diff --git a/package-lock.json b/package-lock.json index 847eb91f..2672df63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@fosscord/server-util": "^1.3.15", + "@fosscord/server-util": "^1.3.16", "@types/jest": "^26.0.22", "@types/json-schema": "^7.0.7", "ajv": "^8.4.0", @@ -520,9 +520,9 @@ } }, "node_modules/@fosscord/server-util": { - "version": "1.3.15", - "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.3.15.tgz", - "integrity": "sha512-PCSOYOUiEzpdcUoyBSCHqOB72b+xdNuYStEuvvxLJt6MV6id4GA18DvD79Hw7F38F4gm/PIK6di+GnHWMd3Prw==", + "version": "1.3.16", + "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.3.16.tgz", + "integrity": "sha512-/oDDGyWllVNMb/84wzzYQ6vpwkcW+mg57ECWS5bUDQ0OhT3apdpYgQFfWxwGYgyYo6fB4gmyJh/U2bzWo6Jmeg==", "dependencies": { "@types/jsonwebtoken": "^8.5.0", "@types/mongoose-autopopulate": "^0.10.1", @@ -12864,9 +12864,9 @@ } }, "@fosscord/server-util": { - "version": "1.3.15", - "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.3.15.tgz", - "integrity": "sha512-PCSOYOUiEzpdcUoyBSCHqOB72b+xdNuYStEuvvxLJt6MV6id4GA18DvD79Hw7F38F4gm/PIK6di+GnHWMd3Prw==", + "version": "1.3.16", + "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.3.16.tgz", + "integrity": "sha512-/oDDGyWllVNMb/84wzzYQ6vpwkcW+mg57ECWS5bUDQ0OhT3apdpYgQFfWxwGYgyYo6fB4gmyJh/U2bzWo6Jmeg==", "requires": { "@types/jsonwebtoken": "^8.5.0", "@types/mongoose-autopopulate": "^0.10.1", diff --git a/package.json b/package.json index 06ff7fc5..5cf2e765 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/fosscord/fosscord-api#readme", "dependencies": { - "@fosscord/server-util": "^1.3.15", + "@fosscord/server-util": "^1.3.16", "@types/jest": "^26.0.22", "@types/json-schema": "^7.0.7", "ajv": "^8.4.0", diff --git a/src/Server.ts b/src/Server.ts index 50110bec..5ae65918 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -9,8 +9,8 @@ import i18nextMiddleware, { I18next } from "i18next-http-middleware"; import i18nextBackend from "i18next-node-fs-backend"; import { ErrorHandler } from "./middlewares/ErrorHandler"; import { BodyParser } from "./middlewares/BodyParser"; -import express, { Router } from "express"; -import fetch, { Response } from "node-fetch"; +import express, { Router, Request, Response } from "express"; +import fetch, { Response as FetchResponse } from "node-fetch"; import mongoose from "mongoose"; import path from "path"; @@ -31,13 +31,13 @@ declare global { const assetCache = new Map< string, { - response: Response; + response: FetchResponse; buffer: Buffer; } >(); export class FosscordServer extends Server { - public options: FosscordServerOptions; + public declare options: FosscordServerOptions; constructor(opts?: Partial) { // @ts-ignore @@ -101,9 +101,9 @@ export class FosscordServer extends Server { this.app.use("/assets", express.static(path.join(__dirname, "..", "assets"))); - this.app.get("/assets/:file", async (req, res) => { + this.app.get("/assets/:file", async (req: Request, res: Response) => { delete req.headers.host; - var response: Response; + var response: FetchResponse; var buffer: Buffer; const cache = assetCache.get(req.params.file); if (!cache) { @@ -140,7 +140,7 @@ export class FosscordServer extends Server { return res.send(buffer); }); - this.app.get("*", (req, res) => { + this.app.get("*", (req: Request, res: Response) => { res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24); res.set("content-type", "text/html"); res.send( diff --git a/src/routes/channels/#channel_id/followers.ts b/src/routes/channels/#channel_id/followers.ts index c06db61b..641af4f8 100644 --- a/src/routes/channels/#channel_id/followers.ts +++ b/src/routes/channels/#channel_id/followers.ts @@ -1,4 +1,4 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router: Router = Router(); // TODO: diff --git a/src/routes/channels/#channel_id/index.ts b/src/routes/channels/#channel_id/index.ts index 0e5a5124..dcc093ae 100644 --- a/src/routes/channels/#channel_id/index.ts +++ b/src/routes/channels/#channel_id/index.ts @@ -1,5 +1,5 @@ import { ChannelDeleteEvent, ChannelModel, ChannelUpdateEvent, getPermission, GuildUpdateEvent, toObject } from "@fosscord/server-util"; -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { HTTPError } from "lambert-server"; import { ChannelModifySchema } from "../../../schema/Channel"; import { emitEvent } from "../../../util/Event"; @@ -8,7 +8,7 @@ const router: Router = Router(); // TODO: delete channel // TODO: Get channel -router.get("/", async (req, res) => { +router.get("/", async (req: Request, res: Response) => { const { channel_id } = req.params; const channel = await ChannelModel.findOne({ id: channel_id }).exec(); @@ -20,7 +20,7 @@ router.get("/", async (req, res) => { return res.send(toObject(channel)); }); -router.delete("/", async (req, res) => { +router.delete("/", async (req: Request, res: Response) => { const { channel_id } = req.params; const channel = await ChannelModel.findOne({ id: channel_id }).exec(); @@ -39,7 +39,7 @@ router.delete("/", async (req, res) => { res.send(data); }); -router.patch("/", check(ChannelModifySchema), async (req, res) => { +router.patch("/", check(ChannelModifySchema), async (req: Request, res: Response) => { var payload = req.body as ChannelModifySchema; const { channel_id } = req.params; diff --git a/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts b/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts index 17f36396..6753e832 100644 --- a/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts +++ b/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts @@ -1,8 +1,8 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); // TODO: -// router.post("/", (req, res) => {}); +// router.post("/", (req: Request, res: Response) => {}); export default router; diff --git a/src/routes/channels/#channel_id/messages/#message_id/index.ts b/src/routes/channels/#channel_id/messages/#message_id/index.ts index aee517fc..90727f60 100644 --- a/src/routes/channels/#channel_id/messages/#message_id/index.ts +++ b/src/routes/channels/#channel_id/messages/#message_id/index.ts @@ -1,5 +1,5 @@ import { ChannelModel, getPermission, MessageDeleteEvent, MessageModel, MessageUpdateEvent, toObject } from "@fosscord/server-util"; -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { HTTPError } from "lambert-server"; import { MessageCreateSchema } from "../../../../../schema/Message"; import { emitEvent } from "../../../../../util/Event"; @@ -8,7 +8,7 @@ import { handleMessage, postHandleMessage } from "../../../../../util/Message"; const router = Router(); -router.patch("/", check(MessageCreateSchema), async (req, res) => { +router.patch("/", check(MessageCreateSchema), async (req: Request, res: Response) => { const { message_id, channel_id } = req.params; var body = req.body as MessageCreateSchema; @@ -47,7 +47,7 @@ router.patch("/", check(MessageCreateSchema), async (req, res) => { // TODO: delete attachments in message -router.delete("/", async (req, res) => { +router.delete("/", async (req: Request, res: Response) => { const { message_id, channel_id } = req.params; const channel = await ChannelModel.findOne({ id: channel_id }, { guild_id: true }); diff --git a/src/routes/channels/#channel_id/messages/#message_id/reactions.ts b/src/routes/channels/#channel_id/messages/#message_id/reactions.ts index 1bfaae39..c31be435 100644 --- a/src/routes/channels/#channel_id/messages/#message_id/reactions.ts +++ b/src/routes/channels/#channel_id/messages/#message_id/reactions.ts @@ -13,7 +13,7 @@ import { toObject, UserModel } from "@fosscord/server-util"; -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { HTTPError } from "lambert-server"; import { emitEvent } from "../../../../../util/Event"; @@ -35,7 +35,7 @@ function getEmoji(emoji: string): PartialEmoji { }; } -router.delete("/", async (req, res) => { +router.delete("/", async (req: Request, res: Response) => { const { message_id, channel_id } = req.params; const channel = await ChannelModel.findOne({ id: channel_id }, { guild_id: true }).exec(); @@ -61,7 +61,7 @@ router.delete("/", async (req, res) => { res.sendStatus(204); }); -router.delete("/:emoji", async (req, res) => { +router.delete("/:emoji", async (req: Request, res: Response) => { const { message_id, channel_id } = req.params; const emoji = getEmoji(req.params.emoji); @@ -95,7 +95,7 @@ router.delete("/:emoji", async (req, res) => { res.sendStatus(204); }); -router.get("/:emoji", async (req, res) => { +router.get("/:emoji", async (req: Request, res: Response) => { const { message_id, channel_id } = req.params; const emoji = getEmoji(req.params.emoji); @@ -112,7 +112,7 @@ router.get("/:emoji", async (req, res) => { res.json(toObject(users)); }); -router.put("/:emoji/:user_id", async (req, res) => { +router.put("/:emoji/:user_id", async (req: Request, res: Response) => { const { message_id, channel_id, user_id } = req.params; if (user_id !== "@me") throw new HTTPError("Invalid user"); const emoji = getEmoji(req.params.emoji); @@ -162,7 +162,7 @@ router.put("/:emoji/:user_id", async (req, res) => { res.sendStatus(204); }); -router.delete("/:emoji/:user_id", async (req, res) => { +router.delete("/:emoji/:user_id", async (req: Request, res: Response) => { var { message_id, channel_id, user_id } = req.params; const emoji = getEmoji(req.params.emoji); diff --git a/src/routes/channels/#channel_id/messages/bulk-delete.ts b/src/routes/channels/#channel_id/messages/bulk-delete.ts index 24724d34..8cb672d8 100644 --- a/src/routes/channels/#channel_id/messages/bulk-delete.ts +++ b/src/routes/channels/#channel_id/messages/bulk-delete.ts @@ -1,4 +1,4 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { ChannelModel, Config, getPermission, MessageDeleteBulkEvent, MessageModel } from "@fosscord/server-util"; import { HTTPError } from "lambert-server"; import { emitEvent } from "../../../../util/Event"; @@ -11,7 +11,7 @@ export default router; // TODO: should users be able to bulk delete messages or only bots? // TODO: should this request fail, if you provide messages older than 14 days/invalid ids? // https://discord.com/developers/docs/resources/channel#bulk-delete-messages -router.post("/", check({ messages: [String] }), async (req, res) => { +router.post("/", check({ messages: [String] }), async (req: Request, res: Response) => { const { channel_id } = req.params; const channel = await ChannelModel.findOne({ id: channel_id }, { permission_overwrites: true, guild_id: true }).exec(); if (!channel?.guild_id) throw new HTTPError("Can't bulk delete dm channel messages", 400); diff --git a/src/routes/channels/#channel_id/messages/index.ts b/src/routes/channels/#channel_id/messages/index.ts index 966244ac..b42a886b 100644 --- a/src/routes/channels/#channel_id/messages/index.ts +++ b/src/routes/channels/#channel_id/messages/index.ts @@ -1,4 +1,4 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { Attachment, ChannelModel, ChannelType, getPermission, MessageDocument, MessageModel, toObject } from "@fosscord/server-util"; import { HTTPError } from "lambert-server"; import { MessageCreateSchema } from "../../../../schema/Message"; @@ -28,7 +28,7 @@ export function isTextChannel(type: ChannelType): boolean { // https://discord.com/developers/docs/resources/channel#create-message // get messages -router.get("/", async (req, res) => { +router.get("/", async (req: Request, res: Response) => { const channel_id = req.params.channel_id; const channel = await ChannelModel.findOne({ id: channel_id }, { guild_id: true, type: true, permission_overwrites: true }).exec(); if (!channel) throw new HTTPError("Channel not found", 404); @@ -101,7 +101,7 @@ const messageUpload = multer({ // TODO: trim and replace message content and every embed field // Send message -router.post("/", check(MessageCreateSchema), messageUpload.single("file"), async (req, res) => { +router.post("/", check(MessageCreateSchema), messageUpload.single("file"), async (req: Request, res: Response) => { const { channel_id } = req.params; var body = req.body as MessageCreateSchema; const attachments: Attachment[] = []; diff --git a/src/routes/channels/#channel_id/permissions.ts b/src/routes/channels/#channel_id/permissions.ts index 1ee35149..3993c424 100644 --- a/src/routes/channels/#channel_id/permissions.ts +++ b/src/routes/channels/#channel_id/permissions.ts @@ -1,5 +1,5 @@ import { ChannelModel, ChannelPermissionOverwrite, ChannelUpdateEvent, getPermission, MemberModel, RoleModel } from "@fosscord/server-util"; -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { HTTPError } from "lambert-server"; import { emitEvent } from "../../../util/Event"; import { check } from "../../../util/instanceOf"; @@ -7,7 +7,7 @@ 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) -router.put("/:overwrite_id", check({ allow: String, deny: String, type: Number, id: String }), async (req, res) => { +router.put("/:overwrite_id", check({ allow: String, deny: String, type: Number, id: String }), async (req: Request, res: Response) => { const { channel_id, overwrite_id } = req.params; const body = req.body as { allow: bigint; deny: bigint; type: number; id: string }; @@ -52,7 +52,7 @@ router.put("/:overwrite_id", check({ allow: String, deny: String, type: Number, }); // TODO: check permission hierarchy -router.delete("/:overwrite_id", async (req, res) => { +router.delete("/:overwrite_id", async (req: Request, res: Response) => { const { channel_id, overwrite_id } = req.params; const permissions = await getPermission(req.user_id, undefined, channel_id); diff --git a/src/routes/channels/#channel_id/pins.ts b/src/routes/channels/#channel_id/pins.ts index 43c504d8..5b61f0d2 100644 --- a/src/routes/channels/#channel_id/pins.ts +++ b/src/routes/channels/#channel_id/pins.ts @@ -53,7 +53,7 @@ router.put("/:message_id", async (req: Request, res: Response) => { res.sendStatus(204); }); -router.delete("/:message_id", async (req, res) => { +router.delete("/:message_id", async (req: Request, res: Response) => { const { channel_id, message_id } = req.params; const channel = await ChannelModel.findOne({ id: channel_id }).exec(); diff --git a/src/routes/channels/#channel_id/recipients.ts b/src/routes/channels/#channel_id/recipients.ts index 93c33ea5..ea6bc563 100644 --- a/src/routes/channels/#channel_id/recipients.ts +++ b/src/routes/channels/#channel_id/recipients.ts @@ -1,4 +1,4 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router: Router = Router(); // TODO: diff --git a/src/routes/channels/#channel_id/webhooks.ts b/src/routes/channels/#channel_id/webhooks.ts index a56365b8..b60f4d68 100644 --- a/src/routes/channels/#channel_id/webhooks.ts +++ b/src/routes/channels/#channel_id/webhooks.ts @@ -1,4 +1,4 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { check, Length } from "../../../util/instanceOf"; import { ChannelModel, getPermission, trimSpecial } from "@fosscord/server-util"; import { HTTPError } from "lambert-server"; @@ -8,7 +8,7 @@ const router: Router = Router(); // TODO: // TODO: use Image Data Type for avatar instead of String -router.post("/", check({ name: new Length(String, 1, 80), $avatar: String }), async (req, res) => { +router.post("/", check({ name: new Length(String, 1, 80), $avatar: String }), async (req: Request, res: Response) => { const channel_id = req.params.channel_id; const channel = await ChannelModel.findOne({ id: channel_id }, { guild_id: true, type: true }).exec(); if (!channel) throw new HTTPError("Channel not found", 404); diff --git a/src/routes/experiments.ts b/src/routes/experiments.ts index 6bca49c5..3bdbed62 100644 --- a/src/routes/experiments.ts +++ b/src/routes/experiments.ts @@ -1,8 +1,8 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); -router.get("/", (req, res) => { +router.get("/", (req: Request, res: Response) => { // TODO: res.send({ fingerprint: "", assignments: [] }); }); diff --git a/src/routes/gateway.ts b/src/routes/gateway.ts index ffbbe74c..7e8146df 100644 --- a/src/routes/gateway.ts +++ b/src/routes/gateway.ts @@ -1,9 +1,9 @@ import { Config } from "@fosscord/server-util"; -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); -router.get("/", (req, res) => { +router.get("/", (req: Request, res: Response) => { const { endpoint } = Config.get().gateway; res.send({ url: endpoint || process.env.GATEWAY || "ws://localhost:3002" }); }); diff --git a/src/routes/guilds/#guild_id/channels.ts b/src/routes/guilds/#guild_id/channels.ts index 9d8a95b0..a3c6f4fe 100644 --- a/src/routes/guilds/#guild_id/channels.ts +++ b/src/routes/guilds/#guild_id/channels.ts @@ -1,4 +1,4 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { ChannelCreateEvent, ChannelModel, @@ -16,14 +16,14 @@ import { check } from "../../../util/instanceOf"; import { createChannel } from "../../../util/Channel"; const router = Router(); -router.get("/", async (req, res) => { +router.get("/", async (req: Request, res: Response) => { const { guild_id } = req.params; const channels = await ChannelModel.find({ guild_id }).exec(); res.json(toObject(channels)); }); -router.post("/", check(ChannelModifySchema), async (req, res) => { +router.post("/", check(ChannelModifySchema), async (req: Request, res: Response) => { const { guild_id } = req.params; const body = req.body as ChannelModifySchema; @@ -32,7 +32,7 @@ router.post("/", check(ChannelModifySchema), async (req, res) => { res.json(channel); }); -router.patch("/", check(ChannelModifySchema), async (req, res) => { +router.patch("/", check(ChannelModifySchema), async (req: Request, res: Response) => { const { guild_id } = req.params; const body = req.body as ChannelModifySchema; diff --git a/src/routes/guilds/#guild_id/members/#member_id/index.ts b/src/routes/guilds/#guild_id/members/#member_id/index.ts index e9356c0d..12eedfb2 100644 --- a/src/routes/guilds/#guild_id/members/#member_id/index.ts +++ b/src/routes/guilds/#guild_id/members/#member_id/index.ts @@ -28,7 +28,7 @@ router.get("/", async (req: Request, res: Response) => { return res.json(toObject(member)); }); -router.patch("/", check(MemberChangeSchema), async (req, res) => { +router.patch("/", check(MemberChangeSchema), async (req: Request, res: Response) => { const { guild_id, member_id } = req.params; const body = req.body as MemberChangeSchema; if (body.roles) { diff --git a/src/routes/science.ts b/src/routes/science.ts index ab3ce58c..b16ef783 100644 --- a/src/routes/science.ts +++ b/src/routes/science.ts @@ -1,8 +1,8 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); -router.post("/", (req, res) => { +router.post("/", (req: Request, res: Response) => { // TODO: res.sendStatus(204); }); diff --git a/src/routes/users/@me/affinities/guilds.ts b/src/routes/users/@me/affinities/guilds.ts index ea0fe59d..fa6be0e7 100644 --- a/src/routes/users/@me/affinities/guilds.ts +++ b/src/routes/users/@me/affinities/guilds.ts @@ -1,8 +1,8 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); -router.get("/", (req, res) => { +router.get("/", (req: Request, res: Response) => { // TODO: res.status(200).send({ guild_affinities: [] }); }); diff --git a/src/routes/users/@me/affinities/user.ts b/src/routes/users/@me/affinities/user.ts index 2e435995..0790a8a4 100644 --- a/src/routes/users/@me/affinities/user.ts +++ b/src/routes/users/@me/affinities/user.ts @@ -1,8 +1,8 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); -router.get("/", (req, res) => { +router.get("/", (req: Request, res: Response) => { // TODO: res.status(200).send({ user_affinities: [], inverse_user_affinities: [] }); }); diff --git a/src/routes/users/@me/channels.ts b/src/routes/users/@me/channels.ts index 4cab869b..a425a25f 100644 --- a/src/routes/users/@me/channels.ts +++ b/src/routes/users/@me/channels.ts @@ -23,7 +23,7 @@ router.get("/", async (req: Request, res: Response) => { res.json(toObject(channels)); }); -router.post("/", check(DmChannelCreateSchema), async (req, res) => { +router.post("/", check(DmChannelCreateSchema), async (req: Request, res: Response) => { const body = req.body as DmChannelCreateSchema; body.recipients = body.recipients.filter((x) => x !== req.user_id).unique(); diff --git a/src/routes/users/@me/disable.ts b/src/routes/users/@me/disable.ts index ab3ce58c..b16ef783 100644 --- a/src/routes/users/@me/disable.ts +++ b/src/routes/users/@me/disable.ts @@ -1,8 +1,8 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); -router.post("/", (req, res) => { +router.post("/", (req: Request, res: Response) => { // TODO: res.sendStatus(204); }); diff --git a/src/routes/users/@me/library.ts b/src/routes/users/@me/library.ts index 2ffff851..d771cb5e 100644 --- a/src/routes/users/@me/library.ts +++ b/src/routes/users/@me/library.ts @@ -1,8 +1,8 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); -router.get("/", (req, res) => { +router.get("/", (req: Request, res: Response) => { // TODO: res.status(200).send([]); }); diff --git a/src/routes/users/@me/relationships.ts b/src/routes/users/@me/relationships.ts index 788b1a0a..b874ec9a 100644 --- a/src/routes/users/@me/relationships.ts +++ b/src/routes/users/@me/relationships.ts @@ -6,7 +6,7 @@ import { RelationshipType, RelationshipRemoveEvent } from "@fosscord/server-util"; -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { check, HTTPError } from "lambert-server"; import { emitEvent } from "../../../util/Event"; @@ -14,7 +14,7 @@ const router = Router(); const userProjection = { "user_data.relationships": true, ...PublicUserProjection }; -router.put("/:id", check({ $type: Number }), async (req, res) => { +router.put("/:id", check({ $type: Number }), async (req: Request, res: Response) => { const { id } = req.params; if (id === req.user_id) throw new HTTPError("You can't add yourself as a friend"); const body = req.body as { type?: number }; @@ -107,7 +107,7 @@ router.put("/:id", check({ $type: Number }), async (req, res) => { return res.sendStatus(204); }); -router.delete("/:id", async (req, res) => { +router.delete("/:id", async (req: Request, res: Response) => { const { id } = req.params; if (id === req.user_id) throw new HTTPError("You can't remove yourself as a friend"); diff --git a/src/routes/users/@me/settings.ts b/src/routes/users/@me/settings.ts index f1d95caf..cca9b3ab 100644 --- a/src/routes/users/@me/settings.ts +++ b/src/routes/users/@me/settings.ts @@ -1,8 +1,8 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; const router = Router(); -router.patch("/", (req, res) => { +router.patch("/", (req: Request, res: Response) => { // TODO: res.sendStatus(204); });