From c81b61eb2e4e3a16f0039ebfa9c174ee216ccafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8A=E3=81=95=E3=82=80=E3=81=AE=E3=81=B2=E3=81=A8?= <46447427+samunohito@users.noreply.github.com> Date: Tue, 6 Feb 2024 21:03:29 +0900 Subject: [PATCH] =?UTF-8?q?fix(misskey-js):=20=E8=87=AA=E5=8B=95=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=89=A9=E3=81=AE=E5=86=92=E9=A0=AD=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=A8=E6=97=A5?= =?UTF-8?q?=E4=BB=98=E3=82=92=E5=89=8A=E9=99=A4=20(#13185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../misskey-js/generator/src/generator.ts | 30 ------------------- .../misskey-js/src/autogen/apiClientJSDoc.ts | 5 ---- packages/misskey-js/src/autogen/endpoint.ts | 5 ---- packages/misskey-js/src/autogen/entities.ts | 5 ---- packages/misskey-js/src/autogen/models.ts | 5 ---- packages/misskey-js/src/autogen/types.ts | 5 ---- 6 files changed, 55 deletions(-) diff --git a/packages/misskey-js/generator/src/generator.ts b/packages/misskey-js/generator/src/generator.ts index 7e72359167..f091e599a9 100644 --- a/packages/misskey-js/generator/src/generator.ts +++ b/packages/misskey-js/generator/src/generator.ts @@ -4,22 +4,6 @@ import { toPascal } from 'ts-case-convert'; import OpenAPIParser from '@readme/openapi-parser'; import openapiTS from 'openapi-typescript'; -function generateVersionHeaderComment(openApiDocs: OpenAPIV3_1.Document): string { - const contents = { - version: openApiDocs.info.version, - generatedAt: new Date().toISOString(), - }; - - const lines: string[] = []; - lines.push('/*'); - for (const [key, value] of Object.entries(contents)) { - lines.push(` * ${key}: ${value}`); - } - lines.push(' */'); - - return lines.join('\n'); -} - async function generateBaseTypes( openApiDocs: OpenAPIV3_1.Document, openApiJsonPath: string, @@ -36,9 +20,6 @@ async function generateBaseTypes( } lines.push(''); - lines.push(generateVersionHeaderComment(openApiDocs)); - lines.push(''); - const generatedTypes = await openapiTS(openApiJsonPath, { exportType: true }); lines.push(generatedTypes); lines.push(''); @@ -59,8 +40,6 @@ async function generateSchemaEntities( const schemaNames = Object.keys(schemas); const typeAliasLines: string[] = []; - typeAliasLines.push(generateVersionHeaderComment(openApiDocs)); - typeAliasLines.push(''); typeAliasLines.push(`import { components } from '${toImportPath(typeFileName)}';`); typeAliasLines.push( ...schemaNames.map(it => `export type ${it} = components['schemas']['${it}'];`), @@ -119,9 +98,6 @@ async function generateEndpoints( const entitiesOutputLine: string[] = []; - entitiesOutputLine.push(generateVersionHeaderComment(openApiDocs)); - entitiesOutputLine.push(''); - entitiesOutputLine.push(`import { operations } from '${toImportPath(typeFileName)}';`); entitiesOutputLine.push(''); @@ -139,9 +115,6 @@ async function generateEndpoints( const endpointOutputLine: string[] = []; - endpointOutputLine.push(generateVersionHeaderComment(openApiDocs)); - endpointOutputLine.push(''); - endpointOutputLine.push('import type {'); endpointOutputLine.push( ...[emptyRequest, emptyResponse, ...entities].map(it => '\t' + it.generateName() + ','), @@ -187,9 +160,6 @@ async function generateApiClientJSDoc( const endpointOutputLine: string[] = []; - endpointOutputLine.push(generateVersionHeaderComment(openApiDocs)); - endpointOutputLine.push(''); - endpointOutputLine.push(`import type { SwitchCaseResponseType } from '${toImportPath(apiClientFileName)}';`); endpointOutputLine.push(`import type { Endpoints } from '${toImportPath(endpointsFileName)}';`); endpointOutputLine.push(''); diff --git a/packages/misskey-js/src/autogen/apiClientJSDoc.ts b/packages/misskey-js/src/autogen/apiClientJSDoc.ts index cb761493a2..d27413810c 100644 --- a/packages/misskey-js/src/autogen/apiClientJSDoc.ts +++ b/packages/misskey-js/src/autogen/apiClientJSDoc.ts @@ -1,8 +1,3 @@ -/* - * version: 2024.2.0-beta.8 - * generatedAt: 2024-02-04T16:51:09.469Z - */ - import type { SwitchCaseResponseType } from '../api.js'; import type { Endpoints } from './endpoint.js'; diff --git a/packages/misskey-js/src/autogen/endpoint.ts b/packages/misskey-js/src/autogen/endpoint.ts index 10ec645a53..7e5ca9b9ce 100644 --- a/packages/misskey-js/src/autogen/endpoint.ts +++ b/packages/misskey-js/src/autogen/endpoint.ts @@ -1,8 +1,3 @@ -/* - * version: 2024.2.0-beta.8 - * generatedAt: 2024-02-04T16:51:09.467Z - */ - import type { EmptyRequest, EmptyResponse, diff --git a/packages/misskey-js/src/autogen/entities.ts b/packages/misskey-js/src/autogen/entities.ts index 04b52e9fb6..9363ef7bcf 100644 --- a/packages/misskey-js/src/autogen/entities.ts +++ b/packages/misskey-js/src/autogen/entities.ts @@ -1,8 +1,3 @@ -/* - * version: 2024.2.0-beta.8 - * generatedAt: 2024-02-04T16:51:09.466Z - */ - import { operations } from './types.js'; export type EmptyRequest = Record | undefined; diff --git a/packages/misskey-js/src/autogen/models.ts b/packages/misskey-js/src/autogen/models.ts index ee14b22f74..8d594e61bb 100644 --- a/packages/misskey-js/src/autogen/models.ts +++ b/packages/misskey-js/src/autogen/models.ts @@ -1,8 +1,3 @@ -/* - * version: 2024.2.0-beta.8 - * generatedAt: 2024-02-04T16:51:09.465Z - */ - import { components } from './types.js'; export type Error = components['schemas']['Error']; export type UserLite = components['schemas']['UserLite']; diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index cce2dadcdb..b7d65406cb 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -1,11 +1,6 @@ /* eslint @typescript-eslint/naming-convention: 0 */ /* eslint @typescript-eslint/no-explicit-any: 0 */ -/* - * version: 2024.2.0-beta.8 - * generatedAt: 2024-02-04T16:51:09.378Z - */ - /** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file.