add openapi registers

This commit is contained in:
miloschwartz
2025-04-06 22:44:14 -04:00
parent a76e3e00f7
commit d260450a84
50 changed files with 852 additions and 60 deletions

View File

@@ -11,6 +11,7 @@ import { addPeer } from "../gerbil/peers";
import { fromError } from "zod-validation-error";
import { removeTargets } from "../newt/targets";
import { getAllowedIps } from "./helpers";
import { OpenAPITags, registry } from "@server/openApi";
const deleteTargetSchema = z
.object({
@@ -18,6 +19,17 @@ const deleteTargetSchema = z
})
.strict();
registry.registerPath({
method: "delete",
path: "/target/{targetId}",
description: "Delete a target.",
tags: [OpenAPITags.Target],
request: {
params: deleteTargetSchema
},
responses: {}
});
export async function deleteTarget(
req: Request,
res: Response,