summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-14 04:23:20 +0100
committerRory& <root@rory.gay>2026-03-14 04:24:04 +0100
commite0783f7595d62f4650587915fdc70df723e31a1c (patch)
treed5360cb548fb30469403c2e4ba7f74cbb473537a
parentFix some JSdoc errors (diff)
downloadserver-ts-e0783f7595d62f4650587915fdc70df723e31a1c.tar.xz
Remove unused imports for non-entities
-rw-r--r--assets/openapi.json571
-rw-r--r--assets/schemas.json537
-rw-r--r--src/api/routes/applications/@me.ts3
-rw-r--r--src/api/routes/applications/index.ts2
-rw-r--r--src/api/routes/auth/sessions.ts2
-rw-r--r--src/api/routes/auth/whoami.ts5
-rw-r--r--src/api/routes/channels/#channel_id/attachments.ts2
-rw-r--r--src/api/routes/channels/#channel_id/index.ts14
-rw-r--r--src/api/routes/channels/#channel_id/messages/#message_id/threads.ts2
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts8
-rw-r--r--src/api/routes/channels/#channel_id/messages/search.ts2
-rw-r--r--src/api/routes/channels/#channel_id/post-data.ts9
-rw-r--r--src/api/routes/channels/#channel_id/threads.ts1
-rw-r--r--src/api/routes/channels/#channel_id/typing.ts2
-rw-r--r--src/api/routes/gifs/search.ts1
-rw-r--r--src/api/routes/guilds/#guild_id/channels.ts3
-rw-r--r--src/api/routes/guilds/#guild_id/emojis.ts2
-rw-r--r--src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts6
-rw-r--r--src/api/routes/interactions/index.ts2
-rw-r--r--src/api/routes/invites/index.ts2
-rw-r--r--src/api/routes/users/@me/delete.ts2
-rw-r--r--src/api/routes/users/@me/guilds.ts2
-rw-r--r--src/api/routes/users/@me/mentions.ts2
-rw-r--r--src/api/routes/users/@me/settings.ts2
-rw-r--r--src/api/util/handlers/Instance.ts1
-rw-r--r--src/bundle/start.ts4
-rw-r--r--src/cdn/routes/emojis.ts2
-rw-r--r--src/cdn/routes/stickers.ts2
-rw-r--r--src/gateway/events/Close.ts2
-rw-r--r--src/gateway/events/Message.ts2
-rw-r--r--src/gateway/opcodes/GuildSync.ts24
-rw-r--r--src/gateway/util/SessionUtils.ts2
-rw-r--r--src/schemas/api/bots/SendableModalSubmitDataSchema.ts2
-rw-r--r--src/schemas/api/users/InstanceUserDeleteSchema.ts2
-rw-r--r--src/util/util/Database.ts2
-rw-r--r--src/util/util/JSON.ts1
-rw-r--r--src/util/util/Token.ts2
-rw-r--r--src/util/util/WebAuthn.ts1
-rw-r--r--src/util/util/json/JsonSerializer.ts1
-rw-r--r--src/webrtc/events/Message.ts1
40 files changed, 824 insertions, 411 deletions
diff --git a/assets/openapi.json b/assets/openapi.json

