import Link from "next/link" import { buildOpenApiSpec } from "@/app/lib/openapiSpec" type OpenApiSpec = ReturnType function methodClass(method: string) { const normalized = method.toLowerCase() if (normalized === "get") return "border-blue-500/40 bg-blue-500/10 text-blue-300" if (normalized === "post") return "border-[var(--nvidia-green)]/50 bg-[var(--nvidia-green)]/10 text-[var(--nvidia-green)]" return "border-[var(--border-subtle)] bg-[var(--background-tertiary)] text-[var(--foreground-dim)]" } function operationRows(spec: OpenApiSpec) { return Object.entries(spec.paths).flatMap(([path, methods]) => Object.entries(methods).map(([method, operation]) => ({ path, method, operation, })), ) } export default function SwaggerPage() { const spec = buildOpenApiSpec() const rows = operationRows(spec) return (

OpenAPI 3.1

Swagger

Controller-node API reference for generating launch kits, autodeploying remote nodes, and managing friendly names.

Dashboard OpenAPI JSON

Title

{spec.info.title}

Version

{spec.info.version}

Auth

session cookie

Endpoints

Expandable operations generated from the local OpenAPI spec.

{rows.map(({ path, method, operation }) => (
{method} {path} {operation.summary}

{operation.description || operation.summary}

Operation

{JSON.stringify(operation, null, 2)}

Curl

{`${method.toUpperCase()} ${path}\nContent-Type: application/json\nCookie: ${spec.components.securitySchemes.sessionCookie.name}=...`}
))}

Schemas

{Object.entries(spec.components.schemas).map(([name, schema]) => (
{name}
{JSON.stringify(schema, null, 2)}
))}
) }