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;