@nestia/migrate 11.2.1 → 12.0.0-dev.20260520.1
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/NestiaMigrateApplication.d.ts +1 -12
- package/lib/NestiaMigrateApplication.js +22 -24873
- package/lib/NestiaMigrateApplication.js.map +1 -1
- package/lib/analyzers/NestiaMigrateControllerAnalyzer.js.map +1 -1
- package/lib/archivers/NestiaMigrateFileArchiver.js.map +1 -1
- package/lib/bundles/NEST_TEMPLATE.js +5 -5
- package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
- package/lib/bundles/SDK_TEMPLATE.js +4 -4
- package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
- package/lib/executable/NestiaMigrateCommander.js +14 -5
- package/lib/executable/NestiaMigrateCommander.js.map +1 -1
- package/lib/executable/NestiaMigrateInquirer.js.map +1 -1
- package/lib/factories/TypeLiteralFactory.d.ts +1 -1
- package/lib/factories/TypeLiteralFactory.js +49 -13
- package/lib/factories/TypeLiteralFactory.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +177 -24588
- package/lib/index.mjs.map +1 -1
- package/lib/internal/ts.d.ts +32 -0
- package/lib/internal/ts.js +37 -0
- package/lib/internal/ts.js.map +1 -0
- package/lib/programmers/NestiaMigrateApiFileProgrammer.d.ts +1 -1
- package/lib/programmers/NestiaMigrateApiFileProgrammer.js +2 -5
- package/lib/programmers/NestiaMigrateApiFileProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.d.ts +1 -1
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js +87 -49
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.d.ts +2 -2
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js +80 -82
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiProgrammer.js +3 -2
- package/lib/programmers/NestiaMigrateApiProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.d.ts +2 -2
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js +39 -37
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiStartProgrammer.js +33 -35
- package/lib/programmers/NestiaMigrateApiStartProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateDtoProgrammer.d.ts +1 -1
- package/lib/programmers/NestiaMigrateDtoProgrammer.js +17 -19
- package/lib/programmers/NestiaMigrateDtoProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.d.ts +1 -1
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.js +26 -23
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateE2eProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateImportProgrammer.d.ts +1 -1
- package/lib/programmers/NestiaMigrateImportProgrammer.js +11 -14
- package/lib/programmers/NestiaMigrateImportProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.d.ts +1 -1
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.js +16 -18
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.d.ts +1 -1
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.js +128 -132
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.d.ts +1 -1
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.js +10 -9
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateNestProgrammer.js +3 -2
- package/lib/programmers/NestiaMigrateNestProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateSchemaProgrammer.d.ts +2 -2
- package/lib/programmers/NestiaMigrateSchemaProgrammer.js +114 -81
- package/lib/programmers/NestiaMigrateSchemaProgrammer.js.map +1 -1
- package/lib/structures/INestiaMigrateConfig.d.ts +1 -1
- package/lib/utils/FilePrinter.d.ts +2 -2
- package/lib/utils/FilePrinter.js +8 -10
- package/lib/utils/FilePrinter.js.map +1 -1
- package/lib/utils/MapUtil.js.map +1 -1
- package/lib/utils/StringUtil.d.ts +0 -1
- package/lib/utils/StringUtil.js +0 -1
- package/lib/utils/StringUtil.js.map +1 -1
- package/package.json +9 -11
- package/src/NestiaMigrateApplication.ts +29 -30
- package/src/bundles/NEST_TEMPLATE.ts +5 -5
- package/src/bundles/SDK_TEMPLATE.ts +4 -4
- package/src/executable/NestiaMigrateCommander.ts +15 -4
- package/src/executable/bundle.js +237 -4
- package/src/factories/TypeLiteralFactory.ts +22 -16
- package/src/internal/ts.ts +94 -0
- package/src/programmers/NestiaMigrateApiFileProgrammer.ts +7 -4
- package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +88 -68
- package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +122 -111
- package/src/programmers/NestiaMigrateApiProgrammer.ts +6 -5
- package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +67 -61
- package/src/programmers/NestiaMigrateApiStartProgrammer.ts +46 -45
- package/src/programmers/NestiaMigrateDtoProgrammer.ts +4 -3
- package/src/programmers/NestiaMigrateE2eFileProgrammer.ts +33 -30
- package/src/programmers/NestiaMigrateE2eProgrammer.ts +1 -1
- package/src/programmers/NestiaMigrateImportProgrammer.ts +20 -19
- package/src/programmers/NestiaMigrateNestControllerProgrammer.ts +8 -7
- package/src/programmers/NestiaMigrateNestMethodProgrammer.ts +82 -77
- package/src/programmers/NestiaMigrateNestModuleProgrammer.ts +18 -17
- package/src/programmers/NestiaMigrateNestProgrammer.ts +6 -5
- package/src/programmers/NestiaMigrateSchemaProgrammer.ts +54 -42
- package/src/structures/INestiaMigrateConfig.ts +1 -1
- package/src/utils/FilePrinter.ts +9 -14
- package/src/utils/StringUtil.ts +0 -5
- package/lib/structures/INestiaMigrateDto.d.ts +0 -7
- package/lib/structures/INestiaMigrateDto.js +0 -3
- package/lib/structures/INestiaMigrateDto.js.map +0 -1
- package/lib/structures/INestiaMigrateProgram.d.ts +0 -9
- package/lib/structures/INestiaMigrateProgram.js +0 -3
- package/lib/structures/INestiaMigrateProgram.js.map +0 -1
- package/lib/structures/INestiaMigrateSchema.d.ts +0 -4
- package/lib/structures/INestiaMigrateSchema.js +0 -3
- package/lib/structures/INestiaMigrateSchema.js.map +0 -1
- package/lib/utils/SetupWizard.d.ts +0 -3
- package/lib/utils/SetupWizard.js +0 -18
- package/lib/utils/SetupWizard.js.map +0 -1
- package/lib/utils/openapi-down-convert/RefVisitor.d.ts +0 -52
- package/lib/utils/openapi-down-convert/RefVisitor.js +0 -102
- package/lib/utils/openapi-down-convert/RefVisitor.js.map +0 -1
- package/lib/utils/openapi-down-convert/converter.d.ts +0 -146
- package/lib/utils/openapi-down-convert/converter.js +0 -441
- package/lib/utils/openapi-down-convert/converter.js.map +0 -1
- package/src/structures/INestiaMigrateDto.ts +0 -8
- package/src/structures/INestiaMigrateProgram.ts +0 -11
- package/src/structures/INestiaMigrateSchema.ts +0 -4
- package/src/utils/SetupWizard.ts +0 -12
- package/src/utils/openapi-down-convert/RefVisitor.ts +0 -134
- package/src/utils/openapi-down-convert/converter.ts +0 -536
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypeScriptFactory } from "@nestia/factory";
|
|
2
|
+
import { IdentifierFactory, StatementFactory } from "@nestia/factory";
|
|
2
3
|
import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
|
|
3
|
-
import
|
|
4
|
-
import ts from "
|
|
4
|
+
import * as typiaUtils from "@typia/utils";
|
|
5
|
+
import ts from "../internal/ts";
|
|
5
6
|
|
|
6
7
|
import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
|
|
7
8
|
import { FilePrinter } from "../utils/FilePrinter";
|
|
8
9
|
import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
|
|
9
10
|
import { NestiaMigrateSchemaProgrammer } from "./NestiaMigrateSchemaProgrammer";
|
|
10
11
|
|
|
12
|
+
const { NamingConvention } =
|
|
13
|
+
(typiaUtils as { default?: typeof typiaUtils }).default ?? typiaUtils;
|
|
14
|
+
|
|
11
15
|
export namespace NestiaMigrateApiFunctionProgrammer {
|
|
12
16
|
export interface IContext {
|
|
13
17
|
config: INestiaMigrateConfig;
|
|
@@ -18,23 +22,23 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
18
22
|
|
|
19
23
|
export const write = (ctx: IContext): ts.FunctionDeclaration =>
|
|
20
24
|
FilePrinter.description(
|
|
21
|
-
|
|
25
|
+
TypeScriptFactory.createFunctionDeclaration(
|
|
22
26
|
[
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
TypeScriptFactory.createModifier(ts.SyntaxKind.ExportKeyword),
|
|
28
|
+
TypeScriptFactory.createModifier(ts.SyntaxKind.AsyncKeyword),
|
|
25
29
|
],
|
|
26
30
|
undefined,
|
|
27
31
|
ctx.route.accessor.at(-1)!,
|
|
28
32
|
undefined,
|
|
29
33
|
writeParameterDeclarations(ctx),
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
TypeScriptFactory.createTypeReferenceNode("Promise", [
|
|
35
|
+
TypeScriptFactory.createTypeReferenceNode(
|
|
32
36
|
ctx.route.success === null
|
|
33
37
|
? "void"
|
|
34
38
|
: `${ctx.route.accessor.at(-1)!}.Response`,
|
|
35
39
|
),
|
|
36
40
|
]),
|
|
37
|
-
|
|
41
|
+
TypeScriptFactory.createBlock(writeBody(ctx), true),
|
|
38
42
|
),
|
|
39
43
|
writeDescription(ctx.config, ctx.route),
|
|
40
44
|
);
|
|
@@ -45,7 +49,7 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
45
49
|
): ts.ParameterDeclaration[] => {
|
|
46
50
|
const connection: ts.ParameterDeclaration = IdentifierFactory.parameter(
|
|
47
51
|
connectionName ?? "connection",
|
|
48
|
-
|
|
52
|
+
TypeScriptFactory.createTypeReferenceNode(
|
|
49
53
|
ctx.importer.external({
|
|
50
54
|
type: "instance",
|
|
51
55
|
library: "@nestia/fetcher",
|
|
@@ -53,7 +57,7 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
53
57
|
}),
|
|
54
58
|
ctx.route.headers
|
|
55
59
|
? [
|
|
56
|
-
|
|
60
|
+
TypeScriptFactory.createTypeReferenceNode(
|
|
57
61
|
`${ctx.route.accessor.at(-1)!}.Headers`,
|
|
58
62
|
),
|
|
59
63
|
]
|
|
@@ -68,12 +72,12 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
68
72
|
if (isProps === false) return [connection];
|
|
69
73
|
return [
|
|
70
74
|
connection,
|
|
71
|
-
|
|
75
|
+
TypeScriptFactory.createParameterDeclaration(
|
|
72
76
|
undefined,
|
|
73
77
|
undefined,
|
|
74
78
|
"props",
|
|
75
79
|
undefined,
|
|
76
|
-
|
|
80
|
+
TypeScriptFactory.createTypeReferenceNode(
|
|
77
81
|
`${ctx.route.accessor.at(-1)!}.Props`,
|
|
78
82
|
),
|
|
79
83
|
),
|
|
@@ -95,7 +99,7 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
95
99
|
? [
|
|
96
100
|
IdentifierFactory.parameter(
|
|
97
101
|
ctx.route.query.key,
|
|
98
|
-
|
|
102
|
+
TypeScriptFactory.createTypeReferenceNode(
|
|
99
103
|
`${ctx.route.accessor.at(-1)!}.Query`,
|
|
100
104
|
),
|
|
101
105
|
),
|
|
@@ -105,13 +109,13 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
105
109
|
? [
|
|
106
110
|
IdentifierFactory.parameter(
|
|
107
111
|
ctx.route.body.key,
|
|
108
|
-
|
|
112
|
+
TypeScriptFactory.createTypeReferenceNode(
|
|
109
113
|
`${ctx.route.accessor.at(-1)!}.Body`,
|
|
110
114
|
),
|
|
111
115
|
(ctx.route.body.type === "application/json" ||
|
|
112
116
|
ctx.route.body.type === "text/plain") &&
|
|
113
117
|
ctx.route.operation().requestBody?.required === false
|
|
114
|
-
?
|
|
118
|
+
? TypeScriptFactory.createToken(ts.SyntaxKind.QuestionToken)
|
|
115
119
|
: undefined,
|
|
116
120
|
),
|
|
117
121
|
]
|
|
@@ -140,13 +144,16 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
140
144
|
|
|
141
145
|
const property = (key: string): ts.Expression =>
|
|
142
146
|
ctx.config.keyword === true
|
|
143
|
-
? IdentifierFactory.access(
|
|
144
|
-
|
|
147
|
+
? IdentifierFactory.access(
|
|
148
|
+
TypeScriptFactory.createIdentifier("props"),
|
|
149
|
+
key,
|
|
150
|
+
)
|
|
151
|
+
: TypeScriptFactory.createIdentifier(key);
|
|
145
152
|
const fetch = () =>
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
TypeScriptFactory.createAwaitExpression(
|
|
154
|
+
TypeScriptFactory.createCallExpression(
|
|
148
155
|
IdentifierFactory.access(
|
|
149
|
-
|
|
156
|
+
TypeScriptFactory.createIdentifier(
|
|
150
157
|
ctx.importer.external({
|
|
151
158
|
type: "instance",
|
|
152
159
|
library: encrypted
|
|
@@ -160,24 +167,26 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
160
167
|
undefined,
|
|
161
168
|
[
|
|
162
169
|
contentType && contentType !== "multipart/form-data"
|
|
163
|
-
?
|
|
170
|
+
? TypeScriptFactory.createObjectLiteralExpression(
|
|
164
171
|
[
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
TypeScriptFactory.createSpreadAssignment(
|
|
173
|
+
TypeScriptFactory.createIdentifier("connection"),
|
|
167
174
|
),
|
|
168
|
-
|
|
175
|
+
TypeScriptFactory.createPropertyAssignment(
|
|
169
176
|
"headers",
|
|
170
|
-
|
|
177
|
+
TypeScriptFactory.createObjectLiteralExpression(
|
|
171
178
|
[
|
|
172
|
-
|
|
179
|
+
TypeScriptFactory.createSpreadAssignment(
|
|
173
180
|
IdentifierFactory.access(
|
|
174
|
-
|
|
181
|
+
TypeScriptFactory.createIdentifier("connection"),
|
|
175
182
|
"headers",
|
|
176
183
|
),
|
|
177
184
|
),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
185
|
+
TypeScriptFactory.createPropertyAssignment(
|
|
186
|
+
TypeScriptFactory.createStringLiteral(
|
|
187
|
+
"Content-Type",
|
|
188
|
+
),
|
|
189
|
+
TypeScriptFactory.createStringLiteral(contentType),
|
|
181
190
|
),
|
|
182
191
|
],
|
|
183
192
|
true,
|
|
@@ -186,29 +195,33 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
186
195
|
],
|
|
187
196
|
true,
|
|
188
197
|
)
|
|
189
|
-
:
|
|
190
|
-
|
|
198
|
+
: TypeScriptFactory.createIdentifier("connection"),
|
|
199
|
+
TypeScriptFactory.createObjectLiteralExpression(
|
|
191
200
|
[
|
|
192
|
-
|
|
201
|
+
TypeScriptFactory.createSpreadAssignment(
|
|
193
202
|
IdentifierFactory.access(
|
|
194
|
-
|
|
203
|
+
TypeScriptFactory.createIdentifier(
|
|
204
|
+
ctx.route.accessor.at(-1)!,
|
|
205
|
+
),
|
|
195
206
|
"METADATA",
|
|
196
207
|
),
|
|
197
208
|
),
|
|
198
|
-
|
|
209
|
+
TypeScriptFactory.createPropertyAssignment(
|
|
199
210
|
"path",
|
|
200
|
-
|
|
211
|
+
TypeScriptFactory.createCallExpression(
|
|
201
212
|
IdentifierFactory.access(
|
|
202
|
-
|
|
213
|
+
TypeScriptFactory.createIdentifier(
|
|
214
|
+
ctx.route.accessor.at(-1)!,
|
|
215
|
+
),
|
|
203
216
|
"path",
|
|
204
217
|
),
|
|
205
218
|
undefined,
|
|
206
219
|
getArguments(ctx, false),
|
|
207
220
|
),
|
|
208
221
|
),
|
|
209
|
-
|
|
222
|
+
TypeScriptFactory.createPropertyAssignment(
|
|
210
223
|
"status",
|
|
211
|
-
|
|
224
|
+
TypeScriptFactory.createNull(),
|
|
212
225
|
),
|
|
213
226
|
],
|
|
214
227
|
true,
|
|
@@ -221,19 +234,19 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
221
234
|
const value: ts.Expression =
|
|
222
235
|
ctx.config.simulate !== true
|
|
223
236
|
? fetch()
|
|
224
|
-
:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
237
|
+
: TypeScriptFactory.createConditionalExpression(
|
|
238
|
+
TypeScriptFactory.createStrictEquality(
|
|
239
|
+
TypeScriptFactory.createTrue(),
|
|
240
|
+
TypeScriptFactory.createIdentifier("connection.simulate"),
|
|
228
241
|
),
|
|
229
242
|
undefined,
|
|
230
|
-
|
|
231
|
-
|
|
243
|
+
TypeScriptFactory.createCallExpression(
|
|
244
|
+
TypeScriptFactory.createIdentifier(
|
|
232
245
|
`${ctx.route.accessor.at(-1)!}.simulate`,
|
|
233
246
|
),
|
|
234
247
|
[],
|
|
235
248
|
[
|
|
236
|
-
|
|
249
|
+
TypeScriptFactory.createIdentifier("connection"),
|
|
237
250
|
...getArguments(ctx, true),
|
|
238
251
|
],
|
|
239
252
|
),
|
|
@@ -243,47 +256,52 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
243
256
|
const headers: Array<IAssignHeader | ISetHeader> = getHeaders(
|
|
244
257
|
ctx.route.comment(),
|
|
245
258
|
);
|
|
246
|
-
if (headers.length === 0)
|
|
259
|
+
if (headers.length === 0)
|
|
260
|
+
return [TypeScriptFactory.createReturnStatement(value)];
|
|
247
261
|
return [
|
|
248
262
|
StatementFactory.constant({
|
|
249
263
|
name: "output",
|
|
250
|
-
type:
|
|
264
|
+
type: TypeScriptFactory.createTypeReferenceNode(
|
|
251
265
|
`${ctx.route.accessor.at(-1)!}.Response`,
|
|
252
266
|
),
|
|
253
267
|
value,
|
|
254
268
|
}),
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
269
|
+
TypeScriptFactory.createExpressionStatement(
|
|
270
|
+
TypeScriptFactory.createBinaryExpression(
|
|
271
|
+
TypeScriptFactory.createIdentifier("connection.headers"),
|
|
272
|
+
TypeScriptFactory.createToken(
|
|
273
|
+
ts.SyntaxKind.QuestionQuestionEqualsToken,
|
|
274
|
+
),
|
|
275
|
+
TypeScriptFactory.createObjectLiteralExpression([]),
|
|
260
276
|
),
|
|
261
277
|
),
|
|
262
278
|
...headers.map((h) =>
|
|
263
|
-
|
|
279
|
+
TypeScriptFactory.createExpressionStatement(
|
|
264
280
|
h.type === "assign"
|
|
265
|
-
?
|
|
266
|
-
|
|
281
|
+
? TypeScriptFactory.createCallExpression(
|
|
282
|
+
TypeScriptFactory.createIdentifier("Object.assign"),
|
|
267
283
|
undefined,
|
|
268
284
|
[
|
|
269
|
-
|
|
270
|
-
|
|
285
|
+
TypeScriptFactory.createIdentifier("connection.headers"),
|
|
286
|
+
TypeScriptFactory.createIdentifier(`output.${h.accessor}`),
|
|
271
287
|
],
|
|
272
288
|
)
|
|
273
|
-
:
|
|
274
|
-
|
|
289
|
+
: TypeScriptFactory.createBinaryExpression(
|
|
290
|
+
TypeScriptFactory.createIdentifier(
|
|
275
291
|
`connection.headers${
|
|
276
292
|
NamingConvention.variable(h.property)
|
|
277
293
|
? `.${h.property}`
|
|
278
294
|
: `[${JSON.stringify(h.property)}]`
|
|
279
295
|
}`,
|
|
280
296
|
),
|
|
281
|
-
|
|
282
|
-
|
|
297
|
+
TypeScriptFactory.createToken(ts.SyntaxKind.EqualsToken),
|
|
298
|
+
TypeScriptFactory.createIdentifier(`output.${h.accessor}`),
|
|
283
299
|
),
|
|
284
300
|
),
|
|
285
301
|
),
|
|
286
|
-
|
|
302
|
+
TypeScriptFactory.createReturnStatement(
|
|
303
|
+
TypeScriptFactory.createIdentifier("output"),
|
|
304
|
+
),
|
|
287
305
|
];
|
|
288
306
|
};
|
|
289
307
|
|
|
@@ -295,14 +313,16 @@ export namespace NestiaMigrateApiFunctionProgrammer {
|
|
|
295
313
|
)
|
|
296
314
|
return [];
|
|
297
315
|
else if (ctx.config.keyword === true)
|
|
298
|
-
return [
|
|
316
|
+
return [TypeScriptFactory.createIdentifier("props")];
|
|
299
317
|
return [
|
|
300
|
-
...ctx.route.parameters.map((p) =>
|
|
318
|
+
...ctx.route.parameters.map((p) =>
|
|
319
|
+
TypeScriptFactory.createIdentifier(p.key),
|
|
320
|
+
),
|
|
301
321
|
...(ctx.route.query
|
|
302
|
-
? [
|
|
322
|
+
? [TypeScriptFactory.createIdentifier(ctx.route.query.key)]
|
|
303
323
|
: []),
|
|
304
324
|
...(body && ctx.route.body
|
|
305
|
-
? [
|
|
325
|
+
? [TypeScriptFactory.createIdentifier(ctx.route.body.key)]
|
|
306
326
|
: []),
|
|
307
327
|
];
|
|
308
328
|
};
|