From 7af29ef0eb38132b0b64632b85dfed80e772c87a Mon Sep 17 00:00:00 2001 From: DecDuck Date: Sat, 9 Aug 2025 19:26:17 +1000 Subject: [PATCH] feat: add initial type hints for API docs --- drop-base | 2 +- server/api/v1/admin/auth/invitation/index.delete.ts | 3 +++ server/api/v1/admin/game/version/index.delete.ts | 2 +- server/api/v1/admin/game/version/index.patch.ts | 2 +- server/api/v1/admin/tags/[id]/index.delete.ts | 5 +++++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drop-base b/drop-base index 04125e8..4c42edf 160000 --- a/drop-base +++ b/drop-base @@ -1 +1 @@ -Subproject commit 04125e89bef517411e103cdabcfa64a1bb563423 +Subproject commit 4c42edf5adfa755c33bc8ce7bf1ddec87a0963a8 diff --git a/server/api/v1/admin/auth/invitation/index.delete.ts b/server/api/v1/admin/auth/invitation/index.delete.ts index 195aae5..83b2d91 100644 --- a/server/api/v1/admin/auth/invitation/index.delete.ts +++ b/server/api/v1/admin/auth/invitation/index.delete.ts @@ -7,6 +7,9 @@ const DeleteInvite = type({ id: "string", }).configure(throwingArktype); +/** + * Delete a simple auth invitation + */ export default defineEventHandler<{ body: typeof DeleteInvite.infer; }>(async (h3) => { diff --git a/server/api/v1/admin/game/version/index.delete.ts b/server/api/v1/admin/game/version/index.delete.ts index caf4242..58850ff 100644 --- a/server/api/v1/admin/game/version/index.delete.ts +++ b/server/api/v1/admin/game/version/index.delete.ts @@ -8,7 +8,7 @@ const DeleteVersion = type({ versionName: "string", }).configure(throwingArktype); -export default defineEventHandler<{ body: typeof DeleteVersion }>( +export default defineEventHandler<{ body: typeof DeleteVersion.infer }>( async (h3) => { const allowed = await aclManager.allowSystemACL(h3, [ "game:version:delete", diff --git a/server/api/v1/admin/game/version/index.patch.ts b/server/api/v1/admin/game/version/index.patch.ts index 3833840..cc9b5fa 100644 --- a/server/api/v1/admin/game/version/index.patch.ts +++ b/server/api/v1/admin/game/version/index.patch.ts @@ -8,7 +8,7 @@ const UpdateVersionOrder = type({ versions: "string[]", }).configure(throwingArktype); -export default defineEventHandler<{ body: typeof UpdateVersionOrder }>( +export default defineEventHandler<{ body: typeof UpdateVersionOrder.infer }>( async (h3) => { const allowed = await aclManager.allowSystemACL(h3, [ "game:version:update", diff --git a/server/api/v1/admin/tags/[id]/index.delete.ts b/server/api/v1/admin/tags/[id]/index.delete.ts index 4279257..69a865f 100644 --- a/server/api/v1/admin/tags/[id]/index.delete.ts +++ b/server/api/v1/admin/tags/[id]/index.delete.ts @@ -1,6 +1,11 @@ import aclManager from "~/server/internal/acls"; import prisma from "~/server/internal/db/database"; +/** + * This route allows you to delete game organization tags. + * + * @param {string} id test + */ export default defineEventHandler(async (h3) => { const allowed = await aclManager.allowSystemACL(h3, ["tags:delete"]); if (!allowed) throw createError({ statusCode: 403 });