From 36879fd4736ff412b0993948501a0a1cc0bf8a2c Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Mon, 3 Jan 2022 11:32:38 +0000 Subject: [PATCH] feat: add discovery / analytics flags --- OpenAPI.json | 250 +++++++++-------------------------------------- package.json | 2 +- types/Bots.ts | 11 +++ types/Servers.ts | 11 +++ 4 files changed, 68 insertions(+), 206 deletions(-) diff --git a/OpenAPI.json b/OpenAPI.json index c52e56b..81dfff6 100644 --- a/OpenAPI.json +++ b/OpenAPI.json @@ -3,7 +3,7 @@ "openapi": "3.0.0", "info": { "title": "Revolt API", - "version": "0.5.3-alpha.9", + "version": "0.5.4-alpha.0", "description": "User-first privacy focused chat platform built with modern web technologies.\n\n# Authentication\n\nCurrently all relevant requests are authenticated by the use of two headers which identify a session.\n\n", "termsOfService": "https://revolt.chat/terms", "contact": { @@ -9275,6 +9275,14 @@ "description": "Whether the bot can be added by anyone", "type": "boolean" }, + "analytics": { + "description": "Whether to collect analytics on this bot\nEnabled if bot is discoverable", + "type": "boolean" + }, + "discoverable": { + "description": "Whether this bot is discoverable", + "type": "boolean" + }, "interactions_url": { "description": "Interactions endpoint URL\n\nRequired for dynamic interactions such as bot commands and message actions. Events will be sent over HTTP and a response may be generated directly.", "type": "string" @@ -9621,6 +9629,14 @@ "description": "Whether the bot can be added by anyone", "type": "boolean" }, + "analytics": { + "description": "Whether to collect analytics on this bot\nEnabled if bot is discoverable", + "type": "boolean" + }, + "discoverable": { + "description": "Whether this bot is discoverable", + "type": "boolean" + }, "interactions_url": { "description": "Interactions endpoint URL\n\nRequired for dynamic interactions such as bot commands and message actions. Events will be sent over HTTP and a response may be generated directly.", "type": "string" @@ -11191,6 +11207,14 @@ "flags": { "description": "Server flags\n\n`1`: Official Revolt server\n`2`: Verified community server", "type": "number" + }, + "analytics": { + "description": "Whether to collect analytics on this server\nEnabled if server is discoverable", + "type": "boolean" + }, + "discoverable": { + "description": "Whether this server is discoverable", + "type": "boolean" } }, "required": [ @@ -11853,6 +11877,14 @@ "description": "Whether the bot can be added by anyone", "type": "boolean" }, + "analytics": { + "description": "Whether to collect analytics on this bot\nEnabled if bot is discoverable", + "type": "boolean" + }, + "discoverable": { + "description": "Whether this bot is discoverable", + "type": "boolean" + }, "interactions_url": { "description": "Interactions endpoint URL\n\nRequired for dynamic interactions such as bot commands and message actions. Events will be sent over HTTP and a response may be generated directly.", "type": "string" @@ -16601,6 +16633,14 @@ "flags": { "description": "Server flags\n\n`1`: Official Revolt server\n`2`: Verified community server", "type": "number" + }, + "analytics": { + "description": "Whether to collect analytics on this server\nEnabled if server is discoverable", + "type": "boolean" + }, + "discoverable": { + "description": "Whether this server is discoverable", + "type": "boolean" } }, "required": [ @@ -17012,10 +17052,14 @@ "Badges": { "enum": [ 1, + 128, 16, 2, 256, + 32, 4, + 512, + 64, 8 ], "type": "number", @@ -17557,99 +17601,6 @@ } } }, - "FetchUnreads": { - "type": "array", - "items": { - "$ref": "#/definitions/ChannelUnread" - }, - "definitions": { - "AttachmentTag": { - "description": "Attachment tag", - "enum": [ - "attachments", - "avatars", - "backgrounds", - "banners", - "icons" - ], - "type": "string" - }, - "RelationshipStatus": { - "description": "Your relationship with the user", - "enum": [ - "Blocked", - "BlockedOther", - "Friend", - "Incoming", - "None", - "Outgoing", - "User" - ], - "type": "string" - }, - "Presence": { - "description": "User presence", - "enum": [ - "Busy", - "Idle", - "Invisible", - "Online" - ], - "type": "string" - }, - "BotInformation": { - "description": "Bot information", - "type": "object", - "properties": { - "owner": { - "description": "The User ID of the owner of this bot", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - } - }, - "required": [ - "owner" - ] - }, - "ChannelUnread": { - "type": "object", - "properties": { - "_id": { - "type": "object", - "properties": { - "channel": { - "description": "Id", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - }, - "user": { - "description": "Id", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - } - }, - "required": [ - "channel", - "user" - ] - }, - "last_id": { - "type": "string" - }, - "mentions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "_id", - "last_id" - ] - } - } - }, "Id": { "description": "Id", "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", @@ -17702,43 +17653,6 @@ "required": [ "owner" ] - }, - "ChannelUnread": { - "type": "object", - "properties": { - "_id": { - "type": "object", - "properties": { - "channel": { - "description": "Id", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - }, - "user": { - "description": "Id", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - } - }, - "required": [ - "channel", - "user" - ] - }, - "last_id": { - "type": "string" - }, - "mentions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "_id", - "last_id" - ] } } }, @@ -17795,43 +17709,6 @@ "required": [ "owner" ] - }, - "ChannelUnread": { - "type": "object", - "properties": { - "_id": { - "type": "object", - "properties": { - "channel": { - "description": "Id", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - }, - "user": { - "description": "Id", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - } - }, - "required": [ - "channel", - "user" - ] - }, - "last_id": { - "type": "string" - }, - "mentions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "_id", - "last_id" - ] } } }, @@ -17888,43 +17765,6 @@ "required": [ "owner" ] - }, - "ChannelUnread": { - "type": "object", - "properties": { - "_id": { - "type": "object", - "properties": { - "channel": { - "description": "Id", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - }, - "user": { - "description": "Id", - "pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}", - "type": "string" - } - }, - "required": [ - "channel", - "user" - ] - }, - "last_id": { - "type": "string" - }, - "mentions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "_id", - "last_id" - ] } } } diff --git a/package.json b/package.json index 527f888..4b23248 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revolt-api", - "version": "0.5.3-alpha.10", + "version": "0.5.4-alpha.0", "description": "Revolt API typings", "main": "dist/index.js", "type": "module", diff --git a/types/Bots.ts b/types/Bots.ts index 3347250..d14fc07 100644 --- a/types/Bots.ts +++ b/types/Bots.ts @@ -25,6 +25,17 @@ export interface Bot { */ public: boolean + /** + * Whether to collect analytics on this bot + * Enabled if bot is discoverable + */ + analytics?: boolean + + /** + * Whether this bot is discoverable + */ + discoverable?: boolean + /** * Interactions endpoint URL * diff --git a/types/Servers.ts b/types/Servers.ts index 502bfcd..74c1f46 100644 --- a/types/Servers.ts +++ b/types/Servers.ts @@ -163,4 +163,15 @@ export type Server = { * `2`: Verified community server */ flags?: number + + /** + * Whether to collect analytics on this server + * Enabled if server is discoverable + */ + analytics?: boolean + + /** + * Whether this server is discoverable + */ + discoverable?: boolean }