diff --git a/assets/openapi.json b/assets/openapi.json index fd2b7c0d04..d6d9342d6f 100644 --- a/assets/openapi.json +++ b/assets/openapi.json @@ -41,110 +41,8 @@ "fingerprint" ] }, - "ApplicationCommandSchema": { - "type": "object", - "properties": { - "id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ], - "type": "number" - }, - "application_id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "guild_id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "name": { - "type": "string" - }, - "name_localizations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name_localized": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string" - }, - "description_localizations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "description_localized": { - "type": "string", - "nullable": true - }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationCommandOption" - } - }, - "default_member_permissions": { - "type": "string", - "nullable": true - }, - "dm_permission": { - "type": "boolean" - }, - "permissions": { - "$ref": "#/components/schemas/ApplicationCommandIndexPermissions" - }, - "nsfw": { - "type": "boolean" - }, - "integration_types": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationIntegrationType" - } - }, - "global_popularity_rank": { - "type": "integer" - }, - "contexts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InteractionContextType" - } - }, - "version": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "handler": { - "enum": [ - 1, - 2, - 3 - ], - "type": "number" - } - }, - "required": [ - "application_id", - "default_member_permissions", - "description", - "name", - "version" - ] + "BaseSchema": { + "type": "object" }, "ConnectedAccountCommonOAuthTokenResponse": { "type": "object", @@ -182,7 +80,10 @@ "pattern": "^.*Response$" }, "headers": { - "$ref": "#/components/schemas/Record" + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, @@ -406,8 +307,14 @@ "type": "string" }, "max_participants": { - "type": "integer", - "nullable": true + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] }, "name": { "type": "string" @@ -434,7 +341,7 @@ "type": "boolean" }, "flags": { - "type": "integer" + "type": "number" }, "custom_install_url": { "type": "string" @@ -570,7 +477,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/components/schemas/UploadAttachmentRequestSchema" + "type": "object" } } }, @@ -589,8 +496,10 @@ "type": "string" }, "icon_hash": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "member_count": { "type": "integer" @@ -605,8 +514,10 @@ "type": "string" }, "banner_hash": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "game_application_ids": { "type": "array", @@ -621,8 +532,10 @@ } }, "tag": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "badge": { "$ref": "#/components/schemas/GuildBadgeType" @@ -652,8 +565,10 @@ "$ref": "#/components/schemas/GuildVisibilityLevel" }, "custom_banner_hash": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "premium_subscription_count": { "type": "integer" @@ -703,13 +618,21 @@ ] }, "InstanceUserDeleteSchema": { - "$ref": "#/components/schemas/InstanceUserDeleteSchemaContent" + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "persistInstanceBan": { + "type": "boolean" + } + } }, - "UserSettingsUpdateSchema": { + "UserSettingsSchema": { "type": "object", "properties": { "afk_timeout": { - "type": "integer" + "type": "number" }, "allow_accessibility_detection": { "type": "boolean" @@ -718,7 +641,7 @@ "type": "boolean" }, "animate_stickers": { - "type": "integer" + "type": "number" }, "contact_sync_enabled": { "type": "boolean" @@ -729,7 +652,22 @@ "custom_status": { "anyOf": [ { - "$ref": "#/components/schemas/CustomStatus" + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "number" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false }, { "type": "null" @@ -752,13 +690,22 @@ "type": "boolean" }, "explicit_content_filter": { - "type": "integer" + "type": "number" }, "friend_discovery_flags": { - "type": "integer" + "type": "number" }, "friend_source_flags": { - "$ref": "#/components/schemas/FriendSourceFlags" + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "required": [ + "all" + ], + "additionalProperties": false }, "gateway_connected": { "type": "boolean" @@ -769,7 +716,49 @@ "guild_folders": { "type": "array", "items": { - "$ref": "#/components/schemas/GuildFolder" + "type": "object", + "properties": { + "color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "guild_ids" + ], + "additionalProperties": false } }, "guild_positions": { @@ -809,66 +798,116 @@ "type": "boolean" }, "status": { + "type": "string", "enum": [ + "online", + "offline", "dnd", "idle", - "invisible", - "offline", - "online" - ], - "type": "string" + "invisible" + ] }, "stream_notifications_enabled": { "type": "boolean" }, "theme": { + "type": "string", "enum": [ "dark", "light" - ], - "type": "string" + ] }, "timezone_offset": { - "type": "integer" + "type": "number" }, "view_nsfw_guilds": { "type": "boolean" } - } - }, - "UserSettingsSchema": { - "type": "object", - "properties": { - "afk_timeout": { - "type": "integer" - }, - "allow_accessibility_detection": { - "type": "boolean" - }, - "animate_emoji": { - "type": "boolean" - }, - "animate_stickers": { - "type": "integer" - }, - "contact_sync_enabled": { - "type": "boolean" - }, - "convert_emoticons": { - "type": "boolean" - }, - "custom_status": { - "anyOf": [ - { - "$ref": "#/components/schemas/CustomStatus" - }, - { - "type": "null" - } - ] - }, - "default_guilds_restricted": { - "type": "boolean" + }, + "required": [ + "afk_timeout", + "allow_accessibility_detection", + "animate_emoji", + "animate_stickers", + "contact_sync_enabled", + "convert_emoticons", + "custom_status", + "default_guilds_restricted", + "detect_platform_accounts", + "developer_mode", + "disable_games_tab", + "enable_tts_command", + "explicit_content_filter", + "friend_discovery_flags", + "friend_source_flags", + "gateway_connected", + "gif_auto_play", + "guild_folders", + "guild_positions", + "inline_attachment_media", + "inline_embed_media", + "locale", + "message_display_compact", + "native_phone_integration_enabled", + "render_embeds", + "render_reactions", + "restricted_guilds", + "show_current_game", + "status", + "stream_notifications_enabled", + "theme", + "timezone_offset", + "view_nsfw_guilds" + ] + }, + "UserSettingsUpdateSchema": { + "type": "object", + "properties": { + "afk_timeout": { + "type": "number" + }, + "allow_accessibility_detection": { + "type": "boolean" + }, + "animate_emoji": { + "type": "boolean" + }, + "animate_stickers": { + "type": "number" + }, + "contact_sync_enabled": { + "type": "boolean" + }, + "convert_emoticons": { + "type": "boolean" + }, + "custom_status": { + "anyOf": [ + { + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "number" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "default_guilds_restricted": { + "type": "boolean" }, "detect_platform_accounts": { "type": "boolean" @@ -883,13 +922,22 @@ "type": "boolean" }, "explicit_content_filter": { - "type": "integer" + "type": "number" }, "friend_discovery_flags": { - "type": "integer" + "type": "number" }, "friend_source_flags": { - "$ref": "#/components/schemas/FriendSourceFlags" + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "required": [ + "all" + ], + "additionalProperties": false }, "gateway_connected": { "type": "boolean" @@ -900,7 +948,49 @@ "guild_folders": { "type": "array", "items": { - "$ref": "#/components/schemas/GuildFolder" + "type": "object", + "properties": { + "color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "guild_ids" + ], + "additionalProperties": false } }, "guild_positions": { @@ -940,229 +1030,507 @@ "type": "boolean" }, "status": { + "type": "string", "enum": [ + "online", + "offline", "dnd", "idle", - "invisible", - "offline", - "online" - ], - "type": "string" + "invisible" + ] }, "stream_notifications_enabled": { "type": "boolean" }, "theme": { + "type": "string", "enum": [ "dark", "light" - ], - "type": "string" + ] }, "timezone_offset": { - "type": "integer" + "type": "number" }, "view_nsfw_guilds": { "type": "boolean" } - }, - "required": [ - "afk_timeout", - "allow_accessibility_detection", - "animate_emoji", - "animate_stickers", - "contact_sync_enabled", - "convert_emoticons", - "custom_status", - "default_guilds_restricted", - "detect_platform_accounts", - "developer_mode", - "disable_games_tab", - "enable_tts_command", - "explicit_content_filter", - "friend_discovery_flags", - "friend_source_flags", - "gateway_connected", - "gif_auto_play", - "guild_folders", - "guild_positions", - "inline_attachment_media", - "inline_embed_media", - "locale", - "message_display_compact", - "native_phone_integration_enabled", - "render_embeds", - "render_reactions", - "restricted_guilds", - "show_current_game", - "status", - "stream_notifications_enabled", - "theme", - "timezone_offset", - "view_nsfw_guilds" - ] + } }, - "IdentifySchema": { + "ActivitySchema": { "type": "object", "properties": { - "token": { - "type": "string" - }, - "properties": { - "type": "object", - "properties": { - "os": { - "type": "string" - }, - "os_atch": { - "type": "string" - }, - "browser": { - "type": "string" - }, - "device": { - "type": "string" - }, - "$os": { - "type": "string" - }, - "$browser": { - "type": "string" - }, - "$device": { - "type": "string" - }, - "browser_user_agent": { - "type": "string" - }, - "browser_version": { - "type": "string" - }, - "os_version": { - "type": "string" - }, - "referrer": { - "type": "string" - }, - "referring_domain": { - "type": "string" - }, - "referrer_current": { - "type": "string" - }, - "referring_domain_current": { - "type": "string" - }, - "release_channel": { - "enum": [ - "canary", - "dev", - "ptb", - "stable" - ], - "type": "string" - }, - "client_build_number": { - "type": "integer" - }, - "client_event_source": { - "type": "string" - }, - "client_version": { - "type": "string" - }, - "system_locale": { - "type": "string" - } - }, - "additionalProperties": false - }, - "intents": { - "type": "number" - }, - "presence": { - "$ref": "#/components/schemas/ActivitySchema" - }, - "compress": { + "afk": { "type": "boolean" }, - "large_threshold": { - "type": "integer" - }, - "largeThreshold": { - "type": "integer" + "status": { + "type": "string" }, - "shard": { - "minItems": 2, - "maxItems": 2, + "activities": { "type": "array", "items": { - "type": "number" - } - }, - "guild_subscriptions": { - "type": "boolean" - }, - "capabilities": { - "type": "integer" + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "number" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "number" + }, + "timestamps": { + "type": "object", + "properties": { + "start": { + "type": "number" + }, + "end": { + "type": "number" + } + }, + "additionalProperties": false + }, + "application_id": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "state": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emoji": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "party": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "size": { + "minItems": 2, + "maxItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "additionalProperties": false + }, + "assets": { + "type": "object", + "properties": { + "large_image": { + "type": "string" + }, + "large_text": { + "type": "string" + }, + "small_image": { + "type": "string" + }, + "small_text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "secrets": { + "type": "object", + "properties": { + "join": { + "type": "string" + }, + "spectate": { + "type": "string" + }, + "match": { + "type": "string" + } + }, + "additionalProperties": false + }, + "instance": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "sync_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "context_uri": { + "type": "string" + }, + "album_id": { + "type": "string" + }, + "artist_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "string" + } + }, + "required": [ + "name", + "type" + ], + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "number" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "number" + }, + "timestamps": { + "type": "object", + "properties": { + "start": { + "type": "number" + }, + "end": { + "type": "number" + } + }, + "additionalProperties": false + }, + "application_id": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "state": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emoji": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "party": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "size": { + "minItems": 2, + "maxItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "additionalProperties": false + }, + "assets": { + "type": "object", + "properties": { + "large_image": { + "type": "string" + }, + "large_text": { + "type": "string" + }, + "small_image": { + "type": "string" + }, + "small_text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "secrets": { + "type": "object", + "properties": { + "join": { + "type": "string" + }, + "spectate": { + "type": "string" + }, + "match": { + "type": "string" + } + }, + "additionalProperties": false + }, + "instance": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "sync_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "context_uri": { + "type": "string" + }, + "album_id": { + "type": "string" + }, + "artist_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "number" + }, + "platform": { + "type": "string" + }, + "supported_platforms": { + "type": "array", + "items": { + "type": "string" + } + }, + "parent_application_id": { + "type": "string" + }, + "status_display_type": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "details_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "state_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "buttons": { + "maxItems": 2, + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "type" + ], + "additionalProperties": {} + } + ] + } }, - "client_state": { - "type": "object", - "properties": { - "guild_hashes": {}, - "highest_last_message_id": { - "type": "integer" - }, - "read_state_version": { - "type": "integer" - }, - "user_guild_settings_version": { - "type": "integer" - }, - "user_settings_version": { - "type": "integer" - }, - "useruser_guild_settings_version": { - "type": "integer" - }, - "private_channels_version": { - "type": "integer" - }, - "guild_versions": {}, - "api_code_version": { - "type": "integer" + "since": { + "anyOf": [ + { + "type": "number" }, - "initial_guild_id": { - "type": "string" + { + "type": "null" } - }, - "additionalProperties": false + ] + } + }, + "required": [ + "status" + ] + }, + "IdentifySchema": { + "type": "object", + "properties": { + "token": { + "type": "string" }, - "clientState": { - "type": "object", - "properties": { - "guildHashes": {}, - "highestLastMessageId": { - "type": "integer" - }, - "readStateVersion": { - "type": "integer" - }, - "userGuildSettingsVersion": { - "type": "integer" - }, - "useruserGuildSettingsVersion": { - "type": "integer" - }, - "guildVersions": {}, - "apiCodeVersion": { - "type": "integer" + "properties": { + "type": "object" + }, + "compress": { + "type": "boolean" + }, + "large_threshold": { + "type": "integer" + }, + "largeThreshold": { + "type": "integer" + }, + "shard": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "prefixItems": [ + { + "type": "number" }, - "initialGuildId": { - "type": "string" + { + "type": "number" } - }, - "additionalProperties": false + ] + }, + "presence": { + "type": "object" + }, + "intents": { + "type": "number" + }, + "capabilities": { + "type": "integer" + }, + "client_state": { + "type": "object" }, "v": { "type": "integer" @@ -1578,8 +1946,10 @@ "type": "object", "properties": { "reason": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "user": { "type": "object", @@ -1684,13 +2054,26 @@ "region": { "type": "string" }, + "description": { + "type": "string" + }, "icon": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "banner": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] + }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" }, "system_channel_id": { "type": "string" @@ -1705,11 +2088,10 @@ "type": "boolean" }, "splash": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string" + "type": [ + "null", + "string" + ] }, "features": { "type": "array", @@ -1726,15 +2108,9 @@ "system_channel_flags": { "type": "integer" }, - "explicit_content_filter": { - "type": "integer" - }, "public_updates_channel_id": { "type": "string" }, - "afk_timeout": { - "type": "integer" - }, "afk_channel_id": { "type": "string" }, @@ -1748,8 +2124,10 @@ "type": "string" }, "safety_alerts_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } }, "required": [ @@ -2514,7 +2892,19 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "roles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Role" + } + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -2523,9 +2913,6 @@ } } }, - "icon": { - "type": "string" - }, "parent": { "type": "string" }, @@ -2564,35 +2951,42 @@ "type": "object", "additionalProperties": false }, - "roles": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Role" - } - }, "banner": { "type": "string" }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" + }, "channels": { "type": "array", "items": { "$ref": "#/components/schemas/Channel" } }, + "members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Member" + } + }, "system_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "rules_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "splash": { "type": "string" }, - "description": { - "type": "string" - }, "features": { "type": "array", "items": { @@ -2608,19 +3002,17 @@ "system_channel_flags": { "type": "integer" }, - "explicit_content_filter": { - "type": "integer" - }, "public_updates_channel_id": { - "type": "string", - "nullable": true - }, - "afk_timeout": { - "type": "integer" + "type": [ + "null", + "string" + ] }, "afk_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "preferred_locale": { "type": "string" @@ -2655,12 +3047,6 @@ "presence_count": { "type": "integer" }, - "members": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Member" - } - }, "template_id": { "type": "string" }, @@ -2718,7 +3104,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "bans", "channel_ordering", "channels", @@ -2748,6 +3134,9 @@ "APIPublicUser": { "type": "object", "properties": { + "discriminator": { + "type": "string" + }, "id": { "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", "type": "string" @@ -2777,9 +3166,6 @@ "username": { "type": "string" }, - "discriminator": { - "type": "string" - }, "public_flags": { "type": "integer" }, @@ -2828,6 +3214,9 @@ "email": { "type": "string" }, + "discriminator": { + "type": "string" + }, "id": { "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", "type": "string" @@ -2863,9 +3252,6 @@ "username": { "type": "string" }, - "discriminator": { - "type": "string" - }, "public_flags": { "type": "integer" }, @@ -2918,7 +3304,7 @@ "type": "boolean" }, "settings": { - "$ref": "#/components/schemas/UserSettingsSchema" + "type": "object" } }, "required": [ @@ -2967,6 +3353,9 @@ "email": { "type": "string" }, + "discriminator": { + "type": "string" + }, "id": { "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", "type": "string" @@ -3002,9 +3391,6 @@ "username": { "type": "string" }, - "discriminator": { - "type": "string" - }, "public_flags": { "type": "integer" }, @@ -3057,7 +3443,7 @@ "type": "boolean" }, "settings": { - "$ref": "#/components/schemas/UserSettingsSchema" + "type": "object" } }, "required": [ @@ -3135,39 +3521,53 @@ "default": "Spacebar Instance" }, "serverName": { - "type": "string", - "default": null, - "nullable": true + "type": [ + "null", + "string" + ], + "default": null }, "instanceDescription": { - "type": "string", - "default": "This is a Spacebar instance made in the pre-release days", - "nullable": true + "type": [ + "null", + "string" + ], + "default": "This is a Spacebar instance made in the pre-release days" }, "frontPage": { - "type": "string", - "default": null, - "nullable": true + "type": [ + "null", + "string" + ], + "default": null }, "tosPage": { - "type": "string", - "default": null, - "nullable": true + "type": [ + "null", + "string" + ], + "default": null }, "correspondenceEmail": { - "type": "string", - "default": null, - "nullable": true + "type": [ + "null", + "string" + ], + "default": null }, "correspondenceUserID": { - "type": "string", - "default": null, - "nullable": true + "type": [ + "null", + "string" + ], + "default": null }, "image": { - "type": "string", - "default": null, - "nullable": true + "type": [ + "null", + "string" + ], + "default": null }, "instanceId": { "type": "string" @@ -3358,13 +3758,26 @@ "region": { "type": "string" }, + "description": { + "type": "string" + }, "icon": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "banner": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] + }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" }, "system_channel_id": { "type": "string" @@ -3379,11 +3792,10 @@ "type": "boolean" }, "splash": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string" + "type": [ + "null", + "string" + ] }, "features": { "type": "array", @@ -3400,15 +3812,9 @@ "system_channel_flags": { "type": "integer" }, - "explicit_content_filter": { - "type": "integer" - }, "public_updates_channel_id": { "type": "string" }, - "afk_timeout": { - "type": "integer" - }, "afk_channel_id": { "type": "string" }, @@ -3422,8 +3828,10 @@ "type": "string" }, "safety_alerts_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } }, "required": [ @@ -3480,40 +3888,165 @@ "user": { "$ref": "#/components/schemas/UserLimits" }, - "guild": { - "$ref": "#/components/schemas/GuildLimits" + "guild": { + "$ref": "#/components/schemas/GuildLimits" + }, + "message": { + "$ref": "#/components/schemas/MessageLimits" + }, + "channel": { + "$ref": "#/components/schemas/ChannelLimits" + }, + "rate": { + "$ref": "#/components/schemas/RateLimits" + }, + "absoluteRate": { + "$ref": "#/components/schemas/GlobalRateLimits" + } + }, + "required": [ + "absoluteRate", + "channel", + "guild", + "message", + "rate", + "user" + ] + }, + "APIStickerPackArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StickerPack" + } + }, + "APIConnectionsConfiguration": { + "type": "object" + }, + "WhoAmIResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "device_id": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "rights": { + "type": "integer" + }, + "logged_in_since": { + "type": "string" + } + }, + "required": [ + "device_id", + "flags", + "id", + "logged_in_since", + "rights" + ] + }, + "ConfigObjectResponse": { + "type": "object" + }, + "APIAutomodRule": { + "type": "object", + "properties": { + "creator": { + "$ref": "#/components/schemas/User" + }, + "enabled": { + "type": "boolean" + }, + "event_type": { + "$ref": "#/components/schemas/AutomodRuleEventType" }, - "message": { - "$ref": "#/components/schemas/MessageLimits" + "exempt_channels": { + "type": "array", + "items": { + "type": "string" + } }, - "channel": { - "$ref": "#/components/schemas/ChannelLimits" + "exempt_roles": { + "type": "array", + "items": { + "type": "string" + } }, - "rate": { - "$ref": "#/components/schemas/RateLimits" + "guild_id": { + "type": "string" }, - "absoluteRate": { - "$ref": "#/components/schemas/GlobalRateLimits" + "name": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "trigger_type": { + "$ref": "#/components/schemas/AutomodRuleTriggerType" + }, + "trigger_metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/AutomodMentionSpamRule" + }, + { + "$ref": "#/components/schemas/AutomodSuspectedSpamRule" + }, + { + "$ref": "#/components/schemas/AutomodCommonlyFlaggedWordsRule" + }, + { + "$ref": "#/components/schemas/AutomodCustomWordsRule" + } + ] + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AutomodAction" + } + }, + "id": { + "type": "string" + }, + "__@annotationsKey@14092": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } } }, "required": [ - "absoluteRate", - "channel", - "guild", - "message", - "rate", - "user" + "__@annotationsKey@14092", + "actions", + "creator", + "enabled", + "event_type", + "exempt_channels", + "exempt_roles", + "guild_id", + "id", + "name", + "position", + "trigger_type" ] }, - "APIStickerPackArray": { + "APIAutomodRuleArray": { "type": "array", "items": { - "$ref": "#/components/schemas/StickerPack" + "$ref": "#/components/schemas/AutomodRule" } }, - "APIConnectionsConfiguration": { - "type": "object" - }, "UpdatesResponse": { "type": "object", "properties": { @@ -3527,8 +4060,10 @@ "type": "string" }, "notes": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } }, "required": [ @@ -3757,15 +4292,14 @@ "type": "string" }, "read_state_type": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "channel_id", - "message_id", - "read_state_type" - ] + "message_id" + ], + "additionalProperties": false } } }, @@ -3773,29 +4307,6 @@ "read_states" ] }, - "ActivitySchema": { - "type": "object", - "properties": { - "afk": { - "type": "boolean" - }, - "status": { - "$ref": "#/components/schemas/Status" - }, - "activities": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Activity" - } - }, - "since": { - "type": "integer" - } - }, - "required": [ - "status" - ] - }, "ApplicationAuthorizeSchema": { "type": "object", "properties": { @@ -3812,9 +4323,9 @@ "type": "string" }, "code": { + "type": "string", "minLength": 6, - "maxLength": 6, - "type": "string" + "maxLength": 6 } }, "required": [ @@ -3823,93 +4334,6 @@ "permissions" ] }, - "AutomodMentionSpamRuleSchema": { - "type": "object", - "properties": { - "mention_total_limit": { - "type": "integer" - }, - "mention_raid_protection_enabled": { - "type": "boolean" - } - }, - "required": [ - "mention_raid_protection_enabled", - "mention_total_limit" - ] - }, - "AutomodSuspectedSpamRuleSchema": { - "type": "object" - }, - "AutomodCommonlyFlaggedWordsRuleSchema": { - "type": "object", - "properties": { - "allow_list": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 - }, - "presets": { - "type": "array", - "items": [ - { - "type": "integer" - } - ], - "minItems": 1, - "maxItems": 1 - } - }, - "required": [ - "allow_list", - "presets" - ] - }, - "AutomodCustomWordsRuleSchema": { - "type": "object", - "properties": { - "allow_list": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 - }, - "keyword_filter": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 - }, - "regex_patterns": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 - } - }, - "required": [ - "allow_list", - "keyword_filter", - "regex_patterns" - ] - }, "AutomodRuleSchema": { "type": "object", "properties": { @@ -3920,27 +4344,19 @@ "type": "boolean" }, "event_type": { - "type": "integer" + "type": "number" }, "exempt_channels": { "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 + "items": { + "type": "string" + } }, "exempt_roles": { "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 + "items": { + "type": "string" + } }, "guild_id": { "type": "string" @@ -3949,24 +4365,84 @@ "type": "string" }, "position": { - "type": "integer" + "type": "number" }, "trigger_type": { - "type": "integer" + "type": "number" }, "trigger_metadata": { "anyOf": [ { - "$ref": "#/components/schemas/AutomodMentionSpamRuleSchema" + "type": "object", + "properties": { + "mention_total_limit": { + "type": "number" + }, + "mention_raid_protection_enabled": { + "type": "boolean" + } + }, + "required": [ + "mention_total_limit", + "mention_raid_protection_enabled" + ], + "additionalProperties": false }, { - "$ref": "#/components/schemas/AutomodSuspectedSpamRuleSchema" + "type": "object", + "properties": {}, + "additionalProperties": false }, { - "$ref": "#/components/schemas/AutomodCommonlyFlaggedWordsRuleSchema" + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "presets": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "allow_list", + "presets" + ], + "additionalProperties": false }, { - "$ref": "#/components/schemas/AutomodCustomWordsRuleSchema" + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyword_filter": { + "type": "array", + "items": { + "type": "string" + } + }, + "regex_patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "allow_list", + "keyword_filter", + "regex_patterns" + ], + "additionalProperties": false } ] } @@ -3980,16 +4456,14 @@ "guild_id", "name", "position", - "trigger_metadata", - "trigger_type" + "trigger_type", + "trigger_metadata" ] }, "BackupCodesChallengeSchema": { "type": "object", "properties": { "password": { - "minLength": 1, - "maxLength": 72, "type": "string" } }, @@ -3999,15 +4473,15 @@ }, "BanCreateSchema": { "type": "object", - "properties": { - "delete_message_seconds": { - "type": "integer" + "properties": { + "reason": { + "type": "string" }, "delete_message_days": { - "type": "integer" + "type": "number" }, - "reason": { - "type": "string" + "delete_message_seconds": { + "type": "number" } } }, @@ -4031,10 +4505,10 @@ } }, "required": [ - "executor_id", - "guild_id", "id", - "user_id" + "user_id", + "guild_id", + "executor_id" ] }, "BanRegistrySchema": { @@ -4053,17 +4527,28 @@ "type": "string" }, "ip": { - "type": "string" + "anyOf": [ + { + "type": "string", + "format": "ipv4", + "pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$" + }, + { + "type": "string", + "format": "ipv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$" + } + ] }, "reason": { "type": "string" } }, "required": [ - "executor_id", - "guild_id", "id", - "user_id" + "user_id", + "guild_id", + "executor_id" ] }, "BotModifySchema": { @@ -4090,7 +4575,7 @@ } }, "delete_message_seconds": { - "type": "integer" + "type": "number" } }, "required": [ @@ -4146,8 +4631,10 @@ "type": "string" }, "icon": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "bitrate": { "type": "integer" @@ -4167,28 +4654,7 @@ "permission_overwrites": { "type": "array", "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/ChannelPermissionOverwriteType" - }, - "allow": { - "type": "string" - }, - "deny": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "allow", - "deny", - "id", - "type" - ] + "type": "object" } }, "applied_tags": { @@ -4213,8 +4679,10 @@ "type": "integer" }, "default_reaction_emoji": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "flags": { "type": "integer" @@ -4237,38 +4705,7 @@ "available_tags": { "type": "array", "items": { - "additionalProperties": false, - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "moderated": { - "type": [ - "null", - "boolean" - ] - }, - "emoji_id": { - "type": [ - "null", - "string" - ] - }, - "emoji_name": { - "type": [ - "null", - "string" - ] - }, - "id": { - "type": "string" - } - }, - "required": [ - "id", - "name" - ] + "type": "object" } } } @@ -4276,24 +4713,24 @@ "ChannelPermissionOverwriteSchema": { "type": "object", "properties": { - "allow": { + "id": { "type": "string" }, - "deny": { - "type": "string" + "type": { + "type": "number" }, - "id": { + "allow": { "type": "string" }, - "type": { - "$ref": "#/components/schemas/ChannelPermissionOverwriteType" + "deny": { + "type": "string" } }, "required": [ - "allow", - "deny", "id", - "type" + "type", + "allow", + "deny" ] }, "ChannelReorderSchema": { @@ -4305,22 +4742,26 @@ "type": "string" }, "position": { - "type": "integer" + "type": "number" }, "lock_permissions": { "type": "boolean" }, "parent_id": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] } }, - "additionalProperties": false, "required": [ "id" - ] + ], + "additionalProperties": false } }, "CodesVerificationSchema": { @@ -4335,11 +4776,7 @@ "regenerate": { "type": "boolean" } - }, - "required": [ - "key", - "nonce" - ] + } }, "ConnectedAccountSchema": { "type": "object", @@ -4350,9 +4787,7 @@ "user_id": { "type": "string" }, - "token_data": { - "$ref": "#/components/schemas/ConnectedAccountTokenData" - }, + "token_data": {}, "friend_sync": { "type": "boolean" }, @@ -4363,7 +4798,7 @@ "type": "boolean" }, "show_activity": { - "type": "integer" + "type": "number" }, "type": { "type": "string" @@ -4372,7 +4807,7 @@ "type": "boolean" }, "visibility": { - "type": "integer" + "type": "number" }, "integrations": { "type": "array", @@ -4382,17 +4817,20 @@ }, "metadata_": {}, "metadata_visibility": { - "type": "integer" + "type": "number" }, "two_way_link": { "type": "boolean" + }, + "access_token": { + "type": "string" } }, "required": [ "external_id", + "user_id", "name", - "type", - "user_id" + "type" ] }, "ConnectionCallbackSchema": { @@ -4410,12 +4848,15 @@ "friend_sync": { "type": "boolean" }, - "openid_params": {} + "openid_params": { + "type": "object", + "additionalProperties": {} + } }, "required": [ - "friend_sync", + "state", "insecure", - "state" + "friend_sync" ] }, "ConnectionUpdateSchema": { @@ -4462,7 +4903,9 @@ "type": "boolean" }, "email": { - "type": "string" + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "use_verification_code": { "type": "boolean" @@ -4481,7 +4924,9 @@ "type": "object", "properties": { "email": { - "type": "string" + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "guild_id": { "type": "string" @@ -4491,9 +4936,9 @@ } }, "required": [ - "code", "email", - "guild_id" + "guild_id", + "code" ] }, "EmojiCreateSchema": { @@ -4506,8 +4951,14 @@ "type": "string" }, "require_colons": { - "type": "boolean", - "nullable": true + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] }, "roles": { "type": "array", @@ -4554,56 +5005,189 @@ "sticker_ids": { "type": "array", "items": { - "type": "string" + "type": "string" + } + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + } + }, + "required": [ + "message_id" + ], + "additionalProperties": false + } + }, + "required": [ + "sticker_ids" + ] + }, + "ChannelCreateSchema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 2, + 255, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "type": "number" + }, + "position": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "flags": { + "type": "integer" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "parent_id": { + "type": "string" + }, + "default_auto_archive_duration": { + "type": "integer" + }, + "permission_overwrites": { + "type": "array", + "items": { + "type": "object" } }, - "allowed_mentions": { - "$ref": "#/components/schemas/AllowedMentions" + "video_quality_mode": { + "type": "integer" }, - "message_reference": { - "type": "object", - "properties": { - "message_id": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "fail_if_not_exists": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "message_id" + "bitrate": { + "type": "integer" + }, + "user_limit": { + "type": "integer" + }, + "nsfw": { + "type": "boolean" + }, + "rate_limit_per_user": { + "type": "integer" + }, + "topic": { + "type": "string" + }, + "default_thread_rate_limit_per_user": { + "type": "integer" + }, + "invitable": { + "type": "boolean" + }, + "rtc_region": { + "type": "string" + }, + "default_reaction_emoji": { + "type": [ + "null", + "string" ] + }, + "auto_archive_duration": { + "type": "integer" + }, + "archived": { + "type": "boolean" + }, + "locked": { + "type": "boolean" } - }, - "required": [ - "sticker_ids" - ] + } }, "GuildCreateSchema": { "type": "object", "properties": { "name": { - "maxLength": 100, "type": "string" }, "region": { "type": "string" }, "icon": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "channels": { "type": "array", "items": { - "$ref": "#/components/schemas/ChannelCreateSchema" + "type": "object" } }, "system_channel_id": { @@ -4620,20 +5204,6 @@ } } }, - "GuildSubscriptionsBulkSchema": { - "type": "object", - "properties": { - "subscriptions": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/GuildSubscriptionSchema" - } - } - }, - "required": [ - "subscriptions" - ] - }, "GuildSubscriptionSchema": { "type": "object", "properties": { @@ -4644,17 +5214,11 @@ "items": { "type": "array", "items": { - "type": "integer" + "type": "number" } } } }, - "members": { - "type": "array", - "items": { - "type": "string" - } - }, "activities": { "type": "boolean" }, @@ -4662,8 +5226,14 @@ "type": "boolean" }, "typing": { - "const": true, - "type": "boolean" + "type": "boolean", + "const": true + }, + "members": { + "type": "array", + "items": { + "type": "string" + } }, "member_updates": { "type": "boolean" @@ -4674,6 +5244,58 @@ } } }, + "GuildSubscriptionsBulkSchema": { + "type": "object", + "properties": { + "subscriptions": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "channels": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "activities": { + "type": "boolean" + }, + "threads": { + "type": "boolean" + }, + "typing": { + "type": "boolean", + "const": true + }, + "members": { + "type": "array", + "items": { + "type": "string" + } + }, + "member_updates": { + "type": "boolean" + }, + "thread_member_lists": { + "type": "array", + "items": {} + } + }, + "additionalProperties": false + } + } + }, + "required": [ + "subscriptions" + ] + }, "GuildTemplateCreateSchema": { "type": "object", "properties": { @@ -4681,8 +5303,14 @@ "type": "string" }, "icon": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, "required": [ @@ -4692,13 +5320,41 @@ "GuildUpdateSchema": { "type": "object", "properties": { + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "system_channel_id": { + "type": "string" + }, + "rules_channel_id": { + "type": "string" + }, + "guild_template_code": { + "type": "string" + }, + "staff_only": { + "type": "boolean" + }, "banner": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "splash": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "description": { "type": "string" @@ -4740,37 +5396,26 @@ "type": "string" }, "safety_alerts_channel_id": { - "type": "string", - "nullable": true - }, - "name": { - "maxLength": 100, - "type": "string" - }, - "region": { - "type": "string" - }, - "icon": { - "type": "string", - "nullable": true - }, - "system_channel_id": { - "type": "string" - }, - "rules_channel_id": { - "type": "string" - }, - "guild_template_code": { - "type": "string" - }, - "staff_only": { - "type": "boolean" + "type": [ + "null", + "string" + ] } } }, "GuildUpdateWelcomeScreenSchema": { "type": "object", "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, "welcome_channels": { "type": "array", "items": { @@ -4789,18 +5434,15 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "channel_id", "description" - ] + ], + "additionalProperties": false } }, "enabled": { "type": "boolean" - }, - "description": { - "type": "string" } } }, @@ -4808,7 +5450,9 @@ "type": "object", "properties": { "email": { - "type": "string" + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "school": { "type": "string" @@ -4826,16 +5470,13 @@ "type": "string" }, "target_type": { - "type": "string" - }, - "validate": { - "type": "string" + "type": "number" }, "max_age": { - "type": "integer" + "type": "number" }, "max_uses": { - "type": "integer" + "type": "number" }, "temporary": { "type": "boolean" @@ -4843,14 +5484,8 @@ "unique": { "type": "boolean" }, - "target_user": { - "type": "string" - }, - "target_user_type": { - "type": "integer" - }, "flags": { - "type": "integer" + "type": "number" } } }, @@ -4928,9 +5563,9 @@ "type": "string" }, "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "undelete": { "type": "boolean" @@ -4953,31 +5588,44 @@ "MemberChangeProfileSchema": { "type": "object", "properties": { - "banner": { - "type": "string", - "nullable": true - }, "nick": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "bio": { "type": "string" }, + "banner": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, "pronouns": { "type": "string" }, "theme_colors": { - "items": [ + "anyOf": [ { - "type": "integer" + "type": "array", + "items": { + "type": "number" + } }, { - "type": "integer" + "type": "null" } - ], - "type": "array", - "minItems": 2, - "maxItems": 2 + ] } } }, @@ -4991,18 +5639,37 @@ } }, "nick": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "avatar": { - "type": "string", - "nullable": true - }, - "bio": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "communication_disabled_until": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "number" } } }, @@ -5020,26 +5687,20 @@ "MessageAcknowledgeSchema": { "type": "object", "properties": { + "token": { + "type": "string" + }, "manual": { "type": "boolean" }, "mention_count": { - "type": "integer" + "type": "number" }, "flags": { - "enum": [ - 0, - 1, - 2, - 4 - ], "type": "number" }, "last_viewed": { - "type": "integer" - }, - "token": { - "type": "string" + "type": "number" } } }, @@ -5047,18 +5708,16 @@ "type": "object", "properties": { "read_state_type": { + "type": "number", "enum": [ 0, 1, 2, - 3, - 4, - 5 - ], - "type": "number" + 3 + ] }, "version": { - "type": "integer" + "type": "number" } } }, @@ -5066,7 +5725,7 @@ "type": "object", "properties": { "type": { - "type": "integer" + "type": "number" }, "content": { "type": "string" @@ -5084,15 +5743,13 @@ "type": "boolean" }, "flags": { - "type": "integer" + "type": "number" }, "embeds": { "anyOf": [ { "type": "array", - "items": { - "$ref": "#/components/schemas/Embed" - } + "items": {} }, { "type": "null" @@ -5101,9 +5758,7 @@ }, "embed": { "anyOf": [ - { - "$ref": "#/components/schemas/Embed" - }, + {}, { "type": "null" } @@ -5152,7 +5807,7 @@ "type": "boolean" }, "type": { - "type": "integer" + "type": "number" } }, "additionalProperties": false @@ -5167,13 +5822,12 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename" - ] + ], + "additionalProperties": false }, "attachments": { - "description": "TODO: we should create an interface for attachments\nTODO: OpenWAAO<-->attachment-style metadata conversion", "type": "array", "items": { "anyOf": [ @@ -5187,11 +5841,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "filename", - "id" - ] + "id", + "filename" + ], + "additionalProperties": false }, { "type": "object", @@ -5209,11 +5863,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename", "uploaded_filename" - ] + ], + "additionalProperties": false } ] } @@ -5235,9 +5889,7 @@ "anyOf": [ { "type": "array", - "items": { - "$ref": "#/components/schemas/ActionRowComponent" - } + "items": {} }, { "type": "null" @@ -5245,7 +5897,54 @@ ] }, "poll": { - "$ref": "#/components/schemas/PollCreationSchema" + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false }, "enforce_nonce": { "type": "boolean" @@ -5262,138 +5961,62 @@ "avatar_url": { "type": "string" }, - "interaction": { - "$ref": "#/components/schemas/MessageInteractionSchema" - }, - "interaction_metadata": { - "$ref": "#/components/schemas/MessageInteractionSchema" - } + "interaction": {}, + "interaction_metadata": {} } }, "PollCreationSchema": { "type": "object", "properties": { "question": { - "$ref": "#/components/schemas/PollMedia" + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false }, "answers": { "type": "array", "items": { - "$ref": "#/components/schemas/PollAnswer" + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false } }, "duration": { - "type": "integer" + "type": "number" }, "allow_multiselect": { "type": "boolean" }, "layout_type": { - "type": "integer" - } - }, - "required": [ - "answers", - "question" - ] - }, - "MessageInteractionSchema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/InteractionType" - }, - "name": { - "type": "string" - }, - "command_type": { - "enum": [ - 1, - 2, - 3, - 4 - ], "type": "number" - }, - "ephemerality_reason": { - "type": "integer" - }, - "user": { - "$ref": "#/components/schemas/PublicUser" - }, - "user_id": { - "type": "string" - }, - "authorizing_integration_owners": { - "type": "object", - "properties": {}, - "additionalProperties": true - }, - "original_response_message_id": { - "description": "A container for useful snowflake-related methods.", - "$ref": "#/components/schemas/Snowflake" - }, - "interacted_message_id": { - "description": "A container for useful snowflake-related methods.", - "$ref": "#/components/schemas/Snowflake" - }, - "triggering_interaction_metadata": { - "$ref": "#/components/schemas/MessageInteractionSchema" - }, - "target_user": { - "$ref": "#/components/schemas/PublicUser" - }, - "target_message_id": { - "description": "A container for useful snowflake-related methods.", - "$ref": "#/components/schemas/Snowflake" } }, "required": [ - "id", - "name", - "type" + "question", + "answers" ] }, "MessageEditSchema": { "type": "object", "properties": { - "embed": { - "anyOf": [ - { - "$ref": "#/components/schemas/Embed" - }, - { - "type": "null" - } - ] - }, - "file": { - "type": "object", - "properties": { - "filename": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "filename" - ] - }, - "flags": { - "type": "integer" - }, - "applied_tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "channel_id": { - "type": "string" - }, "content": { "type": "string" }, @@ -5403,22 +6026,34 @@ "nonce": { "type": "string" }, + "channel_id": { + "type": "string" + }, "tts": { "type": "boolean" }, + "flags": { + "type": "number" + }, "embeds": { "anyOf": [ { "type": "array", - "items": { - "$ref": "#/components/schemas/Embed" - } + "items": {} }, { "type": "null" } ] }, + "embed": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + }, "allowed_mentions": { "type": "object", "properties": { @@ -5462,7 +6097,7 @@ "type": "boolean" }, "type": { - "type": "integer" + "type": "number" } }, "additionalProperties": false @@ -5470,8 +6105,19 @@ "payload_json": { "type": "string" }, + "file": { + "type": "object", + "properties": { + "filename": { + "type": "string" + } + }, + "required": [ + "filename" + ], + "additionalProperties": false + }, "attachments": { - "description": "TODO: we should create an interface for attachments\nTODO: OpenWAAO<-->attachment-style metadata conversion", "type": "array", "items": { "anyOf": [ @@ -5485,11 +6131,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "filename", - "id" - ] + "id", + "filename" + ], + "additionalProperties": false }, { "type": "object", @@ -5507,11 +6153,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename", "uploaded_filename" - ] + ], + "additionalProperties": false } ] } @@ -5533,9 +6179,7 @@ "anyOf": [ { "type": "array", - "items": { - "$ref": "#/components/schemas/ActionRowComponent" - } + "items": {} }, { "type": "null" @@ -5543,32 +6187,81 @@ ] }, "poll": { - "$ref": "#/components/schemas/PollCreationSchema" + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false }, "enforce_nonce": { "type": "boolean" }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, "thread_name": { "type": "string" }, "avatar_url": { "type": "string" }, - "interaction": { - "$ref": "#/components/schemas/MessageInteractionSchema" - }, - "interaction_metadata": { - "$ref": "#/components/schemas/MessageInteractionSchema" - } + "interaction": {}, + "interaction_metadata": {} } }, "MfaCodesSchema": { "type": "object", "properties": { "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "regenerate": { "type": "boolean" @@ -5582,17 +6275,17 @@ "type": "object", "properties": { "name": { + "type": "string", "minLength": 2, - "maxLength": 30, - "type": "string" + "maxLength": 30 }, "description": { - "maxLength": 100, - "type": "string" + "type": "string", + "maxLength": 100 }, "tags": { - "maxLength": 200, - "type": "string" + "type": "string", + "maxLength": 200 } }, "required": [ @@ -5604,9 +6297,9 @@ "type": "object", "properties": { "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "token": { "type": "string" @@ -5638,7 +6331,17 @@ "type": "object", "properties": { "days": { - "type": "integer" + "type": "number", + "minimum": 0 + }, + "compute_prune_count": { + "type": "boolean" + }, + "include_roles": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ @@ -5656,8 +6359,8 @@ } }, "required": [ - "after", - "before" + "before", + "after" ] }, "RefreshUrlsRequestSchema": { @@ -5678,20 +6381,21 @@ "type": "object", "properties": { "username": { - "minLength": 2, - "type": "string" + "type": "string", + "minLength": 2 }, "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "consent": { "type": "boolean" }, "email": { + "type": "string", "format": "email", - "type": "string" + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "fingerprint": { "type": "string" @@ -5700,7 +6404,15 @@ "type": "string" }, "date_of_birth": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "format": "date-time" + } + ] }, "gift_code_sku_id": { "type": "string" @@ -5719,30 +6431,39 @@ } }, "required": [ - "consent", - "username" + "username", + "consent" ] }, "RelationshipPostSchema": { "type": "object", "properties": { "discriminator": { - "type": "string" + "type": "number" }, "username": { "type": "string" } }, "required": [ - "discriminator", "username" ] }, "RelationshipPatchSchema": { "type": "object", "properties": { + "type": { + "type": "number" + }, "nickname": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } } }, @@ -5750,16 +6471,20 @@ "type": "object", "properties": { "type": { - "enum": [ - 1, - 2, - 3, - 4 - ], "type": "number" }, "confirm_stranger_request": { "type": "boolean" + }, + "nickname": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } } }, @@ -5769,17 +6494,13 @@ "guild_id": { "anyOf": [ { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 + "type": "string" }, { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } ] }, @@ -5787,21 +6508,21 @@ "type": "string" }, "limit": { - "type": "integer" + "type": "number" }, "presences": { "type": "boolean" }, "user_ids": { "anyOf": [ + { + "type": "string" + }, { "type": "array", "items": { "type": "string" } - }, - { - "type": "string" } ] }, @@ -5823,7 +6544,7 @@ "type": "string" }, "color": { - "type": "integer" + "type": "number" }, "hoist": { "type": "boolean" @@ -5832,7 +6553,7 @@ "type": "boolean" }, "position": { - "type": "integer" + "type": "number" }, "icon": { "type": "string" @@ -5844,25 +6565,33 @@ "type": "object", "properties": { "primary_color": { - "type": "integer" + "type": "number" }, "secondary_color": { - "type": [ - "null", - "integer" + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } ] }, "tertiary_color": { - "type": [ - "null", - "integer" + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } ] } }, - "additionalProperties": false, "required": [ "primary_color" - ] + ], + "additionalProperties": false } } }, @@ -5875,28 +6604,31 @@ "type": "string" }, "position": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "id", "position" - ] + ], + "additionalProperties": false } }, "SelectProtocolSchema": { "type": "object", "properties": { "protocol": { + "type": "string", "enum": [ - "udp", - "webrtc" - ], - "type": "string" + "webrtc", + "udp" + ] }, "data": { "anyOf": [ + { + "type": "string" + }, { "type": "object", "properties": { @@ -5904,21 +6636,18 @@ "type": "string" }, "port": { - "type": "integer" + "type": "number" }, "mode": { "type": "string" } }, - "additionalProperties": false, "required": [ "address", - "mode", - "port" - ] - }, - { - "type": "string" + "port", + "mode" + ], + "additionalProperties": false } ] }, @@ -5931,38 +6660,38 @@ "type": "object", "properties": { "name": { + "type": "string", "enum": [ - "H264", + "opus", "VP8", "VP9", - "opus" - ], - "type": "string" + "H264" + ] }, "type": { + "type": "string", "enum": [ "audio", "video" - ], - "type": "string" + ] }, "priority": { - "type": "integer" + "type": "number" }, "payload_type": { - "type": "integer" + "type": "number" }, "rtx_payload_type": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "name", - "payload_type", + "type", "priority", - "type" - ] + "payload_type" + ], + "additionalProperties": false } }, "rtc_connection_id": { @@ -5970,8 +6699,8 @@ } }, "required": [ - "data", - "protocol" + "protocol", + "data" ] }, "SettingsProtoUpdateSchema": { @@ -5981,7 +6710,7 @@ "type": "string" }, "required_data_version": { - "type": "integer" + "type": "number" } }, "required": [ @@ -5992,10 +6721,11 @@ "type": "object", "properties": { "settings": { - "$ref": "#/components/schemas/JsonValue" + "type": "object", + "additionalProperties": {} }, "required_data_version": { - "type": "integer" + "type": "number" } }, "required": [ @@ -6020,7 +6750,14 @@ "type": "string" }, "description": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, "required": [ @@ -6034,20 +6771,24 @@ "type": "string" }, "description": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } - }, - "required": [ - "name" - ] + } }, "TotpDisableSchema": { "type": "object", "properties": { "code": { + "type": "string", "minLength": 6, - "maxLength": 6, - "type": "string" + "maxLength": 6 } }, "required": [ @@ -6058,14 +6799,14 @@ "type": "object", "properties": { "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "code": { + "type": "string", "minLength": 6, - "maxLength": 6, - "type": "string" + "maxLength": 6 }, "secret": { "type": "string" @@ -6085,12 +6826,24 @@ "type": "string" }, "gift_code_sku_id": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "login_source": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, "required": [ @@ -6104,7 +6857,29 @@ "files": { "type": "array", "items": { - "$ref": "#/components/schemas/UploadAttachmentRequest" + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "file_size": { + "type": "number" + }, + "is_clip": { + "type": "boolean" + }, + "original_content_type": { + "type": "string" + } + }, + "required": [ + "filename", + "file_size" + ], + "additionalProperties": false } } }, @@ -6127,16 +6902,64 @@ "type": "object", "properties": { "channel_overrides": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/ChannelOverride" - } - }, - "version": { - "type": "integer" + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "message_notifications": { + "type": "number" + }, + "mute_config": { + "anyOf": [ + { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "selected_time_window": { + "type": "number" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "message_notifications", + "mute_config", + "muted", + "channel_id" + ], + "additionalProperties": false + } + }, + { + "type": "null" + } + ] }, "message_notifications": { - "type": "integer" + "type": "number" }, "mobile_push": { "type": "boolean" @@ -6144,7 +6967,16 @@ "mute_config": { "anyOf": [ { - "$ref": "#/components/schemas/MuteConfig" + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "selected_time_window": { + "type": "number" + } + }, + "additionalProperties": false }, { "type": "null" @@ -6160,12 +6992,21 @@ "suppress_roles": { "type": "boolean" }, + "version": { + "type": "number" + }, "guild_id": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "flags": { - "type": "integer" + "type": "number" }, "mute_scheduled_events": { "type": "boolean" @@ -6174,8 +7015,8 @@ "type": "boolean" }, "notify_highlights": { - "const": 0, - "type": "number" + "type": "number", + "const": 0 } } }, @@ -6183,54 +7024,68 @@ "type": "object", "properties": { "username": { - "minLength": 2, - "type": "string" + "type": "string", + "minLength": 2 }, "avatar": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "bio": { "type": "string" }, "accent_color": { - "type": "integer" + "type": "number" }, "banner": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "new_password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "code": { + "type": "string", "minLength": 6, - "maxLength": 6, - "type": "string" + "maxLength": 6 }, "email": { + "type": "string", "format": "email", - "type": "string" + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "discriminator": { + "type": "string", "minLength": 4, - "maxLength": 4, - "type": "string" + "maxLength": 4 }, "display_name_colors": { "type": "array", "items": { - "type": "integer" + "type": "number" } }, "display_name_effect_id": { + "type": "number", "enum": [ 0, 1, @@ -6239,16 +7094,14 @@ 4, 5, 6 - ], - "type": "number" + ] }, "display_name_font_id": { + "type": "number", "enum": [ 0, - 1, - 10, 11, - 12, + 1, 2, 3, 4, @@ -6256,9 +7109,10 @@ 6, 7, 8, - 9 - ], - "type": "number" + 9, + 10, + 12 + ] } } }, @@ -6280,28 +7134,40 @@ "type": "string" }, "accent_color": { - "type": "integer", - "nullable": true + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] }, "banner": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "pronouns": { "type": "string" }, "theme_colors": { - "items": [ + "anyOf": [ { - "type": "integer" + "type": "array", + "items": { + "type": "number" + } }, { - "type": "integer" + "type": "null" } - ], - "type": "array", - "minItems": 2, - "maxItems": 2 + ] } } }, @@ -6309,9 +7175,9 @@ "type": "object", "properties": { "code": { + "type": "string", "minLength": 1, - "maxLength": 20, - "type": "string" + "maxLength": 20 } } }, @@ -6319,8 +7185,14 @@ "type": "object", "properties": { "captcha_key": { - "type": "string", - "nullable": true + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "token": { "type": "string" @@ -6353,18 +7225,19 @@ }, "request_to_speak_timestamp": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "suppress": { "type": "boolean" }, "flags": { - "type": "integer" + "type": "number" } }, "required": [ - "self_deaf", - "self_mute" + "self_mute", + "self_deaf" ] }, "GenerateWebAuthnCredentialsSchema": { @@ -6400,10 +7273,36 @@ "WebAuthnPostSchema": { "anyOf": [ { - "$ref": "#/components/schemas/GenerateWebAuthnCredentialsSchema" + "type": "object", + "properties": { + "password": { + "type": "string" + } + }, + "required": [ + "password" + ], + "additionalProperties": false }, { - "$ref": "#/components/schemas/CreateWebAuthnCredentialSchema" + "type": "object", + "properties": { + "credential": { + "type": "string" + }, + "name": { + "type": "string" + }, + "ticket": { + "type": "string" + } + }, + "required": [ + "credential", + "name", + "ticket" + ], + "additionalProperties": false } ] }, @@ -6426,8 +7325,8 @@ "type": "object", "properties": { "name": { - "maxLength": 80, - "type": "string" + "type": "string", + "maxLength": 80 }, "avatar": { "type": "string" @@ -6455,7 +7354,8 @@ "embeds": { "type": "array", "items": { - "$ref": "#/components/schemas/Embed" + "type": "object", + "additionalProperties": {} } }, "allowed_mentions": { @@ -6487,7 +7387,10 @@ }, "components": { "type": "array", - "items": {} + "items": { + "type": "object", + "additionalProperties": {} + } }, "file": { "type": "object", @@ -6496,16 +7399,15 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename" - ] + ], + "additionalProperties": false }, "payload_json": { "type": "string" }, "attachments": { - "description": "TODO: we should create an interface for attachments\nTODO: OpenWAAO<-->attachment-style metadata conversion", "type": "array", "items": { "type": "object", @@ -6517,15 +7419,15 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "filename", - "id" - ] + "id", + "filename" + ], + "additionalProperties": false } }, "flags": { - "type": "integer" + "type": "number" }, "thread_name": { "type": "string" @@ -6552,10 +7454,10 @@ "type": "boolean" } }, - "additionalProperties": false, "required": [ "message_id" - ] + ], + "additionalProperties": false }, "sticker_ids": { "type": "array", @@ -6570,7 +7472,54 @@ "type": "boolean" }, "poll": { - "$ref": "#/components/schemas/PollCreationSchema" + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false } } }, @@ -6581,7 +7530,14 @@ "type": "string" }, "avatar": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "channel_id": { "type": "string" @@ -6599,18 +7555,18 @@ } }, "required": [ - "channel_id", - "enabled" + "enabled", + "channel_id" ] }, "MessageThreadCreationSchema": { "type": "object", "properties": { "auto_archive_duration": { - "type": "integer" + "type": "number" }, "rate_limit_per_user": { - "type": "integer" + "type": "number" }, "name": { "type": "string" @@ -6619,76 +7575,6 @@ "type": "string" }, "type": { - "type": "integer" - } - }, - "required": [ - "name" - ] - }, - "ApplicationCommandCreateSchema": { - "type": "object", - "properties": { - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ], - "type": "number" - }, - "name": { - "type": "string" - }, - "name_localizations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "description_localizations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationCommandOption" - } - }, - "default_member_permissions": { - "type": "string" - }, - "dm_permission": { - "type": "boolean" - }, - "nsfw": { - "type": "boolean" - }, - "integration_types": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationIntegrationType" - } - }, - "contexts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InteractionContextType" - } - }, - "handler": { - "enum": [ - 1, - 2, - 3 - ], "type": "number" } }, @@ -6696,29 +7582,19 @@ "name" ] }, - "BulkApplicationCommandCreateSchema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationCommandCreateSchema" - } - }, "ThreadCreationSchema": { "type": "object", "properties": { "auto_archive_duration": { - "type": "integer" + "type": "number" }, "rate_limit_per_user": { - "type": "integer" + "type": "number" }, "name": { "type": "string" }, "type": { - "enum": [ - 11, - 12 - ], "type": "number" }, "invitable": { @@ -6741,9 +7617,7 @@ }, "embeds": { "type": "array", - "items": { - "$ref": "#/components/schemas/Embed" - } + "items": {} }, "allowed_mentions": { "type": "object", @@ -6776,9 +7650,7 @@ "anyOf": [ { "type": "array", - "items": { - "$ref": "#/components/schemas/ActionRowComponent" - } + "items": {} }, { "type": "null" @@ -6791,14 +7663,12 @@ "type": "string" } }, - "activity": { - "$ref": "#/components/schemas/MessageActivity" - }, + "activity": {}, "application_id": { "type": "string" }, "flags": { - "type": "integer" + "type": "number" }, "attachments": { "type": "array", @@ -6814,11 +7684,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "filename", - "id" - ] + "id", + "filename" + ], + "additionalProperties": false }, { "type": "object", @@ -6836,11 +7706,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename", "uploaded_filename" - ] + ], + "additionalProperties": false } ] } @@ -6850,7 +7720,8 @@ } }, "required": [ - "name" + "name", + "message" ] }, "PostDataSchema": { @@ -6874,146 +7745,39 @@ "type": "string" }, "moderated": { - "type": "boolean", - "nullable": true + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] }, "emoji_id": { - "type": "string", - "nullable": true - }, - "emoji_name": { - "type": "string", - "nullable": true - } - }, - "required": [ - "name" - ] - }, - "ChannelCreateSchema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "enum": [ - 0, - 1, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 2, - 255, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "type": "number" - }, - "id": { - "type": "string" - }, - "flags": { - "type": "integer" - }, - "icon": { - "type": "string", - "nullable": true - }, - "parent_id": { - "type": "string" - }, - "default_auto_archive_duration": { - "type": "integer" - }, - "permission_overwrites": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/ChannelPermissionOverwriteType" - }, - "allow": { - "type": "string" - }, - "deny": { - "type": "string" - } + "anyOf": [ + { + "type": "string" }, - "additionalProperties": false, - "required": [ - "allow", - "deny", - "id", - "type" - ] - } - }, - "video_quality_mode": { - "type": "integer" - }, - "bitrate": { - "type": "integer" - }, - "user_limit": { - "type": "integer" - }, - "nsfw": { - "type": "boolean" - }, - "rate_limit_per_user": { - "type": "integer" - }, - "topic": { - "type": "string" - }, - "default_thread_rate_limit_per_user": { - "type": "integer" - }, - "applied_tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "position": { - "type": "integer" - }, - "invitable": { - "type": "boolean" - }, - "rtc_region": { - "type": "string" - }, - "default_reaction_emoji": { - "type": "string", - "nullable": true - }, - "auto_archive_duration": { - "type": "integer" - }, - "archived": { - "type": "boolean" - }, - "locked": { - "type": "boolean" + { + "type": "null" + } + ] + }, + "emoji_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } - } + }, + "required": [ + "name" + ] }, "VoiceIdentifySchema": { "type": "object", @@ -7042,132 +7806,405 @@ "type": "object", "properties": { "type": { + "type": "string", "enum": [ + "video", "audio", - "screen", - "video" - ], - "type": "string" + "screen" + ] }, "rid": { "type": "string" }, "quality": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ - "quality", + "type", "rid", - "type" - ] + "quality" + ], + "additionalProperties": false } }, "max_secure_frames_version": { - "type": "integer" + "type": "number" }, "max_dave_protocol_version": { - "type": "integer" + "type": "number" } }, "required": [ "server_id", + "user_id", "session_id", - "token", - "user_id" + "token" ] }, "VoiceVideoSchema": { "type": "object", "properties": { "audio_ssrc": { - "type": "integer" + "type": "number" }, "video_ssrc": { - "type": "integer" + "type": "number" }, "rtx_ssrc": { - "type": "integer" + "type": "number" }, "user_id": { "type": "string" }, - "streams": { + "streams": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "video", + "audio", + "screen" + ] + }, + "rid": { + "type": "string" + }, + "ssrc": { + "type": "number" + }, + "active": { + "type": "boolean" + }, + "quality": { + "type": "number" + }, + "rtx_ssrc": { + "type": "number" + }, + "max_bitrate": { + "type": "number" + }, + "max_framerate": { + "type": "number" + }, + "max_resolution": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "width": { + "type": "number" + }, + "height": { + "type": "number" + } + }, + "required": [ + "type", + "width", + "height" + ], + "additionalProperties": false + } + }, + "required": [ + "type", + "rid", + "ssrc", + "active", + "quality", + "rtx_ssrc", + "max_bitrate", + "max_framerate", + "max_resolution" + ], + "additionalProperties": false + } + } + }, + "required": [ + "audio_ssrc", + "video_ssrc" + ] + }, + "ApplicationCommandSchema": { + "type": "object", + "properties": { + "id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "type": { + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "number" + }, + "application_id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "guild_id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name_localized": { + "type": [ + "null", + "string" + ] + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description_localized": { + "type": [ + "null", + "string" + ] + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationCommandOption" + } + }, + "default_member_permissions": { + "type": [ + "null", + "string" + ] + }, + "dm_permission": { + "type": "boolean" + }, + "permissions": { + "$ref": "#/components/schemas/ApplicationCommandIndexPermissions" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationIntegrationType" + } + }, + "global_popularity_rank": { + "type": "integer" + }, + "contexts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InteractionContextType" + } + }, + "version": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "handler": { + "enum": [ + 1, + 2, + 3 + ], + "type": "number" + } + }, + "required": [ + "application_id", + "default_member_permissions", + "description", + "name", + "version" + ] + }, + "ApplicationCommandCreateSchema": { + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "type": "object" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { "type": "array", "items": { - "type": "object", - "properties": { - "type": { - "enum": [ - "audio", - "screen", - "video" - ], - "type": "string" - }, - "rid": { - "type": "string" - }, - "ssrc": { - "type": "integer" - }, - "active": { - "type": "boolean" - }, - "quality": { - "type": "integer" - }, - "rtx_ssrc": { - "type": "integer" - }, - "max_bitrate": { - "type": "integer" - }, - "max_framerate": { - "type": "integer" - }, - "max_resolution": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "width": { - "type": "integer" - }, - "height": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "height", - "type", - "width" - ] - } - }, - "additionalProperties": false, - "required": [ - "active", - "max_bitrate", - "max_framerate", - "max_resolution", - "quality", - "rid", - "rtx_ssrc", - "ssrc", - "type" + "type": "number", + "enum": [ + 0, + 1, + 2 ] } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] } }, "required": [ - "audio_ssrc", - "video_ssrc" + "name" ] }, + "BulkApplicationCommandCreateSchema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "type": "object" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + }, "CreateReportSchema": { "type": "object", "properties": { @@ -7186,7 +8223,7 @@ "breadcrumbs": { "type": "array", "items": { - "type": "integer" + "type": "number" } }, "elements": { @@ -7227,13 +8264,50 @@ } }, "required": [ - "breadcrumbs", + "version", + "variant", + "name", + "language", + "breadcrumbs" + ] + }, + "ReportingMenuResponse": { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "language": { + "type": "string" + }, + "name": { + "type": "string" + }, + "elements": {}, + "nodes": {}, + "root_node_id": { + "type": "string" + } + }, + "required": [ + "elements", "language", "name", + "nodes", + "root_node_id", "variant", "version" ] }, + "ReportingMenuTypesResponse": { + "type": "array", + "items": { + "type": "string" + } + }, "SessionsLogoutSchema": { "type": "object", "properties": { @@ -7273,7 +8347,14 @@ "items": { "type": "array", "items": { - "$ref": "#/components/schemas/Activity" + "anyOf": [ + { + "type": "object" + }, + { + "type": "object" + } + ] } } }, @@ -7335,98 +8416,86 @@ "user_sessions" ] }, - "ApplicationCommandOption": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/ApplicationCommandOptionType" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "choices": { + "JSONType": { + "anyOf": [ + { "type": "array", "items": { - "$ref": "#/components/schemas/ApplicationCommandOptionChoice" + "$ref": "#/components/schemas/JSONType" } }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationCommandOption" + { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/JSONType" } - } - }, - "required": [ - "description", - "name", - "type" - ] - }, - "ApplicationCommandOptionType": { - "type": "number", - "enum": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8 - ] - }, - "ApplicationCommandOptionChoice": { - "type": "object", - "properties": { - "name": { - "type": "string" }, - "value": { + { "type": [ + "null", "string", - "integer" + "integer", + "boolean" ] } - }, - "required": [ - "name", - "value" ] }, - "ApplicationCommandIndexPermissions": { + "PropertyKey": { + "type": [ + "string", + "integer", + "object" + ] + }, + "RegExp": { "type": "object", "properties": { - "user": { + "source": { + "type": "string" + }, + "global": { "type": "boolean" }, - "roles": { - "$ref": "#/components/schemas/Record" + "ignoreCase": { + "type": "boolean" }, - "channels": { - "$ref": "#/components/schemas/Record" + "multiline": { + "type": "boolean" + }, + "lastIndex": { + "type": "integer" + }, + "flags": { + "type": "string" + }, + "sticky": { + "type": "boolean" + }, + "unicode": { + "type": "boolean" + }, + "dotAll": { + "type": "boolean" + }, + "hasIndices": { + "type": "boolean" + }, + "unicodeSets": { + "type": "boolean" } - } - }, - "ApplicationIntegrationType": { - "type": "number", - "enum": [ - 0, - 1 - ] - }, - "InteractionContextType": { - "type": "number", - "enum": [ - 0, - 1, - 2 + }, + "required": [ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "lastIndex", + "multiline", + "source", + "sticky", + "unicode", + "unicodeSets" ] }, "ErrorList": { @@ -7453,7 +8522,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/components/schemas/UploadAttachmentRequestSchema" + "type": "object" } }, "id": { @@ -7485,28 +8554,69 @@ "version" ] }, - "UploadAttachmentRequest": { + "ApplicationCommandOption": { "type": "object", "properties": { - "id": { - "type": "string" + "type": { + "$ref": "#/components/schemas/ApplicationCommandOptionType" }, - "filename": { + "name": { "type": "string" }, - "file_size": { - "type": "integer" + "description": { + "type": "string" }, - "is_clip": { + "required": { "type": "boolean" }, - "original_content_type": { + "choices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationCommandOptionChoice" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationCommandOption" + } + } + }, + "required": [ + "description", + "name", + "type" + ] + }, + "ApplicationCommandOptionType": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ] + }, + "ApplicationCommandOptionChoice": { + "type": "object", + "properties": { + "name": { "type": "string" + }, + "value": { + "type": [ + "string", + "integer" + ] } }, "required": [ - "file_size", - "filename" + "name", + "value" ] }, "InteractionCallbackType": { @@ -7775,7 +8885,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -7786,7 +8896,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "embeds", "flags", @@ -7812,8 +8922,10 @@ "type": "string" }, "icon": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "type": { "$ref": "#/components/schemas/ChannelType" @@ -7840,8 +8952,10 @@ "$ref": "#/components/schemas/Guild" }, "parent_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "parent": { "$ref": "#/components/schemas/Channel" @@ -7963,7 +9077,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -7974,7 +9088,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "created_at", "flags", "id", @@ -8031,7 +9145,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8042,7 +9156,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "channel_id", "closed", @@ -8242,7 +9356,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8253,7 +9367,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "bio", "bot", "connected_accounts", @@ -8351,7 +9465,7 @@ "session_nickname": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8362,7 +9476,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "activities", "client_info", "client_status", @@ -8654,7 +9768,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8665,7 +9779,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "from", "from_id", "id", @@ -8750,7 +9864,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8761,7 +9875,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "external_id", "id", "name", @@ -8964,7 +10078,7 @@ "type": "boolean", "default": true }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8975,7 +10089,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "afk_timeout", "allow_accessibility_detection", "animate_emoji", @@ -9044,8 +10158,10 @@ "type": "object", "properties": { "color": { - "type": "integer", - "nullable": true + "type": [ + "null", + "integer" + ] }, "guild_ids": { "type": "array", @@ -9054,12 +10170,16 @@ } }, "id": { - "type": "integer", - "nullable": true + "type": [ + "null", + "integer" + ] }, "name": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } }, "required": [ @@ -9090,7 +10210,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9101,7 +10221,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "counter", "id", "key_id", @@ -9122,8 +10242,10 @@ "type": "string" }, "expires_at": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } }, "required": [ @@ -9189,8 +10311,10 @@ "type": "string" }, "expires_at": { - "type": "integer", - "nullable": true + "type": [ + "null", + "integer" + ] } }, "required": [ @@ -9205,20 +10329,28 @@ "type": "object", "properties": { "identity_enabled": { - "type": "boolean", - "nullable": true + "type": [ + "null", + "boolean" + ] }, "identity_guild_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "tag": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "badge": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } }, "required": [ @@ -9259,7 +10391,7 @@ "flags": { "$ref": "#/components/schemas/ThreadMemberFlags" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9270,7 +10402,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "flags", "id", @@ -9371,7 +10503,7 @@ "collectibles": { "$ref": "#/components/schemas/Collectibles" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9382,7 +10514,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "banner", "bio", "communication_disabled_until", @@ -9404,8 +10536,10 @@ "type": "object", "properties": { "afk_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "afk_channel": { "$ref": "#/components/schemas/Channel" @@ -9542,15 +10676,19 @@ "type": "integer" }, "public_updates_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "public_updates_channel": { "$ref": "#/components/schemas/Channel" }, "rules_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "rules_channel": { "type": "string" @@ -9562,8 +10700,10 @@ "type": "string" }, "system_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "system_channel": { "$ref": "#/components/schemas/Channel" @@ -9626,7 +10766,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9637,7 +10777,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "bans", "channel_ordering", "channels", @@ -9692,7 +10832,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9703,7 +10843,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "executor", "executor_id", "guild", @@ -9773,7 +10913,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9784,7 +10924,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "color", "colors", "flags", @@ -9857,7 +10997,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9868,7 +11008,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "code", "created_at", "creator", @@ -9926,7 +11066,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9937,7 +11077,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "animated", "available", "groups", @@ -9994,7 +11134,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10005,7 +11145,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "format_type", "id", "name", @@ -10040,7 +11180,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10051,7 +11191,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "id", "name", "stickers" @@ -10132,7 +11272,7 @@ "flags": { "type": "integer" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10143,7 +11283,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "channel_id", "code", @@ -10217,7 +11357,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10228,7 +11368,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "channel_id", "deaf", @@ -10303,7 +11443,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10314,7 +11454,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "application", "application_id", "avatar", @@ -10471,7 +11611,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10482,7 +11622,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "description", "discoverability_state", "discovery_eligibility_flags", @@ -10525,7 +11665,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10536,7 +11676,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "id", "members", "name", @@ -10574,7 +11714,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10585,7 +11725,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "id", "membership_state", "permissions", @@ -10697,8 +11837,10 @@ "type": "integer" }, "guild_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "flags": { "type": "integer" @@ -10743,8 +11885,10 @@ "type": "boolean" }, "channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } }, "required": [ @@ -10865,7 +12009,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10876,7 +12020,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "badge_count", "channel", "channel_id", @@ -10895,17 +12039,14 @@ 0, 1, 2, - 3, - 4, - 5 + 3 ] }, "ReadStateFlags": { "type": "number", "enum": [ 1, - 2, - 4 + 2 ] }, "ThreadMetadata": { @@ -10963,7 +12104,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10974,7 +12115,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "channel_id", "id", @@ -11015,7 +12156,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -11026,7 +12167,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "filename", "id", "message", @@ -11882,6 +13023,9 @@ "PublicUser": { "type": "object", "properties": { + "discriminator": { + "type": "string" + }, "id": { "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", "type": "string" @@ -11911,9 +13055,6 @@ "username": { "type": "string" }, - "discriminator": { - "type": "string" - }, "public_flags": { "type": "integer" }, @@ -12015,12 +13156,16 @@ "type": "object", "properties": { "emoji_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "emoji_name": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "emoji_animated": { "type": "boolean" @@ -12048,17 +13193,6 @@ 3 ] }, - "InstanceUserDeleteSchemaContent": { - "type": "object", - "properties": { - "reason": { - "type": "string" - }, - "persistInstanceBan": { - "type": "boolean" - } - } - }, "Classification": { "type": "object", "properties": { @@ -12342,8 +13476,10 @@ "type": "string" }, "unpublished_at": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "styles": { "$ref": "#/components/schemas/CollectiblesCategoryStyle" @@ -12365,36 +13501,52 @@ ] }, "mobile_bg": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "pdp_bg": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "success_modal_bg": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "mobile_banner": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "featured_block": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "hero_banner": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "wide_banner": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "hero_logo": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "products": { "type": "array", @@ -12477,8 +13629,10 @@ "type": "string" }, "unpublished_at": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "styles": { "$ref": "#/components/schemas/CollectiblesCategoryStyle" @@ -12632,8 +13786,10 @@ "type": "string" }, "unpublished_at": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "styles": { "$ref": "#/components/schemas/CollectiblesCategoryStyle" @@ -12709,8 +13865,10 @@ "type": "object", "properties": { "animated": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "static": { "type": "string" @@ -12780,8 +13938,10 @@ "type": "string" }, "unpublished_at": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "summary": { "type": "string" @@ -12837,19 +13997,25 @@ "type": "string" }, "unpublished_at": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "banner_url": { "type": "string" }, "body_text": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "banner_text_color": { - "type": "integer", - "nullable": true + "type": [ + "null", + "integer" + ] } }, "required": [ @@ -12960,12 +14126,16 @@ "type": "string" }, "global_name": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "avatar": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "avatar_decoration_data": { "anyOf": [ @@ -13014,12 +14184,16 @@ "type": "boolean" }, "banner": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "accent_color": { - "type": "integer", - "nullable": true + "type": [ + "null", + "integer" + ] }, "public_flags": { "type": "integer" @@ -13061,12 +14235,16 @@ "type": "string" }, "icon": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "description": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "features": { "type": "array", @@ -13171,8 +14349,10 @@ "type": "string" }, "edited_timestamp": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "flags": { "type": "integer" @@ -13308,7 +14488,7 @@ "length": { "type": "integer" }, - "__@unscopables@698": { + "__@unscopables@772": { "type": "object", "additionalProperties": false, "patternProperties": { @@ -13437,17 +14617,17 @@ "remove": { "type": "boolean" }, - "__@iterator@696": { + "__@iterator@770": { "type": "boolean" }, - "__@unscopables@698": { + "__@unscopables@772": { "type": "boolean" } } } }, "required": [ - "__@unscopables@698", + "__@unscopables@772", "length" ] }, @@ -13479,7 +14659,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -13490,7 +14670,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "code", "consumed", "expired", @@ -13502,23 +14682,31 @@ "type": "object", "properties": { "icon": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "id": { "type": "string" }, "last_message_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "name": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "origin_channel_id": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "owner_id": { "type": "string" @@ -13547,8 +14735,10 @@ "type": "object", "properties": { "avatar": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "discriminator": { "type": "string" @@ -13601,7 +14791,7 @@ "icon": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -13612,7 +14802,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "id", "is_primary", "localizations", @@ -13877,35 +15067,321 @@ "register": { "$ref": "#/components/schemas/GlobalRateLimit" }, - "sendMessage": { - "$ref": "#/components/schemas/GlobalRateLimit" - } - }, - "required": [ - "register", - "sendMessage" - ] - }, - "GlobalRateLimit": { - "type": "object", - "properties": { - "limit": { - "type": "integer", - "default": 100 + "sendMessage": { + "$ref": "#/components/schemas/GlobalRateLimit" + } + }, + "required": [ + "register", + "sendMessage" + ] + }, + "GlobalRateLimit": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "default": 100 + }, + "window": { + "type": "integer", + "default": 3600000 + }, + "enabled": { + "type": "boolean", + "default": true + } + }, + "required": [ + "enabled", + "limit", + "window" + ] + }, + "AutomodRuleEventType": { + "type": "number", + "enum": [ + 1, + 2 + ] + }, + "AutomodRuleTriggerType": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ] + }, + "AutomodMentionSpamRule": { + "type": "object", + "properties": { + "mention_total_limit": { + "type": "integer" + }, + "mention_raid_protection_enabled": { + "type": "boolean" + } + }, + "required": [ + "mention_raid_protection_enabled", + "mention_total_limit" + ] + }, + "AutomodSuspectedSpamRule": { + "type": "object" + }, + "AutomodCommonlyFlaggedWordsRule": { + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "presets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AutomodKeywordPresetType" + } + } + }, + "required": [ + "allow_list", + "presets" + ] + }, + "AutomodKeywordPresetType": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + }, + "AutomodCustomWordsRule": { + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyword_filter": { + "type": "array", + "items": { + "type": "string" + } + }, + "regex_patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "allow_list", + "keyword_filter", + "regex_patterns" + ] + }, + "AutomodAction": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "integer", + "const": 1 + }, + "metadata": { + "type": "object", + "properties": { + "custom_message": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "required": [ + "metadata", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "integer", + "const": 2 + }, + "metadata": { + "type": "object", + "properties": { + "channel_id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel_id" + ] + } + }, + "additionalProperties": false, + "required": [ + "metadata", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "integer", + "const": 3 + }, + "metadata": { + "type": "object", + "properties": { + "duration_seconds": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "duration_seconds" + ] + } + }, + "additionalProperties": false, + "required": [ + "metadata", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "integer", + "const": 4 + }, + "metadata": { + "type": "object", + "properties": { + "duration_seconds": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "duration_seconds" + ] + } + }, + "additionalProperties": false, + "required": [ + "metadata", + "type" + ] + } + ] + }, + "AutomodRule": { + "type": "object", + "properties": { + "creator": { + "$ref": "#/components/schemas/User" + }, + "enabled": { + "type": "boolean" + }, + "event_type": { + "$ref": "#/components/schemas/AutomodRuleEventType" + }, + "exempt_channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "exempt_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "guild_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "trigger_type": { + "$ref": "#/components/schemas/AutomodRuleTriggerType" + }, + "trigger_metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/AutomodMentionSpamRule" + }, + { + "$ref": "#/components/schemas/AutomodSuspectedSpamRule" + }, + { + "$ref": "#/components/schemas/AutomodCommonlyFlaggedWordsRule" + }, + { + "$ref": "#/components/schemas/AutomodCustomWordsRule" + } + ] + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AutomodAction" + } }, - "window": { - "type": "integer", - "default": 3600000 + "id": { + "type": "string" }, - "enabled": { - "type": "boolean", - "default": true + "__@annotationsKey@14092": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } } }, "required": [ + "__@annotationsKey@14092", + "actions", + "creator", "enabled", - "limit", - "window" + "event_type", + "exempt_channels", + "exempt_roles", + "guild_id", + "id", + "name", + "position", + "trigger_type" ] }, "PublicConnectedAccount": { @@ -13990,7 +15466,7 @@ "link": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -14001,70 +15477,303 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "description", "icon", "id" ] }, - "AllowedMentions": { + "ApplicationCommandIndexPermissions": { + "type": "object", + "properties": { + "user": { + "type": "boolean" + }, + "roles": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "channels": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } + }, + "ApplicationIntegrationType": { + "type": "number", + "enum": [ + 0, + 1 + ] + }, + "InteractionContextType": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + }, + "ApplicationCommandCreateSchemaOption": { "type": "object", "properties": { - "parse": { + "type": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object" + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object" + }, + "required": { + "type": "boolean" + }, + "choices": { "type": "array", "items": { - "enum": [ - "everyone", - "roles", - "users" - ], - "type": "string" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object" + }, + "value": { + "type": [ + "string", + "integer" + ] + } + }, + "additionalProperties": false, + "required": [ + "name", + "value" + ] } }, - "roles": { + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationCommandCreateSchemaOption" + } + }, + "channel_types": { + "type": "array", + "items": { + "type": "integer" + } + }, + "min_value": { + "type": "integer" + }, + "max_value": { + "type": "integer" + }, + "min_length": { + "type": "integer" + }, + "max_length": { + "type": "integer" + }, + "autocomplete": { + "type": "boolean" + } + }, + "required": [ + "description", + "name", + "type" + ] + }, + "AutomodRuleSchemaWithId": { + "type": "object", + "properties": { + "creator_id": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "event_type": { + "type": "number" + }, + "exempt_channels": { "type": "array", "items": { "type": "string" } }, - "users": { + "exempt_roles": { "type": "array", "items": { "type": "string" } }, - "replied_user": { - "type": "boolean" + "guild_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "position": { + "type": "number" + }, + "trigger_type": { + "type": "number" + }, + "trigger_metadata": { + "anyOf": [ + { + "type": "object", + "properties": { + "mention_total_limit": { + "type": "number" + }, + "mention_raid_protection_enabled": { + "type": "boolean" + } + }, + "required": [ + "mention_total_limit", + "mention_raid_protection_enabled" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": {}, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "presets": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "allow_list", + "presets" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyword_filter": { + "type": "array", + "items": { + "type": "string" + } + }, + "regex_patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "allow_list", + "keyword_filter", + "regex_patterns" + ], + "additionalProperties": false + } + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "creator_id", + "enabled", + "event_type", + "exempt_channels", + "exempt_roles", + "guild_id", + "name", + "position", + "trigger_type", + "trigger_metadata", + "id" + ] + }, + "MessageCreateAttachment": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" } - } + }, + "required": [ + "id", + "filename" + ] }, - "MessageActivity": { + "MessageCreateCloudAttachment": { "type": "object", "properties": { - "type": { - "enum": [ - 1, - 3, - 5 - ], - "type": "number" - }, - "session_id": { + "id": { "type": "string" }, - "party_id": { + "filename": { "type": "string" }, - "name_override": { + "uploaded_filename": { "type": "string" }, - "icon_override": { + "original_content_type": { "type": "string" } }, "required": [ - "type" + "filename", + "uploaded_filename" ] + }, + "InstanceUserDeleteSchemaContent": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "persistInstanceBan": { + "type": "boolean" + } + } } } }, @@ -14203,7 +15912,7 @@ } ], "paths": { - "/webhooks/{webhook_id}/": { + "/webhooks/{webhook_id}": { "get": { "security": [ { @@ -14211,13 +15920,14 @@ } ], "description": "Returns a webhook object for the given id. Requires the MANAGE_WEBHOOKS permission or to be the owner of the webhook.", + "summary": "No summary provided", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/APIWebhook" + "$ref": "#/components/schemas/Webhook" } } } @@ -14247,6 +15957,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -14286,12 +15997,32 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookUpdateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "avatar": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false } } } @@ -14340,7 +16071,7 @@ ] } }, - "/webhooks/{webhook_id}/{token}/": { + "/webhooks/{webhook_id}/{token}": { "get": { "security": [ { @@ -14348,13 +16079,14 @@ } ], "description": "Returns a webhook object for the given id and token.", + "summary": "No summary provided", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/APIWebhook" + "$ref": "#/components/schemas/Webhook" } } } @@ -14393,12 +16125,198 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookExecuteSchema" + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "username": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "tts": { + "type": "boolean" + }, + "embeds": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + } + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "components": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + } + }, + "file": { + "type": "object", + "properties": { + "filename": { + "type": "string" + } + }, + "required": [ + "filename" + ], + "additionalProperties": false + }, + "payload_json": { + "type": "string" + }, + "attachments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "required": [ + "id", + "filename" + ], + "additionalProperties": false + } + }, + "flags": { + "type": "number" + }, + "thread_name": { + "type": "string" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + } + }, + "required": [ + "message_id" + ], + "additionalProperties": false + }, + "sticker_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "nonce": { + "type": "string" + }, + "enforce_nonce": { + "type": "boolean" + }, + "poll": { + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false + } + }, + "additionalProperties": false } } } @@ -14469,6 +16387,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -14517,12 +16436,32 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookUpdateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "avatar": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false } } } @@ -14580,19 +16519,205 @@ ] } }, - "/webhooks/{webhook_id}/{token}/github/": { + "/webhooks/{webhook_id}/{token}/github": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookExecuteSchema" + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "username": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "tts": { + "type": "boolean" + }, + "embeds": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + } + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "components": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + } + }, + "file": { + "type": "object", + "properties": { + "filename": { + "type": "string" + } + }, + "required": [ + "filename" + ], + "additionalProperties": false + }, + "payload_json": { + "type": "string" + }, + "attachments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "required": [ + "id", + "filename" + ], + "additionalProperties": false + } + }, + "flags": { + "type": "number" + }, + "thread_name": { + "type": "string" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + } + }, + "required": [ + "message_id" + ], + "additionalProperties": false + }, + "sticker_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "nonce": { + "type": "string" + }, + "enforce_nonce": { + "type": "boolean" + }, + "poll": { + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false + } + }, + "additionalProperties": false } } } @@ -14658,13 +16783,14 @@ ] } }, - "/warp/license/": { + "/warp/license": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -14675,13 +16801,14 @@ ] } }, - "/voice/regions/": { + "/voice/regions": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -14699,13 +16826,14 @@ ] } }, - "/users/@me/settings/": { + "/users/@me/settings": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -14738,12 +16866,208 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserSettingsUpdateSchema" + "type": "object", + "properties": { + "afk_timeout": { + "type": "number" + }, + "allow_accessibility_detection": { + "type": "boolean" + }, + "animate_emoji": { + "type": "boolean" + }, + "animate_stickers": { + "type": "number" + }, + "contact_sync_enabled": { + "type": "boolean" + }, + "convert_emoticons": { + "type": "boolean" + }, + "custom_status": { + "anyOf": [ + { + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "number" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "default_guilds_restricted": { + "type": "boolean" + }, + "detect_platform_accounts": { + "type": "boolean" + }, + "developer_mode": { + "type": "boolean" + }, + "disable_games_tab": { + "type": "boolean" + }, + "enable_tts_command": { + "type": "boolean" + }, + "explicit_content_filter": { + "type": "number" + }, + "friend_discovery_flags": { + "type": "number" + }, + "friend_source_flags": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "required": [ + "all" + ], + "additionalProperties": false + }, + "gateway_connected": { + "type": "boolean" + }, + "gif_auto_play": { + "type": "boolean" + }, + "guild_folders": { + "type": "array", + "items": { + "type": "object", + "properties": { + "color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "guild_ids" + ], + "additionalProperties": false + } + }, + "guild_positions": { + "type": "array", + "items": { + "type": "string" + } + }, + "inline_attachment_media": { + "type": "boolean" + }, + "inline_embed_media": { + "type": "boolean" + }, + "locale": { + "type": "string" + }, + "message_display_compact": { + "type": "boolean" + }, + "native_phone_integration_enabled": { + "type": "boolean" + }, + "render_embeds": { + "type": "boolean" + }, + "render_reactions": { + "type": "boolean" + }, + "restricted_guilds": { + "type": "array", + "items": { + "type": "string" + } + }, + "show_current_game": { + "type": "boolean" + }, + "status": { + "type": "string", + "enum": [ + "online", + "offline", + "dnd", + "idle", + "invisible" + ] + }, + "stream_notifications_enabled": { + "type": "boolean" + }, + "theme": { + "type": "string", + "enum": [ + "dark", + "light" + ] + }, + "timezone_offset": { + "type": "number" + }, + "view_nsfw_guilds": { + "type": "boolean" + } + }, + "additionalProperties": false } } } @@ -14785,13 +17109,14 @@ ] } }, - "/users/@me/settings-proto/2/": { + "/users/@me/settings-proto/2": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -14824,12 +17149,25 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SettingsProtoUpdateSchema" + "type": "object", + "properties": { + "settings": { + "type": "string" + }, + "required_data_version": { + "type": "number" + } + }, + "required": [ + "settings" + ], + "additionalProperties": false } } } @@ -14858,6 +17196,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -14886,12 +17225,26 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SettingsProtoUpdateJsonSchema" + "type": "object", + "properties": { + "settings": { + "type": "object", + "additionalProperties": {} + }, + "required_data_version": { + "type": "number" + } + }, + "required": [ + "settings" + ], + "additionalProperties": false } } } @@ -14929,13 +17282,14 @@ ] } }, - "/users/@me/settings-proto/1/": { + "/users/@me/settings-proto/1": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -14968,12 +17322,25 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SettingsProtoUpdateSchema" + "type": "object", + "properties": { + "settings": { + "type": "string" + }, + "required_data_version": { + "type": "number" + } + }, + "required": [ + "settings" + ], + "additionalProperties": false } } } @@ -15002,6 +17369,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -15030,12 +17398,26 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SettingsProtoUpdateJsonSchema" + "type": "object", + "properties": { + "settings": { + "type": "object", + "additionalProperties": {} + }, + "required_data_version": { + "type": "number" + } + }, + "required": [ + "settings" + ], + "additionalProperties": false } } } @@ -15073,13 +17455,14 @@ ] } }, - "/users/@me/relationships/": { + "/users/@me/relationships": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -15112,12 +17495,25 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RelationshipPostSchema" + "type": "object", + "properties": { + "discriminator": { + "type": "number" + }, + "username": { + "type": "string" + } + }, + "required": [ + "username" + ], + "additionalProperties": false } } } @@ -15159,12 +17555,32 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RelationshipPutSchema" + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "confirm_stranger_request": { + "type": "boolean" + }, + "nickname": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false } } } @@ -15215,12 +17631,29 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RelationshipPatchSchema" + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "nickname": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false } } } @@ -15271,6 +17704,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -15319,6 +17753,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -15362,12 +17797,22 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserNoteUpdateSchema" + "type": "object", + "properties": { + "note": { + "type": "string" + } + }, + "required": [ + "note" + ], + "additionalProperties": false } } } @@ -15403,13 +17848,14 @@ ] } }, - "/users/@me/mfa/webauthn/credentials/": { + "/users/@me/mfa/webauthn/credentials": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -15425,12 +17871,46 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebAuthnPostSchema" + "anyOf": [ + { + "type": "object", + "properties": { + "password": { + "type": "string" + } + }, + "required": [ + "password" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "credential": { + "type": "string" + }, + "name": { + "type": "string" + }, + "ticket": { + "type": "string" + } + }, + "required": [ + "credential", + "name", + "ticket" + ], + "additionalProperties": false + } + ] } } } @@ -15462,13 +17942,14 @@ ] } }, - "/users/@me/mfa/webauthn/credentials/{key_id}/": { + "/users/@me/mfa/webauthn/credentials/{key_id}": { "delete": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -15490,19 +17971,39 @@ ] } }, - "/users/@me/mfa/totp/enable/": { + "/users/@me/mfa/totp/enable": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TotpEnableSchema" + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1, + "maxLength": 72 + }, + "code": { + "type": "string", + "minLength": 6, + "maxLength": 6 + }, + "secret": { + "type": "string" + } + }, + "required": [ + "password" + ], + "additionalProperties": false } } } @@ -15544,19 +18045,31 @@ ] } }, - "/users/@me/mfa/totp/disable/": { + "/users/@me/mfa/totp/disable": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TotpDisableSchema" + "type": "object", + "properties": { + "code": { + "type": "string", + "minLength": 6, + "maxLength": 6 + } + }, + "required": [ + "code" + ], + "additionalProperties": false } } } @@ -15588,7 +18101,7 @@ ] } }, - "/users/@me/mfa/codes/": { + "/users/@me/mfa/codes": { "post": { "security": [ { @@ -15596,13 +18109,28 @@ } ], "description": "This route is replaced with users/@me/mfa/codes-verification in newer clients", + "summary": "No summary provided", "deprecated": true, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MfaCodesSchema" + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1, + "maxLength": 72 + }, + "regenerate": { + "type": "boolean" + } + }, + "required": [ + "password" + ], + "additionalProperties": false } } } @@ -15644,19 +18172,32 @@ ] } }, - "/users/@me/mfa/codes-verification/": { + "/users/@me/mfa/codes-verification": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CodesVerificationSchema" + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "nonce": { + "type": "string" + }, + "regenerate": { + "type": "boolean" + } + }, + "additionalProperties": false } } } @@ -15705,13 +18246,14 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageListResponse" + "$ref": "#/components/schemas/APIMessageArray" } } } @@ -15732,13 +18274,14 @@ ] } }, - "/users/@me/library/": { + "/users/@me/library": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -15749,13 +18292,14 @@ ] } }, - "/users/@me/": { + "/users/@me": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -15778,12 +18322,107 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserModifySchema" + "type": "object", + "properties": { + "username": { + "type": "string", + "minLength": 2 + }, + "avatar": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "bio": { + "type": "string" + }, + "accent_color": { + "type": "number" + }, + "banner": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "password": { + "type": "string", + "minLength": 1, + "maxLength": 72 + }, + "new_password": { + "type": "string", + "minLength": 1, + "maxLength": 72 + }, + "code": { + "type": "string", + "minLength": 6, + "maxLength": 6 + }, + "email": { + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + "discriminator": { + "type": "string", + "minLength": 4, + "maxLength": 4 + }, + "display_name_colors": { + "type": "array", + "items": { + "type": "number" + } + }, + "display_name_effect_id": { + "type": "number", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ] + }, + "display_name_font_id": { + "type": "number", + "enum": [ + 0, + 11, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 12 + ] + } + }, + "additionalProperties": false } } } @@ -15825,13 +18464,14 @@ ] } }, - "/users/@me/guilds/": { + "/users/@me/guilds": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -15856,6 +18496,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -15897,13 +18538,14 @@ ] } }, - "/users/@me/guilds/premium/subscription-slots/": { + "/users/@me/guilds/premium/subscription-slots": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -15914,13 +18556,14 @@ ] } }, - "/users/@me/guilds/{guild_id}/settings/": { + "/users/@me/guilds/{guild_id}/settings": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -15950,12 +18593,133 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserGuildSettingsSchema" + "type": "object", + "properties": { + "channel_overrides": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "message_notifications": { + "type": "number" + }, + "mute_config": { + "anyOf": [ + { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "selected_time_window": { + "type": "number" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "message_notifications", + "mute_config", + "muted", + "channel_id" + ], + "additionalProperties": false + } + }, + { + "type": "null" + } + ] + }, + "message_notifications": { + "type": "number" + }, + "mobile_push": { + "type": "boolean" + }, + "mute_config": { + "anyOf": [ + { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "selected_time_window": { + "type": "number" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "muted": { + "type": "boolean" + }, + "suppress_everyone": { + "type": "boolean" + }, + "suppress_roles": { + "type": "boolean" + }, + "version": { + "type": "number" + }, + "guild_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "number" + }, + "mute_scheduled_events": { + "type": "boolean" + }, + "hide_muted_channels": { + "type": "boolean" + }, + "notify_highlights": { + "type": "number", + "const": 0 + } + }, + "additionalProperties": false } } } @@ -16008,6 +18772,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16018,13 +18783,14 @@ ] } }, - "/users/@me/email-settings/": { + "/users/@me/email-settings": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16035,13 +18801,14 @@ ] } }, - "/users/@me/disable/": { + "/users/@me/disable": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -16072,13 +18839,14 @@ ] } }, - "/users/@me/devices/": { + "/users/@me/devices": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16089,13 +18857,14 @@ ] } }, - "/users/@me/delete/": { + "/users/@me/delete": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -16126,13 +18895,14 @@ ] } }, - "/users/@me/connections/": { + "/users/@me/connections": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16143,19 +18913,32 @@ ] } }, - "/users/@me/connections/{connection_name}/{connection_id}/": { + "/users/@me/connections/{connection_name}/{connection_id}": { "patch": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConnectionUpdateSchema" + "type": "object", + "properties": { + "visibility": { + "type": "boolean" + }, + "show_activity": { + "type": "boolean" + }, + "metadata_visibility": { + "type": "boolean" + } + }, + "additionalProperties": false } } } @@ -16195,6 +18978,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16225,13 +19009,14 @@ ] } }, - "/users/@me/connections/{connection_name}/{connection_id}/access-token/": { + "/users/@me/connections/{connection_name}/{connection_id}/access-token": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16262,13 +19047,14 @@ ] } }, - "/users/@me/collectibles-purchases/": { + "/users/@me/collectibles-purchases": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -16302,13 +19088,14 @@ ] } }, - "/users/@me/collectibles-marketing/": { + "/users/@me/collectibles-marketing": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -16349,13 +19136,14 @@ ] } }, - "/users/@me/channels/": { + "/users/@me/channels": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -16378,12 +19166,34 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DmChannelCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "recipients": { + "type": "array", + "items": { + "type": "string" + } + }, + "recipient_id": { + "type": "string" + }, + "access_tokens": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false } } } @@ -16405,13 +19215,14 @@ ] } }, - "/users/@me/billing/subscriptions/": { + "/users/@me/billing/subscriptions": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16422,13 +19233,14 @@ ] } }, - "/users/@me/billing/payment-sources/": { + "/users/@me/billing/payment-sources": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16444,6 +19256,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16461,6 +19274,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16487,6 +19301,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16513,6 +19328,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16534,13 +19350,14 @@ ] } }, - "/users/@me/billing/location-info/": { + "/users/@me/billing/location-info": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16551,13 +19368,14 @@ ] } }, - "/users/@me/billing/country-code/": { + "/users/@me/billing/country-code": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16568,13 +19386,14 @@ ] } }, - "/users/@me/applications/{application_id}/entitlements/": { + "/users/@me/applications/{application_id}/entitlements": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16596,13 +19415,14 @@ ] } }, - "/users/@me/affinities/users/": { + "/users/@me/affinities/users": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16613,13 +19433,14 @@ ] } }, - "/users/@me/affinities/guilds/": { + "/users/@me/affinities/guilds": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16630,13 +19451,14 @@ ] } }, - "/users/@me/activities/statistics/applications/": { + "/users/@me/activities/statistics/applications": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16647,13 +19469,14 @@ ] } }, - "/users/{user_id}/relationships/": { + "/users/{user_id}/relationships": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -16692,13 +19515,14 @@ ] } }, - "/users/{user_id}/profile/": { + "/users/{user_id}/profile": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -16732,12 +19556,55 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserProfileModifySchema" + "type": "object", + "properties": { + "bio": { + "type": "string" + }, + "accent_color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "banner": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "pronouns": { + "type": "string" + }, + "theme_colors": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false } } } @@ -16763,13 +19630,14 @@ ] } }, - "/users/{user_id}/messages/": { + "/users/{user_id}/messages": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -16808,13 +19676,14 @@ ] } }, - "/users/{user_id}/": { + "/users/{user_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -16843,7 +19712,7 @@ ] } }, - "/users/{user_id}/delete/": { + "/users/{user_id}/delete": { "post": { "x-right-required": "MANAGE_USERS", "security": [ @@ -16851,12 +19720,22 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InstanceUserDeleteSchema" + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "persistInstanceBan": { + "type": "boolean" + } + }, + "additionalProperties": false } } } @@ -16902,8 +19781,10 @@ ] } }, - "/updates/": { + "/updates": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -16941,8 +19822,10 @@ ] } }, - "/track/": { + "/track": { "post": { + "security": [], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -16953,13 +19836,14 @@ ] } }, - "/teams/": { + "/teams": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -16992,12 +19876,22 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false } } } @@ -17026,6 +19920,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -17047,13 +19942,14 @@ ] } }, - "/store/published-listings/skus/{sku_id}/subscription-plans/": { + "/store/published-listings/skus/{sku_id}/subscription-plans": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -17075,13 +19971,14 @@ ] } }, - "/store/published-listings/applications/{application_id}/subscription-plans/": { + "/store/published-listings/applications/{application_id}/subscription-plans": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -17103,13 +20000,14 @@ ] } }, - "/store/published-listings/applications/{application_id}/": { + "/store/published-listings/applications/{application_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -17131,7 +20029,7 @@ ] } }, - "/stop/": { + "/stop": { "post": { "x-right-required": "OPERATOR", "security": [ @@ -17139,6 +20037,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -17159,13 +20058,14 @@ ] } }, - "/stickers/{sticker_id}/": { + "/stickers/{sticker_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17194,13 +20094,14 @@ ] } }, - "/sticker-packs/": { + "/sticker-packs": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17218,13 +20119,14 @@ ] } }, - "/stage-instances/": { + "/stage-instances": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -17235,8 +20137,10 @@ ] } }, - "/science/": { + "/science": { "post": { + "security": [], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -17247,8 +20151,10 @@ ] } }, - "/scheduled-maintenances/upcoming.json/": { + "/scheduled-maintenances/upcoming.json": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -17259,13 +20165,14 @@ ] } }, - "/safety-hub/suspended/@me/": { + "/safety-hub/suspended/@me": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17293,13 +20200,14 @@ ] } }, - "/safety-hub/@me/": { + "/safety-hub/@me": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17327,7 +20235,7 @@ ] } }, - "/reporting/": { + "/reporting": { "get": { "security": [ { @@ -17335,13 +20243,14 @@ } ], "description": "[EXT] Get available reporting menu types.", + "summary": "No summary provided", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Array" + "$ref": "#/components/schemas/ReportingMenuTypesResponse" } } } @@ -17360,6 +20269,7 @@ } ], "description": "Get reporting menu options for guild reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17399,12 +20309,77 @@ } ], "description": "Get reporting menu options for guild reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -17437,6 +20412,7 @@ } ], "description": "Get reporting menu options for guild_discovery reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17476,12 +20452,77 @@ } ], "description": "Get reporting menu options for guild_discovery reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -17514,6 +20555,7 @@ } ], "description": "Get reporting menu options for guild_directory_entry reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17553,12 +20595,77 @@ } ], "description": "Get reporting menu options for guild_directory_entry reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -17591,6 +20698,7 @@ } ], "description": "Get reporting menu options for guild_scheduled_event reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17630,12 +20738,77 @@ } ], "description": "Get reporting menu options for guild_scheduled_event reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -17668,6 +20841,7 @@ } ], "description": "Get reporting menu options for message reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17707,12 +20881,77 @@ } ], "description": "Get reporting menu options for message reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -17745,6 +20984,7 @@ } ], "description": "Get reporting menu options for stage_channel reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17784,12 +21024,77 @@ } ], "description": "Get reporting menu options for stage_channel reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -17822,6 +21127,7 @@ } ], "description": "Get reporting menu options for first_dm reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17861,12 +21167,77 @@ } ], "description": "Get reporting menu options for first_dm reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -17899,6 +21270,7 @@ } ], "description": "Get reporting menu options for user reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -17938,12 +21310,77 @@ } ], "description": "Get reporting menu options for user reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -17976,6 +21413,7 @@ } ], "description": "Get reporting menu options for application reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18015,12 +21453,77 @@ } ], "description": "Get reporting menu options for application reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -18053,6 +21556,7 @@ } ], "description": "Get reporting menu options for widget reports.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18092,12 +21596,77 @@ } ], "description": "Get reporting menu options for widget reports.", + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReportSchema" + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "breadcrumbs": { + "type": "array", + "items": { + "type": "number" + } + }, + "elements": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "guild_scheduled_event_id": { + "type": "string" + }, + "reported_user_id": { + "type": "string" + }, + "application_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "widget_id": { + "type": "string" + } + }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false } } } @@ -18122,19 +21691,48 @@ ] } }, - "/read-states/ack-bulk/": { + "/read-states/ack-bulk": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AckBulkSchema" + "type": "object", + "properties": { + "read_states": { + "type": "array", + "items": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "read_state_type": { + "type": "number" + } + }, + "required": [ + "channel_id", + "message_id" + ], + "additionalProperties": false + } + } + }, + "required": [ + "read_states" + ], + "additionalProperties": false } } } @@ -18159,13 +21757,14 @@ ] } }, - "/policies/stats/": { + "/policies/stats": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18199,8 +21798,10 @@ ] } }, - "/policies/instance/limits/": { + "/policies/instance/limits": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18224,8 +21825,14 @@ ] } }, - "/policies/instance/": { + "/policies/instance": { "get": { + "security": [ + { + "bearer": [] + } + ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18249,8 +21856,10 @@ ] } }, - "/policies/instance/domains/": { + "/policies/instance/domains": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18274,15 +21883,17 @@ ] } }, - "/policies/instance/config/": { + "/policies/instance/config": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Object" + "$ref": "#/components/schemas/ConfigObjectResponse" } } } @@ -18299,8 +21910,10 @@ ] } }, - "/ping/": { + "/ping": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18324,13 +21937,14 @@ ] } }, - "/partners/{guild_id}/requirements/": { + "/partners/{guild_id}/requirements": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -18352,13 +21966,14 @@ ] } }, - "/outbound-promotions/": { + "/outbound-promotions": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -18369,13 +21984,14 @@ ] } }, - "/oauth2/tokens/": { + "/oauth2/tokens": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -18386,13 +22002,14 @@ ] } }, - "/oauth2/authorize/": { + "/oauth2/authorize": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -18437,12 +22054,38 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationAuthorizeSchema" + "type": "object", + "properties": { + "authorize": { + "type": "boolean" + }, + "guild_id": { + "type": "string" + }, + "permissions": { + "type": "string" + }, + "captcha_key": { + "type": "string" + }, + "code": { + "type": "string", + "minLength": 6, + "maxLength": 6 + } + }, + "required": [ + "authorize", + "guild_id", + "permissions" + ], + "additionalProperties": false } } } @@ -18503,13 +22146,14 @@ ] } }, - "/oauth2/applications/@me/": { + "/oauth2/applications/@me": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18529,6 +22173,8 @@ }, "/invites/{invite_code}": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18573,6 +22219,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18636,6 +22283,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18684,13 +22332,14 @@ ] } }, - "/interactions/": { + "/interactions": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -18701,13 +22350,14 @@ ] } }, - "/interactions/{interaction_id}/{interaction_token}/callback/": { + "/interactions/{interaction_id}/{interaction_token}/callback": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -18745,12 +22395,28 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HubWaitlistSignupSchema" + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + "school": { + "type": "string" + } + }, + "required": [ + "email", + "school" + ], + "additionalProperties": false } } } @@ -18789,6 +22455,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -18842,12 +22509,32 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GuildTemplateCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false } } } @@ -18873,7 +22560,7 @@ ] } }, - "/guilds/": { + "/guilds": { "post": { "x-right-required": "CREATE_GUILDS", "security": [ @@ -18881,12 +22568,186 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GuildCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 100 + }, + "region": { + "type": "string" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "channels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "number", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 255 + ] + }, + "topic": { + "type": "string" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "bitrate": { + "type": "number" + }, + "user_limit": { + "type": "number" + }, + "rate_limit_per_user": { + "type": "number" + }, + "position": { + "type": "number" + }, + "invitable": { + "type": "boolean" + }, + "permission_overwrites": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "number" + }, + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + } + }, + "required": [ + "id", + "type", + "allow", + "deny" + ], + "additionalProperties": false + } + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "parent_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "rtc_region": { + "type": "string" + }, + "default_auto_archive_duration": { + "type": "number" + }, + "default_reaction_emoji": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "number" + }, + "default_thread_rate_limit_per_user": { + "type": "number" + }, + "video_quality_mode": { + "type": "number" + }, + "auto_archive_duration": { + "type": "number" + }, + "archived": { + "type": "boolean" + }, + "locked": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "system_channel_id": { + "type": "string" + }, + "rules_channel_id": { + "type": "string" + }, + "guild_template_code": { + "type": "string" + }, + "staff_only": { + "type": "boolean" + } + }, + "additionalProperties": false } } } @@ -18928,19 +22789,42 @@ ] } }, - "/guilds/automations/email-domain-lookup/": { + "/guilds/automations/email-domain-lookup": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmailDomainLookupSchema" + "type": "object", + "properties": { + "allow_multiple_guilds": { + "type": "boolean" + }, + "email": { + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + "use_verification_code": { + "type": "boolean" + }, + "guild_id": { + "type": "string" + } + }, + "required": [ + "allow_multiple_guilds", + "email", + "use_verification_code" + ], + "additionalProperties": false } } } @@ -18979,12 +22863,32 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmailDomainLookupVerifyCodeSchema" + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + "guild_id": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "email", + "guild_id", + "code" + ], + "additionalProperties": false } } } @@ -19009,13 +22913,14 @@ ] } }, - "/guilds/{guild_id}/widget.png/": { + "/guilds/{guild_id}/widget.png": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -19057,13 +22962,14 @@ ] } }, - "/guilds/{guild_id}/widget.json/": { + "/guilds/{guild_id}/widget.json": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19102,13 +23008,14 @@ ] } }, - "/guilds/{guild_id}/widget/": { + "/guilds/{guild_id}/widget": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19153,12 +23060,26 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WidgetModifySchema" + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "channel_id": { + "type": "string" + } + }, + "required": [ + "enabled", + "channel_id" + ], + "additionalProperties": false } } } @@ -19211,13 +23132,14 @@ ] } }, - "/guilds/{guild_id}/welcome-screen/": { + "/guilds/{guild_id}/welcome-screen": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19262,12 +23184,54 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GuildUpdateWelcomeScreenSchema" + "type": "object", + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "welcome_channels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "description": { + "type": "string" + }, + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + } + }, + "required": [ + "channel_id", + "description" + ], + "additionalProperties": false + } + }, + "enabled": { + "type": "boolean" + } + }, + "additionalProperties": false } } } @@ -19313,7 +23277,7 @@ ] } }, - "/guilds/{guild_id}/webhooks/": { + "/guilds/{guild_id}/webhooks": { "get": { "x-permission-required": "MANAGE_WEBHOOKS", "security": [ @@ -19322,6 +23286,7 @@ } ], "description": "Returns a list of guild webhook objects. Requires the MANAGE_WEBHOOKS permission.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19350,19 +23315,56 @@ ] } }, - "/guilds/{guild_id}/voice-states/{user_id}/": { + "/guilds/{guild_id}/voice-states/{user_id}": { "patch": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VoiceStateUpdateSchema" + "type": "object", + "properties": { + "guild_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "self_mute": { + "type": "boolean" + }, + "self_deaf": { + "type": "boolean" + }, + "self_video": { + "type": "boolean" + }, + "preferred_region": { + "type": "string" + }, + "request_to_speak_timestamp": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + }, + "suppress": { + "type": "boolean" + }, + "flags": { + "type": "number" + } + }, + "required": [ + "self_mute", + "self_deaf" + ], + "additionalProperties": false } } } @@ -19427,7 +23429,7 @@ ] } }, - "/guilds/{guild_id}/vanity-url/": { + "/guilds/{guild_id}/vanity-url": { "get": { "x-permission-required": "MANAGE_GUILD", "security": [ @@ -19435,6 +23437,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19489,12 +23492,21 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VanityUrlSchema" + "type": "object", + "properties": { + "code": { + "type": "string", + "minLength": 1, + "maxLength": 20 + } + }, + "additionalProperties": false } } } @@ -19547,13 +23559,14 @@ ] } }, - "/guilds/{guild_id}/templates/": { + "/guilds/{guild_id}/templates": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19588,12 +23601,32 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false } } } @@ -19664,6 +23697,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19717,6 +23751,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19770,12 +23805,29 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateModifySchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false } } } @@ -19827,13 +23879,14 @@ ] } }, - "/guilds/{guild_id}/stickers/": { + "/guilds/{guild_id}/stickers": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19878,12 +23931,33 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ModifyGuildStickerSchema" + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 2, + "maxLength": 30 + }, + "description": { + "type": "string", + "maxLength": 100 + }, + "tags": { + "type": "string", + "maxLength": 200 + } + }, + "required": [ + "name", + "tags" + ], + "additionalProperties": false } } } @@ -19943,6 +24017,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -19996,12 +24071,33 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ModifyGuildStickerSchema" + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 2, + "maxLength": 30 + }, + "description": { + "type": "string", + "maxLength": 100 + }, + "tags": { + "type": "string", + "maxLength": 200 + } + }, + "required": [ + "name", + "tags" + ], + "additionalProperties": false } } } @@ -20069,6 +24165,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -20109,13 +24206,14 @@ ] } }, - "/guilds/{guild_id}/shield.svg/": { + "/guilds/{guild_id}/shield.svg": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -20147,13 +24245,14 @@ ] } }, - "/guilds/{guild_id}/roles/member-counts/": { + "/guilds/{guild_id}/roles/member-counts": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -20175,13 +24274,14 @@ ] } }, - "/guilds/{guild_id}/roles/": { + "/guilds/{guild_id}/roles": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -20209,12 +24309,72 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleModifySchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "permissions": { + "type": "string" + }, + "color": { + "type": "number" + }, + "hoist": { + "type": "boolean" + }, + "mentionable": { + "type": "boolean" + }, + "position": { + "type": "number" + }, + "icon": { + "type": "string" + }, + "unicode_emoji": { + "type": "string" + }, + "colors": { + "type": "object", + "properties": { + "primary_color": { + "type": "number" + }, + "secondary_color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "tertiary_color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "primary_color" + ], + "additionalProperties": false + } + }, + "additionalProperties": false } } } @@ -20273,12 +24433,29 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RolePositionUpdateSchema" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "position": { + "type": "number" + } + }, + "required": [ + "id", + "position" + ], + "additionalProperties": false + } } } } @@ -20331,7 +24508,7 @@ ] } }, - "/guilds/{guild_id}/roles/{role_id}/members/": { + "/guilds/{guild_id}/roles/{role_id}/members": { "patch": { "x-permission-required": "MANAGE_ROLES", "security": [ @@ -20339,6 +24516,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -20369,13 +24547,14 @@ ] } }, - "/guilds/{guild_id}/roles/{role_id}/member-ids/": { + "/guilds/{guild_id}/roles/{role_id}/member-ids": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -20406,13 +24585,14 @@ ] } }, - "/guilds/{guild_id}/roles/{role_id}/": { + "/guilds/{guild_id}/roles/{role_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -20476,6 +24656,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -20542,12 +24723,72 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleModifySchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "permissions": { + "type": "string" + }, + "color": { + "type": "number" + }, + "hoist": { + "type": "boolean" + }, + "mentionable": { + "type": "boolean" + }, + "position": { + "type": "number" + }, + "icon": { + "type": "string" + }, + "unicode_emoji": { + "type": "string" + }, + "colors": { + "type": "object", + "properties": { + "primary_color": { + "type": "number" + }, + "secondary_color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "tertiary_color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "primary_color" + ], + "additionalProperties": false + } + }, + "additionalProperties": false } } } @@ -20619,13 +24860,14 @@ ] } }, - "/guilds/{guild_id}/regions/": { + "/guilds/{guild_id}/regions": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -20664,13 +24906,14 @@ ] } }, - "/guilds/{guild_id}/prune/": { + "/guilds/{guild_id}/prune": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -20706,6 +24949,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -20744,13 +24988,14 @@ ] } }, - "/guilds/{guild_id}/profile/": { + "/guilds/{guild_id}/profile": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -20786,12 +25031,55 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberChangeProfileSchema" + "type": "object", + "properties": { + "nick": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "bio": { + "type": "string" + }, + "banner": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "pronouns": { + "type": "string" + }, + "theme_colors": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false } } } @@ -20860,6 +25148,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -20881,13 +25170,14 @@ ] } }, - "/guilds/{guild_id}/messages/search/": { + "/guilds/{guild_id}/messages/search": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -20936,13 +25226,14 @@ ] } }, - "/guilds/{guild_id}/members/": { + "/guilds/{guild_id}/members": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -20996,7 +25287,7 @@ ] } }, - "/guilds/{guild_id}/members/{member_id}/roles/{role_id}/": { + "/guilds/{guild_id}/members/{member_id}/roles/{role_id}": { "delete": { "x-permission-required": "MANAGE_ROLES", "security": [ @@ -21004,6 +25295,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -21059,6 +25351,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -21101,19 +25394,29 @@ ] } }, - "/guilds/{guild_id}/members/{member_id}/nick/": { + "/guilds/{guild_id}/members/{member_id}/nick": { "patch": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberNickChangeSchema" + "type": "object", + "properties": { + "nick": { + "type": "string" + } + }, + "required": [ + "nick" + ], + "additionalProperties": false } } } @@ -21175,13 +25478,14 @@ ] } }, - "/guilds/{guild_id}/members/{member_id}/": { + "/guilds/{guild_id}/members/{member_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -21244,12 +25548,55 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberChangeSchema" + "type": "object", + "properties": { + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "nick": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "avatar": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "communication_disabled_until": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "number" + } + }, + "additionalProperties": false } } } @@ -21326,6 +25673,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -21388,6 +25736,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -21428,13 +25777,14 @@ ] } }, - "/guilds/{guild_id}/member-verification/": { + "/guilds/{guild_id}/member-verification": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "404": { "description": "", @@ -21463,7 +25813,7 @@ ] } }, - "/guilds/{guild_id}/invites/": { + "/guilds/{guild_id}/invites": { "get": { "x-permission-required": "MANAGE_GUILD", "security": [ @@ -21471,6 +25821,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -21499,13 +25850,14 @@ ] } }, - "/guilds/{guild_id}/integrations/": { + "/guilds/{guild_id}/integrations": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -21527,13 +25879,14 @@ ] } }, - "/guilds/{guild_id}/": { + "/guilds/{guild_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -21588,12 +25941,114 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GuildUpdateSchema" + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 100 + }, + "region": { + "type": "string" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "system_channel_id": { + "type": "string" + }, + "rules_channel_id": { + "type": "string" + }, + "guild_template_code": { + "type": "string" + }, + "staff_only": { + "type": "boolean" + }, + "banner": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "splash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string" + }, + "features": { + "type": "array", + "items": { + "type": "string" + } + }, + "verification_level": { + "type": "number" + }, + "default_message_notifications": { + "type": "number" + }, + "system_channel_flags": { + "type": "number" + }, + "explicit_content_filter": { + "type": "number" + }, + "public_updates_channel_id": { + "type": "string" + }, + "afk_timeout": { + "type": "number" + }, + "afk_channel_id": { + "type": "string" + }, + "preferred_locale": { + "type": "string" + }, + "premium_progress_bar_enabled": { + "type": "boolean" + }, + "discovery_splash": { + "type": "string" + }, + "safety_alerts_channel_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false } } } @@ -21656,13 +26111,14 @@ ] } }, - "/guilds/{guild_id}/emojis/": { + "/guilds/{guild_id}/emojis": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -21707,12 +26163,41 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmojiCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "image": { + "type": "string" + }, + "require_colons": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "image" + ], + "additionalProperties": false } } } @@ -21772,6 +26257,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -21835,12 +26321,25 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmojiModifySchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false } } } @@ -21898,6 +26397,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -21938,13 +26438,14 @@ ] } }, - "/guilds/{guild_id}/discovery-requirements/": { + "/guilds/{guild_id}/discovery-requirements": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -21973,13 +26474,14 @@ ] } }, - "/guilds/{guild_id}/delete/": { + "/guilds/{guild_id}/delete": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -22021,13 +26523,14 @@ ] } }, - "/guilds/{guild_id}/channels/": { + "/guilds/{guild_id}/channels": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "201": { "description": "", @@ -22062,12 +26565,148 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "number", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 255 + ] + }, + "topic": { + "type": "string" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "bitrate": { + "type": "number" + }, + "user_limit": { + "type": "number" + }, + "rate_limit_per_user": { + "type": "number" + }, + "position": { + "type": "number" + }, + "invitable": { + "type": "boolean" + }, + "permission_overwrites": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "number" + }, + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + } + }, + "required": [ + "id", + "type", + "allow", + "deny" + ], + "additionalProperties": false + } + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "parent_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "rtc_region": { + "type": "string" + }, + "default_auto_archive_duration": { + "type": "number" + }, + "default_reaction_emoji": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "number" + }, + "default_thread_rate_limit_per_user": { + "type": "number" + }, + "video_quality_mode": { + "type": "number" + }, + "auto_archive_duration": { + "type": "number" + }, + "archived": { + "type": "boolean" + }, + "locked": { + "type": "boolean" + } + }, + "additionalProperties": false } } } @@ -22126,12 +26765,41 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelReorderSchema" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "position": { + "type": "number" + }, + "lock_permissions": { + "type": "boolean" + }, + "parent_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false + } } } } @@ -22177,7 +26845,7 @@ ] } }, - "/guilds/{guild_id}/bulk-ban/": { + "/guilds/{guild_id}/bulk-ban": { "post": { "x-permission-required": [ "BAN_MEMBERS", @@ -22188,12 +26856,28 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BulkBanSchema" + "type": "object", + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "delete_message_seconds": { + "type": "number" + } + }, + "required": [ + "user_ids" + ], + "additionalProperties": false } } } @@ -22246,7 +26930,7 @@ ] } }, - "/guilds/{guild_id}/bans/": { + "/guilds/{guild_id}/bans": { "get": { "x-permission-required": "BAN_MEMBERS", "security": [ @@ -22254,6 +26938,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -22300,6 +26985,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -22364,6 +27050,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -22427,12 +27114,25 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BanCreateSchema" + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "delete_message_days": { + "type": "number" + }, + "delete_message_seconds": { + "type": "number" + } + }, + "additionalProperties": false } } } @@ -22493,6 +27193,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -22543,7 +27244,7 @@ ] } }, - "/guilds/{guild_id}/auto-moderation/rules/": { + "/guilds/{guild_id}/auto-moderation/rules": { "get": { "x-permission-required": [ "MANAGE_GUILD" @@ -22553,13 +27254,14 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AutomodRuleSchemaWithId[]" + "$ref": "#/components/schemas/APIAutomodRuleArray" } } } @@ -22599,13 +27301,14 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AutomodRuleSchemaWithId" + "$ref": "#/components/schemas/APIAutomodRule" } } } @@ -22657,13 +27360,14 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AutomodRuleSchemaWithId" + "$ref": "#/components/schemas/APIAutomodRule" } } } @@ -22722,6 +27426,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -22772,13 +27477,14 @@ ] } }, - "/guilds/{guild_id}/audit-logs/": { + "/guilds/{guild_id}/audit-logs": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -22800,13 +27506,14 @@ ] } }, - "/guilds/{guild_id}/application-command-index/": { + "/guilds/{guild_id}/application-command-index": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -22828,13 +27535,14 @@ ] } }, - "/guild-recommendations/": { + "/guild-recommendations": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -22852,13 +27560,14 @@ ] } }, - "/gifs/trending/": { + "/gifs/trending": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -22886,13 +27595,14 @@ ] } }, - "/gifs/trending-gifs/": { + "/gifs/trending-gifs": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -22928,13 +27638,14 @@ ] } }, - "/gifs/search/": { + "/gifs/search": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -22979,8 +27690,10 @@ ] } }, - "/gateway/": { + "/gateway": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -22998,8 +27711,10 @@ ] } }, - "/gateway/bot/": { + "/gateway/bot": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23017,13 +27732,14 @@ ] } }, - "/games/detectable/": { + "/games/detectable": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23041,8 +27757,10 @@ ] } }, - "/experiments/": { + "/experiments": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -23053,13 +27771,14 @@ ] } }, - "/emojis/{emoji_id}/source/": { + "/emojis/{emoji_id}/source": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23098,8 +27817,10 @@ ] } }, - "/download/": { + "/download": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "302": { "description": "No description available" @@ -23127,6 +27848,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23144,13 +27866,14 @@ ] } }, - "/discoverable-guilds/": { + "/discoverable-guilds": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23168,13 +27891,14 @@ ] } }, - "/connections/": { + "/connections": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23192,19 +27916,44 @@ ] } }, - "/connections/{connection_name}/callback/": { + "/connections/{connection_name}/callback": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConnectionCallbackSchema" + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "state": { + "type": "string" + }, + "insecure": { + "type": "boolean" + }, + "friend_sync": { + "type": "boolean" + }, + "openid_params": { + "type": "object", + "additionalProperties": {} + } + }, + "required": [ + "state", + "insecure", + "friend_sync" + ], + "additionalProperties": false } } } @@ -23230,13 +27979,14 @@ ] } }, - "/connections/{connection_name}/authorize/": { + "/connections/{connection_name}/authorize": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -23258,13 +28008,14 @@ ] } }, - "/connections/{connection_name}/{connection_id}/refresh/": { + "/connections/{connection_name}/{connection_id}/refresh": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -23295,13 +28046,14 @@ ] } }, - "/collectibles-shop/": { + "/collectibles-shop": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23322,13 +28074,14 @@ ] } }, - "/collectibles-categories/": { + "/collectibles-categories": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23349,19 +28102,35 @@ ] } }, - "/channels/preload-messages/": { + "/channels/preload-messages": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PreloadMessagesRequestSchema" + "type": "object", + "properties": { + "channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false } } } @@ -23372,7 +28141,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PreloadMessagesResponse" + "$ref": "#/components/schemas/PreloadMessagesResponseSchema" } } } @@ -23393,7 +28162,7 @@ ] } }, - "/channels/{channel_id}/webhooks/": { + "/channels/{channel_id}/webhooks": { "get": { "x-permission-required": "MANAGE_WEBHOOKS", "security": [ @@ -23402,6 +28171,7 @@ } ], "description": "Returns a list of channel webhook objects. Requires the MANAGE_WEBHOOKS permission.", + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23436,12 +28206,26 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 80 + }, + "avatar": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false } } } @@ -23487,7 +28271,7 @@ ] } }, - "/channels/{channel_id}/typing/": { + "/channels/{channel_id}/typing": { "post": { "x-permission-required": "SEND_MESSAGES", "security": [ @@ -23495,6 +28279,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -23522,13 +28307,14 @@ ] } }, - "/channels/{channel_id}/threads/": { + "/channels/{channel_id}/threads": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23608,12 +28394,153 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ThreadCreationSchema" + "type": "object", + "properties": { + "auto_archive_duration": { + "type": "number" + }, + "rate_limit_per_user": { + "type": "number" + }, + "name": { + "type": "string" + }, + "type": { + "type": "number" + }, + "invitable": { + "type": "boolean" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "location": { + "type": "string" + }, + "message": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "embeds": { + "type": "array", + "items": {} + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "components": { + "anyOf": [ + { + "type": "array", + "items": {} + }, + { + "type": "null" + } + ] + }, + "sticker_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "activity": {}, + "application_id": { + "type": "string" + }, + "flags": { + "type": "number" + }, + "attachments": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "required": [ + "id", + "filename" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "uploaded_filename": { + "type": "string" + }, + "original_content_type": { + "type": "string" + } + }, + "required": [ + "filename", + "uploaded_filename" + ], + "additionalProperties": false + } + ] + } + } + }, + "additionalProperties": false + } + }, + "required": [ + "name", + "message" + ], + "additionalProperties": false } } } @@ -23649,12 +28576,28 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AcknowledgeDeleteSchema" + "type": "object", + "properties": { + "read_state_type": { + "type": "number", + "enum": [ + 0, + 1, + 2, + 3 + ] + }, + "version": { + "type": "number" + } + }, + "additionalProperties": false } } } @@ -23687,6 +28630,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -23735,7 +28679,7 @@ ] } }, - "/channels/{channel_id}/thread-members/": { + "/channels/{channel_id}/thread-members": { "get": { "x-permission-required": "VIEW_CHANNEL", "security": [ @@ -23743,6 +28687,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -23775,6 +28720,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -23814,6 +28760,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -23855,6 +28802,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -23879,7 +28827,7 @@ ] } }, - "/channels/{channel_id}/tags/": { + "/channels/{channel_id}/tags": { "post": { "x-permission-required": "MANAGE_CHANNELS", "security": [ @@ -23887,12 +28835,52 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TagCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "moderated": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "emoji_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emoji_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false } } } @@ -23936,12 +28924,52 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TagCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "moderated": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "emoji_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emoji_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false } } } @@ -23992,6 +29020,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -24039,6 +29068,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "201": { "description": "No description available" @@ -24077,6 +29107,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24110,13 +29141,14 @@ ] } }, - "/channels/{channel_id}/purge/": { + "/channels/{channel_id}/purge": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24154,7 +29186,7 @@ ] } }, - "/channels/{channel_id}/post-data/": { + "/channels/{channel_id}/post-data": { "post": { "x-permission-required": "VIEW_CHANNEL", "security": [ @@ -24162,12 +29194,25 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostDataSchema" + "type": "object", + "properties": { + "thread_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "thread_ids" + ], + "additionalProperties": false } } } @@ -24204,6 +29249,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24256,6 +29302,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24302,7 +29349,7 @@ ] } }, - "/channels/{channel_id}/pins/": { + "/channels/{channel_id}/pins": { "get": { "x-permission-required": [ "READ_MESSAGE_HISTORY" @@ -24312,6 +29359,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -24358,12 +29406,34 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelPermissionOverwriteSchema" + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "number" + }, + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + } + }, + "required": [ + "id", + "type", + "allow", + "deny" + ], + "additionalProperties": false } } } @@ -24420,6 +29490,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24453,13 +29524,14 @@ ] } }, - "/channels/{channel_id}/messages/search/": { + "/channels/{channel_id}/messages/search": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -24516,6 +29588,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24568,6 +29641,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24614,7 +29688,7 @@ ] } }, - "/channels/{channel_id}/messages/pins/": { + "/channels/{channel_id}/messages/pins": { "get": { "x-permission-required": [ "READ_MESSAGE_HISTORY" @@ -24624,6 +29698,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -24662,19 +29737,32 @@ ] } }, - "/channels/{channel_id}/messages/bulk-delete/": { + "/channels/{channel_id}/messages/bulk-delete": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BulkDeleteSchema" + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "messages" + ], + "additionalProperties": false } } } @@ -24716,7 +29804,7 @@ ] } }, - "/channels/{channel_id}/messages/{message_id}/threads/": { + "/channels/{channel_id}/messages/{message_id}/threads": { "post": { "x-permission-required": "CREATE_PUBLIC_THREADS", "security": [ @@ -24724,12 +29812,34 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageThreadCreationSchema" + "type": "object", + "properties": { + "auto_archive_duration": { + "type": "number" + }, + "rate_limit_per_user": { + "type": "number" + }, + "name": { + "type": "string" + }, + "location": { + "type": "string" + }, + "type": { + "type": "number" + } + }, + "required": [ + "name" + ], + "additionalProperties": false } } } @@ -24767,7 +29877,7 @@ ] } }, - "/channels/{channel_id}/messages/{message_id}/reactions/": { + "/channels/{channel_id}/messages/{message_id}/reactions": { "delete": { "x-permission-required": "MANAGE_MESSAGES", "security": [ @@ -24775,6 +29885,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24829,6 +29940,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -24890,6 +30002,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -24961,6 +30074,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -25030,6 +30144,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -25101,6 +30216,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -25174,7 +30290,7 @@ ] } }, - "/channels/{channel_id}/messages/{message_id}/": { + "/channels/{channel_id}/messages/{message_id}": { "patch": { "x-right-required": "SEND_MESSAGES", "x-permission-required": "SEND_MESSAGES", @@ -25183,12 +30299,252 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageEditSchema" + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "mobile_network_type": { + "type": "string" + }, + "nonce": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "tts": { + "type": "boolean" + }, + "flags": { + "type": "number" + }, + "embeds": { + "anyOf": [ + { + "type": "array", + "items": {} + }, + { + "type": "null" + } + ] + }, + "embed": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + }, + "type": { + "type": "number" + } + }, + "additionalProperties": false + }, + "payload_json": { + "type": "string" + }, + "file": { + "type": "object", + "properties": { + "filename": { + "type": "string" + } + }, + "required": [ + "filename" + ], + "additionalProperties": false + }, + "attachments": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "required": [ + "id", + "filename" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "uploaded_filename": { + "type": "string" + }, + "original_content_type": { + "type": "string" + } + }, + "required": [ + "filename", + "uploaded_filename" + ], + "additionalProperties": false + } + ] + } + }, + "sticker_ids": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "components": { + "anyOf": [ + { + "type": "array", + "items": {} + }, + { + "type": "null" + } + ] + }, + "poll": { + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false + }, + "enforce_nonce": { + "type": "boolean" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "thread_name": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "interaction": {}, + "interaction_metadata": {} + }, + "additionalProperties": false } } } @@ -25253,12 +30609,255 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageCreateSchema" + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "content": { + "type": "string" + }, + "mobile_network_type": { + "type": "string" + }, + "nonce": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "tts": { + "type": "boolean" + }, + "flags": { + "type": "number" + }, + "embeds": { + "anyOf": [ + { + "type": "array", + "items": {} + }, + { + "type": "null" + } + ] + }, + "embed": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + }, + "type": { + "type": "number" + } + }, + "additionalProperties": false + }, + "payload_json": { + "type": "string" + }, + "file": { + "type": "object", + "properties": { + "filename": { + "type": "string" + } + }, + "required": [ + "filename" + ], + "additionalProperties": false + }, + "attachments": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "required": [ + "id", + "filename" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "uploaded_filename": { + "type": "string" + }, + "original_content_type": { + "type": "string" + } + }, + "required": [ + "filename", + "uploaded_filename" + ], + "additionalProperties": false + } + ] + } + }, + "sticker_ids": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "components": { + "anyOf": [ + { + "type": "array", + "items": {} + }, + { + "type": "null" + } + ] + }, + "poll": { + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false + }, + "enforce_nonce": { + "type": "boolean" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "thread_name": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "interaction": {}, + "interaction_metadata": {} + }, + "additionalProperties": false } } } @@ -25322,6 +30921,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -25380,6 +30980,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -25423,7 +31024,7 @@ ] } }, - "/channels/{channel_id}/messages/{message_id}/crosspost/": { + "/channels/{channel_id}/messages/{message_id}/crosspost": { "post": { "x-permission-required": "MANAGE_MESSAGES", "security": [ @@ -25431,6 +31032,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -25468,19 +31070,38 @@ ] } }, - "/channels/{channel_id}/messages/{message_id}/ack/": { + "/channels/{channel_id}/messages/{message_id}/ack": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageAcknowledgeSchema" + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "manual": { + "type": "boolean" + }, + "mention_count": { + "type": "number" + }, + "flags": { + "type": "number" + }, + "last_viewed": { + "type": "number" + } + }, + "additionalProperties": false } } } @@ -25518,7 +31139,7 @@ ] } }, - "/channels/{channel_id}/invites/": { + "/channels/{channel_id}/invites": { "post": { "x-right-required": "CREATE_INVITES", "x-permission-required": "CREATE_INSTANT_INVITE", @@ -25527,12 +31148,37 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InviteCreateSchema" + "type": "object", + "properties": { + "target_user_id": { + "type": "string" + }, + "target_type": { + "type": "number" + }, + "max_age": { + "type": "number" + }, + "max_uses": { + "type": "number" + }, + "temporary": { + "type": "boolean" + }, + "unique": { + "type": "boolean" + }, + "flags": { + "type": "number" + } + }, + "additionalProperties": false } } } @@ -25584,6 +31230,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -25615,7 +31262,7 @@ ] } }, - "/channels/{channel_id}/": { + "/channels/{channel_id}": { "get": { "x-permission-required": "VIEW_CHANNEL", "security": [ @@ -25623,6 +31270,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -25660,6 +31308,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -25697,12 +31346,190 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelModifySchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "number", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 255 + ] + }, + "topic": { + "type": "string" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "bitrate": { + "type": "number" + }, + "user_limit": { + "type": "number" + }, + "rate_limit_per_user": { + "type": "number" + }, + "position": { + "type": "number" + }, + "invitable": { + "type": "boolean" + }, + "permission_overwrites": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "number" + }, + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + } + }, + "required": [ + "id", + "type", + "allow", + "deny" + ], + "additionalProperties": false + } + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "parent_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "rtc_region": { + "type": "string" + }, + "default_auto_archive_duration": { + "type": "number" + }, + "default_reaction_emoji": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "number" + }, + "default_thread_rate_limit_per_user": { + "type": "number" + }, + "video_quality_mode": { + "type": "number" + }, + "auto_archive_duration": { + "type": "number" + }, + "archived": { + "type": "boolean" + }, + "locked": { + "type": "boolean" + }, + "available_tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "moderated": { + "type": "boolean" + }, + "emoji_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emoji_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + } + } + }, + "additionalProperties": false } } } @@ -25748,7 +31575,7 @@ ] } }, - "/channels/{channel_id}/greet/": { + "/channels/{channel_id}/greet": { "post": { "x-permission-required": "SEND_MESSAGES", "security": [ @@ -25756,12 +31583,73 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GreetRequestSchema" + "type": "object", + "properties": { + "sticker_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + } + }, + "required": [ + "message_id" + ], + "additionalProperties": false + } + }, + "required": [ + "sticker_ids" + ], + "additionalProperties": false } } } @@ -25807,13 +31695,14 @@ ] } }, - "/channels/{channel_id}/directory-entries/": { + "/channels/{channel_id}/directory-entries": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -25852,19 +31741,54 @@ ] } }, - "/channels/{channel_id}/attachments/": { + "/channels/{channel_id}/attachments": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UploadAttachmentRequestSchema" + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "file_size": { + "type": "number" + }, + "is_clip": { + "type": "boolean" + }, + "original_content_type": { + "type": "string" + } + }, + "required": [ + "filename", + "file_size" + ], + "additionalProperties": false + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false } } } @@ -25917,6 +31841,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -25947,13 +31872,14 @@ ] } }, - "/beaker/": { + "/beaker": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -25964,13 +31890,14 @@ ] } }, - "/auth/whoami/": { + "/auth/whoami": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -25994,14 +31921,25 @@ ] } }, - "/auth/verify/view-backup-codes-challenge/": { + "/auth/verify/view-backup-codes-challenge": { "post": { + "security": [], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BackupCodesChallengeSchema" + "type": "object", + "properties": { + "password": { + "type": "string" + } + }, + "required": [ + "password" + ], + "additionalProperties": false } } } @@ -26033,9 +31971,11 @@ ] } }, - "/auth/verify/resend/": { + "/auth/verify/resend": { "post": { "x-right-required": "RESEND_VERIFICATION_EMAIL", + "security": [], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -26066,14 +32006,35 @@ ] } }, - "/auth/verify/": { + "/auth/verify": { "post": { + "security": [], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VerifyEmailSchema" + "type": "object", + "properties": { + "captcha_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "token": { + "type": "string" + } + }, + "required": [ + "token" + ], + "additionalProperties": false } } } @@ -26105,13 +32066,14 @@ ] } }, - "/auth/sessions/": { + "/auth/sessions": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26136,12 +32098,28 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionsLogoutSchema" + "type": "object", + "properties": { + "session_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "session_id_hashes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false } } } @@ -26156,14 +32134,31 @@ ] } }, - "/auth/reset/": { + "/auth/reset": { "post": { + "security": [], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PasswordResetSchema" + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1, + "maxLength": 72 + }, + "token": { + "type": "string" + } + }, + "required": [ + "password", + "token" + ], + "additionalProperties": false } } } @@ -26195,14 +32190,72 @@ ] } }, - "/auth/register/": { + "/auth/register": { "post": { + "security": [], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RegisterSchema" + "type": "object", + "properties": { + "username": { + "type": "string", + "minLength": 2 + }, + "password": { + "type": "string", + "minLength": 1, + "maxLength": 72 + }, + "consent": { + "type": "boolean" + }, + "email": { + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + "fingerprint": { + "type": "string" + }, + "invite": { + "type": "string" + }, + "date_of_birth": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + "gift_code_sku_id": { + "type": "string" + }, + "captcha_key": { + "type": "string" + }, + "promotional_email_opt_in": { + "type": "boolean" + }, + "unique_username_registration": { + "type": "boolean" + }, + "global_name": { + "type": "string" + } + }, + "required": [ + "username", + "consent" + ], + "additionalProperties": false } } } @@ -26234,14 +32287,29 @@ ] } }, - "/auth/mfa/webauthn/": { + "/auth/mfa/webauthn": { "post": { + "security": [], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebAuthnTotpSchema" + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "ticket": { + "type": "string" + } + }, + "required": [ + "code", + "ticket" + ], + "additionalProperties": false } } } @@ -26273,14 +32341,49 @@ ] } }, - "/auth/mfa/totp/": { + "/auth/mfa/totp": { "post": { + "security": [], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TotpSchema" + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "ticket": { + "type": "string" + }, + "gift_code_sku_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "login_source": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "code", + "ticket" + ], + "additionalProperties": false } } } @@ -26312,13 +32415,14 @@ ] } }, - "/auth/logout/": { + "/auth/logout": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "No description available" @@ -26329,14 +32433,43 @@ ] } }, - "/auth/login/": { + "/auth/login": { "post": { + "security": [], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoginSchema" + "type": "object", + "properties": { + "login": { + "type": "string" + }, + "password": { + "type": "string", + "minLength": 1, + "maxLength": 72 + }, + "undelete": { + "type": "boolean" + }, + "captcha_key": { + "type": "string" + }, + "login_source": { + "type": "string" + }, + "gift_code_sku_id": { + "type": "string" + } + }, + "required": [ + "login", + "password" + ], + "additionalProperties": false } } } @@ -26368,8 +32501,10 @@ ] } }, - "/auth/location-metadata/": { + "/auth/location-metadata": { "get": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26387,7 +32522,7 @@ ] } }, - "/auth/generate-registration-tokens/": { + "/auth/generate-registration-tokens": { "get": { "x-right-required": "CREATE_REGISTRATION_TOKENS", "security": [ @@ -26395,6 +32530,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26436,14 +32572,28 @@ ] } }, - "/auth/forgot/": { + "/auth/forgot": { "post": { + "security": [], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ForgotPasswordSchema" + "type": "object", + "properties": { + "login": { + "type": "string" + }, + "captcha_key": { + "type": "string" + } + }, + "required": [ + "login" + ], + "additionalProperties": false } } } @@ -26468,8 +32618,10 @@ ] } }, - "/auth/fingerprint/": { + "/auth/fingerprint": { "post": { + "security": [], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26487,19 +32639,32 @@ ] } }, - "/attachments/refresh-urls/": { + "/attachments/refresh-urls": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RefreshUrlsRequestSchema" + "type": "object", + "properties": { + "attachment_urls": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "attachment_urls" + ], + "additionalProperties": false } } } @@ -26531,13 +32696,14 @@ ] } }, - "/applications/": { + "/applications": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26560,12 +32726,25 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationCreateSchema" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "team_id": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false } } } @@ -26587,13 +32766,14 @@ ] } }, - "/applications/detectable/": { + "/applications/detectable": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26611,13 +32791,14 @@ ] } }, - "/applications/@me/": { + "/applications/@me": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26650,12 +32831,71 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationModifySchema" + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "cover_image": { + "type": "string" + }, + "interactions_endpoint_url": { + "type": "string" + }, + "max_participants": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "privacy_policy_url": { + "type": "string" + }, + "role_connections_verification_url": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms_of_service_url": { + "type": "string" + }, + "bot_public": { + "type": "boolean" + }, + "bot_require_code_grant": { + "type": "boolean" + }, + "flags": { + "type": "number" + }, + "custom_install_url": { + "type": "string" + }, + "guild_id": { + "type": "string" + } + }, + "additionalProperties": false } } } @@ -26687,13 +32927,14 @@ ] } }, - "/applications/{application_id}/skus/": { + "/applications/{application_id}/skus": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26722,13 +32963,14 @@ ] } }, - "/applications/{application_id}/": { + "/applications/{application_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -26772,12 +33014,71 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationModifySchema" + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "cover_image": { + "type": "string" + }, + "interactions_endpoint_url": { + "type": "string" + }, + "max_participants": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "privacy_policy_url": { + "type": "string" + }, + "role_connections_verification_url": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms_of_service_url": { + "type": "string" + }, + "bot_public": { + "type": "boolean" + }, + "bot_require_code_grant": { + "type": "boolean" + }, + "flags": { + "type": "number" + }, + "custom_install_url": { + "type": "string" + }, + "guild_id": { + "type": "string" + } + }, + "additionalProperties": false } } } @@ -26827,6 +33128,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "No description available" @@ -26858,13 +33160,14 @@ ] } }, - "/applications/{application_id}/guilds/{guild_id}/commands/": { + "/applications/{application_id}/guilds/{guild_id}/commands": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -26900,12 +33203,186 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationCommandCreateSchema" + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "definitions": { + "__schema0": { + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required": { + "type": "boolean" + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "channel_types": { + "type": "array", + "items": { + "type": "number" + } + }, + "min_value": { + "type": "number" + }, + "max_value": { + "type": "number" + }, + "min_length": { + "type": "number" + }, + "max_length": { + "type": "number" + }, + "autocomplete": { + "type": "boolean" + } + }, + "required": [ + "type", + "name", + "description" + ], + "additionalProperties": false + } + } } } } @@ -26945,12 +33422,189 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BulkApplicationCommandCreateSchema" + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "definitions": { + "__schema0": { + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required": { + "type": "boolean" + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "channel_types": { + "type": "array", + "items": { + "type": "number" + } + }, + "min_value": { + "type": "number" + }, + "max_value": { + "type": "number" + }, + "min_length": { + "type": "number" + }, + "max_length": { + "type": "number" + }, + "autocomplete": { + "type": "boolean" + } + }, + "required": [ + "type", + "name", + "description" + ], + "additionalProperties": false + } + } } } } @@ -26985,13 +33639,14 @@ ] } }, - "/applications/{application_id}/guilds/{guild_id}/commands/{command_id}/": { + "/applications/{application_id}/guilds/{guild_id}/commands/{command_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -27036,12 +33691,186 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationCommandCreateSchema" + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "definitions": { + "__schema0": { + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required": { + "type": "boolean" + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "channel_types": { + "type": "array", + "items": { + "type": "number" + } + }, + "min_value": { + "type": "number" + }, + "max_value": { + "type": "number" + }, + "min_length": { + "type": "number" + }, + "max_length": { + "type": "number" + }, + "autocomplete": { + "type": "boolean" + } + }, + "required": [ + "type", + "name", + "description" + ], + "additionalProperties": false + } + } } } } @@ -27090,6 +33919,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -27129,13 +33959,14 @@ ] } }, - "/applications/{application_id}/entitlements/": { + "/applications/{application_id}/entitlements": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -27164,13 +33995,14 @@ ] } }, - "/applications/{application_id}/commands/": { + "/applications/{application_id}/commands": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -27197,12 +34029,186 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationCommandCreateSchema" + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "definitions": { + "__schema0": { + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required": { + "type": "boolean" + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "channel_types": { + "type": "array", + "items": { + "type": "number" + } + }, + "min_value": { + "type": "number" + }, + "max_value": { + "type": "number" + }, + "min_length": { + "type": "number" + }, + "max_length": { + "type": "number" + }, + "autocomplete": { + "type": "boolean" + } + }, + "required": [ + "type", + "name", + "description" + ], + "additionalProperties": false + } + } } } } @@ -27233,12 +34239,189 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BulkApplicationCommandCreateSchema" + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "definitions": { + "__schema0": { + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required": { + "type": "boolean" + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "channel_types": { + "type": "array", + "items": { + "type": "number" + } + }, + "min_value": { + "type": "number" + }, + "max_value": { + "type": "number" + }, + "min_length": { + "type": "number" + }, + "max_length": { + "type": "number" + }, + "autocomplete": { + "type": "boolean" + } + }, + "required": [ + "type", + "name", + "description" + ], + "additionalProperties": false + } + } } } } @@ -27264,13 +34447,14 @@ ] } }, - "/applications/{application_id}/commands/{command_id}/": { + "/applications/{application_id}/commands/{command_id}": { "get": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -27306,12 +34490,186 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationCommandCreateSchema" + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "definitions": { + "__schema0": { + "type": "object", + "properties": { + "type": { + "type": "number" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required": { + "type": "boolean" + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema0" + } + }, + "channel_types": { + "type": "array", + "items": { + "type": "number" + } + }, + "min_value": { + "type": "number" + }, + "max_value": { + "type": "number" + }, + "min_length": { + "type": "number" + }, + "max_length": { + "type": "number" + }, + "autocomplete": { + "type": "boolean" + } + }, + "required": [ + "type", + "name", + "description" + ], + "additionalProperties": false + } + } } } } @@ -27351,6 +34709,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "default": { "description": "No description available" @@ -27381,13 +34740,14 @@ ] } }, - "/applications/{application_id}/bot/": { + "/applications/{application_id}/bot": { "post": { "security": [ { "bearer": [] } ], + "summary": "No summary provided", "responses": { "204": { "description": "", @@ -27431,12 +34791,25 @@ "bearer": [] } ], + "summary": "No summary provided", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BotModifySchema" + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "username": { + "type": "string" + }, + "banner": { + "type": "string" + } + }, + "additionalProperties": false } } } @@ -27486,6 +34859,7 @@ "bearer": [] } ], + "summary": "No summary provided", "responses": { "200": { "description": "", @@ -27524,8 +34898,10 @@ ] } }, - "/-/readyz/": { + "/-/readyz": { "get": { + "security": [], + "summary": "No summary provided", "deprecated": true, "responses": { "default": { @@ -27543,8 +34919,10 @@ ] } }, - "/-/healthz/": { + "/-/healthz": { "get": { + "security": [], + "summary": "No summary provided", "deprecated": true, "responses": { "default": { diff --git a/assets/schemas.json b/assets/schemas.json index 158fea5ed9..de94725563 100644 --- a/assets/schemas.json +++ b/assets/schemas.json @@ -12,118 +12,9 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "ApplicationCommandSchema": { - "type": "object", - "properties": { - "id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ], - "type": "number" - }, - "application_id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "guild_id": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "name": { - "type": "string" - }, - "name_localizations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name_localized": { - "type": [ - "null", - "string" - ] - }, - "description": { - "type": "string" - }, - "description_localizations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "description_localized": { - "type": [ - "null", - "string" - ] - }, - "options": { - "type": "array", - "items": { - "$ref": "#/definitions/ApplicationCommandOption" - } - }, - "default_member_permissions": { - "type": [ - "null", - "string" - ] - }, - "dm_permission": { - "type": "boolean" - }, - "permissions": { - "$ref": "#/definitions/ApplicationCommandIndexPermissions" - }, - "nsfw": { - "type": "boolean" - }, - "integration_types": { - "type": "array", - "items": { - "$ref": "#/definitions/ApplicationIntegrationType" - } - }, - "global_popularity_rank": { - "type": "integer" - }, - "contexts": { - "type": "array", - "items": { - "$ref": "#/definitions/InteractionContextType" - } - }, - "version": { - "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", - "type": "string" - }, - "handler": { - "enum": [ - 1, - 2, - 3 - ], - "type": "number" - } - }, - "additionalProperties": false, - "required": [ - "application_id", - "default_member_permissions", - "description", - "name", - "version" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + "BaseSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object" }, "ConnectedAccountCommonOAuthTokenResponse": { "type": "object", @@ -163,7 +54,10 @@ "pattern": "^.*Response$" }, "headers": { - "$ref": "#/definitions/Record" + "type": "object", + "additionalProperties": { + "type": "string" + } } }, "additionalProperties": false, @@ -377,11 +271,10 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "name" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ApplicationModifySchema": { "type": "object", @@ -399,9 +292,13 @@ "type": "string" }, "max_participants": { - "type": [ - "null", - "integer" + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } ] }, "name": { @@ -429,7 +326,7 @@ "type": "boolean" }, "flags": { - "type": "integer" + "type": "number" }, "custom_install_url": { "type": "string" @@ -438,8 +335,7 @@ "type": "string" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "SendableApplicationCommandDataSchema": { "type": "object", @@ -571,7 +467,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/UploadAttachmentRequestSchema" + "type": "object" } } }, @@ -718,14 +614,22 @@ "$schema": "http://json-schema.org/draft-07/schema#" }, "InstanceUserDeleteSchema": { - "$ref": "#/definitions/InstanceUserDeleteSchemaContent", - "$schema": "http://json-schema.org/draft-07/schema#" + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "persistInstanceBan": { + "type": "boolean" + } + }, + "additionalProperties": false }, - "UserSettingsUpdateSchema": { + "UserSettingsSchema": { "type": "object", "properties": { "afk_timeout": { - "type": "integer" + "type": "number" }, "allow_accessibility_detection": { "type": "boolean" @@ -734,7 +638,7 @@ "type": "boolean" }, "animate_stickers": { - "type": "integer" + "type": "number" }, "contact_sync_enabled": { "type": "boolean" @@ -745,7 +649,22 @@ "custom_status": { "anyOf": [ { - "$ref": "#/definitions/CustomStatus" + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "number" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false }, { "type": "null" @@ -768,13 +687,22 @@ "type": "boolean" }, "explicit_content_filter": { - "type": "integer" + "type": "number" }, "friend_discovery_flags": { - "type": "integer" + "type": "number" }, "friend_source_flags": { - "$ref": "#/definitions/FriendSourceFlags" + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "required": [ + "all" + ], + "additionalProperties": false }, "gateway_connected": { "type": "boolean" @@ -785,7 +713,49 @@ "guild_folders": { "type": "array", "items": { - "$ref": "#/definitions/GuildFolder" + "type": "object", + "properties": { + "color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "guild_ids" + ], + "additionalProperties": false } }, "guild_positions": { @@ -825,67 +795,116 @@ "type": "boolean" }, "status": { + "type": "string", "enum": [ + "online", + "offline", "dnd", "idle", - "invisible", - "offline", - "online" - ], - "type": "string" + "invisible" + ] }, "stream_notifications_enabled": { "type": "boolean" }, "theme": { + "type": "string", "enum": [ "dark", "light" - ], - "type": "string" + ] }, "timezone_offset": { - "type": "integer" + "type": "number" }, "view_nsfw_guilds": { "type": "boolean" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "UserSettingsSchema": { - "type": "object", - "properties": { - "afk_timeout": { - "type": "integer" - }, - "allow_accessibility_detection": { - "type": "boolean" - }, - "animate_emoji": { - "type": "boolean" - }, - "animate_stickers": { - "type": "integer" - }, - "contact_sync_enabled": { - "type": "boolean" - }, - "convert_emoticons": { - "type": "boolean" - }, - "custom_status": { - "anyOf": [ - { - "$ref": "#/definitions/CustomStatus" - }, - { - "type": "null" - } - ] - }, - "default_guilds_restricted": { + "required": [ + "afk_timeout", + "allow_accessibility_detection", + "animate_emoji", + "animate_stickers", + "contact_sync_enabled", + "convert_emoticons", + "custom_status", + "default_guilds_restricted", + "detect_platform_accounts", + "developer_mode", + "disable_games_tab", + "enable_tts_command", + "explicit_content_filter", + "friend_discovery_flags", + "friend_source_flags", + "gateway_connected", + "gif_auto_play", + "guild_folders", + "guild_positions", + "inline_attachment_media", + "inline_embed_media", + "locale", + "message_display_compact", + "native_phone_integration_enabled", + "render_embeds", + "render_reactions", + "restricted_guilds", + "show_current_game", + "status", + "stream_notifications_enabled", + "theme", + "timezone_offset", + "view_nsfw_guilds" + ], + "additionalProperties": false + }, + "UserSettingsUpdateSchema": { + "type": "object", + "properties": { + "afk_timeout": { + "type": "number" + }, + "allow_accessibility_detection": { + "type": "boolean" + }, + "animate_emoji": { + "type": "boolean" + }, + "animate_stickers": { + "type": "number" + }, + "contact_sync_enabled": { + "type": "boolean" + }, + "convert_emoticons": { + "type": "boolean" + }, + "custom_status": { + "anyOf": [ + { + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "number" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "default_guilds_restricted": { "type": "boolean" }, "detect_platform_accounts": { @@ -901,13 +920,22 @@ "type": "boolean" }, "explicit_content_filter": { - "type": "integer" + "type": "number" }, "friend_discovery_flags": { - "type": "integer" + "type": "number" }, "friend_source_flags": { - "$ref": "#/definitions/FriendSourceFlags" + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "required": [ + "all" + ], + "additionalProperties": false }, "gateway_connected": { "type": "boolean" @@ -918,7 +946,49 @@ "guild_folders": { "type": "array", "items": { - "$ref": "#/definitions/GuildFolder" + "type": "object", + "properties": { + "color": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "guild_ids" + ], + "additionalProperties": false } }, "guild_positions": { @@ -958,231 +1028,509 @@ "type": "boolean" }, "status": { + "type": "string", "enum": [ + "online", + "offline", "dnd", "idle", - "invisible", - "offline", - "online" - ], - "type": "string" + "invisible" + ] }, "stream_notifications_enabled": { "type": "boolean" }, "theme": { + "type": "string", "enum": [ "dark", "light" - ], - "type": "string" + ] }, "timezone_offset": { - "type": "integer" + "type": "number" }, "view_nsfw_guilds": { "type": "boolean" } }, - "additionalProperties": false, - "required": [ - "afk_timeout", - "allow_accessibility_detection", - "animate_emoji", - "animate_stickers", - "contact_sync_enabled", - "convert_emoticons", - "custom_status", - "default_guilds_restricted", - "detect_platform_accounts", - "developer_mode", - "disable_games_tab", - "enable_tts_command", - "explicit_content_filter", - "friend_discovery_flags", - "friend_source_flags", - "gateway_connected", - "gif_auto_play", - "guild_folders", - "guild_positions", - "inline_attachment_media", - "inline_embed_media", - "locale", - "message_display_compact", - "native_phone_integration_enabled", - "render_embeds", - "render_reactions", - "restricted_guilds", - "show_current_game", - "status", - "stream_notifications_enabled", - "theme", - "timezone_offset", - "view_nsfw_guilds" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, - "IdentifySchema": { + "ActivitySchema": { "type": "object", "properties": { - "token": { - "type": "string" - }, - "properties": { - "type": "object", - "properties": { - "os": { - "type": "string" - }, - "os_atch": { - "type": "string" - }, - "browser": { - "type": "string" - }, - "device": { - "type": "string" - }, - "$os": { - "type": "string" - }, - "$browser": { - "type": "string" - }, - "$device": { - "type": "string" - }, - "browser_user_agent": { - "type": "string" - }, - "browser_version": { - "type": "string" - }, - "os_version": { - "type": "string" - }, - "referrer": { - "type": "string" - }, - "referring_domain": { - "type": "string" - }, - "referrer_current": { - "type": "string" - }, - "referring_domain_current": { - "type": "string" - }, - "release_channel": { - "enum": [ - "canary", - "dev", - "ptb", - "stable" - ], - "type": "string" - }, - "client_build_number": { - "type": "integer" - }, - "client_event_source": { - "type": "string" - }, - "client_version": { - "type": "string" - }, - "system_locale": { - "type": "string" - } - }, - "additionalProperties": false - }, - "intents": { - "type": "bigint" - }, - "presence": { - "$ref": "#/definitions/ActivitySchema" - }, - "compress": { + "afk": { "type": "boolean" }, - "large_threshold": { - "type": "integer" - }, - "largeThreshold": { - "type": "integer" + "status": { + "type": "string" }, - "shard": { - "minItems": 2, - "maxItems": 2, + "activities": { "type": "array", "items": { - "type": "bigint" - } - }, - "guild_subscriptions": { - "type": "boolean" - }, - "capabilities": { - "type": "integer" - }, - "client_state": { - "type": "object", - "properties": { - "guild_hashes": {}, - "highest_last_message_id": { - "type": "integer" - }, - "read_state_version": { - "type": "integer" - }, - "user_guild_settings_version": { - "type": "integer" - }, - "user_settings_version": { - "type": "integer" - }, - "useruser_guild_settings_version": { - "type": "integer" - }, - "private_channels_version": { - "type": "integer" - }, - "guild_versions": {}, - "api_code_version": { - "type": "integer" + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "number" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "number" + }, + "timestamps": { + "type": "object", + "properties": { + "start": { + "type": "number" + }, + "end": { + "type": "number" + } + }, + "additionalProperties": false + }, + "application_id": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "state": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emoji": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "party": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "size": { + "minItems": 2, + "maxItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "additionalProperties": false + }, + "assets": { + "type": "object", + "properties": { + "large_image": { + "type": "string" + }, + "large_text": { + "type": "string" + }, + "small_image": { + "type": "string" + }, + "small_text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "secrets": { + "type": "object", + "properties": { + "join": { + "type": "string" + }, + "spectate": { + "type": "string" + }, + "match": { + "type": "string" + } + }, + "additionalProperties": false + }, + "instance": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "sync_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "context_uri": { + "type": "string" + }, + "album_id": { + "type": "string" + }, + "artist_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "string" + } + }, + "required": [ + "name", + "type" + ], + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "number" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "number" + }, + "timestamps": { + "type": "object", + "properties": { + "start": { + "type": "number" + }, + "end": { + "type": "number" + } + }, + "additionalProperties": false + }, + "application_id": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "state": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emoji": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "party": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "size": { + "minItems": 2, + "maxItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "additionalProperties": false + }, + "assets": { + "type": "object", + "properties": { + "large_image": { + "type": "string" + }, + "large_text": { + "type": "string" + }, + "small_image": { + "type": "string" + }, + "small_text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "secrets": { + "type": "object", + "properties": { + "join": { + "type": "string" + }, + "spectate": { + "type": "string" + }, + "match": { + "type": "string" + } + }, + "additionalProperties": false + }, + "instance": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "sync_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "context_uri": { + "type": "string" + }, + "album_id": { + "type": "string" + }, + "artist_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "flags": { + "type": "number" + }, + "platform": { + "type": "string" + }, + "supported_platforms": { + "type": "array", + "items": { + "type": "string" + } + }, + "parent_application_id": { + "type": "string" + }, + "status_display_type": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "details_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "state_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "buttons": { + "maxItems": 2, + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "type" + ], + "additionalProperties": {} + } + ] + } + }, + "since": { + "anyOf": [ + { + "type": "number" }, - "initial_guild_id": { - "type": "string" + { + "type": "null" } - }, - "additionalProperties": false + ] + } + }, + "required": [ + "status" + ], + "additionalProperties": false + }, + "IdentifySchema": { + "type": "object", + "properties": { + "token": { + "type": "string" }, - "clientState": { - "type": "object", - "properties": { - "guildHashes": {}, - "highestLastMessageId": { - "type": "integer" - }, - "readStateVersion": { - "type": "integer" - }, - "userGuildSettingsVersion": { - "type": "integer" - }, - "useruserGuildSettingsVersion": { - "type": "integer" - }, - "guildVersions": {}, - "apiCodeVersion": { - "type": "integer" + "properties": { + "type": "object" + }, + "compress": { + "type": "boolean" + }, + "large_threshold": { + "type": "integer" + }, + "largeThreshold": { + "type": "integer" + }, + "shard": { + "type": "array", + "items": [ + { + "type": "bigint" }, - "initialGuildId": { - "type": "string" + { + "type": "bigint" } - }, - "additionalProperties": false + ], + "minItems": 2, + "maxItems": 2 + }, + "presence": { + "type": "object" + }, + "intents": { + "type": "bigint" + }, + "capabilities": { + "type": "integer" + }, + "client_state": { + "type": "object" }, "v": { "type": "integer" @@ -1745,6 +2093,9 @@ "region": { "type": "string" }, + "description": { + "type": "string" + }, "icon": { "type": [ "null", @@ -1757,6 +2108,12 @@ "string" ] }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" + }, "system_channel_id": { "type": "string" }, @@ -1775,9 +2132,6 @@ "string" ] }, - "description": { - "type": "string" - }, "features": { "type": "array", "items": { @@ -1793,15 +2147,9 @@ "system_channel_flags": { "type": "integer" }, - "explicit_content_filter": { - "type": "integer" - }, "public_updates_channel_id": { "type": "string" }, - "afk_timeout": { - "type": "integer" - }, "afk_channel_id": { "type": "string" }, @@ -2640,7 +2988,19 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -2649,9 +3009,6 @@ } } }, - "icon": { - "type": "string" - }, "parent": { "type": "string" }, @@ -2690,21 +3047,27 @@ "type": "object", "additionalProperties": false }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/Role" - } - }, "banner": { "type": "string" }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" + }, "channels": { "type": "array", "items": { "$ref": "#/definitions/Channel" } }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, "system_channel_id": { "type": [ "null", @@ -2720,9 +3083,6 @@ "splash": { "type": "string" }, - "description": { - "type": "string" - }, "features": { "type": "array", "items": { @@ -2738,18 +3098,12 @@ "system_channel_flags": { "type": "integer" }, - "explicit_content_filter": { - "type": "integer" - }, "public_updates_channel_id": { "type": [ "null", "string" ] }, - "afk_timeout": { - "type": "integer" - }, "afk_channel_id": { "type": [ "null", @@ -2789,12 +3143,6 @@ "presence_count": { "type": "integer" }, - "members": { - "type": "array", - "items": { - "$ref": "#/definitions/Member" - } - }, "template_id": { "type": "string" }, @@ -2853,7 +3201,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "bans", "channel_ordering", "channels", @@ -2884,6 +3232,9 @@ "APIPublicUser": { "type": "object", "properties": { + "discriminator": { + "type": "string" + }, "id": { "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", "type": "string" @@ -2913,9 +3264,6 @@ "username": { "type": "string" }, - "discriminator": { - "type": "string" - }, "public_flags": { "type": "integer" }, @@ -2966,6 +3314,9 @@ "email": { "type": "string" }, + "discriminator": { + "type": "string" + }, "id": { "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", "type": "string" @@ -3001,9 +3352,6 @@ "username": { "type": "string" }, - "discriminator": { - "type": "string" - }, "public_flags": { "type": "integer" }, @@ -3056,7 +3404,7 @@ "type": "boolean" }, "settings": { - "$ref": "#/definitions/UserSettingsSchema" + "type": "object" } }, "additionalProperties": false, @@ -3110,6 +3458,9 @@ "email": { "type": "string" }, + "discriminator": { + "type": "string" + }, "id": { "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", "type": "string" @@ -3145,9 +3496,6 @@ "username": { "type": "string" }, - "discriminator": { - "type": "string" - }, "public_flags": { "type": "integer" }, @@ -3200,7 +3548,7 @@ "type": "boolean" }, "settings": { - "$ref": "#/definitions/UserSettingsSchema" + "type": "object" } }, "additionalProperties": false, @@ -3533,6 +3881,9 @@ "region": { "type": "string" }, + "description": { + "type": "string" + }, "icon": { "type": [ "null", @@ -3545,6 +3896,12 @@ "string" ] }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" + }, "system_channel_id": { "type": "string" }, @@ -3563,9 +3920,6 @@ "string" ] }, - "description": { - "type": "string" - }, "features": { "type": "array", "items": { @@ -3581,15 +3935,9 @@ "system_channel_flags": { "type": "integer" }, - "explicit_content_filter": { - "type": "integer" - }, "public_updates_channel_id": { "type": "string" }, - "afk_timeout": { - "type": "integer" - }, "afk_channel_id": { "type": "string" }, @@ -3687,27 +4035,159 @@ }, "additionalProperties": false, "required": [ - "absoluteRate", - "channel", - "guild", - "message", - "rate", - "user" + "absoluteRate", + "channel", + "guild", + "message", + "rate", + "user" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "APIStickerPackArray": { + "type": "array", + "items": { + "$ref": "#/definitions/StickerPack" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "APIConnectionsConfiguration": { + "type": "object", + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "WhoAmIResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "device_id": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "rights": { + "type": "integer" + }, + "logged_in_since": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "device_id", + "flags", + "id", + "logged_in_since", + "rights" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "ConfigObjectResponse": { + "type": "object", + "additionalProperties": {}, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "APIAutomodRule": { + "type": "object", + "properties": { + "creator": { + "$ref": "#/definitions/User" + }, + "enabled": { + "type": "boolean" + }, + "event_type": { + "$ref": "#/definitions/AutomodRuleEventType" + }, + "exempt_channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "exempt_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "guild_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "trigger_type": { + "$ref": "#/definitions/AutomodRuleTriggerType" + }, + "trigger_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/AutomodMentionSpamRule" + }, + { + "$ref": "#/definitions/AutomodSuspectedSpamRule" + }, + { + "$ref": "#/definitions/AutomodCommonlyFlaggedWordsRule" + }, + { + "$ref": "#/definitions/AutomodCustomWordsRule" + } + ] + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/AutomodAction" + } + }, + "id": { + "type": "string" + }, + "__@annotationsKey@14092": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "__@annotationsKey@14092", + "actions", + "creator", + "enabled", + "event_type", + "exempt_channels", + "exempt_roles", + "guild_id", + "id", + "name", + "position", + "trigger_type" ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "APIStickerPackArray": { + "APIAutomodRuleArray": { "type": "array", "items": { - "$ref": "#/definitions/StickerPack" + "$ref": "#/definitions/AutomodRule" }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "APIConnectionsConfiguration": { - "type": "object", - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, "UpdatesResponse": { "type": "object", "properties": { @@ -3970,48 +4450,21 @@ "type": "string" }, "read_state_type": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "channel_id", - "message_id", - "read_state_type" - ] + "message_id" + ], + "additionalProperties": false } } }, - "additionalProperties": false, "required": [ "read_states" ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "ActivitySchema": { - "type": "object", - "properties": { - "afk": { - "type": "boolean" - }, - "status": { - "$ref": "#/definitions/Status" - }, - "activities": { - "type": "array", - "items": { - "$ref": "#/definitions/Activity" - } - }, - "since": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "status" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ApplicationAuthorizeSchema": { "type": "object", @@ -4029,113 +4482,17 @@ "type": "string" }, "code": { + "type": "string", "minLength": 6, - "maxLength": 6, - "type": "string" + "maxLength": 6 } }, - "additionalProperties": false, "required": [ "authorize", "guild_id", "permissions" ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "AutomodMentionSpamRuleSchema": { - "type": "object", - "properties": { - "mention_total_limit": { - "type": "integer" - }, - "mention_raid_protection_enabled": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "mention_raid_protection_enabled", - "mention_total_limit" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "AutomodSuspectedSpamRuleSchema": { - "type": "object", - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "AutomodCommonlyFlaggedWordsRuleSchema": { - "type": "object", - "properties": { - "allow_list": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 - }, - "presets": { - "type": "array", - "items": [ - { - "type": "integer" - } - ], - "minItems": 1, - "maxItems": 1 - } - }, - "additionalProperties": false, - "required": [ - "allow_list", - "presets" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "AutomodCustomWordsRuleSchema": { - "type": "object", - "properties": { - "allow_list": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 - }, - "keyword_filter": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 - }, - "regex_patterns": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 - } - }, - "additionalProperties": false, - "required": [ - "allow_list", - "keyword_filter", - "regex_patterns" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "AutomodRuleSchema": { "type": "object", @@ -4147,27 +4504,19 @@ "type": "boolean" }, "event_type": { - "type": "integer" + "type": "number" }, "exempt_channels": { "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 + "items": { + "type": "string" + } }, "exempt_roles": { "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 + "items": { + "type": "string" + } }, "guild_id": { "type": "string" @@ -4176,29 +4525,88 @@ "type": "string" }, "position": { - "type": "integer" + "type": "number" }, "trigger_type": { - "type": "integer" + "type": "number" }, "trigger_metadata": { "anyOf": [ { - "$ref": "#/definitions/AutomodMentionSpamRuleSchema" + "type": "object", + "properties": { + "mention_total_limit": { + "type": "number" + }, + "mention_raid_protection_enabled": { + "type": "boolean" + } + }, + "required": [ + "mention_total_limit", + "mention_raid_protection_enabled" + ], + "additionalProperties": false }, { - "$ref": "#/definitions/AutomodSuspectedSpamRuleSchema" + "type": "object", + "properties": {}, + "additionalProperties": false }, { - "$ref": "#/definitions/AutomodCommonlyFlaggedWordsRuleSchema" + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "presets": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "allow_list", + "presets" + ], + "additionalProperties": false }, { - "$ref": "#/definitions/AutomodCustomWordsRuleSchema" + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyword_filter": { + "type": "array", + "items": { + "type": "string" + } + }, + "regex_patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "allow_list", + "keyword_filter", + "regex_patterns" + ], + "additionalProperties": false } ] } }, - "additionalProperties": false, "required": [ "creator_id", "enabled", @@ -4208,41 +4616,37 @@ "guild_id", "name", "position", - "trigger_metadata", - "trigger_type" + "trigger_type", + "trigger_metadata" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "BackupCodesChallengeSchema": { "type": "object", "properties": { "password": { - "minLength": 1, - "maxLength": 72, "type": "string" } }, - "additionalProperties": false, "required": [ "password" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "BanCreateSchema": { "type": "object", "properties": { - "delete_message_seconds": { - "type": "integer" + "reason": { + "type": "string" }, "delete_message_days": { - "type": "integer" + "type": "number" }, - "reason": { - "type": "string" + "delete_message_seconds": { + "type": "number" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "BanModeratorSchema": { "type": "object", @@ -4263,14 +4667,13 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "executor_id", - "guild_id", "id", - "user_id" + "user_id", + "guild_id", + "executor_id" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "BanRegistrySchema": { "type": "object", @@ -4288,20 +4691,30 @@ "type": "string" }, "ip": { - "type": "string" + "anyOf": [ + { + "type": "string", + "format": "ipv4", + "pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$" + }, + { + "type": "string", + "format": "ipv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$" + } + ] }, "reason": { "type": "string" } }, - "additionalProperties": false, "required": [ - "executor_id", - "guild_id", "id", - "user_id" + "user_id", + "guild_id", + "executor_id" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "BotModifySchema": { "type": "object", @@ -4316,8 +4729,7 @@ "type": "string" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "BulkBanSchema": { "type": "object", @@ -4329,14 +4741,13 @@ } }, "delete_message_seconds": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "user_ids" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "BulkDeleteSchema": { "type": "object", @@ -4348,11 +4759,10 @@ } } }, - "additionalProperties": false, "required": [ "messages" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ChannelModifySchema": { "type": "object", @@ -4412,28 +4822,7 @@ "permission_overwrites": { "type": "array", "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/ChannelPermissionOverwriteType" - }, - "allow": { - "type": "string" - }, - "deny": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "allow", - "deny", - "id", - "type" - ] + "type": "object" } }, "applied_tags": { @@ -4484,38 +4873,7 @@ "available_tags": { "type": "array", "items": { - "additionalProperties": false, - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "moderated": { - "type": [ - "null", - "boolean" - ] - }, - "emoji_id": { - "type": [ - "null", - "string" - ] - }, - "emoji_name": { - "type": [ - "null", - "string" - ] - }, - "id": { - "type": "string" - } - }, - "required": [ - "id", - "name" - ] + "type": "object" } } }, @@ -4525,27 +4883,26 @@ "ChannelPermissionOverwriteSchema": { "type": "object", "properties": { - "allow": { + "id": { "type": "string" }, - "deny": { - "type": "string" + "type": { + "type": "number" }, - "id": { + "allow": { "type": "string" }, - "type": { - "$ref": "#/definitions/ChannelPermissionOverwriteType" + "deny": { + "type": "string" } }, - "additionalProperties": false, "required": [ - "allow", - "deny", "id", - "type" + "type", + "allow", + "deny" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ChannelReorderSchema": { "type": "array", @@ -4556,24 +4913,27 @@ "type": "string" }, "position": { - "type": "integer" + "type": "number" }, "lock_permissions": { "type": "boolean" }, "parent_id": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] } }, - "additionalProperties": false, "required": [ "id" - ] - }, - "$schema": "http://json-schema.org/draft-07/schema#" + ], + "additionalProperties": false + } }, "CodesVerificationSchema": { "type": "object", @@ -4588,12 +4948,7 @@ "type": "boolean" } }, - "additionalProperties": false, - "required": [ - "key", - "nonce" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ConnectedAccountSchema": { "type": "object", @@ -4604,9 +4959,7 @@ "user_id": { "type": "string" }, - "token_data": { - "$ref": "#/definitions/ConnectedAccountTokenData" - }, + "token_data": {}, "friend_sync": { "type": "boolean" }, @@ -4617,7 +4970,7 @@ "type": "boolean" }, "show_activity": { - "type": "integer" + "type": "number" }, "type": { "type": "string" @@ -4626,7 +4979,7 @@ "type": "boolean" }, "visibility": { - "type": "integer" + "type": "number" }, "integrations": { "type": "array", @@ -4636,20 +4989,22 @@ }, "metadata_": {}, "metadata_visibility": { - "type": "integer" + "type": "number" }, "two_way_link": { "type": "boolean" + }, + "access_token": { + "type": "string" } }, - "additionalProperties": false, "required": [ "external_id", + "user_id", "name", - "type", - "user_id" + "type" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ConnectionCallbackSchema": { "type": "object", @@ -4666,15 +5021,17 @@ "friend_sync": { "type": "boolean" }, - "openid_params": {} + "openid_params": { + "type": "object", + "additionalProperties": {} + } }, - "additionalProperties": false, "required": [ - "friend_sync", + "state", "insecure", - "state" + "friend_sync" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ConnectionUpdateSchema": { "type": "object", @@ -4689,8 +5046,7 @@ "type": "boolean" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "DmChannelCreateSchema": { "type": "object", @@ -4714,8 +5070,7 @@ } } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "EmailDomainLookupSchema": { "type": "object", @@ -4724,7 +5079,9 @@ "type": "boolean" }, "email": { - "type": "string" + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "use_verification_code": { "type": "boolean" @@ -4733,19 +5090,20 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "allow_multiple_guilds", "email", "use_verification_code" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "EmailDomainLookupVerifyCodeSchema": { "type": "object", "properties": { "email": { - "type": "string" + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "guild_id": { "type": "string" @@ -4754,13 +5112,12 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "code", "email", - "guild_id" + "guild_id", + "code" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "EmojiCreateSchema": { "type": "object", @@ -4772,9 +5129,13 @@ "type": "string" }, "require_colons": { - "type": [ - "null", - "boolean" + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } ] }, "roles": { @@ -4784,11 +5145,10 @@ } } }, - "additionalProperties": false, "required": [ "image" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "EmojiModifySchema": { "type": "object", @@ -4803,8 +5163,7 @@ } } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ForgotPasswordSchema": { "type": "object", @@ -4812,61 +5171,192 @@ "login": { "type": "string" }, - "captcha_key": { + "captcha_key": { + "type": "string" + } + }, + "required": [ + "login" + ], + "additionalProperties": false + }, + "GreetRequestSchema": { + "type": "object", + "properties": { + "sticker_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + } + }, + "required": [ + "message_id" + ], + "additionalProperties": false + } + }, + "required": [ + "sticker_ids" + ], + "additionalProperties": false + }, + "ChannelCreateSchema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 2, + 255, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "type": "number" + }, + "position": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "flags": { + "type": "integer" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "parent_id": { "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "login" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "GreetRequestSchema": { - "type": "object", - "properties": { - "sticker_ids": { + }, + "default_auto_archive_duration": { + "type": "integer" + }, + "permission_overwrites": { "type": "array", "items": { - "type": "string" + "type": "object" } }, - "allowed_mentions": { - "$ref": "#/definitions/AllowedMentions" + "video_quality_mode": { + "type": "integer" }, - "message_reference": { - "type": "object", - "properties": { - "message_id": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "fail_if_not_exists": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "message_id" + "bitrate": { + "type": "integer" + }, + "user_limit": { + "type": "integer" + }, + "nsfw": { + "type": "boolean" + }, + "rate_limit_per_user": { + "type": "integer" + }, + "topic": { + "type": "string" + }, + "default_thread_rate_limit_per_user": { + "type": "integer" + }, + "invitable": { + "type": "boolean" + }, + "rtc_region": { + "type": "string" + }, + "default_reaction_emoji": { + "type": [ + "null", + "string" ] + }, + "auto_archive_duration": { + "type": "integer" + }, + "archived": { + "type": "boolean" + }, + "locked": { + "type": "boolean" } }, "additionalProperties": false, - "required": [ - "sticker_ids" - ], "$schema": "http://json-schema.org/draft-07/schema#" }, "GuildCreateSchema": { "type": "object", "properties": { "name": { - "maxLength": 100, "type": "string" }, "region": { @@ -4881,7 +5371,7 @@ "channels": { "type": "array", "items": { - "$ref": "#/definitions/ChannelCreateSchema" + "type": "object" } }, "system_channel_id": { @@ -4900,22 +5390,6 @@ "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" }, - "GuildSubscriptionsBulkSchema": { - "type": "object", - "properties": { - "subscriptions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/GuildSubscriptionSchema" - } - } - }, - "additionalProperties": false, - "required": [ - "subscriptions" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "GuildSubscriptionSchema": { "type": "object", "properties": { @@ -4926,17 +5400,11 @@ "items": { "type": "array", "items": { - "type": "integer" + "type": "number" } } } }, - "members": { - "type": "array", - "items": { - "type": "string" - } - }, "activities": { "type": "boolean" }, @@ -4944,8 +5412,14 @@ "type": "boolean" }, "typing": { - "const": true, - "type": "boolean" + "type": "boolean", + "const": true + }, + "members": { + "type": "array", + "items": { + "type": "string" + } }, "member_updates": { "type": "boolean" @@ -4955,8 +5429,60 @@ "items": {} } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false + }, + "GuildSubscriptionsBulkSchema": { + "type": "object", + "properties": { + "subscriptions": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "channels": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "activities": { + "type": "boolean" + }, + "threads": { + "type": "boolean" + }, + "typing": { + "type": "boolean", + "const": true + }, + "members": { + "type": "array", + "items": { + "type": "string" + } + }, + "member_updates": { + "type": "boolean" + }, + "thread_member_lists": { + "type": "array", + "items": {} + } + }, + "additionalProperties": false + } + } + }, + "required": [ + "subscriptions" + ], + "additionalProperties": false }, "GuildTemplateCreateSchema": { "type": "object", @@ -4965,21 +5491,48 @@ "type": "string" }, "icon": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] } }, - "additionalProperties": false, "required": [ "name" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "GuildUpdateSchema": { "type": "object", "properties": { + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "system_channel_id": { + "type": "string" + }, + "rules_channel_id": { + "type": "string" + }, + "guild_template_code": { + "type": "string" + }, + "staff_only": { + "type": "boolean" + }, "banner": { "type": [ "null", @@ -5036,31 +5589,6 @@ "null", "string" ] - }, - "name": { - "maxLength": 100, - "type": "string" - }, - "region": { - "type": "string" - }, - "icon": { - "type": [ - "null", - "string" - ] - }, - "system_channel_id": { - "type": "string" - }, - "rules_channel_id": { - "type": "string" - }, - "guild_template_code": { - "type": "string" - }, - "staff_only": { - "type": "boolean" } }, "additionalProperties": false, @@ -5069,6 +5597,16 @@ "GuildUpdateWelcomeScreenSchema": { "type": "object", "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, "welcome_channels": { "type": "array", "items": { @@ -5087,39 +5625,36 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "channel_id", "description" - ] + ], + "additionalProperties": false } }, "enabled": { "type": "boolean" - }, - "description": { - "type": "string" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "HubWaitlistSignupSchema": { "type": "object", "properties": { "email": { - "type": "string" + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "school": { "type": "string" } }, - "additionalProperties": false, "required": [ "email", "school" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "InviteCreateSchema": { "type": "object", @@ -5128,35 +5663,25 @@ "type": "string" }, "target_type": { - "type": "string" - }, - "validate": { - "type": "string" + "type": "number" }, "max_age": { - "type": "integer" + "type": "number" }, "max_uses": { - "type": "integer" + "type": "number" }, "temporary": { "type": "boolean" }, - "unique": { - "type": "boolean" - }, - "target_user": { - "type": "string" - }, - "target_user_type": { - "type": "integer" - }, + "unique": { + "type": "boolean" + }, "flags": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "MFAResponse": { "type": "object", @@ -5237,9 +5762,9 @@ "type": "string" }, "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "undelete": { "type": "boolean" @@ -5254,47 +5779,56 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "login", "password" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "MemberChangeProfileSchema": { "type": "object", "properties": { - "banner": { - "type": [ - "null", - "string" - ] - }, "nick": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "bio": { "type": "string" }, + "banner": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, "pronouns": { "type": "string" }, "theme_colors": { - "items": [ + "anyOf": [ { - "type": "integer" + "type": "array", + "items": { + "type": "number" + } }, { - "type": "integer" + "type": "null" } - ], - "type": "array", - "minItems": 2, - "maxItems": 2 + ] } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "MemberChangeSchema": { "type": "object", @@ -5306,26 +5840,40 @@ } }, "nick": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "avatar": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, - "bio": { - "type": "string" - }, "communication_disabled_until": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] + }, + "flags": { + "type": "number" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "MemberNickChangeSchema": { "type": "object", @@ -5334,66 +5882,55 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "nick" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "MessageAcknowledgeSchema": { "type": "object", "properties": { + "token": { + "type": "string" + }, "manual": { "type": "boolean" }, "mention_count": { - "type": "integer" + "type": "number" }, "flags": { - "enum": [ - 0, - 1, - 2, - 4 - ], "type": "number" }, "last_viewed": { - "type": "integer" - }, - "token": { - "type": "string" + "type": "number" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "AcknowledgeDeleteSchema": { "type": "object", "properties": { "read_state_type": { + "type": "number", "enum": [ 0, 1, 2, - 3, - 4, - 5 - ], - "type": "number" + 3 + ] }, "version": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "MessageCreateSchema": { "type": "object", "properties": { "type": { - "type": "integer" + "type": "number" }, "content": { "type": "string" @@ -5411,15 +5948,13 @@ "type": "boolean" }, "flags": { - "type": "integer" + "type": "number" }, "embeds": { "anyOf": [ { "type": "array", - "items": { - "$ref": "#/definitions/Embed" - } + "items": {} }, { "type": "null" @@ -5428,9 +5963,7 @@ }, "embed": { "anyOf": [ - { - "$ref": "#/definitions/Embed" - }, + {}, { "type": "null" } @@ -5479,7 +6012,7 @@ "type": "boolean" }, "type": { - "type": "integer" + "type": "number" } }, "additionalProperties": false @@ -5494,13 +6027,12 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename" - ] + ], + "additionalProperties": false }, "attachments": { - "description": "TODO: we should create an interface for attachments\nTODO: OpenWAAO<-->attachment-style metadata conversion", "type": "array", "items": { "anyOf": [ @@ -5514,11 +6046,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "filename", - "id" - ] + "id", + "filename" + ], + "additionalProperties": false }, { "type": "object", @@ -5536,11 +6068,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename", "uploaded_filename" - ] + ], + "additionalProperties": false } ] } @@ -5562,9 +6094,7 @@ "anyOf": [ { "type": "array", - "items": { - "$ref": "#/definitions/ActionRowComponent" - } + "items": {} }, { "type": "null" @@ -5572,7 +6102,54 @@ ] }, "poll": { - "$ref": "#/definitions/PollCreationSchema" + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false }, "enforce_nonce": { "type": "boolean" @@ -5580,153 +6157,73 @@ "applied_tags": { "type": "array", "items": { - "type": "string" - } - }, - "thread_name": { - "type": "string" - }, - "avatar_url": { - "type": "string" - }, - "interaction": { - "$ref": "#/definitions/MessageInteractionSchema" - }, - "interaction_metadata": { - "$ref": "#/definitions/MessageInteractionSchema" - } - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "PollCreationSchema": { - "type": "object", - "properties": { - "question": { - "$ref": "#/definitions/PollMedia" - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/definitions/PollAnswer" - } - }, - "duration": { - "type": "integer" - }, - "allow_multiselect": { - "type": "boolean" - }, - "layout_type": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "answers", - "question" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "MessageInteractionSchema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/InteractionType" - }, - "name": { - "type": "string" - }, - "command_type": { - "enum": [ - 1, - 2, - 3, - 4 - ], - "type": "number" - }, - "ephemerality_reason": { - "type": "integer" - }, - "user": { - "$ref": "#/definitions/PublicUser" - }, - "user_id": { - "type": "string" - }, - "authorizing_integration_owners": { - "type": "object", - "properties": {}, - "additionalProperties": true - }, - "original_response_message_id": { - "description": "A container for useful snowflake-related methods.", - "$ref": "#/definitions/Snowflake" - }, - "interacted_message_id": { - "description": "A container for useful snowflake-related methods.", - "$ref": "#/definitions/Snowflake" + "type": "string" + } }, - "triggering_interaction_metadata": { - "$ref": "#/definitions/MessageInteractionSchema" + "thread_name": { + "type": "string" }, - "target_user": { - "$ref": "#/definitions/PublicUser" + "avatar_url": { + "type": "string" }, - "target_message_id": { - "description": "A container for useful snowflake-related methods.", - "$ref": "#/definitions/Snowflake" - } + "interaction": {}, + "interaction_metadata": {} }, - "additionalProperties": false, - "required": [ - "id", - "name", - "type" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, - "MessageEditSchema": { + "PollCreationSchema": { "type": "object", "properties": { - "embed": { - "anyOf": [ - { - "$ref": "#/definitions/Embed" - }, - { - "type": "null" - } - ] - }, - "file": { + "question": { "type": "object", "properties": { - "filename": { + "text": { "type": "string" } }, - "additionalProperties": false, - "required": [ - "filename" - ] - }, - "flags": { - "type": "integer" + "additionalProperties": false }, - "applied_tags": { + "answers": { "type": "array", "items": { - "type": "string" + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false } }, - "channel_id": { - "type": "string" + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false + }, + "MessageEditSchema": { + "type": "object", + "properties": { "content": { "type": "string" }, @@ -5736,22 +6233,34 @@ "nonce": { "type": "string" }, + "channel_id": { + "type": "string" + }, "tts": { "type": "boolean" }, + "flags": { + "type": "number" + }, "embeds": { "anyOf": [ { "type": "array", - "items": { - "$ref": "#/definitions/Embed" - } + "items": {} }, { "type": "null" } ] }, + "embed": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + }, "allowed_mentions": { "type": "object", "properties": { @@ -5795,7 +6304,7 @@ "type": "boolean" }, "type": { - "type": "integer" + "type": "number" } }, "additionalProperties": false @@ -5803,8 +6312,19 @@ "payload_json": { "type": "string" }, + "file": { + "type": "object", + "properties": { + "filename": { + "type": "string" + } + }, + "required": [ + "filename" + ], + "additionalProperties": false + }, "attachments": { - "description": "TODO: we should create an interface for attachments\nTODO: OpenWAAO<-->attachment-style metadata conversion", "type": "array", "items": { "anyOf": [ @@ -5818,11 +6338,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "filename", - "id" - ] + "id", + "filename" + ], + "additionalProperties": false }, { "type": "object", @@ -5840,11 +6360,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename", "uploaded_filename" - ] + ], + "additionalProperties": false } ] } @@ -5866,9 +6386,7 @@ "anyOf": [ { "type": "array", - "items": { - "$ref": "#/definitions/ActionRowComponent" - } + "items": {} }, { "type": "null" @@ -5876,87 +6394,132 @@ ] }, "poll": { - "$ref": "#/definitions/PollCreationSchema" + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false }, "enforce_nonce": { "type": "boolean" }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + }, "thread_name": { "type": "string" }, "avatar_url": { "type": "string" }, - "interaction": { - "$ref": "#/definitions/MessageInteractionSchema" - }, - "interaction_metadata": { - "$ref": "#/definitions/MessageInteractionSchema" - } + "interaction": {}, + "interaction_metadata": {} }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "MfaCodesSchema": { "type": "object", "properties": { "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "regenerate": { "type": "boolean" } }, - "additionalProperties": false, "required": [ "password" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ModifyGuildStickerSchema": { "type": "object", "properties": { "name": { + "type": "string", "minLength": 2, - "maxLength": 30, - "type": "string" + "maxLength": 30 }, "description": { - "maxLength": 100, - "type": "string" + "type": "string", + "maxLength": 100 }, "tags": { - "maxLength": 200, - "type": "string" + "type": "string", + "maxLength": 200 } }, - "additionalProperties": false, "required": [ "name", "tags" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "PasswordResetSchema": { "type": "object", "properties": { "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "token": { "type": "string" } }, - "additionalProperties": false, "required": [ "password", "token" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "PreloadMessagesRequestSchema": { "type": "object", @@ -5974,21 +6537,29 @@ } } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "PruneSchema": { "type": "object", "properties": { "days": { - "type": "integer" + "type": "number", + "minimum": 0 + }, + "compute_prune_count": { + "type": "boolean" + }, + "include_roles": { + "type": "array", + "items": { + "type": "string" + } } }, - "additionalProperties": false, "required": [ "days" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "PurgeSchema": { "type": "object", @@ -6000,12 +6571,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "after", - "before" + "before", + "after" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "RefreshUrlsRequestSchema": { "type": "object", @@ -6017,30 +6587,30 @@ } } }, - "additionalProperties": false, "required": [ "attachment_urls" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "RegisterSchema": { "type": "object", "properties": { "username": { - "minLength": 2, - "type": "string" + "type": "string", + "minLength": 2 }, "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "consent": { "type": "boolean" }, "email": { + "type": "string", "format": "email", - "type": "string" + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "fingerprint": { "type": "string" @@ -6049,7 +6619,15 @@ "type": "string" }, "date_of_birth": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "format": "date-time" + } + ] }, "gift_code_sku_id": { "type": "string" @@ -6067,58 +6645,67 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "consent", - "username" + "username", + "consent" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "RelationshipPostSchema": { "type": "object", "properties": { "discriminator": { - "type": "string" + "type": "number" }, "username": { "type": "string" } }, - "additionalProperties": false, "required": [ - "discriminator", "username" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "RelationshipPatchSchema": { "type": "object", "properties": { + "type": { + "type": "number" + }, "nickname": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "RelationshipPutSchema": { "type": "object", "properties": { "type": { - "enum": [ - 1, - 2, - 3, - 4 - ], "type": "number" }, "confirm_stranger_request": { "type": "boolean" + }, + "nickname": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "RequestGuildMembersSchema": { "type": "object", @@ -6126,17 +6713,13 @@ "guild_id": { "anyOf": [ { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "maxItems": 1 + "type": "string" }, { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } ] }, @@ -6144,21 +6727,21 @@ "type": "string" }, "limit": { - "type": "integer" + "type": "number" }, "presences": { "type": "boolean" }, "user_ids": { "anyOf": [ + { + "type": "string" + }, { "type": "array", "items": { "type": "string" } - }, - { - "type": "string" } ] }, @@ -6166,11 +6749,10 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "guild_id" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "RoleModifySchema": { "type": "object", @@ -6182,7 +6764,7 @@ "type": "string" }, "color": { - "type": "integer" + "type": "number" }, "hoist": { "type": "boolean" @@ -6191,7 +6773,7 @@ "type": "boolean" }, "position": { - "type": "integer" + "type": "number" }, "icon": { "type": "string" @@ -6203,29 +6785,36 @@ "type": "object", "properties": { "primary_color": { - "type": "integer" + "type": "number" }, "secondary_color": { - "type": [ - "null", - "integer" + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } ] }, "tertiary_color": { - "type": [ - "null", - "integer" + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } ] } }, - "additionalProperties": false, "required": [ "primary_color" - ] + ], + "additionalProperties": false } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "RolePositionUpdateSchema": { "type": "array", @@ -6236,29 +6825,31 @@ "type": "string" }, "position": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "id", "position" - ] - }, - "$schema": "http://json-schema.org/draft-07/schema#" + ], + "additionalProperties": false + } }, "SelectProtocolSchema": { "type": "object", "properties": { "protocol": { + "type": "string", "enum": [ - "udp", - "webrtc" - ], - "type": "string" + "webrtc", + "udp" + ] }, "data": { "anyOf": [ + { + "type": "string" + }, { "type": "object", "properties": { @@ -6266,21 +6857,18 @@ "type": "string" }, "port": { - "type": "integer" + "type": "number" }, "mode": { "type": "string" } }, - "additionalProperties": false, "required": [ "address", - "mode", - "port" - ] - }, - { - "type": "string" + "port", + "mode" + ], + "additionalProperties": false } ] }, @@ -6293,50 +6881,49 @@ "type": "object", "properties": { "name": { + "type": "string", "enum": [ - "H264", + "opus", "VP8", "VP9", - "opus" - ], - "type": "string" + "H264" + ] }, "type": { + "type": "string", "enum": [ "audio", "video" - ], - "type": "string" + ] }, "priority": { - "type": "integer" + "type": "number" }, "payload_type": { - "type": "integer" + "type": "number" }, "rtx_payload_type": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "name", - "payload_type", + "type", "priority", - "type" - ] + "payload_type" + ], + "additionalProperties": false } }, "rtc_connection_id": { "type": "string" } }, - "additionalProperties": false, "required": [ - "data", - "protocol" + "protocol", + "data" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "SettingsProtoUpdateSchema": { "type": "object", @@ -6345,30 +6932,29 @@ "type": "string" }, "required_data_version": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "settings" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "SettingsProtoUpdateJsonSchema": { "type": "object", "properties": { "settings": { - "$ref": "#/definitions/JsonValue" + "type": "object", + "additionalProperties": {} }, "required_data_version": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "settings" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "TeamCreateSchema": { "type": "object", @@ -6377,11 +6963,10 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "name" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "TemplateCreateSchema": { "type": "object", @@ -6390,14 +6975,20 @@ "type": "string" }, "description": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, - "additionalProperties": false, "required": [ "name" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "TemplateModifySchema": { "type": "object", @@ -6406,52 +6997,53 @@ "type": "string" }, "description": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, - "additionalProperties": false, - "required": [ - "name" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "TotpDisableSchema": { "type": "object", "properties": { "code": { + "type": "string", "minLength": 6, - "maxLength": 6, - "type": "string" + "maxLength": 6 } }, - "additionalProperties": false, "required": [ "code" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "TotpEnableSchema": { "type": "object", "properties": { "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "code": { + "type": "string", "minLength": 6, - "maxLength": 6, - "type": "string" + "maxLength": 6 }, "secret": { "type": "string" } }, - "additionalProperties": false, "required": [ "password" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "TotpSchema": { "type": "object", @@ -6463,24 +7055,31 @@ "type": "string" }, "gift_code_sku_id": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "login_source": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] } }, - "additionalProperties": false, "required": [ "code", "ticket" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "UploadAttachmentRequestSchema": { "type": "object", @@ -6488,15 +7087,36 @@ "files": { "type": "array", "items": { - "$ref": "#/definitions/UploadAttachmentRequest" + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "file_size": { + "type": "number" + }, + "is_clip": { + "type": "boolean" + }, + "original_content_type": { + "type": "string" + } + }, + "required": [ + "filename", + "file_size" + ], + "additionalProperties": false } } }, - "additionalProperties": false, "required": [ "files" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "UserDeleteSchema": { "type": "object", @@ -6505,26 +7125,73 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "user_id" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "UserGuildSettingsSchema": { "type": "object", "properties": { "channel_overrides": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ChannelOverride" - } - }, - "version": { - "type": "integer" + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "message_notifications": { + "type": "number" + }, + "mute_config": { + "anyOf": [ + { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "selected_time_window": { + "type": "number" + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "message_notifications", + "mute_config", + "muted", + "channel_id" + ], + "additionalProperties": false + } + }, + { + "type": "null" + } + ] }, "message_notifications": { - "type": "integer" + "type": "number" }, "mobile_push": { "type": "boolean" @@ -6532,7 +7199,16 @@ "mute_config": { "anyOf": [ { - "$ref": "#/definitions/MuteConfig" + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "selected_time_window": { + "type": "number" + } + }, + "additionalProperties": false }, { "type": "null" @@ -6548,14 +7224,21 @@ "suppress_roles": { "type": "boolean" }, + "version": { + "type": "number" + }, "guild_id": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "flags": { - "type": "integer" + "type": "number" }, "mute_scheduled_events": { "type": "boolean" @@ -6564,69 +7247,78 @@ "type": "boolean" }, "notify_highlights": { - "const": 0, - "type": "number" + "type": "number", + "const": 0 } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "UserModifySchema": { "type": "object", "properties": { "username": { - "minLength": 2, - "type": "string" + "type": "string", + "minLength": 2 }, "avatar": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "bio": { "type": "string" }, "accent_color": { - "type": "integer" + "type": "number" }, "banner": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "new_password": { + "type": "string", "minLength": 1, - "maxLength": 72, - "type": "string" + "maxLength": 72 }, "code": { + "type": "string", "minLength": 6, - "maxLength": 6, - "type": "string" + "maxLength": 6 }, "email": { + "type": "string", "format": "email", - "type": "string" + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "discriminator": { + "type": "string", "minLength": 4, - "maxLength": 4, - "type": "string" + "maxLength": 4 }, "display_name_colors": { "type": "array", "items": { - "type": "integer" + "type": "number" } }, "display_name_effect_id": { + "type": "number", "enum": [ 0, 1, @@ -6635,16 +7327,14 @@ 4, 5, 6 - ], - "type": "number" + ] }, "display_name_font_id": { + "type": "number", "enum": [ 0, - 1, - 10, 11, - 12, + 1, 2, 3, 4, @@ -6652,13 +7342,13 @@ 6, 7, 8, - 9 - ], - "type": "number" + 9, + 10, + 12 + ] } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "UserNoteUpdateSchema": { "type": "object", @@ -6667,11 +7357,10 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "note" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "UserProfileModifySchema": { "type": "object", @@ -6680,67 +7369,76 @@ "type": "string" }, "accent_color": { - "type": [ - "null", - "integer" + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } ] }, "banner": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "pronouns": { "type": "string" }, "theme_colors": { - "items": [ + "anyOf": [ { - "type": "integer" + "type": "array", + "items": { + "type": "number" + } }, { - "type": "integer" + "type": "null" } - ], - "type": "array", - "minItems": 2, - "maxItems": 2 + ] } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "VanityUrlSchema": { "type": "object", "properties": { "code": { + "type": "string", "minLength": 1, - "maxLength": 20, - "type": "string" + "maxLength": 20 } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "VerifyEmailSchema": { "type": "object", "properties": { "captcha_key": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "token": { "type": "string" } }, - "additionalProperties": false, "required": [ "token" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "VoiceStateUpdateSchema": { "type": "object", @@ -6765,21 +7463,21 @@ }, "request_to_speak_timestamp": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "suppress": { "type": "boolean" }, "flags": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ - "self_deaf", - "self_mute" + "self_mute", + "self_deaf" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "GenerateWebAuthnCredentialsSchema": { "type": "object", @@ -6788,11 +7486,10 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "password" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "CreateWebAuthnCredentialSchema": { "type": "object", @@ -6807,24 +7504,48 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "credential", "name", "ticket" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "WebAuthnPostSchema": { "anyOf": [ { - "$ref": "#/definitions/GenerateWebAuthnCredentialsSchema" + "type": "object", + "properties": { + "password": { + "type": "string" + } + }, + "required": [ + "password" + ], + "additionalProperties": false }, { - "$ref": "#/definitions/CreateWebAuthnCredentialSchema" + "type": "object", + "properties": { + "credential": { + "type": "string" + }, + "name": { + "type": "string" + }, + "ticket": { + "type": "string" + } + }, + "required": [ + "credential", + "name", + "ticket" + ], + "additionalProperties": false } - ], - "$schema": "http://json-schema.org/draft-07/schema#" + ] }, "WebAuthnTotpSchema": { "type": "object", @@ -6836,29 +7557,27 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "code", "ticket" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "WebhookCreateSchema": { "type": "object", "properties": { "name": { - "maxLength": 80, - "type": "string" + "type": "string", + "maxLength": 80 }, "avatar": { "type": "string" } }, - "additionalProperties": false, "required": [ "name" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "WebhookExecuteSchema": { "type": "object", @@ -6878,7 +7597,8 @@ "embeds": { "type": "array", "items": { - "$ref": "#/definitions/Embed" + "type": "object", + "additionalProperties": {} } }, "allowed_mentions": { @@ -6910,7 +7630,10 @@ }, "components": { "type": "array", - "items": {} + "items": { + "type": "object", + "additionalProperties": {} + } }, "file": { "type": "object", @@ -6919,16 +7642,15 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename" - ] + ], + "additionalProperties": false }, "payload_json": { "type": "string" }, "attachments": { - "description": "TODO: we should create an interface for attachments\nTODO: OpenWAAO<-->attachment-style metadata conversion", "type": "array", "items": { "type": "object", @@ -6940,15 +7662,15 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "filename", - "id" - ] + "id", + "filename" + ], + "additionalProperties": false } }, "flags": { - "type": "integer" + "type": "number" }, "thread_name": { "type": "string" @@ -6975,10 +7697,10 @@ "type": "boolean" } }, - "additionalProperties": false, "required": [ "message_id" - ] + ], + "additionalProperties": false }, "sticker_ids": { "type": "array", @@ -6993,11 +7715,57 @@ "type": "boolean" }, "poll": { - "$ref": "#/definitions/PollCreationSchema" + "type": "object", + "properties": { + "question": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "poll_media": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "emoji": {} + }, + "additionalProperties": false + } + }, + "required": [ + "poll_media" + ], + "additionalProperties": false + } + }, + "duration": { + "type": "number" + }, + "allow_multiselect": { + "type": "boolean" + }, + "layout_type": { + "type": "number" + } + }, + "required": [ + "question", + "answers" + ], + "additionalProperties": false } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "WebhookUpdateSchema": { "type": "object", @@ -7006,153 +7774,74 @@ "type": "string" }, "avatar": { - "type": "string" - }, - "channel_id": { - "type": "string" - } - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "WidgetModifySchema": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "channel_id": { "type": "string" } }, - "additionalProperties": false, - "required": [ - "channel_id", - "enabled" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "MessageThreadCreationSchema": { - "type": "object", - "properties": { - "auto_archive_duration": { - "type": "integer" - }, - "rate_limit_per_user": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "location": { - "type": "string" - }, - "type": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "name" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, - "ApplicationCommandCreateSchema": { - "type": "object", - "properties": { - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ], - "type": "number" - }, - "name": { - "type": "string" - }, - "name_localizations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "description_localizations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "options": { - "type": "array", - "items": { - "$ref": "#/definitions/ApplicationCommandOption" - } + "WidgetModifySchema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" }, - "default_member_permissions": { + "channel_id": { "type": "string" + } + }, + "required": [ + "enabled", + "channel_id" + ], + "additionalProperties": false + }, + "MessageThreadCreationSchema": { + "type": "object", + "properties": { + "auto_archive_duration": { + "type": "number" }, - "dm_permission": { - "type": "boolean" - }, - "nsfw": { - "type": "boolean" + "rate_limit_per_user": { + "type": "number" }, - "integration_types": { - "type": "array", - "items": { - "$ref": "#/definitions/ApplicationIntegrationType" - } + "name": { + "type": "string" }, - "contexts": { - "type": "array", - "items": { - "$ref": "#/definitions/InteractionContextType" - } + "location": { + "type": "string" }, - "handler": { - "enum": [ - 1, - 2, - 3 - ], + "type": { "type": "number" } }, - "additionalProperties": false, "required": [ "name" ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "BulkApplicationCommandCreateSchema": { - "type": "array", - "items": { - "$ref": "#/definitions/ApplicationCommandCreateSchema" - }, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "ThreadCreationSchema": { "type": "object", "properties": { "auto_archive_duration": { - "type": "integer" + "type": "number" }, "rate_limit_per_user": { - "type": "integer" + "type": "number" }, "name": { "type": "string" }, "type": { - "enum": [ - 11, - 12 - ], "type": "number" }, "invitable": { @@ -7175,9 +7864,7 @@ }, "embeds": { "type": "array", - "items": { - "$ref": "#/definitions/Embed" - } + "items": {} }, "allowed_mentions": { "type": "object", @@ -7210,9 +7897,7 @@ "anyOf": [ { "type": "array", - "items": { - "$ref": "#/definitions/ActionRowComponent" - } + "items": {} }, { "type": "null" @@ -7225,14 +7910,12 @@ "type": "string" } }, - "activity": { - "$ref": "#/definitions/MessageActivity" - }, + "activity": {}, "application_id": { "type": "string" }, "flags": { - "type": "integer" + "type": "number" }, "attachments": { "type": "array", @@ -7248,11 +7931,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ - "filename", - "id" - ] + "id", + "filename" + ], + "additionalProperties": false }, { "type": "object", @@ -7270,11 +7953,11 @@ "type": "string" } }, - "additionalProperties": false, "required": [ "filename", "uploaded_filename" - ] + ], + "additionalProperties": false } ] } @@ -7283,11 +7966,11 @@ "additionalProperties": false } }, - "additionalProperties": false, "required": [ - "name" + "name", + "message" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "PostDataSchema": { "type": "object", @@ -7299,11 +7982,10 @@ } } }, - "additionalProperties": false, "required": [ "thread_ids" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "TagCreateSchema": { "type": "object", @@ -7312,160 +7994,40 @@ "type": "string" }, "moderated": { - "type": [ - "null", - "boolean" + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } ] }, "emoji_id": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "emoji_name": { - "type": [ - "null", - "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] } }, - "additionalProperties": false, "required": [ "name" ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "ChannelCreateSchema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "enum": [ - 0, - 1, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 2, - 255, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "type": "number" - }, - "id": { - "type": "string" - }, - "flags": { - "type": "integer" - }, - "icon": { - "type": [ - "null", - "string" - ] - }, - "parent_id": { - "type": "string" - }, - "default_auto_archive_duration": { - "type": "integer" - }, - "permission_overwrites": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/ChannelPermissionOverwriteType" - }, - "allow": { - "type": "string" - }, - "deny": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "allow", - "deny", - "id", - "type" - ] - } - }, - "video_quality_mode": { - "type": "integer" - }, - "bitrate": { - "type": "integer" - }, - "user_limit": { - "type": "integer" - }, - "nsfw": { - "type": "boolean" - }, - "rate_limit_per_user": { - "type": "integer" - }, - "topic": { - "type": "string" - }, - "default_thread_rate_limit_per_user": { - "type": "integer" - }, - "applied_tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "position": { - "type": "integer" - }, - "invitable": { - "type": "boolean" - }, - "rtc_region": { - "type": "string" - }, - "default_reaction_emoji": { - "type": [ - "null", - "string" - ] - }, - "auto_archive_duration": { - "type": "integer" - }, - "archived": { - "type": "boolean" - }, - "locked": { - "type": "boolean" - } - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "VoiceIdentifySchema": { "type": "object", @@ -7494,55 +8056,54 @@ "type": "object", "properties": { "type": { + "type": "string", "enum": [ + "video", "audio", - "screen", - "video" - ], - "type": "string" + "screen" + ] }, "rid": { "type": "string" }, "quality": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ - "quality", + "type", "rid", - "type" - ] + "quality" + ], + "additionalProperties": false } }, "max_secure_frames_version": { - "type": "integer" + "type": "number" }, "max_dave_protocol_version": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ "server_id", + "user_id", "session_id", - "token", - "user_id" + "token" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "VoiceVideoSchema": { "type": "object", "properties": { "audio_ssrc": { - "type": "integer" + "type": "number" }, "video_ssrc": { - "type": "integer" + "type": "number" }, "rtx_ssrc": { - "type": "integer" + "type": "number" }, "user_id": { "type": "string" @@ -7553,33 +8114,33 @@ "type": "object", "properties": { "type": { + "type": "string", "enum": [ + "video", "audio", - "screen", - "video" - ], - "type": "string" + "screen" + ] }, "rid": { "type": "string" }, "ssrc": { - "type": "integer" + "type": "number" }, "active": { "type": "boolean" }, "quality": { - "type": "integer" + "type": "number" }, "rtx_ssrc": { - "type": "integer" + "type": "number" }, "max_bitrate": { - "type": "integer" + "type": "number" }, "max_framerate": { - "type": "integer" + "type": "number" }, "max_resolution": { "type": "object", @@ -7588,41 +8149,316 @@ "type": "string" }, "width": { - "type": "integer" + "type": "number" }, "height": { - "type": "integer" + "type": "number" } }, - "additionalProperties": false, "required": [ - "height", "type", - "width" - ] + "width", + "height" + ], + "additionalProperties": false } }, - "additionalProperties": false, "required": [ + "type", + "rid", + "ssrc", "active", - "max_bitrate", - "max_framerate", - "max_resolution", "quality", - "rid", "rtx_ssrc", - "ssrc", - "type" + "max_bitrate", + "max_framerate", + "max_resolution" + ], + "additionalProperties": false + } + } + }, + "required": [ + "audio_ssrc", + "video_ssrc" + ], + "additionalProperties": false + }, + "ApplicationCommandSchema": { + "type": "object", + "properties": { + "id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "type": { + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "number" + }, + "application_id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "guild_id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name_localized": { + "type": [ + "null", + "string" + ] + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description_localized": { + "type": [ + "null", + "string" + ] + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationCommandOption" + } + }, + "default_member_permissions": { + "type": [ + "null", + "string" + ] + }, + "dm_permission": { + "type": "boolean" + }, + "permissions": { + "$ref": "#/definitions/ApplicationCommandIndexPermissions" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationIntegrationType" + } + }, + "global_popularity_rank": { + "type": "integer" + }, + "contexts": { + "type": "array", + "items": { + "$ref": "#/definitions/InteractionContextType" + } + }, + "version": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + }, + "handler": { + "enum": [ + 1, + 2, + 3 + ], + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "application_id", + "default_member_permissions", + "description", + "name", + "version" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "ApplicationCommandCreateSchema": { + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "type": "object" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "BulkApplicationCommandCreateSchema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4 + ] + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "type": "object" + } + }, + "default_member_permissions": { + "type": "string" + }, + "dm_permission": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "integration_types": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1 + ] + } + }, + "contexts": { + "type": "array", + "items": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + } + }, + "handler": { + "type": "number", + "enum": [ + 1, + 2, + 3 ] } - } - }, - "additionalProperties": false, - "required": [ - "audio_ssrc", - "video_ssrc" - ], - "$schema": "http://json-schema.org/draft-07/schema#" + }, + "required": [ + "name" + ], + "additionalProperties": false + } }, "CreateReportSchema": { "type": "object", @@ -7642,7 +8478,7 @@ "breadcrumbs": { "type": "array", "items": { - "type": "integer" + "type": "number" } }, "elements": { @@ -7682,16 +8518,55 @@ "type": "string" } }, + "required": [ + "version", + "variant", + "name", + "language", + "breadcrumbs" + ], + "additionalProperties": false + }, + "ReportingMenuResponse": { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "language": { + "type": "string" + }, + "name": { + "type": "string" + }, + "elements": {}, + "nodes": {}, + "root_node_id": { + "type": "string" + } + }, "additionalProperties": false, "required": [ - "breadcrumbs", + "elements", "language", "name", + "nodes", + "root_node_id", "variant", "version" ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "ReportingMenuTypesResponse": { + "type": "array", + "items": { + "type": "string" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, "SessionsLogoutSchema": { "type": "object", "properties": { @@ -7708,8 +8583,7 @@ } } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false }, "GetSessionsResponse": { "type": "object", @@ -7733,7 +8607,14 @@ "items": { "type": "array", "items": { - "$ref": "#/definitions/Activity" + "anyOf": [ + { + "type": "object" + }, + { + "type": "object" + } + ] } } }, @@ -7797,106 +8678,89 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "ApplicationCommandOption": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/ApplicationCommandOptionType" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "choices": { + "JSONType": { + "anyOf": [ + { "type": "array", "items": { - "$ref": "#/definitions/ApplicationCommandOptionChoice" + "$ref": "#/definitions/JSONType" } }, - "options": { - "type": "array", - "items": { - "$ref": "#/definitions/ApplicationCommandOption" + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/JSONType" } + }, + { + "type": [ + "null", + "string", + "integer", + "boolean" + ] } - }, - "additionalProperties": false, - "required": [ - "description", - "name", - "type" ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "ApplicationCommandOptionType": { - "type": "number", - "enum": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8 + "PropertyKey": { + "type": [ + "string", + "integer", + "object" ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "ApplicationCommandOptionChoice": { + "RegExp": { "type": "object", "properties": { - "name": { + "source": { "type": "string" }, - "value": { - "type": [ - "string", - "integer" - ] - } - }, - "additionalProperties": false, - "required": [ - "name", - "value" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "ApplicationCommandIndexPermissions": { - "type": "object", - "properties": { - "user": { + "global": { "type": "boolean" }, - "roles": { - "$ref": "#/definitions/Record" + "ignoreCase": { + "type": "boolean" }, - "channels": { - "$ref": "#/definitions/Record" + "multiline": { + "type": "boolean" + }, + "lastIndex": { + "type": "integer" + }, + "flags": { + "type": "string" + }, + "sticky": { + "type": "boolean" + }, + "unicode": { + "type": "boolean" + }, + "dotAll": { + "type": "boolean" + }, + "hasIndices": { + "type": "boolean" + }, + "unicodeSets": { + "type": "boolean" } }, "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "ApplicationIntegrationType": { - "type": "number", - "enum": [ - 0, - 1 - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "InteractionContextType": { - "type": "number", - "enum": [ - 0, - 1, - 2 + "required": [ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "lastIndex", + "multiline", + "source", + "sticky", + "unicode", + "unicodeSets" ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -7927,7 +8791,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/UploadAttachmentRequestSchema" + "type": "object" } }, "id": { @@ -7961,29 +8825,73 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "UploadAttachmentRequest": { + "ApplicationCommandOption": { "type": "object", "properties": { - "id": { - "type": "string" + "type": { + "$ref": "#/definitions/ApplicationCommandOptionType" }, - "filename": { + "name": { "type": "string" }, - "file_size": { - "type": "integer" + "description": { + "type": "string" }, - "is_clip": { + "required": { "type": "boolean" }, - "original_content_type": { + "choices": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationCommandOptionChoice" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationCommandOption" + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "name", + "type" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "ApplicationCommandOptionType": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "ApplicationCommandOptionChoice": { + "type": "object", + "properties": { + "name": { "type": "string" + }, + "value": { + "type": [ + "string", + "integer" + ] } }, "additionalProperties": false, "required": [ - "file_size", - "filename" + "name", + "value" ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -8254,7 +9162,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8266,7 +9174,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "embeds", "flags", @@ -8448,7 +9356,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8460,7 +9368,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "created_at", "flags", "id", @@ -8519,7 +9427,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8531,7 +9439,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "channel_id", "closed", @@ -8732,7 +9640,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8744,7 +9652,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "bio", "bot", "connected_accounts", @@ -8843,7 +9751,7 @@ "session_nickname": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -8855,7 +9763,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "activities", "client_info", "client_status", @@ -9156,7 +10064,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9168,7 +10076,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "from", "from_id", "id", @@ -9255,7 +10163,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9267,7 +10175,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "external_id", "id", "name", @@ -9473,7 +10381,7 @@ "type": "boolean", "default": true }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9485,7 +10393,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "afk_timeout", "allow_accessibility_detection", "animate_emoji", @@ -9613,7 +10521,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9625,7 +10533,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "counter", "id", "key_id", @@ -9806,7 +10714,7 @@ "flags": { "$ref": "#/definitions/ThreadMemberFlags" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9818,7 +10726,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "flags", "id", @@ -9920,7 +10828,7 @@ "collectibles": { "$ref": "#/definitions/Collectibles" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -9932,7 +10840,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "banner", "bio", "communication_disabled_until", @@ -10185,7 +11093,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10197,7 +11105,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "bans", "channel_ordering", "channels", @@ -10253,7 +11161,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10265,7 +11173,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "executor", "executor_id", "guild", @@ -10336,7 +11244,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10348,7 +11256,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "color", "colors", "flags", @@ -10424,7 +11332,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10436,7 +11344,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "code", "created_at", "creator", @@ -10495,7 +11403,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10507,7 +11415,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "animated", "available", "groups", @@ -10565,7 +11473,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10577,7 +11485,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "format_type", "id", "name", @@ -10613,7 +11521,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10625,7 +11533,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "id", "name", "stickers" @@ -10709,7 +11617,7 @@ "flags": { "type": "integer" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10721,7 +11629,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "channel_id", "code", @@ -10796,7 +11704,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10808,7 +11716,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "channel_id", "deaf", @@ -10884,7 +11792,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -10896,7 +11804,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "application", "application_id", "avatar", @@ -11055,7 +11963,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -11067,7 +11975,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "description", "discoverability_state", "discovery_eligibility_flags", @@ -11111,7 +12019,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -11123,7 +12031,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "id", "members", "name", @@ -11162,7 +12070,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -11174,7 +12082,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "id", "membership_state", "permissions", @@ -11475,7 +12383,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -11487,7 +12395,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "badge_count", "channel", "channel_id", @@ -11507,9 +12415,7 @@ 0, 1, 2, - 3, - 4, - 5 + 3 ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -11517,8 +12423,7 @@ "type": "number", "enum": [ 1, - 2, - 4 + 2 ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -11579,7 +12484,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -11591,7 +12496,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "channel", "channel_id", "id", @@ -11633,7 +12538,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -11645,7 +12550,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "filename", "id", "message", @@ -12551,6 +13456,9 @@ "PublicUser": { "type": "object", "properties": { + "discriminator": { + "type": "string" + }, "id": { "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", "type": "string" @@ -12580,9 +13488,6 @@ "username": { "type": "string" }, - "discriminator": { - "type": "string" - }, "public_flags": { "type": "integer" }, @@ -12721,27 +13626,14 @@ "position" ], "$schema": "http://json-schema.org/draft-07/schema#" - }, - "GuildVisibilityLevel": { - "type": "number", - "enum": [ - 1, - 2, - 3 - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "InstanceUserDeleteSchemaContent": { - "type": "object", - "properties": { - "reason": { - "type": "string" - }, - "persistInstanceBan": { - "type": "boolean" - } - }, - "additionalProperties": false, + }, + "GuildVisibilityLevel": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ], "$schema": "http://json-schema.org/draft-07/schema#" }, "Classification": { @@ -14103,7 +14995,7 @@ "length": { "type": "integer" }, - "__@unscopables@698": { + "__@unscopables@772": { "type": "object", "additionalProperties": false, "patternProperties": { @@ -14232,17 +15124,17 @@ "remove": { "type": "boolean" }, - "__@iterator@696": { + "__@iterator@770": { "type": "boolean" }, - "__@unscopables@698": { + "__@unscopables@772": { "type": "boolean" } } } }, "required": [ - "__@unscopables@698", + "__@unscopables@772", "length" ] }, @@ -14275,7 +15167,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -14287,7 +15179,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "code", "consumed", "expired", @@ -14413,7 +15305,7 @@ "icon": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -14425,7 +15317,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "id", "is_primary", "localizations", @@ -14739,8 +15631,308 @@ "additionalProperties": false, "required": [ "enabled", - "limit", - "window" + "limit", + "window" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodRuleEventType": { + "type": "number", + "enum": [ + 1, + 2 + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodRuleTriggerType": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodMentionSpamRule": { + "type": "object", + "properties": { + "mention_total_limit": { + "type": "integer" + }, + "mention_raid_protection_enabled": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "mention_raid_protection_enabled", + "mention_total_limit" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodSuspectedSpamRule": { + "type": "object", + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodCommonlyFlaggedWordsRule": { + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "presets": { + "type": "array", + "items": { + "$ref": "#/definitions/AutomodKeywordPresetType" + } + } + }, + "additionalProperties": false, + "required": [ + "allow_list", + "presets" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodKeywordPresetType": { + "type": "number", + "enum": [ + 1, + 2, + 3 + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodCustomWordsRule": { + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyword_filter": { + "type": "array", + "items": { + "type": "string" + } + }, + "regex_patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "allow_list", + "keyword_filter", + "regex_patterns" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodAction": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "integer", + "const": 1 + }, + "metadata": { + "type": "object", + "properties": { + "custom_message": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "required": [ + "metadata", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "integer", + "const": 2 + }, + "metadata": { + "type": "object", + "properties": { + "channel_id": { + "description": "A Twitter-like snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n```\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of ms since Discord epoch worker pid increment\n```", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel_id" + ] + } + }, + "additionalProperties": false, + "required": [ + "metadata", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "integer", + "const": 3 + }, + "metadata": { + "type": "object", + "properties": { + "duration_seconds": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "duration_seconds" + ] + } + }, + "additionalProperties": false, + "required": [ + "metadata", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "integer", + "const": 4 + }, + "metadata": { + "type": "object", + "properties": { + "duration_seconds": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "duration_seconds" + ] + } + }, + "additionalProperties": false, + "required": [ + "metadata", + "type" + ] + } + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AutomodRule": { + "type": "object", + "properties": { + "creator": { + "$ref": "#/definitions/User" + }, + "enabled": { + "type": "boolean" + }, + "event_type": { + "$ref": "#/definitions/AutomodRuleEventType" + }, + "exempt_channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "exempt_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "guild_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "trigger_type": { + "$ref": "#/definitions/AutomodRuleTriggerType" + }, + "trigger_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/AutomodMentionSpamRule" + }, + { + "$ref": "#/definitions/AutomodSuspectedSpamRule" + }, + { + "$ref": "#/definitions/AutomodCommonlyFlaggedWordsRule" + }, + { + "$ref": "#/definitions/AutomodCustomWordsRule" + } + ] + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/AutomodAction" + } + }, + "id": { + "type": "string" + }, + "__@annotationsKey@14092": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "__@annotationsKey@14092", + "actions", + "creator", + "enabled", + "event_type", + "exempt_channels", + "exempt_roles", + "guild_id", + "id", + "name", + "position", + "trigger_type" ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -14832,7 +16024,7 @@ "link": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@14092": { "type": "object", "additionalProperties": { "type": "array", @@ -14844,74 +16036,313 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@14092", "description", "icon", "id" ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "AllowedMentions": { + "ApplicationCommandIndexPermissions": { + "type": "object", + "properties": { + "user": { + "type": "boolean" + }, + "roles": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "channels": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + }, + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "ApplicationIntegrationType": { + "type": "number", + "enum": [ + 0, + 1 + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "InteractionContextType": { + "type": "number", + "enum": [ + 0, + 1, + 2 + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "ApplicationCommandCreateSchemaOption": { "type": "object", "properties": { - "parse": { + "type": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object" + }, + "description": { + "type": "string" + }, + "description_localizations": { + "type": "object" + }, + "required": { + "type": "boolean" + }, + "choices": { "type": "array", "items": { - "enum": [ - "everyone", - "roles", - "users" - ], - "type": "string" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "name_localizations": { + "type": "object" + }, + "value": { + "type": [ + "string", + "integer" + ] + } + }, + "additionalProperties": false, + "required": [ + "name", + "value" + ] } }, - "roles": { + "options": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/ApplicationCommandCreateSchemaOption" } }, - "users": { + "channel_types": { "type": "array", "items": { - "type": "string" + "type": "integer" } }, - "replied_user": { + "min_value": { + "type": "integer" + }, + "max_value": { + "type": "integer" + }, + "min_length": { + "type": "integer" + }, + "max_length": { + "type": "integer" + }, + "autocomplete": { "type": "boolean" } }, "additionalProperties": false, + "required": [ + "description", + "name", + "type" + ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "MessageActivity": { + "AutomodRuleSchemaWithId": { "type": "object", "properties": { - "type": { - "enum": [ - 1, - 3, - 5 - ], + "creator_id": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "event_type": { "type": "number" }, - "session_id": { + "exempt_channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "exempt_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "guild_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "position": { + "type": "number" + }, + "trigger_type": { + "type": "number" + }, + "trigger_metadata": { + "anyOf": [ + { + "type": "object", + "properties": { + "mention_total_limit": { + "type": "number" + }, + "mention_raid_protection_enabled": { + "type": "boolean" + } + }, + "required": [ + "mention_total_limit", + "mention_raid_protection_enabled" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": {}, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "presets": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "allow_list", + "presets" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "allow_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyword_filter": { + "type": "array", + "items": { + "type": "string" + } + }, + "regex_patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "allow_list", + "keyword_filter", + "regex_patterns" + ], + "additionalProperties": false + } + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "creator_id", + "enabled", + "event_type", + "exempt_channels", + "exempt_roles", + "guild_id", + "name", + "position", + "trigger_type", + "trigger_metadata", + "id" + ], + "additionalProperties": false + }, + "MessageCreateAttachment": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "required": [ + "id", + "filename" + ], + "additionalProperties": false + }, + "MessageCreateCloudAttachment": { + "type": "object", + "properties": { + "id": { "type": "string" }, - "party_id": { + "filename": { "type": "string" }, - "name_override": { + "uploaded_filename": { "type": "string" }, - "icon_override": { + "original_content_type": { "type": "string" } }, - "additionalProperties": false, "required": [ - "type" + "filename", + "uploaded_filename" ], - "$schema": "http://json-schema.org/draft-07/schema#" + "additionalProperties": false + }, + "InstanceUserDeleteSchemaContent": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "persistInstanceBan": { + "type": "boolean" + } + }, + "additionalProperties": false } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e0423a587a..71b2802b53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,6 @@ "dependencies": { "@spacebarchat/pion-webrtc": "^0.0.1", "@toondepauw/node-zstd": "^1.2.0", - "ajv": "^8.18.0", - "ajv-formats": "^3.0.1", "amqplib": "^0.10.9", "badge-maker": "^5.0.2", "bcrypt": "^6.0.0", @@ -50,7 +48,8 @@ "tslib": "^2.8.1", "typeorm": "^0.3.28", "wretch": "^2.11.1", - "ws": "^8.19.0" + "ws": "^8.19.0", + "zod": "^4.3.6" }, "devDependencies": { "@eslint/eslintrc": "^3.3.3", @@ -276,20 +275,20 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", - "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.4.tgz", + "integrity": "sha512-4h4MVF8pmBsncB60r0wSJiIeUKTSD4m7FmTFThG8RHlsg9ajqckLm9OraguFGZE4vVdpiI1Q4+hFnisopmG6gQ==", "dev": true, "license": "MIT", "dependencies": { - "ajv": "^6.12.4", + "ajv": "^6.14.0", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.1", - "minimatch": "^3.1.2", + "minimatch": "^3.1.3", "strip-json-comments": "^3.1.1" }, "engines": { @@ -299,23 +298,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/ajv": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", - "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", @@ -329,13 +311,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" - }, "node_modules/@eslint/js": { "version": "9.39.3", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.3.tgz", @@ -718,6 +693,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-blit/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-blur": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-1.6.0.tgz", @@ -746,6 +731,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-circle/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-color": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-1.6.0.tgz", @@ -763,6 +758,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-color/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-contain": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-1.6.0.tgz", @@ -781,6 +786,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-contain/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-cover": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-1.6.0.tgz", @@ -798,6 +813,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-cover/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-crop": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-1.6.0.tgz", @@ -814,6 +839,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-crop/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-displace": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-1.6.0.tgz", @@ -829,6 +864,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-displace/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-dither": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-1.6.0.tgz", @@ -857,6 +902,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-fisheye/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-flip": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-1.6.0.tgz", @@ -871,6 +926,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-flip/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-hash": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-hash/-/plugin-hash-1.6.0.tgz", @@ -907,6 +972,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-mask/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-print": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-1.6.0.tgz", @@ -929,6 +1004,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-print/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-quantize": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-quantize/-/plugin-quantize-1.6.0.tgz", @@ -943,6 +1028,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-quantize/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-resize": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-1.6.0.tgz", @@ -958,6 +1053,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-resize/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-rotate": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-1.6.0.tgz", @@ -976,6 +1081,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-rotate/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/plugin-threshold": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-1.6.0.tgz", @@ -994,6 +1109,16 @@ "node": ">=18" } }, + "node_modules/@jimp/plugin-threshold/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/types": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/types/-/types-1.6.0.tgz", @@ -1007,6 +1132,16 @@ "node": ">=18" } }, + "node_modules/@jimp/types/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@jimp/utils": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-1.6.0.tgz", @@ -1207,8 +1342,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@spacebarchat/spacebar-webrtc-types/-/spacebar-webrtc-types-1.0.1.tgz", "integrity": "sha512-WfBRUN2520w7o5vU9HNDug9alNvydQP7H/jwAy8LeHTHwlMMUw/60A54FQDIAtsahw787fR3QZ83UGjhKDzDTg==", - "license": "AGPL-3.0-only", - "peer": true + "license": "AGPL-3.0-only" }, "node_modules/@sqltools/formatter": { "version": "1.2.5", @@ -1478,7 +1612,6 @@ "integrity": "sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^5.0.0", @@ -1596,7 +1729,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.13.tgz", "integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==", "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -1687,17 +1819,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.0.tgz", - "integrity": "sha512-lRyPDLzNCuae71A3t9NEINBiTn7swyOhvUj3MyUOxb8x6g6vPEFoOU+ZRmGMusNC3X3YMhqMIX7i8ShqhT74Pw==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.1.tgz", + "integrity": "sha512-Jz9ZztpB37dNC+HU2HI28Bs9QXpzCz+y/twHOwhyrIRdbuVDxSytJNDl6z/aAKlaRIwC7y8wJdkBv7FxYGgi0A==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.56.0", - "@typescript-eslint/type-utils": "8.56.0", - "@typescript-eslint/utils": "8.56.0", - "@typescript-eslint/visitor-keys": "8.56.0", + "@typescript-eslint/scope-manager": "8.56.1", + "@typescript-eslint/type-utils": "8.56.1", + "@typescript-eslint/utils": "8.56.1", + "@typescript-eslint/visitor-keys": "8.56.1", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.4.0" @@ -1710,7 +1842,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.56.0", + "@typescript-eslint/parser": "^8.56.1", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } @@ -1726,17 +1858,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.0.tgz", - "integrity": "sha512-IgSWvLobTDOjnaxAfDTIHaECbkNlAlKv2j5SjpB2v7QHKv1FIfjwMy8FsDbVfDX/KjmCmYICcw7uGaXLhtsLNg==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.1.tgz", + "integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.56.0", - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/typescript-estree": "8.56.0", - "@typescript-eslint/visitor-keys": "8.56.0", + "@typescript-eslint/scope-manager": "8.56.1", + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/typescript-estree": "8.56.1", + "@typescript-eslint/visitor-keys": "8.56.1", "debug": "^4.4.3" }, "engines": { @@ -1752,14 +1883,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.0.tgz", - "integrity": "sha512-M3rnyL1vIQOMeWxTWIW096/TtVP+8W3p/XnaFflhmcFp+U4zlxUxWj4XwNs6HbDeTtN4yun0GNTTDBw/SvufKg==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.1.tgz", + "integrity": "sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.56.0", - "@typescript-eslint/types": "^8.56.0", + "@typescript-eslint/tsconfig-utils": "^8.56.1", + "@typescript-eslint/types": "^8.56.1", "debug": "^4.4.3" }, "engines": { @@ -1774,14 +1905,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.0.tgz", - "integrity": "sha512-7UiO/XwMHquH+ZzfVCfUNkIXlp/yQjjnlYUyYz7pfvlK3/EyyN6BK+emDmGNyQLBtLGaYrTAI6KOw8tFucWL2w==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.1.tgz", + "integrity": "sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/visitor-keys": "8.56.0" + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/visitor-keys": "8.56.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1792,9 +1923,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.0.tgz", - "integrity": "sha512-bSJoIIt4o3lKXD3xmDh9chZcjCz5Lk8xS7Rxn+6l5/pKrDpkCwtQNQQwZ2qRPk7TkUYhrq3WPIHXOXlbXP0itg==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.1.tgz", + "integrity": "sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==", "dev": true, "license": "MIT", "engines": { @@ -1809,15 +1940,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.0.tgz", - "integrity": "sha512-qX2L3HWOU2nuDs6GzglBeuFXviDODreS58tLY/BALPC7iu3Fa+J7EOTwnX9PdNBxUI7Uh0ntP0YWGnxCkXzmfA==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.1.tgz", + "integrity": "sha512-yB/7dxi7MgTtGhZdaHCemf7PuwrHMenHjmzgUW1aJpO+bBU43OycnM3Wn+DdvDO/8zzA9HlhaJ0AUGuvri4oGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/typescript-estree": "8.56.0", - "@typescript-eslint/utils": "8.56.0", + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/typescript-estree": "8.56.1", + "@typescript-eslint/utils": "8.56.1", "debug": "^4.4.3", "ts-api-utils": "^2.4.0" }, @@ -1834,9 +1965,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.0.tgz", - "integrity": "sha512-DBsLPs3GsWhX5HylbP9HNG15U0bnwut55Lx12bHB9MpXxQ+R5GC8MwQe+N1UFXxAeQDvEsEDY6ZYwX03K7Z6HQ==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.1.tgz", + "integrity": "sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==", "dev": true, "license": "MIT", "engines": { @@ -1848,18 +1979,18 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.0.tgz", - "integrity": "sha512-ex1nTUMWrseMltXUHmR2GAQ4d+WjkZCT4f+4bVsps8QEdh0vlBsaCokKTPlnqBFqqGaxilDNJG7b8dolW2m43Q==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.1.tgz", + "integrity": "sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.56.0", - "@typescript-eslint/tsconfig-utils": "8.56.0", - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/visitor-keys": "8.56.0", + "@typescript-eslint/project-service": "8.56.1", + "@typescript-eslint/tsconfig-utils": "8.56.1", + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/visitor-keys": "8.56.1", "debug": "^4.4.3", - "minimatch": "^9.0.5", + "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.4.0" @@ -1899,32 +2030,32 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.6.tgz", - "integrity": "sha512-kQAVowdR33euIqeA0+VZTDqU+qo1IeVY+hrKYtZMio3Pg0P0vuh/kwRylLUddJhB6pf3q/botcOvRtx4IN1wqQ==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { "brace-expansion": "^5.0.2" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@typescript-eslint/utils": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.0.tgz", - "integrity": "sha512-RZ3Qsmi2nFGsS+n+kjLAYDPVlrzf7UhTffrDIKr+h2yzAlYP/y5ZulU0yeDEPItos2Ph46JAL5P/On3pe7kDIQ==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.1.tgz", + "integrity": "sha512-HPAVNIME3tABJ61siYlHzSWCGtOoeP2RTIaHXFMPqjrQKCGB9OgUVdiNgH7TJS2JNIQ5qQ4RsAUDuGaGme/KOA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.56.0", - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/typescript-estree": "8.56.0" + "@typescript-eslint/scope-manager": "8.56.1", + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/typescript-estree": "8.56.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1939,13 +2070,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.0.tgz", - "integrity": "sha512-q+SL+b+05Ud6LbEE35qe4A99P+htKTKVbyiNEe45eCbJFyh/HVK9QXwlrbz+Q4L8SOW4roxSVwXYj4DMBT7Ieg==", + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.1.tgz", + "integrity": "sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.56.0", + "@typescript-eslint/types": "8.56.1", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -1970,28 +2101,28 @@ } }, "node_modules/@typescript/native-preview": { - "version": "7.0.0-dev.20260222.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview/-/native-preview-7.0.0-dev.20260222.1.tgz", - "integrity": "sha512-Uxon0iNhNqH/HkWvKmTmr7d5TJp6yomoyFHNpLIEghy91/DNWEtKMuLjNDYPFcoNxWpuJW9vuWTWeu3mcqT94Q==", + "version": "7.0.0-dev.20260225.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview/-/native-preview-7.0.0-dev.20260225.1.tgz", + "integrity": "sha512-mUf1aON+eZLupLorX4214n4W6uWIz/lvNv81ErzjJylD/GyJPEJkvDLmgIK3bbvLpMwTRWdVJLhpLCah5Qe8iA==", "dev": true, "license": "Apache-2.0", "bin": { "tsgo": "bin/tsgo.js" }, "optionalDependencies": { - "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260222.1", - "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260222.1", - "@typescript/native-preview-linux-arm": "7.0.0-dev.20260222.1", - "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260222.1", - "@typescript/native-preview-linux-x64": "7.0.0-dev.20260222.1", - "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260222.1", - "@typescript/native-preview-win32-x64": "7.0.0-dev.20260222.1" + "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260225.1", + "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260225.1", + "@typescript/native-preview-linux-arm": "7.0.0-dev.20260225.1", + "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260225.1", + "@typescript/native-preview-linux-x64": "7.0.0-dev.20260225.1", + "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260225.1", + "@typescript/native-preview-win32-x64": "7.0.0-dev.20260225.1" } }, "node_modules/@typescript/native-preview-darwin-arm64": { - "version": "7.0.0-dev.20260222.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-arm64/-/native-preview-darwin-arm64-7.0.0-dev.20260222.1.tgz", - "integrity": "sha512-aXfK/s3QlbzXvZoFQ07KJDNx86q61nCITSreqLytnqjhjsXUUuMACsxjy/YsReLG2bdii+mHTA2WB2IB0LKKGA==", + "version": "7.0.0-dev.20260225.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-arm64/-/native-preview-darwin-arm64-7.0.0-dev.20260225.1.tgz", + "integrity": "sha512-3qSsqv7FmM4z09wEpEXdhmgMfiJF/OMOZa41AdgMsXTTRpX2/38hDg2KGhi3fc24M2T3MnLPLTqw6HyTOBaV1Q==", "cpu": [ "arm64" ], @@ -2003,9 +2134,9 @@ ] }, "node_modules/@typescript/native-preview-darwin-x64": { - "version": "7.0.0-dev.20260222.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-x64/-/native-preview-darwin-x64-7.0.0-dev.20260222.1.tgz", - "integrity": "sha512-+bHnCeONX47pmVXTt6kuwxiLayDVqkLtshjqpqthXMWFFGk+1K/5ASbFEb2FumSABgB9hQ/xqkjj5QHUgGmbPg==", + "version": "7.0.0-dev.20260225.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-x64/-/native-preview-darwin-x64-7.0.0-dev.20260225.1.tgz", + "integrity": "sha512-F8ZCCX2UESHcbxvnkd1Dn5PTnOOgpGddFHYgn4usyWRMzNZLPP+YjyGALZe9zdR/D8L0uraND0Haok+TPq8xYg==", "cpu": [ "x64" ], @@ -2017,9 +2148,9 @@ ] }, "node_modules/@typescript/native-preview-linux-arm": { - "version": "7.0.0-dev.20260222.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm/-/native-preview-linux-arm-7.0.0-dev.20260222.1.tgz", - "integrity": "sha512-bavfJlI3JNH2F/7BX0drZ4JCSjLsCc2Dy5e2s6pc2wuLIzJ6hIjFaXIeB9TDbVYJE+MlLf6rtQF9nP9iSsgk9g==", + "version": "7.0.0-dev.20260225.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm/-/native-preview-linux-arm-7.0.0-dev.20260225.1.tgz", + "integrity": "sha512-Iu5rnCmqwGIMUu//BXkl9VQaxAAsqVvFhU4mJoNexNkMxPqVcu9quqYAouY7tN/95WcKzUsPpyRfkThdbNFO/g==", "cpu": [ "arm" ], @@ -2031,9 +2162,9 @@ ] }, "node_modules/@typescript/native-preview-linux-arm64": { - "version": "7.0.0-dev.20260222.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm64/-/native-preview-linux-arm64-7.0.0-dev.20260222.1.tgz", - "integrity": "sha512-Usm9oJzLPqK7Z7echSSaHnmTXhr3knLXycoyVZwRrmWC33aX2efZb+XrdaV/SMhdYjYHCZ6mE60qcK4nEaXdng==", + "version": "7.0.0-dev.20260225.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm64/-/native-preview-linux-arm64-7.0.0-dev.20260225.1.tgz", + "integrity": "sha512-Up8Z/QNcwce5C4rWnbLNW5w7lRARdyKZcNbB1NMnaswaGOBdeDmdP0wbVsOgJMoDp6vnun+EkvrSft8hWLLhIg==", "cpu": [ "arm64" ], @@ -2045,9 +2176,9 @@ ] }, "node_modules/@typescript/native-preview-linux-x64": { - "version": "7.0.0-dev.20260222.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-x64/-/native-preview-linux-x64-7.0.0-dev.20260222.1.tgz", - "integrity": "sha512-JaOwNBJ2nA0C/MBfMXilrVNv+hUpIzs7JtpSgpOsXa3Hq7BL2rnoO6WMuCo8IHz7v8+Lr+MPJufXVEHfrOtf5A==", + "version": "7.0.0-dev.20260225.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-x64/-/native-preview-linux-x64-7.0.0-dev.20260225.1.tgz", + "integrity": "sha512-WWjIfHCWlcriempYYc/sPJ3HFt6znNZKp60nvDNih0+wmxNqEfT5Yzu5zAY0awIe7XLelFSY+bolkpzMYVWEIQ==", "cpu": [ "x64" ], @@ -2059,9 +2190,9 @@ ] }, "node_modules/@typescript/native-preview-win32-arm64": { - "version": "7.0.0-dev.20260222.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-arm64/-/native-preview-win32-arm64-7.0.0-dev.20260222.1.tgz", - "integrity": "sha512-Mngr3qdeO7Ey3DtsHe4oqIghXYcjOr9pVQtKXbijfT0slRtVPeF1TmEb/eH+Z+LsY1SOW8c/Cig1G4NDXZnghw==", + "version": "7.0.0-dev.20260225.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-arm64/-/native-preview-win32-arm64-7.0.0-dev.20260225.1.tgz", + "integrity": "sha512-lmfQO+HdmPMk0dtPoNo8dZereTUYNQuapsAI7nFHCP8F25I8eGKKXY2nD1R8W1hp/LmVtske1pqKFNN6IOCt5g==", "cpu": [ "arm64" ], @@ -2073,9 +2204,9 @@ ] }, "node_modules/@typescript/native-preview-win32-x64": { - "version": "7.0.0-dev.20260222.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-x64/-/native-preview-win32-x64-7.0.0-dev.20260222.1.tgz", - "integrity": "sha512-8Gps/FPcQiyoHeDhRY3RXhJSJwQQuUIP5lepYO3+2xvCPPeeNBoOueiLoGKxno4CYbS4O2fPdVmymboX0ApjZA==", + "version": "7.0.0-dev.20260225.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-x64/-/native-preview-win32-x64-7.0.0-dev.20260225.1.tgz", + "integrity": "sha512-e4eJyzR9ne0XreqYgQNqfX7SNuaePxggnUtVrLERgBv25QKwdQl72GnSXDhdxZHzrb97YwumiXWMQQJj9h8NCg==", "cpu": [ "x64" ], @@ -2144,7 +2275,6 @@ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "devOptional": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2189,38 +2319,22 @@ } }, "node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ajv-formats": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", - "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", - "license": "MIT", - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, "node_modules/amqplib": { "version": "0.10.9", "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.9.tgz", @@ -3383,7 +3497,6 @@ "integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -3468,23 +3581,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/ajv": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", - "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3515,13 +3611,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" - }, "node_modules/espree": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", @@ -3699,6 +3788,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, "license": "MIT" }, "node_modules/fast-json-stable-stringify": { @@ -3715,22 +3805,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", - "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause" - }, "node_modules/fast-zlib": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-zlib/-/fast-zlib-2.0.1.tgz", @@ -4732,9 +4806,10 @@ "license": "MIT" }, "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify": { @@ -5065,9 +5140,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.3.tgz", - "integrity": "sha512-M2GCs7Vk83NxkUyQV1bkABc4yxgz9kILhHImZiBPAZ9ybuvCb0/H7lEl5XvIg3g+9d4eNotkZA5IWwYl0tibaA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "devOptional": true, "license": "ISC", "dependencies": { @@ -5830,15 +5905,14 @@ } }, "node_modules/pg": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.18.0.tgz", - "integrity": "sha512-xqrUDL1b9MbkydY/s+VZ6v+xiMUmOUk7SS9d/1kpyQxoJ6U9AO1oIJyUWVZojbfe5Cc/oluutcgFG4L9RDP1iQ==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.19.0.tgz", + "integrity": "sha512-QIcLGi508BAHkQ3pJNptsFz5WQMlpGbuBGBaIaXsWK8mel2kQ/rThYI+DbgjUvZrIr7MiuEuc9LcChJoEZK1xQ==", "license": "MIT", - "peer": true, "dependencies": { "pg-connection-string": "^2.11.0", - "pg-pool": "^3.11.0", - "pg-protocol": "^1.11.0", + "pg-pool": "^3.12.0", + "pg-protocol": "^1.12.0", "pg-types": "2.2.0", "pgpass": "1.0.5" }, @@ -5871,9 +5945,9 @@ "license": "MIT" }, "node_modules/pg-cursor": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/pg-cursor/-/pg-cursor-2.17.0.tgz", - "integrity": "sha512-2Uio3Xfl5ldwJfls+RgGL+YbPcKQncWACWjYQFqlamvHZ4HJFjZhhZBbqd7jQ2LIkZYSvU90bm2dNW0rno+QFQ==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/pg-cursor/-/pg-cursor-2.18.0.tgz", + "integrity": "sha512-WkMubzXP+FWDIC6XfA9pZwJHO0rmUwbNXUNFfBshp9amnCraQslVLYqEuWA+7qemtyz+v3zybcvcX//Dq5WpxQ==", "license": "MIT", "peerDependencies": { "pg": "^8" @@ -5889,28 +5963,27 @@ } }, "node_modules/pg-pool": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.11.0.tgz", - "integrity": "sha512-MJYfvHwtGp870aeusDh+hg9apvOe2zmpZJpyt+BMtzUWlVqbhFmMK6bOBXLBUPd7iRtIF9fZplDc7KrPN3PN7w==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.12.0.tgz", + "integrity": "sha512-eIJ0DES8BLaziFHW7VgJEBPi5hg3Nyng5iKpYtj3wbcAUV9A1wLgWiY7ajf/f/oO1wfxt83phXPY8Emztg7ITg==", "license": "MIT", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-protocol": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.11.0.tgz", - "integrity": "sha512-pfsxk2M9M3BuGgDOfuy37VNRRX3jmKgMjcvAcWqNDpZSf4cUmv8HSOl5ViRQFsfARFn0KuUQTgLxVMbNq5NW3g==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.12.0.tgz", + "integrity": "sha512-uOANXNRACNdElMXJ0tPz6RBM0XQ61nONGAwlt8da5zs/iUOOCLBQOHSXnrC6fMsvtjxbOJrZZl5IScGv+7mpbg==", "license": "MIT" }, "node_modules/pg-query-stream": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/pg-query-stream/-/pg-query-stream-4.12.0.tgz", - "integrity": "sha512-H97oiVPQ0+eRqIFOeYMUnjDcv9od7vHHMjiVDAhg2SEzAUr3M/dT83UEV1B+fm+tcVnymI8j2LSp57/+yjF6Fg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/pg-query-stream/-/pg-query-stream-4.13.0.tgz", + "integrity": "sha512-6+dbfjiNw90J4W0xCBr89e6KXMH9toEKAW2qvxYVhNnlGyEJVD0+cmccbi6ubXqhjlcQ+o5gKbouszIeVtP5AQ==", "license": "MIT", - "peer": true, "dependencies": { - "pg-cursor": "^2.17.0" + "pg-cursor": "^2.18.0" }, "peerDependencies": { "pg": "^8" @@ -6074,7 +6147,6 @@ "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -6331,15 +6403,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -6947,7 +7010,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -7063,7 +7125,6 @@ "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -7312,9 +7373,9 @@ } }, "node_modules/typeorm/node_modules/minimatch": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.6.tgz", - "integrity": "sha512-kQAVowdR33euIqeA0+VZTDqU+qo1IeVY+hrKYtZMio3Pg0P0vuh/kwRylLUddJhB6pf3q/botcOvRtx4IN1wqQ==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.8.tgz", + "integrity": "sha512-reYkDYtj/b19TeqbNZCV4q9t+Yxylf/rYBsLb42SXJatTv4/ylq5lEiAmhA/IToxO7NI2UzNMghHoHuaqDkAjw==", "license": "ISC", "dependencies": { "brace-expansion": "^5.0.2" @@ -7354,7 +7415,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7834,11 +7894,10 @@ } }, "node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", "license": "MIT", - "optional": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 9e1ebf9c61..ab5c62f6d0 100644 --- a/package.json +++ b/package.json @@ -80,8 +80,6 @@ "dependencies": { "@spacebarchat/pion-webrtc": "^0.0.1", "@toondepauw/node-zstd": "^1.2.0", - "ajv": "^8.18.0", - "ajv-formats": "^3.0.1", "amqplib": "^0.10.9", "badge-maker": "^5.0.2", "bcrypt": "^6.0.0", @@ -118,7 +116,8 @@ "tslib": "^2.8.1", "typeorm": "^0.3.28", "wretch": "^2.11.1", - "ws": "^8.19.0" + "ws": "^8.19.0", + "zod": "^4.3.6" }, "_moduleAliases": { "@spacebar/api": "dist/api", diff --git a/patches/ajv+8.17.1.patch b/patches/ajv+8.17.1.patch deleted file mode 100644 index 9cf6c1cf20..0000000000 --- a/patches/ajv+8.17.1.patch +++ /dev/null @@ -1,249 +0,0 @@ -diff --git a/node_modules/ajv/dist/compile/jtd/parse.js b/node_modules/ajv/dist/compile/jtd/parse.js -index 8fc94fd..abeeda9 100644 ---- a/node_modules/ajv/dist/compile/jtd/parse.js -+++ b/node_modules/ajv/dist/compile/jtd/parse.js -@@ -239,6 +239,9 @@ function parseType(cxt) { - gen.if(fail, () => parsingError(cxt, (0, codegen_1.str) `invalid timestamp`)); - break; - } -+ case "bigint": -+ parseBigInt(cxt); -+ break - case "float32": - case "float64": - parseNumber(cxt); -@@ -284,6 +287,15 @@ function parseNumber(cxt, maxDigits) { - skipWhitespace(cxt); - gen.if((0, codegen_1._) `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits)); - } -+function parseBigInt(cxt, maxDigits) { -+ const {gen} = cxt -+ skipWhitespace(cxt) -+ gen.if( -+ _`"-0123456789".indexOf(${jsonSlice(1)}) < 0`, -+ () => jsonSyntaxError(cxt), -+ () => parseWith(cxt, parseJson_1.parseJsonBigInt, maxDigits) -+ ) -+} - function parseBooleanToken(bool, fail) { - return (cxt) => { - const { gen, data } = cxt; -diff --git a/node_modules/ajv/dist/compile/rules.js b/node_modules/ajv/dist/compile/rules.js -index 82a591f..1ebd8fe 100644 ---- a/node_modules/ajv/dist/compile/rules.js -+++ b/node_modules/ajv/dist/compile/rules.js -@@ -1,7 +1,7 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRules = exports.isJSONType = void 0; --const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; -+const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array","bigint"]; - const jsonTypes = new Set(_jsonTypes); - function isJSONType(x) { - return typeof x == "string" && jsonTypes.has(x); -@@ -13,10 +13,11 @@ function getRules() { - string: { type: "string", rules: [] }, - array: { type: "array", rules: [] }, - object: { type: "object", rules: [] }, -+ bigint: {type: "bigint", rules: []} - }; - return { -- types: { ...groups, integer: true, boolean: true, null: true }, -- rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], -+ types: { ...groups, integer: true, boolean: true, null: true, bigint: true }, -+ rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object, groups.bigint], - post: { rules: [] }, - all: {}, - keywords: {}, -diff --git a/node_modules/ajv/dist/compile/validate/dataType.js b/node_modules/ajv/dist/compile/validate/dataType.js -index 6d03e0d..a35a428 100644 ---- a/node_modules/ajv/dist/compile/validate/dataType.js -+++ b/node_modules/ajv/dist/compile/validate/dataType.js -@@ -53,7 +53,7 @@ function coerceAndCheckDataType(it, types) { - return checkTypes; - } - exports.coerceAndCheckDataType = coerceAndCheckDataType; --const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); -+const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null","bigint"]); - function coerceToTypes(types, coerceTypes) { - return coerceTypes - ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) -@@ -84,6 +84,14 @@ function coerceData(it, types, coerceTo) { - }); - function coerceSpecificType(t) { - switch (t) { -+ case "bigint": -+ gen -+ .elseIf( -+ codegen_1._`${dataType} == "boolean" || ${data} === null -+ || (${dataType} == "string" && ${data} && ${data} == BigInt(${data}))` -+ ) -+ .assign(coerced, codegen_1._`BigInt(${data})`) -+ return - case "string": - gen - .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`) -@@ -144,6 +152,9 @@ function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { - case "number": - cond = numCond(); - break; -+ case "bigint": -+ cond = codegen_1._`typeof ${data} == "bigint" && isFinite(${data})` -+ break - default: - return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`; - } -diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json -index 7027a12..25679c8 100644 ---- a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json -+++ b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json -@@ -78,7 +78,7 @@ - "default": 0 - }, - "simpleTypes": { -- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] -+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string","bigint"] - }, - "stringArray": { - "type": "array", -diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json -index e0ae13d..57c9036 100644 ---- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json -+++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json -@@ -78,7 +78,7 @@ - "default": 0 - }, - "simpleTypes": { -- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] -+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string","bigint"] - }, - "stringArray": { - "type": "array", -diff --git a/node_modules/ajv/dist/refs/json-schema-draft-06.json b/node_modules/ajv/dist/refs/json-schema-draft-06.json -index 5410064..774435b 100644 ---- a/node_modules/ajv/dist/refs/json-schema-draft-06.json -+++ b/node_modules/ajv/dist/refs/json-schema-draft-06.json -@@ -16,7 +16,7 @@ - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { -- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] -+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string","bigint"] - }, - "stringArray": { - "type": "array", -diff --git a/node_modules/ajv/dist/refs/json-schema-draft-07.json b/node_modules/ajv/dist/refs/json-schema-draft-07.json -index 6a74851..fc6dd7d 100644 ---- a/node_modules/ajv/dist/refs/json-schema-draft-07.json -+++ b/node_modules/ajv/dist/refs/json-schema-draft-07.json -@@ -16,7 +16,7 @@ - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { -- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] -+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string","bigint"] - }, - "stringArray": { - "type": "array", -diff --git a/node_modules/ajv/dist/refs/jtd-schema.js b/node_modules/ajv/dist/refs/jtd-schema.js -index 1ee940a..1148887 100644 ---- a/node_modules/ajv/dist/refs/jtd-schema.js -+++ b/node_modules/ajv/dist/refs/jtd-schema.js -@@ -38,6 +38,7 @@ const typeForm = (root) => ({ - "uint16", - "int32", - "uint32", -+ "bigint", - ], - }, - }, -diff --git a/node_modules/ajv/dist/runtime/parseJson.js b/node_modules/ajv/dist/runtime/parseJson.js -index eaa2838..02ad708 100644 ---- a/node_modules/ajv/dist/runtime/parseJson.js -+++ b/node_modules/ajv/dist/runtime/parseJson.js -@@ -97,6 +97,71 @@ exports.parseJsonNumber = parseJsonNumber; - parseJsonNumber.message = undefined; - parseJsonNumber.position = 0; - parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber'; -+ -+function parseJsonBigInt(s, pos, maxDigits) { -+ let numStr = ""; -+ let c; -+ parseJsonBigInt.message = undefined; -+ if (s[pos] === "-") { -+ numStr += "-"; -+ pos++; -+ } -+ if (s[pos] === "0") { -+ numStr += "0"; -+ pos++; -+ } -+ else { -+ if (!parseDigits(maxDigits)) { -+ errorMessage(); -+ return undefined; -+ } -+ } -+ if (maxDigits) { -+ parseJsonBigInt.position = pos; -+ return BigInt(numStr); -+ } -+ if (s[pos] === ".") { -+ numStr += "."; -+ pos++; -+ if (!parseDigits()) { -+ errorMessage(); -+ return undefined; -+ } -+ } -+ if (((c = s[pos]), c === "e" || c === "E")) { -+ numStr += "e"; -+ pos++; -+ if (((c = s[pos]), c === "+" || c === "-")) { -+ numStr += c; -+ pos++; -+ } -+ if (!parseDigits()) { -+ errorMessage(); -+ return undefined; -+ } -+ } -+ parseJsonBigInt.position = pos; -+ return BigInt(numStr); -+ function parseDigits(maxLen) { -+ let digit = false; -+ while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { -+ digit = true; -+ numStr += c; -+ pos++; -+ } -+ return digit; -+ } -+ function errorMessage() { -+ parseJsonBigInt.position = pos; -+ parseJsonBigInt.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"; -+ } -+} -+exports.parseJsonBigInt = parseJsonBigInt; -+parseJsonBigInt.message = undefined; -+parseJsonBigInt.position = 0; -+parseJsonBigInt.code = 'require("ajv/dist/runtime/parseJson").parseJsonBigInt'; -+ -+ - const escapedChars = { - b: "\b", - f: "\f", -diff --git a/node_modules/ajv/dist/vocabularies/jtd/type.js b/node_modules/ajv/dist/vocabularies/jtd/type.js -index 17a0b51..bc54aad 100644 ---- a/node_modules/ajv/dist/vocabularies/jtd/type.js -+++ b/node_modules/ajv/dist/vocabularies/jtd/type.js -@@ -45,6 +45,9 @@ const def = { - cond = timestampCode(cxt); - break; - } -+ case "bigint": -+ cond = codegen_1._`typeof ${data} == "bigint" || typeof ${data} == "string"` -+ break - case "float32": - case "float64": - cond = (0, codegen_1._) `typeof ${data} == "number"`; diff --git a/scripts/openapi.js b/scripts/openapi.js index 86d502e247..e2551ee3f9 100644 --- a/scripts/openapi.js +++ b/scripts/openapi.js @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ const { Stopwatch } = require("../dist/util/util/Stopwatch"); @@ -27,6 +27,27 @@ const { NO_AUTHORIZATION_ROUTES } = require("../dist/api/middlewares/Authenticat require("../dist/util/util/extensions"); const { bgRedBright } = require("picocolors"); +let zodModule; +let zodToJsonSchemaModule; +try { + const z = require("zod"); + zodModule = z; + if (z.toJSONSchema) { + zodToJsonSchemaModule = (schema, opts) => + z.toJSONSchema(schema, { + ...opts, + unrepresentable: "any", + override: (ctx) => { + const def = ctx.zodSchema._zod?.def; + if (def?.type === "date") { + ctx.jsonSchema.type = "string"; + ctx.jsonSchema.format = "date-time"; + } + }, + }); + } +} catch (e) {} + const openapiPath = path.join(__dirname, "..", "assets", "openapi.json"); const SchemaPath = path.join(__dirname, "..", "assets", "schemas.json"); const schemas = JSON.parse(fs.readFileSync(SchemaPath, { encoding: "utf8" })); @@ -99,9 +120,21 @@ function combineSchemas(schemas) { if (typeof definition.properties === "object") { for (const property of Object.values(definition.properties)) { if (Array.isArray(property.type)) { - if (property.type.includes("null")) { - property.type = property.type.find((x) => x !== "null"); - property.nullable = true; + if (property.type.length === 1) { + property.type = property.type[0]; + } + } + + if (Array.isArray(property.items)) { + property.prefixItems = property.items; + delete property.items; + } + if (Array.isArray(property.anyOf)) { + for (const anyOfItem of property.anyOf) { + if (Array.isArray(anyOfItem.items)) { + anyOfItem.prefixItems = anyOfItem.items; + delete anyOfItem.items; + } } } } @@ -126,7 +159,10 @@ function apiRoutes(missingRoutes) { routes.forEach((route, pathAndMethod) => { const [p, method] = pathAndMethod.split("|"); - const path = p.replace(/:(\w+)/g, "{$1}"); + let path = p.replace(/:(\w+)/g, "{$1}"); + if (path !== "/" && path.endsWith("/")) { + path = path.slice(0, -1); + } let obj = specification.paths[path]?.[method] || {}; obj["x-right-required"] = route.right; @@ -140,23 +176,69 @@ function apiRoutes(missingRoutes) { }) ) { obj.security = [{ bearer: [] }]; + } else { + obj.security = []; } if (route.description) obj.description = route.description; - if (route.summary) obj.summary = route.summary; + obj.summary = route.summary || "No summary provided"; if (route.deprecated) obj.deprecated = route.deprecated; if (route.requestBody) { - obj.requestBody = { - required: true, - content: { - "application/json": { - schema: { - $ref: `#/components/schemas/${route.requestBody}`, + let schemaRef; + + if (zodModule && route.requestBody instanceof zodModule.ZodType) { + let schemaName = null; + try { + const schemasBaseDir = path.join(__dirname, "..", "dist", "schemas"); + const dirs = ["uncategorised", "api/bots", "api/developers", "api/users", "api/reports", "webrtc"]; + for (const dir of dirs) { + const dirPath = path.join(schemasBaseDir, dir); + if (!fs.existsSync(dirPath)) continue; + const schemasModule = require(dirPath); + for (const [name, value] of Object.entries(schemasModule)) { + if (value === route.requestBody) { + schemaName = name; + break; + } + } + if (schemaName) break; + } + } catch (e) {} + + if (!schemaName) { + try { + const jsonSchema = + typeof zodToJsonSchemaModule === "function" + ? zodToJsonSchemaModule(route.requestBody, { target: "openApi3" }) + : zodToJsonSchemaModule.zodToJsonSchema(route.requestBody, { + target: "openApi3", + $refStrategy: "none", + }); + delete jsonSchema.$schema; + schemaRef = jsonSchema; + } catch (e) { + schemaRef = { type: "object" }; + } + } + + if (schemaName) { + schemaRef = { $ref: `#/components/schemas/${schemaName}` }; + } + } else { + schemaRef = { $ref: `#/components/schemas/${route.requestBody}` }; + } + + if (schemaRef) { + obj.requestBody = { + required: true, + content: { + "application/json": { + schema: schemaRef, }, }, - }, - }; + }; + } } if (route.responses) { @@ -242,7 +324,10 @@ async function main() { combineSchemas(schemas); apiRoutes(missingRoutes); - fs.writeFileSync(openapiPath, JSON.stringify(specification, null, 4).replaceAll("#/definitions", "#/components/schemas").replaceAll("bigint", "number")); + const outStr = JSON.stringify(specification, null, 4) + .replaceAll("#/definitions", "#/components/schemas") + .replace(/"type":\s*"bigint"/g, '"type": "number"'); + fs.writeFileSync(openapiPath, outStr); console.log("Wrote OpenAPI specification to", openapiPath); const elapsedMs = Number(totalSw.elapsed().totalMilliseconds + "." + totalSw.elapsed().microseconds); console.log( diff --git a/scripts/schema.js b/scripts/schema.js index 67c5563c38..264c3ddc26 100644 --- a/scripts/schema.js +++ b/scripts/schema.js @@ -1,23 +1,23 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ /* - Regenerates the `spacebarchat/server/assets/schemas.json` file, used for API/Gateway input validation. + Regenerates the `spacebarchat/server/assets/schemas.json` file, used for API/Gateway input validation. */ const { Stopwatch } = require("../dist/util/util/Stopwatch"); const totalSw = Stopwatch.startNew(); @@ -291,6 +291,129 @@ async function main() { filterSchema(definitions[defKey]); } + console.log("\n" + cyanBright("Processing Zod schemas...")); + try { + const z = require("zod"); + require("module-alias/register"); + + const schemasBaseDir = path.join(__dirname, "..", "dist", "schemas"); + const schemaDirs = [ + path.join(schemasBaseDir, "uncategorised"), + path.join(schemasBaseDir, "api", "bots"), + path.join(schemasBaseDir, "api", "developers"), + path.join(schemasBaseDir, "api", "users"), + path.join(schemasBaseDir, "api", "reports"), + path.join(schemasBaseDir, "webrtc"), + ]; + + const schemasModule = {}; + for (const schemasDir of schemaDirs) { + if (!fs.existsSync(schemasDir)) continue; + const schemaFiles = fs.readdirSync(schemasDir).filter((f) => f.endsWith(".js") && f !== "index.js"); + + for (const file of schemaFiles) { + try { + const mod = require(path.join(schemasDir, file)); + Object.assign(schemasModule, mod); + } catch (e) {} + } + } + + let zodCount = 0; + let zodReplaced = 0; + for (const [name, value] of Object.entries(schemasModule)) { + if (value instanceof z.ZodType) { + zodCount++; + try { + const jsonSchema = z.toJSONSchema(value, { + target: "openApi3", + unrepresentable: "any", + override: (ctx) => { + const def = ctx.zodSchema._zod.def; + if (def.type === "date") { + ctx.jsonSchema.type = "string"; + ctx.jsonSchema.format = "date-time"; + } + }, + }); + + let schemaObj = jsonSchema; + if (jsonSchema.definitions && jsonSchema.definitions[name]) { + schemaObj = jsonSchema.definitions[name]; + } + delete schemaObj.$schema; + delete schemaObj.definitions; + + delete schemaObj.$schema; + + if (definitions[name]) { + zodReplaced++; + } + definitions[name] = schemaObj; + } catch (e) { + console.log(redBright("[WARN]"), "Failed to convert Zod schema", name, ":", e.message); + } + } + } + console.log(greenBright("Processed"), zodCount, "Zod schemas (" + zodReplaced + " replaced existing TJS definitions)."); + + const zodInternalPattern = + /^\$Zod|^Zod[A-Z]|^_Zod|^Standard|^LoosePartial|^PrimitiveSet|^PropValues|^Primitive$|^ObjectSchema$|^ArraySchema$|^NumberSchema$|^IntegerSchema$|^NullSchema$|^StringSchema$|^BooleanSchema$/; + let removedCount = 0; + for (const key of Object.keys(definitions)) { + if (zodInternalPattern.test(key)) { + delete definitions[key]; + removedCount++; + } + } + if (removedCount > 0) { + console.log(yellowBright("Removed"), removedCount, "Zod internal definitions."); + } + + const invalidNamePattern = /[{}<>()]/; + let removedInvalid = 0; + for (const key of Object.keys(definitions)) { + if (invalidNamePattern.test(key)) { + delete definitions[key]; + removedInvalid++; + } + } + if (removedInvalid > 0) { + console.log(yellowBright("Removed"), removedInvalid, "anonymous inline type definitions."); + } + + function resolveRefs(obj) { + if (!obj || typeof obj !== "object") return; + if (Array.isArray(obj)) { + for (const item of obj) resolveRefs(item); + return; + } + for (const [key, value] of Object.entries(obj)) { + if (key === "$ref" && typeof value === "string") { + const refName = value.replace("#/definitions/", ""); + if (!definitions[refName]) { + delete obj.$ref; + obj.type = "object"; + } + } else if (typeof value === "object") { + resolveRefs(value); + } + } + } + let resolvedCount = 0; + for (const def of Object.values(definitions)) { + const before = JSON.stringify(def); + resolveRefs(def); + if (JSON.stringify(def) !== before) resolvedCount++; + } + if (resolvedCount > 0) { + console.log(yellowBright("Resolved"), resolvedCount, "schemas with broken $ref pointers."); + } + } catch (e) { + console.log(redBright("[ERROR]"), "Failed to process Zod schemas:", e.message); + console.log("Make sure 'zod-to-json-schema' is installed and the project is built."); + } + if (process.env.WRITE_SCHEMA_DIR === "true") { await Promise.all(writePromises); await Promise.all( diff --git a/scripts/schemaExclusions.json b/scripts/schemaExclusions.json index f25e8f0713..2b4c061c98 100644 --- a/scripts/schemaExclusions.json +++ b/scripts/schemaExclusions.json @@ -415,6 +415,26 @@ { "value": "UserResponse", "reason": "Schema with only uppercase properties" + }, + { + "value": "_JSONSchema", + "reason": "Self-reference only schema" + }, + { + "value": "JSONSchema", + "reason": "Self-reference only schema" + }, + { + "value": "OptionalOutSchema", + "reason": "Schema with only uppercase properties" + }, + { + "value": "OptionalInSchema", + "reason": "Schema with only uppercase properties" + }, + { + "value": "ZodJSONSchema", + "reason": "Self-reference only schema" } ] } \ No newline at end of file diff --git a/src/api/middlewares/ErrorHandler.ts b/src/api/middlewares/ErrorHandler.ts index 87e44c630e..8e2b46c07c 100644 --- a/src/api/middlewares/ErrorHandler.ts +++ b/src/api/middlewares/ErrorHandler.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { NextFunction, Request, Response } from "express"; @@ -29,7 +29,6 @@ export function ErrorHandler(error: Error & { type?: string }, req: Request, res let httpcode = code; let message = error?.toString(); let errors = undefined; - let _ajvErrors = undefined; if (error instanceof HTTPError && error.code) code = httpcode = error.code; else if (error instanceof ApiError) { @@ -43,7 +42,6 @@ export function ErrorHandler(error: Error & { type?: string }, req: Request, res code = Number(error.code); message = error.message; errors = error.errors; - _ajvErrors = error._ajvErrors; } else if (error?.type == "entity.parse.failed") { // body-parser failed httpcode = 400; @@ -61,7 +59,7 @@ export function ErrorHandler(error: Error & { type?: string }, req: Request, res if (httpcode > 511) httpcode = 400; - res.status(httpcode).json({ code, message, errors, _ajvErrors, request: `${req.method} ${req.url}` }); + res.status(httpcode).json({ code, message, errors, request: `${req.method} ${req.url}` }); } catch (error) { console.error(`[Internal Server Error] 500`, error); return res.status(500).json({ code: 500, message: `Internal server error while handling error`, request: `${req.method} ${req.url}` }); diff --git a/src/api/routes/applications/#application_id/bot/index.ts b/src/api/routes/applications/#application_id/bot/index.ts index 47b8a72933..74f47279b4 100644 --- a/src/api/routes/applications/#application_id/bot/index.ts +++ b/src/api/routes/applications/#application_id/bot/index.ts @@ -86,7 +86,7 @@ router.post( router.patch( "/", route({ - requestBody: "BotModifySchema", + requestBody: BotModifySchema, responses: { 200: { body: "Application", diff --git a/src/api/routes/applications/#application_id/commands/#command_id/index.ts b/src/api/routes/applications/#application_id/commands/#command_id/index.ts index e0618613ab..d59ff4f9f4 100644 --- a/src/api/routes/applications/#application_id/commands/#command_id/index.ts +++ b/src/api/routes/applications/#application_id/commands/#command_id/index.ts @@ -44,7 +44,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { router.patch( "/", route({ - requestBody: "ApplicationCommandCreateSchema", + requestBody: ApplicationCommandCreateSchema, }), async (req: Request, res: Response) => { const applicationExists = await Application.exists({ where: { id: req.params.application_id as string } }); diff --git a/src/api/routes/applications/#application_id/commands/index.ts b/src/api/routes/applications/#application_id/commands/index.ts index a3aaec2f21..2fd4491319 100644 --- a/src/api/routes/applications/#application_id/commands/index.ts +++ b/src/api/routes/applications/#application_id/commands/index.ts @@ -16,7 +16,7 @@ along with this program. If not, see . */ -import { ApplicationCommandCreateSchema, ApplicationCommandSchema } from "@spacebar/schemas"; +import { ApplicationCommandCreateSchema, ApplicationCommandSchema, BulkApplicationCommandCreateSchema } from "@spacebar/schemas"; import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; import { Application, ApplicationCommand, FieldErrors, Snowflake } from "@spacebar/util"; @@ -39,7 +39,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { router.post( "/", route({ - requestBody: "ApplicationCommandCreateSchema", + requestBody: ApplicationCommandCreateSchema, }), async (req: Request, res: Response) => { const applicationExists = await Application.exists({ where: { id: req.params.application_id as string } }); @@ -99,7 +99,7 @@ router.post( router.put( "/", route({ - requestBody: "BulkApplicationCommandCreateSchema", + requestBody: BulkApplicationCommandCreateSchema, }), async (req: Request, res: Response) => { const applicationExists = await Application.exists({ where: { id: req.params.application_id as string } }); diff --git a/src/api/routes/applications/#application_id/guilds/#guild_id/commands/#command_id/index.ts b/src/api/routes/applications/#application_id/guilds/#guild_id/commands/#command_id/index.ts index 16d7786b31..9e19fb1204 100644 --- a/src/api/routes/applications/#application_id/guilds/#guild_id/commands/#command_id/index.ts +++ b/src/api/routes/applications/#application_id/guilds/#guild_id/commands/#command_id/index.ts @@ -58,7 +58,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { router.patch( "/", route({ - requestBody: "ApplicationCommandCreateSchema", + requestBody: ApplicationCommandCreateSchema, }), async (req: Request, res: Response) => { const applicationExists = await Application.exists({ where: { id: req.params.application_id as string } }); diff --git a/src/api/routes/applications/#application_id/guilds/#guild_id/commands/index.ts b/src/api/routes/applications/#application_id/guilds/#guild_id/commands/index.ts index e51a431828..f8aaa01214 100644 --- a/src/api/routes/applications/#application_id/guilds/#guild_id/commands/index.ts +++ b/src/api/routes/applications/#application_id/guilds/#guild_id/commands/index.ts @@ -16,7 +16,7 @@ along with this program. If not, see . */ -import { ApplicationCommandCreateSchema, ApplicationCommandSchema } from "@spacebar/schemas"; +import { ApplicationCommandCreateSchema, ApplicationCommandSchema, BulkApplicationCommandCreateSchema } from "@spacebar/schemas"; import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; import { Application, ApplicationCommand, FieldErrors, Guild, Member, Snowflake } from "@spacebar/util"; @@ -50,7 +50,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { router.post( "/", route({ - requestBody: "ApplicationCommandCreateSchema", + requestBody: ApplicationCommandCreateSchema, }), async (req: Request, res: Response) => { const applicationExists = await Application.exists({ where: { id: req.params.application_id as string } }); @@ -125,7 +125,7 @@ router.post( router.put( "/", route({ - requestBody: "BulkApplicationCommandCreateSchema", + requestBody: BulkApplicationCommandCreateSchema, }), async (req: Request, res: Response) => { const applicationExists = await Application.exists({ where: { id: req.params.application_id as string } }); diff --git a/src/api/routes/applications/#application_id/index.ts b/src/api/routes/applications/#application_id/index.ts index 64fac23c04..2c1bd78a03 100644 --- a/src/api/routes/applications/#application_id/index.ts +++ b/src/api/routes/applications/#application_id/index.ts @@ -51,7 +51,7 @@ router.get( router.patch( "/", route({ - requestBody: "ApplicationModifySchema", + requestBody: ApplicationModifySchema, responses: { 200: { body: "Application", diff --git a/src/api/routes/applications/@me.ts b/src/api/routes/applications/@me.ts index 7e315a56d3..1f0ee041f6 100644 --- a/src/api/routes/applications/@me.ts +++ b/src/api/routes/applications/@me.ts @@ -51,7 +51,7 @@ router.get( router.patch( "/", route({ - requestBody: "ApplicationModifySchema", + requestBody: ApplicationModifySchema, responses: { 200: { body: "Application", diff --git a/src/api/routes/applications/index.ts b/src/api/routes/applications/index.ts index 0740c2fb56..b08074953d 100644 --- a/src/api/routes/applications/index.ts +++ b/src/api/routes/applications/index.ts @@ -44,7 +44,7 @@ router.get( router.post( "/", route({ - requestBody: "ApplicationCreateSchema", + requestBody: ApplicationCreateSchema, responses: { 200: { body: "Application", diff --git a/src/api/routes/attachments/refresh-urls.ts b/src/api/routes/attachments/refresh-urls.ts index 38bbf8d7ca..55ed2b0c65 100644 --- a/src/api/routes/attachments/refresh-urls.ts +++ b/src/api/routes/attachments/refresh-urls.ts @@ -25,7 +25,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "RefreshUrlsRequestSchema", + requestBody: RefreshUrlsRequestSchema, responses: { 200: { body: "RefreshUrlsResponse", diff --git a/src/api/routes/auth/forgot.ts b/src/api/routes/auth/forgot.ts index 4ebb965457..b374cded04 100644 --- a/src/api/routes/auth/forgot.ts +++ b/src/api/routes/auth/forgot.ts @@ -25,7 +25,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "ForgotPasswordSchema", + requestBody: ForgotPasswordSchema, responses: { 204: {}, 400: { diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts index 466d264a08..8c073a3966 100644 --- a/src/api/routes/auth/login.ts +++ b/src/api/routes/auth/login.ts @@ -29,7 +29,7 @@ export default router; router.post( "/", route({ - requestBody: "LoginSchema", + requestBody: LoginSchema, responses: { 200: { body: "LoginResponse", diff --git a/src/api/routes/auth/mfa/totp.ts b/src/api/routes/auth/mfa/totp.ts index d50f2d0eaa..1d591fc8e0 100644 --- a/src/api/routes/auth/mfa/totp.ts +++ b/src/api/routes/auth/mfa/totp.ts @@ -27,7 +27,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "TotpSchema", + requestBody: TotpSchema, responses: { 200: { body: "TokenResponse", diff --git a/src/api/routes/auth/mfa/webauthn.ts b/src/api/routes/auth/mfa/webauthn.ts index 8e6c5f0394..819958f1de 100644 --- a/src/api/routes/auth/mfa/webauthn.ts +++ b/src/api/routes/auth/mfa/webauthn.ts @@ -36,7 +36,7 @@ function toArrayBuffer(buf: Buffer) { router.post( "/", route({ - requestBody: "WebAuthnTotpSchema", + requestBody: WebAuthnTotpSchema, responses: { 200: { body: "TokenResponse" }, 400: { body: "APIErrorResponse" }, diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts index 5c40ce1d8b..6af2d2aeae 100644 --- a/src/api/routes/auth/register.ts +++ b/src/api/routes/auth/register.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route, verifyCaptcha } from "@spacebar/api"; @@ -29,7 +29,7 @@ const router: Router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "RegisterSchema", + requestBody: RegisterSchema, responses: { 200: { body: "TokenOnlyResponse" }, 400: { body: "APIErrorOrCaptchaResponse" }, @@ -307,7 +307,7 @@ router.post( }); } - const user = await User.register({ ...body, req }); + const user = await User.register({ username: body.username, password: body.password, email: body.email, date_of_birth: body.date_of_birth as Date | undefined, req }); if (body.invite) { // await to fail if the invite doesn't exist (necessary for requireInvite to work properly) (username only signups are possible) diff --git a/src/api/routes/auth/reset.ts b/src/api/routes/auth/reset.ts index 77e93e8407..57687c0ca7 100644 --- a/src/api/routes/auth/reset.ts +++ b/src/api/routes/auth/reset.ts @@ -28,7 +28,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "PasswordResetSchema", + requestBody: PasswordResetSchema, responses: { 200: { body: "TokenOnlyResponse", diff --git a/src/api/routes/auth/sessions.ts b/src/api/routes/auth/sessions.ts index 3a9095f141..6a14e5482f 100644 --- a/src/api/routes/auth/sessions.ts +++ b/src/api/routes/auth/sessions.ts @@ -44,7 +44,7 @@ router.get( router.post( "/logout", route({ - requestBody: "SessionsLogoutSchema", + requestBody: SessionsLogoutSchema, responses: { 204: {}, }, diff --git a/src/api/routes/auth/verify/index.ts b/src/api/routes/auth/verify/index.ts index 7c8ca1876e..3f2ae84056 100644 --- a/src/api/routes/auth/verify/index.ts +++ b/src/api/routes/auth/verify/index.ts @@ -19,6 +19,7 @@ import { route, verifyCaptcha } from "@spacebar/api"; import { checkToken, Config, FieldErrors, generateToken, User } from "@spacebar/util"; import { Request, Response, Router } from "express"; +import { VerifyEmailSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); async function getToken(user: User) { @@ -35,7 +36,7 @@ async function getToken(user: User) { router.post( "/", route({ - requestBody: "VerifyEmailSchema", + requestBody: VerifyEmailSchema, responses: { 200: { body: "TokenResponse", diff --git a/src/api/routes/auth/verify/view-backup-codes-challenge.ts b/src/api/routes/auth/verify/view-backup-codes-challenge.ts index 7bfd669667..2200e0b46d 100644 --- a/src/api/routes/auth/verify/view-backup-codes-challenge.ts +++ b/src/api/routes/auth/verify/view-backup-codes-challenge.ts @@ -26,7 +26,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "BackupCodesChallengeSchema", + requestBody: BackupCodesChallengeSchema, responses: { 200: { body: "BackupCodesChallengeResponse" }, 400: { body: "APIErrorResponse" }, diff --git a/src/api/routes/channels/#channel_id/attachments.ts b/src/api/routes/channels/#channel_id/attachments.ts index 2b3fd355ba..ea0349abd3 100644 --- a/src/api/routes/channels/#channel_id/attachments.ts +++ b/src/api/routes/channels/#channel_id/attachments.ts @@ -27,7 +27,7 @@ const router: Router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "UploadAttachmentRequestSchema", + requestBody: UploadAttachmentRequestSchema, responses: { 200: { body: "UploadAttachmentResponseSchema", diff --git a/src/api/routes/channels/#channel_id/greet.ts b/src/api/routes/channels/#channel_id/greet.ts index b556547d37..123cf851f5 100644 --- a/src/api/routes/channels/#channel_id/greet.ts +++ b/src/api/routes/channels/#channel_id/greet.ts @@ -27,7 +27,7 @@ const router: Router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "GreetRequestSchema", + requestBody: GreetRequestSchema, permission: "SEND_MESSAGES", responses: { 200: { diff --git a/src/api/routes/channels/#channel_id/index.ts b/src/api/routes/channels/#channel_id/index.ts index 37767574dc..7f2eb4a915 100644 --- a/src/api/routes/channels/#channel_id/index.ts +++ b/src/api/routes/channels/#channel_id/index.ts @@ -145,7 +145,7 @@ router.delete( router.patch( "/", route({ - requestBody: "ChannelModifySchema", + requestBody: ChannelModifySchema, permission: "VIEW_CHANNEL", responses: { 200: { diff --git a/src/api/routes/channels/#channel_id/invites.ts b/src/api/routes/channels/#channel_id/invites.ts index 979d080df7..322c123d2a 100644 --- a/src/api/routes/channels/#channel_id/invites.ts +++ b/src/api/routes/channels/#channel_id/invites.ts @@ -27,7 +27,7 @@ const router: Router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "InviteCreateSchema", + requestBody: InviteCreateSchema, permission: "CREATE_INSTANT_INVITE", right: "CREATE_INVITES", responses: { diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/ack.ts b/src/api/routes/channels/#channel_id/messages/#message_id/ack.ts index 8c34af5b03..c9560c8ad2 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/ack.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/ack.ts @@ -19,6 +19,7 @@ import { route } from "@spacebar/api"; import { emitEvent, getPermission, MessageAckEvent, ReadState } from "@spacebar/util"; import { Request, Response, Router } from "express"; +import { MessageAcknowledgeSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); @@ -29,7 +30,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "MessageAcknowledgeSchema", + requestBody: MessageAcknowledgeSchema, responses: { 200: {}, 403: {}, diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts index c0569124b5..a45041a917 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts @@ -52,7 +52,7 @@ const messageUpload = multer({ router.patch( "/", route({ - requestBody: "MessageEditSchema", + requestBody: MessageEditSchema, permission: "SEND_MESSAGES", right: "SEND_MESSAGES", responses: { @@ -150,7 +150,7 @@ router.put( next(); }, route({ - requestBody: "MessageCreateSchema", + requestBody: MessageCreateSchema, permission: "SEND_MESSAGES", right: "SEND_BACKDATED_EVENTS", responses: { diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/threads.ts b/src/api/routes/channels/#channel_id/messages/#message_id/threads.ts index eb375e5de2..72de74db3e 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/threads.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/threads.ts @@ -31,7 +31,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "MessageThreadCreationSchema", + requestBody: MessageThreadCreationSchema, permission: "CREATE_PUBLIC_THREADS", responses: { 200: {}, diff --git a/src/api/routes/channels/#channel_id/messages/bulk-delete.ts b/src/api/routes/channels/#channel_id/messages/bulk-delete.ts index 8c543ad521..8b3156d633 100644 --- a/src/api/routes/channels/#channel_id/messages/bulk-delete.ts +++ b/src/api/routes/channels/#channel_id/messages/bulk-delete.ts @@ -20,6 +20,7 @@ import { route } from "@spacebar/api"; import { Channel, Config, emitEvent, getPermission, getRights, Message, MessageDeleteBulkEvent } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; +import { BulkDeleteSchema } from "@spacebar/schemas"; const router: Router = Router({ mergeParams: true }); @@ -31,7 +32,7 @@ export default router; router.post( "/", route({ - requestBody: "BulkDeleteSchema", + requestBody: BulkDeleteSchema, responses: { 204: {}, 400: { diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts index 46ef45f08a..1603973603 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts @@ -292,7 +292,7 @@ router.post( next(); }, route({ - requestBody: "MessageCreateSchema", + requestBody: MessageCreateSchema, permission: "VIEW_CHANNEL", right: "SEND_MESSAGES", responses: { @@ -525,7 +525,7 @@ router.post( router.delete( "/ack", route({ - requestBody: "AcknowledgeDeleteSchema", + requestBody: AcknowledgeDeleteSchema, responses: { 204: {}, }, diff --git a/src/api/routes/channels/#channel_id/permissions.ts b/src/api/routes/channels/#channel_id/permissions.ts index 3b7e1349b4..fc0c8253aa 100644 --- a/src/api/routes/channels/#channel_id/permissions.ts +++ b/src/api/routes/channels/#channel_id/permissions.ts @@ -29,7 +29,7 @@ const router: Router = Router({ mergeParams: true }); router.put( "/:overwrite_id", route({ - requestBody: "ChannelPermissionOverwriteSchema", + requestBody: ChannelPermissionOverwriteSchema, permission: "MANAGE_ROLES", responses: { 204: {}, diff --git a/src/api/routes/channels/#channel_id/post-data.ts b/src/api/routes/channels/#channel_id/post-data.ts index f58a27cff3..7c8b601320 100644 --- a/src/api/routes/channels/#channel_id/post-data.ts +++ b/src/api/routes/channels/#channel_id/post-data.ts @@ -42,7 +42,7 @@ router.post( next(); }, route({ - requestBody: "PostDataSchema", + requestBody: PostDataSchema, permission: "VIEW_CHANNEL", responses: { 200: {}, diff --git a/src/api/routes/channels/#channel_id/tags.ts b/src/api/routes/channels/#channel_id/tags.ts index a84e4b4291..0d9b5aa941 100644 --- a/src/api/routes/channels/#channel_id/tags.ts +++ b/src/api/routes/channels/#channel_id/tags.ts @@ -27,7 +27,7 @@ const router: Router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "TagCreateSchema", + requestBody: TagCreateSchema, permission: "MANAGE_CHANNELS", responses: { 200: { @@ -72,7 +72,7 @@ router.post( router.put( "/:tag_id", route({ - requestBody: "TagCreateSchema", + requestBody: TagCreateSchema, permission: "MANAGE_CHANNELS", responses: { 200: { diff --git a/src/api/routes/channels/#channel_id/threads.ts b/src/api/routes/channels/#channel_id/threads.ts index 9d10cb17a0..2e64f09e6e 100644 --- a/src/api/routes/channels/#channel_id/threads.ts +++ b/src/api/routes/channels/#channel_id/threads.ts @@ -57,7 +57,7 @@ router.post( next(); }, route({ - requestBody: "ThreadCreationSchema", + requestBody: ThreadCreationSchema, permission: "CREATE_PUBLIC_THREADS", responses: { 200: {}, diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts index 0f686173f7..533ec6c9c5 100644 --- a/src/api/routes/channels/#channel_id/webhooks.ts +++ b/src/api/routes/channels/#channel_id/webhooks.ts @@ -56,7 +56,7 @@ router.get( router.post( "/", route({ - requestBody: "WebhookCreateSchema", + requestBody: WebhookCreateSchema, permission: "MANAGE_WEBHOOKS", responses: { 200: { diff --git a/src/api/routes/channels/preload-messages.ts b/src/api/routes/channels/preload-messages.ts index 09743cc733..9ffe4763d9 100644 --- a/src/api/routes/channels/preload-messages.ts +++ b/src/api/routes/channels/preload-messages.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2025 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -25,10 +25,10 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "PreloadMessagesRequestSchema", + requestBody: PreloadMessagesRequestSchema, responses: { 200: { - body: "PreloadMessagesResponse", + body: "PreloadMessagesResponseSchema", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/connections/#connection_name/callback.ts b/src/api/routes/connections/#connection_name/callback.ts index 2f6a25a003..cd30fe12ea 100644 --- a/src/api/routes/connections/#connection_name/callback.ts +++ b/src/api/routes/connections/#connection_name/callback.ts @@ -23,7 +23,7 @@ import { ConnectionCallbackSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); -router.post("/", route({ requestBody: "ConnectionCallbackSchema" }), async (req: Request, res: Response) => { +router.post("/", route({ requestBody: ConnectionCallbackSchema }), async (req: Request, res: Response) => { const { connection_name } = req.params as { [key: string]: string }; const connection = ConnectionStore.connections.get(connection_name); if (!connection) diff --git a/src/api/routes/guilds/#guild_id/auto-moderation/rules.ts b/src/api/routes/guilds/#guild_id/auto-moderation/rules.ts index 8b56ded9e6..1179adf529 100644 --- a/src/api/routes/guilds/#guild_id/auto-moderation/rules.ts +++ b/src/api/routes/guilds/#guild_id/auto-moderation/rules.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2024 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2024 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -30,7 +30,7 @@ router.get( permission: ["MANAGE_GUILD"], responses: { 200: { - body: "AutomodRuleSchemaWithId[]", + body: "APIAutomodRuleArray", }, 403: { body: "APIErrorResponse", @@ -51,7 +51,7 @@ router.post( permission: ["MANAGE_GUILD"], responses: { 200: { - body: "AutomodRuleSchemaWithId", + body: "APIAutomodRule", }, 400: { body: "APIErrorResponse", @@ -92,7 +92,7 @@ router.patch( permission: ["MANAGE_GUILD"], responses: { 200: { - body: "AutomodRuleSchemaWithId", + body: "APIAutomodRule", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/guilds/#guild_id/bans.ts b/src/api/routes/guilds/#guild_id/bans.ts index 6fa34d3511..56bc729047 100644 --- a/src/api/routes/guilds/#guild_id/bans.ts +++ b/src/api/routes/guilds/#guild_id/bans.ts @@ -183,7 +183,7 @@ router.get( router.put( "/:user_id", route({ - requestBody: "BanCreateSchema", + requestBody: BanCreateSchema, permission: "BAN_MEMBERS", responses: { 204: {}, diff --git a/src/api/routes/guilds/#guild_id/bulk-ban.ts b/src/api/routes/guilds/#guild_id/bulk-ban.ts index 67b23ba5bc..ee2bf88168 100644 --- a/src/api/routes/guilds/#guild_id/bulk-ban.ts +++ b/src/api/routes/guilds/#guild_id/bulk-ban.ts @@ -21,13 +21,14 @@ import { Ban, DiscordApiErrors, GuildBanAddEvent, Member, User, emitEvent } from import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; import { Config } from "@spacebar/util"; +import { BulkBanSchema } from "@spacebar/schemas"; const router: Router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "BulkBanSchema", + requestBody: BulkBanSchema, permission: ["BAN_MEMBERS", "MANAGE_GUILD"], responses: { 200: { diff --git a/src/api/routes/guilds/#guild_id/channels.ts b/src/api/routes/guilds/#guild_id/channels.ts index 493c3398ac..cce59e0ddd 100644 --- a/src/api/routes/guilds/#guild_id/channels.ts +++ b/src/api/routes/guilds/#guild_id/channels.ts @@ -48,7 +48,7 @@ router.get( router.post( "/", route({ - requestBody: "ChannelCreateSchema", + requestBody: ChannelCreateSchema, permission: "MANAGE_CHANNELS", responses: { 201: { @@ -77,7 +77,7 @@ router.post( router.patch( "/", route({ - requestBody: "ChannelReorderSchema", + requestBody: ChannelReorderSchema, permission: "MANAGE_CHANNELS", responses: { 204: {}, diff --git a/src/api/routes/guilds/#guild_id/emojis.ts b/src/api/routes/guilds/#guild_id/emojis.ts index 1044b8a4c5..1699c823c0 100644 --- a/src/api/routes/guilds/#guild_id/emojis.ts +++ b/src/api/routes/guilds/#guild_id/emojis.ts @@ -81,7 +81,7 @@ router.get( router.post( "/", route({ - requestBody: "EmojiCreateSchema", + requestBody: EmojiCreateSchema, permission: "MANAGE_EMOJIS_AND_STICKERS", responses: { 201: { @@ -141,7 +141,7 @@ router.post( router.patch( "/:emoji_id", route({ - requestBody: "EmojiModifySchema", + requestBody: EmojiModifySchema, permission: "MANAGE_EMOJIS_AND_STICKERS", responses: { 200: { diff --git a/src/api/routes/guilds/#guild_id/index.ts b/src/api/routes/guilds/#guild_id/index.ts index 2bfa9c8789..be6670fa3d 100644 --- a/src/api/routes/guilds/#guild_id/index.ts +++ b/src/api/routes/guilds/#guild_id/index.ts @@ -55,7 +55,7 @@ router.get( router.patch( "/", route({ - requestBody: "GuildUpdateSchema", + requestBody: GuildUpdateSchema, permission: "MANAGE_GUILD", responses: { 200: { diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts index 3db964d2ac..95b1d3335a 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts @@ -68,7 +68,7 @@ router.get( router.patch( "/", route({ - requestBody: "MemberChangeSchema", + requestBody: MemberChangeSchema, responses: { 200: { body: "Member", diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts b/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts index 0e6a74654e..aef6fac6e5 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts @@ -19,13 +19,14 @@ import { route } from "@spacebar/api"; import { getPermission, Member, PermissionResolvable } from "@spacebar/util"; import { Request, Response, Router } from "express"; +import { MemberNickChangeSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); router.patch( "/", route({ - requestBody: "MemberNickChangeSchema", + requestBody: MemberNickChangeSchema, responses: { 200: { body: "APIPublicMember", diff --git a/src/api/routes/guilds/#guild_id/messages/search.ts b/src/api/routes/guilds/#guild_id/messages/search.ts index eb9ecd6d65..3189bfe592 100644 --- a/src/api/routes/guilds/#guild_id/messages/search.ts +++ b/src/api/routes/guilds/#guild_id/messages/search.ts @@ -16,8 +16,6 @@ along with this program. If not, see . */ -/* eslint-disable @typescript-eslint/ban-ts-comment */ - import { route } from "@spacebar/api"; import { Channel, FieldErrors, Member, Message, Snowflake, getPermission } from "@spacebar/util"; import { Request, Response, Router } from "express"; diff --git a/src/api/routes/guilds/#guild_id/profile/index.ts b/src/api/routes/guilds/#guild_id/profile/index.ts index 74f408745e..9bbd460c3b 100644 --- a/src/api/routes/guilds/#guild_id/profile/index.ts +++ b/src/api/routes/guilds/#guild_id/profile/index.ts @@ -26,7 +26,7 @@ const router = Router({ mergeParams: true }); router.patch( "/:member_id", route({ - requestBody: "MemberChangeProfileSchema", + requestBody: MemberChangeProfileSchema, responses: { 200: { body: "Member", diff --git a/src/api/routes/guilds/#guild_id/roles/#role_id/index.ts b/src/api/routes/guilds/#guild_id/roles/#role_id/index.ts index af2d3a373a..c55e4d7b58 100644 --- a/src/api/routes/guilds/#guild_id/roles/#role_id/index.ts +++ b/src/api/routes/guilds/#guild_id/roles/#role_id/index.ts @@ -94,7 +94,7 @@ router.delete( router.patch( "/", route({ - requestBody: "RoleModifySchema", + requestBody: RoleModifySchema, permission: "MANAGE_ROLES", responses: { 200: { diff --git a/src/api/routes/guilds/#guild_id/roles/index.ts b/src/api/routes/guilds/#guild_id/roles/index.ts index b7b58e43d4..03e996fd55 100644 --- a/src/api/routes/guilds/#guild_id/roles/index.ts +++ b/src/api/routes/guilds/#guild_id/roles/index.ts @@ -37,7 +37,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { router.post( "/", route({ - requestBody: "RoleModifySchema", + requestBody: RoleModifySchema, permission: "MANAGE_ROLES", responses: { 200: { @@ -111,7 +111,7 @@ router.post( router.patch( "/", route({ - requestBody: "RolePositionUpdateSchema", + requestBody: RolePositionUpdateSchema, permission: "MANAGE_ROLES", responses: { 200: { diff --git a/src/api/routes/guilds/#guild_id/stickers.ts b/src/api/routes/guilds/#guild_id/stickers.ts index 857713de2a..bacf0651e6 100644 --- a/src/api/routes/guilds/#guild_id/stickers.ts +++ b/src/api/routes/guilds/#guild_id/stickers.ts @@ -58,7 +58,7 @@ router.post( bodyParser, route({ permission: "MANAGE_EMOJIS_AND_STICKERS", - requestBody: "ModifyGuildStickerSchema", + requestBody: ModifyGuildStickerSchema, responses: { 200: { body: "Sticker", @@ -146,7 +146,7 @@ router.get( router.patch( "/:sticker_id", route({ - requestBody: "ModifyGuildStickerSchema", + requestBody: ModifyGuildStickerSchema, permission: "MANAGE_EMOJIS_AND_STICKERS", responses: { 200: { diff --git a/src/api/routes/guilds/#guild_id/templates.ts b/src/api/routes/guilds/#guild_id/templates.ts index 54b7fce2c5..53efcab56f 100644 --- a/src/api/routes/guilds/#guild_id/templates.ts +++ b/src/api/routes/guilds/#guild_id/templates.ts @@ -20,6 +20,7 @@ import { generateCode, route } from "@spacebar/api"; import { Guild, Template } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; +import { TemplateCreateSchema, TemplateModifySchema } from "@spacebar/schemas"; const router: Router = Router({ mergeParams: true }); @@ -64,7 +65,7 @@ router.get( router.post( "/", route({ - requestBody: "TemplateCreateSchema", + requestBody: TemplateCreateSchema, permission: "MANAGE_GUILD", responses: { 200: { @@ -156,7 +157,7 @@ router.put( router.patch( "/:code", route({ - requestBody: "TemplateModifySchema", + requestBody: TemplateModifySchema, permission: "MANAGE_GUILD", responses: { 200: { body: "Template" }, diff --git a/src/api/routes/guilds/#guild_id/vanity-url.ts b/src/api/routes/guilds/#guild_id/vanity-url.ts index ec3f0ab54f..8c18335337 100644 --- a/src/api/routes/guilds/#guild_id/vanity-url.ts +++ b/src/api/routes/guilds/#guild_id/vanity-url.ts @@ -67,7 +67,7 @@ router.get( router.patch( "/", route({ - requestBody: "VanityUrlSchema", + requestBody: VanityUrlSchema, permission: "MANAGE_GUILD", responses: { 200: { diff --git a/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts b/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts index 95c392832f..61e5a75945 100644 --- a/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts +++ b/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -27,7 +27,7 @@ const router = Router({ mergeParams: true }); router.patch( "/", route({ - requestBody: "VoiceStateUpdateSchema", + requestBody: VoiceStateUpdateSchema, responses: { 204: {}, 400: { @@ -49,14 +49,14 @@ router.patch( const perms = await getPermission(req.user_id, guild_id, body.channel_id); /* - From https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state - You must have the MUTE_MEMBERS permission to unsuppress others. You can always suppress yourself. - You must have the REQUEST_TO_SPEAK permission to request to speak. You can always clear your own request to speak. - */ + From https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state + You must have the MUTE_MEMBERS permission to unsuppress others. You can always suppress yourself. + You must have the REQUEST_TO_SPEAK permission to request to speak. You can always clear your own request to speak. + */ if (body.suppress && user_id !== req.user_id) { perms.hasThrow("MUTE_MEMBERS"); } - if (!body.suppress) body.request_to_speak_timestamp = new Date(); + if (!body.suppress) body.request_to_speak_timestamp = new Date().toISOString(); if (body.request_to_speak_timestamp) perms.hasThrow("REQUEST_TO_SPEAK"); const voice_state = await VoiceState.findOne({ diff --git a/src/api/routes/guilds/#guild_id/welcome-screen.ts b/src/api/routes/guilds/#guild_id/welcome-screen.ts index dee7fb459f..54eb0cd8fa 100644 --- a/src/api/routes/guilds/#guild_id/welcome-screen.ts +++ b/src/api/routes/guilds/#guild_id/welcome-screen.ts @@ -48,7 +48,7 @@ router.get( router.patch( "/", route({ - requestBody: "GuildUpdateWelcomeScreenSchema", + requestBody: GuildUpdateWelcomeScreenSchema, permission: "MANAGE_GUILD", responses: { 204: {}, diff --git a/src/api/routes/guilds/#guild_id/widget.ts b/src/api/routes/guilds/#guild_id/widget.ts index 122789dc40..f41c94d159 100644 --- a/src/api/routes/guilds/#guild_id/widget.ts +++ b/src/api/routes/guilds/#guild_id/widget.ts @@ -52,7 +52,7 @@ router.get( router.patch( "/", route({ - requestBody: "WidgetModifySchema", + requestBody: WidgetModifySchema, permission: "MANAGE_GUILD", responses: { 200: { diff --git a/src/api/routes/guilds/automations/email-domain-lookup.ts b/src/api/routes/guilds/automations/email-domain-lookup.ts index 943097f8f3..283780b80c 100644 --- a/src/api/routes/guilds/automations/email-domain-lookup.ts +++ b/src/api/routes/guilds/automations/email-domain-lookup.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -28,7 +28,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "EmailDomainLookupSchema", + requestBody: EmailDomainLookupSchema, responses: { 200: { body: "EmailDomainLookupResponse", @@ -62,7 +62,7 @@ router.post( router.post( "/verify-code", route({ - requestBody: "EmailDomainLookupVerifyCodeSchema", + requestBody: EmailDomainLookupVerifyCodeSchema, responses: { // 200: { // body: "EmailDomainLookupVerifyCodeResponse", diff --git a/src/api/routes/guilds/index.ts b/src/api/routes/guilds/index.ts index 663677dcbc..1975f8d835 100644 --- a/src/api/routes/guilds/index.ts +++ b/src/api/routes/guilds/index.ts @@ -28,7 +28,7 @@ const router: Router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "GuildCreateSchema", + requestBody: GuildCreateSchema, right: "CREATE_GUILDS", responses: { 201: { diff --git a/src/api/routes/guilds/templates/index.ts b/src/api/routes/guilds/templates/index.ts index 6eb6ffbee9..c1fd75995e 100644 --- a/src/api/routes/guilds/templates/index.ts +++ b/src/api/routes/guilds/templates/index.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2025 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -48,7 +48,7 @@ router.get( }, ); -router.post("/:template_code", route({ requestBody: "GuildTemplateCreateSchema" }), async (req: Request, res: Response) => { +router.post("/:template_code", route({ requestBody: GuildTemplateCreateSchema }), async (req: Request, res: Response) => { const { template_code } = req.params as { [key: string]: string }; const body = req.body as GuildTemplateCreateSchema; diff --git a/src/api/routes/hub-waitlist.ts b/src/api/routes/hub-waitlist.ts index bd9a8253fe..7c363d2b29 100644 --- a/src/api/routes/hub-waitlist.ts +++ b/src/api/routes/hub-waitlist.ts @@ -24,7 +24,7 @@ const router = Router({ mergeParams: true }); router.post( "/signup", route({ - requestBody: "HubWaitlistSignupSchema", + requestBody: HubWaitlistSignupSchema, responses: { 200: { body: "HubWaitlistSignupResponse", diff --git a/src/api/routes/oauth2/authorize.ts b/src/api/routes/oauth2/authorize.ts index 47a21eb493..d9beccd3e5 100644 --- a/src/api/routes/oauth2/authorize.ts +++ b/src/api/routes/oauth2/authorize.ts @@ -156,7 +156,7 @@ router.get( router.post( "/", route({ - requestBody: "ApplicationAuthorizeSchema", + requestBody: ApplicationAuthorizeSchema, query: { client_id: { type: "string", diff --git a/src/api/routes/policies/instance/config.ts b/src/api/routes/policies/instance/config.ts index 686ecd1e29..1e0058f80d 100755 --- a/src/api/routes/policies/instance/config.ts +++ b/src/api/routes/policies/instance/config.ts @@ -27,7 +27,7 @@ router.get( route({ responses: { 200: { - body: "Object", + body: "ConfigObjectResponse", }, }, spacebarOnly: true, diff --git a/src/api/routes/read-states/ack-bulk.ts b/src/api/routes/read-states/ack-bulk.ts index d0212c0b70..e19c6ca00b 100644 --- a/src/api/routes/read-states/ack-bulk.ts +++ b/src/api/routes/read-states/ack-bulk.ts @@ -25,7 +25,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "AckBulkSchema", + requestBody: AckBulkSchema, responses: { 204: {}, 400: { diff --git a/src/api/routes/reporting/index.ts b/src/api/routes/reporting/index.ts index a04f76de28..0fa55d4fd7 100644 --- a/src/api/routes/reporting/index.ts +++ b/src/api/routes/reporting/index.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2025 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -34,7 +34,7 @@ router.get( description: "[EXT] Get available reporting menu types.", responses: { 200: { - body: "Array", + body: "ReportingMenuTypesResponse", }, }, }), @@ -70,7 +70,7 @@ for (const type of Object.values(ReportMenuTypeNames)) { `/${type}`, route({ description: `Get reporting menu options for ${type} reports.`, - requestBody: "CreateReportSchema", + requestBody: CreateReportSchema, responses: { 200: { body: "ReportingMenuResponse", diff --git a/src/api/routes/teams.ts b/src/api/routes/teams.ts index 9e900df12a..4396ea9033 100644 --- a/src/api/routes/teams.ts +++ b/src/api/routes/teams.ts @@ -54,7 +54,7 @@ router.get( router.post( "/", route({ - requestBody: "TeamCreateSchema", + requestBody: TeamCreateSchema, responses: { 200: { body: "Team", diff --git a/src/api/routes/users/#user_id/delete.ts b/src/api/routes/users/#user_id/delete.ts index a0730cb798..3953215c30 100644 --- a/src/api/routes/users/#user_id/delete.ts +++ b/src/api/routes/users/#user_id/delete.ts @@ -43,7 +43,7 @@ router.post( "/", route({ right: "MANAGE_USERS", - requestBody: "InstanceUserDeleteSchema", + requestBody: InstanceUserDeleteSchema, responses: { 204: {}, 403: { diff --git a/src/api/routes/users/#user_id/profile.ts b/src/api/routes/users/#user_id/profile.ts index 749aaa2ed8..e1d1ce95ea 100644 --- a/src/api/routes/users/#user_id/profile.ts +++ b/src/api/routes/users/#user_id/profile.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -129,7 +129,7 @@ router.get("/", route({ responses: { 200: { body: "UserProfileResponse" } } }), }); }); -router.patch("/", route({ requestBody: "UserProfileModifySchema" }), async (req: Request, res: Response) => { +router.patch("/", route({ requestBody: UserProfileModifySchema }), async (req: Request, res: Response) => { const body = req.body as UserProfileModifySchema; if (body.banner) body.banner = await handleFile(`/banners/${req.user_id}`, body.banner as string); diff --git a/src/api/routes/users/@me/channels.ts b/src/api/routes/users/@me/channels.ts index dc44935e37..23eadfbcee 100644 --- a/src/api/routes/users/@me/channels.ts +++ b/src/api/routes/users/@me/channels.ts @@ -44,7 +44,7 @@ router.get( router.post( "/", route({ - requestBody: "DmChannelCreateSchema", + requestBody: DmChannelCreateSchema, responses: { 200: { body: "DmChannelDTO", diff --git a/src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts b/src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts index 0fc6f3fb69..b040a33d8a 100644 --- a/src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts +++ b/src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -23,7 +23,7 @@ import { ConnectionUpdateSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); // TODO: connection update schema -router.patch("/", route({ requestBody: "ConnectionUpdateSchema" }), async (req: Request, res: Response) => { +router.patch("/", route({ requestBody: ConnectionUpdateSchema }), async (req: Request, res: Response) => { const { connection_name, connection_id } = req.params as { [key: string]: string }; const body = req.body as ConnectionUpdateSchema; diff --git a/src/api/routes/users/@me/guilds/#guild_id/settings.ts b/src/api/routes/users/@me/guilds/#guild_id/settings.ts index 1501ac4b56..f61d650d2f 100644 --- a/src/api/routes/users/@me/guilds/#guild_id/settings.ts +++ b/src/api/routes/users/@me/guilds/#guild_id/settings.ts @@ -44,7 +44,7 @@ router.get( router.patch( "/", route({ - requestBody: "UserGuildSettingsSchema", + requestBody: UserGuildSettingsSchema, responses: { 200: {}, 400: { diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts index 469dddef74..bc414523e4 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -46,7 +46,7 @@ router.get( router.patch( "/", route({ - requestBody: "UserModifySchema", + requestBody: UserModifySchema, responses: { 200: { body: "UserUpdateResponse", diff --git a/src/api/routes/users/@me/mentions.ts b/src/api/routes/users/@me/mentions.ts index 9d4f7060ee..462f7fca68 100644 --- a/src/api/routes/users/@me/mentions.ts +++ b/src/api/routes/users/@me/mentions.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2025 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -28,7 +28,7 @@ router.get( route({ responses: { 200: { - body: "MessageListResponse", + body: "APIMessageArray", }, 404: { body: "APIErrorResponse", diff --git a/src/api/routes/users/@me/mfa/codes-verification.ts b/src/api/routes/users/@me/mfa/codes-verification.ts index 9421303751..45ff1fbc10 100644 --- a/src/api/routes/users/@me/mfa/codes-verification.ts +++ b/src/api/routes/users/@me/mfa/codes-verification.ts @@ -26,7 +26,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "CodesVerificationSchema", + requestBody: CodesVerificationSchema, responses: { 200: { body: "APIBackupCodeArray", diff --git a/src/api/routes/users/@me/mfa/codes.ts b/src/api/routes/users/@me/mfa/codes.ts index 0b1b94dae1..9b37f4bdd7 100644 --- a/src/api/routes/users/@me/mfa/codes.ts +++ b/src/api/routes/users/@me/mfa/codes.ts @@ -29,7 +29,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "MfaCodesSchema", + requestBody: MfaCodesSchema, deprecated: true, description: "This route is replaced with users/@me/mfa/codes-verification in newer clients", responses: { diff --git a/src/api/routes/users/@me/mfa/totp/disable.ts b/src/api/routes/users/@me/mfa/totp/disable.ts index 0b19560168..3d8ff43397 100644 --- a/src/api/routes/users/@me/mfa/totp/disable.ts +++ b/src/api/routes/users/@me/mfa/totp/disable.ts @@ -28,7 +28,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "TotpDisableSchema", + requestBody: TotpDisableSchema, responses: { 200: { body: "TokenOnlyResponse", diff --git a/src/api/routes/users/@me/mfa/totp/enable.ts b/src/api/routes/users/@me/mfa/totp/enable.ts index 869f1573f2..0c4fc91aea 100644 --- a/src/api/routes/users/@me/mfa/totp/enable.ts +++ b/src/api/routes/users/@me/mfa/totp/enable.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; @@ -29,7 +29,7 @@ const router = Router({ mergeParams: true }); router.post( "/", route({ - requestBody: "TotpEnableSchema", + requestBody: TotpEnableSchema, responses: { 200: { body: "TokenWithBackupCodesResponse", @@ -52,7 +52,7 @@ router.post( // TODO: Are guests allowed to enable 2fa? if (user.data.hash) { - if (!(await bcrypt.compare(body.password, user.data.hash))) { + if (!(await bcrypt.compare(body.password!, user.data.hash))) { throw new HTTPError(req.t("auth:login.INVALID_PASSWORD")); } } @@ -61,7 +61,7 @@ router.post( if (!body.code) throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); - if (verifyToken(body.secret, body.code)?.delta != 0) throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); + if (verifyToken(body.secret!, body.code)?.delta != 0) throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); const backup_codes = generateMfaBackupCodes(req.user_id); await Promise.all(backup_codes.map((x) => x.save())); diff --git a/src/api/routes/users/@me/mfa/webauthn/credentials/index.ts b/src/api/routes/users/@me/mfa/webauthn/credentials/index.ts index f99f7b3d5d..b788b32ca5 100644 --- a/src/api/routes/users/@me/mfa/webauthn/credentials/index.ts +++ b/src/api/routes/users/@me/mfa/webauthn/credentials/index.ts @@ -60,7 +60,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { router.post( "/", route({ - requestBody: "WebAuthnPostSchema", + requestBody: WebAuthnPostSchema, responses: { 200: { body: "WebAuthnCreateResponse", diff --git a/src/api/routes/users/@me/notes.ts b/src/api/routes/users/@me/notes.ts index 0b174791a9..ad1c82c9bc 100644 --- a/src/api/routes/users/@me/notes.ts +++ b/src/api/routes/users/@me/notes.ts @@ -19,6 +19,7 @@ import { route } from "@spacebar/api"; import { Note, Snowflake, User, emitEvent } from "@spacebar/util"; import { Request, Response, Router } from "express"; +import { UserNoteUpdateSchema } from "@spacebar/schemas"; const router: Router = Router({ mergeParams: true }); @@ -55,7 +56,7 @@ router.get( router.put( "/:user_id", route({ - requestBody: "UserNoteUpdateSchema", + requestBody: UserNoteUpdateSchema, responses: { 204: {}, 404: { diff --git a/src/api/routes/users/@me/relationships.ts b/src/api/routes/users/@me/relationships.ts index 88f95a3d38..d1838a1b32 100644 --- a/src/api/routes/users/@me/relationships.ts +++ b/src/api/routes/users/@me/relationships.ts @@ -1,26 +1,26 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { route } from "@spacebar/api"; import { Config, DiscordApiErrors, Relationship, RelationshipAddEvent, RelationshipRemoveEvent, RelationshipUpdateEvent, User, emitEvent } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; -import { PublicUserProjection, RelationshipType, RelationshipPatchSchema } from "@spacebar/schemas"; +import { PublicUserProjection, RelationshipType, RelationshipPatchSchema, RelationshipPostSchema, RelationshipPutSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); @@ -53,7 +53,7 @@ router.get( router.put( "/:user_id", route({ - requestBody: "RelationshipPutSchema", + requestBody: RelationshipPutSchema, responses: { 204: {}, 400: { @@ -81,7 +81,7 @@ router.put( router.patch( "/:user_id", route({ - requestBody: "RelationshipPatchSchema", + requestBody: RelationshipPatchSchema, responses: { 204: {}, 400: { @@ -100,7 +100,7 @@ router.patch( to_id: req.params.user_id as string, }, }); - rel.nickname = body.nickname; + rel.nickname = body.nickname ?? undefined; await Promise.all([ emitEvent({ event: "RELATIONSHIP_UPDATE", @@ -119,7 +119,7 @@ router.patch( router.post( "/", route({ - requestBody: "RelationshipPostSchema", + requestBody: RelationshipPostSchema, responses: { 204: {}, 400: { diff --git a/src/api/routes/users/@me/settings-proto/1.ts b/src/api/routes/users/@me/settings-proto/1.ts index 6df652a450..5a1d8608ac 100644 --- a/src/api/routes/users/@me/settings-proto/1.ts +++ b/src/api/routes/users/@me/settings-proto/1.ts @@ -54,7 +54,7 @@ router.get( router.patch( "/", route({ - requestBody: "SettingsProtoUpdateSchema", + requestBody: SettingsProtoUpdateSchema, responses: { 200: { body: "SettingsProtoUpdateResponse", @@ -100,7 +100,7 @@ router.get( router.patch( "/json", route({ - requestBody: "SettingsProtoUpdateJsonSchema", + requestBody: SettingsProtoUpdateJsonSchema, responses: { 200: { body: "SettingsProtoUpdateJsonResponse", diff --git a/src/api/routes/users/@me/settings-proto/2.ts b/src/api/routes/users/@me/settings-proto/2.ts index ac3280e91b..24b73ff950 100644 --- a/src/api/routes/users/@me/settings-proto/2.ts +++ b/src/api/routes/users/@me/settings-proto/2.ts @@ -54,7 +54,7 @@ router.get( router.patch( "/", route({ - requestBody: "SettingsProtoUpdateSchema", + requestBody: SettingsProtoUpdateSchema, responses: { 200: { body: "SettingsProtoUpdateResponse", @@ -100,7 +100,7 @@ router.get( router.patch( "/json", route({ - requestBody: "SettingsProtoUpdateJsonSchema", + requestBody: SettingsProtoUpdateJsonSchema, responses: { 200: { body: "SettingsProtoUpdateJsonResponse", diff --git a/src/api/routes/users/@me/settings.ts b/src/api/routes/users/@me/settings.ts index 47c206c926..092691e709 100644 --- a/src/api/routes/users/@me/settings.ts +++ b/src/api/routes/users/@me/settings.ts @@ -44,7 +44,7 @@ router.get( router.patch( "/", route({ - requestBody: "UserSettingsUpdateSchema", + requestBody: UserSettingsUpdateSchema, responses: { 200: { body: "UserSettings", diff --git a/src/api/routes/webhooks/#webhook_id/#token/github.ts b/src/api/routes/webhooks/#webhook_id/#token/github.ts index 71f61917e4..2d173769e3 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/github.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/github.ts @@ -381,7 +381,7 @@ router.post( next(); }, route({ - requestBody: "WebhookExecuteSchema", + requestBody: WebhookExecuteSchema, query: { wait: { type: "boolean", diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts index 556ee489f0..6f71db56f5 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/index.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts @@ -4,7 +4,7 @@ import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; import multer from "multer"; import { executeWebhook } from "../../../../util/handlers/Webhook"; -import { WebhookUpdateSchema } from "@spacebar/schemas"; +import { WebhookUpdateSchema, WebhookExecuteSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); router.get( @@ -13,7 +13,7 @@ router.get( description: "Returns a webhook object for the given id and token.", responses: { 200: { - body: "APIWebhook", + body: "Webhook", }, 404: {}, }, @@ -65,7 +65,7 @@ router.post( next(); }, route({ - requestBody: "WebhookExecuteSchema", + requestBody: WebhookExecuteSchema, query: { wait: { type: "boolean", @@ -136,7 +136,7 @@ router.delete( router.patch( "/", route({ - requestBody: "WebhookUpdateSchema", + requestBody: WebhookUpdateSchema, responses: { 200: { body: "Message", diff --git a/src/api/routes/webhooks/#webhook_id/index.ts b/src/api/routes/webhooks/#webhook_id/index.ts index 2282a4602d..587e63fcef 100644 --- a/src/api/routes/webhooks/#webhook_id/index.ts +++ b/src/api/routes/webhooks/#webhook_id/index.ts @@ -11,7 +11,7 @@ router.get( description: "Returns a webhook object for the given id. Requires the MANAGE_WEBHOOKS permission or to be the owner of the webhook.", responses: { 200: { - body: "APIWebhook", + body: "Webhook", }, 404: {}, }, @@ -80,7 +80,7 @@ router.delete( router.patch( "/", route({ - requestBody: "WebhookUpdateSchema", + requestBody: WebhookUpdateSchema, responses: { 200: { body: "WebhookCreateResponse", diff --git a/src/api/util/handlers/route.ts b/src/api/util/handlers/route.ts index 43aab15586..baea047e53 100644 --- a/src/api/util/handlers/route.ts +++ b/src/api/util/handlers/route.ts @@ -1,30 +1,24 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { DiscordApiErrors, EVENT, FieldErrors, PermissionResolvable, Permissions, RightResolvable, Rights, SpacebarApiErrors, getPermission, getRights } from "@spacebar/util"; -import { AnyValidateFunction } from "ajv/dist/core"; import { NextFunction, Request, Response } from "express"; -import { ajv } from "@spacebar/schemas"; - -const ignoredRequestSchemas = [ - // skip validation for settings proto JSON updates - TODO: figure out if this even possible to fix? - "SettingsProtoUpdateJsonSchema", -]; +import { z } from "zod"; declare global { // TODO: fix this @@ -39,16 +33,15 @@ declare global { export type RouteResponse = { status?: number; body?: `${string}Response`; - headers?: Record; + headers?: { [key: string]: string }; }; export interface RouteOptions { permission?: PermissionResolvable; right?: RightResolvable; - requestBody?: `${string}Schema`; // typescript interface name + requestBody?: z.ZodType; responses?: { [status: number]: { - // body?: `${string}Response`; body?: string; }; }; @@ -65,28 +58,9 @@ export interface RouteOptions { }; deprecated?: boolean; spacebarOnly?: boolean; - // test?: { - // response?: RouteResponse; - // body?: unknown; - // path?: string; - // event?: EVENT | EVENT[]; - // headers?: Record; - // }; } export function route(opts: RouteOptions) { - let validate: AnyValidateFunction | undefined; - if (opts.requestBody) { - try { - validate = ajv.getSchema(opts.requestBody); - } catch (e) { - console.error("AJV getSchema failed!"); - throw e; - } - - if (!validate) throw new Error(`Body schema ${opts.requestBody} not found`); - } - return async (req: Request, res: Response, next: NextFunction) => { if (opts.permission) { const { guild_id, channel_id } = req.params as { [key: string]: string }; @@ -94,7 +68,6 @@ export function route(opts: RouteOptions) { const requiredPerms = Array.isArray(opts.permission) ? opts.permission : [opts.permission]; requiredPerms.forEach((perm) => { - // bitfield comparison: check if user lacks certain permission if (!req.permission!.has(new Permissions(perm))) { throw DiscordApiErrors.MISSING_PERMISSIONS.withParams(perm as string); } @@ -110,20 +83,20 @@ export function route(opts: RouteOptions) { } } - if (validate && !ignoredRequestSchemas.includes(opts.requestBody!)) { - const valid = validate(req.body); - if (!valid) { + if (opts.requestBody) { + const result = opts.requestBody.safeParse(req.body); + if (!result.success) { const fields: Record = {}; - validate.errors?.forEach( - (x) => - (fields[x.instancePath.slice(1)] = { - code: x.keyword, - message: x.message || "", - }), - ); - if (process.env.LOG_VALIDATION_ERRORS) console.log(`[VALIDATION ERROR] ${req.method} ${req.originalUrl} - SCHEMA='${opts.requestBody}' -`, validate?.errors); - throw FieldErrors(fields, validate.errors!); + result.error.issues.forEach((x: z.core.$ZodIssue) => { + fields[x.path.join(".")] = { + code: x.code, + message: x.message, + }; + }); + if (process.env.LOG_VALIDATION_ERRORS) console.log(`[VALIDATION ERROR] ${req.method} ${req.originalUrl} -`, z.treeifyError(result.error)); + throw FieldErrors(fields); } + req.body = result.data; } next(); }; diff --git a/src/gateway/events/Message.ts b/src/gateway/events/Message.ts index ba6a7b1789..8611d9a8c2 100644 --- a/src/gateway/events/Message.ts +++ b/src/gateway/events/Message.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { CLOSECODES, OPCODES, Payload, WebSocket } from "@spacebar/gateway"; @@ -25,6 +25,7 @@ import WS from "ws"; import OPCodeHandlers from "../opcodes"; import { check } from "../opcodes/instanceOf"; import { PayloadSchema } from "@spacebar/schemas"; +import { z } from "zod"; const bigIntJson = BigIntJson({ storeAsString: true }); @@ -82,7 +83,16 @@ export async function Message(this: WebSocket, buffer: WS.Data) { if (!this.session_id) console.log(`[Gateway/${this.user_id ?? this.ipAddress}] Unknown session id, dumping to unknown folder`); } - check.call(this, PayloadSchema, data); + try { + data = PayloadSchema.parse(data); + } catch (e) { + if (process.env.LOG_VALIDATION_ERRORS) { + import("zod").then(({ z }) => { + console.log(`[VALIDATION ERROR] Gateway payload -`, z.treeifyError(e as any)); + }); + } + return this.close(CLOSECODES.Decode_error); + } const OPCodeHandler = OPCodeHandlers[data.op]; if (!OPCodeHandler) { diff --git a/src/gateway/opcodes/GuildSubscriptionsBulk.ts b/src/gateway/opcodes/GuildSubscriptionsBulk.ts index ec232829b0..b191bdc1f0 100644 --- a/src/gateway/opcodes/GuildSubscriptionsBulk.ts +++ b/src/gateway/opcodes/GuildSubscriptionsBulk.ts @@ -1,12 +1,9 @@ import { WebSocket, Payload } from "@spacebar/gateway"; import { onLazyRequest } from "./LazyRequest"; import { GuildSubscriptionsBulkSchema } from "@spacebar/schemas"; -import { check } from "./instanceOf"; - export async function onGuildSubscriptionsBulk(this: WebSocket, payload: Payload) { const startTime = Date.now(); - check.call(this, GuildSubscriptionsBulkSchema, payload.d); - const body = payload.d as GuildSubscriptionsBulkSchema; + const body = GuildSubscriptionsBulkSchema.parse(payload.d); let guildId: keyof GuildSubscriptionsBulkSchema["subscriptions"]; diff --git a/src/gateway/opcodes/GuildSync.ts b/src/gateway/opcodes/GuildSync.ts index 770e62c814..b9c2870a93 100644 --- a/src/gateway/opcodes/GuildSync.ts +++ b/src/gateway/opcodes/GuildSync.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { @@ -34,7 +34,6 @@ import { } from "@spacebar/util"; import { WebSocket, Payload, handlePresenceUpdate, OPCODES, Send } from "@spacebar/gateway"; import murmur from "murmurhash-js/murmurhash3_gc"; -import { check } from "./instanceOf"; import { LazyRequestSchema, PublicMember } from "@spacebar/schemas"; import { In } from "typeorm"; diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index 00fbf6501b..8d23a7dd4c 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { Capabilities, CLOSECODES, OPCODES, Payload, Send, setupListener, WebSocket } from "@spacebar/gateway"; @@ -55,8 +55,9 @@ import { UserSettings, UserSettingsProtos, VoiceState, + Activity, + Status, } from "@spacebar/util"; -import { check } from "./instanceOf"; import { In, Not } from "typeorm"; import { PreloadedUserSettings } from "discord-protos"; import { ChannelType, DefaultUserGuildSettings, DMChannel, IdentifySchema, PrivateUserProjection, PublicUser, PublicUserProjection } from "@spacebar/schemas"; @@ -82,8 +83,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { clearTimeout(this.readyTimeout); // Check payload matches schema - check.call(this, IdentifySchema, data.d); - const identify: IdentifySchema = data.d; + const identify = IdentifySchema.parse(data.d); this.capabilities = new Capabilities(identify.capabilities || 0); this.large_threshold = identify.large_threshold || 250; @@ -134,12 +134,12 @@ export async function onIdentify(this: WebSocket, data: Payload) { const { session, isNewSession } = tokenData.session ? { session: tokenData.session, isNewSession: false } : { - session: Session.create({ - user_id: this.user_id, - session_id: this.session_id, - }), - isNewSession: true, - }; + session: Session.create({ + user_id: this.user_id, + session_id: this.session_id, + }), + isNewSession: true, + }; if (tokenData.tokenVersion < CurrentTokenFormatVersion) console.warn( @@ -153,13 +153,12 @@ export async function onIdentify(this: WebSocket, data: Payload) { ); this.session = session; - this.session.status = identify.presence?.status || "online"; + this.session.status = (identify.presence?.status as Status) || "online"; this.session.last_seen = new Date(); this.session.client_info ??= {}; - this.session.client_info.platform = identify.properties?.$device ?? identify.properties?.$device; - this.session.client_info.os = identify.properties?.os || identify.properties?.$os; - this.session.client_status = {}; - this.session.activities = identify.presence?.activities ?? []; // TODO: validation + this.session.client_info.platform = identify.properties?.device; + this.session.client_info.os = identify.properties?.os + this.session.activities = (identify.presence?.activities as Activity[]) ?? []; // TODO: validation if (this.ipAddress && this.ipAddress !== this.session.last_seen_ip) { this.session.last_seen_ip = this.ipAddress; @@ -453,20 +452,20 @@ export async function onIdentify(this: WebSocket, data: Payload) { const guilds: GuildOrUnavailable[] = members.map((member) => { member.guild.channels = member.guild.channels /* - //TODO maybe implement this correctly, by causing create and delete events for users who can newly view and not view the channels, along with doing these checks correctly, as they don't currently take into account that the owner of the guild is always able to view channels, with potentially other issues - .filter((channel) => { - const perms = Permissions.finalPermission({ - user: { - id: member.id, - roles: member.roles.map((x) => x.id), - }, - guild: member.guild, - channel, - }); - - return perms.has("VIEW_CHANNEL"); - }) - */ + //TODO maybe implement this correctly, by causing create and delete events for users who can newly view and not view the channels, along with doing these checks correctly, as they don't currently take into account that the owner of the guild is always able to view channels, with potentially other issues + .filter((channel) => { + const perms = Permissions.finalPermission({ + user: { + id: member.id, + roles: member.roles.map((x) => x.id), + }, + guild: member.guild, + channel, + }); + + return perms.has("VIEW_CHANNEL"); + }) + */ .map((channel) => { channel.position = member.guild.channel_ordering.indexOf(channel.id); return channel; @@ -785,11 +784,11 @@ export async function onIdentify(this: WebSocket, data: Payload) { ...x, members: botMemberObject ? [ - { - ...botMemberObject.toPublicMember(), - user: user.toPublicUser(), - }, - ] + { + ...botMemberObject.toPublicMember(), + user: user.toPublicUser(), + }, + ] : [], }, })?.catch((e) => console.error(`[Gateway/${this.user_id}] error when sending bot guilds`, e)); diff --git a/src/gateway/opcodes/LazyRequest.ts b/src/gateway/opcodes/LazyRequest.ts index 4b916ac6f5..71d0d65612 100644 --- a/src/gateway/opcodes/LazyRequest.ts +++ b/src/gateway/opcodes/LazyRequest.ts @@ -1,25 +1,24 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { getDatabase, getPermission, listenEvent, Member, Role, Session, User, Presence, Channel, Permissions, arrayPartition } from "@spacebar/util"; import { WebSocket, Payload, handlePresenceUpdate, OPCODES, Send } from "@spacebar/gateway"; import murmur from "murmurhash-js/murmurhash3_gc"; -import { check } from "./instanceOf"; import { LazyRequestSchema } from "@spacebar/schemas"; // TODO: only show roles/members that have access to this channel @@ -173,8 +172,8 @@ async function subscribeToMemberEvents(this: WebSocket, user_id: string) { export async function onLazyRequest(this: WebSocket, { d }: Payload) { const startTime = Date.now(); // TODO: check data - check.call(this, LazyRequestSchema, d); - const { guild_id, typing, channels, activities, members } = d as LazyRequestSchema; + const parsedData = LazyRequestSchema.parse(d); + const { guild_id, typing, channels, activities, members } = parsedData; if (members) { // Client has requested a PRESENCE_UPDATE for specific member diff --git a/src/gateway/opcodes/PresenceUpdate.ts b/src/gateway/opcodes/PresenceUpdate.ts index 54ce3a894a..d23e9256b6 100644 --- a/src/gateway/opcodes/PresenceUpdate.ts +++ b/src/gateway/opcodes/PresenceUpdate.ts @@ -1,32 +1,31 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { WebSocket, Payload } from "@spacebar/gateway"; import { emitEvent, PresenceUpdateEvent, Session, User } from "@spacebar/util"; -import { check } from "./instanceOf"; import { ActivitySchema } from "@spacebar/schemas"; +import { Activity, Status } from "@spacebar/util"; export async function onPresenceUpdate(this: WebSocket, { d }: Payload) { const startTime = Date.now(); - check.call(this, ActivitySchema, d); - const presence = d as ActivitySchema; + const presence = ActivitySchema.parse(d); - await Session.update({ session_id: this.session_id }, { status: presence.status, activities: presence.activities }); + await Session.update({ session_id: this.session_id }, { status: presence.status as Status, activities: presence.activities as Activity[] }); const session = await Session.findOneOrFail({ select: { client_status: true }, diff --git a/src/gateway/opcodes/RequestGuildMembers.ts b/src/gateway/opcodes/RequestGuildMembers.ts index fa3724ad3f..a59ece9238 100644 --- a/src/gateway/opcodes/RequestGuildMembers.ts +++ b/src/gateway/opcodes/RequestGuildMembers.ts @@ -1,24 +1,23 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { getDatabase, getPermission, GuildMembersChunkEvent, Member, Presence, Session } from "@spacebar/util"; import { WebSocket, Payload, OPCODES, Send } from "@spacebar/gateway"; -import { check } from "./instanceOf"; import { FindManyOptions, ILike, In } from "typeorm"; import { RequestGuildMembersSchema } from "@spacebar/schemas"; @@ -30,10 +29,10 @@ export async function onRequestGuildMembers(this: WebSocket, { d }: Payload) { if (d.user_ids && !Array.isArray(d.user_ids)) d.user_ids = [d.user_ids]; - check.call(this, RequestGuildMembersSchema, d); + const dParsed = RequestGuildMembersSchema.parse(d); - const { presences, nonce, query: requestQuery } = d as RequestGuildMembersSchema; - let { limit, user_ids, guild_id } = d as RequestGuildMembersSchema; + const { presences, nonce, query: requestQuery } = dParsed; + let { limit, user_ids, guild_id } = dParsed; // some discord libraries send empty string as query when they meant to send undefined, which was leading to errors being thrown in this handler const query = requestQuery != "" ? requestQuery : undefined; diff --git a/src/gateway/opcodes/StreamCreate.ts b/src/gateway/opcodes/StreamCreate.ts index 1b8fa7ea8e..8be912396f 100644 --- a/src/gateway/opcodes/StreamCreate.ts +++ b/src/gateway/opcodes/StreamCreate.ts @@ -12,13 +12,11 @@ import { VoiceState, VoiceStateUpdateEvent, } from "@spacebar/util"; -import { check } from "./instanceOf"; import { StreamCreateSchema } from "@spacebar/schemas"; export async function onStreamCreate(this: WebSocket, data: Payload) { const startTime = Date.now(); - check.call(this, StreamCreateSchema, data.d); - const body = data.d as StreamCreateSchema; + const body = StreamCreateSchema.parse(data.d); if (body.channel_id.trim().length === 0) return; diff --git a/src/gateway/opcodes/StreamDelete.ts b/src/gateway/opcodes/StreamDelete.ts index c5d8bec384..debba03a3c 100644 --- a/src/gateway/opcodes/StreamDelete.ts +++ b/src/gateway/opcodes/StreamDelete.ts @@ -1,12 +1,10 @@ import { parseStreamKey, Payload, WebSocket } from "@spacebar/gateway"; import { emitEvent, Stream, StreamDeleteEvent, VoiceState, VoiceStateUpdateEvent } from "@spacebar/util"; -import { check } from "./instanceOf"; import { StreamDeleteSchema } from "@spacebar/schemas"; export async function onStreamDelete(this: WebSocket, data: Payload) { const startTime = Date.now(); - check.call(this, StreamDeleteSchema, data.d); - const body = data.d as StreamDeleteSchema; + const body = StreamDeleteSchema.parse(data.d); let parsedKey: { type: "guild" | "call"; diff --git a/src/gateway/opcodes/StreamWatch.ts b/src/gateway/opcodes/StreamWatch.ts index 92588a9d51..fcb5d907ef 100644 --- a/src/gateway/opcodes/StreamWatch.ts +++ b/src/gateway/opcodes/StreamWatch.ts @@ -1,13 +1,11 @@ import { genVoiceToken, parseStreamKey, Payload, WebSocket } from "@spacebar/gateway"; import { Config, emitEvent, Stream, StreamCreateEvent, StreamServerUpdateEvent, StreamSession } from "@spacebar/util"; -import { check } from "./instanceOf"; import { Not } from "typeorm"; import { StreamWatchSchema } from "@spacebar/schemas"; export async function onStreamWatch(this: WebSocket, data: Payload) { const startTime = Date.now(); - check.call(this, StreamWatchSchema, data.d); - const body = data.d as StreamWatchSchema; + const body = StreamWatchSchema.parse(data.d); // TODO: apply perms: check if user is allowed to watch diff --git a/src/gateway/opcodes/VoiceStateUpdate.ts b/src/gateway/opcodes/VoiceStateUpdate.ts index a128ee3eaa..ea2ec0175f 100644 --- a/src/gateway/opcodes/VoiceStateUpdate.ts +++ b/src/gateway/opcodes/VoiceStateUpdate.ts @@ -1,25 +1,24 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { Payload, WebSocket } from "@spacebar/gateway"; import { Config, emitEvent, Guild, Member, VoiceServerUpdateEvent, VoiceState, VoiceStateUpdateEvent } from "@spacebar/util"; import { genVoiceToken } from "../util/SessionUtils"; -import { check } from "./instanceOf"; import { Region, VoiceStateUpdateSchema } from "@spacebar/schemas"; // TODO: check if a voice server is setup @@ -29,8 +28,7 @@ import { Region, VoiceStateUpdateSchema } from "@spacebar/schemas"; export async function onVoiceStateUpdate(this: WebSocket, data: Payload) { const startTime = Date.now(); - check.call(this, VoiceStateUpdateSchema, data.d); - const body = data.d as VoiceStateUpdateSchema; + const body = VoiceStateUpdateSchema.parse(data.d); const isNew = body.channel_id === null && body.guild_id === null; let isChanged = false; diff --git a/src/gateway/util/Send.ts b/src/gateway/util/Send.ts index 95902ca4cd..38b668a39d 100644 --- a/src/gateway/util/Send.ts +++ b/src/gateway/util/Send.ts @@ -1,22 +1,23 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { Payload, WebSocket } from "@spacebar/gateway"; +import { PayloadSchema } from "@spacebar/schemas"; import fs from "fs/promises"; import path from "path"; @@ -54,6 +55,13 @@ export async function Send(socket: WebSocket, data: Payload) { await fs.writeFile(path.join("dump", id, `${Date.now()}.out.json`), JSON.stringify(data, null, 2)); } + const result = PayloadSchema.safeParse(data); + if (!result.success) { + import("zod").then(({ z }) => { + console.warn(`[Gateway/${socket.user_id ?? socket.ipAddress}] Outgoing Payload Validation Warning:`, z.treeifyError(result.error)); + }); + } + let buffer: Buffer | string; if (socket.encoding === "etf" && erlpack) { // Erlpack doesn't like Date objects, encodes them as {} diff --git a/src/schemas/Validator.ts b/src/schemas/Validator.ts deleted file mode 100644 index e7a227a9c8..0000000000 --- a/src/schemas/Validator.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ - -import Ajv from "ajv"; -import addFormats from "ajv-formats"; -import fs from "fs"; -import path from "path"; - -const SchemaPath = path.join(__dirname, "..", "..", "assets", "schemas.json"); -const schemas = JSON.parse(fs.readFileSync(SchemaPath, { encoding: "utf8" }).replaceAll("#/definitions/", "")); - -// const schemas2 = {...schemas, definitions: {...schemas, }}; -// console.log(schemas); -// for (const schemaName in schemas) { -// const schema = schemas[schemaName]; -// if ("x-sb-defs" in schema) { -// console.log("[Validator] Adding definitions for schema", schemaName, ":", schema["x-sb-defs"]); -// for (const defKey of schema["x-sb-defs"]) { -// console.log(" - ", defKey, typeof schemas[defKey] === "object"); -// schema.definitions = schema.definitions || {}; -// if (schemas[defKey]) schema.definitions[defKey] = schemas[defKey]; -// else console.warn("[Validator] Definition", defKey, "not found for schema", schemaName); -// } -// } -// } - -export const ajv = new Ajv({ - allErrors: true, - parseDate: true, - allowDate: true, - schemas: schemas, - coerceTypes: true, - messages: true, - strict: true, - strictRequired: true, - allowUnionTypes: true, -}); - -addFormats(ajv); - -export function validateSchema(schema: string, data: G): G { - const valid = ajv.validate(schema, data); - if (!valid) { - console.log("[Validator] Validation error in ", schema); - throw ajv.errors; - } - return data; -} diff --git a/src/schemas/api/bots/ApplicationCommandCreateSchema.ts b/src/schemas/api/bots/ApplicationCommandCreateSchema.ts index 4408a9e0fc..4f23934f0f 100644 --- a/src/schemas/api/bots/ApplicationCommandCreateSchema.ts +++ b/src/schemas/api/bots/ApplicationCommandCreateSchema.ts @@ -1,28 +1,71 @@ -import { - ApplicationCommandHandlerType, - ApplicationCommandOption, - ApplicationCommandType, - ApplicationIntegrationType, - InteractionContextType, - StringStringDictionary, -} from "@spacebar/schemas"; - -export interface ApplicationCommandCreateSchema { - type?: ApplicationCommandType; +import { z } from "zod"; +import { ApplicationCommandHandlerType, ApplicationCommandType, ApplicationIntegrationType, InteractionContextType } from "./ApplicationCommandSchema"; + +const StringStringDictionary = z.record(z.string(), z.string()); + +const ApplicationCommandOptionChoice = z.object({ + name: z.string(), + name_localizations: StringStringDictionary.optional(), + value: z.union([z.string(), z.number()]), +}); + +export interface ApplicationCommandCreateSchemaOption { + type: number; name: string; - name_localizations?: StringStringDictionary; - description?: string; - description_localizations?: StringStringDictionary; - options?: ApplicationCommandOption[]; - default_member_permissions?: string; - /* - * @deprecated - */ - dm_permission?: boolean; - nsfw?: boolean; - integration_types?: ApplicationIntegrationType[]; - contexts?: InteractionContextType[]; - handler?: ApplicationCommandHandlerType; + name_localizations?: Record; + description: string; + description_localizations?: Record; + required?: boolean; + choices?: { + name: string; + name_localizations?: Record; + value: string | number; + }[]; + options?: ApplicationCommandCreateSchemaOption[]; + channel_types?: number[]; + min_value?: number; + max_value?: number; + min_length?: number; + max_length?: number; + autocomplete?: boolean; } -export type BulkApplicationCommandCreateSchema = ApplicationCommandCreateSchema[]; +const ApplicationCommandCreateSchemaOption: z.ZodType = z.lazy(() => + z.object({ + type: z.number(), + name: z.string(), + name_localizations: StringStringDictionary.optional(), + description: z.string(), + description_localizations: StringStringDictionary.optional(), + required: z.boolean().optional(), + choices: z.array(ApplicationCommandOptionChoice).optional(), + options: z.array(ApplicationCommandCreateSchemaOption).optional(), + channel_types: z.array(z.number()).optional(), + min_value: z.number().optional(), + max_value: z.number().optional(), + min_length: z.number().optional(), + max_length: z.number().optional(), + autocomplete: z.boolean().optional(), + }), +); + +export const ApplicationCommandCreateSchema = z.object({ + type: z.enum(ApplicationCommandType).optional(), + name: z.string(), + name_localizations: StringStringDictionary.optional(), + description: z.string().optional(), + description_localizations: StringStringDictionary.optional(), + options: z.array(ApplicationCommandCreateSchemaOption).optional(), + default_member_permissions: z.string().optional(), + dm_permission: z.boolean().optional(), + nsfw: z.boolean().optional(), + integration_types: z.array(z.enum(ApplicationIntegrationType)).optional(), + contexts: z.array(z.enum(InteractionContextType)).optional(), + handler: z.enum(ApplicationCommandHandlerType).optional(), +}); + +export type ApplicationCommandCreateSchema = z.infer; + +export const BulkApplicationCommandCreateSchema = z.array(ApplicationCommandCreateSchema); + +export type BulkApplicationCommandCreateSchema = z.infer; diff --git a/src/schemas/api/bots/ApplicationCommandSchema.ts b/src/schemas/api/bots/ApplicationCommandSchema.ts index 7d739e4536..86dfcda2f8 100644 --- a/src/schemas/api/bots/ApplicationCommandSchema.ts +++ b/src/schemas/api/bots/ApplicationCommandSchema.ts @@ -28,8 +28,8 @@ export interface ApplicationCommandSchema { export interface ApplicationCommandIndexPermissions { user?: boolean; - roles?: Record; - channels?: Record; + roles?: { [key: string]: boolean }; + channels?: { [key: string]: boolean }; } export enum ApplicationCommandType { diff --git a/src/schemas/api/developers/ApplicationCreateSchema.ts b/src/schemas/api/developers/ApplicationCreateSchema.ts index 37fd02a7be..2166f597db 100644 --- a/src/schemas/api/developers/ApplicationCreateSchema.ts +++ b/src/schemas/api/developers/ApplicationCreateSchema.ts @@ -16,7 +16,11 @@ along with this program. If not, see . */ -export interface ApplicationCreateSchema { - name: string; - team_id?: string; -} +import { z } from "zod"; + +export const ApplicationCreateSchema = z.object({ + name: z.string(), + team_id: z.string().optional(), +}); + +export type ApplicationCreateSchema = z.infer; diff --git a/src/schemas/api/developers/ApplicationModifySchema.ts b/src/schemas/api/developers/ApplicationModifySchema.ts index c550660a74..fe89389c80 100644 --- a/src/schemas/api/developers/ApplicationModifySchema.ts +++ b/src/schemas/api/developers/ApplicationModifySchema.ts @@ -1,39 +1,39 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface ApplicationModifySchema { - description?: string; - icon?: string; - cover_image?: string; - interactions_endpoint_url?: string; - max_participants?: number | null; - name?: string; - privacy_policy_url?: string; - role_connections_verification_url?: string; - tags?: string[]; - terms_of_service_url?: string; - bot_public?: boolean; - bot_require_code_grant?: boolean; - flags?: number; - custom_install_url?: string; - guild_id?: string; - /*install_params?: { TODO: Validation - scopes: string[]; - permissions: string; - };*/ -} +import { z } from "zod"; + +export const ApplicationModifySchema = z.object({ + description: z.string().optional(), + icon: z.string().optional(), + cover_image: z.string().optional(), + interactions_endpoint_url: z.string().optional(), + max_participants: z.number().nullish(), + name: z.string().optional(), + privacy_policy_url: z.string().optional(), + role_connections_verification_url: z.string().optional(), + tags: z.array(z.string()).optional(), + terms_of_service_url: z.string().optional(), + bot_public: z.boolean().optional(), + bot_require_code_grant: z.boolean().optional(), + flags: z.number().optional(), + custom_install_url: z.string().optional(), + guild_id: z.string().optional(), +}); + +export type ApplicationModifySchema = z.infer; diff --git a/src/schemas/api/guilds/Automod.ts b/src/schemas/api/guilds/Automod.ts index 1c663776ec..86d71f21c8 100644 --- a/src/schemas/api/guilds/Automod.ts +++ b/src/schemas/api/guilds/Automod.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2025 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { Snowflake } from "../../Identifiers"; @@ -67,25 +67,25 @@ export enum AutomodRuleActionType { export type AutomodAction = | { - type: AutomodRuleActionType.BLOCK_MESSAGE; + type: 1; metadata: { custom_message?: string; }; } | { - type: AutomodRuleActionType.SEND_ALERT_MESSAGE; + type: 2; metadata: { channel_id: Snowflake; }; } | { - type: AutomodRuleActionType.TIMEOUT_USER; + type: 3; metadata: { duration_seconds: number; }; } | { - type: AutomodRuleActionType.QUARANTINE_USER; + type: 4; metadata: { duration_seconds: number; }; diff --git a/src/schemas/api/reports/CreateReport.ts b/src/schemas/api/reports/CreateReport.ts index 7c5606dc87..0189998aef 100644 --- a/src/schemas/api/reports/CreateReport.ts +++ b/src/schemas/api/reports/CreateReport.ts @@ -1,36 +1,39 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2025 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -// TODO: check -export interface CreateReportSchema { - version: string; - variant: string; - name: string; - language: string; - breadcrumbs: number[]; - elements?: { [key: string]: string[] }; - channel_id?: string; // snowflake - message_id?: string; // snowflake - guild_id?: string; // snowflake - stage_instance_id?: string; // snowflake - guild_scheduled_event_id?: string; // snowflake - reported_user_id?: string; // snowflake - application_id?: string; // snowflake - user_id?: string; // snowflake - widget_id?: string; // snowflake -} +import { z } from "zod"; + +export const CreateReportSchema = z.object({ + version: z.string(), + variant: z.string(), + name: z.string(), + language: z.string(), + breadcrumbs: z.array(z.number()), + elements: z.record(z.string(), z.array(z.string())).optional(), + channel_id: z.string().optional(), + message_id: z.string().optional(), + guild_id: z.string().optional(), + stage_instance_id: z.string().optional(), + guild_scheduled_event_id: z.string().optional(), + reported_user_id: z.string().optional(), + application_id: z.string().optional(), + user_id: z.string().optional(), + widget_id: z.string().optional(), +}); + +export type CreateReportSchema = z.infer; diff --git a/src/schemas/api/reports/ReportMenu.ts b/src/schemas/api/reports/ReportMenu.ts index 0a8f0972f1..eb4207dbb1 100644 --- a/src/schemas/api/reports/ReportMenu.ts +++ b/src/schemas/api/reports/ReportMenu.ts @@ -1,19 +1,19 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2025 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ export enum ReportMenuType { @@ -48,3 +48,15 @@ export enum ReportButtonType { CANCEL = "cancel", NEXT = "next", } + +export interface ReportingMenuResponse { + version: string; + variant: string; + language: string; + name: string; + elements: unknown; + nodes: unknown; + root_node_id: string; +} + +export type ReportingMenuTypesResponse = string[]; diff --git a/src/schemas/api/users/InstanceUserDeleteSchema.ts b/src/schemas/api/users/InstanceUserDeleteSchema.ts index 497e33484b..31c7b3b3f8 100644 --- a/src/schemas/api/users/InstanceUserDeleteSchema.ts +++ b/src/schemas/api/users/InstanceUserDeleteSchema.ts @@ -1,7 +1,12 @@ -import { ConnectedAccount } from "@spacebar/util"; +import { z } from "zod"; -export type InstanceUserDeleteSchema = InstanceUserDeleteSchemaContent | undefined; //unsure if this a correct way to make the body optional -export interface InstanceUserDeleteSchemaContent { - reason?: string; - persistInstanceBan?: boolean; -} +export const InstanceUserDeleteSchemaContent = z.object({ + reason: z.string().optional(), + persistInstanceBan: z.boolean().optional(), +}); + +// Body is optional (can be undefined) +export const InstanceUserDeleteSchema = InstanceUserDeleteSchemaContent.optional(); + +export type InstanceUserDeleteSchemaContent = z.infer; +export type InstanceUserDeleteSchema = z.infer; diff --git a/src/schemas/api/users/SessionsSchemas.ts b/src/schemas/api/users/SessionsSchemas.ts index 3526414b03..829f9f7c7b 100644 --- a/src/schemas/api/users/SessionsSchemas.ts +++ b/src/schemas/api/users/SessionsSchemas.ts @@ -16,10 +16,16 @@ along with this program. If not, see . */ -import { ActivitySchema, Snowflake } from "@spacebar/schemas"; +import { z } from "zod"; +import { ActivitySchema } from "@spacebar/schemas"; import { ClientStatus } from "@spacebar/util"; -export type SessionsLogoutSchema = { session_ids?: Snowflake[]; session_id_hashes?: string[] }; +export const SessionsLogoutSchema = z.object({ + session_ids: z.array(z.string()).optional(), + session_id_hashes: z.array(z.string()).optional(), +}); + +export type SessionsLogoutSchema = z.infer; export type GetSessionsResponse = { user_sessions: DeviceInfo[] }; export type DeviceInfo = { diff --git a/src/schemas/api/users/UserSettings.ts b/src/schemas/api/users/UserSettings.ts index 457d6f4cc2..243c0219a9 100644 --- a/src/schemas/api/users/UserSettings.ts +++ b/src/schemas/api/users/UserSettings.ts @@ -1,59 +1,85 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export type UserSettingsUpdateSchema = Partial; +import { z } from "zod"; -export interface UserSettingsSchema { - afk_timeout: number; - allow_accessibility_detection: boolean; - animate_emoji: boolean; - animate_stickers: number; - contact_sync_enabled: boolean; - convert_emoticons: boolean; - custom_status: CustomStatus | null; - default_guilds_restricted: boolean; - detect_platform_accounts: boolean; - developer_mode: boolean; - disable_games_tab: boolean; - enable_tts_command: boolean; - explicit_content_filter: number; - friend_discovery_flags: number; - friend_source_flags: FriendSourceFlags; - gateway_connected: boolean; - gif_auto_play: boolean; - guild_folders: GuildFolder[]; // every top guild is displayed as a "folder" - guild_positions: string[]; // guild ids ordered by position - inline_attachment_media: boolean; - inline_embed_media: boolean; - locale: string; // en_US - message_display_compact: boolean; - native_phone_integration_enabled: boolean; - render_embeds: boolean; - render_reactions: boolean; - restricted_guilds: string[]; - show_current_game: boolean; - status: "online" | "offline" | "dnd" | "idle" | "invisible"; - stream_notifications_enabled: boolean; - theme: "dark" | "light"; // dark - timezone_offset: number; // e.g -60 - view_nsfw_guilds: boolean; -} +const CustomStatusSchema = z + .object({ + emoji_id: z.string().optional(), + emoji_name: z.string().optional(), + expires_at: z.number().optional(), + text: z.string().optional(), + }) + .nullable(); + +const FriendSourceFlagsSchema = z.object({ + all: z.boolean(), +}); + +const GuildFolderSchema = z.object({ + color: z.number().nullish(), + guild_ids: z.array(z.string()), + id: z.number().nullish(), + name: z.string().nullish(), +}); + +export const UserSettingsSchema = z.object({ + afk_timeout: z.number(), + allow_accessibility_detection: z.boolean(), + animate_emoji: z.boolean(), + animate_stickers: z.number(), + contact_sync_enabled: z.boolean(), + convert_emoticons: z.boolean(), + custom_status: CustomStatusSchema, + default_guilds_restricted: z.boolean(), + detect_platform_accounts: z.boolean(), + developer_mode: z.boolean(), + disable_games_tab: z.boolean(), + enable_tts_command: z.boolean(), + explicit_content_filter: z.number(), + friend_discovery_flags: z.number(), + friend_source_flags: FriendSourceFlagsSchema, + gateway_connected: z.boolean(), + gif_auto_play: z.boolean(), + guild_folders: z.array(GuildFolderSchema), + guild_positions: z.array(z.string()), + inline_attachment_media: z.boolean(), + inline_embed_media: z.boolean(), + locale: z.string(), + message_display_compact: z.boolean(), + native_phone_integration_enabled: z.boolean(), + render_embeds: z.boolean(), + render_reactions: z.boolean(), + restricted_guilds: z.array(z.string()), + show_current_game: z.boolean(), + status: z.enum(["online", "offline", "dnd", "idle", "invisible"]), + stream_notifications_enabled: z.boolean(), + theme: z.enum(["dark", "light"]), + timezone_offset: z.number(), + view_nsfw_guilds: z.boolean(), +}); + +export const UserSettingsUpdateSchema = UserSettingsSchema.partial(); + +export type UserSettingsSchema = z.infer; +export type UserSettingsUpdateSchema = z.infer; +// Re-export sub-types for downstream consumers export interface CustomStatus { emoji_id?: string; emoji_name?: string; diff --git a/src/schemas/gateway/GatewayPayloadSchema.ts b/src/schemas/gateway/GatewayPayloadSchema.ts index 1df6de7d43..6d9d155c0c 100644 --- a/src/schemas/gateway/GatewayPayloadSchema.ts +++ b/src/schemas/gateway/GatewayPayloadSchema.ts @@ -16,11 +16,11 @@ along with this program. If not, see . */ -import { Tuple } from "lambert-server"; +import { z } from "zod"; -export const PayloadSchema = { - op: Number, - $d: new Tuple(Object, Number), // or number for heartbeat sequence - $s: Number, - $t: String, -}; +export const PayloadSchema = z.object({ + op: z.number(), + d: z.any().optional(), + s: z.number().optional(), + t: z.string().optional(), +}); diff --git a/src/schemas/gateway/IdentifySchema.ts b/src/schemas/gateway/IdentifySchema.ts index 7a80803acb..632f351e41 100644 --- a/src/schemas/gateway/IdentifySchema.ts +++ b/src/schemas/gateway/IdentifySchema.ts @@ -1,144 +1,58 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. -// TODO: Need a way to allow camalCase and pascal_case without just duplicating the schema + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ -import { ActivitySchema } from "@spacebar/schemas"; +import { z } from "zod"; +import { ActivitySchema } from "../uncategorised/ActivitySchema"; -export const IdentifySchema = { - token: String, - $intents: BigInt, // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt - $properties: Object, - // { - // // discord uses $ in the property key for bots, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key - // $os: String, - // $os_arch: String, - // $browser: String, - // $device: String, - // $$os: String, - // $$browser: String, - // $$device: String, - // $browser_user_agent: String, - // $browser_version: String, - // $os_version: String, - // $referrer: String, - // $$referrer: String, - // $referring_domain: String, - // $$referring_domain: String, - // $referrer_current: String, - // $referring_domain_current: String, - // $release_channel: String, - // $client_build_number: Number, - // $client_event_source: String, - // $client_version: String, - // $system_locale: String, - // $window_manager: String, - // $distro: String, - // }, - $presence: ActivitySchema, - $compress: Boolean, - $large_threshold: Number, - $shard: [BigInt, BigInt], - $guild_subscriptions: Boolean, - $capabilities: Number, - $client_state: { - $guild_hashes: Object, - $highest_last_message_id: Number, - $read_state_version: Number, - $user_guild_settings_version: Number, - $user_settings_version: undefined, - $useruser_guild_settings_version: undefined, - $private_channels_version: Number, - $guild_versions: Object, - $api_code_version: Number, - $initial_guild_id: String, - }, - $clientState: { - $guildHashes: Object, - $highestLastMessageId: Number, - $readStateVersion: Number, - $useruserGuildSettingsVersion: undefined, - $userGuildSettingsVersion: undefined, - $guildVersions: Object, - $apiCodeVersion: Number, - $initialGuildId: String, - }, - $v: Number, - $version: Number, -}; +export const IdentifySchema = z.object({ + token: z.string(), + properties: z.object({ + os: z.string().optional(), + $os: z.string().optional(), + browser: z.string().optional(), + $browser: z.string().optional(), + device: z.string().optional(), + $device: z.string().optional(), + system_locale: z.string().optional(), + client_version: z.string().optional(), + client_build_number: z.number().optional(), + release_channel: z.string().optional() + }), + compress: z.boolean().optional(), + large_threshold: z.number().optional(), + largeThreshold: z.number().optional(), + shard: z.tuple([z.coerce.bigint(), z.coerce.bigint()]).optional(), + presence: ActivitySchema.optional(), + intents: z.coerce.bigint().optional(), + capabilities: z.number().optional(), + client_state: z.object({ + guild_hashes: z.any().optional(), + highest_last_message_id: z.number().optional(), + read_state_version: z.number().optional(), + user_guild_settings_version: z.number().optional(), + user_settings_version: z.number().optional(), + useruser_guild_settings_version: z.number().optional(), + private_channels_version: z.number().optional(), + guild_versions: z.any().optional(), + api_code_version: z.number().optional(), + initial_guild_id: z.string().optional(), + }).optional(), + v: z.number().optional(), +}); -export interface IdentifySchema { - token: string; - properties: { - // bruh discord really uses $ in the property key, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key - os?: string; - os_atch?: string; - browser?: string; - device?: string; - $os?: string; - $browser?: string; - $device?: string; - browser_user_agent?: string; - browser_version?: string; - os_version?: string; - referrer?: string; - referring_domain?: string; - referrer_current?: string; - referring_domain_current?: string; - release_channel?: "stable" | "dev" | "ptb" | "canary"; - client_build_number?: number; - client_event_source?: string; - client_version?: string; - system_locale?: string; - }; - intents?: bigint; // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt - presence?: ActivitySchema; - compress?: boolean; - large_threshold?: number; - largeThreshold?: number; - /** - * @minItems 2 - * @maxItems 2 - */ - shard?: bigint[]; // puyo: changed from [bigint, bigint] because it breaks openapi - guild_subscriptions?: boolean; - capabilities?: number; - client_state?: { - guild_hashes?: unknown; - highest_last_message_id?: number; - read_state_version?: number; - user_guild_settings_version?: number; - user_settings_version?: number; - useruser_guild_settings_version?: number; - private_channels_version?: number; - guild_versions?: unknown; - api_code_version?: number; - initial_guild_id?: string; - }; - clientState?: { - guildHashes?: unknown; - highestLastMessageId?: number; - readStateVersion?: number; - userGuildSettingsVersion?: number; - useruserGuildSettingsVersion?: number; - guildVersions?: unknown; - apiCodeVersion?: number; - initialGuildId?: string; - }; - v?: number; -} +export type IdentifySchema = z.infer; diff --git a/src/schemas/gateway/LazyRequestSchema.ts b/src/schemas/gateway/LazyRequestSchema.ts index fcefe680e8..425870d2ba 100644 --- a/src/schemas/gateway/LazyRequestSchema.ts +++ b/src/schemas/gateway/LazyRequestSchema.ts @@ -1,46 +1,32 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface LazyRequestSchema { - guild_id: string; - channels?: { - /** - * @items.type integer - * @minItems 2 - * @maxItems 2 - */ - [key: string]: number[][]; // puyo: changed from [number, number] because it breaks openapi - }; - activities?: boolean; - threads?: boolean; - typing?: true; - members?: string[]; - member_updates?: boolean; - thread_member_lists?: unknown[]; -} +import { z } from "zod"; -export const LazyRequestSchema = { - guild_id: String, - $activities: Boolean, - $channels: Object, - $typing: Boolean, - $threads: Boolean, - $members: [] as string[], - $member_updates: Boolean, - $thread_member_lists: [] as unknown[], -}; +export const LazyRequestSchema = z.object({ + guild_id: z.string(), + channels: z.record(z.string(), z.array(z.array(z.number()))).optional(), + activities: z.boolean().optional(), + threads: z.boolean().optional(), + typing: z.literal(true).optional(), + members: z.array(z.string()).optional(), + member_updates: z.boolean().optional(), + thread_member_lists: z.array(z.any()).optional(), +}); + +export type LazyRequestSchema = z.infer; diff --git a/src/schemas/gateway/StreamCreateSchema.ts b/src/schemas/gateway/StreamCreateSchema.ts index 3e97724a86..c21413a774 100644 --- a/src/schemas/gateway/StreamCreateSchema.ts +++ b/src/schemas/gateway/StreamCreateSchema.ts @@ -1,13 +1,10 @@ -export interface StreamCreateSchema { - type: "guild" | "call"; - channel_id: string; - guild_id?: string; - preferred_region?: string; -} +import { z } from "zod"; -export const StreamCreateSchema = { - type: String, - channel_id: String, - $guild_id: String, - $preferred_region: String, -}; +export const StreamCreateSchema = z.object({ + type: z.enum(["guild", "call"]), + channel_id: z.string(), + guild_id: z.string().optional(), + preferred_region: z.string().optional(), +}); + +export type StreamCreateSchema = z.infer; diff --git a/src/schemas/gateway/StreamDeleteSchema.ts b/src/schemas/gateway/StreamDeleteSchema.ts index 654344418e..d14f028243 100644 --- a/src/schemas/gateway/StreamDeleteSchema.ts +++ b/src/schemas/gateway/StreamDeleteSchema.ts @@ -1,7 +1,7 @@ -export interface StreamDeleteSchema { - stream_key: string; -} +import { z } from "zod"; -export const StreamDeleteSchema = { - stream_key: String, -}; +export const StreamDeleteSchema = z.object({ + stream_key: z.string(), +}); + +export type StreamDeleteSchema = z.infer; diff --git a/src/schemas/gateway/StreamWatchSchema.ts b/src/schemas/gateway/StreamWatchSchema.ts index 14fdd026a0..e51286e03c 100644 --- a/src/schemas/gateway/StreamWatchSchema.ts +++ b/src/schemas/gateway/StreamWatchSchema.ts @@ -1,7 +1,7 @@ -export interface StreamWatchSchema { - stream_key: string; -} +import { z } from "zod"; -export const StreamWatchSchema = { - stream_key: String, -}; +export const StreamWatchSchema = z.object({ + stream_key: z.string(), +}); + +export type StreamWatchSchema = z.infer; diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 99f4095c64..17aaef8cb4 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -22,4 +22,3 @@ export * from "./uncategorised"; export * from "./webrtc"; export * from "./HelperTypes"; export * from "./Identifiers"; -export * from "./Validator"; diff --git a/src/schemas/responses/TypedResponses.ts b/src/schemas/responses/TypedResponses.ts index 13956ec864..6ddd590fcb 100644 --- a/src/schemas/responses/TypedResponses.ts +++ b/src/schemas/responses/TypedResponses.ts @@ -18,7 +18,23 @@ import { GeneralConfiguration, LimitsConfiguration } from "../../util/config/types"; import { DmChannelDTO } from "../../util/dtos"; -import { Application, BackupCode, Categories, Channel, Emoji, Guild, Invite, Member, Message, Role, Sticker, StickerPack, Template, Webhook } from "../../util/entities"; +import { + Application, + AutomodRule, + BackupCode, + Categories, + Channel, + Emoji, + Guild, + Invite, + Member, + Message, + Role, + Sticker, + StickerPack, + Template, + Webhook, +} from "../../util/entities"; import { GuildVoiceRegion } from "./GuildVoiceRegionsResponse"; import { GuildBansResponse, GuildCreateResponse, PrivateUser, PublicMember, PublicUser } from "@spacebar/schemas"; @@ -53,6 +69,7 @@ export type APIInviteArray = Invite[]; export type APIMessageArray = Message[]; +export type APIWebhook = Webhook; export type APIWebhookArray = Webhook[]; export type APIDiscoveryCategoryArray = Categories[]; @@ -88,3 +105,18 @@ export type APIConnectionsConfiguration = Record< enabled: boolean; } >; + +export interface WhoAmIResponse { + id: string; + device_id: string | null; + flags: number; + rights: number; + logged_in_since: string; +} + +export interface ConfigObjectResponse { + [key: string]: unknown; +} + +export type APIAutomodRule = AutomodRule; +export type APIAutomodRuleArray = AutomodRule[]; diff --git a/src/schemas/uncategorised/AckBulkSchema.ts b/src/schemas/uncategorised/AckBulkSchema.ts index d5f160af40..42fdb179c8 100644 --- a/src/schemas/uncategorised/AckBulkSchema.ts +++ b/src/schemas/uncategorised/AckBulkSchema.ts @@ -1,25 +1,31 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface AckBulkSchema { - read_states: { - channel_id: string; - message_id: string; - read_state_type: number; // WHat is this? - }[]; -} +import { z } from "zod"; + +export const AckBulkSchema = z.object({ + read_states: z.array( + z.object({ + channel_id: z.string(), + message_id: z.string(), + read_state_type: z.number().optional(), + }), + ), +}); + +export type AckBulkSchema = z.infer; diff --git a/src/schemas/uncategorised/ActivitySchema.ts b/src/schemas/uncategorised/ActivitySchema.ts index e54948fcaf..40ef7f409a 100644 --- a/src/schemas/uncategorised/ActivitySchema.ts +++ b/src/schemas/uncategorised/ActivitySchema.ts @@ -1,80 +1,99 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { Activity, Status } from "@spacebar/util"; +import { z } from "zod"; +import { Status } from "@spacebar/util"; -export const ActivitySchema = { - $afk: Boolean, - status: String, - $activities: [ - { - name: String, - type: Number, - $url: String, - $created_at: Date, - $timestamps: { - $start: Number, - $end: Number, - }, - $application_id: String, - $details: String, - $state: String, - $emoji: { - $name: String, - $id: String, - $animated: Boolean, - }, - $party: { - $id: String, - $size: [Number, Number], - }, - $assets: { - $large_image: String, - $large_text: String, - $small_image: String, - $small_text: String, - }, - $secrets: { - $join: String, - $spectate: String, - $match: String, - }, - $instance: Boolean, - $flags: String, +const BaseActivitySchema = z.object({ + name: z.string(), + type: z.number(), + url: z.string().nullish(), + created_at: z.number().optional(), + timestamps: z + .object({ + start: z.number().optional(), + end: z.number().optional(), + }) + .optional(), + application_id: z.string().optional(), + details: z.string().nullish(), + state: z.string().nullish(), + emoji: z + .object({ + name: z.string().optional(), + id: z.string().optional(), + animated: z.boolean().optional(), + }) + .nullish(), + party: z + .object({ + id: z.string().optional(), + size: z.array(z.number()).length(2).optional(), + }) + .optional(), + assets: z + .object({ + large_image: z.string().optional(), + large_text: z.string().optional(), + small_image: z.string().optional(), + small_text: z.string().optional(), + }) + .optional(), + secrets: z + .object({ + join: z.string().optional(), + spectate: z.string().optional(), + match: z.string().optional(), + }) + .optional(), + instance: z.boolean().optional(), + id: z.string().optional(), + sync_id: z.string().optional(), + metadata: z + .object({ + context_uri: z.string().optional(), + album_id: z.string().optional(), + artist_ids: z.array(z.string()).optional(), + }) + .optional(), + session_id: z.string().nullish(), +}); - // Spotify and other rich presence data - $id: String, - $sync_id: String, - $metadata: { - // spotify - $context_uri: String, - album_id: String, - artist_ids: [String], - }, - $session_id: String, - }, - ], - $since: Number, // unix time (in milliseconds) of when the client went idle, or null if the client is not idle -}; +const OldActivitySchema = BaseActivitySchema.extend({ + flags: z.string().optional(), +}).passthrough(); -export interface ActivitySchema { - afk?: boolean; - status: Status; - activities?: Activity[]; - since?: number; // unix time (in milliseconds) of when the client went idle, or null if the client is not idle -} +const NewActivitySchema = BaseActivitySchema.extend({ + flags: z.number().optional(), + platform: z.string().optional(), + supported_platforms: z.array(z.string()).optional(), + parent_application_id: z.string().optional(), + status_display_type: z.number().nullish(), + details_url: z.string().nullish(), + state_url: z.string().nullish(), + buttons: z.array(z.string()).max(2).optional(), +}).passthrough(); + +export const ActivitySchema = z.object({ + afk: z.boolean().optional(), + status: z.string(), + activities: z.array(z.union([OldActivitySchema, NewActivitySchema])).optional(), + since: z.number().nullish(), +}); + +export type ActivitySchema = z.infer; diff --git a/src/schemas/uncategorised/ApplicationAuthorizeSchema.ts b/src/schemas/uncategorised/ApplicationAuthorizeSchema.ts index 5fd1afdd1a..4d7ffb3f4c 100644 --- a/src/schemas/uncategorised/ApplicationAuthorizeSchema.ts +++ b/src/schemas/uncategorised/ApplicationAuthorizeSchema.ts @@ -1,29 +1,29 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface ApplicationAuthorizeSchema { - authorize: boolean; - guild_id: string; - permissions: string; - captcha_key?: string; - /** - * @minLength 6 - * @maxLength 6 - */ - code?: string; // 2fa code -} +import { z } from "zod"; + +export const ApplicationAuthorizeSchema = z.object({ + authorize: z.boolean(), + guild_id: z.string(), + permissions: z.string(), + captcha_key: z.string().optional(), + code: z.string().min(6).max(6).optional(), +}); + +export type ApplicationAuthorizeSchema = z.infer; diff --git a/src/schemas/uncategorised/AutomodRuleSchema.ts b/src/schemas/uncategorised/AutomodRuleSchema.ts index 55625bf2ee..12b3058cd4 100644 --- a/src/schemas/uncategorised/AutomodRuleSchema.ts +++ b/src/schemas/uncategorised/AutomodRuleSchema.ts @@ -1,53 +1,55 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2024 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2024 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface AutomodMentionSpamRuleSchema { - mention_total_limit: number; - mention_raid_protection_enabled: boolean; -} - -// export interface AutomodSuspectedSpamRuleSchema {} -export type AutomodSuspectedSpamRuleSchema = Record; // hack to represent an empty object - -export interface AutomodCommonlyFlaggedWordsRuleSchema { - allow_list: [string]; - presets: [number]; -} - -export interface AutomodCustomWordsRuleSchema { - allow_list: [string]; - keyword_filter: [string]; - regex_patterns: [string]; -} - -export interface AutomodRuleSchema { - creator_id: string; - enabled: boolean; - event_type: number; // No idea... - exempt_channels: [string]; - exempt_roles: [string]; - guild_id: string; - name: string; - position: number; - trigger_type: number; //AutomodTriggerTypes - trigger_metadata: AutomodMentionSpamRuleSchema | AutomodSuspectedSpamRuleSchema | AutomodCommonlyFlaggedWordsRuleSchema | AutomodCustomWordsRuleSchema; -} - -export interface AutomodRuleSchemaWithId extends AutomodRuleSchema { - id: string; -} +import { z } from "zod"; + +const AutomodMentionSpamRuleSchema = z.object({ + mention_total_limit: z.number(), + mention_raid_protection_enabled: z.boolean(), +}); + +const AutomodSuspectedSpamRuleSchema = z.object({}); + +const AutomodCommonlyFlaggedWordsRuleSchema = z.object({ + allow_list: z.array(z.string()), + presets: z.array(z.number()), +}); + +const AutomodCustomWordsRuleSchema = z.object({ + allow_list: z.array(z.string()), + keyword_filter: z.array(z.string()), + regex_patterns: z.array(z.string()), +}); + +export const AutomodRuleSchema = z.object({ + creator_id: z.string(), + enabled: z.boolean(), + event_type: z.number(), + exempt_channels: z.array(z.string()), + exempt_roles: z.array(z.string()), + guild_id: z.string(), + name: z.string(), + position: z.number(), + trigger_type: z.number(), + trigger_metadata: z.union([AutomodMentionSpamRuleSchema, AutomodSuspectedSpamRuleSchema, AutomodCommonlyFlaggedWordsRuleSchema, AutomodCustomWordsRuleSchema]), +}); + +export const AutomodRuleSchemaWithId = AutomodRuleSchema.extend({ id: z.string() }); + +export type AutomodRuleSchema = z.infer; +export type AutomodRuleSchemaWithId = z.infer; diff --git a/src/schemas/uncategorised/BackupCodesChallengeSchema.ts b/src/schemas/uncategorised/BackupCodesChallengeSchema.ts index 4e23f32cb8..eb2b684f29 100644 --- a/src/schemas/uncategorised/BackupCodesChallengeSchema.ts +++ b/src/schemas/uncategorised/BackupCodesChallengeSchema.ts @@ -16,10 +16,10 @@ along with this program. If not, see . */ -export interface BackupCodesChallengeSchema { - /** - * @minLength 1 - * @maxLength 72 - */ - password: string; -} +import { z } from "zod"; + +export const BackupCodesChallengeSchema = z.object({ + password: z.string(), +}); + +export type BackupCodesChallengeSchema = z.infer; diff --git a/src/schemas/uncategorised/BanCreateSchema.ts b/src/schemas/uncategorised/BanCreateSchema.ts index e022173960..a1b5500c1f 100644 --- a/src/schemas/uncategorised/BanCreateSchema.ts +++ b/src/schemas/uncategorised/BanCreateSchema.ts @@ -1,23 +1,27 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface BanCreateSchema { - delete_message_seconds?: number; - delete_message_days?: number; - reason?: string; -} +import { z } from "zod"; + +export const BanCreateSchema = z.object({ + reason: z.string().optional(), + delete_message_days: z.number().optional(), + delete_message_seconds: z.number().optional(), +}); + +export type BanCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/BanModeratorSchema.ts b/src/schemas/uncategorised/BanModeratorSchema.ts index 5c423994f9..ca54f41bac 100644 --- a/src/schemas/uncategorised/BanModeratorSchema.ts +++ b/src/schemas/uncategorised/BanModeratorSchema.ts @@ -1,25 +1,29 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface BanModeratorSchema { - id: string; - user_id: string; - guild_id: string; - executor_id: string; - reason?: string | undefined; -} +import { z } from "zod"; + +export const BanModeratorSchema = z.object({ + id: z.string(), + user_id: z.string(), + guild_id: z.string(), + executor_id: z.string(), + reason: z.string().optional(), +}); + +export type BanModeratorSchema = z.infer; diff --git a/src/schemas/uncategorised/BanRegistrySchema.ts b/src/schemas/uncategorised/BanRegistrySchema.ts index a94bd50d10..48a0b6d12f 100644 --- a/src/schemas/uncategorised/BanRegistrySchema.ts +++ b/src/schemas/uncategorised/BanRegistrySchema.ts @@ -1,26 +1,30 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface BanRegistrySchema { - id: string; - user_id: string; - guild_id: string; - executor_id: string; - ip?: string; - reason?: string | undefined; -} +import { z } from "zod"; + +export const BanRegistrySchema = z.object({ + id: z.string(), + user_id: z.string(), + guild_id: z.string(), + executor_id: z.string(), + ip: z.ipv4().or(z.ipv6()).optional(), + reason: z.string().optional(), +}); + +export type BanRegistrySchema = z.infer; diff --git a/src/schemas/uncategorised/BotModifySchema.ts b/src/schemas/uncategorised/BotModifySchema.ts index d1bbab8e6c..9f5efc8c78 100644 --- a/src/schemas/uncategorised/BotModifySchema.ts +++ b/src/schemas/uncategorised/BotModifySchema.ts @@ -1,23 +1,27 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface BotModifySchema { - avatar?: string; - username?: string; - banner?: string; -} +import { z } from "zod"; + +export const BotModifySchema = z.object({ + avatar: z.string().optional(), + username: z.string().optional(), + banner: z.string().optional(), +}); + +export type BotModifySchema = z.infer; diff --git a/src/schemas/uncategorised/BulkBanSchema.ts b/src/schemas/uncategorised/BulkBanSchema.ts index 11bb5dd2ba..3686cdd36f 100644 --- a/src/schemas/uncategorised/BulkBanSchema.ts +++ b/src/schemas/uncategorised/BulkBanSchema.ts @@ -16,7 +16,11 @@ along with this program. If not, see . */ -export interface BulkBanSchema { - user_ids: string[]; - delete_message_seconds?: number; -} +import { z } from "zod"; + +export const BulkBanSchema = z.object({ + user_ids: z.array(z.string()), + delete_message_seconds: z.number().optional(), +}); + +export type BulkBanSchema = z.infer; diff --git a/src/schemas/uncategorised/BulkDeleteSchema.ts b/src/schemas/uncategorised/BulkDeleteSchema.ts index 2d024c30f1..c26b6cc54d 100644 --- a/src/schemas/uncategorised/BulkDeleteSchema.ts +++ b/src/schemas/uncategorised/BulkDeleteSchema.ts @@ -1,21 +1,25 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface BulkDeleteSchema { - messages: string[]; -} +import { z } from "zod"; + +export const BulkDeleteSchema = z.object({ + messages: z.array(z.string()), +}); + +export type BulkDeleteSchema = z.infer; diff --git a/src/schemas/uncategorised/ChannelCreateSchema.ts b/src/schemas/uncategorised/ChannelCreateSchema.ts index c43167511e..6c5e54ba5c 100644 --- a/src/schemas/uncategorised/ChannelCreateSchema.ts +++ b/src/schemas/uncategorised/ChannelCreateSchema.ts @@ -16,6 +16,9 @@ along with this program. If not, see . */ +import { z } from "zod"; import { ChannelModifySchema } from "./ChannelModifySchema"; -export type ChannelCreateSchema = Omit; +export const ChannelCreateSchema = ChannelModifySchema.omit({ available_tags: true }); + +export type ChannelCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/ChannelModifySchema.ts b/src/schemas/uncategorised/ChannelModifySchema.ts index 093da8e645..5085107366 100644 --- a/src/schemas/uncategorised/ChannelModifySchema.ts +++ b/src/schemas/uncategorised/ChannelModifySchema.ts @@ -1,51 +1,65 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { ChannelPermissionOverwriteType, ChannelType, TagCreateSchema } from "@spacebar/schemas"; - -export interface ChannelModifySchema { - name?: string; - type?: ChannelType; - topic?: string; - icon?: string | null; - bitrate?: number; - user_limit?: number; - rate_limit_per_user?: number; - position?: number; - invitable?: boolean; - permission_overwrites?: { - id: string; - type: ChannelPermissionOverwriteType; - allow: string; - deny: string; - }[]; - applied_tags?: string[]; - parent_id?: string; - id?: string; // is not used (only for guild create) - nsfw?: boolean; - rtc_region?: string; - default_auto_archive_duration?: number; - default_reaction_emoji?: string | null; - flags?: number; - default_thread_rate_limit_per_user?: number; - video_quality_mode?: number; - auto_archive_duration?: number; - archived?: boolean; - locked?: boolean; - available_tags?: (TagCreateSchema & { id: string })[]; -} +import { z } from "zod"; +import { ChannelType } from "@spacebar/schemas"; + +const PermissionOverwriteSchema = z.object({ + id: z.string(), + type: z.number(), + allow: z.string(), + deny: z.string(), +}); + +const TagCreateBaseSchema = z.object({ + name: z.string(), + moderated: z.boolean().optional(), + emoji_id: z.string().nullish(), + emoji_name: z.string().nullish(), +}); + +export const ChannelModifySchema = z + .object({ + name: z.string(), + type: z.enum(ChannelType), + topic: z.string(), + icon: z.string().nullable(), + bitrate: z.number(), + user_limit: z.number(), + rate_limit_per_user: z.number(), + position: z.number(), + invitable: z.boolean(), + permission_overwrites: z.array(PermissionOverwriteSchema), + applied_tags: z.array(z.string()), + parent_id: z.string(), + id: z.string(), + nsfw: z.boolean(), + rtc_region: z.string(), + default_auto_archive_duration: z.number(), + default_reaction_emoji: z.string().nullable(), + flags: z.number(), + default_thread_rate_limit_per_user: z.number(), + video_quality_mode: z.number(), + auto_archive_duration: z.number(), + archived: z.boolean(), + locked: z.boolean(), + available_tags: z.array(TagCreateBaseSchema.extend({ id: z.string() })), + }) + .partial(); + +export type ChannelModifySchema = z.infer; diff --git a/src/schemas/uncategorised/ChannelPermissionOverwriteSchema.ts b/src/schemas/uncategorised/ChannelPermissionOverwriteSchema.ts index 7382d276af..eac16e62a3 100644 --- a/src/schemas/uncategorised/ChannelPermissionOverwriteSchema.ts +++ b/src/schemas/uncategorised/ChannelPermissionOverwriteSchema.ts @@ -1,21 +1,28 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -import { ChannelPermissionOverwrite } from "@spacebar/schemas"; +import { z } from "zod"; + +export const ChannelPermissionOverwriteSchema = z.object({ + id: z.string(), + type: z.number(), + allow: z.string(), + deny: z.string(), +}); -export type ChannelPermissionOverwriteSchema = ChannelPermissionOverwrite; +export type ChannelPermissionOverwriteSchema = z.infer; diff --git a/src/schemas/uncategorised/ChannelReorderSchema.ts b/src/schemas/uncategorised/ChannelReorderSchema.ts index 7d6a7d2706..29e443d5e5 100644 --- a/src/schemas/uncategorised/ChannelReorderSchema.ts +++ b/src/schemas/uncategorised/ChannelReorderSchema.ts @@ -1,24 +1,30 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export type ChannelReorderSchema = { - id: string; - position?: number; - lock_permissions?: boolean; - parent_id?: null | string; -}[]; +import { z } from "zod"; + +export const ChannelReorderSchema = z.array( + z.object({ + id: z.string(), + position: z.number().optional(), + lock_permissions: z.boolean().optional(), + parent_id: z.string().nullish(), + }), +); + +export type ChannelReorderSchema = z.infer; diff --git a/src/schemas/uncategorised/CodesVerificationSchema.ts b/src/schemas/uncategorised/CodesVerificationSchema.ts index 5a56fd2016..5192531460 100644 --- a/src/schemas/uncategorised/CodesVerificationSchema.ts +++ b/src/schemas/uncategorised/CodesVerificationSchema.ts @@ -1,23 +1,27 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface CodesVerificationSchema { - key: string; - nonce: string; - regenerate?: boolean; -} +import { z } from "zod"; + +export const CodesVerificationSchema = z.object({ + key: z.string().optional(), + nonce: z.string().optional(), + regenerate: z.boolean().optional(), +}); + +export type CodesVerificationSchema = z.infer; diff --git a/src/schemas/uncategorised/ConnectedAccountSchema.ts b/src/schemas/uncategorised/ConnectedAccountSchema.ts index c1d24d70a6..6d2f8937f9 100644 --- a/src/schemas/uncategorised/ConnectedAccountSchema.ts +++ b/src/schemas/uncategorised/ConnectedAccountSchema.ts @@ -1,36 +1,53 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { ConnectedAccountTokenData } from "../../util/interfaces"; +import { z } from "zod"; + +export const ConnectedAccountSchema = z + .object({ + external_id: z.string(), + user_id: z.string(), + token_data: z.any(), + friend_sync: z.boolean(), + name: z.string(), + revoked: z.boolean(), + show_activity: z.number(), + type: z.string(), + verified: z.boolean(), + visibility: z.number(), + integrations: z.array(z.string()), + metadata_: z.any(), + metadata_visibility: z.number(), + two_way_link: z.boolean(), + access_token: z.string(), + }) + .partial({ + token_data: true, + friend_sync: true, + revoked: true, + show_activity: true, + verified: true, + visibility: true, + integrations: true, + metadata_: true, + metadata_visibility: true, + two_way_link: true, + access_token: true, + }); -export interface ConnectedAccountSchema { - external_id: string; - user_id: string; - token_data?: ConnectedAccountTokenData; - friend_sync?: boolean; - name: string; - revoked?: boolean; - show_activity?: number; - type: string; - verified?: boolean; - visibility?: number; - integrations?: string[]; - metadata_?: unknown; - metadata_visibility?: number; - two_way_link?: boolean; -} +export type ConnectedAccountSchema = z.infer; diff --git a/src/schemas/uncategorised/ConnectionCallbackSchema.ts b/src/schemas/uncategorised/ConnectionCallbackSchema.ts index 8e5aeee424..ce6b19c1be 100644 --- a/src/schemas/uncategorised/ConnectionCallbackSchema.ts +++ b/src/schemas/uncategorised/ConnectionCallbackSchema.ts @@ -1,25 +1,34 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface ConnectionCallbackSchema { - code?: string; - state: string; - insecure: boolean; - friend_sync: boolean; - openid_params?: unknown; // TODO: types -} +import { z } from "zod"; + +export const ConnectionCallbackSchema = z + .object({ + code: z.string(), + state: z.string(), + insecure: z.boolean(), + friend_sync: z.boolean(), + openid_params: z.record(z.string(), z.any()), + }) + .partial({ + code: true, + openid_params: true, + }); + +export type ConnectionCallbackSchema = z.infer; diff --git a/src/schemas/uncategorised/ConnectionUpdateSchema.ts b/src/schemas/uncategorised/ConnectionUpdateSchema.ts index 06d15215bb..3fedf800cd 100644 --- a/src/schemas/uncategorised/ConnectionUpdateSchema.ts +++ b/src/schemas/uncategorised/ConnectionUpdateSchema.ts @@ -1,23 +1,27 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface ConnectionUpdateSchema { - visibility?: boolean; - show_activity?: boolean; - metadata_visibility?: boolean; -} +import { z } from "zod"; + +export const ConnectionUpdateSchema = z.object({ + visibility: z.boolean().optional(), + show_activity: z.boolean().optional(), + metadata_visibility: z.boolean().optional(), +}); + +export type ConnectionUpdateSchema = z.infer; diff --git a/src/schemas/uncategorised/DmChannelCreateSchema.ts b/src/schemas/uncategorised/DmChannelCreateSchema.ts index 0dd0c402b2..fb66fc8d07 100644 --- a/src/schemas/uncategorised/DmChannelCreateSchema.ts +++ b/src/schemas/uncategorised/DmChannelCreateSchema.ts @@ -1,24 +1,28 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface DmChannelCreateSchema { - name?: string; - recipients?: string[]; - recipient_id?: string; - access_tokens?: string[]; //Ignored in Spacebar for now, but makes bots happy -} +import { z } from "zod"; + +export const DmChannelCreateSchema = z.object({ + name: z.string().optional(), + recipients: z.array(z.string()).optional(), + recipient_id: z.string().optional(), + access_tokens: z.array(z.string()).optional(), +}); + +export type DmChannelCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/EmailDomainLookupSchema.ts b/src/schemas/uncategorised/EmailDomainLookupSchema.ts index 2e82e4012d..3381d08797 100644 --- a/src/schemas/uncategorised/EmailDomainLookupSchema.ts +++ b/src/schemas/uncategorised/EmailDomainLookupSchema.ts @@ -1,24 +1,28 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface EmailDomainLookupSchema { - allow_multiple_guilds: boolean; - email: string; - use_verification_code: boolean; - guild_id?: string; -} +import { z } from "zod"; + +export const EmailDomainLookupSchema = z.object({ + allow_multiple_guilds: z.boolean(), + email: z.email(), + use_verification_code: z.boolean(), + guild_id: z.string().optional(), +}); + +export type EmailDomainLookupSchema = z.infer; diff --git a/src/schemas/uncategorised/EmailDomainLookupVerifyCodeSchema.ts b/src/schemas/uncategorised/EmailDomainLookupVerifyCodeSchema.ts index d2ec5665d7..067e7b4a30 100644 --- a/src/schemas/uncategorised/EmailDomainLookupVerifyCodeSchema.ts +++ b/src/schemas/uncategorised/EmailDomainLookupVerifyCodeSchema.ts @@ -1,23 +1,27 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface EmailDomainLookupVerifyCodeSchema { - email: string; - guild_id: string; - code: string; -} +import { z } from "zod"; + +export const EmailDomainLookupVerifyCodeSchema = z.object({ + email: z.email(), + guild_id: z.string(), + code: z.string(), +}); + +export type EmailDomainLookupVerifyCodeSchema = z.infer; diff --git a/src/schemas/uncategorised/EmojiCreateSchema.ts b/src/schemas/uncategorised/EmojiCreateSchema.ts index dac447b50c..e3cced8fab 100644 --- a/src/schemas/uncategorised/EmojiCreateSchema.ts +++ b/src/schemas/uncategorised/EmojiCreateSchema.ts @@ -1,24 +1,28 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface EmojiCreateSchema { - name?: string; - image: string; - require_colons?: boolean | null; - roles?: string[]; -} +import { z } from "zod"; + +export const EmojiCreateSchema = z.object({ + name: z.string().optional(), + image: z.string(), + require_colons: z.boolean().nullish(), + roles: z.array(z.string()).optional(), +}); + +export type EmojiCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/EmojiModifySchema.ts b/src/schemas/uncategorised/EmojiModifySchema.ts index f4efcce374..19b52ef324 100644 --- a/src/schemas/uncategorised/EmojiModifySchema.ts +++ b/src/schemas/uncategorised/EmojiModifySchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface EmojiModifySchema { - name?: string; - roles?: string[]; -} +import { z } from "zod"; + +export const EmojiModifySchema = z.object({ + name: z.string().optional(), + roles: z.array(z.string()).optional(), +}); + +export type EmojiModifySchema = z.infer; diff --git a/src/schemas/uncategorised/ForgotPasswordSchema.ts b/src/schemas/uncategorised/ForgotPasswordSchema.ts index ba8eebbead..7ac3351fe2 100644 --- a/src/schemas/uncategorised/ForgotPasswordSchema.ts +++ b/src/schemas/uncategorised/ForgotPasswordSchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface ForgotPasswordSchema { - login: string; - captcha_key?: string; -} +import { z } from "zod"; + +export const ForgotPasswordSchema = z.object({ + login: z.string(), + captcha_key: z.string().optional(), +}); + +export type ForgotPasswordSchema = z.infer; diff --git a/src/schemas/uncategorised/GreetRequestSchema.ts b/src/schemas/uncategorised/GreetRequestSchema.ts index 03a77bd2e4..3448fafe71 100644 --- a/src/schemas/uncategorised/GreetRequestSchema.ts +++ b/src/schemas/uncategorised/GreetRequestSchema.ts @@ -1,30 +1,41 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -import { AllowedMentions } from "@spacebar/schemas"; +import { z } from "zod"; + +export const GreetRequestSchema = z.object({ + sticker_ids: z.array(z.string()), + allowed_mentions: z + .object({ + parse: z.array(z.string()).optional(), + roles: z.array(z.string()).optional(), + users: z.array(z.string()).optional(), + replied_user: z.boolean().optional(), + }) + .optional(), + message_reference: z + .object({ + message_id: z.string(), + channel_id: z.string().optional(), + guild_id: z.string().optional(), + fail_if_not_exists: z.boolean().optional(), + }) + .optional(), +}); -export interface GreetRequestSchema { - sticker_ids: string[]; - allowed_mentions?: AllowedMentions; - message_reference?: { - message_id: string; - channel_id?: string; - guild_id?: string; - fail_if_not_exists?: boolean; - }; -} +export type GreetRequestSchema = z.infer; diff --git a/src/schemas/uncategorised/GuildCreateSchema.ts b/src/schemas/uncategorised/GuildCreateSchema.ts index 1f71bce38d..ca8f597c67 100644 --- a/src/schemas/uncategorised/GuildCreateSchema.ts +++ b/src/schemas/uncategorised/GuildCreateSchema.ts @@ -16,18 +16,20 @@ along with this program. If not, see . */ -import { ChannelCreateSchema } from "@spacebar/schemas"; +import { z } from "zod"; +import { ChannelCreateSchema } from "./ChannelCreateSchema"; -export interface GuildCreateSchema { - /** - * @maxLength 100 - */ - name?: string; - region?: string; - icon?: string | null; - channels?: ChannelCreateSchema[]; - system_channel_id?: string; - rules_channel_id?: string; - guild_template_code?: string; - staff_only?: boolean; -} +export const GuildCreateSchema = z + .object({ + name: z.string().max(100), + region: z.string(), + icon: z.string().nullable(), + channels: z.array(ChannelCreateSchema), + system_channel_id: z.string(), + rules_channel_id: z.string(), + guild_template_code: z.string(), + staff_only: z.boolean(), + }) + .partial(); + +export type GuildCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/GuildSubscriptionsBulkSchema.ts b/src/schemas/uncategorised/GuildSubscriptionsBulkSchema.ts index 32be9dd0a1..6ec6a96d45 100644 --- a/src/schemas/uncategorised/GuildSubscriptionsBulkSchema.ts +++ b/src/schemas/uncategorised/GuildSubscriptionsBulkSchema.ts @@ -1,11 +1,10 @@ +import { z } from "zod"; import { LazyRequestSchema } from "../gateway/LazyRequestSchema"; -export interface GuildSubscriptionsBulkSchema { - subscriptions: { [key: string]: GuildSubscriptionSchema }; -} +export const GuildSubscriptionSchema = LazyRequestSchema.omit({ guild_id: true }); +export type GuildSubscriptionSchema = z.infer; -export type GuildSubscriptionSchema = Omit; - -export const GuildSubscriptionsBulkSchema = { - $subscriptions: Object, -}; +export const GuildSubscriptionsBulkSchema = z.object({ + subscriptions: z.record(z.string(), GuildSubscriptionSchema), +}); +export type GuildSubscriptionsBulkSchema = z.infer; diff --git a/src/schemas/uncategorised/GuildTemplateCreateSchema.ts b/src/schemas/uncategorised/GuildTemplateCreateSchema.ts index 31035b7841..2ffd9ef125 100644 --- a/src/schemas/uncategorised/GuildTemplateCreateSchema.ts +++ b/src/schemas/uncategorised/GuildTemplateCreateSchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface GuildTemplateCreateSchema { - name: string; - icon?: string | null; -} +import { z } from "zod"; + +export const GuildTemplateCreateSchema = z.object({ + name: z.string(), + icon: z.string().nullish(), +}); + +export type GuildTemplateCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/GuildUpdateSchema.ts b/src/schemas/uncategorised/GuildUpdateSchema.ts index c34c774ec1..c00802553e 100644 --- a/src/schemas/uncategorised/GuildUpdateSchema.ts +++ b/src/schemas/uncategorised/GuildUpdateSchema.ts @@ -1,37 +1,40 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { GuildCreateSchema } from "@spacebar/schemas"; +import { z } from "zod"; +import { GuildCreateSchema } from "./GuildCreateSchema"; -export interface GuildUpdateSchema extends Omit { - banner?: string | null; - splash?: string | null; - description?: string; - features?: string[]; - verification_level?: number; - default_message_notifications?: number; - system_channel_flags?: number; - explicit_content_filter?: number; - public_updates_channel_id?: string; - afk_timeout?: number; - afk_channel_id?: string; - preferred_locale?: string; - premium_progress_bar_enabled?: boolean; - discovery_splash?: string; - safety_alerts_channel_id?: string | null; -} +export const GuildUpdateSchema = GuildCreateSchema.omit({ channels: true }).extend({ + banner: z.string().nullish(), + splash: z.string().nullish(), + description: z.string().optional(), + features: z.array(z.string()).optional(), + verification_level: z.number().optional(), + default_message_notifications: z.number().optional(), + system_channel_flags: z.number().optional(), + explicit_content_filter: z.number().optional(), + public_updates_channel_id: z.string().optional(), + afk_timeout: z.number().optional(), + afk_channel_id: z.string().optional(), + preferred_locale: z.string().optional(), + premium_progress_bar_enabled: z.boolean().optional(), + discovery_splash: z.string().optional(), + safety_alerts_channel_id: z.string().nullish(), +}); + +export type GuildUpdateSchema = z.infer; diff --git a/src/schemas/uncategorised/GuildUpdateWelcomeScreenSchema.ts b/src/schemas/uncategorised/GuildUpdateWelcomeScreenSchema.ts index 4c74f01ca6..42ed796615 100644 --- a/src/schemas/uncategorised/GuildUpdateWelcomeScreenSchema.ts +++ b/src/schemas/uncategorised/GuildUpdateWelcomeScreenSchema.ts @@ -1,28 +1,36 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface GuildUpdateWelcomeScreenSchema { - welcome_channels?: { - channel_id: string; - description: string; - emoji_id?: string; - emoji_name?: string; - }[]; - enabled?: boolean; - description?: string; -} +import { z } from "zod"; + +export const GuildUpdateWelcomeScreenSchema = z.object({ + description: z.string().nullish(), + welcome_channels: z + .array( + z.object({ + channel_id: z.string(), + description: z.string(), + emoji_id: z.string().optional(), + emoji_name: z.string().optional(), + }), + ) + .optional(), + enabled: z.boolean().optional(), +}); + +export type GuildUpdateWelcomeScreenSchema = z.infer; diff --git a/src/schemas/uncategorised/HubWaitlistSignupSchema.ts b/src/schemas/uncategorised/HubWaitlistSignupSchema.ts index 5f7d7def6c..a883808348 100644 --- a/src/schemas/uncategorised/HubWaitlistSignupSchema.ts +++ b/src/schemas/uncategorised/HubWaitlistSignupSchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface HubWaitlistSignupSchema { - email: string; - school: string; -} +import { z } from "zod"; + +export const HubWaitlistSignupSchema = z.object({ + email: z.email(), + school: z.string(), +}); + +export type HubWaitlistSignupSchema = z.infer; diff --git a/src/schemas/uncategorised/InviteCreateSchema.ts b/src/schemas/uncategorised/InviteCreateSchema.ts index 1cc5e6a491..7c1a393406 100644 --- a/src/schemas/uncategorised/InviteCreateSchema.ts +++ b/src/schemas/uncategorised/InviteCreateSchema.ts @@ -1,30 +1,31 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface InviteCreateSchema { - target_user_id?: string; - target_type?: string; - validate?: string; // ? what is this - max_age?: number; - max_uses?: number; - temporary?: boolean; - unique?: boolean; - target_user?: string; - target_user_type?: number; - flags?: number; -} +import { z } from "zod"; + +export const InviteCreateSchema = z.object({ + target_user_id: z.string().optional(), + target_type: z.number().optional(), + max_age: z.number().optional(), + max_uses: z.number().optional(), + temporary: z.boolean().optional(), + unique: z.boolean().optional(), + flags: z.number().optional(), +}); + +export type InviteCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/LoginSchema.ts b/src/schemas/uncategorised/LoginSchema.ts index 006d20dfb5..2d1a969a93 100644 --- a/src/schemas/uncategorised/LoginSchema.ts +++ b/src/schemas/uncategorised/LoginSchema.ts @@ -16,15 +16,15 @@ along with this program. If not, see . */ -export interface LoginSchema { - login: string; - /** - * @minLength 1 - * @maxLength 72 - */ - password: string; - undelete?: boolean; - captcha_key?: string; - login_source?: string; - gift_code_sku_id?: string; -} +import { z } from "zod"; + +export const LoginSchema = z.object({ + login: z.string(), + password: z.string().min(1).max(72), + undelete: z.boolean().optional(), + captcha_key: z.string().optional(), + login_source: z.string().optional(), + gift_code_sku_id: z.string().optional(), +}); + +export type LoginSchema = z.infer; diff --git a/src/schemas/uncategorised/MemberChangeProfileSchema.ts b/src/schemas/uncategorised/MemberChangeProfileSchema.ts index fc690bc7a7..32603738bf 100644 --- a/src/schemas/uncategorised/MemberChangeProfileSchema.ts +++ b/src/schemas/uncategorised/MemberChangeProfileSchema.ts @@ -1,28 +1,29 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface MemberChangeProfileSchema { - banner?: string | null; - nick?: string; - bio?: string; - pronouns?: string; - /** - * @items.type integer - */ - theme_colors?: [number, number]; -} +import { z } from "zod"; + +export const MemberChangeProfileSchema = z.object({ + nick: z.string().nullish(), + bio: z.string().optional(), + banner: z.string().nullish(), + pronouns: z.string().optional(), + theme_colors: z.array(z.number()).nullish(), +}); + +export type MemberChangeProfileSchema = z.infer; diff --git a/src/schemas/uncategorised/MemberChangeSchema.ts b/src/schemas/uncategorised/MemberChangeSchema.ts index 2318a5e019..f42c8fb955 100644 --- a/src/schemas/uncategorised/MemberChangeSchema.ts +++ b/src/schemas/uncategorised/MemberChangeSchema.ts @@ -1,25 +1,29 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface MemberChangeSchema { - roles?: string[]; - nick?: string; - avatar?: string | null; - bio?: string; - communication_disabled_until?: string | null; -} +import { z } from "zod"; + +export const MemberChangeSchema = z.object({ + roles: z.array(z.string()).optional(), + nick: z.string().nullish(), + avatar: z.string().nullish(), + communication_disabled_until: z.string().nullish(), + flags: z.number().optional(), +}); + +export type MemberChangeSchema = z.infer; diff --git a/src/schemas/uncategorised/MemberNickChangeSchema.ts b/src/schemas/uncategorised/MemberNickChangeSchema.ts index 50273a3314..625d6d7655 100644 --- a/src/schemas/uncategorised/MemberNickChangeSchema.ts +++ b/src/schemas/uncategorised/MemberNickChangeSchema.ts @@ -1,21 +1,25 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface MemberNickChangeSchema { - nick: string; -} +import { z } from "zod"; + +export const MemberNickChangeSchema = z.object({ + nick: z.string(), +}); + +export type MemberNickChangeSchema = z.infer; diff --git a/src/schemas/uncategorised/MessageAcknowledgeSchema.ts b/src/schemas/uncategorised/MessageAcknowledgeSchema.ts index dd6e64b02f..1a560fefbb 100644 --- a/src/schemas/uncategorised/MessageAcknowledgeSchema.ts +++ b/src/schemas/uncategorised/MessageAcknowledgeSchema.ts @@ -1,45 +1,48 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface MessageAcknowledgeSchema { - manual?: boolean; - mention_count?: number; - flags?: ReadStateFlags | 0; - last_viewed?: number; - token?: string; -} +import { z } from "zod"; -export interface AcknowledgeDeleteSchema { - read_state_type?: ReadStateType; - version?: number; -} +export const MessageAcknowledgeSchema = z.object({ + token: z.string().optional(), + manual: z.boolean().optional(), + mention_count: z.number().optional(), + flags: z.number().optional(), + last_viewed: z.number().optional(), +}); + +export type MessageAcknowledgeSchema = z.infer; export enum ReadStateType { CHANNEL = 0, GUILD_EVENT = 1, NOTIFICATION_CENTER = 2, - GUILD_HOME = 3, - GUILD_ONBOARDING_QUESTION = 4, - MESSAGE_REQUESTS = 5, + GUILD_ONBOARDING_QUESTION = 3, } export enum ReadStateFlags { IS_GUILD_CHANNEL = 1 << 0, IS_THREAD = 1 << 1, - IS_MENTION_LOW_IMPORTANCE = 1 << 2, } + +export const AcknowledgeDeleteSchema = z.object({ + read_state_type: z.enum(ReadStateType).optional(), + version: z.number().optional(), +}); + +export type AcknowledgeDeleteSchema = z.infer; diff --git a/src/schemas/uncategorised/MessageCreateSchema.ts b/src/schemas/uncategorised/MessageCreateSchema.ts index a1d43d1b39..34a16ada02 100644 --- a/src/schemas/uncategorised/MessageCreateSchema.ts +++ b/src/schemas/uncategorised/MessageCreateSchema.ts @@ -1,100 +1,91 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { InteractionType, Snowflake } from "@spacebar/util"; -import { ActionRowComponent, ApplicationCommandType, Embed, PollAnswer, PollMedia, PublicUser } from "@spacebar/schemas"; +import { z } from "zod"; -export type MessageCreateAttachment = { - id: string; - filename: string; -}; +export const MessageCreateAttachment = z.object({ + id: z.string(), + filename: z.string(), +}); -export type MessageCreateCloudAttachment = { - id?: string; - filename: string; - uploaded_filename: string; - original_content_type?: string; -}; +export const MessageCreateCloudAttachment = z.object({ + id: z.string().optional(), + filename: z.string(), + uploaded_filename: z.string(), + original_content_type: z.string().optional(), +}); -export interface MessageCreateSchema { - type?: number; - content?: string; - mobile_network_type?: string; - nonce?: string; - channel_id?: string; - tts?: boolean; - flags?: number; - embeds?: Embed[] | null; - embed?: Embed | null; - // TODO: ^ embed is deprecated in favor of embeds (https://discord.com/developers/docs/resources/channel#message-object) - allowed_mentions?: { - parse?: string[]; - roles?: string[]; - users?: string[]; - replied_user?: boolean; - }; - message_reference?: { - message_id?: string; - channel_id?: string; - guild_id?: string; - fail_if_not_exists?: boolean; - type?: number; - }; - payload_json?: string; - file?: { filename: string }; - /** - TODO: we should create an interface for attachments - TODO: OpenWAAO<-->attachment-style metadata conversion - **/ - attachments?: (MessageCreateAttachment | MessageCreateCloudAttachment)[]; - sticker_ids?: string[] | null; // null check: fixes Discord-Go - components?: ActionRowComponent[] | null; // null check: fixes Discord-Go - // TODO: Fix TypeScript errors in src\api\util\handlers\Message.ts once this is enabled - poll?: PollCreationSchema; - enforce_nonce?: boolean; // For Discord compatibility, it's the default behavior here - applied_tags?: string[]; // Not implemented yet, for webhooks in forums - thread_name?: string; // Not implemented yet, for webhooks - avatar_url?: string; // Not implemented yet, for webhooks - interaction?: MessageInteractionSchema; - interaction_metadata?: MessageInteractionSchema; -} +const AllowedMentionsSchema = z + .object({ + parse: z.array(z.string()), + roles: z.array(z.string()), + users: z.array(z.string()), + replied_user: z.boolean(), + }) + .partial(); -// TypeScript complains once this is used above -export interface PollCreationSchema { - question: PollMedia; - answers: PollAnswer[]; - duration?: number; - allow_multiselect?: boolean; - layout_type?: number; -} +const MessageReferenceSchema = z + .object({ + message_id: z.string(), + channel_id: z.string(), + guild_id: z.string(), + fail_if_not_exists: z.boolean(), + type: z.number(), + }) + .partial(); -interface MessageInteractionSchema { - id: string; - type: InteractionType; - name: string; - command_type?: ApplicationCommandType; - ephemerality_reason?: number; - user?: PublicUser; // It has to be optional cause LSP gives an errors for some reason - user_id?: string; - authorizing_integration_owners?: object; // It has to be optional cause LSP gives an errors for some reason - original_response_message_id?: Snowflake; - interacted_message_id?: Snowflake; - triggering_interaction_metadata?: MessageInteractionSchema; - target_user?: PublicUser; - target_message_id?: Snowflake; -} +export const PollCreationSchema = z.object({ + question: z.object({ text: z.string().optional() }), + answers: z.array(z.object({ poll_media: z.object({ text: z.string().optional(), emoji: z.any().optional() }) })), + duration: z.number().optional(), + allow_multiselect: z.boolean().optional(), + layout_type: z.number().optional(), +}); + +export const MessageCreateSchema = z + .object({ + type: z.number(), + content: z.string(), + mobile_network_type: z.string(), + nonce: z.string(), + channel_id: z.string(), + tts: z.boolean(), + flags: z.number(), + embeds: z.array(z.any()).nullable(), + embed: z.any().nullable(), + allowed_mentions: AllowedMentionsSchema, + message_reference: MessageReferenceSchema, + payload_json: z.string(), + file: z.object({ filename: z.string() }), + attachments: z.array(z.union([MessageCreateAttachment, MessageCreateCloudAttachment])), + sticker_ids: z.array(z.string()).nullable(), + components: z.array(z.any()).nullable(), + poll: PollCreationSchema, + enforce_nonce: z.boolean(), + applied_tags: z.array(z.string()), + thread_name: z.string(), + avatar_url: z.string(), + interaction: z.any(), + interaction_metadata: z.any(), + }) + .partial(); + +export type MessageCreateSchema = z.infer; +export type PollCreationSchema = z.infer; +export type MessageCreateAttachment = z.infer; +export type MessageCreateCloudAttachment = z.infer; diff --git a/src/schemas/uncategorised/MessageEditSchema.ts b/src/schemas/uncategorised/MessageEditSchema.ts index 002e5af9c7..6d0d676c6c 100644 --- a/src/schemas/uncategorised/MessageEditSchema.ts +++ b/src/schemas/uncategorised/MessageEditSchema.ts @@ -1,21 +1,24 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ +import { z } from "zod"; import { MessageCreateSchema } from "./MessageCreateSchema"; -export type MessageEditSchema = Omit; +export const MessageEditSchema = MessageCreateSchema.omit({ type: true }); + +export type MessageEditSchema = z.infer; diff --git a/src/schemas/uncategorised/MessageThreadCreationSchema.ts b/src/schemas/uncategorised/MessageThreadCreationSchema.ts index 2d0044dbe8..e374b3b4e4 100644 --- a/src/schemas/uncategorised/MessageThreadCreationSchema.ts +++ b/src/schemas/uncategorised/MessageThreadCreationSchema.ts @@ -16,10 +16,14 @@ along with this program. If not, see . */ -export interface MessageThreadCreationSchema { - auto_archive_duration?: number; - rate_limit_per_user?: number; - name: string; - location?: string; //ignore it - type?: number; -} +import { z } from "zod"; + +export const MessageThreadCreationSchema = z.object({ + auto_archive_duration: z.number().optional(), + rate_limit_per_user: z.number().optional(), + name: z.string(), + location: z.string().optional(), + type: z.number().optional(), +}); + +export type MessageThreadCreationSchema = z.infer; diff --git a/src/schemas/uncategorised/MfaCodesSchema.ts b/src/schemas/uncategorised/MfaCodesSchema.ts index bd6ceb4556..45a1228f4d 100644 --- a/src/schemas/uncategorised/MfaCodesSchema.ts +++ b/src/schemas/uncategorised/MfaCodesSchema.ts @@ -16,11 +16,11 @@ along with this program. If not, see . */ -export interface MfaCodesSchema { - /** - * @minLength 1 - * @maxLength 72 - */ - password: string; - regenerate?: boolean; -} +import { z } from "zod"; + +export const MfaCodesSchema = z.object({ + password: z.string().min(1).max(72), + regenerate: z.boolean().optional(), +}); + +export type MfaCodesSchema = z.infer; diff --git a/src/schemas/uncategorised/ModifyGuildStickerSchema.ts b/src/schemas/uncategorised/ModifyGuildStickerSchema.ts index 8673265d3e..7897da8318 100644 --- a/src/schemas/uncategorised/ModifyGuildStickerSchema.ts +++ b/src/schemas/uncategorised/ModifyGuildStickerSchema.ts @@ -1,33 +1,27 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface ModifyGuildStickerSchema { - /** - * @minLength 2 - * @maxLength 30 - */ - name: string; - /** - * @maxLength 100 - */ - description?: string; - /** - * @maxLength 200 - */ - tags: string; -} +import { z } from "zod"; + +export const ModifyGuildStickerSchema = z.object({ + name: z.string().min(2).max(30), + description: z.string().max(100).optional(), + tags: z.string().max(200), +}); + +export type ModifyGuildStickerSchema = z.infer; diff --git a/src/schemas/uncategorised/PasswordResetSchema.ts b/src/schemas/uncategorised/PasswordResetSchema.ts index 26e24f9260..56874b3989 100644 --- a/src/schemas/uncategorised/PasswordResetSchema.ts +++ b/src/schemas/uncategorised/PasswordResetSchema.ts @@ -16,11 +16,11 @@ along with this program. If not, see . */ -export interface PasswordResetSchema { - /** - * @minLength 1 - * @maxLength 72 - */ - password: string; - token: string; -} +import { z } from "zod"; + +export const PasswordResetSchema = z.object({ + password: z.string().min(1).max(72), + token: z.string(), +}); + +export type PasswordResetSchema = z.infer; diff --git a/src/schemas/uncategorised/PostDataSchema.ts b/src/schemas/uncategorised/PostDataSchema.ts index b380610d30..4fbd394f21 100644 --- a/src/schemas/uncategorised/PostDataSchema.ts +++ b/src/schemas/uncategorised/PostDataSchema.ts @@ -16,6 +16,10 @@ along with this program. If not, see . */ -export interface PostDataSchema { - thread_ids: string[]; -} +import { z } from "zod"; + +export const PostDataSchema = z.object({ + thread_ids: z.array(z.string()), +}); + +export type PostDataSchema = z.infer; diff --git a/src/schemas/uncategorised/PreloadMessagesRequestSchema.ts b/src/schemas/uncategorised/PreloadMessagesRequestSchema.ts index 5705e7fe5e..06392b747e 100644 --- a/src/schemas/uncategorised/PreloadMessagesRequestSchema.ts +++ b/src/schemas/uncategorised/PreloadMessagesRequestSchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2025 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface PreloadMessagesRequestSchema { - channels?: string[]; - channel_ids?: string[]; -} +import { z } from "zod"; + +export const PreloadMessagesRequestSchema = z.object({ + channels: z.array(z.string()).optional(), + channel_ids: z.array(z.string()).optional(), +}); + +export type PreloadMessagesRequestSchema = z.infer; diff --git a/src/schemas/uncategorised/PruneSchema.ts b/src/schemas/uncategorised/PruneSchema.ts index eaf0e7e3ea..4837ad6b38 100644 --- a/src/schemas/uncategorised/PruneSchema.ts +++ b/src/schemas/uncategorised/PruneSchema.ts @@ -1,24 +1,27 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface PruneSchema { - /** - * @min 0 - */ - days: number; -} +import { z } from "zod"; + +export const PruneSchema = z.object({ + days: z.number().min(0), + compute_prune_count: z.boolean().optional(), + include_roles: z.array(z.string()).optional(), +}); + +export type PruneSchema = z.infer; diff --git a/src/schemas/uncategorised/PurgeSchema.ts b/src/schemas/uncategorised/PurgeSchema.ts index d9a7f68f42..66537b8048 100644 --- a/src/schemas/uncategorised/PurgeSchema.ts +++ b/src/schemas/uncategorised/PurgeSchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface PurgeSchema { - before: string; - after: string; -} +import { z } from "zod"; + +export const PurgeSchema = z.object({ + before: z.string(), + after: z.string(), +}); + +export type PurgeSchema = z.infer; diff --git a/src/schemas/uncategorised/RefreshUrlsRequestSchema.ts b/src/schemas/uncategorised/RefreshUrlsRequestSchema.ts index 6268dd10f4..0f520bb4cb 100644 --- a/src/schemas/uncategorised/RefreshUrlsRequestSchema.ts +++ b/src/schemas/uncategorised/RefreshUrlsRequestSchema.ts @@ -1,21 +1,25 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface RefreshUrlsRequestSchema { - attachment_urls: string[]; -} +import { z } from "zod"; + +export const RefreshUrlsRequestSchema = z.object({ + attachment_urls: z.array(z.string()), +}); + +export type RefreshUrlsRequestSchema = z.infer; diff --git a/src/schemas/uncategorised/RegisterSchema.ts b/src/schemas/uncategorised/RegisterSchema.ts index 28b7bde508..e5f8ce4220 100644 --- a/src/schemas/uncategorised/RegisterSchema.ts +++ b/src/schemas/uncategorised/RegisterSchema.ts @@ -1,48 +1,49 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface RegisterSchema { - /** - * @minLength 2 - */ - username: string; - /** - * @minLength 1 - * @maxLength 72 - */ - password?: string; - consent: boolean; - /** - * @TJS-format email - */ - email?: string; - fingerprint?: string; - invite?: string; - /** - * @TJS-type string - */ - date_of_birth?: Date; // "2000-04-03" - gift_code_sku_id?: string; - captcha_key?: string; +import { z } from "zod"; - promotional_email_opt_in?: boolean; +export const RegisterSchema = z + .object({ + username: z.string().min(2), + password: z.string().min(1).max(72), + consent: z.boolean(), + email: z.email(), + fingerprint: z.string(), + invite: z.string(), + date_of_birth: z.union([z.string(), z.date()]), + gift_code_sku_id: z.string(), + captcha_key: z.string(), + promotional_email_opt_in: z.boolean(), + unique_username_registration: z.boolean(), + global_name: z.string(), + }) + .partial({ + password: true, + email: true, + fingerprint: true, + invite: true, + date_of_birth: true, + gift_code_sku_id: true, + captcha_key: true, + promotional_email_opt_in: true, + unique_username_registration: true, + global_name: true, + }); - // part of pomelo - unique_username_registration?: boolean; - global_name?: string; -} +export type RegisterSchema = z.infer; diff --git a/src/schemas/uncategorised/RelationshipPatchSchema.ts b/src/schemas/uncategorised/RelationshipPatchSchema.ts index 0ff4b7cc2b..d7206a212d 100644 --- a/src/schemas/uncategorised/RelationshipPatchSchema.ts +++ b/src/schemas/uncategorised/RelationshipPatchSchema.ts @@ -16,6 +16,11 @@ along with this program. If not, see . */ -export interface RelationshipPatchSchema { - nickname?: string; -} +import { z } from "zod"; + +export const RelationshipPatchSchema = z.object({ + type: z.number().optional(), + nickname: z.string().nullish(), +}); + +export type RelationshipPatchSchema = z.infer; diff --git a/src/schemas/uncategorised/RelationshipPostSchema.ts b/src/schemas/uncategorised/RelationshipPostSchema.ts index 5f2d9437d8..23fc40c38e 100644 --- a/src/schemas/uncategorised/RelationshipPostSchema.ts +++ b/src/schemas/uncategorised/RelationshipPostSchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface RelationshipPostSchema { - discriminator: string; - username: string; -} +import { z } from "zod"; + +export const RelationshipPostSchema = z.object({ + discriminator: z.number().optional(), + username: z.string(), +}); + +export type RelationshipPostSchema = z.infer; diff --git a/src/schemas/uncategorised/RelationshipPutSchema.ts b/src/schemas/uncategorised/RelationshipPutSchema.ts index 5a5748020e..49bcfb2e63 100644 --- a/src/schemas/uncategorised/RelationshipPutSchema.ts +++ b/src/schemas/uncategorised/RelationshipPutSchema.ts @@ -1,25 +1,30 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface RelationshipPutSchema { - type?: RelationshipType; - confirm_stranger_request?: boolean; -} +import { z } from "zod"; + +export const RelationshipPutSchema = z.object({ + type: z.number().optional(), + confirm_stranger_request: z.boolean().optional(), + nickname: z.string().nullish(), +}); + +export type RelationshipPutSchema = z.infer; export enum RelationshipType { outgoing = 4, diff --git a/src/schemas/uncategorised/RequestGuildMembersSchema.ts b/src/schemas/uncategorised/RequestGuildMembersSchema.ts index 925b090e79..71a0c7d1eb 100644 --- a/src/schemas/uncategorised/RequestGuildMembersSchema.ts +++ b/src/schemas/uncategorised/RequestGuildMembersSchema.ts @@ -1,35 +1,30 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface RequestGuildMembersSchema { - guild_id: string | [string]; - query?: string; - limit?: number; - presences?: boolean; - user_ids?: string | string[]; - nonce?: string; -} +import { z } from "zod"; -export const RequestGuildMembersSchema = { - guild_id: "" as string | string[], - $query: String, - $limit: Number, - $presences: Boolean, - $user_ids: [] as string | string[], - $nonce: String, -}; +export const RequestGuildMembersSchema = z.object({ + guild_id: z.union([z.string(), z.array(z.string())]), + query: z.string().optional(), + limit: z.number().optional(), + presences: z.boolean().optional(), + user_ids: z.union([z.string(), z.array(z.string())]).optional(), + nonce: z.string().optional(), +}); + +export type RequestGuildMembersSchema = z.infer; diff --git a/src/schemas/uncategorised/RoleModifySchema.ts b/src/schemas/uncategorised/RoleModifySchema.ts index cd1e5f3bed..d3656debf4 100644 --- a/src/schemas/uncategorised/RoleModifySchema.ts +++ b/src/schemas/uncategorised/RoleModifySchema.ts @@ -1,35 +1,39 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface RoleModifySchema { - name?: string; - permissions?: string; - color?: number; - hoist?: boolean; // whether the role should be displayed separately in the sidebar - mentionable?: boolean; // whether the role should be mentionable - position?: number; - icon?: string; - unicode_emoji?: string; - colors?: - | { - primary_color: number; - secondary_color?: number | null | undefined; // only used for "holographic" and "gradient" styles - tertiary_color?: number | null | undefined; // only used for "holographic" style - } - | undefined; -} +import { z } from "zod"; + +export const RoleModifySchema = z + .object({ + name: z.string(), + permissions: z.string(), + color: z.number(), + hoist: z.boolean(), + mentionable: z.boolean(), + position: z.number(), + icon: z.string(), + unicode_emoji: z.string(), + colors: z.object({ + primary_color: z.number(), + secondary_color: z.number().nullish(), + tertiary_color: z.number().nullish(), + }), + }) + .partial(); + +export type RoleModifySchema = z.infer; diff --git a/src/schemas/uncategorised/RolePositionUpdateSchema.ts b/src/schemas/uncategorised/RolePositionUpdateSchema.ts index 86526e7b58..ef56ed55e6 100644 --- a/src/schemas/uncategorised/RolePositionUpdateSchema.ts +++ b/src/schemas/uncategorised/RolePositionUpdateSchema.ts @@ -1,22 +1,28 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export type RolePositionUpdateSchema = { - id: string; - position: number; -}[]; +import { z } from "zod"; + +export const RolePositionUpdateSchema = z.array( + z.object({ + id: z.string(), + position: z.number(), + }), +); + +export type RolePositionUpdateSchema = z.infer; diff --git a/src/schemas/uncategorised/SelectProtocolSchema.ts b/src/schemas/uncategorised/SelectProtocolSchema.ts index 02c31b43f3..f46919cc05 100644 --- a/src/schemas/uncategorised/SelectProtocolSchema.ts +++ b/src/schemas/uncategorised/SelectProtocolSchema.ts @@ -1,37 +1,46 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface SelectProtocolSchema { - protocol: "webrtc" | "udp"; - data: - | string - | { - address: string; - port: number; - mode: string; - }; - sdp?: string; - codecs?: { - name: "opus" | "VP8" | "VP9" | "H264"; - type: "audio" | "video"; - priority: number; - payload_type: number; - rtx_payload_type?: number; - }[]; - rtc_connection_id?: string; // uuid -} +import { z } from "zod"; + +export const SelectProtocolSchema = z.object({ + protocol: z.enum(["webrtc", "udp"]), + data: z.union([ + z.string(), + z.object({ + address: z.string(), + port: z.number(), + mode: z.string(), + }), + ]), + sdp: z.string().optional(), + codecs: z + .array( + z.object({ + name: z.enum(["opus", "VP8", "VP9", "H264"]), + type: z.enum(["audio", "video"]), + priority: z.number(), + payload_type: z.number(), + rtx_payload_type: z.number().optional(), + }), + ) + .optional(), + rtc_connection_id: z.string().optional(), +}); + +export type SelectProtocolSchema = z.infer; diff --git a/src/schemas/uncategorised/SettingsProtoUpdateSchema.ts b/src/schemas/uncategorised/SettingsProtoUpdateSchema.ts index 5bf6808a4c..96cbdbf4c5 100644 --- a/src/schemas/uncategorised/SettingsProtoUpdateSchema.ts +++ b/src/schemas/uncategorised/SettingsProtoUpdateSchema.ts @@ -16,32 +16,16 @@ along with this program. If not, see . */ -import { JsonValue } from "@protobuf-ts/runtime"; +import { z } from "zod"; -export interface SettingsProtoUpdateSchema { - settings: string; - required_data_version?: number; -} +export const SettingsProtoUpdateSchema = z.object({ + settings: z.string(), + required_data_version: z.number().optional(), +}); -export interface SettingsProtoUpdateJsonSchema { - settings: JsonValue; - required_data_version?: number; -} +export const SettingsProtoUpdateJsonSchema = SettingsProtoUpdateSchema.extend({ + settings: z.record(z.string(), z.any()), +}); -// TODO: these dont work with schema validation -// typed JSON schemas: -// export interface SettingsProtoUpdatePreloadedUserSettingsSchema { -// settings: PreloadedUserSettings; -// required_data_version?: number; -// } -// -// export interface SettingsProtoUpdateFrecencyUserSettingsSchema { -// settings: FrecencyUserSettings; -// required_data_version?: number; -// } - -// TODO: what is this? -// export interface SettingsProtoUpdateTestSettingsSchema { -// settings: {}; -// required_data_version?: number; -// } +export type SettingsProtoUpdateSchema = z.infer; +export type SettingsProtoUpdateJsonSchema = z.infer; diff --git a/src/schemas/uncategorised/TagCreateSchema.ts b/src/schemas/uncategorised/TagCreateSchema.ts index 292e9c307e..f4da4a9600 100644 --- a/src/schemas/uncategorised/TagCreateSchema.ts +++ b/src/schemas/uncategorised/TagCreateSchema.ts @@ -16,9 +16,13 @@ along with this program. If not, see . */ -export interface TagCreateSchema { - name: string; - moderated?: boolean | null; - emoji_id?: string | null; - emoji_name?: string | null; -} +import { z } from "zod"; + +export const TagCreateSchema = z.object({ + name: z.string(), + moderated: z.boolean().nullish(), + emoji_id: z.string().nullish(), + emoji_name: z.string().nullish(), +}); + +export type TagCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/TeamCreateSchema.ts b/src/schemas/uncategorised/TeamCreateSchema.ts index 2a2a3280e4..863086bc5b 100644 --- a/src/schemas/uncategorised/TeamCreateSchema.ts +++ b/src/schemas/uncategorised/TeamCreateSchema.ts @@ -1,21 +1,25 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface TeamCreateSchema { - name: string; -} +import { z } from "zod"; + +export const TeamCreateSchema = z.object({ + name: z.string(), +}); + +export type TeamCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/TemplateCreateSchema.ts b/src/schemas/uncategorised/TemplateCreateSchema.ts index 85c1a4ec1f..fa382a951d 100644 --- a/src/schemas/uncategorised/TemplateCreateSchema.ts +++ b/src/schemas/uncategorised/TemplateCreateSchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface TemplateCreateSchema { - name: string; - description?: string; -} +import { z } from "zod"; + +export const TemplateCreateSchema = z.object({ + name: z.string(), + description: z.string().nullish(), +}); + +export type TemplateCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/TemplateModifySchema.ts b/src/schemas/uncategorised/TemplateModifySchema.ts index 01b9981fe0..8efa65a8de 100644 --- a/src/schemas/uncategorised/TemplateModifySchema.ts +++ b/src/schemas/uncategorised/TemplateModifySchema.ts @@ -1,22 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface TemplateModifySchema { - name: string; - description?: string; -} +import { z } from "zod"; + +export const TemplateModifySchema = z.object({ + name: z.string().optional(), + description: z.string().nullish(), +}); + +export type TemplateModifySchema = z.infer; diff --git a/src/schemas/uncategorised/ThreadCreationSchema.ts b/src/schemas/uncategorised/ThreadCreationSchema.ts index 1ad85ce75a..f0b57d696e 100644 --- a/src/schemas/uncategorised/ThreadCreationSchema.ts +++ b/src/schemas/uncategorised/ThreadCreationSchema.ts @@ -1,47 +1,52 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { ActionRowComponent, ChannelType, Embed } from "#schemas/api"; -import { MessageActivity } from "./MessageActivity"; +import { z } from "zod"; import { MessageCreateAttachment, MessageCreateCloudAttachment } from "./MessageCreateSchema"; -export interface ThreadCreationSchema { - auto_archive_duration?: number; - rate_limit_per_user?: number; - name: string; - type?: ChannelType.GUILD_PUBLIC_THREAD | ChannelType.GUILD_PRIVATE_THREAD; - invitable?: boolean; - applied_tags?: string[]; - location?: string; //Ignore it - message?: { - content?: string; - embeds?: Embed[]; - allowed_mentions?: { - parse?: string[]; - roles?: string[]; - users?: string[]; - replied_user?: boolean; - }; - components?: ActionRowComponent[] | null; - sticker_ids?: string[]; - activity?: MessageActivity; - application_id?: string; - flags?: number; - attachments?: (MessageCreateAttachment | MessageCreateCloudAttachment)[]; - }; -} +export const ThreadCreationSchema = z.object({ + auto_archive_duration: z.number().optional(), + rate_limit_per_user: z.number().optional(), + name: z.string(), + type: z.number().optional(), + invitable: z.boolean().optional(), + applied_tags: z.array(z.string()).optional(), + location: z.string().optional(), + message: z + .object({ + content: z.string(), + embeds: z.array(z.any()), + allowed_mentions: z + .object({ + parse: z.array(z.string()), + roles: z.array(z.string()), + users: z.array(z.string()), + replied_user: z.boolean(), + }) + .partial(), + components: z.array(z.any()).nullable(), + sticker_ids: z.array(z.string()), + activity: z.any(), + application_id: z.string(), + flags: z.number(), + attachments: z.array(z.union([MessageCreateAttachment, MessageCreateCloudAttachment])), + }) + .partial(), +}); + +export type ThreadCreationSchema = z.infer; diff --git a/src/schemas/uncategorised/TotpDisableSchema.ts b/src/schemas/uncategorised/TotpDisableSchema.ts index 6420381fd0..b5e6223787 100644 --- a/src/schemas/uncategorised/TotpDisableSchema.ts +++ b/src/schemas/uncategorised/TotpDisableSchema.ts @@ -16,10 +16,10 @@ along with this program. If not, see . */ -export interface TotpDisableSchema { - /** - * @minLength 6 - * @maxLength 6 - */ - code: string; -} +import { z } from "zod"; + +export const TotpDisableSchema = z.object({ + code: z.string().min(6).max(6), +}); + +export type TotpDisableSchema = z.infer; diff --git a/src/schemas/uncategorised/TotpEnableSchema.ts b/src/schemas/uncategorised/TotpEnableSchema.ts index 1fbab81ff4..310c8f22b6 100644 --- a/src/schemas/uncategorised/TotpEnableSchema.ts +++ b/src/schemas/uncategorised/TotpEnableSchema.ts @@ -16,16 +16,12 @@ along with this program. If not, see . */ -export interface TotpEnableSchema { - /** - * @minLength 1 - * @maxLength 72 - */ - password: string; - /** - * @minLength 6 - * @maxLength 6 - */ - code?: string; - secret?: string; -} +import { z } from "zod"; + +export const TotpEnableSchema = z.object({ + password: z.string().min(1).max(72), + code: z.string().min(6).max(6).optional(), + secret: z.string().optional(), +}); + +export type TotpEnableSchema = z.infer; diff --git a/src/schemas/uncategorised/TotpSchema.ts b/src/schemas/uncategorised/TotpSchema.ts index a7e829452f..3c75261bbe 100644 --- a/src/schemas/uncategorised/TotpSchema.ts +++ b/src/schemas/uncategorised/TotpSchema.ts @@ -1,24 +1,28 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface TotpSchema { - code: string; - ticket: string; - gift_code_sku_id?: string | null; - login_source?: string | null; -} +import { z } from "zod"; + +export const TotpSchema = z.object({ + code: z.string(), + ticket: z.string(), + gift_code_sku_id: z.string().nullish(), + login_source: z.string().nullish(), +}); + +export type TotpSchema = z.infer; diff --git a/src/schemas/uncategorised/UploadAttachmentRequestSchema.ts b/src/schemas/uncategorised/UploadAttachmentRequestSchema.ts index b2a905b32d..8e60d5a443 100644 --- a/src/schemas/uncategorised/UploadAttachmentRequestSchema.ts +++ b/src/schemas/uncategorised/UploadAttachmentRequestSchema.ts @@ -1,29 +1,33 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2024 Spacebar and Spacebar Contributors - + Copyright (C) 2023 Spacebar and Spacebar Contributors + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface UploadAttachmentRequestSchema { - files: UploadAttachmentRequest[]; -} +import { z } from "zod"; + +export const UploadAttachmentRequestSchema = z.object({ + files: z.array( + z.object({ + id: z.string().optional(), + filename: z.string(), + file_size: z.number(), + is_clip: z.boolean().optional(), + original_content_type: z.string().optional(), + }), + ), +}); -export interface UploadAttachmentRequest { - id?: string; - filename: string; - file_size: number; - is_clip?: boolean; - original_content_type?: string; -} +export type UploadAttachmentRequestSchema = z.infer; diff --git a/src/schemas/uncategorised/UserDeleteSchema.ts b/src/schemas/uncategorised/UserDeleteSchema.ts index fcd69d85f2..75ef798133 100644 --- a/src/schemas/uncategorised/UserDeleteSchema.ts +++ b/src/schemas/uncategorised/UserDeleteSchema.ts @@ -16,6 +16,10 @@ along with this program. If not, see . */ -export interface UserDeleteSchema { - user_id: string; -} +import { z } from "zod"; + +export const UserDeleteSchema = z.object({ + user_id: z.string(), +}); + +export type UserDeleteSchema = z.infer; diff --git a/src/schemas/uncategorised/UserGuildSettingsSchema.ts b/src/schemas/uncategorised/UserGuildSettingsSchema.ts index 4ed302508e..221d16364b 100644 --- a/src/schemas/uncategorised/UserGuildSettingsSchema.ts +++ b/src/schemas/uncategorised/UserGuildSettingsSchema.ts @@ -1,26 +1,46 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { ChannelOverride, UserGuildSettings } from "@spacebar/schemas"; +import { z } from "zod"; + +const ChannelOverrideSchema = z.object({ + message_notifications: z.number(), + mute_config: z.object({ end_time: z.string().optional(), selected_time_window: z.number().optional() }).nullable(), + muted: z.boolean(), + channel_id: z.string().nullable(), +}); + +export const UserGuildSettingsSchema = z + .object({ + channel_overrides: z.record(z.string(), ChannelOverrideSchema).nullable(), + message_notifications: z.number(), + mobile_push: z.boolean(), + mute_config: z.object({ end_time: z.string().optional(), selected_time_window: z.number().optional() }).nullable(), + muted: z.boolean(), + suppress_everyone: z.boolean(), + suppress_roles: z.boolean(), + version: z.number(), + guild_id: z.string().nullable(), + flags: z.number(), + mute_scheduled_events: z.boolean(), + hide_muted_channels: z.boolean(), + notify_highlights: z.literal(0), + }) + .partial(); -// This sucks. I would use a DeepPartial, my own or typeorms, but they both generate inncorect schema -export interface UserGuildSettingsSchema extends Partial> { - channel_overrides?: { - [channel_id: string]: ChannelOverride; - }; -} +export type UserGuildSettingsSchema = z.infer; diff --git a/src/schemas/uncategorised/UserModifySchema.ts b/src/schemas/uncategorised/UserModifySchema.ts index 45c1ae909c..890b8ae162 100644 --- a/src/schemas/uncategorised/UserModifySchema.ts +++ b/src/schemas/uncategorised/UserModifySchema.ts @@ -1,58 +1,40 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ +import { z } from "zod"; import { User_DisplayNameEffect, User_DisplayNameFont } from "discord-protos"; -export interface UserModifySchema { - /** - * @minLength 2 - */ - username?: string; - avatar?: string | null; - bio?: string; - accent_color?: number; - banner?: string | null; - /** - * @minLength 1 - * @maxLength 72 - */ - password?: string; - /** - * @minLength 1 - * @maxLength 72 - */ - new_password?: string; - /** - * @minLength 6 - * @maxLength 6 - */ - code?: string; - /** - * @TJS-format email - */ - email?: string; - /** - * @minLength 4 - * @maxLength 4 - */ - discriminator?: string; +export const UserModifySchema = z + .object({ + username: z.string().min(2), + avatar: z.string().nullable(), + bio: z.string(), + accent_color: z.number(), + banner: z.string().nullable(), + password: z.string().min(1).max(72), + new_password: z.string().min(1).max(72), + code: z.string().min(6).max(6), + email: z.email(), + discriminator: z.string().min(4).max(4), + display_name_colors: z.array(z.number()), + display_name_effect_id: z.enum(User_DisplayNameEffect), + display_name_font_id: z.enum(User_DisplayNameFont), + }) + .partial(); - display_name_colors?: number[]; - display_name_effect_id?: User_DisplayNameEffect; - display_name_font_id?: User_DisplayNameFont; -} +export type UserModifySchema = z.infer; diff --git a/src/schemas/uncategorised/UserNoteUpdateSchema.ts b/src/schemas/uncategorised/UserNoteUpdateSchema.ts index f54306934f..5fdbefa707 100644 --- a/src/schemas/uncategorised/UserNoteUpdateSchema.ts +++ b/src/schemas/uncategorised/UserNoteUpdateSchema.ts @@ -1,3 +1,7 @@ -export interface UserNoteUpdateSchema { - note: string; -} +import { z } from "zod"; + +export const UserNoteUpdateSchema = z.object({ + note: z.string(), +}); + +export type UserNoteUpdateSchema = z.infer; diff --git a/src/schemas/uncategorised/UserProfileModifySchema.ts b/src/schemas/uncategorised/UserProfileModifySchema.ts index 5ba1dcad93..bc0486d148 100644 --- a/src/schemas/uncategorised/UserProfileModifySchema.ts +++ b/src/schemas/uncategorised/UserProfileModifySchema.ts @@ -1,28 +1,29 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface UserProfileModifySchema { - bio?: string; - accent_color?: number | null; - banner?: string | null; - pronouns?: string; - /** - * @items.type integer - */ - theme_colors?: [number, number]; -} +import { z } from "zod"; + +export const UserProfileModifySchema = z.object({ + bio: z.string().optional(), + accent_color: z.number().nullish(), + banner: z.string().nullish(), + pronouns: z.string().optional(), + theme_colors: z.array(z.number()).nullish(), +}); + +export type UserProfileModifySchema = z.infer; diff --git a/src/schemas/uncategorised/VanityUrlSchema.ts b/src/schemas/uncategorised/VanityUrlSchema.ts index 2273c0fb68..f14af8e968 100644 --- a/src/schemas/uncategorised/VanityUrlSchema.ts +++ b/src/schemas/uncategorised/VanityUrlSchema.ts @@ -16,10 +16,10 @@ along with this program. If not, see . */ -export interface VanityUrlSchema { - /** - * @minLength 1 - * @maxLength 20 - */ - code?: string; -} +import { z } from "zod"; + +export const VanityUrlSchema = z.object({ + code: z.string().min(1).max(20).optional(), +}); + +export type VanityUrlSchema = z.infer; diff --git a/src/schemas/uncategorised/VerifyEmailSchema.ts b/src/schemas/uncategorised/VerifyEmailSchema.ts index 818b0284d7..316abd8b2c 100644 --- a/src/schemas/uncategorised/VerifyEmailSchema.ts +++ b/src/schemas/uncategorised/VerifyEmailSchema.ts @@ -16,7 +16,11 @@ along with this program. If not, see . */ -export interface VerifyEmailSchema { - captcha_key?: string | null; - token: string; -} +import { z } from "zod"; + +export const VerifyEmailSchema = z.object({ + captcha_key: z.string().nullish(), + token: z.string(), +}); + +export type VerifyEmailSchema = z.infer; diff --git a/src/schemas/uncategorised/VoiceStateUpdateSchema.ts b/src/schemas/uncategorised/VoiceStateUpdateSchema.ts index 1d4cee82a9..dc9c70563d 100644 --- a/src/schemas/uncategorised/VoiceStateUpdateSchema.ts +++ b/src/schemas/uncategorised/VoiceStateUpdateSchema.ts @@ -1,42 +1,33 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -//TODO need more testing when community guild and voice stage channel are working -export interface VoiceStateUpdateSchema { - guild_id?: string; - channel_id?: string; - self_mute: boolean; - self_deaf: boolean; - self_video?: boolean; - preferred_region?: string; - request_to_speak_timestamp?: Date; - suppress?: boolean; - flags?: number; -} +import { z } from "zod"; -export const VoiceStateUpdateSchema = { - $guild_id: String, - $channel_id: String, - self_mute: Boolean, - self_deaf: Boolean, - $self_video: Boolean, //required in docs but bots don't always send it - $preferred_region: String, - $request_to_speak_timestamp: Date, - $suppress: Boolean, - $flags: Number, -}; +export const VoiceStateUpdateSchema = z.object({ + guild_id: z.string().optional(), + channel_id: z.string().optional(), + self_mute: z.boolean(), + self_deaf: z.boolean(), + self_video: z.boolean().optional(), + preferred_region: z.string().optional(), + request_to_speak_timestamp: z.iso.datetime().optional(), + suppress: z.boolean().optional(), + flags: z.number().optional(), +}); + +export type VoiceStateUpdateSchema = z.infer; diff --git a/src/schemas/uncategorised/WebAuthnSchema.ts b/src/schemas/uncategorised/WebAuthnSchema.ts index 8b4db9abc6..281db25206 100644 --- a/src/schemas/uncategorised/WebAuthnSchema.ts +++ b/src/schemas/uncategorised/WebAuthnSchema.ts @@ -16,21 +16,26 @@ along with this program. If not, see . */ -// FIXME: better naming -export interface GenerateWebAuthnCredentialsSchema { - password: string; -} +import { z } from "zod"; -// FIXME: better naming -export interface CreateWebAuthnCredentialSchema { - credential: string; - name: string; - ticket: string; -} +export const GenerateWebAuthnCredentialsSchema = z.object({ + password: z.string(), +}); -export type WebAuthnPostSchema = GenerateWebAuthnCredentialsSchema | CreateWebAuthnCredentialSchema; +export const CreateWebAuthnCredentialSchema = z.object({ + credential: z.string(), + name: z.string(), + ticket: z.string(), +}); -export interface WebAuthnTotpSchema { - code: string; - ticket: string; -} +export const WebAuthnPostSchema = z.union([GenerateWebAuthnCredentialsSchema, CreateWebAuthnCredentialSchema]); + +export const WebAuthnTotpSchema = z.object({ + code: z.string(), + ticket: z.string(), +}); + +export type GenerateWebAuthnCredentialsSchema = z.infer; +export type CreateWebAuthnCredentialSchema = z.infer; +export type WebAuthnPostSchema = z.infer; +export type WebAuthnTotpSchema = z.infer; diff --git a/src/schemas/uncategorised/WebhookCreateSchema.ts b/src/schemas/uncategorised/WebhookCreateSchema.ts index df93f6583e..2a0672449f 100644 --- a/src/schemas/uncategorised/WebhookCreateSchema.ts +++ b/src/schemas/uncategorised/WebhookCreateSchema.ts @@ -1,25 +1,26 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface WebhookCreateSchema { - /** - * @maxLength 80 - */ - name: string; - avatar?: string; -} +import { z } from "zod"; + +export const WebhookCreateSchema = z.object({ + name: z.string().max(80), + avatar: z.string().optional(), +}); + +export type WebhookCreateSchema = z.infer; diff --git a/src/schemas/uncategorised/WebhookExecuteSchema.ts b/src/schemas/uncategorised/WebhookExecuteSchema.ts index 2d0fdbd436..b8f7c9da90 100644 --- a/src/schemas/uncategorised/WebhookExecuteSchema.ts +++ b/src/schemas/uncategorised/WebhookExecuteSchema.ts @@ -1,56 +1,63 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { Embed } from "@spacebar/schemas"; -import { MessageCreateAttachment, PollCreationSchema } from "./MessageCreateSchema"; +import { z } from "zod"; +import { MessageCreateAttachment, MessageCreateCloudAttachment, PollCreationSchema } from "./MessageCreateSchema"; + +export const WebhookExecuteSchema = z + .object({ + content: z.string(), + username: z.string(), + avatar_url: z.string(), + tts: z.boolean(), + embeds: z.array(z.record(z.string(), z.any())), + allowed_mentions: z + .object({ + parse: z.array(z.string()), + roles: z.array(z.string()), + users: z.array(z.string()), + replied_user: z.boolean(), + }) + .partial(), + components: z.array(z.record(z.string(), z.any())), + file: z.object({ filename: z.string() }), + payload_json: z.string(), + attachments: z.array(MessageCreateAttachment), + flags: z.number(), + thread_name: z.string(), + applied_tags: z.array(z.string()), + message_reference: z + .object({ + message_id: z.string(), + channel_id: z.string(), + guild_id: z.string(), + fail_if_not_exists: z.boolean(), + }) + .partial({ + channel_id: true, + guild_id: true, + fail_if_not_exists: true, + }), + sticker_ids: z.array(z.string()), + nonce: z.string(), + enforce_nonce: z.boolean(), + poll: PollCreationSchema, + }) + .partial(); -export interface WebhookExecuteSchema { - content?: string; - username?: string; - avatar_url?: string; - tts?: boolean; - embeds?: Embed[]; - allowed_mentions?: { - parse?: string[]; - roles?: string[]; - users?: string[]; - replied_user?: boolean; - }; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - components?: any[]; - file?: { filename: string }; - payload_json?: string; - /** - TODO: we should create an interface for attachments - TODO: OpenWAAO<-->attachment-style metadata conversion - **/ - attachments?: MessageCreateAttachment[]; - flags?: number; - thread_name?: string; - applied_tags?: string[]; - message_reference?: { - message_id: string; - channel_id?: string; - guild_id?: string; - fail_if_not_exists?: boolean; - }; - sticker_ids?: string[]; - nonce?: string; - enforce_nonce?: boolean; // For Discord compatibility, it's the default behavior here - poll?: PollCreationSchema; -} +export type WebhookExecuteSchema = z.infer; diff --git a/src/schemas/uncategorised/WebhookUpdateSchema.ts b/src/schemas/uncategorised/WebhookUpdateSchema.ts index e3fa4c56ab..23ce92bbb1 100755 --- a/src/schemas/uncategorised/WebhookUpdateSchema.ts +++ b/src/schemas/uncategorised/WebhookUpdateSchema.ts @@ -1,23 +1,27 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -export interface WebhookUpdateSchema { - name?: string; - avatar?: string; - channel_id?: string; -} +import { z } from "zod"; + +export const WebhookUpdateSchema = z.object({ + name: z.string().optional(), + avatar: z.string().nullish(), + channel_id: z.string().optional(), +}); + +export type WebhookUpdateSchema = z.infer; diff --git a/src/schemas/uncategorised/WidgetModifySchema.ts b/src/schemas/uncategorised/WidgetModifySchema.ts index 9bb19ee125..377e2db39f 100644 --- a/src/schemas/uncategorised/WidgetModifySchema.ts +++ b/src/schemas/uncategorised/WidgetModifySchema.ts @@ -16,7 +16,11 @@ along with this program. If not, see . */ -export interface WidgetModifySchema { - enabled: boolean; // whether the widget is enabled - channel_id: string; // the widget channel id -} +import { z } from "zod"; + +export const WidgetModifySchema = z.object({ + enabled: z.boolean(), + channel_id: z.string(), +}); + +export type WidgetModifySchema = z.infer; diff --git a/src/schemas/webrtc/VoiceIdentifySchema.ts b/src/schemas/webrtc/VoiceIdentifySchema.ts index 203020b860..854f7d331b 100644 --- a/src/schemas/webrtc/VoiceIdentifySchema.ts +++ b/src/schemas/webrtc/VoiceIdentifySchema.ts @@ -1,34 +1,41 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface VoiceIdentifySchema { - server_id: string; - user_id: string; - session_id: string; - channel_id?: string; - token: string; - video?: boolean; - streams?: { - type: "video" | "audio" | "screen"; - rid: string; - quality: number; - }[]; - // Discord keeps changing the property name of this, probably will keep changing until Dave is finalized - max_secure_frames_version?: number; - max_dave_protocol_version?: number; -} +import { z } from "zod"; + +export const VoiceIdentifySchema = z.object({ + server_id: z.string(), + user_id: z.string(), + session_id: z.string(), + channel_id: z.string().optional(), + token: z.string(), + video: z.boolean().optional(), + streams: z + .array( + z.object({ + type: z.enum(["video", "audio", "screen"]), + rid: z.string(), + quality: z.number(), + }), + ) + .optional(), + max_secure_frames_version: z.number().optional(), + max_dave_protocol_version: z.number().optional(), +}); + +export type VoiceIdentifySchema = z.infer; diff --git a/src/schemas/webrtc/VoiceVideoSchema.ts b/src/schemas/webrtc/VoiceVideoSchema.ts index 64f301cbbb..070d03bef9 100644 --- a/src/schemas/webrtc/VoiceVideoSchema.ts +++ b/src/schemas/webrtc/VoiceVideoSchema.ts @@ -1,35 +1,47 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -export interface VoiceVideoSchema { - audio_ssrc: number; - video_ssrc: number; - rtx_ssrc?: number; - user_id?: string; - streams?: { - type: "video" | "audio" | "screen"; - rid: string; - ssrc: number; - active: boolean; - quality: number; - rtx_ssrc: number; - max_bitrate: number; - max_framerate: number; - max_resolution: { type: string; width: number; height: number }; - }[]; -} +import { z } from "zod"; + +export const VoiceVideoSchema = z.object({ + audio_ssrc: z.number(), + video_ssrc: z.number(), + rtx_ssrc: z.number().optional(), + user_id: z.string().optional(), + streams: z + .array( + z.object({ + type: z.enum(["video", "audio", "screen"]), + rid: z.string(), + ssrc: z.number(), + active: z.boolean(), + quality: z.number(), + rtx_ssrc: z.number(), + max_bitrate: z.number(), + max_framerate: z.number(), + max_resolution: z.object({ + type: z.string(), + width: z.number(), + height: z.number(), + }), + }), + ) + .optional(), +}); + +export type VoiceVideoSchema = z.infer; diff --git a/src/util/util/FieldError.ts b/src/util/util/FieldError.ts index f0ba4aeede..d164db5d28 100644 --- a/src/util/util/FieldError.ts +++ b/src/util/util/FieldError.ts @@ -1,23 +1,21 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { ErrorObject } from "ajv"; - export interface FieldErrorResponse { code: number; message: string; @@ -32,7 +30,7 @@ export function makeObjectErrorContent(code: string, message: string): ObjectErr return { _errors: [{ code, message }] }; } -export function FieldErrors(fields: Record, errors?: ErrorObject[]) { +export function FieldErrors(fields: Record) { const errorObj: ErrorList = {}; for (const [key, { message, code }] of Object.entries(fields)) { errorObj[key] = { @@ -45,7 +43,7 @@ export function FieldErrors(fields: Record. +*/ + +import { z } from "zod"; + +export const Snowflake = z.string().regex(/^\d+$/, "Invalid Snowflake format"); + +export const ImageSchema = z.string().regex(/^data:image\/(jpeg|png|gif);base64,/, "Invalid image data format"); diff --git a/src/util/util/email/clients/SMTPEmailClient.ts b/src/util/util/email/clients/SMTPEmailClient.ts index 5c469e0fe4..f0d3e8fe6a 100644 --- a/src/util/util/email/clients/SMTPEmailClient.ts +++ b/src/util/util/email/clients/SMTPEmailClient.ts @@ -46,7 +46,7 @@ export class SMTPEmailClient extends BaseEmailClient { /* Allow for SMTP relays with and without username/passwords (IE: Smarthosts/Local Relays, etc) */ let nodemailer_opts: unknown; - if(!username || !password) { + if (!username || !password) { nodemailer_opts = { host, port, diff --git a/src/webrtc/opcodes/Identify.ts b/src/webrtc/opcodes/Identify.ts index d61d4bbbcb..5f60b0082c 100644 --- a/src/webrtc/opcodes/Identify.ts +++ b/src/webrtc/opcodes/Identify.ts @@ -1,31 +1,31 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { CLOSECODES } from "@spacebar/gateway"; import { StreamSession, VoiceState } from "@spacebar/util"; -import { validateSchema, VoiceIdentifySchema } from "@spacebar/schemas"; +import { VoiceIdentifySchema } from "@spacebar/schemas"; import { generateSsrc, mediaServer, Send, VoiceOPCodes, VoicePayload, WebRtcWebSocket } from "@spacebar/webrtc"; import { SSRCs } from "@spacebarchat/spacebar-webrtc-types"; import { subscribeToProducers } from "./Video"; export async function onIdentify(this: WebRtcWebSocket, data: VoicePayload) { clearTimeout(this.readyTimeout); - const { server_id, user_id, session_id, token, streams, video } = validateSchema("VoiceIdentifySchema", data.d) as VoiceIdentifySchema; + const { server_id, user_id, session_id, token, streams, video } = VoiceIdentifySchema.parse(data.d); // server_id can be one of the following: a unique id for a GO Live stream, a channel id for a DM voice call, or a guild id for a guild voice channel // not sure if there's a way to determine whether a snowflake is a channel id or a guild id without checking if it exists in db diff --git a/src/webrtc/opcodes/SelectProtocol.ts b/src/webrtc/opcodes/SelectProtocol.ts index 6a73393220..c0a0f60ea6 100644 --- a/src/webrtc/opcodes/SelectProtocol.ts +++ b/src/webrtc/opcodes/SelectProtocol.ts @@ -1,27 +1,27 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ -import { SelectProtocolSchema, validateSchema } from "@spacebar/schemas"; +import { SelectProtocolSchema } from "@spacebar/schemas"; import { VoiceOPCodes, VoicePayload, WebRtcWebSocket, mediaServer, Send } from "@spacebar/webrtc"; export async function onSelectProtocol(this: WebRtcWebSocket, payload: VoicePayload) { if (!this.webRtcClient) return; - const data = validateSchema("SelectProtocolSchema", payload.d) as SelectProtocolSchema; + const data = SelectProtocolSchema.parse(payload.d); // UDP protocol not currently supported. Maybe in the future? if (data.protocol !== "webrtc") return this.close(4000, "only webrtc protocol supported currently"); diff --git a/src/webrtc/opcodes/Video.ts b/src/webrtc/opcodes/Video.ts index a7426198f6..8f4ac5e05b 100644 --- a/src/webrtc/opcodes/Video.ts +++ b/src/webrtc/opcodes/Video.ts @@ -1,31 +1,31 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ import { Stream } from "@spacebar/util"; import { mediaServer, Send, VoiceOPCodes, VoicePayload, WebRtcWebSocket } from "@spacebar/webrtc"; import type { WebRtcClient } from "@spacebarchat/spacebar-webrtc-types"; -import { validateSchema, VoiceVideoSchema } from "@spacebar/schemas"; +import { VoiceVideoSchema } from "@spacebar/schemas"; export async function onVideo(this: WebRtcWebSocket, payload: VoicePayload) { if (!this.webRtcClient) return; const { voiceRoomId } = this.webRtcClient; - const d = validateSchema("VoiceVideoSchema", payload.d) as VoiceVideoSchema; + const d = VoiceVideoSchema.parse(payload.d); if (this.type === "stream") { const stream = await Stream.findOne({ diff --git a/tsconfig.json b/tsconfig.json index b320cf88fc..20433a12b0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ /* Projects */ "incremental": true /* Save .tsbuildinfo files to allow for incremental compilation of projects. */, // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - "tsBuildInfoFile": "./dist/src.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + "tsBuildInfoFile": "./dist/src.tsbuildinfo" /* Specify the path to .tsbuildinfo incremental compilation file. */, // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */