@nestia/migrate 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/MigrateApplication.d.ts +1 -2
- package/lib/MigrateApplication.js +3 -7
- package/lib/MigrateApplication.js.map +1 -1
- package/lib/utils/OpenApiConverter.d.ts +0 -2
- package/lib/utils/OpenApiConverter.js +5 -1565
- package/lib/utils/OpenApiConverter.js.map +1 -1
- package/package.json +75 -78
- package/src/MigrateApplication.ts +4 -7
- package/src/utils/OpenApiConverter.ts +6 -6
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"OpenApiConverter.js","sourceRoot":"","sources":["../../src/utils/OpenApiConverter.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"OpenApiConverter.js","sourceRoot":"","sources":["../../src/utils/OpenApiConverter.ts"],"names":[],"mappings":";;;;;;AAAA,+CAA+C;AAC/C,kDAA0B;AAK1B,gEAA8E;AAE9E,IAAiB,gBAAgB,CAUhC;AAVD,WAAiB,gBAAgB;IAC/B,2EAA2E;IAC3E,gEAAgE;IAChE,mDAAmD;IACnD,KAAK;IAEQ,qBAAI,GAAG,CAAC,OAAoB,EAAY,EAAE;QACrD,MAAM,SAAS,GAAG,IAAI,qBAAa,CAAC,OAAO,CAAC,CAAC;QAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAAO,eAAK,CAAC,MAAM;kCAAZ,eAAK,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAW,SAAS,CAAC,OAAO,EAAc,EAAE;IACjE,CAAC,CAAC;AACJ,CAAC,EAVgB,gBAAgB,gCAAhB,gBAAgB,QAUhC"}
|
package/package.json
CHANGED
@@ -1,78 +1,75 @@
|
|
1
|
-
{
|
2
|
-
"name": "@nestia/migrate",
|
3
|
-
"version": "0.11.
|
4
|
-
"description": "Migration program from swagger to NestJS",
|
5
|
-
"main": "lib/index.js",
|
6
|
-
"typings": "lib/index.d.ts",
|
7
|
-
"bin": {
|
8
|
-
"@nestia/migrate": "lib/executable/migrate.js"
|
9
|
-
},
|
10
|
-
"scripts": {
|
11
|
-
"build": "rimraf lib && tsc",
|
12
|
-
"bundle": "ts-node src/executable/bundle.ts",
|
13
|
-
"dev": "npm run build -- --watch",
|
14
|
-
"package:next": "npm publish --access public --tag next",
|
15
|
-
"prepare": "ts-patch install && typia patch && npm run bundle",
|
16
|
-
"test": "node lib/test"
|
17
|
-
},
|
18
|
-
"repository": {
|
19
|
-
"type": "git",
|
20
|
-
"url": "https://github.com/samchon/nestia"
|
21
|
-
},
|
22
|
-
"keywords": [
|
23
|
-
"migration",
|
24
|
-
"swagger",
|
25
|
-
"NestJS",
|
26
|
-
"nestia",
|
27
|
-
"SDK",
|
28
|
-
"Mockup Simulator"
|
29
|
-
],
|
30
|
-
"author": "Jeongho Nam",
|
31
|
-
"license": "MIT",
|
32
|
-
"bugs": {
|
33
|
-
"url": "https://github.com/samchon/nestia/issues"
|
34
|
-
},
|
35
|
-
"homepage": "https://nestia.io",
|
36
|
-
"devDependencies": {
|
37
|
-
"@nestia/core": "^2.6.0",
|
38
|
-
"@nestia/e2e": "^0.4.1",
|
39
|
-
"@nestia/fetcher": "^2.6.0",
|
40
|
-
"@nestjs/common": "^10.3.5",
|
41
|
-
"@nestjs/core": "^10.3.5",
|
42
|
-
"@nestjs/platform-express": "^10.3.5",
|
43
|
-
"@nestjs/platform-fastify": "^10.3.5",
|
44
|
-
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
45
|
-
"@types/express": "^4.17.21",
|
46
|
-
"@types/inquirer": "^9.0.7",
|
47
|
-
"@types/node": "^20.3.3",
|
48
|
-
"
|
49
|
-
"dotenv": "^
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"ts-
|
55
|
-
"
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
"
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
65
|
-
|
66
|
-
|
67
|
-
"
|
68
|
-
|
69
|
-
|
70
|
-
"
|
71
|
-
"
|
72
|
-
"
|
73
|
-
"
|
74
|
-
|
75
|
-
|
76
|
-
"LICENSE"
|
77
|
-
]
|
78
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@nestia/migrate",
|
3
|
+
"version": "0.11.3",
|
4
|
+
"description": "Migration program from swagger to NestJS",
|
5
|
+
"main": "lib/index.js",
|
6
|
+
"typings": "lib/index.d.ts",
|
7
|
+
"bin": {
|
8
|
+
"@nestia/migrate": "lib/executable/migrate.js"
|
9
|
+
},
|
10
|
+
"scripts": {
|
11
|
+
"build": "rimraf lib && tsc",
|
12
|
+
"bundle": "ts-node src/executable/bundle.ts",
|
13
|
+
"dev": "npm run build -- --watch",
|
14
|
+
"package:next": "npm publish --access public --tag next",
|
15
|
+
"prepare": "ts-patch install && typia patch && npm run bundle",
|
16
|
+
"test": "node lib/test"
|
17
|
+
},
|
18
|
+
"repository": {
|
19
|
+
"type": "git",
|
20
|
+
"url": "https://github.com/samchon/nestia"
|
21
|
+
},
|
22
|
+
"keywords": [
|
23
|
+
"migration",
|
24
|
+
"swagger",
|
25
|
+
"NestJS",
|
26
|
+
"nestia",
|
27
|
+
"SDK",
|
28
|
+
"Mockup Simulator"
|
29
|
+
],
|
30
|
+
"author": "Jeongho Nam",
|
31
|
+
"license": "MIT",
|
32
|
+
"bugs": {
|
33
|
+
"url": "https://github.com/samchon/nestia/issues"
|
34
|
+
},
|
35
|
+
"homepage": "https://nestia.io",
|
36
|
+
"devDependencies": {
|
37
|
+
"@nestia/core": "^2.6.0",
|
38
|
+
"@nestia/e2e": "^0.4.1",
|
39
|
+
"@nestia/fetcher": "^2.6.0",
|
40
|
+
"@nestjs/common": "^10.3.5",
|
41
|
+
"@nestjs/core": "^10.3.5",
|
42
|
+
"@nestjs/platform-express": "^10.3.5",
|
43
|
+
"@nestjs/platform-fastify": "^10.3.5",
|
44
|
+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
45
|
+
"@types/express": "^4.17.21",
|
46
|
+
"@types/inquirer": "^9.0.7",
|
47
|
+
"@types/node": "^20.3.3",
|
48
|
+
"dotenv": "^16.3.1",
|
49
|
+
"dotenv-expand": "^10.0.0",
|
50
|
+
"rimraf": "^5.0.1",
|
51
|
+
"serialize-error": "^4.1.0",
|
52
|
+
"source-map-support": "^0.5.21",
|
53
|
+
"ts-node": "^10.9.1",
|
54
|
+
"ts-patch": "^3.1.0",
|
55
|
+
"typescript-transform-paths": "^3.4.6"
|
56
|
+
},
|
57
|
+
"dependencies": {
|
58
|
+
"commander": "10.0.0",
|
59
|
+
"inquirer": "8.2.5",
|
60
|
+
"openapi-types": "^12.1.3",
|
61
|
+
"prettier": "^3.2.5",
|
62
|
+
"tstl": "^2.5.13",
|
63
|
+
"typescript": "^5.4.2",
|
64
|
+
"typia": "^5.5.7"
|
65
|
+
},
|
66
|
+
"files": [
|
67
|
+
"lib",
|
68
|
+
"src",
|
69
|
+
"!lib/test",
|
70
|
+
"!src/test",
|
71
|
+
"package.json",
|
72
|
+
"README.md",
|
73
|
+
"LICENSE"
|
74
|
+
]
|
75
|
+
}
|
@@ -10,7 +10,6 @@ import { MigrateNestProgrammer } from "./programmers/MigrateNestProgrammer";
|
|
10
10
|
import { IMigrateFile } from "./structures/IMigrateFile";
|
11
11
|
import { IMigrateProgram } from "./structures/IMigrateProgram";
|
12
12
|
import { ISwagger } from "./structures/ISwagger";
|
13
|
-
import { ISwaggerV20 } from "./structures/ISwaggerV20";
|
14
13
|
import { ISwaggerV31 } from "./structures/ISwaggerV31";
|
15
14
|
import { OpenApiConverter } from "./utils/OpenApiConverter";
|
16
15
|
|
@@ -18,13 +17,11 @@ export class MigrateApplication {
|
|
18
17
|
private constructor(public readonly swagger: ISwagger) {}
|
19
18
|
|
20
19
|
public static async create(
|
21
|
-
swagger: ISwagger |
|
20
|
+
swagger: ISwagger | ISwaggerV31,
|
22
21
|
): Promise<IValidation<MigrateApplication>> {
|
23
|
-
swagger = typia.is<
|
24
|
-
?
|
25
|
-
:
|
26
|
-
? OpenApiConverter.v3_1(swagger)
|
27
|
-
: swagger;
|
22
|
+
swagger = typia.is<ISwaggerV31.IVersion>(swagger)
|
23
|
+
? OpenApiConverter.v3_1(swagger)
|
24
|
+
: swagger;
|
28
25
|
const result = typia.validate<ISwagger>(swagger);
|
29
26
|
if (result.success === false) return result;
|
30
27
|
return {
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import V2_0Converter from "swagger2openapi";
|
1
|
+
// import V2_0Converter from "swagger2openapi";
|
2
2
|
import typia from "typia";
|
3
3
|
|
4
4
|
import { ISwagger } from "../structures/ISwagger";
|
5
|
-
import { ISwaggerV20 } from "../structures/ISwaggerV20";
|
5
|
+
// import { ISwaggerV20 } from "../structures/ISwaggerV20";
|
6
6
|
import { ISwaggerV31 } from "../structures/ISwaggerV31";
|
7
7
|
import { Converter as V3_1Converter } from "./openapi-down-convert/converter";
|
8
8
|
|
9
9
|
export namespace OpenApiConverter {
|
10
|
-
export const v2_0 = async (swagger: ISwaggerV20): Promise<ISwagger> => {
|
11
|
-
|
12
|
-
|
13
|
-
};
|
10
|
+
// export const v2_0 = async (swagger: ISwaggerV20): Promise<ISwagger> => {
|
11
|
+
// const output = await V2_0Converter.convertObj(swagger, {});
|
12
|
+
// return typia.assert<ISwagger>(output.openapi);
|
13
|
+
// };
|
14
14
|
|
15
15
|
export const v3_1 = (swagger: ISwaggerV31): ISwagger => {
|
16
16
|
const converter = new V3_1Converter(swagger);
|