From 1348734f7a392aa4faf10f0aef6d762889cfeecc Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Wed, 22 Feb 2023 09:00:06 +0000 Subject: [PATCH] chore: generate OpenAPI specification --- OpenAPI.json | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 200 insertions(+), 1 deletion(-) diff --git a/OpenAPI.json b/OpenAPI.json index a871055..d58cded 100644 --- a/OpenAPI.json +++ b/OpenAPI.json @@ -13,7 +13,7 @@ "name": "AGPLv3", "url": "https://github.com/revoltchat/delta/blob/master/LICENSE" }, - "version": "0.5.7" + "version": "0.5.8" }, "servers": [ { @@ -3656,6 +3656,46 @@ ] } }, + "/safety/report": { + "post": { + "tags": [ + "User Safety" + ], + "summary": "Report Content", + "description": "Report a piece of content to the moderation team.", + "operationId": "report_content_report_content", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataReportContent" + } + } + }, + "required": true + }, + "responses": { + "default": { + "description": "An error occurred.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "200": { + "description": "" + } + }, + "security": [ + { + "Session Token": [] + } + ] + } + }, "/auth/account/create": { "post": { "tags": [ @@ -5603,6 +5643,20 @@ } } }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CannotReportYourself" + ] + } + } + }, { "type": "object", "required": [ @@ -9304,6 +9358,145 @@ } } }, + "DataReportContent": { + "title": "Report Data", + "type": "object", + "required": [ + "content" + ], + "properties": { + "content": { + "description": "Content being reported", + "allOf": [ + { + "$ref": "#/components/schemas/ReportedContent" + } + ] + }, + "additional_context": { + "description": "Additional report description", + "default": "", + "type": "string", + "maxLength": 1000, + "minLength": 0 + } + } + }, + "ReportedContent": { + "oneOf": [ + { + "description": "Report a message", + "type": "object", + "required": [ + "id", + "report_reason", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Message" + ] + }, + "id": { + "description": "ID of the message", + "type": "string" + }, + "report_reason": { + "description": "Reason for reporting message", + "allOf": [ + { + "$ref": "#/components/schemas/ContentReportReason" + } + ] + } + } + }, + { + "description": "Report a server", + "type": "object", + "required": [ + "id", + "report_reason", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Server" + ] + }, + "id": { + "description": "ID of the server", + "type": "string" + }, + "report_reason": { + "description": "Reason for reporting server", + "allOf": [ + { + "$ref": "#/components/schemas/ContentReportReason" + } + ] + } + } + }, + { + "description": "Report a user", + "type": "object", + "required": [ + "id", + "report_reason", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "User" + ] + }, + "id": { + "description": "ID of the user", + "type": "string" + }, + "report_reason": { + "description": "Reason for reporting a user", + "allOf": [ + { + "$ref": "#/components/schemas/UserReportReason" + } + ] + } + } + } + ] + }, + "ContentReportReason": { + "description": "Reason for reporting content (message or server)", + "type": "string", + "enum": [ + "NoneSpecified", + "Illegal", + "PromotesHarm", + "SpamAbuse", + "Malware", + "Harassment" + ] + }, + "UserReportReason": { + "description": "Reason for reporting a user", + "type": "string", + "enum": [ + "NoneSpecified", + "SpamAbuse", + "InappropriateProfile", + "Impersonation", + "BanEvasion", + "Underage" + ] + }, "Authifier Error": { "title": "Error", "oneOf": [ @@ -10299,6 +10492,12 @@ "Emojis" ] }, + { + "name": "Platform Moderation", + "tags": [ + "User Safety" + ] + }, { "name": "Authentication", "tags": [