summary refs log tree commit diff
path: root/api/src/routes/guilds
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-12 21:09:29 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-12 21:09:29 +0200
commit60535f5159a8674874c0a2e319d46400184bd22e (patch)
treeb9c0510b8a5e837d05987a5bf45afb4037044d52 /api/src/routes/guilds
parentMerge pull request #348 from AlTech98/fix-cdn-upload (diff)
downloadserver-60535f5159a8674874c0a2e319d46400184bd22e.tar.xz
:art: remove long relatives paths -> short module paths
Diffstat (limited to 'api/src/routes/guilds')
-rw-r--r--api/src/routes/guilds/#guild_id/bans.ts5
-rw-r--r--api/src/routes/guilds/#guild_id/channels.ts2
-rw-r--r--api/src/routes/guilds/#guild_id/index.ts4
-rw-r--r--api/src/routes/guilds/#guild_id/members/#member_id/index.ts4
-rw-r--r--api/src/routes/guilds/#guild_id/members/index.ts2
-rw-r--r--api/src/routes/guilds/#guild_id/regions.ts6
-rw-r--r--api/src/routes/guilds/#guild_id/roles.ts2
-rw-r--r--api/src/routes/guilds/#guild_id/templates.ts4
-rw-r--r--api/src/routes/guilds/#guild_id/vanity-url.ts2
-rw-r--r--api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts8
-rw-r--r--api/src/routes/guilds/#guild_id/voice-states/@me/index.ts8
-rw-r--r--api/src/routes/guilds/#guild_id/welcome_screen.ts2
-rw-r--r--api/src/routes/guilds/#guild_id/widget.json.ts2
-rw-r--r--api/src/routes/guilds/#guild_id/widget.ts2
-rw-r--r--api/src/routes/guilds/index.ts2
-rw-r--r--api/src/routes/guilds/templates/index.ts2
16 files changed, 28 insertions, 29 deletions
diff --git a/api/src/routes/guilds/#guild_id/bans.ts b/api/src/routes/guilds/#guild_id/bans.ts
index 31aa2385..86bff6b4 100644
--- a/api/src/routes/guilds/#guild_id/bans.ts
+++ b/api/src/routes/guilds/#guild_id/bans.ts
@@ -1,9 +1,8 @@
 import { Request, Response, Router } from "express";
 import { emitEvent, getPermission, GuildBanAddEvent, GuildBanRemoveEvent, Guild, Ban, User, Member } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
-import { getIpAdress } from "../../../util/ipAddress";
-import { BanCreateSchema } from "../../../schema/Ban";
-import { check } from "../../../util/instanceOf";
+import { getIpAdress, check } from "@fosscord/api";
+import { BanCreateSchema } from "@fosscord/api/schema/Ban";
 
 const router: Router = Router();
 
diff --git a/api/src/routes/guilds/#guild_id/channels.ts b/api/src/routes/guilds/#guild_id/channels.ts
index 5aa1d33d..faeecb76 100644
--- a/api/src/routes/guilds/#guild_id/channels.ts
+++ b/api/src/routes/guilds/#guild_id/channels.ts
@@ -3,7 +3,7 @@ import { Channel, ChannelUpdateEvent, getPermission, emitEvent } from "@fosscord
 import { HTTPError } from "lambert-server";
 import { ChannelModifySchema } from "../../../schema/Channel";
 
