diff options
Diffstat (limited to 'src/api')
149 files changed, 271 insertions, 272 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts index 032e923e..447a4802 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts @@ -25,7 +25,7 @@ import { registerRoutes, Sentry, WebAuthn, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; import { Server, ServerOptions } from "lambert-server"; import "missing-native-js-functions"; @@ -38,7 +38,6 @@ import { ErrorHandler } from "./middlewares/ErrorHandler"; import { initRateLimits } from "./middlewares/RateLimit"; import { initTranslation } from "./middlewares/Translation"; import { initInstance } from "./util/handlers/Instance"; -import express from "express"; const PUBLIC_ASSETS_FOLDER = path.join( __dirname, @@ -48,21 +47,21 @@ const PUBLIC_ASSETS_FOLDER = path.join( "public", ); -export type FosscordServerOptions = ServerOptions; +export type SpacebarServerOptions = ServerOptions; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace Express { interface Request { - server: FosscordServer; + server: SpacebarServer; } } } -export class FosscordServer extends Server { - public declare options: FosscordServerOptions; +export class SpacebarServer extends Server { + public declare options: SpacebarServerOptions; - constructor(opts?: Partial<FosscordServerOptions>) { + constructor(opts?: Partial<SpacebarServerOptions>) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore super({ ...opts, errorHandler: false, jsonBody: false }); diff --git a/src/api/middlewares/Authentication.ts b/src/api/middlewares/Authentication.ts index 400a16f4..09644eee 100644 --- a/src/api/middlewares/Authentication.ts +++ b/src/api/middlewares/Authentication.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { checkToken, Config, Rights } from "@fosscord/util"; +import { checkToken, Config, Rights } from "@spacebar/util"; import * as Sentry from "@sentry/node"; import { NextFunction, Request, Response } from "express"; import { HTTPError } from "lambert-server"; diff --git a/src/api/middlewares/ErrorHandler.ts b/src/api/middlewares/ErrorHandler.ts index 439fce68..b8a73298 100644 --- a/src/api/middlewares/ErrorHandler.ts +++ b/src/api/middlewares/ErrorHandler.ts @@ -18,7 +18,7 @@ import { NextFunction, Request, Response } from "express"; import { HTTPError } from "lambert-server"; -import { ApiError, FieldError } from "@fosscord/util"; +import { ApiError, FieldError } from "@spacebar/util"; const EntityNotFoundErrorRegex = /"(\w+)"/; export function ErrorHandler( diff --git a/src/api/middlewares/RateLimit.ts b/src/api/middlewares/RateLimit.ts index f50d6568..0da292e9 100644 --- a/src/api/middlewares/RateLimit.ts +++ b/src/api/middlewares/RateLimit.ts @@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { getIpAdress } from "@fosscord/api"; -import { Config, getRights, listenEvent } from "@fosscord/util"; +import { getIpAdress } from "@spacebar/api"; +import { Config, getRights, listenEvent } from "@spacebar/util"; import { NextFunction, Request, Response, Router } from "express"; import { API_PREFIX_TRAILING_SLASH } from "./Authentication"; @@ -27,7 +27,7 @@ import { API_PREFIX_TRAILING_SLASH } from "./Authentication"; /* ? bucket limit? Max actions/sec per bucket? -(ANSWER: a small fosscord instance might not need a complex rate limiting system) +(ANSWER: a small spacebar instance might not need a complex rate limiting system) TODO: delay database requests to include multiple queries TODO: different for methods (GET/POST) > IP addresses that make too many invalid HTTP requests are automatically and temporarily restricted from accessing the Discord API. Currently, this limit is 10,000 per 10 minutes. An invalid request is one that results in 401, 403, or 429 statuses. diff --git a/src/api/routes/-/healthz.ts b/src/api/routes/-/healthz.ts index 555ccf11..6a2f65de 100644 --- a/src/api/routes/-/healthz.ts +++ b/src/api/routes/-/healthz.ts @@ -17,8 +17,8 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; -import { getDatabase } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { getDatabase } from "@spacebar/util"; const router = Router(); diff --git a/src/api/routes/-/readyz.ts b/src/api/routes/-/readyz.ts index 555ccf11..6a2f65de 100644 --- a/src/api/routes/-/readyz.ts +++ b/src/api/routes/-/readyz.ts @@ -17,8 +17,8 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; -import { getDatabase } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { getDatabase } from "@spacebar/util"; const router = Router(); diff --git a/src/api/routes/applications/#id/bot/index.ts b/src/api/routes/applications/#id/bot/index.ts index 89e185b4..e3f1832c 100644 --- a/src/api/routes/applications/#id/bot/index.ts +++ b/src/api/routes/applications/#id/bot/index.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { Application, generateToken, @@ -25,7 +25,7 @@ import { BotModifySchema, handleFile, DiscordApiErrors, -} from "@fosscord/util"; +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; import { verifyToken } from "node-2fa"; diff --git a/src/api/routes/applications/#id/entitlements.ts b/src/api/routes/applications/#id/entitlements.ts index fa8609bf..e88fb7f7 100644 --- a/src/api/routes/applications/#id/entitlements.ts +++ b/src/api/routes/applications/#id/entitlements.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/applications/#id/index.ts b/src/api/routes/applications/#id/index.ts index 1cd792ba..067f5dad 100644 --- a/src/api/routes/applications/#id/index.ts +++ b/src/api/routes/applications/#id/index.ts @@ -17,12 +17,12 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { Application, DiscordApiErrors, ApplicationModifySchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { verifyToken } from "node-2fa"; import { HTTPError } from "lambert-server"; diff --git a/src/api/routes/applications/#id/skus.ts b/src/api/routes/applications/#id/skus.ts index 973761c3..fcb75423 100644 --- a/src/api/routes/applications/#id/skus.ts +++ b/src/api/routes/applications/#id/skus.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/applications/detectable.ts b/src/api/routes/applications/detectable.ts index 2e972335..a8e30894 100644 --- a/src/api/routes/applications/detectable.ts +++ b/src/api/routes/applications/detectable.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/applications/index.ts b/src/api/routes/applications/index.ts index c4c2c326..80a19aa8 100644 --- a/src/api/routes/applications/index.ts +++ b/src/api/routes/applications/index.ts @@ -17,13 +17,13 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { Application, ApplicationCreateSchema, trimSpecial, User, -} from "@fosscord/util"; +} from "@spacebar/util"; const router: Router = Router(); diff --git a/src/api/routes/auth/forgot.ts b/src/api/routes/auth/forgot.ts index 3a3af3cb..e240dff2 100644 --- a/src/api/routes/auth/forgot.ts +++ b/src/api/routes/auth/forgot.ts @@ -16,14 +16,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { getIpAdress, route, verifyCaptcha } from "@fosscord/api"; +import { getIpAdress, route, verifyCaptcha } from "@spacebar/api"; import { Config, Email, FieldErrors, ForgotPasswordSchema, User, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; const router = Router(); diff --git a/src/api/routes/auth/generate-registration-tokens.ts b/src/api/routes/auth/generate-registration-tokens.ts index 45ebc2e8..723875f8 100644 --- a/src/api/routes/auth/generate-registration-tokens.ts +++ b/src/api/routes/auth/generate-registration-tokens.ts @@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route, random } from "@fosscord/api"; -import { Config, ValidRegistrationToken } from "@fosscord/util"; +import { route, random } from "@spacebar/api"; +import { Config, ValidRegistrationToken } from "@spacebar/util"; import { Request, Response, Router } from "express"; const router: Router = Router(); diff --git a/src/api/routes/auth/location-metadata.ts b/src/api/routes/auth/location-metadata.ts index d7c7adf1..52a45c67 100644 --- a/src/api/routes/auth/location-metadata.ts +++ b/src/api/routes/auth/location-metadata.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; -import { getIpAdress, IPAnalysis } from "@fosscord/api"; +import { route } from "@spacebar/api"; +import { getIpAdress, IPAnalysis } from "@spacebar/api"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts index 280d3461..fe0b4f99 100644 --- a/src/api/routes/auth/login.ts +++ b/src/api/routes/auth/login.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { getIpAdress, route, verifyCaptcha } from "@fosscord/api"; +import { getIpAdress, route, verifyCaptcha } from "@spacebar/api"; import { adjustEmail, Config, @@ -26,7 +26,7 @@ import { LoginSchema, User, WebAuthn, -} from "@fosscord/util"; +} from "@spacebar/util"; import bcrypt from "bcrypt"; import crypto from "crypto"; import { Request, Response, Router } from "express"; diff --git a/src/api/routes/auth/logout.ts b/src/api/routes/auth/logout.ts index 33ad144c..51909afa 100644 --- a/src/api/routes/auth/logout.ts +++ b/src/api/routes/auth/logout.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; const router: Router = Router(); diff --git a/src/api/routes/auth/mfa/totp.ts b/src/api/routes/auth/mfa/totp.ts index 83c4ba56..2396443d 100644 --- a/src/api/routes/auth/mfa/totp.ts +++ b/src/api/routes/auth/mfa/totp.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; -import { BackupCode, generateToken, User, TotpSchema } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { BackupCode, generateToken, User, TotpSchema } from "@spacebar/util"; import { verifyToken } from "node-2fa"; import { HTTPError } from "lambert-server"; const router = Router(); diff --git a/src/api/routes/auth/mfa/webauthn.ts b/src/api/routes/auth/mfa/webauthn.ts index 8ffe1ee2..1b387411 100644 --- a/src/api/routes/auth/mfa/webauthn.ts +++ b/src/api/routes/auth/mfa/webauthn.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { generateToken, SecurityKey, @@ -24,7 +24,7 @@ import { verifyWebAuthnToken, WebAuthn, WebAuthnTotpSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; import { ExpectedAssertionResult } from "fido2-lib"; import { HTTPError } from "lambert-server"; diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts index aa09cf24..430c9532 100644 --- a/src/api/routes/auth/register.ts +++ b/src/api/routes/auth/register.ts @@ -26,14 +26,14 @@ import { adjustEmail, RegisterSchema, ValidRegistrationToken, -} from "@fosscord/util"; +} from "@spacebar/util"; import { route, getIpAdress, IPAnalysis, isProxy, verifyCaptcha, -} from "@fosscord/api"; +} from "@spacebar/api"; import bcrypt from "bcrypt"; import { HTTPError } from "lambert-server"; import { MoreThan } from "typeorm"; @@ -52,7 +52,7 @@ router.post( // They're a one time use token that bypasses registration limits ( rates, disabled reg, etc ) let regTokenUsed = false; if (req.get("Referrer") && req.get("Referrer")?.includes("token=")) { - // eg theyre on https://staging.fosscord.com/register?token=whatever + // eg theyre on https://staging.spacebar.chat/register?token=whatever const token = req.get("Referrer")?.split("token=")[1].split("&")[0]; if (token) { const regToken = await ValidRegistrationToken.findOneOrFail({ diff --git a/src/api/routes/auth/reset.ts b/src/api/routes/auth/reset.ts index a1fd218f..852a43c7 100644 --- a/src/api/routes/auth/reset.ts +++ b/src/api/routes/auth/reset.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { checkToken, Config, @@ -25,7 +25,7 @@ import { generateToken, PasswordResetSchema, User, -} from "@fosscord/util"; +} from "@spacebar/util"; import bcrypt from "bcrypt"; import { Request, Response, Router } from "express"; diff --git a/src/api/routes/auth/verify/index.ts b/src/api/routes/auth/verify/index.ts index 1cde3691..c1afcde9 100644 --- a/src/api/routes/auth/verify/index.ts +++ b/src/api/routes/auth/verify/index.ts @@ -16,14 +16,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { getIpAdress, route, verifyCaptcha } from "@fosscord/api"; +import { getIpAdress, route, verifyCaptcha } from "@spacebar/api"; import { checkToken, Config, FieldErrors, generateToken, User, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/auth/verify/resend.ts b/src/api/routes/auth/verify/resend.ts index d9751ee7..f2727abd 100644 --- a/src/api/routes/auth/verify/resend.ts +++ b/src/api/routes/auth/verify/resend.ts @@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; -import { Email, User } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { Email, User } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; const router = Router(); diff --git a/src/api/routes/auth/verify/view-backup-codes-challenge.ts b/src/api/routes/auth/verify/view-backup-codes-challenge.ts index e02e41f7..b12719ff 100644 --- a/src/api/routes/auth/verify/view-backup-codes-challenge.ts +++ b/src/api/routes/auth/verify/view-backup-codes-challenge.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; -import { FieldErrors, User, BackupCodesChallengeSchema } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { FieldErrors, User, BackupCodesChallengeSchema } from "@spacebar/util"; import bcrypt from "bcrypt"; const router = Router(); diff --git a/src/api/routes/channels/#channel_id/index.ts b/src/api/routes/channels/#channel_id/index.ts index 2033e444..db0d4242 100644 --- a/src/api/routes/channels/#channel_id/index.ts +++ b/src/api/routes/channels/#channel_id/index.ts @@ -25,9 +25,9 @@ import { Recipient, handleFile, ChannelModifySchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); // TODO: delete channel diff --git a/src/api/routes/channels/#channel_id/invites.ts b/src/api/routes/channels/#channel_id/invites.ts index 9bb54026..9f247fe8 100644 --- a/src/api/routes/channels/#channel_id/invites.ts +++ b/src/api/routes/channels/#channel_id/invites.ts @@ -18,8 +18,8 @@ import { Router, Request, Response } from "express"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; -import { random } from "@fosscord/api"; +import { route } from "@spacebar/api"; +import { random } from "@spacebar/api"; import { Channel, Invite, @@ -28,7 +28,7 @@ import { User, Guild, PublicInviteRelation, -} from "@fosscord/util"; +} from "@spacebar/util"; import { isTextChannel } from "./messages"; const router: Router = Router(); diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/ack.ts b/src/api/routes/channels/#channel_id/messages/#message_id/ack.ts index 42c1c346..f098fa8e 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/ack.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/ack.ts @@ -21,9 +21,9 @@ import { getPermission, MessageAckEvent, ReadState, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/crosspost.ts b/src/api/routes/channels/#channel_id/messages/#message_id/crosspost.ts index d2ece163..909a459e 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/crosspost.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/crosspost.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); 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 62e18be4..cd4b243e 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 @@ -20,7 +20,7 @@ import { Attachment, Channel, emitEvent, - FosscordApiErrors, + SpacebarApiErrors, getPermission, getRights, Message, @@ -31,11 +31,11 @@ import { uploadFile, MessageCreateSchema, MessageEditSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Router, Response, Request } from "express"; import multer from "multer"; -import { route } from "@fosscord/api"; -import { handleMessage, postHandleMessage } from "@fosscord/api"; +import { route } from "@spacebar/api"; +import { handleMessage, postHandleMessage } from "@spacebar/api"; import { HTTPError } from "lambert-server"; const router = Router(); @@ -163,14 +163,14 @@ router.put( const snowflake = Snowflake.deconstruct(message_id); if (Date.now() < snowflake.timestamp) { // message is in the future - throw FosscordApiErrors.CANNOT_BACKFILL_TO_THE_FUTURE; + throw SpacebarApiErrors.CANNOT_BACKFILL_TO_THE_FUTURE; } const exists = await Message.findOne({ where: { id: message_id, channel_id: channel_id }, }); if (exists) { - throw FosscordApiErrors.CANNOT_REPLACE_BY_BACKFILL; + throw SpacebarApiErrors.CANNOT_REPLACE_BY_BACKFILL; } if (req.file) { diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts b/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts index 5f86c966..eafa70c8 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts @@ -30,8 +30,8 @@ import { PartialEmoji, PublicUserProjection, User, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; import { Router, Response, Request } from "express"; import { HTTPError } from "lambert-server"; import { In } from "typeorm"; diff --git a/src/api/routes/channels/#channel_id/messages/bulk-delete.ts b/src/api/routes/channels/#channel_id/messages/bulk-delete.ts index d97b97e5..18476d5c 100644 --- a/src/api/routes/channels/#channel_id/messages/bulk-delete.ts +++ b/src/api/routes/channels/#channel_id/messages/bulk-delete.ts @@ -25,9 +25,9 @@ import { getRights, MessageDeleteBulkEvent, Message, -} from "@fosscord/util"; +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts index b68bbcd4..c871087a 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts @@ -36,9 +36,9 @@ import { Rights, Reaction, User, -} from "@fosscord/util"; +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { handleMessage, postHandleMessage, route } from "@fosscord/api"; +import { handleMessage, postHandleMessage, route } from "@spacebar/api"; import multer from "multer"; import { FindManyOptions, FindOperator, LessThan, MoreThan } from "typeorm"; import { URL } from "url"; @@ -146,7 +146,7 @@ router.get("/", async (req: Request, res: Response) => { x.author = User.create({ id: "4", discriminator: "0000", - username: "Fosscord Ghost", + username: "Spacebar Ghost", public_flags: 0, }); x.attachments?.forEach((y: Attachment) => { diff --git a/src/api/routes/channels/#channel_id/permissions.ts b/src/api/routes/channels/#channel_id/permissions.ts index 1794cd9a..68dbc2f2 100644 --- a/src/api/routes/channels/#channel_id/permissions.ts +++ b/src/api/routes/channels/#channel_id/permissions.ts @@ -24,11 +24,11 @@ import { Member, Role, ChannelPermissionOverwriteSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Router, Response, Request } from "express"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); // TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel) diff --git a/src/api/routes/channels/#channel_id/pins.ts b/src/api/routes/channels/#channel_id/pins.ts index bd4c6ae2..32820916 100644 --- a/src/api/routes/channels/#channel_id/pins.ts +++ b/src/api/routes/channels/#channel_id/pins.ts @@ -24,9 +24,9 @@ import { Message, MessageUpdateEvent, DiscordApiErrors, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/channels/#channel_id/purge.ts b/src/api/routes/channels/#channel_id/purge.ts index 5ff53129..c8da6760 100644 --- a/src/api/routes/channels/#channel_id/purge.ts +++ b/src/api/routes/channels/#channel_id/purge.ts @@ -17,7 +17,7 @@ */ import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { isTextChannel } from "./messages"; import { FindManyOptions, Between, Not, FindOperator } from "typeorm"; import { @@ -28,7 +28,7 @@ import { Message, MessageDeleteBulkEvent, PurgeSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Router, Response, Request } from "express"; const router: Router = Router(); diff --git a/src/api/routes/channels/#channel_id/recipients.ts b/src/api/routes/channels/#channel_id/recipients.ts index 4cdc55ed..f1fb48af 100644 --- a/src/api/routes/channels/#channel_id/recipients.ts +++ b/src/api/routes/channels/#channel_id/recipients.ts @@ -27,8 +27,8 @@ import { PublicUserProjection, Recipient, User, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/channels/#channel_id/typing.ts b/src/api/routes/channels/#channel_id/typing.ts index e697ac96..6a2fef39 100644 --- a/src/api/routes/channels/#channel_id/typing.ts +++ b/src/api/routes/channels/#channel_id/typing.ts @@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Channel, emitEvent, Member, TypingStartEvent } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { Channel, emitEvent, Member, TypingStartEvent } from "@spacebar/util"; +import { route } from "@spacebar/api"; import { Router, Request, Response } from "express"; const router: Router = Router(); diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts index d5dd2522..14791a1c 100644 --- a/src/api/routes/channels/#channel_id/webhooks.ts +++ b/src/api/routes/channels/#channel_id/webhooks.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { Channel, Config, @@ -27,10 +27,10 @@ import { Webhook, WebhookCreateSchema, WebhookType, -} from "@fosscord/util"; +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; import { isTextChannel } from "./messages/index"; -import { DiscordApiErrors } from "@fosscord/util"; +import { DiscordApiErrors } from "@spacebar/util"; import crypto from "crypto"; const router: Router = Router(); @@ -63,7 +63,7 @@ router.post( // TODO: move this if (name === "clyde") throw new HTTPError("Invalid name", 400); - if (name === "Fosscord Ghost") throw new HTTPError("Invalid name", 400); + if (name === "Spacebar Ghost") throw new HTTPError("Invalid name", 400); if (avatar) avatar = await handleFile(`/avatars/${channel_id}`, avatar); diff --git a/src/api/routes/discoverable-guilds.ts b/src/api/routes/discoverable-guilds.ts index 383fa298..75eb6088 100644 --- a/src/api/routes/discoverable-guilds.ts +++ b/src/api/routes/discoverable-guilds.ts @@ -16,10 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Guild, Config } from "@fosscord/util"; +import { Guild, Config } from "@spacebar/util"; import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { Like } from "typeorm"; const router = Router(); diff --git a/src/api/routes/discovery.ts b/src/api/routes/discovery.ts index f9f620fb..0c8089e4 100644 --- a/src/api/routes/discovery.ts +++ b/src/api/routes/discovery.ts @@ -16,9 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Categories } from "@fosscord/util"; +import { Categories } from "@spacebar/util"; import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/download.ts b/src/api/routes/download.ts index 916e9208..c4eea8e8 100644 --- a/src/api/routes/download.ts +++ b/src/api/routes/download.ts @@ -17,8 +17,8 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; -import { FieldErrors, Release } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { FieldErrors, Release } from "@spacebar/util"; const router = Router(); diff --git a/src/api/routes/experiments.ts b/src/api/routes/experiments.ts index a29dd894..cd206d79 100644 --- a/src/api/routes/experiments.ts +++ b/src/api/routes/experiments.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/gateway/bot.ts b/src/api/routes/gateway/bot.ts index 1cce93b0..243159ec 100644 --- a/src/api/routes/gateway/bot.ts +++ b/src/api/routes/gateway/bot.ts @@ -16,9 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Config } from "@fosscord/util"; +import { Config } from "@spacebar/util"; import { Router, Response, Request } from "express"; -import { route, RouteOptions } from "@fosscord/api"; +import { route, RouteOptions } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/gateway/index.ts b/src/api/routes/gateway/index.ts index ee500e9b..12e96919 100644 --- a/src/api/routes/gateway/index.ts +++ b/src/api/routes/gateway/index.ts @@ -16,9 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Config } from "@fosscord/util"; +import { Config } from "@spacebar/util"; import { Router, Response, Request } from "express"; -import { route, RouteOptions } from "@fosscord/api"; +import { route, RouteOptions } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/gifs/search.ts b/src/api/routes/gifs/search.ts index d3e8ef1c..fb99374b 100644 --- a/src/api/routes/gifs/search.ts +++ b/src/api/routes/gifs/search.ts @@ -19,7 +19,7 @@ import { Router, Response, Request } from "express"; import fetch from "node-fetch"; import ProxyAgent from "proxy-agent"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { getGifApiKey, parseGifResult } from "./trending"; const router = Router(); diff --git a/src/api/routes/gifs/trending-gifs.ts b/src/api/routes/gifs/trending-gifs.ts index a05bc9aa..238a2abd 100644 --- a/src/api/routes/gifs/trending-gifs.ts +++ b/src/api/routes/gifs/trending-gifs.ts @@ -19,7 +19,7 @@ import { Router, Response, Request } from "express"; import fetch from "node-fetch"; import ProxyAgent from "proxy-agent"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { getGifApiKey, parseGifResult } from "./trending"; const router = Router(); diff --git a/src/api/routes/gifs/trending.ts b/src/api/routes/gifs/trending.ts index e7b5f218..5cccdb2d 100644 --- a/src/api/routes/gifs/trending.ts +++ b/src/api/routes/gifs/trending.ts @@ -19,8 +19,8 @@ import { Router, Response, Request } from "express"; import fetch from "node-fetch"; import ProxyAgent from "proxy-agent"; -import { route } from "@fosscord/api"; -import { Config } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { Config } from "@spacebar/util"; import { HTTPError } from "lambert-server"; const router = Router(); diff --git a/src/api/routes/guild-recommendations.ts b/src/api/routes/guild-recommendations.ts index c6087386..67f43c14 100644 --- a/src/api/routes/guild-recommendations.ts +++ b/src/api/routes/guild-recommendations.ts @@ -16,10 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Guild, Config } from "@fosscord/util"; +import { Guild, Config } from "@spacebar/util"; import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { Like } from "typeorm"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/audit-logs.ts b/src/api/routes/guilds/#guild_id/audit-logs.ts index 82c4f254..5dbb0e3f 100644 --- a/src/api/routes/guilds/#guild_id/audit-logs.ts +++ b/src/api/routes/guilds/#guild_id/audit-logs.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); //TODO: implement audit logs diff --git a/src/api/routes/guilds/#guild_id/bans.ts b/src/api/routes/guilds/#guild_id/bans.ts index 3ecb31c3..31aed6b9 100644 --- a/src/api/routes/guilds/#guild_id/bans.ts +++ b/src/api/routes/guilds/#guild_id/bans.ts @@ -27,9 +27,9 @@ import { Member, BanRegistrySchema, BanModeratorSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { getIpAdress, route } from "@fosscord/api"; +import { getIpAdress, route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/guilds/#guild_id/channels.ts b/src/api/routes/guilds/#guild_id/channels.ts index 0f6225d7..d74d9f84 100644 --- a/src/api/routes/guilds/#guild_id/channels.ts +++ b/src/api/routes/guilds/#guild_id/channels.ts @@ -23,9 +23,9 @@ import { emitEvent, ChannelModifySchema, ChannelReorderSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/guilds/#guild_id/delete.ts b/src/api/routes/guilds/#guild_id/delete.ts index 184e1798..ec72a4ae 100644 --- a/src/api/routes/guilds/#guild_id/delete.ts +++ b/src/api/routes/guilds/#guild_id/delete.ts @@ -16,10 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { emitEvent, GuildDeleteEvent, Guild } from "@fosscord/util"; +import { emitEvent, GuildDeleteEvent, Guild } from "@spacebar/util"; import { Router, Request, Response } from "express"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/discovery-requirements.ts b/src/api/routes/guilds/#guild_id/discovery-requirements.ts index badde878..5e15676a 100644 --- a/src/api/routes/guilds/#guild_id/discovery-requirements.ts +++ b/src/api/routes/guilds/#guild_id/discovery-requirements.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/emojis.ts b/src/api/routes/guilds/#guild_id/emojis.ts index 85fcabc1..c661202e 100644 --- a/src/api/routes/guilds/#guild_id/emojis.ts +++ b/src/api/routes/guilds/#guild_id/emojis.ts @@ -29,8 +29,8 @@ import { User, EmojiCreateSchema, EmojiModifySchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/index.ts b/src/api/routes/guilds/#guild_id/index.ts index 49493342..672bc92e 100644 --- a/src/api/routes/guilds/#guild_id/index.ts +++ b/src/api/routes/guilds/#guild_id/index.ts @@ -27,10 +27,10 @@ import { handleFile, Member, GuildUpdateSchema, - FosscordApiErrors, -} from "@fosscord/util"; + SpacebarApiErrors, +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); @@ -113,7 +113,7 @@ router.patch( for (const feature of diff) { if (MUTABLE_FEATURES.includes(feature)) continue; - throw FosscordApiErrors.FEATURE_IS_IMMUTABLE.withParams( + throw SpacebarApiErrors.FEATURE_IS_IMMUTABLE.withParams( feature, ); } diff --git a/src/api/routes/guilds/#guild_id/integrations.ts b/src/api/routes/guilds/#guild_id/integrations.ts index d5318328..3d963af1 100644 --- a/src/api/routes/guilds/#guild_id/integrations.ts +++ b/src/api/routes/guilds/#guild_id/integrations.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); //TODO: implement integrations list diff --git a/src/api/routes/guilds/#guild_id/invites.ts b/src/api/routes/guilds/#guild_id/invites.ts index 04a89af7..9c446928 100644 --- a/src/api/routes/guilds/#guild_id/invites.ts +++ b/src/api/routes/guilds/#guild_id/invites.ts @@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Invite, PublicInviteRelation } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { Invite, PublicInviteRelation } from "@spacebar/util"; +import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/member-verification.ts b/src/api/routes/guilds/#guild_id/member-verification.ts index 7bb46cbc..242f3684 100644 --- a/src/api/routes/guilds/#guild_id/member-verification.ts +++ b/src/api/routes/guilds/#guild_id/member-verification.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts index e76c9607..a14691f2 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts @@ -29,8 +29,8 @@ import { Guild, handleFile, MemberChangeSchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts b/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts index ac40f0db..14e7467f 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts @@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { getPermission, Member, PermissionResolvable } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { getPermission, Member, PermissionResolvable } from "@spacebar/util"; +import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts b/src/api/routes/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts index 071883d6..698df88f 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts @@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Member } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { Member } from "@spacebar/util"; +import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/members/index.ts b/src/api/routes/guilds/#guild_id/members/index.ts index 87c2af20..f7a55cf1 100644 --- a/src/api/routes/guilds/#guild_id/members/index.ts +++ b/src/api/routes/guilds/#guild_id/members/index.ts @@ -17,8 +17,8 @@ */ import { Request, Response, Router } from "express"; -import { Member, PublicMemberProjection } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { Member, PublicMemberProjection } from "@spacebar/util"; +import { route } from "@spacebar/api"; import { MoreThan } from "typeorm"; import { HTTPError } from "lambert-server"; diff --git a/src/api/routes/guilds/#guild_id/messages/search.ts b/src/api/routes/guilds/#guild_id/messages/search.ts index b4869bc0..bc5f1b6e 100644 --- a/src/api/routes/guilds/#guild_id/messages/search.ts +++ b/src/api/routes/guilds/#guild_id/messages/search.ts @@ -19,8 +19,8 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; -import { getPermission, FieldErrors, Message, Channel } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { getPermission, FieldErrors, Message, Channel } from "@spacebar/util"; import { HTTPError } from "lambert-server"; import { FindManyOptions, In, Like } from "typeorm"; diff --git a/src/api/routes/guilds/#guild_id/premium.ts b/src/api/routes/guilds/#guild_id/premium.ts index 1a3a8497..7b343daf 100644 --- a/src/api/routes/guilds/#guild_id/premium.ts +++ b/src/api/routes/guilds/#guild_id/premium.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); router.get("/subscriptions", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/guilds/#guild_id/profile/index.ts b/src/api/routes/guilds/#guild_id/profile/index.ts index 1511fab4..8ec22ea4 100644 --- a/src/api/routes/guilds/#guild_id/profile/index.ts +++ b/src/api/routes/guilds/#guild_id/profile/index.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { emitEvent, GuildMemberUpdateEvent, @@ -24,7 +24,7 @@ import { Member, MemberChangeProfileSchema, OrmUtils, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/prune.ts b/src/api/routes/guilds/#guild_id/prune.ts index e29ef641..dbed546b 100644 --- a/src/api/routes/guilds/#guild_id/prune.ts +++ b/src/api/routes/guilds/#guild_id/prune.ts @@ -17,9 +17,9 @@ */ import { Router, Request, Response } from "express"; -import { Guild, Member, Snowflake } from "@fosscord/util"; +import { Guild, Member, Snowflake } from "@spacebar/util"; import { LessThan, IsNull } from "typeorm"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); //Returns all inactive members, respecting role hierarchy diff --git a/src/api/routes/guilds/#guild_id/regions.ts b/src/api/routes/guilds/#guild_id/regions.ts index 83dc9144..de1e8769 100644 --- a/src/api/routes/guilds/#guild_id/regions.ts +++ b/src/api/routes/guilds/#guild_id/regions.ts @@ -16,9 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Guild } from "@fosscord/util"; +import { Guild } from "@spacebar/util"; import { Request, Response, Router } from "express"; -import { getVoiceRegions, route, getIpAdress } from "@fosscord/api"; +import { getVoiceRegions, route, getIpAdress } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/roles/#role_id/index.ts b/src/api/routes/guilds/#guild_id/roles/#role_id/index.ts index f783e27b..de3fc35b 100644 --- a/src/api/routes/guilds/#guild_id/roles/#role_id/index.ts +++ b/src/api/routes/guilds/#guild_id/roles/#role_id/index.ts @@ -25,8 +25,8 @@ import { emitEvent, handleFile, RoleModifySchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; import { HTTPError } from "lambert-server"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/roles/index.ts b/src/api/routes/guilds/#guild_id/roles/index.ts index 6f3fab48..f93e9385 100644 --- a/src/api/routes/guilds/#guild_id/roles/index.ts +++ b/src/api/routes/guilds/#guild_id/roles/index.ts @@ -29,8 +29,8 @@ import { RoleModifySchema, RolePositionUpdateSchema, Snowflake, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; import { Not } from "typeorm"; const router: Router = Router(); diff --git a/src/api/routes/guilds/#guild_id/stickers.ts b/src/api/routes/guilds/#guild_id/stickers.ts index 3d0c494e..84a23670 100644 --- a/src/api/routes/guilds/#guild_id/stickers.ts +++ b/src/api/routes/guilds/#guild_id/stickers.ts @@ -26,9 +26,9 @@ import { StickerType, uploadFile, ModifyGuildStickerSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import multer from "multer"; import { HTTPError } from "lambert-server"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/templates.ts b/src/api/routes/guilds/#guild_id/templates.ts index 8a8c53fe..3bd28e05 100644 --- a/src/api/routes/guilds/#guild_id/templates.ts +++ b/src/api/routes/guilds/#guild_id/templates.ts @@ -17,10 +17,10 @@ */ import { Request, Response, Router } from "express"; -import { Guild, Template } from "@fosscord/util"; +import { Guild, Template } from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; -import { generateCode } from "@fosscord/api"; +import { route } from "@spacebar/api"; +import { generateCode } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/guilds/#guild_id/vanity-url.ts b/src/api/routes/guilds/#guild_id/vanity-url.ts index e97c92c5..c85c943f 100644 --- a/src/api/routes/guilds/#guild_id/vanity-url.ts +++ b/src/api/routes/guilds/#guild_id/vanity-url.ts @@ -22,9 +22,9 @@ import { Guild, Invite, VanityUrlSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { HTTPError } from "lambert-server"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts b/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts index 784d7746..791ac102 100644 --- a/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts +++ b/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts @@ -25,8 +25,8 @@ import { VoiceState, VoiceStateUpdateEvent, VoiceStateUpdateSchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/guilds/#guild_id/webhooks.ts b/src/api/routes/guilds/#guild_id/webhooks.ts index caa252d2..d58659a4 100644 --- a/src/api/routes/guilds/#guild_id/webhooks.ts +++ b/src/api/routes/guilds/#guild_id/webhooks.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); //TODO: implement webhooks diff --git a/src/api/routes/guilds/#guild_id/welcome-screen.ts b/src/api/routes/guilds/#guild_id/welcome-screen.ts index 938eef09..696e20db 100644 --- a/src/api/routes/guilds/#guild_id/welcome-screen.ts +++ b/src/api/routes/guilds/#guild_id/welcome-screen.ts @@ -17,9 +17,9 @@ */ import { Request, Response, Router } from "express"; -import { Guild, Member, GuildUpdateWelcomeScreenSchema } from "@fosscord/util"; +import { Guild, Member, GuildUpdateWelcomeScreenSchema } from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/guilds/#guild_id/widget.json.ts b/src/api/routes/guilds/#guild_id/widget.json.ts index 57186e80..1799f0be 100644 --- a/src/api/routes/guilds/#guild_id/widget.json.ts +++ b/src/api/routes/guilds/#guild_id/widget.json.ts @@ -17,9 +17,9 @@ */ import { Request, Response, Router } from "express"; -import { Permissions, Guild, Invite, Channel, Member } from "@fosscord/util"; +import { Permissions, Guild, Invite, Channel, Member } from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { random, route } from "@fosscord/api"; +import { random, route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/guilds/#guild_id/widget.png.ts b/src/api/routes/guilds/#guild_id/widget.png.ts index e4a7713c..4e975603 100644 --- a/src/api/routes/guilds/#guild_id/widget.png.ts +++ b/src/api/routes/guilds/#guild_id/widget.png.ts @@ -19,9 +19,9 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { Request, Response, Router } from "express"; -import { Guild } from "@fosscord/util"; +import { Guild } from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import fs from "fs"; import path from "path"; @@ -58,7 +58,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { const { loadImage } = require("canvas"); const sizeOf = require("image-size"); - // TODO: Widget style templates need Fosscord branding + // TODO: Widget style templates need Spacebar branding const source = path.join( __dirname, "..", diff --git a/src/api/routes/guilds/#guild_id/widget.ts b/src/api/routes/guilds/#guild_id/widget.ts index c8b47c4f..77af25dc 100644 --- a/src/api/routes/guilds/#guild_id/widget.ts +++ b/src/api/routes/guilds/#guild_id/widget.ts @@ -17,8 +17,8 @@ */ import { Request, Response, Router } from "express"; -import { Guild, WidgetModifySchema } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { Guild, WidgetModifySchema } from "@spacebar/util"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/guilds/index.ts b/src/api/routes/guilds/index.ts index 6b95bd97..c793d185 100644 --- a/src/api/routes/guilds/index.ts +++ b/src/api/routes/guilds/index.ts @@ -24,8 +24,8 @@ import { Member, DiscordApiErrors, GuildCreateSchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/guilds/templates/index.ts b/src/api/routes/guilds/templates/index.ts index df753a2c..bfbb7d3b 100644 --- a/src/api/routes/guilds/templates/index.ts +++ b/src/api/routes/guilds/templates/index.ts @@ -25,9 +25,9 @@ import { Config, Member, GuildTemplateCreateSchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; -import { DiscordApiErrors } from "@fosscord/util"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; +import { DiscordApiErrors } from "@spacebar/util"; import fetch from "node-fetch"; const router: Router = Router(); diff --git a/src/api/routes/invites/index.ts b/src/api/routes/invites/index.ts index 805e5e6e..6680e375 100644 --- a/src/api/routes/invites/index.ts +++ b/src/api/routes/invites/index.ts @@ -25,8 +25,8 @@ import { InviteDeleteEvent, User, PublicInviteRelation, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; import { HTTPError } from "lambert-server"; const router: Router = Router(); diff --git a/src/api/routes/oauth2/authorize.ts b/src/api/routes/oauth2/authorize.ts index b06be724..c041f671 100644 --- a/src/api/routes/oauth2/authorize.ts +++ b/src/api/routes/oauth2/authorize.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { ApiError, Application, @@ -27,7 +27,7 @@ import { Member, Permissions, User, -} from "@fosscord/util"; +} from "@spacebar/util"; const router = Router(); // TODO: scopes, other oauth types diff --git a/src/api/routes/oauth2/tokens.ts b/src/api/routes/oauth2/tokens.ts index cff33137..86290721 100644 --- a/src/api/routes/oauth2/tokens.ts +++ b/src/api/routes/oauth2/tokens.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/outbound-promotions.ts b/src/api/routes/outbound-promotions.ts index a260bb4c..1d4564da 100644 --- a/src/api/routes/outbound-promotions.ts +++ b/src/api/routes/outbound-promotions.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/partners/#guild_id/requirements.ts b/src/api/routes/partners/#guild_id/requirements.ts index badde878..5e15676a 100644 --- a/src/api/routes/partners/#guild_id/requirements.ts +++ b/src/api/routes/partners/#guild_id/requirements.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/ping.ts b/src/api/routes/ping.ts index 8deefd32..0fb6d9d0 100644 --- a/src/api/routes/ping.ts +++ b/src/api/routes/ping.ts @@ -17,8 +17,8 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; -import { Config } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { Config } from "@spacebar/util"; const router = Router(); diff --git a/src/api/routes/policies/instance/domains.ts b/src/api/routes/policies/instance/domains.ts index d97f8711..fe032b50 100644 --- a/src/api/routes/policies/instance/domains.ts +++ b/src/api/routes/policies/instance/domains.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; -import { Config } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { Config } from "@spacebar/util"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/policies/instance/index.ts b/src/api/routes/policies/instance/index.ts index 163c9c23..68ce3b42 100644 --- a/src/api/routes/policies/instance/index.ts +++ b/src/api/routes/policies/instance/index.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; -import { Config } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { Config } from "@spacebar/util"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/policies/instance/limits.ts b/src/api/routes/policies/instance/limits.ts index 732d8a48..a6f13170 100644 --- a/src/api/routes/policies/instance/limits.ts +++ b/src/api/routes/policies/instance/limits.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; -import { Config } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { Config } from "@spacebar/util"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/policies/stats.ts b/src/api/routes/policies/stats.ts index 764a5790..3939e1e8 100644 --- a/src/api/routes/policies/stats.ts +++ b/src/api/routes/policies/stats.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { Config, getRights, @@ -24,7 +24,7 @@ import { Member, Message, User, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/read-states/ack-bulk.ts b/src/api/routes/read-states/ack-bulk.ts index cab16c8c..2c51893b 100644 --- a/src/api/routes/read-states/ack-bulk.ts +++ b/src/api/routes/read-states/ack-bulk.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; -import { AckBulkSchema, ReadState } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { AckBulkSchema, ReadState } from "@spacebar/util"; const router = Router(); router.post( diff --git a/src/api/routes/scheduled-maintenances/upcoming_json.ts b/src/api/routes/scheduled-maintenances/upcoming_json.ts index b85d85fa..c1fc0ff3 100644 --- a/src/api/routes/scheduled-maintenances/upcoming_json.ts +++ b/src/api/routes/scheduled-maintenances/upcoming_json.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); router.get( diff --git a/src/api/routes/science.ts b/src/api/routes/science.ts index 52c6d903..099da18b 100644 --- a/src/api/routes/science.ts +++ b/src/api/routes/science.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/stage-instances.ts b/src/api/routes/stage-instances.ts index a260bb4c..1d4564da 100644 --- a/src/api/routes/stage-instances.ts +++ b/src/api/routes/stage-instances.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/sticker-packs/index.ts b/src/api/routes/sticker-packs/index.ts index d5c6cb11..234e03c6 100644 --- a/src/api/routes/sticker-packs/index.ts +++ b/src/api/routes/sticker-packs/index.ts @@ -17,8 +17,8 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; -import { StickerPack } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { StickerPack } from "@spacebar/util"; const router: Router = Router(); diff --git a/src/api/routes/stickers/#sticker_id/index.ts b/src/api/routes/stickers/#sticker_id/index.ts index 0c986320..360149b5 100644 --- a/src/api/routes/stickers/#sticker_id/index.ts +++ b/src/api/routes/stickers/#sticker_id/index.ts @@ -16,9 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Sticker } from "@fosscord/util"; +import { Sticker } from "@spacebar/util"; import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/stop.ts b/src/api/routes/stop.ts index a1761e67..6a6e6277 100644 --- a/src/api/routes/stop.ts +++ b/src/api/routes/stop.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/store/published-listings/applications.ts b/src/api/routes/store/published-listings/applications.ts index 483429e5..5ee63e53 100644 --- a/src/api/routes/store/published-listings/applications.ts +++ b/src/api/routes/store/published-listings/applications.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/store/published-listings/applications/#id/subscription-plans.ts b/src/api/routes/store/published-listings/applications/#id/subscription-plans.ts index 5bc36b7a..a15e0bf7 100644 --- a/src/api/routes/store/published-listings/applications/#id/subscription-plans.ts +++ b/src/api/routes/store/published-listings/applications/#id/subscription-plans.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/store/published-listings/skus.ts b/src/api/routes/store/published-listings/skus.ts index 483429e5..5ee63e53 100644 --- a/src/api/routes/store/published-listings/skus.ts +++ b/src/api/routes/store/published-listings/skus.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/store/published-listings/skus/#sku_id/subscription-plans.ts b/src/api/routes/store/published-listings/skus/#sku_id/subscription-plans.ts index 4d9f7cac..4ea35c18 100644 --- a/src/api/routes/store/published-listings/skus/#sku_id/subscription-plans.ts +++ b/src/api/routes/store/published-listings/skus/#sku_id/subscription-plans.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/teams.ts b/src/api/routes/teams.ts index bca5b915..26570165 100644 --- a/src/api/routes/teams.ts +++ b/src/api/routes/teams.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/template.ts.disabled b/src/api/routes/template.ts.disabled index fcc59ef4..c9d78a03 100644 --- a/src/api/routes/template.ts.disabled +++ b/src/api/routes/template.ts.disabled @@ -1,7 +1,7 @@ //TODO: this is a template for a generic route import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); router.get("/",route({}), async (req: Request, res: Response) => { diff --git a/src/api/routes/track.ts b/src/api/routes/track.ts index 52c6d903..099da18b 100644 --- a/src/api/routes/track.ts +++ b/src/api/routes/track.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/updates.ts b/src/api/routes/updates.ts index 2458871f..f7403899 100644 --- a/src/api/routes/updates.ts +++ b/src/api/routes/updates.ts @@ -17,8 +17,8 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; -import { FieldErrors, Release } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { FieldErrors, Release } from "@spacebar/util"; const router = Router(); diff --git a/src/api/routes/users/#id/delete.ts b/src/api/routes/users/#id/delete.ts index df9d1d6a..e36a35e6 100644 --- a/src/api/routes/users/#id/delete.ts +++ b/src/api/routes/users/#id/delete.ts @@ -16,14 +16,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { emitEvent, Member, PrivateUserProjection, User, UserDeleteEvent, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/#id/index.ts b/src/api/routes/users/#id/index.ts index 9d418bfd..0c7cfe37 100644 --- a/src/api/routes/users/#id/index.ts +++ b/src/api/routes/users/#id/index.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { User } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { User } from "@spacebar/util"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/#id/profile.ts b/src/api/routes/users/#id/profile.ts index 78e704ba..4727e215 100644 --- a/src/api/routes/users/#id/profile.ts +++ b/src/api/routes/users/#id/profile.ts @@ -25,8 +25,8 @@ import { PrivateUserProjection, emitEvent, UserUpdateEvent, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/#id/relationships.ts b/src/api/routes/users/#id/relationships.ts index 241b097d..dfe52a5e 100644 --- a/src/api/routes/users/#id/relationships.ts +++ b/src/api/routes/users/#id/relationships.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { User } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { User } from "@spacebar/util"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/activities/statistics/applications.ts b/src/api/routes/users/@me/activities/statistics/applications.ts index 222261bf..5e797ce8 100644 --- a/src/api/routes/users/@me/activities/statistics/applications.ts +++ b/src/api/routes/users/@me/activities/statistics/applications.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/affinities/guilds.ts b/src/api/routes/users/@me/affinities/guilds.ts index 752ab159..e4966148 100644 --- a/src/api/routes/users/@me/affinities/guilds.ts +++ b/src/api/routes/users/@me/affinities/guilds.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/affinities/users.ts b/src/api/routes/users/@me/affinities/users.ts index dfd84774..76fb8aa6 100644 --- a/src/api/routes/users/@me/affinities/users.ts +++ b/src/api/routes/users/@me/affinities/users.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/applications/#app_id/entitlements.ts b/src/api/routes/users/@me/applications/#app_id/entitlements.ts index a260bb4c..1d4564da 100644 --- a/src/api/routes/users/@me/applications/#app_id/entitlements.ts +++ b/src/api/routes/users/@me/applications/#app_id/entitlements.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/billing/country-code.ts b/src/api/routes/users/@me/billing/country-code.ts index ed6c19b9..2a43a396 100644 --- a/src/api/routes/users/@me/billing/country-code.ts +++ b/src/api/routes/users/@me/billing/country-code.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/billing/payment-sources.ts b/src/api/routes/users/@me/billing/payment-sources.ts index 222261bf..5e797ce8 100644 --- a/src/api/routes/users/@me/billing/payment-sources.ts +++ b/src/api/routes/users/@me/billing/payment-sources.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/billing/subscriptions.ts b/src/api/routes/users/@me/billing/subscriptions.ts index a260bb4c..1d4564da 100644 --- a/src/api/routes/users/@me/billing/subscriptions.ts +++ b/src/api/routes/users/@me/billing/subscriptions.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/channels.ts b/src/api/routes/users/@me/channels.ts index 3c94826f..04db4fe9 100644 --- a/src/api/routes/users/@me/channels.ts +++ b/src/api/routes/users/@me/channels.ts @@ -22,8 +22,8 @@ import { DmChannelDTO, Channel, DmChannelCreateSchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/connections.ts b/src/api/routes/users/@me/connections.ts index a260bb4c..1d4564da 100644 --- a/src/api/routes/users/@me/connections.ts +++ b/src/api/routes/users/@me/connections.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/delete.ts b/src/api/routes/users/@me/delete.ts index e73a7f45..dce737fc 100644 --- a/src/api/routes/users/@me/delete.ts +++ b/src/api/routes/users/@me/delete.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { Member, User } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { Member, User } from "@spacebar/util"; +import { route } from "@spacebar/api"; import bcrypt from "bcrypt"; import { HTTPError } from "lambert-server"; diff --git a/src/api/routes/users/@me/devices.ts b/src/api/routes/users/@me/devices.ts index 52c6d903..099da18b 100644 --- a/src/api/routes/users/@me/devices.ts +++ b/src/api/routes/users/@me/devices.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/disable.ts b/src/api/routes/users/@me/disable.ts index 15e5d9e1..d123a6a1 100644 --- a/src/api/routes/users/@me/disable.ts +++ b/src/api/routes/users/@me/disable.ts @@ -16,9 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { User } from "@fosscord/util"; +import { User } from "@spacebar/util"; import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import bcrypt from "bcrypt"; const router = Router(); diff --git a/src/api/routes/users/@me/email-settings.ts b/src/api/routes/users/@me/email-settings.ts index 8d4e7873..4c9e16b1 100644 --- a/src/api/routes/users/@me/email-settings.ts +++ b/src/api/routes/users/@me/email-settings.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/entitlements.ts b/src/api/routes/users/@me/entitlements.ts index ff088314..7f552622 100644 --- a/src/api/routes/users/@me/entitlements.ts +++ b/src/api/routes/users/@me/entitlements.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/guilds.ts b/src/api/routes/users/@me/guilds.ts index 0de574fc..b16b909d 100644 --- a/src/api/routes/users/@me/guilds.ts +++ b/src/api/routes/users/@me/guilds.ts @@ -25,9 +25,9 @@ import { GuildMemberRemoveEvent, emitEvent, Config, -} from "@fosscord/util"; +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/guilds/#guild_id/settings.ts b/src/api/routes/users/@me/guilds/#guild_id/settings.ts index 9cdc90e6..7e9f2a08 100644 --- a/src/api/routes/users/@me/guilds/#guild_id/settings.ts +++ b/src/api/routes/users/@me/guilds/#guild_id/settings.ts @@ -22,8 +22,8 @@ import { Member, OrmUtils, UserGuildSettingsSchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/guilds/premium/subscription-slots.ts b/src/api/routes/users/@me/guilds/premium/subscription-slots.ts index 222261bf..5e797ce8 100644 --- a/src/api/routes/users/@me/guilds/premium/subscription-slots.ts +++ b/src/api/routes/users/@me/guilds/premium/subscription-slots.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts index 79bb85f8..b3eeb964 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts @@ -28,8 +28,8 @@ import { Config, UserModifySchema, generateToken, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; import bcrypt from "bcrypt"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/library.ts b/src/api/routes/users/@me/library.ts index eacbd039..54d9b04f 100644 --- a/src/api/routes/users/@me/library.ts +++ b/src/api/routes/users/@me/library.ts @@ -17,7 +17,7 @@ */ import { Router, Response, Request } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/mfa/codes-verification.ts b/src/api/routes/users/@me/mfa/codes-verification.ts index e202dc56..69d45e91 100644 --- a/src/api/routes/users/@me/mfa/codes-verification.ts +++ b/src/api/routes/users/@me/mfa/codes-verification.ts @@ -17,14 +17,14 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { BackupCode, generateMfaBackupCodes, User, CodesVerificationSchema, DiscordApiErrors, -} from "@fosscord/util"; +} from "@spacebar/util"; const router = Router(); diff --git a/src/api/routes/users/@me/mfa/codes.ts b/src/api/routes/users/@me/mfa/codes.ts index c9f73ce6..4ddbf78e 100644 --- a/src/api/routes/users/@me/mfa/codes.ts +++ b/src/api/routes/users/@me/mfa/codes.ts @@ -17,14 +17,14 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { BackupCode, FieldErrors, generateMfaBackupCodes, User, MfaCodesSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import bcrypt from "bcrypt"; const router = Router(); diff --git a/src/api/routes/users/@me/mfa/totp/disable.ts b/src/api/routes/users/@me/mfa/totp/disable.ts index f2a63aab..9f406423 100644 --- a/src/api/routes/users/@me/mfa/totp/disable.ts +++ b/src/api/routes/users/@me/mfa/totp/disable.ts @@ -17,7 +17,7 @@ */ import { Router, Request, Response } from "express"; -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { verifyToken } from "node-2fa"; import { HTTPError } from "lambert-server"; import { @@ -25,7 +25,7 @@ import { generateToken, BackupCode, TotpDisableSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; const router = Router(); diff --git a/src/api/routes/users/@me/mfa/totp/enable.ts b/src/api/routes/users/@me/mfa/totp/enable.ts index 9baf7657..4d6b2763 100644 --- a/src/api/routes/users/@me/mfa/totp/enable.ts +++ b/src/api/routes/users/@me/mfa/totp/enable.ts @@ -22,8 +22,8 @@ import { generateToken, generateMfaBackupCodes, TotpEnableSchema, -} from "@fosscord/util"; -import { route } from "@fosscord/api"; +} from "@spacebar/util"; +import { route } from "@spacebar/api"; import bcrypt from "bcrypt"; import { HTTPError } from "lambert-server"; import { verifyToken } from "node-2fa"; diff --git a/src/api/routes/users/@me/mfa/webauthn/credentials/#key_id/index.ts b/src/api/routes/users/@me/mfa/webauthn/credentials/#key_id/index.ts index 54c3d9c7..04aca7e4 100644 --- a/src/api/routes/users/@me/mfa/webauthn/credentials/#key_id/index.ts +++ b/src/api/routes/users/@me/mfa/webauthn/credentials/#key_id/index.ts @@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; -import { SecurityKey, User } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { SecurityKey, User } from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/mfa/webauthn/credentials/index.ts b/src/api/routes/users/@me/mfa/webauthn/credentials/index.ts index 8cc60d58..29dbb7cf 100644 --- a/src/api/routes/users/@me/mfa/webauthn/credentials/index.ts +++ b/src/api/routes/users/@me/mfa/webauthn/credentials/index.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { route } from "@fosscord/api"; +import { route } from "@spacebar/api"; import { CreateWebAuthnCredentialSchema, DiscordApiErrors, @@ -28,7 +28,7 @@ import { verifyWebAuthnToken, WebAuthn, WebAuthnPostSchema, -} from "@fosscord/util"; +} from "@spacebar/util"; import bcrypt from "bcrypt"; import { Request, Response, Router } from "express"; import { ExpectedAttestationResult } from "fido2-lib"; diff --git a/src/api/routes/users/@me/notes.ts b/src/api/routes/users/@me/notes.ts index 87d45277..d05c799c 100644 --- a/src/api/routes/users/@me/notes.ts +++ b/src/api/routes/users/@me/notes.ts @@ -17,8 +17,8 @@ */ import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; -import { User, Note, emitEvent, Snowflake } from "@fosscord/util"; +import { route } from "@spacebar/api"; +import { User, Note, emitEvent, Snowflake } from "@spacebar/util"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/relationships.ts b/src/api/routes/users/@me/relationships.ts index 268e5660..e9ea47e6 100644 --- a/src/api/routes/users/@me/relationships.ts +++ b/src/api/routes/users/@me/relationships.ts @@ -25,11 +25,11 @@ import { emitEvent, Relationship, Config, -} from "@fosscord/util"; +} from "@spacebar/util"; import { Router, Response, Request } from "express"; import { HTTPError } from "lambert-server"; -import { DiscordApiErrors } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { DiscordApiErrors } from "@spacebar/util"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/users/@me/settings.ts b/src/api/routes/users/@me/settings.ts index e91597e4..62cfe904 100644 --- a/src/api/routes/users/@me/settings.ts +++ b/src/api/routes/users/@me/settings.ts @@ -17,8 +17,8 @@ */ import { Router, Response, Request } from "express"; -import { User, UserSettingsSchema } from "@fosscord/util"; -import { route } from "@fosscord/api"; +import { User, UserSettingsSchema } from "@spacebar/util"; +import { route } from "@spacebar/api"; const router = Router(); diff --git a/src/api/routes/voice/regions.ts b/src/api/routes/voice/regions.ts index 8ff52bca..59bac07f 100644 --- a/src/api/routes/voice/regions.ts +++ b/src/api/routes/voice/regions.ts @@ -17,8 +17,8 @@ */ import { Router, Request, Response } from "express"; -import { getIpAdress, route } from "@fosscord/api"; -import { getVoiceRegions } from "@fosscord/api"; +import { getIpAdress, route } from "@spacebar/api"; +import { getVoiceRegions } from "@spacebar/api"; const router: Router = Router(); diff --git a/src/api/start.ts b/src/api/start.ts index 6d35c67b..088c6f8d 100644 --- a/src/api/start.ts +++ b/src/api/start.ts @@ -23,7 +23,7 @@ process.on("unhandledRejection", console.error); import "missing-native-js-functions"; import { config } from "dotenv"; config(); -import { FosscordServer } from "./Server"; +import { SpacebarServer } from "./Server"; import cluster from "cluster"; import os from "os"; let cores = 1; @@ -48,7 +48,7 @@ if (cluster.isPrimary && process.env.NODE_ENV == "production") { } else { const port = Number(process.env.PORT) || 3001; - const server = new FosscordServer({ port }); + const server = new SpacebarServer({ port }); server.start().catch(console.error); // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/src/api/util/handlers/Instance.ts b/src/api/util/handlers/Instance.ts index bd9bf394..ccd56d92 100644 --- a/src/api/util/handlers/Instance.ts +++ b/src/api/util/handlers/Instance.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Session } from "@fosscord/util"; +import { Session } from "@spacebar/util"; export async function initInstance() { // TODO: clean up database and delete tombstone data diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index 65dbcdfe..6172a3d0 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -41,10 +41,10 @@ import { Sticker, MessageCreateSchema, EmbedCache, -} from "@fosscord/util"; +} from "@spacebar/util"; import { HTTPError } from "lambert-server"; import { In } from "typeorm"; -import { EmbedHandlers } from "@fosscord/api"; +import { EmbedHandlers } from "@spacebar/api"; import * as Sentry from "@sentry/node"; const allow_empty = false; // TODO: check webhook, application, system author, stickers diff --git a/src/api/util/handlers/Voice.ts b/src/api/util/handlers/Voice.ts index 0880ab98..db06bd33 100644 --- a/src/api/util/handlers/Voice.ts +++ b/src/api/util/handlers/Voice.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Config } from "@fosscord/util"; +import { Config } from "@spacebar/util"; import { distanceBetweenLocations, IPAnalysis } from "../utility/ipAddress"; export async function getVoiceRegions(ipAddress: string, vip: boolean) { diff --git a/src/api/util/handlers/route.ts b/src/api/util/handlers/route.ts index b0bc3af7..604df4e9 100644 --- a/src/api/util/handlers/route.ts +++ b/src/api/util/handlers/route.ts @@ -21,7 +21,7 @@ import { DiscordApiErrors, EVENT, FieldErrors, - FosscordApiErrors, + SpacebarApiErrors, getPermission, getRights, normalizeBody, @@ -29,7 +29,7 @@ import { Permissions, RightResolvable, Rights, -} from "@fosscord/util"; +} from "@spacebar/util"; import { NextFunction, Request, Response } from "express"; import { AnyValidateFunction } from "ajv/dist/core"; @@ -91,7 +91,7 @@ export function route(opts: RouteOptions) { req.rights = await getRights(req.user_id); if (!req.rights || !req.rights.has(required)) { - throw FosscordApiErrors.MISSING_RIGHTS.withParams( + throw SpacebarApiErrors.MISSING_RIGHTS.withParams( opts.right as string, ); } diff --git a/src/api/util/utility/EmbedHandlers.ts b/src/api/util/utility/EmbedHandlers.ts index 1e84e31a..15e3f67f 100644 --- a/src/api/util/utility/EmbedHandlers.ts +++ b/src/api/util/utility/EmbedHandlers.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Config, Embed, EmbedType } from "@fosscord/util"; +import { Config, Embed, EmbedType } from "@spacebar/util"; import fetch, { RequestInit } from "node-fetch"; import * as cheerio from "cheerio"; import probe from "probe-image-size"; @@ -28,7 +28,7 @@ export const DEFAULT_FETCH_OPTIONS: RequestInit = { follow: 1, headers: { "user-agent": - "Mozilla/5.0 (compatible; Fosscord/1.0; +https://github.com/fosscord/fosscord)", + "Mozilla/5.0 (compatible; Spacebar/1.0; +https://github.com/spacebarchat/server)", }, // size: 1024 * 1024 * 5, // grabbed from config later compress: true, @@ -67,7 +67,7 @@ export const getProxyUrl = ( console.log( "[Embeds]", yellow( - "Imagor has not been set up correctly. https://docs.fosscord.com/setup/server/configuration/imagor/", + "Imagor has not been set up correctly. https://docs.spacebar.chat/setup/server/configuration/imagor/", ), ); } diff --git a/src/api/util/utility/RandomInviteID.ts b/src/api/util/utility/RandomInviteID.ts index e3eda606..926750d3 100644 --- a/src/api/util/utility/RandomInviteID.ts +++ b/src/api/util/utility/RandomInviteID.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Snowflake } from "@fosscord/util"; +import { Snowflake } from "@spacebar/util"; import crypto from "crypto"; // TODO: 'random'? seriously? who named this? diff --git a/src/api/util/utility/String.ts b/src/api/util/utility/String.ts index 7bc752f5..eef69e39 100644 --- a/src/api/util/utility/String.ts +++ b/src/api/util/utility/String.ts @@ -18,7 +18,7 @@ import { Request } from "express"; import { ntob } from "./Base64"; -import { FieldErrors } from "@fosscord/util"; +import { FieldErrors } from "@spacebar/util"; export function checkLength( str: string, diff --git a/src/api/util/utility/captcha.ts b/src/api/util/utility/captcha.ts index 28dba44b..db1b7957 100644 --- a/src/api/util/utility/captcha.ts +++ b/src/api/util/utility/captcha.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Config } from "@fosscord/util"; +import { Config } from "@spacebar/util"; import fetch from "node-fetch"; export interface hcaptchaResponse { @@ -49,7 +49,7 @@ export async function verifyCaptcha(response: string, ip?: string) { if (!service || !secret || !sitekey) throw new Error( - "CAPTCHA is not configured correctly. https://docs.fosscord.com/setup/server/security/captcha/", + "CAPTCHA is not configured correctly. https://docs.spacebar.chat/setup/server/security/captcha/", ); const res = await fetch(verifyEndpoints[service], { diff --git a/src/api/util/utility/ipAddress.ts b/src/api/util/utility/ipAddress.ts index 4ae316fa..172e9604 100644 --- a/src/api/util/utility/ipAddress.ts +++ b/src/api/util/utility/ipAddress.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Config } from "@fosscord/util"; +import { Config } from "@spacebar/util"; import { Request } from "express"; // use ipdata package instead of simple fetch because of integrated caching import fetch from "node-fetch"; diff --git a/src/api/util/utility/passwordStrength.ts b/src/api/util/utility/passwordStrength.ts index 4f3914c5..fd627fbf 100644 --- a/src/api/util/utility/passwordStrength.ts +++ b/src/api/util/utility/passwordStrength.ts @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Config } from "@fosscord/util"; +import { Config } from "@spacebar/util"; import "missing-native-js-functions"; const reNUMBER = /[0-9]/g; |