From 58abf8a45df2d9a97b435286e772fe897731914c Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 20 Mar 2026 09:55:01 +0100 Subject: Clean up nonspecific imports in entities --- src/schemas/api/index.ts | 1 + src/schemas/api/reports/index.ts | 20 ++++++++++++++++++++ src/util/entities/Member.ts | 5 +++-- src/util/entities/ReportMenu.ts | 2 +- src/util/entities/StickerPack.ts | 2 +- src/util/entities/User.ts | 3 ++- 6 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 src/schemas/api/reports/index.ts diff --git a/src/schemas/api/index.ts b/src/schemas/api/index.ts index b0215da1..488522a6 100644 --- a/src/schemas/api/index.ts +++ b/src/schemas/api/index.ts @@ -21,3 +21,4 @@ export * from "./developers"; export * from "./guilds"; export * from "./messages"; export * from "./users"; +export * from "./reports"; 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 . +*/ + +export * from "./CreateReport"; +export * from "./ReportMenu"; diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts index 6d93cf5d..78fcb138 100644 --- a/src/util/entities/Member.ts +++ b/src/util/entities/Member.ts @@ -18,12 +18,13 @@ import { HTTPError } from "lambert-server"; import { BeforeInsert, BeforeUpdate, Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, Not, PrimaryGeneratedColumn, RelationId } from "typeorm"; -import { Ban, Channel, PublicGuildRelations } from "."; import { ReadyGuildDTO } from "../dtos"; import { GuildCreateEvent, GuildDeleteEvent, GuildMemberAddEvent, GuildMemberRemoveEvent, GuildMemberUpdateEvent, MessageCreateEvent } from "../interfaces"; import { Config, emitEvent, DiscordApiErrors } from "../util"; +import { Ban } from "./Ban"; import { BaseClassWithoutId } from "./BaseClass"; -import { Guild } from "./Guild"; +import { Channel } from "./Channel"; +import { Guild, PublicGuildRelations } from "./Guild"; import { Message } from "./Message"; import { Role } from "./Role"; import { User } from "./User"; diff --git a/src/util/entities/ReportMenu.ts b/src/util/entities/ReportMenu.ts index a37ae159..4f565640 100644 --- a/src/util/entities/ReportMenu.ts +++ b/src/util/entities/ReportMenu.ts @@ -18,7 +18,7 @@ import { BaseClass } from "./BaseClass"; import { Entity, Column } from "typeorm"; -import { ReportMenuType } from "../../schemas/api/reports/ReportMenu"; +import { ReportMenuType } from "@spacebar/schemas"; @Entity({ name: "report_menus", diff --git a/src/util/entities/StickerPack.ts b/src/util/entities/StickerPack.ts index d4a598f4..189e2120 100644 --- a/src/util/entities/StickerPack.ts +++ b/src/util/entities/StickerPack.ts @@ -17,7 +17,7 @@ */ import { Column, Entity, JoinColumn, ManyToOne, OneToMany, RelationId } from "typeorm"; -import { Sticker } from "."; +import { Sticker } from "./Sticker"; import { BaseClass } from "./BaseClass"; @Entity({ diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts index 0fd51334..50853f52 100644 --- a/src/util/entities/User.ts +++ b/src/util/entities/User.ts @@ -18,9 +18,10 @@ import { Request } from "express"; import { Column, Entity, JoinColumn, OneToMany, OneToOne } from "typeorm"; -import { Channel, Config, Email, FieldErrors, Snowflake, trimSpecial } from ".."; +import { Config, Email, FieldErrors, Snowflake, trimSpecial } from ".."; import { Random } from "../util"; import { BaseClass } from "./BaseClass"; +import { Channel } from "./Channel"; import { ConnectedAccount } from "./ConnectedAccount"; import { Member } from "./Member"; import { Relationship } from "./Relationship"; -- cgit 1.5.1