@nestia/migrate 0.7.10 → 0.7.11
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 +70 -98
- package/lib/MigrateApplication.js.map +1 -1
- package/lib/bundles/NEST_TEMPLATE.js +2 -2
- package/lib/programmers/MigrateApiSimulatationProgrammer.js +17 -17
- package/lib/programmers/MigrateApiSimulatationProgrammer.js.map +1 -1
- package/package.json +8 -8
- package/src/bundles/NEST_TEMPLATE.ts +2 -2
- package/src/programmers/MigrateApiSimulatationProgrammer.ts +10 -11
@@ -24,9 +24,7 @@ class MigrateApplication {
|
|
24
24
|
const value = input[key];
|
25
25
|
if (undefined === value)
|
26
26
|
return true;
|
27
|
-
|
28
|
-
return "object" === typeof value && null !== value && false === Array.isArray(value) && $iu0(value);
|
29
|
-
return true;
|
27
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $iu0(value);
|
30
28
|
});
|
31
29
|
const $io7 = input => null !== input.type && undefined === input.type && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
32
30
|
const $io8 = input => "null" === input.type && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
@@ -44,9 +42,7 @@ class MigrateApplication {
|
|
44
42
|
const value = input[key];
|
45
43
|
if (undefined === value)
|
46
44
|
return true;
|
47
|
-
|
48
|
-
return "object" === typeof value && null !== value && $iu1(value);
|
49
|
-
return true;
|
45
|
+
return "object" === typeof value && null !== value && $iu1(value);
|
50
46
|
});
|
51
47
|
const $io20 = input => "http" === input.type && "basic" === input.scheme;
|
52
48
|
const $io21 = input => "http" === input.type && "bearer" === input.scheme && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat);
|
@@ -59,9 +55,7 @@ class MigrateApplication {
|
|
59
55
|
const value = input[key];
|
60
56
|
if (undefined === value)
|
61
57
|
return true;
|
62
|
-
|
63
|
-
return "string" === typeof value;
|
64
|
-
return true;
|
58
|
+
return "string" === typeof value;
|
65
59
|
});
|
66
60
|
const $io28 = input => "string" === typeof input.authorizationUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io27(input.scopes));
|
67
61
|
const $io29 = input => "string" === typeof input.tokenUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io27(input.scopes));
|
@@ -69,17 +63,13 @@ class MigrateApplication {
|
|
69
63
|
const value = input[key];
|
70
64
|
if (undefined === value)
|
71
65
|
return true;
|
72
|
-
|
73
|
-
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io31(value);
|
74
|
-
return true;
|
66
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io31(value);
|
75
67
|
});
|
76
68
|
const $io31 = input => Object.keys(input).every(key => {
|
77
69
|
const value = input[key];
|
78
70
|
if (undefined === value)
|
79
71
|
return true;
|
80
|
-
|
81
|
-
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io32(value);
|
82
|
-
return true;
|
72
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io32(value);
|
83
73
|
});
|
84
74
|
const $io32 = input => (undefined === input.parameters || Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && $io33(elem))) && (undefined === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && $io34(input.requestBody)) && (undefined === input.responses || "object" === typeof input.responses && null !== input.responses && false === Array.isArray(input.responses) && $io41(input.responses)) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.security || Array.isArray(input.security) && input.security.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io43(elem))) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (undefined === input["x-nestia-jsDocTags"] || Array.isArray(input["x-nestia-jsDocTags"]) && input["x-nestia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io44(elem)));
|
85
75
|
const $io33 = input => (undefined === input.name || "string" === typeof input.name) && ("header" === input["in"] || "query" === input["in"] || "cookie" === input["in"] || "path" === input["in"]) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && $iu0(input.schema)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description);
|
@@ -94,18 +84,14 @@ class MigrateApplication {
|
|
94
84
|
const value = input[key];
|
95
85
|
if (undefined === value)
|
96
86
|
return true;
|
97
|
-
|
98
|
-
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io42(value);
|
99
|
-
return true;
|
87
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io42(value);
|
100
88
|
});
|
101
89
|
const $io42 = input => (undefined === input.description || "string" === typeof input.description) && (undefined === input.content || "object" === typeof input.content && null !== input.content && false === Array.isArray(input.content) && $io35(input.content)) && (undefined === input["x-nestia-encrypted"] || "boolean" === typeof input["x-nestia-encrypted"]);
|
102
90
|
const $io43 = input => Object.keys(input).every(key => {
|
103
91
|
const value = input[key];
|
104
92
|
if (undefined === value)
|
105
93
|
return true;
|
106
|
-
|
107
|
-
return Array.isArray(value) && value.every(elem => "string" === typeof elem);
|
108
|
-
return true;
|
94
|
+
return Array.isArray(value) && value.every(elem => "string" === typeof elem);
|
109
95
|
});
|
110
96
|
const $io44 = input => "string" === typeof input.name && (undefined === input.text || Array.isArray(input.text) && input.text.every(elem => "object" === typeof elem && null !== elem && $io45(elem)));
|
111
97
|
const $io45 = input => "string" === typeof input.text && "string" === typeof input.kind;
|
@@ -315,17 +301,15 @@ class MigrateApplication {
|
|
315
301
|
const value = input[key];
|
316
302
|
if (undefined === value)
|
317
303
|
return true;
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
});
|
328
|
-
return true;
|
304
|
+
return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
|
305
|
+
path: _path + $join(key),
|
306
|
+
expected: "(ISwaggerSchema.IAnyOf | ISwaggerSchema.IArray | ISwaggerSchema.IBoolean | ISwaggerSchema.IInteger | ISwaggerSchema.INullOnly | ISwaggerSchema.INumber | ISwaggerSchema.IObject | ISwaggerSchema.IOneOf | ISwaggerSchema.IReference | ISwaggerSchema.IString | ISwaggerSchema.IUnknown)",
|
307
|
+
value: value
|
308
|
+
})) && $au0(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
309
|
+
path: _path + $join(key),
|
310
|
+
expected: "(ISwaggerSchema.IAnyOf | ISwaggerSchema.IArray | ISwaggerSchema.IBoolean | ISwaggerSchema.IInteger | ISwaggerSchema.INullOnly | ISwaggerSchema.INumber | ISwaggerSchema.IObject | ISwaggerSchema.IOneOf | ISwaggerSchema.IReference | ISwaggerSchema.IString | ISwaggerSchema.IUnknown)",
|
311
|
+
value: value
|
312
|
+
});
|
329
313
|
});
|
330
314
|
const $ao7 = (input, _path, _exceptionable = true) => (null !== input.type || $guard(_exceptionable, {
|
331
315
|
path: _path + ".type",
|
@@ -919,17 +903,15 @@ class MigrateApplication {
|
|
919
903
|
const value = input[key];
|
920
904
|
if (undefined === value)
|
921
905
|
return true;
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
});
|
932
|
-
return true;
|
906
|
+
return ("object" === typeof value && null !== value || $guard(_exceptionable, {
|
907
|
+
path: _path + $join(key),
|
908
|
+
expected: "(ISwaggerSecurityScheme.IApiKey | ISwaggerSecurityScheme.IHttpBasic | ISwaggerSecurityScheme.IHttpBearer | ISwaggerSecurityScheme.IOAuth2 | ISwaggerSecurityScheme.IOpenId)",
|
909
|
+
value: value
|
910
|
+
})) && $au1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
911
|
+
path: _path + $join(key),
|
912
|
+
expected: "(ISwaggerSecurityScheme.IApiKey | ISwaggerSecurityScheme.IHttpBasic | ISwaggerSecurityScheme.IHttpBearer | ISwaggerSecurityScheme.IOAuth2 | ISwaggerSecurityScheme.IOpenId)",
|
913
|
+
value: value
|
914
|
+
});
|
933
915
|
});
|
934
916
|
const $ao20 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
|
935
917
|
path: _path + ".type",
|
@@ -1050,13 +1032,11 @@ class MigrateApplication {
|
|
1050
1032
|
const value = input[key];
|
1051
1033
|
if (undefined === value)
|
1052
1034
|
return true;
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
});
|
1059
|
-
return true;
|
1035
|
+
return "string" === typeof value || $guard(_exceptionable, {
|
1036
|
+
path: _path + $join(key),
|
1037
|
+
expected: "string",
|
1038
|
+
value: value
|
1039
|
+
});
|
1060
1040
|
});
|
1061
1041
|
const $ao28 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
|
1062
1042
|
path: _path + ".authorizationUrl",
|
@@ -1096,33 +1076,29 @@ class MigrateApplication {
|
|
1096
1076
|
const value = input[key];
|
1097
1077
|
if (undefined === value)
|
1098
1078
|
return true;
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
});
|
1109
|
-
return true;
|
1079
|
+
return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
|
1080
|
+
path: _path + $join(key),
|
1081
|
+
expected: "ISwagger.IPath",
|
1082
|
+
value: value
|
1083
|
+
})) && $ao31(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
1084
|
+
path: _path + $join(key),
|
1085
|
+
expected: "ISwagger.IPath",
|
1086
|
+
value: value
|
1087
|
+
});
|
1110
1088
|
});
|
1111
1089
|
const $ao31 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
1112
1090
|
const value = input[key];
|
1113
1091
|
if (undefined === value)
|
1114
1092
|
return true;
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
});
|
1125
|
-
return true;
|
1093
|
+
return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
|
1094
|
+
path: _path + $join(key),
|
1095
|
+
expected: "ISwaggerRoute",
|
1096
|
+
value: value
|
1097
|
+
})) && $ao32(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
1098
|
+
path: _path + $join(key),
|
1099
|
+
expected: "ISwaggerRoute",
|
1100
|
+
value: value
|
1101
|
+
});
|
1126
1102
|
});
|
1127
1103
|
const $ao32 = (input, _path, _exceptionable = true) => (undefined === input.parameters || (Array.isArray(input.parameters) || $guard(_exceptionable, {
|
1128
1104
|
path: _path + ".parameters",
|
@@ -1349,17 +1325,15 @@ class MigrateApplication {
|
|
1349
1325
|
const value = input[key];
|
1350
1326
|
if (undefined === value)
|
1351
1327
|
return true;
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
});
|
1362
|
-
return true;
|
1328
|
+
return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
|
1329
|
+
path: _path + $join(key),
|
1330
|
+
expected: "__type.o5",
|
1331
|
+
value: value
|
1332
|
+
})) && $ao42(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
1333
|
+
path: _path + $join(key),
|
1334
|
+
expected: "__type.o5",
|
1335
|
+
value: value
|
1336
|
+
});
|
1363
1337
|
});
|
1364
1338
|
const $ao42 = (input, _path, _exceptionable = true) => (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
|
1365
1339
|
path: _path + ".description",
|
@@ -1382,21 +1356,19 @@ class MigrateApplication {
|
|
1382
1356
|
const value = input[key];
|
1383
1357
|
if (undefined === value)
|
1384
1358
|
return true;
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
});
|
1399
|
-
return true;
|
1359
|
+
return (Array.isArray(value) || $guard(_exceptionable, {
|
1360
|
+
path: _path + $join(key),
|
1361
|
+
expected: "Array<string>",
|
1362
|
+
value: value
|
1363
|
+
})) && value.every((elem, _index15) => "string" === typeof elem || $guard(_exceptionable, {
|
1364
|
+
path: _path + $join(key) + "[" + _index15 + "]",
|
1365
|
+
expected: "string",
|
1366
|
+
value: elem
|
1367
|
+
})) || $guard(_exceptionable, {
|
1368
|
+
path: _path + $join(key),
|
1369
|
+
expected: "Array<string>",
|
1370
|
+
value: value
|
1371
|
+
});
|
1400
1372
|
});
|
1401
1373
|
const $ao44 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
|
1402
1374
|
path: _path + ".name",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MigrateApplication.js","sourceRoot":"","sources":["../src/MigrateApplication.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iEAA8D;AAC9D,2DAAwD;AACxD,yDAAsD;AAEtD,6EAA0E;AAC1E,+EAA4E;AAI5E,MAAa,kBAAkB;IAG7B,YAAmB,OAAiB;QAClC,IA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,CAAC;IAEM,GAAG,CAAC,QAAiB;QAC1B,MAAM,OAAO,GAAoB,iCAAe,CAAC,OAAO,CAAC;YACvD,IAAI,EAAE,KAAK;YACX,QAAQ;YACR,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,GAAG,EAAE;SACtB,CAAC,CAAC;QACH,OAAO;YACL,OAAO;YACP,KAAK,EAAE,CAAC,GAAG,2BAAY,EAAE,GAAG,2CAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AApCD,gDAoCC"}
|
@@ -50,7 +50,7 @@ exports.NEST_TEMPLATE = [
|
|
50
50
|
{
|
51
51
|
"location": "",
|
52
52
|
"file": "package.json",
|
53
|
-
"content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.5.
|
53
|
+
"content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.5.5\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/express\": \"^4.17.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^6.19.1\",\r\n \"@typescript-eslint/parser\": \"^6.19.1\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"copy-webpack-plugin\": \"^11.0.0\",\r\n \"eslint-plugin-deprecation\": \"^2.0.0\",\r\n \"express\": \"^4.18.2\",\r\n \"nestia\": \"^5.2.2\",\r\n \"prettier\": \"^3.2.4\",\r\n \"prettier-plugin-prisma\": \"^5.0.0\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"swagger-ui-express\": \"^5.0.0\",\r\n \"ts-loader\": \"^9.5.1\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.3.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\",\r\n \"webpack\": \"^5.89.0\",\r\n \"webpack-cli\": \"^5.1.4\",\r\n \"write-file-webpack-plugin\": \"^4.5.1\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.5.5\",\r\n \"@nestia/fetcher\": \"^2.5.5\",\r\n \"@nestjs/common\": \"^10.3.3\",\r\n \"@nestjs/core\": \"^10.3.3\",\r\n \"@nestjs/platform-express\": \"^10.3.3\",\r\n \"commander\": \"10.0.0\",\r\n \"dotenv\": \"^16.3.1\",\r\n \"dotenv-expand\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.4.7\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}"
|
54
54
|
},
|
55
55
|
{
|
56
56
|
"location": "packages/api",
|
@@ -65,7 +65,7 @@ exports.NEST_TEMPLATE = [
|
|
65
65
|
{
|
66
66
|
"location": "packages/api",
|
67
67
|
"file": "package.json",
|
68
|
-
"content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.
|
68
|
+
"content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.5\",\r\n \"typia\": \"^5.4.8\"\r\n }\r\n}"
|
69
69
|
},
|
70
70
|
{
|
71
71
|
"location": "packages/api",
|
@@ -13,28 +13,28 @@ const MigrateApiNamespaceProgrammer_1 = require("./MigrateApiNamespaceProgrammer
|
|
13
13
|
const MigrateSchemaProgrammer_1 = require("./MigrateSchemaProgrammer");
|
14
14
|
var MigrateApiSimulatationProgrammer;
|
15
15
|
(function (MigrateApiSimulatationProgrammer) {
|
16
|
-
MigrateApiSimulatationProgrammer.random = (components) => (importer) => (props) =>
|
17
|
-
|
18
|
-
typescript_1.default.factory.createTypeReferenceNode(`${importer.external({
|
19
|
-
type: "default",
|
20
|
-
library: "typia",
|
21
|
-
name: "typia",
|
22
|
-
})}.IRandomGenerator`),
|
23
|
-
])),
|
24
|
-
], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(importer.external({
|
25
|
-
type: "default",
|
26
|
-
library: "typia",
|
27
|
-
name: "typia",
|
28
|
-
})))("random"), [
|
29
|
-
props.route.success
|
16
|
+
MigrateApiSimulatationProgrammer.random = (components) => (importer) => (props) => {
|
17
|
+
const output = props.route.success
|
30
18
|
? MigrateSchemaProgrammer_1.MigrateSchemaProgrammer.write(components)(importer)(props.route.success.schema)
|
31
|
-
: TypeFactory_1.TypeFactory.keyword("void")
|
32
|
-
|
19
|
+
: TypeFactory_1.TypeFactory.keyword("void");
|
20
|
+
return constant("random")(typescript_1.default.factory.createArrowFunction(undefined, undefined, [
|
21
|
+
typescript_1.default.factory.createParameterDeclaration(undefined, undefined, "g", typescript_1.default.factory.createToken(typescript_1.default.SyntaxKind.QuestionToken), typescript_1.default.factory.createTypeReferenceNode(typescript_1.default.factory.createIdentifier("Partial"), [
|
22
|
+
typescript_1.default.factory.createTypeReferenceNode(`${importer.external({
|
23
|
+
type: "default",
|
24
|
+
library: "typia",
|
25
|
+
name: "typia",
|
26
|
+
})}.IRandomGenerator`),
|
27
|
+
])),
|
28
|
+
], output, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(importer.external({
|
29
|
+
type: "default",
|
30
|
+
library: "typia",
|
31
|
+
name: "typia",
|
32
|
+
})))("random"), [output], [typescript_1.default.factory.createIdentifier("g")])));
|
33
|
+
};
|
33
34
|
MigrateApiSimulatationProgrammer.simulate = (components) => (importer) => (props) => {
|
34
35
|
const caller = () => typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("random"), undefined, [
|
35
36
|
typescript_1.default.factory.createConditionalExpression(typescript_1.default.factory.createLogicalAnd(typescript_1.default.factory.createStrictEquality(typescript_1.default.factory.createStringLiteral("object"), typescript_1.default.factory.createTypeOfExpression(typescript_1.default.factory.createIdentifier("connection.simulate"))), typescript_1.default.factory.createStrictInequality(typescript_1.default.factory.createNull(), typescript_1.default.factory.createIdentifier("connection.simulate"))), undefined, typescript_1.default.factory.createIdentifier("connection.simulate"), undefined, typescript_1.default.factory.createIdentifier("undefined")),
|
36
37
|
]);
|
37
|
-
assert;
|
38
38
|
return constant("simulate")(typescript_1.default.factory.createArrowFunction(undefined, undefined, MigrateApiFunctionProgrammer_1.MigrateApiFunctionProgrammer.writeParameterDeclarations(components)(importer)(props), typescript_1.default.factory.createTypeReferenceNode(props.route.success ? "Output" : "void"), undefined, typescript_1.default.factory.createBlock([
|
39
39
|
...assert(components)(importer)(props),
|
40
40
|
typescript_1.default.factory.createReturnStatement(caller()),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MigrateApiSimulatationProgrammer.js","sourceRoot":"","sources":["../../src/programmers/MigrateApiSimulatationProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,2EAAwE;AACxE,iEAA8D;AAK9D,iFAA8E;AAC9E,mFAAgF;AAEhF,uEAAoE;AAEpE,IAAiB,gCAAgC,
|
1
|
+
{"version":3,"file":"MigrateApiSimulatationProgrammer.js","sourceRoot":"","sources":["../../src/programmers/MigrateApiSimulatationProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,2EAAwE;AACxE,iEAA8D;AAK9D,iFAA8E;AAC9E,mFAAgF;AAEhF,uEAAoE;AA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ACjC,QAAQ,EACR,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAC1C;YACD,oBAAE,CAAC,OAAO,CAAC,wBAAwB,CACjC,SAAS,EACT,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAC3C;YACD,oBAAE,CAAC,OAAO,CAAC,wBAAwB,CACjC,MAAM,EACN,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CACpD;SACF,EACD,IAAI,CACL,EACD,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAC3B,CACF;KACF,EACD,IAAI,CACL,CACF,EACD,SAAS,CACV,CAAC;AACR,CAAC,EAzSgB,gCAAgC,gDAAhC,gCAAgC,QAyShD;AAED,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,UAAyB,EAAE,EAAE,CAC/D,oBAAE,CAAC,OAAO,CAAC,uBAAuB,CAChC,CAAC,oBAAE,CAAC,OAAO,CAAC,cAAc,CAAC,oBAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,EACxD,oBAAE,CAAC,OAAO,CAAC,6BAA6B,CACtC;IACE,oBAAE,CAAC,OAAO,CAAC,yBAAyB,CAClC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EACjC,SAAS,EACT,SAAS,EACT,UAAU,CACX;CACF,EACD,oBAAE,CAAC,SAAS,CAAC,KAAK,CACnB,CACF,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nestia/migrate",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.11",
|
4
4
|
"description": "Migration program from swagger to NestJS",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"typings": "lib/index.d.ts",
|
@@ -31,12 +31,12 @@
|
|
31
31
|
},
|
32
32
|
"homepage": "https://nestia.io",
|
33
33
|
"devDependencies": {
|
34
|
-
"@nestia/core": "2.5.
|
35
|
-
"@nestia/fetcher": "2.5.
|
36
|
-
"@nestjs/common": "^10.3.
|
37
|
-
"@nestjs/core": "^10.3.
|
38
|
-
"@nestjs/platform-express": "^10.3.
|
39
|
-
"@nestjs/platform-fastify": "^10.3.
|
34
|
+
"@nestia/core": "2.5.5",
|
35
|
+
"@nestia/fetcher": "2.5.5",
|
36
|
+
"@nestjs/common": "^10.3.3",
|
37
|
+
"@nestjs/core": "^10.3.3",
|
38
|
+
"@nestjs/platform-express": "^10.3.3",
|
39
|
+
"@nestjs/platform-fastify": "^10.3.3",
|
40
40
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
41
41
|
"@types/express": "^4.17.21",
|
42
42
|
"@types/inquirer": "^9.0.7",
|
@@ -56,7 +56,7 @@
|
|
56
56
|
"inquirer": "8.2.5",
|
57
57
|
"prettier": "^3.2.5",
|
58
58
|
"typescript": "^5.3.3",
|
59
|
-
"typia": "^5.4.
|
59
|
+
"typia": "^5.4.8"
|
60
60
|
},
|
61
61
|
"files": [
|
62
62
|
"lib",
|
@@ -47,7 +47,7 @@ export const NEST_TEMPLATE = [
|
|
47
47
|
{
|
48
48
|
"location": "",
|
49
49
|
"file": "package.json",
|
50
|
-
"content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.5.
|
50
|
+
"content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.5.5\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/express\": \"^4.17.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^6.19.1\",\r\n \"@typescript-eslint/parser\": \"^6.19.1\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"copy-webpack-plugin\": \"^11.0.0\",\r\n \"eslint-plugin-deprecation\": \"^2.0.0\",\r\n \"express\": \"^4.18.2\",\r\n \"nestia\": \"^5.2.2\",\r\n \"prettier\": \"^3.2.4\",\r\n \"prettier-plugin-prisma\": \"^5.0.0\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"swagger-ui-express\": \"^5.0.0\",\r\n \"ts-loader\": \"^9.5.1\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.3.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\",\r\n \"webpack\": \"^5.89.0\",\r\n \"webpack-cli\": \"^5.1.4\",\r\n \"write-file-webpack-plugin\": \"^4.5.1\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.5.5\",\r\n \"@nestia/fetcher\": \"^2.5.5\",\r\n \"@nestjs/common\": \"^10.3.3\",\r\n \"@nestjs/core\": \"^10.3.3\",\r\n \"@nestjs/platform-express\": \"^10.3.3\",\r\n \"commander\": \"10.0.0\",\r\n \"dotenv\": \"^16.3.1\",\r\n \"dotenv-expand\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.4.7\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}"
|
51
51
|
},
|
52
52
|
{
|
53
53
|
"location": "packages/api",
|
@@ -62,7 +62,7 @@ export const NEST_TEMPLATE = [
|
|
62
62
|
{
|
63
63
|
"location": "packages/api",
|
64
64
|
"file": "package.json",
|
65
|
-
"content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.
|
65
|
+
"content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.5\",\r\n \"typia\": \"^5.4.8\"\r\n }\r\n}"
|
66
66
|
},
|
67
67
|
{
|
68
68
|
"location": "packages/api",
|
@@ -20,8 +20,13 @@ export namespace MigrateApiSimulatationProgrammer {
|
|
20
20
|
export const random =
|
21
21
|
(components: ISwaggerComponents) =>
|
22
22
|
(importer: MigrateImportProgrammer) =>
|
23
|
-
(props: IProps) =>
|
24
|
-
|
23
|
+
(props: IProps) => {
|
24
|
+
const output = props.route.success
|
25
|
+
? MigrateSchemaProgrammer.write(components)(importer)(
|
26
|
+
props.route.success.schema,
|
27
|
+
)
|
28
|
+
: TypeFactory.keyword("void");
|
29
|
+
return constant("random")(
|
25
30
|
ts.factory.createArrowFunction(
|
26
31
|
undefined,
|
27
32
|
undefined,
|
@@ -45,7 +50,7 @@ export namespace MigrateApiSimulatationProgrammer {
|
|
45
50
|
),
|
46
51
|
),
|
47
52
|
],
|
48
|
-
|
53
|
+
output,
|
49
54
|
undefined,
|
50
55
|
ts.factory.createCallExpression(
|
51
56
|
IdentifierFactory.access(
|
@@ -57,17 +62,12 @@ export namespace MigrateApiSimulatationProgrammer {
|
|
57
62
|
}),
|
58
63
|
),
|
59
64
|
)("random"),
|
60
|
-
[
|
61
|
-
props.route.success
|
62
|
-
? MigrateSchemaProgrammer.write(components)(importer)(
|
63
|
-
props.route.success.schema,
|
64
|
-
)
|
65
|
-
: TypeFactory.keyword("void"),
|
66
|
-
],
|
65
|
+
[output],
|
67
66
|
[ts.factory.createIdentifier("g")],
|
68
67
|
),
|
69
68
|
),
|
70
69
|
);
|
70
|
+
};
|
71
71
|
|
72
72
|
export const simulate =
|
73
73
|
(components: ISwaggerComponents) =>
|
@@ -98,7 +98,6 @@ export namespace MigrateApiSimulatationProgrammer {
|
|
98
98
|
),
|
99
99
|
],
|
100
100
|
);
|
101
|
-
assert;
|
102
101
|
return constant("simulate")(
|
103
102
|
ts.factory.createArrowFunction(
|
104
103
|
undefined,
|