@nestia/sdk 6.0.6 → 7.0.0-dev.20250605
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/LICENSE +21 -21
- package/README.md +92 -92
- package/assets/bundle/api/HttpError.ts +1 -1
- package/assets/bundle/api/IConnection.ts +1 -1
- package/assets/bundle/api/Primitive.ts +1 -1
- package/assets/bundle/api/Resolved.ts +1 -1
- package/assets/bundle/api/index.ts +4 -4
- package/assets/bundle/api/module.ts +6 -6
- package/assets/bundle/distribute/README.md +37 -37
- package/assets/bundle/distribute/package.json +28 -28
- package/assets/bundle/distribute/tsconfig.json +109 -109
- package/assets/bundle/e2e/index.ts +42 -42
- package/assets/config/nestia.config.ts +97 -97
- package/lib/INestiaConfig.d.ts +66 -69
- package/lib/executable/internal/NestiaConfigLoader.js +10 -5
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
- package/lib/executable/sdk.js +12 -12
- package/lib/generates/internal/E2eFileProgrammer.js +30 -14
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.js +13 -4
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +3 -2
- package/lib/generates/internal/SdkAliasCollection.js +8 -3
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js +47 -35
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +50 -37
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpRouteProgrammer.js +5 -4
- package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +28 -16
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeProgrammer.js +3 -3
- package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/utils/ArrayUtil.d.ts +2 -2
- package/lib/utils/ArrayUtil.js.map +1 -1
- package/package.json +6 -6
- package/src/INestiaConfig.ts +269 -271
- package/src/NestiaSdkApplication.ts +307 -307
- package/src/NestiaSwaggerComposer.ts +138 -138
- package/src/analyses/AccessorAnalyzer.ts +67 -67
- package/src/analyses/ConfigAnalyzer.ts +155 -155
- package/src/analyses/ExceptionAnalyzer.ts +154 -154
- package/src/analyses/GenericAnalyzer.ts +49 -49
- package/src/analyses/ImportAnalyzer.ts +171 -171
- package/src/analyses/PathAnalyzer.ts +69 -69
- package/src/analyses/ReflectControllerAnalyzer.ts +105 -105
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +183 -183
- package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +71 -71
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +348 -348
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +127 -127
- package/src/analyses/ReflectMetadataAnalyzer.ts +44 -44
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +172 -172
- package/src/analyses/SecurityAnalyzer.ts +25 -25
- package/src/analyses/TypedHttpRouteAnalyzer.ts +186 -186
- package/src/analyses/TypedWebSocketRouteAnalyzer.ts +18 -18
- package/src/decorators/OperationMetadata.ts +15 -15
- package/src/executable/internal/CommandParser.ts +15 -15
- package/src/executable/internal/NestiaConfigLoader.ts +78 -78
- package/src/executable/internal/NestiaSdkCommand.ts +103 -103
- package/src/executable/sdk.ts +75 -75
- package/src/generates/CloneGenerator.ts +66 -66
- package/src/generates/E2eGenerator.ts +32 -32
- package/src/generates/SdkGenerator.ts +159 -159
- package/src/generates/SwaggerGenerator.ts +292 -292
- package/src/generates/internal/E2eFileProgrammer.ts +214 -183
- package/src/generates/internal/FilePrinter.ts +53 -53
- package/src/generates/internal/ImportDictionary.ts +159 -147
- package/src/generates/internal/SdkAliasCollection.ts +204 -185
- package/src/generates/internal/SdkDistributionComposer.ts +103 -103
- package/src/generates/internal/SdkFileProgrammer.ts +116 -116
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +124 -124
- package/src/generates/internal/SdkHttpCloneReferencer.ts +71 -71
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +325 -301
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +563 -529
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +119 -117
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +386 -362
- package/src/generates/internal/SdkImportWizard.ts +55 -55
- package/src/generates/internal/SdkRouteDirectory.ts +18 -18
- package/src/generates/internal/SdkTypeProgrammer.ts +377 -377
- package/src/generates/internal/SdkTypeTagProgrammer.ts +102 -102
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +362 -362
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +265 -265
- package/src/generates/internal/SwaggerDescriptionComposer.ts +64 -64
- package/src/generates/internal/SwaggerOperationComposer.ts +119 -119
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +177 -177
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +110 -110
- package/src/index.ts +4 -4
- package/src/module.ts +3 -3
- package/src/structures/INestiaProject.ts +13 -13
- package/src/structures/INestiaSdkInput.ts +20 -20
- package/src/structures/IReflectApplication.ts +8 -8
- package/src/structures/IReflectController.ts +15 -15
- package/src/structures/IReflectHttpOperation.ts +26 -26
- package/src/structures/IReflectHttpOperationException.ts +19 -19
- package/src/structures/IReflectHttpOperationParameter.ts +81 -81
- package/src/structures/IReflectHttpOperationSuccess.ts +22 -22
- package/src/structures/IReflectOperationError.ts +26 -26
- package/src/structures/IReflectType.ts +4 -4
- package/src/structures/IReflectTypeImport.ts +4 -4
- package/src/structures/IReflectWebSocketOperation.ts +17 -17
- package/src/structures/IReflectWebSocketOperationParameter.ts +38 -38
- package/src/structures/ITypedApplication.ts +11 -11
- package/src/structures/ITypedHttpRoute.ts +30 -30
- package/src/structures/ITypedHttpRouteException.ts +15 -15
- package/src/structures/ITypedHttpRouteParameter.ts +41 -41
- package/src/structures/ITypedHttpRouteSuccess.ts +22 -22
- package/src/structures/ITypedWebSocketRoute.ts +20 -20
- package/src/structures/ITypedWebSocketRouteParameter.ts +3 -3
- package/src/structures/MethodType.ts +5 -5
- package/src/structures/ParamCategory.ts +1 -1
- package/src/structures/TypeEntry.ts +22 -22
- package/src/transform.ts +9 -9
- package/src/transformers/IOperationMetadata.ts +44 -44
- package/src/transformers/ISdkOperationTransformerContext.ts +8 -8
- package/src/transformers/SdkOperationProgrammer.ts +209 -209
- package/src/transformers/SdkOperationTransformer.ts +253 -253
- package/src/transformers/TextPlainValidator.ts +17 -17
- package/src/typings/get-function-location.d.ts +7 -7
- package/src/utils/ArrayUtil.ts +26 -26
- package/src/utils/FileRetriever.ts +22 -22
- package/src/utils/MapUtil.ts +14 -14
- package/src/utils/MetadataUtil.ts +26 -26
- package/src/utils/PathUtil.ts +10 -10
- package/src/utils/SourceFinder.ts +66 -66
- package/src/utils/StringUtil.ts +17 -17
- package/src/utils/StripEnums.ts +5 -5
- package/src/utils/VersioningStrategy.ts +28 -28
- package/src/validators/HttpHeadersValidator.ts +34 -34
- package/src/validators/HttpQueryValidator.ts +34 -34
package/lib/INestiaConfig.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export interface INestiaConfig {
|
|
|
11
11
|
*
|
|
12
12
|
* You can specify target controller classes within two ways.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* - Asynchronous function returning `INestApplication` instance
|
|
15
|
+
* - Specify the path or directory of controller class files
|
|
16
16
|
*/
|
|
17
17
|
input: (() => Promise<INestApplication>) | INestiaConfig.IInput | string[] | string;
|
|
18
18
|
/**
|
|
@@ -22,7 +22,7 @@ export interface INestiaConfig {
|
|
|
22
22
|
*/
|
|
23
23
|
swagger?: INestiaConfig.ISwaggerConfig;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Response directory that SDK would be placed in.
|
|
26
26
|
*
|
|
27
27
|
* If not configured, you can't build the SDK library.
|
|
28
28
|
*/
|
|
@@ -33,23 +33,27 @@ export interface INestiaConfig {
|
|
|
33
33
|
* If you configure this property and runs `npx nestia sdk` command,
|
|
34
34
|
* distribution environments for the SDK library would be generated.
|
|
35
35
|
*
|
|
36
|
-
* After the SDK library generation, move to the `distribute` directory,
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* After the SDK library generation, move to the `distribute` directory, and
|
|
37
|
+
* runs `npm publish` command, then you can share SDK library with other
|
|
38
|
+
* client (frontend) developers.
|
|
39
39
|
*
|
|
40
40
|
* Recommend to use `"packages/api"` value.
|
|
41
41
|
*/
|
|
42
42
|
distribute?: string;
|
|
43
|
+
/**
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
keyword?: boolean;
|
|
43
47
|
/**
|
|
44
48
|
* Allow simulation mode.
|
|
45
49
|
*
|
|
46
|
-
* If you configure this property to be `true`, the SDK library would be
|
|
47
|
-
* simulation mode. In the simulation mode, the SDK library would not
|
|
48
|
-
* with the real backend server, but just returns random mock-up
|
|
49
|
-
* with requestion data validation.
|
|
50
|
+
* If you configure this property to be `true`, the SDK library would be
|
|
51
|
+
* contain simulation mode. In the simulation mode, the SDK library would not
|
|
52
|
+
* communicate with the real backend server, but just returns random mock-up
|
|
53
|
+
* data with requestion data validation.
|
|
50
54
|
*
|
|
51
|
-
* For reference, random mock-up data would be generated by
|
|
52
|
-
* function.
|
|
55
|
+
* For reference, random mock-up data would be generated by
|
|
56
|
+
* `typia.random<T>()` function.
|
|
53
57
|
*
|
|
54
58
|
* @default false
|
|
55
59
|
*/
|
|
@@ -58,8 +62,8 @@ export interface INestiaConfig {
|
|
|
58
62
|
* Target directory that e2e test functions would be placed in.
|
|
59
63
|
*
|
|
60
64
|
* If you configure this property and runs `npx nestia e2e` command,
|
|
61
|
-
* `@nestia/sdk` will analyze your NestJS backend server code, and
|
|
62
|
-
*
|
|
65
|
+
* `@nestia/sdk` will analyze your NestJS backend server code, and generates
|
|
66
|
+
* e2e test functions for every API endpoints.
|
|
63
67
|
*
|
|
64
68
|
* If not configured, you can't run `npx nestia e2e` command.
|
|
65
69
|
*/
|
|
@@ -67,11 +71,11 @@ export interface INestiaConfig {
|
|
|
67
71
|
/**
|
|
68
72
|
* Whether to use propagation mode or not.
|
|
69
73
|
*
|
|
70
|
-
* If being configured, interaction functions of the SDK library would
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
74
|
+
* If being configured, interaction functions of the SDK library would perform
|
|
75
|
+
* the propagation mode. The propagation mode means that never throwing
|
|
76
|
+
* exception even when status code is not 200 (or 201), but just returning the
|
|
77
|
+
* {@link IPropagation} typed instance, which can specify its body type through
|
|
78
|
+
* discriminated union determined by status code.
|
|
75
79
|
*
|
|
76
80
|
* @default false
|
|
77
81
|
*/
|
|
@@ -89,13 +93,13 @@ export interface INestiaConfig {
|
|
|
89
93
|
/**
|
|
90
94
|
* Whether to wrap DTO by primitive type.
|
|
91
95
|
*
|
|
92
|
-
* If you don't configure this property as `false`, all of DTOs in the
|
|
93
|
-
*
|
|
96
|
+
* If you don't configure this property as `false`, all of DTOs in the SDK
|
|
97
|
+
* library would be automatically wrapped by {@link Primitive} type.
|
|
94
98
|
*
|
|
95
|
-
* For refenrece, if a DTO type be capsuled by the {@link Primitive} type,
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
+
* For refenrece, if a DTO type be capsuled by the {@link Primitive} type, all
|
|
100
|
+
* of methods in the DTO type would be automatically erased. Also, if the DTO
|
|
101
|
+
* has a `toJSON()` method, the DTO type would be automatically converted to
|
|
102
|
+
* return type of the `toJSON()` method.
|
|
99
103
|
*
|
|
100
104
|
* @default true
|
|
101
105
|
*/
|
|
@@ -103,12 +107,12 @@ export interface INestiaConfig {
|
|
|
103
107
|
/**
|
|
104
108
|
* Whether to assert parameter types or not.
|
|
105
109
|
*
|
|
106
|
-
* If you configure this property to be `true`, all of the function
|
|
107
|
-
*
|
|
108
|
-
*
|
|
110
|
+
* If you configure this property to be `true`, all of the function parameters
|
|
111
|
+
* of SDK library would be checked through [`typia.assert<T>()`
|
|
112
|
+
* function](https://typia.io/docs/validators/assert/).
|
|
109
113
|
*
|
|
110
|
-
* This option would make your SDK library compilation time a little bit
|
|
111
|
-
* but would enahcne the type safety even in the runtime level.
|
|
114
|
+
* This option would make your SDK library compilation time a little bit
|
|
115
|
+
* slower, but would enahcne the type safety even in the runtime level.
|
|
112
116
|
*
|
|
113
117
|
* @default false
|
|
114
118
|
*/
|
|
@@ -116,13 +120,14 @@ export interface INestiaConfig {
|
|
|
116
120
|
/**
|
|
117
121
|
* Whether to optimize JSON string conversion 10x faster or not.
|
|
118
122
|
*
|
|
119
|
-
* If you configure this property to be `true`, the SDK library would utilize
|
|
120
|
-
* [`typia.assertStringify<T>()
|
|
121
|
-
* to boost up JSON
|
|
123
|
+
* If you configure this property to be `true`, the SDK library would utilize
|
|
124
|
+
* the [`typia.assertStringify<T>()
|
|
125
|
+
* function`](https://github.com/samchon/typia#enhanced-json) to boost up JSON
|
|
126
|
+
* serialization speed and ensure type safety.
|
|
122
127
|
*
|
|
123
|
-
* This option would make your SDK library compilation time a little bit
|
|
124
|
-
* but would enhance JSON serialization speed 10x faster. Also, it can
|
|
125
|
-
* safety even in the runtime level.
|
|
128
|
+
* This option would make your SDK library compilation time a little bit
|
|
129
|
+
* slower, but would enhance JSON serialization speed 10x faster. Also, it can
|
|
130
|
+
* ensure type safety even in the runtime level.
|
|
126
131
|
*
|
|
127
132
|
* @default false
|
|
128
133
|
*/
|
|
@@ -134,25 +139,19 @@ export declare namespace INestiaConfig {
|
|
|
134
139
|
* controllers.
|
|
135
140
|
*/
|
|
136
141
|
interface IInput {
|
|
137
|
-
/**
|
|
138
|
-
* List of files or directories containing the NestJS controller classes.
|
|
139
|
-
*/
|
|
142
|
+
/** List of files or directories containing the NestJS controller classes. */
|
|
140
143
|
include: string[];
|
|
141
|
-
/**
|
|
142
|
-
* List of files or directories to be excluded.
|
|
143
|
-
*/
|
|
144
|
+
/** List of files or directories to be excluded. */
|
|
144
145
|
exclude?: string[];
|
|
145
146
|
}
|
|
146
|
-
/**
|
|
147
|
-
* Building `swagger.json` is also possible.
|
|
148
|
-
*/
|
|
147
|
+
/** Building `swagger.json` is also possible. */
|
|
149
148
|
interface ISwaggerConfig {
|
|
150
149
|
/**
|
|
151
|
-
*
|
|
150
|
+
* Response path of the `swagger.json`.
|
|
152
151
|
*
|
|
153
|
-
* If you've configured only directory, the file name would be the
|
|
154
|
-
* Otherwise you've configured the full path with file name
|
|
155
|
-
* `swagger.json` file would be renamed to it.
|
|
152
|
+
* If you've configured only directory, the file name would be the
|
|
153
|
+
* `swagger.json`. Otherwise you've configured the full path with file name
|
|
154
|
+
* and extension, the `swagger.json` file would be renamed to it.
|
|
156
155
|
*/
|
|
157
156
|
output: string;
|
|
158
157
|
/**
|
|
@@ -169,9 +168,10 @@ export declare namespace INestiaConfig {
|
|
|
169
168
|
/**
|
|
170
169
|
* Whether to beautify JSON content or not.
|
|
171
170
|
*
|
|
172
|
-
* If you configure this property to be `true`, the `swagger.json` file
|
|
173
|
-
* be beautified with indentation (2 spaces) and line breaks. If you
|
|
174
|
-
* numeric value instead, the indentation would be specified by
|
|
171
|
+
* If you configure this property to be `true`, the `swagger.json` file
|
|
172
|
+
* would be beautified with indentation (2 spaces) and line breaks. If you
|
|
173
|
+
* configure numeric value instead, the indentation would be specified by
|
|
174
|
+
* the number.
|
|
175
175
|
*
|
|
176
176
|
* @default false
|
|
177
177
|
*/
|
|
@@ -179,12 +179,11 @@ export declare namespace INestiaConfig {
|
|
|
179
179
|
/**
|
|
180
180
|
* Whether to include additional information or not.
|
|
181
181
|
*
|
|
182
|
-
* If configured to be `true`, those properties would be added into each
|
|
183
|
-
*
|
|
182
|
+
* If configured to be `true`, those properties would be added into each API
|
|
183
|
+
* endpoinnt.
|
|
184
184
|
*
|
|
185
185
|
* - `x-nestia-method`
|
|
186
|
-
* - `x-nestia-namespace`
|
|
187
|
-
* ` `x-nestia-jsDocTags`
|
|
186
|
+
* - `x-nestia-namespace` ` `x-nestia-jsDocTags`
|
|
188
187
|
*
|
|
189
188
|
* @default false
|
|
190
189
|
*/
|
|
@@ -195,24 +194,22 @@ export declare namespace INestiaConfig {
|
|
|
195
194
|
* If omitted, `package.json` content would be used instead.
|
|
196
195
|
*/
|
|
197
196
|
info?: Partial<OpenApi.IDocument.IInfo>;
|
|
198
|
-
/**
|
|
199
|
-
* List of server addresses.
|
|
200
|
-
*/
|
|
197
|
+
/** List of server addresses. */
|
|
201
198
|
servers?: OpenApi.IServer[];
|
|
202
199
|
/**
|
|
203
200
|
* Security schemes.
|
|
204
201
|
*
|
|
205
|
-
* When generating `swagger.json` file through `nestia`, if your controllers
|
|
206
|
-
* theirs methods have a security key which is not enrolled in here
|
|
207
|
-
* it would be an error.
|
|
202
|
+
* When generating `swagger.json` file through `nestia`, if your controllers
|
|
203
|
+
* or theirs methods have a security key which is not enrolled in here
|
|
204
|
+
* property, it would be an error.
|
|
208
205
|
*/
|
|
209
206
|
security?: Record<string, OpenApi.ISecurityScheme>;
|
|
210
207
|
/**
|
|
211
208
|
* List of tag names with description.
|
|
212
209
|
*
|
|
213
|
-
* It is possible to omit this property or skip some tag name even if
|
|
214
|
-
*
|
|
215
|
-
*
|
|
210
|
+
* It is possible to omit this property or skip some tag name even if the
|
|
211
|
+
* tag name is used in the API routes. In that case, the tag name would be
|
|
212
|
+
* used without description.
|
|
216
213
|
*
|
|
217
214
|
* Of course, if you've written a comment like `@tag {name} {description}`,
|
|
218
215
|
* you can entirely replace this property specification.
|
|
@@ -221,10 +218,10 @@ export declare namespace INestiaConfig {
|
|
|
221
218
|
/**
|
|
222
219
|
* Decompose query DTO.
|
|
223
220
|
*
|
|
224
|
-
* If you configure this property to be `true`, the query DTO would be
|
|
225
|
-
* into individual query parameters per each property. Otherwise
|
|
226
|
-
* `false`, the query DTO would be one object type which
|
|
227
|
-
* parameters.
|
|
221
|
+
* If you configure this property to be `true`, the query DTO would be
|
|
222
|
+
* decomposed into individual query parameters per each property. Otherwise
|
|
223
|
+
* you set it to be `false`, the query DTO would be one object type which
|
|
224
|
+
* contains all of query parameters.
|
|
228
225
|
*
|
|
229
226
|
* @default true
|
|
230
227
|
*/
|
|
@@ -76,22 +76,22 @@ var NestiaConfigLoader;
|
|
|
76
76
|
if (false === __is(input)) {
|
|
77
77
|
_errorFactory = errorFactory;
|
|
78
78
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
79
|
-
method: "typia\n .assert",
|
|
79
|
+
method: "typia\r\n .assert",
|
|
80
80
|
path: _path + "",
|
|
81
81
|
expected: "Array<object>",
|
|
82
82
|
value: input
|
|
83
83
|
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || __typia_transform__assertGuard._assertGuard(true, {
|
|
84
|
-
method: "typia\n .assert",
|
|
84
|
+
method: "typia\r\n .assert",
|
|
85
85
|
path: _path + "[" + _index2 + "]",
|
|
86
86
|
expected: "object",
|
|
87
87
|
value: elem
|
|
88
88
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
89
|
-
method: "typia\n .assert",
|
|
89
|
+
method: "typia\r\n .assert",
|
|
90
90
|
path: _path + "[" + _index2 + "]",
|
|
91
91
|
expected: "object",
|
|
92
92
|
value: elem
|
|
93
93
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
94
|
-
method: "typia\n .assert",
|
|
94
|
+
method: "typia\r\n .assert",
|
|
95
95
|
path: _path + "",
|
|
96
96
|
expected: "Array<object>",
|
|
97
97
|
value: input
|
|
@@ -116,7 +116,7 @@ var NestiaConfigLoader;
|
|
|
116
116
|
? instance
|
|
117
117
|
: [instance];
|
|
118
118
|
try {
|
|
119
|
-
return (() => { const _io0 = input => null !== input.input && undefined !== input.input && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every(elem => "string" === typeof elem) || "object" === typeof input.input && null !== input.input && _io1(input.input))) && (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && _io2(input.swagger)) && (undefined === input.output || "string" === typeof input.output) && (undefined === input.distribute || "string" === typeof input.distribute) && (undefined === input.simulate || "boolean" === typeof input.simulate) && (undefined === input.e2e || "string" === typeof input.e2e) && (undefined === input.propagate || "boolean" === typeof input.propagate) && (undefined === input.clone || "boolean" === typeof input.clone) && (undefined === input.primitive || "boolean" === typeof input.primitive) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json); const _io1 = input => Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem)); const _io2 = input => "string" === typeof input.output && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify) && (undefined === input.additional || "boolean" === typeof input.additional) && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && _io3(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && _io9(input.security)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "object" === typeof elem && null !== elem && _io20(elem))) && (undefined === input.decompose || "boolean" === typeof input.decompose); const _io3 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && _io4(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && _io5(input.license)) && (undefined === input.version || "string" === typeof input.version); const _io4 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.email || "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email)); const _io5 = input => "string" === typeof input.name && (undefined === input.identifier || "string" === typeof input.identifier) && (undefined === input.url || "string" === typeof input.url); const _io6 = input => "string" === typeof input.url && (undefined === input.description || "string" === typeof input.description) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && _io7(input.variables)); const _io7 = input => Object.keys(input).every(key => {
|
|
119
|
+
return (() => { const _io0 = input => null !== input.input && undefined !== input.input && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every(elem => "string" === typeof elem) || "object" === typeof input.input && null !== input.input && _io1(input.input))) && (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && _io2(input.swagger)) && (undefined === input.output || "string" === typeof input.output) && (undefined === input.distribute || "string" === typeof input.distribute) && (undefined === input.keyword || "boolean" === typeof input.keyword) && (undefined === input.simulate || "boolean" === typeof input.simulate) && (undefined === input.e2e || "string" === typeof input.e2e) && (undefined === input.propagate || "boolean" === typeof input.propagate) && (undefined === input.clone || "boolean" === typeof input.clone) && (undefined === input.primitive || "boolean" === typeof input.primitive) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json); const _io1 = input => Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem)); const _io2 = input => "string" === typeof input.output && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify) && (undefined === input.additional || "boolean" === typeof input.additional) && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && _io3(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && _io9(input.security)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "object" === typeof elem && null !== elem && _io20(elem))) && (undefined === input.decompose || "boolean" === typeof input.decompose); const _io3 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && _io4(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && _io5(input.license)) && (undefined === input.version || "string" === typeof input.version); const _io4 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.email || "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email)); const _io5 = input => "string" === typeof input.name && (undefined === input.identifier || "string" === typeof input.identifier) && (undefined === input.url || "string" === typeof input.url); const _io6 = input => "string" === typeof input.url && (undefined === input.description || "string" === typeof input.description) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && _io7(input.variables)); const _io7 = input => Object.keys(input).every(key => {
|
|
120
120
|
const value = input[key];
|
|
121
121
|
if (undefined === value)
|
|
122
122
|
return true;
|
|
@@ -189,6 +189,11 @@ var NestiaConfigLoader;
|
|
|
189
189
|
path: _path + ".distribute",
|
|
190
190
|
expected: "(string | undefined)",
|
|
191
191
|
value: input.distribute
|
|
192
|
+
}, _errorFactory)) && (undefined === input.keyword || "boolean" === typeof input.keyword || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
193
|
+
method: "typia.assert",
|
|
194
|
+
path: _path + ".keyword",
|
|
195
|
+
expected: "(boolean | undefined)",
|
|
196
|
+
value: input.keyword
|
|
192
197
|
}, _errorFactory)) && (undefined === input.simulate || "boolean" === typeof input.simulate || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
193
198
|
method: "typia.assert",
|
|
194
199
|
path: _path + ".simulate",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaConfigLoader.js","sourceRoot":"","sources":["../../../src/executable/internal/NestiaConfigLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6GAA0G;AAC1G,4CAAoB;AACpB,gDAAwB;AACxB,qCAAmC;AACnC,uCAAiC;AACjC,4DAA4B;AAC5B,kDAA0B;AAI1B,IAAiB,kBAAkB,CAmElC;AAnED,WAAiB,kBAAkB;IACpB,kCAAe,GAAG,CAC7B,OAAe,EACgB,EAAE;QACjC,MAAM,cAAc,GAAG,oBAAE,CAAC,cAAc,CACtC,OAAO,CAAC,GAAG,EAAE,EACb,oBAAE,CAAC,GAAG,CAAC,UAAU,EACjB,OAAO,CACR,CAAC;QACF,IAAI,CAAC,cAAc;YAA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AEf,IAAI,CAAC;YACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAoB,cAAc,EAAE;QACtC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,qZAAmC,GAAG;gBACpC,GAAG,CAAC,OAAO,GAAG,YAAY,IAAI,SAAS,CAAC;YAC1C,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAA,CAAC;AACJ,CAAC,EAnEgB,kBAAkB,kCAAlB,kBAAkB,QAmElC"}
|
package/lib/executable/sdk.js
CHANGED
|
@@ -50,18 +50,18 @@ const child_process_1 = __importDefault(require("child_process"));
|
|
|
50
50
|
const fs_1 = __importDefault(require("fs"));
|
|
51
51
|
const process_1 = __importDefault(require("process"));
|
|
52
52
|
const CommandParser_1 = require("./internal/CommandParser");
|
|
53
|
-
const USAGE = `Wrong command has been detected. Use like below:
|
|
54
|
-
|
|
55
|
-
npx @nestia/sdk [command] [options?]
|
|
56
|
-
|
|
57
|
-
1. npx @nestia/sdk dependencies --manager (npm|pnpm|yarn)
|
|
58
|
-
- npx @nestia/sdk dependencies
|
|
59
|
-
- npx @nestia/sdk dependencies --manager pnpm
|
|
60
|
-
2. npx @nestia/sdk init
|
|
61
|
-
3. npx @nestia/sdk sdk --config? [config file] --project? [project file]
|
|
62
|
-
4. npx @nestia/sdk swagger --config? [config file] --project? [project file]
|
|
63
|
-
5. npx @nestia/sdk e2e --config? [config file] --project? [project file]
|
|
64
|
-
6. npx @nestia/sdk generate --config? [config file] --project? [project file]
|
|
53
|
+
const USAGE = `Wrong command has been detected. Use like below:
|
|
54
|
+
|
|
55
|
+
npx @nestia/sdk [command] [options?]
|
|
56
|
+
|
|
57
|
+
1. npx @nestia/sdk dependencies --manager (npm|pnpm|yarn)
|
|
58
|
+
- npx @nestia/sdk dependencies
|
|
59
|
+
- npx @nestia/sdk dependencies --manager pnpm
|
|
60
|
+
2. npx @nestia/sdk init
|
|
61
|
+
3. npx @nestia/sdk sdk --config? [config file] --project? [project file]
|
|
62
|
+
4. npx @nestia/sdk swagger --config? [config file] --project? [project file]
|
|
63
|
+
5. npx @nestia/sdk e2e --config? [config file] --project? [project file]
|
|
64
|
+
6. npx @nestia/sdk generate --config? [config file] --project? [project file]
|
|
65
65
|
`;
|
|
66
66
|
function halt(desc) {
|
|
67
67
|
console.error(desc);
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.E2eFileProgrammer = void 0;
|
|
16
16
|
const typescript_1 = __importDefault(require("typescript"));
|
|
17
17
|
const IdentifierFactory_1 = require("typia/lib/factories/IdentifierFactory");
|
|
18
|
+
const LiteralFactory_1 = require("typia/lib/factories/LiteralFactory");
|
|
18
19
|
const FilePrinter_1 = require("./FilePrinter");
|
|
19
20
|
const ImportDictionary_1 = require("./ImportDictionary");
|
|
20
21
|
const SdkAliasCollection_1 = require("./SdkAliasCollection");
|
|
@@ -37,7 +38,7 @@ var E2eFileProgrammer;
|
|
|
37
38
|
instance: null,
|
|
38
39
|
name: "api",
|
|
39
40
|
});
|
|
40
|
-
const functor =
|
|
41
|
+
const functor = generateFunctor(project)(importer)(route);
|
|
41
42
|
yield FilePrinter_1.FilePrinter.write({
|
|
42
43
|
location: importer.file,
|
|
43
44
|
statements: [
|
|
@@ -47,17 +48,18 @@ var E2eFileProgrammer;
|
|
|
47
48
|
],
|
|
48
49
|
});
|
|
49
50
|
});
|
|
50
|
-
const
|
|
51
|
-
typescript_1.default.factory.createVariableDeclaration(typescript_1.default.factory.createIdentifier(getFunctionName(route)), undefined, undefined,
|
|
51
|
+
const generateFunctor = (project) => (importer) => (route) => typescript_1.default.factory.createVariableStatement([typescript_1.default.factory.createModifier(typescript_1.default.SyntaxKind.ExportKeyword)], typescript_1.default.factory.createVariableDeclarationList([
|
|
52
|
+
typescript_1.default.factory.createVariableDeclaration(typescript_1.default.factory.createIdentifier(getFunctionName(route)), undefined, undefined, generateArrow(project)(importer)(route)),
|
|
52
53
|
], typescript_1.default.NodeFlags.Const));
|
|
53
|
-
const
|
|
54
|
+
const generateArrow = (project) => (importer) => (route) => {
|
|
54
55
|
const headers = route.parameters.find((p) => p.category === "headers" && p.field === null);
|
|
56
|
+
const random = IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random");
|
|
55
57
|
const connection = headers
|
|
56
58
|
? typescript_1.default.factory.createObjectLiteralExpression([
|
|
57
59
|
typescript_1.default.factory.createSpreadAssignment(typescript_1.default.factory.createIdentifier("connection")),
|
|
58
60
|
typescript_1.default.factory.createPropertyAssignment("headers", typescript_1.default.factory.createObjectLiteralExpression([
|
|
59
61
|
typescript_1.default.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("connection"), "headers")),
|
|
60
|
-
typescript_1.default.factory.createSpreadAssignment(typescript_1.default.factory.createCallExpression(
|
|
62
|
+
typescript_1.default.factory.createSpreadAssignment(typescript_1.default.factory.createCallExpression(random, [
|
|
61
63
|
project.config.clone === true
|
|
62
64
|
? SdkAliasCollection_1.SdkAliasCollection.from(project)(importer)(headers.metadata)
|
|
63
65
|
: SdkAliasCollection_1.SdkAliasCollection.name(headers),
|
|
@@ -65,15 +67,29 @@ var E2eFileProgrammer;
|
|
|
65
67
|
], true)),
|
|
66
68
|
], true)
|
|
67
69
|
: typescript_1.default.factory.createIdentifier("connection");
|
|
68
|
-
const
|
|
70
|
+
const fetch = typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier(["api", "functional", ...route.accessor].join(".")), undefined, [
|
|
69
71
|
connection,
|
|
70
|
-
...
|
|
71
|
-
.filter((p) => p.category !== "headers")
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
...(project.config.keyword === true &&
|
|
73
|
+
route.parameters.filter((p) => p.category !== "headers").length !== 0
|
|
74
|
+
? [
|
|
75
|
+
LiteralFactory_1.LiteralFactory.write(Object.fromEntries(route.parameters
|
|
76
|
+
.filter((p) => p.category !== "headers")
|
|
77
|
+
.map((p) => [
|
|
78
|
+
p.name,
|
|
79
|
+
typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random"), [
|
|
80
|
+
project.config.clone === true
|
|
81
|
+
? SdkAliasCollection_1.SdkAliasCollection.from(project)(importer)(p.metadata)
|
|
82
|
+
: SdkAliasCollection_1.SdkAliasCollection.name(p),
|
|
83
|
+
], undefined),
|
|
84
|
+
]))),
|
|
85
|
+
]
|
|
86
|
+
: route.parameters
|
|
87
|
+
.filter((p) => p.category !== "headers")
|
|
88
|
+
.map((p) => typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random"), [
|
|
89
|
+
project.config.clone === true
|
|
90
|
+
? SdkAliasCollection_1.SdkAliasCollection.from(project)(importer)(p.metadata)
|
|
91
|
+
: SdkAliasCollection_1.SdkAliasCollection.name(p),
|
|
92
|
+
], undefined))),
|
|
77
93
|
]);
|
|
78
94
|
const assert = typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "assert"), undefined, [typescript_1.default.factory.createIdentifier("output")]);
|
|
79
95
|
return typescript_1.default.factory.createArrowFunction([typescript_1.default.factory.createModifier(typescript_1.default.SyntaxKind.AsyncKeyword)], undefined, [
|
|
@@ -83,7 +99,7 @@ var E2eFileProgrammer;
|
|
|
83
99
|
typescript_1.default.factory.createVariableDeclaration("output", undefined, project.config.propagate !== true &&
|
|
84
100
|
route.success.type.name === "void"
|
|
85
101
|
? undefined
|
|
86
|
-
: SdkAliasCollection_1.SdkAliasCollection.
|
|
102
|
+
: SdkAliasCollection_1.SdkAliasCollection.response(project)(importer)(route), typescript_1.default.factory.createAwaitExpression(fetch)),
|
|
87
103
|
], typescript_1.default.NodeFlags.Const)),
|
|
88
104
|
typescript_1.default.factory.createExpressionStatement(assert),
|
|
89
105
|
]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2eFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/E2eFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;
|
|
1
|
+
{"version":3,"file":"E2eFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/E2eFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,uEAAoE;AAIpE,+CAA4C;AAC5C,yDAAsD;AACtD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 @@ class ImportDictionary {
|
|
|
18
18
|
}
|
|
19
19
|
external(props) {
|
|
20
20
|
var _a;
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const key = `node_modules/${props.library}`;
|
|
22
|
+
const composition = this.components_.take(new tstl_1.Pair(key, props.type), () => ({
|
|
23
|
+
location: key,
|
|
23
24
|
elements: new tstl_1.HashSet(),
|
|
24
25
|
default: false,
|
|
25
26
|
type: props.type,
|
|
@@ -32,13 +33,13 @@ class ImportDictionary {
|
|
|
32
33
|
}
|
|
33
34
|
internal(props) {
|
|
34
35
|
var _a;
|
|
35
|
-
const file = (() => {
|
|
36
|
+
const file = normalize((() => {
|
|
36
37
|
if (props.file.substring(props.file.length - 5) === ".d.ts")
|
|
37
38
|
return props.file.substring(0, props.file.length - 5);
|
|
38
39
|
else if (props.file.substring(props.file.length - 3) === ".ts")
|
|
39
40
|
return props.file.substring(0, props.file.length - 3);
|
|
40
41
|
return props.file;
|
|
41
|
-
})();
|
|
42
|
+
})());
|
|
42
43
|
const composition = this.components_.take(new tstl_1.Pair(file, props.type), () => ({
|
|
43
44
|
location: file,
|
|
44
45
|
elements: new tstl_1.HashSet(),
|
|
@@ -100,4 +101,12 @@ class ImportDictionary {
|
|
|
100
101
|
}
|
|
101
102
|
exports.ImportDictionary = ImportDictionary;
|
|
102
103
|
const NODE_MODULES = "node_modules/";
|
|
104
|
+
const normalize = (file) => {
|
|
105
|
+
file = path_1.default.resolve(file);
|
|
106
|
+
if (file.includes(`node_modules${path_1.default.sep}`))
|
|
107
|
+
file =
|
|
108
|
+
"node_modules/" +
|
|
109
|
+
file.split(`node_modules${path_1.default.sep}`).at(-1).split(path_1.default.sep).join("/");
|
|
110
|
+
return file;
|
|
111
|
+
};
|
|
103
112
|
//# sourceMappingURL=ImportDictionary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportDictionary.js","sourceRoot":"","sources":["../../../src/generates/internal/ImportDictionary.ts"],"names":[],"mappings":";;;;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: ImportDictionary) => (metadata: Metadata) => ts.TypeNode;
|
|
13
|
+
const props: (project: INestiaProject) => (importer: ImportDictionary) => (route: ITypedHttpRoute) => ts.TypeNode;
|
|
13
14
|
const headers: (project: INestiaProject) => (importer: ImportDictionary) => (param: ITypedHttpRouteParameter.IHeaders) => ts.TypeNode;
|
|
14
15
|
const query: (project: INestiaProject) => (importer: ImportDictionary) => (param: ITypedHttpRouteParameter.IQuery) => ts.TypeNode;
|
|
15
|
-
const
|
|
16
|
-
const
|
|
16
|
+
const body: (project: INestiaProject) => (importer: ImportDictionary) => (param: ITypedHttpRouteParameter.IBody) => ts.TypeNode;
|
|
17
|
+
const response: (project: INestiaProject) => (importer: ImportDictionary) => (route: ITypedHttpRoute) => ts.TypeNode;
|
|
17
18
|
const responseBody: (project: INestiaProject) => (importer: ImportDictionary) => (route: ITypedHttpRoute) => ts.TypeNode;
|
|
18
19
|
}
|
|
@@ -14,6 +14,11 @@ var SdkAliasCollection;
|
|
|
14
14
|
? type.typeArguments.map((a) => SdkAliasCollection.name({ type: a }))
|
|
15
15
|
: undefined);
|
|
16
16
|
SdkAliasCollection.from = (project) => (importer) => (metadata) => SdkTypeProgrammer_1.SdkTypeProgrammer.write(project)(importer)(metadata);
|
|
17
|
+
SdkAliasCollection.props = (project) => (importer) => (route) => typescript_1.default.factory.createTypeLiteralNode(route.parameters
|
|
18
|
+
.filter((p) => p.category !== "headers")
|
|
19
|
+
.map((param) => typescript_1.default.factory.createPropertySignature(undefined, param.name, param.metadata.isRequired() === false
|
|
20
|
+
? typescript_1.default.factory.createToken(typescript_1.default.SyntaxKind.QuestionToken)
|
|
21
|
+
: undefined, SdkTypeProgrammer_1.SdkTypeProgrammer.write(project)(importer)(param.metadata))));
|
|
17
22
|
SdkAliasCollection.headers = (project) => (importer) => (param) => {
|
|
18
23
|
if (project.config.clone === true)
|
|
19
24
|
return SdkAliasCollection.from(project)(importer)(param.metadata);
|
|
@@ -38,7 +43,7 @@ var SdkAliasCollection;
|
|
|
38
43
|
instance: "Resolved",
|
|
39
44
|
}), [type]);
|
|
40
45
|
};
|
|
41
|
-
SdkAliasCollection.
|
|
46
|
+
SdkAliasCollection.body = (project) => (importer) => (param) => {
|
|
42
47
|
if (project.config.clone === true) {
|
|
43
48
|
const type = SdkAliasCollection.from(project)(importer)(param.metadata);
|
|
44
49
|
return param.contentType === "multipart/form-data"
|
|
@@ -76,7 +81,7 @@ var SdkAliasCollection;
|
|
|
76
81
|
: "Resolved",
|
|
77
82
|
}), [type]);
|
|
78
83
|
};
|
|
79
|
-
SdkAliasCollection.
|
|
84
|
+
SdkAliasCollection.response = (project) => (importer) => (route) => {
|
|
80
85
|
var _a;
|
|
81
86
|
const schema = (p) => p.metadata.size() === 0
|
|
82
87
|
? TypeFactory_1.TypeFactory.keyword("void")
|
|
@@ -117,7 +122,7 @@ var SdkAliasCollection;
|
|
|
117
122
|
: []),
|
|
118
123
|
]);
|
|
119
124
|
};
|
|
120
|
-
SdkAliasCollection.responseBody = (project) => (importer) => (route) => SdkAliasCollection.
|
|
125
|
+
SdkAliasCollection.responseBody = (project) => (importer) => (route) => SdkAliasCollection.response(Object.assign(Object.assign({}, project), { config: Object.assign(Object.assign({}, project.config), { propagate: false }) }))(importer)(route);
|
|
121
126
|
const formDataInput = (importer) => (type) => typescript_1.default.factory.createTypeReferenceNode(importer.external({
|
|
122
127
|
type: true,
|
|
123
128
|
library: "@nestia/fetcher",
|