Completed openapi specs

This commit is contained in:
Aron Malcher 2024-02-08 09:24:36 +01:00
parent 2ced092aa4
commit 4e6bd72a21
Signed by: aronmal
GPG key ID: 816B7707426FC612

View file

@ -10,13 +10,42 @@
"version": "0.0.0" "version": "0.0.0"
}, },
"paths": { "paths": {
"/api/config/boot": {
"get": {
"tags": ["Guild configs"],
"summary": "Find a guild's config by ID",
"description": "Returns a single guild's config.",
"operationId": "getGuildsFromBoot",
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/guildConfig"
}
}
}
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Guild not found"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/api/config/{guildId}": { "/api/config/{guildId}": {
"get": { "get": {
"tags": [ "tags": ["Guild configs"],
"Guild configs" "summary": "Find a guild's config by ID",
], "description": "Returns a single guild's config.",
"summary": "Find guild config by ID",
"description": "Returns a single guild config",
"operationId": "getGuildById", "operationId": "getGuildById",
"parameters": [ "parameters": [
{ {
@ -26,7 +55,7 @@
"required": true, "required": true,
"schema": { "schema": {
"type": "string", "type": "string",
"format": "varchar(19)" "format": "varchar(20)"
} }
} }
], ],
@ -55,11 +84,9 @@
] ]
}, },
"delete": { "delete": {
"tags": [ "tags": ["Guild configs"],
"Guild configs" "summary": "Deletes a guild's config by ID",
], "description": "Delete a guild's config when the bot is removed from the guild.",
"summary": "Deletes a guild config by ID",
"description": "Delete a guild's config",
"operationId": "deleteGuildById", "operationId": "deleteGuildById",
"parameters": [ "parameters": [
{ {
@ -69,7 +96,7 @@
"required": true, "required": true,
"schema": { "schema": {
"type": "string", "type": "string",
"format": "varchar(19)" "format": "varchar(20)"
} }
} }
], ],
@ -93,10 +120,8 @@
}, },
"/api/tp_messages/{guildId}": { "/api/tp_messages/{guildId}": {
"get": { "get": {
"tags": [ "tags": ["Time planning messages"],
"Time planning messages" "summary": "Find the tp_messages of guild by ID",
],
"summary": "Find guild by ID for it's tp_messages",
"description": "Returns tp_messages for a guild", "description": "Returns tp_messages for a guild",
"operationId": "getTp_messagesOfGuildById", "operationId": "getTp_messagesOfGuildById",
"parameters": [ "parameters": [
@ -107,7 +132,7 @@
"required": true, "required": true,
"schema": { "schema": {
"type": "string", "type": "string",
"format": "varchar(19)" "format": "varchar(20)"
} }
} }
], ],
@ -117,7 +142,222 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/guildConfig" "$ref": "#/components/schemas/tp_messages"
}
}
}
},
"204": {
"description": "Time planning not enabled for this guild"
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Guild not found"
}
},
"security": [
{
"api_key": []
}
]
},
"put": {
"tags": ["Time planning messages"],
"summary": "Put message IDs for tp_messages of guild by ID",
"description": "Returns tp_messages for a guild",
"operationId": "putTp_messagesOfGuildById",
"parameters": [
{
"name": "guildId",
"in": "path",
"description": "ID of guild's tp_messages to return",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/tp_messages"
}
}
}
},
"204": {
"description": "Time planning not enabled for this guild"
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Guild not found"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/api/match/{guildId}/{channelId}": {
"post": {
"tags": ["Matches"],
"summary": "Save a new created match in channel of guild by IDs",
"description": "Returns tp_messages for a guild",
"operationId": "postMatchOfGuildById",
"parameters": [
{
"name": "guildId",
"in": "path",
"description": "ID of match's guild to set",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
},
{
"name": "channelId",
"in": "path",
"description": "ID of match's channel to set",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/tp_messages"
}
}
}
},
"204": {
"description": "Time planning not enabled for this guild"
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Guild not found"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/api/match/{guildId}/{channelId}/{matchMessageId}": {
"put": {
"tags": ["Matches"],
"summary": "Set state for match of guild by IDs",
"description": "Returns tp_messages for a guild",
"operationId": "putMatchOfGuildById",
"parameters": [
{
"name": "guildId",
"in": "path",
"description": "ID of guild's tp_messages to return",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
},
{
"name": "channelId",
"in": "path",
"description": "ID of match's channel to set",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
},
{
"name": "matchMessageId",
"in": "path",
"description": "ID of match's message Id to set",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/tp_messages"
}
}
}
},
"204": {
"description": "Time planning not enabled for this guild"
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Guild not found"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/api/match/{guildId}": {
"get": {
"tags": ["Matches"],
"summary": "Find all matches of guild by ID",
"description": "Returns tp_messages for a guild",
"operationId": "getMatchesOfGuildById",
"parameters": [
{
"name": "guildId",
"in": "path",
"description": "ID of guild's tp_messages to return",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/tp_messages"
}
} }
} }
} }
@ -147,9 +387,14 @@
"properties": { "properties": {
"guildID": { "guildID": {
"type": "string", "type": "string",
"format": "varchar(19)", "format": "varchar(20)",
"example": "1234567890123456789" "example": "1234567890123456789"
}, },
"timezone": {
"type": "string",
"format": "text",
"example": "Europe/Berlin"
},
"features": { "features": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -158,22 +403,40 @@
"properties": { "properties": {
"channelID": { "channelID": {
"type": "string", "type": "string",
"format": "varchar(19)", "format": "varchar(20)",
"example": "1234567890123456789" "example": "1234567890123456789"
}, },
"cron": { "targetMinute": {
"type": "string", "type": "number",
"example": "0 0 1 * * * 60o 1w" "example": 0
}, },
"isAvailableRoleId": { "targetHour": {
"type": "string", "type": "number",
"format": "varchar(19)", "example": 1
"example": "1234567890123456789"
}, },
"wantsToBeNotifieRoledId": { "targetDay": {
"type": "string", "type": "number",
"format": "varchar(19)", "example": 1
"example": "1234567890123456789" },
"roles": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"isAvailableRoleId": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789",
"nullable": true
},
"wantsToBeNotifieRoledId": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789",
"nullable": true
}
}
} }
} }
} }
@ -192,7 +455,7 @@
"properties": { "properties": {
"channelID": { "channelID": {
"type": "string", "type": "string",
"format": "varchar(19)", "format": "varcharq(20)",
"example": "1234567890123456789" "example": "1234567890123456789"
}, },
"matchType": { "matchType": {
@ -202,12 +465,12 @@
}, },
"createrId": { "createrId": {
"type": "string", "type": "string",
"format": "varchar(19)", "format": "varchar(20)",
"example": "1234567890123456789" "example": "1234567890123456789"
}, },
"roleId": { "roleId": {
"type": "string", "type": "string",
"format": "varchar(19)", "format": "varchar(20)",
"example": "1234567890123456789" "example": "1234567890123456789"
}, },
"opponentName": { "opponentName": {
@ -217,12 +480,43 @@
}, },
"messsageId": { "messsageId": {
"type": "string", "type": "string",
"format": "varchar(19)", "format": "varchar(20)",
"example": "1234567890123456789" "example": "1234567890123456789"
}, },
"cron": { "utc_ts": {
"type": "string", "type": "string",
"example": "0 0 1 5 2 2023 60o" "example": "1706180188"
}
}
},
"tp_messages": {
"type": "object",
"properties": {
"guildId": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789"
},
"channelId": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789"
},
"messageIds": {
"type": "array",
"items": {
"type": "string",
"format": "varchar(20)",
"example": [
"1234567890123456789",
"1234567890123456789",
"1234567890123456789",
"1234567890123456789",
"1234567890123456789",
"1234567890123456789",
"1234567890123456789"
]
}
} }
} }
} }