@nestia/sdk 3.10.0 → 3.11.0-dev.20240813
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/NestiaSdkApplication.d.ts +1 -3
- package/lib/NestiaSdkApplication.js +138 -136
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/analyses/ConfigAnalyzer.d.ts +2 -2
- package/lib/analyses/ConfigAnalyzer.js +39 -80
- package/lib/analyses/ConfigAnalyzer.js.map +1 -1
- package/lib/analyses/ExceptionAnalyzer.d.ts +0 -16
- package/lib/analyses/ExceptionAnalyzer.js +142 -105
- package/lib/analyses/ExceptionAnalyzer.js.map +1 -1
- package/lib/analyses/GenericAnalyzer.d.ts +1 -2
- package/lib/analyses/GenericAnalyzer.js.map +1 -1
- package/lib/analyses/ImportAnalyzer.d.ts +6 -11
- package/lib/analyses/ImportAnalyzer.js +70 -42
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectControllerAnalyzer.d.ts +7 -1
- package/lib/analyses/ReflectControllerAnalyzer.js +28 -99
- package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +6 -2
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +72 -152
- package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +15 -0
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +215 -0
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +15 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +81 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -0
- package/lib/analyses/ReflectMetadataAnalyzer.d.ts +1 -3
- package/lib/analyses/ReflectMetadataAnalyzer.js +0 -4
- package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +6 -2
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +72 -48
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
- package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +15 -0
- package/lib/analyses/TypedHttpRouteAnalyzer.js +111 -0
- package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -0
- package/lib/analyses/TypedWebSocketRouteAnalyzer.d.ts +10 -0
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js +9 -0
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -0
- package/lib/decorators/OperationMetadata.d.ts +2 -0
- package/lib/decorators/OperationMetadata.js +10 -0
- package/lib/decorators/OperationMetadata.js.map +1 -0
- package/lib/executable/internal/NestiaConfigLoader.d.ts +1 -1
- package/lib/executable/internal/NestiaConfigLoader.js +34 -3
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
- package/lib/executable/internal/NestiaSdkCommand.js +1 -1
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/generates/CloneGenerator.d.ts +0 -5
- package/lib/generates/CloneGenerator.js +60 -60
- package/lib/generates/CloneGenerator.js.map +1 -1
- package/lib/generates/E2eGenerator.d.ts +2 -3
- package/lib/generates/E2eGenerator.js +9 -8
- package/lib/generates/E2eGenerator.js.map +1 -1
- package/lib/generates/OpenAiGenerator.d.ts +2 -4
- package/lib/generates/OpenAiGenerator.js +13 -3
- package/lib/generates/OpenAiGenerator.js.map +1 -1
- package/lib/generates/SdkGenerator.d.ts +4 -4
- package/lib/generates/SdkGenerator.js +63 -73
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.d.ts +6 -18
- package/lib/generates/SwaggerGenerator.js +60 -235
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.js +5 -9
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +6 -4
- package/lib/generates/internal/SdkAliasCollection.js +33 -31
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.d.ts +4 -1
- package/lib/generates/internal/SdkDistributionComposer.js +6 -6
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.d.ts +2 -4
- package/lib/generates/internal/SdkFileProgrammer.js +6 -6
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +0 -12
- package/lib/generates/internal/SdkHttpCloneProgrammer.js +142 -97
- package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +4 -3
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js +37 -59
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +4 -3
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +31 -48
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpRouteProgrammer.js +7 -3
- package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +4 -3
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +7 -13
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +1 -2
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +11 -16
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +1 -2
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +7 -10
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SwaggerDescriptionComposer.d.ts +23 -0
- package/lib/generates/internal/SwaggerDescriptionComposer.js +44 -0
- package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -0
- package/lib/generates/internal/SwaggerOperationComposer.d.ts +12 -0
- package/lib/generates/internal/SwaggerOperationComposer.js +68 -0
- package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -0
- package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +18 -0
- package/lib/generates/internal/SwaggerOperationParameterComposer.js +99 -0
- package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +9 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js +91 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -0
- package/lib/structures/INestiaProject.d.ts +5 -5
- package/lib/structures/INestiaSdkInput.d.ts +20 -0
- package/lib/structures/{ISwaggerError.js → INestiaSdkInput.js} +1 -1
- package/lib/structures/INestiaSdkInput.js.map +1 -0
- package/lib/structures/IReflectApplication.d.ts +6 -0
- package/lib/structures/IReflectApplication.js +3 -0
- package/lib/structures/IReflectApplication.js.map +1 -0
- package/lib/structures/IReflectController.d.ts +3 -5
- package/lib/structures/IReflectHttpOperation.d.ts +13 -65
- package/lib/structures/IReflectHttpOperationException.d.ts +14 -0
- package/lib/structures/IReflectHttpOperationException.js +3 -0
- package/lib/structures/IReflectHttpOperationException.js.map +1 -0
- package/lib/structures/IReflectHttpOperationParameter.d.ts +35 -0
- package/lib/structures/IReflectHttpOperationParameter.js +3 -0
- package/lib/structures/IReflectHttpOperationParameter.js.map +1 -0
- package/lib/structures/IReflectHttpOperationSuccess.d.ts +15 -0
- package/lib/structures/IReflectHttpOperationSuccess.js +3 -0
- package/lib/structures/IReflectHttpOperationSuccess.js.map +1 -0
- package/lib/structures/IReflectOperationError.d.ts +16 -0
- package/lib/structures/IReflectOperationError.js +23 -0
- package/lib/structures/IReflectOperationError.js.map +1 -0
- package/lib/structures/IReflectType.d.ts +4 -0
- package/lib/structures/{IErrorReport.js → IReflectType.js} +1 -1
- package/lib/structures/IReflectType.js.map +1 -0
- package/lib/structures/IReflectTypeImport.d.ts +4 -0
- package/lib/structures/{ISwaggerLazySchema.js → IReflectTypeImport.js} +1 -1
- package/lib/structures/IReflectTypeImport.js.map +1 -0
- package/lib/structures/IReflectWebSocketOperation.d.ts +8 -9
- package/lib/structures/IReflectWebSocketOperationParameter.d.ts +23 -0
- package/lib/structures/IReflectWebSocketOperationParameter.js +3 -0
- package/lib/structures/IReflectWebSocketOperationParameter.js.map +1 -0
- package/lib/structures/ITypedApplication.d.ts +7 -0
- package/lib/structures/{INormalizedInput.js → ITypedApplication.js} +1 -1
- package/lib/structures/ITypedApplication.js.map +1 -0
- package/lib/structures/ITypedHttpRoute.d.ts +14 -42
- package/lib/structures/ITypedHttpRouteException.d.ts +10 -0
- package/lib/structures/ITypedHttpRouteException.js +3 -0
- package/lib/structures/ITypedHttpRouteException.js.map +1 -0
- package/lib/structures/ITypedHttpRouteParameter.d.ts +31 -0
- package/lib/structures/ITypedHttpRouteParameter.js +3 -0
- package/lib/structures/ITypedHttpRouteParameter.js.map +1 -0
- package/lib/structures/ITypedHttpRouteSuccess.d.ts +19 -0
- package/lib/structures/{ISwaggerLazyProperty.js → ITypedHttpRouteSuccess.js} +1 -1
- package/lib/structures/ITypedHttpRouteSuccess.js.map +1 -0
- package/lib/structures/ITypedWebSocketRoute.d.ts +8 -44
- package/lib/structures/ITypedWebSocketRouteParameter.d.ts +2 -0
- package/lib/structures/ITypedWebSocketRouteParameter.js +3 -0
- package/lib/structures/ITypedWebSocketRouteParameter.js.map +1 -0
- package/lib/transform.d.ts +3 -0
- package/lib/transform.js +8 -0
- package/lib/transform.js.map +1 -0
- package/lib/transformers/IOperationMetadata.d.ts +36 -0
- package/lib/transformers/IOperationMetadata.js +3 -0
- package/lib/transformers/IOperationMetadata.js.map +1 -0
- package/lib/transformers/ISdkTransformerContext.d.ts +7 -0
- package/lib/transformers/ISdkTransformerContext.js +3 -0
- package/lib/transformers/ISdkTransformerContext.js.map +1 -0
- package/lib/transformers/SdkMetadataProgrammer.d.ts +11 -0
- package/lib/transformers/SdkMetadataProgrammer.js +159 -0
- package/lib/transformers/SdkMetadataProgrammer.js.map +1 -0
- package/lib/transformers/SdkTransformer.d.ts +4 -0
- package/lib/transformers/SdkTransformer.js +88 -0
- package/lib/transformers/SdkTransformer.js.map +1 -0
- package/lib/transformers/TextPlainValidator.d.ts +4 -0
- package/lib/transformers/TextPlainValidator.js +19 -0
- package/lib/transformers/TextPlainValidator.js.map +1 -0
- package/lib/utils/StringUtil.d.ts +1 -0
- package/lib/utils/StringUtil.js +1 -0
- package/lib/utils/StringUtil.js.map +1 -1
- package/package.json +8 -8
- package/src/NestiaSdkApplication.ts +173 -160
- package/src/analyses/ConfigAnalyzer.ts +50 -98
- package/src/analyses/ExceptionAnalyzer.ts +142 -142
- package/src/analyses/GenericAnalyzer.ts +3 -5
- package/src/analyses/ImportAnalyzer.ts +130 -115
- package/src/analyses/ReflectControllerAnalyzer.ts +63 -115
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +142 -278
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +319 -0
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +117 -0
- package/src/analyses/ReflectMetadataAnalyzer.ts +1 -18
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +143 -78
- package/src/analyses/TypedHttpRouteAnalyzer.ts +178 -0
- package/src/analyses/TypedWebSocketRouteAnalyzer.ts +18 -0
- package/src/decorators/OperationMetadata.ts +15 -0
- package/src/executable/internal/NestiaConfigLoader.ts +18 -3
- package/src/executable/internal/NestiaSdkCommand.ts +1 -4
- package/src/generates/CloneGenerator.ts +60 -59
- package/src/generates/E2eGenerator.ts +20 -21
- package/src/generates/OpenAiGenerator.ts +44 -45
- package/src/generates/SdkGenerator.ts +97 -125
- package/src/generates/SwaggerGenerator.ts +114 -416
- package/src/generates/internal/E2eFileProgrammer.ts +5 -14
- package/src/generates/internal/SdkAliasCollection.ts +33 -41
- package/src/generates/internal/SdkDistributionComposer.ts +9 -6
- package/src/generates/internal/SdkFileProgrammer.ts +11 -14
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +142 -142
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +20 -47
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +245 -275
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +7 -7
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +11 -23
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +197 -233
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +5 -15
- package/src/generates/internal/{SwaggerDescriptionGenerator.ts → SwaggerDescriptionComposer.ts} +25 -5
- package/src/generates/internal/SwaggerOperationComposer.ts +90 -0
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +173 -0
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +110 -0
- package/src/structures/INestiaProject.ts +5 -5
- package/src/structures/INestiaSdkInput.ts +25 -0
- package/src/structures/IReflectApplication.ts +8 -0
- package/src/structures/IReflectController.ts +3 -5
- package/src/structures/IReflectHttpOperation.ts +14 -76
- package/src/structures/IReflectHttpOperationException.ts +19 -0
- package/src/structures/IReflectHttpOperationParameter.ts +81 -0
- package/src/structures/IReflectHttpOperationSuccess.ts +22 -0
- package/src/structures/IReflectOperationError.ts +26 -0
- package/src/structures/IReflectType.ts +4 -0
- package/src/structures/IReflectTypeImport.ts +4 -0
- package/src/structures/IReflectWebSocketOperation.ts +9 -9
- package/src/structures/IReflectWebSocketOperationParameter.ts +38 -0
- package/src/structures/ITypedApplication.ts +8 -0
- package/src/structures/ITypedHttpRoute.ts +15 -45
- package/src/structures/ITypedHttpRouteException.ts +15 -0
- package/src/structures/ITypedHttpRouteParameter.ts +41 -0
- package/src/structures/ITypedHttpRouteSuccess.ts +22 -0
- package/src/structures/ITypedWebSocketRoute.ts +8 -56
- package/src/structures/ITypedWebSocketRouteParameter.ts +3 -0
- package/src/transform.ts +9 -0
- package/src/transformers/IOperationMetadata.ts +38 -0
- package/src/transformers/ISdkTransformerContext.ts +8 -0
- package/src/transformers/SdkMetadataProgrammer.ts +227 -0
- package/src/transformers/SdkTransformer.ts +168 -0
- package/src/transformers/TextPlainValidator.ts +17 -0
- package/src/utils/StringUtil.ts +3 -0
- package/lib/analyses/TypedControllerAnalyzer.d.ts +0 -8
- package/lib/analyses/TypedControllerAnalyzer.js +0 -77
- package/lib/analyses/TypedControllerAnalyzer.js.map +0 -1
- package/lib/analyses/TypedHttpOperationAnalyzer.d.ts +0 -15
- package/lib/analyses/TypedHttpOperationAnalyzer.js +0 -263
- package/lib/analyses/TypedHttpOperationAnalyzer.js.map +0 -1
- package/lib/analyses/TypedWebSocketOperationAnalyzer.d.ts +0 -15
- package/lib/analyses/TypedWebSocketOperationAnalyzer.js +0 -226
- package/lib/analyses/TypedWebSocketOperationAnalyzer.js.map +0 -1
- package/lib/generates/internal/SwaggerDescriptionGenerator.d.ts +0 -14
- package/lib/generates/internal/SwaggerDescriptionGenerator.js +0 -33
- package/lib/generates/internal/SwaggerDescriptionGenerator.js.map +0 -1
- package/lib/generates/internal/SwaggerSchemaGenerator.d.ts +0 -21
- package/lib/generates/internal/SwaggerSchemaGenerator.js +0 -289
- package/lib/generates/internal/SwaggerSchemaGenerator.js.map +0 -1
- package/lib/generates/internal/SwaggerSchemaValidator.d.ts +0 -7
- package/lib/generates/internal/SwaggerSchemaValidator.js +0 -191
- package/lib/generates/internal/SwaggerSchemaValidator.js.map +0 -1
- package/lib/structures/IErrorReport.d.ts +0 -6
- package/lib/structures/IErrorReport.js.map +0 -1
- package/lib/structures/INormalizedInput.d.ts +0 -19
- package/lib/structures/INormalizedInput.js.map +0 -1
- package/lib/structures/ISwaggerError.d.ts +0 -6
- package/lib/structures/ISwaggerError.js.map +0 -1
- package/lib/structures/ISwaggerLazyProperty.d.ts +0 -6
- package/lib/structures/ISwaggerLazyProperty.js.map +0 -1
- package/lib/structures/ISwaggerLazySchema.d.ts +0 -6
- package/lib/structures/ISwaggerLazySchema.js.map +0 -1
- package/lib/structures/ITypeTuple.d.ts +0 -5
- package/lib/structures/ITypeTuple.js +0 -3
- package/lib/structures/ITypeTuple.js.map +0 -1
- package/src/analyses/TypedControllerAnalyzer.ts +0 -92
- package/src/analyses/TypedHttpOperationAnalyzer.ts +0 -365
- package/src/analyses/TypedWebSocketOperationAnalyzer.ts +0 -375
- package/src/generates/internal/SwaggerSchemaGenerator.ts +0 -473
- package/src/generates/internal/SwaggerSchemaValidator.ts +0 -206
- package/src/structures/IErrorReport.ts +0 -6
- package/src/structures/INormalizedInput.ts +0 -20
- package/src/structures/ISwaggerError.ts +0 -8
- package/src/structures/ISwaggerLazyProperty.ts +0 -7
- package/src/structures/ISwaggerLazySchema.ts +0 -7
- package/src/structures/ITypeTuple.ts +0 -6
|
@@ -14,12 +14,12 @@ export namespace SdkHttpRouteProgrammer {
|
|
|
14
14
|
(importer: ImportDictionary) =>
|
|
15
15
|
(route: ITypedHttpRoute): ts.Statement[] => {
|
|
16
16
|
const props = {
|
|
17
|
-
headers: route.parameters
|
|
18
|
-
(p) => p.category === "headers"
|
|
19
|
-
|
|
20
|
-
query: route.parameters
|
|
21
|
-
(p) => p.category === "query"
|
|
22
|
-
|
|
17
|
+
headers: route.parameters
|
|
18
|
+
.filter((p) => p.category === "headers")
|
|
19
|
+
.find((p) => p.field === undefined),
|
|
20
|
+
query: route.parameters
|
|
21
|
+
.filter((p) => p.category === "query")
|
|
22
|
+
.find((p) => p.field === undefined),
|
|
23
23
|
input: route.parameters.find((p) => p.category === "body"),
|
|
24
24
|
};
|
|
25
25
|
return [
|
|
@@ -109,7 +109,7 @@ export namespace SdkHttpRouteProgrammer {
|
|
|
109
109
|
...(descriptionComments.length && tagComments.length ? [""] : []),
|
|
110
110
|
...tagComments,
|
|
111
111
|
...(descriptionComments.length && tagComments.length ? [""] : []),
|
|
112
|
-
`@controller ${route.controller.name}.${route.name}`,
|
|
112
|
+
`@controller ${route.controller.class.name}.${route.name}`,
|
|
113
113
|
`@path ${route.method} ${route.path}`,
|
|
114
114
|
`@nestia Generated by Nestia - https://github.com/samchon/nestia`,
|
|
115
115
|
].join("\n");
|
|
@@ -7,10 +7,10 @@ import { TypeFactory } from "typia/lib/factories/TypeFactory";
|
|
|
7
7
|
|
|
8
8
|
import { INestiaProject } from "../../structures/INestiaProject";
|
|
9
9
|
import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
|
|
10
|
+
import { ITypedHttpRouteParameter } from "../../structures/ITypedHttpRouteParameter";
|
|
10
11
|
import { ImportDictionary } from "./ImportDictionary";
|
|
11
12
|
import { SdkAliasCollection } from "./SdkAliasCollection";
|
|
12
13
|
import { SdkImportWizard } from "./SdkImportWizard";
|
|
13
|
-
import { SdkTypeProgrammer } from "./SdkTypeProgrammer";
|
|
14
14
|
|
|
15
15
|
export namespace SdkHttpSimulationProgrammer {
|
|
16
16
|
export const random =
|
|
@@ -62,13 +62,13 @@ export namespace SdkHttpSimulationProgrammer {
|
|
|
62
62
|
(
|
|
63
63
|
route: ITypedHttpRoute,
|
|
64
64
|
props: {
|
|
65
|
-
headers:
|
|
66
|
-
query:
|
|
67
|
-
input:
|
|
65
|
+
headers: ITypedHttpRouteParameter.IHeaders | undefined;
|
|
66
|
+
query: ITypedHttpRouteParameter.IQuery | undefined;
|
|
67
|
+
input: ITypedHttpRouteParameter.IBody | undefined;
|
|
68
68
|
},
|
|
69
69
|
): ts.VariableStatement => {
|
|
70
70
|
const output: boolean =
|
|
71
|
-
project.config.propagate === true || route.
|
|
71
|
+
project.config.propagate === true || route.success.type.name !== "void";
|
|
72
72
|
const caller = () =>
|
|
73
73
|
ts.factory.createCallExpression(
|
|
74
74
|
ts.factory.createIdentifier("random"),
|
|
@@ -122,7 +122,7 @@ export namespace SdkHttpSimulationProgrammer {
|
|
|
122
122
|
[],
|
|
123
123
|
undefined,
|
|
124
124
|
p.name,
|
|
125
|
-
p.optional
|
|
125
|
+
p.metadata.optional
|
|
126
126
|
? ts.factory.createToken(ts.SyntaxKind.QuestionToken)
|
|
127
127
|
: undefined,
|
|
128
128
|
project.config.primitive !== false &&
|
|
@@ -130,7 +130,7 @@ export namespace SdkHttpSimulationProgrammer {
|
|
|
130
130
|
? ts.factory.createTypeReferenceNode(
|
|
131
131
|
`${route.name}.${p === props.query ? "Query" : "Input"}`,
|
|
132
132
|
)
|
|
133
|
-
:
|
|
133
|
+
: SdkAliasCollection.name(p.type),
|
|
134
134
|
),
|
|
135
135
|
),
|
|
136
136
|
],
|
|
@@ -150,14 +150,14 @@ export namespace SdkHttpSimulationProgrammer {
|
|
|
150
150
|
ts.factory.createPropertyAssignment(
|
|
151
151
|
"status",
|
|
152
152
|
ExpressionFactory.number(
|
|
153
|
-
route.status ??
|
|
153
|
+
route.success.status ??
|
|
154
154
|
(route.method === "POST" ? 201 : 200),
|
|
155
155
|
),
|
|
156
156
|
),
|
|
157
157
|
ts.factory.createPropertyAssignment(
|
|
158
158
|
"headers",
|
|
159
159
|
LiteralFactory.generate({
|
|
160
|
-
"Content-Type": route.
|
|
160
|
+
"Content-Type": route.success.contentType,
|
|
161
161
|
}),
|
|
162
162
|
),
|
|
163
163
|
ts.factory.createPropertyAssignment("data", caller()),
|
|
@@ -222,7 +222,7 @@ export namespace SdkHttpSimulationProgrammer {
|
|
|
222
222
|
ts.factory.createPropertyAssignment(
|
|
223
223
|
"contentType",
|
|
224
224
|
ts.factory.createIdentifier(
|
|
225
|
-
JSON.stringify(route.
|
|
225
|
+
JSON.stringify(route.success.contentType),
|
|
226
226
|
),
|
|
227
227
|
),
|
|
228
228
|
],
|
|
@@ -256,11 +256,7 @@ export namespace SdkHttpSimulationProgrammer {
|
|
|
256
256
|
"assert",
|
|
257
257
|
),
|
|
258
258
|
undefined,
|
|
259
|
-
[
|
|
260
|
-
ts.factory.createIdentifier(
|
|
261
|
-
p.category === "headers" ? "connection.headers" : p.name,
|
|
262
|
-
),
|
|
263
|
-
],
|
|
259
|
+
[ts.factory.createIdentifier(p.name)],
|
|
264
260
|
),
|
|
265
261
|
),
|
|
266
262
|
],
|
|
@@ -353,11 +349,3 @@ const constant = (name: string) => (expression: ts.Expression) =>
|
|
|
353
349
|
ts.NodeFlags.Const,
|
|
354
350
|
),
|
|
355
351
|
);
|
|
356
|
-
|
|
357
|
-
const getTypeName =
|
|
358
|
-
(project: INestiaProject) =>
|
|
359
|
-
(importer: ImportDictionary) =>
|
|
360
|
-
(p: ITypedHttpRoute.IParameter | ITypedHttpRoute.IOutput) =>
|
|
361
|
-
p.metadata
|
|
362
|
-
? SdkTypeProgrammer.write(project)(importer)(p.metadata)
|
|
363
|
-
: ts.factory.createTypeReferenceNode(p.typeName);
|
|
@@ -3,15 +3,14 @@ import { ExpressionFactory } from "typia/lib/factories/ExpressionFactory";
|
|
|
3
3
|
import { IdentifierFactory } from "typia/lib/factories/IdentifierFactory";
|
|
4
4
|
import { TypeFactory } from "typia/lib/factories/TypeFactory";
|
|
5
5
|
|
|
6
|
-
import { INestiaProject } from "../../structures/INestiaProject";
|
|
7
6
|
import { ITypedWebSocketRoute } from "../../structures/ITypedWebSocketRoute";
|
|
7
|
+
import { ITypedWebSocketRouteParameter } from "../../structures/ITypedWebSocketRouteParameter";
|
|
8
8
|
import { FilePrinter } from "./FilePrinter";
|
|
9
9
|
import { ImportDictionary } from "./ImportDictionary";
|
|
10
|
-
import {
|
|
10
|
+
import { SdkAliasCollection } from "./SdkAliasCollection";
|
|
11
11
|
|
|
12
12
|
export namespace SdkWebSocketNamespaceProgrammer {
|
|
13
13
|
export const write =
|
|
14
|
-
(project: INestiaProject) =>
|
|
15
14
|
(importer: ImportDictionary) =>
|
|
16
15
|
(route: ITypedWebSocketRoute): ts.ModuleDeclaration =>
|
|
17
16
|
ts.factory.createModuleDeclaration(
|
|
@@ -20,7 +19,7 @@ export namespace SdkWebSocketNamespaceProgrammer {
|
|
|
20
19
|
ts.factory.createModuleBlock([
|
|
21
20
|
...writeTypes(importer)(route),
|
|
22
21
|
FilePrinter.enter(),
|
|
23
|
-
writePath(
|
|
22
|
+
writePath(route),
|
|
24
23
|
]),
|
|
25
24
|
ts.NodeFlags.Namespace,
|
|
26
25
|
);
|
|
@@ -75,264 +74,240 @@ export namespace SdkWebSocketNamespaceProgrammer {
|
|
|
75
74
|
]),
|
|
76
75
|
);
|
|
77
76
|
|
|
78
|
-
const acceptor:
|
|
79
|
-
route.parameters.find(
|
|
80
|
-
|
|
81
|
-
)
|
|
82
|
-
const query = route.parameters.find((x) => x.category === "query") as
|
|
83
|
-
| ITypedWebSocketRoute.IQueryParameter
|
|
84
|
-
| undefined;
|
|
85
|
-
|
|
77
|
+
const acceptor: ITypedWebSocketRouteParameter.IAcceptor =
|
|
78
|
+
route.parameters.find((x) => x.category === "acceptor")!;
|
|
79
|
+
const query: ITypedWebSocketRouteParameter.IQuery | undefined =
|
|
80
|
+
route.parameters.find((x) => x.category === "query");
|
|
86
81
|
declare(
|
|
87
82
|
"Header",
|
|
88
|
-
|
|
89
|
-
(
|
|
90
|
-
|
|
91
|
-
| ITypedWebSocketRoute.IHeaderParameter
|
|
92
|
-
| undefined) ?? acceptor.header
|
|
93
|
-
).typeName,
|
|
83
|
+
SdkAliasCollection.name(
|
|
84
|
+
(route.parameters.find((x) => x.category === "header")?.type ??
|
|
85
|
+
acceptor.type.typeArguments?.[0])!,
|
|
94
86
|
),
|
|
95
87
|
);
|
|
96
88
|
declare(
|
|
97
89
|
"Provider",
|
|
98
|
-
|
|
99
|
-
(
|
|
100
|
-
(route.parameters.find((x) => x.category === "driver") as
|
|
101
|
-
| ITypedWebSocketRoute.IDriverParameter
|
|
102
|
-
| undefined) ?? acceptor.listener
|
|
103
|
-
).typeName,
|
|
104
|
-
),
|
|
90
|
+
SdkAliasCollection.name(acceptor.type.typeArguments?.[1]!),
|
|
105
91
|
);
|
|
106
92
|
declare(
|
|
107
93
|
"Listener",
|
|
108
|
-
|
|
94
|
+
SdkAliasCollection.name(acceptor.type.typeArguments?.[2]!),
|
|
109
95
|
);
|
|
110
|
-
if (query)
|
|
111
|
-
declare("Query", ts.factory.createTypeReferenceNode(query.typeName));
|
|
96
|
+
if (query) declare("Query", SdkAliasCollection.name(query.type));
|
|
112
97
|
return output;
|
|
113
98
|
};
|
|
114
99
|
|
|
115
|
-
const writePath =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
IdentifierFactory.parameter(
|
|
138
|
-
p.name,
|
|
139
|
-
p === query
|
|
140
|
-
? ts.factory.createTypeReferenceNode(`${route.name}.Query`)
|
|
141
|
-
: getType(project)(importer)(p),
|
|
142
|
-
),
|
|
100
|
+
const writePath = (route: ITypedWebSocketRoute): ts.VariableStatement => {
|
|
101
|
+
const pathParams: ITypedWebSocketRouteParameter.IParam[] =
|
|
102
|
+
route.parameters.filter(
|
|
103
|
+
(p) => p.category === "param",
|
|
104
|
+
) as ITypedWebSocketRouteParameter.IParam[];
|
|
105
|
+
const query: ITypedWebSocketRouteParameter.IQuery | undefined =
|
|
106
|
+
route.parameters.find((p) => p.category === "query");
|
|
107
|
+
const total: Array<
|
|
108
|
+
| ITypedWebSocketRouteParameter.IParam
|
|
109
|
+
| ITypedWebSocketRouteParameter.IQuery
|
|
110
|
+
> = [...pathParams, ...(query ? [query] : [])];
|
|
111
|
+
const out = (body: ts.ConciseBody) =>
|
|
112
|
+
constant("path")(
|
|
113
|
+
ts.factory.createArrowFunction(
|
|
114
|
+
[],
|
|
115
|
+
[],
|
|
116
|
+
total.map((p) =>
|
|
117
|
+
IdentifierFactory.parameter(
|
|
118
|
+
p.name,
|
|
119
|
+
p === query
|
|
120
|
+
? ts.factory.createTypeReferenceNode(`${route.name}.Query`)
|
|
121
|
+
: SdkAliasCollection.name(p),
|
|
143
122
|
),
|
|
144
|
-
undefined,
|
|
145
|
-
undefined,
|
|
146
|
-
body,
|
|
147
123
|
),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
124
|
+
undefined,
|
|
125
|
+
undefined,
|
|
126
|
+
body,
|
|
127
|
+
),
|
|
128
|
+
);
|
|
129
|
+
if (total.length === 0)
|
|
130
|
+
return out(ts.factory.createStringLiteral(route.path));
|
|
151
131
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
),
|
|
169
|
-
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
|
170
|
-
ts.factory.createStringLiteral("null"),
|
|
132
|
+
const template = () => {
|
|
133
|
+
const splitted: string[] = route.path.split(":");
|
|
134
|
+
if (splitted.length === 1)
|
|
135
|
+
return ts.factory.createStringLiteral(route.path);
|
|
136
|
+
return ts.factory.createTemplateExpression(
|
|
137
|
+
ts.factory.createTemplateHead(splitted[0]),
|
|
138
|
+
splitted.slice(1).map((s, i, arr) => {
|
|
139
|
+
const name: string = s.split("/")[0];
|
|
140
|
+
return ts.factory.createTemplateSpan(
|
|
141
|
+
ts.factory.createCallExpression(
|
|
142
|
+
ts.factory.createIdentifier("encodeURIComponent"),
|
|
143
|
+
undefined,
|
|
144
|
+
[
|
|
145
|
+
ts.factory.createBinaryExpression(
|
|
146
|
+
ts.factory.createIdentifier(
|
|
147
|
+
pathParams.find((p) => p.field === name)!.name,
|
|
171
148
|
),
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
149
|
+
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
|
150
|
+
ts.factory.createStringLiteral("null"),
|
|
151
|
+
),
|
|
152
|
+
],
|
|
153
|
+
),
|
|
154
|
+
(i !== arr.length - 1
|
|
155
|
+
? ts.factory.createTemplateMiddle
|
|
156
|
+
: ts.factory.createTemplateTail)(s.substring(name.length)),
|
|
157
|
+
);
|
|
158
|
+
}),
|
|
159
|
+
);
|
|
160
|
+
};
|
|
161
|
+
if (query === undefined) return out(template());
|
|
182
162
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
),
|
|
163
|
+
const block = (expr: ts.Expression) => {
|
|
164
|
+
const computeName = (str: string): string =>
|
|
165
|
+
total.find((p) => p.name === str) !== undefined
|
|
166
|
+
? computeName("_" + str)
|
|
167
|
+
: str;
|
|
168
|
+
const variables: string = computeName("variables");
|
|
169
|
+
return ts.factory.createBlock(
|
|
170
|
+
[
|
|
171
|
+
local(variables)("URLSearchParams")(
|
|
172
|
+
ts.factory.createNewExpression(
|
|
173
|
+
ts.factory.createIdentifier("URLSearchParams"),
|
|
174
|
+
[],
|
|
175
|
+
[],
|
|
197
176
|
),
|
|
198
|
-
|
|
177
|
+
),
|
|
178
|
+
ts.factory.createForOfStatement(
|
|
179
|
+
undefined,
|
|
180
|
+
ts.factory.createVariableDeclarationList(
|
|
181
|
+
[
|
|
182
|
+
ts.factory.createVariableDeclaration(
|
|
183
|
+
ts.factory.createArrayBindingPattern([
|
|
184
|
+
ts.factory.createBindingElement(
|
|
185
|
+
undefined,
|
|
186
|
+
undefined,
|
|
187
|
+
ts.factory.createIdentifier("key"),
|
|
188
|
+
undefined,
|
|
189
|
+
),
|
|
190
|
+
ts.factory.createBindingElement(
|
|
191
|
+
undefined,
|
|
192
|
+
undefined,
|
|
193
|
+
ts.factory.createIdentifier("value"),
|
|
194
|
+
undefined,
|
|
195
|
+
),
|
|
196
|
+
]),
|
|
197
|
+
undefined,
|
|
198
|
+
undefined,
|
|
199
|
+
undefined,
|
|
200
|
+
),
|
|
201
|
+
],
|
|
202
|
+
ts.NodeFlags.Const,
|
|
203
|
+
),
|
|
204
|
+
ts.factory.createCallExpression(
|
|
205
|
+
ts.factory.createIdentifier("Object.entries"),
|
|
199
206
|
undefined,
|
|
200
|
-
ts.factory.
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
207
|
+
[ts.factory.createAsExpression(expr, TypeFactory.keyword("any"))],
|
|
208
|
+
),
|
|
209
|
+
ts.factory.createIfStatement(
|
|
210
|
+
ts.factory.createStrictEquality(
|
|
211
|
+
ts.factory.createIdentifier("undefined"),
|
|
212
|
+
ts.factory.createIdentifier("value"),
|
|
213
|
+
),
|
|
214
|
+
ts.factory.createContinueStatement(),
|
|
215
|
+
ts.factory.createIfStatement(
|
|
216
|
+
ts.factory.createCallExpression(
|
|
217
|
+
ts.factory.createIdentifier("Array.isArray"),
|
|
218
|
+
undefined,
|
|
219
|
+
[ts.factory.createIdentifier("value")],
|
|
220
|
+
),
|
|
221
|
+
ts.factory.createExpressionStatement(
|
|
222
|
+
ts.factory.createCallExpression(
|
|
223
|
+
ts.factory.createPropertyAccessExpression(
|
|
224
|
+
ts.factory.createIdentifier("value"),
|
|
225
|
+
ts.factory.createIdentifier("forEach"),
|
|
226
|
+
),
|
|
227
|
+
undefined,
|
|
228
|
+
[
|
|
229
|
+
ts.factory.createArrowFunction(
|
|
208
230
|
undefined,
|
|
209
|
-
),
|
|
210
|
-
ts.factory.createBindingElement(
|
|
211
231
|
undefined,
|
|
232
|
+
[IdentifierFactory.parameter("elem")],
|
|
212
233
|
undefined,
|
|
213
|
-
ts.factory.createIdentifier("value"),
|
|
214
234
|
undefined,
|
|
235
|
+
ts.factory.createCallExpression(
|
|
236
|
+
IdentifierFactory.access(
|
|
237
|
+
ts.factory.createIdentifier(variables),
|
|
238
|
+
)("append"),
|
|
239
|
+
undefined,
|
|
240
|
+
[
|
|
241
|
+
ts.factory.createIdentifier("key"),
|
|
242
|
+
ts.factory.createCallExpression(
|
|
243
|
+
ts.factory.createIdentifier("String"),
|
|
244
|
+
undefined,
|
|
245
|
+
[ts.factory.createIdentifier("elem")],
|
|
246
|
+
),
|
|
247
|
+
],
|
|
248
|
+
),
|
|
215
249
|
),
|
|
216
|
-
]
|
|
217
|
-
undefined,
|
|
218
|
-
undefined,
|
|
219
|
-
undefined,
|
|
250
|
+
],
|
|
220
251
|
),
|
|
221
|
-
],
|
|
222
|
-
ts.NodeFlags.Const,
|
|
223
|
-
),
|
|
224
|
-
ts.factory.createCallExpression(
|
|
225
|
-
ts.factory.createIdentifier("Object.entries"),
|
|
226
|
-
undefined,
|
|
227
|
-
[
|
|
228
|
-
ts.factory.createAsExpression(
|
|
229
|
-
expr,
|
|
230
|
-
TypeFactory.keyword("any"),
|
|
231
|
-
),
|
|
232
|
-
],
|
|
233
|
-
),
|
|
234
|
-
ts.factory.createIfStatement(
|
|
235
|
-
ts.factory.createStrictEquality(
|
|
236
|
-
ts.factory.createIdentifier("undefined"),
|
|
237
|
-
ts.factory.createIdentifier("value"),
|
|
238
252
|
),
|
|
239
|
-
ts.factory.
|
|
240
|
-
ts.factory.createIfStatement(
|
|
253
|
+
ts.factory.createExpressionStatement(
|
|
241
254
|
ts.factory.createCallExpression(
|
|
242
|
-
|
|
255
|
+
IdentifierFactory.access(
|
|
256
|
+
ts.factory.createIdentifier(variables),
|
|
257
|
+
)("set"),
|
|
243
258
|
undefined,
|
|
244
|
-
[
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
ts.factory.createIdentifier("value"),
|
|
250
|
-
ts.factory.createIdentifier("forEach"),
|
|
259
|
+
[
|
|
260
|
+
ts.factory.createIdentifier("key"),
|
|
261
|
+
ts.factory.createCallExpression(
|
|
262
|
+
ts.factory.createIdentifier("String"),
|
|
263
|
+
undefined,
|
|
264
|
+
[ts.factory.createIdentifier("value")],
|
|
251
265
|
),
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
),
|
|
266
|
+
],
|
|
267
|
+
),
|
|
268
|
+
),
|
|
269
|
+
),
|
|
270
|
+
),
|
|
271
|
+
),
|
|
272
|
+
local("location")("string")(template()),
|
|
273
|
+
ts.factory.createReturnStatement(
|
|
274
|
+
ts.factory.createConditionalExpression(
|
|
275
|
+
ts.factory.createStrictEquality(
|
|
276
|
+
ExpressionFactory.number(0),
|
|
277
|
+
IdentifierFactory.access(
|
|
278
|
+
ts.factory.createIdentifier(variables),
|
|
279
|
+
)("size"),
|
|
280
|
+
),
|
|
281
|
+
undefined,
|
|
282
|
+
ts.factory.createIdentifier("location"),
|
|
283
|
+
undefined,
|
|
284
|
+
ts.factory.createTemplateExpression(
|
|
285
|
+
ts.factory.createTemplateHead(""),
|
|
286
|
+
[
|
|
287
|
+
ts.factory.createTemplateSpan(
|
|
288
|
+
ts.factory.createIdentifier("location"),
|
|
289
|
+
ts.factory.createTemplateMiddle("?"),
|
|
277
290
|
),
|
|
278
|
-
ts.factory.
|
|
291
|
+
ts.factory.createTemplateSpan(
|
|
279
292
|
ts.factory.createCallExpression(
|
|
280
293
|
IdentifierFactory.access(
|
|
281
294
|
ts.factory.createIdentifier(variables),
|
|
282
|
-
)("
|
|
295
|
+
)("toString"),
|
|
296
|
+
undefined,
|
|
283
297
|
undefined,
|
|
284
|
-
[
|
|
285
|
-
ts.factory.createIdentifier("key"),
|
|
286
|
-
ts.factory.createCallExpression(
|
|
287
|
-
ts.factory.createIdentifier("String"),
|
|
288
|
-
undefined,
|
|
289
|
-
[ts.factory.createIdentifier("value")],
|
|
290
|
-
),
|
|
291
|
-
],
|
|
292
298
|
),
|
|
299
|
+
ts.factory.createTemplateTail(""),
|
|
293
300
|
),
|
|
294
|
-
|
|
295
|
-
),
|
|
296
|
-
),
|
|
297
|
-
local("location")("string")(template()),
|
|
298
|
-
ts.factory.createReturnStatement(
|
|
299
|
-
ts.factory.createConditionalExpression(
|
|
300
|
-
ts.factory.createStrictEquality(
|
|
301
|
-
ExpressionFactory.number(0),
|
|
302
|
-
IdentifierFactory.access(
|
|
303
|
-
ts.factory.createIdentifier(variables),
|
|
304
|
-
)("size"),
|
|
305
|
-
),
|
|
306
|
-
undefined,
|
|
307
|
-
ts.factory.createIdentifier("location"),
|
|
308
|
-
undefined,
|
|
309
|
-
ts.factory.createTemplateExpression(
|
|
310
|
-
ts.factory.createTemplateHead(""),
|
|
311
|
-
[
|
|
312
|
-
ts.factory.createTemplateSpan(
|
|
313
|
-
ts.factory.createIdentifier("location"),
|
|
314
|
-
ts.factory.createTemplateMiddle("?"),
|
|
315
|
-
),
|
|
316
|
-
ts.factory.createTemplateSpan(
|
|
317
|
-
ts.factory.createCallExpression(
|
|
318
|
-
IdentifierFactory.access(
|
|
319
|
-
ts.factory.createIdentifier(variables),
|
|
320
|
-
)("toString"),
|
|
321
|
-
undefined,
|
|
322
|
-
undefined,
|
|
323
|
-
),
|
|
324
|
-
ts.factory.createTemplateTail(""),
|
|
325
|
-
),
|
|
326
|
-
],
|
|
327
|
-
),
|
|
301
|
+
],
|
|
328
302
|
),
|
|
329
303
|
),
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return out(block(ts.factory.createIdentifier(query.name)));
|
|
304
|
+
),
|
|
305
|
+
],
|
|
306
|
+
true,
|
|
307
|
+
);
|
|
335
308
|
};
|
|
309
|
+
return out(block(ts.factory.createIdentifier(query.name)));
|
|
310
|
+
};
|
|
336
311
|
}
|
|
337
312
|
|
|
338
313
|
const local = (name: string) => (type: string) => (expression: ts.Expression) =>
|
|
@@ -365,14 +340,3 @@ const constant = (name: string) => (expression: ts.Expression) =>
|
|
|
365
340
|
ts.NodeFlags.Const,
|
|
366
341
|
),
|
|
367
342
|
);
|
|
368
|
-
const getType =
|
|
369
|
-
(project: INestiaProject) =>
|
|
370
|
-
(importer: ImportDictionary) =>
|
|
371
|
-
(
|
|
372
|
-
p:
|
|
373
|
-
| ITypedWebSocketRoute.IPathParameter
|
|
374
|
-
| ITypedWebSocketRoute.IQueryParameter,
|
|
375
|
-
) =>
|
|
376
|
-
p.metadata
|
|
377
|
-
? SdkTypeProgrammer.write(project)(importer)(p.metadata)
|
|
378
|
-
: ts.factory.createTypeReferenceNode(p.typeName);
|