summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@proton.me>2023-03-27 15:51:34 -0400
committerPuyodead1 <puyodead@proton.me>2023-04-13 15:44:39 -0400
commit866eb15d90f35cc789bfacea4b70b904471d8eae (patch)
treee63e01e5860c8190e2829a0919c76c5bd7b535df /src
parentoapi: fix a few response types in auth (diff)
downloadserver-866eb15d90f35cc789bfacea4b70b904471d8eae.tar.xz
clusterfuck
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/applications/index.ts2
-rw-r--r--src/api/routes/channels/#channel_id/invites.ts2
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts2
-rw-r--r--src/api/routes/channels/#channel_id/pins.ts2
-rw-r--r--src/api/routes/channels/#channel_id/webhooks.ts2
-rw-r--r--src/api/routes/discovery.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/channels.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/emojis.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/index.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/invites.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/members/index.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/regions.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/roles/index.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/stickers.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/templates.ts2
-rw-r--r--src/api/routes/policies/instance/index.ts2
-rw-r--r--src/api/routes/policies/instance/limits.ts2
-rw-r--r--src/api/routes/sticker-packs/index.ts2
-rw-r--r--src/api/routes/users/#id/index.ts2
-rw-r--r--src/api/routes/users/@me/channels.ts2
-rw-r--r--src/api/routes/users/@me/guilds.ts2
-rw-r--r--src/api/routes/users/@me/index.ts2
-rw-r--r--src/api/routes/users/@me/mfa/codes-verification.ts2
-rw-r--r--src/api/routes/users/@me/mfa/codes.ts2
-rw-r--r--src/api/routes/voice/regions.ts2
-rw-r--r--src/util/schemas/UserProfileResponse.ts4
-rw-r--r--src/util/schemas/responses/ApplicationDetectableResponse.ts1
-rw-r--r--src/util/schemas/responses/ApplicationEntitlementsResponse.ts1
-rw-r--r--src/util/schemas/responses/ApplicationSkusResponse.ts1
-rw-r--r--src/util/schemas/responses/ApplicationsResponse.ts3
-rw-r--r--src/util/schemas/responses/ChannelInvitesResponse.ts3
-rw-r--r--src/util/schemas/responses/ChannelMessagesResponse.ts3
-rw-r--r--src/util/schemas/responses/ChannelPinsResponse.ts3
-rw-r--r--src/util/schemas/responses/ChannelWebhooksResponse.ts3
-rw-r--r--src/util/schemas/responses/DiscoveryCategoriesResponse.ts3
-rw-r--r--src/util/schemas/responses/GeneralConfigurationResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildChannelsResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildEmojisResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildInvitesResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildMembersResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildRolesResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildStickersResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildTemplatesResponse.ts3
-rw-r--r--src/util/schemas/responses/GuildVoiceRegionsResponse.ts2
-rw-r--r--src/util/schemas/responses/LimitsConfigurationResponse.ts3
-rw-r--r--src/util/schemas/responses/StickerPacksResponse.ts3
-rw-r--r--src/util/schemas/responses/TypedResponses.ts84
-rw-r--r--src/util/schemas/responses/UserResponse.ts15
-rw-r--r--src/util/schemas/responses/index.ts21
50 files changed, 112 insertions, 118 deletions
diff --git a/src/api/routes/applications/index.ts b/src/api/routes/applications/index.ts

