Merge remote-branch 'misskey/develop'
This commit is contained in:
commit
de7c078721
|
@ -4,23 +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,
|
||||
basedMisskeyVersion: openApiDocs.info.description,
|
||||
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,
|
||||
|
@ -37,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('');
|
||||
|
@ -60,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}'];`),
|
||||
|
@ -120,9 +98,6 @@ async function generateEndpoints(
|
|||
|
||||
const entitiesOutputLine: string[] = [];
|
||||
|
||||
entitiesOutputLine.push(generateVersionHeaderComment(openApiDocs));
|
||||
entitiesOutputLine.push('');
|
||||
|
||||
entitiesOutputLine.push(`import { operations } from '${toImportPath(typeFileName)}';`);
|
||||
entitiesOutputLine.push('');
|
||||
|
||||
|
@ -140,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() + ','),
|
||||
|
@ -188,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('');
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
/*
|
||||
* version: 4.7.0-beta.1
|
||||
* basedMisskeyVersion: 2024.2.0-beta.10
|
||||
* generatedAt: 2024-02-07T07:14:28.049Z
|
||||
*/
|
||||
|
||||
import type { SwitchCaseResponseType } from '../api.js';
|
||||
import type { Endpoints } from './endpoint.js';
|
||||
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
/*
|
||||
* version: 4.7.0-beta.1
|
||||
* basedMisskeyVersion: 2024.2.0-beta.10
|
||||
* generatedAt: 2024-02-07T07:14:28.047Z
|
||||
*/
|
||||
|
||||
import type {
|
||||
EmptyRequest,
|
||||
EmptyResponse,
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
/*
|
||||
* version: 4.7.0-beta.1
|
||||
* basedMisskeyVersion: 2024.2.0-beta.10
|
||||
* generatedAt: 2024-02-07T07:14:28.045Z
|
||||
*/
|
||||
|
||||
import { operations } from './types.js';
|
||||
|
||||
export type EmptyRequest = Record<string, unknown> | undefined;
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
/*
|
||||
* version: 4.7.0-beta.1
|
||||
* basedMisskeyVersion: 2024.2.0-beta.10
|
||||
* generatedAt: 2024-02-07T07:14:28.044Z
|
||||
*/
|
||||
|
||||
import { components } from './types.js';
|
||||
export type Error = components['schemas']['Error'];
|
||||
export type UserLite = components['schemas']['UserLite'];
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* eslint @typescript-eslint/naming-convention: 0 */
|
||||
/* eslint @typescript-eslint/no-explicit-any: 0 */
|
||||
|
||||
/*
|
||||
* version: 4.7.0-beta.1
|
||||
* basedMisskeyVersion: 2024.2.0-beta.10
|
||||
* generatedAt: 2024-02-07T07:14:27.957Z
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file was auto-generated by openapi-typescript.
|
||||
* Do not make direct changes to the file.
|
||||
|
|
|
@ -119,6 +119,7 @@ function close() {
|
|||
margin-top: 12px;
|
||||
font-size: 0.8em;
|
||||
line-height: 1.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
> .indicatorWithValue {
|
||||
|
|
|
@ -893,7 +893,6 @@ function getGameImageDriveFile() {
|
|||
formData.append('file', blob);
|
||||
formData.append('name', `bubble-game-${Date.now()}.png`);
|
||||
formData.append('isSensitive', 'false');
|
||||
formData.append('comment', 'null');
|
||||
formData.append('i', $i.token);
|
||||
if (defaultStore.state.uploadFolder) {
|
||||
formData.append('folderId', defaultStore.state.uploadFolder);
|
||||
|
|
|
@ -239,7 +239,7 @@ export class Storage<T extends StateDef> {
|
|||
|
||||
/**
|
||||
* 特定のキーの、簡易的なgetter/setterを作ります
|
||||
* 主にvue場で設定コントロールのmodelとして使う用
|
||||
* 主にvue上で設定コントロールのmodelとして使う用
|
||||
*/
|
||||
public makeGetterSetter<K extends keyof T>(key: K, getter?: (v: T[K]) => unknown, setter?: (v: unknown) => T[K]): {
|
||||
get: () => T[K]['default'];
|
||||
|
|
Loading…
Reference in a new issue