liljudd-website/public/api/specs/liljudd.json

546 lines
14 KiB
JSON

{
"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": {
"/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/bootConfig"
}
}
}
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Guild not found"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/api/config/{guildId}": {
"get": {
"tags": ["Guild configs"],
"summary": "Find a guild's config by ID",
"description": "Returns a single guild's config.",
"operationId": "getGuildById",
"parameters": [
{
"name": "guildId",
"in": "path",
"description": "ID of guild config to return",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
}
],
"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": {
"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.",
"operationId": "deleteGuildById",
"parameters": [
{
"name": "guildId",
"in": "path",
"description": "ID of guild config to delete",
"required": true,
"schema": {
"type": "string",
"format": "varchar(20)"
}
}
],
"responses": {
"204": {
"description": "successful operation"
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Guild not found"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/api/tp_messages/{guildId}": {
"get": {
"tags": ["Time planning messages"],
"summary": "Find the tp_messages of guild by ID",
"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",
"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": []
}
]
},
"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"
}
}
}
}
},
"204": {
"description": "Time planning not enabled for this guild"
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Guild not found"
}
},
"security": [
{
"api_key": []
}
]
}
}
},
"components": {
"schemas": {
"bootConfig": {
"type": "object",
"properties": {
"guilds": {
"type": "array",
"items": {
"$ref": "#/components/schemas/guildConfig"
}
},
"accessToken": {
"type": "string"
}
}
},
"guildConfig": {
"type": "object",
"properties": {
"guildID": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789"
},
"timezone": {
"type": "string",
"format": "text",
"example": "Europe/Berlin"
},
"features": {
"type": "object",
"properties": {
"time_planning": {
"type": "object",
"properties": {
"channelID": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789"
},
"targetMinute": {
"type": "number",
"example": 0
},
"targetHour": {
"type": "number",
"example": 1
},
"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
}
}
}
}
}
}
},
"matches": {
"type": "array",
"items": {
"$ref": "#/components/schemas/match"
}
}
}
},
"match": {
"type": "object",
"properties": {
"channelID": {
"type": "string",
"format": "varcharq(20)",
"example": "1234567890123456789"
},
"matchType": {
"type": "string",
"format": "varchar(50)",
"example": "Scrim"
},
"createrId": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789"
},
"roleId": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789"
},
"opponentName": {
"type": "string",
"format": "varchar(100)",
"example": "?"
},
"messsageId": {
"type": "string",
"format": "varchar(20)",
"example": "1234567890123456789"
},
"utc_ts": {
"type": "string",
"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"
]
}
}
}
},
"securitySchemes": {
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "header"
}
}
}
}