summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-04-20 00:01:32 +0200
committerRory& <root@rory.gay>2026-04-20 00:15:22 +0200
commit55344e6d90c2f5f9cb4792f01264d1875662ace2 (patch)
treedc020af0d4f56c35f02d15a1e35fd0bda9dfa41e
parentClean up schemas/gateway a bit (diff)
downloadserver-ts-55344e6d90c2f5f9cb4792f01264d1875662ace2.tar.xz
Clean up schemas/responses a bit
-rw-r--r--src/schemas/responses/EmailDomainLookupResponse.ts1
-rw-r--r--src/schemas/responses/EmojiSourceResponse.ts1
-rw-r--r--src/schemas/responses/GatewayBotResponse.ts28
-rw-r--r--src/schemas/responses/GatewayResponse.ts10
-rw-r--r--src/schemas/responses/GuildCreateResponse.ts1
-rw-r--r--src/schemas/responses/GuildWidgetJsonResponse.ts1
-rw-r--r--src/schemas/responses/GuildWidgetSettingsResponse.ts2
-rw-r--r--src/schemas/responses/MemberJoinGuildResponse.ts1
-rw-r--r--src/schemas/responses/PreloadMessagesResponseSchema.ts1
-rw-r--r--src/schemas/responses/SettingsProtoUpdateResponse.ts1
-rw-r--r--src/schemas/responses/TeamListResponse.ts1
-rw-r--r--src/schemas/responses/TypedResponses.ts6
-rw-r--r--src/schemas/responses/UserProfileResponse.ts1
-rw-r--r--src/schemas/responses/UserRelationsResponse.ts11
-rw-r--r--src/schemas/responses/WebAuthnCreateResponse.ts1
-rw-r--r--src/schemas/responses/index.ts2
16 files changed, 35 insertions, 34 deletions
diff --git a/src/schemas/responses/EmailDomainLookupResponse.ts b/src/schemas/responses/EmailDomainLookupResponse.ts

