summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-04-19 23:49:24 +0200
committerRory& <root@rory.gay>2026-04-20 00:14:59 +0200
commitdce297144c9d0539f7c220862db63841c007a621 (patch)
treedcd4d7c4ec96010525c24825cf1191a406720ea0
parentClean up imports in schemas/api/bots (diff)
downloadserver-ts-dce297144c9d0539f7c220862db63841c007a621.tar.xz
Clean up schemas/api a bit
-rw-r--r--.lintstagedrc.mjs2
-rw-r--r--src/schemas/api/channels/Webhook.ts18
-rw-r--r--src/schemas/api/channels/index.ts1
-rw-r--r--src/schemas/api/developers/index.ts1
-rw-r--r--src/schemas/api/guilds/GuildSchema.ts2
-rw-r--r--src/schemas/api/guilds/VoiceState.ts19
-rw-r--r--src/schemas/api/index.ts2
-rw-r--r--src/schemas/api/messages/Message.ts1
-rw-r--r--src/schemas/api/messages/index.ts1
-rw-r--r--src/schemas/api/reports/index.ts20
-rw-r--r--src/schemas/api/users/ConnectedAccount.ts19
-rw-r--r--src/schemas/api/users/InstanceUserDeleteSchema.ts18
-rw-r--r--src/schemas/api/users/Member.ts19
-rw-r--r--src/schemas/api/users/SessionsSchemas.ts25
-rw-r--r--src/schemas/api/users/User.ts2
-rw-r--r--src/schemas/api/users/index.ts1
16 files changed, 137 insertions, 14 deletions
diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs

