diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f771c1a..162ce93 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,21 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -30,41 +39,54 @@
- {
+ "keyToString": {
+ "NIXITCH_NIXPKGS_CONFIG": "/etc/nix/nixpkgs-config.nix",
+ "NIXITCH_NIX_CONF_DIR": "",
+ "NIXITCH_NIX_OTHER_STORES": "",
+ "NIXITCH_NIX_PATH": "/home/Rory/.nix-defexpr/channels:nixpkgs=/nix/store/wb6agba4kfsxpbnb5hzlq58vkjzvbsk6-source",
+ "NIXITCH_NIX_PROFILES": "/run/current-system/sw /nix/var/nix/profiles/default /etc/profiles/per-user/Rory /home/Rory/.local/state/nix/profile /nix/profile /home/Rory/.nix-profile",
+ "NIXITCH_NIX_REMOTE": "",
+ "NIXITCH_NIX_USER_PROFILE_DIR": "/nix/var/nix/profiles/per-user/Rory",
+ "Node.js.Server.ts.executor": "Debug",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "javascript.nodejs.core.library.configured.version": "24.8.0",
+ "javascript.nodejs.core.library.typings.version": "24.7.0",
+ "last_opened_file_path": "/home/Rory/git/spacebar/server/src/admin-api/routes/v0",
+ "node.js.detected.package.eslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_interpreter_path": "node",
+ "nodejs_package_manager_path": "npm",
+ "npm.Start API.executor": "Run",
+ "npm.Start CDN.executor": "Run",
+ "npm.Start Gateway.executor": "Run",
+ "npm.build.executor": "Run",
+ "npm.start.executor": "Debug",
+ "prettierjs.PrettierConfiguration.Package": "/home/Rory/git/spacebar/server/node_modules/prettier",
+ "settings.editor.selected.configurable": "preferences.pluginManager",
+ "ts.external.directory.path": "/home/Rory/git/spacebar/server-master/node_modules/typescript/lib"
+ },
+ "keyToStringList": {
+ "GitStage.ChangesTree.GroupingKeys": [
+ "directory",
+ "module",
+ "repository"
+ ]
}
-}]]>
+}
+
+
+
+
+
diff --git a/package.json b/package.json
index c847f55..13a4102 100644
--- a/package.json
+++ b/package.json
@@ -120,6 +120,7 @@
"@spacebar/gateway": "dist/gateway",
"@spacebar/util": "dist/util",
"@spacebar/webrtc": "dist/webrtc",
+ "@spacebar/schemas": "dist/schemas",
"lambert-server": "dist/util/util/lambert-server"
},
"optionalDependencies": {
diff --git a/scripts/schema.js b/scripts/schema.js
index 32af357..7720583 100644
--- a/scripts/schema.js
+++ b/scripts/schema.js
@@ -94,7 +94,7 @@
function main() {
const program = TJS.programFromConfig(
path.join(__dirname, "..", "tsconfig.json"),
- walk(path.join(__dirname, "..", "src", "util", "schemas")),
+ walk(path.join(__dirname, "..", "src", "schemas")),
);
const generator = TJS.buildGenerator(program, settings);
if (!generator || !program) return;
diff --git a/src/schemas/AckBulkSchema.ts b/src/schemas/AckBulkSchema.ts
new file mode 100644
index 0000000..5604c2f
--- /dev/null
+++ b/src/schemas/AckBulkSchema.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface AckBulkSchema {
+ read_states: {
+ channel_id: string;
+ message_id: string;
+ read_state_type: number; // WHat is this?
+ }[];
+}
diff --git a/src/schemas/ActivitySchema.ts b/src/schemas/ActivitySchema.ts
new file mode 100644
index 0000000..f168f96
--- /dev/null
+++ b/src/schemas/ActivitySchema.ts
@@ -0,0 +1,80 @@
+/*
+ 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 .
+*/
+
+import { Activity, Status } from "@spacebar/util";
+
+export const ActivitySchema = {
+ $afk: Boolean,
+ status: String,
+ $activities: [
+ {
+ name: String,
+ type: Number,
+ $url: String,
+ $created_at: Date,
+ $timestamps: {
+ $start: Number,
+ $end: Number,
+ },
+ $application_id: String,
+ $details: String,
+ $state: String,
+ $emoji: {
+ $name: String,
+ $id: String,
+ $animated: Boolean,
+ },
+ $party: {
+ $id: String,
+ $size: [Number, Number],
+ },
+ $assets: {
+ $large_image: String,
+ $large_text: String,
+ $small_image: String,
+ $small_text: String,
+ },
+ $secrets: {
+ $join: String,
+ $spectate: String,
+ $match: String,
+ },
+ $instance: Boolean,
+ $flags: String,
+
+ // Spotify and other rich presence data
+ $id: String,
+ $sync_id: String,
+ $metadata: {
+ // spotify
+ $context_uri: String,
+ album_id: String,
+ artist_ids: [String],
+ },
+ $session_id: String,
+ },
+ ],
+ $since: Number, // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
+};
+
+export interface ActivitySchema {
+ afk?: boolean;
+ status: Status;
+ activities?: Activity[];
+ since?: number; // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
+}
diff --git a/src/schemas/ApplicationAuthorizeSchema.ts b/src/schemas/ApplicationAuthorizeSchema.ts
new file mode 100644
index 0000000..04b7b1e
--- /dev/null
+++ b/src/schemas/ApplicationAuthorizeSchema.ts
@@ -0,0 +1,29 @@
+/*
+ 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 .
+*/
+
+export interface ApplicationAuthorizeSchema {
+ authorize: boolean;
+ guild_id: string;
+ permissions: string;
+ captcha_key?: string;
+ /**
+ * @minLength 6
+ * @maxLength 6
+ */
+ code?: string; // 2fa code
+}
diff --git a/src/schemas/ApplicationCreateSchema.ts b/src/schemas/ApplicationCreateSchema.ts
new file mode 100644
index 0000000..80956ec
--- /dev/null
+++ b/src/schemas/ApplicationCreateSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface ApplicationCreateSchema {
+ name: string;
+ team_id?: string;
+}
diff --git a/src/schemas/ApplicationModifySchema.ts b/src/schemas/ApplicationModifySchema.ts
new file mode 100644
index 0000000..a871797
--- /dev/null
+++ b/src/schemas/ApplicationModifySchema.ts
@@ -0,0 +1,39 @@
+/*
+ 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 .
+*/
+
+export interface ApplicationModifySchema {
+ description?: string;
+ icon?: string;
+ cover_image?: string;
+ interactions_endpoint_url?: string;
+ max_participants?: number | null;
+ name?: string;
+ privacy_policy_url?: string;
+ role_connections_verification_url?: string;
+ tags?: string[];
+ terms_of_service_url?: string;
+ bot_public?: boolean;
+ bot_require_code_grant?: boolean;
+ flags?: number;
+ custom_install_url?: string;
+ guild_id?: string;
+ /*install_params?: { TODO: Validation
+ scopes: string[];
+ permissions: string;
+ };*/
+}
diff --git a/src/schemas/AutomodRuleSchema.ts b/src/schemas/AutomodRuleSchema.ts
new file mode 100644
index 0000000..55cf202
--- /dev/null
+++ b/src/schemas/AutomodRuleSchema.ts
@@ -0,0 +1,56 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2024 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 .
+*/
+
+export interface AutomodMentionSpamRuleSchema {
+ mention_total_limit: number;
+ mention_raid_protection_enabled: boolean;
+}
+
+export interface AutomodSuspectedSpamRuleSchema {}
+
+export interface AutomodCommonlyFlaggedWordsRuleSchema {
+ allow_list: [string];
+ presets: [number];
+}
+
+export interface AutomodCustomWordsRuleSchema {
+ allow_list: [string];
+ keyword_filter: [string];
+ regex_patterns: [string];
+}
+
+export interface AutomodRuleSchema {
+ creator_id: string;
+ enabled: boolean;
+ event_type: number; // No idea...
+ exempt_channels: [string];
+ exempt_roles: [string];
+ guild_id: string;
+ name: string;
+ position: number;
+ trigger_type: number; //AutomodTriggerTypes
+ trigger_metadata:
+ | AutomodMentionSpamRuleSchema
+ | AutomodSuspectedSpamRuleSchema
+ | AutomodCommonlyFlaggedWordsRuleSchema
+ | AutomodCustomWordsRuleSchema;
+}
+
+export interface AutomodRuleSchemaWithId extends AutomodRuleSchema {
+ id: string;
+}
diff --git a/src/schemas/BackupCodesChallengeSchema.ts b/src/schemas/BackupCodesChallengeSchema.ts
new file mode 100644
index 0000000..25f1b70
--- /dev/null
+++ b/src/schemas/BackupCodesChallengeSchema.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface BackupCodesChallengeSchema {
+ /**
+ * @minLength 1
+ * @maxLength 72
+ */
+ password: string;
+}
diff --git a/src/schemas/BanCreateSchema.ts b/src/schemas/BanCreateSchema.ts
new file mode 100644
index 0000000..6d30ca2
--- /dev/null
+++ b/src/schemas/BanCreateSchema.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+export interface BanCreateSchema {
+ delete_message_seconds?: string;
+ delete_message_days?: string;
+ reason?: string;
+}
diff --git a/src/schemas/BanModeratorSchema.ts b/src/schemas/BanModeratorSchema.ts
new file mode 100644
index 0000000..cba1a5e
--- /dev/null
+++ b/src/schemas/BanModeratorSchema.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface BanModeratorSchema {
+ id: string;
+ user_id: string;
+ guild_id: string;
+ executor_id: string;
+ reason?: string | undefined;
+}
diff --git a/src/schemas/BanRegistrySchema.ts b/src/schemas/BanRegistrySchema.ts
new file mode 100644
index 0000000..4e76870
--- /dev/null
+++ b/src/schemas/BanRegistrySchema.ts
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+
+export interface BanRegistrySchema {
+ id: string;
+ user_id: string;
+ guild_id: string;
+ executor_id: string;
+ ip?: string;
+ reason?: string | undefined;
+}
diff --git a/src/schemas/BotModifySchema.ts b/src/schemas/BotModifySchema.ts
new file mode 100644
index 0000000..7d94da2
--- /dev/null
+++ b/src/schemas/BotModifySchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface BotModifySchema {
+ avatar?: string;
+ username?: string;
+}
diff --git a/src/schemas/BulkBanSchema.ts b/src/schemas/BulkBanSchema.ts
new file mode 100644
index 0000000..48a7bac
--- /dev/null
+++ b/src/schemas/BulkBanSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface BulkBanSchema {
+ user_ids: string[];
+ delete_message_seconds?: number;
+}
diff --git a/src/schemas/BulkDeleteSchema.ts b/src/schemas/BulkDeleteSchema.ts
new file mode 100644
index 0000000..ca22f10
--- /dev/null
+++ b/src/schemas/BulkDeleteSchema.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface BulkDeleteSchema {
+ messages: string[];
+}
diff --git a/src/schemas/ChannelModifySchema.ts b/src/schemas/ChannelModifySchema.ts
new file mode 100644
index 0000000..088ac45
--- /dev/null
+++ b/src/schemas/ChannelModifySchema.ts
@@ -0,0 +1,48 @@
+/*
+ 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 .
+*/
+
+import { ChannelPermissionOverwriteType, ChannelType } from "@spacebar/util";
+
+export interface ChannelModifySchema {
+ /**
+ * @maxLength 100
+ */
+ name?: string;
+ type?: ChannelType;
+ topic?: string;
+ icon?: string | null;
+ bitrate?: number;
+ user_limit?: number;
+ rate_limit_per_user?: number;
+ position?: number;
+ permission_overwrites?: {
+ id: string;
+ type: ChannelPermissionOverwriteType;
+ allow: string;
+ deny: string;
+ }[];
+ parent_id?: string;
+ id?: string; // is not used (only for guild create)
+ nsfw?: boolean;
+ rtc_region?: string;
+ default_auto_archive_duration?: number;
+ default_reaction_emoji?: string | null;
+ flags?: number;
+ default_thread_rate_limit_per_user?: number;
+ video_quality_mode?: number;
+}
diff --git a/src/schemas/ChannelPermissionOverwriteSchema.ts b/src/schemas/ChannelPermissionOverwriteSchema.ts
new file mode 100644
index 0000000..6e8b340
--- /dev/null
+++ b/src/schemas/ChannelPermissionOverwriteSchema.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+import { ChannelPermissionOverwrite } from "@spacebar/util";
+
+export type ChannelPermissionOverwriteSchema = ChannelPermissionOverwrite;
diff --git a/src/schemas/ChannelReorderSchema.ts b/src/schemas/ChannelReorderSchema.ts
new file mode 100644
index 0000000..657ed42
--- /dev/null
+++ b/src/schemas/ChannelReorderSchema.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export type ChannelReorderSchema = {
+ id: string;
+ position?: number;
+ lock_permissions?: boolean;
+ parent_id?: null | string;
+}[];
diff --git a/src/schemas/CodesVerificationSchema.ts b/src/schemas/CodesVerificationSchema.ts
new file mode 100644
index 0000000..3c95e61
--- /dev/null
+++ b/src/schemas/CodesVerificationSchema.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+export interface CodesVerificationSchema {
+ key: string;
+ nonce: string;
+ regenerate?: boolean;
+}
diff --git a/src/schemas/ConnectedAccountSchema.ts b/src/schemas/ConnectedAccountSchema.ts
new file mode 100644
index 0000000..3c3e76e
--- /dev/null
+++ b/src/schemas/ConnectedAccountSchema.ts
@@ -0,0 +1,36 @@
+/*
+ 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 .
+*/
+
+import { ConnectedAccountTokenData } from "../util/interfaces";
+
+export interface ConnectedAccountSchema {
+ external_id: string;
+ user_id: string;
+ token_data?: ConnectedAccountTokenData;
+ friend_sync?: boolean;
+ name: string;
+ revoked?: boolean;
+ show_activity?: number;
+ type: string;
+ verified?: boolean;
+ visibility?: number;
+ integrations?: string[];
+ metadata_?: unknown;
+ metadata_visibility?: number;
+ two_way_link?: boolean;
+}
diff --git a/src/schemas/ConnectionCallbackSchema.ts b/src/schemas/ConnectionCallbackSchema.ts
new file mode 100644
index 0000000..b66bfe2
--- /dev/null
+++ b/src/schemas/ConnectionCallbackSchema.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface ConnectionCallbackSchema {
+ code?: string;
+ state: string;
+ insecure: boolean;
+ friend_sync: boolean;
+ openid_params?: unknown; // TODO: types
+}
diff --git a/src/schemas/ConnectionUpdateSchema.ts b/src/schemas/ConnectionUpdateSchema.ts
new file mode 100644
index 0000000..f9f17b0
--- /dev/null
+++ b/src/schemas/ConnectionUpdateSchema.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+export interface ConnectionUpdateSchema {
+ visibility?: boolean;
+ show_activity?: boolean;
+ metadata_visibility?: boolean;
+}
diff --git a/src/schemas/DmChannelCreateSchema.ts b/src/schemas/DmChannelCreateSchema.ts
new file mode 100644
index 0000000..510ff9c
--- /dev/null
+++ b/src/schemas/DmChannelCreateSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface DmChannelCreateSchema {
+ name?: string;
+ recipients: string[];
+}
diff --git a/src/schemas/EmailDomainLookupSchema.ts b/src/schemas/EmailDomainLookupSchema.ts
new file mode 100644
index 0000000..43680aa
--- /dev/null
+++ b/src/schemas/EmailDomainLookupSchema.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export interface EmailDomainLookupSchema {
+ allow_multiple_guilds: boolean;
+ email: string;
+ use_verification_code: boolean;
+ guild_id?: string;
+}
diff --git a/src/schemas/EmailDomainLookupVerifyCodeSchema.ts b/src/schemas/EmailDomainLookupVerifyCodeSchema.ts
new file mode 100644
index 0000000..9fe0bd4
--- /dev/null
+++ b/src/schemas/EmailDomainLookupVerifyCodeSchema.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+export interface EmailDomainLookupVerifyCodeSchema {
+ email: string;
+ guild_id: string;
+ code: string;
+}
diff --git a/src/schemas/EmojiCreateSchema.ts b/src/schemas/EmojiCreateSchema.ts
new file mode 100644
index 0000000..5eae5a9
--- /dev/null
+++ b/src/schemas/EmojiCreateSchema.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export interface EmojiCreateSchema {
+ name?: string;
+ image: string;
+ require_colons?: boolean | null;
+ roles?: string[];
+}
diff --git a/src/schemas/EmojiModifySchema.ts b/src/schemas/EmojiModifySchema.ts
new file mode 100644
index 0000000..5d33bf6
--- /dev/null
+++ b/src/schemas/EmojiModifySchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface EmojiModifySchema {
+ name?: string;
+ roles?: string[];
+}
diff --git a/src/schemas/ForgotPasswordSchema.ts b/src/schemas/ForgotPasswordSchema.ts
new file mode 100644
index 0000000..0f9fc92
--- /dev/null
+++ b/src/schemas/ForgotPasswordSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface ForgotPasswordSchema {
+ login: string;
+ captcha_key?: string;
+}
diff --git a/src/schemas/GatewayBotResponse.ts b/src/schemas/GatewayBotResponse.ts
new file mode 100644
index 0000000..c68ec09
--- /dev/null
+++ b/src/schemas/GatewayBotResponse.ts
@@ -0,0 +1,28 @@
+/*
+ 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 .
+*/
+
+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/GatewayPayloadSchema.ts b/src/schemas/GatewayPayloadSchema.ts
new file mode 100644
index 0000000..cb01f16
--- /dev/null
+++ b/src/schemas/GatewayPayloadSchema.ts
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+
+import { Tuple } from "lambert-server*";
+
+export const PayloadSchema = {
+ op: Number,
+ $d: new Tuple(Object, Number), // or number for heartbeat sequence
+ $s: Number,
+ $t: String,
+};
diff --git a/src/schemas/GatewayResponse.ts b/src/schemas/GatewayResponse.ts
new file mode 100644
index 0000000..5b771ed
--- /dev/null
+++ b/src/schemas/GatewayResponse.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface GatewayResponse {
+ url: string;
+}
diff --git a/src/schemas/GreetRequestSchema.ts b/src/schemas/GreetRequestSchema.ts
new file mode 100644
index 0000000..545952d
--- /dev/null
+++ b/src/schemas/GreetRequestSchema.ts
@@ -0,0 +1,30 @@
+/*
+ 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 .
+*/
+
+import { AllowedMentions } from "@spacebar/util";
+
+export interface GreetRequestSchema {
+ sticker_ids: string[];
+ allowed_mentions?: AllowedMentions;
+ message_reference?: {
+ message_id: string;
+ channel_id?: string;
+ guild_id?: string;
+ fail_if_not_exists?: boolean;
+ };
+}
\ No newline at end of file
diff --git a/src/schemas/GuildCreateSchema.ts b/src/schemas/GuildCreateSchema.ts
new file mode 100644
index 0000000..278a759
--- /dev/null
+++ b/src/schemas/GuildCreateSchema.ts
@@ -0,0 +1,33 @@
+/*
+ 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 .
+*/
+
+import { ChannelModifySchema } from "./index";
+
+export interface GuildCreateSchema {
+ /**
+ * @maxLength 100
+ */
+ name?: string;
+ region?: string;
+ icon?: string | null;
+ channels?: ChannelModifySchema[];
+ system_channel_id?: string;
+ rules_channel_id?: string;
+ guild_template_code?: string;
+ staff_only?: boolean;
+}
diff --git a/src/schemas/GuildSubscriptionsBulkSchema.ts b/src/schemas/GuildSubscriptionsBulkSchema.ts
new file mode 100644
index 0000000..86f00a3
--- /dev/null
+++ b/src/schemas/GuildSubscriptionsBulkSchema.ts
@@ -0,0 +1,11 @@
+import { LazyRequestSchema } from "./LazyRequestSchema";
+
+export interface GuildSubscriptionsBulkSchema {
+ subscriptions: { [key: string]: GuildSubscriptionSchema };
+}
+
+export type GuildSubscriptionSchema = Omit;
+
+export const GuildSubscriptionsBulkSchema = {
+ $subscriptions: Object,
+};
diff --git a/src/schemas/GuildTemplateCreateSchema.ts b/src/schemas/GuildTemplateCreateSchema.ts
new file mode 100644
index 0000000..048de6f
--- /dev/null
+++ b/src/schemas/GuildTemplateCreateSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface GuildTemplateCreateSchema {
+ name: string;
+ avatar?: string | null;
+}
diff --git a/src/schemas/GuildUpdateSchema.ts b/src/schemas/GuildUpdateSchema.ts
new file mode 100644
index 0000000..069be6c
--- /dev/null
+++ b/src/schemas/GuildUpdateSchema.ts
@@ -0,0 +1,37 @@
+/*
+ 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 .
+*/
+
+import { GuildCreateSchema } from "@spacebar/util";
+
+export interface GuildUpdateSchema extends Omit {
+ banner?: string | null;
+ splash?: string | null;
+ description?: string;
+ features?: string[];
+ verification_level?: number;
+ default_message_notifications?: number;
+ system_channel_flags?: number;
+ explicit_content_filter?: number;
+ public_updates_channel_id?: string;
+ afk_timeout?: number;
+ afk_channel_id?: string;
+ preferred_locale?: string;
+ premium_progress_bar_enabled?: boolean;
+ discovery_splash?: string;
+ safety_alerts_channel_id?: string | null;
+}
diff --git a/src/schemas/GuildUpdateWelcomeScreenSchema.ts b/src/schemas/GuildUpdateWelcomeScreenSchema.ts
new file mode 100644
index 0000000..8046aae
--- /dev/null
+++ b/src/schemas/GuildUpdateWelcomeScreenSchema.ts
@@ -0,0 +1,28 @@
+/*
+ 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 .
+*/
+
+export interface GuildUpdateWelcomeScreenSchema {
+ welcome_channels?: {
+ channel_id: string;
+ description: string;
+ emoji_id?: string;
+ emoji_name?: string;
+ }[];
+ enabled?: boolean;
+ description?: string;
+}
diff --git a/src/schemas/HubWaitlistSignupSchema.ts b/src/schemas/HubWaitlistSignupSchema.ts
new file mode 100644
index 0000000..8114b3d
--- /dev/null
+++ b/src/schemas/HubWaitlistSignupSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface HubWaitlistSignupSchema {
+ email: string;
+ school: string;
+}
diff --git a/src/schemas/IdentifySchema.ts b/src/schemas/IdentifySchema.ts
new file mode 100644
index 0000000..0619dac
--- /dev/null
+++ b/src/schemas/IdentifySchema.ts
@@ -0,0 +1,144 @@
+/*
+ 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 .
+*/
+
+import { ActivitySchema } from "@spacebar/util";
+
+// TODO: Need a way to allow camalCase and pascal_case without just duplicating the schema
+
+export const IdentifySchema = {
+ token: String,
+ $intents: BigInt, // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt
+ $properties: Object,
+ // {
+ // // discord uses $ in the property key for bots, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key
+ // $os: String,
+ // $os_arch: String,
+ // $browser: String,
+ // $device: String,
+ // $$os: String,
+ // $$browser: String,
+ // $$device: String,
+ // $browser_user_agent: String,
+ // $browser_version: String,
+ // $os_version: String,
+ // $referrer: String,
+ // $$referrer: String,
+ // $referring_domain: String,
+ // $$referring_domain: String,
+ // $referrer_current: String,
+ // $referring_domain_current: String,
+ // $release_channel: String,
+ // $client_build_number: Number,
+ // $client_event_source: String,
+ // $client_version: String,
+ // $system_locale: String,
+ // $window_manager: String,
+ // $distro: String,
+ // },
+ $presence: ActivitySchema,
+ $compress: Boolean,
+ $large_threshold: Number,
+ $shard: [BigInt, BigInt],
+ $guild_subscriptions: Boolean,
+ $capabilities: Number,
+ $client_state: {
+ $guild_hashes: Object,
+ $highest_last_message_id: String || Number,
+ $read_state_version: Number,
+ $user_guild_settings_version: Number,
+ $user_settings_version: undefined,
+ $useruser_guild_settings_version: undefined,
+ $private_channels_version: Number,
+ $guild_versions: Object,
+ $api_code_version: Number,
+ $initial_guild_id: String,
+ },
+ $clientState: {
+ $guildHashes: Object,
+ $highestLastMessageId: String || Number,
+ $readStateVersion: Number,
+ $useruserGuildSettingsVersion: undefined,
+ $userGuildSettingsVersion: undefined,
+ $guildVersions: Object,
+ $apiCodeVersion: Number,
+ $initialGuildId: String,
+ },
+ $v: Number,
+ $version: Number,
+};
+
+export interface IdentifySchema {
+ token: string;
+ properties: {
+ // bruh discord really uses $ in the property key, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key
+ os?: string;
+ os_atch?: string;
+ browser?: string;
+ device?: string;
+ $os?: string;
+ $browser?: string;
+ $device?: string;
+ browser_user_agent?: string;
+ browser_version?: string;
+ os_version?: string;
+ referrer?: string;
+ referring_domain?: string;
+ referrer_current?: string;
+ referring_domain_current?: string;
+ release_channel?: "stable" | "dev" | "ptb" | "canary";
+ client_build_number?: number;
+ client_event_source?: string;
+ client_version?: string;
+ system_locale?: string;
+ };
+ intents?: bigint; // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt
+ presence?: ActivitySchema;
+ compress?: boolean;
+ large_threshold?: number;
+ largeThreshold?: number;
+ /**
+ * @minItems 2
+ * @maxItems 2
+ */
+ shard?: bigint[]; // puyo: changed from [bigint, bigint] because it breaks openapi
+ guild_subscriptions?: boolean;
+ capabilities?: number;
+ client_state?: {
+ guild_hashes?: unknown;
+ highest_last_message_id?: string | number;
+ read_state_version?: number;
+ user_guild_settings_version?: number;
+ user_settings_version?: number;
+ useruser_guild_settings_version?: number;
+ private_channels_version?: number;
+ guild_versions?: unknown;
+ api_code_version?: number;
+ initial_guild_id?: string;
+ };
+ clientState?: {
+ guildHashes?: unknown;
+ highestLastMessageId?: string | number;
+ readStateVersion?: number;
+ userGuildSettingsVersion?: number;
+ useruserGuildSettingsVersion?: number;
+ guildVersions?: unknown;
+ apiCodeVersion?: number;
+ initialGuildId?: string;
+ };
+ v?: number;
+}
diff --git a/src/schemas/InviteCreateSchema.ts b/src/schemas/InviteCreateSchema.ts
new file mode 100644
index 0000000..92333e7
--- /dev/null
+++ b/src/schemas/InviteCreateSchema.ts
@@ -0,0 +1,30 @@
+/*
+ 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 .
+*/
+
+export interface InviteCreateSchema {
+ target_user_id?: string;
+ target_type?: string;
+ validate?: string; // ? what is this
+ max_age?: number;
+ max_uses?: number;
+ temporary?: boolean;
+ unique?: boolean;
+ target_user?: string;
+ target_user_type?: number;
+ flags?: number;
+}
diff --git a/src/schemas/LazyRequestSchema.ts b/src/schemas/LazyRequestSchema.ts
new file mode 100644
index 0000000..ca07d37
--- /dev/null
+++ b/src/schemas/LazyRequestSchema.ts
@@ -0,0 +1,46 @@
+/*
+ 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 .
+*/
+
+export interface LazyRequestSchema {
+ guild_id: string;
+ channels?: {
+ /**
+ * @items.type integer
+ * @minItems 2
+ * @maxItems 2
+ */
+ [key: string]: number[][]; // puyo: changed from [number, number] because it breaks openapi
+ };
+ activities?: boolean;
+ threads?: boolean;
+ typing?: true;
+ members?: string[];
+ member_updates?: boolean;
+ thread_member_lists?: unknown[];
+}
+
+export const LazyRequestSchema = {
+ guild_id: String,
+ $activities: Boolean,
+ $channels: Object,
+ $typing: Boolean,
+ $threads: Boolean,
+ $members: [] as string[],
+ $member_updates: Boolean,
+ $thread_member_lists: [] as unknown[],
+};
diff --git a/src/schemas/LoginResponse.ts b/src/schemas/LoginResponse.ts
new file mode 100644
index 0000000..faf3f76
--- /dev/null
+++ b/src/schemas/LoginResponse.ts
@@ -0,0 +1,14 @@
+import { TokenResponse } from "./responses";
+
+export interface MFAResponse {
+ ticket: string;
+ mfa: true;
+ sms: false; // TODO
+ token: null;
+}
+
+export interface WebAuthnResponse extends MFAResponse {
+ webauthn: string;
+}
+
+export type LoginResponse = TokenResponse | MFAResponse | WebAuthnResponse;
diff --git a/src/schemas/LoginSchema.ts b/src/schemas/LoginSchema.ts
new file mode 100644
index 0000000..55b6a02
--- /dev/null
+++ b/src/schemas/LoginSchema.ts
@@ -0,0 +1,30 @@
+/*
+ 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 .
+*/
+
+export interface LoginSchema {
+ login: string;
+ /**
+ * @minLength 1
+ * @maxLength 72
+ */
+ password: string;
+ undelete?: boolean;
+ captcha_key?: string;
+ login_source?: string;
+ gift_code_sku_id?: string;
+}
diff --git a/src/schemas/MemberChangeProfileSchema.ts b/src/schemas/MemberChangeProfileSchema.ts
new file mode 100644
index 0000000..d2d1481
--- /dev/null
+++ b/src/schemas/MemberChangeProfileSchema.ts
@@ -0,0 +1,28 @@
+/*
+ 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 .
+*/
+
+export interface MemberChangeProfileSchema {
+ banner?: string | null;
+ nick?: string;
+ bio?: string;
+ pronouns?: string;
+ /**
+ * @items.type integer
+ */
+ theme_colors?: [number, number];
+}
diff --git a/src/schemas/MemberChangeSchema.ts b/src/schemas/MemberChangeSchema.ts
new file mode 100644
index 0000000..e1ee096
--- /dev/null
+++ b/src/schemas/MemberChangeSchema.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export interface MemberChangeSchema {
+ roles?: string[];
+ nick?: string;
+ avatar?: string | null;
+ bio?: string;
+}
diff --git a/src/schemas/MemberNickChangeSchema.ts b/src/schemas/MemberNickChangeSchema.ts
new file mode 100644
index 0000000..4589056
--- /dev/null
+++ b/src/schemas/MemberNickChangeSchema.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface MemberNickChangeSchema {
+ nick: string;
+}
diff --git a/src/schemas/MessageAcknowledgeSchema.ts b/src/schemas/MessageAcknowledgeSchema.ts
new file mode 100644
index 0000000..3ba7164
--- /dev/null
+++ b/src/schemas/MessageAcknowledgeSchema.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface MessageAcknowledgeSchema {
+ manual?: boolean;
+ mention_count?: number;
+ flags?: number;
+ last_viewed?: number;
+ token?: string;
+}
diff --git a/src/schemas/MessageCreateSchema.ts b/src/schemas/MessageCreateSchema.ts
new file mode 100644
index 0000000..f5037d6
--- /dev/null
+++ b/src/schemas/MessageCreateSchema.ts
@@ -0,0 +1,80 @@
+/*
+ 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 .
+*/
+
+import { ActionRowComponent, Embed, PollAnswer, PollMedia } from "@spacebar/util";
+
+export type MessageCreateAttachment = {
+ id: string;
+ filename: string;
+};
+
+export type MessageCreateCloudAttachment = {
+ id?: string;
+ filename: string;
+ uploaded_filename: string;
+ original_content_type?: string;
+}
+
+export interface MessageCreateSchema {
+ type?: number;
+ content?: string;
+ mobile_network_type?: string;
+ nonce?: string;
+ channel_id?: string;
+ tts?: boolean;
+ flags?: number;
+ embeds?: Embed[];
+ embed?: Embed;
+ // TODO: ^ embed is deprecated in favor of embeds (https://discord.com/developers/docs/resources/channel#message-object)
+ allowed_mentions?: {
+ parse?: string[];
+ roles?: string[];
+ users?: string[];
+ replied_user?: boolean;
+ };
+ message_reference?: {
+ message_id: string;
+ channel_id?: string;
+ guild_id?: string;
+ fail_if_not_exists?: boolean;
+ };
+ payload_json?: string;
+ file?: { filename: string };
+ /**
+ TODO: we should create an interface for attachments
+ TODO: OpenWAAO<-->attachment-style metadata conversion
+ **/
+ attachments?: (MessageCreateAttachment | MessageCreateCloudAttachment)[];
+ sticker_ids?: string[] | null; // null check: fixes Discord-Go
+ components?: ActionRowComponent[] | null; // null check: fixes Discord-Go
+ // TODO: Fix TypeScript errors in src\api\util\handlers\Message.ts once this is enabled
+ poll?: PollCreationSchema;
+ enforce_nonce?: boolean; // For Discord compatibility, it's the default behavior here
+ applied_tags?: string[]; // Not implemented yet, for webhooks in forums
+ thread_name?: string; // Not implemented yet, for webhooks
+ avatar_url?: string; // Not implemented yet, for webhooks
+}
+
+// TypeScript complains once this is used above
+export interface PollCreationSchema {
+ question: PollMedia;
+ answers: PollAnswer[];
+ duration?: number;
+ allow_multiselect?: boolean;
+ layout_type?: number;
+}
diff --git a/src/schemas/MessageEditSchema.ts b/src/schemas/MessageEditSchema.ts
new file mode 100644
index 0000000..002e5af
--- /dev/null
+++ b/src/schemas/MessageEditSchema.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+import { MessageCreateSchema } from "./MessageCreateSchema";
+
+export type MessageEditSchema = Omit;
diff --git a/src/schemas/MfaCodesSchema.ts b/src/schemas/MfaCodesSchema.ts
new file mode 100644
index 0000000..1f66f08
--- /dev/null
+++ b/src/schemas/MfaCodesSchema.ts
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+
+export interface MfaCodesSchema {
+ /**
+ * @minLength 1
+ * @maxLength 72
+ */
+ password: string;
+ regenerate?: boolean;
+}
diff --git a/src/schemas/ModifyGuildStickerSchema.ts b/src/schemas/ModifyGuildStickerSchema.ts
new file mode 100644
index 0000000..95eb541
--- /dev/null
+++ b/src/schemas/ModifyGuildStickerSchema.ts
@@ -0,0 +1,33 @@
+/*
+ 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 .
+*/
+
+export interface ModifyGuildStickerSchema {
+ /**
+ * @minLength 2
+ * @maxLength 30
+ */
+ name: string;
+ /**
+ * @maxLength 100
+ */
+ description?: string;
+ /**
+ * @maxLength 200
+ */
+ tags: string;
+}
diff --git a/src/schemas/PasswordResetSchema.ts b/src/schemas/PasswordResetSchema.ts
new file mode 100644
index 0000000..15489a9
--- /dev/null
+++ b/src/schemas/PasswordResetSchema.ts
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+
+export interface PasswordResetSchema {
+ /**
+ * @minLength 1
+ * @maxLength 72
+ */
+ password: string;
+ token: string;
+}
diff --git a/src/schemas/PreloadMessagesRequestSchema.ts b/src/schemas/PreloadMessagesRequestSchema.ts
new file mode 100644
index 0000000..7c5145b
--- /dev/null
+++ b/src/schemas/PreloadMessagesRequestSchema.ts
@@ -0,0 +1,21 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+export interface PreloadMessagesRequestSchema {
+ channels: string[];
+}
diff --git a/src/schemas/PruneSchema.ts b/src/schemas/PruneSchema.ts
new file mode 100644
index 0000000..88d2f6e
--- /dev/null
+++ b/src/schemas/PruneSchema.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export interface PruneSchema {
+ /**
+ * @min 0
+ */
+ days: number;
+}
diff --git a/src/schemas/PurgeSchema.ts b/src/schemas/PurgeSchema.ts
new file mode 100644
index 0000000..2e88799
--- /dev/null
+++ b/src/schemas/PurgeSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface PurgeSchema {
+ before: string;
+ after: string;
+}
diff --git a/src/schemas/RefreshUrlsRequestSchema.ts b/src/schemas/RefreshUrlsRequestSchema.ts
new file mode 100644
index 0000000..9c1df54
--- /dev/null
+++ b/src/schemas/RefreshUrlsRequestSchema.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface RefreshUrlsRequestSchema {
+ attachment_urls: string[];
+}
diff --git a/src/schemas/RegisterSchema.ts b/src/schemas/RegisterSchema.ts
new file mode 100644
index 0000000..cfee0f0
--- /dev/null
+++ b/src/schemas/RegisterSchema.ts
@@ -0,0 +1,48 @@
+/*
+ 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 .
+*/
+
+export interface RegisterSchema {
+ /**
+ * @minLength 2
+ */
+ username: string;
+ /**
+ * @minLength 1
+ * @maxLength 72
+ */
+ password?: string;
+ consent: boolean;
+ /**
+ * @TJS-format email
+ */
+ email?: string;
+ fingerprint?: string;
+ invite?: string;
+ /**
+ * @TJS-type string
+ */
+ date_of_birth?: Date; // "2000-04-03"
+ gift_code_sku_id?: string;
+ captcha_key?: string;
+
+ promotional_email_opt_in?: boolean;
+
+ // part of pomelo
+ unique_username_registration?: boolean;
+ global_name?: string;
+}
diff --git a/src/schemas/RelationshipPostSchema.ts b/src/schemas/RelationshipPostSchema.ts
new file mode 100644
index 0000000..066ecfd
--- /dev/null
+++ b/src/schemas/RelationshipPostSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface RelationshipPostSchema {
+ discriminator: string;
+ username: string;
+}
diff --git a/src/schemas/RelationshipPutSchema.ts b/src/schemas/RelationshipPutSchema.ts
new file mode 100644
index 0000000..36d9877
--- /dev/null
+++ b/src/schemas/RelationshipPutSchema.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+import { RelationshipType } from "@spacebar/util";
+
+export interface RelationshipPutSchema {
+ type?: RelationshipType;
+}
diff --git a/src/schemas/RequestGuildMembersSchema.ts b/src/schemas/RequestGuildMembersSchema.ts
new file mode 100644
index 0000000..9e60d26
--- /dev/null
+++ b/src/schemas/RequestGuildMembersSchema.ts
@@ -0,0 +1,35 @@
+/*
+ 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 .
+*/
+
+export interface RequestGuildMembersSchema {
+ guild_id: string | [string];
+ query?: string;
+ limit?: number;
+ presences?: boolean;
+ user_ids?: string | string[];
+ nonce?: string;
+}
+
+export const RequestGuildMembersSchema = {
+ guild_id: "" as string | string[],
+ $query: String,
+ $limit: Number,
+ $presences: Boolean,
+ $user_ids: [] as string | string[],
+ $nonce: String,
+};
diff --git a/src/schemas/RoleModifySchema.ts b/src/schemas/RoleModifySchema.ts
new file mode 100644
index 0000000..a6d1893
--- /dev/null
+++ b/src/schemas/RoleModifySchema.ts
@@ -0,0 +1,33 @@
+/*
+ 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 .
+*/
+
+export interface RoleModifySchema {
+ name?: string;
+ permissions?: string;
+ color?: number;
+ hoist?: boolean; // whether the role should be displayed separately in the sidebar
+ mentionable?: boolean; // whether the role should be mentionable
+ position?: number;
+ icon?: string;
+ unicode_emoji?: string;
+ colors?: {
+ primary_color: number;
+ secondary_color: number | null | undefined; // only used for "holographic" and "gradient" styles
+ tertiary_color?: number | null | undefined; // only used for "holographic" style
+ } | undefined;
+}
diff --git a/src/schemas/RolePositionUpdateSchema.ts b/src/schemas/RolePositionUpdateSchema.ts
new file mode 100644
index 0000000..6bfd7f3
--- /dev/null
+++ b/src/schemas/RolePositionUpdateSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export type RolePositionUpdateSchema = {
+ id: string;
+ position: number;
+}[];
diff --git a/src/schemas/SelectProtocolSchema.ts b/src/schemas/SelectProtocolSchema.ts
new file mode 100644
index 0000000..d04adf7
--- /dev/null
+++ b/src/schemas/SelectProtocolSchema.ts
@@ -0,0 +1,37 @@
+/*
+ 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 .
+*/
+
+export interface SelectProtocolSchema {
+ protocol: "webrtc" | "udp";
+ data:
+ | string
+ | {
+ address: string;
+ port: number;
+ mode: string;
+ };
+ sdp?: string;
+ codecs?: {
+ name: "opus" | "VP8" | "VP9" | "H264";
+ type: "audio" | "video";
+ priority: number;
+ payload_type: number;
+ rtx_payload_type?: number;
+ }[];
+ rtc_connection_id?: string; // uuid
+}
diff --git a/src/schemas/SettingsProtoUpdateSchema.ts b/src/schemas/SettingsProtoUpdateSchema.ts
new file mode 100644
index 0000000..2b930bc
--- /dev/null
+++ b/src/schemas/SettingsProtoUpdateSchema.ts
@@ -0,0 +1,47 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+import { JsonValue } from "@protobuf-ts/runtime";
+
+export interface SettingsProtoUpdateSchema {
+ settings: string;
+ required_data_version?: number;
+}
+
+export interface SettingsProtoUpdateJsonSchema {
+ settings: JsonValue;
+ required_data_version?: number;
+}
+
+// TODO: these dont work with schema validation
+// typed JSON schemas:
+// export interface SettingsProtoUpdatePreloadedUserSettingsSchema {
+// settings: PreloadedUserSettings;
+// required_data_version?: number;
+// }
+//
+// export interface SettingsProtoUpdateFrecencyUserSettingsSchema {
+// settings: FrecencyUserSettings;
+// required_data_version?: number;
+// }
+
+// TODO: what is this?
+// export interface SettingsProtoUpdateTestSettingsSchema {
+// settings: {};
+// required_data_version?: number;
+// }
\ No newline at end of file
diff --git a/src/schemas/StreamCreateSchema.ts b/src/schemas/StreamCreateSchema.ts
new file mode 100644
index 0000000..bb65079
--- /dev/null
+++ b/src/schemas/StreamCreateSchema.ts
@@ -0,0 +1,13 @@
+export interface StreamCreateSchema {
+ type: "guild" | "call";
+ channel_id: string;
+ guild_id?: string;
+ preferred_region?: string;
+}
+
+export const StreamCreateSchema = {
+ type: String,
+ channel_id: String,
+ $guild_id: String,
+ $preferred_region: String,
+};
diff --git a/src/schemas/StreamDeleteSchema.ts b/src/schemas/StreamDeleteSchema.ts
new file mode 100644
index 0000000..0e2aff7
--- /dev/null
+++ b/src/schemas/StreamDeleteSchema.ts
@@ -0,0 +1,7 @@
+export interface StreamDeleteSchema {
+ stream_key: string;
+}
+
+export const StreamDeleteSchema = {
+ stream_key: String,
+};
diff --git a/src/schemas/StreamWatchSchema.ts b/src/schemas/StreamWatchSchema.ts
new file mode 100644
index 0000000..263bb11
--- /dev/null
+++ b/src/schemas/StreamWatchSchema.ts
@@ -0,0 +1,7 @@
+export interface StreamWatchSchema {
+ stream_key: string;
+}
+
+export const StreamWatchSchema = {
+ stream_key: String,
+};
diff --git a/src/schemas/TeamCreateSchema.ts b/src/schemas/TeamCreateSchema.ts
new file mode 100644
index 0000000..5903a53
--- /dev/null
+++ b/src/schemas/TeamCreateSchema.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface TeamCreateSchema {
+ name: string;
+}
diff --git a/src/schemas/TemplateCreateSchema.ts b/src/schemas/TemplateCreateSchema.ts
new file mode 100644
index 0000000..9e562c9
--- /dev/null
+++ b/src/schemas/TemplateCreateSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface TemplateCreateSchema {
+ name: string;
+ description?: string;
+}
diff --git a/src/schemas/TemplateModifySchema.ts b/src/schemas/TemplateModifySchema.ts
new file mode 100644
index 0000000..49b0237
--- /dev/null
+++ b/src/schemas/TemplateModifySchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface TemplateModifySchema {
+ name: string;
+ description?: string;
+}
diff --git a/src/schemas/TotpDisableSchema.ts b/src/schemas/TotpDisableSchema.ts
new file mode 100644
index 0000000..29706f4
--- /dev/null
+++ b/src/schemas/TotpDisableSchema.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface TotpDisableSchema {
+ /**
+ * @minLength 6
+ * @maxLength 6
+ */
+ code: string;
+}
diff --git a/src/schemas/TotpEnableSchema.ts b/src/schemas/TotpEnableSchema.ts
new file mode 100644
index 0000000..a80e06a
--- /dev/null
+++ b/src/schemas/TotpEnableSchema.ts
@@ -0,0 +1,31 @@
+/*
+ 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 .
+*/
+
+export interface TotpEnableSchema {
+ /**
+ * @minLength 1
+ * @maxLength 72
+ */
+ password: string;
+ /**
+ * @minLength 6
+ * @maxLength 6
+ */
+ code?: string;
+ secret?: string;
+}
diff --git a/src/schemas/TotpSchema.ts b/src/schemas/TotpSchema.ts
new file mode 100644
index 0000000..657b7e7
--- /dev/null
+++ b/src/schemas/TotpSchema.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export interface TotpSchema {
+ code: string;
+ ticket: string;
+ gift_code_sku_id?: string | null;
+ login_source?: string | null;
+}
diff --git a/src/schemas/UploadAttachmentRequestSchema.ts b/src/schemas/UploadAttachmentRequestSchema.ts
new file mode 100644
index 0000000..60bf89f
--- /dev/null
+++ b/src/schemas/UploadAttachmentRequestSchema.ts
@@ -0,0 +1,30 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2024 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 .
+*/
+
+
+export interface UploadAttachmentRequestSchema {
+ files: UploadAttachmentRequest[];
+}
+
+export interface UploadAttachmentRequest {
+ id?: string;
+ filename: string;
+ file_size: number;
+ is_clip?: boolean;
+ original_content_type?: string;
+}
diff --git a/src/schemas/UserDeleteSchema.ts b/src/schemas/UserDeleteSchema.ts
new file mode 100644
index 0000000..40fb778
--- /dev/null
+++ b/src/schemas/UserDeleteSchema.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface UserDeleteSchema {
+ user_id: string;
+}
diff --git a/src/schemas/UserGuildSettingsSchema.ts b/src/schemas/UserGuildSettingsSchema.ts
new file mode 100644
index 0000000..82edae9
--- /dev/null
+++ b/src/schemas/UserGuildSettingsSchema.ts
@@ -0,0 +1,27 @@
+/*
+ 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 .
+*/
+
+import { ChannelOverride, UserGuildSettings } from "@spacebar/util";
+
+// This sucks. I would use a DeepPartial, my own or typeorms, but they both generate inncorect schema
+export interface UserGuildSettingsSchema
+ extends Partial> {
+ channel_overrides?: {
+ [channel_id: string]: ChannelOverride;
+ };
+}
diff --git a/src/schemas/UserModifySchema.ts b/src/schemas/UserModifySchema.ts
new file mode 100644
index 0000000..6d2998e
--- /dev/null
+++ b/src/schemas/UserModifySchema.ts
@@ -0,0 +1,52 @@
+/*
+ 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 .
+*/
+
+export interface UserModifySchema {
+ /**
+ * @minLength 2
+ */
+ username?: string;
+ avatar?: string | null;
+ bio?: string;
+ accent_color?: number;
+ banner?: string | null;
+ /**
+ * @minLength 1
+ * @maxLength 72
+ */
+ password?: string;
+ /**
+ * @minLength 1
+ * @maxLength 72
+ */
+ new_password?: string;
+ /**
+ * @minLength 6
+ * @maxLength 6
+ */
+ code?: string;
+ /**
+ * @TJS-format email
+ */
+ email?: string;
+ /**
+ * @minLength 4
+ * @maxLength 4
+ */
+ discriminator?: string;
+}
diff --git a/src/schemas/UserNoteUpdateSchema.ts b/src/schemas/UserNoteUpdateSchema.ts
new file mode 100644
index 0000000..0a73127
--- /dev/null
+++ b/src/schemas/UserNoteUpdateSchema.ts
@@ -0,0 +1,3 @@
+export interface UserNoteUpdateSchema {
+ note: string;
+}
diff --git a/src/schemas/UserProfileModifySchema.ts b/src/schemas/UserProfileModifySchema.ts
new file mode 100644
index 0000000..3dea257
--- /dev/null
+++ b/src/schemas/UserProfileModifySchema.ts
@@ -0,0 +1,28 @@
+/*
+ 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 .
+*/
+
+export interface UserProfileModifySchema {
+ bio?: string;
+ accent_color?: number | null;
+ banner?: string | null;
+ pronouns?: string;
+ /**
+ * @items.type integer
+ */
+ theme_colors?: [number, number];
+}
diff --git a/src/schemas/UserSettingsSchema.ts b/src/schemas/UserSettingsSchema.ts
new file mode 100644
index 0000000..0d23e75
--- /dev/null
+++ b/src/schemas/UserSettingsSchema.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+import { UserSettings } from "@spacebar/util";
+
+export type UserSettingsSchema = Omit, "index">;
diff --git a/src/schemas/Validator.ts b/src/schemas/Validator.ts
new file mode 100644
index 0000000..0460860
--- /dev/null
+++ b/src/schemas/Validator.ts
@@ -0,0 +1,54 @@
+/*
+ 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 .
+*/
+
+import Ajv from "ajv";
+import addFormats from "ajv-formats";
+import fs from "fs";
+import path from "path";
+
+const SchemaPath = path.join(
+ __dirname,
+ "..",
+ "..",
+ "assets",
+ "schemas.json",
+);
+const schemas = JSON.parse(fs.readFileSync(SchemaPath, { encoding: "utf8" }));
+
+export const ajv = new Ajv({
+ allErrors: true,
+ parseDate: true,
+ allowDate: true,
+ schemas,
+ coerceTypes: true,
+ messages: true,
+ strict: true,
+ strictRequired: true,
+ allowUnionTypes: true,
+});
+
+addFormats(ajv);
+
+export function validateSchema(schema: string, data: G): G {
+ const valid = ajv.validate(schema, data);
+ if (!valid) {
+ console.log("[Validator] Validation error in ", schema)
+ throw ajv.errors;
+ }
+ return data;
+}
diff --git a/src/schemas/VanityUrlSchema.ts b/src/schemas/VanityUrlSchema.ts
new file mode 100644
index 0000000..12d5abd
--- /dev/null
+++ b/src/schemas/VanityUrlSchema.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface VanityUrlSchema {
+ /**
+ * @minLength 1
+ * @maxLength 20
+ */
+ code?: string;
+}
diff --git a/src/schemas/VerifyEmailSchema.ts b/src/schemas/VerifyEmailSchema.ts
new file mode 100644
index 0000000..ce297c5
--- /dev/null
+++ b/src/schemas/VerifyEmailSchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface VerifyEmailSchema {
+ captcha_key?: string | null;
+ token: string;
+}
diff --git a/src/schemas/VoiceIdentifySchema.ts b/src/schemas/VoiceIdentifySchema.ts
new file mode 100644
index 0000000..82f846c
--- /dev/null
+++ b/src/schemas/VoiceIdentifySchema.ts
@@ -0,0 +1,31 @@
+/*
+ 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 .
+*/
+
+export interface VoiceIdentifySchema {
+ server_id: string;
+ user_id: string;
+ session_id: string;
+ token: string;
+ video?: boolean;
+ streams?: {
+ type: "video" | "audio" | "screen";
+ rid: string;
+ quality: number;
+ }[];
+ max_secure_frames_version?: number;
+}
diff --git a/src/schemas/VoiceStateUpdateSchema.ts b/src/schemas/VoiceStateUpdateSchema.ts
new file mode 100644
index 0000000..fda073e
--- /dev/null
+++ b/src/schemas/VoiceStateUpdateSchema.ts
@@ -0,0 +1,42 @@
+/*
+ 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 .
+*/
+
+//TODO need more testing when community guild and voice stage channel are working
+export interface VoiceStateUpdateSchema {
+ guild_id?: string;
+ channel_id?: string;
+ self_mute: boolean;
+ self_deaf: boolean;
+ self_video?: boolean;
+ preferred_region?: string;
+ request_to_speak_timestamp?: Date;
+ suppress?: boolean;
+ flags?: number;
+}
+
+export const VoiceStateUpdateSchema = {
+ $guild_id: String,
+ $channel_id: String,
+ self_mute: Boolean,
+ self_deaf: Boolean,
+ $self_video: Boolean, //required in docs but bots don't always send it
+ $preferred_region: String,
+ $request_to_speak_timestamp: Date,
+ $suppress: Boolean,
+ $flags: Number,
+};
diff --git a/src/schemas/VoiceVideoSchema.ts b/src/schemas/VoiceVideoSchema.ts
new file mode 100644
index 0000000..c621431
--- /dev/null
+++ b/src/schemas/VoiceVideoSchema.ts
@@ -0,0 +1,35 @@
+/*
+ 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 .
+*/
+
+export interface VoiceVideoSchema {
+ audio_ssrc: number;
+ video_ssrc: number;
+ rtx_ssrc?: number;
+ user_id?: string;
+ streams?: {
+ type: "video" | "audio" | "screen";
+ rid: string;
+ ssrc: number;
+ active: boolean;
+ quality: number;
+ rtx_ssrc: number;
+ max_bitrate: number;
+ max_framerate: number;
+ max_resolution: { type: string; width: number; height: number };
+ }[];
+}
diff --git a/src/schemas/WebAuthnSchema.ts b/src/schemas/WebAuthnSchema.ts
new file mode 100644
index 0000000..3f5e0da
--- /dev/null
+++ b/src/schemas/WebAuthnSchema.ts
@@ -0,0 +1,38 @@
+/*
+ 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 .
+*/
+
+// FIXME: better naming
+export interface GenerateWebAuthnCredentialsSchema {
+ password: string;
+}
+
+// FIXME: better naming
+export interface CreateWebAuthnCredentialSchema {
+ credential: string;
+ name: string;
+ ticket: string;
+}
+
+export type WebAuthnPostSchema =
+ | GenerateWebAuthnCredentialsSchema
+ | CreateWebAuthnCredentialSchema;
+
+export interface WebAuthnTotpSchema {
+ code: string;
+ ticket: string;
+}
diff --git a/src/schemas/WebhookCreateSchema.ts b/src/schemas/WebhookCreateSchema.ts
new file mode 100644
index 0000000..7bd0afa
--- /dev/null
+++ b/src/schemas/WebhookCreateSchema.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface WebhookCreateSchema {
+ /**
+ * @maxLength 80
+ */
+ name: string;
+ avatar?: string;
+}
diff --git a/src/schemas/WebhookExecuteSchema.ts b/src/schemas/WebhookExecuteSchema.ts
new file mode 100644
index 0000000..b50a4cf
--- /dev/null
+++ b/src/schemas/WebhookExecuteSchema.ts
@@ -0,0 +1,59 @@
+/*
+ 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 .
+*/
+
+import { Embed } from "../util/entities";
+import {
+ MessageCreateAttachment,
+ PollCreationSchema,
+} from "./MessageCreateSchema";
+
+export interface WebhookExecuteSchema {
+ content?: string;
+ username?: string;
+ avatar_url?: string;
+ tts?: boolean;
+ embeds?: Embed[];
+ allowed_mentions?: {
+ parse?: string[];
+ roles?: string[];
+ users?: string[];
+ replied_user?: boolean;
+ };
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ components?: any[];
+ file?: { filename: string };
+ payload_json?: string;
+ /**
+ TODO: we should create an interface for attachments
+ TODO: OpenWAAO<-->attachment-style metadata conversion
+ **/
+ attachments?: MessageCreateAttachment[];
+ flags?: number;
+ thread_name?: string;
+ applied_tags?: string[];
+ message_reference?: {
+ message_id: string;
+ channel_id?: string;
+ guild_id?: string;
+ fail_if_not_exists?: boolean;
+ };
+ sticker_ids?: string[];
+ nonce?: string;
+ enforce_nonce?: boolean; // For Discord compatibility, it's the default behavior here
+ poll?: PollCreationSchema;
+}
diff --git a/src/schemas/WebhookUpdateSchema.ts b/src/schemas/WebhookUpdateSchema.ts
new file mode 100755
index 0000000..bc276e4
--- /dev/null
+++ b/src/schemas/WebhookUpdateSchema.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+export interface WebhookUpdateSchema {
+ name?: string;
+ avatar?: string;
+ channel_id?: string;
+}
diff --git a/src/schemas/WidgetModifySchema.ts b/src/schemas/WidgetModifySchema.ts
new file mode 100644
index 0000000..50794d6
--- /dev/null
+++ b/src/schemas/WidgetModifySchema.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface WidgetModifySchema {
+ enabled: boolean; // whether the widget is enabled
+ channel_id: string; // the widget channel id
+}
diff --git a/src/schemas/index.ts b/src/schemas/index.ts
new file mode 100644
index 0000000..3971042
--- /dev/null
+++ b/src/schemas/index.ts
@@ -0,0 +1,100 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+export * from "./AckBulkSchema";
+export * from "./ActivitySchema";
+export * from "./ApplicationAuthorizeSchema";
+export * from "./ApplicationCreateSchema";
+export * from "./ApplicationModifySchema";
+export * from "./AutomodRuleSchema";
+export * from "./BackupCodesChallengeSchema";
+export * from "./BanCreateSchema";
+export * from "./BanModeratorSchema";
+export * from "./BanRegistrySchema";
+export * from "./BotModifySchema";
+export * from "./ChannelModifySchema";
+export * from "./ChannelPermissionOverwriteSchema";
+export * from "./ChannelReorderSchema";
+export * from "./CodesVerificationSchema";
+export * from "./ConnectedAccountSchema";
+export * from "./ConnectionCallbackSchema";
+export * from "./ConnectionUpdateSchema";
+export * from "./DmChannelCreateSchema";
+export * from "./EmailDomainLookupSchema";
+export * from "./EmailDomainLookupVerifyCodeSchema";
+export * from "./EmojiCreateSchema";
+export * from "./EmojiModifySchema";
+export * from "./ForgotPasswordSchema";
+export * from "./GatewayPayloadSchema";
+export * from "./GreetRequestSchema";
+export * from "./GuildCreateSchema";
+export * from "./GuildSubscriptionsBulkSchema";
+export * from "./GuildTemplateCreateSchema";
+export * from "./GuildUpdateSchema";
+export * from "./GuildUpdateWelcomeScreenSchema";
+export * from "./HubWaitlistSignupSchema";
+export * from "./IdentifySchema";
+export * from "./InviteCreateSchema";
+export * from "./LazyRequestSchema";
+export * from "./LoginSchema";
+export * from "./MemberChangeProfileSchema";
+export * from "./MemberChangeSchema";
+export * from "./MessageAcknowledgeSchema";
+export * from "./MessageCreateSchema";
+export * from "./MessageEditSchema";
+export * from "./MfaCodesSchema";
+export * from "./ModifyGuildStickerSchema";
+export * from "./PreloadMessagesRequestSchema";
+export * from "./PasswordResetSchema";
+export * from "./PurgeSchema";
+export * from "./RefreshUrlsRequestSchema";
+export * from "./RegisterSchema";
+export * from "./RelationshipPostSchema";
+export * from "./RelationshipPutSchema";
+export * from "./RequestGuildMembersSchema";
+export * from "./responses";
+export * from "./RoleModifySchema";
+export * from "./RolePositionUpdateSchema";
+export * from "./SelectProtocolSchema";
+export * from "./SettingsProtoUpdateSchema";
+export * from "./StreamCreateSchema";
+export * from "./StreamDeleteSchema";
+export * from "./StreamWatchSchema";
+export * from "./TeamCreateSchema";
+export * from "./TemplateCreateSchema";
+export * from "./TemplateModifySchema";
+export * from "./TotpDisableSchema";
+export * from "./TotpEnableSchema";
+export * from "./TotpSchema";
+export * from "./UploadAttachmentRequestSchema";
+export * from "./UserDeleteSchema";
+export * from "./UserGuildSettingsSchema";
+export * from "./UserModifySchema";
+export * from "./UserNoteUpdateSchema";
+export * from "./UserProfileModifySchema";
+export * from "./UserSettingsSchema";
+export * from "./Validator";
+export * from "./VanityUrlSchema";
+export * from "./VoiceIdentifySchema";
+export * from "./VoiceStateUpdateSchema";
+export * from "./VoiceVideoSchema";
+export * from "./WebAuthnSchema";
+export * from "./WebhookCreateSchema";
+export * from "./WebhookExecuteSchema";
+export * from "./WebhookUpdateSchema";
+export * from "./WidgetModifySchema";
diff --git a/src/schemas/responses/APIErrorOrCaptchaResponse.ts b/src/schemas/responses/APIErrorOrCaptchaResponse.ts
new file mode 100644
index 0000000..fd89a47
--- /dev/null
+++ b/src/schemas/responses/APIErrorOrCaptchaResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+import { APIErrorResponse } from "./APIErrorResponse";
+import { CaptchaRequiredResponse } from "./CaptchaRequiredResponse";
+
+export type APIErrorOrCaptchaResponse =
+ | CaptchaRequiredResponse
+ | APIErrorResponse;
diff --git a/src/schemas/responses/APIErrorResponse.ts b/src/schemas/responses/APIErrorResponse.ts
new file mode 100644
index 0000000..547ee58
--- /dev/null
+++ b/src/schemas/responses/APIErrorResponse.ts
@@ -0,0 +1,30 @@
+/*
+ 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 .
+*/
+
+export interface APIErrorResponse {
+ code: number;
+ message: string;
+ errors: {
+ [key: string]: {
+ _errors: {
+ message: string;
+ code: string;
+ }[];
+ };
+ };
+}
diff --git a/src/schemas/responses/AccountStandingResponse.ts b/src/schemas/responses/AccountStandingResponse.ts
new file mode 100644
index 0000000..b2992c7
--- /dev/null
+++ b/src/schemas/responses/AccountStandingResponse.ts
@@ -0,0 +1,159 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+import { Attachment } from "../../util/entities";
+
+export enum AccountStandingState {
+ ALL_GOOD = 100,
+ LIMITED = 200,
+ VERY_LIMITED = 300,
+ AT_RISK = 400,
+ SUSPENDED = 500,
+}
+
+export enum AppealEligibility {
+ DSA_ELIGIBLE = 1,
+ IN_APP_ELIGIBLE = 2,
+ AGE_VERIFY_ELIGIBLE = 3,
+}
+
+export enum ClassificationType {
+ UNKNOWN = 1,
+ UNSOLICITED_PORNOGRAPHY = 100,
+ NONCONSENSUAL_PORNOGRAPHY = 200,
+ GLORIFYING_VIOLENCE = 210,
+ HATE_SPEECH = 220,
+ CRACKED_ACCOUNTS = 230,
+ ILLICIT_GOODS = 240,
+ SOCIAL_ENGINEERING = 250,
+ CHILD_SAFETY = 280,
+ HARRASMENT_AND_BULLYING = 290,
+ HARRASMENT_AND_BULLYING_2 = 310,
+ HATEFUL_CONDUCT = 320,
+ HARRASMENT_AND_BULLYING_3 = 390,
+ CHILD_SAFETY_2 = 600,
+ CHILD_SAFETY_3 = 650,
+ IMPERSONATION = 711,
+ BAN_EVASION = 720,
+ MALICIOUS_CONDUCT = 3010,
+ SPAM = 3030,
+ NONCONSENSUAL_ADULT_CONTENT = 4000,
+ FRAUD = 4010,
+ DOXXING_GUILD_OWNER = 4130,
+ COPYRIGHT_INFRINGEMENT_GUILD_OWNER = 4140,
+ CHILD_SAFETY_4 = 5010,
+ CHILD_SELF_ENDANGERMENT = 5090,
+ DOXXING_GUILD_MEMBER = 5305,
+ UNDERAGE = 5411,
+ COPYRIGHT_INFRINGEMENT_GUILD_MEMBER = 5440,
+ COPYRIGHT_INFRINGEMENT_3 = 5485,
+}
+
+export enum AppealIngestionType {
+ WEBFORM = 0,
+ AGE_VERIFY = 1,
+ IN_APP = 2,
+}
+
+export enum ClassificationActionType {
+ BAN = 0,
+ TEMP_BAN = 1,
+ GLOBAL_QUARANTINE = 2,
+ REQUIRE_VERIFICATION = 3,
+ USER_WARNING = 4,
+ USER_SPAMMER = 5,
+ CHANNEL_SPAM = 6,
+ MESSAGE_SPAM = 7,
+ DISABLE_SUSPICIOUS_ACTIVITY = 8,
+ LIMITED_ACCESS = 9,
+ CHANNEL_SCHEDULE_DELETE = 10,
+ MESSAGE_CONTENT_REMOVAL = 11,
+ GUILD_DISABLE_INVITE = 12,
+ USER_CONTENT_REMOVAL = 13,
+ USER_USERNAME_MANGLED = 14,
+ GUILD_LIMITED_ACCESS = 15,
+ USER_MESSAGE_REMOVAL = 16,
+ GUILD_DELETE = 20,
+ USER_PROFILE_MANGLED = 22,
+}
+
+export interface ClassificationAction {
+ id: string;
+ action_type: ClassificationActionType;
+ descriptions: string[];
+}
+
+export enum AppealStatusValue {
+ REVIEW_PENDING = 1,
+ CLASSIFICATION_UPHELD = 2,
+ CLASSIFICATION_INVALIDATED = 3,
+}
+
+export interface AppealStatus {
+ status: AppealStatusValue;
+}
+
+// why is this just a reduced message?
+export interface FlaggedContent {
+ type: "message";
+ id: string;
+ content: string;
+ attachments: Attachment[];
+}
+
+export interface Classification {
+ id: string;
+ classification_type: ClassificationType;
+ description: string;
+ explainer_link: string;
+ actions: ClassificationAction[];
+ max_expiration_time: string; // ISO 8601 timestamp
+ flagged_content: unknown[]; // TODO
+ appeal_status: AppealStatus;
+ is_coppa: boolean;
+ is_spam: boolean;
+ appeal_ingestion_type: AppealIngestionType;
+}
+
+export enum GuildMemberType {
+ OWNER = 1,
+ MEMBER = 2
+}
+
+export interface GuildMetadata {
+ name: string;
+ icon?: string;
+ member_type: GuildMemberType;
+}
+
+export interface GuildClassification extends Classification {
+ guild_metadata: GuildMetadata;
+}
+
+export interface AccountStandingResponse {
+ classifications: Classification[];
+ guild_classifications: GuildClassification[];
+ account_standing: {
+ state: AccountStandingState;
+ };
+ is_dsa_eligible: boolean;
+ username: string;
+ discriminator: string; // Not sure if this is even valid, we don't have any examples of pre-pomelo users
+ is_appeal_eligible: boolean;
+ appeal_eligibility: AppealEligibility[];
+}
diff --git a/src/schemas/responses/BackupCodesChallengeResponse.ts b/src/schemas/responses/BackupCodesChallengeResponse.ts
new file mode 100644
index 0000000..b587845
--- /dev/null
+++ b/src/schemas/responses/BackupCodesChallengeResponse.ts
@@ -0,0 +1,22 @@
+/*
+ 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 .
+*/
+
+export interface BackupCodesChallengeResponse {
+ nonce: string;
+ regenerate_nonce: string;
+}
diff --git a/src/schemas/responses/CaptchaRequiredResponse.ts b/src/schemas/responses/CaptchaRequiredResponse.ts
new file mode 100644
index 0000000..a58e605
--- /dev/null
+++ b/src/schemas/responses/CaptchaRequiredResponse.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+export interface CaptchaRequiredResponse {
+ captcha_key: string;
+ captcha_sitekey: string;
+ captcha_service: string;
+}
diff --git a/src/schemas/responses/CollectiblesCategoriesResponse.ts b/src/schemas/responses/CollectiblesCategoriesResponse.ts
new file mode 100644
index 0000000..8a26d89
--- /dev/null
+++ b/src/schemas/responses/CollectiblesCategoriesResponse.ts
@@ -0,0 +1,120 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+import { StringStringDictionary } from "../../util/util";
+
+// TODO: Clean up
+export type CollectiblesCategoriesResponse = CollectiblesCategoryItem[];
+
+export interface CollectiblesCategoryStyle {
+ background_colors: number[];
+ button_colors: number[];
+ confetti_colors: number[];
+}
+
+export interface CollectiblesCategoryItem {
+ sku_id: string;
+ name: string;
+ summary: string;
+ store_listing_id: string;
+ banner: string;
+ unpublished_at: string | null;
+ styles: CollectiblesCategoryStyle;
+ logo: string;
+ hero_ranking: string[] | null;
+ mobile_bg: string | null;
+ pdp_bg: string | null;
+ success_modal_bg: string | null;
+ mobile_banner: string | null;
+ featured_block: string | null;
+ hero_banner: string | null;
+ wide_banner: string | null;
+ hero_logo: string | null;
+ products: CollectiblesCategoryProductItem[];
+ banner_asset?: StaticAnimatedAsset;
+ hero_banner_asset?: StaticAnimatedAsset;
+}
+
+export interface StaticAnimatedAsset {
+ // CDN URLs
+ animated: string | null;
+ static: string;
+}
+
+export interface CollectiblesCategoryProductItem {
+ sku_id: string;
+ name: string;
+ summary: string;
+ store_listing_id: string;
+ banner: string;
+ unpublished_at: string | null;
+ styles: CollectiblesCategoryStyle;
+ prices: PriceMap;
+ items: ProductItem[];
+ type: number;
+ premium_type: number;
+ category_sku_id: string;
+ google_sku_ids: StringStringDictionary;
+ variants?: ProductItemVariant[];
+}
+
+export interface ProductItemVariant {
+ sku_id: string;
+ name: string;
+ name_localizations: null;
+ summary: string;
+ summary_localizations: null;
+ store_listing_id: string;
+ banner?: string;
+ unpublished_at?: string | null;
+ styles?: CollectiblesCategoryStyle;
+ prices: PriceMap;
+ items: ProductItem[];
+ type: number;
+ premium_type: number;
+ category_sku_id: string;
+ google_sku_ids?: StringStringDictionary;
+ base_variant_sku_id: string;
+ base_variant_name: string;
+ variant_label: string;
+ variant_value: string; // hex string
+}
+
+export interface ProductItem {
+ type: number;
+ id: string;
+ sku_id: string;
+ asset?: string;
+ label?: string;
+ palette?: string;
+}
+
+export type PriceMap = {
+ [key: string]: { country_prices: CountryPrice };
+};
+
+export interface CountryPrice {
+ country_code: string;
+ prices: PriceEntry[];
+}
+
+export interface PriceEntry {
+ amount: number;
+ currency: string;
+ exponent: number;
+}
diff --git a/src/schemas/responses/CollectiblesMarketingResponse.ts b/src/schemas/responses/CollectiblesMarketingResponse.ts
new file mode 100644
index 0000000..5fda976
--- /dev/null
+++ b/src/schemas/responses/CollectiblesMarketingResponse.ts
@@ -0,0 +1,60 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+export class CollectiblesMarketingResponse {
+ marketings: {
+ [key: string]: CollectiblesMarketingItem;
+ };
+}
+
+export class CollectiblesMarketingItem {
+ type: number;
+ version: number;
+ title: string;
+ body: string;
+}
+
+export class AvatarDecorationMarketingItem extends CollectiblesMarketingItem {
+ declare type: 0;
+ // CDN URL to the avatar decoration
+ avatar: string;
+ // Asset IDs
+ decorations: string[];
+ dismissible_content: number; // Is this a generic property?
+ ref_target_background: RefTargetBackground;
+}
+
+export class NameplateMarketingItem extends CollectiblesMarketingItem {
+ declare type: 2;
+ asset: string;
+ popout_asset: string;
+}
+
+export class TargetBackgroundReference {
+ light: string | null;
+ dark: string | null;
+}
+export class TargetBackgroundReferenceInteraction {
+ resting: TargetBackgroundReference;
+ hovered: TargetBackgroundReference;
+}
+
+export class RefTargetBackground {
+ style: TargetBackgroundReferenceInteraction;
+ asset: TargetBackgroundReferenceInteraction;
+}
diff --git a/src/schemas/responses/CollectiblesShopResponse.ts b/src/schemas/responses/CollectiblesShopResponse.ts
new file mode 100644
index 0000000..f168776
--- /dev/null
+++ b/src/schemas/responses/CollectiblesShopResponse.ts
@@ -0,0 +1,66 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+import { CollectiblesCategoryItem, StaticAnimatedAsset } from "./CollectiblesCategoriesResponse";
+
+export interface CollectiblesShopResponse {
+ shop_blocks: AnyShopBlock[];
+ categories: CollectiblesCategoryItem[];
+}
+
+export type AnyShopBlock = ItemRowShopBlock | BundleTileRowShopBlock | ItemCollectionShopBlock;
+
+export interface BaseShopBlock {
+ type: number;
+}
+
+export interface ItemRowShopBlock extends BaseShopBlock {
+ type: 0;
+ category_sku_id: string;
+ name: string;
+ category_store_listing_id: string;
+ banner_asset: StaticAnimatedAsset;
+ logo_url: string;
+ unpublished_at: string | null;
+ summary: string;
+ ranked_sku_ids: string[];
+}
+
+export interface BundleTileRowShopBlock extends BaseShopBlock {
+ type: 1;
+ subblocks: ShopBlockSubBlock[];
+}
+
+export interface ShopBlockSubBlock {
+ type: number;
+ category_store_listing_id: string;
+ name: string;
+ unpublished_at: string | null;
+ banner_url: string;
+ body_text: string | null;
+ banner_text_color: number | null;
+}
+
+export interface ItemCollectionShopBlock extends BaseShopBlock {
+ type: 2;
+ ranked_sku_ids: string[];
+ sorted_sku_ids: {
+ recommended: string[] | null;
+ popular: string[];
+ };
+}
diff --git a/src/schemas/responses/DiscoverableGuildsResponse.ts b/src/schemas/responses/DiscoverableGuildsResponse.ts
new file mode 100644
index 0000000..9785c04
--- /dev/null
+++ b/src/schemas/responses/DiscoverableGuildsResponse.ts
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+
+import { Guild } from "../../util/entities";
+
+export interface DiscoverableGuildsResponse {
+ total: number;
+ guilds: Guild[];
+ offset: number;
+ limit: number;
+}
diff --git a/src/schemas/responses/DmMessagesResponseSchema.ts b/src/schemas/responses/DmMessagesResponseSchema.ts
new file mode 100644
index 0000000..8bce6e6
--- /dev/null
+++ b/src/schemas/responses/DmMessagesResponseSchema.ts
@@ -0,0 +1,21 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+import { PartialMessage } from "@spacebar/util";
+
+export type DmMessagesResponseSchema = PartialMessage[];
diff --git a/src/schemas/responses/EmailDomainLookupResponse.ts b/src/schemas/responses/EmailDomainLookupResponse.ts
new file mode 100644
index 0000000..dc7faa6
--- /dev/null
+++ b/src/schemas/responses/EmailDomainLookupResponse.ts
@@ -0,0 +1,27 @@
+/*
+ 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 .
+*/
+export interface HubGuild {
+ icon: string;
+ id: string;
+ name: string;
+}
+
+export interface EmailDomainLookupResponse {
+ guilds_info: HubGuild[];
+ has_matching_guild: boolean;
+}
diff --git a/src/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts b/src/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts
new file mode 100644
index 0000000..3e29c70
--- /dev/null
+++ b/src/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+import { Guild } from "../../util/entities";
+
+export interface EmailDomainLookupVerifyCodeResponse {
+ guild: Guild;
+ joined: boolean;
+}
diff --git a/src/schemas/responses/EmojiSourceResponse.ts b/src/schemas/responses/EmojiSourceResponse.ts
new file mode 100644
index 0000000..6eeebb3
--- /dev/null
+++ b/src/schemas/responses/EmojiSourceResponse.ts
@@ -0,0 +1,44 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+import { Emoji } from "@spacebar/util";
+
+export interface EmojiSourceResponse {
+ type: "GUILD" | "APPLICATION";
+ guild?: EmojiGuild | null;
+ application?: EmojiApplication | null;
+}
+
+// keep in sync with
+export interface EmojiGuild {
+ id: string;
+ name: string;
+ icon?: string | null;
+ description?: string | null;
+ features: string[];
+ emojis: Emoji[];
+ premium_tier: number;
+ premium_subscription_count?: number;
+ approximate_member_count?: number;
+ approximate_presence_count?: number;
+}
+
+export interface EmojiApplication {
+ id: string;
+ name: string;
+}
diff --git a/src/schemas/responses/GatewayBotResponse.ts b/src/schemas/responses/GatewayBotResponse.ts
new file mode 100644
index 0000000..c68ec09
--- /dev/null
+++ b/src/schemas/responses/GatewayBotResponse.ts
@@ -0,0 +1,28 @@
+/*
+ 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 .
+*/
+
+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
new file mode 100644
index 0000000..5b771ed
--- /dev/null
+++ b/src/schemas/responses/GatewayResponse.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface GatewayResponse {
+ url: string;
+}
diff --git a/src/schemas/responses/GenerateRegistrationTokensResponse.ts b/src/schemas/responses/GenerateRegistrationTokensResponse.ts
new file mode 100644
index 0000000..4931eb5
--- /dev/null
+++ b/src/schemas/responses/GenerateRegistrationTokensResponse.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface GenerateRegistrationTokensResponse {
+ tokens: string[];
+}
diff --git a/src/schemas/responses/GuildBansResponse.ts b/src/schemas/responses/GuildBansResponse.ts
new file mode 100644
index 0000000..91011d5
--- /dev/null
+++ b/src/schemas/responses/GuildBansResponse.ts
@@ -0,0 +1,28 @@
+/*
+ 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 .
+*/
+
+export interface GuildBansResponse {
+ reason: string | null;
+ user: {
+ username: string;
+ discriminator: string;
+ id: string;
+ avatar: string | null;
+ public_flags: number;
+ };
+}
diff --git a/src/schemas/responses/GuildCreateResponse.ts b/src/schemas/responses/GuildCreateResponse.ts
new file mode 100644
index 0000000..50f5f2f
--- /dev/null
+++ b/src/schemas/responses/GuildCreateResponse.ts
@@ -0,0 +1,42 @@
+/*
+ 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 .
+*/
+
+import { GuildUpdateSchema, GuildWelcomeScreen } from "@spacebar/util";
+
+export interface GuildCreateResponse extends Omit {
+ id: string;
+ name: string;
+ primary_category_id: string | undefined;
+ large: boolean | undefined;
+ max_members: number | undefined;
+ max_presences: number | undefined;
+ max_video_channel_users: number | undefined;
+ member_count: number | undefined;
+ presence_count: number | undefined;
+ template_id: string | undefined;
+ mfa_level: number | undefined;
+ owner_id: string | undefined;
+ premium_subscription_count: number | undefined;
+ premium_tier: number | undefined;
+ welcome_screen: GuildWelcomeScreen;
+ widget_channel_id: string | undefined;
+ widget_enabled: boolean;
+ nsfw_level: number | undefined;
+ nsfw: boolean;
+ parent: string | undefined;
+}
diff --git a/src/schemas/responses/GuildDiscoveryRequirements.ts b/src/schemas/responses/GuildDiscoveryRequirements.ts
new file mode 100644
index 0000000..1c1ea0a
--- /dev/null
+++ b/src/schemas/responses/GuildDiscoveryRequirements.ts
@@ -0,0 +1,41 @@
+/*
+ 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 .
+*/
+
+export interface GuildDiscoveryRequirementsResponse {
+ uild_id: string;
+ safe_environment: boolean;
+ healthy: boolean;
+ health_score_pending: boolean;
+ size: boolean;
+ nsfw_properties: unknown;
+ protected: boolean;
+ sufficient: boolean;
+ sufficient_without_grace_period: boolean;
+ valid_rules_channel: boolean;
+ retention_healthy: boolean;
+ engagement_healthy: boolean;
+ age: boolean;
+ minimum_age: number;
+ health_score: {
+ avg_nonnew_participators: number;
+ avg_nonnew_communicators: number;
+ num_intentful_joiners: number;
+ perc_ret_w1_intentful: number;
+ };
+ minimum_size: number;
+}
diff --git a/src/schemas/responses/GuildMessagesSearchResponse.ts b/src/schemas/responses/GuildMessagesSearchResponse.ts
new file mode 100644
index 0000000..376b684
--- /dev/null
+++ b/src/schemas/responses/GuildMessagesSearchResponse.ts
@@ -0,0 +1,53 @@
+/*
+ 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 .
+*/
+
+import {
+ ActionRowComponent,
+ Attachment,
+ Embed,
+ MessageType,
+ Poll,
+ PublicUser,
+ Role,
+} from "../../util/entities";
+
+export interface GuildMessagesSearchMessage {
+ id: string;
+ type: MessageType;
+ content?: string;
+ channel_id: string;
+ author: PublicUser;
+ attachments: Attachment[];
+ embeds: Embed[];
+ mentions: PublicUser[];
+ mention_roles: Role[];
+ pinned: boolean;
+ mention_everyone?: boolean;
+ tts: boolean;
+ timestamp: string;
+ edited_timestamp: string | null;
+ flags: number;
+ components: ActionRowComponent[];
+ poll: Poll;
+ hit: true;
+}
+
+export interface GuildMessagesSearchResponse {
+ messages: GuildMessagesSearchMessage[];
+ total_results: number;
+}
diff --git a/src/schemas/responses/GuildProfileResponse.ts b/src/schemas/responses/GuildProfileResponse.ts
new file mode 100644
index 0000000..58e4b48
--- /dev/null
+++ b/src/schemas/responses/GuildProfileResponse.ts
@@ -0,0 +1,96 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+export interface GuildProfileResponse {
+ id: string;
+ name: string;
+ icon_hash: string | null;
+ member_count: number;
+ online_count: number;
+ description: string;
+ brand_color_primary: string;
+ banner_hash: string | null;
+ game_application_ids: string[];
+ game_activity: {[id: string]: GameActivity};
+ tag: string | null;
+ badge: GuildBadgeType;
+ badge_color_primary: string;
+ badge_color_secondary: string;
+ badge_hash: string;
+ traits: GuildTrait[];
+ features: string[];
+ visibility: GuildVisibilityLevel;
+ custom_banner_hash: string | null;
+ premium_subscription_count: number;
+ premium_tier: number;
+}
+
+export interface GameActivity {
+ activity_level: number;
+ activity_score: number;
+}
+
+export interface GuildTrait {
+ emoji_id: string | null;
+ emoji_name: string | null;
+ emoji_animated: boolean;
+ label: string;
+ position: number;
+}
+
+// TODO: move
+export enum GuildVisibilityLevel {
+ PUBLIC = 1,
+ RESTRICTED = 2,
+ PUBLIC_WITH_RECRUITMENT = 3
+}
+
+export enum GuildBadgeType {
+ SWORD = 0,
+ WATER_DROP = 1,
+ SKULL = 2,
+ TOADSTOOL = 3,
+ MOON = 4,
+ LIGHTNING = 5,
+ LEAF = 6,
+ HEART = 7,
+ FIRE = 8,
+ COMPASS = 9,
+ CROSSHAIRS = 10,
+ FLOWER = 11,
+ FORCE = 12,
+ GEM = 13,
+ LAVA = 14,
+ PSYCHIC = 15,
+ SMOKE = 16,
+ SNOW = 17,
+ SOUND = 18,
+ SUN = 19,
+ WIND = 20,
+ BUNNY = 21,
+ DOG = 22,
+ FROG = 23,
+ GOAT = 24,
+ CAT = 25,
+ DIAMOND = 26,
+ CROWN = 27,
+ TROPHY = 28,
+ MONEY_BAG = 29,
+ DOLLAR_SIGN = 30,
+}
+
diff --git a/src/schemas/responses/GuildPruneResponse.ts b/src/schemas/responses/GuildPruneResponse.ts
new file mode 100644
index 0000000..2a24ef6
--- /dev/null
+++ b/src/schemas/responses/GuildPruneResponse.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface GuildPruneResponse {
+ pruned: number;
+}
+
+export interface GuildPurgeResponse {
+ purged: number;
+}
diff --git a/src/schemas/responses/GuildRecommendationsResponse.ts b/src/schemas/responses/GuildRecommendationsResponse.ts
new file mode 100644
index 0000000..2f7bb77
--- /dev/null
+++ b/src/schemas/responses/GuildRecommendationsResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+import { Guild } from "../../util/entities";
+
+export interface GuildRecommendationsResponse {
+ recommended_guilds: Guild[];
+ load_id: string;
+}
diff --git a/src/schemas/responses/GuildVanityUrl.ts b/src/schemas/responses/GuildVanityUrl.ts
new file mode 100644
index 0000000..c6595a6
--- /dev/null
+++ b/src/schemas/responses/GuildVanityUrl.ts
@@ -0,0 +1,35 @@
+/*
+ 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 .
+*/
+
+export interface GuildVanityUrl {
+ code: string;
+ uses: number;
+}
+
+export interface GuildVanityUrlNoInvite {
+ code: null;
+}
+
+export type GuildVanityUrlResponse =
+ | GuildVanityUrl
+ | GuildVanityUrl[]
+ | GuildVanityUrlNoInvite;
+
+export interface GuildVanityUrlCreateResponse {
+ code: string;
+}
diff --git a/src/schemas/responses/GuildVoiceRegionsResponse.ts b/src/schemas/responses/GuildVoiceRegionsResponse.ts
new file mode 100644
index 0000000..63a77f8
--- /dev/null
+++ b/src/schemas/responses/GuildVoiceRegionsResponse.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+
+export interface GuildVoiceRegion {
+ id: string;
+ name: string;
+ custom: boolean;
+ deprecated: boolean;
+ optimal: boolean;
+}
diff --git a/src/schemas/responses/GuildWidgetJsonResponse.ts b/src/schemas/responses/GuildWidgetJsonResponse.ts
new file mode 100644
index 0000000..bd69230
--- /dev/null
+++ b/src/schemas/responses/GuildWidgetJsonResponse.ts
@@ -0,0 +1,39 @@
+/*
+ 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 .
+*/
+
+import { ClientStatus } from "@spacebar/util";
+
+export interface GuildWidgetJsonResponse {
+ id: string;
+ name: string;
+ instant_invite: string;
+ channels: {
+ id: string;
+ name: string;
+ position: number;
+ }[];
+ members: {
+ id: string;
+ username: string;
+ discriminator: string;
+ avatar: string | null;
+ status: ClientStatus;
+ avatar_url: string;
+ }[];
+ presence_count: number;
+}
diff --git a/src/schemas/responses/GuildWidgetSettingsResponse.ts b/src/schemas/responses/GuildWidgetSettingsResponse.ts
new file mode 100644
index 0000000..6ffc771
--- /dev/null
+++ b/src/schemas/responses/GuildWidgetSettingsResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+import { Snowflake } from "@spacebar/util";
+
+export interface GuildWidgetSettingsResponse {
+ enabled: boolean;
+ channel_id: Snowflake | null;
+}
diff --git a/src/schemas/responses/HubDirectoryEntriesResponse.ts b/src/schemas/responses/HubDirectoryEntriesResponse.ts
new file mode 100644
index 0000000..9efa90c
--- /dev/null
+++ b/src/schemas/responses/HubDirectoryEntriesResponse.ts
@@ -0,0 +1,31 @@
+/*
+ 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 .
+*/
+
+import { Guild } from "../../util/entities";
+
+export interface HubDirectoryEntry {
+ author_id: string;
+ created_at: string;
+ description: string;
+ directory_channel_id: string;
+ guild: Guild;
+ primary_category_id: number;
+ type: number; // TODO: not exactly sure what this is, channel type?
+}
+
+export type HubDirectoryEntriesResponse = HubDirectoryEntry[];
diff --git a/src/schemas/responses/HubWaitlistSignupResponse.ts b/src/schemas/responses/HubWaitlistSignupResponse.ts
new file mode 100644
index 0000000..bd11df2
--- /dev/null
+++ b/src/schemas/responses/HubWaitlistSignupResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export interface HubWaitlistSignupResponse {
+ email: string;
+ email_domain: string;
+ school: string;
+ user_id: string;
+}
diff --git a/src/schemas/responses/InstanceDomainsResponse.ts b/src/schemas/responses/InstanceDomainsResponse.ts
new file mode 100644
index 0000000..0be3682
--- /dev/null
+++ b/src/schemas/responses/InstanceDomainsResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export interface InstanceDomainsResponse {
+ cdn: string;
+ gateway: string;
+ defaultApiVersion: string;
+ apiEndpoint: string;
+}
diff --git a/src/schemas/responses/InstancePingResponse.ts b/src/schemas/responses/InstancePingResponse.ts
new file mode 100644
index 0000000..4ff3950
--- /dev/null
+++ b/src/schemas/responses/InstancePingResponse.ts
@@ -0,0 +1,31 @@
+/*
+ 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 .
+*/
+
+export interface InstancePingResponse {
+ ping: "pong!";
+ instance: {
+ id: string;
+ name: string;
+ description: string | null;
+ image: string | null;
+ correspondenceEmail: string | null;
+ correspondenceUserID: string | null;
+ frontPage: string | null;
+ tosPage: string | null;
+ };
+}
diff --git a/src/schemas/responses/InstanceStatsResponse.ts b/src/schemas/responses/InstanceStatsResponse.ts
new file mode 100644
index 0000000..60541f0
--- /dev/null
+++ b/src/schemas/responses/InstanceStatsResponse.ts
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+
+export interface InstanceStatsResponse {
+ counts: {
+ user: number;
+ guild: number;
+ message: number;
+ members: number;
+ };
+}
diff --git a/src/schemas/responses/LocationMetadataResponse.ts b/src/schemas/responses/LocationMetadataResponse.ts
new file mode 100644
index 0000000..2a7ca9b
--- /dev/null
+++ b/src/schemas/responses/LocationMetadataResponse.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+export interface LocationMetadataResponse {
+ consent_required: boolean;
+ country_code: string;
+ promotional_email_opt_in: { required: true; pre_checked: false };
+}
diff --git a/src/schemas/responses/MemberJoinGuildResponse.ts b/src/schemas/responses/MemberJoinGuildResponse.ts
new file mode 100644
index 0000000..40002e1
--- /dev/null
+++ b/src/schemas/responses/MemberJoinGuildResponse.ts
@@ -0,0 +1,27 @@
+/*
+ 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 .
+*/
+
+import { GuildCreateResponse } from "@spacebar/util";
+import { Emoji, Role, Sticker } from "../../util/entities";
+
+export interface MemberJoinGuildResponse {
+ guild: GuildCreateResponse;
+ emojis: Emoji[];
+ roles: Role[];
+ stickers: Sticker[];
+}
diff --git a/src/schemas/responses/OAuthAuthorizeResponse.ts b/src/schemas/responses/OAuthAuthorizeResponse.ts
new file mode 100644
index 0000000..ba81f94
--- /dev/null
+++ b/src/schemas/responses/OAuthAuthorizeResponse.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+export interface OAuthAuthorizeResponse {
+ location: string;
+}
diff --git a/src/schemas/responses/PreloadMessagesResponseSchema.ts b/src/schemas/responses/PreloadMessagesResponseSchema.ts
new file mode 100644
index 0000000..9452896
--- /dev/null
+++ b/src/schemas/responses/PreloadMessagesResponseSchema.ts
@@ -0,0 +1,21 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+import { Message } from "@spacebar/util";
+
+export type PreloadMessagesResponseSchema = Message[];
\ No newline at end of file
diff --git a/src/schemas/responses/RefreshUrlsResponse.ts b/src/schemas/responses/RefreshUrlsResponse.ts
new file mode 100644
index 0000000..b08efaa
--- /dev/null
+++ b/src/schemas/responses/RefreshUrlsResponse.ts
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+
+export interface RefreshedUrl {
+ original: string;
+ refreshed: string;
+}
+
+export interface RefreshUrlsResponse {
+ refreshed_urls: RefreshedUrl[];
+}
diff --git a/src/schemas/responses/SettingsProtoUpdateResponse.ts b/src/schemas/responses/SettingsProtoUpdateResponse.ts
new file mode 100644
index 0000000..42f8621
--- /dev/null
+++ b/src/schemas/responses/SettingsProtoUpdateResponse.ts
@@ -0,0 +1,53 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+import { JsonValue } from "@protobuf-ts/runtime";
+
+export interface SettingsProtoResponse {
+ settings: string;
+}
+
+export interface SettingsProtoUpdateResponse extends SettingsProtoResponse {
+ out_of_date?: boolean;
+}
+
+export interface SettingsProtoJsonResponse {
+ settings: JsonValue;
+}
+
+export interface SettingsProtoUpdateJsonResponse extends SettingsProtoJsonResponse {
+ out_of_date?: boolean;
+}
+
+// TODO: these dont work with schemas validation
+// Typed JSON schemas:
+// export interface SettingsProtoUpdatePreloadedUserSettingsJsonResponse {
+// settings: PreloadedUserSettings;
+// out_of_date?: boolean;
+// }
+//
+// export interface SettingsProtoUpdateFrecencyUserSettingsJsonResponse {
+// settings: FrecencyUserSettings;
+// out_of_date?: boolean;
+// }
+
+// TODO: what is this?
+// export interface SettingsProtoUpdateTestSettingsJsonResponse {
+// settings: {};
+// out_of_date?: boolean;
+// }
diff --git a/src/schemas/responses/TeamListResponse.ts b/src/schemas/responses/TeamListResponse.ts
new file mode 100644
index 0000000..e4e8284
--- /dev/null
+++ b/src/schemas/responses/TeamListResponse.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+
+import { Team } from "@spacebar/util";
+
+export type TeamListResponse = Team[];
diff --git a/src/schemas/responses/Tenor.ts b/src/schemas/responses/Tenor.ts
new file mode 100644
index 0000000..5af229e
--- /dev/null
+++ b/src/schemas/responses/Tenor.ts
@@ -0,0 +1,90 @@
+/*
+ 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 .
+*/
+
+export enum TenorMediaTypes {
+ gif,
+ mediumgif,
+ tinygif,
+ nanogif,
+ mp4,
+ loopedmp4,
+ tinymp4,
+ nanomp4,
+ webm,
+ tinywebm,
+ nanowebm,
+}
+
+export type TenorMedia = {
+ preview: string;
+ url: string;
+ dims: number[];
+ size: number;
+};
+
+export type TenorGif = {
+ created: number;
+ hasaudio: boolean;
+ id: string;
+ media: { [type in keyof typeof TenorMediaTypes]: TenorMedia }[];
+ tags: string[];
+ title: string;
+ itemurl: string;
+ hascaption: boolean;
+ url: string;
+};
+
+export type TenorCategory = {
+ searchterm: string;
+ path: string;
+ image: string;
+ name: string;
+};
+
+export type TenorCategoriesResults = {
+ tags: TenorCategory[];
+};
+
+export type TenorTrendingResults = {
+ next: string;
+ results: TenorGif[];
+ locale: string;
+};
+
+export type TenorSearchResults = {
+ next: string;
+ results: TenorGif[];
+};
+
+export interface TenorGifResponse {
+ id: string;
+ title: string;
+ url: string;
+ src: string;
+ gif_src: string;
+ width: number;
+ height: number;
+ preview: string;
+}
+
+export interface TenorTrendingResponse {
+ categories: TenorCategoriesResults;
+ gifs: TenorGifResponse[];
+}
+
+export type TenorGifsResponse = TenorGifResponse[];
diff --git a/src/schemas/responses/TokenResponse.ts b/src/schemas/responses/TokenResponse.ts
new file mode 100644
index 0000000..c0f1346
--- /dev/null
+++ b/src/schemas/responses/TokenResponse.ts
@@ -0,0 +1,33 @@
+/*
+ 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 .
+*/
+
+import { BackupCode, UserSettings } from "../../util/entities";
+
+export interface TokenResponse {
+ token: string;
+ settings: UserSettings;
+}
+
+export interface TokenOnlyResponse {
+ token: string;
+}
+
+export interface TokenWithBackupCodesResponse {
+ token: string;
+ backup_codes: BackupCode[];
+}
diff --git a/src/schemas/responses/TypedResponses.ts b/src/schemas/responses/TypedResponses.ts
new file mode 100644
index 0000000..86d0849
--- /dev/null
+++ b/src/schemas/responses/TypedResponses.ts
@@ -0,0 +1,116 @@
+/*
+ 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 .
+*/
+
+import { GuildBansResponse, GuildCreateResponse } from "@spacebar/util";
+import { GeneralConfiguration, LimitsConfiguration } from "../../util/config";
+import { DmChannelDTO } from "../../util/dtos";
+import {
+ Application,
+ BackupCode,
+ Categories,
+ Channel,
+ Emoji,
+ Guild,
+ Invite,
+ Member,
+ Message,
+ PrivateUser,
+ PublicMember,
+ PublicUser,
+ Role,
+ Sticker,
+ StickerPack,
+ Template,
+ Webhook,
+} from "../../util/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 APIBansArray = GuildBansResponse[];
+
+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 APIPublicMember = PublicMember;
+
+export interface APIGuildWithJoinedAt extends GuildCreateResponse {
+ 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[];
+
+export type APIConnectionsConfiguration = Record<
+ string,
+ {
+ enabled: boolean;
+ }
+>;
diff --git a/src/schemas/responses/UpdatesResponse.ts b/src/schemas/responses/UpdatesResponse.ts
new file mode 100644
index 0000000..d8770b4
--- /dev/null
+++ b/src/schemas/responses/UpdatesResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+export interface UpdatesResponse {
+ name: string;
+ pub_date: string;
+ url: string;
+ notes: string | null;
+}
diff --git a/src/schemas/responses/UploadAttachmentResponseSchema.ts b/src/schemas/responses/UploadAttachmentResponseSchema.ts
new file mode 100644
index 0000000..eab5f22
--- /dev/null
+++ b/src/schemas/responses/UploadAttachmentResponseSchema.ts
@@ -0,0 +1,29 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2024 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 .
+*/
+
+
+export interface UploadAttachmentResponseSchema {
+ attachments: UploadAttachmentResponse[];
+}
+
+export interface UploadAttachmentResponse {
+ id?: string;
+ upload_url: string;
+ upload_filename: string;
+ original_content_type?: string;
+}
diff --git a/src/schemas/responses/UserNoteResponse.ts b/src/schemas/responses/UserNoteResponse.ts
new file mode 100644
index 0000000..0bde99a
--- /dev/null
+++ b/src/schemas/responses/UserNoteResponse.ts
@@ -0,0 +1,23 @@
+/*
+ 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 .
+*/
+
+export interface UserNoteResponse {
+ note: string;
+ note_user_id: string;
+ user_id: string;
+}
diff --git a/src/schemas/responses/UserProfileResponse.ts b/src/schemas/responses/UserProfileResponse.ts
new file mode 100644
index 0000000..7b63542
--- /dev/null
+++ b/src/schemas/responses/UserProfileResponse.ts
@@ -0,0 +1,57 @@
+/*
+ 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 .
+*/
+
+import {
+ Badge,
+ Member,
+ PublicConnectedAccount,
+ PublicMember,
+ PublicUser,
+ User,
+} from "@spacebar/util";
+
+export type MutualGuild = {
+ id: string;
+ nick?: string;
+};
+
+export type PublicMemberProfile = Pick<
+ Member,
+ "banner" | "bio" | "guild_id"
+> & {
+ accent_color: null; // TODO
+};
+
+export type UserProfile = Pick<
+ User,
+ "bio" | "accent_color" | "banner" | "pronouns" | "theme_colors"
+>;
+
+export interface UserProfileResponse {
+ user: PublicUser;
+ connected_accounts: PublicConnectedAccount;
+ premium_guild_since?: Date;
+ premium_since?: Date;
+ mutual_guilds: MutualGuild[];
+ premium_type: number;
+ profile_themes_experiment_bucket: number;
+ user_profile: UserProfile;
+ guild_member?: PublicMember;
+ guild_member_profile?: PublicMemberProfile;
+ badges: Badge[];
+}
diff --git a/src/schemas/responses/UserRelationsResponse.ts b/src/schemas/responses/UserRelationsResponse.ts
new file mode 100644
index 0000000..808dd3d
--- /dev/null
+++ b/src/schemas/responses/UserRelationsResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+import { User } from "@spacebar/util";
+
+export type UserRelationsResponse = (Pick &
+ Pick &
+ Pick &
+ Pick &
+ Pick)[];
diff --git a/src/schemas/responses/UserRelationshipsResponse.ts b/src/schemas/responses/UserRelationshipsResponse.ts
new file mode 100644
index 0000000..1a3341f
--- /dev/null
+++ b/src/schemas/responses/UserRelationshipsResponse.ts
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+import { PublicUser, RelationshipType } from "../../util/entities";
+
+export interface UserRelationshipsResponse {
+ id: string;
+ type: RelationshipType;
+ nickname: null;
+ user: PublicUser;
+}
diff --git a/src/schemas/responses/WebAuthnCreateResponse.ts b/src/schemas/responses/WebAuthnCreateResponse.ts
new file mode 100644
index 0000000..57386e6
--- /dev/null
+++ b/src/schemas/responses/WebAuthnCreateResponse.ts
@@ -0,0 +1,21 @@
+/*
+ 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 .
+*/
+export interface WebAuthnCreateResponse {
+ name: string;
+ id: string;
+}
diff --git a/src/schemas/responses/WebhookCreateResponse.ts b/src/schemas/responses/WebhookCreateResponse.ts
new file mode 100644
index 0000000..6f1cd24
--- /dev/null
+++ b/src/schemas/responses/WebhookCreateResponse.ts
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+
+import { User, Webhook } from "../../util/entities";
+
+export interface WebhookCreateResponse {
+ user: User;
+ hook: Webhook;
+}
diff --git a/src/schemas/responses/index.ts b/src/schemas/responses/index.ts
new file mode 100644
index 0000000..dcf49f3
--- /dev/null
+++ b/src/schemas/responses/index.ts
@@ -0,0 +1,68 @@
+/*
+ Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2025 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 .
+*/
+
+export * from "./AccountStandingResponse";
+export * from "./APIErrorOrCaptchaResponse";
+export * from "./APIErrorResponse";
+export * from "./BackupCodesChallengeResponse";
+export * from "./CaptchaRequiredResponse";
+export * from "./CollectiblesCategoriesResponse";
+export * from "./CollectiblesMarketingResponse";
+export * from "./CollectiblesShopResponse";
+export * from "./DiscoverableGuildsResponse";
+export * from "./DmMessagesResponseSchema";
+export * from "./EmailDomainLookupResponse";
+export * from "./EmailDomainLookupVerifyCodeResponse";
+export * from "./EmojiSourceResponse";
+export * from "./GatewayBotResponse";
+export * from "./GatewayResponse";
+export * from "./GenerateRegistrationTokensResponse";
+export * from "./GuildBansResponse";
+export * from "./GuildCreateResponse";
+export * from "./GuildDiscoveryRequirements";
+export * from "./GuildMessagesSearchResponse";
+export * from "./GuildProfileResponse";
+export * from "./GuildPruneResponse";
+export * from "./GuildRecommendationsResponse";
+export * from "./GuildVanityUrl";
+export * from "./GuildVoiceRegionsResponse";
+export * from "./GuildWidgetJsonResponse";
+export * from "./GuildWidgetSettingsResponse";
+export * from "./HubDirectoryEntriesResponse";
+export * from "./HubWaitlistSignupResponse";
+export * from "./InstanceDomainsResponse";
+export * from "./InstancePingResponse";
+export * from "./InstanceStatsResponse";
+export * from "./LocationMetadataResponse";
+export * from "./MemberJoinGuildResponse";
+export * from "./OAuthAuthorizeResponse";
+export * from "./PreloadMessagesResponseSchema";
+export * from "./RefreshUrlsResponse";
+export * from "./SettingsProtoUpdateResponse";
+export * from "./TeamListResponse";
+export * from "./Tenor";
+export * from "./TokenResponse";
+export * from "./TypedResponses";
+export * from "./UpdatesResponse";
+export * from "./UploadAttachmentResponseSchema";
+export * from "./UserNoteResponse";
+export * from "./UserProfileResponse";
+export * from "./UserRelationshipsResponse";
+export * from "./UserRelationsResponse";
+export * from "./WebAuthnCreateResponse";
+export * from "./WebhookCreateResponse";
diff --git a/src/util/connections/Connection.ts b/src/util/connections/Connection.ts
index 638dde2..32ef635 100644
--- a/src/util/connections/Connection.ts
+++ b/src/util/connections/Connection.ts
@@ -18,7 +18,7 @@
import crypto from "crypto";
import { ConnectedAccount } from "../entities";
-import { ConnectedAccountSchema, ConnectionCallbackSchema } from "../schemas";
+import { ConnectedAccountSchema, ConnectionCallbackSchema } from "@spacebar/schemas*";
import { Config, DiscordApiErrors } from "../util";
/**
diff --git a/src/util/index.ts b/src/util/index.ts
index 9a84d1a..f2b526e 100644
--- a/src/util/index.ts
+++ b/src/util/index.ts
@@ -24,7 +24,7 @@
export * from "./interfaces/index";
export * from "./entities/index";
export * from "./dtos/index";
-export * from "./schemas";
+export * from "@spacebar/schemas*";
export * from "./imports";
export * from "./config";
export * from "./connections";
diff --git a/src/util/schemas/AckBulkSchema.ts b/src/util/schemas/AckBulkSchema.ts
deleted file mode 100644
index 5604c2f..0000000
--- a/src/util/schemas/AckBulkSchema.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface AckBulkSchema {
- read_states: {
- channel_id: string;
- message_id: string;
- read_state_type: number; // WHat is this?
- }[];
-}
diff --git a/src/util/schemas/ActivitySchema.ts b/src/util/schemas/ActivitySchema.ts
deleted file mode 100644
index f168f96..0000000
--- a/src/util/schemas/ActivitySchema.ts
+++ /dev/null
@@ -1,80 +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 .
-*/
-
-import { Activity, Status } from "@spacebar/util";
-
-export const ActivitySchema = {
- $afk: Boolean,
- status: String,
- $activities: [
- {
- name: String,
- type: Number,
- $url: String,
- $created_at: Date,
- $timestamps: {
- $start: Number,
- $end: Number,
- },
- $application_id: String,
- $details: String,
- $state: String,
- $emoji: {
- $name: String,
- $id: String,
- $animated: Boolean,
- },
- $party: {
- $id: String,
- $size: [Number, Number],
- },
- $assets: {
- $large_image: String,
- $large_text: String,
- $small_image: String,
- $small_text: String,
- },
- $secrets: {
- $join: String,
- $spectate: String,
- $match: String,
- },
- $instance: Boolean,
- $flags: String,
-
- // Spotify and other rich presence data
- $id: String,
- $sync_id: String,
- $metadata: {
- // spotify
- $context_uri: String,
- album_id: String,
- artist_ids: [String],
- },
- $session_id: String,
- },
- ],
- $since: Number, // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
-};
-
-export interface ActivitySchema {
- afk?: boolean;
- status: Status;
- activities?: Activity[];
- since?: number; // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
-}
diff --git a/src/util/schemas/ApplicationAuthorizeSchema.ts b/src/util/schemas/ApplicationAuthorizeSchema.ts
deleted file mode 100644
index 04b7b1e..0000000
--- a/src/util/schemas/ApplicationAuthorizeSchema.ts
+++ /dev/null
@@ -1,29 +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 .
-*/
-
-export interface ApplicationAuthorizeSchema {
- authorize: boolean;
- guild_id: string;
- permissions: string;
- captcha_key?: string;
- /**
- * @minLength 6
- * @maxLength 6
- */
- code?: string; // 2fa code
-}
diff --git a/src/util/schemas/ApplicationCreateSchema.ts b/src/util/schemas/ApplicationCreateSchema.ts
deleted file mode 100644
index 80956ec..0000000
--- a/src/util/schemas/ApplicationCreateSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface ApplicationCreateSchema {
- name: string;
- team_id?: string;
-}
diff --git a/src/util/schemas/ApplicationModifySchema.ts b/src/util/schemas/ApplicationModifySchema.ts
deleted file mode 100644
index a871797..0000000
--- a/src/util/schemas/ApplicationModifySchema.ts
+++ /dev/null
@@ -1,39 +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 .
-*/
-
-export interface ApplicationModifySchema {
- description?: string;
- icon?: string;
- cover_image?: string;
- interactions_endpoint_url?: string;
- max_participants?: number | null;
- name?: string;
- privacy_policy_url?: string;
- role_connections_verification_url?: string;
- tags?: string[];
- terms_of_service_url?: string;
- bot_public?: boolean;
- bot_require_code_grant?: boolean;
- flags?: number;
- custom_install_url?: string;
- guild_id?: string;
- /*install_params?: { TODO: Validation
- scopes: string[];
- permissions: string;
- };*/
-}
diff --git a/src/util/schemas/AutomodRuleSchema.ts b/src/util/schemas/AutomodRuleSchema.ts
deleted file mode 100644
index 55cf202..0000000
--- a/src/util/schemas/AutomodRuleSchema.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2024 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 .
-*/
-
-export interface AutomodMentionSpamRuleSchema {
- mention_total_limit: number;
- mention_raid_protection_enabled: boolean;
-}
-
-export interface AutomodSuspectedSpamRuleSchema {}
-
-export interface AutomodCommonlyFlaggedWordsRuleSchema {
- allow_list: [string];
- presets: [number];
-}
-
-export interface AutomodCustomWordsRuleSchema {
- allow_list: [string];
- keyword_filter: [string];
- regex_patterns: [string];
-}
-
-export interface AutomodRuleSchema {
- creator_id: string;
- enabled: boolean;
- event_type: number; // No idea...
- exempt_channels: [string];
- exempt_roles: [string];
- guild_id: string;
- name: string;
- position: number;
- trigger_type: number; //AutomodTriggerTypes
- trigger_metadata:
- | AutomodMentionSpamRuleSchema
- | AutomodSuspectedSpamRuleSchema
- | AutomodCommonlyFlaggedWordsRuleSchema
- | AutomodCustomWordsRuleSchema;
-}
-
-export interface AutomodRuleSchemaWithId extends AutomodRuleSchema {
- id: string;
-}
diff --git a/src/util/schemas/BackupCodesChallengeSchema.ts b/src/util/schemas/BackupCodesChallengeSchema.ts
deleted file mode 100644
index 25f1b70..0000000
--- a/src/util/schemas/BackupCodesChallengeSchema.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface BackupCodesChallengeSchema {
- /**
- * @minLength 1
- * @maxLength 72
- */
- password: string;
-}
diff --git a/src/util/schemas/BanCreateSchema.ts b/src/util/schemas/BanCreateSchema.ts
deleted file mode 100644
index 6d30ca2..0000000
--- a/src/util/schemas/BanCreateSchema.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-export interface BanCreateSchema {
- delete_message_seconds?: string;
- delete_message_days?: string;
- reason?: string;
-}
diff --git a/src/util/schemas/BanModeratorSchema.ts b/src/util/schemas/BanModeratorSchema.ts
deleted file mode 100644
index cba1a5e..0000000
--- a/src/util/schemas/BanModeratorSchema.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface BanModeratorSchema {
- id: string;
- user_id: string;
- guild_id: string;
- executor_id: string;
- reason?: string | undefined;
-}
diff --git a/src/util/schemas/BanRegistrySchema.ts b/src/util/schemas/BanRegistrySchema.ts
deleted file mode 100644
index 4e76870..0000000
--- a/src/util/schemas/BanRegistrySchema.ts
+++ /dev/null
@@ -1,26 +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 .
-*/
-
-export interface BanRegistrySchema {
- id: string;
- user_id: string;
- guild_id: string;
- executor_id: string;
- ip?: string;
- reason?: string | undefined;
-}
diff --git a/src/util/schemas/BotModifySchema.ts b/src/util/schemas/BotModifySchema.ts
deleted file mode 100644
index 7d94da2..0000000
--- a/src/util/schemas/BotModifySchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface BotModifySchema {
- avatar?: string;
- username?: string;
-}
diff --git a/src/util/schemas/BulkBanSchema.ts b/src/util/schemas/BulkBanSchema.ts
deleted file mode 100644
index 48a7bac..0000000
--- a/src/util/schemas/BulkBanSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface BulkBanSchema {
- user_ids: string[];
- delete_message_seconds?: number;
-}
diff --git a/src/util/schemas/BulkDeleteSchema.ts b/src/util/schemas/BulkDeleteSchema.ts
deleted file mode 100644
index ca22f10..0000000
--- a/src/util/schemas/BulkDeleteSchema.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface BulkDeleteSchema {
- messages: string[];
-}
diff --git a/src/util/schemas/ChannelModifySchema.ts b/src/util/schemas/ChannelModifySchema.ts
deleted file mode 100644
index 088ac45..0000000
--- a/src/util/schemas/ChannelModifySchema.ts
+++ /dev/null
@@ -1,48 +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 .
-*/
-
-import { ChannelPermissionOverwriteType, ChannelType } from "@spacebar/util";
-
-export interface ChannelModifySchema {
- /**
- * @maxLength 100
- */
- name?: string;
- type?: ChannelType;
- topic?: string;
- icon?: string | null;
- bitrate?: number;
- user_limit?: number;
- rate_limit_per_user?: number;
- position?: number;
- permission_overwrites?: {
- id: string;
- type: ChannelPermissionOverwriteType;
- allow: string;
- deny: string;
- }[];
- parent_id?: string;
- id?: string; // is not used (only for guild create)
- nsfw?: boolean;
- rtc_region?: string;
- default_auto_archive_duration?: number;
- default_reaction_emoji?: string | null;
- flags?: number;
- default_thread_rate_limit_per_user?: number;
- video_quality_mode?: number;
-}
diff --git a/src/util/schemas/ChannelPermissionOverwriteSchema.ts b/src/util/schemas/ChannelPermissionOverwriteSchema.ts
deleted file mode 100644
index 6e8b340..0000000
--- a/src/util/schemas/ChannelPermissionOverwriteSchema.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-import { ChannelPermissionOverwrite } from "@spacebar/util";
-
-export type ChannelPermissionOverwriteSchema = ChannelPermissionOverwrite;
diff --git a/src/util/schemas/ChannelReorderSchema.ts b/src/util/schemas/ChannelReorderSchema.ts
deleted file mode 100644
index 657ed42..0000000
--- a/src/util/schemas/ChannelReorderSchema.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export type ChannelReorderSchema = {
- id: string;
- position?: number;
- lock_permissions?: boolean;
- parent_id?: null | string;
-}[];
diff --git a/src/util/schemas/CodesVerificationSchema.ts b/src/util/schemas/CodesVerificationSchema.ts
deleted file mode 100644
index 3c95e61..0000000
--- a/src/util/schemas/CodesVerificationSchema.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-export interface CodesVerificationSchema {
- key: string;
- nonce: string;
- regenerate?: boolean;
-}
diff --git a/src/util/schemas/ConnectedAccountSchema.ts b/src/util/schemas/ConnectedAccountSchema.ts
deleted file mode 100644
index 5fd05b7..0000000
--- a/src/util/schemas/ConnectedAccountSchema.ts
+++ /dev/null
@@ -1,36 +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 .
-*/
-
-import { ConnectedAccountTokenData } from "../interfaces";
-
-export interface ConnectedAccountSchema {
- external_id: string;
- user_id: string;
- token_data?: ConnectedAccountTokenData;
- friend_sync?: boolean;
- name: string;
- revoked?: boolean;
- show_activity?: number;
- type: string;
- verified?: boolean;
- visibility?: number;
- integrations?: string[];
- metadata_?: unknown;
- metadata_visibility?: number;
- two_way_link?: boolean;
-}
diff --git a/src/util/schemas/ConnectionCallbackSchema.ts b/src/util/schemas/ConnectionCallbackSchema.ts
deleted file mode 100644
index b66bfe2..0000000
--- a/src/util/schemas/ConnectionCallbackSchema.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface ConnectionCallbackSchema {
- code?: string;
- state: string;
- insecure: boolean;
- friend_sync: boolean;
- openid_params?: unknown; // TODO: types
-}
diff --git a/src/util/schemas/ConnectionUpdateSchema.ts b/src/util/schemas/ConnectionUpdateSchema.ts
deleted file mode 100644
index f9f17b0..0000000
--- a/src/util/schemas/ConnectionUpdateSchema.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-export interface ConnectionUpdateSchema {
- visibility?: boolean;
- show_activity?: boolean;
- metadata_visibility?: boolean;
-}
diff --git a/src/util/schemas/DmChannelCreateSchema.ts b/src/util/schemas/DmChannelCreateSchema.ts
deleted file mode 100644
index 510ff9c..0000000
--- a/src/util/schemas/DmChannelCreateSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface DmChannelCreateSchema {
- name?: string;
- recipients: string[];
-}
diff --git a/src/util/schemas/EmailDomainLookupSchema.ts b/src/util/schemas/EmailDomainLookupSchema.ts
deleted file mode 100644
index 43680aa..0000000
--- a/src/util/schemas/EmailDomainLookupSchema.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export interface EmailDomainLookupSchema {
- allow_multiple_guilds: boolean;
- email: string;
- use_verification_code: boolean;
- guild_id?: string;
-}
diff --git a/src/util/schemas/EmailDomainLookupVerifyCodeSchema.ts b/src/util/schemas/EmailDomainLookupVerifyCodeSchema.ts
deleted file mode 100644
index 9fe0bd4..0000000
--- a/src/util/schemas/EmailDomainLookupVerifyCodeSchema.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-export interface EmailDomainLookupVerifyCodeSchema {
- email: string;
- guild_id: string;
- code: string;
-}
diff --git a/src/util/schemas/EmojiCreateSchema.ts b/src/util/schemas/EmojiCreateSchema.ts
deleted file mode 100644
index 5eae5a9..0000000
--- a/src/util/schemas/EmojiCreateSchema.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export interface EmojiCreateSchema {
- name?: string;
- image: string;
- require_colons?: boolean | null;
- roles?: string[];
-}
diff --git a/src/util/schemas/EmojiModifySchema.ts b/src/util/schemas/EmojiModifySchema.ts
deleted file mode 100644
index 5d33bf6..0000000
--- a/src/util/schemas/EmojiModifySchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface EmojiModifySchema {
- name?: string;
- roles?: string[];
-}
diff --git a/src/util/schemas/ForgotPasswordSchema.ts b/src/util/schemas/ForgotPasswordSchema.ts
deleted file mode 100644
index 0f9fc92..0000000
--- a/src/util/schemas/ForgotPasswordSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface ForgotPasswordSchema {
- login: string;
- captcha_key?: string;
-}
diff --git a/src/util/schemas/GatewayBotResponse.ts b/src/util/schemas/GatewayBotResponse.ts
deleted file mode 100644
index c68ec09..0000000
--- a/src/util/schemas/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 .
-*/
-
-export interface GatewayBotResponse {
- url: string;
- shards: number;
- session_start_limit: {
- total: number;
- remaining: number;
- reset_after: number;
- max_concurrency: number;
- };
-}
diff --git a/src/util/schemas/GatewayPayloadSchema.ts b/src/util/schemas/GatewayPayloadSchema.ts
deleted file mode 100644
index 306f2c0..0000000
--- a/src/util/schemas/GatewayPayloadSchema.ts
+++ /dev/null
@@ -1,26 +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 .
-*/
-
-import { Tuple } from "lambert-server";
-
-export const PayloadSchema = {
- op: Number,
- $d: new Tuple(Object, Number), // or number for heartbeat sequence
- $s: Number,
- $t: String,
-};
diff --git a/src/util/schemas/GatewayResponse.ts b/src/util/schemas/GatewayResponse.ts
deleted file mode 100644
index 5b771ed..0000000
--- a/src/util/schemas/GatewayResponse.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface GatewayResponse {
- url: string;
-}
diff --git a/src/util/schemas/GreetRequestSchema.ts b/src/util/schemas/GreetRequestSchema.ts
deleted file mode 100644
index 545952d..0000000
--- a/src/util/schemas/GreetRequestSchema.ts
+++ /dev/null
@@ -1,30 +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 .
-*/
-
-import { AllowedMentions } from "@spacebar/util";
-
-export interface GreetRequestSchema {
- sticker_ids: string[];
- allowed_mentions?: AllowedMentions;
- message_reference?: {
- message_id: string;
- channel_id?: string;
- guild_id?: string;
- fail_if_not_exists?: boolean;
- };
-}
\ No newline at end of file
diff --git a/src/util/schemas/GuildCreateSchema.ts b/src/util/schemas/GuildCreateSchema.ts
deleted file mode 100644
index c293aa8..0000000
--- a/src/util/schemas/GuildCreateSchema.ts
+++ /dev/null
@@ -1,33 +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 .
-*/
-
-import { ChannelModifySchema } from ".";
-
-export interface GuildCreateSchema {
- /**
- * @maxLength 100
- */
- name?: string;
- region?: string;
- icon?: string | null;
- channels?: ChannelModifySchema[];
- system_channel_id?: string;
- rules_channel_id?: string;
- guild_template_code?: string;
- staff_only?: boolean;
-}
diff --git a/src/util/schemas/GuildSubscriptionsBulkSchema.ts b/src/util/schemas/GuildSubscriptionsBulkSchema.ts
deleted file mode 100644
index 86f00a3..0000000
--- a/src/util/schemas/GuildSubscriptionsBulkSchema.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { LazyRequestSchema } from "./LazyRequestSchema";
-
-export interface GuildSubscriptionsBulkSchema {
- subscriptions: { [key: string]: GuildSubscriptionSchema };
-}
-
-export type GuildSubscriptionSchema = Omit;
-
-export const GuildSubscriptionsBulkSchema = {
- $subscriptions: Object,
-};
diff --git a/src/util/schemas/GuildTemplateCreateSchema.ts b/src/util/schemas/GuildTemplateCreateSchema.ts
deleted file mode 100644
index 048de6f..0000000
--- a/src/util/schemas/GuildTemplateCreateSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface GuildTemplateCreateSchema {
- name: string;
- avatar?: string | null;
-}
diff --git a/src/util/schemas/GuildUpdateSchema.ts b/src/util/schemas/GuildUpdateSchema.ts
deleted file mode 100644
index 069be6c..0000000
--- a/src/util/schemas/GuildUpdateSchema.ts
+++ /dev/null
@@ -1,37 +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 .
-*/
-
-import { GuildCreateSchema } from "@spacebar/util";
-
-export interface GuildUpdateSchema extends Omit {
- banner?: string | null;
- splash?: string | null;
- description?: string;
- features?: string[];
- verification_level?: number;
- default_message_notifications?: number;
- system_channel_flags?: number;
- explicit_content_filter?: number;
- public_updates_channel_id?: string;
- afk_timeout?: number;
- afk_channel_id?: string;
- preferred_locale?: string;
- premium_progress_bar_enabled?: boolean;
- discovery_splash?: string;
- safety_alerts_channel_id?: string | null;
-}
diff --git a/src/util/schemas/GuildUpdateWelcomeScreenSchema.ts b/src/util/schemas/GuildUpdateWelcomeScreenSchema.ts
deleted file mode 100644
index 8046aae..0000000
--- a/src/util/schemas/GuildUpdateWelcomeScreenSchema.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 .
-*/
-
-export interface GuildUpdateWelcomeScreenSchema {
- welcome_channels?: {
- channel_id: string;
- description: string;
- emoji_id?: string;
- emoji_name?: string;
- }[];
- enabled?: boolean;
- description?: string;
-}
diff --git a/src/util/schemas/HubWaitlistSignupSchema.ts b/src/util/schemas/HubWaitlistSignupSchema.ts
deleted file mode 100644
index 8114b3d..0000000
--- a/src/util/schemas/HubWaitlistSignupSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface HubWaitlistSignupSchema {
- email: string;
- school: string;
-}
diff --git a/src/util/schemas/IdentifySchema.ts b/src/util/schemas/IdentifySchema.ts
deleted file mode 100644
index 0619dac..0000000
--- a/src/util/schemas/IdentifySchema.ts
+++ /dev/null
@@ -1,144 +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 .
-*/
-
-import { ActivitySchema } from "@spacebar/util";
-
-// TODO: Need a way to allow camalCase and pascal_case without just duplicating the schema
-
-export const IdentifySchema = {
- token: String,
- $intents: BigInt, // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt
- $properties: Object,
- // {
- // // discord uses $ in the property key for bots, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key
- // $os: String,
- // $os_arch: String,
- // $browser: String,
- // $device: String,
- // $$os: String,
- // $$browser: String,
- // $$device: String,
- // $browser_user_agent: String,
- // $browser_version: String,
- // $os_version: String,
- // $referrer: String,
- // $$referrer: String,
- // $referring_domain: String,
- // $$referring_domain: String,
- // $referrer_current: String,
- // $referring_domain_current: String,
- // $release_channel: String,
- // $client_build_number: Number,
- // $client_event_source: String,
- // $client_version: String,
- // $system_locale: String,
- // $window_manager: String,
- // $distro: String,
- // },
- $presence: ActivitySchema,
- $compress: Boolean,
- $large_threshold: Number,
- $shard: [BigInt, BigInt],
- $guild_subscriptions: Boolean,
- $capabilities: Number,
- $client_state: {
- $guild_hashes: Object,
- $highest_last_message_id: String || Number,
- $read_state_version: Number,
- $user_guild_settings_version: Number,
- $user_settings_version: undefined,
- $useruser_guild_settings_version: undefined,
- $private_channels_version: Number,
- $guild_versions: Object,
- $api_code_version: Number,
- $initial_guild_id: String,
- },
- $clientState: {
- $guildHashes: Object,
- $highestLastMessageId: String || Number,
- $readStateVersion: Number,
- $useruserGuildSettingsVersion: undefined,
- $userGuildSettingsVersion: undefined,
- $guildVersions: Object,
- $apiCodeVersion: Number,
- $initialGuildId: String,
- },
- $v: Number,
- $version: Number,
-};
-
-export interface IdentifySchema {
- token: string;
- properties: {
- // bruh discord really uses $ in the property key, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key
- os?: string;
- os_atch?: string;
- browser?: string;
- device?: string;
- $os?: string;
- $browser?: string;
- $device?: string;
- browser_user_agent?: string;
- browser_version?: string;
- os_version?: string;
- referrer?: string;
- referring_domain?: string;
- referrer_current?: string;
- referring_domain_current?: string;
- release_channel?: "stable" | "dev" | "ptb" | "canary";
- client_build_number?: number;
- client_event_source?: string;
- client_version?: string;
- system_locale?: string;
- };
- intents?: bigint; // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt
- presence?: ActivitySchema;
- compress?: boolean;
- large_threshold?: number;
- largeThreshold?: number;
- /**
- * @minItems 2
- * @maxItems 2
- */
- shard?: bigint[]; // puyo: changed from [bigint, bigint] because it breaks openapi
- guild_subscriptions?: boolean;
- capabilities?: number;
- client_state?: {
- guild_hashes?: unknown;
- highest_last_message_id?: string | number;
- read_state_version?: number;
- user_guild_settings_version?: number;
- user_settings_version?: number;
- useruser_guild_settings_version?: number;
- private_channels_version?: number;
- guild_versions?: unknown;
- api_code_version?: number;
- initial_guild_id?: string;
- };
- clientState?: {
- guildHashes?: unknown;
- highestLastMessageId?: string | number;
- readStateVersion?: number;
- userGuildSettingsVersion?: number;
- useruserGuildSettingsVersion?: number;
- guildVersions?: unknown;
- apiCodeVersion?: number;
- initialGuildId?: string;
- };
- v?: number;
-}
diff --git a/src/util/schemas/InviteCreateSchema.ts b/src/util/schemas/InviteCreateSchema.ts
deleted file mode 100644
index 92333e7..0000000
--- a/src/util/schemas/InviteCreateSchema.ts
+++ /dev/null
@@ -1,30 +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 .
-*/
-
-export interface InviteCreateSchema {
- target_user_id?: string;
- target_type?: string;
- validate?: string; // ? what is this
- max_age?: number;
- max_uses?: number;
- temporary?: boolean;
- unique?: boolean;
- target_user?: string;
- target_user_type?: number;
- flags?: number;
-}
diff --git a/src/util/schemas/LazyRequestSchema.ts b/src/util/schemas/LazyRequestSchema.ts
deleted file mode 100644
index ca07d37..0000000
--- a/src/util/schemas/LazyRequestSchema.ts
+++ /dev/null
@@ -1,46 +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 .
-*/
-
-export interface LazyRequestSchema {
- guild_id: string;
- channels?: {
- /**
- * @items.type integer
- * @minItems 2
- * @maxItems 2
- */
- [key: string]: number[][]; // puyo: changed from [number, number] because it breaks openapi
- };
- activities?: boolean;
- threads?: boolean;
- typing?: true;
- members?: string[];
- member_updates?: boolean;
- thread_member_lists?: unknown[];
-}
-
-export const LazyRequestSchema = {
- guild_id: String,
- $activities: Boolean,
- $channels: Object,
- $typing: Boolean,
- $threads: Boolean,
- $members: [] as string[],
- $member_updates: Boolean,
- $thread_member_lists: [] as unknown[],
-};
diff --git a/src/util/schemas/LoginResponse.ts b/src/util/schemas/LoginResponse.ts
deleted file mode 100644
index faf3f76..0000000
--- a/src/util/schemas/LoginResponse.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { TokenResponse } from "./responses";
-
-export interface MFAResponse {
- ticket: string;
- mfa: true;
- sms: false; // TODO
- token: null;
-}
-
-export interface WebAuthnResponse extends MFAResponse {
- webauthn: string;
-}
-
-export type LoginResponse = TokenResponse | MFAResponse | WebAuthnResponse;
diff --git a/src/util/schemas/LoginSchema.ts b/src/util/schemas/LoginSchema.ts
deleted file mode 100644
index 55b6a02..0000000
--- a/src/util/schemas/LoginSchema.ts
+++ /dev/null
@@ -1,30 +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 .
-*/
-
-export interface LoginSchema {
- login: string;
- /**
- * @minLength 1
- * @maxLength 72
- */
- password: string;
- undelete?: boolean;
- captcha_key?: string;
- login_source?: string;
- gift_code_sku_id?: string;
-}
diff --git a/src/util/schemas/MemberChangeProfileSchema.ts b/src/util/schemas/MemberChangeProfileSchema.ts
deleted file mode 100644
index d2d1481..0000000
--- a/src/util/schemas/MemberChangeProfileSchema.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 .
-*/
-
-export interface MemberChangeProfileSchema {
- banner?: string | null;
- nick?: string;
- bio?: string;
- pronouns?: string;
- /**
- * @items.type integer
- */
- theme_colors?: [number, number];
-}
diff --git a/src/util/schemas/MemberChangeSchema.ts b/src/util/schemas/MemberChangeSchema.ts
deleted file mode 100644
index e1ee096..0000000
--- a/src/util/schemas/MemberChangeSchema.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export interface MemberChangeSchema {
- roles?: string[];
- nick?: string;
- avatar?: string | null;
- bio?: string;
-}
diff --git a/src/util/schemas/MemberNickChangeSchema.ts b/src/util/schemas/MemberNickChangeSchema.ts
deleted file mode 100644
index 4589056..0000000
--- a/src/util/schemas/MemberNickChangeSchema.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface MemberNickChangeSchema {
- nick: string;
-}
diff --git a/src/util/schemas/MessageAcknowledgeSchema.ts b/src/util/schemas/MessageAcknowledgeSchema.ts
deleted file mode 100644
index 3ba7164..0000000
--- a/src/util/schemas/MessageAcknowledgeSchema.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface MessageAcknowledgeSchema {
- manual?: boolean;
- mention_count?: number;
- flags?: number;
- last_viewed?: number;
- token?: string;
-}
diff --git a/src/util/schemas/MessageCreateSchema.ts b/src/util/schemas/MessageCreateSchema.ts
deleted file mode 100644
index f5037d6..0000000
--- a/src/util/schemas/MessageCreateSchema.ts
+++ /dev/null
@@ -1,80 +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 .
-*/
-
-import { ActionRowComponent, Embed, PollAnswer, PollMedia } from "@spacebar/util";
-
-export type MessageCreateAttachment = {
- id: string;
- filename: string;
-};
-
-export type MessageCreateCloudAttachment = {
- id?: string;
- filename: string;
- uploaded_filename: string;
- original_content_type?: string;
-}
-
-export interface MessageCreateSchema {
- type?: number;
- content?: string;
- mobile_network_type?: string;
- nonce?: string;
- channel_id?: string;
- tts?: boolean;
- flags?: number;
- embeds?: Embed[];
- embed?: Embed;
- // TODO: ^ embed is deprecated in favor of embeds (https://discord.com/developers/docs/resources/channel#message-object)
- allowed_mentions?: {
- parse?: string[];
- roles?: string[];
- users?: string[];
- replied_user?: boolean;
- };
- message_reference?: {
- message_id: string;
- channel_id?: string;
- guild_id?: string;
- fail_if_not_exists?: boolean;
- };
- payload_json?: string;
- file?: { filename: string };
- /**
- TODO: we should create an interface for attachments
- TODO: OpenWAAO<-->attachment-style metadata conversion
- **/
- attachments?: (MessageCreateAttachment | MessageCreateCloudAttachment)[];
- sticker_ids?: string[] | null; // null check: fixes Discord-Go
- components?: ActionRowComponent[] | null; // null check: fixes Discord-Go
- // TODO: Fix TypeScript errors in src\api\util\handlers\Message.ts once this is enabled
- poll?: PollCreationSchema;
- enforce_nonce?: boolean; // For Discord compatibility, it's the default behavior here
- applied_tags?: string[]; // Not implemented yet, for webhooks in forums
- thread_name?: string; // Not implemented yet, for webhooks
- avatar_url?: string; // Not implemented yet, for webhooks
-}
-
-// TypeScript complains once this is used above
-export interface PollCreationSchema {
- question: PollMedia;
- answers: PollAnswer[];
- duration?: number;
- allow_multiselect?: boolean;
- layout_type?: number;
-}
diff --git a/src/util/schemas/MessageEditSchema.ts b/src/util/schemas/MessageEditSchema.ts
deleted file mode 100644
index 002e5af..0000000
--- a/src/util/schemas/MessageEditSchema.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-import { MessageCreateSchema } from "./MessageCreateSchema";
-
-export type MessageEditSchema = Omit;
diff --git a/src/util/schemas/MfaCodesSchema.ts b/src/util/schemas/MfaCodesSchema.ts
deleted file mode 100644
index 1f66f08..0000000
--- a/src/util/schemas/MfaCodesSchema.ts
+++ /dev/null
@@ -1,26 +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 .
-*/
-
-export interface MfaCodesSchema {
- /**
- * @minLength 1
- * @maxLength 72
- */
- password: string;
- regenerate?: boolean;
-}
diff --git a/src/util/schemas/ModifyGuildStickerSchema.ts b/src/util/schemas/ModifyGuildStickerSchema.ts
deleted file mode 100644
index 95eb541..0000000
--- a/src/util/schemas/ModifyGuildStickerSchema.ts
+++ /dev/null
@@ -1,33 +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 .
-*/
-
-export interface ModifyGuildStickerSchema {
- /**
- * @minLength 2
- * @maxLength 30
- */
- name: string;
- /**
- * @maxLength 100
- */
- description?: string;
- /**
- * @maxLength 200
- */
- tags: string;
-}
diff --git a/src/util/schemas/PasswordResetSchema.ts b/src/util/schemas/PasswordResetSchema.ts
deleted file mode 100644
index 15489a9..0000000
--- a/src/util/schemas/PasswordResetSchema.ts
+++ /dev/null
@@ -1,26 +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 .
-*/
-
-export interface PasswordResetSchema {
- /**
- * @minLength 1
- * @maxLength 72
- */
- password: string;
- token: string;
-}
diff --git a/src/util/schemas/PreloadMessagesRequestSchema.ts b/src/util/schemas/PreloadMessagesRequestSchema.ts
deleted file mode 100644
index 7c5145b..0000000
--- a/src/util/schemas/PreloadMessagesRequestSchema.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-export interface PreloadMessagesRequestSchema {
- channels: string[];
-}
diff --git a/src/util/schemas/PruneSchema.ts b/src/util/schemas/PruneSchema.ts
deleted file mode 100644
index 88d2f6e..0000000
--- a/src/util/schemas/PruneSchema.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export interface PruneSchema {
- /**
- * @min 0
- */
- days: number;
-}
diff --git a/src/util/schemas/PurgeSchema.ts b/src/util/schemas/PurgeSchema.ts
deleted file mode 100644
index 2e88799..0000000
--- a/src/util/schemas/PurgeSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface PurgeSchema {
- before: string;
- after: string;
-}
diff --git a/src/util/schemas/RefreshUrlsRequestSchema.ts b/src/util/schemas/RefreshUrlsRequestSchema.ts
deleted file mode 100644
index 9c1df54..0000000
--- a/src/util/schemas/RefreshUrlsRequestSchema.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface RefreshUrlsRequestSchema {
- attachment_urls: string[];
-}
diff --git a/src/util/schemas/RegisterSchema.ts b/src/util/schemas/RegisterSchema.ts
deleted file mode 100644
index cfee0f0..0000000
--- a/src/util/schemas/RegisterSchema.ts
+++ /dev/null
@@ -1,48 +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 .
-*/
-
-export interface RegisterSchema {
- /**
- * @minLength 2
- */
- username: string;
- /**
- * @minLength 1
- * @maxLength 72
- */
- password?: string;
- consent: boolean;
- /**
- * @TJS-format email
- */
- email?: string;
- fingerprint?: string;
- invite?: string;
- /**
- * @TJS-type string
- */
- date_of_birth?: Date; // "2000-04-03"
- gift_code_sku_id?: string;
- captcha_key?: string;
-
- promotional_email_opt_in?: boolean;
-
- // part of pomelo
- unique_username_registration?: boolean;
- global_name?: string;
-}
diff --git a/src/util/schemas/RelationshipPostSchema.ts b/src/util/schemas/RelationshipPostSchema.ts
deleted file mode 100644
index 066ecfd..0000000
--- a/src/util/schemas/RelationshipPostSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface RelationshipPostSchema {
- discriminator: string;
- username: string;
-}
diff --git a/src/util/schemas/RelationshipPutSchema.ts b/src/util/schemas/RelationshipPutSchema.ts
deleted file mode 100644
index 36d9877..0000000
--- a/src/util/schemas/RelationshipPutSchema.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-import { RelationshipType } from "@spacebar/util";
-
-export interface RelationshipPutSchema {
- type?: RelationshipType;
-}
diff --git a/src/util/schemas/RequestGuildMembersSchema.ts b/src/util/schemas/RequestGuildMembersSchema.ts
deleted file mode 100644
index 9e60d26..0000000
--- a/src/util/schemas/RequestGuildMembersSchema.ts
+++ /dev/null
@@ -1,35 +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 .
-*/
-
-export interface RequestGuildMembersSchema {
- guild_id: string | [string];
- query?: string;
- limit?: number;
- presences?: boolean;
- user_ids?: string | string[];
- nonce?: string;
-}
-
-export const RequestGuildMembersSchema = {
- guild_id: "" as string | string[],
- $query: String,
- $limit: Number,
- $presences: Boolean,
- $user_ids: [] as string | string[],
- $nonce: String,
-};
diff --git a/src/util/schemas/RoleModifySchema.ts b/src/util/schemas/RoleModifySchema.ts
deleted file mode 100644
index a6d1893..0000000
--- a/src/util/schemas/RoleModifySchema.ts
+++ /dev/null
@@ -1,33 +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 .
-*/
-
-export interface RoleModifySchema {
- name?: string;
- permissions?: string;
- color?: number;
- hoist?: boolean; // whether the role should be displayed separately in the sidebar
- mentionable?: boolean; // whether the role should be mentionable
- position?: number;
- icon?: string;
- unicode_emoji?: string;
- colors?: {
- primary_color: number;
- secondary_color: number | null | undefined; // only used for "holographic" and "gradient" styles
- tertiary_color?: number | null | undefined; // only used for "holographic" style
- } | undefined;
-}
diff --git a/src/util/schemas/RolePositionUpdateSchema.ts b/src/util/schemas/RolePositionUpdateSchema.ts
deleted file mode 100644
index 6bfd7f3..0000000
--- a/src/util/schemas/RolePositionUpdateSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export type RolePositionUpdateSchema = {
- id: string;
- position: number;
-}[];
diff --git a/src/util/schemas/SelectProtocolSchema.ts b/src/util/schemas/SelectProtocolSchema.ts
deleted file mode 100644
index d04adf7..0000000
--- a/src/util/schemas/SelectProtocolSchema.ts
+++ /dev/null
@@ -1,37 +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 .
-*/
-
-export interface SelectProtocolSchema {
- protocol: "webrtc" | "udp";
- data:
- | string
- | {
- address: string;
- port: number;
- mode: string;
- };
- sdp?: string;
- codecs?: {
- name: "opus" | "VP8" | "VP9" | "H264";
- type: "audio" | "video";
- priority: number;
- payload_type: number;
- rtx_payload_type?: number;
- }[];
- rtc_connection_id?: string; // uuid
-}
diff --git a/src/util/schemas/SettingsProtoUpdateSchema.ts b/src/util/schemas/SettingsProtoUpdateSchema.ts
deleted file mode 100644
index 2b930bc..0000000
--- a/src/util/schemas/SettingsProtoUpdateSchema.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-import { JsonValue } from "@protobuf-ts/runtime";
-
-export interface SettingsProtoUpdateSchema {
- settings: string;
- required_data_version?: number;
-}
-
-export interface SettingsProtoUpdateJsonSchema {
- settings: JsonValue;
- required_data_version?: number;
-}
-
-// TODO: these dont work with schema validation
-// typed JSON schemas:
-// export interface SettingsProtoUpdatePreloadedUserSettingsSchema {
-// settings: PreloadedUserSettings;
-// required_data_version?: number;
-// }
-//
-// export interface SettingsProtoUpdateFrecencyUserSettingsSchema {
-// settings: FrecencyUserSettings;
-// required_data_version?: number;
-// }
-
-// TODO: what is this?
-// export interface SettingsProtoUpdateTestSettingsSchema {
-// settings: {};
-// required_data_version?: number;
-// }
\ No newline at end of file
diff --git a/src/util/schemas/StreamCreateSchema.ts b/src/util/schemas/StreamCreateSchema.ts
deleted file mode 100644
index bb65079..0000000
--- a/src/util/schemas/StreamCreateSchema.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export interface StreamCreateSchema {
- type: "guild" | "call";
- channel_id: string;
- guild_id?: string;
- preferred_region?: string;
-}
-
-export const StreamCreateSchema = {
- type: String,
- channel_id: String,
- $guild_id: String,
- $preferred_region: String,
-};
diff --git a/src/util/schemas/StreamDeleteSchema.ts b/src/util/schemas/StreamDeleteSchema.ts
deleted file mode 100644
index 0e2aff7..0000000
--- a/src/util/schemas/StreamDeleteSchema.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export interface StreamDeleteSchema {
- stream_key: string;
-}
-
-export const StreamDeleteSchema = {
- stream_key: String,
-};
diff --git a/src/util/schemas/StreamWatchSchema.ts b/src/util/schemas/StreamWatchSchema.ts
deleted file mode 100644
index 263bb11..0000000
--- a/src/util/schemas/StreamWatchSchema.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export interface StreamWatchSchema {
- stream_key: string;
-}
-
-export const StreamWatchSchema = {
- stream_key: String,
-};
diff --git a/src/util/schemas/TeamCreateSchema.ts b/src/util/schemas/TeamCreateSchema.ts
deleted file mode 100644
index 5903a53..0000000
--- a/src/util/schemas/TeamCreateSchema.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface TeamCreateSchema {
- name: string;
-}
diff --git a/src/util/schemas/TemplateCreateSchema.ts b/src/util/schemas/TemplateCreateSchema.ts
deleted file mode 100644
index 9e562c9..0000000
--- a/src/util/schemas/TemplateCreateSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface TemplateCreateSchema {
- name: string;
- description?: string;
-}
diff --git a/src/util/schemas/TemplateModifySchema.ts b/src/util/schemas/TemplateModifySchema.ts
deleted file mode 100644
index 49b0237..0000000
--- a/src/util/schemas/TemplateModifySchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface TemplateModifySchema {
- name: string;
- description?: string;
-}
diff --git a/src/util/schemas/TotpDisableSchema.ts b/src/util/schemas/TotpDisableSchema.ts
deleted file mode 100644
index 29706f4..0000000
--- a/src/util/schemas/TotpDisableSchema.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface TotpDisableSchema {
- /**
- * @minLength 6
- * @maxLength 6
- */
- code: string;
-}
diff --git a/src/util/schemas/TotpEnableSchema.ts b/src/util/schemas/TotpEnableSchema.ts
deleted file mode 100644
index a80e06a..0000000
--- a/src/util/schemas/TotpEnableSchema.ts
+++ /dev/null
@@ -1,31 +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 .
-*/
-
-export interface TotpEnableSchema {
- /**
- * @minLength 1
- * @maxLength 72
- */
- password: string;
- /**
- * @minLength 6
- * @maxLength 6
- */
- code?: string;
- secret?: string;
-}
diff --git a/src/util/schemas/TotpSchema.ts b/src/util/schemas/TotpSchema.ts
deleted file mode 100644
index 657b7e7..0000000
--- a/src/util/schemas/TotpSchema.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export interface TotpSchema {
- code: string;
- ticket: string;
- gift_code_sku_id?: string | null;
- login_source?: string | null;
-}
diff --git a/src/util/schemas/UploadAttachmentRequestSchema.ts b/src/util/schemas/UploadAttachmentRequestSchema.ts
deleted file mode 100644
index 60bf89f..0000000
--- a/src/util/schemas/UploadAttachmentRequestSchema.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2024 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 .
-*/
-
-
-export interface UploadAttachmentRequestSchema {
- files: UploadAttachmentRequest[];
-}
-
-export interface UploadAttachmentRequest {
- id?: string;
- filename: string;
- file_size: number;
- is_clip?: boolean;
- original_content_type?: string;
-}
diff --git a/src/util/schemas/UserDeleteSchema.ts b/src/util/schemas/UserDeleteSchema.ts
deleted file mode 100644
index 40fb778..0000000
--- a/src/util/schemas/UserDeleteSchema.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface UserDeleteSchema {
- user_id: string;
-}
diff --git a/src/util/schemas/UserGuildSettingsSchema.ts b/src/util/schemas/UserGuildSettingsSchema.ts
deleted file mode 100644
index 82edae9..0000000
--- a/src/util/schemas/UserGuildSettingsSchema.ts
+++ /dev/null
@@ -1,27 +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 .
-*/
-
-import { ChannelOverride, UserGuildSettings } from "@spacebar/util";
-
-// This sucks. I would use a DeepPartial, my own or typeorms, but they both generate inncorect schema
-export interface UserGuildSettingsSchema
- extends Partial> {
- channel_overrides?: {
- [channel_id: string]: ChannelOverride;
- };
-}
diff --git a/src/util/schemas/UserModifySchema.ts b/src/util/schemas/UserModifySchema.ts
deleted file mode 100644
index 6d2998e..0000000
--- a/src/util/schemas/UserModifySchema.ts
+++ /dev/null
@@ -1,52 +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 .
-*/
-
-export interface UserModifySchema {
- /**
- * @minLength 2
- */
- username?: string;
- avatar?: string | null;
- bio?: string;
- accent_color?: number;
- banner?: string | null;
- /**
- * @minLength 1
- * @maxLength 72
- */
- password?: string;
- /**
- * @minLength 1
- * @maxLength 72
- */
- new_password?: string;
- /**
- * @minLength 6
- * @maxLength 6
- */
- code?: string;
- /**
- * @TJS-format email
- */
- email?: string;
- /**
- * @minLength 4
- * @maxLength 4
- */
- discriminator?: string;
-}
diff --git a/src/util/schemas/UserNoteUpdateSchema.ts b/src/util/schemas/UserNoteUpdateSchema.ts
deleted file mode 100644
index 0a73127..0000000
--- a/src/util/schemas/UserNoteUpdateSchema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface UserNoteUpdateSchema {
- note: string;
-}
diff --git a/src/util/schemas/UserProfileModifySchema.ts b/src/util/schemas/UserProfileModifySchema.ts
deleted file mode 100644
index 3dea257..0000000
--- a/src/util/schemas/UserProfileModifySchema.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 .
-*/
-
-export interface UserProfileModifySchema {
- bio?: string;
- accent_color?: number | null;
- banner?: string | null;
- pronouns?: string;
- /**
- * @items.type integer
- */
- theme_colors?: [number, number];
-}
diff --git a/src/util/schemas/UserSettingsSchema.ts b/src/util/schemas/UserSettingsSchema.ts
deleted file mode 100644
index 0d23e75..0000000
--- a/src/util/schemas/UserSettingsSchema.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-import { UserSettings } from "@spacebar/util";
-
-export type UserSettingsSchema = Omit, "index">;
diff --git a/src/util/schemas/Validator.ts b/src/util/schemas/Validator.ts
deleted file mode 100644
index 1d9daf2..0000000
--- a/src/util/schemas/Validator.ts
+++ /dev/null
@@ -1,55 +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 .
-*/
-
-import Ajv from "ajv";
-import addFormats from "ajv-formats";
-import fs from "fs";
-import path from "path";
-
-const SchemaPath = path.join(
- __dirname,
- "..",
- "..",
- "..",
- "assets",
- "schemas.json",
-);
-const schemas = JSON.parse(fs.readFileSync(SchemaPath, { encoding: "utf8" }));
-
-export const ajv = new Ajv({
- allErrors: true,
- parseDate: true,
- allowDate: true,
- schemas,
- coerceTypes: true,
- messages: true,
- strict: true,
- strictRequired: true,
- allowUnionTypes: true,
-});
-
-addFormats(ajv);
-
-export function validateSchema(schema: string, data: G): G {
- const valid = ajv.validate(schema, data);
- if (!valid) {
- console.log("[Validator] Validation error in ", schema)
- throw ajv.errors;
- }
- return data;
-}
diff --git a/src/util/schemas/VanityUrlSchema.ts b/src/util/schemas/VanityUrlSchema.ts
deleted file mode 100644
index 12d5abd..0000000
--- a/src/util/schemas/VanityUrlSchema.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface VanityUrlSchema {
- /**
- * @minLength 1
- * @maxLength 20
- */
- code?: string;
-}
diff --git a/src/util/schemas/VerifyEmailSchema.ts b/src/util/schemas/VerifyEmailSchema.ts
deleted file mode 100644
index ce297c5..0000000
--- a/src/util/schemas/VerifyEmailSchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface VerifyEmailSchema {
- captcha_key?: string | null;
- token: string;
-}
diff --git a/src/util/schemas/VoiceIdentifySchema.ts b/src/util/schemas/VoiceIdentifySchema.ts
deleted file mode 100644
index 82f846c..0000000
--- a/src/util/schemas/VoiceIdentifySchema.ts
+++ /dev/null
@@ -1,31 +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 .
-*/
-
-export interface VoiceIdentifySchema {
- server_id: string;
- user_id: string;
- session_id: string;
- token: string;
- video?: boolean;
- streams?: {
- type: "video" | "audio" | "screen";
- rid: string;
- quality: number;
- }[];
- max_secure_frames_version?: number;
-}
diff --git a/src/util/schemas/VoiceStateUpdateSchema.ts b/src/util/schemas/VoiceStateUpdateSchema.ts
deleted file mode 100644
index fda073e..0000000
--- a/src/util/schemas/VoiceStateUpdateSchema.ts
+++ /dev/null
@@ -1,42 +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 .
-*/
-
-//TODO need more testing when community guild and voice stage channel are working
-export interface VoiceStateUpdateSchema {
- guild_id?: string;
- channel_id?: string;
- self_mute: boolean;
- self_deaf: boolean;
- self_video?: boolean;
- preferred_region?: string;
- request_to_speak_timestamp?: Date;
- suppress?: boolean;
- flags?: number;
-}
-
-export const VoiceStateUpdateSchema = {
- $guild_id: String,
- $channel_id: String,
- self_mute: Boolean,
- self_deaf: Boolean,
- $self_video: Boolean, //required in docs but bots don't always send it
- $preferred_region: String,
- $request_to_speak_timestamp: Date,
- $suppress: Boolean,
- $flags: Number,
-};
diff --git a/src/util/schemas/VoiceVideoSchema.ts b/src/util/schemas/VoiceVideoSchema.ts
deleted file mode 100644
index c621431..0000000
--- a/src/util/schemas/VoiceVideoSchema.ts
+++ /dev/null
@@ -1,35 +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 .
-*/
-
-export interface VoiceVideoSchema {
- audio_ssrc: number;
- video_ssrc: number;
- rtx_ssrc?: number;
- user_id?: string;
- streams?: {
- type: "video" | "audio" | "screen";
- rid: string;
- ssrc: number;
- active: boolean;
- quality: number;
- rtx_ssrc: number;
- max_bitrate: number;
- max_framerate: number;
- max_resolution: { type: string; width: number; height: number };
- }[];
-}
diff --git a/src/util/schemas/WebAuthnSchema.ts b/src/util/schemas/WebAuthnSchema.ts
deleted file mode 100644
index 3f5e0da..0000000
--- a/src/util/schemas/WebAuthnSchema.ts
+++ /dev/null
@@ -1,38 +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 .
-*/
-
-// FIXME: better naming
-export interface GenerateWebAuthnCredentialsSchema {
- password: string;
-}
-
-// FIXME: better naming
-export interface CreateWebAuthnCredentialSchema {
- credential: string;
- name: string;
- ticket: string;
-}
-
-export type WebAuthnPostSchema =
- | GenerateWebAuthnCredentialsSchema
- | CreateWebAuthnCredentialSchema;
-
-export interface WebAuthnTotpSchema {
- code: string;
- ticket: string;
-}
diff --git a/src/util/schemas/WebhookCreateSchema.ts b/src/util/schemas/WebhookCreateSchema.ts
deleted file mode 100644
index 7bd0afa..0000000
--- a/src/util/schemas/WebhookCreateSchema.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface WebhookCreateSchema {
- /**
- * @maxLength 80
- */
- name: string;
- avatar?: string;
-}
diff --git a/src/util/schemas/WebhookExecuteSchema.ts b/src/util/schemas/WebhookExecuteSchema.ts
deleted file mode 100644
index c2617d1..0000000
--- a/src/util/schemas/WebhookExecuteSchema.ts
+++ /dev/null
@@ -1,59 +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 .
-*/
-
-import { Embed } from "../entities";
-import {
- MessageCreateAttachment,
- PollCreationSchema,
-} from "./MessageCreateSchema";
-
-export interface WebhookExecuteSchema {
- content?: string;
- username?: string;
- avatar_url?: string;
- tts?: boolean;
- embeds?: Embed[];
- allowed_mentions?: {
- parse?: string[];
- roles?: string[];
- users?: string[];
- replied_user?: boolean;
- };
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- components?: any[];
- file?: { filename: string };
- payload_json?: string;
- /**
- TODO: we should create an interface for attachments
- TODO: OpenWAAO<-->attachment-style metadata conversion
- **/
- attachments?: MessageCreateAttachment[];
- flags?: number;
- thread_name?: string;
- applied_tags?: string[];
- message_reference?: {
- message_id: string;
- channel_id?: string;
- guild_id?: string;
- fail_if_not_exists?: boolean;
- };
- sticker_ids?: string[];
- nonce?: string;
- enforce_nonce?: boolean; // For Discord compatibility, it's the default behavior here
- poll?: PollCreationSchema;
-}
diff --git a/src/util/schemas/WebhookUpdateSchema.ts b/src/util/schemas/WebhookUpdateSchema.ts
deleted file mode 100755
index bc276e4..0000000
--- a/src/util/schemas/WebhookUpdateSchema.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-export interface WebhookUpdateSchema {
- name?: string;
- avatar?: string;
- channel_id?: string;
-}
diff --git a/src/util/schemas/WidgetModifySchema.ts b/src/util/schemas/WidgetModifySchema.ts
deleted file mode 100644
index 50794d6..0000000
--- a/src/util/schemas/WidgetModifySchema.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface WidgetModifySchema {
- enabled: boolean; // whether the widget is enabled
- channel_id: string; // the widget channel id
-}
diff --git a/src/util/schemas/index.ts b/src/util/schemas/index.ts
deleted file mode 100644
index 3971042..0000000
--- a/src/util/schemas/index.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-export * from "./AckBulkSchema";
-export * from "./ActivitySchema";
-export * from "./ApplicationAuthorizeSchema";
-export * from "./ApplicationCreateSchema";
-export * from "./ApplicationModifySchema";
-export * from "./AutomodRuleSchema";
-export * from "./BackupCodesChallengeSchema";
-export * from "./BanCreateSchema";
-export * from "./BanModeratorSchema";
-export * from "./BanRegistrySchema";
-export * from "./BotModifySchema";
-export * from "./ChannelModifySchema";
-export * from "./ChannelPermissionOverwriteSchema";
-export * from "./ChannelReorderSchema";
-export * from "./CodesVerificationSchema";
-export * from "./ConnectedAccountSchema";
-export * from "./ConnectionCallbackSchema";
-export * from "./ConnectionUpdateSchema";
-export * from "./DmChannelCreateSchema";
-export * from "./EmailDomainLookupSchema";
-export * from "./EmailDomainLookupVerifyCodeSchema";
-export * from "./EmojiCreateSchema";
-export * from "./EmojiModifySchema";
-export * from "./ForgotPasswordSchema";
-export * from "./GatewayPayloadSchema";
-export * from "./GreetRequestSchema";
-export * from "./GuildCreateSchema";
-export * from "./GuildSubscriptionsBulkSchema";
-export * from "./GuildTemplateCreateSchema";
-export * from "./GuildUpdateSchema";
-export * from "./GuildUpdateWelcomeScreenSchema";
-export * from "./HubWaitlistSignupSchema";
-export * from "./IdentifySchema";
-export * from "./InviteCreateSchema";
-export * from "./LazyRequestSchema";
-export * from "./LoginSchema";
-export * from "./MemberChangeProfileSchema";
-export * from "./MemberChangeSchema";
-export * from "./MessageAcknowledgeSchema";
-export * from "./MessageCreateSchema";
-export * from "./MessageEditSchema";
-export * from "./MfaCodesSchema";
-export * from "./ModifyGuildStickerSchema";
-export * from "./PreloadMessagesRequestSchema";
-export * from "./PasswordResetSchema";
-export * from "./PurgeSchema";
-export * from "./RefreshUrlsRequestSchema";
-export * from "./RegisterSchema";
-export * from "./RelationshipPostSchema";
-export * from "./RelationshipPutSchema";
-export * from "./RequestGuildMembersSchema";
-export * from "./responses";
-export * from "./RoleModifySchema";
-export * from "./RolePositionUpdateSchema";
-export * from "./SelectProtocolSchema";
-export * from "./SettingsProtoUpdateSchema";
-export * from "./StreamCreateSchema";
-export * from "./StreamDeleteSchema";
-export * from "./StreamWatchSchema";
-export * from "./TeamCreateSchema";
-export * from "./TemplateCreateSchema";
-export * from "./TemplateModifySchema";
-export * from "./TotpDisableSchema";
-export * from "./TotpEnableSchema";
-export * from "./TotpSchema";
-export * from "./UploadAttachmentRequestSchema";
-export * from "./UserDeleteSchema";
-export * from "./UserGuildSettingsSchema";
-export * from "./UserModifySchema";
-export * from "./UserNoteUpdateSchema";
-export * from "./UserProfileModifySchema";
-export * from "./UserSettingsSchema";
-export * from "./Validator";
-export * from "./VanityUrlSchema";
-export * from "./VoiceIdentifySchema";
-export * from "./VoiceStateUpdateSchema";
-export * from "./VoiceVideoSchema";
-export * from "./WebAuthnSchema";
-export * from "./WebhookCreateSchema";
-export * from "./WebhookExecuteSchema";
-export * from "./WebhookUpdateSchema";
-export * from "./WidgetModifySchema";
diff --git a/src/util/schemas/responses/APIErrorOrCaptchaResponse.ts b/src/util/schemas/responses/APIErrorOrCaptchaResponse.ts
deleted file mode 100644
index fd89a47..0000000
--- a/src/util/schemas/responses/APIErrorOrCaptchaResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-import { APIErrorResponse } from "./APIErrorResponse";
-import { CaptchaRequiredResponse } from "./CaptchaRequiredResponse";
-
-export type APIErrorOrCaptchaResponse =
- | CaptchaRequiredResponse
- | APIErrorResponse;
diff --git a/src/util/schemas/responses/APIErrorResponse.ts b/src/util/schemas/responses/APIErrorResponse.ts
deleted file mode 100644
index 547ee58..0000000
--- a/src/util/schemas/responses/APIErrorResponse.ts
+++ /dev/null
@@ -1,30 +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 .
-*/
-
-export interface APIErrorResponse {
- code: number;
- message: string;
- errors: {
- [key: string]: {
- _errors: {
- message: string;
- code: string;
- }[];
- };
- };
-}
diff --git a/src/util/schemas/responses/AccountStandingResponse.ts b/src/util/schemas/responses/AccountStandingResponse.ts
deleted file mode 100644
index 9315a32..0000000
--- a/src/util/schemas/responses/AccountStandingResponse.ts
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-import { Attachment } from "../../entities";
-
-export enum AccountStandingState {
- ALL_GOOD = 100,
- LIMITED = 200,
- VERY_LIMITED = 300,
- AT_RISK = 400,
- SUSPENDED = 500,
-}
-
-export enum AppealEligibility {
- DSA_ELIGIBLE = 1,
- IN_APP_ELIGIBLE = 2,
- AGE_VERIFY_ELIGIBLE = 3,
-}
-
-export enum ClassificationType {
- UNKNOWN = 1,
- UNSOLICITED_PORNOGRAPHY = 100,
- NONCONSENSUAL_PORNOGRAPHY = 200,
- GLORIFYING_VIOLENCE = 210,
- HATE_SPEECH = 220,
- CRACKED_ACCOUNTS = 230,
- ILLICIT_GOODS = 240,
- SOCIAL_ENGINEERING = 250,
- CHILD_SAFETY = 280,
- HARRASMENT_AND_BULLYING = 290,
- HARRASMENT_AND_BULLYING_2 = 310,
- HATEFUL_CONDUCT = 320,
- HARRASMENT_AND_BULLYING_3 = 390,
- CHILD_SAFETY_2 = 600,
- CHILD_SAFETY_3 = 650,
- IMPERSONATION = 711,
- BAN_EVASION = 720,
- MALICIOUS_CONDUCT = 3010,
- SPAM = 3030,
- NONCONSENSUAL_ADULT_CONTENT = 4000,
- FRAUD = 4010,
- DOXXING_GUILD_OWNER = 4130,
- COPYRIGHT_INFRINGEMENT_GUILD_OWNER = 4140,
- CHILD_SAFETY_4 = 5010,
- CHILD_SELF_ENDANGERMENT = 5090,
- DOXXING_GUILD_MEMBER = 5305,
- UNDERAGE = 5411,
- COPYRIGHT_INFRINGEMENT_GUILD_MEMBER = 5440,
- COPYRIGHT_INFRINGEMENT_3 = 5485,
-}
-
-export enum AppealIngestionType {
- WEBFORM = 0,
- AGE_VERIFY = 1,
- IN_APP = 2,
-}
-
-export enum ClassificationActionType {
- BAN = 0,
- TEMP_BAN = 1,
- GLOBAL_QUARANTINE = 2,
- REQUIRE_VERIFICATION = 3,
- USER_WARNING = 4,
- USER_SPAMMER = 5,
- CHANNEL_SPAM = 6,
- MESSAGE_SPAM = 7,
- DISABLE_SUSPICIOUS_ACTIVITY = 8,
- LIMITED_ACCESS = 9,
- CHANNEL_SCHEDULE_DELETE = 10,
- MESSAGE_CONTENT_REMOVAL = 11,
- GUILD_DISABLE_INVITE = 12,
- USER_CONTENT_REMOVAL = 13,
- USER_USERNAME_MANGLED = 14,
- GUILD_LIMITED_ACCESS = 15,
- USER_MESSAGE_REMOVAL = 16,
- GUILD_DELETE = 20,
- USER_PROFILE_MANGLED = 22,
-}
-
-export interface ClassificationAction {
- id: string;
- action_type: ClassificationActionType;
- descriptions: string[];
-}
-
-export enum AppealStatusValue {
- REVIEW_PENDING = 1,
- CLASSIFICATION_UPHELD = 2,
- CLASSIFICATION_INVALIDATED = 3,
-}
-
-export interface AppealStatus {
- status: AppealStatusValue;
-}
-
-// why is this just a reduced message?
-export interface FlaggedContent {
- type: "message";
- id: string;
- content: string;
- attachments: Attachment[];
-}
-
-export interface Classification {
- id: string;
- classification_type: ClassificationType;
- description: string;
- explainer_link: string;
- actions: ClassificationAction[];
- max_expiration_time: string; // ISO 8601 timestamp
- flagged_content: unknown[]; // TODO
- appeal_status: AppealStatus;
- is_coppa: boolean;
- is_spam: boolean;
- appeal_ingestion_type: AppealIngestionType;
-}
-
-export enum GuildMemberType {
- OWNER = 1,
- MEMBER = 2
-}
-
-export interface GuildMetadata {
- name: string;
- icon?: string;
- member_type: GuildMemberType;
-}
-
-export interface GuildClassification extends Classification {
- guild_metadata: GuildMetadata;
-}
-
-export interface AccountStandingResponse {
- classifications: Classification[];
- guild_classifications: GuildClassification[];
- account_standing: {
- state: AccountStandingState;
- };
- is_dsa_eligible: boolean;
- username: string;
- discriminator: string; // Not sure if this is even valid, we don't have any examples of pre-pomelo users
- is_appeal_eligible: boolean;
- appeal_eligibility: AppealEligibility[];
-}
diff --git a/src/util/schemas/responses/BackupCodesChallengeResponse.ts b/src/util/schemas/responses/BackupCodesChallengeResponse.ts
deleted file mode 100644
index b587845..0000000
--- a/src/util/schemas/responses/BackupCodesChallengeResponse.ts
+++ /dev/null
@@ -1,22 +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 .
-*/
-
-export interface BackupCodesChallengeResponse {
- nonce: string;
- regenerate_nonce: string;
-}
diff --git a/src/util/schemas/responses/CaptchaRequiredResponse.ts b/src/util/schemas/responses/CaptchaRequiredResponse.ts
deleted file mode 100644
index a58e605..0000000
--- a/src/util/schemas/responses/CaptchaRequiredResponse.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-export interface CaptchaRequiredResponse {
- captcha_key: string;
- captcha_sitekey: string;
- captcha_service: string;
-}
diff --git a/src/util/schemas/responses/CollectiblesCategoriesResponse.ts b/src/util/schemas/responses/CollectiblesCategoriesResponse.ts
deleted file mode 100644
index 57dbf47..0000000
--- a/src/util/schemas/responses/CollectiblesCategoriesResponse.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-import { StringStringDictionary } from "../../util";
-
-// TODO: Clean up
-export type CollectiblesCategoriesResponse = CollectiblesCategoryItem[];
-
-export interface CollectiblesCategoryStyle {
- background_colors: number[];
- button_colors: number[];
- confetti_colors: number[];
-}
-
-export interface CollectiblesCategoryItem {
- sku_id: string;
- name: string;
- summary: string;
- store_listing_id: string;
- banner: string;
- unpublished_at: string | null;
- styles: CollectiblesCategoryStyle;
- logo: string;
- hero_ranking: string[] | null;
- mobile_bg: string | null;
- pdp_bg: string | null;
- success_modal_bg: string | null;
- mobile_banner: string | null;
- featured_block: string | null;
- hero_banner: string | null;
- wide_banner: string | null;
- hero_logo: string | null;
- products: CollectiblesCategoryProductItem[];
- banner_asset?: StaticAnimatedAsset;
- hero_banner_asset?: StaticAnimatedAsset;
-}
-
-export interface StaticAnimatedAsset {
- // CDN URLs
- animated: string | null;
- static: string;
-}
-
-export interface CollectiblesCategoryProductItem {
- sku_id: string;
- name: string;
- summary: string;
- store_listing_id: string;
- banner: string;
- unpublished_at: string | null;
- styles: CollectiblesCategoryStyle;
- prices: PriceMap;
- items: ProductItem[];
- type: number;
- premium_type: number;
- category_sku_id: string;
- google_sku_ids: StringStringDictionary;
- variants?: ProductItemVariant[];
-}
-
-export interface ProductItemVariant {
- sku_id: string;
- name: string;
- name_localizations: null;
- summary: string;
- summary_localizations: null;
- store_listing_id: string;
- banner?: string;
- unpublished_at?: string | null;
- styles?: CollectiblesCategoryStyle;
- prices: PriceMap;
- items: ProductItem[];
- type: number;
- premium_type: number;
- category_sku_id: string;
- google_sku_ids?: StringStringDictionary;
- base_variant_sku_id: string;
- base_variant_name: string;
- variant_label: string;
- variant_value: string; // hex string
-}
-
-export interface ProductItem {
- type: number;
- id: string;
- sku_id: string;
- asset?: string;
- label?: string;
- palette?: string;
-}
-
-export type PriceMap = {
- [key: string]: { country_prices: CountryPrice };
-};
-
-export interface CountryPrice {
- country_code: string;
- prices: PriceEntry[];
-}
-
-export interface PriceEntry {
- amount: number;
- currency: string;
- exponent: number;
-}
diff --git a/src/util/schemas/responses/CollectiblesMarketingResponse.ts b/src/util/schemas/responses/CollectiblesMarketingResponse.ts
deleted file mode 100644
index 5fda976..0000000
--- a/src/util/schemas/responses/CollectiblesMarketingResponse.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-export class CollectiblesMarketingResponse {
- marketings: {
- [key: string]: CollectiblesMarketingItem;
- };
-}
-
-export class CollectiblesMarketingItem {
- type: number;
- version: number;
- title: string;
- body: string;
-}
-
-export class AvatarDecorationMarketingItem extends CollectiblesMarketingItem {
- declare type: 0;
- // CDN URL to the avatar decoration
- avatar: string;
- // Asset IDs
- decorations: string[];
- dismissible_content: number; // Is this a generic property?
- ref_target_background: RefTargetBackground;
-}
-
-export class NameplateMarketingItem extends CollectiblesMarketingItem {
- declare type: 2;
- asset: string;
- popout_asset: string;
-}
-
-export class TargetBackgroundReference {
- light: string | null;
- dark: string | null;
-}
-export class TargetBackgroundReferenceInteraction {
- resting: TargetBackgroundReference;
- hovered: TargetBackgroundReference;
-}
-
-export class RefTargetBackground {
- style: TargetBackgroundReferenceInteraction;
- asset: TargetBackgroundReferenceInteraction;
-}
diff --git a/src/util/schemas/responses/CollectiblesShopResponse.ts b/src/util/schemas/responses/CollectiblesShopResponse.ts
deleted file mode 100644
index f168776..0000000
--- a/src/util/schemas/responses/CollectiblesShopResponse.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-import { CollectiblesCategoryItem, StaticAnimatedAsset } from "./CollectiblesCategoriesResponse";
-
-export interface CollectiblesShopResponse {
- shop_blocks: AnyShopBlock[];
- categories: CollectiblesCategoryItem[];
-}
-
-export type AnyShopBlock = ItemRowShopBlock | BundleTileRowShopBlock | ItemCollectionShopBlock;
-
-export interface BaseShopBlock {
- type: number;
-}
-
-export interface ItemRowShopBlock extends BaseShopBlock {
- type: 0;
- category_sku_id: string;
- name: string;
- category_store_listing_id: string;
- banner_asset: StaticAnimatedAsset;
- logo_url: string;
- unpublished_at: string | null;
- summary: string;
- ranked_sku_ids: string[];
-}
-
-export interface BundleTileRowShopBlock extends BaseShopBlock {
- type: 1;
- subblocks: ShopBlockSubBlock[];
-}
-
-export interface ShopBlockSubBlock {
- type: number;
- category_store_listing_id: string;
- name: string;
- unpublished_at: string | null;
- banner_url: string;
- body_text: string | null;
- banner_text_color: number | null;
-}
-
-export interface ItemCollectionShopBlock extends BaseShopBlock {
- type: 2;
- ranked_sku_ids: string[];
- sorted_sku_ids: {
- recommended: string[] | null;
- popular: string[];
- };
-}
diff --git a/src/util/schemas/responses/DiscoverableGuildsResponse.ts b/src/util/schemas/responses/DiscoverableGuildsResponse.ts
deleted file mode 100644
index dc47590..0000000
--- a/src/util/schemas/responses/DiscoverableGuildsResponse.ts
+++ /dev/null
@@ -1,26 +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 .
-*/
-
-import { Guild } from "../../entities";
-
-export interface DiscoverableGuildsResponse {
- total: number;
- guilds: Guild[];
- offset: number;
- limit: number;
-}
diff --git a/src/util/schemas/responses/DmMessagesResponseSchema.ts b/src/util/schemas/responses/DmMessagesResponseSchema.ts
deleted file mode 100644
index 8bce6e6..0000000
--- a/src/util/schemas/responses/DmMessagesResponseSchema.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-import { PartialMessage } from "@spacebar/util";
-
-export type DmMessagesResponseSchema = PartialMessage[];
diff --git a/src/util/schemas/responses/EmailDomainLookupResponse.ts b/src/util/schemas/responses/EmailDomainLookupResponse.ts
deleted file mode 100644
index dc7faa6..0000000
--- a/src/util/schemas/responses/EmailDomainLookupResponse.ts
+++ /dev/null
@@ -1,27 +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 .
-*/
-export interface HubGuild {
- icon: string;
- id: string;
- name: string;
-}
-
-export interface EmailDomainLookupResponse {
- guilds_info: HubGuild[];
- has_matching_guild: boolean;
-}
diff --git a/src/util/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts b/src/util/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts
deleted file mode 100644
index 1fcfba3..0000000
--- a/src/util/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-import { Guild } from "../../entities";
-
-export interface EmailDomainLookupVerifyCodeResponse {
- guild: Guild;
- joined: boolean;
-}
diff --git a/src/util/schemas/responses/EmojiSourceResponse.ts b/src/util/schemas/responses/EmojiSourceResponse.ts
deleted file mode 100644
index 6eeebb3..0000000
--- a/src/util/schemas/responses/EmojiSourceResponse.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-import { Emoji } from "@spacebar/util";
-
-export interface EmojiSourceResponse {
- type: "GUILD" | "APPLICATION";
- guild?: EmojiGuild | null;
- application?: EmojiApplication | null;
-}
-
-// keep in sync with
-export interface EmojiGuild {
- id: string;
- name: string;
- icon?: string | null;
- description?: string | null;
- features: string[];
- emojis: Emoji[];
- premium_tier: number;
- premium_subscription_count?: number;
- approximate_member_count?: number;
- approximate_presence_count?: number;
-}
-
-export interface EmojiApplication {
- id: string;
- name: string;
-}
diff --git a/src/util/schemas/responses/GatewayBotResponse.ts b/src/util/schemas/responses/GatewayBotResponse.ts
deleted file mode 100644
index c68ec09..0000000
--- a/src/util/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 .
-*/
-
-export interface GatewayBotResponse {
- url: string;
- shards: number;
- session_start_limit: {
- total: number;
- remaining: number;
- reset_after: number;
- max_concurrency: number;
- };
-}
diff --git a/src/util/schemas/responses/GatewayResponse.ts b/src/util/schemas/responses/GatewayResponse.ts
deleted file mode 100644
index 5b771ed..0000000
--- a/src/util/schemas/responses/GatewayResponse.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface GatewayResponse {
- url: string;
-}
diff --git a/src/util/schemas/responses/GenerateRegistrationTokensResponse.ts b/src/util/schemas/responses/GenerateRegistrationTokensResponse.ts
deleted file mode 100644
index 4931eb5..0000000
--- a/src/util/schemas/responses/GenerateRegistrationTokensResponse.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface GenerateRegistrationTokensResponse {
- tokens: string[];
-}
diff --git a/src/util/schemas/responses/GuildBansResponse.ts b/src/util/schemas/responses/GuildBansResponse.ts
deleted file mode 100644
index 91011d5..0000000
--- a/src/util/schemas/responses/GuildBansResponse.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 .
-*/
-
-export interface GuildBansResponse {
- reason: string | null;
- user: {
- username: string;
- discriminator: string;
- id: string;
- avatar: string | null;
- public_flags: number;
- };
-}
diff --git a/src/util/schemas/responses/GuildCreateResponse.ts b/src/util/schemas/responses/GuildCreateResponse.ts
deleted file mode 100644
index 50f5f2f..0000000
--- a/src/util/schemas/responses/GuildCreateResponse.ts
+++ /dev/null
@@ -1,42 +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 .
-*/
-
-import { GuildUpdateSchema, GuildWelcomeScreen } from "@spacebar/util";
-
-export interface GuildCreateResponse extends Omit {
- id: string;
- name: string;
- primary_category_id: string | undefined;
- large: boolean | undefined;
- max_members: number | undefined;
- max_presences: number | undefined;
- max_video_channel_users: number | undefined;
- member_count: number | undefined;
- presence_count: number | undefined;
- template_id: string | undefined;
- mfa_level: number | undefined;
- owner_id: string | undefined;
- premium_subscription_count: number | undefined;
- premium_tier: number | undefined;
- welcome_screen: GuildWelcomeScreen;
- widget_channel_id: string | undefined;
- widget_enabled: boolean;
- nsfw_level: number | undefined;
- nsfw: boolean;
- parent: string | undefined;
-}
diff --git a/src/util/schemas/responses/GuildDiscoveryRequirements.ts b/src/util/schemas/responses/GuildDiscoveryRequirements.ts
deleted file mode 100644
index 1c1ea0a..0000000
--- a/src/util/schemas/responses/GuildDiscoveryRequirements.ts
+++ /dev/null
@@ -1,41 +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 .
-*/
-
-export interface GuildDiscoveryRequirementsResponse {
- uild_id: string;
- safe_environment: boolean;
- healthy: boolean;
- health_score_pending: boolean;
- size: boolean;
- nsfw_properties: unknown;
- protected: boolean;
- sufficient: boolean;
- sufficient_without_grace_period: boolean;
- valid_rules_channel: boolean;
- retention_healthy: boolean;
- engagement_healthy: boolean;
- age: boolean;
- minimum_age: number;
- health_score: {
- avg_nonnew_participators: number;
- avg_nonnew_communicators: number;
- num_intentful_joiners: number;
- perc_ret_w1_intentful: number;
- };
- minimum_size: number;
-}
diff --git a/src/util/schemas/responses/GuildMessagesSearchResponse.ts b/src/util/schemas/responses/GuildMessagesSearchResponse.ts
deleted file mode 100644
index ec41965..0000000
--- a/src/util/schemas/responses/GuildMessagesSearchResponse.ts
+++ /dev/null
@@ -1,53 +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 .
-*/
-
-import {
- ActionRowComponent,
- Attachment,
- Embed,
- MessageType,
- Poll,
- PublicUser,
- Role,
-} from "../../entities";
-
-export interface GuildMessagesSearchMessage {
- id: string;
- type: MessageType;
- content?: string;
- channel_id: string;
- author: PublicUser;
- attachments: Attachment[];
- embeds: Embed[];
- mentions: PublicUser[];
- mention_roles: Role[];
- pinned: boolean;
- mention_everyone?: boolean;
- tts: boolean;
- timestamp: string;
- edited_timestamp: string | null;
- flags: number;
- components: ActionRowComponent[];
- poll: Poll;
- hit: true;
-}
-
-export interface GuildMessagesSearchResponse {
- messages: GuildMessagesSearchMessage[];
- total_results: number;
-}
diff --git a/src/util/schemas/responses/GuildProfileResponse.ts b/src/util/schemas/responses/GuildProfileResponse.ts
deleted file mode 100644
index 58e4b48..0000000
--- a/src/util/schemas/responses/GuildProfileResponse.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-export interface GuildProfileResponse {
- id: string;
- name: string;
- icon_hash: string | null;
- member_count: number;
- online_count: number;
- description: string;
- brand_color_primary: string;
- banner_hash: string | null;
- game_application_ids: string[];
- game_activity: {[id: string]: GameActivity};
- tag: string | null;
- badge: GuildBadgeType;
- badge_color_primary: string;
- badge_color_secondary: string;
- badge_hash: string;
- traits: GuildTrait[];
- features: string[];
- visibility: GuildVisibilityLevel;
- custom_banner_hash: string | null;
- premium_subscription_count: number;
- premium_tier: number;
-}
-
-export interface GameActivity {
- activity_level: number;
- activity_score: number;
-}
-
-export interface GuildTrait {
- emoji_id: string | null;
- emoji_name: string | null;
- emoji_animated: boolean;
- label: string;
- position: number;
-}
-
-// TODO: move
-export enum GuildVisibilityLevel {
- PUBLIC = 1,
- RESTRICTED = 2,
- PUBLIC_WITH_RECRUITMENT = 3
-}
-
-export enum GuildBadgeType {
- SWORD = 0,
- WATER_DROP = 1,
- SKULL = 2,
- TOADSTOOL = 3,
- MOON = 4,
- LIGHTNING = 5,
- LEAF = 6,
- HEART = 7,
- FIRE = 8,
- COMPASS = 9,
- CROSSHAIRS = 10,
- FLOWER = 11,
- FORCE = 12,
- GEM = 13,
- LAVA = 14,
- PSYCHIC = 15,
- SMOKE = 16,
- SNOW = 17,
- SOUND = 18,
- SUN = 19,
- WIND = 20,
- BUNNY = 21,
- DOG = 22,
- FROG = 23,
- GOAT = 24,
- CAT = 25,
- DIAMOND = 26,
- CROWN = 27,
- TROPHY = 28,
- MONEY_BAG = 29,
- DOLLAR_SIGN = 30,
-}
-
diff --git a/src/util/schemas/responses/GuildPruneResponse.ts b/src/util/schemas/responses/GuildPruneResponse.ts
deleted file mode 100644
index 2a24ef6..0000000
--- a/src/util/schemas/responses/GuildPruneResponse.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface GuildPruneResponse {
- pruned: number;
-}
-
-export interface GuildPurgeResponse {
- purged: number;
-}
diff --git a/src/util/schemas/responses/GuildRecommendationsResponse.ts b/src/util/schemas/responses/GuildRecommendationsResponse.ts
deleted file mode 100644
index db67ff6..0000000
--- a/src/util/schemas/responses/GuildRecommendationsResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-import { Guild } from "../../entities";
-
-export interface GuildRecommendationsResponse {
- recommended_guilds: Guild[];
- load_id: string;
-}
diff --git a/src/util/schemas/responses/GuildVanityUrl.ts b/src/util/schemas/responses/GuildVanityUrl.ts
deleted file mode 100644
index c6595a6..0000000
--- a/src/util/schemas/responses/GuildVanityUrl.ts
+++ /dev/null
@@ -1,35 +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 .
-*/
-
-export interface GuildVanityUrl {
- code: string;
- uses: number;
-}
-
-export interface GuildVanityUrlNoInvite {
- code: null;
-}
-
-export type GuildVanityUrlResponse =
- | GuildVanityUrl
- | GuildVanityUrl[]
- | GuildVanityUrlNoInvite;
-
-export interface GuildVanityUrlCreateResponse {
- code: string;
-}
diff --git a/src/util/schemas/responses/GuildVoiceRegionsResponse.ts b/src/util/schemas/responses/GuildVoiceRegionsResponse.ts
deleted file mode 100644
index 63a77f8..0000000
--- a/src/util/schemas/responses/GuildVoiceRegionsResponse.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-
-export interface GuildVoiceRegion {
- id: string;
- name: string;
- custom: boolean;
- deprecated: boolean;
- optimal: boolean;
-}
diff --git a/src/util/schemas/responses/GuildWidgetJsonResponse.ts b/src/util/schemas/responses/GuildWidgetJsonResponse.ts
deleted file mode 100644
index bd69230..0000000
--- a/src/util/schemas/responses/GuildWidgetJsonResponse.ts
+++ /dev/null
@@ -1,39 +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 .
-*/
-
-import { ClientStatus } from "@spacebar/util";
-
-export interface GuildWidgetJsonResponse {
- id: string;
- name: string;
- instant_invite: string;
- channels: {
- id: string;
- name: string;
- position: number;
- }[];
- members: {
- id: string;
- username: string;
- discriminator: string;
- avatar: string | null;
- status: ClientStatus;
- avatar_url: string;
- }[];
- presence_count: number;
-}
diff --git a/src/util/schemas/responses/GuildWidgetSettingsResponse.ts b/src/util/schemas/responses/GuildWidgetSettingsResponse.ts
deleted file mode 100644
index 6ffc771..0000000
--- a/src/util/schemas/responses/GuildWidgetSettingsResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-import { Snowflake } from "@spacebar/util";
-
-export interface GuildWidgetSettingsResponse {
- enabled: boolean;
- channel_id: Snowflake | null;
-}
diff --git a/src/util/schemas/responses/HubDirectoryEntriesResponse.ts b/src/util/schemas/responses/HubDirectoryEntriesResponse.ts
deleted file mode 100644
index 9aaadfe..0000000
--- a/src/util/schemas/responses/HubDirectoryEntriesResponse.ts
+++ /dev/null
@@ -1,31 +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 .
-*/
-
-import { Guild } from "../../entities";
-
-export interface HubDirectoryEntry {
- author_id: string;
- created_at: string;
- description: string;
- directory_channel_id: string;
- guild: Guild;
- primary_category_id: number;
- type: number; // TODO: not exactly sure what this is, channel type?
-}
-
-export type HubDirectoryEntriesResponse = HubDirectoryEntry[];
diff --git a/src/util/schemas/responses/HubWaitlistSignupResponse.ts b/src/util/schemas/responses/HubWaitlistSignupResponse.ts
deleted file mode 100644
index bd11df2..0000000
--- a/src/util/schemas/responses/HubWaitlistSignupResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export interface HubWaitlistSignupResponse {
- email: string;
- email_domain: string;
- school: string;
- user_id: string;
-}
diff --git a/src/util/schemas/responses/InstanceDomainsResponse.ts b/src/util/schemas/responses/InstanceDomainsResponse.ts
deleted file mode 100644
index 0be3682..0000000
--- a/src/util/schemas/responses/InstanceDomainsResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export interface InstanceDomainsResponse {
- cdn: string;
- gateway: string;
- defaultApiVersion: string;
- apiEndpoint: string;
-}
diff --git a/src/util/schemas/responses/InstancePingResponse.ts b/src/util/schemas/responses/InstancePingResponse.ts
deleted file mode 100644
index 4ff3950..0000000
--- a/src/util/schemas/responses/InstancePingResponse.ts
+++ /dev/null
@@ -1,31 +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 .
-*/
-
-export interface InstancePingResponse {
- ping: "pong!";
- instance: {
- id: string;
- name: string;
- description: string | null;
- image: string | null;
- correspondenceEmail: string | null;
- correspondenceUserID: string | null;
- frontPage: string | null;
- tosPage: string | null;
- };
-}
diff --git a/src/util/schemas/responses/InstanceStatsResponse.ts b/src/util/schemas/responses/InstanceStatsResponse.ts
deleted file mode 100644
index 60541f0..0000000
--- a/src/util/schemas/responses/InstanceStatsResponse.ts
+++ /dev/null
@@ -1,26 +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 .
-*/
-
-export interface InstanceStatsResponse {
- counts: {
- user: number;
- guild: number;
- message: number;
- members: number;
- };
-}
diff --git a/src/util/schemas/responses/LocationMetadataResponse.ts b/src/util/schemas/responses/LocationMetadataResponse.ts
deleted file mode 100644
index 2a7ca9b..0000000
--- a/src/util/schemas/responses/LocationMetadataResponse.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-export interface LocationMetadataResponse {
- consent_required: boolean;
- country_code: string;
- promotional_email_opt_in: { required: true; pre_checked: false };
-}
diff --git a/src/util/schemas/responses/MemberJoinGuildResponse.ts b/src/util/schemas/responses/MemberJoinGuildResponse.ts
deleted file mode 100644
index 67d2de0..0000000
--- a/src/util/schemas/responses/MemberJoinGuildResponse.ts
+++ /dev/null
@@ -1,27 +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 .
-*/
-
-import { GuildCreateResponse } from "@spacebar/util";
-import { Emoji, Role, Sticker } from "../../entities";
-
-export interface MemberJoinGuildResponse {
- guild: GuildCreateResponse;
- emojis: Emoji[];
- roles: Role[];
- stickers: Sticker[];
-}
diff --git a/src/util/schemas/responses/OAuthAuthorizeResponse.ts b/src/util/schemas/responses/OAuthAuthorizeResponse.ts
deleted file mode 100644
index ba81f94..0000000
--- a/src/util/schemas/responses/OAuthAuthorizeResponse.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-export interface OAuthAuthorizeResponse {
- location: string;
-}
diff --git a/src/util/schemas/responses/PreloadMessagesResponseSchema.ts b/src/util/schemas/responses/PreloadMessagesResponseSchema.ts
deleted file mode 100644
index 9452896..0000000
--- a/src/util/schemas/responses/PreloadMessagesResponseSchema.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-import { Message } from "@spacebar/util";
-
-export type PreloadMessagesResponseSchema = Message[];
\ No newline at end of file
diff --git a/src/util/schemas/responses/RefreshUrlsResponse.ts b/src/util/schemas/responses/RefreshUrlsResponse.ts
deleted file mode 100644
index b08efaa..0000000
--- a/src/util/schemas/responses/RefreshUrlsResponse.ts
+++ /dev/null
@@ -1,26 +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 .
-*/
-
-export interface RefreshedUrl {
- original: string;
- refreshed: string;
-}
-
-export interface RefreshUrlsResponse {
- refreshed_urls: RefreshedUrl[];
-}
diff --git a/src/util/schemas/responses/SettingsProtoUpdateResponse.ts b/src/util/schemas/responses/SettingsProtoUpdateResponse.ts
deleted file mode 100644
index 42f8621..0000000
--- a/src/util/schemas/responses/SettingsProtoUpdateResponse.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-import { JsonValue } from "@protobuf-ts/runtime";
-
-export interface SettingsProtoResponse {
- settings: string;
-}
-
-export interface SettingsProtoUpdateResponse extends SettingsProtoResponse {
- out_of_date?: boolean;
-}
-
-export interface SettingsProtoJsonResponse {
- settings: JsonValue;
-}
-
-export interface SettingsProtoUpdateJsonResponse extends SettingsProtoJsonResponse {
- out_of_date?: boolean;
-}
-
-// TODO: these dont work with schemas validation
-// Typed JSON schemas:
-// export interface SettingsProtoUpdatePreloadedUserSettingsJsonResponse {
-// settings: PreloadedUserSettings;
-// out_of_date?: boolean;
-// }
-//
-// export interface SettingsProtoUpdateFrecencyUserSettingsJsonResponse {
-// settings: FrecencyUserSettings;
-// out_of_date?: boolean;
-// }
-
-// TODO: what is this?
-// export interface SettingsProtoUpdateTestSettingsJsonResponse {
-// settings: {};
-// out_of_date?: boolean;
-// }
diff --git a/src/util/schemas/responses/TeamListResponse.ts b/src/util/schemas/responses/TeamListResponse.ts
deleted file mode 100644
index e4e8284..0000000
--- a/src/util/schemas/responses/TeamListResponse.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-
-import { Team } from "@spacebar/util";
-
-export type TeamListResponse = Team[];
diff --git a/src/util/schemas/responses/Tenor.ts b/src/util/schemas/responses/Tenor.ts
deleted file mode 100644
index 5af229e..0000000
--- a/src/util/schemas/responses/Tenor.ts
+++ /dev/null
@@ -1,90 +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 .
-*/
-
-export enum TenorMediaTypes {
- gif,
- mediumgif,
- tinygif,
- nanogif,
- mp4,
- loopedmp4,
- tinymp4,
- nanomp4,
- webm,
- tinywebm,
- nanowebm,
-}
-
-export type TenorMedia = {
- preview: string;
- url: string;
- dims: number[];
- size: number;
-};
-
-export type TenorGif = {
- created: number;
- hasaudio: boolean;
- id: string;
- media: { [type in keyof typeof TenorMediaTypes]: TenorMedia }[];
- tags: string[];
- title: string;
- itemurl: string;
- hascaption: boolean;
- url: string;
-};
-
-export type TenorCategory = {
- searchterm: string;
- path: string;
- image: string;
- name: string;
-};
-
-export type TenorCategoriesResults = {
- tags: TenorCategory[];
-};
-
-export type TenorTrendingResults = {
- next: string;
- results: TenorGif[];
- locale: string;
-};
-
-export type TenorSearchResults = {
- next: string;
- results: TenorGif[];
-};
-
-export interface TenorGifResponse {
- id: string;
- title: string;
- url: string;
- src: string;
- gif_src: string;
- width: number;
- height: number;
- preview: string;
-}
-
-export interface TenorTrendingResponse {
- categories: TenorCategoriesResults;
- gifs: TenorGifResponse[];
-}
-
-export type TenorGifsResponse = TenorGifResponse[];
diff --git a/src/util/schemas/responses/TokenResponse.ts b/src/util/schemas/responses/TokenResponse.ts
deleted file mode 100644
index bc13605..0000000
--- a/src/util/schemas/responses/TokenResponse.ts
+++ /dev/null
@@ -1,33 +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 .
-*/
-
-import { BackupCode, UserSettings } from "../../entities";
-
-export interface TokenResponse {
- token: string;
- settings: UserSettings;
-}
-
-export interface TokenOnlyResponse {
- token: string;
-}
-
-export interface TokenWithBackupCodesResponse {
- token: string;
- backup_codes: BackupCode[];
-}
diff --git a/src/util/schemas/responses/TypedResponses.ts b/src/util/schemas/responses/TypedResponses.ts
deleted file mode 100644
index bc20450..0000000
--- a/src/util/schemas/responses/TypedResponses.ts
+++ /dev/null
@@ -1,116 +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 .
-*/
-
-import { GuildBansResponse, GuildCreateResponse } from "@spacebar/util";
-import { GeneralConfiguration, LimitsConfiguration } from "../../config";
-import { DmChannelDTO } from "../../dtos";
-import {
- Application,
- BackupCode,
- Categories,
- Channel,
- Emoji,
- Guild,
- Invite,
- Member,
- Message,
- PrivateUser,
- PublicMember,
- 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 APIBansArray = GuildBansResponse[];
-
-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 APIPublicMember = PublicMember;
-
-export interface APIGuildWithJoinedAt extends GuildCreateResponse {
- 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[];
-
-export type APIConnectionsConfiguration = Record<
- string,
- {
- enabled: boolean;
- }
->;
diff --git a/src/util/schemas/responses/UpdatesResponse.ts b/src/util/schemas/responses/UpdatesResponse.ts
deleted file mode 100644
index d8770b4..0000000
--- a/src/util/schemas/responses/UpdatesResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-export interface UpdatesResponse {
- name: string;
- pub_date: string;
- url: string;
- notes: string | null;
-}
diff --git a/src/util/schemas/responses/UploadAttachmentResponseSchema.ts b/src/util/schemas/responses/UploadAttachmentResponseSchema.ts
deleted file mode 100644
index eab5f22..0000000
--- a/src/util/schemas/responses/UploadAttachmentResponseSchema.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2024 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 .
-*/
-
-
-export interface UploadAttachmentResponseSchema {
- attachments: UploadAttachmentResponse[];
-}
-
-export interface UploadAttachmentResponse {
- id?: string;
- upload_url: string;
- upload_filename: string;
- original_content_type?: string;
-}
diff --git a/src/util/schemas/responses/UserNoteResponse.ts b/src/util/schemas/responses/UserNoteResponse.ts
deleted file mode 100644
index 0bde99a..0000000
--- a/src/util/schemas/responses/UserNoteResponse.ts
+++ /dev/null
@@ -1,23 +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 .
-*/
-
-export interface UserNoteResponse {
- note: string;
- note_user_id: string;
- user_id: string;
-}
diff --git a/src/util/schemas/responses/UserProfileResponse.ts b/src/util/schemas/responses/UserProfileResponse.ts
deleted file mode 100644
index 7b63542..0000000
--- a/src/util/schemas/responses/UserProfileResponse.ts
+++ /dev/null
@@ -1,57 +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 .
-*/
-
-import {
- Badge,
- Member,
- PublicConnectedAccount,
- PublicMember,
- PublicUser,
- User,
-} from "@spacebar/util";
-
-export type MutualGuild = {
- id: string;
- nick?: string;
-};
-
-export type PublicMemberProfile = Pick<
- Member,
- "banner" | "bio" | "guild_id"
-> & {
- accent_color: null; // TODO
-};
-
-export type UserProfile = Pick<
- User,
- "bio" | "accent_color" | "banner" | "pronouns" | "theme_colors"
->;
-
-export interface UserProfileResponse {
- user: PublicUser;
- connected_accounts: PublicConnectedAccount;
- premium_guild_since?: Date;
- premium_since?: Date;
- mutual_guilds: MutualGuild[];
- premium_type: number;
- profile_themes_experiment_bucket: number;
- user_profile: UserProfile;
- guild_member?: PublicMember;
- guild_member_profile?: PublicMemberProfile;
- badges: Badge[];
-}
diff --git a/src/util/schemas/responses/UserRelationsResponse.ts b/src/util/schemas/responses/UserRelationsResponse.ts
deleted file mode 100644
index 808dd3d..0000000
--- a/src/util/schemas/responses/UserRelationsResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-import { User } from "@spacebar/util";
-
-export type UserRelationsResponse = (Pick &
- Pick &
- Pick &
- Pick &
- Pick)[];
diff --git a/src/util/schemas/responses/UserRelationshipsResponse.ts b/src/util/schemas/responses/UserRelationshipsResponse.ts
deleted file mode 100644
index 115c45a..0000000
--- a/src/util/schemas/responses/UserRelationshipsResponse.ts
+++ /dev/null
@@ -1,25 +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 .
-*/
-import { PublicUser, RelationshipType } from "../../entities";
-
-export interface UserRelationshipsResponse {
- id: string;
- type: RelationshipType;
- nickname: null;
- user: PublicUser;
-}
diff --git a/src/util/schemas/responses/WebAuthnCreateResponse.ts b/src/util/schemas/responses/WebAuthnCreateResponse.ts
deleted file mode 100644
index 57386e6..0000000
--- a/src/util/schemas/responses/WebAuthnCreateResponse.ts
+++ /dev/null
@@ -1,21 +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 .
-*/
-export interface WebAuthnCreateResponse {
- name: string;
- id: string;
-}
diff --git a/src/util/schemas/responses/WebhookCreateResponse.ts b/src/util/schemas/responses/WebhookCreateResponse.ts
deleted file mode 100644
index 7226e61..0000000
--- a/src/util/schemas/responses/WebhookCreateResponse.ts
+++ /dev/null
@@ -1,24 +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 .
-*/
-
-import { User, Webhook } from "../../entities";
-
-export interface WebhookCreateResponse {
- user: User;
- hook: Webhook;
-}
diff --git a/src/util/schemas/responses/index.ts b/src/util/schemas/responses/index.ts
deleted file mode 100644
index dcf49f3..0000000
--- a/src/util/schemas/responses/index.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2025 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 .
-*/
-
-export * from "./AccountStandingResponse";
-export * from "./APIErrorOrCaptchaResponse";
-export * from "./APIErrorResponse";
-export * from "./BackupCodesChallengeResponse";
-export * from "./CaptchaRequiredResponse";
-export * from "./CollectiblesCategoriesResponse";
-export * from "./CollectiblesMarketingResponse";
-export * from "./CollectiblesShopResponse";
-export * from "./DiscoverableGuildsResponse";
-export * from "./DmMessagesResponseSchema";
-export * from "./EmailDomainLookupResponse";
-export * from "./EmailDomainLookupVerifyCodeResponse";
-export * from "./EmojiSourceResponse";
-export * from "./GatewayBotResponse";
-export * from "./GatewayResponse";
-export * from "./GenerateRegistrationTokensResponse";
-export * from "./GuildBansResponse";
-export * from "./GuildCreateResponse";
-export * from "./GuildDiscoveryRequirements";
-export * from "./GuildMessagesSearchResponse";
-export * from "./GuildProfileResponse";
-export * from "./GuildPruneResponse";
-export * from "./GuildRecommendationsResponse";
-export * from "./GuildVanityUrl";
-export * from "./GuildVoiceRegionsResponse";
-export * from "./GuildWidgetJsonResponse";
-export * from "./GuildWidgetSettingsResponse";
-export * from "./HubDirectoryEntriesResponse";
-export * from "./HubWaitlistSignupResponse";
-export * from "./InstanceDomainsResponse";
-export * from "./InstancePingResponse";
-export * from "./InstanceStatsResponse";
-export * from "./LocationMetadataResponse";
-export * from "./MemberJoinGuildResponse";
-export * from "./OAuthAuthorizeResponse";
-export * from "./PreloadMessagesResponseSchema";
-export * from "./RefreshUrlsResponse";
-export * from "./SettingsProtoUpdateResponse";
-export * from "./TeamListResponse";
-export * from "./Tenor";
-export * from "./TokenResponse";
-export * from "./TypedResponses";
-export * from "./UpdatesResponse";
-export * from "./UploadAttachmentResponseSchema";
-export * from "./UserNoteResponse";
-export * from "./UserProfileResponse";
-export * from "./UserRelationshipsResponse";
-export * from "./UserRelationsResponse";
-export * from "./WebAuthnCreateResponse";
-export * from "./WebhookCreateResponse";
diff --git a/tsconfig.json b/tsconfig.json
index f350133..c72ac35 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -39,6 +39,7 @@
"@spacebar/cdn*": ["./src/cdn"],
"@spacebar/util*": ["./src/util"],
"@spacebar/webrtc*": ["./src/webrtc"],
+ "@spacebar/schemas*": ["./src/schemas"],
"lambert-server*": ["./src/util/util/lambert-server"]
} /* Specify a set of entries that re-map imports to additional lookup locations. */,
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */