feat(studio): authors/series/articles/subtopics/briefs/style-presets + agent tokens (show-once)
This commit is contained in:
14
scripts/gen-api.mjs
Normal file
14
scripts/gen-api.mjs
Normal file
@ -0,0 +1,14 @@
|
||||
// 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/public/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}`)
|
||||
Reference in New Issue
Block a user