summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/Server.ts9
-rw-r--r--src/api/routes/v0/applications/#id/skus.ts1
-rw-r--r--src/api/routes/v9/auth/location-metadata.ts3
-rw-r--r--src/api/routes/v9/channels/#channel_id/messages/index.ts12
-rw-r--r--src/api/routes/v9/channels/#channel_id/webhooks.ts2
-rw-r--r--src/api/routes/v9/guild-recommendations.ts2
-rw-r--r--src/api/routes/v9/guilds/#guild_id/delete.ts12
-rw-r--r--src/api/routes/v9/guilds/#guild_id/discovery-requirements.ts2
-rw-r--r--src/api/routes/v9/guilds/#guild_id/invites.ts2
-rw-r--r--src/api/routes/v9/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts2
-rw-r--r--src/api/routes/v9/guilds/#guild_id/regions.ts5
-rw-r--r--src/api/routes/v9/oauth2/authorize.ts3
-rw-r--r--src/api/routes/v9/users/@me/delete.ts2
-rw-r--r--src/api/routes/v9/users/@me/relationships.ts2
-rw-r--r--src/api/routes/v9/users/@me/settings.ts2
-rw-r--r--src/api/routes/v9/voice/regions.ts3
16 files changed, 20 insertions, 44 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts
index 088c1953..61fcca81 100644
--- a/src/api/Server.ts
+++ b/src/api/Server.ts
@@ -1,7 +1,13 @@
 import "missing-native-js-functions";
 import { Server, ServerOptions } from "lambert-server";
 import { Authentication, CORS } from "./middlewares/";
-import { Config, initDatabase, initEvent, Sentry } from "@fosscord/util";
+import {
+	Config,
+	initDatabase,
+	initEvent,
+	Sentry,
+	registerRoutes,
+} from "@fosscord/util";
 import { ErrorHandler } from "./middlewares/ErrorHandler";
 import { BodyParser } from "./middlewares/BodyParser";
 import { Router, Request, Response, NextFunction } from "express";
@@ -11,7 +17,6 @@ import TestClient from "./middlewares/TestClient";
 import { initTranslation } from "./middlewares/Translation";
 import morgan from "morgan";
 import { initInstance } from "./util/handlers/Instance";
-import { registerRoutes } from "@fosscord/util";
 import { red } from "picocolors";
 
 export interface FosscordServerOptions extends ServerOptions {}
diff --git a/src/api/routes/v0/applications/#id/skus.ts b/src/api/routes/v0/applications/#id/skus.ts
index 2383e6f7..86e36558 100644
--- a/src/api/routes/v0/applications/#id/skus.ts
+++ b/src/api/routes/v0/applications/#id/skus.ts
@@ -1,6 +1,5 @@
 import { Request, Response, Router } from "express";
 import { route } from "@fosscord/api";
-import { Application, OrmUtils, Team, trimSpecial, User } from "@fosscord/util";
 
 const router: Router = Router();
 
diff --git a/src/api/routes/v9/auth/location-metadata.ts b/src/api/routes/v9/auth/location-metadata.ts
index 0ae946ed..5b86efc8 100644
--- a/src/api/routes/v9/auth/location-metadata.ts
+++ b/src/api/routes/v9/auth/location-metadata.ts
@@ -1,6 +1,5 @@
 import { Router, Request, Response } from "express";