-import { check } from "../../../util/instanceOf";
+import { check } from "@fosscord/api";
 const router = Router();
 
 router.get("/", async (req: Request, res: Response) => {
diff --git a/api/src/routes/guilds/#guild_id/index.ts b/api/src/routes/guilds/#guild_id/index.ts
index 9d302a48..244900ec 100644
--- a/api/src/routes/guilds/#guild_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/index.ts
@@ -3,8 +3,8 @@ import { emitEvent, getPermission, Guild, GuildUpdateEvent, Member } from "@foss
 import { HTTPError } from "lambert-server";
 import { GuildUpdateSchema } from "../../../schema/Guild";
 
-import { check } from "../../../util/instanceOf";
-import { handleFile } from "../../../util/cdn";
+import { check } from "@fosscord/api";
+import { handleFile } from "@fosscord/api";
 import "missing-native-js-functions";
 
 const router = Router();
diff --git a/api/src/routes/guilds/#guild_id/members/#member_id/index.ts b/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
index 0d62e555..8b04a508 100644
--- a/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
@@ -11,8 +11,8 @@ import {
 	emitEvent
 } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
-import { check } from "../../../../../util/instanceOf";
-import { MemberChangeSchema } from "../../../../../schema/Member";
+import { check } from "@fosscord/api";
+import { MemberChangeSchema } from "@fosscord/api/schema/Member";
 import { In } from "typeorm";
 
 const router = Router();
diff --git a/api/src/routes/guilds/#guild_id/members/index.ts b/api/src/routes/guilds/#guild_id/members/index.ts
index 0bfd71cb..198d6946 100644
--- a/api/src/routes/guilds/#guild_id/members/index.ts
+++ b/api/src/routes/guilds/#guild_id/members/index.ts
@@ -1,6 +1,6 @@
 import { Request, Response, Router } from "express";
 import { Guild, Member, PublicMemberProjection } from "@fosscord/util";
-import { instanceOf, Length } from "../../../../util/instanceOf";
+import { instanceOf, Length } from "@fosscord/api";
 import { MoreThan } from "typeorm";
 
 const router = Router();
diff --git a/api/src/routes/guilds/#guild_id/regions.ts b/api/src/routes/guilds/#guild_id/regions.ts
index 212c9bcd..86208b79 100644
--- a/api/src/routes/guilds/#guild_id/regions.ts
+++ b/api/src/routes/guilds/#guild_id/regions.ts
@@ -1,7 +1,7 @@
-import {Config, Guild, Member} from "@fosscord/util";
+import { Config, Guild, Member } from "@fosscord/util";
 import { Request, Response, Router } from "express";
-import {getVoiceRegions} from "../../../util/Voice";
-import {getIpAdress} from "../../../util/ipAddress";
+import { getVoiceRegions } from "@fosscord/api";
+import { getIpAdress } from "@fosscord/api";
 
 const router = Router();
 
diff --git a/api/src/routes/guilds/#guild_id/roles.ts b/api/src/routes/guilds/#guild_id/roles.ts
index 6a318688..76dd47c5 100644
--- a/api/src/routes/guilds/#guild_id/roles.ts
+++ b/api/src/routes/guilds/#guild_id/roles.ts
@@ -12,7 +12,7 @@ import {
 } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
 
-import { check } from "../../../util/instanceOf";
+import { check } from "@fosscord/api";
 import { RoleModifySchema, RolePositionUpdateSchema } from "../../../schema/Roles";
 import { DiscordApiErrors } from "@fosscord/util";
 import { In } from "typeorm";
diff --git a/api/src/routes/guilds/#guild_id/templates.ts b/api/src/routes/guilds/#guild_id/templates.ts
index a7613abf..e9304e11 100644
--- a/api/src/routes/guilds/#guild_id/templates.ts
+++ b/api/src/routes/guilds/#guild_id/templates.ts
@@ -2,8 +2,8 @@ import { Request, Response, Router } from "express";
 import { Guild, getPermission, Template } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
 import { TemplateCreateSchema, TemplateModifySchema } from "../../../schema/Template";
-import { check } from "../../../util/instanceOf";
-import { generateCode } from "../../../util/String";
+import { check } from "@fosscord/api";
+import { generateCode } from "@fosscord/api";
 
 const router: Router = Router();
 
diff --git a/api/src/routes/guilds/#guild_id/vanity-url.ts b/api/src/routes/guilds/#guild_id/vanity-url.ts
index 58940b42..f1887cc0 100644
--- a/api/src/routes/guilds/#guild_id/vanity-url.ts
+++ b/api/src/routes/guilds/#guild_id/vanity-url.ts
@@ -1,7 +1,7 @@
 import { Channel, ChannelType, getPermission, Guild, Invite, trimSpecial } from "@fosscord/util";
 import { Router, Request, Response } from "express";
 import { HTTPError } from "lambert-server";
-import { check, Length } from "../../../util/instanceOf";
+import { check, Length } from "@fosscord/api";
 
 const router = Router();
 
diff --git a/api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts b/api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts
index 02951f81..447e15c1 100644
--- a/api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts
@@ -1,15 +1,15 @@
-import { check } from "../../../../../util/instanceOf";
+import { check } from "@fosscord/api";
 import { VoiceStateUpdateSchema } from "../../../../../schema";
 import { Request, Response, Router } from "express";
-import { updateVoiceState } from "../../../../../util/VoiceState";
+import { updateVoiceState } from "@fosscord/api";
 
 const router = Router();
 
 router.patch("/", check(VoiceStateUpdateSchema), async (req: Request, res: Response) => {
 	const body = req.body as VoiceStateUpdateSchema;
 	const { guild_id, user_id } = req.params;
-	await updateVoiceState(body, guild_id, req.user_id, user_id)
+	await updateVoiceState(body, guild_id, req.user_id, user_id);
 	return res.sendStatus(204);
 });
 
-export default router;
\ No newline at end of file
+export default router;
diff --git a/api/src/routes/guilds/#guild_id/voice-states/@me/index.ts b/api/src/routes/guilds/#guild_id/voice-states/@me/index.ts
index 42ba543e..b637ff66 100644
--- a/api/src/routes/guilds/#guild_id/voice-states/@me/index.ts
+++ b/api/src/routes/guilds/#guild_id/voice-states/@me/index.ts
@@ -1,15 +1,15 @@
-import { check } from "../../../../../util/instanceOf";
+import { check } from "@fosscord/api";
 import { VoiceStateUpdateSchema } from "../../../../../schema";
 import { Request, Response, Router } from "express";
-import { updateVoiceState } from "../../../../../util/VoiceState";
+import { updateVoiceState } from "@fosscord/api";
 
 const router = Router();
 
 router.patch("/", check(VoiceStateUpdateSchema), async (req: Request, res: Response) => {
 	const body = req.body as VoiceStateUpdateSchema;
 	const { guild_id } = req.params;
-	await updateVoiceState(body, guild_id, req.user_id)
+	await updateVoiceState(body, guild_id, req.user_id);
 	return res.sendStatus(204);
 });
 
-export default router;
\ No newline at end of file
+export default router;
diff --git a/api/src/routes/guilds/#guild_id/welcome_screen.ts b/api/src/routes/guilds/#guild_id/welcome_screen.ts
index defbcd40..7ca49b4e 100644
--- a/api/src/routes/guilds/#guild_id/welcome_screen.ts
+++ b/api/src/routes/guilds/#guild_id/welcome_screen.ts
@@ -2,7 +2,7 @@ import { Request, Response, Router } from "express";
 import { Guild, getPermission, Snowflake, Member } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
 
-import { check } from "../../../util/instanceOf";
+import { check } from "@fosscord/api";
 import { GuildUpdateWelcomeScreenSchema } from "../../../schema/Guild";
 
 const router: Router = Router();
diff --git a/api/src/routes/guilds/#guild_id/widget.json.ts b/api/src/routes/guilds/#guild_id/widget.json.ts
index 193ed095..f871fac8 100644
--- a/api/src/routes/guilds/#guild_id/widget.json.ts
+++ b/api/src/routes/guilds/#guild_id/widget.json.ts
@@ -1,7 +1,7 @@
 import { Request, Response, Router } from "express";
 import { Config, Permissions, Guild, Invite, Channel, Member } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
-import { random } from "../../../util/RandomInviteID";
+import { random } from "@fosscord/api";
 
 const router: Router = Router();
 
diff --git a/api/src/routes/guilds/#guild_id/widget.ts b/api/src/routes/guilds/#guild_id/widget.ts
index fcf71402..d9ce817e 100644
--- a/api/src/routes/guilds/#guild_id/widget.ts
+++ b/api/src/routes/guilds/#guild_id/widget.ts
@@ -1,7 +1,7 @@
 import { Request, Response, Router } from "express";
 import { getPermission, Guild } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
-import { check } from "../../../util/instanceOf";
+import { check } from "@fosscord/api";
 import { WidgetModifySchema } from "../../../schema/Widget";
 
 const router: Router = Router();
diff --git a/api/src/routes/guilds/index.ts b/api/src/routes/guilds/index.ts
index e5830647..a1b199e7 100644
--- a/api/src/routes/guilds/index.ts
+++ b/api/src/routes/guilds/index.ts
@@ -1,7 +1,7 @@
 import { Router, Request, Response } from "express";
 import { Role, Guild, Snowflake, Config, User, Member, Channel } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
-import { check } from "./../../util/instanceOf";
+import { check } from "@fosscord/api";
 import { GuildCreateSchema } from "../../schema/Guild";
 import { DiscordApiErrors } from "@fosscord/util";
 
diff --git a/api/src/routes/guilds/templates/index.ts b/api/src/routes/guilds/templates/index.ts
index 58201f65..1d0f2716 100644
--- a/api/src/routes/guilds/templates/index.ts
+++ b/api/src/routes/guilds/templates/index.ts
@@ -3,7 +3,7 @@ const router: Router = Router();
 import { Template, Guild, Role, Snowflake, Config, User, Member } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
 import { GuildTemplateCreateSchema } from "../../../schema/Guild";
-import { check } from "../../../util/instanceOf";
+import { check } from "@fosscord/api";
 import { DiscordApiErrors } from "@fosscord/util";
 
 router.get("/:code", async (req: Request, res: Response) => {