Clean up unused imports

This commit is contained in:
Rory& 2025-09-30 05:13:29 +02:00
parent 8cfe0311ca
commit b87d28c2c9
26 changed files with 19 additions and 50 deletions

View File

@ -16,24 +16,16 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { generateCode, randomString, route } from "@spacebar/api";
import { randomString, route } from "@spacebar/api";
import {
Attachment,
Channel,
Config,
emitEvent,
GreetRequestSchema,
Message,
MessageCreateEvent,
MessageType,
Permissions,
Sticker,
UploadAttachmentRequestSchema,
UploadAttachmentResponseSchema,
User,
} from "@spacebar/util";
import { Request, Response, Router } from "express";
import { In } from "typeorm";
import { CloudAttachment } from "../../../../util/entities/CloudAttachment";
import fetch from "node-fetch-commonjs";

View File

@ -39,7 +39,6 @@ import { Request, Response, Router } from "express";
import { HTTPError } from "lambert-server";
import multer from "multer";
import { handleMessage, postHandleMessage, route } from "../../../../../util";
import { URL } from "url";
const router = Router();
// TODO: message content/embed string length limit

View File

@ -47,8 +47,6 @@ import { HTTPError } from "lambert-server";
import multer from "multer";
import { FindManyOptions, FindOperator, LessThan, MoreThan, MoreThanOrEqual } from "typeorm";
import { URL } from "url";
import fetch from "node-fetch-commonjs";
import { CloudAttachment } from "../../../../../util/entities/CloudAttachment";
const router: Router = Router();

View File

@ -28,7 +28,6 @@ import {
handleFile,
isTextChannel,
trimSpecial,
FieldErrors,
ValidateName,
} from "@spacebar/util";
import crypto from "crypto";

View File

@ -19,7 +19,6 @@
import { Request, Response, Router } from "express";
import { Role, Member } from "@spacebar/util";
import { route } from "@spacebar/api";
import {} from "typeorm";
const router: Router = Router();

View File

@ -23,8 +23,6 @@ import {
Guild,
GuildTemplateCreateSchema,
Member,
Role,
Snowflake,
Template,
} from "@spacebar/util";
import { Request, Response, Router } from "express";

View File

@ -17,7 +17,7 @@
*/
import { route } from "@spacebar/api";
import { Channel, Config, DmMessagesResponseSchema, Message, User } from "@spacebar/util";
import { Config, DmMessagesResponseSchema, Message, User } from "@spacebar/util";
import { Request, Response, Router } from "express";
const router = Router();

View File

@ -27,7 +27,7 @@ import {
SettingsProtoUpdateSchema,
UserSettingsProtos,
} from "@spacebar/util";
import { FrecencyUserSettings, PreloadedUserSettings } from "discord-protos";
import { FrecencyUserSettings } from "discord-protos";
import { JsonValue } from "@protobuf-ts/runtime";
const router: Router = Router();

View File

@ -9,7 +9,6 @@ import {
WebhookUpdateSchema,
Channel,
handleFile,
FieldErrors,
ValidateName,
} from "@spacebar/util";
import { Request, Response, Router } from "express";

View File

@ -29,7 +29,7 @@ import avatarsRoute from "./routes/avatars";
import guildProfilesRoute from "./routes/guild-profiles";
import iconsRoute from "./routes/role-icons";
import morgan from "morgan";
import { Like, Or } from "typeorm";
import { Like } from "typeorm";
export type CDNServerOptions = ServerOptions;

View File

@ -18,12 +18,12 @@
import { Config, hasValidSignature, NewUrlUserSignatureData, Snowflake, UrlSignResult } from "@spacebar/util";
import { Request, Response, Router } from "express";
import { fileTypeFromBuffer } from "file-type";
import imageSize from "image-size";
import { HTTPError } from "lambert-server";
import { multer } from "../util/multer";
import { storage } from "../util/Storage";
import { CloudAttachment } from "../../util/entities/CloudAttachment";
import { fileTypeFromBuffer } from "file-type";
const router = Router();

View File

@ -18,8 +18,8 @@
import { Router, Response, Request } from "express";
import { storage } from "../util/Storage";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import { fileTypeFromBuffer } from "file-type";
const router = Router();

View File

