diff --git a/OpenAPI.json b/OpenAPI.json index b60e789..b2dd98f 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.15" + "version": "0.5.16" }, "servers": [ { @@ -58,10 +58,10 @@ } } }, - "/stats": { + "/admin/stats": { "get": { "tags": [ - "Core" + "Admin" ], "summary": "Query Stats", "description": "Fetch various technical statistics.", @@ -90,14 +90,24 @@ } } }, - "/users/@me": { - "get": { + "/admin/messages": { + "post": { "tags": [ - "User Information" + "Admin" ], - "summary": "Fetch Self", - "description": "Retrieve your user information.", - "operationId": "fetch_self_req", + "summary": "Globally Fetch Messages", + "description": "This is a privileged route to globally fetch messages.", + "operationId": "message_query_message_query", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageQuery" + } + } + }, + "required": true + }, "responses": { "default": { "description": "An error occurred.", @@ -114,7 +124,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/BulkMessageResponse" } } } @@ -125,24 +135,16 @@ "Session Token": [] } ] - }, - "patch": { + } + }, + "/users/@me": { + "get": { "tags": [ "User Information" ], - "summary": "Edit User", - "description": "Edit currently authenticated user.", - "operationId": "edit_user_req", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DataEditUser" - } - } - }, - "required": true - }, + "summary": "Fetch Self", + "description": "Retrieve your user information.", + "operationId": "fetch_self_req", "responses": { "default": { "description": "An error occurred.", @@ -217,6 +219,61 @@ "Session Token": [] } ] + }, + "patch": { + "tags": [ + "User Information" + ], + "summary": "Edit User", + "description": "Edit currently authenticated user.", + "operationId": "edit_user_req", + "parameters": [ + { + "name": "target", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataEditUser" + } + } + }, + "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/User" + } + } + } + } + }, + "security": [ + { + "Session Token": [] + } + ] } }, "/users/{target}/flags": { @@ -6345,98 +6402,379 @@ } } }, - "User": { - "description": "Representiation of a User on Revolt.", + "BulkMessageResponse": { + "title": "Bulk Message Response", + "description": "Response used when multiple messages are fetched", + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Message" + } + }, + { + "type": "object", + "required": [ + "messages", + "users" + ], + "properties": { + "messages": { + "description": "List of messages", + "type": "array", + "items": { + "$ref": "#/components/schemas/Message" + } + }, + "users": { + "description": "List of users", + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "members": { + "description": "List of members", + "type": "array", + "items": { + "$ref": "#/components/schemas/Member" + }, + "nullable": true + } + } + } + ] + }, + "Message": { + "description": "Representation of a Message on Revolt", "type": "object", "required": [ "_id", - "username" + "author", + "channel" ], "properties": { "_id": { "description": "Unique Id", "type": "string" }, - "username": { - "description": "Username", + "nonce": { + "description": "Unique value generated by client sending this message", + "type": "string", + "nullable": true + }, + "channel": { + "description": "Id of the channel this message was sent in", "type": "string" }, - "avatar": { - "description": "Avatar attachment", + "author": { + "description": "Id of the user that sent this message", + "type": "string" + }, + "content": { + "description": "Message content", + "type": "string", + "nullable": true + }, + "system": { + "description": "System message", "allOf": [ { - "$ref": "#/components/schemas/File" + "$ref": "#/components/schemas/SystemMessage" } ], "nullable": true }, - "relations": { - "description": "Relationships with other users", + "attachments": { + "description": "Array of attachments", "type": "array", "items": { - "$ref": "#/components/schemas/Relationship" + "$ref": "#/components/schemas/File" }, "nullable": true }, - "badges": { - "description": "Bitfield of user badges", - "type": "integer", - "format": "int32", - "nullable": true - }, - "status": { - "description": "User's current status", + "edited": { + "description": "Time at which this message was last edited", "allOf": [ { - "$ref": "#/components/schemas/UserStatus" + "$ref": "#/components/schemas/ISO8601 Timestamp" } ], "nullable": true }, - "profile": { - "description": "User's profile page", + "embeds": { + "description": "Attached embeds to this message", + "type": "array", + "items": { + "$ref": "#/components/schemas/Embed" + }, + "nullable": true + }, + "mentions": { + "description": "Array of user ids mentioned in this message", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "replies": { + "description": "Array of message ids this message is replying to", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "reactions": { + "description": "Hashmap of emoji IDs to array of user IDs", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "interactions": { + "description": "Information about how this message should be interacted with", "allOf": [ { - "$ref": "#/components/schemas/UserProfile" + "$ref": "#/components/schemas/Interactions" } - ], - "nullable": true + ] }, - "flags": { - "description": "Enum of user flags", - "type": "integer", - "format": "int32", - "nullable": true - }, - "privileged": { - "description": "Whether this user is privileged", - "type": "boolean" - }, - "bot": { - "description": "Bot information", + "masquerade": { + "description": "Name and / or avatar overrides for this message", "allOf": [ { - "$ref": "#/components/schemas/BotInformation" + "$ref": "#/components/schemas/Masquerade" } ], "nullable": true - }, - "relationship": { - "description": "Current session user's relationship with this user", - "allOf": [ - { - "$ref": "#/components/schemas/RelationshipStatus" - } - ], - "nullable": true - }, - "online": { - "description": "Whether this user is currently online", - "type": "boolean", - "nullable": true } } }, + "SystemMessage": { + "description": "Representation of a system event message", + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] + }, + "content": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "by", + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "user_added" + ] + }, + "id": { + "type": "string" + }, + "by": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "by", + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "user_remove" + ] + }, + "id": { + "type": "string" + }, + "by": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "user_joined" + ] + }, + "id": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "user_left" + ] + }, + "id": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "user_kicked" + ] + }, + "id": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "user_banned" + ] + }, + "id": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "by", + "name", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "channel_renamed" + ] + }, + "name": { + "type": "string" + }, + "by": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "by", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "channel_description_changed" + ] + }, + "by": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "by", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "channel_icon_changed" + ] + }, + "by": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "channel_ownership_changed" + ] + }, + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + } + } + ] + }, "File": { "description": "Representation of a File on Revolt Generated by Autumn", "type": "object", @@ -6607,6 +6945,638 @@ } ] }, + "Embed": { + "description": "Embed", + "oneOf": [ + { + "description": "Website metadata", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Website" + ] + }, + "url": { + "description": "Direct URL to web page", + "type": "string", + "nullable": true + }, + "original_url": { + "description": "Original direct URL", + "type": "string", + "nullable": true + }, + "special": { + "description": "Remote content", + "allOf": [ + { + "$ref": "#/components/schemas/Special" + } + ], + "nullable": true + }, + "title": { + "description": "Title of website", + "type": "string", + "nullable": true + }, + "description": { + "description": "Description of website", + "type": "string", + "nullable": true + }, + "image": { + "description": "Embedded image", + "allOf": [ + { + "$ref": "#/components/schemas/Image" + } + ], + "nullable": true + }, + "video": { + "description": "Embedded video", + "allOf": [ + { + "$ref": "#/components/schemas/Video" + } + ], + "nullable": true + }, + "site_name": { + "description": "Site name", + "type": "string", + "nullable": true + }, + "icon_url": { + "description": "URL to site icon", + "type": "string", + "nullable": true + }, + "colour": { + "description": "CSS Colour", + "type": "string", + "nullable": true + } + } + }, + { + "description": "Image", + "type": "object", + "required": [ + "height", + "size", + "type", + "url", + "width" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Image" + ] + }, + "url": { + "description": "URL to the original image", + "type": "string" + }, + "width": { + "description": "Width of the image", + "type": "integer", + "format": "int" + }, + "height": { + "description": "Height of the image", + "type": "integer", + "format": "int" + }, + "size": { + "description": "Positioning and size", + "allOf": [ + { + "$ref": "#/components/schemas/ImageSize" + } + ] + } + } + }, + { + "description": "Video", + "type": "object", + "required": [ + "height", + "type", + "url", + "width" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Video" + ] + }, + "url": { + "description": "URL to the original video", + "type": "string" + }, + "width": { + "description": "Width of the video", + "type": "integer", + "format": "int" + }, + "height": { + "description": "Height of the video", + "type": "integer", + "format": "int" + } + } + }, + { + "description": "Text Embed", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Text" + ] + }, + "icon_url": { + "description": "URL to icon", + "type": "string", + "nullable": true + }, + "url": { + "description": "URL for title", + "type": "string", + "nullable": true + }, + "title": { + "description": "Title of text embed", + "type": "string", + "nullable": true + }, + "description": { + "description": "Description of text embed", + "type": "string", + "nullable": true + }, + "media": { + "description": "ID of uploaded autumn file", + "allOf": [ + { + "$ref": "#/components/schemas/File" + } + ], + "nullable": true + }, + "colour": { + "description": "CSS Colour", + "type": "string", + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "None" + ] + } + } + } + ] + }, + "Special": { + "description": "Information about special remote content", + "oneOf": [ + { + "description": "No remote content", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "None" + ] + } + } + }, + { + "description": "Content hint that this contains a GIF\n\nUse metadata to find video or image to play", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "GIF" + ] + } + } + }, + { + "description": "YouTube video", + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "YouTube" + ] + }, + "id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "nullable": true + } + } + }, + { + "description": "Lightspeed.tv stream", + "type": "object", + "required": [ + "content_type", + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Lightspeed" + ] + }, + "content_type": { + "$ref": "#/components/schemas/LightspeedType" + }, + "id": { + "type": "string" + } + } + }, + { + "description": "Twitch stream or clip", + "type": "object", + "required": [ + "content_type", + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Twitch" + ] + }, + "content_type": { + "$ref": "#/components/schemas/TwitchType" + }, + "id": { + "type": "string" + } + } + }, + { + "description": "Spotify track", + "type": "object", + "required": [ + "content_type", + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Spotify" + ] + }, + "content_type": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + { + "description": "Soundcloud track", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Soundcloud" + ] + } + } + }, + { + "description": "Bandcamp track", + "type": "object", + "required": [ + "content_type", + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bandcamp" + ] + }, + "content_type": { + "$ref": "#/components/schemas/BandcampType" + }, + "id": { + "type": "string" + } + } + }, + { + "description": "Streamable Video", + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Streamable" + ] + }, + "id": { + "type": "string" + } + } + } + ] + }, + "LightspeedType": { + "description": "Type of remote Lightspeed.tv content", + "type": "string", + "enum": [ + "Channel" + ] + }, + "TwitchType": { + "description": "Type of remote Twitch content", + "type": "string", + "enum": [ + "Channel", + "Video", + "Clip" + ] + }, + "BandcampType": { + "description": "Type of remote Bandcamp content", + "type": "string", + "enum": [ + "Album", + "Track" + ] + }, + "Image": { + "description": "Image", + "type": "object", + "required": [ + "height", + "size", + "url", + "width" + ], + "properties": { + "url": { + "description": "URL to the original image", + "type": "string" + }, + "width": { + "description": "Width of the image", + "type": "integer", + "format": "int" + }, + "height": { + "description": "Height of the image", + "type": "integer", + "format": "int" + }, + "size": { + "description": "Positioning and size", + "allOf": [ + { + "$ref": "#/components/schemas/ImageSize" + } + ] + } + } + }, + "ImageSize": { + "description": "Image positioning and size", + "type": "string", + "enum": [ + "Large", + "Preview" + ] + }, + "Video": { + "description": "Video", + "type": "object", + "required": [ + "height", + "url", + "width" + ], + "properties": { + "url": { + "description": "URL to the original video", + "type": "string" + }, + "width": { + "description": "Width of the video", + "type": "integer", + "format": "int" + }, + "height": { + "description": "Height of the video", + "type": "integer", + "format": "int" + } + } + }, + "Interactions": { + "description": "Information to guide interactions on this message", + "type": "object", + "properties": { + "reactions": { + "description": "Reactions which should always appear and be distinct", + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "nullable": true + }, + "restrict_reactions": { + "description": "Whether reactions should be restricted to the given list\n\nCan only be set to true if reactions list is of at least length 1", + "type": "boolean" + } + } + }, + "Masquerade": { + "description": "Name and / or avatar override information", + "type": "object", + "properties": { + "name": { + "description": "Replace the display name shown on this message", + "type": "string", + "maxLength": 32, + "minLength": 1, + "nullable": true + }, + "avatar": { + "description": "Replace the avatar shown on this message (URL to image file)", + "type": "string", + "maxLength": 256, + "minLength": 1, + "nullable": true + }, + "colour": { + "description": "Replace the display role colour shown on this message\n\nMust have `ManageRole` permission to use", + "type": "string", + "maxLength": 128, + "minLength": 1, + "pattern": "(?i)^(?:[a-z ]+|var\\(--[a-z\\d-]+\\)|rgba?\\([\\d, ]+\\)|#[a-f0-9]+|(repeating-)?(linear|conic|radial)-gradient\\(([a-z ]+|var\\(--[a-z\\d-]+\\)|rgba?\\([\\d, ]+\\)|#[a-f0-9]+|\\d+deg)([ ]+(\\d{1,3}%|0))?(,[ ]*([a-z ]+|var\\(--[a-z\\d-]+\\)|rgba?\\([\\d, ]+\\)|#[a-f0-9]+)([ ]+(\\d{1,3}%|0))?)+\\))$", + "nullable": true + } + } + }, + "User": { + "description": "Representiation of a User on Revolt.", + "type": "object", + "required": [ + "_id", + "username" + ], + "properties": { + "_id": { + "description": "Unique Id", + "type": "string" + }, + "username": { + "description": "Username", + "type": "string" + }, + "avatar": { + "description": "Avatar attachment", + "allOf": [ + { + "$ref": "#/components/schemas/File" + } + ], + "nullable": true + }, + "relations": { + "description": "Relationships with other users", + "type": "array", + "items": { + "$ref": "#/components/schemas/Relationship" + }, + "nullable": true + }, + "badges": { + "description": "Bitfield of user badges", + "type": "integer", + "format": "int32", + "nullable": true + }, + "status": { + "description": "User's current status", + "allOf": [ + { + "$ref": "#/components/schemas/UserStatus" + } + ], + "nullable": true + }, + "profile": { + "description": "User's profile page", + "allOf": [ + { + "$ref": "#/components/schemas/UserProfile" + } + ], + "nullable": true + }, + "flags": { + "description": "Enum of user flags", + "type": "integer", + "format": "int32", + "nullable": true + }, + "privileged": { + "description": "Whether this user is privileged", + "type": "boolean" + }, + "bot": { + "description": "Bot information", + "allOf": [ + { + "$ref": "#/components/schemas/BotInformation" + } + ], + "nullable": true + }, + "relationship": { + "description": "Current session user's relationship with this user", + "allOf": [ + { + "$ref": "#/components/schemas/RelationshipStatus" + } + ], + "nullable": true + }, + "online": { + "description": "Whether this user is currently online", + "type": "boolean", + "nullable": true + } + } + }, "Relationship": { "description": "Relationship entry indicating current status with other user", "type": "object", @@ -6702,6 +7672,156 @@ } } }, + "Member": { + "description": "Representation of a member of a server on Revolt", + "type": "object", + "required": [ + "_id", + "joined_at" + ], + "properties": { + "_id": { + "description": "Unique member id", + "allOf": [ + { + "$ref": "#/components/schemas/MemberCompositeKey" + } + ] + }, + "joined_at": { + "description": "Time at which this user joined the server", + "allOf": [ + { + "$ref": "#/components/schemas/ISO8601 Timestamp" + } + ] + }, + "nickname": { + "description": "Member's nickname", + "type": "string", + "nullable": true + }, + "avatar": { + "description": "Avatar attachment", + "allOf": [ + { + "$ref": "#/components/schemas/File" + } + ], + "nullable": true + }, + "roles": { + "description": "Member's roles", + "type": "array", + "items": { + "type": "string" + } + }, + "timeout": { + "description": "Timestamp this member is timed out until", + "allOf": [ + { + "$ref": "#/components/schemas/ISO8601 Timestamp" + } + ], + "nullable": true + } + } + }, + "MemberCompositeKey": { + "description": "Composite primary key consisting of server and user id", + "type": "object", + "required": [ + "server", + "user" + ], + "properties": { + "server": { + "description": "Server Id", + "type": "string" + }, + "user": { + "description": "User Id", + "type": "string" + } + } + }, + "MessageQuery": { + "title": "Message Query", + "description": "Filter and sort messages by time", + "type": "object", + "anyOf": [ + { + "type": "object", + "required": [ + "nearby" + ], + "properties": { + "nearby": { + "description": "Message id to search around\n\nSpecifying 'nearby' ignores 'before', 'after' and 'sort'. It will also take half of limit rounded as the limits to each side. It also fetches the message ID specified.", + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "before": { + "description": "Message id before which messages should be fetched", + "type": "string", + "nullable": true + }, + "after": { + "description": "Message id after which messages should be fetched", + "type": "string", + "nullable": true + }, + "sort": { + "description": "Message sort direction", + "allOf": [ + { + "$ref": "#/components/schemas/MessageSort" + } + ], + "nullable": true + } + } + } + ], + "properties": { + "limit": { + "description": "Maximum number of messages to fetch\n\nFor fetching nearby messages, this is \\`(limit + 1)\\`.", + "type": "integer", + "format": "int64", + "nullable": true + }, + "channel": { + "description": "Parent channel ID", + "type": "string", + "nullable": true + }, + "author": { + "description": "Message author ID", + "type": "string", + "nullable": true + }, + "query": { + "description": "Search query", + "type": "string", + "nullable": true + } + } + }, + "MessageSort": { + "title": "Message Sort", + "description": "Sort used for retrieving messages", + "type": "string", + "enum": [ + "Relevance", + "Latest", + "Oldest" + ] + }, "Id": { "type": "string" }, @@ -6723,6 +7843,13 @@ "title": "User Data", "type": "object", "properties": { + "avatar": { + "description": "Attachment Id for avatar", + "type": "string", + "maxLength": 128, + "minLength": 1, + "nullable": true + }, "status": { "description": "New user status", "allOf": [ @@ -6741,11 +7868,16 @@ ], "nullable": true }, - "avatar": { - "description": "Attachment Id for avatar", - "type": "string", - "maxLength": 128, - "minLength": 1, + "badges": { + "description": "Bitfield of user badges", + "type": "integer", + "format": "int32", + "nullable": true + }, + "flags": { + "description": "Enum of user flags", + "type": "integer", + "format": "int32", "nullable": true }, "remove": { @@ -7501,876 +8633,6 @@ } ] }, - "Message": { - "description": "Representation of a Message on Revolt", - "type": "object", - "required": [ - "_id", - "author", - "channel" - ], - "properties": { - "_id": { - "description": "Unique Id", - "type": "string" - }, - "nonce": { - "description": "Unique value generated by client sending this message", - "type": "string", - "nullable": true - }, - "channel": { - "description": "Id of the channel this message was sent in", - "type": "string" - }, - "author": { - "description": "Id of the user that sent this message", - "type": "string" - }, - "content": { - "description": "Message content", - "type": "string", - "nullable": true - }, - "system": { - "description": "System message", - "allOf": [ - { - "$ref": "#/components/schemas/SystemMessage" - } - ], - "nullable": true - }, - "attachments": { - "description": "Array of attachments", - "type": "array", - "items": { - "$ref": "#/components/schemas/File" - }, - "nullable": true - }, - "edited": { - "description": "Time at which this message was last edited", - "allOf": [ - { - "$ref": "#/components/schemas/ISO8601 Timestamp" - } - ], - "nullable": true - }, - "embeds": { - "description": "Attached embeds to this message", - "type": "array", - "items": { - "$ref": "#/components/schemas/Embed" - }, - "nullable": true - }, - "mentions": { - "description": "Array of user ids mentioned in this message", - "type": "array", - "items": { - "type": "string" - }, - "nullable": true - }, - "replies": { - "description": "Array of message ids this message is replying to", - "type": "array", - "items": { - "type": "string" - }, - "nullable": true - }, - "reactions": { - "description": "Hashmap of emoji IDs to array of user IDs", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - }, - "interactions": { - "description": "Information about how this message should be interacted with", - "allOf": [ - { - "$ref": "#/components/schemas/Interactions" - } - ] - }, - "masquerade": { - "description": "Name and / or avatar overrides for this message", - "allOf": [ - { - "$ref": "#/components/schemas/Masquerade" - } - ], - "nullable": true - } - } - }, - "SystemMessage": { - "description": "Representation of a system event message", - "oneOf": [ - { - "type": "object", - "required": [ - "content", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ] - }, - "content": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "by", - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "user_added" - ] - }, - "id": { - "type": "string" - }, - "by": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "by", - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "user_remove" - ] - }, - "id": { - "type": "string" - }, - "by": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "user_joined" - ] - }, - "id": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "user_left" - ] - }, - "id": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "user_kicked" - ] - }, - "id": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "user_banned" - ] - }, - "id": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "by", - "name", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "channel_renamed" - ] - }, - "name": { - "type": "string" - }, - "by": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "by", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "channel_description_changed" - ] - }, - "by": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "by", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "channel_icon_changed" - ] - }, - "by": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "from", - "to", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "channel_ownership_changed" - ] - }, - "from": { - "type": "string" - }, - "to": { - "type": "string" - } - } - } - ] - }, - "Embed": { - "description": "Embed", - "oneOf": [ - { - "description": "Website metadata", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Website" - ] - }, - "url": { - "description": "Direct URL to web page", - "type": "string", - "nullable": true - }, - "original_url": { - "description": "Original direct URL", - "type": "string", - "nullable": true - }, - "special": { - "description": "Remote content", - "allOf": [ - { - "$ref": "#/components/schemas/Special" - } - ], - "nullable": true - }, - "title": { - "description": "Title of website", - "type": "string", - "nullable": true - }, - "description": { - "description": "Description of website", - "type": "string", - "nullable": true - }, - "image": { - "description": "Embedded image", - "allOf": [ - { - "$ref": "#/components/schemas/Image" - } - ], - "nullable": true - }, - "video": { - "description": "Embedded video", - "allOf": [ - { - "$ref": "#/components/schemas/Video" - } - ], - "nullable": true - }, - "site_name": { - "description": "Site name", - "type": "string", - "nullable": true - }, - "icon_url": { - "description": "URL to site icon", - "type": "string", - "nullable": true - }, - "colour": { - "description": "CSS Colour", - "type": "string", - "nullable": true - } - } - }, - { - "description": "Image", - "type": "object", - "required": [ - "height", - "size", - "type", - "url", - "width" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Image" - ] - }, - "url": { - "description": "URL to the original image", - "type": "string" - }, - "width": { - "description": "Width of the image", - "type": "integer", - "format": "int" - }, - "height": { - "description": "Height of the image", - "type": "integer", - "format": "int" - }, - "size": { - "description": "Positioning and size", - "allOf": [ - { - "$ref": "#/components/schemas/ImageSize" - } - ] - } - } - }, - { - "description": "Video", - "type": "object", - "required": [ - "height", - "type", - "url", - "width" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Video" - ] - }, - "url": { - "description": "URL to the original video", - "type": "string" - }, - "width": { - "description": "Width of the video", - "type": "integer", - "format": "int" - }, - "height": { - "description": "Height of the video", - "type": "integer", - "format": "int" - } - } - }, - { - "description": "Text Embed", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Text" - ] - }, - "icon_url": { - "description": "URL to icon", - "type": "string", - "nullable": true - }, - "url": { - "description": "URL for title", - "type": "string", - "nullable": true - }, - "title": { - "description": "Title of text embed", - "type": "string", - "nullable": true - }, - "description": { - "description": "Description of text embed", - "type": "string", - "nullable": true - }, - "media": { - "description": "ID of uploaded autumn file", - "allOf": [ - { - "$ref": "#/components/schemas/File" - } - ], - "nullable": true - }, - "colour": { - "description": "CSS Colour", - "type": "string", - "nullable": true - } - } - }, - { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "None" - ] - } - } - } - ] - }, - "Special": { - "description": "Information about special remote content", - "oneOf": [ - { - "description": "No remote content", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "None" - ] - } - } - }, - { - "description": "Content hint that this contains a GIF\n\nUse metadata to find video or image to play", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "GIF" - ] - } - } - }, - { - "description": "YouTube video", - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "YouTube" - ] - }, - "id": { - "type": "string" - }, - "timestamp": { - "type": "string", - "nullable": true - } - } - }, - { - "description": "Lightspeed.tv stream", - "type": "object", - "required": [ - "content_type", - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Lightspeed" - ] - }, - "content_type": { - "$ref": "#/components/schemas/LightspeedType" - }, - "id": { - "type": "string" - } - } - }, - { - "description": "Twitch stream or clip", - "type": "object", - "required": [ - "content_type", - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Twitch" - ] - }, - "content_type": { - "$ref": "#/components/schemas/TwitchType" - }, - "id": { - "type": "string" - } - } - }, - { - "description": "Spotify track", - "type": "object", - "required": [ - "content_type", - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Spotify" - ] - }, - "content_type": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - { - "description": "Soundcloud track", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Soundcloud" - ] - } - } - }, - { - "description": "Bandcamp track", - "type": "object", - "required": [ - "content_type", - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Bandcamp" - ] - }, - "content_type": { - "$ref": "#/components/schemas/BandcampType" - }, - "id": { - "type": "string" - } - } - }, - { - "description": "Streamable Video", - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Streamable" - ] - }, - "id": { - "type": "string" - } - } - } - ] - }, - "LightspeedType": { - "description": "Type of remote Lightspeed.tv content", - "type": "string", - "enum": [ - "Channel" - ] - }, - "TwitchType": { - "description": "Type of remote Twitch content", - "type": "string", - "enum": [ - "Channel", - "Video", - "Clip" - ] - }, - "BandcampType": { - "description": "Type of remote Bandcamp content", - "type": "string", - "enum": [ - "Album", - "Track" - ] - }, - "Image": { - "description": "Image", - "type": "object", - "required": [ - "height", - "size", - "url", - "width" - ], - "properties": { - "url": { - "description": "URL to the original image", - "type": "string" - }, - "width": { - "description": "Width of the image", - "type": "integer", - "format": "int" - }, - "height": { - "description": "Height of the image", - "type": "integer", - "format": "int" - }, - "size": { - "description": "Positioning and size", - "allOf": [ - { - "$ref": "#/components/schemas/ImageSize" - } - ] - } - } - }, - "ImageSize": { - "description": "Image positioning and size", - "type": "string", - "enum": [ - "Large", - "Preview" - ] - }, - "Video": { - "description": "Video", - "type": "object", - "required": [ - "height", - "url", - "width" - ], - "properties": { - "url": { - "description": "URL to the original video", - "type": "string" - }, - "width": { - "description": "Width of the video", - "type": "integer", - "format": "int" - }, - "height": { - "description": "Height of the video", - "type": "integer", - "format": "int" - } - } - }, - "Interactions": { - "description": "Information to guide interactions on this message", - "type": "object", - "properties": { - "reactions": { - "description": "Reactions which should always appear and be distinct", - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true, - "nullable": true - }, - "restrict_reactions": { - "description": "Whether reactions should be restricted to the given list\n\nCan only be set to true if reactions list is of at least length 1", - "type": "boolean" - } - } - }, - "Masquerade": { - "description": "Name and / or avatar override information", - "type": "object", - "properties": { - "name": { - "description": "Replace the display name shown on this message", - "type": "string", - "maxLength": 32, - "minLength": 1, - "nullable": true - }, - "avatar": { - "description": "Replace the avatar shown on this message (URL to image file)", - "type": "string", - "maxLength": 256, - "minLength": 1, - "nullable": true - }, - "colour": { - "description": "Replace the display role colour shown on this message\n\nMust have `ManageRole` permission to use", - "type": "string", - "maxLength": 128, - "minLength": 1, - "pattern": "(?i)^(?:[a-z ]+|var\\(--[a-z\\d-]+\\)|rgba?\\([\\d, ]+\\)|#[a-f0-9]+|(repeating-)?(linear|conic|radial)-gradient\\(([a-z ]+|var\\(--[a-z\\d-]+\\)|rgba?\\([\\d, ]+\\)|#[a-f0-9]+|\\d+deg)([ ]+(\\d{1,3}%|0))?(,[ ]*([a-z ]+|var\\(--[a-z\\d-]+\\)|rgba?\\([\\d, ]+\\)|#[a-f0-9]+)([ ]+(\\d{1,3}%|0))?)+\\))$", - "nullable": true - } - } - }, "DataMessageSend": { "type": "object", "properties": { @@ -8494,133 +8756,6 @@ } } }, - "BulkMessageResponse": { - "title": "Bulk Message Response", - "description": "Response used when multiple messages are fetched", - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/Message" - } - }, - { - "type": "object", - "required": [ - "messages", - "users" - ], - "properties": { - "messages": { - "description": "List of messages", - "type": "array", - "items": { - "$ref": "#/components/schemas/Message" - } - }, - "users": { - "description": "List of users", - "type": "array", - "items": { - "$ref": "#/components/schemas/User" - } - }, - "members": { - "description": "List of members", - "type": "array", - "items": { - "$ref": "#/components/schemas/Member" - }, - "nullable": true - } - } - } - ] - }, - "Member": { - "description": "Representation of a member of a server on Revolt", - "type": "object", - "required": [ - "_id", - "joined_at" - ], - "properties": { - "_id": { - "description": "Unique member id", - "allOf": [ - { - "$ref": "#/components/schemas/MemberCompositeKey" - } - ] - }, - "joined_at": { - "description": "Time at which this user joined the server", - "allOf": [ - { - "$ref": "#/components/schemas/ISO8601 Timestamp" - } - ] - }, - "nickname": { - "description": "Member's nickname", - "type": "string", - "nullable": true - }, - "avatar": { - "description": "Avatar attachment", - "allOf": [ - { - "$ref": "#/components/schemas/File" - } - ], - "nullable": true - }, - "roles": { - "description": "Member's roles", - "type": "array", - "items": { - "type": "string" - } - }, - "timeout": { - "description": "Timestamp this member is timed out until", - "allOf": [ - { - "$ref": "#/components/schemas/ISO8601 Timestamp" - } - ], - "nullable": true - } - } - }, - "MemberCompositeKey": { - "description": "Composite primary key consisting of server and user id", - "type": "object", - "required": [ - "server", - "user" - ], - "properties": { - "server": { - "description": "Server Id", - "type": "string" - }, - "user": { - "description": "User Id", - "type": "string" - } - } - }, - "MessageSort": { - "title": "Message Sort", - "description": "Sort used for retrieving messages", - "type": "string", - "enum": [ - "Relevance", - "Latest", - "Oldest" - ] - }, "OptionsMessageSearch": { "title": "Search Parameters", "type": "object", @@ -8657,7 +8792,7 @@ "nullable": true }, "sort": { - "description": "Message sort direction\n\nBy default, it will be sorted by relevance.", + "description": "Message sort direction\n\nBy default, it will be sorted by latest.", "default": "Relevance", "allOf": [ { @@ -8963,7 +9098,7 @@ "nullable": true }, "flags": { - "description": "Enum of server flags", + "description": "Bitfield of server flags", "type": "integer", "format": "int32", "nullable": true @@ -9147,6 +9282,12 @@ ], "nullable": true }, + "flags": { + "description": "Bitfield of server flags", + "type": "integer", + "format": "int32", + "nullable": true + }, "discoverable": { "description": "Whether this server is public and should show up on [Revolt Discover](https://rvlt.gg)", "type": "boolean", @@ -10379,7 +10520,7 @@ "nullable": true }, "flags": { - "description": "Enum of server flags", + "description": "Bitfield of server flags", "type": "integer", "format": "int32", "nullable": true @@ -11495,8 +11636,9 @@ ] }, { - "name": "Platform Moderation", + "name": "Platform Administration", "tags": [ + "Admin", "User Safety" ] },