import { writeFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { openapiDocument } from '../src/openapi.js'; const here = path.dirname(fileURLToPath(import.meta.url)); const out = path.resolve(here, '../../../docs/openapi.json'); writeFileSync(out, JSON.stringify(openapiDocument(), null, 2) + '\n'); console.log(`wrote ${out}`);