@ -17,10 +17,10 @@
*/
import { Request, Response, Router } from "express";
import { fileTypeFromBuffer } from "file-type";
import fs from "fs/promises";
import { HTTPError } from "lambert-server";
import { join } from "path";
import { fileTypeFromBuffer } from "file-type";
const defaultAvatarHashMap = new Map([
["0", "4a8562cf00887030c416d3ec2d46385a"],

View File

@ -19,10 +19,10 @@
import { Config, Snowflake } from "@spacebar/util";
import crypto from "crypto";
import { Request, Response, Router } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import { multer } from "../util/multer";
import { storage } from "../util/Storage";
import { fileTypeFromBuffer } from "file-type";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon

View File

@ -24,14 +24,12 @@ import {
DefaultUserGuildSettings,
EVENTEnum,
Guild,
GuildCreateEvent,
GuildOrUnavailable,
IdentifySchema,
Intents,
Member,
MemberPrivateProjection,
OPCodes,
Permissions,
PresenceUpdateEvent,
PrivateSessionProjection,
PrivateUserProjection,
@ -61,7 +59,6 @@ import {
} from "@spacebar/util";
import { check } from "./instanceOf";
import { In } from "typeorm";
import guild_id from "../../api/routes/guilds/#guild_id";
// TODO: user sharding
// TODO: check privileged intents, if defined in the config

View File

@ -9,7 +9,6 @@ import {
Config,
emitEvent,
Member,
Region,
Snowflake,
Stream,
StreamCreateEvent,

View File

@ -16,9 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { BeforeRemove, Column, Entity, JoinColumn, ManyToOne, OneToOne, RelationId } from "typeorm";
import { URL } from "url";
import { deleteFile } from "../util/cdn";
import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { BaseClass } from "./BaseClass";
import { dbEngine } from "../util/Database";
import { User } from "./User";

View File

@ -16,16 +16,13 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { AfterLoad, Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
import { Channel } from "./Channel";
import { Guild } from "./Guild";
import { Member } from "./Member";
import { User } from "./User";
import { dbEngine } from "../util/Database";
import { emitEvent } from "../util";
import { GuildCreateEvent } from "../interfaces";
import { ReadyGuildDTO } from "../dtos";
export const PublicInviteRelation = ["inviter", "guild", "channel"];

View File

@ -3,14 +3,12 @@ import {
Entity,
JoinColumn,
ManyToOne,
OneToMany,
RelationId,
} from "typeorm";
import { BaseClass } from "./BaseClass";
import { dbEngine } from "../util/Database";
import { User } from "./User";
import { Channel } from "./Channel";
import { StreamSession } from "./StreamSession";
@Entity({
name: "streams",

View File

@ -3,7 +3,6 @@ import {
Entity,
JoinColumn,
ManyToOne,
OneToMany,
RelationId,
} from "typeorm";
import { BaseClass } from "./BaseClass";

View File

@ -18,7 +18,7 @@
import { Request } from "express";
import { Column, Entity, FindOneOptions, JoinColumn, OneToMany, OneToOne } from "typeorm";
import { Channel, ChannelType, Config, Email, FieldErrors, Recipient, Snowflake, trimSpecial } from "..";
import { Channel, ChannelType, Config, Email, FieldErrors, Snowflake, trimSpecial } from "..";
import { BitField } from "../util/BitField";
import { BaseClass } from "./BaseClass";
import { ConnectedAccount } from "./ConnectedAccount";

View File

@ -16,18 +16,18 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Column, Entity, JoinColumn, OneToOne, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, OneToOne } from "typeorm";
import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
import { dbEngine } from "@spacebar/util";
import { User } from "./User";
import {
FrecencyUserSettings,
PreloadedUserSettings,
PreloadedUserSettings_LaunchPadMode,
PreloadedUserSettings_SwipeRightToLeftMode,
PreloadedUserSettings_Theme,
PreloadedUserSettings_TimestampHourCycle,
PreloadedUserSettings_UIDensity,
} from "discord-protos";
@Entity({

View File

@ -16,7 +16,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ConnectedAccountTokenData } from "../interfaces";
import { AllowedMentions } from "@spacebar/util*";
export interface GreetRequestSchema {

View File

@ -16,8 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ActionRowComponent, Embed, PollAnswer, PollMedia, UploadAttachmentResponse } from "@spacebar/util";
import { CloudAttachment } from "../entities/CloudAttachment";
import { ActionRowComponent, Embed, PollAnswer, PollMedia } from "@spacebar/util";
export type MessageCreateAttachment = {
id: string;

View File

@ -16,7 +16,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { StringStringDictionary } from "../../util";
import { CollectiblesCategoryItem, StaticAnimatedAsset } from "./CollectiblesCategoriesResponse";
export interface CollectiblesShopResponse {

View File

@ -21,7 +21,7 @@ import path from "node:path";
import { User } from "../../entities";
import { Config } from "../Config";
import { generateToken } from "../Token";
import { BaseEmailClient, IEmail, IEmailClient } from "./clients/IEmailClient";
import { IEmail, IEmailClient } from "./clients/IEmailClient";
import { SendGridEmailClient } from "./clients/SendGridEmailClient";
import { SMTPEmailClient } from "./clients/SMTPEmailClient";
import { MailGunEmailClient } from "./clients/MailGunEmailClient";