diff --git a/lib/Command/Room/TRoomCommand.php b/lib/Command/Room/TRoomCommand.php index 75f7925626c..249b92beece 100644 --- a/lib/Command/Room/TRoomCommand.php +++ b/lib/Command/Room/TRoomCommand.php @@ -12,6 +12,7 @@ use OCA\Talk\Events\AAttendeeRemovedEvent; use OCA\Talk\Exceptions\ParticipantNotFoundException; use OCA\Talk\Exceptions\RoomNotFoundException; +use OCA\Talk\Exceptions\RoomProperty\NameException; use OCA\Talk\Manager; use OCA\Talk\MatterbridgeManager; use OCA\Talk\Model\Attendee; @@ -56,7 +57,9 @@ protected function setRoomName(Room $room, string $name): void { throw new InvalidArgumentException('Invalid room name.'); } - if (!$this->roomService->setName($room, $name)) { + try { + $this->roomService->setName($room, $name); + } catch (NameException) { throw new InvalidArgumentException('Unable to change room name.'); } } diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 35f94d0b7e1..0fd609102cf 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -17,6 +17,11 @@ use OCA\Talk\Exceptions\InvalidPasswordException; use OCA\Talk\Exceptions\ParticipantNotFoundException; use OCA\Talk\Exceptions\RoomNotFoundException; +use OCA\Talk\Exceptions\RoomProperty\DefaultPermissionsException; +use OCA\Talk\Exceptions\RoomProperty\LobbyException; +use OCA\Talk\Exceptions\RoomProperty\NameException; +use OCA\Talk\Exceptions\RoomProperty\RecordingConsentException; +use OCA\Talk\Exceptions\RoomProperty\SipConfigurationException; use OCA\Talk\Exceptions\UnauthorizedException; use OCA\Talk\Federation\Authenticator; use OCA\Talk\Federation\FederationManager; @@ -776,7 +781,7 @@ public function setNotificationCalls(int $level): DataResponse { * Rename a room * * @param string $roomName New name - * @return DataResponse, array{}> + * @return DataResponse, array{}>|DataResponse * * 200: Room renamed successfully * 400: Renaming room is not possible @@ -784,17 +789,11 @@ public function setNotificationCalls(int $level): DataResponse { #[PublicPage] #[RequireModeratorParticipant] public function renameRoom(string $roomName): DataResponse { - if ($this->room->getType() === Room::TYPE_ONE_TO_ONE || $this->room->getType() === Room::TYPE_ONE_TO_ONE_FORMER) { - return new DataResponse([], Http::STATUS_BAD_REQUEST); - } - - $roomName = trim($roomName); - - if ($roomName === '' || mb_strlen($roomName) > 255) { - return new DataResponse([], Http::STATUS_BAD_REQUEST); + try { + $this->roomService->setName($this->room, $roomName, validateType: true); + } catch (NameException $e) { + return new DataResponse(['error' => $e->getReason()], Http::STATUS_BAD_REQUEST); } - - $this->roomService->setName($this->room, $roomName); return new DataResponse(); } @@ -2109,7 +2108,7 @@ protected function changeParticipantType(int $attendeeId, bool $promote): DataRe * @param 'call'|'default' $mode Level of the permissions ('call' (removed in Talk 20), 'default') * @param int<0, 255> $permissions New permissions * @psalm-param int-mask-of $permissions - * @return DataResponse|DataResponse + * @return DataResponse|DataResponse * * 200: Permissions updated successfully * 400: Updating permissions is not possible @@ -2123,10 +2122,8 @@ public function setPermissions(string $mode, int $permissions): DataResponse { try { $this->roomService->setDefaultPermissions($this->room, $permissions); - } catch (\InvalidArgumentException $e) { - /** @var 'breakout-room'|'type' $error */ - $error = $e->getMessage(); - return new DataResponse(['error' => $error], Http::STATUS_BAD_REQUEST); + } catch (DefaultPermissionsException $e) { + return new DataResponse(['error' => $e->getReason()], Http::STATUS_BAD_REQUEST); } return new DataResponse($this->formatRoom($this->room, $this->participant)); @@ -2199,7 +2196,7 @@ public function setAllAttendeesPermissions(string $method, int $permissions): Da * @psalm-param Webinary::LOBBY_* $state * @param int|null $timer Timer when the lobby will be removed * @psalm-param non-negative-int|null $timer - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse * * 200: Lobby state updated successfully * 400: Updating lobby state is not possible @@ -2213,17 +2210,19 @@ public function setLobby(int $state, ?int $timer = null): DataResponse { $timerDateTime = $this->timeFactory->getDateTime('@' . $timer); $timerDateTime->setTimezone(new \DateTimeZone('UTC')); } catch (\Exception $e) { - return new DataResponse([], Http::STATUS_BAD_REQUEST); + return new DataResponse(['error' => LobbyException::REASON_VALUE], Http::STATUS_BAD_REQUEST); } } if ($this->room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) { // Do not allow manual changing the lobby in breakout rooms - return new DataResponse([], Http::STATUS_BAD_REQUEST); + return new DataResponse(['error' => LobbyException::REASON_BREAKOUT_ROOM], Http::STATUS_BAD_REQUEST); } - if (!$this->roomService->setLobby($this->room, $state, $timerDateTime)) { - return new DataResponse([], Http::STATUS_BAD_REQUEST); + try { + $this->roomService->setLobby($this->room, $state, $timerDateTime); + } catch (LobbyException $e) { + return new DataResponse(['error' => $e->getReason()], Http::STATUS_BAD_REQUEST); } if ($state === Webinary::LOBBY_NON_MODERATORS) { @@ -2245,7 +2244,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{}> + * @return DataResponse|DataResponse, array{}>|DataResponse * * 200: SIP enabled state updated successfully * 400: Updating SIP enabled state is not possible @@ -2269,8 +2268,10 @@ public function setSIPEnabled(int $state): DataResponse { return new DataResponse([], Http::STATUS_PRECONDITION_FAILED); } - if (!$this->roomService->setSIPEnabled($this->room, $state)) { - return new DataResponse([], Http::STATUS_BAD_REQUEST); + try { + $this->roomService->setSIPEnabled($this->room, $state); + } catch (SipConfigurationException $e) { + return new DataResponse(['error' => $e->getReason()], Http::STATUS_BAD_REQUEST); } return new DataResponse($this->formatRoom($this->room, $this->participant)); @@ -2282,7 +2283,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 @@ -2297,8 +2298,8 @@ public function setRecordingConsent(int $recordingConsent): DataResponse { try { $this->roomService->setRecordingConsent($this->room, $recordingConsent); - } catch (\InvalidArgumentException $exception) { - return new DataResponse(['error' => $exception->getMessage()], Http::STATUS_BAD_REQUEST); + } catch (RecordingConsentException $e) { + return new DataResponse(['error' => $e->getReason()], Http::STATUS_BAD_REQUEST); } return new DataResponse($this->formatRoom($this->room, $this->participant)); diff --git a/lib/Exceptions/RoomProperty/DefaultPermissionsException.php b/lib/Exceptions/RoomProperty/DefaultPermissionsException.php new file mode 100644 index 00000000000..4cec622dbd9 --- /dev/null +++ b/lib/Exceptions/RoomProperty/DefaultPermissionsException.php @@ -0,0 +1,31 @@ +reason; + } +} diff --git a/lib/Exceptions/RoomProperty/LobbyException.php b/lib/Exceptions/RoomProperty/LobbyException.php new file mode 100644 index 00000000000..eee55f9d37a --- /dev/null +++ b/lib/Exceptions/RoomProperty/LobbyException.php @@ -0,0 +1,32 @@ +reason; + } +} diff --git a/lib/Exceptions/RoomProperty/NameException.php b/lib/Exceptions/RoomProperty/NameException.php new file mode 100644 index 00000000000..971a6bc35fd --- /dev/null +++ b/lib/Exceptions/RoomProperty/NameException.php @@ -0,0 +1,30 @@ +reason; + } +} diff --git a/lib/Exceptions/RoomProperty/RecordingConsentException.php b/lib/Exceptions/RoomProperty/RecordingConsentException.php new file mode 100644 index 00000000000..93180b3f111 --- /dev/null +++ b/lib/Exceptions/RoomProperty/RecordingConsentException.php @@ -0,0 +1,31 @@ +reason; + } +} diff --git a/lib/Exceptions/RoomProperty/SipConfigurationException.php b/lib/Exceptions/RoomProperty/SipConfigurationException.php new file mode 100644 index 00000000000..2fe27a7d2d1 --- /dev/null +++ b/lib/Exceptions/RoomProperty/SipConfigurationException.php @@ -0,0 +1,32 @@ +reason; + } +} diff --git a/lib/Service/RoomService.php b/lib/Service/RoomService.php index 36d4c8f82f7..a30baefed7f 100644 --- a/lib/Service/RoomService.php +++ b/lib/Service/RoomService.php @@ -27,6 +27,11 @@ use OCA\Talk\Events\RoomPasswordVerifyEvent; use OCA\Talk\Events\RoomSyncedEvent; use OCA\Talk\Exceptions\RoomNotFoundException; +use OCA\Talk\Exceptions\RoomProperty\DefaultPermissionsException; +use OCA\Talk\Exceptions\RoomProperty\LobbyException; +use OCA\Talk\Exceptions\RoomProperty\NameException; +use OCA\Talk\Exceptions\RoomProperty\RecordingConsentException; +use OCA\Talk\Exceptions\RoomProperty\SipConfigurationException; use OCA\Talk\Manager; use OCA\Talk\Model\Attendee; use OCA\Talk\Model\BreakoutRoom; @@ -186,18 +191,23 @@ public function setPermissions(Room $room, string $level, string $method, int $p } /** - * @throws InvalidArgumentException + * @throws DefaultPermissionsException */ public function setDefaultPermissions(Room $room, int $permissions): void { if ($room->getType() === Room::TYPE_ONE_TO_ONE || $room->getType() === Room::TYPE_ONE_TO_ONE_FORMER || $room->getType() === Room::TYPE_NOTE_TO_SELF) { - throw new \InvalidArgumentException('type'); + throw new DefaultPermissionsException(DefaultPermissionsException::REASON_TYPE); } if ($room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) { // Do not allow manual changing the permissions in breakout rooms - throw new InvalidArgumentException('breakout-room'); + throw new DefaultPermissionsException(DefaultPermissionsException::REASON_BREAKOUT_ROOM); + } + + if ($permissions < 0 || $permissions > 255) { + // Do not allow manual changing the permissions in breakout rooms + throw new DefaultPermissionsException(DefaultPermissionsException::REASON_VALUE); } $oldPermissions = $room->getDefaultPermissions(); @@ -225,27 +235,30 @@ public function setDefaultPermissions(Room $room, int $permissions): void { $this->dispatcher->dispatchTyped($event); } - public function setSIPEnabled(Room $room, int $newSipEnabled): bool { + /** + * @throws SipConfigurationException + */ + public function setSIPEnabled(Room $room, int $newSipEnabled): void { $oldSipEnabled = $room->getSIPEnabled(); if ($newSipEnabled === $oldSipEnabled) { - return false; + return; } if ($room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) { - return false; + throw new SipConfigurationException(SipConfigurationException::REASON_BREAKOUT_ROOM); } if (!in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) { - return false; + throw new SipConfigurationException(SipConfigurationException::REASON_TYPE); } if (!in_array($newSipEnabled, [Webinary::SIP_ENABLED_NO_PIN, Webinary::SIP_ENABLED, Webinary::SIP_DISABLED], true)) { - return false; + throw new SipConfigurationException(SipConfigurationException::REASON_VALUE); } if (preg_match(Room::SIP_INCOMPATIBLE_REGEX, $room->getToken())) { - return false; + throw new SipConfigurationException(SipConfigurationException::REASON_TOKEN); } $event = new BeforeRoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_SIP_ENABLED, $newSipEnabled, $oldSipEnabled); @@ -261,13 +274,11 @@ public function setSIPEnabled(Room $room, int $newSipEnabled): bool { $event = new RoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_SIP_ENABLED, $newSipEnabled, $oldSipEnabled); $this->dispatcher->dispatchTyped($event); - - return true; } /** * @psalm-param RecordingService::CONSENT_REQUIRED_* $recordingConsent - * @throws InvalidArgumentException When the room has an active call or the value is invalid + * @throws RecordingConsentException When the room has an active call or the value is invalid */ public function setRecordingConsent(Room $room, int $recordingConsent, bool $allowUpdatingBreakoutRooms = false): void { $oldRecordingConsent = $room->getRecordingConsent(); @@ -277,19 +288,19 @@ public function setRecordingConsent(Room $room, int $recordingConsent, bool $all } if (!in_array($recordingConsent, [RecordingService::CONSENT_REQUIRED_NO, RecordingService::CONSENT_REQUIRED_YES], true)) { - throw new InvalidArgumentException('value'); + throw new RecordingConsentException(RecordingConsentException::REASON_VALUE); } if ($recordingConsent !== RecordingService::CONSENT_REQUIRED_NO && $room->getCallFlag() !== Participant::FLAG_DISCONNECTED) { - throw new InvalidArgumentException('call'); + throw new RecordingConsentException(RecordingConsentException::REASON_CALL); } if (!$allowUpdatingBreakoutRooms && $room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) { - throw new InvalidArgumentException('breakout-room'); + throw new RecordingConsentException(RecordingConsentException::REASON_BREAKOUT_ROOM); } if ($room->getBreakoutRoomStatus() !== BreakoutRoom::STATUS_STOPPED) { - throw new InvalidArgumentException('breakout-room'); + throw new RecordingConsentException(RecordingConsentException::REASON_BREAKOUT_ROOM); } $event = new BeforeRoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_RECORDING_CONSENT, $recordingConsent, $oldRecordingConsent); @@ -320,13 +331,21 @@ public function setRecordingConsent(Room $room, int $recordingConsent, bool $all } /** - * @param string $newName Currently it is only allowed to rename: self::TYPE_GROUP, self::TYPE_PUBLIC - * @return bool True when the change was valid, false otherwise + * @throws NameException */ - public function setName(Room $room, string $newName, ?string $oldName = null): bool { - $oldName = $oldName !== null ? $oldName : $room->getName(); + public function setName(Room $room, string $newName, ?string $oldName = null, bool $validateType = false): void { + if ($validateType && ($room->getType() === Room::TYPE_ONE_TO_ONE || $room->getType() === Room::TYPE_ONE_TO_ONE_FORMER)) { + throw new NameException(NameException::REASON_TYPE); + } + + $newName = trim($newName); + $oldName = $oldName ?? $room->getName(); if ($newName === $oldName) { - return false; + return; + } + + if ($newName === '' || mb_strlen($newName) > 255) { + throw new NameException(NameException::REASON_VALUE); } $event = new BeforeRoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_NAME, $newName, $oldName); @@ -342,8 +361,6 @@ public function setName(Room $room, string $newName, ?string $oldName = null): b $event = new RoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_NAME, $newName, $oldName); $this->dispatcher->dispatchTyped($event); - - return true; } /** @@ -355,21 +372,21 @@ public function setName(Room $room, string $newName, ?string $oldName = null): b * @param \DateTime|null $dateTime * @param bool $timerReached * @param bool $dispatchEvents (Only skip if the room is created in the same PHP request) - * @return bool True when the change was valid, false otherwise + * @throws LobbyException */ - public function setLobby(Room $room, int $newState, ?\DateTime $dateTime, bool $timerReached = false, bool $dispatchEvents = true): bool { + public function setLobby(Room $room, int $newState, ?\DateTime $dateTime, bool $timerReached = false, bool $dispatchEvents = true): void { $oldState = $room->getLobbyState(false); if (!in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) { - return false; + throw new LobbyException(LobbyException::REASON_TYPE); } if ($room->getObjectType() !== '' && $room->getObjectType() !== BreakoutRoom::PARENT_OBJECT_TYPE) { - return false; + throw new LobbyException(LobbyException::REASON_OBJECT); } if (!in_array($newState, [Webinary::LOBBY_NON_MODERATORS, Webinary::LOBBY_NONE], true)) { - return false; + throw new LobbyException(LobbyException::REASON_VALUE); } if ($dispatchEvents) { @@ -391,8 +408,6 @@ public function setLobby(Room $room, int $newState, ?\DateTime $dateTime, bool $ $event = new LobbyModifiedEvent($room, $newState, $oldState, $dateTime, $timerReached); $this->dispatcher->dispatchTyped($event); } - - return true; } public function setAvatar(Room $room, string $avatar): bool { @@ -1008,11 +1023,11 @@ public function syncPropertiesFromHostRoom(Room $local, array $host): void { } } if (isset($host['name']) && $host['name'] !== $local->getName()) { - $success = $this->setName($local, $host['name'], $local->getName()); - if (!$success) { - $this->logger->error('An error occurred while trying to sync name of ' . $local->getId() . ' to ' . $host['name']); - } else { + try { + $this->setName($local, $host['name'], $local->getName()); $changed[] = ARoomModifiedEvent::PROPERTY_NAME; + } catch (NameException $e) { + $this->logger->error('An error (' . $e->getReason() . ') occurred while trying to sync name of ' . $local->getId() . ' to ' . $host['name'], ['exception' => $e]); } } if (isset($host['description']) && $host['description'] !== $local->getDescription()) { @@ -1039,8 +1054,8 @@ public function syncPropertiesFromHostRoom(Room $local, array $host): void { try { $this->setDefaultPermissions($local, $host['defaultPermissions']); $changed[] = ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS; - } catch (\InvalidArgumentException $e) { - $this->logger->error('An error (' . $e->getMessage() . ') occurred while trying to sync defaultPermissions of ' . $local->getId() . ' to ' . $host['defaultPermissions'], ['exception' => $e]); + } catch (DefaultPermissionsException $e) { + $this->logger->error('An error (' . $e->getReason() . ') occurred while trying to sync defaultPermissions of ' . $local->getId() . ' to ' . $host['defaultPermissions'], ['exception' => $e]); } } if (isset($host['avatarVersion']) && $host['avatarVersion'] !== $local->getAvatar()) { @@ -1063,11 +1078,11 @@ public function syncPropertiesFromHostRoom(Room $local, array $host): void { } if (isset($host['lobbyState'], $host['lobbyTimer']) && ($host['lobbyState'] !== $local->getLobbyState(false) || $host['lobbyTimer'] !== ((int)$local->getLobbyTimer(false)?->getTimestamp()))) { $hostTimer = $host['lobbyTimer'] === 0 ? null : $this->timeFactory->getDateTime('@' . $host['lobbyTimer']); - $success = $this->setLobby($local, $host['lobbyState'], $hostTimer); - if (!$success) { - $this->logger->error('An error occurred while trying to sync lobby of ' . $local->getId() . ' to ' . $host['lobbyState'] . ' with timer to ' . $host['lobbyTimer']); - } else { + try { + $this->setLobby($local, $host['lobbyState'], $hostTimer); $changed[] = ARoomModifiedEvent::PROPERTY_LOBBY; + } catch (LobbyException $e) { + $this->logger->error('An error (' . $e->getReason() . ') occurred while trying to sync lobby of ' . $local->getId() . ' to ' . $host['lobbyState'] . ' with timer to ' . $host['lobbyTimer'], ['exception' => $e]); } } if (isset($host['callStartTime'], $host['callFlag'])) { @@ -1111,16 +1126,16 @@ public function syncPropertiesFromHostRoom(Room $local, array $host): void { try { $this->setRecordingConsent($local, $host['recordingConsent'], true); $changed[] = ARoomModifiedEvent::PROPERTY_RECORDING_CONSENT; - } catch (\InvalidArgumentException $e) { - $this->logger->error('An error (' . $e->getMessage() . ') occurred while trying to sync recordingConsent of ' . $local->getId() . ' to ' . $host['recordingConsent'], ['exception' => $e]); + } catch (RecordingConsentException $e) { + $this->logger->error('An error (' . $e->getReason() . ') occurred while trying to sync recordingConsent of ' . $local->getId() . ' to ' . $host['recordingConsent'], ['exception' => $e]); } } if (isset($host['sipEnabled']) && $host['sipEnabled'] !== $local->getSIPEnabled()) { - $success = $this->setSIPEnabled($local, $host['sipEnabled']); - if (!$success) { - $this->logger->error('An error occurred while trying to sync sipEnabled of ' . $local->getId() . ' to ' . $host['sipEnabled']); - } else { + try { + $this->setSIPEnabled($local, $host['sipEnabled']); $changed[] = ARoomModifiedEvent::PROPERTY_SIP_ENABLED; + } catch (SipConfigurationException $e) { + $this->logger->error('An error (' . $e->getReason() . ') occurred while trying to sync sipEnabled of ' . $local->getId() . ' to ' . $host['sipEnabled'], ['exception' => $e]); } } diff --git a/openapi-full.json b/openapi-full.json index 17ebdf1963e..99d6e2907e6 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -12214,7 +12214,8 @@ "enum": [ "breakout-room", "mode", - "type" + "type", + "value" ] } } @@ -14916,7 +14917,23 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "breakout-room", + "object", + "type", + "value" + ] + } + } + } } } } @@ -15031,8 +15048,8 @@ } } }, - "400": { - "description": "Updating SIP enabled state is not possible", + "401": { + "description": "User not found", "content": { "application/json": { "schema": { @@ -15059,8 +15076,8 @@ } } }, - "401": { - "description": "User not found", + "403": { + "description": "Missing permissions to update SIP enabled state", "content": { "application/json": { "schema": { @@ -15087,8 +15104,8 @@ } } }, - "403": { - "description": "Missing permissions to update SIP enabled state", + "412": { + "description": "SIP not configured", "content": { "application/json": { "schema": { @@ -15115,8 +15132,8 @@ } } }, - "412": { - "description": "SIP not configured", + "400": { + "description": "Updating SIP enabled state is not possible", "content": { "application/json": { "schema": { @@ -15135,7 +15152,23 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "breakout-room", + "token", + "type", + "value" + ] + } + } + } } } } @@ -15272,7 +15305,12 @@ ], "properties": { "error": { - "type": "string" + "type": "string", + "enum": [ + "breakout-room", + "call", + "value" + ] } } } diff --git a/openapi.json b/openapi.json index b1c4193eefa..24c01677c95 100644 --- a/openapi.json +++ b/openapi.json @@ -11175,7 +11175,21 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "type", + "value" + ] + } + } + } } } } @@ -12334,7 +12348,8 @@ "enum": [ "breakout-room", "mode", - "type" + "type", + "value" ] } } @@ -15036,7 +15051,23 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "breakout-room", + "object", + "type", + "value" + ] + } + } + } } } } @@ -15151,8 +15182,8 @@ } } }, - "400": { - "description": "Updating SIP enabled state is not possible", + "401": { + "description": "User not found", "content": { "application/json": { "schema": { @@ -15179,8 +15210,8 @@ } } }, - "401": { - "description": "User not found", + "403": { + "description": "Missing permissions to update SIP enabled state", "content": { "application/json": { "schema": { @@ -15207,8 +15238,8 @@ } } }, - "403": { - "description": "Missing permissions to update SIP enabled state", + "412": { + "description": "SIP not configured", "content": { "application/json": { "schema": { @@ -15235,8 +15266,8 @@ } } }, - "412": { - "description": "SIP not configured", + "400": { + "description": "Updating SIP enabled state is not possible", "content": { "application/json": { "schema": { @@ -15255,7 +15286,23 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "breakout-room", + "token", + "type", + "value" + ] + } + } + } } } } @@ -15392,7 +15439,12 @@ ], "properties": { "error": { - "type": "string" + "type": "string", + "enum": [ + "breakout-room", + "call", + "value" + ] } } } diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 02bd64a7c18..2bc804d3006 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -6516,7 +6516,7 @@ export interface operations { meta: components["schemas"]["OCSMeta"]; data: { /** @enum {string} */ - error: "breakout-room" | "mode" | "type"; + error: "breakout-room" | "mode" | "type" | "value"; }; }; }; @@ -7657,7 +7657,10 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: { + /** @enum {string} */ + error: "breakout-room" | "object" | "type" | "value"; + }; }; }; }; @@ -7713,7 +7716,10 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: { + /** @enum {string} */ + error: "breakout-room" | "token" | "type" | "value"; + }; }; }; }; @@ -7812,7 +7818,8 @@ export interface operations { ocs: { meta: components["schemas"]["OCSMeta"]; data: { - error: string; + /** @enum {string} */ + error: "breakout-room" | "call" | "value"; }; }; }; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 9b265449367..f8c06b84173 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -5621,7 +5621,10 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: { + /** @enum {string} */ + error: "type" | "value"; + }; }; }; }; @@ -6094,7 +6097,7 @@ export interface operations { meta: components["schemas"]["OCSMeta"]; data: { /** @enum {string} */ - error: "breakout-room" | "mode" | "type"; + error: "breakout-room" | "mode" | "type" | "value"; }; }; }; @@ -7235,7 +7238,10 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: { + /** @enum {string} */ + error: "breakout-room" | "object" | "type" | "value"; + }; }; }; }; @@ -7291,7 +7297,10 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: { + /** @enum {string} */ + error: "breakout-room" | "token" | "type" | "value"; + }; }; }; }; @@ -7390,7 +7399,8 @@ export interface operations { ocs: { meta: components["schemas"]["OCSMeta"]; data: { - error: string; + /** @enum {string} */ + error: "breakout-room" | "call" | "value"; }; }; };