diff --git a/scripts/util/getRouteDescriptions.js b/scripts/util/getRouteDescriptions.js index 5896f04..5c4c0af 100644 --- a/scripts/util/getRouteDescriptions.js +++ b/scripts/util/getRouteDescriptions.js @@ -2,7 +2,7 @@ const path = require("path"); const { traverseDirectory } = require("lambert-server"); const RouteUtility = require("../../dist/api/util/handlers/route.js"); -const { bgRedBright, greenBright, yellowBright, blueBright, redBright, underline, bold } = require("picocolors"); +const { bgRedBright, greenBright, yellowBright, blueBright, redBright, underline, bold, bgYellow, black } = require("picocolors"); const methods = ["get", "post", "put", "delete", "patch"]; const routes = new Map(); @@ -46,7 +46,7 @@ const opts = args.find((x) => x?.prototype?.OPTS_MARKER == true); if (!opts) return console.error( - ` \x1b[5m${bgRedBright("ERROR")}\x1b[25m ${file.replace(path.resolve(__dirname, "..", "..", "dist"), "/src/")} has route without route() description middleware: ${colorizeMethod(apiMethod)} ${formatPath(apiPath)}`, + ` \x1b[5m${bgYellow(black("WARN"))}\x1b[25m ${file.replace(path.resolve(__dirname, "..", "..", "dist"), "/src")} has route without route() description middleware: ${colorizeMethod(apiMethod)} ${formatPath(apiPath)}`, ); console.log(`${colorizeMethod(apiMethod).padStart("DELETE".length + 10)} ${formatPath(apiPathPrefix + apiPath)}`); diff --git "a/src/api/routes/applications/\043application_id/commands/\043command_id/index.ts" "b/src/api/routes/applications/\043application_id/commands/\043command_id/index.ts" index 5501104..e061861 100644 --- "a/src/api/routes/applications/\043application_id/commands/\043command_id/index.ts" +++ "b/src/api/routes/applications/\043application_id/commands/\043command_id/index.ts" @@ -100,7 +100,7 @@ }, ); -router.delete("/", async (req: Request, res: Response) => { +router.delete("/", route({}), async (req: Request, res: Response) => { const applicationExists = await Application.exists({ where: { id: req.params.application_id as string } }); if (!applicationExists) { diff --git "a/src/api/routes/applications/\043application_id/guilds/\043guild_id/commands/\043command_id/index.ts" "b/src/api/routes/applications/\043application_id/guilds/\043guild_id/commands/\043command_id/index.ts" index e4f847c..16d7786 100644 --- "a/src/api/routes/applications/\043application_id/guilds/\043guild_id/commands/\043command_id/index.ts" +++ "b/src/api/routes/applications/\043application_id/guilds/\043guild_id/commands/\043command_id/index.ts" @@ -131,7 +131,7 @@ }, ); -router.delete("/", async (req: Request, res: Response) => { +router.delete("/", route({}), async (req: Request, res: Response) => { const applicationExists = await Application.exists({ where: { id: req.params.application_id as string } }); if (!applicationExists) { diff --git "a/src/api/routes/channels/\043channel_id/attachments.ts" "b/src/api/routes/channels/\043channel_id/attachments.ts" index bf3c70f..2b3fd35 100644 --- "a/src/api/routes/channels/\043channel_id/attachments.ts" +++ "b/src/api/routes/channels/\043channel_id/attachments.ts" @@ -99,7 +99,7 @@ }, ); -router.delete("/:cloud_attachment_url", async (req: Request, res: Response) => { +router.delete("/:cloud_attachment_url", route({}), async (req: Request, res: Response) => { const { channel_id, cloud_attachment_url } = req.params as { [key: string]: string }; const user = req.user;