index f5686b79..aa1b9bea 100644 --- a/.lintstagedrc.mjs +++ b/.lintstagedrc.mjs
@@ -1,4 +1,4 @@ export default { "*.{j,t}s": [() => "npm run build:src:tsgo", "eslint --concurrency 4" /* sweet spot it seems */, "prettier --write"], - "src/schemas/{*,**/*}.ts": [() => "tsc -b -v", () => "node scripts/schema.js", () => "node scripts/openapi.js", () => "git add assets/schemas.json assets/openapi.json"], + "src/schemas/{*,**/*}.ts": [() => "npm run build:src:tsgo", () => "node scripts/schema.js", () => "node scripts/openapi.js", () => "git add assets/schemas.json assets/openapi.json"], }; diff --git a/src/schemas/api/channels/Webhook.ts b/src/schemas/api/channels/Webhook.ts
index ac50001f..65072047 100644 --- a/src/schemas/api/channels/Webhook.ts +++ b/src/schemas/api/channels/Webhook.ts
@@ -1,3 +1,21 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + export enum WebhookType { Incoming = 1, ChannelFollower = 2, diff --git a/src/schemas/api/channels/index.ts b/src/schemas/api/channels/index.ts
index cdd42bed..1ab6232c 100644 --- a/src/schemas/api/channels/index.ts +++ b/src/schemas/api/channels/index.ts
@@ -15,5 +15,6 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ + export * from "./Channel"; export * from "./Webhook"; diff --git a/src/schemas/api/developers/index.ts b/src/schemas/api/developers/index.ts
index e9443067..fe064085 100644 --- a/src/schemas/api/developers/index.ts +++ b/src/schemas/api/developers/index.ts
@@ -15,6 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ + export * from "./Application"; export * from "./ApplicationCreateSchema"; export * from "./ApplicationModifySchema"; diff --git a/src/schemas/api/guilds/GuildSchema.ts b/src/schemas/api/guilds/GuildSchema.ts
index adc9efd1..3937847a 100644 --- a/src/schemas/api/guilds/GuildSchema.ts +++ b/src/schemas/api/guilds/GuildSchema.ts
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Snowflake } from "@spacebar/schemas"; +import { Snowflake } from "../../Identifiers"; export interface GuildAvailableSchema { id: Snowflake; diff --git a/src/schemas/api/guilds/VoiceState.ts b/src/schemas/api/guilds/VoiceState.ts
index 9a8fb2b9..278e9678 100644 --- a/src/schemas/api/guilds/VoiceState.ts +++ b/src/schemas/api/guilds/VoiceState.ts
@@ -1,3 +1,22 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +//TODO: remove entity import import { VoiceState } from "@spacebar/util"; export enum PublicVoiceStateEnum { diff --git a/src/schemas/api/index.ts b/src/schemas/api/index.ts
index b0215da1..25458c95 100644 --- a/src/schemas/api/index.ts +++ b/src/schemas/api/index.ts
@@ -15,9 +15,11 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ + export * from "./bots"; export * from "./channels"; export * from "./developers"; export * from "./guilds"; export * from "./messages"; +export * from "./reports"; export * from "./users"; diff --git a/src/schemas/api/messages/Message.ts b/src/schemas/api/messages/Message.ts
index f99f2b1b..b7eed17c 100644 --- a/src/schemas/api/messages/Message.ts +++ b/src/schemas/api/messages/Message.ts
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +// TODO: remove entity import import { Sticker } from "@spacebar/util"; import { Embed, MessageActivity, MessageComponent, PartialUser, Poll, PublicChannel, Snowflake } from "@spacebar/schemas"; import { PublicAttachment } from "./Attachments"; diff --git a/src/schemas/api/messages/index.ts b/src/schemas/api/messages/index.ts
index 95a8a659..1533dd0c 100644 --- a/src/schemas/api/messages/index.ts +++ b/src/schemas/api/messages/index.ts
@@ -15,6 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ + export * from "./Components"; export * from "./Embeds"; export * from "./Message"; diff --git a/src/schemas/api/reports/index.ts b/src/schemas/api/reports/index.ts new file mode 100644
index 00000000..cf5f6497 --- /dev/null +++ b/src/schemas/api/reports/index.ts
@@ -0,0 +1,20 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +export * from "./CreateReport"; +export * from "./ReportMenu"; diff --git a/src/schemas/api/users/ConnectedAccount.ts b/src/schemas/api/users/ConnectedAccount.ts
index a6230340..281fc58f 100644 --- a/src/schemas/api/users/ConnectedAccount.ts +++ b/src/schemas/api/users/ConnectedAccount.ts
@@ -1,3 +1,22 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +//TODO: remove entity import import { ConnectedAccount } from "@spacebar/util"; export type PublicConnectedAccount = Pick<ConnectedAccount, "name" | "type" | "verified">; diff --git a/src/schemas/api/users/InstanceUserDeleteSchema.ts b/src/schemas/api/users/InstanceUserDeleteSchema.ts
index aee124fe..d4507f49 100644 --- a/src/schemas/api/users/InstanceUserDeleteSchema.ts +++ b/src/schemas/api/users/InstanceUserDeleteSchema.ts
@@ -1,3 +1,21 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + export type InstanceUserDeleteSchema = InstanceUserDeleteSchemaContent | undefined; //unsure if this a correct way to make the body optional export interface InstanceUserDeleteSchemaContent { reason?: string; diff --git a/src/schemas/api/users/Member.ts b/src/schemas/api/users/Member.ts
index 526bf705..049190e0 100644 --- a/src/schemas/api/users/Member.ts +++ b/src/schemas/api/users/Member.ts
@@ -1,4 +1,23 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + import { PublicUser } from "@spacebar/schemas"; +// TODO: remove entity import import { Member } from "@spacebar/util"; export interface ChannelOverride { diff --git a/src/schemas/api/users/SessionsSchemas.ts b/src/schemas/api/users/SessionsSchemas.ts
index 3526414b..34ad0c64 100644 --- a/src/schemas/api/users/SessionsSchemas.ts +++ b/src/schemas/api/users/SessionsSchemas.ts
@@ -1,22 +1,23 @@ /* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2025 Spacebar and Spacebar Contributors + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2026 Spacebar and Spacebar Contributors - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ import { ActivitySchema, Snowflake } from "@spacebar/schemas"; +// TODO: remove entity import import { ClientStatus } from "@spacebar/util"; export type SessionsLogoutSchema = { session_ids?: Snowflake[]; session_id_hashes?: string[] }; diff --git a/src/schemas/api/users/User.ts b/src/schemas/api/users/User.ts
index 29b211d4..0360eb03 100644 --- a/src/schemas/api/users/User.ts +++ b/src/schemas/api/users/User.ts
@@ -17,7 +17,9 @@ */ import { ConnectedAccountSchema, Snowflake, UserSettingsSchema } from "@spacebar/schemas"; +// TODO: maybe move the one thing this depends on to import { BitField } from "@spacebar/util/util"; +// TODO: remove entity import import { Relationship, Session } from "@spacebar/util/entities"; interface UserEntityPleaseRewriteThankYou { diff --git a/src/schemas/api/users/index.ts b/src/schemas/api/users/index.ts
index 6400f42d..85c92662 100644 --- a/src/schemas/api/users/index.ts +++ b/src/schemas/api/users/index.ts
@@ -15,6 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ + export * from "./ConnectedAccount"; export * from "./InstanceUserDeleteSchema"; export * from "./Member";