index c3ce5213..863e11e9 100644 --- a/src/schemas/responses/EmailDomainLookupResponse.ts +++ b/src/schemas/responses/EmailDomainLookupResponse.ts
@@ -15,6 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ + export interface HubGuild { icon: string; id: string; diff --git a/src/schemas/responses/EmojiSourceResponse.ts b/src/schemas/responses/EmojiSourceResponse.ts
index 9397027d..f01848a8 100644 --- a/src/schemas/responses/EmojiSourceResponse.ts +++ b/src/schemas/responses/EmojiSourceResponse.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: remove entity import import { Emoji } from "@spacebar/util"; export interface EmojiSourceResponse { diff --git a/src/schemas/responses/GatewayBotResponse.ts b/src/schemas/responses/GatewayBotResponse.ts deleted file mode 100644
index 1bbe1598..00000000 --- a/src/schemas/responses/GatewayBotResponse.ts +++ /dev/null
@@ -1,28 +0,0 @@ -/* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. -*/ - -export interface GatewayBotResponse { - url: string; - shards: number; - session_start_limit: { - total: number; - remaining: number; - reset_after: number; - max_concurrency: number; - }; -} diff --git a/src/schemas/responses/GatewayResponse.ts b/src/schemas/responses/GatewayResponse.ts
index 7d1c659e..7327e1ed 100644 --- a/src/schemas/responses/GatewayResponse.ts +++ b/src/schemas/responses/GatewayResponse.ts
@@ -19,3 +19,13 @@ export interface GatewayResponse { url: string; } + +export interface GatewayBotResponse extends GatewayResponse { + shards: number; + session_start_limit: { + total: number; + remaining: number; + reset_after: number; + max_concurrency: number; + }; +} diff --git a/src/schemas/responses/GuildCreateResponse.ts b/src/schemas/responses/GuildCreateResponse.ts
index 0fef3843..cd115cf3 100644 --- a/src/schemas/responses/GuildCreateResponse.ts +++ b/src/schemas/responses/GuildCreateResponse.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: remove import from util import { GuildWelcomeScreen } from "@spacebar/util"; import { GuildUpdateSchema } from "@spacebar/schemas"; diff --git a/src/schemas/responses/GuildWidgetJsonResponse.ts b/src/schemas/responses/GuildWidgetJsonResponse.ts
index a1c99dde..84fb9913 100644 --- a/src/schemas/responses/GuildWidgetJsonResponse.ts +++ b/src/schemas/responses/GuildWidgetJsonResponse.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: remove util import import { ClientStatus } from "@spacebar/util"; export interface GuildWidgetJsonResponse { diff --git a/src/schemas/responses/GuildWidgetSettingsResponse.ts b/src/schemas/responses/GuildWidgetSettingsResponse.ts
index 957aaff0..0b7bb921 100644 --- a/src/schemas/responses/GuildWidgetSettingsResponse.ts +++ b/src/schemas/responses/GuildWidgetSettingsResponse.ts
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Snowflake } from "@spacebar/util"; +import { Snowflake } from "../Identifiers"; export interface GuildWidgetSettingsResponse { enabled: boolean; diff --git a/src/schemas/responses/MemberJoinGuildResponse.ts b/src/schemas/responses/MemberJoinGuildResponse.ts
index 75081656..bbb370cc 100644 --- a/src/schemas/responses/MemberJoinGuildResponse.ts +++ b/src/schemas/responses/MemberJoinGuildResponse.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: remove entity imports import { Emoji, Role, Sticker } from "@spacebar/util"; import { GuildCreateResponse } from "@spacebar/schemas"; diff --git a/src/schemas/responses/PreloadMessagesResponseSchema.ts b/src/schemas/responses/PreloadMessagesResponseSchema.ts
index 0edb6a71..0a767888 100644 --- a/src/schemas/responses/PreloadMessagesResponseSchema.ts +++ b/src/schemas/responses/PreloadMessagesResponseSchema.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: remove entity import import { Message } from "@spacebar/util"; export type PreloadMessagesResponseSchema = Message[]; diff --git a/src/schemas/responses/SettingsProtoUpdateResponse.ts b/src/schemas/responses/SettingsProtoUpdateResponse.ts
index 079f36c4..fe635f77 100644 --- a/src/schemas/responses/SettingsProtoUpdateResponse.ts +++ b/src/schemas/responses/SettingsProtoUpdateResponse.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: is there a better alternative for this? import { JsonValue } from "@protobuf-ts/runtime"; export interface SettingsProtoResponse { diff --git a/src/schemas/responses/TeamListResponse.ts b/src/schemas/responses/TeamListResponse.ts
index e4e8284e..d8bf8564 100644 --- a/src/schemas/responses/TeamListResponse.ts +++ b/src/schemas/responses/TeamListResponse.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: remove entity import import { Team } from "@spacebar/util"; export type TeamListResponse = Team[]; diff --git a/src/schemas/responses/TypedResponses.ts b/src/schemas/responses/TypedResponses.ts
index 4ce27536..9fa6cd0c 100644 --- a/src/schemas/responses/TypedResponses.ts +++ b/src/schemas/responses/TypedResponses.ts
@@ -16,11 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: clean up util imports import { GeneralConfiguration, LimitsConfiguration } from "../../util/config/types"; import { DmChannelDTO } from "../../util/dtos"; -import { Application, BackupCode, Categories, Channel, Emoji, Guild, Invite, Member, Message, Role, Sticker, StickerPack, Template, Webhook } from "@spacebar/util"; +// TODO: remove entity imports +import { Application, BackupCode, Categories, Channel, Guild, Invite, Member, Message, Role, Template, Webhook } from "@spacebar/util"; import { GuildVoiceRegion } from "./GuildVoiceRegionsResponse"; -import { GuildBansResponse, GuildCreateResponse, PrivateUser, PublicMember, PublicUser } from "@spacebar/schemas"; +import { GuildCreateResponse, PrivateUser, PublicMember, PublicUser } from "@spacebar/schemas"; // TODO: remove this entire file! // removes internal properties from the guild class diff --git a/src/schemas/responses/UserProfileResponse.ts b/src/schemas/responses/UserProfileResponse.ts
index 656e139b..64459bd1 100644 --- a/src/schemas/responses/UserProfileResponse.ts +++ b/src/schemas/responses/UserProfileResponse.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: remove entity imports import { Badge, Member, User } from "@spacebar/util"; import { PublicConnectedAccount, PublicMember, PublicUser } from "@spacebar/schemas"; diff --git a/src/schemas/responses/UserRelationsResponse.ts b/src/schemas/responses/UserRelationsResponse.ts
index 377cab09..8124a55c 100644 --- a/src/schemas/responses/UserRelationsResponse.ts +++ b/src/schemas/responses/UserRelationsResponse.ts
@@ -15,6 +15,13 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { User } from "@spacebar/util"; -export type UserRelationsResponse = (Pick<User, "id"> & Pick<User, "username"> & Pick<User, "discriminator"> & Pick<User, "avatar"> & Pick<User, "public_flags">)[]; +export interface UserRelationResponse { + id: string; + username: string; + discriminator: string; + avatar?: string; + public_flags: number; +} + +export type UserRelationsResponse = UserRelationResponse[]; diff --git a/src/schemas/responses/WebAuthnCreateResponse.ts b/src/schemas/responses/WebAuthnCreateResponse.ts
index b87ff1df..37d768eb 100644 --- a/src/schemas/responses/WebAuthnCreateResponse.ts +++ b/src/schemas/responses/WebAuthnCreateResponse.ts
@@ -15,6 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ + export interface WebAuthnCreateResponse { name: string; id: string; diff --git a/src/schemas/responses/index.ts b/src/schemas/responses/index.ts
index e231879e..c430cb17 100644 --- a/src/schemas/responses/index.ts +++ b/src/schemas/responses/index.ts
@@ -15,6 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ + export * from "./APIErrorOrCaptchaResponse"; export * from "./APIErrorResponse"; export * from "./AccountStandingResponse"; @@ -28,7 +29,6 @@ export * from "./DmMessagesResponseSchema"; export * from "./EmailDomainLookupResponse"; export * from "./EmailDomainLookupVerifyCodeResponse"; export * from "./EmojiSourceResponse"; -export * from "./GatewayBotResponse"; export * from "./GatewayResponse"; export * from "./GenerateRegistrationTokensResponse"; export * from "./GuildBansResponse";