summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-08-08 06:53:15 +0200
committerRory& <root@rory.gay>2026-08-08 06:53:15 +0200
commitfc086ddcea686e4e4359cd96b1f2423a4601a94b (patch)
treec02765effbb5d198a4282b49cd71f86ea308c6e8
parentToGuildSource -> ToDiscoverableGuild (diff)
downloadserver-ts-fc086ddcea686e4e4359cd96b1f2423a4601a94b.tar.xz
Clean up some schemas
-rw-r--r--assets/openapi.json1150
-rw-r--r--assets/schemas.json1202
-rw-r--r--src/api/routes/users/@me/settings.ts6
-rw-r--r--src/database/entities/Guild.ts4
-rw-r--r--src/database/entities/Session.ts5
-rw-r--r--src/database/entities/UserSettings.ts2
-rw-r--r--src/gateway/opcodes/PresenceUpdate.ts4
-rw-r--r--src/schemas/api/guilds/index.ts1
-rw-r--r--src/schemas/api/messages/index.ts1
-rw-r--r--src/schemas/api/spacebar/AttachmentListResponse.ts3
-rw-r--r--src/schemas/api/users/ConnectedAccount.ts9
-rw-r--r--src/schemas/api/users/SessionsSchemas.ts4
-rw-r--r--src/schemas/api/users/Status.ts (renamed from src/util/interfaces/Status.ts)0
-rw-r--r--src/schemas/api/users/UserSettings.ts20
-rw-r--r--src/schemas/api/users/index.ts3
-rw-r--r--src/schemas/responses/DiscoverableGuildsResponse.ts3
-rw-r--r--src/schemas/responses/GuildCreateResponse.ts4
-rw-r--r--src/schemas/responses/GuildMessagesSearchResponse.ts5
-rw-r--r--src/schemas/responses/GuildWelcomeScreen.ts28
-rw-r--r--src/schemas/responses/GuildWidgetJsonResponse.ts3
-rw-r--r--src/schemas/responses/HubDirectoryEntriesResponse.ts16
-rw-r--r--src/schemas/responses/MemberJoinGuildResponse.ts3
-rw-r--r--src/schemas/responses/TeamListResponse.ts15
-rw-r--r--src/schemas/responses/TokenResponse.ts5
-rw-r--r--src/schemas/responses/TypedResponses.ts2
-rw-r--r--src/schemas/responses/UserProfileResponse.ts46
-rw-r--r--src/schemas/responses/index.ts1
-rw-r--r--src/schemas/uncategorised/ActivitySchema.ts4
-rw-r--r--src/util/interfaces/Event.ts3
-rw-r--r--src/util/interfaces/GuildWelcomeScreen.ts10
-rw-r--r--src/util/interfaces/Presence.ts3
-rw-r--r--src/util/interfaces/index.ts1
32 files changed, 1515 insertions, 1051 deletions
diff --git a/assets/openapi.json b/assets/openapi.json

