From 238e00f4287a30a69a45c93094b8614cdb8d777c Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 7 Sep 2024 11:25:38 +0100 Subject: [PATCH 1/2] feat: swap oapi for openapi-fetch --- .gitignore | 3 + README.md | 46 +- codegen.js | 20 + nodemon.json | 10 - package.json | 19 +- src/api.d.ts | 7154 +++++++++++++++++++++++++++++++++++++++++++++ src/baseURL.ts | 2 - src/index.ts | 293 +- src/params.ts | 3 - src/routes.ts | 184 -- src/schema.ts | 4899 ------------------------------- src/types.d.ts | 131 + src/types.ts | 131 - tsconfig.esm.json | 26 +- tsconfig.json | 24 +- yarn.lock | 589 +++- 16 files changed, 7911 insertions(+), 5623 deletions(-) create mode 100644 codegen.js delete mode 100644 nodemon.json create mode 100644 src/api.d.ts delete mode 100644 src/baseURL.ts delete mode 100644 src/params.ts delete mode 100644 src/routes.ts delete mode 100644 src/schema.ts create mode 100644 src/types.d.ts delete mode 100644 src/types.ts diff --git a/.gitignore b/.gitignore index fd0b663..f08d033 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ node_modules dist out esm + +deno.lock +test.ts diff --git a/README.md b/README.md index 47de0fb..498b70f 100644 --- a/README.md +++ b/README.md @@ -2,38 +2,42 @@ ![revolt-api](https://img.shields.io/npm/v/revolt-api) -This package contains typings for objects in the [Revolt API](https://developers.revolt.chat/api/) and a fully typed API request builder. +This package contains typings for objects in the [Revolt API](https://developers.revolt.chat/api/) and a fully typed API request builder using [openapi-fetch](https://openapi-ts.dev). ### Example Usage If you just need access to types: ```typescript -import type { User } from 'revolt-api'; +import type { User } from "revolt-api"; ``` If you want to send requests: ```typescript -import { API } from 'revolt-api'; - -// Initialise a new API client: -const client = new API(); - -// or with authentication: -const client = new API({ authentication: { revolt: 'bot-token' } }); - -// Make requests with ease: -client.get('/users/@me') - // Fully typed responses! - .then(user => user.username); +import { createClient } from "./esm/index.js"; + +const api = createClient({ + // specify bot token: + botToken: "bot-token", + // .. or a user session token: + sessionToken: "session-token", + // .. also accepts options from openapi-fetch + // such as custom middleware, baseURL, etc +}); -// No need to worry about the details: -let channel_id = "some channel id"; -client.post(`/channels/${channel_id}/messages`, { - // Parameters given are fully typed as well! - content: "some content" +// Fetch information about user +api.GET("/users/@me").then((res) => console.info(res.data)); + +// Send a message to a channel +api.POST("/channels/{target}/messages", { + params: { + path: { + target: "01F92C5ZXBQWQ8KY7J8KY917NM", + }, + }, + body: { + content: "Hello from Fetch/Node.js/Bun/Deno!", + }, }); ``` - -For more details on how this works, see the [README of @insertish/oapi](https://github.com/insertish/oapi#example). diff --git a/codegen.js b/codegen.js new file mode 100644 index 0000000..0380dc3 --- /dev/null +++ b/codegen.js @@ -0,0 +1,20 @@ +const { readFile, writeFile } = require("node:fs/promises"); + +const RE_SCHEMA = /\["schemas"\]\["([\w\d]+)"\]/g; + +readFile("src/api.d.ts") + .then((f) => f.toString()) + .then((src) => [...src.matchAll(RE_SCHEMA)].map(([_, m1]) => m1)) + .then((arr) => new Set(arr)) + .then((set) => [...set]) + .then((schemas) => + writeFile( + "src/types.d.ts", + `import type { components } from "./api"; + +${schemas.map((n) => `type ${n} = components["schemas"]["${n}"];`).join("\n")} + +export type { ${schemas.join(", ")} }; +` + ) + ); diff --git a/nodemon.json b/nodemon.json deleted file mode 100644 index c8850ec..0000000 --- a/nodemon.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/nodemon.json", - "watch": [ - "**/*.ts" - ], - "ext": "ts", - "ignore": [ - "__temp.ts" - ] -} \ No newline at end of file diff --git a/package.json b/package.json index c491824..f9cd9a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revolt-api", - "version": "0.7.16", + "version": "0.7.16-next.1", "description": "Revolt API Library", "main": "dist/index.js", "module": "esm/index.js", @@ -9,26 +9,27 @@ "author": "Paul Makles ", "license": "MIT", "scripts": { - "build": "REWRITE_ANYOF=1 oapilib && tsc && tsc -p tsconfig.esm.json", + "gen": "REWRITE_ANYOF=1 openapi-typescript ./OpenAPI.json -o ./src/api.d.ts && node codegen.js", + "build": "yarn gen && rimraf dist esm && tsc && tsc -p tsconfig.esm.json", + "typecheck": "tsc --noEmit", "prepublish": "in-publish && yarn build || echo Skipping build." }, "devDependencies": { - "@insertish/oapi": "0.1.18", - "@types/lodash.defaultsdeep": "^4.6.6", "in-publish": "^2.0.1", - "openapi-typescript": "^5.2.0", - "typescript": "^4.6.2" + "openapi-typescript": "^7.4.0", + "rimraf": "^6.0.1", + "typescript": "^5.5.4" }, "dependencies": { - "axios": "^0.26.1", - "lodash.defaultsdeep": "^4.6.1" + "openapi-fetch": "^0.12.0" }, "files": [ "src", "dist", "esm", + "codegen.js", "OpenAPI.json", "LICENSE", "README.md" ] -} +} \ No newline at end of file diff --git a/src/api.d.ts b/src/api.d.ts new file mode 100644 index 0000000..8ccde28 --- /dev/null +++ b/src/api.d.ts @@ -0,0 +1,7154 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + "/": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Query Node + * @description Fetch the server configuration for this Revolt instance. + */ + get: operations["root_root"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/@me": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Self + * @description Retrieve your user information. + */ + get: operations["fetch_self_fetch"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/{target}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch User + * @description Retrieve a user's information. + */ + get: operations["fetch_user_fetch"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** + * Edit User + * @description Edit currently authenticated user. + */ + patch: operations["edit_user_edit"]; + trace?: never; + }; + "/users/{target}/flags": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch User Flags + * @description Retrieve a user's flags. + */ + get: operations["fetch_user_flags_fetch_user_flags"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/@me/username": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** + * Change Username + * @description Change your username. + */ + patch: operations["change_username_change_username"]; + trace?: never; + }; + "/users/{target}/default_avatar": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Default Avatar + * @description This returns a default avatar based on the given id. + */ + get: operations["get_default_avatar_default_avatar"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/{target}/profile": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch User Profile + * @description Retrieve a user's profile data. + * + * Will fail if you do not have permission to access the other user's profile. + */ + get: operations["fetch_profile_profile"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/dms": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Direct Message Channels + * @description This fetches your direct messages, including any DM and group DM conversations. + */ + get: operations["fetch_dms_direct_messages"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/{target}/dm": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Open Direct Message + * @description Open a DM with another user. + * + * If the target is oneself, a saved messages channel is returned. + */ + get: operations["open_dm_open_dm"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/{target}/mutual": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Mutual Friends And Servers + * @description Retrieve a list of mutual friends and servers with another user. + */ + get: operations["find_mutual_mutual"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/{target}/friend": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Accept Friend Request + * @description Accept another user's friend request. + */ + put: operations["add_friend_add"]; + post?: never; + /** + * Deny Friend Request / Remove Friend + * @description Denies another user's friend request or removes an existing friend. + */ + delete: operations["remove_friend_remove"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/{target}/block": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Block User + * @description Block another user by their id. + */ + put: operations["block_user_block"]; + post?: never; + /** + * Unblock User + * @description Unblock another user by their id. + */ + delete: operations["unblock_user_unblock"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/friend": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Send Friend Request + * @description Send a friend request to another user. + */ + post: operations["send_friend_request_send_friend_request"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bots/create": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Create Bot + * @description Create a new Revolt bot. + */ + post: operations["create_create_bot"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bots/{target}/invite": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Public Bot + * @description Fetch details of a public (or owned) bot by its id. + */ + get: operations["fetch_public_fetch_public_bot"]; + put?: never; + /** + * Invite Bot + * @description Invite a bot to a server or group by its id.` + */ + post: operations["invite_invite_bot"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bots/{bot}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Bot + * @description Fetch details of a bot you own by its id. + */ + get: operations["fetch_fetch_bot"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bots/@me": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Owned Bots + * @description Fetch all of the bots that you have control over. + */ + get: operations["fetch_owned_fetch_owned_bots"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bots/{target}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Delete Bot + * @description Delete a bot by its id. + */ + delete: operations["delete_delete_bot"]; + options?: never; + head?: never; + /** + * Edit Bot + * @description Edit bot details by its id. + */ + patch: operations["edit_edit_bot"]; + trace?: never; + }; + "/channels/{target}/ack/{message}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Acknowledge Message + * @description Lets the server and all other clients know that we've seen this message id in this channel. + */ + put: operations["channel_ack_ack"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Channel + * @description Fetch channel by its id. + */ + get: operations["channel_fetch_fetch"]; + put?: never; + post?: never; + /** + * Close Channel + * @description Deletes a server channel, leaves a group or closes a group. + */ + delete: operations["channel_delete_delete"]; + options?: never; + head?: never; + /** + * Edit Channel + * @description Edit a channel object by its id. + */ + patch: operations["channel_edit_edit"]; + trace?: never; + }; + "/channels/{target}/members": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Group Members + * @description Retrieves all users who are part of this group. + * + * This may not return full user information if users are not friends but have mutual connections. + */ + get: operations["members_fetch_fetch_members"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/invites": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Create Invite + * @description Creates an invite to this channel. + * + * Channel must be a `TextChannel`. + */ + post: operations["invite_create_create_invite"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/messages": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Messages + * @description Fetch multiple messages. + */ + get: operations["message_query_query"]; + put?: never; + /** + * Send Message + * @description Sends a message to the given channel. + */ + post: operations["message_send_message_send"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/search": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Search for Messages + * @description This route searches for messages within the given parameters. + */ + post: operations["message_search_search"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/messages/{msg}/pin": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Pins a message + * @description Pins a message by its id. + */ + post: operations["message_pin_message_pin"]; + /** + * Unpins a message + * @description Unpins a message by its id. + */ + delete: operations["message_unpin_message_unpin"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/messages/{msg}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Message + * @description Retrieves a message by its id. + */ + get: operations["message_fetch_fetch"]; + put?: never; + post?: never; + /** + * Delete Message + * @description Delete a message you've sent or one you have permission to delete. + */ + delete: operations["message_delete_delete"]; + options?: never; + head?: never; + /** + * Edit Message + * @description Edits a message that you've previously sent. + */ + patch: operations["message_edit_edit"]; + trace?: never; + }; + "/channels/{target}/messages/bulk": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Bulk Delete Messages + * @description Delete multiple messages you've sent or one you have permission to delete. + * + * This will always require `ManageMessages` permission regardless of whether you own the message or not. + * + * Messages must have been sent within the past 1 week. + */ + delete: operations["message_bulk_delete_bulk_delete_messages"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/create": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Create Group + * @description Create a new group channel. + */ + post: operations["group_create_create_group"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{group_id}/recipients/{member_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Add Member to Group + * @description Adds another user to the group. + */ + put: operations["group_add_member_add_member"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/recipients/{member}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Remove Member from Group + * @description Removes a user from the group. + */ + delete: operations["group_remove_member_remove_member"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/join_call": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Join Call + * @description Asks the voice server for a token to join the call. + */ + post: operations["voice_join_call"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/permissions/{role_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Set Role Permission + * @description Sets permissions for the specified role in this channel. + * + * Channel must be a `TextChannel` or `VoiceChannel`. + */ + put: operations["permissions_set_set_role_permissions"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/permissions/default": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Set Default Permission + * @description Sets permissions for the default role in this channel. + * + * Channel must be a `Group`, `TextChannel` or `VoiceChannel`. + */ + put: operations["permissions_set_default_set_default_permissions"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/messages/{msg}/reactions/{emoji}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Add Reaction to Message + * @description React to a given message. + */ + put: operations["message_react_react_message"]; + post?: never; + /** + * Remove Reaction(s) to Message + * @description Remove your own, someone else's or all of a given reaction. + * + * Requires `ManageMessages` if changing others' reactions. + */ + delete: operations["message_unreact_unreact_message"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/messages/{msg}/reactions": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Remove All Reactions from Message + * @description Remove your own, someone else's or all of a given reaction. + * + * Requires `ManageMessages` permission. + */ + delete: operations["message_clear_reactions_clear_reactions"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{target}/webhooks": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Creates a webhook + * @description Creates a webhook which 3rd party platforms can use to send messages + */ + post: operations["webhook_create_create_webhook"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/channels/{channel_id}/webhooks": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Gets all webhooks + * @description Gets all webhooks inside the channel + */ + get: operations["webhook_fetch_all_fetch_webhooks"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/create": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Create Server + * @description Create a new server. + */ + post: operations["server_create_create_server"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Server + * @description Fetch a server by its id. + */ + get: operations["server_fetch_fetch"]; + put?: never; + post?: never; + /** + * Delete / Leave Server + * @description Deletes a server if owner otherwise leaves. + */ + delete: operations["server_delete_delete"]; + options?: never; + head?: never; + /** + * Edit Server + * @description Edit a server by its id. + */ + patch: operations["server_edit_edit"]; + trace?: never; + }; + "/servers/{target}/ack": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Mark Server As Read + * @description Mark all channels in a server as read. + */ + put: operations["server_ack_ack"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{server}/channels": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Create Channel + * @description Create a new Text or Voice channel. + */ + post: operations["channel_create_create_server_channel"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}/members": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Members + * @description Fetch all server members. + */ + get: operations["member_fetch_all_fetch_all"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}/members/{member}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Member + * @description Retrieve a member. + */ + get: operations["member_fetch_fetch"]; + put?: never; + post?: never; + /** + * Kick Member + * @description Removes a member from the server. + */ + delete: operations["member_remove_kick"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{server}/members/{target}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** + * Edit Member + * @description Edit a member by their id. + */ + patch: operations["member_edit_edit"]; + trace?: never; + }; + "/servers/{target}/members_experimental_query": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Query members by name + * @description Query members by a given name, this API is not stable and will be removed in the future. + */ + get: operations["member_experimental_query_member_experimental_query"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{server}/bans/{target}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Ban User + * @description Ban a user by their id. + */ + put: operations["ban_create_ban"]; + post?: never; + /** + * Unban user + * @description Remove a user's ban. + */ + delete: operations["ban_remove_unban"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}/bans": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Bans + * @description Fetch all bans on a server. + */ + get: operations["ban_list_list"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}/invites": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Invites + * @description Fetch all server invites. + */ + get: operations["invites_fetch_invites"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}/roles": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Create Role + * @description Creates a new server role. + */ + post: operations["roles_create_create"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}/roles/{role_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Role + * @description Fetch a role by its id. + */ + get: operations["roles_fetch_fetch"]; + put?: never; + post?: never; + /** + * Delete Role + * @description Delete a server role by its id. + */ + delete: operations["roles_delete_delete"]; + options?: never; + head?: never; + /** + * Edit Role + * @description Edit a role by its id. + */ + patch: operations["roles_edit_edit"]; + trace?: never; + }; + "/servers/{target}/permissions/{role_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Set Role Permission + * @description Sets permissions for the specified role in the server. + */ + put: operations["permissions_set_set_role_permission"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}/permissions/default": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Set Default Permission + * @description Sets permissions for the default role in this server. + */ + put: operations["permissions_set_default_set_default_permissions"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/servers/{target}/emojis": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Server Emoji + * @description Fetch all emoji on a server. + */ + get: operations["emoji_list_list_emoji"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/invites/{target}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Invite + * @description Fetch an invite by its id. + */ + get: operations["invite_fetch_fetch"]; + put?: never; + /** + * Join Invite + * @description Join an invite by its ID + */ + post: operations["invite_join_join"]; + /** + * Delete Invite + * @description Delete an invite by its id. + */ + delete: operations["invite_delete_delete"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/custom/emoji/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Create New Emoji + * @description Create an emoji by its Autumn upload id. + */ + put: operations["emoji_create_create_emoji"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/custom/emoji/{emoji_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Emoji + * @description Fetch an emoji by its id. + */ + get: operations["emoji_fetch_fetch_emoji"]; + put?: never; + post?: never; + /** + * Delete Emoji + * @description Delete an emoji by its id. + */ + delete: operations["emoji_delete_delete_emoji"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/safety/report": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Report Content + * @description Report a piece of content to the moderation team. + */ + post: operations["report_content_report_content"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/account/create": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Create Account + * @description Create a new account. + */ + post: operations["create_account_create_account"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/account/reverify": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Resend Verification + * @description Resend account creation verification email. + */ + post: operations["resend_verification_resend_verification"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/account/delete": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Confirm Account Deletion + * @description Schedule an account for deletion by confirming the received token. + */ + put: operations["confirm_deletion_confirm_deletion"]; + /** + * Delete Account + * @description Request to have an account deleted. + */ + post: operations["delete_account_delete_account"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/account/": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Account + * @description Fetch account information from the current session. + */ + get: operations["fetch_account_fetch_account"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/account/disable": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Disable Account + * @description Disable an account. + */ + post: operations["disable_account_disable_account"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/account/change/password": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** + * Change Password + * @description Change the current account password. + */ + patch: operations["change_password_change_password"]; + trace?: never; + }; + "/auth/account/change/email": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** + * Change Email + * @description Change the associated account email. + */ + patch: operations["change_email_change_email"]; + trace?: never; + }; + "/auth/account/verify/{code}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Verify Email + * @description Verify an email address. + */ + post: operations["verify_email_verify_email"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/account/reset_password": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Send Password Reset + * @description Send an email to reset account password. + */ + post: operations["send_password_reset_send_password_reset"]; + delete?: never; + options?: never; + head?: never; + /** + * Password Reset + * @description Confirm password reset and change the password. + */ + patch: operations["password_reset_password_reset"]; + trace?: never; + }; + "/auth/session/login": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Login + * @description Login to an account. + */ + post: operations["login_login"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/session/logout": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Logout + * @description Delete current session. + */ + post: operations["logout_logout"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/session/all": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Sessions + * @description Fetch all sessions associated with this account. + */ + get: operations["fetch_all_fetch_all"]; + put?: never; + post?: never; + /** + * Delete All Sessions + * @description Delete all active sessions, optionally including current one. + */ + delete: operations["revoke_all_revoke_all"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/session/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Revoke Session + * @description Delete a specific active session. + */ + delete: operations["revoke_revoke"]; + options?: never; + head?: never; + /** + * Edit Session + * @description Edit current session information. + */ + patch: operations["edit_edit"]; + trace?: never; + }; + "/auth/mfa/ticket": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Create MFA ticket + * @description Create a new MFA ticket or validate an existing one. + */ + put: operations["create_ticket_create_ticket"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/mfa/": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * MFA Status + * @description Fetch MFA status of an account. + */ + get: operations["fetch_status_fetch_status"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/mfa/recovery": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Fetch Recovery Codes + * @description Fetch recovery codes for an account. + */ + post: operations["fetch_recovery_fetch_recovery"]; + delete?: never; + options?: never; + head?: never; + /** + * Generate Recovery Codes + * @description Re-generate recovery codes for an account. + */ + patch: operations["generate_recovery_generate_recovery"]; + trace?: never; + }; + "/auth/mfa/methods": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get MFA Methods + * @description Fetch available MFA methods. + */ + get: operations["get_mfa_methods_get_mfa_methods"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/mfa/totp": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Enable TOTP 2FA + * @description Generate a new secret for TOTP. + */ + put: operations["totp_enable_totp_enable"]; + /** + * Generate TOTP Secret + * @description Generate a new secret for TOTP. + */ + post: operations["totp_generate_secret_totp_generate_secret"]; + /** + * Disable TOTP 2FA + * @description Disable TOTP 2FA for an account. + */ + delete: operations["totp_disable_totp_disable"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/onboard/hello": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Check Onboarding Status + * @description This will tell you whether the current account requires onboarding or whether you can continue to send requests as usual. You may skip calling this if you're restoring an existing session. + */ + get: operations["hello_hello"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/onboard/complete": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Complete Onboarding + * @description This sets a new username, completes onboarding and allows a user to start using Revolt. + */ + post: operations["complete_complete"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/push/subscribe": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Push Subscribe + * @description Create a new Web Push subscription. + * + * If an existing subscription exists on this session, it will be removed. + */ + post: operations["subscribe_subscribe"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/push/unsubscribe": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Unsubscribe + * @description Remove the Web Push subscription associated with the current session. + */ + post: operations["unsubscribe_unsubscribe"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/sync/settings/fetch": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Fetch Settings + * @description Fetch settings from server filtered by keys. + * + * This will return an object with the requested keys, each value is a tuple of `(timestamp, value)`, the value is the previously uploaded data. + */ + post: operations["get_settings_fetch"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/sync/settings/set": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Set Settings + * @description Upload data to save to settings. + */ + post: operations["set_settings_set"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/sync/unreads": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Fetch Unreads + * @description Fetch information about unread state on channels. + */ + get: operations["get_unreads_unreads"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + /** Server Configuration */ + RevoltConfig: { + /** @description Revolt API Version */ + revolt: string; + /** @description Features enabled on this Revolt node */ + features: components["schemas"]["RevoltFeatures"]; + /** @description WebSocket URL */ + ws: string; + /** @description URL pointing to the client serving this node */ + app: string; + /** @description Web Push VAPID public key */ + vapid: string; + /** @description Build information */ + build: components["schemas"]["BuildInformation"]; + }; + /** Feature Configuration */ + RevoltFeatures: { + /** @description hCaptcha configuration */ + captcha: components["schemas"]["CaptchaFeature"]; + /** @description Whether email verification is enabled */ + email: boolean; + /** @description Whether this server is invite only */ + invite_only: boolean; + /** @description File server service configuration */ + autumn: components["schemas"]["Feature"]; + /** @description Proxy service configuration */ + january: components["schemas"]["Feature"]; + /** @description Voice server configuration */ + voso: components["schemas"]["VoiceFeature"]; + }; + /** hCaptcha Configuration */ + CaptchaFeature: { + /** @description Whether captcha is enabled */ + enabled: boolean; + /** @description Client key used for solving captcha */ + key: string; + }; + /** Generic Service Configuration */ + Feature: { + /** @description Whether the service is enabled */ + enabled: boolean; + /** @description URL pointing to the service */ + url: string; + }; + /** Voice Server Configuration */ + VoiceFeature: { + /** @description Whether voice is enabled */ + enabled: boolean; + /** @description URL pointing to the voice API */ + url: string; + /** @description URL pointing to the voice WebSocket server */ + ws: string; + }; + /** Build Information */ + BuildInformation: { + /** @description Commit Hash */ + commit_sha: string; + /** @description Commit Timestamp */ + commit_timestamp: string; + /** @description Git Semver */ + semver: string; + /** @description Git Origin URL */ + origin_url: string; + /** @description Build Timestamp */ + timestamp: string; + }; + /** + * Error + * @description Error information + */ + Error: { + /** @description Where this error occurred */ + location: string; + } & ({ + /** @enum {string} */ + type: "LabelMe"; + } | { + /** @enum {string} */ + type: "AlreadyOnboarded"; + } | { + /** @enum {string} */ + type: "UsernameTaken"; + } | { + /** @enum {string} */ + type: "InvalidUsername"; + } | { + /** @enum {string} */ + type: "DiscriminatorChangeRatelimited"; + } | { + /** @enum {string} */ + type: "UnknownUser"; + } | { + /** @enum {string} */ + type: "AlreadyFriends"; + } | { + /** @enum {string} */ + type: "AlreadySentRequest"; + } | { + /** @enum {string} */ + type: "Blocked"; + } | { + /** @enum {string} */ + type: "BlockedByOther"; + } | { + /** @enum {string} */ + type: "NotFriends"; + } | { + /** @enum {string} */ + type: "TooManyPendingFriendRequests"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "UnknownChannel"; + } | { + /** @enum {string} */ + type: "UnknownAttachment"; + } | { + /** @enum {string} */ + type: "UnknownMessage"; + } | { + /** @enum {string} */ + type: "CannotEditMessage"; + } | { + /** @enum {string} */ + type: "CannotJoinCall"; + } | { + /** @enum {string} */ + type: "TooManyAttachments"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "TooManyEmbeds"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "TooManyReplies"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "TooManyChannels"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "EmptyMessage"; + } | { + /** @enum {string} */ + type: "PayloadTooLarge"; + } | { + /** @enum {string} */ + type: "CannotRemoveYourself"; + } | { + /** @enum {string} */ + type: "GroupTooLarge"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "AlreadyInGroup"; + } | { + /** @enum {string} */ + type: "NotInGroup"; + } | { + /** @enum {string} */ + type: "AlreadyPinned"; + } | { + /** @enum {string} */ + type: "NotPinned"; + } | { + /** @enum {string} */ + type: "UnknownServer"; + } | { + /** @enum {string} */ + type: "InvalidRole"; + } | { + /** @enum {string} */ + type: "Banned"; + } | { + /** @enum {string} */ + type: "TooManyServers"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "TooManyEmoji"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "TooManyRoles"; + /** Format: uint */ + max: number; + } | { + /** @enum {string} */ + type: "AlreadyInServer"; + } | { + /** @enum {string} */ + type: "ReachedMaximumBots"; + } | { + /** @enum {string} */ + type: "IsBot"; + } | { + /** @enum {string} */ + type: "BotIsPrivate"; + } | { + /** @enum {string} */ + type: "CannotReportYourself"; + } | { + /** @enum {string} */ + type: "MissingPermission"; + permission: string; + } | { + /** @enum {string} */ + type: "MissingUserPermission"; + permission: string; + } | { + /** @enum {string} */ + type: "NotElevated"; + } | { + /** @enum {string} */ + type: "NotPrivileged"; + } | { + /** @enum {string} */ + type: "CannotGiveMissingPermissions"; + } | { + /** @enum {string} */ + type: "NotOwner"; + } | { + /** @enum {string} */ + type: "DatabaseError"; + operation: string; + collection: string; + } | { + /** @enum {string} */ + type: "InternalError"; + } | { + /** @enum {string} */ + type: "InvalidOperation"; + } | { + /** @enum {string} */ + type: "InvalidCredentials"; + } | { + /** @enum {string} */ + type: "InvalidProperty"; + } | { + /** @enum {string} */ + type: "InvalidSession"; + } | { + /** @enum {string} */ + type: "DuplicateNonce"; + } | { + /** @enum {string} */ + type: "NotFound"; + } | { + /** @enum {string} */ + type: "NoEffect"; + } | { + /** @enum {string} */ + type: "FailedValidation"; + error: string; + } | { + /** @enum {string} */ + type: "ProxyError"; + } | { + /** @enum {string} */ + type: "VosoUnavailable"; + }); + /** @description User */ + User: { + /** @description Unique Id */ + _id: string; + /** @description Username */ + username: string; + /** @description Discriminator */ + discriminator: string; + /** @description Display name */ + display_name?: string | null; + /** @description Avatar attachment */ + avatar?: components["schemas"]["File"] | null; + /** @description Relationships with other users */ + relations?: components["schemas"]["Relationship"][]; + /** + * Format: uint32 + * @description Bitfield of user badges + * + * https://docs.rs/revolt-models/latest/revolt_models/v0/enum.UserBadges.html + */ + badges?: number; + /** @description User's current status */ + status?: components["schemas"]["UserStatus"] | null; + /** + * Format: uint32 + * @description Enum of user flags + * + * https://docs.rs/revolt-models/latest/revolt_models/v0/enum.UserFlags.html + */ + flags?: number; + /** @description Whether this user is privileged */ + privileged?: boolean; + /** @description Bot information */ + bot?: components["schemas"]["BotInformation"] | null; + /** @description Current session user's relationship with this user */ + relationship: components["schemas"]["RelationshipStatus"]; + /** @description Whether this user is currently online */ + online: boolean; + }; + /** @description File */ + File: { + /** @description Unique Id */ + _id: string; + /** @description Tag / bucket this file was uploaded to */ + tag: string; + /** @description Original filename */ + filename: string; + /** @description Parsed metadata of this file */ + metadata: components["schemas"]["Metadata"]; + /** @description Raw content type of this file */ + content_type: string; + /** + * Format: int + * @description Size of this file (in bytes) + */ + size: number; + /** @description Whether this file was deleted */ + deleted?: boolean | null; + /** @description Whether this file was reported */ + reported?: boolean | null; + message_id?: string | null; + user_id?: string | null; + server_id?: string | null; + /** @description Id of the object this file is associated with */ + object_id?: string | null; + }; + /** @description Metadata associated with a file */ + Metadata: { + /** @enum {string} */ + type: "File"; + } | { + /** @enum {string} */ + type: "Text"; + } | { + /** @enum {string} */ + type: "Image"; + /** Format: uint */ + width: number; + /** Format: uint */ + height: number; + } | { + /** @enum {string} */ + type: "Video"; + /** Format: uint */ + width: number; + /** Format: uint */ + height: number; + } | { + /** @enum {string} */ + type: "Audio"; + }; + /** @description Relationship entry indicating current status with other user */ + Relationship: { + /** @description Other user's Id */ + _id: string; + /** @description Relationship status with them */ + status: components["schemas"]["RelationshipStatus"]; + }; + /** + * @description User's relationship with another user (or themselves) + * @enum {string} + */ + RelationshipStatus: "None" | "User" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; + /** @description User's active status */ + UserStatus: { + /** @description Custom status text */ + text?: string | null; + /** @description Current presence option */ + presence?: components["schemas"]["Presence"] | null; + }; + /** + * @description Presence status + * @enum {string} + */ + Presence: "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; + /** @description Bot information for if the user is a bot */ + BotInformation: { + /** @description Id of the owner of this bot */ + owner: string; + }; + Id: string; + /** @description User flag reponse */ + FlagResponse: { + /** + * Format: int32 + * @description Flags + */ + flags: number; + }; + /** @description New user information */ + DataEditUser: { + /** @description New display name */ + display_name?: string | null; + /** @description Attachment Id for avatar */ + avatar?: string | null; + /** @description New user status */ + status?: components["schemas"]["UserStatus"] | null; + /** @description New user profile data + * + * This is applied as a partial. */ + profile?: components["schemas"]["DataUserProfile"] | null; + /** + * Format: int32 + * @description Bitfield of user badges + */ + badges?: number | null; + /** + * Format: int32 + * @description Enum of user flags + */ + flags?: number | null; + /** @description Fields to remove from user object */ + remove?: components["schemas"]["FieldsUser"][] | null; + }; + /** @description New user profile data */ + DataUserProfile: { + /** @description Text to set as user profile description */ + content?: string | null; + /** @description Attachment Id for background */ + background?: string | null; + }; + /** + * @description Optional fields on user object + * @enum {string} + */ + FieldsUser: "Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground" | "DisplayName" | "Internal"; + /** Username Information */ + DataChangeUsername: { + /** @description New username */ + username: string; + /** @description Current account password */ + password: string; + }; + /** @description User's profile */ + UserProfile: { + /** @description Text content on user's profile */ + content?: string | null; + /** @description Background visible on user's profile */ + background?: components["schemas"]["File"] | null; + }; + /** @description Channel */ + Channel: { + /** @enum {string} */ + channel_type: "SavedMessages"; + /** @description Unique Id */ + _id: string; + /** @description Id of the user this channel belongs to */ + user: string; + } | { + /** @enum {string} */ + channel_type: "DirectMessage"; + /** @description Unique Id */ + _id: string; + /** @description Whether this direct message channel is currently open on both sides */ + active: boolean; + /** @description 2-tuple of user ids participating in direct message */ + recipients: string[]; + /** @description Id of the last message sent in this channel */ + last_message_id?: string | null; + } | { + /** @enum {string} */ + channel_type: "Group"; + /** @description Unique Id */ + _id: string; + /** @description Display name of the channel */ + name: string; + /** @description User id of the owner of the group */ + owner: string; + /** @description Channel description */ + description?: string | null; + /** @description Array of user ids participating in channel */ + recipients: string[]; + /** @description Custom icon attachment */ + icon?: components["schemas"]["File"] | null; + /** @description Id of the last message sent in this channel */ + last_message_id?: string | null; + /** + * Format: int64 + * @description Permissions assigned to members of this group (does not apply to the owner of the group) + */ + permissions?: number | null; + /** @description Whether this group is marked as not safe for work */ + nsfw?: boolean; + } | { + /** @enum {string} */ + channel_type: "TextChannel"; + /** @description Unique Id */ + _id: string; + /** @description Id of the server this channel belongs to */ + server: string; + /** @description Display name of the channel */ + name: string; + /** @description Channel description */ + description?: string | null; + /** @description Custom icon attachment */ + icon?: components["schemas"]["File"] | null; + /** @description Id of the last message sent in this channel */ + last_message_id?: string | null; + /** @description Default permissions assigned to users in this channel */ + default_permissions?: components["schemas"]["OverrideField"] | null; + /** @description Permissions assigned based on role to this channel */ + role_permissions?: { + [key: string]: components["schemas"]["OverrideField"]; + }; + /** @description Whether this channel is marked as not safe for work */ + nsfw?: boolean; + } | { + /** @enum {string} */ + channel_type: "VoiceChannel"; + /** @description Unique Id */ + _id: string; + /** @description Id of the server this channel belongs to */ + server: string; + /** @description Display name of the channel */ + name: string; + /** @description Channel description */ + description?: string | null; + /** @description Custom icon attachment */ + icon?: components["schemas"]["File"] | null; + /** @description Default permissions assigned to users in this channel */ + default_permissions?: components["schemas"]["OverrideField"] | null; + /** @description Permissions assigned based on role to this channel */ + role_permissions?: { + [key: string]: components["schemas"]["OverrideField"]; + }; + /** @description Whether this channel is marked as not safe for work */ + nsfw?: boolean; + }; + /** @description Representation of a single permission override as it appears on models and in the database */ + OverrideField: { + /** + * Format: int64 + * @description Allow bit flags + */ + a: number; + /** + * Format: int64 + * @description Disallow bit flags + */ + d: number; + }; + /** @description Mutual friends and servers response */ + MutualResponse: { + /** @description Array of mutual user IDs that both users are friends with */ + users: string[]; + /** @description Array of mutual server IDs that both users are in */ + servers: string[]; + }; + /** @description User lookup information */ + DataSendFriendRequest: { + /** @description Username and discriminator combo separated by # */ + username: string; + }; + /** @description Bot with user response */ + BotWithUserResponse: { + user: components["schemas"]["User"]; + /** @description Bot Id */ + _id: string; + /** @description User Id of the bot owner */ + owner: string; + /** @description Token used to authenticate requests for this bot */ + token: string; + /** @description Whether the bot is public (may be invited by anyone) */ + public: boolean; + /** @description Whether to enable analytics */ + analytics?: boolean; + /** @description Whether this bot should be publicly discoverable */ + discoverable?: boolean; + /** @description Reserved; URL for handling interactions */ + interactions_url?: string; + /** @description URL for terms of service */ + terms_of_service_url?: string; + /** @description URL for privacy policy */ + privacy_policy_url?: string; + /** + * Format: uint32 + * @description Enum of bot flags + */ + flags?: number; + }; + /** @description Bot Details */ + DataCreateBot: { + /** @description Bot username */ + name: string; + }; + /** @description Where we are inviting a bot to */ + InviteBotDestination: { + /** @description Server Id */ + server: string; + } | { + /** @description Group Id */ + group: string; + }; + /** @description Public Bot */ + PublicBot: { + /** @description Bot Id */ + _id: string; + /** @description Bot Username */ + username: string; + /** @description Profile Avatar */ + avatar?: string; + /** @description Profile Description */ + description?: string; + }; + /** @description Bot Response */ + FetchBotResponse: { + /** @description Bot object */ + bot: components["schemas"]["Bot"]; + /** @description User object */ + user: components["schemas"]["User"]; + }; + /** @description Bot */ + Bot: { + /** @description Bot Id */ + _id: string; + /** @description User Id of the bot owner */ + owner: string; + /** @description Token used to authenticate requests for this bot */ + token: string; + /** @description Whether the bot is public (may be invited by anyone) */ + public: boolean; + /** @description Whether to enable analytics */ + analytics?: boolean; + /** @description Whether this bot should be publicly discoverable */ + discoverable?: boolean; + /** @description Reserved; URL for handling interactions */ + interactions_url?: string; + /** @description URL for terms of service */ + terms_of_service_url?: string; + /** @description URL for privacy policy */ + privacy_policy_url?: string; + /** + * Format: uint32 + * @description Enum of bot flags + */ + flags?: number; + }; + /** @description Owned Bots Response + * + * Both lists are sorted by their IDs. + * + * TODO: user should be in bot object */ + OwnedBotsResponse: { + /** @description Bot objects */ + bots: components["schemas"]["Bot"][]; + /** @description User objects */ + users: components["schemas"]["User"][]; + }; + /** @description New Bot Details */ + DataEditBot: { + /** @description Bot username */ + name?: string | null; + /** @description Whether the bot can be added by anyone */ + public?: boolean | null; + /** @description Whether analytics should be gathered for this bot + * + * Must be enabled in order to show up on [Revolt Discover](https://rvlt.gg). */ + analytics?: boolean | null; + /** @description Interactions URL */ + interactions_url?: string | null; + /** @description Fields to remove from bot object */ + remove?: components["schemas"]["FieldsBot"][] | null; + }; + /** + * @description Optional fields on bot object + * @enum {string} + */ + FieldsBot: "Token" | "InteractionsURL"; + /** @description New webhook information */ + DataEditChannel: { + /** @description Channel name */ + name?: string | null; + /** @description Channel description */ + description?: string | null; + /** @description Group owner */ + owner?: string | null; + /** @description Icon + * + * Provide an Autumn attachment Id. */ + icon?: string | null; + /** @description Whether this channel is age-restricted */ + nsfw?: boolean | null; + /** @description Whether this channel is archived */ + archived?: boolean | null; + /** + * @description Fields to remove from channel + * @default null + */ + remove: components["schemas"]["FieldsChannel"][] | null; + }; + /** + * @description Optional fields on channel object + * @enum {string} + */ + FieldsChannel: "Description" | "Icon" | "DefaultPermissions"; + /** @description Invite */ + Invite: { + /** @enum {string} */ + type: "Server"; + /** @description Invite code */ + _id: string; + /** @description Id of the server this invite points to */ + server: string; + /** @description Id of user who created this invite */ + creator: string; + /** @description Id of the server channel this invite points to */ + channel: string; + } | { + /** @enum {string} */ + type: "Group"; + /** @description Invite code */ + _id: string; + /** @description Id of user who created this invite */ + creator: string; + /** @description Id of the group channel this invite points to */ + channel: string; + }; + /** @description Message */ + Message: { + /** @description Unique Id */ + _id: string; + /** @description Unique value generated by client sending this message */ + nonce?: string | null; + /** @description Id of the channel this message was sent in */ + channel: string; + /** @description Id of the user or webhook that sent this message */ + author: string; + /** @description The user that sent this message */ + user?: components["schemas"]["User"] | null; + /** @description The member that sent this message */ + member?: components["schemas"]["Member"] | null; + /** @description The webhook that sent this message */ + webhook?: components["schemas"]["MessageWebhook"] | null; + /** @description Message content */ + content?: string | null; + /** @description System message */ + system?: components["schemas"]["SystemMessage"] | null; + /** @description Array of attachments */ + attachments?: components["schemas"]["File"][] | null; + /** @description Time at which this message was last edited */ + edited?: components["schemas"]["ISO8601 Timestamp"] | null; + /** @description Attached embeds to this message */ + embeds?: components["schemas"]["Embed"][] | null; + /** @description Array of user ids mentioned in this message */ + mentions?: string[] | null; + /** @description Array of message ids this message is replying to */ + replies?: string[] | null; + /** @description Hashmap of emoji IDs to array of user IDs */ + reactions?: { + [key: string]: string[]; + }; + /** @description Information about how this message should be interacted with */ + interactions?: components["schemas"]["Interactions"]; + /** @description Name and / or avatar overrides for this message */ + masquerade?: components["schemas"]["Masquerade"] | null; + /** @description Whether or not the message in pinned */ + pinned?: boolean | null; + /** + * Format: uint32 + * @description Bitfield of message flags + * + * https://docs.rs/revolt-models/latest/revolt_models/v0/enum.MessageFlags.html + */ + flags?: number; + }; + /** @description Server Member */ + Member: { + /** @description Unique member id */ + _id: components["schemas"]["MemberCompositeKey"]; + /** @description Time at which this user joined the server */ + joined_at: components["schemas"]["ISO8601 Timestamp"]; + /** @description Member's nickname */ + nickname?: string | null; + /** @description Avatar attachment */ + avatar?: components["schemas"]["File"] | null; + /** @description Member's roles */ + roles?: string[]; + /** @description Timestamp this member is timed out until */ + timeout?: components["schemas"]["ISO8601 Timestamp"] | null; + }; + /** @description Composite primary key consisting of server and user id */ + MemberCompositeKey: { + /** @description Server Id */ + server: string; + /** @description User Id */ + user: string; + }; + /** + * Format: date-time + * @description ISO8601 formatted timestamp + * @example 1970-01-01T00:00:00Z + */ + "ISO8601 Timestamp": string; + /** @description Information about the webhook bundled with Message */ + MessageWebhook: { + name: string; + avatar?: string | null; + }; + /** @description System Event */ + SystemMessage: { + /** @enum {string} */ + type: "text"; + content: string; + } | { + /** @enum {string} */ + type: "user_added"; + id: string; + by: string; + } | { + /** @enum {string} */ + type: "user_remove"; + id: string; + by: string; + } | { + /** @enum {string} */ + type: "user_joined"; + id: string; + } | { + /** @enum {string} */ + type: "user_left"; + id: string; + } | { + /** @enum {string} */ + type: "user_kicked"; + id: string; + } | { + /** @enum {string} */ + type: "user_banned"; + id: string; + } | { + /** @enum {string} */ + type: "channel_renamed"; + name: string; + by: string; + } | { + /** @enum {string} */ + type: "channel_description_changed"; + by: string; + } | { + /** @enum {string} */ + type: "channel_icon_changed"; + by: string; + } | { + /** @enum {string} */ + type: "channel_ownership_changed"; + from: string; + to: string; + } | { + /** @enum {string} */ + type: "message_pinned"; + id: string; + by: string; + } | { + /** @enum {string} */ + type: "message_unpinned"; + id: string; + by: string; + }; + /** @description Embed */ + Embed: { + /** @enum {string} */ + type: "Website"; + /** @description Direct URL to web page */ + url?: string | null; + /** @description Original direct URL */ + original_url?: string | null; + /** @description Remote content */ + special?: components["schemas"]["Special"] | null; + /** @description Title of website */ + title?: string | null; + /** @description Description of website */ + description?: string | null; + /** @description Embedded image */ + image?: components["schemas"]["Image"] | null; + /** @description Embedded video */ + video?: components["schemas"]["Video"] | null; + /** @description Site name */ + site_name?: string | null; + /** @description URL to site icon */ + icon_url?: string | null; + /** @description CSS Colour */ + colour?: string | null; + } | { + /** @enum {string} */ + type: "Image"; + /** @description URL to the original image */ + url: string; + /** + * Format: int + * @description Width of the image + */ + width: number; + /** + * Format: int + * @description Height of the image + */ + height: number; + /** @description Positioning and size */ + size: components["schemas"]["ImageSize"]; + } | { + /** @enum {string} */ + type: "Video"; + /** @description URL to the original video */ + url: string; + /** + * Format: int + * @description Width of the video + */ + width: number; + /** + * Format: int + * @description Height of the video + */ + height: number; + } | { + /** @enum {string} */ + type: "Text"; + /** @description URL to icon */ + icon_url?: string | null; + /** @description URL for title */ + url?: string | null; + /** @description Title of text embed */ + title?: string | null; + /** @description Description of text embed */ + description?: string | null; + /** @description ID of uploaded autumn file */ + media?: components["schemas"]["File"] | null; + /** @description CSS Colour */ + colour?: string | null; + } | { + /** @enum {string} */ + type: "None"; + }; + /** @description Information about special remote content */ + Special: { + /** @enum {string} */ + type: "None"; + } | { + /** @enum {string} */ + type: "GIF"; + } | { + /** @enum {string} */ + type: "YouTube"; + id: string; + timestamp?: string | null; + } | { + /** @enum {string} */ + type: "Lightspeed"; + content_type: components["schemas"]["LightspeedType"]; + id: string; + } | { + /** @enum {string} */ + type: "Twitch"; + content_type: components["schemas"]["TwitchType"]; + id: string; + } | { + /** @enum {string} */ + type: "Spotify"; + content_type: string; + id: string; + } | { + /** @enum {string} */ + type: "Soundcloud"; + } | { + /** @enum {string} */ + type: "Bandcamp"; + content_type: components["schemas"]["BandcampType"]; + id: string; + } | { + /** @enum {string} */ + type: "AppleMusic"; + album_id: string; + track_id?: string | null; + } | { + /** @enum {string} */ + type: "Streamable"; + id: string; + }; + /** + * @description Type of remote Lightspeed.tv content + * @enum {string} + */ + LightspeedType: "Channel"; + /** + * @description Type of remote Twitch content + * @enum {string} + */ + TwitchType: "Channel" | "Video" | "Clip"; + /** + * @description Type of remote Bandcamp content + * @enum {string} + */ + BandcampType: "Album" | "Track"; + /** @description Image */ + Image: { + /** @description URL to the original image */ + url: string; + /** + * Format: int + * @description Width of the image + */ + width: number; + /** + * Format: int + * @description Height of the image + */ + height: number; + /** @description Positioning and size */ + size: components["schemas"]["ImageSize"]; + }; + /** + * @description Image positioning and size + * @enum {string} + */ + ImageSize: "Large" | "Preview"; + /** @description Video */ + Video: { + /** @description URL to the original video */ + url: string; + /** + * Format: int + * @description Width of the video + */ + width: number; + /** + * Format: int + * @description Height of the video + */ + height: number; + }; + /** @description Information to guide interactions on this message */ + Interactions: { + /** @description Reactions which should always appear and be distinct */ + reactions?: string[] | null; + /** @description Whether reactions should be restricted to the given list + * + * Can only be set to true if reactions list is of at least length 1 */ + restrict_reactions?: boolean; + }; + /** @description Name and / or avatar override information */ + Masquerade: { + /** @description Replace the display name shown on this message */ + name?: string | null; + /** @description Replace the avatar shown on this message (URL to image file) */ + avatar?: string | null; + /** @description Replace the display role colour shown on this message + * + * Must have `ManageRole` permission to use */ + colour?: string | null; + }; + /** @description Message to send */ + DataMessageSend: { + /** @description Unique token to prevent duplicate message sending + * + * **This is deprecated and replaced by `Idempotency-Key`!** */ + nonce?: string | null; + /** @description Message content to send */ + content?: string | null; + /** @description Attachments to include in message */ + attachments?: string[] | null; + /** @description Messages to reply to */ + replies?: components["schemas"]["ReplyIntent"][] | null; + /** @description Embeds to include in message + * + * Text embed content contributes to the content length cap */ + embeds?: components["schemas"]["SendableEmbed"][] | null; + /** @description Masquerade to apply to this message */ + masquerade?: components["schemas"]["Masquerade"] | null; + /** @description Information about how this message should be interacted with */ + interactions?: components["schemas"]["Interactions"] | null; + /** + * Format: uint32 + * @description Bitfield of message flags + * + * https://docs.rs/revolt-models/latest/revolt_models/v0/enum.MessageFlags.html + */ + flags?: number | null; + }; + /** @description What this message should reply to and how */ + ReplyIntent: { + /** @description Message Id */ + id: string; + /** @description Whether this reply should mention the message's author */ + mention: boolean; + }; + /** @description Representation of a text embed before it is sent. */ + SendableEmbed: { + icon_url?: string | null; + url?: string | null; + title?: string | null; + description?: string | null; + media?: string | null; + colour?: string | null; + }; + /** @description Bulk Message Response */ + BulkMessageResponse: components["schemas"]["Message"][] | { + /** @description List of messages */ + messages: components["schemas"]["Message"][]; + /** @description List of users */ + users: components["schemas"]["User"][]; + /** @description List of members */ + members?: components["schemas"]["Member"][] | null; + }; + /** + * @description Message Sort + * + * Sort used for retrieving messages + * @enum {string} + */ + MessageSort: "Relevance" | "Latest" | "Oldest"; + /** @description Options for searching for messages */ + DataMessageSearch: { + /** @description Full-text search query + * + * See [MongoDB documentation](https://docs.mongodb.com/manual/text-search/#-text-operator) for more information. */ + query?: string | null; + /** @description Whether to only search for pinned messages, cannot be sent with `query`. */ + pinned?: boolean | null; + /** + * Format: int64 + * @description Maximum number of messages to fetch + */ + limit?: number | null; + /** @description Message id before which messages should be fetched */ + before?: string | null; + /** @description Message id after which messages should be fetched */ + after?: string | null; + /** + * @description Message sort direction + * + * By default, it will be sorted by latest. + * @default Relevance + */ + sort: components["schemas"]["MessageSort"]; + /** @description Whether to include user (and member, if server channel) objects */ + include_users?: boolean | null; + }; + /** @description Changes to make to message */ + DataEditMessage: { + /** @description New message content */ + content?: string | null; + /** @description Embeds to include in the message */ + embeds?: components["schemas"]["SendableEmbed"][] | null; + }; + /** @description Options for bulk deleting messages */ + OptionsBulkDelete: { + /** @description Message IDs */ + ids: string[]; + }; + /** @description Create new group */ + DataCreateGroup: { + /** @description Group name */ + name: string; + /** @description Group description */ + description?: string | null; + /** @description Group icon */ + icon?: string | null; + /** + * @description Array of user IDs to add to the group + * + * Must be friends with these users. + * @default [] + */ + users: string[]; + /** @description Whether this group is age-restricted */ + nsfw?: boolean | null; + }; + /** @description Voice server token response */ + LegacyCreateVoiceUserResponse: { + /** @description Token for authenticating with the voice server */ + token: string; + }; + /** @description New role permissions */ + DataSetRolePermissions: { + /** @description Allow / deny values to set for this role */ + permissions: components["schemas"]["Override"]; + }; + /** @description Representation of a single permission override */ + Override: { + /** + * Format: uint64 + * @description Allow bit flags + */ + allow: number; + /** + * Format: uint64 + * @description Disallow bit flags + */ + deny: number; + }; + /** @description New default permissions */ + DataDefaultChannelPermissions: { + /** + * Format: uint64 + * @description Permission values to set for members in a `Group` + */ + permissions: number; + } | { + /** @description Allow / deny values to set for members in this `TextChannel` or `VoiceChannel` */ + permissions: components["schemas"]["Override"]; + }; + /** @description Webhook */ + Webhook: { + /** @description Webhook Id */ + id: string; + /** @description The name of the webhook */ + name: string; + /** @description The avatar of the webhook */ + avatar?: components["schemas"]["File"] | null; + /** @description The channel this webhook belongs to */ + channel_id: string; + /** + * Format: uint64 + * @description The permissions for the webhook + */ + permissions: number; + /** @description The private token for the webhook */ + token?: string | null; + }; + /** @description Information for the webhook */ + CreateWebhookBody: { + name: string; + avatar?: string | null; + }; + /** @description Information returned when creating server */ + CreateServerLegacyResponse: { + /** @description Server object */ + server: components["schemas"]["Server"]; + /** @description Default channels */ + channels: components["schemas"]["Channel"][]; + }; + /** @description Server */ + Server: { + /** @description Unique Id */ + _id: string; + /** @description User id of the owner */ + owner: string; + /** @description Name of the server */ + name: string; + /** @description Description for the server */ + description?: string | null; + /** @description Channels within this server */ + channels: string[]; + /** @description Categories for this server */ + categories?: components["schemas"]["Category"][] | null; + /** @description Configuration for sending system event messages */ + system_messages?: components["schemas"]["SystemMessageChannels"] | null; + /** @description Roles for this server */ + roles?: { + [key: string]: components["schemas"]["Role"]; + }; + /** + * Format: int64 + * @description Default set of server and channel permissions + */ + default_permissions: number; + /** @description Icon attachment */ + icon?: components["schemas"]["File"] | null; + /** @description Banner attachment */ + banner?: components["schemas"]["File"] | null; + /** + * Format: uint32 + * @description Bitfield of server flags + */ + flags?: number; + /** @description Whether this server is flagged as not safe for work */ + nsfw?: boolean; + /** @description Whether to enable analytics */ + analytics?: boolean; + /** @description Whether this server should be publicly discoverable */ + discoverable?: boolean; + }; + /** @description Channel category */ + Category: { + /** @description Unique ID for this category */ + id: string; + /** @description Title for this category */ + title: string; + /** @description Channels in this category */ + channels: string[]; + }; + /** @description System message channel assignments */ + SystemMessageChannels: { + /** @description ID of channel to send user join messages in */ + user_joined?: string | null; + /** @description ID of channel to send user left messages in */ + user_left?: string | null; + /** @description ID of channel to send user kicked messages in */ + user_kicked?: string | null; + /** @description ID of channel to send user banned messages in */ + user_banned?: string | null; + }; + /** @description Role */ + Role: { + /** @description Role name */ + name: string; + /** @description Permissions available to this role */ + permissions: components["schemas"]["OverrideField"]; + /** @description Colour used for this role + * + * This can be any valid CSS colour */ + colour?: string | null; + /** @description Whether this role should be shown separately on the member sidebar */ + hoist?: boolean; + /** + * Format: int64 + * @description Ranking of this role + * @default 0 + */ + rank: number; + }; + /** @description Information about new server to create */ + DataCreateServer: { + /** @description Server name */ + name: string; + /** @description Server description */ + description?: string | null; + /** @description Whether this server is age-restricted */ + nsfw?: boolean | null; + }; + /** @description Fetch server information */ + FetchServerResponse: components["schemas"]["Server"] | { + /** @description Channels within this server */ + channels: string[]; + /** @description Unique Id */ + _id: string; + /** @description User id of the owner */ + owner: string; + /** @description Name of the server */ + name: string; + /** @description Description for the server */ + description?: string | null; + /** @description Categories for this server */ + categories?: components["schemas"]["Category"][] | null; + /** @description Configuration for sending system event messages */ + system_messages?: components["schemas"]["SystemMessageChannels"] | null; + /** @description Roles for this server */ + roles?: { + [key: string]: components["schemas"]["Role"]; + }; + /** + * Format: int64 + * @description Default set of server and channel permissions + */ + default_permissions: number; + /** @description Icon attachment */ + icon?: components["schemas"]["File"] | null; + /** @description Banner attachment */ + banner?: components["schemas"]["File"] | null; + /** + * Format: uint32 + * @description Bitfield of server flags + */ + flags?: number; + /** @description Whether this server is flagged as not safe for work */ + nsfw?: boolean; + /** @description Whether to enable analytics */ + analytics?: boolean; + /** @description Whether this server should be publicly discoverable */ + discoverable?: boolean; + }; + /** @description New server information */ + DataEditServer: { + /** @description Server name */ + name?: string | null; + /** @description Server description */ + description?: string | null; + /** @description Attachment Id for icon */ + icon?: string | null; + /** @description Attachment Id for banner */ + banner?: string | null; + /** @description Category structure for server */ + categories?: components["schemas"]["Category"][] | null; + /** @description System message configuration */ + system_messages?: components["schemas"]["SystemMessageChannels"] | null; + /** + * Format: int32 + * @description Bitfield of server flags + */ + flags?: number | null; + /** @description Whether this server is public and should show up on [Revolt Discover](https://rvlt.gg) */ + discoverable?: boolean | null; + /** @description Whether analytics should be collected for this server + * + * Must be enabled in order to show up on [Revolt Discover](https://rvlt.gg). */ + analytics?: boolean | null; + /** @description Fields to remove from server object */ + remove?: components["schemas"]["FieldsServer"][] | null; + }; + /** + * @description Optional fields on server object + * @enum {string} + */ + FieldsServer: "Description" | "Categories" | "SystemMessages" | "Icon" | "Banner"; + /** @description Create new server channel */ + DataCreateServerChannel: { + /** + * @description Channel type + * @default Text + */ + type: components["schemas"]["LegacyServerChannelType"]; + /** @description Channel name */ + name: string; + /** @description Channel description */ + description?: string | null; + /** @description Whether this channel is age restricted */ + nsfw?: boolean | null; + }; + /** + * @description Server Channel Type + * @enum {string} + */ + LegacyServerChannelType: "Text" | "Voice"; + /** @description Response with all members */ + AllMemberResponse: { + /** @description List of members */ + members: components["schemas"]["Member"][]; + /** @description List of users */ + users: components["schemas"]["User"][]; + }; + /** @description Member response */ + MemberResponse: components["schemas"]["Member"] | { + member: components["schemas"]["Member"]; + roles: { + [key: string]: components["schemas"]["Role"]; + }; + }; + /** @description New member information */ + DataMemberEdit: { + /** @description Member nickname */ + nickname?: string | null; + /** @description Attachment Id to set for avatar */ + avatar?: string | null; + /** @description Array of role ids */ + roles?: string[] | null; + /** @description Timestamp this member is timed out until */ + timeout?: components["schemas"]["ISO8601 Timestamp"] | null; + /** @description Fields to remove from channel object */ + remove?: components["schemas"]["FieldsMember"][] | null; + }; + /** + * @description Optional fields on server member object + * @enum {string} + */ + FieldsMember: "Nickname" | "Avatar" | "Roles" | "Timeout"; + /** Query members by name */ + MemberQueryResponse: { + /** @description List of members */ + members: components["schemas"]["Member"][]; + /** @description List of users */ + users: components["schemas"]["User"][]; + }; + /** @description Server Ban */ + ServerBan: { + /** @description Unique member id */ + _id: components["schemas"]["MemberCompositeKey"]; + /** @description Reason for ban creation */ + reason?: string | null; + }; + /** @description Information for new server ban */ + DataBanCreate: { + /** @description Ban reason */ + reason?: string | null; + }; + /** @description Ban list result */ + BanListResult: { + /** @description Users objects */ + users: components["schemas"]["BannedUser"][]; + /** @description Ban objects */ + bans: components["schemas"]["ServerBan"][]; + }; + /** @description Just enough information to list a ban */ + BannedUser: { + /** @description Id of the banned user */ + _id: string; + /** @description Username of the banned user */ + username: string; + /** @description Discriminator of the banned user */ + discriminator: string; + /** @description Avatar of the banned user */ + avatar?: components["schemas"]["File"] | null; + }; + /** @description Response after creating new role */ + NewRoleResponse: { + /** @description Id of the role */ + id: string; + /** @description New role */ + role: components["schemas"]["Role"]; + }; + /** @description Information about new role to create */ + DataCreateRole: { + /** @description Role name */ + name: string; + /** + * Format: int64 + * @description Ranking position + * + * Smaller values take priority. + */ + rank?: number | null; + }; + /** @description New role information */ + DataEditRole: { + /** @description Role name */ + name?: string | null; + /** @description Role colour */ + colour?: string | null; + /** @description Whether this role should be displayed separately */ + hoist?: boolean | null; + /** + * Format: int64 + * @description Ranking position + * + * Smaller values take priority. + */ + rank?: number | null; + /** @description Fields to remove from role object */ + remove?: components["schemas"]["FieldsRole"][] | null; + }; + /** + * @description Optional fields on server object + * @enum {string} + */ + FieldsRole: "Colour"; + /** @description New role permissions */ + DataSetServerRolePermission: { + /** @description Allow / deny values for the role in this server. */ + permissions: components["schemas"]["Override"]; + }; + /** @description Data permissions Value - contains allow */ + DataPermissionsValue: { + /** Format: uint64 */ + permissions: number; + }; + /** @description Emoji */ + Emoji: { + /** @description Unique Id */ + _id: string; + /** @description What owns this emoji */ + parent: components["schemas"]["EmojiParent"]; + /** @description Uploader user id */ + creator_id: string; + /** @description Emoji name */ + name: string; + /** @description Whether the emoji is animated */ + animated?: boolean; + /** @description Whether the emoji is marked as nsfw */ + nsfw?: boolean; + }; + /** @description Parent Id of the emoji */ + EmojiParent: { + /** @enum {string} */ + type: "Server"; + id: string; + } | { + /** @enum {string} */ + type: "Detached"; + }; + /** @description Public invite response */ + InviteResponse: { + /** @enum {string} */ + type: "Server"; + /** @description Invite code */ + code: string; + /** @description Id of the server */ + server_id: string; + /** @description Name of the server */ + server_name: string; + /** @description Attachment for server icon */ + server_icon?: components["schemas"]["File"] | null; + /** @description Attachment for server banner */ + server_banner?: components["schemas"]["File"] | null; + /** + * Format: int32 + * @description Enum of server flags + */ + server_flags?: number | null; + /** @description Id of server channel */ + channel_id: string; + /** @description Name of server channel */ + channel_name: string; + /** @description Description of server channel */ + channel_description?: string | null; + /** @description Name of user who created the invite */ + user_name: string; + /** @description Avatar of the user who created the invite */ + user_avatar?: components["schemas"]["File"] | null; + /** + * Format: int64 + * @description Number of members in this server + */ + member_count: number; + } | { + /** @enum {string} */ + type: "Group"; + /** @description Invite code */ + code: string; + /** @description Id of group channel */ + channel_id: string; + /** @description Name of group channel */ + channel_name: string; + /** @description Description of group channel */ + channel_description?: string | null; + /** @description Name of user who created the invite */ + user_name: string; + /** @description Avatar of the user who created the invite */ + user_avatar?: components["schemas"]["File"] | null; + }; + /** @description Invite join response */ + InviteJoinResponse: { + /** @enum {string} */ + type: "Server"; + /** @description Channels in the server */ + channels: components["schemas"]["Channel"][]; + /** @description Server we are joining */ + server: components["schemas"]["Server"]; + } | { + /** @enum {string} */ + type: "Group"; + /** @description Group channel we are joining */ + channel: components["schemas"]["Channel"]; + /** @description Members of this group */ + users: components["schemas"]["User"][]; + }; + /** @description Create a new emoji */ + DataCreateEmoji: { + /** @description Server name */ + name: string; + /** @description Parent information */ + parent: components["schemas"]["EmojiParent"]; + /** + * @description Whether the emoji is mature + * @default false + */ + nsfw: boolean; + }; + /** Report Data */ + DataReportContent: { + /** @description Content being reported */ + content: components["schemas"]["ReportedContent"]; + /** + * @description Additional report description + * @default + */ + additional_context: string; + }; + /** @description The content being reported */ + ReportedContent: { + /** @enum {string} */ + type: "Message"; + /** @description ID of the message */ + id: string; + /** @description Reason for reporting message */ + report_reason: components["schemas"]["ContentReportReason"]; + } | { + /** @enum {string} */ + type: "Server"; + /** @description ID of the server */ + id: string; + /** @description Reason for reporting server */ + report_reason: components["schemas"]["ContentReportReason"]; + } | { + /** @enum {string} */ + type: "User"; + /** @description ID of the user */ + id: string; + /** @description Reason for reporting a user */ + report_reason: components["schemas"]["UserReportReason"]; + /** @description Message context */ + message_id?: string | null; + }; + /** + * @description Reason for reporting content (message or server) + * @enum {string} + */ + ContentReportReason: "NoneSpecified" | "Illegal" | "IllegalGoods" | "IllegalExtortion" | "IllegalPornography" | "IllegalHacking" | "ExtremeViolence" | "PromotesHarm" | "UnsolicitedSpam" | "Raid" | "SpamAbuse" | "ScamsFraud" | "Malware" | "Harassment"; + /** + * @description Reason for reporting a user + * @enum {string} + */ + UserReportReason: "NoneSpecified" | "UnsolicitedSpam" | "SpamAbuse" | "InappropriateProfile" | "Impersonation" | "BanEvasion" | "Underage"; + /** Error */ + "Authifier Error": { + /** @enum {string} */ + type: "IncorrectData"; + with: string; + } | { + /** @enum {string} */ + type: "DatabaseError"; + operation: string; + with: string; + } | { + /** @enum {string} */ + type: "InternalError"; + } | { + /** @enum {string} */ + type: "OperationFailed"; + } | { + /** @enum {string} */ + type: "RenderFail"; + } | { + /** @enum {string} */ + type: "MissingHeaders"; + } | { + /** @enum {string} */ + type: "CaptchaFailed"; + } | { + /** @enum {string} */ + type: "BlockedByShield"; + } | { + /** @enum {string} */ + type: "InvalidSession"; + } | { + /** @enum {string} */ + type: "UnverifiedAccount"; + } | { + /** @enum {string} */ + type: "UnknownUser"; + } | { + /** @enum {string} */ + type: "EmailFailed"; + } | { + /** @enum {string} */ + type: "InvalidToken"; + } | { + /** @enum {string} */ + type: "MissingInvite"; + } | { + /** @enum {string} */ + type: "InvalidInvite"; + } | { + /** @enum {string} */ + type: "InvalidCredentials"; + } | { + /** @enum {string} */ + type: "CompromisedPassword"; + } | { + /** @enum {string} */ + type: "ShortPassword"; + } | { + /** @enum {string} */ + type: "Blacklisted"; + } | { + /** @enum {string} */ + type: "LockedOut"; + } | { + /** @enum {string} */ + type: "TotpAlreadyEnabled"; + } | { + /** @enum {string} */ + type: "DisallowedMFAMethod"; + }; + /** Account Data */ + DataCreateAccount: { + /** @description Valid email address */ + email: string; + /** @description Password */ + password: string; + /** @description Invite code */ + invite?: string | null; + /** @description Captcha verification code */ + captcha?: string | null; + }; + /** Resend Information */ + DataResendVerification: { + /** @description Email associated with the account */ + email: string; + /** @description Captcha verification code */ + captcha?: string | null; + }; + /** Account Deletion Token */ + DataAccountDeletion: { + /** @description Deletion token */ + token: string; + }; + AccountInfo: { + _id: string; + email: string; + }; + /** Change Data */ + DataChangePassword: { + /** @description New password */ + password: string; + /** @description Current password */ + current_password: string; + }; + /** Change Data */ + DataChangeEmail: { + /** @description Valid email address */ + email: string; + /** @description Current password */ + current_password: string; + }; + ResponseVerify: null | { + /** @description Authorised MFA ticket, can be used to log in */ + ticket: components["schemas"]["MFATicket"]; + }; + /** @description Multi-factor auth ticket */ + MFATicket: { + /** @description Unique Id */ + _id: string; + /** @description Account Id */ + account_id: string; + /** @description Unique Token */ + token: string; + /** @description Whether this ticket has been validated (can be used for account actions) */ + validated: boolean; + /** @description Whether this ticket is authorised (can be used to log a user in) */ + authorised: boolean; + /** @description TOTP code at time of ticket creation */ + last_totp_code?: string | null; + }; + /** Password Reset */ + DataPasswordReset: { + /** @description Reset token */ + token: string; + /** @description New password */ + password: string; + /** + * @description Whether to logout all sessions + * @default false + */ + remove_sessions: boolean; + }; + /** Reset Information */ + DataSendPasswordReset: { + /** @description Email associated with the account */ + email: string; + /** @description Captcha verification code */ + captcha?: string | null; + }; + ResponseLogin: { + /** @enum {string} */ + result: "Success"; + /** @description Unique Id */ + _id: string; + /** @description User Id */ + user_id: string; + /** @description Session token */ + token: string; + /** @description Display name */ + name: string; + /** @description Web Push subscription */ + subscription?: components["schemas"]["WebPushSubscription"] | null; + } | { + /** @enum {string} */ + result: "MFA"; + ticket: string; + allowed_methods: components["schemas"]["MFAMethod"][]; + } | { + /** @enum {string} */ + result: "Disabled"; + user_id: string; + }; + /** @description Web Push subscription */ + WebPushSubscription: { + endpoint: string; + p256dh: string; + auth: string; + }; + /** + * @description MFA method + * @enum {string} + */ + MFAMethod: "Password" | "Recovery" | "Totp"; + /** Login Data */ + DataLogin: { + /** @description Email */ + email: string; + /** @description Password */ + password: string; + /** @description Friendly name used for the session */ + friendly_name?: string | null; + } | { + /** @description Unvalidated or authorised MFA ticket + * + * Used to resolve the correct account */ + mfa_ticket: string; + /** @description Valid MFA response + * + * This will take precedence over the `password` field where applicable */ + mfa_response?: components["schemas"]["MFAResponse"] | null; + /** @description Friendly name used for the session */ + friendly_name?: string | null; + }; + /** @description MFA response */ + MFAResponse: { + password: string; + } | { + recovery_code: string; + } | { + totp_code: string; + }; + SessionInfo: { + _id: string; + name: string; + }; + /** Edit Data */ + DataEditSession: { + /** @description Session friendly name */ + friendly_name: string; + }; + MultiFactorStatus: { + email_otp: boolean; + trusted_handover: boolean; + email_mfa: boolean; + totp_mfa: boolean; + security_key_mfa: boolean; + recovery_active: boolean; + }; + /** Totp Secret */ + ResponseTotpSecret: { + secret: string; + }; + /** Onboarding Status */ + DataHello: { + /** @description Whether onboarding is required */ + onboarding: boolean; + }; + /** New User Data */ + DataOnboard: { + /** @description New username which will be used to identify the user on the platform */ + username: string; + }; + /** @description Options for fetching settings */ + OptionsFetchSettings: { + /** @description Keys to fetch */ + keys: string[]; + }; + /** @description Channel Unread */ + ChannelUnread: { + /** @description Composite key pointing to a user's view of a channel */ + _id: components["schemas"]["ChannelCompositeKey"]; + /** @description Id of the last message read in this channel by a user */ + last_id?: string | null; + /** @description Array of message ids that mention the user */ + mentions?: string[]; + }; + /** @description Composite primary key consisting of channel and user id */ + ChannelCompositeKey: { + /** @description Channel Id */ + channel: string; + /** @description User Id */ + user: string; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + root_root: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["RevoltConfig"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_self_fetch: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_user_fetch: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + edit_user_edit: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataEditUser"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_user_flags_fetch_user_flags: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["FlagResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + change_username_change_username: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataChangeUsername"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + get_default_avatar_default_avatar: { + parameters: { + query?: never; + header?: never; + path: { + target: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Default Avatar Picture */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "image/png": string; + }; + }; + }; + }; + fetch_profile_profile: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["UserProfile"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_dms_direct_messages: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Channel"][]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + open_dm_open_dm: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Channel"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + find_mutual_mutual: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MutualResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + add_friend_add: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + remove_friend_remove: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + block_user_block: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + unblock_user_unblock: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + send_friend_request_send_friend_request: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataSendFriendRequest"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + create_create_bot: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataCreateBot"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["BotWithUserResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_public_fetch_public_bot: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PublicBot"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + invite_invite_bot: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["InviteBotDestination"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_fetch_bot: { + parameters: { + query?: never; + header?: never; + path: { + bot: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["FetchBotResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_owned_fetch_owned_bots: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["OwnedBotsResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + delete_delete_bot: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + edit_edit_bot: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataEditBot"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["BotWithUserResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + channel_ack_ack: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + message: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + channel_fetch_fetch: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Channel"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + channel_delete_delete: { + parameters: { + query?: { + /** @description Whether to not send a leave message */ + leave_silently?: boolean | null; + }; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + channel_edit_edit: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataEditChannel"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Channel"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + members_fetch_fetch_members: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"][]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + invite_create_create_invite: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Invite"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_query_query: { + parameters: { + query?: { + /** @description Maximum number of messages to fetch + * + * For fetching nearby messages, this is \`(limit + 1)\`. */ + limit?: number | null; + /** @description Message id before which messages should be fetched */ + before?: string | null; + /** @description Message id after which messages should be fetched */ + after?: string | null; + /** @description Message sort direction */ + sort?: components["schemas"]["MessageSort"]; + /** @description Message id to search around + * + * Specifying '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. */ + nearby?: string | null; + /** @description Whether to include user (and member, if server channel) objects */ + include_users?: boolean | null; + }; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["BulkMessageResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_send_message_send: { + parameters: { + query?: never; + header?: { + /** @description Unique key to prevent duplicate requests */ + "Idempotency-Key"?: string; + }; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataMessageSend"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Message"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_search_search: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataMessageSearch"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["BulkMessageResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_pin_message_pin: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + msg: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_unpin_message_unpin: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + msg: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_fetch_fetch: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + msg: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Message"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_delete_delete: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + msg: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_edit_edit: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + msg: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataEditMessage"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Message"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_bulk_delete_bulk_delete_messages: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["OptionsBulkDelete"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + group_create_create_group: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataCreateGroup"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Channel"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + group_add_member_add_member: { + parameters: { + query?: never; + header?: never; + path: { + group_id: components["schemas"]["Id"]; + member_id: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + group_remove_member_remove_member: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + member: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + voice_join_call: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["LegacyCreateVoiceUserResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + permissions_set_set_role_permissions: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + role_id: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataSetRolePermissions"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Channel"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + permissions_set_default_set_default_permissions2: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataDefaultChannelPermissions"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Channel"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_react_react_message: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + msg: components["schemas"]["Id"]; + emoji: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_unreact_unreact_message: { + parameters: { + query?: { + /** @description Remove a specific user's reaction */ + user_id?: string | null; + /** @description Remove all reactions */ + remove_all?: boolean | null; + }; + header?: never; + path: { + target: components["schemas"]["Id"]; + msg: components["schemas"]["Id"]; + emoji: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + message_clear_reactions_clear_reactions: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + msg: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + webhook_create_create_webhook: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["CreateWebhookBody"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Webhook"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + webhook_fetch_all_fetch_webhooks: { + parameters: { + query?: never; + header?: never; + path: { + channel_id: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Webhook"][]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + server_create_create_server: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataCreateServer"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["CreateServerLegacyResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + server_fetch_fetch: { + parameters: { + query?: { + /** @description Whether to include channels */ + include_channels?: boolean | null; + }; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["FetchServerResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + server_delete_delete: { + parameters: { + query?: { + /** @description Whether to not send a leave message */ + leave_silently?: boolean | null; + }; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + server_edit_edit: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataEditServer"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Server"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + server_ack_ack: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + channel_create_create_server_channel: { + parameters: { + query?: never; + header?: never; + path: { + server: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataCreateServerChannel"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Channel"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + member_fetch_all_fetch_all: { + parameters: { + query?: { + /** @description Whether to exclude offline users */ + exclude_offline?: boolean | null; + }; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["AllMemberResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + member_fetch_fetch: { + parameters: { + query?: { + roles?: boolean | null; + }; + header?: never; + path: { + target: components["schemas"]["Id"]; + member: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MemberResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + member_remove_kick: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + member: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + member_edit_edit: { + parameters: { + query?: never; + header?: never; + path: { + server: components["schemas"]["Id"]; + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataMemberEdit"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Member"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + member_experimental_query_member_experimental_query: { + parameters: { + query: { + /** @description String to search for */ + query: string; + /** @description Discourage use of this API */ + experimental_api: boolean; + }; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MemberQueryResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + ban_create_ban: { + parameters: { + query?: never; + header?: never; + path: { + server: components["schemas"]["Id"]; + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataBanCreate"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ServerBan"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + ban_remove_unban: { + parameters: { + query?: never; + header?: never; + path: { + server: components["schemas"]["Id"]; + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + ban_list_list: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["BanListResult"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + invites_fetch_invites: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Invite"][]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + roles_create_create: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataCreateRole"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["NewRoleResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + roles_fetch_fetch: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + role_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Role"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + roles_delete_delete: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + role_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + roles_edit_edit: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + role_id: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataEditRole"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Role"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + permissions_set_set_role_permission: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + role_id: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataSetServerRolePermission"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Server"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + permissions_set_default_set_default_permissions: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataPermissionsValue"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Server"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + emoji_list_list_emoji: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Emoji"][]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + invite_fetch_fetch: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["InviteResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + invite_join_join: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["InviteJoinResponse"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + invite_delete_delete: { + parameters: { + query?: never; + header?: never; + path: { + target: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + emoji_create_create_emoji: { + parameters: { + query?: never; + header?: never; + path: { + id: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataCreateEmoji"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Emoji"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + emoji_fetch_fetch_emoji: { + parameters: { + query?: never; + header?: never; + path: { + emoji_id: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Emoji"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + emoji_delete_delete_emoji: { + parameters: { + query?: never; + header?: never; + path: { + emoji_id: components["schemas"]["Id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + report_content_report_content: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataReportContent"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + create_account_create_account: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataCreateAccount"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + resend_verification_resend_verification: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataResendVerification"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + confirm_deletion_confirm_deletion: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataAccountDeletion"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + delete_account_delete_account: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_account_fetch_account: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["AccountInfo"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + disable_account_disable_account: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + change_password_change_password: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataChangePassword"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + change_email_change_email: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataChangeEmail"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + verify_email_verify_email: { + parameters: { + query?: never; + header?: never; + path: { + code: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResponseVerify"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + send_password_reset_send_password_reset: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataSendPasswordReset"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + password_reset_password_reset: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataPasswordReset"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + login_login: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataLogin"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResponseLogin"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + logout_logout: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_all_fetch_all: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SessionInfo"][]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + revoke_all_revoke_all: { + parameters: { + query?: { + revoke_self?: boolean | null; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + revoke_revoke: { + parameters: { + query?: never; + header?: never; + path: { + id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + edit_edit: { + parameters: { + query?: never; + header?: never; + path: { + id: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataEditSession"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SessionInfo"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + create_ticket_create_ticket: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["MFAResponse"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MFATicket"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_status_fetch_status: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MultiFactorStatus"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + fetch_recovery_fetch_recovery: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": string[]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + generate_recovery_generate_recovery: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": string[]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + get_mfa_methods_get_mfa_methods: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MFAMethod"][]; + }; + }; + }; + }; + totp_enable_totp_enable: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["MFAResponse"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + totp_generate_secret_totp_generate_secret: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResponseTotpSecret"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + totp_disable_totp_disable: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + hello_hello: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DataHello"]; + }; + }; + }; + }; + complete_complete: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DataOnboard"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["User"]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + subscribe_subscribe: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["WebPushSubscription"]; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + unsubscribe_unsubscribe: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + get_settings_fetch: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["OptionsFetchSettings"]; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + [key: string]: [ + number, + string + ]; + }; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + set_settings_set: { + parameters: { + query?: { + /** @description Timestamp of settings change. + * + * Used to avoid feedback loops. */ + timestamp?: number | null; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + [key: string]: string; + }; + }; + }; + responses: { + /** @description Success */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + get_unreads_unreads: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ChannelUnread"][]; + }; + }; + /** @description An error occurred. */ + default: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; +} diff --git a/src/baseURL.ts b/src/baseURL.ts deleted file mode 100644 index b8e0feb..0000000 --- a/src/baseURL.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file was auto-generated by @insertish/oapi! -export const defaultBaseURL = "https://api.revolt.chat"; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 450783d..f232395 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,271 +1,48 @@ -// This file was auto-generated by @insertish/oapi! -import Axios from 'axios'; -import type { AxiosRequestConfig } from 'axios'; +import createFetchClient, { ClientOptions, Middleware } from "openapi-fetch"; +import type { paths } from "./api.js"; -import defaultsDeep from 'lodash.defaultsdeep'; +export type * from "./types.js"; -export * from './types'; -import type { APIRoutes } from './routes'; +export type FetchConfiguration = ClientOptions & { + /** + * Specify a bot token to authenticate with Revolt + */ + botToken?: string; -import { defaultBaseURL } from './baseURL'; -import { pathResolve, queryParams } from './params'; - -type Methods = APIRoutes['method']; -type PickRoutes = APIRoutes & { method: Method }; - -type GetRoutes = PickRoutes<'get'>; -type PatchRoutes = PickRoutes<'patch'>; -type PutRoutes = PickRoutes<'put'>; -type DeleteRoutes = PickRoutes<'delete'>; -type PostRoutes = PickRoutes<'post'>; - -type Count = - Str extends `${infer _}${SubStr}${infer After}` ? Count : Matches['length']; - -/** - * Get the specific path name of any given path. - * @param anyPath Any path - * @returns Specific path - */ -export function getPathName(anyPath: string) { - const segments = anyPath.split('/'); - - const list = (pathResolve as unknown as Record)[(segments.length - 1).toString()] || []; - for (const entry of list) { - let i = 1; - let copy = [...segments]; - for (i;i = { }) { - this.baseURL = baseURL || defaultBaseURL; - this.authentication = authentication || { }; - } - - /** - * Generate authentication options. - */ - get auth(): AxiosRequestConfig { - if (this.authentication.rauth) { - if (typeof this.authentication.rauth === 'string') { - return { - headers: { - 'X-Session-Token': this.authentication.rauth - } - } - } - } else if (this.authentication.revolt) { - switch (typeof this.authentication.revolt) { - case 'string': { - return { - headers: { - 'X-Bot-Token': this.authentication.revolt - } - } - } - case 'object': { - return { - headers: { - 'X-Session-Token': this.authentication.revolt.token - } - } - } - } +export function createClient(config?: FetchConfiguration) { + const client = createFetchClient({ + baseUrl: "https://revolt.chat/api", + ...config, + }); + + if (config?.sessionToken || config?.botToken) { + const authMiddleware: Middleware = { + async onRequest({ request }) { + if (config.sessionToken) { + request.headers.set("X-Session-Token", config.sessionToken); } - return { }; - } - - /** - * Generate config to pass through to API. - */ - get config(): AxiosRequestConfig { - return { - baseURL: this.baseURL, - ...this.auth, - }; - } - - /** - * Send any arbitrary request. - * @param method HTTP Method - * @param path Path - * @param params Body or Query Parameters - * @param config Axios configuration - * @returns Typed Response Data - */ - req, Path extends Routes['path'], Route extends Routes & { path: Path, parts: Count }>(method: Method, path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise { - let query, body; - let named = getPathName(path); - - // If we are aware of this route, then match the parameters given. - if (named && typeof params === 'object') { - const route = queryParams[named as keyof typeof queryParams]; - const allowed_query = (route as unknown as Record)[method]; - - // Map each parameter to the correct object. - for (const parameter of Object.keys(params)) { - if (allowed_query?.includes(parameter)) { - query = { - ...(query || {}), - [parameter]: (params as Record)[parameter] - }; - } else { - body = { - ...(body || {}), - [parameter]: (params as Record)[parameter] - }; - } - } + if (config.botToken) { + request.headers.set("X-Bot-Token", config.botToken); } - return Axios(path, defaultsDeep({ - method, - params: query, - data: body - }, defaultsDeep( - config, - this.config - ))) - .then(res => res.data); - } - - /** - * Send HTTP GET request. - * @param path Path - * @param params Body or Query Parameters - * @param config Axios configuration - * @returns Typed Response Data - */ - get }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise; - - /** - * Send HTTP GET request. - * @param path Path - * @returns Typed Response Data - */ - get }>(path: Path): Promise; - - get(path: any, params?: any, config?: AxiosRequestConfig): Promise { - // @ts-ignore-next-line - return this.req('get', path, params, config); - } - - /** - * Send HTTP PATCH request. - * @param path Path - * @param params Body or Query Parameters - * @param config Axios configuration - * @returns Typed Response Data - */ - patch }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise; - - /** - * Send HTTP PATCH request. - * @param path Path - * @returns Typed Response Data - */ - patch }>(path: Path): Promise; - - patch(path: any, params?: any, config?: AxiosRequestConfig): Promise { - // @ts-ignore-next-line - return this.req('patch', path, params, config); - } - - /** - * Send HTTP PUT request. - * @param path Path - * @param params Body or Query Parameters - * @param config Axios configuration - * @returns Typed Response Data - */ - put }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise; - - /** - * Send HTTP PUT request. - * @param path Path - * @returns Typed Response Data - */ - put }>(path: Path): Promise; - - put(path: any, params?: any, config?: AxiosRequestConfig): Promise { - // @ts-ignore-next-line - return this.req('put', path, params, config); - } - - /** - * Send HTTP DELETE request. - * @param path Path - * @param params Body or Query Parameters - * @param config Axios configuration - * @returns Typed Response Data - */ - delete }>(path: Path, params?: any, config?: AxiosRequestConfig): Promise; - - /** - * Send HTTP DELETE request. - * @param path Path - * @param params Body or Query Parameters - * @returns Typed Response Data - */ - delete }>(path: Path, params?: any): Promise; - - delete(path: any, params?: any, config?: AxiosRequestConfig): Promise { - // @ts-ignore-next-line - return this.req('delete', path, params, config); - } + return request; + }, + }; - /** - * Send HTTP POST request. - * @param path Path - * @param params Body or Query Parameters - * @param config Axios configuration - * @returns Typed Response Data - */ - post }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise; - - /** - * Send HTTP POST request. - * @param path Path - * @returns Typed Response Data - */ - post }>(path: Path): Promise; + client.use(authMiddleware); + } - post(path: any, params?: any, config?: AxiosRequestConfig): Promise { - // @ts-ignore-next-line - return this.req('post', path, params, config); - } + return client; } diff --git a/src/params.ts b/src/params.ts deleted file mode 100644 index 45aee84..0000000 --- a/src/params.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was auto-generated by @insertish/oapi! -export const pathResolve = {"1":[[""]],"2":[["users","@me"],["users",["{target}"]],["users","dms"],["users","friend"],["bots","create"],["bots",["{bot}"]],["bots","@me"],["bots",["{target}"]],["channels",["{target}"]],["channels","create"],["servers","create"],["servers",["{target}"]],["invites",["{target}"]],["safety","report"],["onboard","hello"],["onboard","complete"],["push","subscribe"],["push","unsubscribe"],["sync","unreads"]],"3":[["users",["{target}"],"flags"],["users","@me","username"],["users",["{target}"],"default_avatar"],["users",["{target}"],"profile"],["users",["{target}"],"dm"],["users",["{target}"],"mutual"],["users",["{target}"],"friend"],["users",["{target}"],"block"],["bots",["{target}"],"invite"],["channels",["{target}"],"members"],["channels",["{target}"],"invites"],["channels",["{target}"],"messages"],["channels",["{target}"],"search"],["channels",["{target}"],"join_call"],["channels",["{target}"],"webhooks"],["channels",["{channel_id}"],"webhooks"],["servers",["{target}"],"ack"],["servers",["{server}"],"channels"],["servers",["{target}"],"members"],["servers",["{target}"],"members_experimental_query"],["servers",["{target}"],"bans"],["servers",["{target}"],"invites"],["servers",["{target}"],"roles"],["servers",["{target}"],"emojis"],["custom","emoji",["{id}"]],["custom","emoji",["{emoji_id}"]],["auth","account","create"],["auth","account","reverify"],["auth","account","delete"],["auth","account",""],["auth","account","disable"],["auth","account","reset_password"],["auth","session","login"],["auth","session","logout"],["auth","session","all"],["auth","session",["{id}"]],["auth","mfa","ticket"],["auth","mfa",""],["auth","mfa","recovery"],["auth","mfa","methods"],["auth","mfa","totp"],["sync","settings","fetch"],["sync","settings","set"]],"4":[["channels",["{target}"],"ack",["{message}"]],["channels",["{target}"],"messages",["{msg}"]],["channels",["{target}"],"messages","bulk"],["channels",["{group_id}"],"recipients",["{member_id}"]],["channels",["{target}"],"recipients",["{member}"]],["channels",["{target}"],"permissions",["{role_id}"]],["channels",["{target}"],"permissions","default"],["servers",["{target}"],"members",["{member}"]],["servers",["{server}"],"members",["{target}"]],["servers",["{server}"],"bans",["{target}"]],["servers",["{target}"],"roles",["{role_id}"]],["servers",["{target}"],"permissions",["{role_id}"]],["servers",["{target}"],"permissions","default"],["auth","account","change","password"],["auth","account","change","email"],["auth","account","verify",["{code}"]]],"5":[["channels",["{target}"],"messages",["{msg}"],"pin"],["channels",["{target}"],"messages",["{msg}"],"reactions"]],"6":[["channels",["{target}"],"messages",["{msg}"],"reactions",["{emoji}"]]]}; -export const queryParams = {"/":{"get":[]},"/users/@me":{"get":[]},"/users/{target}":{"get":[],"patch":[]},"/users/{target}/flags":{"get":[]},"/users/@me/username":{"patch":[]},"/users/{target}/default_avatar":{"get":[]},"/users/{target}/profile":{"get":[]},"/users/dms":{"get":[]},"/users/{target}/dm":{"get":[]},"/users/{target}/mutual":{"get":[]},"/users/{target}/friend":{"put":[],"delete":[]},"/users/{target}/block":{"put":[],"delete":[]},"/users/friend":{"post":[]},"/bots/create":{"post":[]},"/bots/{target}/invite":{"get":[],"post":[]},"/bots/{bot}":{"get":[]},"/bots/@me":{"get":[]},"/bots/{target}":{"delete":[],"patch":[]},"/channels/{target}/ack/{message}":{"put":[]},"/channels/{target}":{"get":[],"delete":["leave_silently"],"patch":[]},"/channels/{target}/members":{"get":[]},"/channels/{target}/invites":{"post":[]},"/channels/{target}/messages":{"get":["limit","before","after","sort","nearby","include_users"],"post":[]},"/channels/{target}/search":{"post":[]},"/channels/{target}/messages/{msg}/pin":{"post":[],"delete":[]},"/channels/{target}/messages/{msg}":{"get":[],"delete":[],"patch":[]},"/channels/{target}/messages/bulk":{"delete":[]},"/channels/create":{"post":[]},"/channels/{group_id}/recipients/{member_id}":{"put":[]},"/channels/{target}/recipients/{member}":{"delete":[]},"/channels/{target}/join_call":{"post":[]},"/channels/{target}/permissions/{role_id}":{"put":[]},"/channels/{target}/permissions/default":{"put":[]},"/channels/{target}/messages/{msg}/reactions/{emoji}":{"put":[],"delete":["user_id","remove_all"]},"/channels/{target}/messages/{msg}/reactions":{"delete":[]},"/channels/{target}/webhooks":{"post":[]},"/channels/{channel_id}/webhooks":{"get":[]},"/servers/create":{"post":[]},"/servers/{target}":{"get":["include_channels"],"delete":["leave_silently"],"patch":[]},"/servers/{target}/ack":{"put":[]},"/servers/{server}/channels":{"post":[]},"/servers/{target}/members":{"get":["exclude_offline"]},"/servers/{target}/members/{member}":{"get":["roles"],"delete":[]},"/servers/{server}/members/{target}":{"patch":[]},"/servers/{target}/members_experimental_query":{"get":["query","experimental_api"]},"/servers/{server}/bans/{target}":{"put":[],"delete":[]},"/servers/{target}/bans":{"get":[]},"/servers/{target}/invites":{"get":[]},"/servers/{target}/roles":{"post":[]},"/servers/{target}/roles/{role_id}":{"get":[],"delete":[],"patch":[]},"/servers/{target}/permissions/{role_id}":{"put":[]},"/servers/{target}/permissions/default":{"put":[]},"/servers/{target}/emojis":{"get":[]},"/invites/{target}":{"get":[],"post":[],"delete":[]},"/custom/emoji/{id}":{"put":[]},"/custom/emoji/{emoji_id}":{"get":[],"delete":[]},"/safety/report":{"post":[]},"/auth/account/create":{"post":[]},"/auth/account/reverify":{"post":[]},"/auth/account/delete":{"put":[],"post":[]},"/auth/account/":{"get":[]},"/auth/account/disable":{"post":[]},"/auth/account/change/password":{"patch":[]},"/auth/account/change/email":{"patch":[]},"/auth/account/verify/{code}":{"post":[]},"/auth/account/reset_password":{"post":[],"patch":[]},"/auth/session/login":{"post":[]},"/auth/session/logout":{"post":[]},"/auth/session/all":{"get":[],"delete":["revoke_self"]},"/auth/session/{id}":{"delete":[],"patch":[]},"/auth/mfa/ticket":{"put":[]},"/auth/mfa/":{"get":[]},"/auth/mfa/recovery":{"post":[],"patch":[]},"/auth/mfa/methods":{"get":[]},"/auth/mfa/totp":{"put":[],"post":[],"delete":[]},"/onboard/hello":{"get":[]},"/onboard/complete":{"post":[]},"/push/subscribe":{"post":[]},"/push/unsubscribe":{"post":[]},"/sync/settings/fetch":{"post":[]},"/sync/settings/set":{"post":["timestamp"]},"/sync/unreads":{"get":[]}}; \ No newline at end of file diff --git a/src/routes.ts b/src/routes.ts deleted file mode 100644 index 0dcdede..0000000 --- a/src/routes.ts +++ /dev/null @@ -1,184 +0,0 @@ -// This file was auto-generated by @insertish/oapi! -import { paths } from './schema'; -export type APIRoutes = -| { method: 'get', path: `/`, parts: 1, params: undefined, response: paths['/']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/users/@me`, parts: 2, params: undefined, response: paths['/users/@me']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/users/${string}`, parts: 2, params: undefined, response: paths['/users/{target}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/users/{target}', parts: 2, params: undefined, response: paths['/users/{target}']['get']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: `/users/${string}`, parts: 2, params: paths['/users/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/users/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: '-/users/{target}', parts: 2, params: paths['/users/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/users/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/users/${string}/flags`, parts: 3, params: undefined, response: paths['/users/{target}/flags']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/users/{target}/flags', parts: 3, params: undefined, response: paths['/users/{target}/flags']['get']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: `/users/@me/username`, parts: 3, params: paths['/users/@me/username']['patch']['requestBody']['content']['application/json'], response: paths['/users/@me/username']['patch']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/users/${string}/default_avatar`, parts: 3, params: undefined, response: paths['/users/{target}/default_avatar']['get']['responses']['200']['content']['image/png'] } -| { method: 'get', path: '-/users/{target}/default_avatar', parts: 3, params: undefined, response: paths['/users/{target}/default_avatar']['get']['responses']['200']['content']['image/png'] } -| { method: 'get', path: `/users/${string}/profile`, parts: 3, params: undefined, response: paths['/users/{target}/profile']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/users/{target}/profile', parts: 3, params: undefined, response: paths['/users/{target}/profile']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/users/dms`, parts: 2, params: undefined, response: paths['/users/dms']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/users/${string}/dm`, parts: 3, params: undefined, response: paths['/users/{target}/dm']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/users/{target}/dm', parts: 3, params: undefined, response: paths['/users/{target}/dm']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/users/${string}/mutual`, parts: 3, params: undefined, response: paths['/users/{target}/mutual']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/users/{target}/mutual', parts: 3, params: undefined, response: paths['/users/{target}/mutual']['get']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/users/${string}/friend`, parts: 3, params: undefined, response: paths['/users/{target}/friend']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: '-/users/{target}/friend', parts: 3, params: undefined, response: paths['/users/{target}/friend']['put']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/users/${string}/friend`, parts: 3, params: undefined, response: paths['/users/{target}/friend']['delete']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: '-/users/{target}/friend', parts: 3, params: undefined, response: paths['/users/{target}/friend']['delete']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/users/${string}/block`, parts: 3, params: undefined, response: paths['/users/{target}/block']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: '-/users/{target}/block', parts: 3, params: undefined, response: paths['/users/{target}/block']['put']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/users/${string}/block`, parts: 3, params: undefined, response: paths['/users/{target}/block']['delete']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: '-/users/{target}/block', parts: 3, params: undefined, response: paths['/users/{target}/block']['delete']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/users/friend`, parts: 2, params: paths['/users/friend']['post']['requestBody']['content']['application/json'], response: paths['/users/friend']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/bots/create`, parts: 2, params: paths['/bots/create']['post']['requestBody']['content']['application/json'], response: paths['/bots/create']['post']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/bots/${string}/invite`, parts: 3, params: undefined, response: paths['/bots/{target}/invite']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/bots/{target}/invite', parts: 3, params: undefined, response: paths['/bots/{target}/invite']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/bots/${string}/invite`, parts: 3, params: paths['/bots/{target}/invite']['post']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: '-/bots/{target}/invite', parts: 3, params: paths['/bots/{target}/invite']['post']['requestBody']['content']['application/json'], response: undefined } -| { method: 'get', path: `/bots/${string}`, parts: 2, params: undefined, response: paths['/bots/{bot}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/bots/{bot}', parts: 2, params: undefined, response: paths['/bots/{bot}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/bots/@me`, parts: 2, params: undefined, response: paths['/bots/@me']['get']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/bots/${string}`, parts: 2, params: undefined, response: undefined } -| { method: 'delete', path: '-/bots/{target}', parts: 2, params: undefined, response: undefined } -| { method: 'patch', path: `/bots/${string}`, parts: 2, params: paths['/bots/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/bots/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: '-/bots/{target}', parts: 2, params: paths['/bots/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/bots/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/channels/${string}/ack/${string}`, parts: 4, params: undefined, response: undefined } -| { method: 'put', path: '-/channels/{target}/ack/{message}', parts: 4, params: undefined, response: undefined } -| { method: 'get', path: `/channels/${string}`, parts: 2, params: undefined, response: paths['/channels/{target}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/channels/{target}', parts: 2, params: undefined, response: paths['/channels/{target}']['get']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/channels/${string}`, parts: 2, params: paths['/channels/{target}']['delete']['parameters']['query'], response: undefined } -| { method: 'delete', path: '-/channels/{target}', parts: 2, params: paths['/channels/{target}']['delete']['parameters']['query'], response: undefined } -| { method: 'patch', path: `/channels/${string}`, parts: 2, params: paths['/channels/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/channels/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: '-/channels/{target}', parts: 2, params: paths['/channels/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/channels/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/channels/${string}/members`, parts: 3, params: undefined, response: paths['/channels/{target}/members']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/channels/{target}/members', parts: 3, params: undefined, response: paths['/channels/{target}/members']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/channels/${string}/invites`, parts: 3, params: undefined, response: paths['/channels/{target}/invites']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/channels/{target}/invites', parts: 3, params: undefined, response: paths['/channels/{target}/invites']['post']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/channels/${string}/messages`, parts: 3, params: paths['/channels/{target}/messages']['get']['parameters']['query'], response: paths['/channels/{target}/messages']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/channels/{target}/messages', parts: 3, params: paths['/channels/{target}/messages']['get']['parameters']['query'], response: paths['/channels/{target}/messages']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/channels/${string}/messages`, parts: 3, params: paths['/channels/{target}/messages']['post']['requestBody']['content']['application/json'], response: paths['/channels/{target}/messages']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/channels/{target}/messages', parts: 3, params: paths['/channels/{target}/messages']['post']['requestBody']['content']['application/json'], response: paths['/channels/{target}/messages']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/channels/${string}/search`, parts: 3, params: paths['/channels/{target}/search']['post']['requestBody']['content']['application/json'], response: paths['/channels/{target}/search']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/channels/{target}/search', parts: 3, params: paths['/channels/{target}/search']['post']['requestBody']['content']['application/json'], response: paths['/channels/{target}/search']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/channels/${string}/messages/${string}/pin`, parts: 5, params: undefined, response: undefined } -| { method: 'post', path: '-/channels/{target}/messages/{msg}/pin', parts: 5, params: undefined, response: undefined } -| { method: 'delete', path: `/channels/${string}/messages/${string}/pin`, parts: 5, params: undefined, response: undefined } -| { method: 'delete', path: '-/channels/{target}/messages/{msg}/pin', parts: 5, params: undefined, response: undefined } -| { method: 'get', path: `/channels/${string}/messages/${string}`, parts: 4, params: undefined, response: paths['/channels/{target}/messages/{msg}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/channels/{target}/messages/{msg}', parts: 4, params: undefined, response: paths['/channels/{target}/messages/{msg}']['get']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/channels/${string}/messages/${string}`, parts: 4, params: undefined, response: undefined } -| { method: 'delete', path: '-/channels/{target}/messages/{msg}', parts: 4, params: undefined, response: undefined } -| { method: 'patch', path: `/channels/${string}/messages/${string}`, parts: 4, params: paths['/channels/{target}/messages/{msg}']['patch']['requestBody']['content']['application/json'], response: paths['/channels/{target}/messages/{msg}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: '-/channels/{target}/messages/{msg}', parts: 4, params: paths['/channels/{target}/messages/{msg}']['patch']['requestBody']['content']['application/json'], response: paths['/channels/{target}/messages/{msg}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/channels/${string}/messages/bulk`, parts: 4, params: paths['/channels/{target}/messages/bulk']['delete']['requestBody']['content']['application/json'], response: undefined } -| { method: 'delete', path: '-/channels/{target}/messages/bulk', parts: 4, params: paths['/channels/{target}/messages/bulk']['delete']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: `/channels/create`, parts: 2, params: paths['/channels/create']['post']['requestBody']['content']['application/json'], response: paths['/channels/create']['post']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/channels/${string}/recipients/${string}`, parts: 4, params: undefined, response: undefined } -| { method: 'put', path: '-/channels/{group_id}/recipients/{member_id}', parts: 4, params: undefined, response: undefined } -| { method: 'delete', path: `/channels/${string}/recipients/${string}`, parts: 4, params: undefined, response: undefined } -| { method: 'delete', path: '-/channels/{target}/recipients/{member}', parts: 4, params: undefined, response: undefined } -| { method: 'post', path: `/channels/${string}/join_call`, parts: 3, params: undefined, response: paths['/channels/{target}/join_call']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/channels/{target}/join_call', parts: 3, params: undefined, response: paths['/channels/{target}/join_call']['post']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/channels/${string}/permissions/${string}`, parts: 4, params: paths['/channels/{target}/permissions/{role_id}']['put']['requestBody']['content']['application/json'], response: paths['/channels/{target}/permissions/{role_id}']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: '-/channels/{target}/permissions/{role_id}', parts: 4, params: paths['/channels/{target}/permissions/{role_id}']['put']['requestBody']['content']['application/json'], response: paths['/channels/{target}/permissions/{role_id}']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/channels/${string}/permissions/default`, parts: 4, params: paths['/channels/{target}/permissions/default']['put']['requestBody']['content']['application/json'], response: paths['/channels/{target}/permissions/default']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: '-/channels/{target}/permissions/default', parts: 4, params: paths['/channels/{target}/permissions/default']['put']['requestBody']['content']['application/json'], response: paths['/channels/{target}/permissions/default']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/channels/${string}/messages/${string}/reactions/${string}`, parts: 6, params: undefined, response: undefined } -| { method: 'put', path: '-/channels/{target}/messages/{msg}/reactions/{emoji}', parts: 6, params: undefined, response: undefined } -| { method: 'delete', path: `/channels/${string}/messages/${string}/reactions/${string}`, parts: 6, params: paths['/channels/{target}/messages/{msg}/reactions/{emoji}']['delete']['parameters']['query'], response: undefined } -| { method: 'delete', path: '-/channels/{target}/messages/{msg}/reactions/{emoji}', parts: 6, params: paths['/channels/{target}/messages/{msg}/reactions/{emoji}']['delete']['parameters']['query'], response: undefined } -| { method: 'delete', path: `/channels/${string}/messages/${string}/reactions`, parts: 5, params: undefined, response: undefined } -| { method: 'delete', path: '-/channels/{target}/messages/{msg}/reactions', parts: 5, params: undefined, response: undefined } -| { method: 'post', path: `/channels/${string}/webhooks`, parts: 3, params: paths['/channels/{target}/webhooks']['post']['requestBody']['content']['application/json'], response: paths['/channels/{target}/webhooks']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/channels/{target}/webhooks', parts: 3, params: paths['/channels/{target}/webhooks']['post']['requestBody']['content']['application/json'], response: paths['/channels/{target}/webhooks']['post']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/channels/${string}/webhooks`, parts: 3, params: undefined, response: paths['/channels/{channel_id}/webhooks']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/channels/{channel_id}/webhooks', parts: 3, params: undefined, response: paths['/channels/{channel_id}/webhooks']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/servers/create`, parts: 2, params: paths['/servers/create']['post']['requestBody']['content']['application/json'], response: paths['/servers/create']['post']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/servers/${string}`, parts: 2, params: paths['/servers/{target}']['get']['parameters']['query'], response: paths['/servers/{target}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/servers/{target}', parts: 2, params: paths['/servers/{target}']['get']['parameters']['query'], response: paths['/servers/{target}']['get']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/servers/${string}`, parts: 2, params: paths['/servers/{target}']['delete']['parameters']['query'], response: undefined } -| { method: 'delete', path: '-/servers/{target}', parts: 2, params: paths['/servers/{target}']['delete']['parameters']['query'], response: undefined } -| { method: 'patch', path: `/servers/${string}`, parts: 2, params: paths['/servers/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/servers/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: '-/servers/{target}', parts: 2, params: paths['/servers/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/servers/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/servers/${string}/ack`, parts: 3, params: undefined, response: undefined } -| { method: 'put', path: '-/servers/{target}/ack', parts: 3, params: undefined, response: undefined } -| { method: 'post', path: `/servers/${string}/channels`, parts: 3, params: paths['/servers/{server}/channels']['post']['requestBody']['content']['application/json'], response: paths['/servers/{server}/channels']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/servers/{server}/channels', parts: 3, params: paths['/servers/{server}/channels']['post']['requestBody']['content']['application/json'], response: paths['/servers/{server}/channels']['post']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/servers/${string}/members`, parts: 3, params: paths['/servers/{target}/members']['get']['parameters']['query'], response: paths['/servers/{target}/members']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/servers/{target}/members', parts: 3, params: paths['/servers/{target}/members']['get']['parameters']['query'], response: paths['/servers/{target}/members']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/servers/${string}/members/${string}`, parts: 4, params: paths['/servers/{target}/members/{member}']['get']['parameters']['query'], response: paths['/servers/{target}/members/{member}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/servers/{target}/members/{member}', parts: 4, params: paths['/servers/{target}/members/{member}']['get']['parameters']['query'], response: paths['/servers/{target}/members/{member}']['get']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/servers/${string}/members/${string}`, parts: 4, params: undefined, response: undefined } -| { method: 'delete', path: '-/servers/{target}/members/{member}', parts: 4, params: undefined, response: undefined } -| { method: 'patch', path: `/servers/${string}/members/${string}`, parts: 4, params: paths['/servers/{server}/members/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/servers/{server}/members/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: '-/servers/{server}/members/{target}', parts: 4, params: paths['/servers/{server}/members/{target}']['patch']['requestBody']['content']['application/json'], response: paths['/servers/{server}/members/{target}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/servers/${string}/members_experimental_query`, parts: 3, params: paths['/servers/{target}/members_experimental_query']['get']['parameters']['query'], response: paths['/servers/{target}/members_experimental_query']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/servers/{target}/members_experimental_query', parts: 3, params: paths['/servers/{target}/members_experimental_query']['get']['parameters']['query'], response: paths['/servers/{target}/members_experimental_query']['get']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/servers/${string}/bans/${string}`, parts: 4, params: paths['/servers/{server}/bans/{target}']['put']['requestBody']['content']['application/json'], response: paths['/servers/{server}/bans/{target}']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: '-/servers/{server}/bans/{target}', parts: 4, params: paths['/servers/{server}/bans/{target}']['put']['requestBody']['content']['application/json'], response: paths['/servers/{server}/bans/{target}']['put']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/servers/${string}/bans/${string}`, parts: 4, params: undefined, response: undefined } -| { method: 'delete', path: '-/servers/{server}/bans/{target}', parts: 4, params: undefined, response: undefined } -| { method: 'get', path: `/servers/${string}/bans`, parts: 3, params: undefined, response: paths['/servers/{target}/bans']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/servers/{target}/bans', parts: 3, params: undefined, response: paths['/servers/{target}/bans']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/servers/${string}/invites`, parts: 3, params: undefined, response: paths['/servers/{target}/invites']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/servers/{target}/invites', parts: 3, params: undefined, response: paths['/servers/{target}/invites']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/servers/${string}/roles`, parts: 3, params: paths['/servers/{target}/roles']['post']['requestBody']['content']['application/json'], response: paths['/servers/{target}/roles']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/servers/{target}/roles', parts: 3, params: paths['/servers/{target}/roles']['post']['requestBody']['content']['application/json'], response: paths['/servers/{target}/roles']['post']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/servers/${string}/roles/${string}`, parts: 4, params: undefined, response: paths['/servers/{target}/roles/{role_id}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/servers/{target}/roles/{role_id}', parts: 4, params: undefined, response: paths['/servers/{target}/roles/{role_id}']['get']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/servers/${string}/roles/${string}`, parts: 4, params: undefined, response: undefined } -| { method: 'delete', path: '-/servers/{target}/roles/{role_id}', parts: 4, params: undefined, response: undefined } -| { method: 'patch', path: `/servers/${string}/roles/${string}`, parts: 4, params: paths['/servers/{target}/roles/{role_id}']['patch']['requestBody']['content']['application/json'], response: paths['/servers/{target}/roles/{role_id}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: '-/servers/{target}/roles/{role_id}', parts: 4, params: paths['/servers/{target}/roles/{role_id}']['patch']['requestBody']['content']['application/json'], response: paths['/servers/{target}/roles/{role_id}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/servers/${string}/permissions/${string}`, parts: 4, params: paths['/servers/{target}/permissions/{role_id}']['put']['requestBody']['content']['application/json'], response: paths['/servers/{target}/permissions/{role_id}']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: '-/servers/{target}/permissions/{role_id}', parts: 4, params: paths['/servers/{target}/permissions/{role_id}']['put']['requestBody']['content']['application/json'], response: paths['/servers/{target}/permissions/{role_id}']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/servers/${string}/permissions/default`, parts: 4, params: paths['/servers/{target}/permissions/default']['put']['requestBody']['content']['application/json'], response: paths['/servers/{target}/permissions/default']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: '-/servers/{target}/permissions/default', parts: 4, params: paths['/servers/{target}/permissions/default']['put']['requestBody']['content']['application/json'], response: paths['/servers/{target}/permissions/default']['put']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/servers/${string}/emojis`, parts: 3, params: undefined, response: paths['/servers/{target}/emojis']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/servers/{target}/emojis', parts: 3, params: undefined, response: paths['/servers/{target}/emojis']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/invites/${string}`, parts: 2, params: undefined, response: paths['/invites/{target}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/invites/{target}', parts: 2, params: undefined, response: paths['/invites/{target}']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/invites/${string}`, parts: 2, params: undefined, response: paths['/invites/{target}']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/invites/{target}', parts: 2, params: undefined, response: paths['/invites/{target}']['post']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/invites/${string}`, parts: 2, params: undefined, response: undefined } -| { method: 'delete', path: '-/invites/{target}', parts: 2, params: undefined, response: undefined } -| { method: 'put', path: `/custom/emoji/${string}`, parts: 3, params: paths['/custom/emoji/{id}']['put']['requestBody']['content']['application/json'], response: paths['/custom/emoji/{id}']['put']['responses']['200']['content']['application/json'] } -| { method: 'put', path: '-/custom/emoji/{id}', parts: 3, params: paths['/custom/emoji/{id}']['put']['requestBody']['content']['application/json'], response: paths['/custom/emoji/{id}']['put']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/custom/emoji/${string}`, parts: 3, params: undefined, response: paths['/custom/emoji/{emoji_id}']['get']['responses']['200']['content']['application/json'] } -| { method: 'get', path: '-/custom/emoji/{emoji_id}', parts: 3, params: undefined, response: paths['/custom/emoji/{emoji_id}']['get']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/custom/emoji/${string}`, parts: 3, params: undefined, response: undefined } -| { method: 'delete', path: '-/custom/emoji/{emoji_id}', parts: 3, params: undefined, response: undefined } -| { method: 'post', path: `/safety/report`, parts: 2, params: paths['/safety/report']['post']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: `/auth/account/create`, parts: 3, params: paths['/auth/account/create']['post']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: `/auth/account/reverify`, parts: 3, params: paths['/auth/account/reverify']['post']['requestBody']['content']['application/json'], response: undefined } -| { method: 'put', path: `/auth/account/delete`, parts: 3, params: paths['/auth/account/delete']['put']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: `/auth/account/delete`, parts: 3, params: undefined, response: undefined } -| { method: 'get', path: `/auth/account/`, parts: 3, params: undefined, response: paths['/auth/account/']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/auth/account/disable`, parts: 3, params: undefined, response: undefined } -| { method: 'patch', path: `/auth/account/change/password`, parts: 4, params: paths['/auth/account/change/password']['patch']['requestBody']['content']['application/json'], response: undefined } -| { method: 'patch', path: `/auth/account/change/email`, parts: 4, params: paths['/auth/account/change/email']['patch']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: `/auth/account/verify/${string}`, parts: 4, params: undefined, response: paths['/auth/account/verify/{code}']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: '-/auth/account/verify/{code}', parts: 4, params: undefined, response: paths['/auth/account/verify/{code}']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/auth/account/reset_password`, parts: 3, params: paths['/auth/account/reset_password']['post']['requestBody']['content']['application/json'], response: undefined } -| { method: 'patch', path: `/auth/account/reset_password`, parts: 3, params: paths['/auth/account/reset_password']['patch']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: `/auth/session/login`, parts: 3, params: paths['/auth/session/login']['post']['requestBody']['content']['application/json'], response: paths['/auth/session/login']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/auth/session/logout`, parts: 3, params: undefined, response: undefined } -| { method: 'get', path: `/auth/session/all`, parts: 3, params: undefined, response: paths['/auth/session/all']['get']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/auth/session/all`, parts: 3, params: paths['/auth/session/all']['delete']['parameters']['query'], response: undefined } -| { method: 'delete', path: `/auth/session/${string}`, parts: 3, params: undefined, response: undefined } -| { method: 'delete', path: '-/auth/session/{id}', parts: 3, params: undefined, response: undefined } -| { method: 'patch', path: `/auth/session/${string}`, parts: 3, params: paths['/auth/session/{id}']['patch']['requestBody']['content']['application/json'], response: paths['/auth/session/{id}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: '-/auth/session/{id}', parts: 3, params: paths['/auth/session/{id}']['patch']['requestBody']['content']['application/json'], response: paths['/auth/session/{id}']['patch']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/auth/mfa/ticket`, parts: 3, params: paths['/auth/mfa/ticket']['put']['requestBody']['content']['application/json'], response: paths['/auth/mfa/ticket']['put']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/auth/mfa/`, parts: 3, params: undefined, response: paths['/auth/mfa/']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/auth/mfa/recovery`, parts: 3, params: undefined, response: paths['/auth/mfa/recovery']['post']['responses']['200']['content']['application/json'] } -| { method: 'patch', path: `/auth/mfa/recovery`, parts: 3, params: undefined, response: paths['/auth/mfa/recovery']['patch']['responses']['200']['content']['application/json'] } -| { method: 'get', path: `/auth/mfa/methods`, parts: 3, params: undefined, response: paths['/auth/mfa/methods']['get']['responses']['200']['content']['application/json'] } -| { method: 'put', path: `/auth/mfa/totp`, parts: 3, params: paths['/auth/mfa/totp']['put']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: `/auth/mfa/totp`, parts: 3, params: undefined, response: paths['/auth/mfa/totp']['post']['responses']['200']['content']['application/json'] } -| { method: 'delete', path: `/auth/mfa/totp`, parts: 3, params: undefined, response: undefined } -| { method: 'get', path: `/onboard/hello`, parts: 2, params: undefined, response: paths['/onboard/hello']['get']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/onboard/complete`, parts: 2, params: paths['/onboard/complete']['post']['requestBody']['content']['application/json'], response: paths['/onboard/complete']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/push/subscribe`, parts: 2, params: paths['/push/subscribe']['post']['requestBody']['content']['application/json'], response: undefined } -| { method: 'post', path: `/push/unsubscribe`, parts: 2, params: undefined, response: undefined } -| { method: 'post', path: `/sync/settings/fetch`, parts: 3, params: paths['/sync/settings/fetch']['post']['requestBody']['content']['application/json'], response: paths['/sync/settings/fetch']['post']['responses']['200']['content']['application/json'] } -| { method: 'post', path: `/sync/settings/set`, parts: 3, params: paths['/sync/settings/set']['post']['parameters']['query']|paths['/sync/settings/set']['post']['requestBody']['content']['application/json'], response: undefined } -| { method: 'get', path: `/sync/unreads`, parts: 2, params: undefined, response: paths['/sync/unreads']['get']['responses']['200']['content']['application/json'] }; \ No newline at end of file diff --git a/src/schema.ts b/src/schema.ts deleted file mode 100644 index 6ed207e..0000000 --- a/src/schema.ts +++ /dev/null @@ -1,4899 +0,0 @@ -/** - * This file was auto-generated by openapi-typescript. - * Do not make direct changes to the file. - */ - -export interface paths { - "/": { - /** Fetch the server configuration for this Revolt instance. */ - get: operations["root_root"]; - }; - "/users/@me": { - /** Retrieve your user information. */ - get: operations["fetch_self_fetch"]; - }; - "/users/{target}": { - /** Retrieve a user's information. */ - get: operations["fetch_user_fetch"]; - /** Edit currently authenticated user. */ - patch: operations["edit_user_edit"]; - }; - "/users/{target}/flags": { - /** Retrieve a user's flags. */ - get: operations["fetch_user_flags_fetch_user_flags"]; - }; - "/users/@me/username": { - /** Change your username. */ - patch: operations["change_username_change_username"]; - }; - "/users/{target}/default_avatar": { - /** This returns a default avatar based on the given id. */ - get: operations["get_default_avatar_default_avatar"]; - }; - "/users/{target}/profile": { - /** - * Retrieve a user's profile data. - * - * Will fail if you do not have permission to access the other user's profile. - */ - get: operations["fetch_profile_profile"]; - }; - "/users/dms": { - /** This fetches your direct messages, including any DM and group DM conversations. */ - get: operations["fetch_dms_direct_messages"]; - }; - "/users/{target}/dm": { - /** - * Open a DM with another user. - * - * If the target is oneself, a saved messages channel is returned. - */ - get: operations["open_dm_open_dm"]; - }; - "/users/{target}/mutual": { - /** Retrieve a list of mutual friends and servers with another user. */ - get: operations["find_mutual_mutual"]; - }; - "/users/{target}/friend": { - /** Accept another user's friend request. */ - put: operations["add_friend_add"]; - /** Denies another user's friend request or removes an existing friend. */ - delete: operations["remove_friend_remove"]; - }; - "/users/{target}/block": { - /** Block another user by their id. */ - put: operations["block_user_block"]; - /** Unblock another user by their id. */ - delete: operations["unblock_user_unblock"]; - }; - "/users/friend": { - /** Send a friend request to another user. */ - post: operations["send_friend_request_send_friend_request"]; - }; - "/bots/create": { - /** Create a new Revolt bot. */ - post: operations["create_create_bot"]; - }; - "/bots/{target}/invite": { - /** Fetch details of a public (or owned) bot by its id. */ - get: operations["fetch_public_fetch_public_bot"]; - /** Invite a bot to a server or group by its id.` */ - post: operations["invite_invite_bot"]; - }; - "/bots/{bot}": { - /** Fetch details of a bot you own by its id. */ - get: operations["fetch_fetch_bot"]; - }; - "/bots/@me": { - /** Fetch all of the bots that you have control over. */ - get: operations["fetch_owned_fetch_owned_bots"]; - }; - "/bots/{target}": { - /** Delete a bot by its id. */ - delete: operations["delete_delete_bot"]; - /** Edit bot details by its id. */ - patch: operations["edit_edit_bot"]; - }; - "/channels/{target}/ack/{message}": { - /** Lets the server and all other clients know that we've seen this message id in this channel. */ - put: operations["channel_ack_ack"]; - }; - "/channels/{target}": { - /** Fetch channel by its id. */ - get: operations["channel_fetch_fetch"]; - /** Deletes a server channel, leaves a group or closes a group. */ - delete: operations["channel_delete_delete"]; - /** Edit a channel object by its id. */ - patch: operations["channel_edit_edit"]; - }; - "/channels/{target}/members": { - /** - * Retrieves all users who are part of this group. - * - * This may not return full user information if users are not friends but have mutual connections. - */ - get: operations["members_fetch_fetch_members"]; - }; - "/channels/{target}/invites": { - /** - * Creates an invite to this channel. - * - * Channel must be a `TextChannel`. - */ - post: operations["invite_create_create_invite"]; - }; - "/channels/{target}/messages": { - /** Fetch multiple messages. */ - get: operations["message_query_query"]; - /** Sends a message to the given channel. */ - post: operations["message_send_message_send"]; - }; - "/channels/{target}/search": { - /** This route searches for messages within the given parameters. */ - post: operations["message_search_search"]; - }; - "/channels/{target}/messages/{msg}/pin": { - /** Pins a message by its id. */ - post: operations["message_pin_message_pin"]; - /** Unpins a message by its id. */ - delete: operations["message_unpin_message_unpin"]; - }; - "/channels/{target}/messages/{msg}": { - /** Retrieves a message by its id. */ - get: operations["message_fetch_fetch"]; - /** Delete a message you've sent or one you have permission to delete. */ - delete: operations["message_delete_delete"]; - /** Edits a message that you've previously sent. */ - patch: operations["message_edit_edit"]; - }; - "/channels/{target}/messages/bulk": { - /** - * Delete multiple messages you've sent or one you have permission to delete. - * - * This will always require `ManageMessages` permission regardless of whether you own the message or not. - * - * Messages must have been sent within the past 1 week. - */ - delete: operations["message_bulk_delete_bulk_delete_messages"]; - }; - "/channels/create": { - /** Create a new group channel. */ - post: operations["group_create_create_group"]; - }; - "/channels/{group_id}/recipients/{member_id}": { - /** Adds another user to the group. */ - put: operations["group_add_member_add_member"]; - }; - "/channels/{target}/recipients/{member}": { - /** Removes a user from the group. */ - delete: operations["group_remove_member_remove_member"]; - }; - "/channels/{target}/join_call": { - /** Asks the voice server for a token to join the call. */ - post: operations["voice_join_call"]; - }; - "/channels/{target}/permissions/{role_id}": { - /** - * Sets permissions for the specified role in this channel. - * - * Channel must be a `TextChannel` or `VoiceChannel`. - */ - put: operations["permissions_set_set_role_permissions"]; - }; - "/channels/{target}/permissions/default": { - /** - * Sets permissions for the default role in this channel. - * - * Channel must be a `Group`, `TextChannel` or `VoiceChannel`. - */ - put: operations["permissions_set_default_set_default_permissions"]; - }; - "/channels/{target}/messages/{msg}/reactions/{emoji}": { - /** React to a given message. */ - put: operations["message_react_react_message"]; - /** - * Remove your own, someone else's or all of a given reaction. - * - * Requires `ManageMessages` if changing others' reactions. - */ - delete: operations["message_unreact_unreact_message"]; - }; - "/channels/{target}/messages/{msg}/reactions": { - /** - * Remove your own, someone else's or all of a given reaction. - * - * Requires `ManageMessages` permission. - */ - delete: operations["message_clear_reactions_clear_reactions"]; - }; - "/channels/{target}/webhooks": { - /** Creates a webhook which 3rd party platforms can use to send messages */ - post: operations["webhook_create_create_webhook"]; - }; - "/channels/{channel_id}/webhooks": { - /** Gets all webhooks inside the channel */ - get: operations["webhook_fetch_all_fetch_webhooks"]; - }; - "/servers/create": { - /** Create a new server. */ - post: operations["server_create_create_server"]; - }; - "/servers/{target}": { - /** Fetch a server by its id. */ - get: operations["server_fetch_fetch"]; - /** Deletes a server if owner otherwise leaves. */ - delete: operations["server_delete_delete"]; - /** Edit a server by its id. */ - patch: operations["server_edit_edit"]; - }; - "/servers/{target}/ack": { - /** Mark all channels in a server as read. */ - put: operations["server_ack_ack"]; - }; - "/servers/{server}/channels": { - /** Create a new Text or Voice channel. */ - post: operations["channel_create_create_server_channel"]; - }; - "/servers/{target}/members": { - /** Fetch all server members. */ - get: operations["member_fetch_all_fetch_all"]; - }; - "/servers/{target}/members/{member}": { - /** Retrieve a member. */ - get: operations["member_fetch_fetch"]; - /** Removes a member from the server. */ - delete: operations["member_remove_kick"]; - }; - "/servers/{server}/members/{target}": { - /** Edit a member by their id. */ - patch: operations["member_edit_edit"]; - }; - "/servers/{target}/members_experimental_query": { - /** Query members by a given name, this API is not stable and will be removed in the future. */ - get: operations["member_experimental_query_member_experimental_query"]; - }; - "/servers/{server}/bans/{target}": { - /** Ban a user by their id. */ - put: operations["ban_create_ban"]; - /** Remove a user's ban. */ - delete: operations["ban_remove_unban"]; - }; - "/servers/{target}/bans": { - /** Fetch all bans on a server. */ - get: operations["ban_list_list"]; - }; - "/servers/{target}/invites": { - /** Fetch all server invites. */ - get: operations["invites_fetch_invites"]; - }; - "/servers/{target}/roles": { - /** Creates a new server role. */ - post: operations["roles_create_create"]; - }; - "/servers/{target}/roles/{role_id}": { - /** Fetch a role by its id. */ - get: operations["roles_fetch_fetch"]; - /** Delete a server role by its id. */ - delete: operations["roles_delete_delete"]; - /** Edit a role by its id. */ - patch: operations["roles_edit_edit"]; - }; - "/servers/{target}/permissions/{role_id}": { - /** Sets permissions for the specified role in the server. */ - put: operations["permissions_set_set_role_permission"]; - }; - "/servers/{target}/permissions/default": { - /** Sets permissions for the default role in this server. */ - put: operations["permissions_set_default_set_default_permissions"]; - }; - "/servers/{target}/emojis": { - /** Fetch all emoji on a server. */ - get: operations["emoji_list_list_emoji"]; - }; - "/invites/{target}": { - /** Fetch an invite by its id. */ - get: operations["invite_fetch_fetch"]; - /** Join an invite by its ID */ - post: operations["invite_join_join"]; - /** Delete an invite by its id. */ - delete: operations["invite_delete_delete"]; - }; - "/custom/emoji/{id}": { - /** Create an emoji by its Autumn upload id. */ - put: operations["emoji_create_create_emoji"]; - }; - "/custom/emoji/{emoji_id}": { - /** Fetch an emoji by its id. */ - get: operations["emoji_fetch_fetch_emoji"]; - /** Delete an emoji by its id. */ - delete: operations["emoji_delete_delete_emoji"]; - }; - "/safety/report": { - /** Report a piece of content to the moderation team. */ - post: operations["report_content_report_content"]; - }; - "/auth/account/create": { - /** Create a new account. */ - post: operations["create_account_create_account"]; - }; - "/auth/account/reverify": { - /** Resend account creation verification email. */ - post: operations["resend_verification_resend_verification"]; - }; - "/auth/account/delete": { - /** Schedule an account for deletion by confirming the received token. */ - put: operations["confirm_deletion_confirm_deletion"]; - /** Request to have an account deleted. */ - post: operations["delete_account_delete_account"]; - }; - "/auth/account/": { - /** Fetch account information from the current session. */ - get: operations["fetch_account_fetch_account"]; - }; - "/auth/account/disable": { - /** Disable an account. */ - post: operations["disable_account_disable_account"]; - }; - "/auth/account/change/password": { - /** Change the current account password. */ - patch: operations["change_password_change_password"]; - }; - "/auth/account/change/email": { - /** Change the associated account email. */ - patch: operations["change_email_change_email"]; - }; - "/auth/account/verify/{code}": { - /** Verify an email address. */ - post: operations["verify_email_verify_email"]; - }; - "/auth/account/reset_password": { - /** Send an email to reset account password. */ - post: operations["send_password_reset_send_password_reset"]; - /** Confirm password reset and change the password. */ - patch: operations["password_reset_password_reset"]; - }; - "/auth/session/login": { - /** Login to an account. */ - post: operations["login_login"]; - }; - "/auth/session/logout": { - /** Delete current session. */ - post: operations["logout_logout"]; - }; - "/auth/session/all": { - /** Fetch all sessions associated with this account. */ - get: operations["fetch_all_fetch_all"]; - /** Delete all active sessions, optionally including current one. */ - delete: operations["revoke_all_revoke_all"]; - }; - "/auth/session/{id}": { - /** Delete a specific active session. */ - delete: operations["revoke_revoke"]; - /** Edit current session information. */ - patch: operations["edit_edit"]; - }; - "/auth/mfa/ticket": { - /** Create a new MFA ticket or validate an existing one. */ - put: operations["create_ticket_create_ticket"]; - }; - "/auth/mfa/": { - /** Fetch MFA status of an account. */ - get: operations["fetch_status_fetch_status"]; - }; - "/auth/mfa/recovery": { - /** Fetch recovery codes for an account. */ - post: operations["fetch_recovery_fetch_recovery"]; - /** Re-generate recovery codes for an account. */ - patch: operations["generate_recovery_generate_recovery"]; - }; - "/auth/mfa/methods": { - /** Fetch available MFA methods. */ - get: operations["get_mfa_methods_get_mfa_methods"]; - }; - "/auth/mfa/totp": { - /** Generate a new secret for TOTP. */ - put: operations["totp_enable_totp_enable"]; - /** Generate a new secret for TOTP. */ - post: operations["totp_generate_secret_totp_generate_secret"]; - /** Disable TOTP 2FA for an account. */ - delete: operations["totp_disable_totp_disable"]; - }; - "/onboard/hello": { - /** This will tell you whether the current account requires onboarding or whether you can continue to send requests as usual. You may skip calling this if you're restoring an existing session. */ - get: operations["hello_hello"]; - }; - "/onboard/complete": { - /** This sets a new username, completes onboarding and allows a user to start using Revolt. */ - post: operations["complete_complete"]; - }; - "/push/subscribe": { - /** - * Create a new Web Push subscription. - * - * If an existing subscription exists on this session, it will be removed. - */ - post: operations["subscribe_subscribe"]; - }; - "/push/unsubscribe": { - /** Remove the Web Push subscription associated with the current session. */ - post: operations["unsubscribe_unsubscribe"]; - }; - "/sync/settings/fetch": { - /** - * Fetch settings from server filtered by keys. - * - * This will return an object with the requested keys, each value is a tuple of `(timestamp, value)`, the value is the previously uploaded data. - */ - post: operations["get_settings_fetch"]; - }; - "/sync/settings/set": { - /** Upload data to save to settings. */ - post: operations["set_settings_set"]; - }; - "/sync/unreads": { - /** Fetch information about unread state on channels. */ - get: operations["get_unreads_unreads"]; - }; -} - -export interface components { - schemas: { - /** Server Configuration */ - RevoltConfig: { - /** @description Revolt API Version */ - revolt: string; - /** @description Features enabled on this Revolt node */ - features: components["schemas"]["RevoltFeatures"]; - /** @description WebSocket URL */ - ws: string; - /** @description URL pointing to the client serving this node */ - app: string; - /** @description Web Push VAPID public key */ - vapid: string; - /** @description Build information */ - build: components["schemas"]["BuildInformation"]; - }; - /** Feature Configuration */ - RevoltFeatures: { - /** @description hCaptcha configuration */ - captcha: components["schemas"]["CaptchaFeature"]; - /** @description Whether email verification is enabled */ - email: boolean; - /** @description Whether this server is invite only */ - invite_only: boolean; - /** @description File server service configuration */ - autumn: components["schemas"]["Feature"]; - /** @description Proxy service configuration */ - january: components["schemas"]["Feature"]; - /** @description Voice server configuration */ - voso: components["schemas"]["VoiceFeature"]; - }; - /** hCaptcha Configuration */ - CaptchaFeature: { - /** @description Whether captcha is enabled */ - enabled: boolean; - /** @description Client key used for solving captcha */ - key: string; - }; - /** Generic Service Configuration */ - Feature: { - /** @description Whether the service is enabled */ - enabled: boolean; - /** @description URL pointing to the service */ - url: string; - }; - /** Voice Server Configuration */ - VoiceFeature: { - /** @description Whether voice is enabled */ - enabled: boolean; - /** @description URL pointing to the voice API */ - url: string; - /** @description URL pointing to the voice WebSocket server */ - ws: string; - }; - /** Build Information */ - BuildInformation: { - /** @description Commit Hash */ - commit_sha: string; - /** @description Commit Timestamp */ - commit_timestamp: string; - /** @description Git Semver */ - semver: string; - /** @description Git Origin URL */ - origin_url: string; - /** @description Build Timestamp */ - timestamp: string; - }; - /** - * Error - * @description Error information - */ - Error: ( - | { - /** @enum {string} */ - type: "LabelMe"; - } - | { - /** @enum {string} */ - type: "AlreadyOnboarded"; - } - | { - /** @enum {string} */ - type: "UsernameTaken"; - } - | { - /** @enum {string} */ - type: "InvalidUsername"; - } - | { - /** @enum {string} */ - type: "DiscriminatorChangeRatelimited"; - } - | { - /** @enum {string} */ - type: "UnknownUser"; - } - | { - /** @enum {string} */ - type: "AlreadyFriends"; - } - | { - /** @enum {string} */ - type: "AlreadySentRequest"; - } - | { - /** @enum {string} */ - type: "Blocked"; - } - | { - /** @enum {string} */ - type: "BlockedByOther"; - } - | { - /** @enum {string} */ - type: "NotFriends"; - } - | { - /** @enum {string} */ - type: "TooManyPendingFriendRequests"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "UnknownChannel"; - } - | { - /** @enum {string} */ - type: "UnknownAttachment"; - } - | { - /** @enum {string} */ - type: "UnknownMessage"; - } - | { - /** @enum {string} */ - type: "CannotEditMessage"; - } - | { - /** @enum {string} */ - type: "CannotJoinCall"; - } - | { - /** @enum {string} */ - type: "TooManyAttachments"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "TooManyEmbeds"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "TooManyReplies"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "TooManyChannels"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "EmptyMessage"; - } - | { - /** @enum {string} */ - type: "PayloadTooLarge"; - } - | { - /** @enum {string} */ - type: "CannotRemoveYourself"; - } - | { - /** @enum {string} */ - type: "GroupTooLarge"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "AlreadyInGroup"; - } - | { - /** @enum {string} */ - type: "NotInGroup"; - } - | { - /** @enum {string} */ - type: "AlreadyPinned"; - } - | { - /** @enum {string} */ - type: "NotPinned"; - } - | { - /** @enum {string} */ - type: "UnknownServer"; - } - | { - /** @enum {string} */ - type: "InvalidRole"; - } - | { - /** @enum {string} */ - type: "Banned"; - } - | { - /** @enum {string} */ - type: "TooManyServers"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "TooManyEmoji"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "TooManyRoles"; - /** Format: uint */ - max: number; - } - | { - /** @enum {string} */ - type: "AlreadyInServer"; - } - | { - /** @enum {string} */ - type: "ReachedMaximumBots"; - } - | { - /** @enum {string} */ - type: "IsBot"; - } - | { - /** @enum {string} */ - type: "BotIsPrivate"; - } - | { - /** @enum {string} */ - type: "CannotReportYourself"; - } - | { - /** @enum {string} */ - type: "MissingPermission"; - permission: string; - } - | { - /** @enum {string} */ - type: "MissingUserPermission"; - permission: string; - } - | { - /** @enum {string} */ - type: "NotElevated"; - } - | { - /** @enum {string} */ - type: "NotPrivileged"; - } - | { - /** @enum {string} */ - type: "CannotGiveMissingPermissions"; - } - | { - /** @enum {string} */ - type: "NotOwner"; - } - | { - /** @enum {string} */ - type: "DatabaseError"; - operation: string; - collection: string; - } - | { - /** @enum {string} */ - type: "InternalError"; - } - | { - /** @enum {string} */ - type: "InvalidOperation"; - } - | { - /** @enum {string} */ - type: "InvalidCredentials"; - } - | { - /** @enum {string} */ - type: "InvalidProperty"; - } - | { - /** @enum {string} */ - type: "InvalidSession"; - } - | { - /** @enum {string} */ - type: "DuplicateNonce"; - } - | { - /** @enum {string} */ - type: "NotFound"; - } - | { - /** @enum {string} */ - type: "NoEffect"; - } - | { - /** @enum {string} */ - type: "FailedValidation"; - error: string; - } - | { - /** @enum {string} */ - type: "ProxyError"; - } - | { - /** @enum {string} */ - type: "VosoUnavailable"; - } - ) & { - /** @description Where this error occurred */ - location: string; - }; - /** @description User */ - User: { - /** @description Unique Id */ - _id: string; - /** @description Username */ - username: string; - /** @description Discriminator */ - discriminator: string; - /** @description Display name */ - display_name?: string | null; - /** @description Avatar attachment */ - avatar?: components["schemas"]["File"] | null; - /** @description Relationships with other users */ - relations?: components["schemas"]["Relationship"][]; - /** - * Format: uint32 - * @description Bitfield of user badges - * - * https://docs.rs/revolt-models/latest/revolt_models/v0/enum.UserBadges.html - */ - badges?: number; - /** @description User's current status */ - status?: components["schemas"]["UserStatus"] | null; - /** - * Format: uint32 - * @description Enum of user flags - * - * https://docs.rs/revolt-models/latest/revolt_models/v0/enum.UserFlags.html - */ - flags?: number; - /** @description Whether this user is privileged */ - privileged?: boolean; - /** @description Bot information */ - bot?: components["schemas"]["BotInformation"] | null; - /** @description Current session user's relationship with this user */ - relationship: components["schemas"]["RelationshipStatus"]; - /** @description Whether this user is currently online */ - online: boolean; - }; - /** @description File */ - File: { - /** @description Unique Id */ - _id: string; - /** @description Tag / bucket this file was uploaded to */ - tag: string; - /** @description Original filename */ - filename: string; - /** @description Parsed metadata of this file */ - metadata: components["schemas"]["Metadata"]; - /** @description Raw content type of this file */ - content_type: string; - /** - * Format: int - * @description Size of this file (in bytes) - */ - size: number; - /** @description Whether this file was deleted */ - deleted?: boolean | null; - /** @description Whether this file was reported */ - reported?: boolean | null; - message_id?: string | null; - user_id?: string | null; - server_id?: string | null; - /** @description Id of the object this file is associated with */ - object_id?: string | null; - }; - /** @description Metadata associated with a file */ - Metadata: - | { - /** @enum {string} */ - type: "File"; - } - | { - /** @enum {string} */ - type: "Text"; - } - | { - /** @enum {string} */ - type: "Image"; - /** Format: uint */ - width: number; - /** Format: uint */ - height: number; - } - | { - /** @enum {string} */ - type: "Video"; - /** Format: uint */ - width: number; - /** Format: uint */ - height: number; - } - | { - /** @enum {string} */ - type: "Audio"; - }; - /** @description Relationship entry indicating current status with other user */ - Relationship: { - /** @description Other user's Id */ - _id: string; - /** @description Relationship status with them */ - status: components["schemas"]["RelationshipStatus"]; - }; - /** - * @description User's relationship with another user (or themselves) - * @enum {string} - */ - RelationshipStatus: - | "None" - | "User" - | "Friend" - | "Outgoing" - | "Incoming" - | "Blocked" - | "BlockedOther"; - /** @description User's active status */ - UserStatus: { - /** @description Custom status text */ - text?: string | null; - /** @description Current presence option */ - presence?: components["schemas"]["Presence"] | null; - }; - /** - * @description Presence status - * @enum {string} - */ - Presence: "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; - /** @description Bot information for if the user is a bot */ - BotInformation: { - /** @description Id of the owner of this bot */ - owner: string; - }; - Id: string; - /** @description User flag reponse */ - FlagResponse: { - /** - * Format: int32 - * @description Flags - */ - flags: number; - }; - /** @description New user information */ - DataEditUser: { - /** @description New display name */ - display_name?: string | null; - /** @description Attachment Id for avatar */ - avatar?: string | null; - /** @description New user status */ - status?: components["schemas"]["UserStatus"] | null; - /** - * @description New user profile data - * - * This is applied as a partial. - */ - profile?: components["schemas"]["DataUserProfile"] | null; - /** - * Format: int32 - * @description Bitfield of user badges - */ - badges?: number | null; - /** - * Format: int32 - * @description Enum of user flags - */ - flags?: number | null; - /** @description Fields to remove from user object */ - remove?: components["schemas"]["FieldsUser"][] | null; - }; - /** @description New user profile data */ - DataUserProfile: { - /** @description Text to set as user profile description */ - content?: string | null; - /** @description Attachment Id for background */ - background?: string | null; - }; - /** - * @description Optional fields on user object - * @enum {string} - */ - FieldsUser: - | "Avatar" - | "StatusText" - | "StatusPresence" - | "ProfileContent" - | "ProfileBackground" - | "DisplayName" - | "Internal"; - /** Username Information */ - DataChangeUsername: { - /** @description New username */ - username: string; - /** @description Current account password */ - password: string; - }; - /** @description User's profile */ - UserProfile: { - /** @description Text content on user's profile */ - content?: string | null; - /** @description Background visible on user's profile */ - background?: components["schemas"]["File"] | null; - }; - /** @description Channel */ - Channel: - | { - /** @enum {string} */ - channel_type: "SavedMessages"; - /** @description Unique Id */ - _id: string; - /** @description Id of the user this channel belongs to */ - user: string; - } - | { - /** @enum {string} */ - channel_type: "DirectMessage"; - /** @description Unique Id */ - _id: string; - /** @description Whether this direct message channel is currently open on both sides */ - active: boolean; - /** @description 2-tuple of user ids participating in direct message */ - recipients: string[]; - /** @description Id of the last message sent in this channel */ - last_message_id?: string | null; - } - | { - /** @enum {string} */ - channel_type: "Group"; - /** @description Unique Id */ - _id: string; - /** @description Display name of the channel */ - name: string; - /** @description User id of the owner of the group */ - owner: string; - /** @description Channel description */ - description?: string | null; - /** @description Array of user ids participating in channel */ - recipients: string[]; - /** @description Custom icon attachment */ - icon?: components["schemas"]["File"] | null; - /** @description Id of the last message sent in this channel */ - last_message_id?: string | null; - /** - * Format: int64 - * @description Permissions assigned to members of this group (does not apply to the owner of the group) - */ - permissions?: number | null; - /** @description Whether this group is marked as not safe for work */ - nsfw?: boolean; - } - | { - /** @enum {string} */ - channel_type: "TextChannel"; - /** @description Unique Id */ - _id: string; - /** @description Id of the server this channel belongs to */ - server: string; - /** @description Display name of the channel */ - name: string; - /** @description Channel description */ - description?: string | null; - /** @description Custom icon attachment */ - icon?: components["schemas"]["File"] | null; - /** @description Id of the last message sent in this channel */ - last_message_id?: string | null; - /** @description Default permissions assigned to users in this channel */ - default_permissions?: components["schemas"]["OverrideField"] | null; - /** @description Permissions assigned based on role to this channel */ - role_permissions?: { - [key: string]: components["schemas"]["OverrideField"]; - }; - /** @description Whether this channel is marked as not safe for work */ - nsfw?: boolean; - } - | { - /** @enum {string} */ - channel_type: "VoiceChannel"; - /** @description Unique Id */ - _id: string; - /** @description Id of the server this channel belongs to */ - server: string; - /** @description Display name of the channel */ - name: string; - /** @description Channel description */ - description?: string | null; - /** @description Custom icon attachment */ - icon?: components["schemas"]["File"] | null; - /** @description Default permissions assigned to users in this channel */ - default_permissions?: components["schemas"]["OverrideField"] | null; - /** @description Permissions assigned based on role to this channel */ - role_permissions?: { - [key: string]: components["schemas"]["OverrideField"]; - }; - /** @description Whether this channel is marked as not safe for work */ - nsfw?: boolean; - }; - /** @description Representation of a single permission override as it appears on models and in the database */ - OverrideField: { - /** - * Format: int64 - * @description Allow bit flags - */ - a: number; - /** - * Format: int64 - * @description Disallow bit flags - */ - d: number; - }; - /** @description Mutual friends and servers response */ - MutualResponse: { - /** @description Array of mutual user IDs that both users are friends with */ - users: string[]; - /** @description Array of mutual server IDs that both users are in */ - servers: string[]; - }; - /** @description User lookup information */ - DataSendFriendRequest: { - /** @description Username and discriminator combo separated by # */ - username: string; - }; - /** @description Bot with user response */ - BotWithUserResponse: { - user: components["schemas"]["User"]; - /** @description Bot Id */ - _id: string; - /** @description User Id of the bot owner */ - owner: string; - /** @description Token used to authenticate requests for this bot */ - token: string; - /** @description Whether the bot is public (may be invited by anyone) */ - public: boolean; - /** @description Whether to enable analytics */ - analytics?: boolean; - /** @description Whether this bot should be publicly discoverable */ - discoverable?: boolean; - /** @description Reserved; URL for handling interactions */ - interactions_url?: string; - /** @description URL for terms of service */ - terms_of_service_url?: string; - /** @description URL for privacy policy */ - privacy_policy_url?: string; - /** - * Format: uint32 - * @description Enum of bot flags - */ - flags?: number; - }; - /** @description Bot Details */ - DataCreateBot: { - /** @description Bot username */ - name: string; - }; - /** @description Where we are inviting a bot to */ - InviteBotDestination: - | { - /** @description Server Id */ - server: string; - } - | { - /** @description Group Id */ - group: string; - }; - /** @description Public Bot */ - PublicBot: { - /** @description Bot Id */ - _id: string; - /** @description Bot Username */ - username: string; - /** @description Profile Avatar */ - avatar?: string; - /** @description Profile Description */ - description?: string; - }; - /** @description Bot Response */ - FetchBotResponse: { - /** @description Bot object */ - bot: components["schemas"]["Bot"]; - /** @description User object */ - user: components["schemas"]["User"]; - }; - /** @description Bot */ - Bot: { - /** @description Bot Id */ - _id: string; - /** @description User Id of the bot owner */ - owner: string; - /** @description Token used to authenticate requests for this bot */ - token: string; - /** @description Whether the bot is public (may be invited by anyone) */ - public: boolean; - /** @description Whether to enable analytics */ - analytics?: boolean; - /** @description Whether this bot should be publicly discoverable */ - discoverable?: boolean; - /** @description Reserved; URL for handling interactions */ - interactions_url?: string; - /** @description URL for terms of service */ - terms_of_service_url?: string; - /** @description URL for privacy policy */ - privacy_policy_url?: string; - /** - * Format: uint32 - * @description Enum of bot flags - */ - flags?: number; - }; - /** - * @description Owned Bots Response - * - * Both lists are sorted by their IDs. - * - * TODO: user should be in bot object - */ - OwnedBotsResponse: { - /** @description Bot objects */ - bots: components["schemas"]["Bot"][]; - /** @description User objects */ - users: components["schemas"]["User"][]; - }; - /** @description New Bot Details */ - DataEditBot: { - /** @description Bot username */ - name?: string | null; - /** @description Whether the bot can be added by anyone */ - public?: boolean | null; - /** - * @description Whether analytics should be gathered for this bot - * - * Must be enabled in order to show up on [Revolt Discover](https://rvlt.gg). - */ - analytics?: boolean | null; - /** @description Interactions URL */ - interactions_url?: string | null; - /** @description Fields to remove from bot object */ - remove?: components["schemas"]["FieldsBot"][] | null; - }; - /** - * @description Optional fields on bot object - * @enum {string} - */ - FieldsBot: "Token" | "InteractionsURL"; - /** @description New webhook information */ - DataEditChannel: { - /** @description Channel name */ - name?: string | null; - /** @description Channel description */ - description?: string | null; - /** @description Group owner */ - owner?: string | null; - /** - * @description Icon - * - * Provide an Autumn attachment Id. - */ - icon?: string | null; - /** @description Whether this channel is age-restricted */ - nsfw?: boolean | null; - /** @description Whether this channel is archived */ - archived?: boolean | null; - /** @description Fields to remove from channel */ - remove?: components["schemas"]["FieldsChannel"][] | null; - }; - /** - * @description Optional fields on channel object - * @enum {string} - */ - FieldsChannel: "Description" | "Icon" | "DefaultPermissions"; - /** @description Invite */ - Invite: - | { - /** @enum {string} */ - type: "Server"; - /** @description Invite code */ - _id: string; - /** @description Id of the server this invite points to */ - server: string; - /** @description Id of user who created this invite */ - creator: string; - /** @description Id of the server channel this invite points to */ - channel: string; - } - | { - /** @enum {string} */ - type: "Group"; - /** @description Invite code */ - _id: string; - /** @description Id of user who created this invite */ - creator: string; - /** @description Id of the group channel this invite points to */ - channel: string; - }; - /** @description Message */ - Message: { - /** @description Unique Id */ - _id: string; - /** @description Unique value generated by client sending this message */ - nonce?: string | null; - /** @description Id of the channel this message was sent in */ - channel: string; - /** @description Id of the user or webhook that sent this message */ - author: string; - /** @description The user that sent this message */ - user?: components["schemas"]["User"] | null; - /** @description The member that sent this message */ - member?: components["schemas"]["Member"] | null; - /** @description The webhook that sent this message */ - webhook?: components["schemas"]["MessageWebhook"] | null; - /** @description Message content */ - content?: string | null; - /** @description System message */ - system?: components["schemas"]["SystemMessage"] | null; - /** @description Array of attachments */ - attachments?: components["schemas"]["File"][] | null; - /** @description Time at which this message was last edited */ - edited?: components["schemas"]["ISO8601 Timestamp"] | null; - /** @description Attached embeds to this message */ - embeds?: components["schemas"]["Embed"][] | null; - /** @description Array of user ids mentioned in this message */ - mentions?: string[] | null; - /** @description Array of message ids this message is replying to */ - replies?: string[] | null; - /** @description Hashmap of emoji IDs to array of user IDs */ - reactions?: { [key: string]: string[] }; - /** @description Information about how this message should be interacted with */ - interactions?: components["schemas"]["Interactions"]; - /** @description Name and / or avatar overrides for this message */ - masquerade?: components["schemas"]["Masquerade"] | null; - /** @description Whether or not the message in pinned */ - pinned?: boolean | null; - /** - * Format: uint32 - * @description Bitfield of message flags - * - * https://docs.rs/revolt-models/latest/revolt_models/v0/enum.MessageFlags.html - */ - flags?: number; - }; - /** @description Server Member */ - Member: { - /** @description Unique member id */ - _id: components["schemas"]["MemberCompositeKey"]; - /** @description Time at which this user joined the server */ - joined_at: components["schemas"]["ISO8601 Timestamp"]; - /** @description Member's nickname */ - nickname?: string | null; - /** @description Avatar attachment */ - avatar?: components["schemas"]["File"] | null; - /** @description Member's roles */ - roles?: string[]; - /** @description Timestamp this member is timed out until */ - timeout?: components["schemas"]["ISO8601 Timestamp"] | null; - }; - /** @description Composite primary key consisting of server and user id */ - MemberCompositeKey: { - /** @description Server Id */ - server: string; - /** @description User Id */ - user: string; - }; - /** - * Format: date-time - * @description ISO8601 formatted timestamp - * @example 1970-01-01T00:00:00Z - */ - "ISO8601 Timestamp": string; - /** @description Information about the webhook bundled with Message */ - MessageWebhook: { - name: string; - avatar?: string | null; - }; - /** @description System Event */ - SystemMessage: - | { - /** @enum {string} */ - type: "text"; - content: string; - } - | { - /** @enum {string} */ - type: "user_added"; - id: string; - by: string; - } - | { - /** @enum {string} */ - type: "user_remove"; - id: string; - by: string; - } - | { - /** @enum {string} */ - type: "user_joined"; - id: string; - } - | { - /** @enum {string} */ - type: "user_left"; - id: string; - } - | { - /** @enum {string} */ - type: "user_kicked"; - id: string; - } - | { - /** @enum {string} */ - type: "user_banned"; - id: string; - } - | { - /** @enum {string} */ - type: "channel_renamed"; - name: string; - by: string; - } - | { - /** @enum {string} */ - type: "channel_description_changed"; - by: string; - } - | { - /** @enum {string} */ - type: "channel_icon_changed"; - by: string; - } - | { - /** @enum {string} */ - type: "channel_ownership_changed"; - from: string; - to: string; - } - | { - /** @enum {string} */ - type: "message_pinned"; - id: string; - by: string; - } - | { - /** @enum {string} */ - type: "message_unpinned"; - id: string; - by: string; - }; - /** @description Embed */ - Embed: - | { - /** @enum {string} */ - type: "Website"; - /** @description Direct URL to web page */ - url?: string | null; - /** @description Original direct URL */ - original_url?: string | null; - /** @description Remote content */ - special?: components["schemas"]["Special"] | null; - /** @description Title of website */ - title?: string | null; - /** @description Description of website */ - description?: string | null; - /** @description Embedded image */ - image?: components["schemas"]["Image"] | null; - /** @description Embedded video */ - video?: components["schemas"]["Video"] | null; - /** @description Site name */ - site_name?: string | null; - /** @description URL to site icon */ - icon_url?: string | null; - /** @description CSS Colour */ - colour?: string | null; - } - | { - /** @enum {string} */ - type: "Image"; - /** @description URL to the original image */ - url: string; - /** - * Format: int - * @description Width of the image - */ - width: number; - /** - * Format: int - * @description Height of the image - */ - height: number; - /** @description Positioning and size */ - size: components["schemas"]["ImageSize"]; - } - | { - /** @enum {string} */ - type: "Video"; - /** @description URL to the original video */ - url: string; - /** - * Format: int - * @description Width of the video - */ - width: number; - /** - * Format: int - * @description Height of the video - */ - height: number; - } - | { - /** @enum {string} */ - type: "Text"; - /** @description URL to icon */ - icon_url?: string | null; - /** @description URL for title */ - url?: string | null; - /** @description Title of text embed */ - title?: string | null; - /** @description Description of text embed */ - description?: string | null; - /** @description ID of uploaded autumn file */ - media?: components["schemas"]["File"] | null; - /** @description CSS Colour */ - colour?: string | null; - } - | { - /** @enum {string} */ - type: "None"; - }; - /** @description Information about special remote content */ - Special: - | { - /** @enum {string} */ - type: "None"; - } - | { - /** @enum {string} */ - type: "GIF"; - } - | { - /** @enum {string} */ - type: "YouTube"; - id: string; - timestamp?: string | null; - } - | { - /** @enum {string} */ - type: "Lightspeed"; - content_type: components["schemas"]["LightspeedType"]; - id: string; - } - | { - /** @enum {string} */ - type: "Twitch"; - content_type: components["schemas"]["TwitchType"]; - id: string; - } - | { - /** @enum {string} */ - type: "Spotify"; - content_type: string; - id: string; - } - | { - /** @enum {string} */ - type: "Soundcloud"; - } - | { - /** @enum {string} */ - type: "Bandcamp"; - content_type: components["schemas"]["BandcampType"]; - id: string; - } - | { - /** @enum {string} */ - type: "AppleMusic"; - album_id: string; - track_id?: string | null; - } - | { - /** @enum {string} */ - type: "Streamable"; - id: string; - }; - /** - * @description Type of remote Lightspeed.tv content - * @enum {string} - */ - LightspeedType: "Channel"; - /** - * @description Type of remote Twitch content - * @enum {string} - */ - TwitchType: "Channel" | "Video" | "Clip"; - /** - * @description Type of remote Bandcamp content - * @enum {string} - */ - BandcampType: "Album" | "Track"; - /** @description Image */ - Image: { - /** @description URL to the original image */ - url: string; - /** - * Format: int - * @description Width of the image - */ - width: number; - /** - * Format: int - * @description Height of the image - */ - height: number; - /** @description Positioning and size */ - size: components["schemas"]["ImageSize"]; - }; - /** - * @description Image positioning and size - * @enum {string} - */ - ImageSize: "Large" | "Preview"; - /** @description Video */ - Video: { - /** @description URL to the original video */ - url: string; - /** - * Format: int - * @description Width of the video - */ - width: number; - /** - * Format: int - * @description Height of the video - */ - height: number; - }; - /** @description Information to guide interactions on this message */ - Interactions: { - /** @description Reactions which should always appear and be distinct */ - reactions?: string[] | null; - /** - * @description Whether reactions should be restricted to the given list - * - * Can only be set to true if reactions list is of at least length 1 - */ - restrict_reactions?: boolean; - }; - /** @description Name and / or avatar override information */ - Masquerade: { - /** @description Replace the display name shown on this message */ - name?: string | null; - /** @description Replace the avatar shown on this message (URL to image file) */ - avatar?: string | null; - /** - * @description Replace the display role colour shown on this message - * - * Must have `ManageRole` permission to use - */ - colour?: string | null; - }; - /** @description Message to send */ - DataMessageSend: { - /** - * @description Unique token to prevent duplicate message sending - * - * **This is deprecated and replaced by `Idempotency-Key`!** - */ - nonce?: string | null; - /** @description Message content to send */ - content?: string | null; - /** @description Attachments to include in message */ - attachments?: string[] | null; - /** @description Messages to reply to */ - replies?: components["schemas"]["ReplyIntent"][] | null; - /** - * @description Embeds to include in message - * - * Text embed content contributes to the content length cap - */ - embeds?: components["schemas"]["SendableEmbed"][] | null; - /** @description Masquerade to apply to this message */ - masquerade?: components["schemas"]["Masquerade"] | null; - /** @description Information about how this message should be interacted with */ - interactions?: components["schemas"]["Interactions"] | null; - /** - * Format: uint32 - * @description Bitfield of message flags - * - * https://docs.rs/revolt-models/latest/revolt_models/v0/enum.MessageFlags.html - */ - flags?: number | null; - }; - /** @description What this message should reply to and how */ - ReplyIntent: { - /** @description Message Id */ - id: string; - /** @description Whether this reply should mention the message's author */ - mention: boolean; - }; - /** @description Representation of a text embed before it is sent. */ - SendableEmbed: { - icon_url?: string | null; - url?: string | null; - title?: string | null; - description?: string | null; - media?: string | null; - colour?: string | null; - }; - /** @description Bulk Message Response */ - BulkMessageResponse: - | components["schemas"]["Message"][] - | { - /** @description List of messages */ - messages: components["schemas"]["Message"][]; - /** @description List of users */ - users: components["schemas"]["User"][]; - /** @description List of members */ - members?: components["schemas"]["Member"][] | null; - }; - /** - * @description Message Sort - * - * Sort used for retrieving messages - * @enum {string} - */ - MessageSort: "Relevance" | "Latest" | "Oldest"; - /** @description Options for searching for messages */ - DataMessageSearch: { - /** - * @description Full-text search query - * - * See [MongoDB documentation](https://docs.mongodb.com/manual/text-search/#-text-operator) for more information. - */ - query?: string | null; - /** @description Whether to only search for pinned messages, cannot be sent with `query`. */ - pinned?: boolean | null; - /** - * Format: int64 - * @description Maximum number of messages to fetch - */ - limit?: number | null; - /** @description Message id before which messages should be fetched */ - before?: string | null; - /** @description Message id after which messages should be fetched */ - after?: string | null; - /** - * @description Message sort direction - * - * By default, it will be sorted by latest. - * @default Relevance - */ - sort?: components["schemas"]["MessageSort"]; - /** @description Whether to include user (and member, if server channel) objects */ - include_users?: boolean | null; - }; - /** @description Changes to make to message */ - DataEditMessage: { - /** @description New message content */ - content?: string | null; - /** @description Embeds to include in the message */ - embeds?: components["schemas"]["SendableEmbed"][] | null; - }; - /** @description Options for bulk deleting messages */ - OptionsBulkDelete: { - /** @description Message IDs */ - ids: string[]; - }; - /** @description Create new group */ - DataCreateGroup: { - /** @description Group name */ - name: string; - /** @description Group description */ - description?: string | null; - /** @description Group icon */ - icon?: string | null; - /** - * @description Array of user IDs to add to the group - * - * Must be friends with these users. - * @default - */ - users?: string[]; - /** @description Whether this group is age-restricted */ - nsfw?: boolean | null; - }; - /** @description Voice server token response */ - LegacyCreateVoiceUserResponse: { - /** @description Token for authenticating with the voice server */ - token: string; - }; - /** @description New role permissions */ - DataSetRolePermissions: { - /** @description Allow / deny values to set for this role */ - permissions: components["schemas"]["Override"]; - }; - /** @description Representation of a single permission override */ - Override: { - /** - * Format: uint64 - * @description Allow bit flags - */ - allow: number; - /** - * Format: uint64 - * @description Disallow bit flags - */ - deny: number; - }; - /** @description New default permissions */ - DataDefaultChannelPermissions: - | { - /** - * Format: uint64 - * @description Permission values to set for members in a `Group` - */ - permissions: number; - } - | { - /** @description Allow / deny values to set for members in this `TextChannel` or `VoiceChannel` */ - permissions: components["schemas"]["Override"]; - }; - /** @description Webhook */ - Webhook: { - /** @description Webhook Id */ - id: string; - /** @description The name of the webhook */ - name: string; - /** @description The avatar of the webhook */ - avatar?: components["schemas"]["File"] | null; - /** @description The channel this webhook belongs to */ - channel_id: string; - /** - * Format: uint64 - * @description The permissions for the webhook - */ - permissions: number; - /** @description The private token for the webhook */ - token?: string | null; - }; - /** @description Information for the webhook */ - CreateWebhookBody: { - name: string; - avatar?: string | null; - }; - /** @description Information returned when creating server */ - CreateServerLegacyResponse: { - /** @description Server object */ - server: components["schemas"]["Server"]; - /** @description Default channels */ - channels: components["schemas"]["Channel"][]; - }; - /** @description Server */ - Server: { - /** @description Unique Id */ - _id: string; - /** @description User id of the owner */ - owner: string; - /** @description Name of the server */ - name: string; - /** @description Description for the server */ - description?: string | null; - /** @description Channels within this server */ - channels: string[]; - /** @description Categories for this server */ - categories?: components["schemas"]["Category"][] | null; - /** @description Configuration for sending system event messages */ - system_messages?: components["schemas"]["SystemMessageChannels"] | null; - /** @description Roles for this server */ - roles?: { [key: string]: components["schemas"]["Role"] }; - /** - * Format: int64 - * @description Default set of server and channel permissions - */ - default_permissions: number; - /** @description Icon attachment */ - icon?: components["schemas"]["File"] | null; - /** @description Banner attachment */ - banner?: components["schemas"]["File"] | null; - /** - * Format: uint32 - * @description Bitfield of server flags - */ - flags?: number; - /** @description Whether this server is flagged as not safe for work */ - nsfw?: boolean; - /** @description Whether to enable analytics */ - analytics?: boolean; - /** @description Whether this server should be publicly discoverable */ - discoverable?: boolean; - }; - /** @description Channel category */ - Category: { - /** @description Unique ID for this category */ - id: string; - /** @description Title for this category */ - title: string; - /** @description Channels in this category */ - channels: string[]; - }; - /** @description System message channel assignments */ - SystemMessageChannels: { - /** @description ID of channel to send user join messages in */ - user_joined?: string | null; - /** @description ID of channel to send user left messages in */ - user_left?: string | null; - /** @description ID of channel to send user kicked messages in */ - user_kicked?: string | null; - /** @description ID of channel to send user banned messages in */ - user_banned?: string | null; - }; - /** @description Role */ - Role: { - /** @description Role name */ - name: string; - /** @description Permissions available to this role */ - permissions: components["schemas"]["OverrideField"]; - /** - * @description Colour used for this role - * - * This can be any valid CSS colour - */ - colour?: string | null; - /** @description Whether this role should be shown separately on the member sidebar */ - hoist?: boolean; - /** - * Format: int64 - * @description Ranking of this role - */ - rank?: number; - }; - /** @description Information about new server to create */ - DataCreateServer: { - /** @description Server name */ - name: string; - /** @description Server description */ - description?: string | null; - /** @description Whether this server is age-restricted */ - nsfw?: boolean | null; - }; - /** @description Fetch server information */ - FetchServerResponse: - | components["schemas"]["Server"] - | { - /** @description Channels within this server */ - channels: string[]; - /** @description Unique Id */ - _id: string; - /** @description User id of the owner */ - owner: string; - /** @description Name of the server */ - name: string; - /** @description Description for the server */ - description?: string | null; - /** @description Categories for this server */ - categories?: components["schemas"]["Category"][] | null; - /** @description Configuration for sending system event messages */ - system_messages?: - | components["schemas"]["SystemMessageChannels"] - | null; - /** @description Roles for this server */ - roles?: { [key: string]: components["schemas"]["Role"] }; - /** - * Format: int64 - * @description Default set of server and channel permissions - */ - default_permissions: number; - /** @description Icon attachment */ - icon?: components["schemas"]["File"] | null; - /** @description Banner attachment */ - banner?: components["schemas"]["File"] | null; - /** - * Format: uint32 - * @description Bitfield of server flags - */ - flags?: number; - /** @description Whether this server is flagged as not safe for work */ - nsfw?: boolean; - /** @description Whether to enable analytics */ - analytics?: boolean; - /** @description Whether this server should be publicly discoverable */ - discoverable?: boolean; - }; - /** @description New server information */ - DataEditServer: { - /** @description Server name */ - name?: string | null; - /** @description Server description */ - description?: string | null; - /** @description Attachment Id for icon */ - icon?: string | null; - /** @description Attachment Id for banner */ - banner?: string | null; - /** @description Category structure for server */ - categories?: components["schemas"]["Category"][] | null; - /** @description System message configuration */ - system_messages?: components["schemas"]["SystemMessageChannels"] | null; - /** - * Format: int32 - * @description Bitfield of server flags - */ - flags?: number | null; - /** @description Whether this server is public and should show up on [Revolt Discover](https://rvlt.gg) */ - discoverable?: boolean | null; - /** - * @description Whether analytics should be collected for this server - * - * Must be enabled in order to show up on [Revolt Discover](https://rvlt.gg). - */ - analytics?: boolean | null; - /** @description Fields to remove from server object */ - remove?: components["schemas"]["FieldsServer"][] | null; - }; - /** - * @description Optional fields on server object - * @enum {string} - */ - FieldsServer: - | "Description" - | "Categories" - | "SystemMessages" - | "Icon" - | "Banner"; - /** @description Create new server channel */ - DataCreateServerChannel: { - /** - * @description Channel type - * @default Text - */ - type?: components["schemas"]["LegacyServerChannelType"]; - /** @description Channel name */ - name: string; - /** @description Channel description */ - description?: string | null; - /** @description Whether this channel is age restricted */ - nsfw?: boolean | null; - }; - /** - * @description Server Channel Type - * @enum {string} - */ - LegacyServerChannelType: "Text" | "Voice"; - /** @description Response with all members */ - AllMemberResponse: { - /** @description List of members */ - members: components["schemas"]["Member"][]; - /** @description List of users */ - users: components["schemas"]["User"][]; - }; - /** @description Member response */ - MemberResponse: - | components["schemas"]["Member"] - | { - member: components["schemas"]["Member"]; - roles: { [key: string]: components["schemas"]["Role"] }; - }; - /** @description New member information */ - DataMemberEdit: { - /** @description Member nickname */ - nickname?: string | null; - /** @description Attachment Id to set for avatar */ - avatar?: string | null; - /** @description Array of role ids */ - roles?: string[] | null; - /** @description Timestamp this member is timed out until */ - timeout?: components["schemas"]["ISO8601 Timestamp"] | null; - /** @description Fields to remove from channel object */ - remove?: components["schemas"]["FieldsMember"][] | null; - }; - /** - * @description Optional fields on server member object - * @enum {string} - */ - FieldsMember: "Nickname" | "Avatar" | "Roles" | "Timeout"; - /** Query members by name */ - MemberQueryResponse: { - /** @description List of members */ - members: components["schemas"]["Member"][]; - /** @description List of users */ - users: components["schemas"]["User"][]; - }; - /** @description Server Ban */ - ServerBan: { - /** @description Unique member id */ - _id: components["schemas"]["MemberCompositeKey"]; - /** @description Reason for ban creation */ - reason?: string | null; - }; - /** @description Information for new server ban */ - DataBanCreate: { - /** @description Ban reason */ - reason?: string | null; - }; - /** @description Ban list result */ - BanListResult: { - /** @description Users objects */ - users: components["schemas"]["BannedUser"][]; - /** @description Ban objects */ - bans: components["schemas"]["ServerBan"][]; - }; - /** @description Just enough information to list a ban */ - BannedUser: { - /** @description Id of the banned user */ - _id: string; - /** @description Username of the banned user */ - username: string; - /** @description Discriminator of the banned user */ - discriminator: string; - /** @description Avatar of the banned user */ - avatar?: components["schemas"]["File"] | null; - }; - /** @description Response after creating new role */ - NewRoleResponse: { - /** @description Id of the role */ - id: string; - /** @description New role */ - role: components["schemas"]["Role"]; - }; - /** @description Information about new role to create */ - DataCreateRole: { - /** @description Role name */ - name: string; - /** - * Format: int64 - * @description Ranking position - * - * Smaller values take priority. - */ - rank?: number | null; - }; - /** @description New role information */ - DataEditRole: { - /** @description Role name */ - name?: string | null; - /** @description Role colour */ - colour?: string | null; - /** @description Whether this role should be displayed separately */ - hoist?: boolean | null; - /** - * Format: int64 - * @description Ranking position - * - * Smaller values take priority. - */ - rank?: number | null; - /** @description Fields to remove from role object */ - remove?: components["schemas"]["FieldsRole"][] | null; - }; - /** - * @description Optional fields on server object - * @enum {string} - */ - FieldsRole: "Colour"; - /** @description New role permissions */ - DataSetServerRolePermission: { - /** @description Allow / deny values for the role in this server. */ - permissions: components["schemas"]["Override"]; - }; - /** @description Data permissions Value - contains allow */ - DataPermissionsValue: { - /** Format: uint64 */ - permissions: number; - }; - /** @description Emoji */ - Emoji: { - /** @description Unique Id */ - _id: string; - /** @description What owns this emoji */ - parent: components["schemas"]["EmojiParent"]; - /** @description Uploader user id */ - creator_id: string; - /** @description Emoji name */ - name: string; - /** @description Whether the emoji is animated */ - animated?: boolean; - /** @description Whether the emoji is marked as nsfw */ - nsfw?: boolean; - }; - /** @description Parent Id of the emoji */ - EmojiParent: - | { - /** @enum {string} */ - type: "Server"; - id: string; - } - | { - /** @enum {string} */ - type: "Detached"; - }; - /** @description Public invite response */ - InviteResponse: - | { - /** @enum {string} */ - type: "Server"; - /** @description Invite code */ - code: string; - /** @description Id of the server */ - server_id: string; - /** @description Name of the server */ - server_name: string; - /** @description Attachment for server icon */ - server_icon?: components["schemas"]["File"] | null; - /** @description Attachment for server banner */ - server_banner?: components["schemas"]["File"] | null; - /** - * Format: int32 - * @description Enum of server flags - */ - server_flags?: number | null; - /** @description Id of server channel */ - channel_id: string; - /** @description Name of server channel */ - channel_name: string; - /** @description Description of server channel */ - channel_description?: string | null; - /** @description Name of user who created the invite */ - user_name: string; - /** @description Avatar of the user who created the invite */ - user_avatar?: components["schemas"]["File"] | null; - /** - * Format: int64 - * @description Number of members in this server - */ - member_count: number; - } - | { - /** @enum {string} */ - type: "Group"; - /** @description Invite code */ - code: string; - /** @description Id of group channel */ - channel_id: string; - /** @description Name of group channel */ - channel_name: string; - /** @description Description of group channel */ - channel_description?: string | null; - /** @description Name of user who created the invite */ - user_name: string; - /** @description Avatar of the user who created the invite */ - user_avatar?: components["schemas"]["File"] | null; - }; - /** @description Invite join response */ - InviteJoinResponse: - | { - /** @enum {string} */ - type: "Server"; - /** @description Channels in the server */ - channels: components["schemas"]["Channel"][]; - /** @description Server we are joining */ - server: components["schemas"]["Server"]; - } - | { - /** @enum {string} */ - type: "Group"; - /** @description Group channel we are joining */ - channel: components["schemas"]["Channel"]; - /** @description Members of this group */ - users: components["schemas"]["User"][]; - }; - /** @description Create a new emoji */ - DataCreateEmoji: { - /** @description Server name */ - name: string; - /** @description Parent information */ - parent: components["schemas"]["EmojiParent"]; - /** @description Whether the emoji is mature */ - nsfw?: boolean; - }; - /** Report Data */ - DataReportContent: { - /** @description Content being reported */ - content: components["schemas"]["ReportedContent"]; - /** @description Additional report description */ - additional_context?: string; - }; - /** @description The content being reported */ - ReportedContent: - | { - /** @enum {string} */ - type: "Message"; - /** @description ID of the message */ - id: string; - /** @description Reason for reporting message */ - report_reason: components["schemas"]["ContentReportReason"]; - } - | { - /** @enum {string} */ - type: "Server"; - /** @description ID of the server */ - id: string; - /** @description Reason for reporting server */ - report_reason: components["schemas"]["ContentReportReason"]; - } - | { - /** @enum {string} */ - type: "User"; - /** @description ID of the user */ - id: string; - /** @description Reason for reporting a user */ - report_reason: components["schemas"]["UserReportReason"]; - /** @description Message context */ - message_id?: string | null; - }; - /** - * @description Reason for reporting content (message or server) - * @enum {string} - */ - ContentReportReason: - | "NoneSpecified" - | "Illegal" - | "IllegalGoods" - | "IllegalExtortion" - | "IllegalPornography" - | "IllegalHacking" - | "ExtremeViolence" - | "PromotesHarm" - | "UnsolicitedSpam" - | "Raid" - | "SpamAbuse" - | "ScamsFraud" - | "Malware" - | "Harassment"; - /** - * @description Reason for reporting a user - * @enum {string} - */ - UserReportReason: - | "NoneSpecified" - | "UnsolicitedSpam" - | "SpamAbuse" - | "InappropriateProfile" - | "Impersonation" - | "BanEvasion" - | "Underage"; - /** Error */ - "Authifier Error": - | { - /** @enum {string} */ - type: "IncorrectData"; - with: string; - } - | { - /** @enum {string} */ - type: "DatabaseError"; - operation: string; - with: string; - } - | { - /** @enum {string} */ - type: "InternalError"; - } - | { - /** @enum {string} */ - type: "OperationFailed"; - } - | { - /** @enum {string} */ - type: "RenderFail"; - } - | { - /** @enum {string} */ - type: "MissingHeaders"; - } - | { - /** @enum {string} */ - type: "CaptchaFailed"; - } - | { - /** @enum {string} */ - type: "BlockedByShield"; - } - | { - /** @enum {string} */ - type: "InvalidSession"; - } - | { - /** @enum {string} */ - type: "UnverifiedAccount"; - } - | { - /** @enum {string} */ - type: "UnknownUser"; - } - | { - /** @enum {string} */ - type: "EmailFailed"; - } - | { - /** @enum {string} */ - type: "InvalidToken"; - } - | { - /** @enum {string} */ - type: "MissingInvite"; - } - | { - /** @enum {string} */ - type: "InvalidInvite"; - } - | { - /** @enum {string} */ - type: "InvalidCredentials"; - } - | { - /** @enum {string} */ - type: "CompromisedPassword"; - } - | { - /** @enum {string} */ - type: "ShortPassword"; - } - | { - /** @enum {string} */ - type: "Blacklisted"; - } - | { - /** @enum {string} */ - type: "LockedOut"; - } - | { - /** @enum {string} */ - type: "TotpAlreadyEnabled"; - } - | { - /** @enum {string} */ - type: "DisallowedMFAMethod"; - }; - /** Account Data */ - DataCreateAccount: { - /** @description Valid email address */ - email: string; - /** @description Password */ - password: string; - /** @description Invite code */ - invite?: string | null; - /** @description Captcha verification code */ - captcha?: string | null; - }; - /** Resend Information */ - DataResendVerification: { - /** @description Email associated with the account */ - email: string; - /** @description Captcha verification code */ - captcha?: string | null; - }; - /** Account Deletion Token */ - DataAccountDeletion: { - /** @description Deletion token */ - token: string; - }; - AccountInfo: { - _id: string; - email: string; - }; - /** Change Data */ - DataChangePassword: { - /** @description New password */ - password: string; - /** @description Current password */ - current_password: string; - }; - /** Change Data */ - DataChangeEmail: { - /** @description Valid email address */ - email: string; - /** @description Current password */ - current_password: string; - }; - ResponseVerify: - | unknown - | { - /** @description Authorised MFA ticket, can be used to log in */ - ticket: components["schemas"]["MFATicket"]; - }; - /** @description Multi-factor auth ticket */ - MFATicket: { - /** @description Unique Id */ - _id: string; - /** @description Account Id */ - account_id: string; - /** @description Unique Token */ - token: string; - /** @description Whether this ticket has been validated (can be used for account actions) */ - validated: boolean; - /** @description Whether this ticket is authorised (can be used to log a user in) */ - authorised: boolean; - /** @description TOTP code at time of ticket creation */ - last_totp_code?: string | null; - }; - /** Password Reset */ - DataPasswordReset: { - /** @description Reset token */ - token: string; - /** @description New password */ - password: string; - /** @description Whether to logout all sessions */ - remove_sessions?: boolean; - }; - /** Reset Information */ - DataSendPasswordReset: { - /** @description Email associated with the account */ - email: string; - /** @description Captcha verification code */ - captcha?: string | null; - }; - ResponseLogin: - | { - /** @enum {string} */ - result: "Success"; - /** @description Unique Id */ - _id: string; - /** @description User Id */ - user_id: string; - /** @description Session token */ - token: string; - /** @description Display name */ - name: string; - /** @description Web Push subscription */ - subscription?: components["schemas"]["WebPushSubscription"] | null; - } - | { - /** @enum {string} */ - result: "MFA"; - ticket: string; - allowed_methods: components["schemas"]["MFAMethod"][]; - } - | { - /** @enum {string} */ - result: "Disabled"; - user_id: string; - }; - /** @description Web Push subscription */ - WebPushSubscription: { - endpoint: string; - p256dh: string; - auth: string; - }; - /** - * @description MFA method - * @enum {string} - */ - MFAMethod: "Password" | "Recovery" | "Totp"; - /** Login Data */ - DataLogin: - | { - /** @description Email */ - email: string; - /** @description Password */ - password: string; - /** @description Friendly name used for the session */ - friendly_name?: string | null; - } - | { - /** - * @description Unvalidated or authorised MFA ticket - * - * Used to resolve the correct account - */ - mfa_ticket: string; - /** - * @description Valid MFA response - * - * This will take precedence over the `password` field where applicable - */ - mfa_response?: components["schemas"]["MFAResponse"] | null; - /** @description Friendly name used for the session */ - friendly_name?: string | null; - }; - /** @description MFA response */ - MFAResponse: - | { - password: string; - } - | { - recovery_code: string; - } - | { - totp_code: string; - }; - SessionInfo: { - _id: string; - name: string; - }; - /** Edit Data */ - DataEditSession: { - /** @description Session friendly name */ - friendly_name: string; - }; - MultiFactorStatus: { - email_otp: boolean; - trusted_handover: boolean; - email_mfa: boolean; - totp_mfa: boolean; - security_key_mfa: boolean; - recovery_active: boolean; - }; - /** Totp Secret */ - ResponseTotpSecret: { - secret: string; - }; - /** Onboarding Status */ - DataHello: { - /** @description Whether onboarding is required */ - onboarding: boolean; - }; - /** New User Data */ - DataOnboard: { - /** @description New username which will be used to identify the user on the platform */ - username: string; - }; - /** @description Options for fetching settings */ - OptionsFetchSettings: { - /** @description Keys to fetch */ - keys: string[]; - }; - /** @description Channel Unread */ - ChannelUnread: { - /** @description Composite key pointing to a user's view of a channel */ - _id: components["schemas"]["ChannelCompositeKey"]; - /** @description Id of the last message read in this channel by a user */ - last_id?: string | null; - /** @description Array of message ids that mention the user */ - mentions?: string[]; - }; - /** @description Composite primary key consisting of channel and user id */ - ChannelCompositeKey: { - /** @description Channel Id */ - channel: string; - /** @description User Id */ - user: string; - }; - }; -} - -export interface operations { - /** Fetch the server configuration for this Revolt instance. */ - root_root: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["RevoltConfig"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Retrieve your user information. */ - fetch_self_fetch: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Retrieve a user's information. */ - fetch_user_fetch: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Edit currently authenticated user. */ - edit_user_edit: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataEditUser"]; - }; - }; - }; - /** Retrieve a user's flags. */ - fetch_user_flags_fetch_user_flags: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["FlagResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Change your username. */ - change_username_change_username: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataChangeUsername"]; - }; - }; - }; - /** This returns a default avatar based on the given id. */ - get_default_avatar_default_avatar: { - parameters: { - path: { - target: string; - }; - }; - responses: { - /** Default Avatar Picture */ - 200: { - content: { - "image/png": string; - }; - }; - }; - }; - /** - * Retrieve a user's profile data. - * - * Will fail if you do not have permission to access the other user's profile. - */ - fetch_profile_profile: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["UserProfile"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** This fetches your direct messages, including any DM and group DM conversations. */ - fetch_dms_direct_messages: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["Channel"][]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** - * Open a DM with another user. - * - * If the target is oneself, a saved messages channel is returned. - */ - open_dm_open_dm: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Channel"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Retrieve a list of mutual friends and servers with another user. */ - find_mutual_mutual: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["MutualResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Accept another user's friend request. */ - add_friend_add: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Denies another user's friend request or removes an existing friend. */ - remove_friend_remove: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Block another user by their id. */ - block_user_block: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Unblock another user by their id. */ - unblock_user_unblock: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Send a friend request to another user. */ - send_friend_request_send_friend_request: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataSendFriendRequest"]; - }; - }; - }; - /** Create a new Revolt bot. */ - create_create_bot: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["BotWithUserResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataCreateBot"]; - }; - }; - }; - /** Fetch details of a public (or owned) bot by its id. */ - fetch_public_fetch_public_bot: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["PublicBot"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Invite a bot to a server or group by its id.` */ - invite_invite_bot: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["InviteBotDestination"]; - }; - }; - }; - /** Fetch details of a bot you own by its id. */ - fetch_fetch_bot: { - parameters: { - path: { - bot: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["FetchBotResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch all of the bots that you have control over. */ - fetch_owned_fetch_owned_bots: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["OwnedBotsResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Delete a bot by its id. */ - delete_delete_bot: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Edit bot details by its id. */ - edit_edit_bot: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["BotWithUserResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataEditBot"]; - }; - }; - }; - /** Lets the server and all other clients know that we've seen this message id in this channel. */ - channel_ack_ack: { - parameters: { - path: { - target: components["schemas"]["Id"]; - message: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch channel by its id. */ - channel_fetch_fetch: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Channel"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Deletes a server channel, leaves a group or closes a group. */ - channel_delete_delete: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - query: { - /** Whether to not send a leave message */ - leave_silently?: boolean | null; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Edit a channel object by its id. */ - channel_edit_edit: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Channel"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataEditChannel"]; - }; - }; - }; - /** - * Retrieves all users who are part of this group. - * - * This may not return full user information if users are not friends but have mutual connections. - */ - members_fetch_fetch_members: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"][]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** - * Creates an invite to this channel. - * - * Channel must be a `TextChannel`. - */ - invite_create_create_invite: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Invite"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch multiple messages. */ - message_query_query: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - query: { - /** - * Maximum number of messages to fetch - * - * For fetching nearby messages, this is \`(limit + 1)\`. - */ - limit?: number | null; - /** Message id before which messages should be fetched */ - before?: string | null; - /** Message id after which messages should be fetched */ - after?: string | null; - /** Message sort direction */ - sort?: components["schemas"]["MessageSort"] | null; - /** - * Message id to search around - * - * Specifying '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. - */ - nearby?: string | null; - /** Whether to include user (and member, if server channel) objects */ - include_users?: boolean | null; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["BulkMessageResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Sends a message to the given channel. */ - message_send_message_send: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - header: { - /** Unique key to prevent duplicate requests */ - "Idempotency-Key"?: string; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Message"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataMessageSend"]; - }; - }; - }; - /** This route searches for messages within the given parameters. */ - message_search_search: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["BulkMessageResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataMessageSearch"]; - }; - }; - }; - /** Pins a message by its id. */ - message_pin_message_pin: { - parameters: { - path: { - target: components["schemas"]["Id"]; - msg: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Unpins a message by its id. */ - message_unpin_message_unpin: { - parameters: { - path: { - target: components["schemas"]["Id"]; - msg: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Retrieves a message by its id. */ - message_fetch_fetch: { - parameters: { - path: { - target: components["schemas"]["Id"]; - msg: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Message"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Delete a message you've sent or one you have permission to delete. */ - message_delete_delete: { - parameters: { - path: { - target: components["schemas"]["Id"]; - msg: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Edits a message that you've previously sent. */ - message_edit_edit: { - parameters: { - path: { - target: components["schemas"]["Id"]; - msg: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Message"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataEditMessage"]; - }; - }; - }; - /** - * Delete multiple messages you've sent or one you have permission to delete. - * - * This will always require `ManageMessages` permission regardless of whether you own the message or not. - * - * Messages must have been sent within the past 1 week. - */ - message_bulk_delete_bulk_delete_messages: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["OptionsBulkDelete"]; - }; - }; - }; - /** Create a new group channel. */ - group_create_create_group: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["Channel"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataCreateGroup"]; - }; - }; - }; - /** Adds another user to the group. */ - group_add_member_add_member: { - parameters: { - path: { - group_id: components["schemas"]["Id"]; - member_id: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Removes a user from the group. */ - group_remove_member_remove_member: { - parameters: { - path: { - target: components["schemas"]["Id"]; - member: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Asks the voice server for a token to join the call. */ - voice_join_call: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["LegacyCreateVoiceUserResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** - * Sets permissions for the specified role in this channel. - * - * Channel must be a `TextChannel` or `VoiceChannel`. - */ - permissions_set_set_role_permissions: { - parameters: { - path: { - target: components["schemas"]["Id"]; - role_id: string; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Channel"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataSetRolePermissions"]; - }; - }; - }; - /** Sets permissions for the default role in this server. */ - permissions_set_default_set_default_permissions: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Server"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataPermissionsValue"]; - }; - }; - }; - /** React to a given message. */ - message_react_react_message: { - parameters: { - path: { - target: components["schemas"]["Id"]; - msg: components["schemas"]["Id"]; - emoji: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** - * Remove your own, someone else's or all of a given reaction. - * - * Requires `ManageMessages` if changing others' reactions. - */ - message_unreact_unreact_message: { - parameters: { - path: { - target: components["schemas"]["Id"]; - msg: components["schemas"]["Id"]; - emoji: components["schemas"]["Id"]; - }; - query: { - /** Remove a specific user's reaction */ - user_id?: string | null; - /** Remove all reactions */ - remove_all?: boolean | null; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** - * Remove your own, someone else's or all of a given reaction. - * - * Requires `ManageMessages` permission. - */ - message_clear_reactions_clear_reactions: { - parameters: { - path: { - target: components["schemas"]["Id"]; - msg: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Creates a webhook which 3rd party platforms can use to send messages */ - webhook_create_create_webhook: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Webhook"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateWebhookBody"]; - }; - }; - }; - /** Gets all webhooks inside the channel */ - webhook_fetch_all_fetch_webhooks: { - parameters: { - path: { - channel_id: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Webhook"][]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Create a new server. */ - server_create_create_server: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["CreateServerLegacyResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataCreateServer"]; - }; - }; - }; - /** Fetch a server by its id. */ - server_fetch_fetch: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - query: { - /** Whether to include channels */ - include_channels?: boolean | null; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["FetchServerResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Deletes a server if owner otherwise leaves. */ - server_delete_delete: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - query: { - /** Whether to not send a leave message */ - leave_silently?: boolean | null; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Edit a server by its id. */ - server_edit_edit: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Server"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataEditServer"]; - }; - }; - }; - /** Mark all channels in a server as read. */ - server_ack_ack: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Create a new Text or Voice channel. */ - channel_create_create_server_channel: { - parameters: { - path: { - server: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Channel"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataCreateServerChannel"]; - }; - }; - }; - /** Fetch all server members. */ - member_fetch_all_fetch_all: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - query: { - /** Whether to exclude offline users */ - exclude_offline?: boolean | null; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["AllMemberResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Retrieve a member. */ - member_fetch_fetch: { - parameters: { - path: { - target: components["schemas"]["Id"]; - member: components["schemas"]["Id"]; - }; - query: { - roles?: boolean | null; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["MemberResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Removes a member from the server. */ - member_remove_kick: { - parameters: { - path: { - target: components["schemas"]["Id"]; - member: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Edit a member by their id. */ - member_edit_edit: { - parameters: { - path: { - server: components["schemas"]["Id"]; - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Member"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataMemberEdit"]; - }; - }; - }; - /** Query members by a given name, this API is not stable and will be removed in the future. */ - member_experimental_query_member_experimental_query: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - query: { - /** String to search for */ - query: string; - /** Discourage use of this API */ - experimental_api: boolean; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["MemberQueryResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Ban a user by their id. */ - ban_create_ban: { - parameters: { - path: { - server: components["schemas"]["Id"]; - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["ServerBan"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataBanCreate"]; - }; - }; - }; - /** Remove a user's ban. */ - ban_remove_unban: { - parameters: { - path: { - server: components["schemas"]["Id"]; - target: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch all bans on a server. */ - ban_list_list: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["BanListResult"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch all server invites. */ - invites_fetch_invites: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Invite"][]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Creates a new server role. */ - roles_create_create: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["NewRoleResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataCreateRole"]; - }; - }; - }; - /** Fetch a role by its id. */ - roles_fetch_fetch: { - parameters: { - path: { - target: components["schemas"]["Id"]; - role_id: string; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Role"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Delete a server role by its id. */ - roles_delete_delete: { - parameters: { - path: { - target: components["schemas"]["Id"]; - role_id: string; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Edit a role by its id. */ - roles_edit_edit: { - parameters: { - path: { - target: components["schemas"]["Id"]; - role_id: string; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Role"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataEditRole"]; - }; - }; - }; - /** Sets permissions for the specified role in the server. */ - permissions_set_set_role_permission: { - parameters: { - path: { - target: components["schemas"]["Id"]; - role_id: string; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Server"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataSetServerRolePermission"]; - }; - }; - }; - /** Fetch all emoji on a server. */ - emoji_list_list_emoji: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Emoji"][]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch an invite by its id. */ - invite_fetch_fetch: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["InviteResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Join an invite by its ID */ - invite_join_join: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["InviteJoinResponse"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Delete an invite by its id. */ - invite_delete_delete: { - parameters: { - path: { - target: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Create an emoji by its Autumn upload id. */ - emoji_create_create_emoji: { - parameters: { - path: { - id: string; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Emoji"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataCreateEmoji"]; - }; - }; - }; - /** Fetch an emoji by its id. */ - emoji_fetch_fetch_emoji: { - parameters: { - path: { - emoji_id: components["schemas"]["Id"]; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["Emoji"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Delete an emoji by its id. */ - emoji_delete_delete_emoji: { - parameters: { - path: { - emoji_id: components["schemas"]["Id"]; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Report a piece of content to the moderation team. */ - report_content_report_content: { - responses: { - 200: unknown; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataReportContent"]; - }; - }; - }; - /** Create a new account. */ - create_account_create_account: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataCreateAccount"]; - }; - }; - }; - /** Resend account creation verification email. */ - resend_verification_resend_verification: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataResendVerification"]; - }; - }; - }; - /** Schedule an account for deletion by confirming the received token. */ - confirm_deletion_confirm_deletion: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataAccountDeletion"]; - }; - }; - }; - /** Request to have an account deleted. */ - delete_account_delete_account: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch account information from the current session. */ - fetch_account_fetch_account: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["AccountInfo"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Disable an account. */ - disable_account_disable_account: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Change the current account password. */ - change_password_change_password: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataChangePassword"]; - }; - }; - }; - /** Change the associated account email. */ - change_email_change_email: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataChangeEmail"]; - }; - }; - }; - /** Verify an email address. */ - verify_email_verify_email: { - parameters: { - path: { - code: string; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["ResponseVerify"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Send an email to reset account password. */ - send_password_reset_send_password_reset: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataSendPasswordReset"]; - }; - }; - }; - /** Confirm password reset and change the password. */ - password_reset_password_reset: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataPasswordReset"]; - }; - }; - }; - /** Login to an account. */ - login_login: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["ResponseLogin"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataLogin"]; - }; - }; - }; - /** Delete current session. */ - logout_logout: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch all sessions associated with this account. */ - fetch_all_fetch_all: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["SessionInfo"][]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Delete all active sessions, optionally including current one. */ - revoke_all_revoke_all: { - parameters: { - query: { - revoke_self?: boolean | null; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Delete a specific active session. */ - revoke_revoke: { - parameters: { - path: { - id: string; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Edit current session information. */ - edit_edit: { - parameters: { - path: { - id: string; - }; - }; - responses: { - 200: { - content: { - "application/json": components["schemas"]["SessionInfo"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataEditSession"]; - }; - }; - }; - /** Create a new MFA ticket or validate an existing one. */ - create_ticket_create_ticket: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["MFATicket"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["MFAResponse"]; - }; - }; - }; - /** Fetch MFA status of an account. */ - fetch_status_fetch_status: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["MultiFactorStatus"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch recovery codes for an account. */ - fetch_recovery_fetch_recovery: { - responses: { - 200: { - content: { - "application/json": string[]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Re-generate recovery codes for an account. */ - generate_recovery_generate_recovery: { - responses: { - 200: { - content: { - "application/json": string[]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Fetch available MFA methods. */ - get_mfa_methods_get_mfa_methods: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["MFAMethod"][]; - }; - }; - }; - }; - /** Generate a new secret for TOTP. */ - totp_enable_totp_enable: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["MFAResponse"]; - }; - }; - }; - /** Generate a new secret for TOTP. */ - totp_generate_secret_totp_generate_secret: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["ResponseTotpSecret"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** Disable TOTP 2FA for an account. */ - totp_disable_totp_disable: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** This will tell you whether the current account requires onboarding or whether you can continue to send requests as usual. You may skip calling this if you're restoring an existing session. */ - hello_hello: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["DataHello"]; - }; - }; - }; - }; - /** This sets a new username, completes onboarding and allows a user to start using Revolt. */ - complete_complete: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["User"]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DataOnboard"]; - }; - }; - }; - /** - * Create a new Web Push subscription. - * - * If an existing subscription exists on this session, it will be removed. - */ - subscribe_subscribe: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["WebPushSubscription"]; - }; - }; - }; - /** Remove the Web Push subscription associated with the current session. */ - unsubscribe_unsubscribe: { - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; - /** - * Fetch settings from server filtered by keys. - * - * This will return an object with the requested keys, each value is a tuple of `(timestamp, value)`, the value is the previously uploaded data. - */ - get_settings_fetch: { - responses: { - 200: { - content: { - "application/json": { [key: string]: [number, string] }; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["OptionsFetchSettings"]; - }; - }; - }; - /** Upload data to save to settings. */ - set_settings_set: { - parameters: { - query: { - /** - * Timestamp of settings change. - * - * Used to avoid feedback loops. - */ - timestamp?: number | null; - }; - }; - responses: { - /** Success */ - 204: never; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - requestBody: { - content: { - "application/json": { [key: string]: string }; - }; - }; - }; - /** Fetch information about unread state on channels. */ - get_unreads_unreads: { - responses: { - 200: { - content: { - "application/json": components["schemas"]["ChannelUnread"][]; - }; - }; - /** An error occurred. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - }; - }; -} - -export interface external {} diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 0000000..ec8ebff --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1,131 @@ +import type { components } from "./api"; + +type RevoltFeatures = components["schemas"]["RevoltFeatures"]; +type BuildInformation = components["schemas"]["BuildInformation"]; +type CaptchaFeature = components["schemas"]["CaptchaFeature"]; +type Feature = components["schemas"]["Feature"]; +type VoiceFeature = components["schemas"]["VoiceFeature"]; +type File = components["schemas"]["File"]; +type Relationship = components["schemas"]["Relationship"]; +type UserStatus = components["schemas"]["UserStatus"]; +type BotInformation = components["schemas"]["BotInformation"]; +type RelationshipStatus = components["schemas"]["RelationshipStatus"]; +type Metadata = components["schemas"]["Metadata"]; +type Presence = components["schemas"]["Presence"]; +type DataUserProfile = components["schemas"]["DataUserProfile"]; +type FieldsUser = components["schemas"]["FieldsUser"]; +type OverrideField = components["schemas"]["OverrideField"]; +type User = components["schemas"]["User"]; +type Bot = components["schemas"]["Bot"]; +type FieldsBot = components["schemas"]["FieldsBot"]; +type FieldsChannel = components["schemas"]["FieldsChannel"]; +type Member = components["schemas"]["Member"]; +type MessageWebhook = components["schemas"]["MessageWebhook"]; +type SystemMessage = components["schemas"]["SystemMessage"]; +type Embed = components["schemas"]["Embed"]; +type Interactions = components["schemas"]["Interactions"]; +type Masquerade = components["schemas"]["Masquerade"]; +type MemberCompositeKey = components["schemas"]["MemberCompositeKey"]; +type Special = components["schemas"]["Special"]; +type Image = components["schemas"]["Image"]; +type Video = components["schemas"]["Video"]; +type ImageSize = components["schemas"]["ImageSize"]; +type LightspeedType = components["schemas"]["LightspeedType"]; +type TwitchType = components["schemas"]["TwitchType"]; +type BandcampType = components["schemas"]["BandcampType"]; +type ReplyIntent = components["schemas"]["ReplyIntent"]; +type SendableEmbed = components["schemas"]["SendableEmbed"]; +type Message = components["schemas"]["Message"]; +type MessageSort = components["schemas"]["MessageSort"]; +type Override = components["schemas"]["Override"]; +type Server = components["schemas"]["Server"]; +type Channel = components["schemas"]["Channel"]; +type Category = components["schemas"]["Category"]; +type SystemMessageChannels = components["schemas"]["SystemMessageChannels"]; +type Role = components["schemas"]["Role"]; +type FieldsServer = components["schemas"]["FieldsServer"]; +type LegacyServerChannelType = components["schemas"]["LegacyServerChannelType"]; +type FieldsMember = components["schemas"]["FieldsMember"]; +type BannedUser = components["schemas"]["BannedUser"]; +type ServerBan = components["schemas"]["ServerBan"]; +type FieldsRole = components["schemas"]["FieldsRole"]; +type EmojiParent = components["schemas"]["EmojiParent"]; +type ReportedContent = components["schemas"]["ReportedContent"]; +type ContentReportReason = components["schemas"]["ContentReportReason"]; +type UserReportReason = components["schemas"]["UserReportReason"]; +type MFATicket = components["schemas"]["MFATicket"]; +type WebPushSubscription = components["schemas"]["WebPushSubscription"]; +type MFAMethod = components["schemas"]["MFAMethod"]; +type MFAResponse = components["schemas"]["MFAResponse"]; +type ChannelCompositeKey = components["schemas"]["ChannelCompositeKey"]; +type RevoltConfig = components["schemas"]["RevoltConfig"]; +type Error = components["schemas"]["Error"]; +type Id = components["schemas"]["Id"]; +type DataEditUser = components["schemas"]["DataEditUser"]; +type FlagResponse = components["schemas"]["FlagResponse"]; +type DataChangeUsername = components["schemas"]["DataChangeUsername"]; +type UserProfile = components["schemas"]["UserProfile"]; +type MutualResponse = components["schemas"]["MutualResponse"]; +type DataSendFriendRequest = components["schemas"]["DataSendFriendRequest"]; +type DataCreateBot = components["schemas"]["DataCreateBot"]; +type BotWithUserResponse = components["schemas"]["BotWithUserResponse"]; +type PublicBot = components["schemas"]["PublicBot"]; +type InviteBotDestination = components["schemas"]["InviteBotDestination"]; +type FetchBotResponse = components["schemas"]["FetchBotResponse"]; +type OwnedBotsResponse = components["schemas"]["OwnedBotsResponse"]; +type DataEditBot = components["schemas"]["DataEditBot"]; +type DataEditChannel = components["schemas"]["DataEditChannel"]; +type Invite = components["schemas"]["Invite"]; +type BulkMessageResponse = components["schemas"]["BulkMessageResponse"]; +type DataMessageSend = components["schemas"]["DataMessageSend"]; +type DataMessageSearch = components["schemas"]["DataMessageSearch"]; +type DataEditMessage = components["schemas"]["DataEditMessage"]; +type OptionsBulkDelete = components["schemas"]["OptionsBulkDelete"]; +type DataCreateGroup = components["schemas"]["DataCreateGroup"]; +type LegacyCreateVoiceUserResponse = components["schemas"]["LegacyCreateVoiceUserResponse"]; +type DataSetRolePermissions = components["schemas"]["DataSetRolePermissions"]; +type DataDefaultChannelPermissions = components["schemas"]["DataDefaultChannelPermissions"]; +type CreateWebhookBody = components["schemas"]["CreateWebhookBody"]; +type Webhook = components["schemas"]["Webhook"]; +type DataCreateServer = components["schemas"]["DataCreateServer"]; +type CreateServerLegacyResponse = components["schemas"]["CreateServerLegacyResponse"]; +type FetchServerResponse = components["schemas"]["FetchServerResponse"]; +type DataEditServer = components["schemas"]["DataEditServer"]; +type DataCreateServerChannel = components["schemas"]["DataCreateServerChannel"]; +type AllMemberResponse = components["schemas"]["AllMemberResponse"]; +type MemberResponse = components["schemas"]["MemberResponse"]; +type DataMemberEdit = components["schemas"]["DataMemberEdit"]; +type MemberQueryResponse = components["schemas"]["MemberQueryResponse"]; +type DataBanCreate = components["schemas"]["DataBanCreate"]; +type BanListResult = components["schemas"]["BanListResult"]; +type DataCreateRole = components["schemas"]["DataCreateRole"]; +type NewRoleResponse = components["schemas"]["NewRoleResponse"]; +type DataEditRole = components["schemas"]["DataEditRole"]; +type DataSetServerRolePermission = components["schemas"]["DataSetServerRolePermission"]; +type DataPermissionsValue = components["schemas"]["DataPermissionsValue"]; +type Emoji = components["schemas"]["Emoji"]; +type InviteResponse = components["schemas"]["InviteResponse"]; +type InviteJoinResponse = components["schemas"]["InviteJoinResponse"]; +type DataCreateEmoji = components["schemas"]["DataCreateEmoji"]; +type DataReportContent = components["schemas"]["DataReportContent"]; +type DataCreateAccount = components["schemas"]["DataCreateAccount"]; +type DataResendVerification = components["schemas"]["DataResendVerification"]; +type DataAccountDeletion = components["schemas"]["DataAccountDeletion"]; +type AccountInfo = components["schemas"]["AccountInfo"]; +type DataChangePassword = components["schemas"]["DataChangePassword"]; +type DataChangeEmail = components["schemas"]["DataChangeEmail"]; +type ResponseVerify = components["schemas"]["ResponseVerify"]; +type DataSendPasswordReset = components["schemas"]["DataSendPasswordReset"]; +type DataPasswordReset = components["schemas"]["DataPasswordReset"]; +type DataLogin = components["schemas"]["DataLogin"]; +type ResponseLogin = components["schemas"]["ResponseLogin"]; +type SessionInfo = components["schemas"]["SessionInfo"]; +type DataEditSession = components["schemas"]["DataEditSession"]; +type MultiFactorStatus = components["schemas"]["MultiFactorStatus"]; +type ResponseTotpSecret = components["schemas"]["ResponseTotpSecret"]; +type DataHello = components["schemas"]["DataHello"]; +type DataOnboard = components["schemas"]["DataOnboard"]; +type OptionsFetchSettings = components["schemas"]["OptionsFetchSettings"]; +type ChannelUnread = components["schemas"]["ChannelUnread"]; + +export type { RevoltFeatures, BuildInformation, CaptchaFeature, Feature, VoiceFeature, File, Relationship, UserStatus, BotInformation, RelationshipStatus, Metadata, Presence, DataUserProfile, FieldsUser, OverrideField, User, Bot, FieldsBot, FieldsChannel, Member, MessageWebhook, SystemMessage, Embed, Interactions, Masquerade, MemberCompositeKey, Special, Image, Video, ImageSize, LightspeedType, TwitchType, BandcampType, ReplyIntent, SendableEmbed, Message, MessageSort, Override, Server, Channel, Category, SystemMessageChannels, Role, FieldsServer, LegacyServerChannelType, FieldsMember, BannedUser, ServerBan, FieldsRole, EmojiParent, ReportedContent, ContentReportReason, UserReportReason, MFATicket, WebPushSubscription, MFAMethod, MFAResponse, ChannelCompositeKey, RevoltConfig, Error, Id, DataEditUser, FlagResponse, DataChangeUsername, UserProfile, MutualResponse, DataSendFriendRequest, DataCreateBot, BotWithUserResponse, PublicBot, InviteBotDestination, FetchBotResponse, OwnedBotsResponse, DataEditBot, DataEditChannel, Invite, BulkMessageResponse, DataMessageSend, DataMessageSearch, DataEditMessage, OptionsBulkDelete, DataCreateGroup, LegacyCreateVoiceUserResponse, DataSetRolePermissions, DataDefaultChannelPermissions, CreateWebhookBody, Webhook, DataCreateServer, CreateServerLegacyResponse, FetchServerResponse, DataEditServer, DataCreateServerChannel, AllMemberResponse, MemberResponse, DataMemberEdit, MemberQueryResponse, DataBanCreate, BanListResult, DataCreateRole, NewRoleResponse, DataEditRole, DataSetServerRolePermission, DataPermissionsValue, Emoji, InviteResponse, InviteJoinResponse, DataCreateEmoji, DataReportContent, DataCreateAccount, DataResendVerification, DataAccountDeletion, AccountInfo, DataChangePassword, DataChangeEmail, ResponseVerify, DataSendPasswordReset, DataPasswordReset, DataLogin, ResponseLogin, SessionInfo, DataEditSession, MultiFactorStatus, ResponseTotpSecret, DataHello, DataOnboard, OptionsFetchSettings, ChannelUnread }; diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index 23d5dde..0000000 --- a/src/types.ts +++ /dev/null @@ -1,131 +0,0 @@ -// This file was auto-generated by @insertish/oapi! -import { components } from './schema'; -export type RevoltConfig = components['schemas']['RevoltConfig']; -export type RevoltFeatures = components['schemas']['RevoltFeatures']; -export type CaptchaFeature = components['schemas']['CaptchaFeature']; -export type Feature = components['schemas']['Feature']; -export type VoiceFeature = components['schemas']['VoiceFeature']; -export type BuildInformation = components['schemas']['BuildInformation']; -export type Error = components['schemas']['Error']; -export type User = components['schemas']['User']; -export type File = components['schemas']['File']; -export type Metadata = components['schemas']['Metadata']; -export type Relationship = components['schemas']['Relationship']; -export type RelationshipStatus = components['schemas']['RelationshipStatus']; -export type UserStatus = components['schemas']['UserStatus']; -export type Presence = components['schemas']['Presence']; -export type BotInformation = components['schemas']['BotInformation']; -export type Id = components['schemas']['Id']; -export type FlagResponse = components['schemas']['FlagResponse']; -export type DataEditUser = components['schemas']['DataEditUser']; -export type DataUserProfile = components['schemas']['DataUserProfile']; -export type FieldsUser = components['schemas']['FieldsUser']; -export type DataChangeUsername = components['schemas']['DataChangeUsername']; -export type UserProfile = components['schemas']['UserProfile']; -export type Channel = components['schemas']['Channel']; -export type OverrideField = components['schemas']['OverrideField']; -export type MutualResponse = components['schemas']['MutualResponse']; -export type DataSendFriendRequest = components['schemas']['DataSendFriendRequest']; -export type BotWithUserResponse = components['schemas']['BotWithUserResponse']; -export type DataCreateBot = components['schemas']['DataCreateBot']; -export type InviteBotDestination = components['schemas']['InviteBotDestination']; -export type PublicBot = components['schemas']['PublicBot']; -export type FetchBotResponse = components['schemas']['FetchBotResponse']; -export type Bot = components['schemas']['Bot']; -export type OwnedBotsResponse = components['schemas']['OwnedBotsResponse']; -export type DataEditBot = components['schemas']['DataEditBot']; -export type FieldsBot = components['schemas']['FieldsBot']; -export type DataEditChannel = components['schemas']['DataEditChannel']; -export type FieldsChannel = components['schemas']['FieldsChannel']; -export type Invite = components['schemas']['Invite']; -export type Message = components['schemas']['Message']; -export type Member = components['schemas']['Member']; -export type MemberCompositeKey = components['schemas']['MemberCompositeKey']; -export type ISO8601_Timestamp = components['schemas']['ISO8601 Timestamp']; -export type MessageWebhook = components['schemas']['MessageWebhook']; -export type SystemMessage = components['schemas']['SystemMessage']; -export type Embed = components['schemas']['Embed']; -export type Special = components['schemas']['Special']; -export type LightspeedType = components['schemas']['LightspeedType']; -export type TwitchType = components['schemas']['TwitchType']; -export type BandcampType = components['schemas']['BandcampType']; -export type Image = components['schemas']['Image']; -export type ImageSize = components['schemas']['ImageSize']; -export type Video = components['schemas']['Video']; -export type Interactions = components['schemas']['Interactions']; -export type Masquerade = components['schemas']['Masquerade']; -export type DataMessageSend = components['schemas']['DataMessageSend']; -export type ReplyIntent = components['schemas']['ReplyIntent']; -export type SendableEmbed = components['schemas']['SendableEmbed']; -export type BulkMessageResponse = components['schemas']['BulkMessageResponse']; -export type MessageSort = components['schemas']['MessageSort']; -export type DataMessageSearch = components['schemas']['DataMessageSearch']; -export type DataEditMessage = components['schemas']['DataEditMessage']; -export type OptionsBulkDelete = components['schemas']['OptionsBulkDelete']; -export type DataCreateGroup = components['schemas']['DataCreateGroup']; -export type LegacyCreateVoiceUserResponse = components['schemas']['LegacyCreateVoiceUserResponse']; -export type DataSetRolePermissions = components['schemas']['DataSetRolePermissions']; -export type Override = components['schemas']['Override']; -export type DataDefaultChannelPermissions = components['schemas']['DataDefaultChannelPermissions']; -export type Webhook = components['schemas']['Webhook']; -export type CreateWebhookBody = components['schemas']['CreateWebhookBody']; -export type CreateServerLegacyResponse = components['schemas']['CreateServerLegacyResponse']; -export type Server = components['schemas']['Server']; -export type Category = components['schemas']['Category']; -export type SystemMessageChannels = components['schemas']['SystemMessageChannels']; -export type Role = components['schemas']['Role']; -export type DataCreateServer = components['schemas']['DataCreateServer']; -export type FetchServerResponse = components['schemas']['FetchServerResponse']; -export type DataEditServer = components['schemas']['DataEditServer']; -export type FieldsServer = components['schemas']['FieldsServer']; -export type DataCreateServerChannel = components['schemas']['DataCreateServerChannel']; -export type LegacyServerChannelType = components['schemas']['LegacyServerChannelType']; -export type AllMemberResponse = components['schemas']['AllMemberResponse']; -export type MemberResponse = components['schemas']['MemberResponse']; -export type DataMemberEdit = components['schemas']['DataMemberEdit']; -export type FieldsMember = components['schemas']['FieldsMember']; -export type MemberQueryResponse = components['schemas']['MemberQueryResponse']; -export type ServerBan = components['schemas']['ServerBan']; -export type DataBanCreate = components['schemas']['DataBanCreate']; -export type BanListResult = components['schemas']['BanListResult']; -export type BannedUser = components['schemas']['BannedUser']; -export type NewRoleResponse = components['schemas']['NewRoleResponse']; -export type DataCreateRole = components['schemas']['DataCreateRole']; -export type DataEditRole = components['schemas']['DataEditRole']; -export type FieldsRole = components['schemas']['FieldsRole']; -export type DataSetServerRolePermission = components['schemas']['DataSetServerRolePermission']; -export type DataPermissionsValue = components['schemas']['DataPermissionsValue']; -export type Emoji = components['schemas']['Emoji']; -export type EmojiParent = components['schemas']['EmojiParent']; -export type InviteResponse = components['schemas']['InviteResponse']; -export type InviteJoinResponse = components['schemas']['InviteJoinResponse']; -export type DataCreateEmoji = components['schemas']['DataCreateEmoji']; -export type DataReportContent = components['schemas']['DataReportContent']; -export type ReportedContent = components['schemas']['ReportedContent']; -export type ContentReportReason = components['schemas']['ContentReportReason']; -export type UserReportReason = components['schemas']['UserReportReason']; -export type Authifier_Error = components['schemas']['Authifier Error']; -export type DataCreateAccount = components['schemas']['DataCreateAccount']; -export type DataResendVerification = components['schemas']['DataResendVerification']; -export type DataAccountDeletion = components['schemas']['DataAccountDeletion']; -export type AccountInfo = components['schemas']['AccountInfo']; -export type DataChangePassword = components['schemas']['DataChangePassword']; -export type DataChangeEmail = components['schemas']['DataChangeEmail']; -export type ResponseVerify = components['schemas']['ResponseVerify']; -export type MFATicket = components['schemas']['MFATicket']; -export type DataPasswordReset = components['schemas']['DataPasswordReset']; -export type DataSendPasswordReset = components['schemas']['DataSendPasswordReset']; -export type ResponseLogin = components['schemas']['ResponseLogin']; -export type WebPushSubscription = components['schemas']['WebPushSubscription']; -export type MFAMethod = components['schemas']['MFAMethod']; -export type DataLogin = components['schemas']['DataLogin']; -export type MFAResponse = components['schemas']['MFAResponse']; -export type SessionInfo = components['schemas']['SessionInfo']; -export type DataEditSession = components['schemas']['DataEditSession']; -export type MultiFactorStatus = components['schemas']['MultiFactorStatus']; -export type ResponseTotpSecret = components['schemas']['ResponseTotpSecret']; -export type DataHello = components['schemas']['DataHello']; -export type DataOnboard = components['schemas']['DataOnboard']; -export type OptionsFetchSettings = components['schemas']['OptionsFetchSettings']; -export type ChannelUnread = components['schemas']['ChannelUnread']; -export type ChannelCompositeKey = components['schemas']['ChannelCompositeKey'];; \ No newline at end of file diff --git a/tsconfig.esm.json b/tsconfig.esm.json index 6c19af4..f01c8dd 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -4,18 +4,18 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "ESNext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ - "module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + "target": "ESNext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, + "module": "ESNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declaration": true /* Generates corresponding '.d.ts' file. */, // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./esm", /* Redirect output structure to the directory. */ - "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + "outDir": "./esm" /* Redirect output structure to the directory. */, + "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ // "removeComments": true, /* Do not emit comments to output. */ @@ -25,7 +25,7 @@ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ @@ -39,19 +39,19 @@ // "noUnusedParameters": true, /* Report errors on unused parameters. */ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + "noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */, // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ /* Module Resolution Options */ - "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ @@ -66,10 +66,8 @@ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ /* Advanced Options */ - "skipLibCheck": true, /* Skip type checking of declaration files. */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + "skipLibCheck": false /* Skip type checking of declaration files. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": [ - "src/**/*" - ] + "include": ["src/**/*"] } diff --git a/tsconfig.json b/tsconfig.json index 4880e06..a7ca97b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,18 +4,18 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es2016", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ - "module": "CommonJS", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + "target": "es2016" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, + "module": "CommonJS" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declaration": true /* Generates corresponding '.d.ts' file. */, // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist", /* Redirect output structure to the directory. */ - "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + "outDir": "./dist" /* Redirect output structure to the directory. */, + "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ // "removeComments": true, /* Do not emit comments to output. */ @@ -25,7 +25,7 @@ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ @@ -39,7 +39,7 @@ // "noUnusedParameters": true, /* Report errors on unused parameters. */ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + "noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */, // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ @@ -51,7 +51,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ @@ -66,10 +66,8 @@ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ /* Advanced Options */ - "skipLibCheck": true, /* Skip type checking of declaration files. */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + "skipLibCheck": false /* Skip type checking of declaration files. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": [ - "src/**/*" - ] + "include": ["src/**/*"] } diff --git a/yarn.lock b/yarn.lock index 2329710..3462af5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,60 +2,292 @@ # yarn lockfile v1 -"@insertish/oapi@0.1.18": - version "0.1.18" - resolved "https://registry.yarnpkg.com/@insertish/oapi/-/oapi-0.1.18.tgz#3544d021fbfe8cbe8ad4080860f1bcc97f21d0c1" - integrity sha512-LZLUk3WmzUjCM0quensexvQx/Kk1MpFBtCLJRnRrPOiaFT37JpOmWUFlrdu0sPS6B9wi2edEBeLcsnIiq85WMA== +"@babel/code-frame@^7.22.13": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" + integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== dependencies: - typescript "^4.6.2" - optionalDependencies: - axios "^0.26.1" - openapi-typescript "^5.2.0" + "@babel/highlight" "^7.24.7" + picocolors "^1.0.0" + +"@babel/helper-validator-identifier@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" + integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== + +"@babel/highlight@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" + integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== + dependencies: + "@babel/helper-validator-identifier" "^7.24.7" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" -"@types/lodash.defaultsdeep@^4.6.6": - version "4.6.6" - resolved "https://registry.yarnpkg.com/@types/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.6.tgz#d2e87c07ec8d0361e4b79aa000815732b210be04" - integrity sha512-k3bXTg1/54Obm6uFEtSwvDm2vCyK9jSROv0V9X3gFFNPu7eKmvqqadPSXx0SkVVixSilR30BxhFlnIj8OavXOA== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== dependencies: - "@types/lodash" "*" + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + +"@redocly/ajv@^8.11.0": + version "8.11.2" + resolved "https://registry.yarnpkg.com/@redocly/ajv/-/ajv-8.11.2.tgz#46e1bf321ec0ac1e0fd31dea41a3d1fcbdcda0b5" + integrity sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js-replace "^1.0.1" + +"@redocly/config@^0.10.1": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@redocly/config/-/config-0.10.1.tgz#c7bcbab6cb3b82236c2f5c87aa44924a652d8e80" + integrity sha512-H3LnKVGzOaxskwJu8pmJYwBOWjP61qOK7TuTrbafqArDVckE06fhA6l0nO4KvBbjLPjy1Al7UnlxOu23V4Nl0w== + +"@redocly/openapi-core@^1.16.0": + version "1.23.1" + resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.23.1.tgz#20c0061cff6f60e5274ec59f491d6e5c6e972374" + integrity sha512-eCSHGOP/T68TNQYVqPLTZfWRjxHJjRdlQjMljY160UhiWHRt1SlBtjkOCpmCN+p3Vj3IirlrUhnTXtrqZclpVg== + dependencies: + "@redocly/ajv" "^8.11.0" + "@redocly/config" "^0.10.1" + colorette "^1.2.0" + https-proxy-agent "^7.0.4" + js-levenshtein "^1.1.6" + js-yaml "^4.1.0" + lodash.isequal "^4.5.0" + minimatch "^5.0.1" + node-fetch "^2.6.1" + pluralize "^8.0.0" + yaml-ast-parser "0.0.43" + +agent-base@^7.0.2: + version "7.1.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317" + integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA== + dependencies: + debug "^4.3.4" + +ansi-colors@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -"@types/lodash@*": - version "4.14.180" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.180.tgz#4ab7c9ddfc92ec4a887886483bc14c79fb380670" - integrity sha512-XOKXa1KIxtNXgASAnwj7cnttJxS4fksBRywK/9LzRV5YxrF80BXZIGeQSuoESQ/VkUj30Ae0+YcuHc15wJCB2g== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -axios@^0.26.1: - version "0.26.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" - integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: - follow-redirects "^1.14.8" + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" -follow-redirects@^1.14.8: - version "1.14.9" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" - integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== +change-case@^5.4.4: + version "5.4.4" + resolved "https://registry.yarnpkg.com/change-case/-/change-case-5.4.4.tgz#0d52b507d8fb8f204343432381d1a6d7bff97a02" + integrity sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w== -globalyzer@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465" - integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q== +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" -globrex@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" - integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colorette@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" + integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== + +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@4, debug@^4.3.4: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +foreground-child@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.3.0.tgz#0ac8644c06e431439f8561db8ecf29a7b5519c77" + integrity sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + +glob@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-11.0.0.tgz#6031df0d7b65eaa1ccb9b29b5ced16cea658e77e" + integrity sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g== + dependencies: + foreground-child "^3.1.0" + jackspeak "^4.0.1" + minimatch "^10.0.0" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +https-proxy-agent@^7.0.4: + version "7.0.5" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2" + integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw== + dependencies: + agent-base "^7.0.2" + debug "4" in-publish@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.1.tgz#948b1a535c8030561cea522f73f78f4be357e00c" integrity sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ== +index-to-position@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/index-to-position/-/index-to-position-0.1.2.tgz#e11bfe995ca4d8eddb1ec43274488f3c201a7f09" + integrity sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +jackspeak@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-4.0.1.tgz#9fca4ce961af6083e259c376e9e3541431f5287b" + integrity sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + +js-levenshtein@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" + integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -63,52 +295,251 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -lodash.defaultsdeep@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz#512e9bd721d272d94e3d3a63653fa17516741ca6" - integrity sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + +lru-cache@^11.0.0: + version "11.0.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.0.1.tgz#3a732fbfedb82c5ba7bca6564ad3f42afcb6e147" + integrity sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ== + +minimatch@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.0.1.tgz#ce0521856b453c86e25f2c4c0d03e6ff7ddc440b" + integrity sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + +minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + +ms@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +node-fetch@^2.6.1: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +openapi-fetch@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/openapi-fetch/-/openapi-fetch-0.12.0.tgz#eb7d9c1163cfad9866815bb71ee40fcd36ee6300" + integrity sha512-D/g5BUGiOAKqivR5s02veJ2+cMHzrkFJKberKP4Z8Vl2VhE6MMirI6wWOgpp8wlsYCRRK7CX0NCGVL/mt6l1fA== + dependencies: + openapi-typescript-helpers "^0.0.13" + +openapi-typescript-helpers@^0.0.13: + version "0.0.13" + resolved "https://registry.yarnpkg.com/openapi-typescript-helpers/-/openapi-typescript-helpers-0.0.13.tgz#d959b6a87b5461759e240af375fab480252d2caf" + integrity sha512-z44WK2e7ygW3aUtAtiurfEACohf/Qt9g6BsejmIYgEoY4REHeRzgFJmO3ium0libsuzPc145I+8lE9aiiZrQvQ== + +openapi-typescript@^7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/openapi-typescript/-/openapi-typescript-7.4.0.tgz#8d7b3de60466450fc1ac4f3f468f68c2a423fd53" + integrity sha512-u4iVuTGkzKG4rHFUMA/IFXTks9tYVQzkowZsScMOdzJSvIF10qSNySWHTwnN2fD+MEeWFAM8i1f3IUBlgS92eQ== + dependencies: + "@redocly/openapi-core" "^1.16.0" + ansi-colors "^4.1.3" + change-case "^5.4.4" + parse-json "^8.1.0" + supports-color "^9.4.0" + yargs-parser "^21.1.1" + +package-json-from-dist@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz#e501cd3094b278495eb4258d4c9f6d5ac3019f00" + integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw== + +parse-json@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-8.1.0.tgz#91cdc7728004e955af9cb734de5684733b24a717" + integrity sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA== + dependencies: + "@babel/code-frame" "^7.22.13" + index-to-position "^0.1.2" + type-fest "^4.7.1" + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-scurry@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.0.tgz#9f052289f23ad8bf9397a2a0425e7b8615c58580" + integrity sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg== + dependencies: + lru-cache "^11.0.0" + minipass "^7.1.2" + +picocolors@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.0.tgz#5358b76a78cde483ba5cef6a9dc9671440b27d59" + integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw== + +pluralize@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" + integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +rimraf@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-6.0.1.tgz#ffb8ad8844dd60332ab15f52bc104bc3ed71ea4e" + integrity sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A== + dependencies: + glob "^11.0.0" + package-json-from-dist "^1.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" -mime@^3.0.0: +shebang-regex@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" - integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== -openapi-typescript@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/openapi-typescript/-/openapi-typescript-5.2.0.tgz#c0712d7a17e4502ac083162c42f946c0e966a505" - integrity sha512-EGoPTmxrpiN40R6An5Wqol2l74sRb773pv/KXWYCQaMCXNtMGN7Jv+y/jY4B1Bd4hsIW2j9GFmQXxqfGmOXaxA== +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: - js-yaml "^4.1.0" - mime "^3.0.0" - prettier "^2.5.1" - tiny-glob "^0.2.9" - undici "^4.14.1" - yargs-parser "^21.0.0" - -prettier@^2.5.1: - version "2.6.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.0.tgz#12f8f504c4d8ddb76475f441337542fa799207d4" - integrity sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A== - -tiny-glob@^0.2.9: - version "0.2.9" - resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2" - integrity sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg== - dependencies: - globalyzer "0.1.0" - globrex "^0.1.2" - -typescript@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4" - integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg== - -undici@^4.14.1: - version "4.16.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-4.16.0.tgz#469bb87b3b918818d3d7843d91a1d08da357d5ff" - integrity sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw== - -yargs-parser@^21.0.0: - version "21.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-9.4.0.tgz#17bfcf686288f531db3dea3215510621ccb55954" + integrity sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw== + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +type-fest@^4.7.1: + version "4.26.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.26.0.tgz#703f263af10c093cd6277d079e26b9e17d517c4b" + integrity sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw== + +typescript@^5.5.4: + version "5.5.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" + integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== + +uri-js-replace@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uri-js-replace/-/uri-js-replace-1.0.1.tgz#c285bb352b701c9dfdaeffc4da5be77f936c9048" + integrity sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + +yaml-ast-parser@0.0.43: + version "0.0.43" + resolved "https://registry.yarnpkg.com/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb" + integrity sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A== + +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== From 4a0d2fa64bdbf75dec41951cca648c11c4f63d17 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 7 Sep 2024 11:31:05 +0100 Subject: [PATCH 2/2] fix: copy d.ts files into built directory --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f9cd9a7..612b5db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revolt-api", - "version": "0.7.16-next.1", + "version": "0.7.16-next.2", "description": "Revolt API Library", "main": "dist/index.js", "module": "esm/index.js", @@ -10,7 +10,7 @@ "license": "MIT", "scripts": { "gen": "REWRITE_ANYOF=1 openapi-typescript ./OpenAPI.json -o ./src/api.d.ts && node codegen.js", - "build": "yarn gen && rimraf dist esm && tsc && tsc -p tsconfig.esm.json", + "build": "yarn gen && rimraf dist esm && tsc && tsc -p tsconfig.esm.json && cp src/api.d.ts src/types.d.ts dist && cp src/api.d.ts src/types.d.ts esm", "typecheck": "tsc --noEmit", "prepublish": "in-publish && yarn build || echo Skipping build." },