2024-01-16 19:24:48 +00:00
|
|
|
{
|
|
|
|
"openapi": "3.0.0",
|
|
|
|
"info": {
|
|
|
|
"title": "li'l Judd - OpenAPI 3.0",
|
|
|
|
"description": "None yet",
|
|
|
|
"termsOfService": "https://liljudd.ink/terms-of-service/",
|
|
|
|
"contact": {
|
|
|
|
"url": "https://liljudd.ink/contact/"
|
|
|
|
},
|
|
|
|
"version": "0.0.0"
|
|
|
|
},
|
|
|
|
"paths": {
|
2024-02-08 08:24:36 +00:00
|
|
|
"/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": {
|
2024-02-11 19:57:48 +00:00
|
|
|
"$ref": "#/components/schemas/bootConfig"
|
2024-02-08 08:24:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Invalid ID supplied"
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "Guild not found"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"api_key": []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2024-01-16 19:24:48 +00:00
|
|
|
"/api/config/{guildId}": {
|
|
|
|
"get": {
|
2024-02-08 08:24:36 +00:00
|
|
|
"tags": ["Guild configs"],
|
|
|
|
"summary": "Find a guild's config by ID",
|
|
|
|
"description": "Returns a single guild's config.",
|
2024-01-16 19:24:48 +00:00
|
|
|
"operationId": "getGuildById",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "guildId",
|
|
|
|
"in": "path",
|
|
|
|
"description": "ID of guild config to return",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)"
|
2024-01-16 19:24:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"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": []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"delete": {
|
2024-02-08 08:24:36 +00:00
|
|
|
"tags": ["Guild configs"],
|
|
|
|
"summary": "Deletes a guild's config by ID",
|
|
|
|
"description": "Delete a guild's config when the bot is removed from the guild.",
|
2024-01-16 19:24:48 +00:00
|
|
|
"operationId": "deleteGuildById",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "guildId",
|
|
|
|
"in": "path",
|
|
|
|
"description": "ID of guild config to delete",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)"
|
2024-01-16 19:24:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"204": {
|
|
|
|
"description": "successful operation"
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Invalid ID supplied"
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "Guild not found"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"api_key": []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/api/tp_messages/{guildId}": {
|
|
|
|
"get": {
|
2024-02-08 08:24:36 +00:00
|
|
|
"tags": ["Time planning messages"],
|
|
|
|
"summary": "Find the tp_messages of guild by ID",
|
2024-01-16 19:24:48 +00:00
|
|
|
"description": "Returns tp_messages for a guild",
|
|
|
|
"operationId": "getTp_messagesOfGuildById",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "guildId",
|
|
|
|
"in": "path",
|
|
|
|
"description": "ID of guild's tp_messages to return",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)"
|
2024-01-16 19:24:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "successful operation",
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
2024-02-08 08:24:36 +00:00
|
|
|
"$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"
|
|
|
|
}
|
2024-01-16 19:24:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"204": {
|
|
|
|
"description": "Time planning not enabled for this guild"
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Invalid ID supplied"
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "Guild not found"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"api_key": []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"components": {
|
|
|
|
"schemas": {
|
2024-02-11 19:57:48 +00:00
|
|
|
"bootConfig": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"guilds": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/guildConfig"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"accessToken": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-01-16 19:24:48 +00:00
|
|
|
"guildConfig": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"guildID": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)",
|
2024-01-16 19:24:48 +00:00
|
|
|
"example": "1234567890123456789"
|
|
|
|
},
|
2024-02-08 08:24:36 +00:00
|
|
|
"timezone": {
|
|
|
|
"type": "string",
|
|
|
|
"format": "text",
|
|
|
|
"example": "Europe/Berlin"
|
|
|
|
},
|
2024-01-16 19:24:48 +00:00
|
|
|
"features": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"time_planning": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"channelID": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)",
|
2024-01-16 19:24:48 +00:00
|
|
|
"example": "1234567890123456789"
|
|
|
|
},
|
2024-02-08 08:24:36 +00:00
|
|
|
"targetMinute": {
|
|
|
|
"type": "number",
|
|
|
|
"example": 0
|
2024-01-16 19:24:48 +00:00
|
|
|
},
|
2024-02-08 08:24:36 +00:00
|
|
|
"targetHour": {
|
|
|
|
"type": "number",
|
|
|
|
"example": 1
|
2024-01-16 19:24:48 +00:00
|
|
|
},
|
2024-02-08 08:24:36 +00:00
|
|
|
"targetDay": {
|
|
|
|
"type": "number",
|
|
|
|
"example": 1
|
|
|
|
},
|
|
|
|
"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
|
|
|
|
}
|
|
|
|
}
|
2024-01-16 19:24:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"matches": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/match"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"match": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"channelID": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varcharq(20)",
|
2024-01-16 19:24:48 +00:00
|
|
|
"example": "1234567890123456789"
|
|
|
|
},
|
|
|
|
"matchType": {
|
|
|
|
"type": "string",
|
|
|
|
"format": "varchar(50)",
|
|
|
|
"example": "Scrim"
|
|
|
|
},
|
|
|
|
"createrId": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)",
|
2024-01-16 19:24:48 +00:00
|
|
|
"example": "1234567890123456789"
|
|
|
|
},
|
|
|
|
"roleId": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)",
|
2024-01-16 19:24:48 +00:00
|
|
|
"example": "1234567890123456789"
|
|
|
|
},
|
|
|
|
"opponentName": {
|
|
|
|
"type": "string",
|
|
|
|
"format": "varchar(100)",
|
|
|
|
"example": "?"
|
|
|
|
},
|
|
|
|
"messsageId": {
|
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)",
|
|
|
|
"example": "1234567890123456789"
|
|
|
|
},
|
|
|
|
"utc_ts": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "1706180188"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"tp_messages": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"guildId": {
|
|
|
|
"type": "string",
|
|
|
|
"format": "varchar(20)",
|
2024-01-16 19:24:48 +00:00
|
|
|
"example": "1234567890123456789"
|
|
|
|
},
|
2024-02-08 08:24:36 +00:00
|
|
|
"channelId": {
|
2024-01-16 19:24:48 +00:00
|
|
|
"type": "string",
|
2024-02-08 08:24:36 +00:00
|
|
|
"format": "varchar(20)",
|
|
|
|
"example": "1234567890123456789"
|
|
|
|
},
|
|
|
|
"messageIds": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
2024-02-11 19:57:48 +00:00
|
|
|
"format": "varchar(20)"
|
|
|
|
},
|
|
|
|
"example": [
|
|
|
|
"1234567890123456789",
|
|
|
|
"1234567890123456789",
|
|
|
|
"1234567890123456789",
|
|
|
|
"1234567890123456789",
|
|
|
|
"1234567890123456789",
|
|
|
|
"1234567890123456789",
|
|
|
|
"1234567890123456789"
|
|
|
|
]
|
2024-01-16 19:24:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"securitySchemes": {
|
|
|
|
"api_key": {
|
|
|
|
"type": "apiKey",
|
|
|
|
"name": "api_key",
|
|
|
|
"in": "header"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-02-08 08:24:36 +00:00
|
|
|
}
|