diff --git a/assets/openapi.json b/assets/openapi.json
index c2718ee8d..85292bc33 100644
Binary files a/assets/openapi.json and b/assets/openapi.json differ
diff --git a/assets/schemas.json b/assets/schemas.json
index 0bd0aced2..75c9d9042 100644
Binary files a/assets/schemas.json and b/assets/schemas.json differ
diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
index 96ff98e18..233d13815 100644
--- a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
+++ b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
@@ -34,7 +34,7 @@ import {
import { Request, Response, Router } from "express";
import { HTTPError } from "lambert-server";
import multer from "multer";
-import { handleMessage, postHandleMessage, route } from "../../../../../util";
+import { handleMessage, postHandleMessage, route } from "@spacebar/api";
import { MessageCreateAttachment, MessageCreateCloudAttachment, MessageCreateSchema, MessageEditSchema, ChannelType } from "@spacebar/schemas";
const router = Router({ mergeParams: true });
diff --git a/src/api/routes/connections/#connection_name/authorize.ts b/src/api/routes/connections/#connection_name/authorize.ts
index b74fd8619..7d3d03eb4 100644
--- a/src/api/routes/connections/#connection_name/authorize.ts
+++ b/src/api/routes/connections/#connection_name/authorize.ts
@@ -18,7 +18,7 @@
import { route } from "@spacebar/api";
import { Request, Response, Router } from "express";
-import { ConnectionStore, FieldErrors } from "../../../../util";
+import { ConnectionStore, FieldErrors } from "@spacebar/util";
const router = Router({ mergeParams: true });
diff --git a/src/api/routes/guilds/#guild_id/widget.png.ts b/src/api/routes/guilds/#guild_id/widget.png.ts
index 875761e64..ee623214c 100644
--- a/src/api/routes/guilds/#guild_id/widget.png.ts
+++ b/src/api/routes/guilds/#guild_id/widget.png.ts
@@ -24,7 +24,7 @@ import { Request, Response, Router } from "express";
import fs from "fs";
import { HTTPError } from "lambert-server";
import path from "path";
-import { storage } from "../../../../cdn/util/Storage";
+import { storage } from "@spacebar/cdn";
const router: Router = Router({ mergeParams: true });
diff --git a/src/cdn/routes/app-assets.ts b/src/cdn/routes/app-assets.ts
index 572cb3aac..149d8b351 100644
--- a/src/cdn/routes/app-assets.ts
+++ b/src/cdn/routes/app-assets.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/app-icons.ts b/src/cdn/routes/app-icons.ts
index b8ab98b97..b67bc1fb0 100644
--- a/src/cdn/routes/app-icons.ts
+++ b/src/cdn/routes/app-icons.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/attachments.ts b/src/cdn/routes/attachments.ts
index 86a7f0c89..87d96a4c6 100644
--- a/src/cdn/routes/attachments.ts
+++ b/src/cdn/routes/attachments.ts
@@ -21,8 +21,8 @@ import { Request, Response, Router } from "express";
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 { storage } from "@spacebar/cdn";
+import { CloudAttachment } from "@spacebar/util";
import { fileTypeFromBuffer } from "file-type";
import { cache } from "../util/cache";
diff --git a/src/cdn/routes/avatar-decoration-presets.ts b/src/cdn/routes/avatar-decoration-presets.ts
index 736a281d1..591e0ab17 100644
--- a/src/cdn/routes/avatar-decoration-presets.ts
+++ b/src/cdn/routes/avatar-decoration-presets.ts
@@ -17,7 +17,7 @@
*/
import { Router, Response, Request } from "express";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { HTTPError } from "lambert-server";
import { fileTypeFromBuffer } from "file-type";
import { cache } from "../util/cache";
diff --git a/src/cdn/routes/avatars.ts b/src/cdn/routes/avatars.ts
index 793bc45bb..f2d539bdc 100644
--- a/src/cdn/routes/avatars.ts
+++ b/src/cdn/routes/avatars.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/badge-icons.ts b/src/cdn/routes/badge-icons.ts
index 829baeb18..33134e1a4 100644
--- a/src/cdn/routes/badge-icons.ts
+++ b/src/cdn/routes/badge-icons.ts
@@ -17,7 +17,7 @@
*/
import { Router, Response, Request } from "express";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { HTTPError } from "lambert-server";
import { fileTypeFromBuffer } from "file-type";
import { cache } from "../util/cache";
diff --git a/src/cdn/routes/banners.ts b/src/cdn/routes/banners.ts
index 211643f9d..979bdad02 100644
--- a/src/cdn/routes/banners.ts
+++ b/src/cdn/routes/banners.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/channel-icons.ts b/src/cdn/routes/channel-icons.ts
index 946759dd9..3b85d4e46 100644
--- a/src/cdn/routes/channel-icons.ts
+++ b/src/cdn/routes/channel-icons.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/discover-splashes.ts b/src/cdn/routes/discover-splashes.ts
index d9822feb6..e9c07cb19 100644
--- a/src/cdn/routes/discover-splashes.ts
+++ b/src/cdn/routes/discover-splashes.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/discovery-splashes.ts b/src/cdn/routes/discovery-splashes.ts
index c9f8ddf7f..9d6d81c70 100644
--- a/src/cdn/routes/discovery-splashes.ts
+++ b/src/cdn/routes/discovery-splashes.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/emojis.ts b/src/cdn/routes/emojis.ts
index 761ad00e6..f11af3bad 100644
--- a/src/cdn/routes/emojis.ts
+++ b/src/cdn/routes/emojis.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/guild-profiles.ts b/src/cdn/routes/guild-profiles.ts
index 279b43611..9d27debf3 100644
--- a/src/cdn/routes/guild-profiles.ts
+++ b/src/cdn/routes/guild-profiles.ts
@@ -21,7 +21,7 @@ import crypto from "crypto";
import { Request, Response, Router } from "express";
import { HTTPError } from "lambert-server";
import { multer } from "../util/multer";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { cache } from "../util/cache";
diff --git a/src/cdn/routes/icons.ts b/src/cdn/routes/icons.ts
index c98313f41..6ddd49e9d 100644
--- a/src/cdn/routes/icons.ts
+++ b/src/cdn/routes/icons.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/role-icons.ts b/src/cdn/routes/role-icons.ts
index 2aaa6197d..f169309c8 100644
--- a/src/cdn/routes/role-icons.ts
+++ b/src/cdn/routes/role-icons.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/splashes.ts b/src/cdn/routes/splashes.ts
index 8a501ec4d..a10709d71 100644
--- a/src/cdn/routes/splashes.ts
+++ b/src/cdn/routes/splashes.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/stickers.ts b/src/cdn/routes/stickers.ts
index 5821db67f..a92069493 100644
--- a/src/cdn/routes/stickers.ts
+++ b/src/cdn/routes/stickers.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/routes/team-icons.ts b/src/cdn/routes/team-icons.ts
index 103974daa..c0e7e7854 100644
--- a/src/cdn/routes/team-icons.ts
+++ b/src/cdn/routes/team-icons.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/cdn/util/basicCrdFileRouter.ts b/src/cdn/util/basicCrdFileRouter.ts
index d489f373e..7490d5465 100644
--- a/src/cdn/util/basicCrdFileRouter.ts
+++ b/src/cdn/util/basicCrdFileRouter.ts
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@spacebar/util";
-import { storage } from "../util/Storage";
+import { storage } from "@spacebar/cdn";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server";
import crypto from "crypto";
diff --git a/src/connections/BattleNet/index.ts b/src/connections/BattleNet/index.ts
index 843ab79b3..f7d08cbe8 100644
--- a/src/connections/BattleNet/index.ts
+++ b/src/connections/BattleNet/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
+import { ConnectedAccount, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
import wretch from "wretch";
import { BattleNetSettings } from "./BattleNetSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
interface BattleNetConnectionUser {
sub: string;
diff --git a/src/connections/Discord/index.ts b/src/connections/Discord/index.ts
index ab44f4b31..f209a81bd 100644
--- a/src/connections/Discord/index.ts
+++ b/src/connections/Discord/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
+import { ConnectedAccount, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
import wretch from "wretch";
import { DiscordSettings } from "./DiscordSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
interface UserResponse {
id: string;
diff --git a/src/connections/EpicGames/index.ts b/src/connections/EpicGames/index.ts
index 69c44cb04..959192e64 100644
--- a/src/connections/EpicGames/index.ts
+++ b/src/connections/EpicGames/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
+import { ConnectedAccount, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
import wretch from "wretch";
import { EpicGamesSettings } from "./EpicGamesSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
export interface UserResponse {
accountId: string;
diff --git a/src/connections/Facebook/index.ts b/src/connections/Facebook/index.ts
index b661cbe87..29317c2e6 100644
--- a/src/connections/Facebook/index.ts
+++ b/src/connections/Facebook/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
+import { ConnectedAccount, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
import wretch from "wretch";
import { FacebookSettings } from "./FacebookSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
export interface FacebookErrorResponse {
error: {
diff --git a/src/connections/GitHub/index.ts b/src/connections/GitHub/index.ts
index 42dc0724f..df64912ae 100644
--- a/src/connections/GitHub/index.ts
+++ b/src/connections/GitHub/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
+import { ConnectedAccount, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
import wretch from "wretch";
import { GitHubSettings } from "./GitHubSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
interface UserResponse {
login: string;
diff --git a/src/connections/Reddit/index.ts b/src/connections/Reddit/index.ts
index 14faf4a6e..781e097a1 100644
--- a/src/connections/Reddit/index.ts
+++ b/src/connections/Reddit/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
+import { ConnectedAccount, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
import wretch from "wretch";
import { RedditSettings } from "./RedditSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
export interface UserResponse {
verified: boolean;
diff --git a/src/connections/Spotify/index.ts b/src/connections/Spotify/index.ts
index e1381cf2f..2186396bb 100644
--- a/src/connections/Spotify/index.ts
+++ b/src/connections/Spotify/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, ConnectionLoader, DiscordApiErrors, RefreshableConnection } from "@spacebar/util";
+import { ConnectedAccount, ConnectionLoader, DiscordApiErrors, RefreshableConnection } from "@spacebar/util";
import wretch from "wretch";
import { SpotifySettings } from "./SpotifySettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
export interface UserResponse {
display_name: string;
diff --git a/src/connections/Twitch/index.ts b/src/connections/Twitch/index.ts
index 84e8b3c04..5952caf1a 100644
--- a/src/connections/Twitch/index.ts
+++ b/src/connections/Twitch/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, ConnectionLoader, DiscordApiErrors, RefreshableConnection } from "@spacebar/util";
+import { ConnectedAccount, ConnectionLoader, DiscordApiErrors, RefreshableConnection } from "@spacebar/util";
import wretch from "wretch";
import { TwitchSettings } from "./TwitchSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
interface TwitchConnectionUserResponse {
data: {
diff --git a/src/connections/Twitter/index.ts b/src/connections/Twitter/index.ts
index 46b9289a0..3c79515be 100644
--- a/src/connections/Twitter/index.ts
+++ b/src/connections/Twitter/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, ConnectionLoader, DiscordApiErrors, RefreshableConnection } from "@spacebar/util";
+import { ConnectedAccount, ConnectionLoader, DiscordApiErrors, RefreshableConnection } from "@spacebar/util";
import wretch from "wretch";
import { TwitterSettings } from "./TwitterSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
interface TwitterUserResponse {
data: {
diff --git a/src/connections/Xbox/index.ts b/src/connections/Xbox/index.ts
index 184fe7637..59d4a0054 100644
--- a/src/connections/Xbox/index.ts
+++ b/src/connections/Xbox/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
+import { ConnectedAccount, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
import wretch from "wretch";
import { XboxSettings } from "./XboxSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
interface XboxUserResponse {
IssueInstant: string;
diff --git a/src/connections/Youtube/index.ts b/src/connections/Youtube/index.ts
index de452dffa..2db9289f3 100644
--- a/src/connections/Youtube/index.ts
+++ b/src/connections/Youtube/index.ts
@@ -16,10 +16,10 @@
along with this program. If not, see .
*/
-import { ConnectedAccount, ConnectedAccountCommonOAuthTokenResponse, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
+import { ConnectedAccount, Connection, ConnectionLoader, DiscordApiErrors } from "@spacebar/util";
import wretch from "wretch";
import { YoutubeSettings } from "./YoutubeSettings";
-import { ConnectionCallbackSchema } from "@spacebar/schemas";
+import { ConnectedAccountCommonOAuthTokenResponse, ConnectionCallbackSchema } from "@spacebar/schemas";
interface YouTubeConnectionChannelListResult {
items: {
diff --git a/src/gateway/Server.ts b/src/gateway/Server.ts
index c6419cfa8..72faa9836 100644
--- a/src/gateway/Server.ts
+++ b/src/gateway/Server.ts
@@ -22,7 +22,7 @@ import { checkToken, closeDatabase, Config, initDatabase, initEvent, Rights } fr
import ws from "ws";
import { Connection, openConnections } from "./events/Connection";
import http from "http";
-import { cleanupOnStartup } from "./util/Utils";
+import { cleanupOnStartup } from "./util";
import { randomString } from "@spacebar/api";
import { setInterval } from "timers";
diff --git a/src/gateway/listener/listener.ts b/src/gateway/listener/listener.ts
index 3a7b626c2..112f55bbf 100644
--- a/src/gateway/listener/listener.ts
+++ b/src/gateway/listener/listener.ts
@@ -31,11 +31,9 @@ import {
Recipient,
Relationship,
} from "@spacebar/util";
-import { CLOSECODES, OPCODES } from "../util/Constants";
-import { Send } from "../util/Send";
+import { CLOSECODES, OPCODES, Send } from "../util";
import { WebSocket } from "@spacebar/gateway";
import { Channel as AMQChannel } from "amqplib";
-import * as console from "node:console";
import { PublicMember, RelationshipType } from "@spacebar/schemas";
import { bgRedBright } from "picocolors";
diff --git a/src/gateway/opcodes/VoiceStateUpdate.ts b/src/gateway/opcodes/VoiceStateUpdate.ts
index 89ead6e7e..678afad8d 100644
--- a/src/gateway/opcodes/VoiceStateUpdate.ts
+++ b/src/gateway/opcodes/VoiceStateUpdate.ts
@@ -18,7 +18,7 @@
import { Payload, WebSocket } from "@spacebar/gateway";
import { Config, emitEvent, Guild, Member, VoiceServerUpdateEvent, VoiceState, VoiceStateUpdateEvent } from "@spacebar/util";
-import { genVoiceToken } from "../util/SessionUtils";
+import { genVoiceToken } from "@spacebar/gateway";
import { check } from "./instanceOf";
import { Region, VoiceStateUpdateSchema } from "@spacebar/schemas";
// TODO: check if a voice server is setup
diff --git a/src/schemas/gateway/LazyRequestSchema.ts b/src/schemas/gateway/LazyRequestSchema.ts
index fcefe680e..0433355cc 100644
--- a/src/schemas/gateway/LazyRequestSchema.ts
+++ b/src/schemas/gateway/LazyRequestSchema.ts
@@ -15,32 +15,3 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
-
-export interface LazyRequestSchema {
- guild_id: string;
- channels?: {
- /**
- * @items.type integer
- * @minItems 2
- * @maxItems 2
- */
- [key: string]: number[][]; // puyo: changed from [number, number] because it breaks openapi
- };
- activities?: boolean;
- threads?: boolean;
- typing?: true;
- members?: string[];
- member_updates?: boolean;
- thread_member_lists?: unknown[];
-}
-
-export const LazyRequestSchema = {
- guild_id: String,
- $activities: Boolean,
- $channels: Object,
- $typing: Boolean,
- $threads: Boolean,
- $members: [] as string[],
- $member_updates: Boolean,
- $thread_member_lists: [] as unknown[],
-};
diff --git a/src/schemas/responses/AccountStandingResponse.ts b/src/schemas/responses/AccountStandingResponse.ts
index bbb8cd85d..6f29ebef7 100644
--- a/src/schemas/responses/AccountStandingResponse.ts
+++ b/src/schemas/responses/AccountStandingResponse.ts
@@ -16,7 +16,8 @@
along with this program. If not, see .
*/
-import { Attachment } from "../../util/entities";
+// TODO: remove dependency on entities...
+import { Attachment } from "@spacebar/util";
export enum AccountStandingState {
ALL_GOOD = 100,
diff --git a/src/schemas/responses/DiscoverableGuildsResponse.ts b/src/schemas/responses/DiscoverableGuildsResponse.ts
index 3e22c992a..02c46f1c6 100644
--- a/src/schemas/responses/DiscoverableGuildsResponse.ts
+++ b/src/schemas/responses/DiscoverableGuildsResponse.ts
@@ -16,7 +16,8 @@
along with this program. If not, see .
*/
-import { Guild } from "../../util/entities";
+// TODO: remove dependency on entities
+import { Guild } from "@spacebar/util";
export interface DiscoverableGuildsResponse {
total: number;
diff --git a/src/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts b/src/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts
index 6efeaba63..b2400e95d 100644
--- a/src/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts
+++ b/src/schemas/responses/EmailDomainLookupVerifyCodeResponse.ts
@@ -16,7 +16,8 @@
along with this program. If not, see .
*/
-import { Guild } from "../../util/entities";
+// TODO: remove dependency on entities
+import { Guild } from "@spacebar/util";
export interface EmailDomainLookupVerifyCodeResponse {
guild: Guild;
diff --git a/src/schemas/responses/GuildMessagesSearchResponse.ts b/src/schemas/responses/GuildMessagesSearchResponse.ts
index 6777ad8a9..555092ee2 100644
--- a/src/schemas/responses/GuildMessagesSearchResponse.ts
+++ b/src/schemas/responses/GuildMessagesSearchResponse.ts
@@ -16,7 +16,8 @@
along with this program. If not, see .
*/
-import { Attachment, Role } from "../../util/entities";
+// TODO: remove dependency on entities
+import { Attachment, Role } from "@spacebar/util";
import { ActionRowComponent, Embed, MessageType, Poll, PublicUser } from "@spacebar/schemas";
export interface GuildMessagesSearchMessage {
diff --git a/src/schemas/responses/GuildRecommendationsResponse.ts b/src/schemas/responses/GuildRecommendationsResponse.ts
index 04f9d1efc..c8fed0721 100644
--- a/src/schemas/responses/GuildRecommendationsResponse.ts
+++ b/src/schemas/responses/GuildRecommendationsResponse.ts
@@ -16,7 +16,8 @@
along with this program. If not, see .
*/
-import { Guild } from "../../util/entities";
+// TODO: remove dependency on entities
+import { Guild } from "@spacebar/util";
export interface GuildRecommendationsResponse {
recommended_guilds: Guild[];
diff --git a/src/schemas/responses/HubDirectoryEntriesResponse.ts b/src/schemas/responses/HubDirectoryEntriesResponse.ts
index 677199d37..c19b6a141 100644
--- a/src/schemas/responses/HubDirectoryEntriesResponse.ts
+++ b/src/schemas/responses/HubDirectoryEntriesResponse.ts
@@ -16,7 +16,8 @@
along with this program. If not, see .
*/
-import { Guild } from "../../util/entities";
+// TODO: remove dependency on entities
+import { Guild } from "@spacebar/util";
export interface HubDirectoryEntry {
author_id: string;
diff --git a/src/schemas/responses/MemberJoinGuildResponse.ts b/src/schemas/responses/MemberJoinGuildResponse.ts
index 1f9bc8c9a..75081656b 100644
--- a/src/schemas/responses/MemberJoinGuildResponse.ts
+++ b/src/schemas/responses/MemberJoinGuildResponse.ts
@@ -16,7 +16,7 @@
along with this program. If not, see .
*/
-import { Emoji, Role, Sticker } from "../../util/entities";
+import { Emoji, Role, Sticker } from "@spacebar/util";
import { GuildCreateResponse } from "@spacebar/schemas";
export interface MemberJoinGuildResponse {
diff --git a/src/schemas/responses/TokenResponse.ts b/src/schemas/responses/TokenResponse.ts
index 0af06fd11..4a0c0834e 100644
--- a/src/schemas/responses/TokenResponse.ts
+++ b/src/schemas/responses/TokenResponse.ts
@@ -16,7 +16,8 @@
along with this program. If not, see .
*/
-import { BackupCode, UserSettings } from "../../util/entities";
+// TODO: remove dependency on entities
+import { BackupCode, UserSettings } from "@spacebar/util";
export interface TokenResponse {
token: string;
diff --git a/src/schemas/responses/TypedResponses.ts b/src/schemas/responses/TypedResponses.ts
index 13956ec86..13143a9f9 100644
--- a/src/schemas/responses/TypedResponses.ts
+++ b/src/schemas/responses/TypedResponses.ts
@@ -18,10 +18,11 @@
import { GeneralConfiguration, LimitsConfiguration } from "../../util/config/types";
import { DmChannelDTO } from "../../util/dtos";
-import { Application, BackupCode, Categories, Channel, Emoji, Guild, Invite, Member, Message, Role, Sticker, StickerPack, Template, Webhook } from "../../util/entities";
+import { Application, BackupCode, Categories, Channel, Emoji, Guild, Invite, Member, Message, Role, Sticker, StickerPack, Template, Webhook } from "@spacebar/util";
import { GuildVoiceRegion } from "./GuildVoiceRegionsResponse";
import { GuildBansResponse, GuildCreateResponse, PrivateUser, PublicMember, PublicUser } from "@spacebar/schemas";
+// TODO: remove this entire file!
// removes internal properties from the guild class
export type APIGuild = Omit;
diff --git a/src/schemas/responses/WebhookCreateResponse.ts b/src/schemas/responses/WebhookCreateResponse.ts
index 1246c7422..08d997fb9 100644
--- a/src/schemas/responses/WebhookCreateResponse.ts
+++ b/src/schemas/responses/WebhookCreateResponse.ts
@@ -16,7 +16,8 @@
along with this program. If not, see .
*/
-import { User, Webhook } from "../../util/entities";
+// TODO: remove dependency on entities
+import { User, Webhook } from "@spacebar/util";
export interface WebhookCreateResponse {
user: User;
diff --git a/src/schemas/uncategorised/ConnectedAccountSchema.ts b/src/schemas/uncategorised/ConnectedAccountSchema.ts
index c1d24d70a..a754f9f43 100644
--- a/src/schemas/uncategorised/ConnectedAccountSchema.ts
+++ b/src/schemas/uncategorised/ConnectedAccountSchema.ts
@@ -16,8 +16,6 @@
along with this program. If not, see .
*/
-import { ConnectedAccountTokenData } from "../../util/interfaces";
-
export interface ConnectedAccountSchema {
external_id: string;
user_id: string;
@@ -34,3 +32,21 @@ export interface ConnectedAccountSchema {
metadata_visibility?: number;
two_way_link?: boolean;
}
+
+export interface ConnectedAccountCommonOAuthTokenResponse {
+ access_token: string;
+ token_type: string;
+ scope: string;
+ refresh_token?: string;
+ expires_in?: number;
+}
+
+export interface ConnectedAccountTokenData {
+ access_token: string;
+ token_type?: string;
+ scope?: string;
+ refresh_token?: string;
+ expires_in?: number;
+ expires_at?: number;
+ fetched_at: number;
+}
diff --git a/src/schemas/uncategorised/GuildSubscriptionsBulkSchema.ts b/src/schemas/uncategorised/GuildSubscriptionsBulkSchema.ts
index 32be9dd0a..272110c5f 100644
--- a/src/schemas/uncategorised/GuildSubscriptionsBulkSchema.ts
+++ b/src/schemas/uncategorised/GuildSubscriptionsBulkSchema.ts
@@ -1,5 +1,3 @@
-import { LazyRequestSchema } from "../gateway/LazyRequestSchema";
-
export interface GuildSubscriptionsBulkSchema {
subscriptions: { [key: string]: GuildSubscriptionSchema };
}
@@ -9,3 +7,32 @@ export type GuildSubscriptionSchema = Omit;
export const GuildSubscriptionsBulkSchema = {
$subscriptions: Object,
};
+
+export interface LazyRequestSchema {
+ guild_id: string;
+ channels?: {
+ /**
+ * @items.type integer
+ * @minItems 2
+ * @maxItems 2
+ */
+ [key: string]: number[][]; // puyo: changed from [number, number] because it breaks openapi
+ };
+ activities?: boolean;
+ threads?: boolean;
+ typing?: true;
+ members?: string[];
+ member_updates?: boolean;
+ thread_member_lists?: unknown[];
+}
+
+export const LazyRequestSchema = {
+ guild_id: String,
+ $activities: Boolean,
+ $channels: Object,
+ $typing: Boolean,
+ $threads: Boolean,
+ $members: [] as string[],
+ $member_updates: Boolean,
+ $thread_member_lists: [] as unknown[],
+};
diff --git a/src/util/connections/ConnectionConfig.ts b/src/util/connections/ConnectionConfig.ts
index a5e0095ad..c5da3878a 100644
--- a/src/util/connections/ConnectionConfig.ts
+++ b/src/util/connections/ConnectionConfig.ts
@@ -17,7 +17,7 @@
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
-import { ConnectionConfigEntity } from "../entities/ConnectionConfigEntity";
+import { ConnectionConfigEntity } from "../entities";
import { OrmUtils } from "../imports";
let config: any;
diff --git a/src/util/connections/RefreshableConnection.ts b/src/util/connections/RefreshableConnection.ts
index 32cf36acd..3d7761f71 100644
--- a/src/util/connections/RefreshableConnection.ts
+++ b/src/util/connections/RefreshableConnection.ts
@@ -17,8 +17,8 @@
*/
import { ConnectedAccount } from "../entities";
-import { ConnectedAccountCommonOAuthTokenResponse } from "../interfaces";
import { Connection } from "./Connection";
+import { ConnectedAccountCommonOAuthTokenResponse } from "@spacebar/schemas";
/**
* A connection that can refresh its token.
diff --git a/src/util/entities/Attachment.ts b/src/util/entities/Attachment.ts
index c6858eb8e..9dc9c3ac0 100644
--- a/src/util/entities/Attachment.ts
+++ b/src/util/entities/Attachment.ts
@@ -18,7 +18,7 @@
import { BeforeRemove, Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { URL } from "url";
-import { deleteFile } from "../util/cdn";
+import { deleteFile } from "../util";
import { BaseClass } from "./BaseClass";
import { getUrlSignature, NewUrlUserSignatureData, NewUrlSignatureData } from "../Signing";
diff --git a/src/util/entities/BaseClass.ts b/src/util/entities/BaseClass.ts
index ad8338e77..24a3aee18 100644
--- a/src/util/entities/BaseClass.ts
+++ b/src/util/entities/BaseClass.ts
@@ -17,10 +17,9 @@
*/
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, ColumnOptions, FindOptionsWhere, ObjectIdColumn, PrimaryColumn } from "typeorm";
-import { Snowflake } from "../util/Snowflake";
-import { getDatabase } from "../util/Database";
-import { OrmUtils } from "../imports/OrmUtils";
-import { annotationsKey, JsonNumber } from "../util/Decorators";
+import { Snowflake, getDatabase } from "../util";
+import { OrmUtils } from "../imports";
+import { annotationsKey } from "../util/Decorators";
export class BaseClassWithoutId extends BaseEntity {
private get construct() {
diff --git a/src/util/entities/ConnectedAccount.ts b/src/util/entities/ConnectedAccount.ts
index 7c5ffb550..6a5fed759 100644
--- a/src/util/entities/ConnectedAccount.ts
+++ b/src/util/entities/ConnectedAccount.ts
@@ -17,9 +17,9 @@
*/
import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
-import { ConnectedAccountTokenData } from "../interfaces";
import { BaseClass } from "./BaseClass";
import { User } from "./User";
+import { ConnectedAccountTokenData } from "@spacebar/schemas";
@Entity({
name: "connected_accounts",
diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts
index 401c51be3..6d93cf5db 100644
--- a/src/util/entities/Member.ts
+++ b/src/util/entities/Member.ts
@@ -21,8 +21,7 @@ import { BeforeInsert, BeforeUpdate, Column, Entity, Index, JoinColumn, JoinTabl
import { Ban, Channel, PublicGuildRelations } from ".";
import { ReadyGuildDTO } from "../dtos";
import { GuildCreateEvent, GuildDeleteEvent, GuildMemberAddEvent, GuildMemberRemoveEvent, GuildMemberUpdateEvent, MessageCreateEvent } from "../interfaces";
-import { Config, emitEvent } from "../util";
-import { DiscordApiErrors } from "../util/Constants";
+import { Config, emitEvent, DiscordApiErrors } from "../util";
import { BaseClassWithoutId } from "./BaseClass";
import { Guild } from "./Guild";
import { Message } from "./Message";
diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts
index bedd5aee8..a4448a14a 100644
--- a/src/util/entities/Message.ts
+++ b/src/util/entities/Message.ts
@@ -20,7 +20,7 @@ import { User } from "./User";
import { Member } from "./Member";
import { Role } from "./Role";
import { Channel } from "./Channel";
-import { InteractionType } from "../interfaces/Interaction";
+import { InteractionType } from "../interfaces";
import { Application } from "./Application";
import { Column, CreateDateColumn, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, RelationId, FindOneOptions, Raw, Not, BaseEntity, In } from "typeorm";
import { BaseClass } from "./BaseClass";
diff --git a/src/util/interfaces/ConnectedAccount.ts b/src/util/interfaces/ConnectedAccount.ts
index 57cda25d2..0433355cc 100644
--- a/src/util/interfaces/ConnectedAccount.ts
+++ b/src/util/interfaces/ConnectedAccount.ts
@@ -15,21 +15,3 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
-
-export interface ConnectedAccountCommonOAuthTokenResponse {
- access_token: string;
- token_type: string;
- scope: string;
- refresh_token?: string;
- expires_in?: number;
-}
-
-export interface ConnectedAccountTokenData {
- access_token: string;
- token_type?: string;
- scope?: string;
- refresh_token?: string;
- expires_in?: number;
- expires_at?: number;
- fetched_at: number;
-}
diff --git a/src/util/util/Config.ts b/src/util/util/Config.ts
index 1cd24b901..27f0b4502 100644
--- a/src/util/util/Config.ts
+++ b/src/util/util/Config.ts
@@ -20,7 +20,7 @@ import { existsSync } from "fs";
import fs from "fs/promises";
import { OrmUtils } from "..";
import { ConfigValue } from "../config";
-import { ConfigEntity } from "../entities/Config";
+import { ConfigEntity } from "../entities";
import { JsonValue } from "@protobuf-ts/runtime";
// TODO: yaml instead of json
diff --git a/src/webrtc/Server.ts b/src/webrtc/Server.ts
index bc26f3d19..ff98fe57e 100644
--- a/src/webrtc/Server.ts
+++ b/src/webrtc/Server.ts
@@ -21,7 +21,7 @@ import { closeDatabase, Config, initDatabase, initEvent } from "@spacebar/util";
import http from "http";
import ws from "ws";
import { Connection } from "./events/Connection";
-import { loadWebRtcLibrary, mediaServer, WRTC_PORT_MAX, WRTC_PORT_MIN, WRTC_PUBLIC_IP } from "./util/MediaServer";
+import { loadWebRtcLibrary, mediaServer, WRTC_PORT_MAX, WRTC_PORT_MIN, WRTC_PUBLIC_IP } from "./util";
import { green, yellow } from "picocolors";
export class Server {