Skip to content

Commit

Permalink
revert misskey-js related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Aug 16, 2024
1 parent a18bf4b commit 9e0c77f
Show file tree
Hide file tree
Showing 6 changed files with 589 additions and 562 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@typescript-eslint/parser": "7.17.0",
"cross-env": "7.0.3",
"cypress": "13.13.1",
"eslint": "9.9.0",
"eslint": "9.8.0",
"globals": "15.8.0",
"ncp": "2.0.0",
"start-server-and-test": "2.0.4"
Expand Down
11 changes: 3 additions & 8 deletions packages/backend/src/server/api/openapi/gen-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {
const hasBody = (schema.type === 'object' && schema.properties && Object.keys(schema.properties).length >= 1);

const info = {
operationId: endpoint.name.replaceAll('/', '___'), // NOTE: スラッシュは使えない
summary: endpoint.name,
description: desc,
externalDocs: {
Expand Down Expand Up @@ -209,15 +210,9 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {

spec.paths['/' + endpoint.name] = {
...(endpoint.meta.allowGet ? {
get: {
...info,
operationId: 'get_____' + endpoint.name.replaceAll('/', '___'), // NOTE: スラッシュは使えない
},
get: info,
} : {}),
post: {
...info,
operationId: 'post_____' + endpoint.name.replaceAll('/', '___'), // NOTE: スラッシュは使えない
},
post: info,
};
}

Expand Down
16 changes: 8 additions & 8 deletions packages/misskey-js/generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"generate": "tsx src/generator.ts && eslint ./built/**/*.ts --fix"
},
"devDependencies": {
"@readme/openapi-parser": "2.6.0",
"@types/node": "22.3.0",
"@typescript-eslint/eslint-plugin": "8.1.0",
"@typescript-eslint/parser": "8.1.0",
"@readme/openapi-parser": "2.5.0",
"@types/node": "20.9.1",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"openapi-types": "12.1.3",
"openapi-typescript": "7.3.0",
"ts-case-convert": "2.0.7",
"tsx": "4.17.0",
"typescript": "5.5.4"
"openapi-typescript": "6.7.3",
"ts-case-convert": "2.0.2",
"tsx": "4.4.0",
"typescript": "5.3.3"
},
"files": [
"built"
Expand Down
6 changes: 2 additions & 4 deletions packages/misskey-js/generator/src/generator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mkdir, writeFile, readFile } from 'fs/promises';
import { mkdir, writeFile } from 'fs/promises';
import { OpenAPIV3_1 } from 'openapi-types';
import { toPascal } from 'ts-case-convert';
import OpenAPIParser from '@readme/openapi-parser';
Expand All @@ -20,9 +20,7 @@ async function generateBaseTypes(
}
lines.push('');

const json = await readFile(openApiJsonPath, 'utf-8');

const generatedTypes = await openapiTS(json, {
const generatedTypes = await openapiTS(openApiJsonPath, {
exportType: true,
transform(schemaObject) {
if ('format' in schemaObject && schemaObject.format === 'binary') {
Expand Down
10 changes: 5 additions & 5 deletions packages/misskey-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
"directory": "packages/misskey-js"
},
"devDependencies": {
"@microsoft/api-extractor": "7.47.6",
"@microsoft/api-extractor": "7.47.4",
"@swc/jest": "0.2.36",
"@types/jest": "29.5.12",
"@types/node": "22.3.0",
"@typescript-eslint/eslint-plugin": "8.1.0",
"@typescript-eslint/parser": "8.1.0",
"@types/node": "20.14.12",
"@typescript-eslint/eslint-plugin": "7.17.0",
"@typescript-eslint/parser": "7.17.0",
"jest": "29.7.0",
"jest-fetch-mock": "3.0.3",
"jest-websocket-mock": "2.5.0",
"mock-socket": "9.3.1",
"ncp": "2.0.0",
"nodemon": "3.1.4",
"execa": "9.3.1",
"execa": "9.3.0",
"tsd": "0.31.1",
"typescript": "5.5.4",
"esbuild": "0.23.0",
Expand Down
Loading

0 comments on commit 9e0c77f

Please sign in to comment.