fix(misskey-js): fix misskey-js autogen (#16345)
This commit is contained in:
parent
6d54370f01
commit
2da20bf3e8
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue