From 7ecf40caa172ef8deb0076e8d6407a0c43b52b4c Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 6 Nov 2024 14:15:54 +0100 Subject: [PATCH] fix(OpenAPI): Fix array syntax ambiguities Signed-off-by: provokateurin --- lib/Capabilities.php | 10 +- lib/Chat/ChatManager.php | 6 ++ lib/Chat/ReactionManager.php | 2 +- lib/Controller/BanController.php | 4 +- lib/Controller/BotController.php | 10 +- lib/Controller/BreakoutRoomController.php | 12 +-- lib/Controller/CallController.php | 16 ++-- lib/Controller/ChatController.php | 37 ++++---- lib/Controller/FederationController.php | 2 +- lib/Controller/FilesIntegrationController.php | 14 +-- lib/Controller/GuestController.php | 2 +- .../HostedSignalingServerController.php | 4 +- lib/Controller/PollController.php | 10 +- lib/Controller/PublicShareAuthController.php | 2 +- lib/Controller/ReactionController.php | 10 +- lib/Controller/RecordingController.php | 20 ++-- lib/Controller/RoomController.php | 94 +++++++++---------- lib/Controller/SettingsController.php | 6 +- lib/Controller/SignalingController.php | 14 +-- lib/Controller/TempAvatarController.php | 4 +- .../TalkV1/Controller/CallController.php | 14 +-- .../TalkV1/Controller/ChatController.php | 23 ++--- .../TalkV1/Controller/PollController.php | 6 +- .../TalkV1/Controller/ReactionController.php | 12 +-- .../TalkV1/Controller/RoomController.php | 17 ++-- .../TalkV1/Controller/SignalingController.php | 4 +- lib/Federation/Proxy/TalkV1/UserConverter.php | 8 +- lib/Model/BanMapper.php | 5 +- lib/ResponseDefinitions.php | 28 +++--- lib/Service/BanService.php | 2 +- lib/Service/BreakoutRoomService.php | 2 +- lib/Service/RoomFormatter.php | 2 +- openapi-administration.json | 21 +---- openapi-backend-recording.json | 21 +---- openapi-backend-signaling.json | 21 +---- openapi-backend-sipbridge.json | 21 +---- openapi-bots.json | 21 +---- openapi-federation.json | 21 +---- openapi-full.json | 21 +---- openapi.json | 21 +---- src/types/openapi/openapi-administration.ts | 4 +- .../openapi/openapi-backend-recording.ts | 4 +- .../openapi/openapi-backend-signaling.ts | 4 +- .../openapi/openapi-backend-sipbridge.ts | 4 +- src/types/openapi/openapi-bots.ts | 4 +- src/types/openapi/openapi-federation.ts | 4 +- src/types/openapi/openapi-full.ts | 4 +- src/types/openapi/openapi.ts | 4 +- 48 files changed, 266 insertions(+), 336 deletions(-) diff --git a/lib/Capabilities.php b/lib/Capabilities.php index cb30c4bb443..e89bf085918 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -171,8 +171,8 @@ public function __construct( /** * @return array{ - * spreed: TalkCapabilities, - * }|array + * spreed?: TalkCapabilities, + * } */ public function getCapabilities(): array { $user = $this->userSession->getUser(); @@ -257,18 +257,18 @@ public function getCapabilities(): array { $capabilities['config']['signaling']['hello-v2-token-key'] = $pubKey; } - /** @var ?string[] $predefinedBackgrounds */ + /** @var ?list $predefinedBackgrounds */ $predefinedBackgrounds = null; $cachedPredefinedBackgrounds = $this->talkCache->get('predefined_backgrounds'); if ($cachedPredefinedBackgrounds !== null) { // Try using cached value - /** @var string[]|null $predefinedBackgrounds */ + /** @var ?list $predefinedBackgrounds */ $predefinedBackgrounds = json_decode($cachedPredefinedBackgrounds, true); } if (!is_array($predefinedBackgrounds)) { // Cache was empty or invalid, regenerate - /** @var string[] $predefinedBackgrounds */ + /** @var list $predefinedBackgrounds */ $predefinedBackgrounds = []; if (file_exists(__DIR__ . '/../img/backgrounds')) { $directoryIterator = new \DirectoryIterator(__DIR__ . '/../img/backgrounds'); diff --git a/lib/Chat/ChatManager.php b/lib/Chat/ChatManager.php index b709581ddc7..7206fbd166c 100644 --- a/lib/Chat/ChatManager.php +++ b/lib/Chat/ChatManager.php @@ -23,6 +23,7 @@ use OCA\Talk\Model\Message; use OCA\Talk\Model\Poll; use OCA\Talk\Participant; +use OCA\Talk\ResponseDefinitions; use OCA\Talk\Room; use OCA\Talk\Service\AttachmentService; use OCA\Talk\Service\ParticipantService; @@ -59,6 +60,7 @@ * * When a message is saved the mentioned users are notified as needed, and * pending notifications are removed if the messages are deleted. + * @psalm-import-type TalkChatMentionSuggestion from ResponseDefinitions */ class ChatManager { public const MAX_CHAT_LENGTH = 32000; @@ -950,6 +952,10 @@ public function searchForObjectsWithFilters(string $search, array $objectIds, st return $this->commentsManager->searchForObjectsWithFilters($search, 'chat', $objectIds, $verb, $since, $until, $actorType, $actorId, $offset, $limit); } + /** + * @param list $results + * @return list + */ public function addConversationNotify(array $results, string $search, Room $room, Participant $participant): array { if ($room->getType() === Room::TYPE_ONE_TO_ONE) { return $results; diff --git a/lib/Chat/ReactionManager.php b/lib/Chat/ReactionManager.php index 11a0efe3e1b..3fc31b74cfe 100644 --- a/lib/Chat/ReactionManager.php +++ b/lib/Chat/ReactionManager.php @@ -127,7 +127,7 @@ public function deleteReactionMessage(Room $chat, string $actorType, string $act } /** - * @return array + * @return array> * @throws PreConditionNotMetException */ public function retrieveReactionMessages(Room $chat, Participant $participant, int $messageId, ?string $reaction = null): array { diff --git a/lib/Controller/BanController.php b/lib/Controller/BanController.php index 6520cb68522..a38b9fdbeeb 100644 --- a/lib/Controller/BanController.php +++ b/lib/Controller/BanController.php @@ -77,7 +77,7 @@ public function banActor(string $actorType, string $actorId, string $internalNot * * Required capability: `ban-v1` * - * @return DataResponse + * @return DataResponse, array{}> * * 200: List all bans */ @@ -95,7 +95,7 @@ public function listBans(): DataResponse { * Required capability: `ban-v1` * * @param int $banId ID of the ban to be removed - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Unban successfully or not found */ diff --git a/lib/Controller/BotController.php b/lib/Controller/BotController.php index 0b8cf9797e0..e38303a67a9 100644 --- a/lib/Controller/BotController.php +++ b/lib/Controller/BotController.php @@ -120,7 +120,7 @@ protected function getBotFromHeaders(string $token, string $message): Bot { * @param string $referenceId For the message to be able to later identify it again * @param int $replyTo Parent id which this message is a reply to * @param bool $silent If sent silent the chat message will not create any notifications - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 201: Message sent successfully * 400: When the replyTo is invalid or message is empty @@ -183,7 +183,7 @@ public function sendMessage(string $token, string $message, string $referenceId * @param string $token Conversation token * @param int $messageId ID of the message * @param string $reaction Reaction to add - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Reaction already exists * 201: Reacted successfully @@ -237,7 +237,7 @@ public function react(string $token, int $messageId, string $reaction): DataResp * @param string $token Conversation token * @param int $messageId ID of the message * @param string $reaction Reaction to delete - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Reaction deleted successfully * 400: Reacting is not possible @@ -285,7 +285,7 @@ public function deleteReaction(string $token, int $messageId, string $reaction): /** * List admin bots * - * @return DataResponse + * @return DataResponse, array{}> * * 200: Bot list returned */ @@ -305,7 +305,7 @@ public function adminListBots(): DataResponse { /** * List bots * - * @return DataResponse + * @return DataResponse, array{}> * * 200: Bot list returned */ diff --git a/lib/Controller/BreakoutRoomController.php b/lib/Controller/BreakoutRoomController.php index 9d12507d8ce..07b418eb27a 100644 --- a/lib/Controller/BreakoutRoomController.php +++ b/lib/Controller/BreakoutRoomController.php @@ -45,7 +45,7 @@ public function __construct( * @psalm-param BreakoutRoom::MODE_* $mode * @param int<1, 20> $amount Number of breakout rooms - Constants {@see BreakoutRoom::MINIMUM_ROOM_AMOUNT} and {@see BreakoutRoom::MAXIMUM_ROOM_AMOUNT} * @param string $attendeeMap Mapping of the attendees to breakout rooms - * @return DataResponse|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Breakout rooms configured successfully * 400: Configuring breakout rooms errored @@ -87,7 +87,7 @@ public function removeBreakoutRooms(): DataResponse { * Broadcast a chat message to all breakout rooms * * @param string $message Message to broadcast - * @return DataResponse|DataResponse + * @return DataResponse, array{}>|DataResponse * * 201: Chat message broadcasted successfully * 400: Broadcasting chat message is not possible @@ -111,7 +111,7 @@ public function broadcastChatMessage(string $message): DataResponse { * Apply an attendee map to the breakout rooms * * @param string $attendeeMap JSON encoded mapping of the attendees to breakout rooms `array` - * @return DataResponse|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Attendee map applied successfully * 400: Applying attendee map is not possible @@ -181,7 +181,7 @@ public function resetRequestForAssistance(): DataResponse { /** * Start the breakout rooms * - * @return DataResponse|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Breakout rooms started successfully * 400: Starting breakout rooms is not possible @@ -202,7 +202,7 @@ public function startBreakoutRooms(): DataResponse { /** * Stop the breakout rooms * - * @return DataResponse|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Breakout rooms stopped successfully * 400: Stopping breakout rooms is not possible @@ -247,7 +247,7 @@ public function switchBreakoutRoom(string $target): DataResponse { } /** - * @return TalkRoom[] + * @return list */ protected function formatMultipleRooms(array $rooms): array { $return = []; diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php index 7e17b26e2d3..e67697e62bd 100644 --- a/lib/Controller/CallController.php +++ b/lib/Controller/CallController.php @@ -67,7 +67,7 @@ public function __construct( /** * Get the peers for a call * - * @return DataResponse + * @return DataResponse, array{}> * * 200: List of peers in the call returned */ @@ -193,7 +193,7 @@ public function downloadParticipantsForCall(string $format = 'csv'): DataDownloa * (Only needed when the `config => call => recording-consent` capability is set to {@see RecordingService::CONSENT_REQUIRED_YES} * or the capability is {@see RecordingService::CONSENT_REQUIRED_OPTIONAL} * and the conversation `recordingConsent` value is {@see RecordingService::CONSENT_REQUIRED_YES} ) - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Call joined successfully * 400: No recording consent was given @@ -274,7 +274,7 @@ protected function validateRecordingConsent(bool $recordingConsent): void { * @psalm-param int-mask-of|null $flags * @param bool $silent Join the call silently * @param bool $recordingConsent Agreement to be recorded - * @return DataResponse, array{}>|DataResponse|DataResponse + * @return DataResponse, array{}>|DataResponse|DataResponse * * 200: Call joined successfully * 400: Conditions to join not met @@ -314,7 +314,7 @@ public function joinFederatedCall(string $sessionId, ?int $flags = null, bool $s * Ring an attendee * * @param int $attendeeId ID of the attendee to ring - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Attendee rang successfully * 400: Ringing attendee is not possible @@ -396,7 +396,7 @@ public function sipDialOut(int $attendeeId): DataResponse { * * @param int<0, 15> $flags New flags * @psalm-param int-mask-of $flags New flags - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: In-call flags updated successfully * 400: Updating in-call flags is not possible @@ -439,7 +439,7 @@ public function updateCallFlags(int $flags): DataResponse { * @param string $sessionId Federated session id to update the flags with * @param int<0, 15> $flags New flags * @psalm-param int-mask-of $flags New flags - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: In-call flags updated successfully * 400: Updating in-call flags is not possible @@ -469,7 +469,7 @@ public function updateFederatedCallFlags(string $sessionId, int $flags): DataRes * Leave a call * * @param bool $all whether to also terminate the call for all participants - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Call left successfully * 404: Call session not found @@ -519,7 +519,7 @@ public function leaveCall(bool $all = false): DataResponse { * user. * * @param string $sessionId Federated session id to leave with - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Call left successfully * 404: Call session not found diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php index e598b0e9e26..a819e559a7d 100644 --- a/lib/Controller/ChatController.php +++ b/lib/Controller/ChatController.php @@ -185,7 +185,7 @@ protected function parseCommentToResponse(IComment $comment, ?Message $parentMes * @param int $replyTo Parent id which this message is a reply to * @psalm-param non-negative-int $replyTo * @param bool $silent If sent silent the chat message will not create any notifications - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 201: Message sent successfully * 400: Sending message is not possible @@ -258,7 +258,7 @@ public function sendMessage(string $message, string $actorDisplayName = '', stri * @param string $metaData Additional metadata * @param string $actorDisplayName Guest name * @param string $referenceId Reference ID - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 201: Object shared successfully * 400: Sharing object is not possible @@ -397,7 +397,7 @@ protected function preloadShares(array $comments): void { * @param 0|1 $includeLastKnown Include the $lastKnownMessageId in the messages when 1 (default 0) * @param 0|1 $noStatusUpdate When the user status should not be automatically set to online set to 1 (default 0) * @param 0|1 $markNotificationsAsRead Set to 0 when notifications should not be marked as read (default 1) - * @return DataResponse|DataResponse, array> + * @return DataResponse, array{'X-Chat-Last-Common-Read'?: numeric-string, X-Chat-Last-Given?: numeric-string}>|DataResponse, array{}> * * 200: Messages returned * 304: No messages @@ -490,7 +490,7 @@ public function receiveMessages(int $lookIntoFuture, } /** - * @return DataResponse + * @return DataResponse, array{X-Chat-Last-Common-Read?: numeric-string, X-Chat-Last-Given?: numeric-string}> */ protected function prepareCommentsAsDataResponse(array $comments, int $lastCommonReadId = 0): DataResponse { if (empty($comments)) { @@ -626,7 +626,7 @@ protected function prepareCommentsAsDataResponse(array $comments, int $lastCommo * @param int $messageId The focused message which should be in the "middle" of the returned context * @psalm-param non-negative-int $messageId * @param int<1, 100> $limit Number of chat messages to receive in both directions (50 by default, 100 at most, might return 201 messages) - * @return DataResponse|DataResponse, array> + * @return DataResponse, array{'X-Chat-Last-Common-Read'?: numeric-string, X-Chat-Last-Given?: numeric-string}>|DataResponse, array{}> * * 200: Message context returned * 304: No messages @@ -654,6 +654,10 @@ public function getMessageContext( return $this->prepareCommentsAsDataResponse(array_merge($commentsHistory, $commentsFuture)); } + /** + * @param list $messages + * @return list + */ protected function loadSelfReactions(array $messages, array $commentIdToIndex): array { // Get message ids with reactions $messageIdsWithReactions = array_map( @@ -695,6 +699,7 @@ protected function loadSelfReactions(array $messages, array $commentIdToIndex): } } + /** @var list $messages */ return $messages; } @@ -703,7 +708,7 @@ protected function loadSelfReactions(array $messages, array $commentIdToIndex): * * @param int $messageId ID of the message * @psalm-param non-negative-int $messageId - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Message deleted successfully * 202: Message deleted successfully, but a bot or Matterbridge is configured, so the information can be replicated elsewhere @@ -794,7 +799,7 @@ public function deleteMessage(int $messageId): DataResponse { * @param int $messageId ID of the message * @param string $message the message to send * @psalm-param non-negative-int $messageId - * @return DataResponse|DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse|DataResponse, array{}> * * 200: Message edited successfully * 202: Message edited successfully, but a bot or Matterbridge is configured, so the information can be replicated to other services @@ -1019,7 +1024,7 @@ protected function validateMessageExists(int $messageId, bool $sync = false): vo /** * Clear the chat history * - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: History cleared successfully * 202: History cleared successfully, but Matterbridge is configured, so the information can be replicated elsewhere @@ -1142,7 +1147,7 @@ public function markUnread(): DataResponse { * Get objects that are shared in the room overview * * @param int<1, 20> $limit Maximum number of objects - * @return DataResponse, array{}> + * @return DataResponse>, array{}> * * 200: List of shared objects messages of each type returned */ @@ -1195,7 +1200,7 @@ public function getObjectsSharedInRoomOverview(int $limit = 7): DataResponse { * @param int $lastKnownMessageId ID of the last known message * @psalm-param non-negative-int $lastKnownMessageId * @param int<1, 200> $limit Maximum number of objects - * @return DataResponse + * @return DataResponse, array{X-Chat-Last-Given?: numeric-string}> * * 200: List of shared objects messages returned */ @@ -1209,7 +1214,7 @@ public function getObjectsSharedInRoom(string $objectType, int $lastKnownMessage $attachments = $this->attachmentService->getAttachmentsByType($this->room, $objectType, $offset, $limit); $messageIds = array_map(static fn (Attachment $attachment): int => $attachment->getMessageId(), $attachments); - /** @var TalkChatMessage[] $messages */ + /** @var array $messages */ $messages = $this->getMessagesForRoom($messageIds); $headers = []; @@ -1218,11 +1223,11 @@ public function getObjectsSharedInRoom(string $objectType, int $lastKnownMessage $headers = ['X-Chat-Last-Given' => $newLastKnown]; } - return new DataResponse($messages, Http::STATUS_OK, $headers); + return new DataResponse(array_values($messages), Http::STATUS_OK, $headers); } /** - * @return TalkChatMessage[] + * @return array */ protected function getMessagesForRoom(array $messageIds): array { $comments = $this->chatManager->getMessagesForRoomById($this->room, $messageIds); @@ -1257,7 +1262,7 @@ protected function getMessagesForRoom(array $messageIds): array { * @param string $search Text to search for * @param int $limit Maximum number of results * @param bool $includeStatus Include the user statuses - * @return DataResponse + * @return DataResponse, array{}> * * 200: List of mention suggestions returned */ @@ -1313,8 +1318,8 @@ public function mentions(string $search, int $limit = 20, bool $includeStatus = /** * @param array $results - * @param IUserStatus[] $statuses - * @return TalkChatMentionSuggestion[] + * @param array $statuses + * @return list */ protected function prepareResultArray(array $results, array $statuses): array { $output = []; diff --git a/lib/Controller/FederationController.php b/lib/Controller/FederationController.php index ae5e46f9030..37705a26ade 100644 --- a/lib/Controller/FederationController.php +++ b/lib/Controller/FederationController.php @@ -108,7 +108,7 @@ public function acceptShare(int $id): DataResponse { * * @param int $id ID of the share * @psalm-param non-negative-int $id - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Invite declined successfully * 400: Invite was already accepted, use the "Remove the current user from a room" endpoint instead diff --git a/lib/Controller/FilesIntegrationController.php b/lib/Controller/FilesIntegrationController.php index 99cd239ac73..ea28b80b81f 100644 --- a/lib/Controller/FilesIntegrationController.php +++ b/lib/Controller/FilesIntegrationController.php @@ -76,9 +76,9 @@ public function __construct( * owner of such a file. * * @param string $fileId ID of the file - * @return DataResponse|DataResponse, array{}> - * 200: Room token returned - * 400: Rooms not allowed for shares + * @return DataResponse|DataResponse, array{}> + * 200: Room token returned + * 400: Rooms not allowed for shares * @throws OCSNotFoundException Share not found */ #[NoAdminRequired] @@ -142,10 +142,10 @@ public function getRoomByFileId(string $fileId): DataResponse { * thus logged-in users as seen as guests. * * @param string $shareToken Token of the file share - * @return DataResponse|DataResponse, array{}> - * 200: Room token and user info returned - * 400: Rooms not allowed for shares - * 404: Share not found + * @return DataResponse|DataResponse, array{}> + * 200: Room token and user info returned + * 400: Rooms not allowed for shares + * 404: Share not found */ #[PublicPage] #[UseSession] diff --git a/lib/Controller/GuestController.php b/lib/Controller/GuestController.php index 403a33262e4..ab2a287a507 100644 --- a/lib/Controller/GuestController.php +++ b/lib/Controller/GuestController.php @@ -30,7 +30,7 @@ public function __construct( * Set the display name as a guest * * @param string $displayName New display name - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Display name updated successfully * 403: Not a guest diff --git a/lib/Controller/HostedSignalingServerController.php b/lib/Controller/HostedSignalingServerController.php index 46b5eb64201..4009f048905 100644 --- a/lib/Controller/HostedSignalingServerController.php +++ b/lib/Controller/HostedSignalingServerController.php @@ -41,7 +41,7 @@ public function __construct( /** * Get the authentication credentials * - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Authentication credentials returned * 412: Getting authentication credentials is not possible @@ -101,7 +101,7 @@ public function requestTrial(string $url, string $name, string $email, string $l /** * Delete the account * - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 204: Account deleted successfully * 400: Deleting account is not possible diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php index 0b4722d47c6..57320e99090 100644 --- a/lib/Controller/PollController.php +++ b/lib/Controller/PollController.php @@ -169,7 +169,7 @@ public function getAllDraftPolls(): DataResponse { * * @param int $pollId ID of the poll * @psalm-param non-negative-int $pollId - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Poll returned * 404: Poll not found @@ -209,8 +209,8 @@ public function showPoll(int $pollId): DataResponse { * * @param int $pollId ID of the poll * @psalm-param non-negative-int $pollId - * @param int[] $optionIds IDs of the selected options - * @return DataResponse|DataResponse, array{}> + * @param list $optionIds IDs of the selected options + * @return DataResponse|DataResponse, array{}> * * 200: Voted successfully * 400: Voting is not possible @@ -274,7 +274,7 @@ public function votePoll(int $pollId, array $optionIds = []): DataResponse { * * @param int $pollId ID of the poll * @psalm-param non-negative-int $pollId - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Poll closed successfully * 202: Poll draft was deleted successfully @@ -347,6 +347,8 @@ public function closePoll(int $pollId): DataResponse { } /** + * @param list $votedSelf + * @param list $detailedVotes * @return TalkPoll * @throws JsonException */ diff --git a/lib/Controller/PublicShareAuthController.php b/lib/Controller/PublicShareAuthController.php index f40882b1915..9839f781c59 100644 --- a/lib/Controller/PublicShareAuthController.php +++ b/lib/Controller/PublicShareAuthController.php @@ -49,7 +49,7 @@ public function __construct( * otherwise. * * @param string $shareToken Token of the file share - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 201: Room created successfully * 404: Share not found diff --git a/lib/Controller/ReactionController.php b/lib/Controller/ReactionController.php index 85b90aaeab5..213fe11746c 100644 --- a/lib/Controller/ReactionController.php +++ b/lib/Controller/ReactionController.php @@ -43,7 +43,7 @@ public function __construct( * @param int $messageId ID of the message * @psalm-param non-negative-int $messageId * @param string $reaction Emoji to add - * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> + * @return DataResponse>|\stdClass, array{}>|DataResponse, array{}> * * 200: Reaction already existed * 201: Reaction added successfully @@ -89,7 +89,7 @@ public function react(int $messageId, string $reaction): DataResponse { * @param int $messageId ID of the message * @psalm-param non-negative-int $messageId * @param string $reaction Emoji to remove - * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> + * @return DataResponse>|\stdClass, array{}>|DataResponse, array{}> * * 200: Reaction deleted successfully * 400: Deleting reaction is not possible @@ -132,7 +132,7 @@ public function delete(int $messageId, string $reaction): DataResponse { * @param int $messageId ID of the message * @psalm-param non-negative-int $messageId * @param string|null $reaction Emoji to filter - * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> + * @return DataResponse>|\stdClass, array{}>|DataResponse, array{}> * * 200: Reactions returned * 404: Message or reaction not found @@ -161,8 +161,8 @@ public function getReactions(int $messageId, ?string $reaction): DataResponse { } /** - * @param array $reactions - * @return array|\stdClass + * @param array> $reactions + * @return array>|\stdClass */ protected function formatReactions(array $reactions): array|\stdClass { if ($this->getResponseFormat() === 'json' && empty($reactions)) { diff --git a/lib/Controller/RecordingController.php b/lib/Controller/RecordingController.php index f42caa1c535..eae5d5b76bf 100644 --- a/lib/Controller/RecordingController.php +++ b/lib/Controller/RecordingController.php @@ -54,7 +54,7 @@ public function __construct( * * @param int $serverId ID of the server * @psalm-param non-negative-int $serverId - * @return DataResponse|DataResponse, array{}>|DataResponse + * @return DataResponse|DataResponse, array{}>|DataResponse * * 200: Welcome message returned * 404: Recording server not found or not configured @@ -151,7 +151,7 @@ protected function getInputStream(): string { /** * Update the recording status as a backend * - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Recording status updated successfully * 400: Updating recording status is not possible @@ -196,7 +196,7 @@ public function backend(): DataResponse { } /** - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse */ private function backendStarted(array $started): DataResponse { $token = $started['token']; @@ -247,7 +247,7 @@ private function backendStarted(array $started): DataResponse { } /** - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse */ private function backendStopped(array $stopped): DataResponse { $token = $stopped['token']; @@ -288,7 +288,7 @@ private function backendStopped(array $stopped): DataResponse { } /** - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse */ private function backendFailed(array $failed): DataResponse { $token = $failed['token']; @@ -319,7 +319,7 @@ private function backendFailed(array $failed): DataResponse { * * @param int $status Type of the recording * @psalm-param Room::RECORDING_* $status - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Recording started successfully * 400: Starting recording is not possible @@ -338,7 +338,7 @@ public function start(int $status): DataResponse { /** * Stop the recording * - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Recording stopped successfully * 400: Stopping recording is not possible @@ -358,7 +358,7 @@ public function stop(): DataResponse { * Store the recording * * @param ?string $owner User that will own the recording file. `null` is actually not allowed and will always result in a "400 Bad Request". It's only allowed code-wise to handle requests where the post data exceeded the limits, so we can return a proper error instead of "500 Internal Server Error". - * @return DataResponse, array{}>|DataResponse|DataResponse + * @return DataResponse, array{}>|DataResponse|DataResponse * * 200: Recording stored successfully * 400: Storing recording is not possible @@ -406,7 +406,7 @@ public function store(?string $owner): DataResponse { * * @param int $timestamp Timestamp of the notification to be dismissed * @psalm-param non-negative-int $timestamp - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Notification dismissed successfully * 400: Dismissing notification is not possible @@ -433,7 +433,7 @@ public function notificationDismiss(int $timestamp): DataResponse { * @psalm-param non-negative-int $fileId * @param int $timestamp Timestamp of the notification to be dismissed * @psalm-param non-negative-int $timestamp - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Recording shared to chat successfully * 400: Sharing recording to chat is not possible diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 17821e88409..5147865c8cf 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -174,7 +174,7 @@ protected function getTalkHashHeader(): array { * @param bool $includeStatus Include the user status * @param int $modifiedSince Filter rooms modified after a timestamp * @psalm-param non-negative-int $modifiedSince - * @return DataResponse + * @return DataResponse, array{X-Nextcloud-Talk-Hash: string, X-Nextcloud-Talk-Modified-Before: numeric-string, X-Nextcloud-Talk-Federation-Invites?: numeric-string}> * * 200: Return list of rooms */ @@ -283,7 +283,7 @@ public function getRooms(int $noStatusUpdate = 0, bool $includeStatus = false, i * Get listed rooms with optional search term * * @param string $searchTerm search term - * @return DataResponse + * @return DataResponse, array{}> * * 200: Return list of matching rooms */ @@ -304,7 +304,7 @@ public function getListedRooms(string $searchTerm = ''): DataResponse { * * All for moderators and in case of "free selection", or the assigned breakout room for other participants * - * @return DataResponse|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Breakout rooms returned * 400: Getting breakout rooms is not possible @@ -499,7 +499,7 @@ protected function formatRoom(Room $room, ?Participant $currentParticipant, ?arr * @param 'groups'|'circles'|'' $source Source of the invite ID ('circles' to create a room with a circle, etc.) * @param string $objectType Type of the object * @param string $objectId ID of the object - * @return DataResponse|DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse|DataResponse, array{}> * * 200: Room already existed * 201: Room created successfully @@ -540,7 +540,7 @@ public function createRoom(int $roomType, string $invite = '', string $roomName * Initiates a one-to-one video call from the current user to the recipient * * @param string $targetUserId ID of the user - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> */ #[NoAdminRequired] protected function createOneToOneRoom(string $targetUserId): DataResponse { @@ -588,7 +588,7 @@ protected function createOneToOneRoom(string $targetUserId): DataResponse { * Initiates a group video call from the selected group * * @param string $targetGroupName - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> */ #[NoAdminRequired] protected function createGroupRoom(string $targetGroupName): DataResponse { @@ -614,7 +614,7 @@ protected function createGroupRoom(string $targetGroupName): DataResponse { * Initiates a group video call from the selected circle * * @param string $targetCircleId - * @return DataResponse|DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse|DataResponse, array{}> */ #[NoAdminRequired] protected function createCircleRoom(string $targetCircleId): DataResponse { @@ -642,7 +642,7 @@ protected function createCircleRoom(string $targetCircleId): DataResponse { } /** - * @return DataResponse|DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse|DataResponse, array{}> */ #[NoAdminRequired] protected function createEmptyRoom(string $roomName, bool $public = true, string $objectType = '', string $objectId = ''): DataResponse { @@ -711,7 +711,7 @@ protected function createEmptyRoom(string $roomName, bool $public = true, string /** * Add a room to the favorites * - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Successfully added room to favorites */ @@ -726,7 +726,7 @@ public function addToFavorites(): DataResponse { /** * Remove a room from the favorites * - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Successfully removed room from favorites */ @@ -743,7 +743,7 @@ public function removeFromFavorites(): DataResponse { * * @param int $level New level * @psalm-param Participant::NOTIFY_* $level - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Notification level updated successfully * 400: Updating notification level is not possible @@ -766,7 +766,7 @@ public function setNotificationLevel(int $level): DataResponse { * * @param int $level New level * @psalm-param Participant::NOTIFY_CALLS_* $level - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Call notification level updated successfully * 400: Updating call notification level is not possible @@ -787,7 +787,7 @@ public function setNotificationCalls(int $level): DataResponse { * Rename a room * * @param string $roomName New name - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Room renamed successfully * 400: Renaming room is not possible @@ -807,7 +807,7 @@ public function renameRoom(string $roomName): DataResponse { * Update the description of a room * * @param string $description New description - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Description updated successfully * 400: Updating description is not possible @@ -827,7 +827,7 @@ public function setDescription(string $description): DataResponse { /** * Delete a room * - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Room successfully deleted * 400: Deleting room is not possible @@ -849,7 +849,7 @@ public function deleteRoom(): DataResponse { * Get a list of participants for a room * * @param bool $includeStatus Include the user statuses - * @return DataResponse|DataResponse, array{}> + * @return DataResponse, array{X-Nextcloud-Has-User-Statuses?: bool}>|DataResponse, array{}> * * 200: Participants returned * 403: Missing permissions for getting participants @@ -869,12 +869,12 @@ public function getParticipants(bool $includeStatus = false): DataResponse { && $includeStatus && count($data) < Config::USER_STATUS_INTEGRATION_LIMIT && $this->appManager->isEnabledForUser('user_status')) { - $userIds = array_filter(array_map(static function (array $parsedParticipant): ?string { + $userIds = array_values(array_filter(array_map(static function (array $parsedParticipant): ?string { if ($parsedParticipant['actorType'] === Attendee::ACTOR_USERS) { return $parsedParticipant['actorId']; } return null; - }, $data)); + }, $data))); $statuses = $this->statusManager->getUserStatuses($userIds); $data = array_map(static function (array $parsedParticipant) use ($statuses): array { @@ -914,7 +914,7 @@ public function getParticipants(bool $includeStatus = false): DataResponse { * Get the breakout room participants for a room * * @param bool $includeStatus Include the user statuses - * @return DataResponse|DataResponse|DataResponse, array{}> + * @return DataResponse, array{X-Nextcloud-Has-User-Statuses?: bool}>|DataResponse|DataResponse, array{}> * * 200: Breakout room participants returned * 400: Getting breakout room participants is not possible @@ -1117,7 +1117,7 @@ protected function formatParticipantList(array $participants, bool $includeStatu * * @param string $newParticipant New participant * @param 'users'|'groups'|'circles'|'emails'|'federated_users'|'phones' $source Source of the participant - * @return DataResponse, array{}>|DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse, array{}>|DataResponse * * 200: Participant successfully added * 400: Adding participant is not possible, e.g. when the user is banned (check error attribute of response for detail key) @@ -1321,7 +1321,7 @@ public function addParticipantToRoom(string $newParticipant, string $source = 'u /** * Remove the current user from a room * - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Participant removed successfully * 400: Removing participant is not possible @@ -1335,7 +1335,7 @@ public function removeSelfFromRoom(): DataResponse { } /** - * @return DataResponse, array{}> + * @return DataResponse, array{}> */ protected function removeSelfFromRoomLogic(Room $room, Participant $participant): DataResponse { if ($room->isFederatedConversation()) { @@ -1377,7 +1377,7 @@ protected function removeSelfFromRoomLogic(Room $room, Participant $participant) * * @param int $attendeeId ID of the attendee * @psalm-param non-negative-int $attendeeId - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Attendee removed successfully * 400: Removing attendee is not possible @@ -1417,7 +1417,7 @@ public function removeAttendeeFromRoom(int $attendeeId): DataResponse { /** * Allowed guests to join conversation * - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Allowed guests successfully * 400: Allowing guests is not possible @@ -1437,7 +1437,7 @@ public function makePublic(): DataResponse { /** * Disallowed guests to join conversation * - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Room unpublished Disallowing guests successfully * 400: Disallowing guests is not possible @@ -1459,7 +1459,7 @@ public function makePrivate(): DataResponse { * * @param 0|1 $state New read-only state * @psalm-param Room::READ_* $state - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Read-only state updated successfully * 400: Updating read-only state is not possible @@ -1490,7 +1490,7 @@ public function setReadOnly(int $state): DataResponse { * * @param 0|1|2 $scope Scope where the room is listable * @psalm-param Room::LISTABLE_* $scope - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Made room listable successfully * 400: Making room listable is not possible @@ -1533,7 +1533,7 @@ public function setMentionPermissions(int $mentionPermissions): DataResponse { * Set a password for a room * * @param string $password New password - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Password set successfully * 400: Setting password is not possible @@ -1590,7 +1590,7 @@ public function unarchiveConversation(): DataResponse { * @param string $token Token of the room * @param string $password Password of the room * @param bool $force Create a new session if necessary - * @return DataResponse|DataResponse>|DataResponse, array>|DataResponse> + * @return DataResponse|DataResponse|DataResponse, array{}>|DataResponse * * 200: Room joined successfully * 403: Joining room is not allowed @@ -1788,7 +1788,7 @@ public function joinFederatedRoom(string $token, ?string $sessionId): DataRespon * Verify a dial-in PIN (SIP bridge) * * @param numeric-string $pin PIN the participant used to dial-in - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Participant returned * 401: SIP request invalid @@ -1830,7 +1830,7 @@ public function verifyDialInPin(string $pin): DataResponse { * * @param string $number E164 formatted phone number * @param array{actorId?: string, actorType?: string, attendeeId?: int} $options Additional details to verify the validity of the request - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Participant created successfully * 400: Phone number and details could not be confirmed @@ -1879,7 +1879,7 @@ public function verifyDialOutNumber(string $number, array $options = []): DataRe /** * Create a guest by their dial-in * - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Participant created successfully * 400: SIP not enabled @@ -1916,7 +1916,7 @@ public function createGuestByDialIn(): DataResponse { * * @param string $callId The call ID provided by the SIP bridge earlier to uniquely identify the call to terminate * @param array{actorId?: string, actorType?: string, attendeeId?: int} $options Additional details to verify the validity of the request - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Call ID reset * 400: Call ID mismatch or attendeeId not found in $options @@ -1965,7 +1965,7 @@ public function rejectedDialOutRequest(string $callId, array $options = []): Dat * * @param 0|1 $state of the room * @psalm-param Session::STATE_* $state - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Session state set successfully * 400: The provided new state was invalid @@ -1992,7 +1992,7 @@ public function setSessionState(int $state): DataResponse { * Leave a room * * @param string $token Token of the room - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Successfully left the room */ @@ -2023,7 +2023,7 @@ public function leaveRoom(string $token): DataResponse { * * @param string $token Token of the room * @param string $sessionId Federated session id to leave with - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Successfully left the room * 404: Room not found (non-federation request) @@ -2072,7 +2072,7 @@ public function leaveFederatedRoom(string $token, string $sessionId): DataRespon * * @param int $attendeeId ID of the attendee * @psalm-param non-negative-int $attendeeId - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Attendee promoted to moderator successfully * 400: Promoting attendee to moderator is not possible @@ -2090,7 +2090,7 @@ public function promoteModerator(int $attendeeId): DataResponse { * * @param int $attendeeId ID of the attendee * @psalm-param non-negative-int $attendeeId - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Attendee demoted from moderator successfully * 400: Demoting attendee from moderator is not possible @@ -2110,7 +2110,7 @@ public function demoteModerator(int $attendeeId): DataResponse { * @param int $attendeeId * @psalm-param non-negative-int $attendeeId * @param bool $promote Shall the attendee be promoted or demoted - * @return DataResponse, array{}> + * @return DataResponse, array{}> */ protected function changeParticipantType(int $attendeeId, bool $promote): DataResponse { try { @@ -2193,7 +2193,7 @@ public function setPermissions(string $mode, int $permissions): DataResponse { * @param 'set'|'remove'|'add' $method Method of updating permissions ('set', 'remove', 'add') * @param int<0, 255> $permissions New permissions * @psalm-param int-mask-of $permissions - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Permissions updated successfully * 400: Updating permissions is not possible @@ -2229,7 +2229,7 @@ public function setAttendeePermissions(int $attendeeId, string $method, int $per * @psalm-param Attendee::PERMISSIONS_MODIFY_* $method * @param int<0, 255> $permissions New permissions * @psalm-param int-mask-of $permissions - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * @deprecated Call permissions have been removed * * 200: Permissions updated successfully @@ -2300,7 +2300,7 @@ public function setLobby(int $state, ?int $timer = null): DataResponse { * * @param 0|1|2 $state New state * @psalm-param Webinary::SIP_* $state - * @return DataResponse|DataResponse, array{}>|DataResponse + * @return DataResponse|DataResponse, array{}>|DataResponse * * 200: SIP enabled state updated successfully * 400: Updating SIP enabled state is not possible @@ -2339,7 +2339,7 @@ public function setSIPEnabled(int $state): DataResponse { * @param int $recordingConsent New consent setting for the conversation * (Only {@see RecordingService::CONSENT_REQUIRED_NO} and {@see RecordingService::CONSENT_REQUIRED_YES} are allowed here.) * @psalm-param RecordingService::CONSENT_REQUIRED_NO|RecordingService::CONSENT_REQUIRED_YES $recordingConsent - * @return DataResponse|DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse|DataResponse, array{}> * * 200: Recording consent requirement set successfully * 400: Setting recording consent requirement is not possible @@ -2366,7 +2366,7 @@ public function setRecordingConsent(int $recordingConsent): DataResponse { * * @param int|null $attendeeId ID of the attendee * @psalm-param non-negative-int|null $attendeeId - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Invitation resent successfully * 404: Attendee not found @@ -2403,7 +2403,7 @@ public function resendInvitations(?int $attendeeId): DataResponse { * * @param int $seconds New time * @psalm-param non-negative-int $seconds - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Message expiration time updated successfully * 400: Updating message expiration time is not possible @@ -2426,7 +2426,7 @@ public function setMessageExpiration(int $seconds): DataResponse { * See "Capability handling in federated conversations" in https://github.com/nextcloud/spreed/issues/10680 * to learn which capabilities should be considered from the local server or from the remote server. * - * @return DataResponse, array{X-Nextcloud-Talk-Hash?: string, X-Nextcloud-Talk-Proxy-Hash?: string}> + * @return DataResponse, array{X-Nextcloud-Talk-Hash?: string, X-Nextcloud-Talk-Proxy-Hash?: string}> * * 200: Get capabilities successfully */ @@ -2440,7 +2440,7 @@ public function getCapabilities(): DataResponse { $proxy = \OCP\Server::get(\OCA\Talk\Federation\Proxy\TalkV1\Controller\RoomController::class); $response = $proxy->getCapabilities($this->room, $this->participant); - /** @var TalkCapabilities|array $data */ + /** @var TalkCapabilities|list $data */ $data = $response->getData(); /** diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 6dc4abef085..e07525d211c 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -41,7 +41,7 @@ public function __construct( * * @param 'attachment_folder'|'read_status_privacy'|'typing_privacy'|'play_sounds' $key Key to update * @param string|int|null $value New value for the key - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: User setting updated successfully * 400: Updating user setting is not possible @@ -60,10 +60,10 @@ public function setUserSetting(string $key, $value): DataResponse { /** * Update SIP bridge settings * - * @param string[] $sipGroups New SIP groups + * @param list $sipGroups New SIP groups * @param string $dialInInfo New dial info * @param string $sharedSecret New shared secret - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Successfully set new SIP settings */ diff --git a/lib/Controller/SignalingController.php b/lib/Controller/SignalingController.php index 3a594ba8c05..02a93bc6a9a 100644 --- a/lib/Controller/SignalingController.php +++ b/lib/Controller/SignalingController.php @@ -107,7 +107,7 @@ private function validateRecordingBackendRequest(string $data): bool { * Get the signaling settings * * @param string $token Token of the room - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * * 200: Signaling settings returned * 401: Recording request invalid @@ -262,7 +262,7 @@ private function getFederationSettings(?Room $room): array { * * @param int $serverId ID of the signaling server * @psalm-param non-negative-int $serverId - * @return DataResponse, array{}>|DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse, array{}>|DataResponse * * 200: Welcome message returned * 404: Signaling server not found @@ -349,7 +349,7 @@ public function getWelcomeMessage(int $serverId): DataResponse { * * @param string $token Token of the room * @param string $messages JSON encoded messages - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Signaling message sent successfully * 400: Sending signaling message is not possible @@ -494,7 +494,7 @@ private function isTryingToPublishMedia(string $sdp, string $media): bool { * Get signaling messages * * @param string $token Token of the room - * @return DataResponse, array{}>|DataResponse + * @return DataResponse|string}>, array{}>|DataResponse * * 200: Signaling messages returned * 400: Getting signaling messages is not possible @@ -597,7 +597,7 @@ public function pullMessages(string $token): DataResponse { /** * @param Room $room * @param int $pingTimestamp - * @return TalkSignalingSession[] + * @return list */ protected function getUsersInRoom(Room $room, int $pingTimestamp): array { $usersInRoom = []; @@ -699,7 +699,7 @@ protected function getInputStream(): string { * See sections "Backend validation" in * https://nextcloud-spreed-signaling.readthedocs.io/en/latest/standalone-signaling-api-v1/#backend-requests * - * @return DataResponse}, room?: array{version: string, roomid?: string, properties?: array, permissions?: string[], session?: array}}, array{}> + * @return DataResponse}, room?: array{version: string, roomid?: string, properties?: array, permissions?: list, session?: array}}, array{}> * * 200: Always, sorry about that */ @@ -797,7 +797,7 @@ private function backendAuth(array $auth): DataResponse { } /** - * @return DataResponse, permissions: string[], session?: array}}, array{}> + * @return DataResponse, permissions: list, session?: array}}, array{}> */ private function backendRoom(array $roomRequest): DataResponse { $token = $roomRequest['roomid']; // It's actually the room token diff --git a/lib/Controller/TempAvatarController.php b/lib/Controller/TempAvatarController.php index 223d803e8d9..3ed249c5ab5 100644 --- a/lib/Controller/TempAvatarController.php +++ b/lib/Controller/TempAvatarController.php @@ -36,7 +36,7 @@ public function __construct( /** * Upload your avatar as a user * - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Avatar uploaded successfully * 400: Uploading avatar is not possible @@ -111,7 +111,7 @@ public function postAvatar(): DataResponse { /** * Delete your avatar as a user * - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Avatar deleted successfully * 400: Deleting avatar is not possible diff --git a/lib/Federation/Proxy/TalkV1/Controller/CallController.php b/lib/Federation/Proxy/TalkV1/Controller/CallController.php index a2852ec48ec..f1f938131ed 100644 --- a/lib/Federation/Proxy/TalkV1/Controller/CallController.php +++ b/lib/Federation/Proxy/TalkV1/Controller/CallController.php @@ -36,7 +36,7 @@ public function __construct( * * @param Room $room the federated room to get the call peers * @param Participant $participant the federated user to get the call peers - * @return DataResponse + * @return DataResponse, array{}> * @throws CannotReachRemoteException * * 200: List of peers in the call returned @@ -48,10 +48,10 @@ public function getPeersForCall(Room $room, Participant $participant): DataRespo $room->getRemoteServer() . '/ocs/v2.php/apps/spreed/api/v4/call/' . $room->getRemoteToken(), ); - /** @var TalkCallPeer[] $data */ + /** @var list $data */ $data = $this->proxy->getOCSData($proxy); - /** @var TalkCallPeer[] $data */ + /** @var list $data */ $data = $this->userConverter->convertAttendees($room, $data, 'actorType', 'actorId', 'displayName'); $statusCode = $proxy->getStatusCode(); @@ -73,7 +73,7 @@ public function getPeersForCall(Room $room, Participant $participant): DataRespo * @psalm-param int-mask-of $flags * @param bool $silent Join the call silently * @param bool $recordingConsent Agreement to be recorded - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * @throws CannotReachRemoteException * * 200: Federated user is now in the call @@ -108,7 +108,7 @@ public function joinFederatedCall(Room $room, Participant $participant, int $fla * @see \OCA\Talk\Controller\RoomController::ringAttendee() * * @param int $attendeeId ID of the attendee to ring - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * @throws CannotReachRemoteException * * 200: Attendee rang successfully @@ -142,7 +142,7 @@ public function ringAttendee(Room $room, Participant $participant, int $attendee * flags; the participant must have a session * @param int<0, 15> $flags New flags * @psalm-param int-mask-of $flags New flags - * @return DataResponse, array{}> + * @return DataResponse, array{}> * @throws CannotReachRemoteException * * 200: In-call flags updated successfully for federated user @@ -177,7 +177,7 @@ public function updateFederatedCallFlags(Room $room, Participant $participant, i * @param Room $room the federated room to leave the call in * @param Participant $participant the federated user that will leave the * call; the participant must have a session - * @return DataResponse, array{}> + * @return DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Federated user left the call diff --git a/lib/Federation/Proxy/TalkV1/Controller/ChatController.php b/lib/Federation/Proxy/TalkV1/Controller/ChatController.php index b1c3dfb245f..3ac7cf963c7 100644 --- a/lib/Federation/Proxy/TalkV1/Controller/ChatController.php +++ b/lib/Federation/Proxy/TalkV1/Controller/ChatController.php @@ -47,7 +47,7 @@ public function __construct( /** * @see \OCA\Talk\Controller\ChatController::sendMessage() * - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * @throws CannotReachRemoteException * * 201: Message sent successfully @@ -104,7 +104,7 @@ public function sendMessage(Room $room, Participant $participant, string $messag } /** - * @return DataResponse|DataResponse, array> + * @return DataResponse, array{'X-Chat-Last-Common-Read'?: numeric-string, X-Chat-Last-Given?: numeric-string}>|DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Messages returned @@ -197,16 +197,16 @@ public function receiveMessages( } } - /** @var TalkChatMessageWithParent[] $data */ + /** @var list $data */ $data = $this->proxy->getOCSData($proxy); - /** @var TalkChatMessageWithParent[] $data */ + /** @var list $data */ $data = $this->userConverter->convertMessages($room, $data); return new DataResponse($data, Http::STATUS_OK, $headers); } /** - * @return DataResponse|DataResponse, array> + * @return DataResponse, array{'X-Chat-Last-Common-Read'?: numeric-string, X-Chat-Last-Given?: numeric-string}>|DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Message context returned @@ -240,16 +240,16 @@ public function getMessageContext(Room $room, Participant $participant, int $mes $headers['X-Chat-Last-Given'] = (string)(int)$proxy->getHeader('X-Chat-Last-Given'); } - /** @var TalkChatMessageWithParent[] $data */ + /** @var list $data */ $data = $this->proxy->getOCSData($proxy); - /** @var TalkChatMessageWithParent[] $data */ + /** @var list $data */ $data = $this->userConverter->convertMessages($room, $data); return new DataResponse($data, Http::STATUS_OK, $headers); } /** - * @return DataResponse|DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse|DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Message edited successfully @@ -308,7 +308,7 @@ public function editMessage(Room $room, Participant $participant, int $messageId } /** - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Message deleted successfully @@ -446,7 +446,7 @@ public function markUnread(Room $room, Participant $participant, string $respons /** * @see \OCA\Talk\Controller\ChatController::mentions() * - * @return DataResponse + * @return DataResponse, array{}> * @throws CannotReachRemoteException * * 200: List of mention suggestions returned @@ -463,8 +463,9 @@ public function mentions(Room $room, Participant $participant, string $search, i ], ); - /** @var TalkChatMentionSuggestion[] $data */ + /** @var list $data */ $data = $this->proxy->getOCSData($proxy); + /** @var list $data */ $data = $this->userConverter->convertAttendees($room, $data, 'source', 'id', 'label'); // FIXME post-load status information diff --git a/lib/Federation/Proxy/TalkV1/Controller/PollController.php b/lib/Federation/Proxy/TalkV1/Controller/PollController.php index 7708b020962..5ca5b250b26 100644 --- a/lib/Federation/Proxy/TalkV1/Controller/PollController.php +++ b/lib/Federation/Proxy/TalkV1/Controller/PollController.php @@ -62,7 +62,7 @@ public function getDraftsForRoom(Room $room, Participant $participant): DataResp } /** - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Poll returned @@ -89,7 +89,7 @@ public function showPoll(Room $room, Participant $participant, int $pollId): Dat } /** - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Voted successfully @@ -166,7 +166,7 @@ public function createPoll(Room $room, Participant $participant, string $questio } /** - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Poll closed successfully diff --git a/lib/Federation/Proxy/TalkV1/Controller/ReactionController.php b/lib/Federation/Proxy/TalkV1/Controller/ReactionController.php index 234e2ceedfa..85620193eaf 100644 --- a/lib/Federation/Proxy/TalkV1/Controller/ReactionController.php +++ b/lib/Federation/Proxy/TalkV1/Controller/ReactionController.php @@ -32,7 +32,7 @@ public function __construct( * @param int $messageId ID of the message * @psalm-param non-negative-int $messageId * @param string $reaction Emoji to add - * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> + * @return DataResponse>|\stdClass, array{}>|DataResponse, array{}> * * 200: Reaction already existed * 201: Reaction added successfully @@ -73,7 +73,7 @@ public function react(Room $room, Participant $participant, int $messageId, stri * @param int $messageId ID of the message * @psalm-param non-negative-int $messageId * @param string $reaction Emoji to remove - * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> + * @return DataResponse>|\stdClass, array{}>|DataResponse, array{}> * * 200: Reaction deleted successfully * 400: Deleting reaction is not possible @@ -114,7 +114,7 @@ public function delete(Room $room, Participant $participant, int $messageId, str * @param int $messageId ID of the message * @psalm-param non-negative-int $messageId * @param string|null $reaction Emoji to filter - * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> + * @return DataResponse>|\stdClass, array{}>|DataResponse, array{}> * * 200: Reactions returned * 404: Message or reaction not found @@ -137,7 +137,7 @@ public function getReactions(Room $room, Participant $participant, int $messageI return new DataResponse([], Http::STATUS_NOT_FOUND); } - /** @var array $data */ + /** @var array> $data */ $data = $this->proxy->getOCSData($proxy); $data = $this->userConverter->convertReactionsList($room, $data); @@ -145,8 +145,8 @@ public function getReactions(Room $room, Participant $participant, int $messageI } /** - * @param array $reactions - * @return array|\stdClass + * @param array> $reactions + * @return array>|\stdClass */ protected function formatReactions(string $format, array $reactions): array|\stdClass { if ($format === 'json' && empty($reactions)) { diff --git a/lib/Federation/Proxy/TalkV1/Controller/RoomController.php b/lib/Federation/Proxy/TalkV1/Controller/RoomController.php index e7e75f7f7f2..db91c109ef1 100644 --- a/lib/Federation/Proxy/TalkV1/Controller/RoomController.php +++ b/lib/Federation/Proxy/TalkV1/Controller/RoomController.php @@ -33,7 +33,7 @@ public function __construct( /** * @see \OCA\Talk\Controller\RoomController::getParticipants() * - * @return DataResponse + * @return DataResponse, array{X-Nextcloud-Has-User-Statuses?: bool}> * @throws CannotReachRemoteException * * 200: Participants returned @@ -46,10 +46,10 @@ public function getParticipants(Room $room, Participant $participant): DataRespo $room->getRemoteServer() . '/ocs/v2.php/apps/spreed/api/v4/room/' . $room->getRemoteToken() . '/participants', ); - /** @var TalkParticipant[] $data */ + /** @var list $data */ $data = $this->proxy->getOCSData($proxy); - /** @var TalkParticipant[] $data */ + /** @var list $data */ $data = $this->userConverter->convertAttendees($room, $data, 'actorType', 'actorId', 'displayName'); $headers = []; if ($proxy->getHeader('X-Nextcloud-Has-User-Statuses')) { @@ -65,7 +65,7 @@ public function getParticipants(Room $room, Participant $participant): DataRespo * @param Room $room the federated room to join * @param Participant $participant the federated user to will join the room; * the participant must have a session - * @return DataResponse, array{X-Nextcloud-Talk-Proxy-Hash: string}> + * @return DataResponse, array{X-Nextcloud-Talk-Proxy-Hash: string}> * @throws CannotReachRemoteException * * 200: Federated user joined the room @@ -91,9 +91,10 @@ public function joinFederatedRoom(Room $room, Participant $participant): DataRes $headers = ['X-Nextcloud-Talk-Proxy-Hash' => $this->proxy->overwrittenRemoteTalkHash($proxy->getHeader('X-Nextcloud-Talk-Hash'))]; - /** @var TalkRoom[] $data */ + /** @var list $data */ $data = $this->proxy->getOCSData($proxy); + /** @var list $data */ $data = $this->userConverter->convertAttendee($room, $data, 'actorType', 'actorId', 'displayName'); return new DataResponse($data, $statusCode, $headers); @@ -105,7 +106,7 @@ public function joinFederatedRoom(Room $room, Participant $participant): DataRes * @param Room $room the federated room to leave * @param Participant $participant the federated user that will leave the * room; the participant must have a session - * @return DataResponse, array{}> + * @return DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Federated user left the room @@ -136,7 +137,7 @@ public function leaveFederatedRoom(Room $room, Participant $participant): DataRe /** * @see \OCA\Talk\Controller\RoomController::getCapabilities() * - * @return DataResponse, array{X-Nextcloud-Talk-Hash: string}> + * @return DataResponse, array{X-Nextcloud-Talk-Hash: string}> * @throws CannotReachRemoteException * * 200: Get capabilities successfully @@ -148,7 +149,7 @@ public function getCapabilities(Room $room, Participant $participant): DataRespo $room->getRemoteServer() . '/ocs/v2.php/apps/spreed/api/v4/room/' . $room->getRemoteToken() . '/capabilities', ); - /** @var TalkCapabilities|array $data */ + /** @var TalkCapabilities|list $data */ $data = $this->proxy->getOCSData($proxy); $headers = [ diff --git a/lib/Federation/Proxy/TalkV1/Controller/SignalingController.php b/lib/Federation/Proxy/TalkV1/Controller/SignalingController.php index 67a1c119dc5..72be9df3ee1 100644 --- a/lib/Federation/Proxy/TalkV1/Controller/SignalingController.php +++ b/lib/Federation/Proxy/TalkV1/Controller/SignalingController.php @@ -28,7 +28,7 @@ public function __construct( /** * @see \OCA\Talk\Controller\SignalingController::getSettings() * - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse, array{}> * @throws CannotReachRemoteException * * 200: Signaling settings returned @@ -50,7 +50,7 @@ public function getSettings(Room $room, Participant $participant): DataResponse throw new CannotReachRemoteException(); } - /** @var TalkSignalingSettings|array $data */ + /** @var TalkSignalingSettings|list $data */ $data = $this->proxy->getOCSData($proxy); return new DataResponse($data, $statusCode); diff --git a/lib/Federation/Proxy/TalkV1/UserConverter.php b/lib/Federation/Proxy/TalkV1/UserConverter.php index 6e435d38591..157338026e2 100644 --- a/lib/Federation/Proxy/TalkV1/UserConverter.php +++ b/lib/Federation/Proxy/TalkV1/UserConverter.php @@ -158,8 +158,8 @@ public function convertPoll(Room $room, array $poll): array { /** * @param Room $room - * @param TalkReaction[] $reactions - * @return TalkReaction[] + * @param list $reactions + * @return list */ protected function convertReactions(Room $room, array $reactions): array { return array_map( @@ -170,8 +170,8 @@ protected function convertReactions(Room $room, array $reactions): array { /** * @param Room $room - * @param array $reactionsList - * @return array + * @param array> $reactionsList + * @return array> */ public function convertReactionsList(Room $room, array $reactionsList): array { return array_map( diff --git a/lib/Model/BanMapper.php b/lib/Model/BanMapper.php index 52f52aff9f5..46295244973 100644 --- a/lib/Model/BanMapper.php +++ b/lib/Model/BanMapper.php @@ -16,7 +16,7 @@ /** * @method Ban mapRowToEntity(array $row) * @method Ban findEntity(IQueryBuilder $query) - * @method Ban[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class BanMapper extends QBMapper { @@ -39,6 +39,9 @@ public function findForBannedActorAndRoom(string $bannedActorType, string $banne return $this->findEntity($query); } + /** + * @return list + */ public function findByRoomId(int $roomId, ?string $bannedActorType = null): array { $query = $this->db->getQueryBuilder(); $query->select('*') diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 9722340e49d..04bbb106658 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -113,7 +113,7 @@ * isReplyable: bool, * markdown: bool, * reactions: array|\stdClass, - * reactionsSelf?: string[], + * reactionsSelf?: list, * referenceId: string, * timestamp: int, * token: string, @@ -156,7 +156,7 @@ * inviterDisplayName: string, * } * - * @psalm-type TalkMatterbridgeConfigFields = array> + * @psalm-type TalkMatterbridgeConfigFields = list> * * @psalm-type TalkMatterbridge = array{ * enabled: bool, @@ -184,7 +184,7 @@ * participantType: int, * permissions: int, * roomToken: string, - * sessionIds: string[], + * sessionIds: list, * status?: string, * statusClearAt?: ?int, * statusIcon?: ?string, @@ -213,9 +213,9 @@ * } * * @psalm-type TalkPoll = TalkPollDraft&array{ - * details?: TalkPollVote[], + * details?: list, * numVoters?: int<0, max>, - * votedSelf?: int[], + * votedSelf?: list, * votes?: array, * } * @@ -254,7 +254,7 @@ * isFavorite: bool, * lastActivity: int, * lastCommonReadMessage: int, - * lastMessage: TalkRoomLastMessage|array, + * lastMessage: TalkRoomLastMessage|list, * lastPing: int, * lastReadMessage: int, * listable: int, @@ -307,7 +307,7 @@ * token: string, * }, * roomId: string, - * }|array, + * }|list, * helloAuthParams: array{ * "1.0": array{ * userid: ?string, @@ -321,15 +321,15 @@ * server: string, * signalingMode: string, * sipDialinInfo: string, - * stunservers: array{urls: string[]}[], + * stunservers: list}>, * ticket: string, - * turnservers: array{urls: string[], username: string, credential: mixed}[], + * turnservers: list, username: string, credential: mixed}>, * userId: ?string, * } * * @psalm-type TalkCapabilities = array{ - * features: string[], - * features-local: string[], + * features: list, + * features-local: list, * config: array{ * attachments: array{ * allowed: bool, @@ -340,8 +340,8 @@ * breakout-rooms: bool, * recording: bool, * recording-consent: int, - * supported-reactions: string[], - * predefined-backgrounds: string[], + * supported-reactions: list, + * predefined-backgrounds: list, * can-upload-background: bool, * sip-enabled: bool, * sip-dialout-enabled: bool, @@ -372,7 +372,7 @@ * hello-v2-token-key?: string, * }, * }, - * config-local: array, + * config-local: array>, * version: string, * } */ diff --git a/lib/Service/BanService.php b/lib/Service/BanService.php index 883f1629dea..876a4f9bfeb 100644 --- a/lib/Service/BanService.php +++ b/lib/Service/BanService.php @@ -224,7 +224,7 @@ public function isActorBanned(Room $room, string $actorType, string $actorId): b /** * Retrieve all bans for a specific room. * - * @return Ban[] + * @return list */ public function getBansForRoom(int $roomId): array { return $this->banMapper->findByRoomId($roomId); diff --git a/lib/Service/BreakoutRoomService.php b/lib/Service/BreakoutRoomService.php index 832905499fe..f0643664b44 100644 --- a/lib/Service/BreakoutRoomService.php +++ b/lib/Service/BreakoutRoomService.php @@ -416,7 +416,7 @@ public function startBreakoutRooms(Room $parent): array { /** * @param Room $parent - * @return Room[] + * @return list */ public function stopBreakoutRooms(Room $parent): array { if ($parent->getBreakoutRoomMode() === BreakoutRoom::MODE_NOT_CONFIGURED) { diff --git a/lib/Service/RoomFormatter.php b/lib/Service/RoomFormatter.php index 86ee4104268..c674135add5 100644 --- a/lib/Service/RoomFormatter.php +++ b/lib/Service/RoomFormatter.php @@ -406,7 +406,7 @@ public function formatRoomV4( } /** - * @return TalkRoomLastMessage|array + * @return TalkRoomLastMessage|list */ public function formatLastMessage( string $responseFormat, diff --git a/openapi-administration.json b/openapi-administration.json index fa4e80bed78..828d3c1664a 100644 --- a/openapi-administration.json +++ b/openapi-administration.json @@ -326,23 +326,12 @@ } }, "PublicCapabilities": { - "oneOf": [ - { - "type": "object", - "required": [ - "spreed" - ], - "properties": { - "spreed": { - "$ref": "#/components/schemas/Capabilities" - } - } - }, - { - "type": "array", - "maxItems": 0 + "type": "object", + "properties": { + "spreed": { + "$ref": "#/components/schemas/Capabilities" } - ] + } } } }, diff --git a/openapi-backend-recording.json b/openapi-backend-recording.json index f6b1d452627..e39ac6889db 100644 --- a/openapi-backend-recording.json +++ b/openapi-backend-recording.json @@ -259,23 +259,12 @@ } }, "PublicCapabilities": { - "oneOf": [ - { - "type": "object", - "required": [ - "spreed" - ], - "properties": { - "spreed": { - "$ref": "#/components/schemas/Capabilities" - } - } - }, - { - "type": "array", - "maxItems": 0 + "type": "object", + "properties": { + "spreed": { + "$ref": "#/components/schemas/Capabilities" } - ] + } } } }, diff --git a/openapi-backend-signaling.json b/openapi-backend-signaling.json index ad42624f290..e558a105b79 100644 --- a/openapi-backend-signaling.json +++ b/openapi-backend-signaling.json @@ -259,23 +259,12 @@ } }, "PublicCapabilities": { - "oneOf": [ - { - "type": "object", - "required": [ - "spreed" - ], - "properties": { - "spreed": { - "$ref": "#/components/schemas/Capabilities" - } - } - }, - { - "type": "array", - "maxItems": 0 + "type": "object", + "properties": { + "spreed": { + "$ref": "#/components/schemas/Capabilities" } - ] + } } } }, diff --git a/openapi-backend-sipbridge.json b/openapi-backend-sipbridge.json index 5df0b9eeb46..52569efb6cc 100644 --- a/openapi-backend-sipbridge.json +++ b/openapi-backend-sipbridge.json @@ -381,23 +381,12 @@ } }, "PublicCapabilities": { - "oneOf": [ - { - "type": "object", - "required": [ - "spreed" - ], - "properties": { - "spreed": { - "$ref": "#/components/schemas/Capabilities" - } - } - }, - { - "type": "array", - "maxItems": 0 + "type": "object", + "properties": { + "spreed": { + "$ref": "#/components/schemas/Capabilities" } - ] + } }, "RichObjectParameter": { "type": "object", diff --git a/openapi-bots.json b/openapi-bots.json index 8f24560fe4b..83ddb300e9b 100644 --- a/openapi-bots.json +++ b/openapi-bots.json @@ -259,23 +259,12 @@ } }, "PublicCapabilities": { - "oneOf": [ - { - "type": "object", - "required": [ - "spreed" - ], - "properties": { - "spreed": { - "$ref": "#/components/schemas/Capabilities" - } - } - }, - { - "type": "array", - "maxItems": 0 + "type": "object", + "properties": { + "spreed": { + "$ref": "#/components/schemas/Capabilities" } - ] + } } } }, diff --git a/openapi-federation.json b/openapi-federation.json index 1b2274d22c7..941fdb51f45 100644 --- a/openapi-federation.json +++ b/openapi-federation.json @@ -435,23 +435,12 @@ } }, "PublicCapabilities": { - "oneOf": [ - { - "type": "object", - "required": [ - "spreed" - ], - "properties": { - "spreed": { - "$ref": "#/components/schemas/Capabilities" - } - } - }, - { - "type": "array", - "maxItems": 0 + "type": "object", + "properties": { + "spreed": { + "$ref": "#/components/schemas/Capabilities" } - ] + } }, "RichObjectParameter": { "type": "object", diff --git a/openapi-full.json b/openapi-full.json index b6f65dfcd2c..0fd153e8942 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -988,23 +988,12 @@ } }, "PublicCapabilities": { - "oneOf": [ - { - "type": "object", - "required": [ - "spreed" - ], - "properties": { - "spreed": { - "$ref": "#/components/schemas/Capabilities" - } - } - }, - { - "type": "array", - "maxItems": 0 + "type": "object", + "properties": { + "spreed": { + "$ref": "#/components/schemas/Capabilities" } - ] + } }, "Reaction": { "type": "object", diff --git a/openapi.json b/openapi.json index 5c125efe00e..94ff9c2563e 100644 --- a/openapi.json +++ b/openapi.json @@ -875,23 +875,12 @@ } }, "PublicCapabilities": { - "oneOf": [ - { - "type": "object", - "required": [ - "spreed" - ], - "properties": { - "spreed": { - "$ref": "#/components/schemas/Capabilities" - } - } - }, - { - "type": "array", - "maxItems": 0 + "type": "object", + "properties": { + "spreed": { + "$ref": "#/components/schemas/Capabilities" } - ] + } }, "Reaction": { "type": "object", diff --git a/src/types/openapi/openapi-administration.ts b/src/types/openapi/openapi-administration.ts index e960be1a078..6aa583cb1c8 100644 --- a/src/types/openapi/openapi-administration.ts +++ b/src/types/openapi/openapi-administration.ts @@ -273,8 +273,8 @@ export type components = { itemsperpage?: string; }; PublicCapabilities: { - spreed: components["schemas"]["Capabilities"]; - } | unknown[]; + spreed?: components["schemas"]["Capabilities"]; + }; }; responses: never; parameters: never; diff --git a/src/types/openapi/openapi-backend-recording.ts b/src/types/openapi/openapi-backend-recording.ts index 63f3a3b8602..6a0b72a4aab 100644 --- a/src/types/openapi/openapi-backend-recording.ts +++ b/src/types/openapi/openapi-backend-recording.ts @@ -107,8 +107,8 @@ export type components = { itemsperpage?: string; }; PublicCapabilities: { - spreed: components["schemas"]["Capabilities"]; - } | unknown[]; + spreed?: components["schemas"]["Capabilities"]; + }; }; responses: never; parameters: never; diff --git a/src/types/openapi/openapi-backend-signaling.ts b/src/types/openapi/openapi-backend-signaling.ts index 54bf7d5d98b..9ac4c03d151 100644 --- a/src/types/openapi/openapi-backend-signaling.ts +++ b/src/types/openapi/openapi-backend-signaling.ts @@ -93,8 +93,8 @@ export type components = { itemsperpage?: string; }; PublicCapabilities: { - spreed: components["schemas"]["Capabilities"]; - } | unknown[]; + spreed?: components["schemas"]["Capabilities"]; + }; }; responses: never; parameters: never; diff --git a/src/types/openapi/openapi-backend-sipbridge.ts b/src/types/openapi/openapi-backend-sipbridge.ts index 84e84856e36..5c436e5e845 100644 --- a/src/types/openapi/openapi-backend-sipbridge.ts +++ b/src/types/openapi/openapi-backend-sipbridge.ts @@ -211,8 +211,8 @@ export type components = { itemsperpage?: string; }; PublicCapabilities: { - spreed: components["schemas"]["Capabilities"]; - } | unknown[]; + spreed?: components["schemas"]["Capabilities"]; + }; RichObjectParameter: { type: string; id: string; diff --git a/src/types/openapi/openapi-bots.ts b/src/types/openapi/openapi-bots.ts index 5e29b8e7795..b1ff120a214 100644 --- a/src/types/openapi/openapi-bots.ts +++ b/src/types/openapi/openapi-bots.ts @@ -111,8 +111,8 @@ export type components = { itemsperpage?: string; }; PublicCapabilities: { - spreed: components["schemas"]["Capabilities"]; - } | unknown[]; + spreed?: components["schemas"]["Capabilities"]; + }; }; responses: never; parameters: never; diff --git a/src/types/openapi/openapi-federation.ts b/src/types/openapi/openapi-federation.ts index b498f99f0f7..f3c3f1bbf36 100644 --- a/src/types/openapi/openapi-federation.ts +++ b/src/types/openapi/openapi-federation.ts @@ -258,8 +258,8 @@ export type components = { itemsperpage?: string; }; PublicCapabilities: { - spreed: components["schemas"]["Capabilities"]; - } | unknown[]; + spreed?: components["schemas"]["Capabilities"]; + }; RichObjectParameter: { type: string; id: string; diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index d4f3325ea0a..87a7538586f 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -2116,8 +2116,8 @@ export type components = { optionId: number; }; PublicCapabilities: { - spreed: components["schemas"]["Capabilities"]; - } | unknown[]; + spreed?: components["schemas"]["Capabilities"]; + }; Reaction: { actorDisplayName: string; actorId: string; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 0773d2a108f..57e91cac596 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -1597,8 +1597,8 @@ export type components = { optionId: number; }; PublicCapabilities: { - spreed: components["schemas"]["Capabilities"]; - } | unknown[]; + spreed?: components["schemas"]["Capabilities"]; + }; Reaction: { actorDisplayName: string; actorId: string;