summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-09-09 21:00:07 +0200
committerRory& <root@rory.gay>2026-09-12 23:48:59 +0200
commit104e2aa0164387b4da2fa48e0947174d6e1c028a (patch)
treebe96417e2b26956afc50b363929bc9f188cf0fe3
parentFix attachments for webhooks (diff)
downloadserver-ts-104e2aa0164387b4da2fa48e0947174d6e1c028a.tar.xz
Some schema fixes
-rw-r--r--assets/openapi.json617
-rw-r--r--assets/schemas.json626
-rw-r--r--scripts/schemaExclusions.json1
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts2
-rw-r--r--src/api/routes/channels/#channel_id/messages/pins/index.ts2
-rw-r--r--src/api/routes/channels/#channel_id/pins.ts2
-rw-r--r--src/api/routes/channels/#channel_id/webhooks.ts2
-rw-r--r--src/api/routes/channels/preload-messages.ts6
-rw-r--r--src/api/routes/guilds/#guild_id/members/index.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/webhooks.ts2
-rw-r--r--src/api/routes/users/#user_id/index.ts2
-rw-r--r--src/api/routes/users/@me/index.ts2
-rw-r--r--src/schemas/api/channels/Webhook.ts2
-rw-r--r--src/schemas/api/guilds/Emoji.ts18
-rw-r--r--src/schemas/api/guilds/GuildScheduledEvents.ts24
-rw-r--r--src/schemas/api/guilds/GuildSchema.ts35
-rw-r--r--src/schemas/api/guilds/Invite.ts88
-rw-r--r--src/schemas/api/messages/Message.ts2
-rw-r--r--src/schemas/api/users/Member.ts2
-rw-r--r--src/schemas/responses/TypedResponses.ts6
20 files changed, 692 insertions, 751 deletions
diff --git a/assets/openapi.json b/assets/openapi.json

