feat: establish NekoNest Cloud control and relay

This commit is contained in:
2026-08-12 23:25:43 +08:00
commit f27606b709
222 changed files with 71456 additions and 0 deletions
@@ -0,0 +1,24 @@
import {
authenticateRelayNode,
revokePhoneForRelay,
} from "@/db/relay-control-plane";
import { apiError, readJsonMutation } from "../../../respond";
export async function POST(request: Request) {
try {
const principal = await authenticateRelayNode(request);
const payload = await readJsonMutation<{
tenant_id?: string;
phone_id?: string;
reason?: string;
}>(request);
return Response.json(await revokePhoneForRelay({
principal,
tenantId: payload.tenant_id ?? "",
phoneId: payload.phone_id ?? "",
reason: payload.reason ?? "",
}), { headers: { "cache-control": "no-store" } });
} catch (error) {
return apiError(error);
}
}