From 90e5c0bfe2ef3daed068b31559ea6b9f33ea17a6 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Fri, 1 Mar 2024 12:02:06 +0100 Subject: [PATCH 1/2] fix: Add missing MessageTypes and tighten method types Signed-off-by: provokateurin --- lib/Chat/ChatManager.php | 3 +++ lib/Chat/Parser/SystemMessage.php | 6 ++--- lib/Model/Message.php | 13 +++++++++-- lib/Model/ProxyCacheMessages.php | 23 ++++++++++++++++--- lib/ResponseDefinitions.php | 6 +++-- lib/Service/AttachmentService.php | 4 ++++ openapi-backend-sipbridge.json | 19 +++++++++++++-- openapi-federation.json | 19 +++++++++++++-- openapi-full.json | 19 +++++++++++++-- openapi.json | 19 +++++++++++++-- .../openapi/openapi-backend-sipbridge.ts | 6 +++-- src/types/openapi/openapi-federation.ts | 6 +++-- src/types/openapi/openapi-full.ts | 6 +++-- src/types/openapi/openapi.ts | 6 +++-- 14 files changed, 129 insertions(+), 26 deletions(-) diff --git a/lib/Chat/ChatManager.php b/lib/Chat/ChatManager.php index fc145c8858d..a4e7ee63d55 100644 --- a/lib/Chat/ChatManager.php +++ b/lib/Chat/ChatManager.php @@ -84,6 +84,9 @@ class ChatManager { public const VERB_MESSAGE_DELETED = 'comment_deleted'; public const VERB_REACTION = 'reaction'; public const VERB_REACTION_DELETED = 'reaction_deleted'; + public const VERB_VOICE_MESSAGE = 'voice-message'; + public const VERB_RECORD_AUDIO = 'record-audio'; + public const VERB_RECORD_VIDEO = 'record-video'; protected ICache $cache; protected ICache $unreadCountCache; diff --git a/lib/Chat/Parser/SystemMessage.php b/lib/Chat/Parser/SystemMessage.php index d7f48e61106..33a38f0d10c 100644 --- a/lib/Chat/Parser/SystemMessage.php +++ b/lib/Chat/Parser/SystemMessage.php @@ -490,11 +490,11 @@ protected function parseMessage(Message $chatMessage): void { $metaData = $parameters['metaData'] ?? []; if (isset($metaData['messageType'])) { if ($metaData['messageType'] === 'voice-message') { - $chatMessage->setMessageType('voice-message'); + $chatMessage->setMessageType(ChatManager::VERB_VOICE_MESSAGE); } elseif ($metaData['messageType'] === 'record-audio') { - $chatMessage->setMessageType('record-audio'); + $chatMessage->setMessageType(ChatManager::VERB_RECORD_AUDIO); } elseif ($metaData['messageType'] === 'record-video') { - $chatMessage->setMessageType('record-video'); + $chatMessage->setMessageType(ChatManager::VERB_RECORD_VIDEO); } else { $chatMessage->setMessageType(ChatManager::VERB_MESSAGE); } diff --git a/lib/Model/Message.php b/lib/Model/Message.php index fe11403476c..6ee1f6f6473 100644 --- a/lib/Model/Message.php +++ b/lib/Model/Message.php @@ -40,8 +40,11 @@ class Message { /** @var bool */ protected $visible = true; - /** @var string */ - protected $type = ''; + /** + * @var string + * @psalm-var ChatManager::VERB_* + */ + protected $type; /** @var string */ protected $message = ''; @@ -131,10 +134,16 @@ public function getMessageRaw(): string { return $this->rawMessage; } + /** + * @psalm-param ChatManager::VERB_* $type + */ public function setMessageType(string $type): void { $this->type = $type; } + /** + * @return ChatManager::VERB_* $type + */ public function getMessageType(): string { return $this->type; } diff --git a/lib/Model/ProxyCacheMessages.php b/lib/Model/ProxyCacheMessages.php index 9803f3e2b70..320852dfa44 100644 --- a/lib/Model/ProxyCacheMessages.php +++ b/lib/Model/ProxyCacheMessages.php @@ -26,6 +26,7 @@ namespace OCA\Talk\Model; +use OCA\Talk\Chat\ChatManager; use OCA\Talk\ResponseDefinitions; use OCP\AppFramework\Db\Entity; @@ -44,8 +45,6 @@ * @method string getActorId() * @method void setActorDisplayName(string $actorDisplayName) * @method string getActorDisplayName() - * @method void setMessageType(string $messageType) - * @method string getMessageType() * @method void setSystemMessage(?string $systemMessage) * @method string|null getSystemMessage() * @method void setExpirationDatetime(?\DateTimeImmutable $expirationDatetime) @@ -66,7 +65,11 @@ class ProxyCacheMessages extends Entity implements \JsonSerializable { protected string $actorType = ''; protected string $actorId = ''; protected ?string $actorDisplayName = null; - protected ?string $messageType = null; + /** + * @var string + * @psalm-var ChatManager::VERB_* + */ + protected string $messageType; protected ?string $systemMessage = null; protected ?\DateTimeImmutable $expirationDatetime = null; protected ?string $message = null; @@ -87,6 +90,20 @@ public function __construct() { $this->addType('messageParameters', 'string'); } + /** + * @psalm-param ChatManager::VERB_* $type + */ + public function setMessageType(string $type): void { + $this->messageType = $type; + } + + /** + * @return ChatManager::VERB_* $type + */ + public function getMessageType(): string { + return $this->messageType; + } + /** * @return TalkRoomProxyMessage */ diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 1f257d8224b..79797110bf3 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -67,6 +67,8 @@ * statusMessage: ?string, * } * + * @psalm-type TalkMessageType = 'command'|'comment'|'comment_deleted'|'object_shared'|'reaction'|'reaction_deleted'|'record-audio'|'record-video'|'system'|'voice-message' + * * @psalm-type TalkChatMessage = array{ * actorDisplayName: string, * actorId: string, @@ -78,7 +80,7 @@ * markdown: bool, * message: string, * messageParameters: array>, - * messageType: string, + * messageType: TalkMessageType, * reactions: array|\stdClass, * referenceId: string, * systemMessage: string, @@ -98,7 +100,7 @@ * expirationTimestamp: int, * message: string, * messageParameters: array>, - * messageType: string, + * messageType: TalkMessageType, * systemMessage: string, * } * diff --git a/lib/Service/AttachmentService.php b/lib/Service/AttachmentService.php index 0a935d7914b..68c4390805c 100644 --- a/lib/Service/AttachmentService.php +++ b/lib/Service/AttachmentService.php @@ -26,6 +26,7 @@ namespace OCA\Talk\Service; +use OCA\Talk\Chat\ChatManager; use OCA\Talk\Model\Attachment; use OCA\Talk\Model\AttachmentMapper; use OCA\Talk\Room; @@ -38,6 +39,9 @@ public function __construct( ) { } + /** + * @param ChatManager::VERB_* $messageType + */ public function createAttachmentEntry(Room $room, IComment $comment, string $messageType, array $parameters): void { $attachment = new Attachment(); $attachment->setRoomId($room->getId()); diff --git a/openapi-backend-sipbridge.json b/openapi-backend-sipbridge.json index 04f1ce51023..7930d2d4aa4 100644 --- a/openapi-backend-sipbridge.json +++ b/openapi-backend-sipbridge.json @@ -246,7 +246,7 @@ } }, "messageType": { - "type": "string" + "$ref": "#/components/schemas/MessageType" }, "reactions": { "type": "object", @@ -286,6 +286,21 @@ } } }, + "MessageType": { + "type": "string", + "enum": [ + "command", + "comment", + "comment_deleted", + "object_shared", + "reaction", + "reaction_deleted", + "record-audio", + "record-video", + "system", + "voice-message" + ] + }, "OCSMeta": { "type": "object", "required": [ @@ -638,7 +653,7 @@ } }, "messageType": { - "type": "string" + "$ref": "#/components/schemas/MessageType" }, "systemMessage": { "type": "string" diff --git a/openapi-federation.json b/openapi-federation.json index 94f1cc13e13..33c6d5ab033 100644 --- a/openapi-federation.json +++ b/openapi-federation.json @@ -246,7 +246,7 @@ } }, "messageType": { - "type": "string" + "$ref": "#/components/schemas/MessageType" }, "reactions": { "type": "object", @@ -345,6 +345,21 @@ } } }, + "MessageType": { + "type": "string", + "enum": [ + "command", + "comment", + "comment_deleted", + "object_shared", + "reaction", + "reaction_deleted", + "record-audio", + "record-video", + "system", + "voice-message" + ] + }, "OCSMeta": { "type": "object", "required": [ @@ -697,7 +712,7 @@ } }, "messageType": { - "type": "string" + "$ref": "#/components/schemas/MessageType" }, "systemMessage": { "type": "string" diff --git a/openapi-full.json b/openapi-full.json index 79512b6a4e8..fefb1479618 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -407,7 +407,7 @@ } }, "messageType": { - "type": "string" + "$ref": "#/components/schemas/MessageType" }, "reactions": { "type": "object", @@ -600,6 +600,21 @@ } ] }, + "MessageType": { + "type": "string", + "enum": [ + "command", + "comment", + "comment_deleted", + "object_shared", + "reaction", + "reaction_deleted", + "record-audio", + "record-video", + "system", + "voice-message" + ] + }, "OCSMeta": { "type": "object", "required": [ @@ -1162,7 +1177,7 @@ } }, "messageType": { - "type": "string" + "$ref": "#/components/schemas/MessageType" }, "systemMessage": { "type": "string" diff --git a/openapi.json b/openapi.json index 93b882007eb..ec144d48db0 100644 --- a/openapi.json +++ b/openapi.json @@ -348,7 +348,7 @@ } }, "messageType": { - "type": "string" + "$ref": "#/components/schemas/MessageType" }, "reactions": { "type": "object", @@ -482,6 +482,21 @@ } ] }, + "MessageType": { + "type": "string", + "enum": [ + "command", + "comment", + "comment_deleted", + "object_shared", + "reaction", + "reaction_deleted", + "record-audio", + "record-video", + "system", + "voice-message" + ] + }, "OCSMeta": { "type": "object", "required": [ @@ -1044,7 +1059,7 @@ } }, "messageType": { - "type": "string" + "$ref": "#/components/schemas/MessageType" }, "systemMessage": { "type": "string" diff --git a/src/types/openapi/openapi-backend-sipbridge.ts b/src/types/openapi/openapi-backend-sipbridge.ts index bbdf239a724..fa76de64a99 100644 --- a/src/types/openapi/openapi-backend-sipbridge.ts +++ b/src/types/openapi/openapi-backend-sipbridge.ts @@ -102,7 +102,7 @@ export type components = { [key: string]: Record; }; }; - messageType: string; + messageType: components["schemas"]["MessageType"]; reactions: { [key: string]: number; }; @@ -118,6 +118,8 @@ export type components = { lastEditTimestamp?: number; silent?: boolean; }; + /** @enum {string} */ + MessageType: "command" | "comment" | "comment_deleted" | "object_shared" | "reaction" | "reaction_deleted" | "record-audio" | "record-video" | "system" | "voice-message"; OCSMeta: { status: string; statuscode: number; @@ -226,7 +228,7 @@ export type components = { [key: string]: Record; }; }; - messageType: string; + messageType: components["schemas"]["MessageType"]; systemMessage: string; }; }; diff --git a/src/types/openapi/openapi-federation.ts b/src/types/openapi/openapi-federation.ts index c34cbe8f98b..5c27c9a577a 100644 --- a/src/types/openapi/openapi-federation.ts +++ b/src/types/openapi/openapi-federation.ts @@ -97,7 +97,7 @@ export type components = { [key: string]: Record; }; }; - messageType: string; + messageType: components["schemas"]["MessageType"]; reactions: { [key: string]: number; }; @@ -131,6 +131,8 @@ export type components = { inviterCloudId: string; inviterDisplayName: string; }; + /** @enum {string} */ + MessageType: "command" | "comment" | "comment_deleted" | "object_shared" | "reaction" | "reaction_deleted" | "record-audio" | "record-video" | "system" | "voice-message"; OCSMeta: { status: string; statuscode: number; @@ -239,7 +241,7 @@ export type components = { [key: string]: Record; }; }; - messageType: string; + messageType: components["schemas"]["MessageType"]; systemMessage: string; }; }; diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 711bce6fba2..471a0a0c1cf 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -613,7 +613,7 @@ export type components = { [key: string]: Record; }; }; - messageType: string; + messageType: components["schemas"]["MessageType"]; reactions: { [key: string]: number; }; @@ -672,6 +672,8 @@ export type components = { running: boolean; }; MatterbridgeWithProcessState: components["schemas"]["Matterbridge"] & components["schemas"]["MatterbridgeProcessState"]; + /** @enum {string} */ + MessageType: "command" | "comment" | "comment_deleted" | "object_shared" | "reaction" | "reaction_deleted" | "record-audio" | "record-video" | "system" | "voice-message"; OCSMeta: { status: string; statuscode: number; @@ -843,7 +845,7 @@ export type components = { [key: string]: Record; }; }; - messageType: string; + messageType: components["schemas"]["MessageType"]; systemMessage: string; }; SignalingSession: { diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 98e6ce34317..5a444b33e0d 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -472,7 +472,7 @@ export type components = { [key: string]: Record; }; }; - messageType: string; + messageType: components["schemas"]["MessageType"]; reactions: { [key: string]: number; }; @@ -513,6 +513,8 @@ export type components = { running: boolean; }; MatterbridgeWithProcessState: components["schemas"]["Matterbridge"] & components["schemas"]["MatterbridgeProcessState"]; + /** @enum {string} */ + MessageType: "command" | "comment" | "comment_deleted" | "object_shared" | "reaction" | "reaction_deleted" | "record-audio" | "record-video" | "system" | "voice-message"; OCSMeta: { status: string; statuscode: number; @@ -684,7 +686,7 @@ export type components = { [key: string]: Record; }; }; - messageType: string; + messageType: components["schemas"]["MessageType"]; systemMessage: string; }; SignalingSession: { From 616b3a1e8d67325c2adecd73846c330b7151f64e Mon Sep 17 00:00:00 2001 From: provokateurin Date: Fri, 1 Mar 2024 12:19:36 +0100 Subject: [PATCH 2/2] refactor: Tighten ActorType fields and methods Signed-off-by: provokateurin --- lib/Chat/ChatManager.php | 1 + lib/Chat/CommentsManager.php | 4 +- lib/Chat/MessageParser.php | 3 ++ lib/Chat/Parser/SystemMessage.php | 3 ++ lib/Chat/ReactionManager.php | 9 ++-- lib/Listener/DisplayNameListener.php | 3 ++ lib/Manager.php | 2 +- lib/Model/Attachment.php | 21 ++++++++-- lib/Model/Attendee.php | 21 ++++++++-- lib/Model/AttendeeMapper.php | 2 +- lib/Model/Consent.php | 21 ++++++++-- lib/Model/ConsentMapper.php | 5 +++ lib/Model/Message.php | 13 +++++- lib/Model/Poll.php | 21 ++++++++-- lib/Model/ProxyCacheMessages.php | 21 ++++++++-- lib/Model/Vote.php | 21 ++++++++-- lib/Model/VoteMapper.php | 5 ++- lib/ResponseDefinitions.php | 18 ++++---- lib/Service/BreakoutRoomService.php | 2 +- lib/Service/ConsentService.php | 3 ++ lib/Service/ParticipantService.php | 1 + lib/Service/PollService.php | 4 ++ openapi-backend-sipbridge.json | 31 ++++++++++++-- openapi-federation.json | 31 ++++++++++++-- openapi-full.json | 41 +++++++++++++++---- openapi.json | 41 +++++++++++++++---- .../openapi/openapi-backend-sipbridge.ts | 8 ++-- src/types/openapi/openapi-federation.ts | 8 ++-- src/types/openapi/openapi-full.ts | 18 ++++---- src/types/openapi/openapi.ts | 18 ++++---- 30 files changed, 320 insertions(+), 80 deletions(-) diff --git a/lib/Chat/ChatManager.php b/lib/Chat/ChatManager.php index a4e7ee63d55..a43712a88dc 100644 --- a/lib/Chat/ChatManager.php +++ b/lib/Chat/ChatManager.php @@ -116,6 +116,7 @@ public function __construct( /** * Sends a new message to the given chat. * + * @psalm-param Attendee::ACTOR_* $actorType * @param bool $shouldSkipLastMessageUpdate If multiple messages will be posted * (e.g. when adding multiple users to a room) we can skip the last * message and last activity update until the last entry was created diff --git a/lib/Chat/CommentsManager.php b/lib/Chat/CommentsManager.php index 4080632d5b3..c79b4822828 100644 --- a/lib/Chat/CommentsManager.php +++ b/lib/Chat/CommentsManager.php @@ -25,6 +25,7 @@ use OC\Comments\Comment; use OC\Comments\Manager; +use OCA\Talk\Model\Attendee; use OCP\Comments\IComment; use OCP\DB\Exception; use OCP\DB\QueryBuilder\IQueryBuilder; @@ -66,7 +67,7 @@ public function getCommentsById(array $ids): array { } /** - * @param string $actorType + * @psalm-param Attendee::ACTOR_* $actorType * @param string $actorId * @param string[] $messageIds * @return array @@ -100,6 +101,7 @@ public function retrieveReactionsByActor(string $actorType, string $actorId, arr * @param string $objectType Limit the search by object type * @param string[] $objectIds Limit the search by object ids * @param string $verb Limit the verb of the comment + * @psalm-param ?Attendee::ACTOR_* $actorType * @return list */ public function searchForObjectsWithFilters(string $search, string $objectType, array $objectIds, string $verb, ?\DateTimeImmutable $since, ?\DateTimeImmutable $until, ?string $actorType, ?string $actorId, int $offset, int $limit = 50): array { diff --git a/lib/Chat/MessageParser.php b/lib/Chat/MessageParser.php index 77e42316a9b..9d539d4adb6 100644 --- a/lib/Chat/MessageParser.php +++ b/lib/Chat/MessageParser.php @@ -112,6 +112,9 @@ protected function setLastEditInfo(Message $message): void { } } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ protected function getActorInformation(Message $message, string $actorType, string $actorId, string $displayName = ''): array { if ($actorType === Attendee::ACTOR_USERS) { $tempDisplayName = $this->userManager->getDisplayName($actorId); diff --git a/lib/Chat/Parser/SystemMessage.php b/lib/Chat/Parser/SystemMessage.php index 33a38f0d10c..869fc406353 100644 --- a/lib/Chat/Parser/SystemMessage.php +++ b/lib/Chat/Parser/SystemMessage.php @@ -843,6 +843,9 @@ protected function getActorFromComment(Room $room, IComment $comment): array { return $this->getActor($room, $comment->getActorType(), $comment->getActorId()); } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ protected function getActor(Room $room, string $actorType, string $actorId): array { if ($actorType === Attendee::ACTOR_GUESTS || $actorType === Attendee::ACTOR_EMAILS) { return $this->getGuest($room, $actorType, $actorId); diff --git a/lib/Chat/ReactionManager.php b/lib/Chat/ReactionManager.php index b1f174b6e8e..c439f82e4e3 100644 --- a/lib/Chat/ReactionManager.php +++ b/lib/Chat/ReactionManager.php @@ -28,6 +28,7 @@ use OCA\Talk\Exceptions\ReactionAlreadyExistsException; use OCA\Talk\Exceptions\ReactionNotSupportedException; use OCA\Talk\Exceptions\ReactionOutOfContextException; +use OCA\Talk\Model\Attendee; use OCA\Talk\Participant; use OCA\Talk\ResponseDefinitions; use OCA\Talk\Room; @@ -56,7 +57,7 @@ public function __construct( * Add reaction * * @param Room $chat - * @param string $actorType + * @psalm-param Attendee::ACTOR_* $actorType * @param string $actorId * @param integer $messageId * @param string $reaction @@ -99,7 +100,7 @@ public function addReactionMessage(Room $chat, string $actorType, string $actorI * Delete reaction * * @param Room $chat - * @param string $actorType + * @psalm-param Attendee::ACTOR_* $actorType * @param string $actorId * @param integer $messageId * @param string $reaction @@ -159,8 +160,10 @@ public function retrieveReactionMessages(Room $chat, Participant $participant, i $message = $this->messageParser->createMessage($chat, $participant, $comment, $this->l); $this->messageParser->parseMessage($message); + /** @var Attendee::ACTOR_* $actorType */ + $actorType = $comment->getActorType(); $reactions[$comment->getMessage()][] = [ - 'actorType' => $comment->getActorType(), + 'actorType' => $actorType, 'actorId' => $comment->getActorId(), 'actorDisplayName' => $message->getActorDisplayName(), 'timestamp' => $comment->getCreationDateTime()->getTimestamp(), diff --git a/lib/Listener/DisplayNameListener.php b/lib/Listener/DisplayNameListener.php index 4ab79cb5359..67fa61fee76 100644 --- a/lib/Listener/DisplayNameListener.php +++ b/lib/Listener/DisplayNameListener.php @@ -51,6 +51,9 @@ public function handle(Event $event): void { } } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ protected function updateCachedName(string $actorType, string $actorId, string $newName): void { $this->participantService->updateDisplayNameForActor( $actorType, diff --git a/lib/Manager.php b/lib/Manager.php index a3ff4435722..8291e41e242 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -318,7 +318,7 @@ public function getRoomsForUser(string $userId, array $sessionIds = [], bool $in } /** - * @param string $actorType + * @psalm-param Attendee::ACTOR_* $actorType * @param string $actorId * @param array $sessionIds A list of talk sessions to consider for loading (otherwise no session is loaded) * @param bool $includeLastMessage diff --git a/lib/Model/Attachment.php b/lib/Model/Attachment.php index 91aaf2fa24f..04b2fde9d2a 100644 --- a/lib/Model/Attachment.php +++ b/lib/Model/Attachment.php @@ -34,8 +34,6 @@ * @method int getMessageTime() * @method void setObjectType(string $objectType) * @method string getObjectType() - * @method void setActorType(string $actorType) - * @method string getActorType() * @method void setActorId(string $actorId) * @method string getActorId() */ @@ -62,7 +60,10 @@ class Attachment extends Entity { /** @var string */ protected $objectType; - /** @var string */ + /** + * @var string + * @psalm-var Attendee::ACTOR_* + */ protected $actorType; /** @var string */ @@ -77,6 +78,20 @@ public function __construct() { $this->addType('actorId', 'string'); } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ + public function setActorType(string $actorType): void { + $this->actorType = $actorType; + } + + /** + * @psalm-return Attendee::ACTOR_* + */ + public function getActorType(): string { + return $this->actorType; + } + /** * @return array */ diff --git a/lib/Model/Attendee.php b/lib/Model/Attendee.php index 8d7ed05788f..f81de9461f7 100644 --- a/lib/Model/Attendee.php +++ b/lib/Model/Attendee.php @@ -28,8 +28,6 @@ /** * @method void setRoomId(int $roomId) * @method int getRoomId() - * @method void setActorType(string $actorType) - * @method string getActorType() * @method void setActorId(string $actorId) * @method string getActorId() * @method void setDisplayName(string $displayName) @@ -111,7 +109,10 @@ class Attendee extends Entity { /** @var int */ protected $roomId; - /** @var string */ + /** + * @var string + * @psalm-var Attendee::ACTOR_* + */ protected $actorType; /** @var string */ @@ -191,6 +192,20 @@ public function __construct() { $this->addType('callId', 'string'); } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ + public function setActorType(string $actorType): void { + $this->actorType = $actorType; + } + + /** + * @psalm-return Attendee::ACTOR_* + */ + public function getActorType(): string { + return $this->actorType; + } + public function getDisplayName(): string { return (string) $this->displayName; } diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php index 268f5eab9f6..3a30714c383 100644 --- a/lib/Model/AttendeeMapper.php +++ b/lib/Model/AttendeeMapper.php @@ -46,7 +46,7 @@ public function __construct(IDBConnection $db) { /** * @param int $roomId - * @param string $actorType + * @psalm-param Attendee::ACTOR_* $actorType * @param string $actorId * @return Attendee * @throws DoesNotExistException diff --git a/lib/Model/Consent.php b/lib/Model/Consent.php index eef91bceac9..29b5bb45a30 100644 --- a/lib/Model/Consent.php +++ b/lib/Model/Consent.php @@ -30,8 +30,6 @@ /** * @method void setToken(string $token) * @method string getToken() - * @method void setActorType(string $actorType) - * @method string getActorType() * @method void setActorId(string $actorId) * @method string getActorId() * @method void setDateTime(\DateTime $dateTime) @@ -39,7 +37,10 @@ */ class Consent extends Entity implements \JsonSerializable { protected string $token = ''; - protected string $actorType = ''; + /** + * @psalm-var Attendee::ACTOR_* + */ + protected string $actorType; protected string $actorId = ''; protected ?\DateTime $dateTime = null; @@ -50,6 +51,20 @@ public function __construct() { $this->addType('dateTime', 'datetime'); } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ + public function setActorType(string $actorType): void { + $this->actorType = $actorType; + } + + /** + * @psalm-return Attendee::ACTOR_* + */ + public function getActorType(): string { + return $this->actorType; + } + public function jsonSerialize(): array { return [ 'token' => $this->getToken(), diff --git a/lib/Model/ConsentMapper.php b/lib/Model/ConsentMapper.php index 7f9f134cabd..863a9b3db3c 100644 --- a/lib/Model/ConsentMapper.php +++ b/lib/Model/ConsentMapper.php @@ -63,6 +63,7 @@ public function deleteByToken(string $token): int { } /** + * @psalm-param Attendee::ACTOR_* $actorType * @return Consent[] */ public function findForActor(string $actorType, string $actorId): array { @@ -75,6 +76,9 @@ public function findForActor(string $actorType, string $actorId): array { return $this->findEntities($query); } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ public function deleteByActor(string $actorType, string $actorId): int { $query = $this->db->getQueryBuilder(); $query->delete($this->getTableName()) @@ -85,6 +89,7 @@ public function deleteByActor(string $actorType, string $actorId): int { } /** + * @psalm-param Attendee::ACTOR_* $actorType * @return Consent[] */ public function findForTokenByActor(string $token, string $actorType, string $actorId): array { diff --git a/lib/Model/Message.php b/lib/Model/Message.php index 6ee1f6f6473..c06ef07d8de 100644 --- a/lib/Model/Message.php +++ b/lib/Model/Message.php @@ -55,8 +55,11 @@ class Message { /** @var array */ protected $parameters = []; - /** @var string */ - protected $actorType = ''; + /** + * @var string + * @psalm-var Attendee::ACTOR_* + */ + protected $actorType; /** @var string */ protected $actorId = ''; @@ -148,6 +151,9 @@ public function getMessageType(): string { return $this->type; } + /** + * @psalm-param Attendee::ACTOR_* $type + */ public function setActor(string $type, string $id, string $displayName): void { $this->actorType = $type; $this->actorId = $id; @@ -161,6 +167,9 @@ public function setLastEdit(string $type, string $id, string $displayName, int $ $this->lastEditTimestamp = $timestamp; } + /** + * @psalm-return Attendee::ACTOR_* + */ public function getActorType(): string { return $this->actorType; } diff --git a/lib/Model/Poll.php b/lib/Model/Poll.php index c4a1689a004..05f47fbffcc 100644 --- a/lib/Model/Poll.php +++ b/lib/Model/Poll.php @@ -40,8 +40,6 @@ * @method string getVotes() * @method void setNumVoters(int $numVoters) * @method int getNumVoters() - * @method void setActorType(string $actorType) - * @method string getActorType() * @method void setActorId(string $actorId) * @method string getActorId() * @method void setDisplayName(string $displayName) @@ -67,7 +65,10 @@ class Poll extends Entity { protected string $options = ''; protected string $votes = ''; protected int $numVoters = 0; - protected string $actorType = ''; + /** + * @psalm-var Attendee::ACTOR_* + */ + protected string $actorType; protected string $actorId = ''; protected ?string $displayName = null; protected int $status = self::STATUS_OPEN; @@ -88,6 +89,20 @@ public function __construct() { $this->addType('maxVotes', 'int'); } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ + public function setActorType(string $actorType): void { + $this->actorType = $actorType; + } + + /** + * @psalm-return Attendee::ACTOR_* + */ + public function getActorType(): string { + return $this->actorType; + } + /** * @return TalkPoll */ diff --git a/lib/Model/ProxyCacheMessages.php b/lib/Model/ProxyCacheMessages.php index 320852dfa44..47049fa8910 100644 --- a/lib/Model/ProxyCacheMessages.php +++ b/lib/Model/ProxyCacheMessages.php @@ -39,8 +39,6 @@ * @method string getRemoteToken() * @method void setRemoteMessageId(int $remoteMessageId) * @method int getRemoteMessageId() - * @method void setActorType(string $actorType) - * @method string getActorType() * @method void setActorId(string $actorId) * @method string getActorId() * @method void setActorDisplayName(string $actorDisplayName) @@ -62,7 +60,10 @@ class ProxyCacheMessages extends Entity implements \JsonSerializable { protected string $remoteServerUrl = ''; protected string $remoteToken = ''; protected int $remoteMessageId = 0; - protected string $actorType = ''; + /** + * @psalm-var Attendee::ACTOR_* + */ + protected string $actorType; protected string $actorId = ''; protected ?string $actorDisplayName = null; /** @@ -104,6 +105,20 @@ public function getMessageType(): string { return $this->messageType; } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ + public function setActorType(string $actorType): void { + $this->actorType = $actorType; + } + + /** + * @psalm-return Attendee::ACTOR_* + */ + public function getActorType(): string { + return $this->actorType; + } + /** * @return TalkRoomProxyMessage */ diff --git a/lib/Model/Vote.php b/lib/Model/Vote.php index d2c48480a76..da3e9f5979a 100644 --- a/lib/Model/Vote.php +++ b/lib/Model/Vote.php @@ -35,8 +35,6 @@ * @method int getPollId() * @method void setRoomId(int $roomId) * @method int getRoomId() - * @method void setActorType(string $actorType) - * @method string getActorType() * @method void setActorId(string $actorId) * @method string getActorId() * @method void setDisplayName(string $displayName) @@ -49,7 +47,10 @@ class Vote extends Entity { protected int $pollId = 0; protected int $roomId = 0; - protected string $actorType = ''; + /** + * @psalm-var Attendee::ACTOR_* + */ + protected string $actorType; protected string $actorId = ''; protected ?string $displayName = null; protected ?int $optionId = null; @@ -63,6 +64,20 @@ public function __construct() { $this->addType('optionId', 'int'); } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ + public function setActorType(string $actorType): void { + $this->actorType = $actorType; + } + + /** + * @psalm-return Attendee::ACTOR_* + */ + public function getActorType(): string { + return $this->actorType; + } + /** * @return TalkPollVote */ diff --git a/lib/Model/VoteMapper.php b/lib/Model/VoteMapper.php index cc76c381db7..7eb3396ef91 100644 --- a/lib/Model/VoteMapper.php +++ b/lib/Model/VoteMapper.php @@ -56,7 +56,7 @@ public function findByPollId(int $pollId): array { /** * @param int $pollId - * @param string $actorType + * @psalm-param Attendee::ACTOR_* $actorType * @param string $actorId * @return Vote[] */ @@ -89,6 +89,9 @@ public function deleteByPollId(int $pollId): void { $query->executeStatement(); } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ public function deleteVotesByActor(int $pollId, string $actorType, string $actorId): void { $query = $this->db->getQueryBuilder(); diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 79797110bf3..dda5dd85b3b 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -47,9 +47,11 @@ * secret: string, * } * + * @psalm-type TalkActorType = 'bot-'|'bots'|'bridged'|'changelog'|'circles'|'cli'|'emails'|'federated_users'|'groups'|'guests'|'phones'|'system'|'users' + * * @psalm-type TalkCallPeer = array{ * actorId: string, - * actorType: string, + * actorType: TalkActorType, * displayName: string, * lastPing: int, * sessionId: string, @@ -72,7 +74,7 @@ * @psalm-type TalkChatMessage = array{ * actorDisplayName: string, * actorId: string, - * actorType: string, + * actorType: TalkActorType, * deleted?: true, * expirationTimestamp: int, * id: int, @@ -96,7 +98,7 @@ * @psalm-type TalkRoomProxyMessage = array{ * actorDisplayName: string, * actorId: string, - * actorType: string, + * actorType: TalkActorType, * expirationTimestamp: int, * message: string, * messageParameters: array>, @@ -147,7 +149,7 @@ * * @psalm-type TalkParticipant = array{ * actorId: string, - * actorType: string, + * actorType: TalkActorType, * attendeeId: int, * attendeePermissions: int, * attendeePin: string, @@ -169,14 +171,14 @@ * @psalm-type TalkPollVote = array{ * actorDisplayName: string, * actorId: string, - * actorType: string, + * actorType: TalkActorType, * optionId: int, * } * * @psalm-type TalkPoll = array{ * actorDisplayName: string, * actorId: string, - * actorType: string, + * actorType: TalkActorType, * details?: TalkPollVote[], * id: int, * maxVotes: int, @@ -192,13 +194,13 @@ * @psalm-type TalkReaction = array{ * actorDisplayName: string, * actorId: string, - * actorType: string, + * actorType: TalkActorType, * timestamp: int, * } * * @psalm-type TalkRoom = array{ * actorId: string, - * actorType: string, + * actorType: TalkActorType|'', * attendeeId: int, * attendeePermissions: int, * attendeePin: ?string, diff --git a/lib/Service/BreakoutRoomService.php b/lib/Service/BreakoutRoomService.php index 238b6120313..5cb2d363ebb 100644 --- a/lib/Service/BreakoutRoomService.php +++ b/lib/Service/BreakoutRoomService.php @@ -556,7 +556,7 @@ public function getBreakoutRooms(Room $parent, Participant $participant): array /** * @param Room $parent - * @param string $actorType + * @psalm-param Attendee::ACTOR_* $actorType * @param string $actorId * @param bool $throwOnModerator * @return void diff --git a/lib/Service/ConsentService.php b/lib/Service/ConsentService.php index 4d4f8a50ba6..61309ee5bc2 100644 --- a/lib/Service/ConsentService.php +++ b/lib/Service/ConsentService.php @@ -39,6 +39,9 @@ public function __construct( ) { } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ public function storeConsent(Room $room, string $actorType, string $actorId): Consent { $consent = new Consent(); $consent->setToken($room->getToken()); diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index 7ea81e69c7e..d6bac38f61a 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -364,6 +364,7 @@ public function joinRoom(RoomService $roomService, Room $room, IUser $user, stri } /** + * @psalm-param Attendee::ACTOR_* $actorType * @throws UnauthorizedException */ public function joinRoomAsFederatedUser(Room $room, string $actorType, string $actorId): Participant { diff --git a/lib/Service/PollService.php b/lib/Service/PollService.php index b4eaab223ad..8031c460467 100644 --- a/lib/Service/PollService.php +++ b/lib/Service/PollService.php @@ -26,6 +26,7 @@ namespace OCA\Talk\Service; use OCA\Talk\Exceptions\WrongPermissionsException; +use OCA\Talk\Model\Attendee; use OCA\Talk\Model\Poll; use OCA\Talk\Model\PollMapper; use OCA\Talk\Model\Vote; @@ -46,6 +47,9 @@ public function __construct( ) { } + /** + * @psalm-param Attendee::ACTOR_* $actorType + */ public function createPoll(int $roomId, string $actorType, string $actorId, string $displayName, string $question, array $options, int $resultMode, int $maxVotes): Poll { $question = trim($question); diff --git a/openapi-backend-sipbridge.json b/openapi-backend-sipbridge.json index 7930d2d4aa4..1f613f4c442 100644 --- a/openapi-backend-sipbridge.json +++ b/openapi-backend-sipbridge.json @@ -20,6 +20,24 @@ } }, "schemas": { + "ActorType": { + "type": "string", + "enum": [ + "bot-", + "bots", + "bridged", + "changelog", + "circles", + "cli", + "emails", + "federated_users", + "groups", + "guests", + "phones", + "system", + "users" + ] + }, "Capabilities": { "type": "object", "required": [ @@ -211,7 +229,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "deleted": { "type": "boolean", @@ -403,7 +421,14 @@ "type": "string" }, "actorType": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/ActorType" + }, + { + "type": "string" + } + ] }, "attendeeId": { "type": "integer", @@ -634,7 +659,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "expirationTimestamp": { "type": "integer", diff --git a/openapi-federation.json b/openapi-federation.json index 33c6d5ab033..18eaaa65f82 100644 --- a/openapi-federation.json +++ b/openapi-federation.json @@ -20,6 +20,24 @@ } }, "schemas": { + "ActorType": { + "type": "string", + "enum": [ + "bot-", + "bots", + "bridged", + "changelog", + "circles", + "cli", + "emails", + "federated_users", + "groups", + "guests", + "phones", + "system", + "users" + ] + }, "Capabilities": { "type": "object", "required": [ @@ -211,7 +229,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "deleted": { "type": "boolean", @@ -462,7 +480,14 @@ "type": "string" }, "actorType": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/ActorType" + }, + { + "type": "string" + } + ] }, "attendeeId": { "type": "integer", @@ -693,7 +718,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "expirationTimestamp": { "type": "integer", diff --git a/openapi-full.json b/openapi-full.json index fefb1479618..3834a923a69 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -20,6 +20,24 @@ } }, "schemas": { + "ActorType": { + "type": "string", + "enum": [ + "bot-", + "bots", + "bridged", + "changelog", + "circles", + "cli", + "emails", + "federated_users", + "groups", + "guests", + "phones", + "system", + "users" + ] + }, "Bot": { "type": "object", "required": [ @@ -120,7 +138,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "displayName": { "type": "string" @@ -372,7 +390,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "deleted": { "type": "boolean", @@ -660,7 +678,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "attendeeId": { "type": "integer", @@ -748,7 +766,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "details": { "type": "array", @@ -817,7 +835,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "optionId": { "type": "integer", @@ -860,7 +878,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "timestamp": { "type": "integer", @@ -927,7 +945,14 @@ "type": "string" }, "actorType": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/ActorType" + }, + { + "type": "string" + } + ] }, "attendeeId": { "type": "integer", @@ -1158,7 +1183,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "expirationTimestamp": { "type": "integer", diff --git a/openapi.json b/openapi.json index ec144d48db0..cf5831f7055 100644 --- a/openapi.json +++ b/openapi.json @@ -20,6 +20,24 @@ } }, "schemas": { + "ActorType": { + "type": "string", + "enum": [ + "bot-", + "bots", + "bridged", + "changelog", + "circles", + "cli", + "emails", + "federated_users", + "groups", + "guests", + "phones", + "system", + "users" + ] + }, "Bot": { "type": "object", "required": [ @@ -61,7 +79,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "displayName": { "type": "string" @@ -313,7 +331,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "deleted": { "type": "boolean", @@ -542,7 +560,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "attendeeId": { "type": "integer", @@ -630,7 +648,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "details": { "type": "array", @@ -699,7 +717,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "optionId": { "type": "integer", @@ -742,7 +760,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "timestamp": { "type": "integer", @@ -809,7 +827,14 @@ "type": "string" }, "actorType": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/ActorType" + }, + { + "type": "string" + } + ] }, "attendeeId": { "type": "integer", @@ -1040,7 +1065,7 @@ "type": "string" }, "actorType": { - "type": "string" + "$ref": "#/components/schemas/ActorType" }, "expirationTimestamp": { "type": "integer", diff --git a/src/types/openapi/openapi-backend-sipbridge.ts b/src/types/openapi/openapi-backend-sipbridge.ts index fa76de64a99..f6490280395 100644 --- a/src/types/openapi/openapi-backend-sipbridge.ts +++ b/src/types/openapi/openapi-backend-sipbridge.ts @@ -40,6 +40,8 @@ export type webhooks = Record; export type components = { schemas: { + /** @enum {string} */ + ActorType: "bot-" | "bots" | "bridged" | "changelog" | "circles" | "cli" | "emails" | "federated_users" | "groups" | "guests" | "phones" | "system" | "users"; Capabilities: { features: string[]; config: { @@ -87,7 +89,7 @@ export type components = { ChatMessage: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** @enum {boolean} */ deleted?: true; /** Format: int64 */ @@ -132,7 +134,7 @@ export type components = { }, unknown[]]>; Room: { actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"] | string; /** Format: int64 */ attendeeId: number; /** Format: int64 */ @@ -219,7 +221,7 @@ export type components = { RoomProxyMessage: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ expirationTimestamp: number; message: string; diff --git a/src/types/openapi/openapi-federation.ts b/src/types/openapi/openapi-federation.ts index 5c27c9a577a..2f227d10392 100644 --- a/src/types/openapi/openapi-federation.ts +++ b/src/types/openapi/openapi-federation.ts @@ -35,6 +35,8 @@ export type webhooks = Record; export type components = { schemas: { + /** @enum {string} */ + ActorType: "bot-" | "bots" | "bridged" | "changelog" | "circles" | "cli" | "emails" | "federated_users" | "groups" | "guests" | "phones" | "system" | "users"; Capabilities: { features: string[]; config: { @@ -82,7 +84,7 @@ export type components = { ChatMessage: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** @enum {boolean} */ deleted?: true; /** Format: int64 */ @@ -145,7 +147,7 @@ export type components = { }, unknown[]]>; Room: { actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"] | string; /** Format: int64 */ attendeeId: number; /** Format: int64 */ @@ -232,7 +234,7 @@ export type components = { RoomProxyMessage: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ expirationTimestamp: number; message: string; diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 471a0a0c1cf..2dc51a755db 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -509,6 +509,8 @@ export type webhooks = Record; export type components = { schemas: { + /** @enum {string} */ + ActorType: "bot-" | "bots" | "bridged" | "changelog" | "circles" | "cli" | "emails" | "federated_users" | "groups" | "guests" | "phones" | "system" | "users"; Bot: { description: string | null; /** Format: int64 */ @@ -533,7 +535,7 @@ export type components = { }; CallPeer: { actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; displayName: string; /** Format: int64 */ lastPing: number; @@ -598,7 +600,7 @@ export type components = { ChatMessage: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** @enum {boolean} */ deleted?: true; /** Format: int64 */ @@ -683,7 +685,7 @@ export type components = { }; Participant: { actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ attendeeId: number; /** Format: int64 */ @@ -711,7 +713,7 @@ export type components = { Poll: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; details?: components["schemas"]["PollVote"][]; /** Format: int64 */ id: number; @@ -733,7 +735,7 @@ export type components = { PollVote: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ optionId: number; }; @@ -743,13 +745,13 @@ export type components = { Reaction: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ timestamp: number; }; Room: { actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"] | string; /** Format: int64 */ attendeeId: number; /** Format: int64 */ @@ -836,7 +838,7 @@ export type components = { RoomProxyMessage: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ expirationTimestamp: number; message: string; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 5a444b33e0d..dafa86b5525 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -382,6 +382,8 @@ export type webhooks = Record; export type components = { schemas: { + /** @enum {string} */ + ActorType: "bot-" | "bots" | "bridged" | "changelog" | "circles" | "cli" | "emails" | "federated_users" | "groups" | "guests" | "phones" | "system" | "users"; Bot: { description: string | null; /** Format: int64 */ @@ -392,7 +394,7 @@ export type components = { }; CallPeer: { actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; displayName: string; /** Format: int64 */ lastPing: number; @@ -457,7 +459,7 @@ export type components = { ChatMessage: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** @enum {boolean} */ deleted?: true; /** Format: int64 */ @@ -524,7 +526,7 @@ export type components = { }; Participant: { actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ attendeeId: number; /** Format: int64 */ @@ -552,7 +554,7 @@ export type components = { Poll: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; details?: components["schemas"]["PollVote"][]; /** Format: int64 */ id: number; @@ -574,7 +576,7 @@ export type components = { PollVote: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ optionId: number; }; @@ -584,13 +586,13 @@ export type components = { Reaction: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ timestamp: number; }; Room: { actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"] | string; /** Format: int64 */ attendeeId: number; /** Format: int64 */ @@ -677,7 +679,7 @@ export type components = { RoomProxyMessage: { actorDisplayName: string; actorId: string; - actorType: string; + actorType: components["schemas"]["ActorType"]; /** Format: int64 */ expirationTimestamp: number; message: string;