index fd2b7c0d..c2718ee8 100644 --- a/assets/openapi.json +++ b/assets/openapi.json
@@ -2514,7 +2514,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -2715,10 +2715,15 @@ }, "discovery_excluded": { "type": "boolean" + }, + "ToGuildSource": { + "type": "object", + "additionalProperties": false } }, "required": [ - "__@annotationsKey@12271", + "ToGuildSource", + "__@annotationsKey@12309", "bans", "channel_ordering", "channels", @@ -3217,6 +3222,9 @@ "guild_id": { "type": "string" }, + "flags": { + "type": "integer" + }, "mute": { "type": "boolean" }, @@ -3280,6 +3288,7 @@ "bio", "communication_disabled_until", "deaf", + "flags", "guild_id", "id", "joined_at", @@ -5110,52 +5119,87 @@ ] }, "allowed_mentions": { - "type": "object", - "properties": { - "parse": { - "type": "array", - "items": { - "type": "string" - } - }, - "roles": { - "type": "array", - "items": { - "type": "string" - } - }, - "users": { - "type": "array", - "items": { - "type": "string" - } + "anyOf": [ + { + "type": "object", + "properties": { + "parse": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "roles": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "users": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false }, - "replied_user": { - "type": "boolean" + { + "type": "null" } - }, - "additionalProperties": false + ] }, "message_reference": { - "type": "object", - "properties": { - "message_id": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "fail_if_not_exists": { - "type": "boolean" + "anyOf": [ + { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + }, + "type": { + "type": "integer" + } + }, + "additionalProperties": false }, - "type": { - "type": "integer" + { + "type": "null" } - }, - "additionalProperties": false + ] }, "payload_json": { "type": "string" @@ -5420,52 +5464,87 @@ ] }, "allowed_mentions": { - "type": "object", - "properties": { - "parse": { - "type": "array", - "items": { - "type": "string" - } - }, - "roles": { - "type": "array", - "items": { - "type": "string" - } - }, - "users": { - "type": "array", - "items": { - "type": "string" - } + "anyOf": [ + { + "type": "object", + "properties": { + "parse": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "roles": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "users": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false }, - "replied_user": { - "type": "boolean" + { + "type": "null" } - }, - "additionalProperties": false + ] }, "message_reference": { - "type": "object", - "properties": { - "message_id": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "fail_if_not_exists": { - "type": "boolean" + "anyOf": [ + { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + }, + "type": { + "type": "integer" + } + }, + "additionalProperties": false }, - "type": { - "type": "integer" + { + "type": "null" } - }, - "additionalProperties": false + ] }, "payload_json": { "type": "string" @@ -7775,7 +7854,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -7786,7 +7865,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "embeds", "flags", @@ -7963,7 +8042,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -7974,7 +8053,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "created_at", "flags", "id", @@ -8031,7 +8110,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8042,7 +8121,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "channel_id", "closed", @@ -8242,7 +8321,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8253,7 +8332,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "bio", "bot", "connected_accounts", @@ -8351,7 +8430,7 @@ "session_nickname": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8362,7 +8441,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "activities", "client_info", "client_status", @@ -8654,7 +8733,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8665,7 +8744,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "from", "from_id", "id", @@ -8750,7 +8829,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8761,7 +8840,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "external_id", "id", "name", @@ -8964,7 +9043,7 @@ "type": "boolean", "default": true }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8975,7 +9054,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "afk_timeout", "allow_accessibility_detection", "animate_emoji", @@ -9090,7 +9169,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9101,7 +9180,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "counter", "id", "key_id", @@ -9259,7 +9338,7 @@ "flags": { "$ref": "#/components/schemas/ThreadMemberFlags" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9270,7 +9349,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "flags", "id", @@ -9371,7 +9450,11 @@ "collectibles": { "$ref": "#/components/schemas/Collectibles" }, - "__@annotationsKey@12271": { + "flags": { + "type": "integer", + "default": 0 + }, + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9382,11 +9465,12 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "banner", "bio", "communication_disabled_until", "deaf", + "flags", "guild", "guild_id", "id", @@ -9626,7 +9710,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9637,7 +9721,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "bans", "channel_ordering", "channels", @@ -9692,7 +9776,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9703,7 +9787,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "executor", "executor_id", "guild", @@ -9773,7 +9857,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9784,7 +9868,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "color", "colors", "flags", @@ -9857,7 +9941,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9868,7 +9952,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "code", "created_at", "creator", @@ -9926,7 +10010,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9937,7 +10021,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "animated", "available", "groups", @@ -9994,7 +10078,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10005,7 +10089,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "format_type", "id", "name", @@ -10040,7 +10124,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10051,7 +10135,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "id", "name", "stickers" @@ -10132,7 +10216,7 @@ "flags": { "type": "integer" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10143,7 +10227,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "channel_id", "code", @@ -10217,7 +10301,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10228,7 +10312,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "channel_id", "deaf", @@ -10303,7 +10387,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10314,7 +10398,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "application", "application_id", "avatar", @@ -10471,7 +10555,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10482,7 +10566,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "description", "discoverability_state", "discovery_eligibility_flags", @@ -10525,7 +10609,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10536,7 +10620,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "id", "members", "name", @@ -10574,7 +10658,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10585,7 +10669,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "id", "membership_state", "permissions", @@ -10865,7 +10949,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10876,7 +10960,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "badge_count", "channel", "channel_id", @@ -10963,7 +11047,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10974,7 +11058,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "channel_id", "id", @@ -11015,7 +11099,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -11026,7 +11110,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "filename", "id", "message", @@ -11187,20 +11271,43 @@ ] }, "PartialEmoji": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] }, - "animated": { - "type": "boolean" + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] } - }, - "required": [ - "name" ] }, "MessageType": { @@ -11330,7 +11437,44 @@ "type": "string" }, "emoji": { - "$ref": "#/components/schemas/PartialEmoji" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + } + ] }, "custom_id": { "type": "string" @@ -11494,7 +11638,44 @@ "type": "string" }, "emoji": { - "$ref": "#/components/schemas/PartialEmoji" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + } + ] }, "default": { "type": "boolean" @@ -11591,7 +11772,44 @@ "type": "string" }, "emoji": { - "$ref": "#/components/schemas/PartialEmoji" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + } + ] } } }, @@ -11807,6 +12025,9 @@ "guild_id": { "type": "string" }, + "flags": { + "type": "integer" + }, "mute": { "type": "boolean" }, @@ -11870,6 +12091,7 @@ "bio", "communication_disabled_until", "deaf", + "flags", "guild_id", "id", "joined_at", @@ -13479,7 +13701,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -13490,7 +13712,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "code", "consumed", "expired", @@ -13601,7 +13823,7 @@ "icon": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -13612,7 +13834,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "id", "is_primary", "localizations", @@ -13990,7 +14212,7 @@ "link": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -14001,7 +14223,7 @@ } }, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "description", "icon", "id" @@ -17194,6 +17416,41 @@ ] } }, + "/stickers/{sticker_id}/guild": { + "get": { + "security": [ + { + "bearer": [] + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Sticker" + } + } + } + } + }, + "parameters": [ + { + "name": "sticker_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "sticker_id" + } + ], + "tags": [ + "stickers" + ] + } + }, "/sticker-packs/": { "get": { "security": [ diff --git a/assets/schemas.json b/assets/schemas.json
index 158fea5e..0bd0aced 100644 --- a/assets/schemas.json +++ b/assets/schemas.json
@@ -2640,7 +2640,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -2849,11 +2849,16 @@ }, "discovery_excluded": { "type": "boolean" + }, + "ToGuildSource": { + "type": "object", + "additionalProperties": false } }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "ToGuildSource", + "__@annotationsKey@12309", "bans", "channel_ordering", "channels", @@ -3391,6 +3396,9 @@ "guild_id": { "type": "string" }, + "flags": { + "type": "integer" + }, "mute": { "type": "boolean" }, @@ -3454,6 +3462,7 @@ "bio", "communication_disabled_until", "deaf", + "flags", "guild_id", "id", "joined_at", @@ -5437,52 +5446,87 @@ ] }, "allowed_mentions": { - "type": "object", - "properties": { - "parse": { - "type": "array", - "items": { - "type": "string" - } - }, - "roles": { - "type": "array", - "items": { - "type": "string" - } - }, - "users": { - "type": "array", - "items": { - "type": "string" - } + "anyOf": [ + { + "type": "object", + "properties": { + "parse": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "roles": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "users": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false }, - "replied_user": { - "type": "boolean" + { + "type": "null" } - }, - "additionalProperties": false + ] }, "message_reference": { - "type": "object", - "properties": { - "message_id": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "fail_if_not_exists": { - "type": "boolean" + "anyOf": [ + { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + }, + "type": { + "type": "integer" + } + }, + "additionalProperties": false }, - "type": { - "type": "integer" + { + "type": "null" } - }, - "additionalProperties": false + ] }, "payload_json": { "type": "string" @@ -5753,52 +5797,87 @@ ] }, "allowed_mentions": { - "type": "object", - "properties": { - "parse": { - "type": "array", - "items": { - "type": "string" - } - }, - "roles": { - "type": "array", - "items": { - "type": "string" - } - }, - "users": { - "type": "array", - "items": { - "type": "string" - } + "anyOf": [ + { + "type": "object", + "properties": { + "parse": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "roles": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "users": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false }, - "replied_user": { - "type": "boolean" + { + "type": "null" } - }, - "additionalProperties": false + ] }, "message_reference": { - "type": "object", - "properties": { - "message_id": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "fail_if_not_exists": { - "type": "boolean" + "anyOf": [ + { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "fail_if_not_exists": { + "type": "boolean" + }, + "type": { + "type": "integer" + } + }, + "additionalProperties": false }, - "type": { - "type": "integer" + { + "type": "null" } - }, - "additionalProperties": false + ] }, "payload_json": { "type": "string" @@ -8254,7 +8333,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8266,7 +8345,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "embeds", "flags", @@ -8448,7 +8527,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8460,7 +8539,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "created_at", "flags", "id", @@ -8519,7 +8598,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8531,7 +8610,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "channel_id", "closed", @@ -8732,7 +8811,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8744,7 +8823,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "bio", "bot", "connected_accounts", @@ -8843,7 +8922,7 @@ "session_nickname": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -8855,7 +8934,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "activities", "client_info", "client_status", @@ -9156,7 +9235,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9168,7 +9247,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "from", "from_id", "id", @@ -9255,7 +9334,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9267,7 +9346,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "external_id", "id", "name", @@ -9473,7 +9552,7 @@ "type": "boolean", "default": true }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9485,7 +9564,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "afk_timeout", "allow_accessibility_detection", "animate_emoji", @@ -9613,7 +9692,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9625,7 +9704,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "counter", "id", "key_id", @@ -9806,7 +9885,7 @@ "flags": { "$ref": "#/definitions/ThreadMemberFlags" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9818,7 +9897,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "flags", "id", @@ -9920,7 +9999,11 @@ "collectibles": { "$ref": "#/definitions/Collectibles" }, - "__@annotationsKey@12271": { + "flags": { + "type": "integer", + "default": 0 + }, + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -9932,11 +10015,12 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "banner", "bio", "communication_disabled_until", "deaf", + "flags", "guild", "guild_id", "id", @@ -10185,7 +10269,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10197,7 +10281,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "bans", "channel_ordering", "channels", @@ -10253,7 +10337,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10265,7 +10349,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "executor", "executor_id", "guild", @@ -10336,7 +10420,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10348,7 +10432,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "color", "colors", "flags", @@ -10424,7 +10508,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10436,7 +10520,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "code", "created_at", "creator", @@ -10495,7 +10579,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10507,7 +10591,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "animated", "available", "groups", @@ -10565,7 +10649,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10577,7 +10661,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "format_type", "id", "name", @@ -10613,7 +10697,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10625,7 +10709,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "id", "name", "stickers" @@ -10709,7 +10793,7 @@ "flags": { "type": "integer" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10721,7 +10805,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "channel_id", "code", @@ -10796,7 +10880,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10808,7 +10892,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "channel_id", "deaf", @@ -10884,7 +10968,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -10896,7 +10980,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "application", "application_id", "avatar", @@ -11055,7 +11139,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -11067,7 +11151,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "description", "discoverability_state", "discovery_eligibility_flags", @@ -11111,7 +11195,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -11123,7 +11207,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "id", "members", "name", @@ -11162,7 +11246,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -11174,7 +11258,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "id", "membership_state", "permissions", @@ -11475,7 +11559,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -11487,7 +11571,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "badge_count", "channel", "channel_id", @@ -11579,7 +11663,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -11591,7 +11675,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "channel", "channel_id", "id", @@ -11633,7 +11717,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -11645,7 +11729,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "filename", "id", "message", @@ -11813,21 +11897,43 @@ "$schema": "http://json-schema.org/draft-07/schema#" }, "PartialEmoji": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] }, - "animated": { - "type": "boolean" + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] } - }, - "additionalProperties": false, - "required": [ - "name" ], "$schema": "http://json-schema.org/draft-07/schema#" }, @@ -11963,7 +12069,44 @@ "type": "string" }, "emoji": { - "$ref": "#/definitions/PartialEmoji" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + } + ] }, "custom_id": { "type": "string" @@ -12138,7 +12281,44 @@ "type": "string" }, "emoji": { - "$ref": "#/definitions/PartialEmoji" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + } + ] }, "default": { "type": "boolean" @@ -12243,7 +12423,44 @@ "type": "string" }, "emoji": { - "$ref": "#/definitions/PartialEmoji" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + } + ] } }, "additionalProperties": false, @@ -12475,6 +12692,9 @@ "guild_id": { "type": "string" }, + "flags": { + "type": "integer" + }, "mute": { "type": "boolean" }, @@ -12538,6 +12758,7 @@ "bio", "communication_disabled_until", "deaf", + "flags", "guild_id", "id", "joined_at", @@ -14275,7 +14496,7 @@ "id": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -14287,7 +14508,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "code", "consumed", "expired", @@ -14413,7 +14634,7 @@ "icon": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -14425,7 +14646,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "id", "is_primary", "localizations", @@ -14832,7 +15053,7 @@ "link": { "type": "string" }, - "__@annotationsKey@12271": { + "__@annotationsKey@12309": { "type": "object", "additionalProperties": { "type": "array", @@ -14844,7 +15065,7 @@ }, "additionalProperties": false, "required": [ - "__@annotationsKey@12271", + "__@annotationsKey@12309", "description", "icon", "id" diff --git a/src/api/routes/applications/@me.ts b/src/api/routes/applications/@me.ts
index 7e315a56..d3d8c70f 100644 --- a/src/api/routes/applications/@me.ts +++ b/src/api/routes/applications/@me.ts
@@ -17,10 +17,9 @@ */ import { route } from "@spacebar/api"; -import { Application, DiscordApiErrors, Guild, handleFile } from "@spacebar/util"; +import { Application, Guild, handleFile } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; -import { verifyToken } from "node-2fa"; import { ApplicationModifySchema } from "@spacebar/schemas"; const router: Router = Router({ mergeParams: true }); diff --git a/src/api/routes/applications/index.ts b/src/api/routes/applications/index.ts
index 0740c2fb..2240379a 100644 --- a/src/api/routes/applications/index.ts +++ b/src/api/routes/applications/index.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { Application, Config, User, createAppBotUser, trimSpecial } from "@spacebar/util"; +import { Application, Config, createAppBotUser, trimSpecial } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { ApplicationCreateSchema } from "@spacebar/schemas"; diff --git a/src/api/routes/auth/sessions.ts b/src/api/routes/auth/sessions.ts
index 8f48d1ec..d1e1c649 100644 --- a/src/api/routes/auth/sessions.ts +++ b/src/api/routes/auth/sessions.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; import { createHash } from "node:crypto"; -import { emitEvent, Session, Snowflake } from "@spacebar/util"; +import { emitEvent, Session } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { SessionsLogoutSchema } from "../../../schemas/api/users/SessionsSchemas"; import { In } from "typeorm"; diff --git a/src/api/routes/auth/whoami.ts b/src/api/routes/auth/whoami.ts
index 51366376..0aaad2bb 100644 --- a/src/api/routes/auth/whoami.ts +++ b/src/api/routes/auth/whoami.ts
@@ -16,11 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ import { route } from "@spacebar/api"; -import { createHash } from "node:crypto"; -import { Session, Snowflake } from "@spacebar/util"; import { Request, Response, Router } from "express"; -import { SessionsLogoutSchema } from "../../../schemas/api/users/SessionsSchemas"; -import { In } from "typeorm"; + const router = Router({ mergeParams: true }); router.get( "/", diff --git a/src/api/routes/channels/#channel_id/attachments.ts b/src/api/routes/channels/#channel_id/attachments.ts
index 2b3fd355..0e595ccc 100644 --- a/src/api/routes/channels/#channel_id/attachments.ts +++ b/src/api/routes/channels/#channel_id/attachments.ts
@@ -17,7 +17,7 @@ */ import { randomString, route } from "@spacebar/api"; -import { Channel, Config, Permissions, User } from "@spacebar/util"; +import { Channel, Config, Permissions } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { CloudAttachment } from "@spacebar/util"; import { UploadAttachmentRequestSchema, UploadAttachmentResponseSchema } from "@spacebar/schemas"; diff --git a/src/api/routes/channels/#channel_id/index.ts b/src/api/routes/channels/#channel_id/index.ts
index 37767574..ff88703e 100644 --- a/src/api/routes/channels/#channel_id/index.ts +++ b/src/api/routes/channels/#channel_id/index.ts
@@ -17,19 +17,7 @@ */ import { route } from "@spacebar/api"; -import { - Channel, - ChannelDeleteEvent, - ChannelUpdateEvent, - Recipient, - emitEvent, - handleFile, - Config, - FieldError, - ErrorList, - ObjectErrorContent, - makeObjectErrorContent, -} from "@spacebar/util"; +import { Channel, ChannelDeleteEvent, ChannelUpdateEvent, Recipient, emitEvent, handleFile, Config, FieldError, ErrorList, makeObjectErrorContent } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { ChannelModifySchema, ChannelType } from "@spacebar/schemas"; diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/threads.ts b/src/api/routes/channels/#channel_id/messages/#message_id/threads.ts
index 7bb119df..525337b4 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/threads.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/threads.ts
@@ -17,7 +17,7 @@ */ import { route, sendMessage } from "@spacebar/api"; -import { Message, Channel, emitEvent, User, MessageUpdateEvent, Recipient } from "@spacebar/util"; +import { Message, Channel, emitEvent, User, MessageUpdateEvent } from "@spacebar/util"; import { MessageThreadCreationSchema, ChannelType, MessageType } from "@spacebar/schemas"; import { Request, Response, Router } from "express"; diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts
index ac993d7f..7687d8be 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -19,8 +19,6 @@ import { handleMessage, postHandleMessage, route } from "@spacebar/api"; import { Attachment, - AutomodRule, - AutomodTriggerTypes, Channel, Config, DiscordApiErrors, @@ -38,10 +36,8 @@ import { Relationship, Rights, Snowflake, - stringGlobToRegexp, uploadFile, User, - Recipient, ThreadMember, ThreadMemberFlags, ThreadMembersUpdateEvent, @@ -54,9 +50,6 @@ import { FindManyOptions, FindOperator, LessThan, MoreThan, MoreThanOrEqual } fr import { URL } from "url"; import { AcknowledgeDeleteSchema, - AutomodCustomWordsRule, - AutomodRuleActionType, - AutomodRuleEventType, isTextChannel, MessageCreateAttachment, MessageCreateCloudAttachment, @@ -64,7 +57,6 @@ import { Reaction, ReadStateType, RelationshipType, - ChannelType, } from "@spacebar/schemas"; const router: Router = Router({ mergeParams: true }); diff --git a/src/api/routes/channels/#channel_id/messages/search.ts b/src/api/routes/channels/#channel_id/messages/search.ts
index 77ec46c7..8363edc6 100644 --- a/src/api/routes/channels/#channel_id/messages/search.ts +++ b/src/api/routes/channels/#channel_id/messages/search.ts
@@ -22,7 +22,7 @@ import { route } from "@spacebar/api"; import { Channel, FieldErrors, Message, getPermission } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; -import { FindManyOptions, In, Like } from "typeorm"; +import { FindManyOptions, Like } from "typeorm"; const router: Router = Router({ mergeParams: true }); diff --git a/src/api/routes/channels/#channel_id/post-data.ts b/src/api/routes/channels/#channel_id/post-data.ts
index f58a27cf..d37344a9 100644 --- a/src/api/routes/channels/#channel_id/post-data.ts +++ b/src/api/routes/channels/#channel_id/post-data.ts
@@ -16,14 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { handleMessage, postHandleMessage, route, sendMessage } from "@spacebar/api"; -import { Channel, emitEvent, User, uploadFile, Attachment, Member, ReadState, MessageCreateEvent, FieldErrors, getPermission, ThreadMember, Message } from "@spacebar/util"; -import { ChannelType, MessageType, ThreadCreationSchema, MessageCreateAttachment, MessageCreateCloudAttachment, PostDataSchema } from "@spacebar/schemas"; +import { route } from "@spacebar/api"; +import { Channel, Member, Message } from "@spacebar/util"; +import { PostDataSchema } from "@spacebar/schemas"; import { Request, Response, Router } from "express"; import { messageUpload } from "./messages"; -import { HTTPError } from "#util/util/lambert-server"; -import { FindManyOptions, FindOptionsOrder, In, Like } from "typeorm"; +import { In } from "typeorm"; const router = Router({ mergeParams: true }); diff --git a/src/api/routes/channels/#channel_id/threads.ts b/src/api/routes/channels/#channel_id/threads.ts
index e81c8d79..8b8d9bc7 100644 --- a/src/api/routes/channels/#channel_id/threads.ts +++ b/src/api/routes/channels/#channel_id/threads.ts
@@ -31,7 +31,6 @@ import { ThreadMember, Message, ChannelFlags, - DiscordApiErrors, } from "@spacebar/util"; import { ChannelType, MessageType, ThreadCreationSchema, MessageCreateAttachment, MessageCreateCloudAttachment } from "@spacebar/schemas"; diff --git a/src/api/routes/channels/#channel_id/typing.ts b/src/api/routes/channels/#channel_id/typing.ts
index d5890fcb..44ad1a4b 100644 --- a/src/api/routes/channels/#channel_id/typing.ts +++ b/src/api/routes/channels/#channel_id/typing.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { Channel, emitEvent, Member, TypingStartEvent, User } from "@spacebar/util"; +import { Channel, emitEvent, Member, TypingStartEvent } from "@spacebar/util"; import { Request, Response, Router } from "express"; const router: Router = Router({ mergeParams: true }); diff --git a/src/api/routes/gifs/search.ts b/src/api/routes/gifs/search.ts
index ca07956e..cd20b8d4 100644 --- a/src/api/routes/gifs/search.ts +++ b/src/api/routes/gifs/search.ts
@@ -19,7 +19,6 @@ import { route } from "@spacebar/api"; import { getGifApiKey, parseGifResult } from "@spacebar/util"; import { Request, Response, Router } from "express"; -import http from "http"; import { TenorGif, TenorMediaTypes } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); diff --git a/src/api/routes/guilds/#guild_id/channels.ts b/src/api/routes/guilds/#guild_id/channels.ts
index 493c3398..39807903 100644 --- a/src/api/routes/guilds/#guild_id/channels.ts +++ b/src/api/routes/guilds/#guild_id/channels.ts
@@ -19,8 +19,7 @@ import { route } from "@spacebar/api"; import { Channel, ChannelUpdateEvent, Guild, emitEvent } from "@spacebar/util"; import { Request, Response, Router } from "express"; -import { ChannelModifySchema, ChannelReorderSchema } from "@spacebar/schemas"; -import { ChannelCreateSchema } from "../../../../schemas/uncategorised/ChannelCreateSchema"; +import { ChannelCreateSchema, ChannelReorderSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); router.get( diff --git a/src/api/routes/guilds/#guild_id/emojis.ts b/src/api/routes/guilds/#guild_id/emojis.ts
index 1044b8a4..321331f4 100644 --- a/src/api/routes/guilds/#guild_id/emojis.ts +++ b/src/api/routes/guilds/#guild_id/emojis.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { Config, DiscordApiErrors, Emoji, GuildEmojisUpdateEvent, Member, Snowflake, User, emitEvent, handleFile } from "@spacebar/util"; +import { Config, DiscordApiErrors, Emoji, GuildEmojisUpdateEvent, Member, Snowflake, emitEvent, handleFile } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { EmojiCreateSchema, EmojiModifySchema } from "@spacebar/schemas"; diff --git a/src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts b/src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts
index 8ad56ff9..3083b300 100644 --- a/src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts +++ b/src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts
@@ -17,11 +17,9 @@ */ import { ButtonStyle, InteractionCallbackSchema, InteractionCallbackType, MessageComponentType, MessageType } from "@spacebar/schemas"; -import { route } from "@spacebar/api"; -import { MessageCreateAttachment, MessageCreateCloudAttachment } from "@spacebar/schemas"; +import { route, sendMessage } from "@spacebar/api"; import { Request, Response, Router } from "express"; -import { emitEvent, FieldErrors, InteractionSuccessEvent, uploadFile, Attachment, pendingInteractions, User } from "@spacebar/util"; -import { sendMessage } from "../../../../util/handlers/Message"; +import { emitEvent, FieldErrors, InteractionSuccessEvent, pendingInteractions, User } from "@spacebar/util"; const router = Router({ mergeParams: true }); diff --git a/src/api/routes/interactions/index.ts b/src/api/routes/interactions/index.ts
index 585267e9..5542b9c1 100644 --- a/src/api/routes/interactions/index.ts +++ b/src/api/routes/interactions/index.ts
@@ -20,7 +20,7 @@ import { randomBytes } from "crypto"; import { InteractionFailureReason, InteractionSchema } from "@spacebar/schemas"; import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; -import { Config, emitEvent, getPermission, Guild, InteractionCreateEvent, InteractionFailureEvent, InteractionType, Member, Message, Snowflake, User } from "@spacebar/util"; +import { Config, emitEvent, getPermission, Guild, InteractionCreateEvent, InteractionFailureEvent, InteractionType, Member, Message, Snowflake } from "@spacebar/util"; import { pendingInteractions } from "@spacebar/util/imports/Interactions"; import { InteractionCreateSchema } from "@spacebar/schemas/api/bots/InteractionCreateSchema"; diff --git a/src/api/routes/invites/index.ts b/src/api/routes/invites/index.ts
index 316e7686..15da05dc 100644 --- a/src/api/routes/invites/index.ts +++ b/src/api/routes/invites/index.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { Ban, Config, DiscordApiErrors, emitEvent, getPermission, Guild, Invite, InviteDeleteEvent, PublicInviteRelation, User } from "@spacebar/util"; +import { Ban, Config, DiscordApiErrors, emitEvent, getPermission, Guild, Invite, InviteDeleteEvent, PublicInviteRelation } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; import { UserFlags } from "@spacebar/schemas"; diff --git a/src/api/routes/users/@me/delete.ts b/src/api/routes/users/@me/delete.ts
index 9f4fbf92..3d5fa642 100644 --- a/src/api/routes/users/@me/delete.ts +++ b/src/api/routes/users/@me/delete.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { DiscordApiErrors, Guild, Member, User, UserSettingsProtos } from "@spacebar/util"; +import { Guild, Member, User, UserSettingsProtos } from "@spacebar/util"; import bcrypt from "bcrypt"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; diff --git a/src/api/routes/users/@me/guilds.ts b/src/api/routes/users/@me/guilds.ts
index d2740678..8751c3c8 100644 --- a/src/api/routes/users/@me/guilds.ts +++ b/src/api/routes/users/@me/guilds.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { Config, Guild, GuildDeleteEvent, GuildMemberRemoveEvent, Member, User, emitEvent } from "@spacebar/util"; +import { Config, Guild, Member } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; diff --git a/src/api/routes/users/@me/mentions.ts b/src/api/routes/users/@me/mentions.ts
index 9d4f7060..d3c05b44 100644 --- a/src/api/routes/users/@me/mentions.ts +++ b/src/api/routes/users/@me/mentions.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { Snowflake, User, Message, Member, Channel, Permissions, timePromise, NewUrlUserSignatureData, Stopwatch, Attachment } from "@spacebar/util"; +import { Snowflake, Message, Member, Channel, Permissions, NewUrlUserSignatureData, Stopwatch, Attachment } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { In, LessThan, FindOptionsWhere } from "typeorm"; diff --git a/src/api/routes/users/@me/settings.ts b/src/api/routes/users/@me/settings.ts
index 47c206c9..2013611b 100644 --- a/src/api/routes/users/@me/settings.ts +++ b/src/api/routes/users/@me/settings.ts
@@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { User, UserSettings, emitEvent, Session, PrivateSessionProjection, PresenceUpdateEvent } from "@spacebar/util"; +import { User, UserSettings, emitEvent, Session, PresenceUpdateEvent } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { UserSettingsUpdateSchema } from "@spacebar/schemas"; diff --git a/src/api/util/handlers/Instance.ts b/src/api/util/handlers/Instance.ts
index e71c3eda..6b8d1ec6 100644 --- a/src/api/util/handlers/Instance.ts +++ b/src/api/util/handlers/Instance.ts
@@ -17,7 +17,6 @@ */ import { Session, TimeSpan } from "@spacebar/util"; -import { Like } from "typeorm"; import { setInterval } from "timers"; export async function initInstance() { diff --git a/src/bundle/start.ts b/src/bundle/start.ts
index 227964b5..254241f6 100644 --- a/src/bundle/start.ts +++ b/src/bundle/start.ts
@@ -16,7 +16,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -// process.env.MONGOMS_DEBUG = "true"; import moduleAlias from "module-alias"; moduleAlias(__dirname + "../../../package.json"); @@ -28,10 +27,7 @@ import { initStats } from "./stats"; import { config } from "dotenv"; config({ quiet: true }); -import { execSync } from "child_process"; import { centerString, getRevInfoOrFail, Logo } from "@spacebar/util"; -import fs from "fs"; -import path from "path"; const cores = process.env.THREADS ? parseInt(process.env.THREADS) : 1; diff --git a/src/cdn/routes/emojis.ts b/src/cdn/routes/emojis.ts
index d92cdf90..761ad00e 100644 --- a/src/cdn/routes/emojis.ts +++ b/src/cdn/routes/emojis.ts
@@ -24,8 +24,6 @@ import { HTTPError } from "lambert-server"; import crypto from "crypto"; import { multer } from "../util/multer"; import { cache, cacheNotFound } from "../util/cache"; -import { FileStorage } from "@spacebar/cdn"; -import fs from "fs/promises"; // TODO: check premium and animated pfp are allowed in the config // TODO: generate different sizes of icon diff --git a/src/cdn/routes/stickers.ts b/src/cdn/routes/stickers.ts
index c2347efb..5821db67 100644 --- a/src/cdn/routes/stickers.ts +++ b/src/cdn/routes/stickers.ts
@@ -24,8 +24,6 @@ import { HTTPError } from "lambert-server"; import crypto from "crypto"; import { multer } from "../util/multer"; import { cache, cacheNotFound } from "../util/cache"; -import { FileStorage } from "@spacebar/cdn*"; -import fs from "fs/promises"; // TODO: check premium and animated pfp are allowed in the config // TODO: generate different sizes of icon diff --git a/src/gateway/events/Close.ts b/src/gateway/events/Close.ts
index 8b8a2d96..2f30564c 100644 --- a/src/gateway/events/Close.ts +++ b/src/gateway/events/Close.ts
@@ -17,7 +17,7 @@ */ import { WebSocket } from "@spacebar/gateway"; -import { emitEvent, PresenceUpdateEvent, PrivateSessionProjection, Session, SessionsReplace, User, VoiceState, VoiceStateUpdateEvent } from "@spacebar/util"; +import { emitEvent, PresenceUpdateEvent, Session, SessionsReplace, User, VoiceState, VoiceStateUpdateEvent } from "@spacebar/util"; export async function Close(this: WebSocket, code: number, reason: Buffer) { console.log("[WebSocket] closed", code, reason.toString()); diff --git a/src/gateway/events/Message.ts b/src/gateway/events/Message.ts
index 61c70c8a..b4263b40 100644 --- a/src/gateway/events/Message.ts +++ b/src/gateway/events/Message.ts
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { CLOSECODES, OPCODES, Payload, WebSocket } from "@spacebar/gateway"; +import { CLOSECODES, Payload, WebSocket } from "@spacebar/gateway"; import { ErlpackType } from "@spacebar/util"; import fs from "fs/promises"; import BigIntJson from "json-bigint"; diff --git a/src/gateway/opcodes/GuildSync.ts b/src/gateway/opcodes/GuildSync.ts
index 6a427ad7..9a6260e7 100644 --- a/src/gateway/opcodes/GuildSync.ts +++ b/src/gateway/opcodes/GuildSync.ts
@@ -16,27 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { - getDatabase, - getPermission, - listenEvent, - Member, - Role, - Session, - User, - Presence, - Channel, - Permissions, - arrayPartition, - timePromise, - Stopwatch, - Guild, - Config, -} from "@spacebar/util"; -import { WebSocket, Payload, handlePresenceUpdate, OPCODES, Send, getMostRelevantSession, handleOffloadedGatewayRequest } from "@spacebar/gateway"; -import murmur from "murmurhash-js/murmurhash3_gc"; -import { check } from "./instanceOf"; -import { LazyRequestSchema, PublicMember } from "@spacebar/schemas"; +import { Member, Session, Presence, timePromise, Stopwatch, Config } from "@spacebar/util"; +import { WebSocket, Payload, OPCODES, Send, getMostRelevantSession, handleOffloadedGatewayRequest } from "@spacebar/gateway"; +import { PublicMember } from "@spacebar/schemas"; import { In } from "typeorm"; // TODO: only show roles/members that have access to this channel diff --git a/src/gateway/util/SessionUtils.ts b/src/gateway/util/SessionUtils.ts
index f84304c6..9d2f01b3 100644 --- a/src/gateway/util/SessionUtils.ts +++ b/src/gateway/util/SessionUtils.ts
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { getDatabase, Member, Session } from "@spacebar/util"; +import { Session } from "@spacebar/util"; export function genSessionId() { return genRanHex(32); diff --git a/src/schemas/api/bots/SendableModalSubmitDataSchema.ts b/src/schemas/api/bots/SendableModalSubmitDataSchema.ts
index 9f859b96..f898c0ca 100644 --- a/src/schemas/api/bots/SendableModalSubmitDataSchema.ts +++ b/src/schemas/api/bots/SendableModalSubmitDataSchema.ts
@@ -17,7 +17,7 @@ */ import { UploadAttachmentRequestSchema } from "@spacebar/schemas"; -import { Attachment, Snowflake } from "@spacebar/util"; +import { Snowflake } from "@spacebar/util"; export interface SendableModalSubmitDataSchema { id: Snowflake; diff --git a/src/schemas/api/users/InstanceUserDeleteSchema.ts b/src/schemas/api/users/InstanceUserDeleteSchema.ts
index 497e3348..aee124fe 100644 --- a/src/schemas/api/users/InstanceUserDeleteSchema.ts +++ b/src/schemas/api/users/InstanceUserDeleteSchema.ts
@@ -1,5 +1,3 @@ -import { ConnectedAccount } from "@spacebar/util"; - export type InstanceUserDeleteSchema = InstanceUserDeleteSchemaContent | undefined; //unsure if this a correct way to make the body optional export interface InstanceUserDeleteSchemaContent { reason?: string; diff --git a/src/util/util/Database.ts b/src/util/util/Database.ts
index 0a3e6937..8f4119a1 100644 --- a/src/util/util/Database.ts +++ b/src/util/util/Database.ts
@@ -22,8 +22,6 @@ import { green, red, yellow } from "picocolors"; import { DataSource } from "typeorm"; // noinspection ES6PreferShortImport import { ConfigEntity } from "../entities/Config"; -// noinspection ES6PreferShortImport -import { Migration } from "../entities/Migration"; import fs from "fs"; // UUID extension option is only supported with postgres diff --git a/src/util/util/JSON.ts b/src/util/util/JSON.ts
index 00479228..e716f7d4 100644 --- a/src/util/util/JSON.ts +++ b/src/util/util/JSON.ts
@@ -18,7 +18,6 @@ // Discord.com sends ISO strings with +00:00 extension, not Z // This causes issues with Python bot libs -import Stream from "node:stream"; export function JSONReplacer(this: { [key: string]: unknown }, key: string, value: unknown) { if (this[key] instanceof Date) { diff --git a/src/util/util/Token.ts b/src/util/util/Token.ts
index ded54488..8bd45bcb 100644 --- a/src/util/util/Token.ts +++ b/src/util/util/Token.ts
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import jwt, { VerifyOptions } from "jsonwebtoken"; +import jwt from "jsonwebtoken"; import { Config } from "./Config"; import { InstanceBan, Session, User } from "../entities"; import crypto from "node:crypto"; diff --git a/src/util/util/WebAuthn.ts b/src/util/util/WebAuthn.ts
index f3750e7c..f6c5dbc4 100644 --- a/src/util/util/WebAuthn.ts +++ b/src/util/util/WebAuthn.ts
@@ -18,7 +18,6 @@ import { Fido2Lib } from "fido2-lib"; import jwt from "jsonwebtoken"; -import { Config } from "./Config"; import { loadOrGenerateKeypair } from "./Token"; const jwtSignOptions: jwt.SignOptions = { diff --git a/src/util/util/json/JsonSerializer.ts b/src/util/util/json/JsonSerializer.ts
index 5d4b8075..a35bb947 100644 --- a/src/util/util/json/JsonSerializer.ts +++ b/src/util/util/json/JsonSerializer.ts
@@ -2,7 +2,6 @@ import { JsonSerializerOptions } from "./JsonSerializerOptions"; import { Worker } from "worker_threads"; import { join } from "path"; import os from "os"; -import Stream from "node:stream"; import { ReadStream, WriteStream } from "node:fs"; // const worker = new Worker(join(process.cwd(), 'dist', 'util', 'util', 'json', 'jsonWorker.js')); diff --git a/src/webrtc/events/Message.ts b/src/webrtc/events/Message.ts
index dfcc0610..b5455d97 100644 --- a/src/webrtc/events/Message.ts +++ b/src/webrtc/events/Message.ts
@@ -17,7 +17,6 @@ */ import { CLOSECODES } from "@spacebar/gateway"; -import { Tuple } from "lambert-server"; import OPCodeHandlers from "../opcodes"; import { VoiceOPCodes, VoicePayload, WebRtcWebSocket } from "../util";