From 676c3cd4fe3a0a935d154d2c2aa83e12456d531f Mon Sep 17 00:00:00 2001 From: Vinyarion <38413862+VinyarionHyarmendacil@users.noreply.github.com> Date: Tue, 7 Oct 2025 12:14:34 -0500 Subject: [PATCH] Complement #503 --- openapi/components/parameters.yaml | 16 +++++++- openapi/components/paths/authentication.yaml | 37 ++++++++++++++++++- .../CreateAvatarModerationRequest.yaml | 10 +++++ .../CreateAvatarModerationResponse.yaml | 5 +++ .../DeleteAvatarModerationResponse.yaml | 5 +++ .../schemas/AvatarModerationCreated.yaml | 15 ++++++++ openapi/components/schemas/OkStatus2.yaml | 9 +++++ 7 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 openapi/components/requests/CreateAvatarModerationRequest.yaml create mode 100644 openapi/components/responses/authentication/CreateAvatarModerationResponse.yaml create mode 100644 openapi/components/responses/authentication/DeleteAvatarModerationResponse.yaml create mode 100644 openapi/components/schemas/AvatarModerationCreated.yaml create mode 100644 openapi/components/schemas/OkStatus2.yaml diff --git a/openapi/components/parameters.yaml b/openapi/components/parameters.yaml index 570b6f72..8a73a95a 100644 --- a/openapi/components/parameters.yaml +++ b/openapi/components/parameters.yaml @@ -369,8 +369,22 @@ avatarId: in: path required: true schema: - type: string + $ref: ./schemas/AvatarID.yaml + description: Must be a valid avatar ID. +targetAvatarId: + name: targetAvatarId + in: query + required: true + schema: + $ref: ./schemas/AvatarID.yaml description: Must be a valid avatar ID. +avatarModerationType: + name: avatarModerationType + in: query + required: true + schema: + $ref: ./schemas/AvatarModerationType.yaml + description: The avatar moderation type associated with the avatar. messageType: name: messageType in: path diff --git a/openapi/components/paths/authentication.yaml b/openapi/components/paths/authentication.yaml index 8c5ca7d6..bd890db2 100644 --- a/openapi/components/paths/authentication.yaml +++ b/openapi/components/paths/authentication.yaml @@ -171,7 +171,7 @@ paths: get: summary: Get Global Avatar Moderations operationId: getGlobalAvatarModerations - description: Returns list of globally blocked avatars. + description: Returns list of globally moderated avatars. tags: - authentication security: @@ -181,6 +181,41 @@ paths: $ref: ../responses/authentication/GetAvatarModerationsResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml + post: + summary: Create Global Avatar Moderation + operationId: createGlobalAvatarModeration + description: Globally moderates an avatar. + requestBody: + required: true + content: + application/json: + schema: + $ref: ../requests/CreateAvatarModerationRequest.yaml + tags: + - authentication + security: + - authCookie: [] + responses: + '200': + $ref: ../responses/authentication/CreateAvatarModerationResponse.yaml + '401': + $ref: ../responses/MissingCredentialsError.yaml + delete: + summary: Delete Global Avatar Moderation + operationId: deleteGlobalAvatarModeration + description: Globally unmoderates an avatar. + parameters: + - $ref: ../parameters.yaml#/targetAvatarId + - $ref: ../parameters.yaml#/avatarModerationType + tags: + - authentication + security: + - authCookie: [] + responses: + '200': + $ref: ../responses/authentication/DeleteAvatarModerationResponse.yaml + '401': + $ref: ../responses/MissingCredentialsError.yaml /auth/twofactorauth/otp/verify: post: summary: Verify 2FA code with Recovery code diff --git a/openapi/components/requests/CreateAvatarModerationRequest.yaml b/openapi/components/requests/CreateAvatarModerationRequest.yaml new file mode 100644 index 00000000..66534d15 --- /dev/null +++ b/openapi/components/requests/CreateAvatarModerationRequest.yaml @@ -0,0 +1,10 @@ +title: CreateAvatarModerationRequest +type: object +properties: + targetAvatarId: + $ref: ../schemas/AvatarID.yaml + avatarModerationType: + $ref: ../schemas/AvatarModerationType.yaml +required: + - targetAvatarId + - avatarModerationType diff --git a/openapi/components/responses/authentication/CreateAvatarModerationResponse.yaml b/openapi/components/responses/authentication/CreateAvatarModerationResponse.yaml new file mode 100644 index 00000000..8b08b96e --- /dev/null +++ b/openapi/components/responses/authentication/CreateAvatarModerationResponse.yaml @@ -0,0 +1,5 @@ +description: Returns a single AvatarModerationCreated object +content: + application/json: + schema: + $ref: ../../schemas/AvatarModerationCreated.yaml \ No newline at end of file diff --git a/openapi/components/responses/authentication/DeleteAvatarModerationResponse.yaml b/openapi/components/responses/authentication/DeleteAvatarModerationResponse.yaml new file mode 100644 index 00000000..7a4fe40a --- /dev/null +++ b/openapi/components/responses/authentication/DeleteAvatarModerationResponse.yaml @@ -0,0 +1,5 @@ +description: Returns a single OkStatus2 object +content: + application/json: + schema: + $ref: ../../schemas/OkStatus2.yaml \ No newline at end of file diff --git a/openapi/components/schemas/AvatarModerationCreated.yaml b/openapi/components/schemas/AvatarModerationCreated.yaml new file mode 100644 index 00000000..af37aed3 --- /dev/null +++ b/openapi/components/schemas/AvatarModerationCreated.yaml @@ -0,0 +1,15 @@ +title: AvatarModerationCreated +type: object +properties: + avatarModerationType: + $ref: ./AvatarModerationType.yaml + created: + type: integer + format: int64 + description: Timestamp in milliseconds since Unix epoch + targetAvatarId: + $ref: ./AvatarID.yaml +required: + - avatarModerationType + - created + - targetAvatarId diff --git a/openapi/components/schemas/OkStatus2.yaml b/openapi/components/schemas/OkStatus2.yaml new file mode 100644 index 00000000..3e99735e --- /dev/null +++ b/openapi/components/schemas/OkStatus2.yaml @@ -0,0 +1,9 @@ +title: OkStatus2 +type: object +description: Another status response consisting of solely a string description of whether the result of an operation was ok. +properties: + OK: + type: string + description: The actual status itself +required: + - OK