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
5 changes: 5 additions & 0 deletions openapi/components/parameters/proof-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: proofId
in: path
required: true
schema:
$ref: "../../openapi.yaml#/components/schemas/ProofId"
5 changes: 5 additions & 0 deletions openapi/components/parameters/punishment-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: punishmentId
in: path
required: true
schema:
$ref: "../../openapi.yaml#/components/schemas/PunishmentId"
2 changes: 2 additions & 0 deletions openapi/components/schemas/api-key-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ enum:
- players:read
- players:read-details
- players:write
- punishments:read
- punishments:write
8 changes: 8 additions & 0 deletions openapi/components/schemas/api-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ required:
- scopes
- createdAt
- expiresAt
- playerId
properties:
name:
type: string
Expand Down Expand Up @@ -37,3 +38,10 @@ properties:
- "null"
format: date-time
description: The date and time at which the API key expires, or `null` if it does not expire.

playerId:
type:
- string
- "null"
format: uuid
description: The player linked to this API key, or `null` if the key is not linked to a player.
3 changes: 3 additions & 0 deletions openapi/components/schemas/create-api-key-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ properties:

expiresAt:
$ref: "./api-key.yaml#/properties/expiresAt"

playerId:
$ref: "./api-key.yaml#/properties/playerId"
11 changes: 11 additions & 0 deletions openapi/components/schemas/create-proof-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: object
additionalProperties: false
required:
- text
- public
properties:
text:
$ref: "./proof.yaml#/properties/text"

public:
$ref: "./proof.yaml#/properties/public"
27 changes: 27 additions & 0 deletions openapi/components/schemas/create-punishment-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
type: object
additionalProperties: false
required:
- targetName
- target
- type
- reason
- expiresAt
- server
properties:
targetName:
$ref: "./punishment.yaml#/properties/targetName"

target:
$ref: "./punishment.yaml#/properties/target"

type:
$ref: "../../openapi.yaml#/components/schemas/PunishmentType"

reason:
$ref: "./punishment.yaml#/properties/reason"

expiresAt:
$ref: "./punishment.yaml#/properties/expiresAt"

server:
$ref: "./punishment.yaml#/properties/server"
14 changes: 14 additions & 0 deletions openapi/components/schemas/list-punishments-response.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: object
required:
- items
- nextCursor
properties:
items:
type: array
items:
$ref: "../../openapi.yaml#/components/schemas/Punishment"

nextCursor:
type:
- string
- "null"
4 changes: 4 additions & 0 deletions openapi/components/schemas/proof-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: integer
format: int64
minimum: 1
readOnly: true
15 changes: 15 additions & 0 deletions openapi/components/schemas/proof.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type: object
required:
- id
- text
- public
properties:
id:
$ref: "../../openapi.yaml#/components/schemas/ProofId"

text:
type: string
minLength: 1

public:
type: boolean
4 changes: 4 additions & 0 deletions openapi/components/schemas/punishment-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: integer
format: int64
minimum: 1
readOnly: true
14 changes: 14 additions & 0 deletions openapi/components/schemas/punishment-type.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: string
enum:
- ban
- tempBan
- ipBan
- tempIpBan
- mute
- tempMute
- ipMute
- tempIpMute
- warning
- caution
- kick
- note
69 changes: 69 additions & 0 deletions openapi/components/schemas/punishment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
type: object
required:
- id
- targetName
- target
- type
- reason
- actorId
- createdAt
- expiresAt
- server
- seen
- active
- proofs
- revocation
properties:
id:
$ref: "../../openapi.yaml#/components/schemas/PunishmentId"

targetName:
type: string
minLength: 1

target:
type: string
minLength: 1

type:
$ref: "../../openapi.yaml#/components/schemas/PunishmentType"

reason:
type: string
minLength: 1

actorId:
type: string
format: uuid

createdAt:
type: string
format: date-time
readOnly: true

expiresAt:
type:
- string
- "null"
format: date-time

server:
type: string
minLength: 1

seen:
type: boolean

active:
type: boolean
readOnly: true

proofs:
type: array
items:
$ref: "../../openapi.yaml#/components/schemas/Proof"

revocation:
oneOf:
- $ref: "../../openapi.yaml#/components/schemas/Revocation"
- type: "null"
25 changes: 25 additions & 0 deletions openapi/components/schemas/revocation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
type: object
required:
- id
- reason
- actorId
- createdAt
properties:
id:
type: integer
format: int64
minimum: 1
readOnly: true

reason:
type: string
minLength: 1

actorId:
type: string
format: uuid

createdAt:
type: string
format: date-time
readOnly: true
8 changes: 8 additions & 0 deletions openapi/components/schemas/revoke-punishment-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
additionalProperties: false
required:
- reason
properties:
reason:
type: string
minLength: 1
10 changes: 10 additions & 0 deletions openapi/components/schemas/update-proof-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
additionalProperties: false
minProperties: 1
properties:
text:
type: string
minLength: 1

public:
type: boolean
10 changes: 10 additions & 0 deletions openapi/components/schemas/update-punishment-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
additionalProperties: false
minProperties: 1
properties:
reason:
type: string
minLength: 1

seen:
type: boolean
38 changes: 38 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ tags:
description: Operations related to patch notes.
- name: players
description: Operations related to players.
- name: punishments
description: Operations related to punishment records and proofs.

paths:
/api-keys:
Expand All @@ -34,6 +36,14 @@ paths:
$ref: "./paths/players/players.yaml"
/players/{playerId}:
$ref: "./paths/players/players-by-id.yaml"
/punishments:
$ref: "./paths/punishments/punishments.yaml"
/punishments/{punishmentId}:
$ref: "./paths/punishments/punishments-by-id.yaml"
/punishments/{punishmentId}/proofs:
$ref: "./paths/punishments/punishment-proofs.yaml"
/punishments/{punishmentId}/proofs/{proofId}:
$ref: "./paths/punishments/punishment-proofs-by-id.yaml"

components:
parameters:
Expand All @@ -43,6 +53,10 @@ components:
$ref: "./components/parameters/patch-note-id.yaml"
PlayerId:
$ref: "./components/parameters/player-id.yaml"
PunishmentId:
$ref: "./components/parameters/punishment-id.yaml"
ProofId:
$ref: "./components/parameters/proof-id.yaml"

responses:
Unauthorized:
Expand Down Expand Up @@ -83,6 +97,30 @@ components:
$ref: "./components/schemas/player-status.yaml"
UpdatePlayerRequest:
$ref: "./components/schemas/update-player-request.yaml"
Punishment:
$ref: "./components/schemas/punishment.yaml"
PunishmentType:
$ref: "./components/schemas/punishment-type.yaml"
PunishmentId:
$ref: "./components/schemas/punishment-id.yaml"
Proof:
$ref: "./components/schemas/proof.yaml"
ProofId:
$ref: "./components/schemas/proof-id.yaml"
Revocation:
$ref: "./components/schemas/revocation.yaml"
CreatePunishmentRequest:
$ref: "./components/schemas/create-punishment-request.yaml"
UpdatePunishmentRequest:
$ref: "./components/schemas/update-punishment-request.yaml"
RevokePunishmentRequest:
$ref: "./components/schemas/revoke-punishment-request.yaml"
ListPunishmentsResponse:
$ref: "./components/schemas/list-punishments-response.yaml"
CreateProofRequest:
$ref: "./components/schemas/create-proof-request.yaml"
UpdateProofRequest:
$ref: "./components/schemas/update-proof-request.yaml"

securitySchemes:
ApiKeyAuth:
Expand Down
Loading