diff options
Diffstat (limited to 'src/api/routes/users')
26 files changed, 126 insertions, 129 deletions
diff --git a/src/api/routes/users/#id/index.ts b/src/api/routes/users/#id/index.ts index bdb1060f..e33e5695 100644 --- a/src/api/routes/users/#id/index.ts +++ b/src/api/routes/users/#id/index.ts @@ -1,6 +1,6 @@ -import { Router, Request, Response } from "express"; -import { User } from "@fosscord/util"; import { route } from "@fosscord/api"; +import { User } from "@fosscord/util"; +import { Request, Response, Router } from "express"; const router: Router = Router(); diff --git a/src/api/routes/users/#id/profile.ts b/src/api/routes/users/#id/profile.ts index 7a995a8c..27717c79 100644 --- a/src/api/routes/users/#id/profile.ts +++ b/src/api/routes/users/#id/profile.ts @@ -1,6 +1,6 @@ -import { Router, Request, Response } from "express"; -import { PublicConnectedAccount, PublicUser, User, UserPublic, Member } from "@fosscord/util"; import { route } from "@fosscord/api"; +import { Member, PublicConnectedAccount, User, UserPublic } from "@fosscord/util"; +import { Request, Response, Router } from "express"; const router: Router = Router(); @@ -17,22 +17,22 @@ router.get("/", route({ test: { response: { body: "UserProfileResponse" } } }), let mutual_guilds: object[] = []; let premium_guild_since; - const requested_member = await Member.find( { where: { id: req.params.id, } }) - const self_member = await Member.find( { where: { id: req.user_id, } }) + const requested_member = await Member.find({ where: { id: req.params.id } }); + const self_member = await Member.find({ where: { id: req.user_id } }); - for(const rmem of requested_member) { - if(rmem.premium_since) { - if(premium_guild_since){ - if(premium_guild_since > rmem.premium_since) { + for (const rmem of requested_member) { + if (rmem.premium_since) { + if (premium_guild_since) { + if (premium_guild_since > rmem.premium_since) { premium_guild_since = rmem.premium_since; } } else { premium_guild_since = rmem.premium_since; } } - for(const smem of self_member) { + for (const smem of self_member) { if (smem.guild_id === rmem.guild_id) { - mutual_guilds.push({id: rmem.guild_id, nick: rmem.nick}) + mutual_guilds.push({ id: rmem.guild_id, nick: rmem.nick }); } } } diff --git a/src/api/routes/users/#id/relationships.ts b/src/api/routes/users/#id/relationships.ts index 61655c25..9b7e3402 100644 --- a/src/api/routes/users/#id/relationships.ts +++ b/src/api/routes/users/#id/relationships.ts @@ -1,41 +1,46 @@ -import { Router, Request, Response } from "express"; -import { User } from "@fosscord/util"; import { route } from "@fosscord/api"; +import { User } from "@fosscord/util"; +import { Request, Response, Router } from "express"; const router: Router = Router(); export interface UserRelationsResponse { object: { - id?: string, - username?: string, - avatar?: string, - discriminator?: string, - public_flags?: number - } + id?: string; + username?: string; + avatar?: string; + discriminator?: string; + public_flags?: number; + }; } - router.get("/", route({ test: { response: { body: "UserRelationsResponse" } } }), async (req: Request, res: Response) => { let mutual_relations: object[] = []; - const requested_relations = await User.findOneOrFail({ + const requested_relations = await User.findOneOrFail({ where: { id: req.params.id }, relations: ["relationships"] }); - const self_relations = await User.findOneOrFail({ + const self_relations = await User.findOneOrFail({ where: { id: req.user_id }, relations: ["relationships"] }); - - for(const rmem of requested_relations.relationships) { - for(const smem of self_relations.relationships) - if (rmem.to_id === smem.to_id && rmem.type === 1 && rmem.to_id !== req.user_id) { - let relation_user = await User.getPublicUser(rmem.to_id) - mutual_relations.push({id: relation_user.id, username: relation_user.username, avatar: relation_user.avatar, discriminator: relation_user.discriminator, public_flags: relation_user.public_flags}) - } + for (const rmem of requested_relations.relationships) { + for (const smem of self_relations.relationships) + if (rmem.to_id === smem.to_id && rmem.type === 1 && rmem.to_id !== req.user_id) { + let relation_user = await User.getPublicUser(rmem.to_id); + + mutual_relations.push({ + id: relation_user.id, + username: relation_user.username, + avatar: relation_user.avatar, + discriminator: relation_user.discriminator, + public_flags: relation_user.public_flags + }); + } } - res.json(mutual_relations) + res.json(mutual_relations); }); export default router; diff --git a/src/api/routes/users/@me/activities/statistics/applications.ts b/src/api/routes/users/@me/activities/statistics/applications.ts index 014df8af..ba359b47 100644 --- a/src/api/routes/users/@me/activities/statistics/applications.ts +++ b/src/api/routes/users/@me/activities/statistics/applications.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/affinities/guilds.ts b/src/api/routes/users/@me/affinities/guilds.ts index 8d744744..e733910f 100644 --- a/src/api/routes/users/@me/affinities/guilds.ts +++ b/src/api/routes/users/@me/affinities/guilds.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/affinities/users.ts b/src/api/routes/users/@me/affinities/users.ts index 6d4e4991..758bedc3 100644 --- a/src/api/routes/users/@me/affinities/users.ts +++ b/src/api/routes/users/@me/affinities/users.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; 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 411e95bf..8e407184 100644 --- a/src/api/routes/users/@me/applications/#app_id/entitlements.ts +++ b/src/api/routes/users/@me/applications/#app_id/entitlements.ts @@ -1,5 +1,5 @@ -import { Request, Response, Router } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; 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 33d40796..72601f42 100644 --- a/src/api/routes/users/@me/billing/country-code.ts +++ b/src/api/routes/users/@me/billing/country-code.ts @@ -1,5 +1,5 @@ -import { Request, Response, Router } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; 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 014df8af..ba359b47 100644 --- a/src/api/routes/users/@me/billing/payment-sources.ts +++ b/src/api/routes/users/@me/billing/payment-sources.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/billing/subscriptions.ts b/src/api/routes/users/@me/billing/subscriptions.ts index 411e95bf..8e407184 100644 --- a/src/api/routes/users/@me/billing/subscriptions.ts +++ b/src/api/routes/users/@me/billing/subscriptions.ts @@ -1,5 +1,5 @@ -import { Request, Response, Router } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/channels.ts b/src/api/routes/users/@me/channels.ts index ad483529..c17275ec 100644 --- a/src/api/routes/users/@me/channels.ts +++ b/src/api/routes/users/@me/channels.ts @@ -1,6 +1,6 @@ -import { Request, Response, Router } from "express"; -import { Recipient, DmChannelDTO, Channel, DmChannelCreateSchema } from "@fosscord/util"; import { route } from "@fosscord/api"; +import { Channel, DmChannelCreateSchema, DmChannelDTO, Recipient } from "@fosscord/util"; +import { Request, Response, Router } from "express"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/connections.ts b/src/api/routes/users/@me/connections.ts index 411e95bf..8e407184 100644 --- a/src/api/routes/users/@me/connections.ts +++ b/src/api/routes/users/@me/connections.ts @@ -1,5 +1,5 @@ -import { Request, Response, Router } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router: Router = Router(); diff --git a/src/api/routes/users/@me/devices.ts b/src/api/routes/users/@me/devices.ts index 8556a3ad..cb01e576 100644 --- a/src/api/routes/users/@me/devices.ts +++ b/src/api/routes/users/@me/devices.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/disable.ts b/src/api/routes/users/@me/disable.ts index 3a1d48b8..05976908 100644 --- a/src/api/routes/users/@me/disable.ts +++ b/src/api/routes/users/@me/disable.ts @@ -1,6 +1,6 @@ +import { route } from "@fosscord/api"; import { User } from "@fosscord/util"; import { Request, Response, Router } from "express"; -import { route } from "@fosscord/api"; let bcrypt: any; try { diff --git a/src/api/routes/users/@me/email-settings.ts b/src/api/routes/users/@me/email-settings.ts index 3114984e..28d0864a 100644 --- a/src/api/routes/users/@me/email-settings.ts +++ b/src/api/routes/users/@me/email-settings.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/entitlements.ts b/src/api/routes/users/@me/entitlements.ts index 341e2b4c..7aaa5d7c 100644 --- a/src/api/routes/users/@me/entitlements.ts +++ b/src/api/routes/users/@me/entitlements.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/guilds.ts b/src/api/routes/users/@me/guilds.ts index 4d4fccd4..5141aa3d 100644 --- a/src/api/routes/users/@me/guilds.ts +++ b/src/api/routes/users/@me/guilds.ts @@ -1,7 +1,6 @@ -import { Router, Request, Response } from "express"; -import { Guild, Member, User, GuildDeleteEvent, GuildMemberRemoveEvent, emitEvent, Config } from "@fosscord/util"; -import { HTTPError } from "@fosscord/util"; import { route } from "@fosscord/api"; +import { Config, emitEvent, Guild, GuildDeleteEvent, GuildMemberRemoveEvent, HTTPError, Member, User } from "@fosscord/util"; +import { Request, Response, Router } from "express"; const router: 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 014df8af..ba359b47 100644 --- a/src/api/routes/users/@me/guilds/premium/subscription-slots.ts +++ b/src/api/routes/users/@me/guilds/premium/subscription-slots.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts index 4421d54f..fcb0a9df 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts @@ -53,17 +53,17 @@ router.patch("/", route({ body: "UserModifySchema" }), async (req: Request, res: } user.data.hash = await bcrypt.hash(body.new_password, 12); user.data.valid_tokens_since = new Date(); - token = await generateToken(user.id) as string; + token = (await generateToken(user.id)) as string; } - if(body.username){ - let check_username = body?.username?.replace(/\s/g, ''); - if(!check_username) { - throw FieldErrors({ - username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") } - }); - } - } + if (body.username) { + let check_username = body?.username?.replace(/\s/g, ""); + if (!check_username) { + throw FieldErrors({ + username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") } + }); + } + } user = OrmUtils.mergeDeep(user, body); await user.save(); @@ -77,7 +77,7 @@ router.patch("/", route({ body: "UserModifySchema" }), async (req: Request, res: user_id: req.user_id, data: user } as UserUpdateEvent); - + res.json({ ...user, token diff --git a/src/api/routes/users/@me/library.ts b/src/api/routes/users/@me/library.ts index 7ac13bae..0aea02a0 100644 --- a/src/api/routes/users/@me/library.ts +++ b/src/api/routes/users/@me/library.ts @@ -1,5 +1,5 @@ -import { Router, Response, Request } from "express"; import { route } from "@fosscord/api"; +import { Request, Response, Router } from "express"; const router = Router(); diff --git a/src/api/routes/users/@me/mfa/codes.ts b/src/api/routes/users/@me/mfa/codes.ts index 8d90f993..c62581cc 100644 --- a/src/api/routes/users/@me/mfa/codes.ts +++ b/src/api/routes/users/@me/mfa/codes.ts @@ -19,25 +19,21 @@ router.post("/", route({ body: "MfaCodesSchema" }), async (req: Request, res: Re const user = await User.findOneOrFail({ where: { id: req.user_id }, select: ["data"] }); - if (!await bcrypt.compare(password, user.data.hash || "")) { + if (!(await bcrypt.compare(password, user.data.hash || ""))) { throw FieldErrors({ password: { message: req.t("auth:login.INVALID_PASSWORD"), code: "INVALID_PASSWORD" } }); } var codes: BackupCode[]; if (regenerate && Config.get().security.twoFactor.generateBackupCodes) { - await BackupCode.update( - { user: { id: req.user_id } }, - { expired: true } - ); + await BackupCode.update({ user: { id: req.user_id } }, { expired: true }); codes = generateMfaBackupCodes(req.user_id); - await Promise.all(codes.map(x => x.save())); - } - else { + await Promise.all(codes.map((x) => x.save())); + } else { codes = await BackupCode.find({ where: { user: { - id: req.user_id, + id: req.user_id }, expired: false } @@ -45,8 +41,8 @@ router.post("/", route({ body: "MfaCodesSchema" }), async (req: Request, res: Re } return res.json({ - backup_codes: codes.map(x => ({ ...x, expired: undefined })), - }) + backup_codes: codes.map((x) => ({ ...x, expired: undefined })) + }); }); export default router; diff --git a/src/api/routes/users/@me/mfa/totp/disable.ts b/src/api/routes/users/@me/mfa/totp/disable.ts index 2fe9355c..6bc9a5c7 100644 --- a/src/api/routes/users/@me/mfa/totp/disable.ts +++ b/src/api/routes/users/@me/mfa/totp/disable.ts @@ -1,8 +1,8 @@ -import { Router, Request, Response } from "express"; import { route } from "@fosscord/api"; -import { verifyToken } from 'node-2fa'; +import { BackupCode, generateToken, TotpDisableSchema, User } from "@fosscord/util"; +import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; -import { User, generateToken, BackupCode, TotpDisableSchema } from "@fosscord/util"; +import { verifyToken } from "node-2fa"; const router = Router(); @@ -14,28 +14,27 @@ router.post("/", route({ body: "TotpDisableSchema" }), async (req: Request, res: const backup = await BackupCode.findOne({ where: { code: body.code } }); if (!backup) { const ret = verifyToken(user.totp_secret!, body.code); - if (!ret || ret.delta != 0) - throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); + if (!ret || ret.delta != 0) throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); } await User.update( { id: req.user_id }, { mfa_enabled: false, - totp_secret: "", - }, + totp_secret: "" + } ); await BackupCode.update( { user: { id: req.user_id } }, { - expired: true, + expired: true } ); return res.json({ - token: await generateToken(user.id), + token: await generateToken(user.id) }); }); -export default router; \ No newline at end of file +export default router; diff --git a/src/api/routes/users/@me/mfa/totp/enable.ts b/src/api/routes/users/@me/mfa/totp/enable.ts index a38a133a..f3a73c28 100644 --- a/src/api/routes/users/@me/mfa/totp/enable.ts +++ b/src/api/routes/users/@me/mfa/totp/enable.ts @@ -1,8 +1,8 @@ +import { route } from "@fosscord/api"; import { BackupCode, Config, generateMfaBackupCodes, generateToken, TotpEnableSchema, User } from "@fosscord/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; -import { verifyToken } from 'node-2fa'; -import { route } from '@fosscord/api'; +import { verifyToken } from "node-2fa"; let bcrypt: any; try { @@ -21,34 +21,28 @@ router.post("/", route({ body: "TotpEnableSchema" }), async (req: Request, res: // TODO: Are guests allowed to enable 2fa? if (user.data.hash) { - if (!await bcrypt.compare(body.password, user.data.hash)) { + if (!(await bcrypt.compare(body.password, user.data.hash))) { throw new HTTPError(req.t("auth:login.INVALID_PASSWORD")); } } - if (!body.secret) - throw new HTTPError(req.t("auth:login.INVALID_TOTP_SECRET"), 60005); + if (!body.secret) throw new HTTPError(req.t("auth:login.INVALID_TOTP_SECRET"), 60005); - if (!body.code) - throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); + if (!body.code) throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); - if (verifyToken(body.secret, body.code)?.delta != 0) - throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); + if (verifyToken(body.secret, body.code)?.delta != 0) throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008); let backup_codes: BackupCode[] = []; if (Config.get().security.twoFactor.generateBackupCodes) { backup_codes = generateMfaBackupCodes(req.user_id); - await Promise.all(backup_codes.map(x => x.save())); + await Promise.all(backup_codes.map((x) => x.save())); } - await User.update( - { id: req.user_id }, - { mfa_enabled: true, totp_secret: body.secret } - ); + await User.update({ id: req.user_id }, { mfa_enabled: true, totp_secret: body.secret }); res.send({ token: await generateToken(user.id), - backup_codes: backup_codes.map(x => ({ ...x, expired: undefined })), + backup_codes: backup_codes.map((x) => ({ ...x, expired: undefined })) }); }); diff --git a/src/api/routes/users/@me/notes.ts b/src/api/routes/users/@me/notes.ts index f938f088..fc207401 100644 --- a/src/api/routes/users/@me/notes.ts +++ b/src/api/routes/users/@me/notes.ts @@ -1,6 +1,6 @@ -import { Request, Response, Router } from "express"; import { route } from "@fosscord/api"; -import { User, Note, emitEvent, Snowflake } from "@fosscord/util"; +import { emitEvent, Note, Snowflake, User } from "@fosscord/util"; +import { Request, Response, Router } from "express"; const router: Router = Router(); @@ -10,38 +10,31 @@ router.get("/:id", route({}), async (req: Request, res: Response) => { const note = await Note.findOneOrFail({ where: { owner: { id: req.user_id }, - target: { id: id }, + target: { id: id } } }); return res.json({ note: note?.content, note_user_id: id, - user_id: req.user_id, + user_id: req.user_id }); }); router.put("/:id", route({}), async (req: Request, res: Response) => { const { id } = req.params; const owner = await User.findOneOrFail({ where: { id: req.user_id } }); - const target = await User.findOneOrFail({ where: { id: id } }); //if noted user does not exist throw + const target = await User.findOneOrFail({ where: { id: id } }); //if noted user does not exist throw const { note } = req.body; if (note && note.length) { // upsert a note if (await Note.findOne({ where: { owner: { id: owner.id }, target: { id: target.id } } })) { - Note.update( - { owner: { id: owner.id }, target: { id: target.id } }, - { owner, target, content: note } - ); + Note.update({ owner: { id: owner.id }, target: { id: target.id } }, { owner, target, content: note }); + } else { + Note.insert({ id: Snowflake.generate(), owner, target, content: note }); } - else { - Note.insert( - { id: Snowflake.generate(), owner, target, content: note } - ); - } - } - else { + } else { await Note.delete({ owner: { id: owner.id }, target: { id: target.id } }); } @@ -51,7 +44,7 @@ router.put("/:id", route({}), async (req: Request, res: Response) => { note: note, id: target.id }, - user_id: owner.id, + user_id: owner.id }); return res.status(204); diff --git a/src/api/routes/users/@me/relationships.ts b/src/api/routes/users/@me/relationships.ts index f7464b99..8267c142 100644 --- a/src/api/routes/users/@me/relationships.ts +++ b/src/api/routes/users/@me/relationships.ts @@ -1,18 +1,18 @@ +import { route } from "@fosscord/api"; import { - RelationshipAddEvent, - User, - PublicUserProjection, - RelationshipType, - RelationshipRemoveEvent, + Config, + DiscordApiErrors, emitEvent, + HTTPError, + OrmUtils, + PublicUserProjection, Relationship, - Config + RelationshipAddEvent, + RelationshipRemoveEvent, + RelationshipType, + User } from "@fosscord/util"; -import { Router, Response, Request } from "express"; -import { HTTPError } from "@fosscord/util"; -import { DiscordApiErrors } from "@fosscord/util"; -import { route } from "@fosscord/api"; -import { OrmUtils } from "@fosscord/util"; +import { Request, Response, Router } from "express"; const router = Router(); @@ -42,7 +42,11 @@ router.put("/:id", route({ body: "RelationshipPutSchema" }), async (req: Request return await updateRelationship( req, res, - await User.findOneOrFail({ where: { id: req.params.id }, relations: ["relationships", "relationships.to"], select: userProjection }), + await User.findOneOrFail({ + where: { id: req.params.id }, + relations: ["relationships", "relationships.to"], + select: userProjection + }), req.body.type ?? RelationshipType.friends ); }); @@ -132,7 +136,9 @@ async function updateRelationship(req: Request, res: Response, friend: User, typ relationship.type = RelationshipType.blocked; await relationship.save(); } else { - relationship = await (OrmUtils.mergeDeep(new Relationship(), { to_id: id, type: RelationshipType.blocked, from_id: req.user_id }) as Relationship).save(); + relationship = await ( + OrmUtils.mergeDeep(new Relationship(), { to_id: id, type: RelationshipType.blocked, from_id: req.user_id }) as Relationship + ).save(); } if (friendRequest && friendRequest.type !== RelationshipType.blocked) { @@ -158,7 +164,12 @@ async function updateRelationship(req: Request, res: Response, friend: User, typ const { maxFriends } = Config.get().limits.user; if (user.relationships.length >= maxFriends) throw DiscordApiErrors.MAXIMUM_FRIENDS.withParams(maxFriends); - let incoming_relationship = OrmUtils.mergeDeep(new Relationship(), { nickname: undefined, type: RelationshipType.incoming, to: user, from: friend }); + let incoming_relationship = OrmUtils.mergeDeep(new Relationship(), { + nickname: undefined, + type: RelationshipType.incoming, + to: user, + from: friend + }); let outgoing_relationship = OrmUtils.mergeDeep(new Relationship(), { nickname: undefined, type: RelationshipType.outgoing, diff --git a/src/api/routes/users/@me/settings.ts b/src/api/routes/users/@me/settings.ts index 7578d36e..e276a22a 100644 --- a/src/api/routes/users/@me/settings.ts +++ b/src/api/routes/users/@me/settings.ts @@ -1,6 +1,6 @@ -import { Router, Response, Request } from "express"; -import { User, UserSettings } from "@fosscord/util"; import { route } from "@fosscord/api"; +import { User, UserSettings } from "@fosscord/util"; +import { Request, Response, Router } from "express"; const router = Router(); |