Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions openapi/components/paths/playermoderation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
openapi: 3.0.3
info:
title: authentication
version: '1.0'
description: A
paths:
/auth/user/playermoderations:
get:
summary: Search Player Moderations
tags:
- playermoderation
responses:
'200':
$ref: ../responses/playermoderation/PlayerModerationListResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
operationId: getPlayerModerations
security:
- apiKeyCookie: []
authCookie: []
parameters:
- schema:
type: string
in: query
name: type
description: 'Must be one of PlayerModerationType, except unblock. Unblocking simply removes a block.'
- schema:
type: string
in: query
name: sourceUserId
description: Must be valid UserID. Trying to view someone else's moderations results with "Can't view someone else's player moderations" error.
x-internal: true
- schema:
type: string
in: query
name: targetUserId
description: Must be valid UserID.
description: |-
Returns a list of all player moderations made by **you**.

This endpoint does not have pagination, and will return *all* results. Use query parameters to limit your query if needed.
post:
summary: Moderate User
operationId: moderateUser
security:
- apiKeyCookie: []
authCookie: []
responses:
'200':
$ref: ../responses/playermoderation/PlayerModerationResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
requestBody:
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
moderated:
$ref: ../schemas/UserID.yaml
type:
$ref: ../schemas/PlayerModerationType.yaml
required:
- moderated
- type
description: ''
description: 'Moderate a user, e.g. unmute them or show their avatar.'
tags:
- playermoderation
delete:
summary: Clear All Player Moderations
operationId: clearAllPlayerModerations
security:
- apiKeyCookie: []
authCookie: []
responses:
'200':
$ref: ../responses/OkSuccess.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
description: ⚠️ **This will delete every single player moderation you've ever made.**
tags:
- playermoderation
/auth/user/unplayermoderate:
put:
summary: Unmoderate User
operationId: unmoderateUser
security:
- apiKeyCookie: []
authCookie: []
requestBody:
content:
application/json:
schema:
type: object
properties:
moderated:
$ref: ../schemas/UserID.yaml
type:
$ref: ../schemas/PlayerModerationType.yaml
required:
- type
description: 'Removes a player moderation previously added through `moderateUser`. E.g if you previuosly have shown their avatar, but now want to reset it to default.'
responses:
'200':
$ref: ../responses/playermoderation/PlayerModerationUnmoderatedSuccess.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
tags:
- playermoderation
'/auth/user/playermoderations/{playerModerationId}':
get:
summary: Get Player Moderation
tags:
- playermoderation
responses:
'200':
$ref: ../responses/playermoderation/PlayerModerationResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
'404':
$ref: ../responses/playermoderation/PlayerModerationNotFoundError.yaml
operationId: getPlayerModeration
security:
- apiKeyCookie: []
authCookie: []
description: Returns a single Player Moderation. This returns the exact same amount of information as the more generalised `getPlayerModerations`.
delete:
summary: Delete Player Moderation
operationId: deletePlayerModeration
security:
- apiKeyCookie: []
authCookie: []
responses:
'200':
$ref: ../responses/playermoderation/PlayerModerationRemovedSuccess.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
'403':
$ref: ../responses/playermoderation/PlayerModerationDeleteOthersError.yaml
description: Deletes a specific player moderation based on it's `pmod_` ID. The website uses `unmoderateUser` instead. You can delete the same player moderation multiple times successfully.
tags:
- playermoderation
parameters:
- schema:
type: string
name: playerModerationId
in: path
required: true
tags:
$ref: ../../openapi.yaml#/tags
components:
securitySchemes:
$ref: ../../openapi.yaml#/components/securitySchemes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: Error response when trying to delete someone else's player moderati
content:
application/json:
schema:
$ref: ../schemas/Error.yaml
$ref: ../../schemas/Error.yaml
examples:
403 Can't delete Player Moderation You Didn't Create:
value:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Returns a list of PlayerModeration objects.
content:
application/json:
schema:
type: array
items:
$ref: ../../schemas/PlayerModeration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: Error response when trying to show information about a non-existent
content:
application/json:
schema:
$ref: ../schemas/Error.yaml
$ref: ../../schemas/Error.yaml
examples:
404 Player Moderation Not Found:
value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: Success response after removing a PlayerModeration by ID.
content:
application/json:
schema:
$ref: ../schemas/Error.yaml
$ref: ../../schemas/Success.yaml
examples:
200 Player Moderation Removed:
value:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Returns a single PlayerModeration object.
content:
application/json:
schema:
$ref: ../../schemas/PlayerModeration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: Success response after unmoderating a player moderation.
content:
application/json:
schema:
$ref: ../schemas/Error.yaml
$ref: ../../schemas/Success.yaml
examples:
200 Specific User Unmoderated:
value:
Expand Down
160 changes: 4 additions & 156 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,149 +107,11 @@ paths:
'/avatars/{avatarId}/select':
$ref: ./components/paths/avatars.yaml#/paths/~1avatars~1{avatarId}~1select
/auth/user/playermoderations:
get:
summary: Search Player Moderations
tags:
- playermoderation
responses:
'200':
$ref: '#/components/responses/PlayerModerationList'
'401':
$ref: ./components/responses/MissingCredentialsError.yaml
operationId: getPlayerModerations
security:
- apiKeyCookie: []
authCookie: []
parameters:
- schema:
type: string
in: query
name: type
description: 'Must be one of PlayerModerationType, except unblock. Unblocking simply removes a block.'
- schema:
type: string
in: query
name: sourceUserId
description: Must be valid UserID. Trying to view someone else's moderations results with "Can't view someone else's player moderations" error.
x-internal: true
- schema:
type: string
in: query
name: targetUserId
description: Must be valid UserID.
description: |-
Returns a list of all player moderations made by **you**.