index 62f4cbaa7..cced6947f 100644 --- a/assets/openapi.json +++ b/assets/openapi.json
@@ -1598,6 +1598,12 @@ "InstanceUserDeleteSchema": { "$ref": "#/components/schemas/InstanceUserDeleteSchemaContent" }, + "PublicMemberListResponse": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PublicMember" + } + }, "SessionsLogoutSchema": { "type": "object", "properties": { @@ -3350,201 +3356,6 @@ "widget_enabled" ] }, - "APIPublicUser": { - "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" - }, - "premium_since": { - "type": "string", - "format": "date-time" - }, - "avatar": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { - "type": "string" - }, - "username": { - "type": "string" - }, - "discriminator": { - "type": "string" - }, - "public_flags": { - "type": "integer" - }, - "accent_color": { - "type": "integer" - }, - "bot": { - "type": "boolean" - }, - "premium_type": { - "type": "integer" - }, - "badge_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "avatar_decoration_data": { - "$ref": "#/components/schemas/AvatarDecorationData" - }, - "display_name_styles": { - "$ref": "#/components/schemas/DisplayNameStyle" - }, - "collectibles": { - "$ref": "#/components/schemas/Collectibles" - }, - "primary_guild": { - "$ref": "#/components/schemas/PrimaryGuild" - } - }, - "required": [ - "bio", - "bot", - "discriminator", - "id", - "premium_since", - "premium_type", - "public_flags", - "username" - ] - }, - "APIPrivateUser": { - "type": "object", - "properties": { - "email": { - "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" - }, - "flags": { - "type": "integer" - }, - "premium_since": { - "type": "string", - "format": "date-time" - }, - "avatar": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { - "type": "string" - }, - "username": { - "type": "string" - }, - "discriminator": { - "type": "string" - }, - "public_flags": { - "type": "integer" - }, - "accent_color": { - "type": "integer" - }, - "bot": { - "type": "boolean" - }, - "premium_type": { - "type": "integer" - }, - "badge_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "avatar_decoration_data": { - "$ref": "#/components/schemas/AvatarDecorationData" - }, - "display_name_styles": { - "$ref": "#/components/schemas/DisplayNameStyle" - }, - "collectibles": { - "$ref": "#/components/schemas/Collectibles" - }, - "primary_guild": { - "$ref": "#/components/schemas/PrimaryGuild" - }, - "mfa_enabled": { - "type": "boolean" - }, - "phone": { - "type": "string" - }, - "verified": { - "type": "boolean" - }, - "nsfw_allowed": { - "type": "boolean" - }, - "premium": { - "type": "boolean" - }, - "purchased_flags": { - "type": "integer" - }, - "premium_usage_flags": { - "type": "integer" - }, - "disabled": { - "type": "boolean" - }, - "settings": { - "$ref": "#/components/schemas/UserSettingsSchema" - } - }, - "required": [ - "bio", - "bot", - "disabled", - "discriminator", - "flags", - "id", - "mfa_enabled", - "nsfw_allowed", - "premium", - "premium_since", - "premium_type", - "premium_usage_flags", - "public_flags", - "purchased_flags", - "username", - "verified" - ] - }, "APIGuildArray": { "type": "array", "items": { @@ -6249,6 +6060,12 @@ } } }, + "PublicMessageListResponse": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PublicMessage" + } + }, "PollUserAnswersSchema": { "type": "object", "properties": { @@ -6609,6 +6426,74 @@ "user" ] }, + "WebhookListResponse": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebhookResponse" + } + }, + "WebhookResponse": { + "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": { + "$ref": "#/components/schemas/WebhookType" + }, + "guild_id": { + "type": "string", + "nullable": true + }, + "channel_id": { + "type": "string", + "nullable": true + }, + "user": { + "anyOf": [ + { + "$ref": "#/components/schemas/PartialUser" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string", + "nullable": true + }, + "avatar": { + "type": "string", + "nullable": true + }, + "token": { + "type": "string" + }, + "application_id": { + "type": "string", + "nullable": true + }, + "source_guild": { + "$ref": "#/components/schemas/IntegrationGuild" + }, + "source_channel": { + "$ref": "#/components/schemas/WebhookChannel" + }, + "url": { + "type": "string" + } + }, + "required": [ + "application_id", + "avatar", + "channel_id", + "id", + "name", + "type" + ] + }, "AuditLogResponse": { "type": "object", "properties": { @@ -13832,6 +13717,168 @@ } } }, + "PublicMember": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "flags": { + "type": "integer" + }, + "nick": { + "type": "string" + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "pending": { + "type": "boolean" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "premium_since": { + "type": "integer" + }, + "avatar": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "communication_disabled_until": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "user": { + "$ref": "#/components/schemas/PublicUser" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "banner", + "bio", + "communication_disabled_until", + "deaf", + "flags", + "guild_id", + "id", + "joined_at", + "mute", + "pending", + "roles", + "user" + ] + }, + "PublicUser": { + "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" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "avatar": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "username": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "accent_color": { + "type": "integer" + }, + "bot": { + "type": "boolean" + }, + "premium_type": { + "type": "integer" + }, + "badge_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "avatar_decoration_data": { + "$ref": "#/components/schemas/AvatarDecorationData" + }, + "display_name_styles": { + "$ref": "#/components/schemas/DisplayNameStyle" + }, + "collectibles": { + "$ref": "#/components/schemas/Collectibles" + }, + "primary_guild": { + "$ref": "#/components/schemas/PrimaryGuild" + } + }, + "required": [ + "bio", + "bot", + "discriminator", + "id", + "premium_since", + "premium_type", + "public_flags", + "username" + ] + }, "EmojiGuild": { "type": "object", "properties": { @@ -13991,83 +14038,6 @@ "type" ] }, - "PublicUser": { - "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" - }, - "premium_since": { - "type": "string", - "format": "date-time" - }, - "avatar": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { - "type": "string" - }, - "username": { - "type": "string" - }, - "discriminator": { - "type": "string" - }, - "public_flags": { - "type": "integer" - }, - "accent_color": { - "type": "integer" - }, - "bot": { - "type": "boolean" - }, - "premium_type": { - "type": "integer" - }, - "badge_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "avatar_decoration_data": { - "$ref": "#/components/schemas/AvatarDecorationData" - }, - "display_name_styles": { - "$ref": "#/components/schemas/DisplayNameStyle" - }, - "collectibles": { - "$ref": "#/components/schemas/Collectibles" - }, - "primary_guild": { - "$ref": "#/components/schemas/PrimaryGuild" - } - }, - "required": [ - "bio", - "bot", - "discriminator", - "id", - "premium_since", - "premium_type", - "public_flags", - "username" - ] - }, "RoleTags": { "type": "object", "properties": { @@ -14532,91 +14502,6 @@ "type" ] }, - "PublicMember": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "flags": { - "type": "integer" - }, - "nick": { - "type": "string" - }, - "joined_at": { - "type": "string", - "format": "date-time" - }, - "pending": { - "type": "boolean" - }, - "deaf": { - "type": "boolean" - }, - "mute": { - "type": "boolean" - }, - "premium_since": { - "type": "integer" - }, - "avatar": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { - "type": "string" - }, - "communication_disabled_until": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - }, - "user": { - "$ref": "#/components/schemas/PublicUser" - }, - "roles": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "banner", - "bio", - "communication_disabled_until", - "deaf", - "flags", - "guild_id", - "id", - "joined_at", - "mute", - "pending", - "roles", - "user" - ] - }, "MessageActivity": { "type": "object", "properties": { @@ -18130,7 +18015,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/APIPrivateUser" + "$ref": "#/components/schemas/PrivateUser" } } } @@ -19189,7 +19074,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/APIPublicUser" + "$ref": "#/components/schemas/PublicUser" } } } @@ -21830,7 +21715,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookArray" + "$ref": "#/components/schemas/WebhookListResponse" } } } @@ -23449,7 +23334,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublicMemberArray" + "$ref": "#/components/schemas/PublicMemberListResponse" } } } @@ -25997,7 +25882,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublicMessageArray" + "$ref": "#/components/schemas/PublicMessageListResponse" } } } @@ -26033,7 +25918,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookArray" + "$ref": "#/components/schemas/WebhookListResponse" } } } @@ -26163,7 +26048,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublicMessageArray" + "$ref": "#/components/schemas/PublicMessageListResponse" } } } @@ -27079,7 +26964,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublicMessageArray" + "$ref": "#/components/schemas/PublicMessageListResponse" } } } @@ -27391,7 +27276,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublicMessageArray" + "$ref": "#/components/schemas/PublicMessageListResponse" } } } diff --git a/assets/schemas.json b/assets/schemas.json
index 678371708..fe58930aa 100644 --- a/assets/schemas.json +++ b/assets/schemas.json
@@ -1696,6 +1696,13 @@ "$ref": "#/definitions/InstanceUserDeleteSchemaContent", "$schema": "http://json-schema.org/draft-07/schema#" }, + "PublicMemberListResponse": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicMember" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, "SessionsLogoutSchema": { "type": "object", "properties": { @@ -3550,205 +3557,6 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "APIPublicUser": { - "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" - }, - "premium_since": { - "type": "string", - "format": "date-time" - }, - "avatar": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { - "type": "string" - }, - "username": { - "type": "string" - }, - "discriminator": { - "type": "string" - }, - "public_flags": { - "type": "integer" - }, - "accent_color": { - "type": "integer" - }, - "bot": { - "type": "boolean" - }, - "premium_type": { - "type": "integer" - }, - "badge_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "avatar_decoration_data": { - "$ref": "#/definitions/AvatarDecorationData" - }, - "display_name_styles": { - "$ref": "#/definitions/DisplayNameStyle" - }, - "collectibles": { - "$ref": "#/definitions/Collectibles" - }, - "primary_guild": { - "$ref": "#/definitions/PrimaryGuild" - } - }, - "additionalProperties": false, - "required": [ - "bio", - "bot", - "discriminator", - "id", - "premium_since", - "premium_type", - "public_flags", - "username" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "APIPrivateUser": { - "type": "object", - "properties": { - "email": { - "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" - }, - "flags": { - "type": "integer" - }, - "premium_since": { - "type": "string", - "format": "date-time" - }, - "avatar": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { - "type": "string" - }, - "username": { - "type": "string" - }, - "discriminator": { - "type": "string" - }, - "public_flags": { - "type": "integer" - }, - "accent_color": { - "type": "integer" - }, - "bot": { - "type": "boolean" - }, - "premium_type": { - "type": "integer" - }, - "badge_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "avatar_decoration_data": { - "$ref": "#/definitions/AvatarDecorationData" - }, - "display_name_styles": { - "$ref": "#/definitions/DisplayNameStyle" - }, - "collectibles": { - "$ref": "#/definitions/Collectibles" - }, - "primary_guild": { - "$ref": "#/definitions/PrimaryGuild" - }, - "mfa_enabled": { - "type": "boolean" - }, - "phone": { - "type": "string" - }, - "verified": { - "type": "boolean" - }, - "nsfw_allowed": { - "type": "boolean" - }, - "premium": { - "type": "boolean" - }, - "purchased_flags": { - "type": "integer" - }, - "premium_usage_flags": { - "type": "integer" - }, - "disabled": { - "type": "boolean" - }, - "settings": { - "$ref": "#/definitions/UserSettingsSchema" - } - }, - "additionalProperties": false, - "required": [ - "bio", - "bot", - "disabled", - "discriminator", - "flags", - "id", - "mfa_enabled", - "nsfw_allowed", - "premium", - "premium_since", - "premium_type", - "premium_usage_flags", - "public_flags", - "purchased_flags", - "username", - "verified" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "APIGuildArray": { "type": "array", "items": { @@ -6679,6 +6487,13 @@ "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" }, + "PublicMessageListResponse": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicMessage" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, "PollUserAnswersSchema": { "type": "object", "properties": { @@ -7060,6 +6875,87 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "WebhookListResponse": { + "type": "array", + "items": { + "$ref": "#/definitions/WebhookResponse" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "WebhookResponse": { + "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": { + "$ref": "#/definitions/WebhookType" + }, + "guild_id": { + "type": [ + "null", + "string" + ] + }, + "channel_id": { + "type": [ + "null", + "string" + ] + }, + "user": { + "anyOf": [ + { + "$ref": "#/definitions/PartialUser" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "avatar": { + "type": [ + "null", + "string" + ] + }, + "token": { + "type": "string" + }, + "application_id": { + "type": [ + "null", + "string" + ] + }, + "source_guild": { + "$ref": "#/definitions/IntegrationGuild" + }, + "source_channel": { + "$ref": "#/definitions/WebhookChannel" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application_id", + "avatar", + "channel_id", + "id", + "name", + "type" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "AuditLogResponse": { "type": "object", "properties": { @@ -14737,6 +14633,172 @@ "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" }, + "PublicMember": { + "additionalProperties": false, + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "flags": { + "type": "integer" + }, + "nick": { + "type": "string" + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "pending": { + "type": "boolean" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "premium_since": { + "type": "integer" + }, + "avatar": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "communication_disabled_until": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "user": { + "$ref": "#/definitions/PublicUser" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "banner", + "bio", + "communication_disabled_until", + "deaf", + "flags", + "guild_id", + "id", + "joined_at", + "mute", + "pending", + "roles", + "user" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "PublicUser": { + "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" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "avatar": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "username": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "accent_color": { + "type": "integer" + }, + "bot": { + "type": "boolean" + }, + "premium_type": { + "type": "integer" + }, + "badge_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "avatar_decoration_data": { + "$ref": "#/definitions/AvatarDecorationData" + }, + "display_name_styles": { + "$ref": "#/definitions/DisplayNameStyle" + }, + "collectibles": { + "$ref": "#/definitions/Collectibles" + }, + "primary_guild": { + "$ref": "#/definitions/PrimaryGuild" + } + }, + "additionalProperties": false, + "required": [ + "bio", + "bot", + "discriminator", + "id", + "premium_since", + "premium_type", + "public_flags", + "username" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "EmojiGuild": { "type": "object", "properties": { @@ -14908,85 +14970,6 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "PublicUser": { - "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" - }, - "premium_since": { - "type": "string", - "format": "date-time" - }, - "avatar": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { - "type": "string" - }, - "username": { - "type": "string" - }, - "discriminator": { - "type": "string" - }, - "public_flags": { - "type": "integer" - }, - "accent_color": { - "type": "integer" - }, - "bot": { - "type": "boolean" - }, - "premium_type": { - "type": "integer" - }, - "badge_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "avatar_decoration_data": { - "$ref": "#/definitions/AvatarDecorationData" - }, - "display_name_styles": { - "$ref": "#/definitions/DisplayNameStyle" - }, - "collectibles": { - "$ref": "#/definitions/Collectibles" - }, - "primary_guild": { - "$ref": "#/definitions/PrimaryGuild" - } - }, - "additionalProperties": false, - "required": [ - "bio", - "bot", - "discriminator", - "id", - "premium_since", - "premium_type", - "public_flags", - "username" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "RoleTags": { "type": "object", "properties": { @@ -15502,93 +15485,6 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, - "PublicMember": { - "additionalProperties": false, - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "flags": { - "type": "integer" - }, - "nick": { - "type": "string" - }, - "joined_at": { - "type": "string", - "format": "date-time" - }, - "pending": { - "type": "boolean" - }, - "deaf": { - "type": "boolean" - }, - "mute": { - "type": "boolean" - }, - "premium_since": { - "type": "integer" - }, - "avatar": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "theme_colors": { - "type": "array", - "items": { - "type": "integer" - } - }, - "pronouns": { - "type": "string" - }, - "communication_disabled_until": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - }, - "user": { - "$ref": "#/definitions/PublicUser" - }, - "roles": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "banner", - "bio", - "communication_disabled_until", - "deaf", - "flags", - "guild_id", - "id", - "joined_at", - "mute", - "pending", - "roles", - "user" - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "MessageActivity": { "type": "object", "properties": { diff --git a/scripts/schemaExclusions.json b/scripts/schemaExclusions.json
index 82e545ab0..3305a4e4b 100644 --- a/scripts/schemaExclusions.json +++ b/scripts/schemaExclusions.json
@@ -31,7 +31,6 @@ "UpdateRouteResponse", "MessagesSendAPIResponse", "APIWebhook", - "WebhookResponse", "WebhookValidationResponse", "MessageResponse", "ConnectionSettingsResponse", diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts
index c9b7a5406..762eae171 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -78,7 +78,7 @@ router.get( }, responses: { 200: { - body: "PublicMessageArray", + body: "PublicMessageListResponse", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/channels/#channel_id/messages/pins/index.ts b/src/api/routes/channels/#channel_id/messages/pins/index.ts
index 062084e58..1b1254b92 100644 --- a/src/api/routes/channels/#channel_id/messages/pins/index.ts +++ b/src/api/routes/channels/#channel_id/messages/pins/index.ts
@@ -165,7 +165,7 @@ router.get( permission: ["READ_MESSAGE_HISTORY"], responses: { 200: { - body: "PublicMessageArray", + body: "PublicMessageListResponse", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/channels/#channel_id/pins.ts b/src/api/routes/channels/#channel_id/pins.ts
index 499e3a980..2169d05cc 100644 --- a/src/api/routes/channels/#channel_id/pins.ts +++ b/src/api/routes/channels/#channel_id/pins.ts
@@ -166,7 +166,7 @@ router.get( permission: ["READ_MESSAGE_HISTORY"], responses: { 200: { - body: "PublicMessageArray", + body: "PublicMessageListResponse", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts
index d38e18d7c..a27e1cf28 100644 --- a/src/api/routes/channels/#channel_id/webhooks.ts +++ b/src/api/routes/channels/#channel_id/webhooks.ts
@@ -34,7 +34,7 @@ router.get( permission: "MANAGE_WEBHOOKS", responses: { 200: { - body: "WebhookArray", + body: "WebhookListResponse", }, }, }), diff --git a/src/api/routes/channels/preload-messages.ts b/src/api/routes/channels/preload-messages.ts
index 8b860bc98..f8b0d9a09 100644 --- a/src/api/routes/channels/preload-messages.ts +++ b/src/api/routes/channels/preload-messages.ts
@@ -20,7 +20,7 @@ import { Request, Response, Router } from "express"; import { route } from "@spacebar/api/middlewares"; import { Message } from "@spacebar/database"; import { Config } from "@spacebar/util"; -import { PreloadMessagesRequestSchema, PublicMessageArray } from "@spacebar/schemas"; +import { PreloadMessagesRequestSchema, PublicMessageListResponse } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); @@ -30,7 +30,7 @@ router.post( requestBody: "PreloadMessagesRequestSchema", responses: { 200: { - body: "PublicMessageArray", + body: "PublicMessageListResponse", }, 400: { body: "APIErrorResponse", @@ -62,7 +62,7 @@ router.post( // https://docs.discord.food/resources/message#preload-messages - reactions are not included in the response x.reactions = undefined; return x; - }) as unknown as PublicMessageArray; + }) as unknown as PublicMessageListResponse; return res.status(200).send(filteredMessages); }, diff --git a/src/api/routes/guilds/#guild_id/members/index.ts b/src/api/routes/guilds/#guild_id/members/index.ts
index ba8f4b3b9..fabc48f96 100644 --- a/src/api/routes/guilds/#guild_id/members/index.ts +++ b/src/api/routes/guilds/#guild_id/members/index.ts
@@ -42,7 +42,7 @@ router.get( }, responses: { 200: { - body: "PublicMemberArray", + body: "PublicMemberListResponse", }, 403: { body: "APIErrorResponse", diff --git a/src/api/routes/guilds/#guild_id/webhooks.ts b/src/api/routes/guilds/#guild_id/webhooks.ts
index 3ae2ad7ee..bc9c91a53 100644 --- a/src/api/routes/guilds/#guild_id/webhooks.ts +++ b/src/api/routes/guilds/#guild_id/webhooks.ts
@@ -31,7 +31,7 @@ router.get( permission: "MANAGE_WEBHOOKS", responses: { 200: { - body: "WebhookArray", + body: "WebhookListResponse", }, }, }), diff --git a/src/api/routes/users/#user_id/index.ts b/src/api/routes/users/#user_id/index.ts
index 228c87bb2..bee48dcb9 100644 --- a/src/api/routes/users/#user_id/index.ts +++ b/src/api/routes/users/#user_id/index.ts
@@ -27,7 +27,7 @@ router.get( route({ responses: { 200: { - body: "APIPublicUser", + body: "PublicUser", }, }, }), diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts
index 2ed525e82..f58f87ff2 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts
@@ -30,7 +30,7 @@ router.get( route({ responses: { 200: { - body: "APIPrivateUser", + body: "PrivateUser", }, }, }), diff --git a/src/schemas/api/channels/Webhook.ts b/src/schemas/api/channels/Webhook.ts
index 22f78946f..fcceb1a83 100644 --- a/src/schemas/api/channels/Webhook.ts +++ b/src/schemas/api/channels/Webhook.ts
@@ -29,7 +29,7 @@ export interface WebhookCreateResponse { hook: WebhookResponse; } -export type WebhookArray = WebhookResponse[]; +export type WebhookListResponse = WebhookResponse[]; export interface WebhookResponse { id: Snowflake; type: WebhookType; diff --git a/src/schemas/api/guilds/Emoji.ts b/src/schemas/api/guilds/Emoji.ts
index b0b358fda..607434748 100644 --- a/src/schemas/api/guilds/Emoji.ts +++ b/src/schemas/api/guilds/Emoji.ts
@@ -1,3 +1,21 @@ +/* + 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/>. +*/ + import { Snowflake } from "../../Identifiers"; import { PartialUser } from "../users"; diff --git a/src/schemas/api/guilds/GuildScheduledEvents.ts b/src/schemas/api/guilds/GuildScheduledEvents.ts new file mode 100644
index 000000000..11522da3f --- /dev/null +++ b/src/schemas/api/guilds/GuildScheduledEvents.ts
@@ -0,0 +1,24 @@ +/* + 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/>. +*/ + +import { Snowflake } from "../../Identifiers"; + +export enum EventPrivacyLevel { + PUBLIC = 1, + GUILD_ONLY = 2, +} diff --git a/src/schemas/api/guilds/GuildSchema.ts b/src/schemas/api/guilds/GuildSchema.ts
index a4c671c8a..96bb97391 100644 --- a/src/schemas/api/guilds/GuildSchema.ts +++ b/src/schemas/api/guilds/GuildSchema.ts
@@ -1,6 +1,6 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 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 @@ -28,3 +28,36 @@ export interface IntegrationGuild { name: string; icon: string | null; } + +export enum GuildVerificationLevel { + NONE = 0, + // Verified email + LOW = 1, + // Registered >5min ago + MEDIUM = 2, + // Member for >10min + HIGH = 3, + // Verified phone number + VERY_HIGH = 4, +} + +export enum GuildNsfwLevel { + DEFAULT = 0, + EXPLICIT = 1, + SAFE = 2, + AGE_RESTRICTED = 3, +} + +// Unlocked boost perk level +export enum GuildPremiumTier { + NONE = 0, + TIER_1 = 1, + TIER_2 = 2, + TIER_3 = 3, +} + +export enum GuildHubType { + DEFAULT = 0, + HIGH_SCHOOL = 1, + COLLEGE = 2, +} diff --git a/src/schemas/api/guilds/Invite.ts b/src/schemas/api/guilds/Invite.ts new file mode 100644
index 000000000..35e458592 --- /dev/null +++ b/src/schemas/api/guilds/Invite.ts
@@ -0,0 +1,88 @@ +/* + 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/>. + */ + +import { Snowflake } from "../../Identifiers"; +import { PartialUser } from "../users"; +import { GuildNsfwLevel, GuildPremiumTier, GuildVerificationLevel } from "./GuildSchema"; +import { GuildProfileResponse, PublicChannel, RoleColors } from "@spacebar/schemas"; +import { Role } from "@spacebar/database"; + +export interface Invite { + code: string; + type: number; + channel: PublicChannel | null; // TODO: Figure out what fields this is *supposed* to have as it's labeled as "Partial channel object" + guild_id?: Snowflake; + guild?: InviteGuild; + profile?: GuildProfileResponse; + inviter?: PartialUser; + flags?: number; + target_type?: number; + target_user?: PartialUser; + // target_application?: PartialApplication; // TODO - voice activities + roles?: InviteRole[]; // TODO: This is labeled as "Partial role object", is this used anywhere else? + approximate_member_count?: number; + approximate_presence_count?: number; + expires_at: string | null; + // guild_scheduled_event?: GuildScheduledEvent; //TODO - scheduled events + new_member?: boolean; + show_verification_form?: boolean; + is_nickname_changeable?: boolean; + target_users_job_status?: InviteTargetUsersJob; // TODO +} + +export interface InviteTargetUsersJob { + status: InviteTargetUsersJobStatus; + total_users: number; + processed_users: number; + created_at: Date | null; + completed_at: Date | null; + error_message: string | null; +} + +export enum InviteTargetUsersJobStatus { + UNSPECIFIED = 0, + PROCESSING = 1, + COMPLETED = 2, + FAILED = 3, +} + +export interface InviteGuild { + id: Snowflake; + name: string; + icon: string | null; + description: string | null; + banner: string | null; + splash: string | null; + verification_level: GuildVerificationLevel; + features: string[]; + vanity_url_code: string | null; + premium_subscription_count?: number; + premium_tier: GuildPremiumTier; + nsfw: boolean; + nsfw_level: GuildNsfwLevel; +} + +export interface InviteRole { + id: Snowflake; + name: string; + position: number; + color: number; + colors: RoleColors; + icon?: string | null; + unicode_emoji?: string | null; +} diff --git a/src/schemas/api/messages/Message.ts b/src/schemas/api/messages/Message.ts
index 8d736aa68..b340a8637 100644 --- a/src/schemas/api/messages/Message.ts +++ b/src/schemas/api/messages/Message.ts
@@ -163,7 +163,7 @@ export interface MessageSnapshot { }; } -export type PublicMessageArray = PublicMessage[]; +export type PublicMessageListResponse = PublicMessage[]; export interface PublicMessage { id: Snowflake; channel_id: Snowflake; diff --git a/src/schemas/api/users/Member.ts b/src/schemas/api/users/Member.ts
index f6778509e..691b085bc 100644 --- a/src/schemas/api/users/Member.ts +++ b/src/schemas/api/users/Member.ts
@@ -116,4 +116,4 @@ export type PublicMember = Omit<Pick<Member, PublicMemberKeys>, "roles"> & { roles: string[]; // only role ids not objects }; -export type PublicMemberArray = PublicMember[]; +export type PublicMemberListResponse = PublicMember[]; diff --git a/src/schemas/responses/TypedResponses.ts b/src/schemas/responses/TypedResponses.ts
index e43114201..b37c4b741 100644 --- a/src/schemas/responses/TypedResponses.ts +++ b/src/schemas/responses/TypedResponses.ts
@@ -21,17 +21,15 @@ import { GeneralConfiguration, LimitsConfiguration } from "../../util/config/typ import { DmChannelDTO } from "../../util/dtos"; // TODO: remove entity imports import { Application, Categories, Channel, Guild, Invite, Template } from "@spacebar/database"; -import { GuildCreateResponse, PrivateUser, PublicUser } from "@spacebar/schemas"; +import { GuildCreateResponse, PrivateUser } from "@spacebar/schemas"; // TODO: remove this entire file! // removes internal properties from the guild class export type APIGuild = Omit<Guild, "afk_channel" | "template" | "owner" | "public_updates_channel" | "rules_channel" | "system_channel" | "widget_channel">; -export type APIPublicUser = PublicUser; -export type APIPrivateUser = PrivateUser; export type APIGuildArray = APIGuild[]; export type APIDMChannelArray = DmChannelDTO[]; -export interface UserUpdateResponse extends APIPrivateUser { +export interface UserUpdateResponse extends PrivateUser { newToken?: string; }