fix(misskey-js): fix misskey-js autogen (#16345)

This commit is contained in:
かっこかり 2025-08-02 17:16:24 +09:00 committed by GitHub
parent 6d54370f01
commit 2da20bf3e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import assert from 'assert';
import { mkdir, readFile, writeFile } from 'fs/promises'; import { mkdir, readFile, writeFile } from 'fs/promises';
import type { OpenAPIV3_1 } from 'openapi-types'; import type { OpenAPIV3_1 } from 'openapi-types';
import { toPascal } from 'ts-case-convert'; import { toPascal } from 'ts-case-convert';
import OpenAPIParser from '@readme/openapi-parser'; import { parse } from '@readme/openapi-parser';
import openapiTS, { astToString } from 'openapi-typescript'; import openapiTS, { astToString } from 'openapi-typescript';
import type { OpenAPI3, OperationObject, PathItemObject } from 'openapi-typescript'; import type { OpenAPI3, OperationObject, PathItemObject } from 'openapi-typescript';
import ts from 'typescript'; import ts from 'typescript';
@ -401,7 +401,7 @@ async function main() {
await mkdir(generatePath, { recursive: true }); await mkdir(generatePath, { recursive: true });
const openApiJsonPath = './api.json'; const openApiJsonPath = './api.json';
const openApiDocs = await OpenAPIParser.parse(openApiJsonPath) as OpenAPIV3_1.Document; const openApiDocs = await parse(openApiJsonPath) as OpenAPIV3_1.Document;
const typeFileName = './built/autogen/types.ts'; const typeFileName = './built/autogen/types.ts';
await generateBaseTypes(openApiDocs, openApiJsonPath, typeFileName); await generateBaseTypes(openApiDocs, openApiJsonPath, typeFileName);