@nestia/migrate 0.9.6 → 0.10.0
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.js +367 -197
- package/lib/MigrateApplication.js.map +1 -1
- package/lib/analyzers/MigrateControllerAnalyzer.js +5 -0
- package/lib/analyzers/MigrateControllerAnalyzer.js.map +1 -1
- package/lib/analyzers/MigrateMethodAnalyzer.js +121 -36
- package/lib/analyzers/MigrateMethodAnalyzer.js.map +1 -1
- package/lib/bundles/NEST_TEMPLATE.js +2 -2
- package/lib/bundles/SDK_TEMPLATE.js +1 -1
- package/lib/programmers/MigrateSchemaProgrammer.js +15 -13
- package/lib/programmers/MigrateSchemaProgrammer.js.map +1 -1
- package/lib/structures/ISwagger.d.ts +1 -1
- package/lib/structures/ISwaggerComponents.d.ts +7 -1
- package/lib/structures/ISwaggerRoute.d.ts +6 -41
- package/lib/structures/ISwaggerRouteBodyContent.d.ts +14 -0
- package/lib/structures/ISwaggerRouteBodyContent.js +3 -0
- package/lib/structures/ISwaggerRouteBodyContent.js.map +1 -0
- package/lib/structures/ISwaggerRouteHeader.d.ts +0 -0
- package/lib/structures/ISwaggerRouteHeader.js +2 -0
- package/lib/structures/ISwaggerRouteHeader.js.map +1 -0
- package/lib/structures/ISwaggerRouteParameter.d.ts +13 -0
- package/lib/structures/ISwaggerRouteParameter.js +3 -0
- package/lib/structures/ISwaggerRouteParameter.js.map +1 -0
- package/lib/structures/ISwaggerRouteRequestBody.d.ts +11 -0
- package/lib/structures/ISwaggerRouteRequestBody.js +3 -0
- package/lib/structures/ISwaggerRouteRequestBody.js.map +1 -0
- package/lib/structures/ISwaggerRouteResponse.d.ts +10 -0
- package/lib/structures/ISwaggerRouteResponse.js +3 -0
- package/lib/structures/ISwaggerRouteResponse.js.map +1 -0
- package/lib/utils/SwaggerComponentsExplorer.d.ts +9 -0
- package/lib/utils/SwaggerComponentsExplorer.js +29 -0
- package/lib/utils/SwaggerComponentsExplorer.js.map +1 -0
- package/lib/utils/SwaggerExplorer.d.ts +0 -0
- package/lib/utils/SwaggerExplorer.js +2 -0
- package/lib/utils/SwaggerExplorer.js.map +1 -0
- package/lib/utils/SwaggerTypeChecker.d.ts +2 -2
- package/lib/utils/SwaggerTypeChecker.js +25 -25
- package/lib/utils/SwaggerTypeChecker.js.map +1 -1
- package/package.json +2 -2
- package/src/analyzers/MigrateControllerAnalyzer.ts +7 -0
- package/src/analyzers/MigrateMethodAnalyzer.ts +147 -71
- package/src/bundles/NEST_TEMPLATE.ts +2 -2
- package/src/bundles/SDK_TEMPLATE.ts +1 -1
- package/src/programmers/MigrateSchemaProgrammer.ts +19 -16
- package/src/structures/ISwagger.ts +4 -1
- package/src/structures/ISwaggerComponents.ts +7 -1
- package/src/structures/ISwaggerRoute.ts +9 -44
- package/src/structures/ISwaggerRouteBodyContent.ts +15 -0
- package/src/structures/ISwaggerRouteHeader.ts +0 -0
- package/src/structures/ISwaggerRouteParameter.ts +14 -0
- package/src/structures/ISwaggerRouteRequestBody.ts +12 -0
- package/src/structures/ISwaggerRouteResponse.ts +11 -0
- package/src/utils/SwaggerComponentsExplorer.ts +43 -0
- package/src/utils/SwaggerTypeChecker.ts +5 -5
@@ -1,7 +1,13 @@
|
|
1
|
+
import { ISwaggerRouteParameter } from "./ISwaggerRouteParameter";
|
2
|
+
import { ISwaggerRouteRequestBody } from "./ISwaggerRouteRequestBody";
|
3
|
+
import { ISwaggerRouteResponse } from "./ISwaggerRouteResponse";
|
1
4
|
import { ISwaggerSchema } from "./ISwaggerSchema";
|
2
5
|
import { ISwaggerSecurityScheme } from "./ISwaggerSecurityScheme";
|
3
6
|
export interface ISwaggerComponents {
|
7
|
+
parameters?: Record<string, ISwaggerRouteParameter>;
|
8
|
+
requestBodies?: Record<string, ISwaggerRouteRequestBody>;
|
9
|
+
responses?: Record<string, ISwaggerRouteResponse>;
|
4
10
|
schemas?: Record<string, ISwaggerSchema>;
|
5
11
|
securitySchemes?: Record<string, ISwaggerSecurityScheme>;
|
6
|
-
namespace?: string;
|
12
|
+
"x-nestia-namespace"?: string;
|
7
13
|
}
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import { IJsDocTagInfo } from "typia/lib/schemas/metadata/IJsDocTagInfo";
|
2
|
-
import {
|
2
|
+
import { ISwaggerRouteParameter } from "./ISwaggerRouteParameter";
|
3
|
+
import { ISwaggerRouteRequestBody } from "./ISwaggerRouteRequestBody";
|
4
|
+
import { ISwaggerRouteResponse } from "./ISwaggerRouteResponse";
|
3
5
|
export interface ISwaggerRoute {
|
4
|
-
parameters?:
|
5
|
-
requestBody?:
|
6
|
-
responses?:
|
6
|
+
parameters?: (ISwaggerRouteParameter | ISwaggerRouteParameter.IReference)[];
|
7
|
+
requestBody?: ISwaggerRouteRequestBody;
|
8
|
+
responses?: Record<string, ISwaggerRouteResponse | ISwaggerRouteResponse.IReference>;
|
7
9
|
summary?: string;
|
8
10
|
description?: string;
|
9
11
|
deprecated?: boolean;
|
@@ -11,40 +13,3 @@ export interface ISwaggerRoute {
|
|
11
13
|
tags?: string[];
|
12
14
|
"x-nestia-jsDocTags"?: IJsDocTagInfo[];
|
13
15
|
}
|
14
|
-
export declare namespace ISwaggerRoute {
|
15
|
-
interface IParameter {
|
16
|
-
name?: string;
|
17
|
-
in: "path" | "query" | "header" | "cookie";
|
18
|
-
schema: ISwaggerSchema;
|
19
|
-
required?: boolean;
|
20
|
-
description?: string;
|
21
|
-
}
|
22
|
-
interface IRequestBody {
|
23
|
-
description?: string;
|
24
|
-
content: IContent;
|
25
|
-
required?: boolean;
|
26
|
-
"x-nestia-encrypted"?: boolean;
|
27
|
-
}
|
28
|
-
type IResponseBody = Record<string, {
|
29
|
-
description?: string;
|
30
|
-
content?: IContent;
|
31
|
-
"x-nestia-encrypted"?: boolean;
|
32
|
-
}>;
|
33
|
-
interface IContent {
|
34
|
-
"text/plain"?: {
|
35
|
-
schema: ISwaggerSchema;
|
36
|
-
};
|
37
|
-
"application/json"?: {
|
38
|
-
schema: ISwaggerSchema;
|
39
|
-
};
|
40
|
-
"application/x-www-form-urlencoded"?: {
|
41
|
-
schema: ISwaggerSchema;
|
42
|
-
};
|
43
|
-
"multipart/form-data"?: {
|
44
|
-
schema: ISwaggerSchema;
|
45
|
-
};
|
46
|
-
"*/*"?: {
|
47
|
-
schema: ISwaggerSchema;
|
48
|
-
};
|
49
|
-
}
|
50
|
-
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ISwaggerSchema } from "./ISwaggerSchema";
|
2
|
+
export interface ISwaggerRouteBodyContent {
|
3
|
+
"text/plain"?: ISwaggerRouteBodyContent.IMediaType;
|
4
|
+
"application/json"?: ISwaggerRouteBodyContent.IMediaType;
|
5
|
+
"application/x-www-form-urlencoded"?: ISwaggerRouteBodyContent.IMediaType;
|
6
|
+
"multipart/form-data"?: ISwaggerRouteBodyContent.IMediaType;
|
7
|
+
"*/*"?: ISwaggerRouteBodyContent.IMediaType;
|
8
|
+
}
|
9
|
+
export declare namespace ISwaggerRouteBodyContent {
|
10
|
+
interface IMediaType {
|
11
|
+
schema?: ISwaggerSchema;
|
12
|
+
"x-nestia-encrypted"?: boolean;
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ISwaggerRouteBodyContent.js","sourceRoot":"","sources":["../../src/structures/ISwaggerRouteBodyContent.ts"],"names":[],"mappings":""}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ISwaggerRouteHeader.js","sourceRoot":"","sources":["../../src/structures/ISwaggerRouteHeader.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ISwaggerSchema } from "./ISwaggerSchema";
|
2
|
+
export interface ISwaggerRouteParameter {
|
3
|
+
name?: string;
|
4
|
+
in: "path" | "query" | "header" | "cookie";
|
5
|
+
schema: ISwaggerSchema;
|
6
|
+
required?: boolean;
|
7
|
+
description?: string;
|
8
|
+
}
|
9
|
+
export declare namespace ISwaggerRouteParameter {
|
10
|
+
interface IReference {
|
11
|
+
$ref: `#/components/parameters/${string}`;
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ISwaggerRouteParameter.js","sourceRoot":"","sources":["../../src/structures/ISwaggerRouteParameter.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { ISwaggerRouteBodyContent } from "./ISwaggerRouteBodyContent";
|
2
|
+
export interface ISwaggerRouteRequestBody {
|
3
|
+
description?: string;
|
4
|
+
required?: boolean;
|
5
|
+
content?: ISwaggerRouteBodyContent;
|
6
|
+
}
|
7
|
+
export declare namespace ISwaggerRouteRequestBody {
|
8
|
+
interface IReference {
|
9
|
+
$ref: `#/components/requestBodies/${string}`;
|
10
|
+
}
|
11
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ISwaggerRouteRequestBody.js","sourceRoot":"","sources":["../../src/structures/ISwaggerRouteRequestBody.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ISwaggerRouteBodyContent } from "./ISwaggerRouteBodyContent";
|
2
|
+
export interface ISwaggerRouteResponse {
|
3
|
+
description?: string;
|
4
|
+
content?: ISwaggerRouteBodyContent;
|
5
|
+
}
|
6
|
+
export declare namespace ISwaggerRouteResponse {
|
7
|
+
interface IReference {
|
8
|
+
$ref: `#/components/responses/${string}`;
|
9
|
+
}
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ISwaggerRouteResponse.js","sourceRoot":"","sources":["../../src/structures/ISwaggerRouteResponse.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { ISwaggerComponents } from "../module";
|
2
|
+
import { ISwaggerRouteParameter } from "../structures/ISwaggerRouteParameter";
|
3
|
+
import { ISwaggerRouteRequestBody } from "../structures/ISwaggerRouteRequestBody";
|
4
|
+
import { ISwaggerRouteResponse } from "../structures/ISwaggerRouteResponse";
|
5
|
+
export declare namespace SwaggerComponentsExplorer {
|
6
|
+
const getParameter: (components: ISwaggerComponents) => (schema: ISwaggerRouteParameter | ISwaggerRouteParameter.IReference) => ISwaggerRouteParameter | null;
|
7
|
+
const getRequestBody: (components: ISwaggerComponents) => (schema: ISwaggerRouteRequestBody | ISwaggerRouteRequestBody.IReference) => ISwaggerRouteRequestBody | null;
|
8
|
+
const getResponse: (components: ISwaggerComponents) => (schema: ISwaggerRouteResponse | ISwaggerRouteResponse.IReference) => ISwaggerRouteResponse | null;
|
9
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SwaggerComponentsExplorer = void 0;
|
4
|
+
const SwaggerTypeChecker_1 = require("./SwaggerTypeChecker");
|
5
|
+
var SwaggerComponentsExplorer;
|
6
|
+
(function (SwaggerComponentsExplorer) {
|
7
|
+
SwaggerComponentsExplorer.getParameter = (components) => (schema) => {
|
8
|
+
var _a, _b;
|
9
|
+
return SwaggerTypeChecker_1.SwaggerTypeChecker.isReference(schema) &&
|
10
|
+
schema.$ref.startsWith("#/components/parameters/")
|
11
|
+
? (_b = (_a = components.parameters) === null || _a === void 0 ? void 0 : _a[schema.$ref.replace("#/components/parameters/", "")]) !== null && _b !== void 0 ? _b : null
|
12
|
+
: schema;
|
13
|
+
};
|
14
|
+
SwaggerComponentsExplorer.getRequestBody = (components) => (schema) => {
|
15
|
+
var _a, _b;
|
16
|
+
return SwaggerTypeChecker_1.SwaggerTypeChecker.isReference(schema) &&
|
17
|
+
schema.$ref.startsWith("#/components/requestBodies/")
|
18
|
+
? (_b = (_a = components.requestBodies) === null || _a === void 0 ? void 0 : _a[schema.$ref.replace("#/components/requestBodies/", "")]) !== null && _b !== void 0 ? _b : null
|
19
|
+
: schema;
|
20
|
+
};
|
21
|
+
SwaggerComponentsExplorer.getResponse = (components) => (schema) => {
|
22
|
+
var _a, _b;
|
23
|
+
return SwaggerTypeChecker_1.SwaggerTypeChecker.isReference(schema) &&
|
24
|
+
schema.$ref.startsWith("#/components/responses/")
|
25
|
+
? (_b = (_a = components.responses) === null || _a === void 0 ? void 0 : _a[schema.$ref.replace("#/components/responses/", "")]) !== null && _b !== void 0 ? _b : null
|
26
|
+
: schema;
|
27
|
+
};
|
28
|
+
})(SwaggerComponentsExplorer || (exports.SwaggerComponentsExplorer = SwaggerComponentsExplorer = {}));
|
29
|
+
//# sourceMappingURL=SwaggerComponentsExplorer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SwaggerComponentsExplorer.js","sourceRoot":"","sources":["../../src/utils/SwaggerComponentsExplorer.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,IAAiB,yBAAyB,CAoCzC;AApCD,WAAiB,yBAAyB;IAC3B,sCAAY,GACvB,CAAC,UAA8B,EAAE,EAAE,CACnC,CACE,MAAkE,EACnC,EAAE;;QACjC,OAAA,uCAAkB,CAAC,WAAW,CAAC,MAAM,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC;YAChD,CAAC,CAAC,MAAA,MAAA,UAAU,CAAC,UAAU,0CACnB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CACpD,mCAAI,IAAI;YACX,CAAC,CAAE,MAAiC,CAAA;KAAA,CAAC;IAE9B,wCAAc,GACzB,CAAC,UAA8B,EAAE,EAAE,CACnC,CACE,MAAsE,EACrC,EAAE;;QACnC,OAAA,uCAAkB,CAAC,WAAW,CAAC,MAAM,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC;YACnD,CAAC,CAAC,MAAA,MAAA,UAAU,CAAC,aAAa,0CACtB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,6BAA6B,EAAE,EAAE,CAAC,CACvD,mCAAI,IAAI;YACX,CAAC,CAAE,MAAmC,CAAA;KAAA,CAAC;IAEhC,qCAAW,GACtB,CAAC,UAA8B,EAAE,EAAE,CACnC,CACE,MAAgE,EAClC,EAAE;;QAChC,OAAA,uCAAkB,CAAC,WAAW,CAAC,MAAM,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC;YAC/C,CAAC,CAAC,MAAA,MAAA,UAAU,CAAC,SAAS,0CAClB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CACnD,mCAAI,IAAI;YACX,CAAC,CAAE,MAAgC,CAAA;KAAA,CAAC;AAC5C,CAAC,EApCgB,yBAAyB,yCAAzB,yBAAyB,QAoCzC"}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SwaggerExplorer.js","sourceRoot":"","sources":["../../src/utils/SwaggerExplorer.ts"],"names":[],"mappings":""}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { ISwaggerSchema } from "../structures/ISwaggerSchema";
|
2
1
|
import { ISwaggerComponents } from "../structures/ISwaggerComponents";
|
3
|
-
|
2
|
+
import { ISwaggerSchema } from "../structures/ISwaggerSchema";
|
3
|
+
export declare namespace SwaggerTypeChecker {
|
4
4
|
const isAnyOf: (schema: ISwaggerSchema) => schema is ISwaggerSchema.IAnyOf;
|
5
5
|
const isOneOf: (schema: ISwaggerSchema) => schema is ISwaggerSchema.IOneOf;
|
6
6
|
const isNullOnly: (schema: ISwaggerSchema) => schema is ISwaggerSchema.INullOnly;
|
@@ -1,34 +1,34 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
var
|
5
|
-
(function (
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
!
|
18
|
-
!
|
19
|
-
!
|
20
|
-
|
3
|
+
exports.SwaggerTypeChecker = void 0;
|
4
|
+
var SwaggerTypeChecker;
|
5
|
+
(function (SwaggerTypeChecker) {
|
6
|
+
SwaggerTypeChecker.isAnyOf = (schema) => schema.anyOf !== undefined;
|
7
|
+
SwaggerTypeChecker.isOneOf = (schema) => schema.oneOf !== undefined;
|
8
|
+
SwaggerTypeChecker.isNullOnly = (schema) => schema.type === "null";
|
9
|
+
SwaggerTypeChecker.isBoolean = (schema) => schema.type === "boolean";
|
10
|
+
SwaggerTypeChecker.isInteger = (schema) => schema.type === "integer";
|
11
|
+
SwaggerTypeChecker.isNumber = (schema) => schema.type === "number";
|
12
|
+
SwaggerTypeChecker.isString = (schema) => schema.type === "string";
|
13
|
+
SwaggerTypeChecker.isArray = (schema) => schema.type === "array";
|
14
|
+
SwaggerTypeChecker.isObject = (schema) => schema.type === "object";
|
15
|
+
SwaggerTypeChecker.isReference = (schema) => schema.$ref !== undefined;
|
16
|
+
SwaggerTypeChecker.isUnknown = (schema) => schema.type === undefined &&
|
17
|
+
!SwaggerTypeChecker.isAnyOf(schema) &&
|
18
|
+
!SwaggerTypeChecker.isOneOf(schema) &&
|
19
|
+
!SwaggerTypeChecker.isReference(schema);
|
20
|
+
SwaggerTypeChecker.isNullable = (components) => (schema) => {
|
21
21
|
var _a;
|
22
|
-
if (
|
23
|
-
return schema.anyOf.some(
|
24
|
-
else if (
|
25
|
-
return schema.oneOf.some(
|
26
|
-
else if (
|
22
|
+
if (SwaggerTypeChecker.isAnyOf(schema))
|
23
|
+
return schema.anyOf.some(SwaggerTypeChecker.isNullable(components));
|
24
|
+
else if (SwaggerTypeChecker.isOneOf(schema))
|
25
|
+
return schema.oneOf.some(SwaggerTypeChecker.isNullable(components));
|
26
|
+
else if (SwaggerTypeChecker.isReference(schema)) {
|
27
27
|
const $id = schema.$ref.replace("#/components/schemas/", "");
|
28
28
|
const target = ((_a = components.schemas) !== null && _a !== void 0 ? _a : {})[$id];
|
29
|
-
return target === undefined ? false :
|
29
|
+
return target === undefined ? false : SwaggerTypeChecker.isNullable(components)(target);
|
30
30
|
}
|
31
31
|
return schema.nullable === true;
|
32
32
|
};
|
33
|
-
})(
|
33
|
+
})(SwaggerTypeChecker || (exports.SwaggerTypeChecker = SwaggerTypeChecker = {}));
|
34
34
|
//# sourceMappingURL=SwaggerTypeChecker.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SwaggerTypeChecker.js","sourceRoot":"","sources":["../../src/utils/SwaggerTypeChecker.ts"],"names":[],"mappings":";;;AAGA,IAAiB,
|
1
|
+
{"version":3,"file":"SwaggerTypeChecker.js","sourceRoot":"","sources":["../../src/utils/SwaggerTypeChecker.ts"],"names":[],"mappings":";;;AAGA,IAAiB,kBAAkB,CA+DlC;AA/DD,WAAiB,kBAAkB;IACpB,0BAAO,GAAG,CACrB,MAAsB,EACW,EAAE,CAAE,MAAc,CAAC,KAAK,KAAK,SAAS,CAAC;IAE7D,0BAAO,GAAG,CACrB,MAAsB,EACW,EAAE,CAAE,MAAc,CAAC,KAAK,KAAK,SAAS,CAAC;IAE7D,6BAAU,GAAG,CACxB,MAAsB,EACc,EAAE,CAAE,MAAc,CAAC,IAAI,KAAK,MAAM,CAAC;IAE5D,4BAAS,GAAG,CACvB,MAAsB,EACa,EAAE,CAAE,MAAc,CAAC,IAAI,KAAK,SAAS,CAAC;IAE9D,4BAAS,GAAG,CACvB,MAAsB,EACa,EAAE,CAAE,MAAc,CAAC,IAAI,KAAK,SAAS,CAAC;IAE9D,2BAAQ,GAAG,CACtB,MAAsB,EACY,EAAE,CAAE,MAAc,CAAC,IAAI,KAAK,QAAQ,CAAC;IAE5D,2BAAQ,GAAG,CACtB,MAAsB,EACY,EAAE,CAAE,MAAc,CAAC,IAAI,KAAK,QAAQ,CAAC;IAE5D,0BAAO,GAAG,CACrB,MAAsB,EACW,EAAE,CAAE,MAAc,CAAC,IAAI,KAAK,OAAO,CAAC;IAE1D,2BAAQ,GAAG,CACtB,MAAsB,EACY,EAAE,CAAE,MAAc,CAAC,IAAI,KAAK,QAAQ,CAAC;IAE5D,8BAAW,GAAG,CACzB,MAAsB,EACe,EAAE,CAAE,MAAc,CAAC,IAAI,KAAK,SAAS,CAAC;IAEhE,4BAAS,GAAG,CACvB,MAAsB,EACa,EAAE,CACpC,MAAc,CAAC,IAAI,KAAK,SAAS;QAClC,CAAC,mBAAA,OAAO,CAAC,MAAM,CAAC;QAChB,CAAC,mBAAA,OAAO,CAAC,MAAM,CAAC;QAChB,CAAC,mBAAA,WAAW,CAAC,MAAM,CAAC,CAAC;IAEV,6BAAU,GACrB,CAAC,UAA8B,EAAE,EAAE,CACnC,CAAC,MAAsB,EAAW,EAAE;;QAClC,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC;YACpC,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAA,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aAC9C,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC;YACzC,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAA,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aAC9C,IAAI,kBAAkB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YAChD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;YAC7D,MAAM,MAAM,GAAG,CAAC,MAAA,UAAU,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;YAC/C,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAA,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;QACvE,CAAC;QACD,OAAQ,MAAiC,CAAC,QAAQ,KAAK,IAAI,CAAC;IAC9D,CAAC,CAAC;AACN,CAAC,EA/DgB,kBAAkB,kCAAlB,kBAAkB,QA+DlC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nestia/migrate",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.10.0",
|
4
4
|
"description": "Migration program from swagger to NestJS",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"typings": "lib/index.d.ts",
|
@@ -60,7 +60,7 @@
|
|
60
60
|
"prettier": "^3.2.5",
|
61
61
|
"tstl": "^2.5.13",
|
62
62
|
"typescript": "^5.4.2",
|
63
|
-
"typia": "^5.5.
|
63
|
+
"typia": "^5.5.7"
|
64
64
|
},
|
65
65
|
"files": [
|
66
66
|
"lib",
|
@@ -20,6 +20,8 @@ export namespace MigrateControllerAnalyzer {
|
|
20
20
|
|
21
21
|
// GATHER ROUTES
|
22
22
|
for (const [path, collection] of Object.entries(props.swagger.paths)) {
|
23
|
+
if (collection === undefined) continue;
|
24
|
+
|
23
25
|
// PREPARE DIRECTORIES
|
24
26
|
const location: string = StringUtil.splitWithNormalization(path)
|
25
27
|
.filter((str) => str[0] !== "{" && str[0] !== ":")
|
@@ -29,6 +31,11 @@ export namespace MigrateControllerAnalyzer {
|
|
29
31
|
// INSERT ROUTES TO THE LAST DIRECTORY
|
30
32
|
const routes: IEntry[] = MapUtil.take(endpoints)(location)(() => []);
|
31
33
|
for (const [method, value] of Object.entries(collection)) {
|
34
|
+
if (
|
35
|
+
value === undefined ||
|
36
|
+
["get", "post", "patch", "put", "delete"].includes(method) === false
|
37
|
+
)
|
38
|
+
continue;
|
32
39
|
const r: IMigrateRoute | null = MigrateMethodAnalzyer.analyze(props)({
|
33
40
|
path,
|
34
41
|
method,
|