index 0cd1543b..d863aed7 100644 --- a/assets/openapi.json +++ b/assets/openapi.json
@@ -1544,18 +1544,202 @@ "shop_blocks" ] }, + "DiscoverableGuildsResponse": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "guilds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DiscoverableGuild" + } + }, + "offset": { + "type": "integer" + }, + "limit": { + "type": "integer" + } + }, + "required": [ + "guilds", + "limit", + "offset", + "total" + ] + }, + "DmMessagesResponseSchema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PartialMessage" + } + }, + "EmailDomainLookupResponse": { + "type": "object", + "properties": { + "guilds_info": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HubGuild" + } + }, + "has_matching_guild": { + "type": "boolean" + } + }, + "required": [ + "guilds_info", + "has_matching_guild" + ] + }, + "EmailDomainLookupVerifyCodeResponse": { + "type": "object", + "properties": { + "guild": { + "$ref": "#/components/schemas/Guild" + }, + "joined": { + "type": "boolean" + } + }, + "required": [ + "guild", + "joined" + ] + }, "InstanceUserDeleteSchema": { "$ref": "#/components/schemas/InstanceUserDeleteSchemaContent" }, + "SessionsLogoutSchema": { + "type": "object", + "properties": { + "session_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "session_id_hashes": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "GetSessionsResponse": { + "type": "object", + "properties": { + "user_sessions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "id_hash": { + "type": "string" + }, + "status": { + "type": "string" + }, + "activities": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Activity" + } + } + }, + "client_status": { + "$ref": "#/components/schemas/ClientStatus" + }, + "approx_last_used_time": { + "type": "string" + }, + "client_info": { + "type": "object", + "properties": { + "client": { + "type": "string" + }, + "os": { + "type": "string" + }, + "version": { + "type": "integer" + }, + "location": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "client", + "location", + "os", + "version" + ] + }, + "last_seen": { + "type": "string", + "format": "date-time" + }, + "last_seen_ip": { + "type": "string" + }, + "last_seen_location": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "activities", + "approx_last_used_time", + "client_info", + "client_status", + "id", + "id_hash", + "status" + ] + } + } + }, + "required": [ + "user_sessions" + ] + }, "UserSettingsUpdateSchema": { "type": "object", "properties": { + "activity_restricted_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "activity_joining_restricted_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, "afk_timeout": { "type": "integer" }, "allow_accessibility_detection": { "type": "boolean" }, + "allow_activity_party_privacy_friends": { + "type": "boolean" + }, + "allow_activity_party_privacy_voice_channel": { + "type": "boolean" + }, "animate_emoji": { "type": "boolean" }, @@ -1600,10 +1784,14 @@ "type": "integer" }, "friend_source_flags": { - "$ref": "#/components/schemas/FriendSourceFlags" - }, - "gateway_connected": { - "type": "boolean" + "anyOf": [ + { + "$ref": "#/components/schemas/FriendSourceFlags" + }, + { + "type": "null" + } + ] }, "gif_auto_play": { "type": "boolean" @@ -1614,12 +1802,6 @@ "$ref": "#/components/schemas/GuildFolder" } }, - "guild_positions": { - "type": "array", - "items": { - "type": "string" - } - }, "inline_attachment_media": { "type": "boolean" }, @@ -1635,6 +1817,9 @@ "native_phone_integration_enabled": { "type": "boolean" }, + "passwordless": { + "type": "boolean" + }, "render_embeds": { "type": "boolean" }, @@ -1650,6 +1835,12 @@ "show_current_game": { "type": "boolean" }, + "slayer_sdk_receive_dms_in_game": { + "type": "integer" + }, + "soundboard_volume": { + "type": "integer" + }, "status": { "enum": [ "dnd", @@ -1666,13 +1857,18 @@ "theme": { "enum": [ "dark", - "light" + "darker", + "light", + "midnight" ], "type": "string" }, "timezone_offset": { "type": "integer" }, + "view_nsfw_commands": { + "type": "boolean" + }, "view_nsfw_guilds": { "type": "boolean" } @@ -1681,12 +1877,30 @@ "UserSettingsSchema": { "type": "object", "properties": { + "activity_restricted_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "activity_joining_restricted_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, "afk_timeout": { "type": "integer" }, "allow_accessibility_detection": { "type": "boolean" }, + "allow_activity_party_privacy_friends": { + "type": "boolean" + }, + "allow_activity_party_privacy_voice_channel": { + "type": "boolean" + }, "animate_emoji": { "type": "boolean" }, @@ -1731,10 +1945,14 @@ "type": "integer" }, "friend_source_flags": { - "$ref": "#/components/schemas/FriendSourceFlags" - }, - "gateway_connected": { - "type": "boolean" + "anyOf": [ + { + "$ref": "#/components/schemas/FriendSourceFlags" + }, + { + "type": "null" + } + ] }, "gif_auto_play": { "type": "boolean" @@ -1745,12 +1963,6 @@ "$ref": "#/components/schemas/GuildFolder" } }, - "guild_positions": { - "type": "array", - "items": { - "type": "string" - } - }, "inline_attachment_media": { "type": "boolean" }, @@ -1766,6 +1978,9 @@ "native_phone_integration_enabled": { "type": "boolean" }, + "passwordless": { + "type": "boolean" + }, "render_embeds": { "type": "boolean" }, @@ -1781,6 +1996,12 @@ "show_current_game": { "type": "boolean" }, + "slayer_sdk_receive_dms_in_game": { + "type": "integer" + }, + "soundboard_volume": { + "type": "integer" + }, "status": { "enum": [ "dnd", @@ -1797,20 +2018,29 @@ "theme": { "enum": [ "dark", - "light" + "darker", + "light", + "midnight" ], "type": "string" }, "timezone_offset": { "type": "integer" }, + "view_nsfw_commands": { + "type": "boolean" + }, "view_nsfw_guilds": { "type": "boolean" } }, "required": [ + "activity_joining_restricted_guild_ids", + "activity_restricted_guild_ids", "afk_timeout", "allow_accessibility_detection", + "allow_activity_party_privacy_friends", + "allow_activity_party_privacy_voice_channel", "animate_emoji", "animate_stickers", "contact_sync_enabled", @@ -1824,127 +2054,28 @@ "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", + "passwordless", "render_embeds", "render_reactions", "restricted_guilds", "show_current_game", + "slayer_sdk_receive_dms_in_game", + "soundboard_volume", "status", "stream_notifications_enabled", "theme", "timezone_offset", + "view_nsfw_commands", "view_nsfw_guilds" ] }, - "SessionsLogoutSchema": { - "type": "object", - "properties": { - "session_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "session_id_hashes": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "GetSessionsResponse": { - "type": "object", - "properties": { - "user_sessions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "id_hash": { - "type": "string" - }, - "status": { - "type": "string" - }, - "activities": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Activity" - } - } - }, - "client_status": { - "$ref": "#/components/schemas/ClientStatus" - }, - "approx_last_used_time": { - "type": "string" - }, - "client_info": { - "type": "object", - "properties": { - "client": { - "type": "string" - }, - "os": { - "type": "string" - }, - "version": { - "type": "integer" - }, - "location": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "client", - "location", - "os", - "version" - ] - }, - "last_seen": { - "type": "string", - "format": "date-time" - }, - "last_seen_ip": { - "type": "string" - }, - "last_seen_location": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "activities", - "approx_last_used_time", - "client_info", - "client_status", - "id", - "id_hash", - "status" - ] - } - } - }, - "required": [ - "user_sessions" - ] - }, "EmojisResponse": { "type": "array", "items": { @@ -2003,71 +2134,6 @@ "name" ] }, - "DiscoverableGuildsResponse": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "guilds": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DiscoverableGuild" - } - }, - "offset": { - "type": "integer" - }, - "limit": { - "type": "integer" - } - }, - "required": [ - "guilds", - "limit", - "offset", - "total" - ] - }, - "DmMessagesResponseSchema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PartialMessage" - } - }, - "EmailDomainLookupResponse": { - "type": "object", - "properties": { - "guilds_info": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HubGuild" - } - }, - "has_matching_guild": { - "type": "boolean" - } - }, - "required": [ - "guilds_info", - "has_matching_guild" - ] - }, - "EmailDomainLookupVerifyCodeResponse": { - "type": "object", - "properties": { - "guild": { - "$ref": "#/components/schemas/Guild" - }, - "joined": { - "type": "boolean" - } - }, - "required": [ - "guild", - "joined" - ] - }, "EmojiSourceResponse": { "type": "object", "properties": { @@ -2968,6 +3034,39 @@ "settings" ] }, + "Team": { + "type": "object", + "properties": { + "icon": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeamMember" + } + }, + "name": { + "type": "string" + }, + "owner_user_id": { + "type": "string" + }, + "owner_user": { + "$ref": "#/components/schemas/User" + }, + "id": { + "type": "string" + } + }, + "required": [ + "id", + "members", + "name", + "owner_user", + "owner_user_id" + ] + }, "TeamListResponse": { "type": "array", "items": { @@ -2981,7 +3080,7 @@ "type": "string" }, "settings": { - "$ref": "#/components/schemas/UserSettings" + "$ref": "#/components/schemas/UserSettingsSchema" } }, "required": [ @@ -4606,9 +4705,6 @@ "flags": { "type": "integer" }, - "verified": { - "type": "boolean" - }, "premium_since": { "type": "string", "format": "date-time" @@ -4673,6 +4769,9 @@ "phone": { "type": "string" }, + "verified": { + "type": "boolean" + }, "nsfw_allowed": { "type": "boolean" }, @@ -4739,9 +4838,6 @@ "flags": { "type": "integer" }, - "verified": { - "type": "boolean" - }, "premium_since": { "type": "string", "format": "date-time" @@ -4806,6 +4902,9 @@ "phone": { "type": "string" }, + "verified": { + "type": "boolean" + }, "nsfw_allowed": { "type": "boolean" }, @@ -5196,6 +5295,142 @@ "user_id" ] }, + "ProfileMetadataResponse": { + "type": "object", + "properties": { + "pronouns": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "banner": { + "type": "string", + "nullable": true + }, + "accent_color": { + "type": "integer", + "nullable": true + }, + "theme_colors": { + "anyOf": [ + { + "type": "array", + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + } + ], + "minItems": 2, + "maxItems": 2 + }, + { + "type": "null" + } + ] + }, + "popout_animation_particle_type": { + "type": "string", + "nullable": true + }, + "emoji": { + "anyOf": [ + { + "$ref": "#/components/schemas/EmojiResponse" + }, + { + "type": "null" + } + ] + }, + "profile_effect": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProfileEffect" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "pronouns" + ] + }, + "GuildProfileMetadataResponse": { + "type": "object", + "properties": { + "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" + }, + "accent_color": { + "type": "null" + }, + "pronouns": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "banner": { + "type": "string", + "nullable": true + }, + "theme_colors": { + "anyOf": [ + { + "type": "array", + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + } + ], + "minItems": 2, + "maxItems": 2 + }, + { + "type": "null" + } + ] + }, + "popout_animation_particle_type": { + "type": "string", + "nullable": true + }, + "emoji": { + "anyOf": [ + { + "$ref": "#/components/schemas/EmojiResponse" + }, + { + "type": "null" + } + ] + }, + "profile_effect": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProfileEffect" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "guild_id", + "pronouns" + ] + }, "UserProfileResponse": { "type": "object", "properties": { @@ -5216,19 +5451,7 @@ "mutual_guilds": { "type": "array", "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "nick": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "id" - ] + "$ref": "#/components/schemas/MutualGuild" } }, "premium_type": { @@ -5238,18 +5461,18 @@ "type": "integer" }, "user_profile": { - "$ref": "#/components/schemas/UserProfile" + "$ref": "#/components/schemas/ProfileMetadataResponse" }, "guild_member": { "$ref": "#/components/schemas/PublicMember" }, "guild_member_profile": { - "$ref": "#/components/schemas/PublicMemberProfile" + "$ref": "#/components/schemas/GuildProfileMetadataResponse" }, "badges": { "type": "array", "items": { - "$ref": "#/components/schemas/Badge" + "$ref": "#/components/schemas/ProfileBadge" } } }, @@ -8864,69 +9087,154 @@ "type" ] }, - "InstanceUserDeleteSchemaContent": { + "DiscoverableGuild": { "type": "object", "properties": { - "reason": { + "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" }, - "persistInstanceBan": { - "type": "boolean" - } - } - }, - "CustomStatus": { - "type": "object", - "properties": { - "emoji_id": { + "name": { "type": "string" }, - "emoji_name": { + "icon": { + "type": "string", + "nullable": true + }, + "description": { + "type": "string", + "nullable": true + }, + "banner": { + "type": "string", + "nullable": true + }, + "splash": { + "type": "string", + "nullable": true + }, + "discovery_splash": { + "type": "string", + "nullable": true + }, + "features": { + "type": "array", + "items": { + "type": "string" + } + }, + "vanity_url_code": { + "type": "string", + "nullable": true + }, + "preferred_locale": { "type": "string" }, - "expires_at": { + "premium_subscription_count": { "type": "integer" }, - "text": { - "type": "string" - } - } - }, - "FriendSourceFlags": { - "type": "object", - "properties": { - "all": { + "approximate_member_count": { + "type": "integer" + }, + "approximate_presence_count": { + "type": "integer" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmojiResponse" + } + }, + "emoji_count": { + "type": "integer" + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StickerResponse" + } + }, + "sticker_count": { + "type": "integer" + }, + "auto_removed": { "type": "boolean" - } - }, - "required": [ - "all" - ] - }, - "GuildFolder": { - "type": "object", - "properties": { - "color": { - "type": "integer", - "nullable": true }, - "guild_ids": { + "primary_category_id": { + "type": "integer" + }, + "primary_category": { + "$ref": "#/components/schemas/DiscoveryCategory" + }, + "keywords": { "type": "array", "items": { "type": "string" } }, - "id": { - "type": "integer", - "nullable": true + "is_published": { + "type": "boolean" }, - "name": { + "reasons_to_join": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DiscoveryReason" + } + }, + "social_links": { + "type": "array", + "items": { + "type": "string" + } + }, + "about": { "type": "string", "nullable": true + }, + "category_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DiscoveryCategory" + } + }, + "created_at": { + "type": "string" + }, + "nsfw_properties": { + "anyOf": [ + { + "$ref": "#/components/schemas/DiscoveryNsfwProperties" + }, + { + "type": "null" + } + ] } }, "required": [ - "guild_ids" + "approximate_member_count", + "approximate_presence_count", + "auto_removed", + "banner", + "description", + "discovery_splash", + "features", + "icon", + "id", + "is_published", + "keywords", + "name", + "preferred_locale", + "premium_subscription_count", + "primary_category_id", + "splash", + "vanity_url_code" ] }, "PartialUser": { @@ -9132,156 +9440,6 @@ "tag" ] }, - "DiscoverableGuild": { - "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" - }, - "name": { - "type": "string" - }, - "icon": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string", - "nullable": true - }, - "banner": { - "type": "string", - "nullable": true - }, - "splash": { - "type": "string", - "nullable": true - }, - "discovery_splash": { - "type": "string", - "nullable": true - }, - "features": { - "type": "array", - "items": { - "type": "string" - } - }, - "vanity_url_code": { - "type": "string", - "nullable": true - }, - "preferred_locale": { - "type": "string" - }, - "premium_subscription_count": { - "type": "integer" - }, - "approximate_member_count": { - "type": "integer" - }, - "approximate_presence_count": { - "type": "integer" - }, - "emojis": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EmojiResponse" - } - }, - "emoji_count": { - "type": "integer" - }, - "stickers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/StickerResponse" - } - }, - "sticker_count": { - "type": "integer" - }, - "auto_removed": { - "type": "boolean" - }, - "primary_category_id": { - "type": "integer" - }, - "primary_category": { - "$ref": "#/components/schemas/DiscoveryCategory" - }, - "keywords": { - "type": "array", - "items": { - "type": "string" - } - }, - "is_published": { - "type": "boolean" - }, - "reasons_to_join": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DiscoveryReason" - } - }, - "social_links": { - "type": "array", - "items": { - "type": "string" - } - }, - "about": { - "type": "string", - "nullable": true - }, - "category_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "categories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DiscoveryCategory" - } - }, - "created_at": { - "type": "string" - }, - "nsfw_properties": { - "anyOf": [ - { - "$ref": "#/components/schemas/DiscoveryNsfwProperties" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "approximate_member_count", - "approximate_presence_count", - "auto_removed", - "banner", - "description", - "discovery_splash", - "features", - "icon", - "id", - "is_published", - "keywords", - "name", - "preferred_locale", - "premium_subscription_count", - "primary_category_id", - "splash", - "vanity_url_code" - ] - }, "StickerType": { "type": "number", "enum": [ @@ -10634,7 +10792,9 @@ "theme": { "enum": [ "dark", - "light" + "darker", + "light", + "midnight" ], "type": "string", "default": "dark" @@ -10685,6 +10845,63 @@ "view_nsfw_guilds" ] }, + "CustomStatus": { + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "integer" + }, + "text": { + "type": "string" + } + } + }, + "FriendSourceFlags": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "mutual_friends": { + "type": "boolean" + }, + "mutual_guilds": { + "type": "boolean" + } + } + }, + "GuildFolder": { + "type": "object", + "properties": { + "color": { + "type": "integer", + "nullable": true + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "integer", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "guild_ids" + ] + }, "SecurityKey": { "type": "object", "properties": { @@ -11723,39 +11940,6 @@ "verify_key" ] }, - "Team": { - "type": "object", - "properties": { - "icon": { - "type": "string" - }, - "members": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TeamMember" - } - }, - "name": { - "type": "string" - }, - "owner_user_id": { - "type": "string" - }, - "owner_user": { - "$ref": "#/components/schemas/User" - }, - "id": { - "type": "string" - } - }, - "required": [ - "id", - "members", - "name", - "owner_user", - "owner_user_id" - ] - }, "TeamMember": { "type": "object", "properties": { @@ -13540,6 +13724,17 @@ "welcome_channels" ] }, + "InstanceUserDeleteSchemaContent": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "persistInstanceBan": { + "type": "boolean" + } + } + }, "EmojiGuild": { "type": "object", "properties": { @@ -13853,7 +14048,7 @@ "type": "integer" }, "type": { - "type": "integer" + "$ref": "#/components/schemas/HubDirectoryEntryType" } }, "required": [ @@ -13866,6 +14061,13 @@ "type" ] }, + "HubDirectoryEntryType": { + "type": "number", + "enum": [ + 0, + 1 + ] + }, "PublicMessage": { "type": "object", "properties": { @@ -14623,28 +14825,16 @@ "BackupCode": { "type": "object", "properties": { - "user": { - "$ref": "#/components/schemas/User" - }, "code": { "type": "string" }, "consumed": { "type": "boolean" - }, - "expired": { - "type": "boolean" - }, - "id": { - "type": "string" } }, "required": [ "code", - "consumed", - "expired", - "id", - "user" + "consumed" ] }, "InteractionCallbackType": { @@ -15526,74 +15716,56 @@ "window" ] }, - "PublicConnectedAccount": { + "ProfileEffect": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "type": { + "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" }, - "verified": { - "type": "boolean" + "expires_at": { + "type": "integer", + "nullable": true } }, "required": [ - "name", - "type" + "expires_at", + "id" ] }, - "UserProfile": { + "PublicConnectedAccount": { "type": "object", "properties": { - "banner": { - "type": "string" - }, - "bio": { + "name": { "type": "string" }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { + "type": { "type": "string" }, - "accent_color": { - "type": "integer" + "verified": { + "type": "boolean" } }, "required": [ - "bio" + "name", + "type" ] }, - "PublicMemberProfile": { + "MutualGuild": { "type": "object", "properties": { - "guild_id": { - "type": "string" - }, - "banner": { + "id": { "type": "string" }, - "bio": { + "nick": { "type": "string" - }, - "accent_color": { - "type": "null" } }, "required": [ - "accent_color", - "banner", - "bio", - "guild_id" + "id" ] }, - "Badge": { + "ProfileBadge": { "type": "object", "properties": { "id": { diff --git a/assets/schemas.json b/assets/schemas.json
index cceb08a2..00200007 100644 --- a/assets/schemas.json +++ b/assets/schemas.json
@@ -1636,19 +1636,214 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "DiscoverableGuildsResponse": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "guilds": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscoverableGuild" + } + }, + "offset": { + "type": "integer" + }, + "limit": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "guilds", + "limit", + "offset", + "total" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "DmMessagesResponseSchema": { + "type": "array", + "items": { + "$ref": "#/definitions/PartialMessage" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "EmailDomainLookupResponse": { + "type": "object", + "properties": { + "guilds_info": { + "type": "array", + "items": { + "$ref": "#/definitions/HubGuild" + } + }, + "has_matching_guild": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "guilds_info", + "has_matching_guild" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "EmailDomainLookupVerifyCodeResponse": { + "type": "object", + "properties": { + "guild": { + "$ref": "#/definitions/Guild" + }, + "joined": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "guild", + "joined" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "InstanceUserDeleteSchema": { "$ref": "#/definitions/InstanceUserDeleteSchemaContent", "$schema": "http://json-schema.org/draft-07/schema#" }, + "SessionsLogoutSchema": { + "type": "object", + "properties": { + "session_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "session_id_hashes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GetSessionsResponse": { + "type": "object", + "properties": { + "user_sessions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "id_hash": { + "type": "string" + }, + "status": { + "type": "string" + }, + "activities": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Activity" + } + } + }, + "client_status": { + "$ref": "#/definitions/ClientStatus" + }, + "approx_last_used_time": { + "type": "string" + }, + "client_info": { + "type": "object", + "properties": { + "client": { + "type": "string" + }, + "os": { + "type": "string" + }, + "version": { + "type": "integer" + }, + "location": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "client", + "location", + "os", + "version" + ] + }, + "last_seen": { + "type": "string", + "format": "date-time" + }, + "last_seen_ip": { + "type": "string" + }, + "last_seen_location": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "activities", + "approx_last_used_time", + "client_info", + "client_status", + "id", + "id_hash", + "status" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "user_sessions" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "UserSettingsUpdateSchema": { "type": "object", "properties": { + "activity_restricted_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "activity_joining_restricted_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, "afk_timeout": { "type": "integer" }, "allow_accessibility_detection": { "type": "boolean" }, + "allow_activity_party_privacy_friends": { + "type": "boolean" + }, + "allow_activity_party_privacy_voice_channel": { + "type": "boolean" + }, "animate_emoji": { "type": "boolean" }, @@ -1693,10 +1888,14 @@ "type": "integer" }, "friend_source_flags": { - "$ref": "#/definitions/FriendSourceFlags" - }, - "gateway_connected": { - "type": "boolean" + "anyOf": [ + { + "$ref": "#/definitions/FriendSourceFlags" + }, + { + "type": "null" + } + ] }, "gif_auto_play": { "type": "boolean" @@ -1707,12 +1906,6 @@ "$ref": "#/definitions/GuildFolder" } }, - "guild_positions": { - "type": "array", - "items": { - "type": "string" - } - }, "inline_attachment_media": { "type": "boolean" }, @@ -1728,6 +1921,9 @@ "native_phone_integration_enabled": { "type": "boolean" }, + "passwordless": { + "type": "boolean" + }, "render_embeds": { "type": "boolean" }, @@ -1743,6 +1939,12 @@ "show_current_game": { "type": "boolean" }, + "slayer_sdk_receive_dms_in_game": { + "type": "integer" + }, + "soundboard_volume": { + "type": "integer" + }, "status": { "enum": [ "dnd", @@ -1759,13 +1961,18 @@ "theme": { "enum": [ "dark", - "light" + "darker", + "light", + "midnight" ], "type": "string" }, "timezone_offset": { "type": "integer" }, + "view_nsfw_commands": { + "type": "boolean" + }, "view_nsfw_guilds": { "type": "boolean" } @@ -1776,12 +1983,30 @@ "UserSettingsSchema": { "type": "object", "properties": { + "activity_restricted_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "activity_joining_restricted_guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, "afk_timeout": { "type": "integer" }, "allow_accessibility_detection": { "type": "boolean" }, + "allow_activity_party_privacy_friends": { + "type": "boolean" + }, + "allow_activity_party_privacy_voice_channel": { + "type": "boolean" + }, "animate_emoji": { "type": "boolean" }, @@ -1826,10 +2051,14 @@ "type": "integer" }, "friend_source_flags": { - "$ref": "#/definitions/FriendSourceFlags" - }, - "gateway_connected": { - "type": "boolean" + "anyOf": [ + { + "$ref": "#/definitions/FriendSourceFlags" + }, + { + "type": "null" + } + ] }, "gif_auto_play": { "type": "boolean" @@ -1840,12 +2069,6 @@ "$ref": "#/definitions/GuildFolder" } }, - "guild_positions": { - "type": "array", - "items": { - "type": "string" - } - }, "inline_attachment_media": { "type": "boolean" }, @@ -1861,6 +2084,9 @@ "native_phone_integration_enabled": { "type": "boolean" }, + "passwordless": { + "type": "boolean" + }, "render_embeds": { "type": "boolean" }, @@ -1876,6 +2102,12 @@ "show_current_game": { "type": "boolean" }, + "slayer_sdk_receive_dms_in_game": { + "type": "integer" + }, + "soundboard_volume": { + "type": "integer" + }, "status": { "enum": [ "dnd", @@ -1892,21 +2124,30 @@ "theme": { "enum": [ "dark", - "light" + "darker", + "light", + "midnight" ], "type": "string" }, "timezone_offset": { "type": "integer" }, + "view_nsfw_commands": { + "type": "boolean" + }, "view_nsfw_guilds": { "type": "boolean" } }, "additionalProperties": false, "required": [ + "activity_joining_restricted_guild_ids", + "activity_restricted_guild_ids", "afk_timeout", "allow_accessibility_detection", + "allow_activity_party_privacy_friends", + "allow_activity_party_privacy_voice_channel", "animate_emoji", "animate_stickers", "contact_sync_enabled", @@ -1920,132 +2161,29 @@ "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", + "passwordless", "render_embeds", "render_reactions", "restricted_guilds", "show_current_game", + "slayer_sdk_receive_dms_in_game", + "soundboard_volume", "status", "stream_notifications_enabled", "theme", "timezone_offset", + "view_nsfw_commands", "view_nsfw_guilds" ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "SessionsLogoutSchema": { - "type": "object", - "properties": { - "session_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "session_id_hashes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "GetSessionsResponse": { - "type": "object", - "properties": { - "user_sessions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "id_hash": { - "type": "string" - }, - "status": { - "type": "string" - }, - "activities": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Activity" - } - } - }, - "client_status": { - "$ref": "#/definitions/ClientStatus" - }, - "approx_last_used_time": { - "type": "string" - }, - "client_info": { - "type": "object", - "properties": { - "client": { - "type": "string" - }, - "os": { - "type": "string" - }, - "version": { - "type": "integer" - }, - "location": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "client", - "location", - "os", - "version" - ] - }, - "last_seen": { - "type": "string", - "format": "date-time" - }, - "last_seen_ip": { - "type": "string" - }, - "last_seen_location": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "activities", - "approx_last_used_time", - "client_info", - "client_status", - "id", - "id_hash", - "status" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "user_sessions" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "EmojisResponse": { "type": "array", "items": { @@ -2113,78 +2251,6 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "DiscoverableGuildsResponse": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "guilds": { - "type": "array", - "items": { - "$ref": "#/definitions/DiscoverableGuild" - } - }, - "offset": { - "type": "integer" - }, - "limit": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "guilds", - "limit", - "offset", - "total" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "DmMessagesResponseSchema": { - "type": "array", - "items": { - "$ref": "#/definitions/PartialMessage" - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "EmailDomainLookupResponse": { - "type": "object", - "properties": { - "guilds_info": { - "type": "array", - "items": { - "$ref": "#/definitions/HubGuild" - } - }, - "has_matching_guild": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "guilds_info", - "has_matching_guild" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "EmailDomainLookupVerifyCodeResponse": { - "type": "object", - "properties": { - "guild": { - "$ref": "#/definitions/Guild" - }, - "joined": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "guild", - "joined" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "EmojiSourceResponse": { "type": "object", "properties": { @@ -3160,6 +3226,37 @@ "items": { "$ref": "#/definitions/Team" }, + "definitions": { + "Team": { + "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" + }, + "name": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "owner_user_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": [ + "icon", + "id", + "name", + "owner_user_id" + ] + } + }, "$schema": "http://json-schema.org/draft-07/schema#" }, "TokenResponse": { @@ -3169,7 +3266,7 @@ "type": "string" }, "settings": { - "$ref": "#/definitions/UserSettings" + "$ref": "#/definitions/UserSettingsSchema" } }, "additionalProperties": false, @@ -4884,9 +4981,6 @@ "flags": { "type": "integer" }, - "verified": { - "type": "boolean" - }, "premium_since": { "type": "string", "format": "date-time" @@ -4951,6 +5045,9 @@ "phone": { "type": "string" }, + "verified": { + "type": "boolean" + }, "nsfw_allowed": { "type": "boolean" }, @@ -5021,9 +5118,6 @@ "flags": { "type": "integer" }, - "verified": { - "type": "boolean" - }, "premium_since": { "type": "string", "format": "date-time" @@ -5088,6 +5182,9 @@ "phone": { "type": "string" }, + "verified": { + "type": "boolean" + }, "nsfw_allowed": { "type": "boolean" }, @@ -5528,6 +5625,156 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "ProfileMetadataResponse": { + "type": "object", + "properties": { + "pronouns": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "banner": { + "type": [ + "null", + "string" + ] + }, + "accent_color": { + "type": [ + "null", + "integer" + ] + }, + "theme_colors": { + "anyOf": [ + { + "type": "array", + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + } + ], + "minItems": 2, + "maxItems": 2 + }, + { + "type": "null" + } + ] + }, + "popout_animation_particle_type": { + "type": [ + "null", + "string" + ] + }, + "emoji": { + "anyOf": [ + { + "$ref": "#/definitions/EmojiResponse" + }, + { + "type": "null" + } + ] + }, + "profile_effect": { + "anyOf": [ + { + "$ref": "#/definitions/ProfileEffect" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "required": [ + "pronouns" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GuildProfileMetadataResponse": { + "type": "object", + "properties": { + "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" + }, + "accent_color": { + "type": "null" + }, + "pronouns": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "banner": { + "type": [ + "null", + "string" + ] + }, + "theme_colors": { + "anyOf": [ + { + "type": "array", + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + } + ], + "minItems": 2, + "maxItems": 2 + }, + { + "type": "null" + } + ] + }, + "popout_animation_particle_type": { + "type": [ + "null", + "string" + ] + }, + "emoji": { + "anyOf": [ + { + "$ref": "#/definitions/EmojiResponse" + }, + { + "type": "null" + } + ] + }, + "profile_effect": { + "anyOf": [ + { + "$ref": "#/definitions/ProfileEffect" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "required": [ + "guild_id", + "pronouns" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "UserProfileResponse": { "type": "object", "properties": { @@ -5548,19 +5795,7 @@ "mutual_guilds": { "type": "array", "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "nick": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "id" - ] + "$ref": "#/definitions/MutualGuild" } }, "premium_type": { @@ -5570,18 +5805,18 @@ "type": "integer" }, "user_profile": { - "$ref": "#/definitions/UserProfile" + "$ref": "#/definitions/ProfileMetadataResponse" }, "guild_member": { "$ref": "#/definitions/PublicMember" }, "guild_member_profile": { - "$ref": "#/definitions/PublicMemberProfile" + "$ref": "#/definitions/GuildProfileMetadataResponse" }, "badges": { "type": "array", "items": { - "$ref": "#/definitions/Badge" + "$ref": "#/definitions/ProfileBadge" } } }, @@ -9467,82 +9702,169 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "InstanceUserDeleteSchemaContent": { + "DiscoverableGuild": { "type": "object", "properties": { - "reason": { + "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" }, - "persistInstanceBan": { - "type": "boolean" - } - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "CustomStatus": { - "type": "object", - "properties": { - "emoji_id": { + "name": { "type": "string" }, - "emoji_name": { - "type": "string" + "icon": { + "type": [ + "null", + "string" + ] }, - "expires_at": { - "type": "integer" + "description": { + "type": [ + "null", + "string" + ] }, - "text": { - "type": "string" - } - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "FriendSourceFlags": { - "type": "object", - "properties": { - "all": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "all" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "GuildFolder": { - "type": "object", - "properties": { - "color": { + "banner": { "type": [ "null", - "integer" + "string" ] }, - "guild_ids": { + "splash": { + "type": [ + "null", + "string" + ] + }, + "discovery_splash": { + "type": [ + "null", + "string" + ] + }, + "features": { "type": "array", "items": { "type": "string" } }, - "id": { + "vanity_url_code": { "type": [ "null", - "integer" + "string" ] }, - "name": { + "preferred_locale": { + "type": "string" + }, + "premium_subscription_count": { + "type": "integer" + }, + "approximate_member_count": { + "type": "integer" + }, + "approximate_presence_count": { + "type": "integer" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/definitions/EmojiResponse" + } + }, + "emoji_count": { + "type": "integer" + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/StickerResponse" + } + }, + "sticker_count": { + "type": "integer" + }, + "auto_removed": { + "type": "boolean" + }, + "primary_category_id": { + "type": "integer" + }, + "primary_category": { + "$ref": "#/definitions/DiscoveryCategory" + }, + "keywords": { + "type": "array", + "items": { + "type": "string" + } + }, + "is_published": { + "type": "boolean" + }, + "reasons_to_join": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscoveryReason" + } + }, + "social_links": { + "type": "array", + "items": { + "type": "string" + } + }, + "about": { "type": [ "null", "string" ] + }, + "category_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscoveryCategory" + } + }, + "created_at": { + "type": "string" + }, + "nsfw_properties": { + "anyOf": [ + { + "$ref": "#/definitions/DiscoveryNsfwProperties" + }, + { + "type": "null" + } + ] } }, "additionalProperties": false, "required": [ - "guild_ids" + "approximate_member_count", + "approximate_presence_count", + "auto_removed", + "banner", + "description", + "discovery_splash", + "features", + "icon", + "id", + "is_published", + "keywords", + "name", + "preferred_locale", + "premium_subscription_count", + "primary_category_id", + "splash", + "vanity_url_code" ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -9781,172 +10103,6 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "DiscoverableGuild": { - "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" - }, - "name": { - "type": "string" - }, - "icon": { - "type": [ - "null", - "string" - ] - }, - "description": { - "type": [ - "null", - "string" - ] - }, - "banner": { - "type": [ - "null", - "string" - ] - }, - "splash": { - "type": [ - "null", - "string" - ] - }, - "discovery_splash": { - "type": [ - "null", - "string" - ] - }, - "features": { - "type": "array", - "items": { - "type": "string" - } - }, - "vanity_url_code": { - "type": [ - "null", - "string" - ] - }, - "preferred_locale": { - "type": "string" - }, - "premium_subscription_count": { - "type": "integer" - }, - "approximate_member_count": { - "type": "integer" - }, - "approximate_presence_count": { - "type": "integer" - }, - "emojis": { - "type": "array", - "items": { - "$ref": "#/definitions/EmojiResponse" - } - }, - "emoji_count": { - "type": "integer" - }, - "stickers": { - "type": "array", - "items": { - "$ref": "#/definitions/StickerResponse" - } - }, - "sticker_count": { - "type": "integer" - }, - "auto_removed": { - "type": "boolean" - }, - "primary_category_id": { - "type": "integer" - }, - "primary_category": { - "$ref": "#/definitions/DiscoveryCategory" - }, - "keywords": { - "type": "array", - "items": { - "type": "string" - } - }, - "is_published": { - "type": "boolean" - }, - "reasons_to_join": { - "type": "array", - "items": { - "$ref": "#/definitions/DiscoveryReason" - } - }, - "social_links": { - "type": "array", - "items": { - "type": "string" - } - }, - "about": { - "type": [ - "null", - "string" - ] - }, - "category_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "categories": { - "type": "array", - "items": { - "$ref": "#/definitions/DiscoveryCategory" - } - }, - "created_at": { - "type": "string" - }, - "nsfw_properties": { - "anyOf": [ - { - "$ref": "#/definitions/DiscoveryNsfwProperties" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "required": [ - "approximate_member_count", - "approximate_presence_count", - "auto_removed", - "banner", - "description", - "discovery_splash", - "features", - "icon", - "id", - "is_published", - "keywords", - "name", - "preferred_locale", - "premium_subscription_count", - "primary_category_id", - "splash", - "vanity_url_code" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "StickerType": { "type": "number", "enum": [ @@ -11345,7 +11501,9 @@ "theme": { "enum": [ "dark", - "light" + "darker", + "light", + "midnight" ], "type": "string", "default": "dark" @@ -11398,6 +11556,75 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "CustomStatus": { + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "integer" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "FriendSourceFlags": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "mutual_friends": { + "type": "boolean" + }, + "mutual_guilds": { + "type": "boolean" + } + }, + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GuildFolder": { + "type": "object", + "properties": { + "color": { + "type": [ + "null", + "integer" + ] + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": [ + "null", + "integer" + ] + }, + "name": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false, + "required": [ + "guild_ids" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "SecurityKey": { "type": "object", "properties": { @@ -14390,6 +14617,19 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "InstanceUserDeleteSchemaContent": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "persistInstanceBan": { + "type": "boolean" + } + }, + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, "EmojiGuild": { "type": "object", "properties": { @@ -14729,7 +14969,7 @@ "type": "integer" }, "type": { - "type": "integer" + "$ref": "#/definitions/HubDirectoryEntryType" } }, "additionalProperties": false, @@ -14744,6 +14984,14 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "HubDirectoryEntryType": { + "type": "number", + "enum": [ + 0, + 1 + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "PublicMessage": { "type": "object", "properties": { @@ -15552,29 +15800,17 @@ "BackupCode": { "type": "object", "properties": { - "user": { - "$ref": "#/definitions/User" - }, "code": { "type": "string" }, "consumed": { "type": "boolean" - }, - "expired": { - "type": "boolean" - }, - "id": { - "type": "string" } }, "additionalProperties": false, "required": [ "code", - "consumed", - "expired", - "id", - "user" + "consumed" ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -16550,80 +16786,64 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "PublicConnectedAccount": { + "ProfileEffect": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "type": { + "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" }, - "verified": { - "type": "boolean" + "expires_at": { + "type": [ + "null", + "integer" + ] } }, "additionalProperties": false, "required": [ - "name", - "type" + "expires_at", + "id" ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "UserProfile": { + "PublicConnectedAccount": { "type": "object", "properties": { - "banner": { - "type": "string" - }, - "bio": { + "name": { "type": "string" }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { + "type": { "type": "string" }, - "accent_color": { - "type": "integer" + "verified": { + "type": "boolean" } }, "additionalProperties": false, "required": [ - "bio" + "name", + "type" ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "PublicMemberProfile": { - "additionalProperties": false, + "MutualGuild": { "type": "object", "properties": { - "guild_id": { - "type": "string" - }, - "banner": { + "id": { "type": "string" }, - "bio": { + "nick": { "type": "string" - }, - "accent_color": { - "type": "null" } }, + "additionalProperties": false, "required": [ - "accent_color", - "banner", - "bio", - "guild_id" + "id" ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "Badge": { + "ProfileBadge": { "type": "object", "properties": { "id": { diff --git a/src/api/routes/users/@me/settings.ts b/src/api/routes/users/@me/settings.ts
index c4dfb5da..abe73131 100644 --- a/src/api/routes/users/@me/settings.ts +++ b/src/api/routes/users/@me/settings.ts
@@ -68,7 +68,11 @@ router.patch( relations: { settings: true }, }); - if (!user.settings) user.settings = UserSettings.create<UserSettings>(body); + if (!user.settings) + user.settings = UserSettings.create<UserSettings>({ + ...body, + friend_source_flags: body.friend_source_flags ?? { all: true }, + }); else user.settings.assign(body); if (body.guild_folders) user.settings.guild_folders = body.guild_folders; diff --git a/src/database/entities/Guild.ts b/src/database/entities/Guild.ts
index 62df6011..6a6a0b93 100644 --- a/src/database/entities/Guild.ts +++ b/src/database/entities/Guild.ts
@@ -18,7 +18,7 @@ import { Column, Entity, JoinColumn, ManyToOne, OneToMany, RelationId } from "typeorm"; import { arrayRemove } from "@spacebar/extensions"; -import { Config, GuildWelcomeScreen, Snowflake, handleFile } from "@spacebar/util"; +import { Config, Snowflake, handleFile } from "@spacebar/util"; import { Ban } from "./Ban"; import { BaseClass } from "./BaseClass"; import { Channel } from "./Channel"; @@ -31,7 +31,7 @@ import { Template } from "./Template"; import { User } from "./User"; import { VoiceState } from "./VoiceState"; import { Webhook } from "./Webhook"; -import { DiscoverableGuild, IntegrationGuild } from "@spacebar/schemas"; +import { DiscoverableGuild, GuildWelcomeScreen, IntegrationGuild } from "@spacebar/schemas"; import { Categories } from "@spacebar/database"; // TODO: application_command_count, application_command_counts: {1: 0, 2: 0, 3: 0} // TODO: guild_scheduled_events diff --git a/src/database/entities/Session.ts b/src/database/entities/Session.ts
index be84dc00..6018c529 100644 --- a/src/database/entities/Session.ts +++ b/src/database/entities/Session.ts
@@ -19,10 +19,11 @@ import crypto from "node:crypto"; import { Column, CreateDateColumn, Entity, Index, JoinColumn, ManyToOne, PrimaryColumn, RelationId } from "typeorm"; import { DateBuilder, TimeSpan, Random } from "@spacebar/extensions"; +import { ClientStatus, PrivateStatus } from "@spacebar/schemas"; +import { IpDataClient } from "@spacebar/util/util/networking"; +import { Activity, GatewaySession, GatewaySessionClientInfo } from "../../util/interfaces"; import { User } from "./User"; import { BaseClassWithoutId } from "./BaseClass"; -import { Activity, ClientStatus, GatewaySession, GatewaySessionClientInfo, PrivateStatus } from "../../util/interfaces"; -import { IpDataClient } from "@spacebar/util/util/networking"; @Entity({ name: "sessions", diff --git a/src/database/entities/UserSettings.ts b/src/database/entities/UserSettings.ts
index 7ccb8e1e..b8afaa4a 100644 --- a/src/database/entities/UserSettings.ts +++ b/src/database/entities/UserSettings.ts
@@ -118,7 +118,7 @@ export class UserSettings extends BaseClassWithoutId { stream_notifications_enabled: boolean = false; @Column({ nullable: true }) - theme: "dark" | "light" = "dark"; // dark + theme: "dark" | "light" | "darker" | "midnight" = "dark"; // dark @Column({ nullable: true }) timezone_offset: number = 0; // e.g -60 diff --git a/src/gateway/opcodes/PresenceUpdate.ts b/src/gateway/opcodes/PresenceUpdate.ts
index a0be5f65..abd2f026 100644 --- a/src/gateway/opcodes/PresenceUpdate.ts +++ b/src/gateway/opcodes/PresenceUpdate.ts
@@ -18,8 +18,8 @@ import { Session, User } from "@spacebar/database"; import { WebSocket, Payload } from "@spacebar/gateway"; -import { emitEvent, InternalStatusOrder, PresenceUpdateEvent, PrivateStatus } from "@spacebar/util"; -import { ActivitySchema } from "@spacebar/schemas"; +import { emitEvent, PresenceUpdateEvent } from "@spacebar/util"; +import { ActivitySchema, InternalStatusOrder, PrivateStatus } from "@spacebar/schemas"; import { check } from "./instanceOf"; export async function onPresenceUpdate(this: WebSocket, { d }: Payload) { diff --git a/src/schemas/api/guilds/index.ts b/src/schemas/api/guilds/index.ts
index eee86bce..8c638422 100644 --- a/src/schemas/api/guilds/index.ts +++ b/src/schemas/api/guilds/index.ts
@@ -17,6 +17,7 @@ */ export * from "./AuditLog"; export * from "./Automod"; +export * from "./Emoji"; export * from "./GuildProfileResponse"; export * from "./GuildSchema"; export * from "./Role"; diff --git a/src/schemas/api/messages/index.ts b/src/schemas/api/messages/index.ts
index 1533dd0c..ca8bf938 100644 --- a/src/schemas/api/messages/index.ts +++ b/src/schemas/api/messages/index.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +export * from "./Attachments"; export * from "./Components"; export * from "./Embeds"; export * from "./Message"; diff --git a/src/schemas/api/spacebar/AttachmentListResponse.ts b/src/schemas/api/spacebar/AttachmentListResponse.ts
index fe10bde7..26afb154 100644 --- a/src/schemas/api/spacebar/AttachmentListResponse.ts +++ b/src/schemas/api/spacebar/AttachmentListResponse.ts
@@ -16,8 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { PublicAttachment } from "@spacebar/schemas/api/messages/Attachments"; -import { MessageReferenceIds } from "@spacebar/schemas"; +import { MessageReferenceIds, PublicAttachment } from "@spacebar/schemas"; export interface AttachmentListResponse { items: { diff --git a/src/schemas/api/users/ConnectedAccount.ts b/src/schemas/api/users/ConnectedAccount.ts
index 0779a769..b5d21b57 100644 --- a/src/schemas/api/users/ConnectedAccount.ts +++ b/src/schemas/api/users/ConnectedAccount.ts
@@ -16,7 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -//TODO: remove entity import -import { ConnectedAccount } from "@spacebar/database"; - -export type PublicConnectedAccount = Pick<ConnectedAccount, "name" | "type" | "verified">; +export interface PublicConnectedAccount { + name: string; + type: string; + verified?: boolean; +} diff --git a/src/schemas/api/users/SessionsSchemas.ts b/src/schemas/api/users/SessionsSchemas.ts
index 34ad0c64..c7486352 100644 --- a/src/schemas/api/users/SessionsSchemas.ts +++ b/src/schemas/api/users/SessionsSchemas.ts
@@ -16,9 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { ActivitySchema, Snowflake } from "@spacebar/schemas"; -// TODO: remove entity import -import { ClientStatus } from "@spacebar/util"; +import { ActivitySchema, ClientStatus, Snowflake } from "@spacebar/schemas"; export type SessionsLogoutSchema = { session_ids?: Snowflake[]; session_id_hashes?: string[] }; export type GetSessionsResponse = { user_sessions: DeviceInfo[] }; diff --git a/src/util/interfaces/Status.ts b/src/schemas/api/users/Status.ts
index 78ea0ce7..78ea0ce7 100644 --- a/src/util/interfaces/Status.ts +++ b/src/schemas/api/users/Status.ts
diff --git a/src/schemas/api/users/UserSettings.ts b/src/schemas/api/users/UserSettings.ts
index 457d6f4c..d5ff664e 100644 --- a/src/schemas/api/users/UserSettings.ts +++ b/src/schemas/api/users/UserSettings.ts
@@ -16,11 +16,17 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import { Snowflake } from "@spacebar/schemas"; + export type UserSettingsUpdateSchema = Partial<UserSettingsSchema>; export interface UserSettingsSchema { + activity_restricted_guild_ids: Snowflake[]; + activity_joining_restricted_guild_ids: Snowflake[]; afk_timeout: number; allow_accessibility_detection: boolean; + allow_activity_party_privacy_friends: boolean; + allow_activity_party_privacy_voice_channel: boolean; animate_emoji: boolean; animate_stickers: number; contact_sync_enabled: boolean; @@ -33,24 +39,26 @@ export interface UserSettingsSchema { enable_tts_command: boolean; explicit_content_filter: number; friend_discovery_flags: number; - friend_source_flags: FriendSourceFlags; - gateway_connected: boolean; + friend_source_flags: FriendSourceFlags | null; 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; + passwordless: boolean; render_embeds: boolean; render_reactions: boolean; restricted_guilds: string[]; show_current_game: boolean; + slayer_sdk_receive_dms_in_game: number; + soundboard_volume: number; status: "online" | "offline" | "dnd" | "idle" | "invisible"; stream_notifications_enabled: boolean; - theme: "dark" | "light"; // dark + theme: "dark" | "light" | "darker" | "midnight"; // dark timezone_offset: number; // e.g -60 + view_nsfw_commands: boolean; view_nsfw_guilds: boolean; } @@ -69,5 +77,7 @@ export interface GuildFolder { } export interface FriendSourceFlags { - all: boolean; + all?: boolean; + mutual_friends?: boolean; + mutual_guilds?: boolean; } diff --git a/src/schemas/api/users/index.ts b/src/schemas/api/users/index.ts
index 5c9b2008..21a9661a 100644 --- a/src/schemas/api/users/index.ts +++ b/src/schemas/api/users/index.ts
@@ -19,6 +19,7 @@ export * from "./ConnectedAccount"; export * from "./InstanceUserDeleteSchema"; export * from "./Member"; +export * from "./SessionsSchemas"; +export * from "./Status"; export * from "./User"; export * from "./UserSettings"; -export * from "./SessionsSchemas"; diff --git a/src/schemas/responses/DiscoverableGuildsResponse.ts b/src/schemas/responses/DiscoverableGuildsResponse.ts
index 6eb3de8d..b091aaf1 100644 --- a/src/schemas/responses/DiscoverableGuildsResponse.ts +++ b/src/schemas/responses/DiscoverableGuildsResponse.ts
@@ -16,8 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Snowflake, StickerResponse } from "@spacebar/schemas"; -import { EmojiResponse } from "@spacebar/schemas/api/guilds/Emoji"; +import { EmojiResponse, Snowflake, StickerResponse } from "@spacebar/schemas"; export interface DiscoverableGuildsResponse { total: number; diff --git a/src/schemas/responses/GuildCreateResponse.ts b/src/schemas/responses/GuildCreateResponse.ts
index cd115cf3..42caf88b 100644 --- a/src/schemas/responses/GuildCreateResponse.ts +++ b/src/schemas/responses/GuildCreateResponse.ts
@@ -16,9 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -// TODO: remove import from util -import { GuildWelcomeScreen } from "@spacebar/util"; -import { GuildUpdateSchema } from "@spacebar/schemas"; +import { GuildUpdateSchema, GuildWelcomeScreen } from "@spacebar/schemas"; export interface GuildCreateResponse extends Omit<GuildUpdateSchema, "name"> { id: string; diff --git a/src/schemas/responses/GuildMessagesSearchResponse.ts b/src/schemas/responses/GuildMessagesSearchResponse.ts
index df582b65..72583822 100644 --- a/src/schemas/responses/GuildMessagesSearchResponse.ts +++ b/src/schemas/responses/GuildMessagesSearchResponse.ts
@@ -16,10 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -// TODO: remove dependency on entities -import { Role } from "@spacebar/database"; -import { BaseMessageComponents, Embed, MessageType, Poll, PublicUser, RoleResponse } from "@spacebar/schemas"; -import { PublicAttachment } from "../api/messages/Attachments"; +import { BaseMessageComponents, Embed, MessageType, Poll, PublicUser, RoleResponse, PublicAttachment } from "@spacebar/schemas"; export interface GuildMessagesSearchMessage { id: string; diff --git a/src/schemas/responses/GuildWelcomeScreen.ts b/src/schemas/responses/GuildWelcomeScreen.ts new file mode 100644
index 00000000..d51f3de8 --- /dev/null +++ b/src/schemas/responses/GuildWelcomeScreen.ts
@@ -0,0 +1,28 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 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 <https://www.gnu.org/licenses/>. +*/ + +export interface GuildWelcomeScreen { + enabled: boolean; + description: string; + welcome_channels: { + description: string; + emoji_id?: string; + emoji_name?: string; + channel_id: string; + }[]; +} diff --git a/src/schemas/responses/GuildWidgetJsonResponse.ts b/src/schemas/responses/GuildWidgetJsonResponse.ts
index 84fb9913..258b51e6 100644 --- a/src/schemas/responses/GuildWidgetJsonResponse.ts +++ b/src/schemas/responses/GuildWidgetJsonResponse.ts
@@ -16,8 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -// TODO: remove util import -import { ClientStatus } from "@spacebar/util"; +import { ClientStatus } from "@spacebar/schemas/api/users/Status"; export interface GuildWidgetJsonResponse { id: string; diff --git a/src/schemas/responses/HubDirectoryEntriesResponse.ts b/src/schemas/responses/HubDirectoryEntriesResponse.ts
index fc710aa2..f4b15e68 100644 --- a/src/schemas/responses/HubDirectoryEntriesResponse.ts +++ b/src/schemas/responses/HubDirectoryEntriesResponse.ts
@@ -26,7 +26,21 @@ export interface HubDirectoryEntry { directory_channel_id: string; guild: Guild; primary_category_id: number; - type: number; // TODO: not exactly sure what this is, channel type? + type: HubDirectoryEntryType; +} + +export enum HubDirectoryEntryType { + GUILD = 0, + GUILD_SCHEDULED_EVENT = 1, +} + +export enum HubDirectoryCategory { + UNCATEGORIZED = 0, + SCHOOL_CLUB = 1, + CLASS = 2, + STUDY_SOCIAL = 3, + SUBJECT_MAJOR = 4, + MISC = 5, } export type HubDirectoryEntriesResponse = HubDirectoryEntry[]; diff --git a/src/schemas/responses/MemberJoinGuildResponse.ts b/src/schemas/responses/MemberJoinGuildResponse.ts
index 87e50239..9d2420fb 100644 --- a/src/schemas/responses/MemberJoinGuildResponse.ts +++ b/src/schemas/responses/MemberJoinGuildResponse.ts
@@ -16,8 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { GuildCreateResponse, RoleResponse, StickerResponse } from "@spacebar/schemas"; -import { EmojiResponse } from "@spacebar/schemas/api/guilds/Emoji"; +import { GuildCreateResponse, RoleResponse, StickerResponse, EmojiResponse } from "@spacebar/schemas"; export interface MemberJoinGuildResponse { guild: GuildCreateResponse; diff --git a/src/schemas/responses/TeamListResponse.ts b/src/schemas/responses/TeamListResponse.ts
index fc4d93e2..ac568381 100644 --- a/src/schemas/responses/TeamListResponse.ts +++ b/src/schemas/responses/TeamListResponse.ts
@@ -17,6 +17,19 @@ */ // TODO: remove entity import -import { Team } from "@spacebar/database"; +import { Snowflake } from "@spacebar/schemas"; + +export interface Team { + id: Snowflake; + name: string; + icon: string | null; + owner_user_id: Snowflake; + // members?: TeamMember[]; // TODO: only in application object + // TODO: only on Get/List Team(s) w/ include_payout_account_status=true + // payout_account_status?: TeamPayoutAccountStatus | null; + // payout_account_statuses?: TeamPayoutAccount[]; + // TODO: Get Team only + // stripe_connect_account_id?: string; +} export type TeamListResponse = Team[]; diff --git a/src/schemas/responses/TokenResponse.ts b/src/schemas/responses/TokenResponse.ts
index 88ac5e20..9239c121 100644 --- a/src/schemas/responses/TokenResponse.ts +++ b/src/schemas/responses/TokenResponse.ts
@@ -16,12 +16,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -// TODO: remove dependency on entities -import { BackupCode, UserSettings } from "@spacebar/database"; +import { BackupCode, UserSettingsSchema } from "@spacebar/schemas"; export interface TokenResponse { token: string; - settings: UserSettings; + settings: UserSettingsSchema; } export interface TokenOnlyResponse { diff --git a/src/schemas/responses/TypedResponses.ts b/src/schemas/responses/TypedResponses.ts
index f7bd7712..e4311420 100644 --- a/src/schemas/responses/TypedResponses.ts +++ b/src/schemas/responses/TypedResponses.ts
@@ -20,7 +20,7 @@ import { GeneralConfiguration, LimitsConfiguration } from "../../util/config/types"; import { DmChannelDTO } from "../../util/dtos"; // TODO: remove entity imports -import { Application, BackupCode, Categories, Channel, Guild, Invite, Member, Template, Webhook } from "@spacebar/database"; +import { Application, Categories, Channel, Guild, Invite, Template } from "@spacebar/database"; import { GuildCreateResponse, PrivateUser, PublicUser } from "@spacebar/schemas"; // TODO: remove this entire file! diff --git a/src/schemas/responses/UserProfileResponse.ts b/src/schemas/responses/UserProfileResponse.ts
index daf0c460..efb1fba1 100644 --- a/src/schemas/responses/UserProfileResponse.ts +++ b/src/schemas/responses/UserProfileResponse.ts
@@ -1,6 +1,6 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Copyright (C) 2026 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 @@ -16,20 +16,40 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -// TODO: remove entity imports -import { Badge, Member, User } from "@spacebar/database"; -import { PublicConnectedAccount, PublicMember, PublicUser } from "@spacebar/schemas"; +import { EmojiResponse, PublicConnectedAccount, PublicMember, PublicUser, Snowflake } from "@spacebar/schemas"; -export type MutualGuild = { +export interface ProfileBadge { + id: string; + description: string; + icon: string; + link?: string; +} + +export interface MutualGuild { id: string; nick?: string; -}; +} -export type PublicMemberProfile = Pick<Member, "banner" | "bio" | "guild_id"> & { - accent_color: null; // TODO -}; +export interface ProfileMetadataResponse { + pronouns: string; + bio?: string; + banner?: string | null; + accent_color?: number | null; + theme_colors?: [number, number] | null; + popout_animation_particle_type?: Snowflake | null; + emoji?: EmojiResponse | null; + profile_effect?: ProfileEffect | null; +} + +export interface GuildProfileMetadataResponse extends ProfileMetadataResponse { + guild_id: Snowflake; + accent_color?: null; // ignored by clients +} -export type UserProfile = Pick<User, "bio" | "accent_color" | "banner" | "pronouns" | "theme_colors">; +export interface ProfileEffect { + id: Snowflake; + expires_at: number | null; +} export interface UserProfileResponse { user: PublicUser; @@ -39,8 +59,8 @@ export interface UserProfileResponse { mutual_guilds: MutualGuild[]; premium_type: number; profile_themes_experiment_bucket: number; - user_profile: UserProfile; + user_profile: ProfileMetadataResponse; guild_member?: PublicMember; - guild_member_profile?: PublicMemberProfile; - badges: Badge[]; + guild_member_profile?: GuildProfileMetadataResponse; + badges: ProfileBadge[]; } diff --git a/src/schemas/responses/index.ts b/src/schemas/responses/index.ts
index bb870cf9..fa6a884e 100644 --- a/src/schemas/responses/index.ts +++ b/src/schemas/responses/index.ts
@@ -39,6 +39,7 @@ export * from "./GuildPruneResponse"; export * from "./GuildRecommendationsResponse"; export * from "./GuildVanityUrl"; export * from "./GuildVoiceRegionsResponse"; +export * from "./GuildWelcomeScreen"; export * from "./GuildWidgetJsonResponse"; export * from "./GuildWidgetSettingsResponse"; export * from "./HubDirectoryEntriesResponse"; diff --git a/src/schemas/uncategorised/ActivitySchema.ts b/src/schemas/uncategorised/ActivitySchema.ts
index 4e41d660..979139c7 100644 --- a/src/schemas/uncategorised/ActivitySchema.ts +++ b/src/schemas/uncategorised/ActivitySchema.ts
@@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -// TODO: remove entity imports -import { Activity, ClientStatus, SetPrivateStatus, Status } from "@spacebar/util"; +import { ClientStatus, SetPrivateStatus } from "@spacebar/schemas"; +import { Activity } from "@spacebar/util"; export const ActivitySchema = { $afk: Boolean, diff --git a/src/util/interfaces/Event.ts b/src/util/interfaces/Event.ts
index e211044b..a2f6c774 100644 --- a/src/util/interfaces/Event.ts +++ b/src/util/interfaces/Event.ts
@@ -17,7 +17,7 @@ */ import { ConnectedAccount, Invite, Role, Emoji, Channel, User, Sticker, UserSettings, ReadState, ThreadMember } from "@spacebar/database"; -import { Activity, Presence, IReadyGuildDTO, ReadyUserGuildSettingsEntries, ReadyPrivateChannel, GuildOrUnavailable, Snowflake, PrivateStatus } from "@spacebar/util"; +import { Activity, Presence, IReadyGuildDTO, ReadyUserGuildSettingsEntries, ReadyPrivateChannel, GuildOrUnavailable, Snowflake } from "@spacebar/util"; import { JsonValue } from "@protobuf-ts/runtime"; import { ApplicationCommand, @@ -25,6 +25,7 @@ import { Interaction, InteractionFailureReason, PartialEmoji, + PrivateStatus, PublicChannel, PublicMember, PublicMessage, diff --git a/src/util/interfaces/GuildWelcomeScreen.ts b/src/util/interfaces/GuildWelcomeScreen.ts
index d4de4131..e69de29b 100644 --- a/src/util/interfaces/GuildWelcomeScreen.ts +++ b/src/util/interfaces/GuildWelcomeScreen.ts
@@ -1,10 +0,0 @@ -export interface GuildWelcomeScreen { - enabled: boolean; - description: string; - welcome_channels: { - description: string; - emoji_id?: string; - emoji_name?: string; - channel_id: string; - }[]; -} diff --git a/src/util/interfaces/Presence.ts b/src/util/interfaces/Presence.ts
index 40aca8df..8f06850b 100644 --- a/src/util/interfaces/Presence.ts +++ b/src/util/interfaces/Presence.ts
@@ -16,9 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { ClientStatus, Status } from "./Status"; +import { ClientStatus, Status, PublicUser } from "@spacebar/schemas"; import { Activity } from "./Activity"; -import { PublicUser } from "@spacebar/schemas"; export interface Presence { user: PublicUser; diff --git a/src/util/interfaces/index.ts b/src/util/interfaces/index.ts
index 63a3dc6c..d993cefc 100644 --- a/src/util/interfaces/index.ts +++ b/src/util/interfaces/index.ts
@@ -21,4 +21,3 @@ export * from "./ConnectedAccount"; export * from "./Event"; export * from "./GuildWelcomeScreen"; export * from "./Presence"; -export * from "./Status";