chore: generate OpenAPI specification

This commit is contained in:
Revolt CI
2023-06-11 09:17:39 +00:00
parent 4ca55ef07f
commit 002a2fe4ec
+34 -487
View File
@@ -13,7 +13,7 @@
"name": "AGPLv3",
"url": "https://github.com/revoltchat/delta/blob/master/LICENSE"
},
"version": "0.6.0-rc.2"
"version": "0.6.0"
},
"servers": [
{
@@ -5639,425 +5639,6 @@
}
]
}
},
"/webhooks/{webhook_id}/{token}": {
"get": {
"tags": [
"Webhooks"
],
"summary": "Gets a webhook",
"description": "Gets a webhook with a token",
"operationId": "webhook_fetch_token_webhook_fetch_token",
"parameters": [
{
"name": "webhook_id",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/Id"
}
},
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "An error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Webhook"
}
}
}
}
}
},
"post": {
"tags": [
"Webhooks"
],
"summary": "Executes a webhook",
"description": "Executes a webhook and sends a message",
"operationId": "webhook_execute_webhook_execute",
"parameters": [
{
"name": "webhook_id",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/Id"
}
},
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "Idempotency-Key",
"in": "header",
"description": "Unique key to prevent duplicate requests",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DataMessageSend"
}
}
},
"required": true
},
"responses": {
"default": {
"description": "An error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Message"
}
}
}
}
}
},
"delete": {
"tags": [
"Webhooks"
],
"summary": "Deletes a webhook",
"description": "Deletes a webhook with a token",
"operationId": "webhook_delete_token_webhook_delete_token",
"parameters": [
{
"name": "webhook_id",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/Id"
}
},
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "An error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"204": {
"description": "Success"
}
}
},
"patch": {
"tags": [
"Webhooks"
],
"summary": "Edits a webhook",
"description": "Edits a webhook with a token",
"operationId": "webhook_edit_token_webhook_edit_token",
"parameters": [
{
"name": "webhook_id",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/Id"
}
},
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DataEditWebhook"
}
}
},
"required": true
},
"responses": {
"default": {
"description": "An error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Webhook"
}
}
}
}
}
}
},
"/webhooks/{webhook_id}": {
"get": {
"tags": [
"Webhooks"
],
"summary": "Gets a webhook",
"description": "Gets a webhook",
"operationId": "webhook_fetch_webhook_fetch",
"parameters": [
{
"name": "webhook_id",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/Id"
}
}
],
"responses": {
"default": {
"description": "An error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResponseWebhook"
}
}
}
}
},
"security": [
{
"Session Token": []
}
]
},
"delete": {
"tags": [
"Webhooks"
],
"summary": "Deletes a webhook",
"description": "Deletes a webhook",
"operationId": "webhook_delete_webhook_delete",
"parameters": [
{
"name": "webhook_id",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/Id"
}
}
],
"responses": {
"default": {
"description": "An error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"204": {
"description": "Success"
}
},
"security": [
{
"Session Token": []
}
]
},
"patch": {
"tags": [
"Webhooks"
],
"summary": "Edits a webhook",
"description": "Edits a webhook",
"operationId": "webhook_edit_webhook_edit",
"parameters": [
{
"name": "webhook_id",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/Id"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DataEditWebhook"
}
}
},
"required": true
},
"responses": {
"default": {
"description": "An error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Webhook"
}
}
}
}
},
"security": [
{
"Session Token": []
}
]
}
},
"/webhooks/{webhook_id}/{token}/github": {
"post": {
"tags": [
"Webhooks"
],
"summary": "Executes a webhook specific to github",
"description": "Executes a webhook specific to github and sends a message containing the relevant info about the event",
"operationId": "webhook_execute_github_webhook_execute_github",
"parameters": [
{
"name": "webhook_id",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/Id"
}
},
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "X-Github-Event",
"in": "header",
"description": "The name of the github event",
"required": true,
"content": {
"X-Github-Event": {
"schema": {}
}
}
}
],
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"type": "string"
}
}
},
"required": true
},
"responses": {
"default": {
"description": "An error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"200": {
"description": ""
}
}
}
}
},
"components": {
@@ -9221,6 +8802,8 @@
"type": "object",
"required": [
"_id",
"discriminator",
"display_name",
"username"
],
"properties": {
@@ -9232,6 +8815,14 @@
"description": "Username",
"type": "string"
},
"discriminator": {
"description": "Discriminator",
"type": "string"
},
"display_name": {
"description": "Display name",
"type": "string"
},
"avatar": {
"description": "Avatar attachment",
"allOf": [
@@ -9574,6 +9165,14 @@
"title": "User Data",
"type": "object",
"properties": {
"displayName": {
"description": "New display name",
"type": "string",
"maxLength": 32,
"minLength": 2,
"pattern": "^[^\\u200B\\n\\r]+$",
"nullable": true
},
"avatar": {
"description": "Attachment Id for avatar",
"type": "string",
@@ -9666,7 +9265,7 @@
"type": "string",
"maxLength": 32,
"minLength": 2,
"pattern": "^[^\\u200BА-Яа-яΑ-Ωα-ω@#:\\n\\r\\[\\]]+$"
"pattern": "^(\\p{L}|[\\d_.-])+$"
},
"password": {
"description": "Current account password",
@@ -9996,6 +9595,7 @@
],
"properties": {
"username": {
"description": "Username and discriminator combo separated by #",
"type": "string"
}
}
@@ -10069,7 +9669,7 @@
"type": "string",
"maxLength": 32,
"minLength": 2,
"pattern": "^[^\\u200BА-Яа-яΑ-Ωα-ω@#:\\n\\r\\[\\]]+$"
"pattern": "^(\\p{L}|[\\d_.-])+$"
}
}
},
@@ -10192,7 +9792,7 @@
"type": "string",
"maxLength": 32,
"minLength": 2,
"pattern": "^[^\\u200BА-Яа-яΑ-Ωα-ω@#:\\n\\r\\[\\]]+$",
"pattern": "^(\\p{L}|[\\d_.-])+$",
"nullable": true
},
"public": {
@@ -12523,6 +12123,8 @@
"required": [
"_id",
"_type",
"discriminator",
"display_name",
"username"
],
"properties": {
@@ -12540,6 +12142,14 @@
"description": "Username",
"type": "string"
},
"discriminator": {
"description": "Discriminator",
"type": "string"
},
"display_name": {
"description": "Display name",
"type": "string"
},
"avatar": {
"description": "Avatar attachment",
"allOf": [
@@ -13516,7 +13126,7 @@
"type": "string",
"maxLength": 32,
"minLength": 2,
"pattern": "^[^\\u200BА-Яа-яΑ-Ωα-ω@#:\\n\\r\\[\\]]+$"
"pattern": "^(\\p{L}|[\\d_.-])+$"
}
}
},
@@ -13583,69 +13193,6 @@
"type": "string"
}
}
},
"DataEditWebhook": {
"description": "New webhook information",
"type": "object",
"properties": {
"name": {
"description": "Webhook name",
"type": "string",
"maxLength": 32,
"minLength": 1,
"nullable": true
},
"avatar": {
"description": "Avatar ID",
"type": "string",
"maxLength": 128,
"minLength": 1,
"nullable": true
},
"remove": {
"description": "Fields to remove from webhook",
"default": [],
"type": "array",
"items": {
"$ref": "#/components/schemas/FieldsWebhook"
}
}
}
},
"FieldsWebhook": {
"description": "Optional fields on webhook object",
"type": "string",
"enum": [
"Avatar"
]
},
"ResponseWebhook": {
"description": "Webhook information",
"type": "object",
"required": [
"channel_id",
"id",
"name"
],
"properties": {
"id": {
"description": "Webhook Id",
"type": "string"
},
"name": {
"description": "Webhook name",
"type": "string"
},
"avatar": {
"description": "Avatar ID",
"type": "string",
"nullable": true
},
"channel_id": {
"description": "The channel this webhook belongs to",
"type": "string"
}
}
}
},
"securitySchemes": {