This endpoint does not have pagination, and will return *all* results. Use query parameters to limit your query if needed.
post:
summary: Moderate User
operationId: moderateUser
security:
- apiKeyCookie: []
authCookie: []
responses:
'200':
$ref: '#/components/responses/PlayerModeration'
'401':
$ref: ./components/responses/MissingCredentialsError.yaml
requestBody:
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
moderated:
$ref: ./components/schemas/UserID.yaml
type:
$ref: ./components/schemas/PlayerModerationType.yaml
required:
- moderated
- type
description: ''
description: 'Moderate a user, e.g. unmute them or show their avatar.'
tags:
- playermoderation
delete:
summary: Clear All Player Moderations
operationId: clearAllPlayerModerations
security:
- apiKeyCookie: []
authCookie: []
responses:
'200':
$ref: ./components/responses/OkSuccess.yaml
'401':
$ref: ./components/responses/MissingCredentialsError.yaml
description: ⚠️ **This will delete every single player moderation you've ever made.**
tags:
- playermoderation
$ref: ./components/paths/playermoderation.yaml#/paths/~1auth~1user~1playermoderations
/auth/user/unplayermoderate:
put:
summary: Unmoderate User
operationId: unmoderateUser
security:
- apiKeyCookie: []
authCookie: []
requestBody:
content:
application/json:
schema:
type: object
properties:
moderated:
$ref: ./components/schemas/UserID.yaml
type:
$ref: ./components/schemas/PlayerModerationType.yaml
required:
- type
description: 'Removes a player moderation previously added through `moderateUser`. E.g if you previuosly have shown their avatar, but now want to reset it to default.'
responses:
'200':
$ref: ./components/responses/PlayerModerationUnmoderatedSuccess.yaml
'401':
$ref: ./components/responses/MissingCredentialsError.yaml
tags:
- playermoderation
$ref: ./components/paths/playermoderation.yaml#/paths/~1auth~1user~1unplayermoderate
'/auth/user/playermoderations/{playerModerationId}':
get:
summary: Get Player Moderation
tags:
- playermoderation
responses:
'200':
$ref: '#/components/responses/PlayerModeration'
'401':
$ref: ./components/responses/MissingCredentialsError.yaml
'404':
$ref: ./components/responses/PlayerModerationNotFoundError.yaml
operationId: getPlayerModeration
security:
- apiKeyCookie: []
authCookie: []
description: Returns a single Player Moderation. This returns the exact same amount of information as the more generalised `getPlayerModerations`.
delete:
summary: Delete Player Moderation
operationId: deletePlayerModeration
security:
- apiKeyCookie: []
authCookie: []
responses:
'200':
$ref: ./components/responses/PlayerModerationRemovedSuccess.yaml
'401':
$ref: ./components/responses/MissingCredentialsError.yaml
'403':
$ref: ./components/responses/PlayerModerationDeleteOthersError.yaml
description: Deletes a specific player moderation based on it's `pmod_` ID. The website uses `unmoderateUser` instead. You can delete the same player moderation multiple times successfully.
tags:
- playermoderation
parameters:
- schema:
type: string
name: playerModerationId
in: path
required: true
$ref: ./components/paths/playermoderation.yaml#/paths/~1auth~1user~1playermoderations~1{playerModerationId}
/auth/permissions:
$ref: ./components/paths/permissions.yaml#/paths/~1auth~1permissions
/permissions:
Expand Down Expand Up @@ -283,21 +145,7 @@ components:
type: apiKey
in: cookie
description: 2FA device remembrance via Cookie
responses:
PlayerModerationList:
description: Returns a list of PlayerModeration objects.
content:
application/json:
schema:
type: array
items:
$ref: ./components/schemas/PlayerModeration.yaml
PlayerModeration:
description: Returns a single PlayerModeration object.
content:
application/json:
schema:
$ref: ./components/schemas/PlayerModeration.yaml
responses: {}
parameters:
number:
name: 'n'
Expand Down