diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index e2fc798d3..9dbad645e 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -18,7 +18,8 @@ import { HTTPError } from "lambert-server/HTTPError"; import { Equal, In, Or } from "typeorm"; -import { fillMessageUrlEmbeds } from "@spacebar/api"; +// noinspection ES6PreferShortImport -- Causes a circular reference... +import { fillMessageUrlEmbeds } from "../utility/EmbedHandlers"; import { getDatabase, Application, Attachment, Channel, CloudAttachment, Guild, Member, Message, ReadState, Role, Session, Sticker, User, Webhook } from "@spacebar/database"; import { mathLogBase, arrayDistributeSequentially, Stopwatch, Random } from "@spacebar/extensions"; import { diff --git a/src/api/util/handlers/Webhook.ts b/src/api/util/handlers/Webhook.ts index 02fe6690f..1f4f60a73 100644 --- a/src/api/util/handlers/Webhook.ts +++ b/src/api/util/handlers/Webhook.ts @@ -1,7 +1,25 @@ +/* + 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 . +*/ + import { Request, Response } from "express"; import { HTTPError } from "lambert-server/HTTPError"; import { MoreThan } from "typeorm"; -import { handleMessage, postHandleMessage } from "@spacebar/api"; +import { handleMessage, postHandleMessage } from "./Message"; import { Attachment, Channel, Message, Webhook } from "@spacebar/database"; import { Config, DiscordApiErrors, emitEvent, FieldErrors, MessageCreateEvent, Snowflake, uploadFile, ValidateName } from "@spacebar/util"; import { WebhookExecuteSchema } from "@spacebar/schemas"; diff --git a/src/database/entities/ApplicationCommand.ts b/src/database/entities/ApplicationCommand.ts index 892bb8334..8fc7ef9fa 100644 --- a/src/database/entities/ApplicationCommand.ts +++ b/src/database/entities/ApplicationCommand.ts @@ -18,15 +18,15 @@ import { Column, Entity } from "typeorm"; import { BaseClass } from "./BaseClass"; -import { +import type { ApplicationCommandHandlerType, ApplicationCommandOption, ApplicationCommandIndexPermissions, - ApplicationCommandType, Snowflake, ApplicationIntegrationType, InteractionContextType, } from "@spacebar/schemas"; +import { ApplicationCommandType } from "@spacebar/schemas/api/bots/ApplicationCommandSchema"; @Entity({ name: "application_commands", diff --git a/src/database/entities/Attachment.ts b/src/database/entities/Attachment.ts index 9631e74b2..08fb369a8 100644 --- a/src/database/entities/Attachment.ts +++ b/src/database/entities/Attachment.ts @@ -19,7 +19,7 @@ import { BeforeRemove, Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; import { Config, deleteFile } from "@spacebar/util/util"; import { getUrlSignature, NewUrlUserSignatureData, NewUrlSignatureData } from "@spacebar/util/Signing"; -import { PublicAttachment } from "@spacebar/schemas/api/messages/Attachments"; +import type { PublicAttachment } from "@spacebar/schemas/api/messages/Attachments"; import { BaseClass } from "./BaseClass"; @Entity({ diff --git a/src/util/util/lambert-server/Server.ts b/src/util/util/lambert-server/Server.ts index 4a73f7c32..7c7b647d5 100644 --- a/src/util/util/lambert-server/Server.ts +++ b/src/util/util/lambert-server/Server.ts @@ -68,7 +68,9 @@ export class Server { return router; } catch (error) { - console.error(new Error(`[Server] Failed to register route ${path}: ${error}`)); + const err = new Error(`[Server] Failed to register route ${path}: ${error}`); + err.stack = (err.stack ?? "") + "\n Inner exception: " + (error).stack!.replaceAll("/:", "/index.ts:"); + console.error(err); } }