mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05:00
Go side: - Log hooks returned by Implemented() - Log each hook name -> ID mapping - Log OnActivate implementation status - Log OnActivate call flow Python side: - Log Implemented() return value - Log OnActivate gRPC receipt and handler invocation This is temporary debug logging to diagnose why OnActivate isn't being called for Python plugins. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
836 lines
35 KiB
Python
836 lines
35 KiB
Python
"""
|
|
@generated by mypy-protobuf. Do not edit manually!
|
|
isort:skip_file
|
|
Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
See LICENSE.txt for license information.
|
|
"""
|
|
|
|
from collections import abc as _abc
|
|
from google.protobuf import descriptor as _descriptor
|
|
from google.protobuf import message as _message
|
|
from google.protobuf.internal import containers as _containers
|
|
import api_remaining_pb2 as _api_remaining_pb2
|
|
import builtins as _builtins
|
|
import common_pb2 as _common_pb2
|
|
import file_pb2 as _file_pb2
|
|
import hooks_common_pb2 as _hooks_common_pb2
|
|
import post_pb2 as _post_pb2
|
|
import sys
|
|
import typing as _typing
|
|
|
|
if sys.version_info >= (3, 10):
|
|
from typing import TypeAlias as _TypeAlias
|
|
else:
|
|
from typing_extensions import TypeAlias as _TypeAlias
|
|
|
|
DESCRIPTOR: _descriptor.FileDescriptor
|
|
|
|
@_typing.final
|
|
class EmailNotificationJson(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
Model Types
|
|
-----------------------------------------------------------------------------
|
|
Note: PushNotification and Preference are defined in api_remaining.proto
|
|
and imported above. This file only defines types specific to message hooks.
|
|
|
|
EmailNotificationJson wraps a serialized model.EmailNotification as JSON bytes.
|
|
EmailNotification is a complex type with embedded struct; we use JSON blob
|
|
approach to avoid maintaining duplicate proto schema.
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
NOTIFICATION_JSON_FIELD_NUMBER: _builtins.int
|
|
notification_json: _builtins.bytes
|
|
"""JSON-encoded model.EmailNotification"""
|
|
def __init__(
|
|
self,
|
|
*,
|
|
notification_json: _builtins.bytes = ...,
|
|
) -> None: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["notification_json", b"notification_json"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___EmailNotificationJson: _TypeAlias = EmailNotificationJson # noqa: Y015
|
|
|
|
@_typing.final
|
|
class EmailNotificationContent(_message.Message):
|
|
"""EmailNotificationContent contains the customizable content of an email notification.
|
|
Maps to model.EmailNotificationContent in Go (server/public/model/email_notification.go).
|
|
This is the return type for EmailNotificationWillBeSent hook.
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
SUBJECT_FIELD_NUMBER: _builtins.int
|
|
TITLE_FIELD_NUMBER: _builtins.int
|
|
SUB_TITLE_FIELD_NUMBER: _builtins.int
|
|
MESSAGE_HTML_FIELD_NUMBER: _builtins.int
|
|
MESSAGE_TEXT_FIELD_NUMBER: _builtins.int
|
|
BUTTON_TEXT_FIELD_NUMBER: _builtins.int
|
|
BUTTON_URL_FIELD_NUMBER: _builtins.int
|
|
FOOTER_TEXT_FIELD_NUMBER: _builtins.int
|
|
subject: _builtins.str
|
|
"""Email subject line"""
|
|
title: _builtins.str
|
|
"""Main title in the email body"""
|
|
sub_title: _builtins.str
|
|
"""Subtitle below the main title"""
|
|
message_html: _builtins.str
|
|
"""HTML-formatted message content"""
|
|
message_text: _builtins.str
|
|
"""Plain text message content (for email clients that don't render HTML)"""
|
|
button_text: _builtins.str
|
|
"""Text for the call-to-action button"""
|
|
button_url: _builtins.str
|
|
"""URL for the call-to-action button"""
|
|
footer_text: _builtins.str
|
|
"""Footer text at the bottom of the email"""
|
|
def __init__(
|
|
self,
|
|
*,
|
|
subject: _builtins.str = ...,
|
|
title: _builtins.str = ...,
|
|
sub_title: _builtins.str = ...,
|
|
message_html: _builtins.str = ...,
|
|
message_text: _builtins.str = ...,
|
|
button_text: _builtins.str = ...,
|
|
button_url: _builtins.str = ...,
|
|
footer_text: _builtins.str = ...,
|
|
) -> None: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["button_text", b"button_text", "button_url", b"button_url", "footer_text", b"footer_text", "message_html", b"message_html", "message_text", b"message_text", "sub_title", b"sub_title", "subject", b"subject", "title", b"title"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___EmailNotificationContent: _TypeAlias = EmailNotificationContent # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageWillBePostedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
MessageWillBePosted Hook
|
|
Signature: MessageWillBePosted(c *Context, post *model.Post) (*model.Post, string)
|
|
Invoked when a message is posted before it is committed to the database.
|
|
Can modify/reject the post.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
POST_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def post(self) -> _post_pb2.Post:
|
|
"""The post about to be created"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
post: _post_pb2.Post | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "post", b"post"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "post", b"post"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessageWillBePostedRequest: _TypeAlias = MessageWillBePostedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageWillBePostedResponse(_message.Message):
|
|
"""Note: No error field - rejection is via rejection_reason string"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
MODIFIED_POST_FIELD_NUMBER: _builtins.int
|
|
REJECTION_REASON_FIELD_NUMBER: _builtins.int
|
|
rejection_reason: _builtins.str
|
|
"""Non-empty string rejects the post with this message shown to user.
|
|
Use "plugin.message_will_be_posted.dismiss_post" to silently dismiss.
|
|
"""
|
|
@_builtins.property
|
|
def modified_post(self) -> _post_pb2.Post:
|
|
"""Modified post to use instead of the original (null to use original unchanged)"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
modified_post: _post_pb2.Post | None = ...,
|
|
rejection_reason: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["modified_post", b"modified_post"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["modified_post", b"modified_post", "rejection_reason", b"rejection_reason"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessageWillBePostedResponse: _TypeAlias = MessageWillBePostedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageWillBeUpdatedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
MessageWillBeUpdated Hook
|
|
Signature: MessageWillBeUpdated(c *Context, newPost, oldPost *model.Post) (*model.Post, string)
|
|
Invoked when a message is updated before it is committed to the database.
|
|
Can modify/reject the update.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
NEW_POST_FIELD_NUMBER: _builtins.int
|
|
OLD_POST_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def new_post(self) -> _post_pb2.Post:
|
|
"""The updated post content"""
|
|
|
|
@_builtins.property
|
|
def old_post(self) -> _post_pb2.Post:
|
|
"""The original post before the update"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
new_post: _post_pb2.Post | None = ...,
|
|
old_post: _post_pb2.Post | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "new_post", b"new_post", "old_post", b"old_post", "plugin_context", b"plugin_context"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "new_post", b"new_post", "old_post", b"old_post", "plugin_context", b"plugin_context"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessageWillBeUpdatedRequest: _TypeAlias = MessageWillBeUpdatedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageWillBeUpdatedResponse(_message.Message):
|
|
"""Note: No error field - rejection is via rejection_reason string"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
MODIFIED_POST_FIELD_NUMBER: _builtins.int
|
|
REJECTION_REASON_FIELD_NUMBER: _builtins.int
|
|
rejection_reason: _builtins.str
|
|
"""Non-empty string rejects the update with this message shown to user.
|
|
The post will remain in its previous state.
|
|
"""
|
|
@_builtins.property
|
|
def modified_post(self) -> _post_pb2.Post:
|
|
"""Modified post to use instead (null to use new_post unchanged)"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
modified_post: _post_pb2.Post | None = ...,
|
|
rejection_reason: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["modified_post", b"modified_post"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["modified_post", b"modified_post", "rejection_reason", b"rejection_reason"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessageWillBeUpdatedResponse: _TypeAlias = MessageWillBeUpdatedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageHasBeenPostedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
MessageHasBeenPosted Hook
|
|
Signature: MessageHasBeenPosted(c *Context, post *model.Post)
|
|
Invoked after the message has been committed to the database.
|
|
Notification only - cannot modify or reject.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
POST_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def post(self) -> _post_pb2.Post:
|
|
"""The post that was created"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
post: _post_pb2.Post | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "post", b"post"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "post", b"post"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessageHasBeenPostedRequest: _TypeAlias = MessageHasBeenPostedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageHasBeenPostedResponse(_message.Message):
|
|
"""No error field because the Go signature has no return value.
|
|
Hook failures are logged but do not affect server operation.
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
def __init__(
|
|
self,
|
|
) -> None: ...
|
|
|
|
Global___MessageHasBeenPostedResponse: _TypeAlias = MessageHasBeenPostedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageHasBeenUpdatedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
MessageHasBeenUpdated Hook
|
|
Signature: MessageHasBeenUpdated(c *Context, newPost, oldPost *model.Post)
|
|
Invoked after the message update has been committed to the database.
|
|
Notification only - cannot modify or reject.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
NEW_POST_FIELD_NUMBER: _builtins.int
|
|
OLD_POST_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def new_post(self) -> _post_pb2.Post:
|
|
"""The post after the update"""
|
|
|
|
@_builtins.property
|
|
def old_post(self) -> _post_pb2.Post:
|
|
"""The post before the update"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
new_post: _post_pb2.Post | None = ...,
|
|
old_post: _post_pb2.Post | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "new_post", b"new_post", "old_post", b"old_post", "plugin_context", b"plugin_context"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "new_post", b"new_post", "old_post", b"old_post", "plugin_context", b"plugin_context"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessageHasBeenUpdatedRequest: _TypeAlias = MessageHasBeenUpdatedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageHasBeenUpdatedResponse(_message.Message):
|
|
"""No error field because the Go signature has no return value.
|
|
Hook failures are logged but do not affect server operation.
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
def __init__(
|
|
self,
|
|
) -> None: ...
|
|
|
|
Global___MessageHasBeenUpdatedResponse: _TypeAlias = MessageHasBeenUpdatedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessagesWillBeConsumedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
MessagesWillBeConsumed Hook
|
|
Signature: MessagesWillBeConsumed(posts []*model.Post) []*model.Post
|
|
Invoked when messages are requested by a client before they are returned.
|
|
Can filter or modify posts before delivery to clients.
|
|
Note: No Context parameter in Go signature.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
POSTS_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def posts(self) -> _containers.RepeatedCompositeFieldContainer[_post_pb2.Post]:
|
|
"""Posts about to be sent to the client"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
posts: _abc.Iterable[_post_pb2.Post] | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "posts", b"posts"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessagesWillBeConsumedRequest: _TypeAlias = MessagesWillBeConsumedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessagesWillBeConsumedResponse(_message.Message):
|
|
"""No error field because the Go signature has no error return value."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
POSTS_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def posts(self) -> _containers.RepeatedCompositeFieldContainer[_post_pb2.Post]:
|
|
"""Modified/filtered posts to return to the client.
|
|
Can remove posts by omitting them, or modify post content.
|
|
"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
posts: _abc.Iterable[_post_pb2.Post] | None = ...,
|
|
) -> None: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["posts", b"posts"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessagesWillBeConsumedResponse: _TypeAlias = MessagesWillBeConsumedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageHasBeenDeletedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
MessageHasBeenDeleted Hook
|
|
Signature: MessageHasBeenDeleted(c *Context, post *model.Post)
|
|
Invoked after the message has been deleted from the database.
|
|
Notification only - cannot undo the deletion.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
POST_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def post(self) -> _post_pb2.Post:
|
|
"""The post that was deleted"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
post: _post_pb2.Post | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "post", b"post"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "post", b"post"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___MessageHasBeenDeletedRequest: _TypeAlias = MessageHasBeenDeletedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class MessageHasBeenDeletedResponse(_message.Message):
|
|
"""No error field because the Go signature has no return value.
|
|
Hook failures are logged but do not affect server operation.
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
def __init__(
|
|
self,
|
|
) -> None: ...
|
|
|
|
Global___MessageHasBeenDeletedResponse: _TypeAlias = MessageHasBeenDeletedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class FileWillBeUploadedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
FileWillBeUploaded Hook
|
|
Signature: FileWillBeUploaded(c *Context, info *model.FileInfo, file io.Reader, output io.Writer) (*model.FileInfo, string)
|
|
Invoked when a file is uploaded before it is committed to storage.
|
|
Can modify/reject the upload.
|
|
|
|
Note: In Phase 8 (streaming), this will be enhanced with proper streaming.
|
|
For now, we use bytes for file content.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
FILE_INFO_FIELD_NUMBER: _builtins.int
|
|
FILE_CONTENT_FIELD_NUMBER: _builtins.int
|
|
file_content: _builtins.bytes
|
|
"""The raw file content (Phase 8 will add streaming support)"""
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def file_info(self) -> _file_pb2.FileInfo:
|
|
"""Metadata about the file being uploaded"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
file_info: _file_pb2.FileInfo | None = ...,
|
|
file_content: _builtins.bytes = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "file_info", b"file_info", "plugin_context", b"plugin_context"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "file_content", b"file_content", "file_info", b"file_info", "plugin_context", b"plugin_context"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___FileWillBeUploadedRequest: _TypeAlias = FileWillBeUploadedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class FileWillBeUploadedResponse(_message.Message):
|
|
"""Note: No error field - rejection is via rejection_reason string"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
MODIFIED_FILE_INFO_FIELD_NUMBER: _builtins.int
|
|
MODIFIED_CONTENT_FIELD_NUMBER: _builtins.int
|
|
REJECTION_REASON_FIELD_NUMBER: _builtins.int
|
|
modified_content: _builtins.bytes
|
|
"""Modified file content (empty to use original unchanged)
|
|
Size will be automatically recalculated if content is modified.
|
|
"""
|
|
rejection_reason: _builtins.str
|
|
"""Non-empty string rejects the upload with this message shown to user."""
|
|
@_builtins.property
|
|
def modified_file_info(self) -> _file_pb2.FileInfo:
|
|
"""Modified file metadata (null to use original unchanged)"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
modified_file_info: _file_pb2.FileInfo | None = ...,
|
|
modified_content: _builtins.bytes = ...,
|
|
rejection_reason: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["modified_file_info", b"modified_file_info"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["modified_content", b"modified_content", "modified_file_info", b"modified_file_info", "rejection_reason", b"rejection_reason"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___FileWillBeUploadedResponse: _TypeAlias = FileWillBeUploadedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class ReactionHasBeenAddedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
ReactionHasBeenAdded Hook
|
|
Signature: ReactionHasBeenAdded(c *Context, reaction *model.Reaction)
|
|
Invoked after a reaction has been committed to the database.
|
|
Notification only.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
REACTION_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def reaction(self) -> _post_pb2.Reaction:
|
|
"""The reaction that was added (defined in post.proto)"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
reaction: _post_pb2.Reaction | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "reaction", b"reaction"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "reaction", b"reaction"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___ReactionHasBeenAddedRequest: _TypeAlias = ReactionHasBeenAddedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class ReactionHasBeenAddedResponse(_message.Message):
|
|
"""No error field because the Go signature has no return value.
|
|
Hook failures are logged but do not affect server operation.
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
def __init__(
|
|
self,
|
|
) -> None: ...
|
|
|
|
Global___ReactionHasBeenAddedResponse: _TypeAlias = ReactionHasBeenAddedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class ReactionHasBeenRemovedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
ReactionHasBeenRemoved Hook
|
|
Signature: ReactionHasBeenRemoved(c *Context, reaction *model.Reaction)
|
|
Invoked after a reaction has been removed from the database.
|
|
Notification only.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
REACTION_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def reaction(self) -> _post_pb2.Reaction:
|
|
"""The reaction that was removed (defined in post.proto)"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
reaction: _post_pb2.Reaction | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "reaction", b"reaction"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "reaction", b"reaction"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___ReactionHasBeenRemovedRequest: _TypeAlias = ReactionHasBeenRemovedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class ReactionHasBeenRemovedResponse(_message.Message):
|
|
"""No error field because the Go signature has no return value.
|
|
Hook failures are logged but do not affect server operation.
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
def __init__(
|
|
self,
|
|
) -> None: ...
|
|
|
|
Global___ReactionHasBeenRemovedResponse: _TypeAlias = ReactionHasBeenRemovedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class NotificationWillBePushedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
NotificationWillBePushed Hook
|
|
Signature: NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string)
|
|
Invoked before a push notification is sent to the push notification server.
|
|
Can modify/reject the notification.
|
|
Note: No Context parameter in Go signature.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PUSH_NOTIFICATION_FIELD_NUMBER: _builtins.int
|
|
USER_ID_FIELD_NUMBER: _builtins.int
|
|
user_id: _builtins.str
|
|
"""The user ID of the notification recipient"""
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def push_notification(self) -> _api_remaining_pb2.PushNotification:
|
|
"""The push notification about to be sent"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
push_notification: _api_remaining_pb2.PushNotification | None = ...,
|
|
user_id: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "push_notification", b"push_notification"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "push_notification", b"push_notification", "user_id", b"user_id"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___NotificationWillBePushedRequest: _TypeAlias = NotificationWillBePushedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class NotificationWillBePushedResponse(_message.Message):
|
|
"""Note: No error field - rejection is via rejection_reason string"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
MODIFIED_NOTIFICATION_FIELD_NUMBER: _builtins.int
|
|
REJECTION_REASON_FIELD_NUMBER: _builtins.int
|
|
rejection_reason: _builtins.str
|
|
"""Non-empty string rejects the notification (it won't be sent)"""
|
|
@_builtins.property
|
|
def modified_notification(self) -> _api_remaining_pb2.PushNotification:
|
|
"""Modified notification to send instead (null to use original unchanged)"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
modified_notification: _api_remaining_pb2.PushNotification | None = ...,
|
|
rejection_reason: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["modified_notification", b"modified_notification"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["modified_notification", b"modified_notification", "rejection_reason", b"rejection_reason"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___NotificationWillBePushedResponse: _TypeAlias = NotificationWillBePushedResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class EmailNotificationWillBeSentRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
EmailNotificationWillBeSent Hook
|
|
Signature: EmailNotificationWillBeSent(emailNotification *model.EmailNotification) (*model.EmailNotificationContent, string)
|
|
Invoked before an email notification is sent.
|
|
Can customize or reject the notification.
|
|
Note: No Context parameter in Go signature.
|
|
Note: EmailNotification input uses JSON blob (complex embedded struct).
|
|
EmailNotificationContent return is typed (simple flat struct).
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
EMAIL_NOTIFICATION_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def email_notification(self) -> Global___EmailNotificationJson:
|
|
"""The email notification as JSON bytes (model.EmailNotification is complex)"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
email_notification: Global___EmailNotificationJson | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "email_notification", b"email_notification"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "email_notification", b"email_notification"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___EmailNotificationWillBeSentRequest: _TypeAlias = EmailNotificationWillBeSentRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class EmailNotificationWillBeSentResponse(_message.Message):
|
|
"""Note: No error field - rejection is via rejection_reason string"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
MODIFIED_CONTENT_FIELD_NUMBER: _builtins.int
|
|
REJECTION_REASON_FIELD_NUMBER: _builtins.int
|
|
rejection_reason: _builtins.str
|
|
"""Non-empty string rejects the email (it won't be sent)"""
|
|
@_builtins.property
|
|
def modified_content(self) -> Global___EmailNotificationContent:
|
|
"""Modified content to use instead (null to use original unchanged)
|
|
Only content fields can be modified; core identifiers are immutable.
|
|
"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
modified_content: Global___EmailNotificationContent | None = ...,
|
|
rejection_reason: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["modified_content", b"modified_content"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["modified_content", b"modified_content", "rejection_reason", b"rejection_reason"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___EmailNotificationWillBeSentResponse: _TypeAlias = EmailNotificationWillBeSentResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class PreferencesHaveChangedRequest(_message.Message):
|
|
"""-----------------------------------------------------------------------------
|
|
PreferencesHaveChanged Hook
|
|
Signature: PreferencesHaveChanged(c *Context, preferences []model.Preference)
|
|
Invoked after one or more of a user's preferences have changed.
|
|
Notification only.
|
|
-----------------------------------------------------------------------------
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PLUGIN_CONTEXT_FIELD_NUMBER: _builtins.int
|
|
PREFERENCES_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def context(self) -> _common_pb2.RequestContext: ...
|
|
@_builtins.property
|
|
def plugin_context(self) -> _hooks_common_pb2.PluginContext:
|
|
"""Plugin context with session/request metadata"""
|
|
|
|
@_builtins.property
|
|
def preferences(self) -> _containers.RepeatedCompositeFieldContainer[_api_remaining_pb2.Preference]:
|
|
"""The preferences that were changed"""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
context: _common_pb2.RequestContext | None = ...,
|
|
plugin_context: _hooks_common_pb2.PluginContext | None = ...,
|
|
preferences: _abc.Iterable[_api_remaining_pb2.Preference] | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["context", b"context", "plugin_context", b"plugin_context", "preferences", b"preferences"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
|
|
Global___PreferencesHaveChangedRequest: _TypeAlias = PreferencesHaveChangedRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class PreferencesHaveChangedResponse(_message.Message):
|
|
"""No error field because the Go signature has no return value.
|
|
Hook failures are logged but do not affect server operation.
|
|
"""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
def __init__(
|
|
self,
|
|
) -> None: ...
|
|
|
|
Global___PreferencesHaveChangedResponse: _TypeAlias = PreferencesHaveChangedResponse # noqa: Y015
|