mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-29 05:29:15 +00:00
Clean up some imports to make API work again
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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";
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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>error).stack!.replaceAll("/:", "/index.ts:");
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user