-import { route } from "@fosscord/api";
-import { getIpAdress, IPAnalysis } from "@fosscord/api";
+import { route, getIpAdress, IPAnalysis } from "@fosscord/api";
 const router = Router();
 
 router.get("/", route({}), async (req: Request, res: Response) => {
diff --git a/src/api/routes/v9/channels/#channel_id/messages/index.ts b/src/api/routes/v9/channels/#channel_id/messages/index.ts
index d8c69dd0..c2ff12fd 100644
--- a/src/api/routes/v9/channels/#channel_id/messages/index.ts
+++ b/src/api/routes/v9/channels/#channel_id/messages/index.ts
@@ -2,7 +2,6 @@ import { Router, Response, Request } from "express";
 import {
 	Attachment,
 	Channel,
-	ChannelType,
 	Config,
 	DmChannelDTO,
 	emitEvent,
@@ -13,22 +12,13 @@ import {
 	Snowflake,
 	uploadFile,
 	Member,
-	Role,
 	MessageCreateSchema,
 	ReadState,
-	DiscordApiErrors,
-	getRights,
 	Rights,
 } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
-import {
-	handleMessage,
-	postHandleMessage,
-	route,
-	getIpAdress,
-} from "@fosscord/api";
+import { handleMessage, postHandleMessage, route } from "@fosscord/api";
 import multer from "multer";
-import { yellow } from "picocolors";
 import { FindManyOptions, LessThan, MoreThan } from "typeorm";
 import { URL } from "url";
 
diff --git a/src/api/routes/v9/channels/#channel_id/webhooks.ts b/src/api/routes/v9/channels/#channel_id/webhooks.ts
index 9af188f0..d786497a 100644
--- a/src/api/routes/v9/channels/#channel_id/webhooks.ts
+++ b/src/api/routes/v9/channels/#channel_id/webhooks.ts
@@ -9,9 +9,9 @@ import {
 	Webhook,
 	WebhookCreateSchema,
 	WebhookType,
+	DiscordApiErrors,
 } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
-import { DiscordApiErrors } from "@fosscord/util";
 import crypto from "crypto";
 
 const router: Router = Router();
diff --git a/src/api/routes/v9/guild-recommendations.ts b/src/api/routes/v9/guild-recommendations.ts
index 8ee7fe66..a7a8040b 100644
--- a/src/api/routes/v9/guild-recommendations.ts
+++ b/src/api/routes/v9/guild-recommendations.ts
@@ -10,7 +10,7 @@ router.get("/", route({}), async (req: Request, res: Response) => {
 	const { limit, personalization_disabled } = req.query;
 	let showAllGuilds = Config.get().guild.discovery.showAllGuilds;
 
-	const genLoadId = (size: Number) =>
+	const genLoadId = (size: number) =>
 		[...Array(size)]
 			.map(() => Math.floor(Math.random() * 16).toString(16))
 			.join("");
diff --git a/src/api/routes/v9/guilds/#guild_id/delete.ts b/src/api/routes/v9/guilds/#guild_id/delete.ts
index 2c15e0de..3e9d4ef6 100644
--- a/src/api/routes/v9/guilds/#guild_id/delete.ts
+++ b/src/api/routes/v9/guilds/#guild_id/delete.ts
@@ -1,14 +1,4 @@
-import {
-	Channel,
-	emitEvent,
-	GuildDeleteEvent,
-	Guild,
-	Member,
-	Message,
-	Role,
-	Invite,
-	Emoji,
-} from "@fosscord/util";
+import { emitEvent, GuildDeleteEvent, Guild } from "@fosscord/util";
 import { Router, Request, Response } from "express";
 import { HTTPError } from "lambert-server";
 import { route } from "@fosscord/api";
diff --git a/src/api/routes/v9/guilds/#guild_id/discovery-requirements.ts b/src/api/routes/v9/guilds/#guild_id/discovery-requirements.ts
index 7e63c06b..a7797c83 100644
--- a/src/api/routes/v9/guilds/#guild_id/discovery-requirements.ts
+++ b/src/api/routes/v9/guilds/#guild_id/discovery-requirements.ts
@@ -1,5 +1,3 @@
-import { Guild, Config } from "@fosscord/util";
-
 import { Router, Request, Response } from "express";
 import { route } from "@fosscord/api";
 
diff --git a/src/api/routes/v9/guilds/#guild_id/invites.ts b/src/api/routes/v9/guilds/#guild_id/invites.ts
index 4d033e9c..cdba51b5 100644
--- a/src/api/routes/v9/guilds/#guild_id/invites.ts
+++ b/src/api/routes/v9/guilds/#guild_id/invites.ts
@@ -1,4 +1,4 @@
-import { getPermission, Invite, PublicInviteRelation } from "@fosscord/util";
+import { Invite, PublicInviteRelation } from "@fosscord/util";
 import { route } from "@fosscord/api";
 import { Request, Response, Router } from "express";
 
diff --git a/src/api/routes/v9/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts b/src/api/routes/v9/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts
index c0383912..4e80ba21 100644
--- a/src/api/routes/v9/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts
+++ b/src/api/routes/v9/guilds/#guild_id/members/#member_id/roles/#role_id/index.ts
@@ -1,4 +1,4 @@
-import { getPermission, Member } from "@fosscord/util";
+import { Member } from "@fosscord/util";
 import { route } from "@fosscord/api";
 import { Request, Response, Router } from "express";
 
diff --git a/src/api/routes/v9/guilds/#guild_id/regions.ts b/src/api/routes/v9/guilds/#guild_id/regions.ts
index 0b275ea4..49ec4531 100644
--- a/src/api/routes/v9/guilds/#guild_id/regions.ts
+++ b/src/api/routes/v9/guilds/#guild_id/regions.ts
@@ -1,7 +1,6 @@
-import { Config, Guild, Member } from "@fosscord/util";
+import { Guild } from "@fosscord/util";
 import { Request, Response, Router } from "express";
-import { getVoiceRegions, route } from "@fosscord/api";
-import { getIpAdress } from "@fosscord/api";
+import { getVoiceRegions, route, getIpAdress } from "@fosscord/api";
 
 const router = Router();
 
diff --git a/src/api/routes/v9/oauth2/authorize.ts b/src/api/routes/v9/oauth2/authorize.ts
index 6374972e..779545b6 100644
--- a/src/api/routes/v9/oauth2/authorize.ts
+++ b/src/api/routes/v9/oauth2/authorize.ts
@@ -9,9 +9,6 @@ import {
 	Member,
 	Permissions,
 	User,
-	getRights,
-	Rights,
-	MemberPrivateProjection,
 } from "@fosscord/util";
 const router = Router();
 
diff --git a/src/api/routes/v9/users/@me/delete.ts b/src/api/routes/v9/users/@me/delete.ts
index a9f8167c..e0173d5b 100644
--- a/src/api/routes/v9/users/@me/delete.ts
+++ b/src/api/routes/v9/users/@me/delete.ts
@@ -1,5 +1,5 @@
 import { Router, Request, Response } from "express";
-import { Guild, Member, User } from "@fosscord/util";
+import { Member, User } from "@fosscord/util";
 import { route } from "@fosscord/api";
 import bcrypt from "bcrypt";
 import { HTTPError } from "lambert-server";
diff --git a/src/api/routes/v9/users/@me/relationships.ts b/src/api/routes/v9/users/@me/relationships.ts
index 6b5d429c..318c26d6 100644
--- a/src/api/routes/v9/users/@me/relationships.ts
+++ b/src/api/routes/v9/users/@me/relationships.ts
@@ -7,10 +7,10 @@ import {
 	emitEvent,
 	Relationship,
 	Config,
+	DiscordApiErrors,
 } from "@fosscord/util";
 import { Router, Response, Request } from "express";
 import { HTTPError } from "lambert-server";
-import { DiscordApiErrors } from "@fosscord/util";
 import { route } from "@fosscord/api";
 
 const router = Router();
diff --git a/src/api/routes/v9/users/@me/settings.ts b/src/api/routes/v9/users/@me/settings.ts
index cce366ac..07a237da 100644
--- a/src/api/routes/v9/users/@me/settings.ts
+++ b/src/api/routes/v9/users/@me/settings.ts
@@ -1,5 +1,5 @@
 import { Router, Response, Request } from "express";
-import { OrmUtils, User, UserSettingsSchema } from "@fosscord/util";
+import { User, UserSettingsSchema } from "@fosscord/util";
 import { route } from "@fosscord/api";
 
 const router = Router();
diff --git a/src/api/routes/v9/voice/regions.ts b/src/api/routes/v9/voice/regions.ts
index 4de304ee..c174e98d 100644
--- a/src/api/routes/v9/voice/regions.ts
+++ b/src/api/routes/v9/voice/regions.ts
@@ -1,6 +1,5 @@
 import { Router, Request, Response } from "express";
-import { getIpAdress, route } from "@fosscord/api";
-import { getVoiceRegions } from "@fosscord/api";
+import { getIpAdress, route, getVoiceRegions } from "@fosscord/api";
 
 const router: Router = Router();