index dba0a499..1e536a06 100644 --- a/src/api/routes/applications/index.ts +++ b/src/api/routes/applications/index.ts
@@ -32,7 +32,7 @@ router.get( route({ responses: { 200: { - body: "ApplicationsResponse", + body: "APIApplicationArray", }, }, }), diff --git a/src/api/routes/channels/#channel_id/invites.ts b/src/api/routes/channels/#channel_id/invites.ts
index d2874872..f608cca2 100644 --- a/src/api/routes/channels/#channel_id/invites.ts +++ b/src/api/routes/channels/#channel_id/invites.ts
@@ -96,7 +96,7 @@ router.get( permission: "MANAGE_CHANNELS", responses: { 200: { - body: "ChannelInvitesResponse", + body: "APIInviteArray", }, 404: {}, }, diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts
index 3d6cc596..551efb4e 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -94,7 +94,7 @@ router.get( }, responses: { 200: { - body: "ChannelMessagesResponse", + body: "APIMessageArray", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/channels/#channel_id/pins.ts b/src/api/routes/channels/#channel_id/pins.ts
index 7b379c30..724ebffd 100644 --- a/src/api/routes/channels/#channel_id/pins.ts +++ b/src/api/routes/channels/#channel_id/pins.ts
@@ -138,7 +138,7 @@ router.get( permission: ["READ_MESSAGE_HISTORY"], responses: { 200: { - body: "ChannelPinsResponse", + body: "APIMessageArray", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts
index 17437301..6b81298f 100644 --- a/src/api/routes/channels/#channel_id/webhooks.ts +++ b/src/api/routes/channels/#channel_id/webhooks.ts
@@ -41,7 +41,7 @@ router.get( route({ responses: { 200: { - body: "ChannelWebhooksResponse", + body: "APIWebhookArray", }, }, }), diff --git a/src/api/routes/discovery.ts b/src/api/routes/discovery.ts
index 79bbc686..a045c191 100644 --- a/src/api/routes/discovery.ts +++ b/src/api/routes/discovery.ts
@@ -27,7 +27,7 @@ router.get( route({ responses: { 200: { - body: "DiscoveryCategoriesResponse", + body: "APIDiscoveryCategoryArray", }, }, }), diff --git a/src/api/routes/guilds/#guild_id/channels.ts b/src/api/routes/guilds/#guild_id/channels.ts
index 0cbfca00..1d5897a5 100644 --- a/src/api/routes/guilds/#guild_id/channels.ts +++ b/src/api/routes/guilds/#guild_id/channels.ts
@@ -33,7 +33,7 @@ router.get( route({ responses: { 201: { - body: "GuildChannelsResponse", + body: "APIChannelArray", }, }, }), diff --git a/src/api/routes/guilds/#guild_id/emojis.ts b/src/api/routes/guilds/#guild_id/emojis.ts
index b1f3c7bf..ef28f989 100644 --- a/src/api/routes/guilds/#guild_id/emojis.ts +++ b/src/api/routes/guilds/#guild_id/emojis.ts
@@ -39,7 +39,7 @@ router.get( route({ responses: { 200: { - body: "GuildEmojisResponse", + body: "APIEmojiArray", }, 403: { body: "APIErrorResponse", diff --git a/src/api/routes/guilds/#guild_id/index.ts b/src/api/routes/guilds/#guild_id/index.ts
index 7c8f583e..e87a5e45 100644 --- a/src/api/routes/guilds/#guild_id/index.ts +++ b/src/api/routes/guilds/#guild_id/index.ts
@@ -39,7 +39,7 @@ router.get( route({ responses: { "200": { - body: "GuildResponse", + body: "GuildWithJoinedAt", }, 401: { body: "APIErrorResponse", diff --git a/src/api/routes/guilds/#guild_id/invites.ts b/src/api/routes/guilds/#guild_id/invites.ts
index 219b6a4f..a0ffa3f4 100644 --- a/src/api/routes/guilds/#guild_id/invites.ts +++ b/src/api/routes/guilds/#guild_id/invites.ts
@@ -28,7 +28,7 @@ router.get( permission: "MANAGE_GUILD", responses: { 200: { - body: "GuildInvitesResponse", + body: "APIInviteArray", }, }, }), diff --git a/src/api/routes/guilds/#guild_id/members/index.ts b/src/api/routes/guilds/#guild_id/members/index.ts
index 1ab9dd28..9260308d 100644 --- a/src/api/routes/guilds/#guild_id/members/index.ts +++ b/src/api/routes/guilds/#guild_id/members/index.ts
@@ -42,7 +42,7 @@ router.get( }, responses: { 200: { - body: "GuildMembersResponse", + body: "APIMemberArray", }, 403: { body: "APIErrorResponse", diff --git a/src/api/routes/guilds/#guild_id/regions.ts b/src/api/routes/guilds/#guild_id/regions.ts
index 166c9625..b0ae0602 100644 --- a/src/api/routes/guilds/#guild_id/regions.ts +++ b/src/api/routes/guilds/#guild_id/regions.ts
@@ -27,7 +27,7 @@ router.get( route({ responses: { 200: { - body: "GuildVoiceRegionsResponse", + body: "APIGuildVoiceRegion", }, 404: { body: "APIErrorResponse", diff --git a/src/api/routes/guilds/#guild_id/roles/index.ts b/src/api/routes/guilds/#guild_id/roles/index.ts
index 77d84347..e2c34e7f 100644 --- a/src/api/routes/guilds/#guild_id/roles/index.ts +++ b/src/api/routes/guilds/#guild_id/roles/index.ts
@@ -122,7 +122,7 @@ router.patch( permission: "MANAGE_ROLES", responses: { 200: { - body: "GuildRolesResponse", + body: "APIRoleArray", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/guilds/#guild_id/stickers.ts b/src/api/routes/guilds/#guild_id/stickers.ts
index 38b10e7d..2da9a21e 100644 --- a/src/api/routes/guilds/#guild_id/stickers.ts +++ b/src/api/routes/guilds/#guild_id/stickers.ts
@@ -38,7 +38,7 @@ router.get( route({ responses: { 200: { - body: "GuildStickersResponse", + body: "APIStickerArray", }, 403: { body: "APIErrorResponse", diff --git a/src/api/routes/guilds/#guild_id/templates.ts b/src/api/routes/guilds/#guild_id/templates.ts
index 12b235c7..85ae0ac9 100644 --- a/src/api/routes/guilds/#guild_id/templates.ts +++ b/src/api/routes/guilds/#guild_id/templates.ts
@@ -45,7 +45,7 @@ router.get( route({ responses: { 200: { - body: "GuildTemplatesResponse", + body: "APITemplateArray", }, }, }), diff --git a/src/api/routes/policies/instance/index.ts b/src/api/routes/policies/instance/index.ts
index 4b4bc194..6e269a5c 100644 --- a/src/api/routes/policies/instance/index.ts +++ b/src/api/routes/policies/instance/index.ts
@@ -26,7 +26,7 @@ router.get( route({ responses: { 200: { - body: "GeneralConfigurationResponse", + body: "APIGeneralConfiguration", }, }, }), diff --git a/src/api/routes/policies/instance/limits.ts b/src/api/routes/policies/instance/limits.ts
index e144a5bc..9852459d 100644 --- a/src/api/routes/policies/instance/limits.ts +++ b/src/api/routes/policies/instance/limits.ts
@@ -26,7 +26,7 @@ router.get( route({ responses: { 200: { - body: "LimitsConfigurationResponse", + body: "APILimitsConfiguration", }, }, }), diff --git a/src/api/routes/sticker-packs/index.ts b/src/api/routes/sticker-packs/index.ts
index 627ce061..569d1104 100644 --- a/src/api/routes/sticker-packs/index.ts +++ b/src/api/routes/sticker-packs/index.ts
@@ -27,7 +27,7 @@ router.get( route({ responses: { 200: { - body: "StickerPacksResponse", + body: "APIStickerPackArray", }, }, }), diff --git a/src/api/routes/users/#id/index.ts b/src/api/routes/users/#id/index.ts
index 4e3625a4..1bd413d3 100644 --- a/src/api/routes/users/#id/index.ts +++ b/src/api/routes/users/#id/index.ts
@@ -27,7 +27,7 @@ router.get( route({ responses: { 200: { - body: "PublicUserResponse", + body: "APIPublicUser", }, }, }), diff --git a/src/api/routes/users/@me/channels.ts b/src/api/routes/users/@me/channels.ts
index 9354d0cf..8a8fadd9 100644 --- a/src/api/routes/users/@me/channels.ts +++ b/src/api/routes/users/@me/channels.ts
@@ -32,7 +32,7 @@ router.get( route({ responses: { 200: { - body: "UserChannelsResponse", + body: "APIDMChannelArray", }, }, }), diff --git a/src/api/routes/users/@me/guilds.ts b/src/api/routes/users/@me/guilds.ts
index b5fdca26..0bce432b 100644 --- a/src/api/routes/users/@me/guilds.ts +++ b/src/api/routes/users/@me/guilds.ts
@@ -36,7 +36,7 @@ router.get( route({ responses: { 200: { - body: "UserGuildsResponse", + body: "APIGuildArray", }, }, }), diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts
index 14feb1b1..8fe86265 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts
@@ -39,7 +39,7 @@ router.get( route({ responses: { 200: { - body: "PrivateUserResponse", + body: "APIPrivateUser", }, }, }), diff --git a/src/api/routes/users/@me/mfa/codes-verification.ts b/src/api/routes/users/@me/mfa/codes-verification.ts
index 7e336e5a..f71704a9 100644 --- a/src/api/routes/users/@me/mfa/codes-verification.ts +++ b/src/api/routes/users/@me/mfa/codes-verification.ts
@@ -34,7 +34,7 @@ router.post( requestBody: "CodesVerificationSchema", responses: { 200: { - body: "UserBackupCodesResponse", + body: "APIBackupCodeArray", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/users/@me/mfa/codes.ts b/src/api/routes/users/@me/mfa/codes.ts
index 7a60522a..f9cfc4c4 100644 --- a/src/api/routes/users/@me/mfa/codes.ts +++ b/src/api/routes/users/@me/mfa/codes.ts
@@ -40,7 +40,7 @@ router.post( "This route is replaced with users/@me/mfa/codes-verification in newer clients", responses: { 200: { - body: "UserBackupCodesResponse", + body: "APIBackupCodeArray", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/voice/regions.ts b/src/api/routes/voice/regions.ts
index 9fb58fbe..10a8b21d 100644 --- a/src/api/routes/voice/regions.ts +++ b/src/api/routes/voice/regions.ts
@@ -26,7 +26,7 @@ router.get( route({ responses: { 200: { - body: "GuildVoiceRegionsResponse", + body: "APIGuildVoiceRegion", }, }, }), diff --git a/src/util/schemas/UserProfileResponse.ts b/src/util/schemas/UserProfileResponse.ts
index 4ef6431e..10bbcdbf 100644 --- a/src/util/schemas/UserProfileResponse.ts +++ b/src/util/schemas/UserProfileResponse.ts
@@ -16,10 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { PublicConnectedAccount, PublicUserResponse } from ".."; +import { PublicConnectedAccount, PublicUser } from ".."; export interface UserProfileResponse { - user: PublicUserResponse; + user: PublicUser; connected_accounts: PublicConnectedAccount; premium_guild_since?: Date; premium_since?: Date; diff --git a/src/util/schemas/responses/ApplicationDetectableResponse.ts b/src/util/schemas/responses/ApplicationDetectableResponse.ts deleted file mode 100644
index 958b8d43..00000000 --- a/src/util/schemas/responses/ApplicationDetectableResponse.ts +++ /dev/null
@@ -1 +0,0 @@ -export type ApplicationDetectableResponse = unknown[]; diff --git a/src/util/schemas/responses/ApplicationEntitlementsResponse.ts b/src/util/schemas/responses/ApplicationEntitlementsResponse.ts deleted file mode 100644
index 1d2b349e..00000000 --- a/src/util/schemas/responses/ApplicationEntitlementsResponse.ts +++ /dev/null
@@ -1 +0,0 @@ -export type ApplicationEntitlementsResponse = unknown[]; diff --git a/src/util/schemas/responses/ApplicationSkusResponse.ts b/src/util/schemas/responses/ApplicationSkusResponse.ts deleted file mode 100644
index 8d577c92..00000000 --- a/src/util/schemas/responses/ApplicationSkusResponse.ts +++ /dev/null
@@ -1 +0,0 @@ -export type ApplicationSkusResponse = unknown[]; diff --git a/src/util/schemas/responses/ApplicationsResponse.ts b/src/util/schemas/responses/ApplicationsResponse.ts deleted file mode 100644
index fef3fbde..00000000 --- a/src/util/schemas/responses/ApplicationsResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Application } from "../../entities"; - -export type ApplicationsResponse = Application[]; diff --git a/src/util/schemas/responses/ChannelInvitesResponse.ts b/src/util/schemas/responses/ChannelInvitesResponse.ts deleted file mode 100644
index c50d033c..00000000 --- a/src/util/schemas/responses/ChannelInvitesResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Invite } from "../../entities"; - -export type ChannelInvitesResponse = Invite[]; diff --git a/src/util/schemas/responses/ChannelMessagesResponse.ts b/src/util/schemas/responses/ChannelMessagesResponse.ts deleted file mode 100644
index 65b7dab5..00000000 --- a/src/util/schemas/responses/ChannelMessagesResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Message } from "../../entities"; - -export type ChannelMessagesResponse = Message[]; diff --git a/src/util/schemas/responses/ChannelPinsResponse.ts b/src/util/schemas/responses/ChannelPinsResponse.ts deleted file mode 100644
index 7a1b8d43..00000000 --- a/src/util/schemas/responses/ChannelPinsResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Message } from "../../entities"; - -export type ChannelPinsResponse = Message[]; diff --git a/src/util/schemas/responses/ChannelWebhooksResponse.ts b/src/util/schemas/responses/ChannelWebhooksResponse.ts deleted file mode 100644
index 84f49dce..00000000 --- a/src/util/schemas/responses/ChannelWebhooksResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Webhook } from "../../entities"; - -export type ChannelWebhooksResponse = Webhook[]; diff --git a/src/util/schemas/responses/DiscoveryCategoriesResponse.ts b/src/util/schemas/responses/DiscoveryCategoriesResponse.ts deleted file mode 100644
index c23f4f88..00000000 --- a/src/util/schemas/responses/DiscoveryCategoriesResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Categories } from "../../entities"; - -export type DiscoveryCategoriesResponse = Categories[]; diff --git a/src/util/schemas/responses/GeneralConfigurationResponse.ts b/src/util/schemas/responses/GeneralConfigurationResponse.ts deleted file mode 100644
index 4feaa32d..00000000 --- a/src/util/schemas/responses/GeneralConfigurationResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { GeneralConfiguration } from "../../config"; - -export type GeneralConfigurationResponse = GeneralConfiguration; diff --git a/src/util/schemas/responses/GuildChannelsResponse.ts b/src/util/schemas/responses/GuildChannelsResponse.ts deleted file mode 100644
index 3321455d..00000000 --- a/src/util/schemas/responses/GuildChannelsResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Channel } from "../../entities"; - -export type GuildChannelsResponse = Channel[]; diff --git a/src/util/schemas/responses/GuildEmojisResponse.ts b/src/util/schemas/responses/GuildEmojisResponse.ts deleted file mode 100644
index cea6fd55..00000000 --- a/src/util/schemas/responses/GuildEmojisResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Emoji } from "../../entities"; - -export type GuildEmojisResponse = Emoji[]; diff --git a/src/util/schemas/responses/GuildInvitesResponse.ts b/src/util/schemas/responses/GuildInvitesResponse.ts deleted file mode 100644
index cf9ed9cc..00000000 --- a/src/util/schemas/responses/GuildInvitesResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Invite } from "../../entities"; - -export type GuildInvitesResponse = Invite[]; diff --git a/src/util/schemas/responses/GuildMembersResponse.ts b/src/util/schemas/responses/GuildMembersResponse.ts deleted file mode 100644
index 8d14fd9e..00000000 --- a/src/util/schemas/responses/GuildMembersResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Member } from "../../entities"; - -export type GuildMembersResponse = Member[]; diff --git a/src/util/schemas/responses/GuildResponse.ts b/src/util/schemas/responses/GuildResponse.ts deleted file mode 100644
index 00035243..00000000 --- a/src/util/schemas/responses/GuildResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Guild } from "../../entities"; - -export type GuildResponse = Guild & { joined_at: string }; diff --git a/src/util/schemas/responses/GuildRolesResponse.ts b/src/util/schemas/responses/GuildRolesResponse.ts deleted file mode 100644
index a064cddb..00000000 --- a/src/util/schemas/responses/GuildRolesResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Role } from "../../entities"; - -export type GuildRolesResponse = Role[]; diff --git a/src/util/schemas/responses/GuildStickersResponse.ts b/src/util/schemas/responses/GuildStickersResponse.ts deleted file mode 100644
index a02f3e55..00000000 --- a/src/util/schemas/responses/GuildStickersResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Sticker } from "../../entities"; - -export type GuildStickersResponse = Sticker[]; diff --git a/src/util/schemas/responses/GuildTemplatesResponse.ts b/src/util/schemas/responses/GuildTemplatesResponse.ts deleted file mode 100644
index e975fe43..00000000 --- a/src/util/schemas/responses/GuildTemplatesResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { Template } from "../../entities"; - -export type GuildTemplatesResponse = Template[]; diff --git a/src/util/schemas/responses/GuildVoiceRegionsResponse.ts b/src/util/schemas/responses/GuildVoiceRegionsResponse.ts
index c17e2f5d..8190d5fd 100644 --- a/src/util/schemas/responses/GuildVoiceRegionsResponse.ts +++ b/src/util/schemas/responses/GuildVoiceRegionsResponse.ts
@@ -5,5 +5,3 @@ export interface GuildVoiceRegion { deprecated: boolean; optimal: boolean; } - -export type GuildVoiceRegionsResponse = GuildVoiceRegion[]; diff --git a/src/util/schemas/responses/LimitsConfigurationResponse.ts b/src/util/schemas/responses/LimitsConfigurationResponse.ts deleted file mode 100644
index f40ab918..00000000 --- a/src/util/schemas/responses/LimitsConfigurationResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { LimitsConfiguration } from "../../config"; - -export type LimitsConfigurationResponse = LimitsConfiguration; diff --git a/src/util/schemas/responses/StickerPacksResponse.ts b/src/util/schemas/responses/StickerPacksResponse.ts deleted file mode 100644
index 4f382df0..00000000 --- a/src/util/schemas/responses/StickerPacksResponse.ts +++ /dev/null
@@ -1,3 +0,0 @@ -import { StickerPack } from "../../entities"; - -export type StickerPacksResponse = StickerPack[]; diff --git a/src/util/schemas/responses/TypedResponses.ts b/src/util/schemas/responses/TypedResponses.ts new file mode 100644
index 00000000..cb238401 --- /dev/null +++ b/src/util/schemas/responses/TypedResponses.ts
@@ -0,0 +1,84 @@ +import { GeneralConfiguration, LimitsConfiguration } from "../../config"; +import { DmChannelDTO } from "../../dtos"; +import { + Application, + BackupCode, + Categories, + Channel, + Emoji, + Guild, + Invite, + Member, + Message, + PrivateUser, + PublicUser, + Role, + Sticker, + StickerPack, + Template, + Webhook, +} from "../../entities"; +import { GuildVoiceRegion } from "./GuildVoiceRegionsResponse"; + +// removes internal properties from the guild class +export type APIGuild = Omit< + Guild, + | "afk_channel" + | "template" + | "owner" + | "public_updates_channel" + | "rules_channel" + | "system_channel" + | "widget_channel" +>; + +export type APIPublicUser = PublicUser; +export type APIPrivateUser = PrivateUser; + +export type APIGuildArray = APIGuild[]; + +export type APIDMChannelArray = DmChannelDTO[]; + +export type APIBackupCodeArray = BackupCode[]; + +export interface UserUpdateResponse extends APIPrivateUser { + newToken?: string; +} + +export type ApplicationDetectableResponse = unknown[]; + +export type ApplicationEntitlementsResponse = unknown[]; + +export type ApplicationSkusResponse = unknown[]; + +export type APIApplicationArray = Application[]; + +export type APIInviteArray = Invite[]; + +export type APIMessageArray = Message[]; + +export type APIWebhookArray = Webhook[]; + +export type APIDiscoveryCategoryArray = Categories[]; + +export type APIGeneralConfiguration = GeneralConfiguration; + +export type APIChannelArray = Channel[]; + +export type APIEmojiArray = Emoji[]; + +export type APIMemberArray = Member[]; + +export type GuildWithJoinedAt = Guild & { joined_at: string }; + +export type APIRoleArray = Role[]; + +export type APIStickerArray = Sticker[]; + +export type APITemplateArray = Template[]; + +export type APIGuildVoiceRegion = GuildVoiceRegion[]; + +export type APILimitsConfiguration = LimitsConfiguration; + +export type APIStickerPackArray = StickerPack[]; diff --git a/src/util/schemas/responses/UserResponse.ts b/src/util/schemas/responses/UserResponse.ts deleted file mode 100644
index 95f73649..00000000 --- a/src/util/schemas/responses/UserResponse.ts +++ /dev/null
@@ -1,15 +0,0 @@ -import { DmChannelDTO } from "../../dtos"; -import { BackupCode, Guild, PrivateUser, PublicUser } from "../../entities"; - -export type PublicUserResponse = PublicUser; -export type PrivateUserResponse = PrivateUser; - -export interface UserUpdateResponse extends PrivateUserResponse { - newToken?: string; -} - -export type UserGuildsResponse = Guild[]; - -export type UserChannelsResponse = DmChannelDTO[]; - -export type UserBackupCodesResponse = BackupCode[]; diff --git a/src/util/schemas/responses/index.ts b/src/util/schemas/responses/index.ts
index 282c4a41..d8b7fd57 100644 --- a/src/util/schemas/responses/index.ts +++ b/src/util/schemas/responses/index.ts
@@ -1,34 +1,17 @@ export * from "./APIErrorOrCaptchaResponse"; export * from "./APIErrorResponse"; -export * from "./ApplicationDetectableResponse"; -export * from "./ApplicationEntitlementsResponse"; -export * from "./ApplicationSkusResponse"; -export * from "./ApplicationsResponse"; export * from "./BackupCodesChallengeResponse"; export * from "./CaptchaRequiredResponse"; -export * from "./ChannelInvitesResponse"; -export * from "./ChannelPinsResponse"; -export * from "./ChannelWebhooksResponse"; export * from "./DiscoverableGuildsResponse"; -export * from "./DiscoveryCategoriesResponse"; export * from "./GatewayBotResponse"; export * from "./GatewayResponse"; -export * from "./GeneralConfigurationResponse"; export * from "./GenerateRegistrationTokensResponse"; export * from "./GuildBansResponse"; -export * from "./GuildChannelsResponse"; export * from "./GuildCreateResponse"; export * from "./GuildDiscoveryRequirements"; -export * from "./GuildEmojisResponse"; -export * from "./GuildInvitesResponse"; -export * from "./GuildMembersResponse"; export * from "./GuildMessagesSearchResponse"; export * from "./GuildPruneResponse"; export * from "./GuildRecommendationsResponse"; -export * from "./GuildResponse"; -export * from "./GuildRolesResponse"; -export * from "./GuildStickersResponse"; -export * from "./GuildTemplatesResponse"; export * from "./GuildVanityUrl"; export * from "./GuildVoiceRegionsResponse"; export * from "./GuildWidgetJsonResponse"; @@ -36,18 +19,16 @@ export * from "./GuildWidgetSettingsResponse"; export * from "./InstanceDomainsResponse"; export * from "./InstancePingResponse"; export * from "./InstanceStatsResponse"; -export * from "./LimitsConfigurationResponse"; export * from "./LocationMetadataResponse"; export * from "./MemberJoinGuildResponse"; export * from "./OAuthAuthorizeResponse"; -export * from "./StickerPacksResponse"; export * from "./Tenor"; export * from "./TokenResponse"; +export * from "./TypedResponses"; export * from "./UpdatesResponse"; export * from "./UserNoteResponse"; export * from "./UserProfileResponse"; export * from "./UserRelationshipsResponse"; export * from "./UserRelationsResponse"; -export * from "./UserResponse"; export * from "./WebAuthnCreateResponse"; export * from "./WebhookCreateResponse";