feat: add initial type hints for API docs

This commit is contained in:
DecDuck
2025-08-09 19:26:17 +10:00
parent b84d1f20b5
commit 7af29ef0eb
5 changed files with 11 additions and 3 deletions

View File

@ -7,6 +7,9 @@ const DeleteInvite = type({
id: "string", id: "string",
}).configure(throwingArktype); }).configure(throwingArktype);
/**
* Delete a simple auth invitation
*/
export default defineEventHandler<{ export default defineEventHandler<{
body: typeof DeleteInvite.infer; body: typeof DeleteInvite.infer;
}>(async (h3) => { }>(async (h3) => {

View File

@ -8,7 +8,7 @@ const DeleteVersion = type({
versionName: "string", versionName: "string",
}).configure(throwingArktype); }).configure(throwingArktype);
export default defineEventHandler<{ body: typeof DeleteVersion }>( export default defineEventHandler<{ body: typeof DeleteVersion.infer }>(
async (h3) => { async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [ const allowed = await aclManager.allowSystemACL(h3, [
"game:version:delete", "game:version:delete",

View File

@ -8,7 +8,7 @@ const UpdateVersionOrder = type({
versions: "string[]", versions: "string[]",
}).configure(throwingArktype); }).configure(throwingArktype);
export default defineEventHandler<{ body: typeof UpdateVersionOrder }>( export default defineEventHandler<{ body: typeof UpdateVersionOrder.infer }>(
async (h3) => { async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [ const allowed = await aclManager.allowSystemACL(h3, [
"game:version:update", "game:version:update",

View File

@ -1,6 +1,11 @@
import aclManager from "~/server/internal/acls"; import aclManager from "~/server/internal/acls";
import prisma from "~/server/internal/db/database"; 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) => { export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, ["tags:delete"]); const allowed = await aclManager.allowSystemACL(h3, ["tags:delete"]);
if (!allowed) throw createError({ statusCode: 403 }); if (!allowed) throw createError({ statusCode: 403 });