summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--assets/openapi.json755
-rw-r--r--assets/schemas.json535
-rw-r--r--src/api/routes/guilds/#guild_id/widget.json.ts3
-rw-r--r--src/api/routes/oauth2/authorize.ts2
4 files changed, 971 insertions, 324 deletions
diff --git a/assets/openapi.json b/assets/openapi.json

index fbadb7ab..ed53ce9a 100644 --- a/assets/openapi.json +++ b/assets/openapi.json
@@ -1577,6 +1577,9 @@ "discriminator": { "type": "string" }, + "global_name": { + "type": "string" + }, "id": { "type": "string" }, @@ -1671,11 +1674,11 @@ "region": { "type": "string" }, - "icon": { + "banner": { "type": "string", "nullable": true }, - "banner": { + "icon": { "type": "string", "nullable": true }, @@ -1968,6 +1971,12 @@ "username": { "type": "string" }, + "global_name": { + "type": [ + "null", + "string" + ] + }, "discriminator": { "type": "string" }, @@ -1989,6 +1998,7 @@ "avatar", "avatar_url", "discriminator", + "global_name", "id", "status", "username" @@ -2501,6 +2511,9 @@ "id": { "type": "string" }, + "banner": { + "type": "string" + }, "icon": { "type": "string" }, @@ -2537,9 +2550,6 @@ "$ref": "#/components/schemas/Role" } }, - "banner": { - "type": "string" - }, "channels": { "type": "array", "items": { @@ -2711,29 +2721,10 @@ "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": { + "username": { "type": "string" }, - "username": { + "global_name": { "type": "string" }, "discriminator": { @@ -2742,15 +2733,37 @@ "public_flags": { "type": "integer" }, + "avatar": { + "type": "string" + }, "accent_color": { "type": "integer" }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, "bot": { "type": "boolean" }, + "premium_since": { + "type": "string", + "format": "date-time" + }, "premium_type": { "type": "integer" }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, "badge_ids": { "type": "array", "items": { @@ -2782,22 +2795,40 @@ "flags": { "type": "integer" }, - "verified": { - "type": "boolean" + "username": { + "type": "string" }, - "premium_since": { - "type": "string", - "format": "date-time" + "global_name": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" }, "avatar": { "type": "string" }, + "accent_color": { + "type": "integer" + }, "banner": { "type": "string" }, "bio": { "type": "string" }, + "bot": { + "type": "boolean" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "premium_type": { + "type": "integer" + }, "theme_colors": { "type": "array", "items": { @@ -2807,24 +2838,9 @@ "pronouns": { "type": "string" }, - "username": { - "type": "string" - }, - "discriminator": { - "type": "string" - }, - "public_flags": { - "type": "integer" - }, - "accent_color": { - "type": "integer" - }, - "bot": { + "verified": { "type": "boolean" }, - "premium_type": { - "type": "integer" - }, "badge_ids": { "type": "array", "items": { @@ -2893,12 +2909,9 @@ "$ref": "#/components/schemas/BackupCode" } }, - "UserUpdateResponse": { + "PrivateUserResponse": { "type": "object", "properties": { - "newToken": { - "type": "string" - }, "email": { "type": "string" }, @@ -2909,22 +2922,143 @@ "flags": { "type": "integer" }, - "verified": { + "username": { + "type": "string" + }, + "global_name": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "avatar": { + "type": "string" + }, + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "bot": { "type": "boolean" }, "premium_since": { "type": "string", "format": "date-time" }, + "premium_type": { + "type": "integer" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "verified": { + "type": "boolean" + }, + "badge_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "mfa_enabled": { + "type": "boolean" + }, + "phone": { + "type": "string" + }, + "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" + ] + }, + "PublicUserResponse": { + "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" + }, + "username": { + "type": "string" + }, + "global_name": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, "avatar": { "type": "string" }, + "accent_color": { + "type": "integer" + }, "banner": { "type": "string" }, "bio": { "type": "string" }, + "bot": { + "type": "boolean" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "premium_type": { + "type": "integer" + }, "theme_colors": { "type": "array", "items": { @@ -2934,24 +3068,86 @@ "pronouns": { "type": "string" }, + "badge_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "bio", + "bot", + "discriminator", + "id", + "premium_since", + "premium_type", + "public_flags", + "username" + ] + }, + "UserUpdateResponse": { + "type": "object", + "properties": { + "newToken": { + "type": "string" + }, + "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" + }, "username": { "type": "string" }, + "global_name": { + "type": "string" + }, "discriminator": { "type": "string" }, "public_flags": { "type": "integer" }, + "avatar": { + "type": "string" + }, "accent_color": { "type": "integer" }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, "bot": { "type": "boolean" }, + "premium_since": { + "type": "string", + "format": "date-time" + }, "premium_type": { "type": "integer" }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "verified": { + "type": "boolean" + }, "badge_ids": { "type": "array", "items": { @@ -3098,6 +3294,10 @@ "autoCreateBotUsers": { "type": "boolean", "default": false + }, + "uniqueUsernames": { + "type": "boolean", + "default": false } }, "required": [ @@ -3110,7 +3310,8 @@ "instanceId", "instanceName", "serverName", - "tosPage" + "tosPage", + "uniqueUsernames" ] }, "APIChannelArray": { @@ -3140,25 +3341,6 @@ "guild_id": { "type": "string" }, - "mute": { - "type": "boolean" - }, - "deaf": { - "type": "boolean" - }, - "nick": { - "type": "string" - }, - "joined_at": { - "type": "string", - "format": "date-time" - }, - "pending": { - "type": "boolean" - }, - "premium_since": { - "type": "integer" - }, "avatar": { "type": "string" }, @@ -3168,6 +3350,9 @@ "bio": { "type": "string" }, + "premium_since": { + "type": "integer" + }, "theme_colors": { "type": "array", "items": { @@ -3177,6 +3362,22 @@ "pronouns": { "type": "string" }, + "mute": { + "type": "boolean" + }, + "deaf": { + "type": "boolean" + }, + "nick": { + "type": "string" + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "pending": { + "type": "boolean" + }, "communication_disabled_until": { "anyOf": [ { @@ -3281,11 +3482,11 @@ "region": { "type": "string" }, - "icon": { + "banner": { "type": "string", "nullable": true }, - "banner": { + "icon": { "type": "string", "nullable": true }, @@ -3594,6 +3795,9 @@ "username": { "type": "string" }, + "global_name": { + "type": "string" + }, "discriminator": { "type": "string" }, @@ -5957,6 +6161,17 @@ "files" ] }, + "UniqueUsernameAttemptSchema": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + }, + "required": [ + "username" + ] + }, "UserDeleteSchema": { "type": "object", "properties": { @@ -6028,7 +6243,8 @@ "type": "object", "properties": { "username": { - "minLength": 2, + "minLength": 1, + "maxLength": 100, "type": "string" }, "avatar": { @@ -6036,6 +6252,7 @@ "nullable": true }, "bio": { + "maxLength": 1024, "type": "string" }, "accent_color": { @@ -6046,28 +6263,24 @@ "nullable": true }, "password": { - "minLength": 1, - "maxLength": 72, "type": "string" }, "new_password": { - "minLength": 1, - "maxLength": 72, "type": "string" }, "code": { - "minLength": 6, - "maxLength": 6, "type": "string" }, "email": { - "format": "email", "type": "string" }, "discriminator": { "minLength": 4, "maxLength": 4, "type": "string" + }, + "global_name": { + "type": "string" } } }, @@ -6808,6 +7021,17 @@ "user_sessions" ] }, + "UniqueUsernameAttemptResponse": { + "type": "object", + "properties": { + "taken": { + "type": "boolean" + } + }, + "required": [ + "taken" + ] + }, "ApplicationCommandOption": { "type": "object", "properties": { @@ -7460,6 +7684,12 @@ "username": { "type": "string" }, + "global_name": { + "type": "string" + }, + "legacy_username": { + "type": "string" + }, "discriminator": { "type": "string" }, @@ -7627,6 +7857,9 @@ "type": "string" } }, + "tag": { + "type": "string" + }, "id": { "type": "string" } @@ -7658,6 +7891,7 @@ "security_keys", "sessions", "system", + "tag", "username", "verified", "webauthn_enabled" @@ -10611,25 +10845,6 @@ "guild_id": { "type": "string" }, - "mute": { - "type": "boolean" - }, - "deaf": { - "type": "boolean" - }, - "nick": { - "type": "string" - }, - "joined_at": { - "type": "string", - "format": "date-time" - }, - "pending": { - "type": "boolean" - }, - "premium_since": { - "type": "integer" - }, "avatar": { "type": "string" }, @@ -10639,6 +10854,9 @@ "bio": { "type": "string" }, + "premium_since": { + "type": "integer" + }, "theme_colors": { "type": "array", "items": { @@ -10648,6 +10866,22 @@ "pronouns": { "type": "string" }, + "mute": { + "type": "boolean" + }, + "deaf": { + "type": "boolean" + }, + "nick": { + "type": "string" + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "pending": { + "type": "boolean" + }, "communication_disabled_until": { "anyOf": [ { @@ -10690,29 +10924,10 @@ "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": { + "username": { "type": "string" }, - "username": { + "global_name": { "type": "string" }, "discriminator": { @@ -10721,15 +10936,37 @@ "public_flags": { "type": "integer" }, + "avatar": { + "type": "string" + }, "accent_color": { "type": "integer" }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, "bot": { "type": "boolean" }, + "premium_since": { + "type": "string", + "format": "date-time" + }, "premium_type": { "type": "integer" }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, "badge_ids": { "type": "array", "items": { @@ -12442,38 +12679,31 @@ "MinimalPublicUserDTO": { "type": "object", "properties": { - "avatar": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "global_name": { "type": "string", + "default": null, "nullable": true }, "discriminator": { "type": "string" }, - "id": { - "type": "string" - }, "public_flags": { "type": "integer" }, - "username": { - "type": "string" - }, - "badge_ids": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ] + "avatar": { + "type": "string", + "nullable": true } }, "required": [ "discriminator", + "global_name", "id", "public_flags", "username" @@ -12539,6 +12769,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -12556,7 +12790,8 @@ "maxBio", "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -12810,6 +13045,9 @@ "UserProfile": { "type": "object", "properties": { + "accent_color": { + "type": "integer" + }, "banner": { "type": "string" }, @@ -12824,9 +13062,6 @@ }, "pronouns": { "type": "string" - }, - "accent_color": { - "type": "integer" } }, "required": [ @@ -13030,6 +13265,9 @@ "name": "track" }, { + "name": "unique-username" + }, + { "name": "updates" }, { @@ -14159,6 +14397,121 @@ ] } }, + "/users/@me/pomelo/": { + "post": { + "security": [ + { + "bearer": [] + } + ], + "description": "Claims a unique username for the user. Returns the updated user object on success. Fires a User Update Gateway event.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UniqueUsernameAttemptSchema" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateUserResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIErrorResponse" + } + } + } + } + }, + "tags": [ + "users" + ] + } + }, + "/users/@me/pomelo-suggestions/": { + "get": { + "security": [ + { + "bearer": [] + } + ], + "description": "Returns a suggested unique username string based on the current user's username.", + "responses": { + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIErrorResponse" + } + } + } + } + }, + "tags": [ + "users" + ] + } + }, + "/users/@me/pomelo-attempt/": { + "post": { + "security": [ + { + "bearer": [] + } + ], + "description": "Checks whether a unique username is available for the user to claim.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UniqueUsernameAttemptSchema" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UniqueUsernameAttemptResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIErrorResponse" + } + } + } + } + }, + "tags": [ + "users" + ] + } + }, "/users/@me/notes/{user_id}": { "get": { "security": [ @@ -15788,6 +16141,86 @@ ] } }, + "/unique-username/username-suggestions-unauthed/": { + "get": { + "security": [ + { + "bearer": [] + } + ], + "description": "Returns a suggested unique username string based on the current user's username.", + "responses": { + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIErrorResponse" + } + } + } + } + }, + "parameters": [ + { + "name": "global_name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "tags": [ + "unique-username" + ] + } + }, + "/unique-username/username-attempt-unauthed/": { + "post": { + "security": [ + { + "bearer": [] + } + ], + "description": "Checks whether a unique username is available for the user to claim.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UniqueUsernameAttemptSchema" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UniqueUsernameAttemptResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIErrorResponse" + } + } + } + } + }, + "tags": [ + "unique-username" + ] + } + }, "/track/": { "post": { "responses": { @@ -24978,38 +25411,6 @@ ] } }, - "/auth/forgot/": { - "post": { - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ForgotPasswordSchema" - } - } - } - }, - "responses": { - "204": { - "description": "No description available" - }, - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/APIErrorOrCaptchaResponse" - } - } - } - } - }, - "tags": [ - "auth" - ] - } - }, "/auth/fingerprint/": { "post": { "responses": { diff --git a/assets/schemas.json b/assets/schemas.json
index a7d759fa..6883f0ba 100644 --- a/assets/schemas.json +++ b/assets/schemas.json
@@ -1636,6 +1636,9 @@ "discriminator": { "type": "string" }, + "global_name": { + "type": "string" + }, "id": { "type": "string" }, @@ -1732,13 +1735,13 @@ "region": { "type": "string" }, - "icon": { + "banner": { "type": [ "null", "string" ] }, - "banner": { + "icon": { "type": [ "null", "string" @@ -2052,6 +2055,12 @@ "username": { "type": "string" }, + "global_name": { + "type": [ + "null", + "string" + ] + }, "discriminator": { "type": "string" }, @@ -2073,6 +2082,7 @@ "avatar", "avatar_url", "discriminator", + "global_name", "id", "status", "username" @@ -2627,6 +2637,9 @@ "id": { "type": "string" }, + "banner": { + "type": "string" + }, "icon": { "type": "string" }, @@ -2663,9 +2676,6 @@ "$ref": "#/definitions/Role" } }, - "banner": { - "type": "string" - }, "channels": { "type": "array", "items": { @@ -2847,29 +2857,10 @@ "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": { + "username": { "type": "string" }, - "username": { + "global_name": { "type": "string" }, "discriminator": { @@ -2878,15 +2869,37 @@ "public_flags": { "type": "integer" }, + "avatar": { + "type": "string" + }, "accent_color": { "type": "integer" }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, "bot": { "type": "boolean" }, + "premium_since": { + "type": "string", + "format": "date-time" + }, "premium_type": { "type": "integer" }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, "badge_ids": { "type": "array", "items": { @@ -2920,22 +2933,40 @@ "flags": { "type": "integer" }, - "verified": { - "type": "boolean" + "username": { + "type": "string" }, - "premium_since": { - "type": "string", - "format": "date-time" + "global_name": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" }, "avatar": { "type": "string" }, + "accent_color": { + "type": "integer" + }, "banner": { "type": "string" }, "bio": { "type": "string" }, + "bot": { + "type": "boolean" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "premium_type": { + "type": "integer" + }, "theme_colors": { "type": "array", "items": { @@ -2945,24 +2976,9 @@ "pronouns": { "type": "string" }, - "username": { - "type": "string" - }, - "discriminator": { - "type": "string" - }, - "public_flags": { - "type": "integer" - }, - "accent_color": { - "type": "integer" - }, - "bot": { + "verified": { "type": "boolean" }, - "premium_type": { - "type": "integer" - }, "badge_ids": { "type": "array", "items": { @@ -3036,12 +3052,9 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "UserUpdateResponse": { + "PrivateUserResponse": { "type": "object", "properties": { - "newToken": { - "type": "string" - }, "email": { "type": "string" }, @@ -3052,22 +3065,145 @@ "flags": { "type": "integer" }, - "verified": { + "username": { + "type": "string" + }, + "global_name": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "avatar": { + "type": "string" + }, + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "bot": { "type": "boolean" }, "premium_since": { "type": "string", "format": "date-time" }, + "premium_type": { + "type": "integer" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "verified": { + "type": "boolean" + }, + "badge_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "mfa_enabled": { + "type": "boolean" + }, + "phone": { + "type": "string" + }, + "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#" + }, + "PublicUserResponse": { + "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" + }, + "username": { + "type": "string" + }, + "global_name": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, "avatar": { "type": "string" }, + "accent_color": { + "type": "integer" + }, "banner": { "type": "string" }, "bio": { "type": "string" }, + "bot": { + "type": "boolean" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "premium_type": { + "type": "integer" + }, "theme_colors": { "type": "array", "items": { @@ -3077,24 +3213,88 @@ "pronouns": { "type": "string" }, + "badge_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "bio", + "bot", + "discriminator", + "id", + "premium_since", + "premium_type", + "public_flags", + "username" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "UserUpdateResponse": { + "type": "object", + "properties": { + "newToken": { + "type": "string" + }, + "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" + }, "username": { "type": "string" }, + "global_name": { + "type": "string" + }, "discriminator": { "type": "string" }, "public_flags": { "type": "integer" }, + "avatar": { + "type": "string" + }, "accent_color": { "type": "integer" }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, "bot": { "type": "boolean" }, + "premium_since": { + "type": "string", + "format": "date-time" + }, "premium_type": { "type": "integer" }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "verified": { + "type": "boolean" + }, "badge_ids": { "type": "array", "items": { @@ -3266,6 +3466,10 @@ "autoCreateBotUsers": { "type": "boolean", "default": false + }, + "uniqueUsernames": { + "type": "boolean", + "default": false } }, "additionalProperties": false, @@ -3279,7 +3483,8 @@ "instanceId", "instanceName", "serverName", - "tosPage" + "tosPage", + "uniqueUsernames" ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -3314,25 +3519,6 @@ "guild_id": { "type": "string" }, - "mute": { - "type": "boolean" - }, - "deaf": { - "type": "boolean" - }, - "nick": { - "type": "string" - }, - "joined_at": { - "type": "string", - "format": "date-time" - }, - "pending": { - "type": "boolean" - }, - "premium_since": { - "type": "integer" - }, "avatar": { "type": "string" }, @@ -3342,6 +3528,9 @@ "bio": { "type": "string" }, + "premium_since": { + "type": "integer" + }, "theme_colors": { "type": "array", "items": { @@ -3351,6 +3540,22 @@ "pronouns": { "type": "string" }, + "mute": { + "type": "boolean" + }, + "deaf": { + "type": "boolean" + }, + "nick": { + "type": "string" + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "pending": { + "type": "boolean" + }, "communication_disabled_until": { "anyOf": [ { @@ -3456,13 +3661,13 @@ "region": { "type": "string" }, - "icon": { + "banner": { "type": [ "null", "string" ] }, - "banner": { + "icon": { "type": [ "null", "string" @@ -3800,6 +4005,9 @@ "username": { "type": "string" }, + "global_name": { + "type": "string" + }, "discriminator": { "type": "string" }, @@ -6343,6 +6551,19 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "UniqueUsernameAttemptSchema": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "username" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "UserDeleteSchema": { "type": "object", "properties": { @@ -6420,7 +6641,8 @@ "type": "object", "properties": { "username": { - "minLength": 2, + "minLength": 1, + "maxLength": 100, "type": "string" }, "avatar": { @@ -6430,6 +6652,7 @@ ] }, "bio": { + "maxLength": 1024, "type": "string" }, "accent_color": { @@ -6442,28 +6665,24 @@ ] }, "password": { - "minLength": 1, - "maxLength": 72, "type": "string" }, "new_password": { - "minLength": 1, - "maxLength": 72, "type": "string" }, "code": { - "minLength": 6, - "maxLength": 6, "type": "string" }, "email": { - "format": "email", "type": "string" }, "discriminator": { "minLength": 4, "maxLength": 4, "type": "string" + }, + "global_name": { + "type": "string" } }, "additionalProperties": false, @@ -7250,6 +7469,19 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "UniqueUsernameAttemptResponse": { + "type": "object", + "properties": { + "taken": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "taken" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "ApplicationCommandOption": { "type": "object", "properties": { @@ -7930,6 +8162,12 @@ "username": { "type": "string" }, + "global_name": { + "type": "string" + }, + "legacy_username": { + "type": "string" + }, "discriminator": { "type": "string" }, @@ -8097,6 +8335,9 @@ "type": "string" } }, + "tag": { + "type": "string" + }, "id": { "type": "string" } @@ -8129,6 +8370,7 @@ "security_keys", "sessions", "system", + "tag", "username", "verified", "webauthn_enabled" @@ -11226,25 +11468,6 @@ "guild_id": { "type": "string" }, - "mute": { - "type": "boolean" - }, - "deaf": { - "type": "boolean" - }, - "nick": { - "type": "string" - }, - "joined_at": { - "type": "string", - "format": "date-time" - }, - "pending": { - "type": "boolean" - }, - "premium_since": { - "type": "integer" - }, "avatar": { "type": "string" }, @@ -11254,6 +11477,9 @@ "bio": { "type": "string" }, + "premium_since": { + "type": "integer" + }, "theme_colors": { "type": "array", "items": { @@ -11263,6 +11489,22 @@ "pronouns": { "type": "string" }, + "mute": { + "type": "boolean" + }, + "deaf": { + "type": "boolean" + }, + "nick": { + "type": "string" + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "pending": { + "type": "boolean" + }, "communication_disabled_until": { "anyOf": [ { @@ -11306,29 +11548,10 @@ "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": { + "username": { "type": "string" }, - "username": { + "global_name": { "type": "string" }, "discriminator": { @@ -11337,15 +11560,37 @@ "public_flags": { "type": "integer" }, + "avatar": { + "type": "string" + }, "accent_color": { "type": "integer" }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, "bot": { "type": "boolean" }, + "premium_since": { + "type": "string", + "format": "date-time" + }, "premium_type": { "type": "integer" }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, "badge_ids": { "type": "array", "items": { @@ -13219,41 +13464,36 @@ "MinimalPublicUserDTO": { "type": "object", "properties": { - "avatar": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "global_name": { "type": [ "null", "string" - ] + ], + "default": null }, "discriminator": { "type": "string" }, - "id": { - "type": "string" - }, "public_flags": { "type": "integer" }, - "username": { - "type": "string" - }, - "badge_ids": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } + "avatar": { + "type": [ + "null", + "string" ] } }, "additionalProperties": false, "required": [ "discriminator", + "global_name", "id", "public_flags", "username" @@ -13324,6 +13564,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -13342,7 +13586,8 @@ "maxBio", "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -13617,6 +13862,9 @@ "UserProfile": { "type": "object", "properties": { + "accent_color": { + "type": "integer" + }, "banner": { "type": "string" }, @@ -13631,9 +13879,6 @@ }, "pronouns": { "type": "string" - }, - "accent_color": { - "type": "integer" } }, "additionalProperties": false, diff --git a/src/api/routes/guilds/#guild_id/widget.json.ts b/src/api/routes/guilds/#guild_id/widget.json.ts
index 6827c7f6..aae5581f 100644 --- a/src/api/routes/guilds/#guild_id/widget.json.ts +++ b/src/api/routes/guilds/#guild_id/widget.json.ts
@@ -130,6 +130,7 @@ async function getWidgetJsonData(guild_id: string) { return { id: x.id, username: x.user.username, + global_name: x.user.global_name, discriminator: x.user.discriminator, avatar: null, status: "online", // TODO @@ -154,4 +155,4 @@ async function getWidgetJsonData(guild_id: string) { } as GuildWidgetJsonResponse; } -export default router; +export default router; \ No newline at end of file diff --git a/src/api/routes/oauth2/authorize.ts b/src/api/routes/oauth2/authorize.ts
index 48a2b7e4..9f198522 100644 --- a/src/api/routes/oauth2/authorize.ts +++ b/src/api/routes/oauth2/authorize.ts
@@ -75,7 +75,7 @@ router.get( id: req.user_id, bot: false, }, - select: { id: true, username: true, avatar: true, discriminator: true, public_flags: true, global_name: true, public_flags: true }, + select: { id: true, username: true, avatar: true, discriminator: true, public_flags: true, global_name: true }, }); const guilds = await Member.find({