// Regenerate src/api/types.gen.ts from the backend's scribe-admin OpenAPI spec. // Prepends @ts-nocheck: scribe emits duplicate operationIds (OTP/SID/AgentToken…), // so the file is reference-only — hand-written shapes live in src/api/types.ts. import { execSync } from 'node:child_process' import { readFileSync, writeFileSync } from 'node:fs' const SPEC = process.env.OPENAPI_SPEC ?? '../gig-platform/storage/app/api-docs/admin/openapi.yaml' const OUT = 'src/api/types.gen.ts' execSync(`pnpm exec openapi-typescript ${SPEC} -o ${OUT}`, { stdio: 'inherit' }) const banner = '// @ts-nocheck — generated from scribe-admin OpenAPI; reference only\n' writeFileSync(OUT, banner + readFileSync(OUT, 'utf8')) console.log(`prepended @ts-nocheck to ${OUT}`)