@nestia/sdk 2.3.0-dev.20231018 → 2.3.0-dev.20231019

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.
@@ -18,18 +18,16 @@ export const NESTIA_CONFIG: INestiaConfig = {
18
18
  })
19
19
  class MyModule {}
20
20
  const app = await NestFactory.create(MyModule);
21
+ // app.setGlobalPrefix("api");
22
+ // app.enableVersioning({
23
+ // type: VersioningType.URI,
24
+ // prefix: "v",
25
+ // })
21
26
  return app;
22
27
  },
23
28
  // input: "src/controllers",
24
29
  // input: "src/**/*.controller.ts",
25
30
 
26
- /**
27
- * Output directory that SDK would be placed in.
28
- *
29
- * If not configured, you can't build the SDK library.
30
- */
31
- output: "src/api",
32
-
33
31
  /**
34
32
  * Building `swagger.json` is also possible.
35
33
  *
@@ -46,6 +44,13 @@ export const NESTIA_CONFIG: INestiaConfig = {
46
44
  output: "dist/swagger.json",
47
45
  },
48
46
 
47
+ /**
48
+ * Output directory that SDK would be placed in.
49
+ *
50
+ * If not configured, you can't build the SDK library.
51
+ */
52
+ output: "src/api",
53
+
49
54
  /**
50
55
  * Target directory that SDK distribution files would be placed in.
51
56
  *
@@ -8,21 +8,21 @@ import type { ISwaggerSecurityScheme } from "./structures/ISwaggerSecurityScheme
8
8
  * @author Jeongho Nam - https://github.com/samchon
9
9
  */
10
10
  export interface INestiaConfig {
11
- /**
12
- * Building `swagger.json` is also possible.
13
- *
14
- * If not specified, you can't build the `swagger.json`.
15
- */
16
- swagger?: INestiaConfig.ISwaggerConfig;
17
11
  /**
18
12
  * Accessor of controller classes.
19
13
  *
20
- * You can specify it within two ways
14
+ * You can specify target controller classes within two ways
21
15
  *
22
16
  * - Asynchronous function returning `INestApplication` instance
23
17
  * - Specify the path or directory of controller class files
24
18
  */
25
- input: string | string[] | INestiaConfig.IInput | (() => Promise<INestApplication>);
19
+ input: (() => Promise<INestApplication>) | INestiaConfig.IInput | string[] | string;
20
+ /**
21
+ * Building `swagger.json` is also possible.
22
+ *
23
+ * If not specified, you can't build the `swagger.json`.
24
+ */
25
+ swagger?: INestiaConfig.ISwaggerConfig;
26
26
  /**
27
27
  * Output directory that SDK would be placed in.
28
28
  *
@@ -82,13 +82,14 @@ var NestiaConfigLoader;
82
82
  try {
83
83
  return (input => {
84
84
  const __is = input => {
85
- const $io0 = input => (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && $io1(input.swagger)) && (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 && $io17(input.input)))) && (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.project || "string" === typeof input.project) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json);
86
- const $io1 = input => "string" === typeof input.output && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && $io2(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io5(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && $io6(input.security)) && (undefined === input.decompose || "boolean" === typeof input.decompose);
87
- const $io2 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.termsOfService)) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && $io3(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && $io4(input.license)) && (undefined === input.version || "string" === typeof input.version);
88
- const $io3 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url)) && (undefined === input.email || "string" === typeof input.email && /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(input.email));
89
- const $io4 = input => "string" === typeof input.name && (undefined === input.url || "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url));
90
- const $io5 = input => "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) && (undefined === input.description || "string" === typeof input.description);
91
- const $io6 = input => Object.keys(input).every(key => {
85
+ 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.project || "string" === typeof input.project) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json);
86
+ 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));
87
+ const $io2 = input => "string" === typeof input.output && (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) && $io7(input.security)) && (undefined === input.decompose || "boolean" === typeof input.decompose);
88
+ const $io3 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(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);
89
+ const $io4 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url)) && (undefined === input.email || "string" === typeof input.email && /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(input.email));
90
+ const $io5 = input => "string" === typeof input.name && (undefined === input.url || "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url));
91
+ const $io6 = input => "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) && (undefined === input.description || "string" === typeof input.description);
92
+ const $io7 = input => Object.keys(input).every(key => {
92
93
  const value = input[key];
93
94
  if (undefined === value)
94
95
  return true;
@@ -96,14 +97,14 @@ var NestiaConfigLoader;
96
97
  return "object" === typeof value && null !== value && $iu0(value);
97
98
  return true;
98
99
  });
99
- const $io7 = input => "http" === input.type && "basic" === input.scheme;
100
- const $io8 = input => "http" === input.type && "bearer" === input.scheme && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat);
101
- const $io9 = input => "apiKey" === input.type && (undefined === input["in"] || "header" === input["in"] || "query" === input["in"] || "cookie" === input["in"]) && (undefined === input.name || "string" === typeof input.name);
102
- const $io10 = input => "openIdConnect" === input.type && "string" === typeof input.openIdConnectUrl;
103
- const $io11 = input => "oauth2" === input.type && ("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) && $io12(input.flows)) && (undefined === input.description || "string" === typeof input.description);
104
- const $io12 = input => (undefined === input.authorizationCode || "object" === typeof input.authorizationCode && null !== input.authorizationCode && $io13(input.authorizationCode)) && (undefined === input.implicit || "object" === typeof input.implicit && null !== input.implicit && $io15(input.implicit)) && (undefined === input.password || "object" === typeof input.password && null !== input.password && $io16(input.password)) && (undefined === input.clientCredentials || "object" === typeof input.clientCredentials && null !== input.clientCredentials && $io16(input.clientCredentials));
105
- const $io13 = input => "string" === typeof input.authorizationUrl && "string" === typeof input.tokenUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io14(input.scopes));
106
- const $io14 = input => Object.keys(input).every(key => {
100
+ const $io8 = input => "http" === input.type && "basic" === input.scheme;
101
+ const $io9 = input => "http" === input.type && "bearer" === input.scheme && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat);
102
+ const $io10 = input => "apiKey" === input.type && (undefined === input["in"] || "header" === input["in"] || "query" === input["in"] || "cookie" === input["in"]) && (undefined === input.name || "string" === typeof input.name);
103
+ const $io11 = input => "openIdConnect" === input.type && "string" === typeof input.openIdConnectUrl;
104
+ const $io12 = input => "oauth2" === input.type && ("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) && $io13(input.flows)) && (undefined === input.description || "string" === typeof input.description);
105
+ const $io13 = input => (undefined === input.authorizationCode || "object" === typeof input.authorizationCode && null !== input.authorizationCode && $io14(input.authorizationCode)) && (undefined === input.implicit || "object" === typeof input.implicit && null !== input.implicit && $io16(input.implicit)) && (undefined === input.password || "object" === typeof input.password && null !== input.password && $io17(input.password)) && (undefined === input.clientCredentials || "object" === typeof input.clientCredentials && null !== input.clientCredentials && $io17(input.clientCredentials));
106
+ const $io14 = input => "string" === typeof input.authorizationUrl && "string" === typeof input.tokenUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io15(input.scopes));
107
+ const $io15 = input => Object.keys(input).every(key => {
107
108
  const value = input[key];
108
109
  if (undefined === value)
109
110
  return true;
@@ -111,20 +112,19 @@ var NestiaConfigLoader;
111
112
  return "string" === typeof value;
112
113
  return true;
113
114
  });
114
- const $io15 = input => "string" === typeof input.authorizationUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io14(input.scopes));
115
- const $io16 = input => "string" === typeof input.tokenUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io14(input.scopes));
116
- const $io17 = 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));
115
+ const $io16 = input => "string" === typeof input.authorizationUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io15(input.scopes));
116
+ const $io17 = input => "string" === typeof input.tokenUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io15(input.scopes));
117
117
  const $iu0 = input => (() => {
118
118
  if ("basic" === input.scheme)
119
- return $io7(input);
120
- else if ("bearer" === input.scheme)
121
119
  return $io8(input);
122
- else if ("apiKey" === input.type)
120
+ else if ("bearer" === input.scheme)
123
121
  return $io9(input);
124
- else if ("openIdConnect" === input.type)
122
+ else if ("apiKey" === input.type)
125
123
  return $io10(input);
126
- else if ("oauth2" === input.type)
124
+ else if ("openIdConnect" === input.type)
127
125
  return $io11(input);
126
+ else if ("oauth2" === input.type)
127
+ return $io12(input);
128
128
  else
129
129
  return false;
130
130
  })();
@@ -134,15 +134,7 @@ var NestiaConfigLoader;
134
134
  ((input, _path, _exceptionable = true) => {
135
135
  const $guard = typia_1.default.assert.guard;
136
136
  const $join = typia_1.default.assert.join;
137
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || $guard(_exceptionable, {
138
- path: _path + ".swagger",
139
- expected: "(INestiaConfig.ISwaggerConfig | undefined)",
140
- value: input.swagger
141
- })) && $ao1(input.swagger, _path + ".swagger", true && _exceptionable) || $guard(_exceptionable, {
142
- path: _path + ".swagger",
143
- expected: "(INestiaConfig.ISwaggerConfig | undefined)",
144
- value: input.swagger
145
- })) && ((null !== input.input || $guard(_exceptionable, {
137
+ const $ao0 = (input, _path, _exceptionable = true) => (null !== input.input || $guard(_exceptionable, {
146
138
  path: _path + ".input",
147
139
  expected: "(Array<string> | INestiaConfig.IInput | string)",
148
140
  value: input.input
@@ -154,7 +146,7 @@ var NestiaConfigLoader;
154
146
  path: _path + ".input[" + _index1 + "]",
155
147
  expected: "string",
156
148
  value: elem
157
- })) || "object" === typeof input.input && null !== input.input && $ao17(input.input, _path + ".input", true && _exceptionable) || $guard(_exceptionable, {
149
+ })) || "object" === typeof input.input && null !== input.input && $ao1(input.input, _path + ".input", true && _exceptionable) || $guard(_exceptionable, {
158
150
  path: _path + ".input",
159
151
  expected: "(Array<string> | INestiaConfig.IInput | string)",
160
152
  value: input.input
@@ -162,7 +154,15 @@ var NestiaConfigLoader;
162
154
  path: _path + ".input",
163
155
  expected: "(Array<string> | INestiaConfig.IInput | string)",
164
156
  value: input.input
165
- }))) && (undefined === input.output || "string" === typeof input.output || $guard(_exceptionable, {
157
+ })) && (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || $guard(_exceptionable, {
158
+ path: _path + ".swagger",
159
+ expected: "(INestiaConfig.ISwaggerConfig | undefined)",
160
+ value: input.swagger
161
+ })) && $ao2(input.swagger, _path + ".swagger", true && _exceptionable) || $guard(_exceptionable, {
162
+ path: _path + ".swagger",
163
+ expected: "(INestiaConfig.ISwaggerConfig | undefined)",
164
+ value: input.swagger
165
+ })) && (undefined === input.output || "string" === typeof input.output || $guard(_exceptionable, {
166
166
  path: _path + ".output",
167
167
  expected: "(string | undefined)",
168
168
  value: input.output
@@ -203,7 +203,32 @@ var NestiaConfigLoader;
203
203
  expected: "(boolean | undefined)",
204
204
  value: input.json
205
205
  }));
206
- const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || $guard(_exceptionable, {
206
+ const $ao1 = (input, _path, _exceptionable = true) => ((Array.isArray(input.include) || $guard(_exceptionable, {
207
+ path: _path + ".include",
208
+ expected: "Array<string>",
209
+ value: input.include
210
+ })) && input.include.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
211
+ path: _path + ".include[" + _index2 + "]",
212
+ expected: "string",
213
+ value: elem
214
+ })) || $guard(_exceptionable, {
215
+ path: _path + ".include",
216
+ expected: "Array<string>",
217
+ value: input.include
218
+ })) && (undefined === input.exclude || (Array.isArray(input.exclude) || $guard(_exceptionable, {
219
+ path: _path + ".exclude",
220
+ expected: "(Array<string> | undefined)",
221
+ value: input.exclude
222
+ })) && input.exclude.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
223
+ path: _path + ".exclude[" + _index3 + "]",
224
+ expected: "string",
225
+ value: elem
226
+ })) || $guard(_exceptionable, {
227
+ path: _path + ".exclude",
228
+ expected: "(Array<string> | undefined)",
229
+ value: input.exclude
230
+ }));
231
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || $guard(_exceptionable, {
207
232
  path: _path + ".output",
208
233
  expected: "string",
209
234
  value: input.output
@@ -211,7 +236,7 @@ var NestiaConfigLoader;
211
236
  path: _path + ".info",
212
237
  expected: "(Partial<ISwaggerInfo> | undefined)",
213
238
  value: input.info
214
- })) && $ao2(input.info, _path + ".info", true && _exceptionable) || $guard(_exceptionable, {
239
+ })) && $ao3(input.info, _path + ".info", true && _exceptionable) || $guard(_exceptionable, {
215
240
  path: _path + ".info",
216
241
  expected: "(Partial<ISwaggerInfo> | undefined)",
217
242
  value: input.info
@@ -219,12 +244,12 @@ var NestiaConfigLoader;
219
244
  path: _path + ".servers",
220
245
  expected: "(Array<ISwagger.IServer> | undefined)",
221
246
  value: input.servers
222
- })) && input.servers.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
223
- path: _path + ".servers[" + _index2 + "]",
247
+ })) && input.servers.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
248
+ path: _path + ".servers[" + _index4 + "]",
224
249
  expected: "ISwagger.IServer",
225
250
  value: elem
226
- })) && $ao5(elem, _path + ".servers[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
227
- path: _path + ".servers[" + _index2 + "]",
251
+ })) && $ao6(elem, _path + ".servers[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
252
+ path: _path + ".servers[" + _index4 + "]",
228
253
  expected: "ISwagger.IServer",
229
254
  value: elem
230
255
  })) || $guard(_exceptionable, {
@@ -235,7 +260,7 @@ var NestiaConfigLoader;
235
260
  path: _path + ".security",
236
261
  expected: "(Record<string, ISwaggerSecurityScheme> | undefined)",
237
262
  value: input.security
238
- })) && $ao6(input.security, _path + ".security", true && _exceptionable) || $guard(_exceptionable, {
263
+ })) && $ao7(input.security, _path + ".security", true && _exceptionable) || $guard(_exceptionable, {
239
264
  path: _path + ".security",
240
265
  expected: "(Record<string, ISwaggerSecurityScheme> | undefined)",
241
266
  value: input.security
@@ -244,7 +269,7 @@ var NestiaConfigLoader;
244
269
  expected: "(boolean | undefined)",
245
270
  value: input.decompose
246
271
  }));
247
- const $ao2 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || $guard(_exceptionable, {
272
+ const $ao3 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || $guard(_exceptionable, {
248
273
  path: _path + ".title",
249
274
  expected: "(string | undefined)",
250
275
  value: input.title
@@ -264,7 +289,7 @@ var NestiaConfigLoader;
264
289
  path: _path + ".contact",
265
290
  expected: "(ISwaggerInfo.IContact | undefined)",
266
291
  value: input.contact
267
- })) && $ao3(input.contact, _path + ".contact", true && _exceptionable) || $guard(_exceptionable, {
292
+ })) && $ao4(input.contact, _path + ".contact", true && _exceptionable) || $guard(_exceptionable, {
268
293
  path: _path + ".contact",
269
294
  expected: "(ISwaggerInfo.IContact | undefined)",
270
295
  value: input.contact
@@ -272,7 +297,7 @@ var NestiaConfigLoader;
272
297
  path: _path + ".license",
273
298
  expected: "(ISwaggerInfo.ILicense | undefined)",
274
299
  value: input.license
275
- })) && $ao4(input.license, _path + ".license", true && _exceptionable) || $guard(_exceptionable, {
300
+ })) && $ao5(input.license, _path + ".license", true && _exceptionable) || $guard(_exceptionable, {
276
301
  path: _path + ".license",
277
302
  expected: "(ISwaggerInfo.ILicense | undefined)",
278
303
  value: input.license
@@ -281,7 +306,7 @@ var NestiaConfigLoader;
281
306
  expected: "(string | undefined)",
282
307
  value: input.version
283
308
  }));
284
- const $ao3 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
309
+ const $ao4 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
285
310
  path: _path + ".name",
286
311
  expected: "(string | undefined)",
287
312
  value: input.name
@@ -302,7 +327,7 @@ var NestiaConfigLoader;
302
327
  expected: "((string & Format<\"email\">) | undefined)",
303
328
  value: input.email
304
329
  }));
305
- const $ao4 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
330
+ const $ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
306
331
  path: _path + ".name",
307
332
  expected: "string",
308
333
  value: input.name
@@ -315,7 +340,7 @@ var NestiaConfigLoader;
315
340
  expected: "((string & Format<\"url\">) | undefined)",
316
341
  value: input.url
317
342
  }));
318
- const $ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.url && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) || $guard(_exceptionable, {
343
+ const $ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.url && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) || $guard(_exceptionable, {
319
344
  path: _path + ".url",
320
345
  expected: "string & Format<\"url\">",
321
346
  value: input.url
@@ -328,7 +353,7 @@ var NestiaConfigLoader;
328
353
  expected: "(string | undefined)",
329
354
  value: input.description
330
355
  }));
331
- const $ao6 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
356
+ const $ao7 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
332
357
  const value = input[key];
333
358
  if (undefined === value)
334
359
  return true;
@@ -344,7 +369,7 @@ var NestiaConfigLoader;
344
369
  });
345
370
  return true;
346
371
  });
347
- const $ao7 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
372
+ const $ao8 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
348
373
  path: _path + ".type",
349
374
  expected: "\"http\"",
350
375
  value: input.type
@@ -353,7 +378,7 @@ var NestiaConfigLoader;
353
378
  expected: "\"basic\"",
354
379
  value: input.scheme
355
380
  }));
356
- const $ao8 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
381
+ const $ao9 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
357
382
  path: _path + ".type",
358
383
  expected: "\"http\"",
359
384
  value: input.type
@@ -366,7 +391,7 @@ var NestiaConfigLoader;
366
391
  expected: "(string | undefined)",
367
392
  value: input.bearerFormat
368
393
  }));
369
- const $ao9 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || $guard(_exceptionable, {
394
+ const $ao10 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || $guard(_exceptionable, {
370
395
  path: _path + ".type",
371
396
  expected: "\"apiKey\"",
372
397
  value: input.type
@@ -379,7 +404,7 @@ var NestiaConfigLoader;
379
404
  expected: "(string | undefined)",
380
405
  value: input.name
381
406
  }));
382
- const $ao10 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || $guard(_exceptionable, {
407
+ const $ao11 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || $guard(_exceptionable, {
383
408
  path: _path + ".type",
384
409
  expected: "\"openIdConnect\"",
385
410
  value: input.type
@@ -388,7 +413,7 @@ var NestiaConfigLoader;
388
413
  expected: "string",
389
414
  value: input.openIdConnectUrl
390
415
  }));
391
- const $ao11 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || $guard(_exceptionable, {
416
+ const $ao12 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || $guard(_exceptionable, {
392
417
  path: _path + ".type",
393
418
  expected: "\"oauth2\"",
394
419
  value: input.type
@@ -396,7 +421,7 @@ var NestiaConfigLoader;
396
421
  path: _path + ".flows",
397
422
  expected: "ISwaggerSecurityScheme.IOAuth2.IFlowSet",
398
423
  value: input.flows
399
- })) && $ao12(input.flows, _path + ".flows", true && _exceptionable) || $guard(_exceptionable, {
424
+ })) && $ao13(input.flows, _path + ".flows", true && _exceptionable) || $guard(_exceptionable, {
400
425
  path: _path + ".flows",
401
426
  expected: "ISwaggerSecurityScheme.IOAuth2.IFlowSet",
402
427
  value: input.flows
@@ -405,11 +430,11 @@ var NestiaConfigLoader;
405
430
  expected: "(string | undefined)",
406
431
  value: input.description
407
432
  }));
408
- const $ao12 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode || $guard(_exceptionable, {
433
+ const $ao13 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode || $guard(_exceptionable, {
409
434
  path: _path + ".authorizationCode",
410
435
  expected: "(ISwaggerSecurityScheme.IOAuth2.IFlow | undefined)",
411
436
  value: input.authorizationCode
412
- })) && $ao13(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || $guard(_exceptionable, {
437
+ })) && $ao14(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || $guard(_exceptionable, {
413
438
  path: _path + ".authorizationCode",
414
439
  expected: "(ISwaggerSecurityScheme.IOAuth2.IFlow | undefined)",
415
440
  value: input.authorizationCode
@@ -417,7 +442,7 @@ var NestiaConfigLoader;
417
442
  path: _path + ".implicit",
418
443
  expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
419
444
  value: input.implicit
420
- })) && $ao15(input.implicit, _path + ".implicit", true && _exceptionable) || $guard(_exceptionable, {
445
+ })) && $ao16(input.implicit, _path + ".implicit", true && _exceptionable) || $guard(_exceptionable, {
421
446
  path: _path + ".implicit",
422
447
  expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
423
448
  value: input.implicit
@@ -425,7 +450,7 @@ var NestiaConfigLoader;
425
450
  path: _path + ".password",
426
451
  expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
427
452
  value: input.password
428
- })) && $ao16(input.password, _path + ".password", true && _exceptionable) || $guard(_exceptionable, {
453
+ })) && $ao17(input.password, _path + ".password", true && _exceptionable) || $guard(_exceptionable, {
429
454
  path: _path + ".password",
430
455
  expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
431
456
  value: input.password
@@ -433,12 +458,12 @@ var NestiaConfigLoader;
433
458
  path: _path + ".clientCredentials",
434
459
  expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
435
460
  value: input.clientCredentials
436
- })) && $ao16(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || $guard(_exceptionable, {
461
+ })) && $ao17(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || $guard(_exceptionable, {
437
462
  path: _path + ".clientCredentials",
438
463
  expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
439
464
  value: input.clientCredentials
440
465
  }));
441
- const $ao13 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
466
+ const $ao14 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
442
467
  path: _path + ".authorizationUrl",
443
468
  expected: "string",
444
469
  value: input.authorizationUrl
@@ -454,12 +479,12 @@ var NestiaConfigLoader;
454
479
  path: _path + ".scopes",
455
480
  expected: "(Record<string, string> | undefined)",
456
481
  value: input.scopes
457
- })) && $ao14(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
482
+ })) && $ao15(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
458
483
  path: _path + ".scopes",
459
484
  expected: "(Record<string, string> | undefined)",
460
485
  value: input.scopes
461
486
  }));
462
- const $ao14 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
487
+ const $ao15 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
463
488
  const value = input[key];
464
489
  if (undefined === value)
465
490
  return true;
@@ -471,7 +496,7 @@ var NestiaConfigLoader;
471
496
  });
472
497
  return true;
473
498
  });
474
- const $ao15 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
499
+ const $ao16 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
475
500
  path: _path + ".authorizationUrl",
476
501
  expected: "string",
477
502
  value: input.authorizationUrl
@@ -483,12 +508,12 @@ var NestiaConfigLoader;
483
508
  path: _path + ".scopes",
484
509
  expected: "(Record<string, string> | undefined)",
485
510
  value: input.scopes
486
- })) && $ao14(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
511
+ })) && $ao15(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
487
512
  path: _path + ".scopes",
488
513
  expected: "(Record<string, string> | undefined)",
489
514
  value: input.scopes
490
515
  }));
491
- const $ao16 = (input, _path, _exceptionable = true) => ("string" === typeof input.tokenUrl || $guard(_exceptionable, {
516
+ const $ao17 = (input, _path, _exceptionable = true) => ("string" === typeof input.tokenUrl || $guard(_exceptionable, {
492
517
  path: _path + ".tokenUrl",
493
518
  expected: "string",
494
519
  value: input.tokenUrl
@@ -500,47 +525,22 @@ var NestiaConfigLoader;
500
525
  path: _path + ".scopes",
501
526
  expected: "(Record<string, string> | undefined)",
502
527
  value: input.scopes
503
- })) && $ao14(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
528
+ })) && $ao15(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
504
529
  path: _path + ".scopes",
505
530
  expected: "(Record<string, string> | undefined)",
506
531
  value: input.scopes
507
532
  }));
508
- const $ao17 = (input, _path, _exceptionable = true) => ((Array.isArray(input.include) || $guard(_exceptionable, {
509
- path: _path + ".include",
510
- expected: "Array<string>",
511
- value: input.include
512
- })) && input.include.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
513
- path: _path + ".include[" + _index3 + "]",
514
- expected: "string",
515
- value: elem
516
- })) || $guard(_exceptionable, {
517
- path: _path + ".include",
518
- expected: "Array<string>",
519
- value: input.include
520
- })) && (undefined === input.exclude || (Array.isArray(input.exclude) || $guard(_exceptionable, {
521
- path: _path + ".exclude",
522
- expected: "(Array<string> | undefined)",
523
- value: input.exclude
524
- })) && input.exclude.every((elem, _index4) => "string" === typeof elem || $guard(_exceptionable, {
525
- path: _path + ".exclude[" + _index4 + "]",
526
- expected: "string",
527
- value: elem
528
- })) || $guard(_exceptionable, {
529
- path: _path + ".exclude",
530
- expected: "(Array<string> | undefined)",
531
- value: input.exclude
532
- }));
533
533
  const $au0 = (input, _path, _exceptionable = true) => (() => {
534
534
  if ("basic" === input.scheme)
535
- return $ao7(input, _path, true && _exceptionable);
536
- else if ("bearer" === input.scheme)
537
535
  return $ao8(input, _path, true && _exceptionable);
538
- else if ("apiKey" === input.type)
536
+ else if ("bearer" === input.scheme)
539
537
  return $ao9(input, _path, true && _exceptionable);
540
- else if ("openIdConnect" === input.type)
538
+ else if ("apiKey" === input.type)
541
539
  return $ao10(input, _path, true && _exceptionable);
542
- else if ("oauth2" === input.type)
540
+ else if ("openIdConnect" === input.type)
543
541
  return $ao11(input, _path, true && _exceptionable);
542
+ else if ("oauth2" === input.type)
543
+ return $ao12(input, _path, true && _exceptionable);
544
544
  else
545
545
  return $guard(_exceptionable, {
546
546
  path: _path,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/sdk",
3
- "version": "2.3.0-dev.20231018",
3
+ "version": "2.3.0-dev.20231019",
4
4
  "description": "Nestia SDK and Swagger generator",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "homepage": "https://nestia.io",
37
37
  "dependencies": {
38
- "@nestia/fetcher": "^2.3.0-dev.20231018",
38
+ "@nestia/fetcher": "^2.3.0-dev.20231019",
39
39
  "cli": "^1.0.1",
40
40
  "get-function-location": "^2.0.0",
41
41
  "glob": "^7.2.0",
@@ -48,7 +48,7 @@
48
48
  "typia": "^5.2.2"
49
49
  },
50
50
  "peerDependencies": {
51
- "@nestia/fetcher": ">=2.3.0-dev.20231018",
51
+ "@nestia/fetcher": ">=2.3.0-dev.20231019",
52
52
  "@nestjs/common": ">=7.0.1",
53
53
  "@nestjs/core": ">=7.0.1",
54
54
  "reflect-metadata": ">=0.1.12",
@@ -11,26 +11,26 @@ import type { ISwaggerSecurityScheme } from "./structures/ISwaggerSecurityScheme
11
11
  * @author Jeongho Nam - https://github.com/samchon
12
12
  */
13
13
  export interface INestiaConfig {
14
- /**
15
- * Building `swagger.json` is also possible.
16
- *
17
- * If not specified, you can't build the `swagger.json`.
18
- */
19
- swagger?: INestiaConfig.ISwaggerConfig;
20
-
21
14
  /**
22
15
  * Accessor of controller classes.
23
16
  *
24
- * You can specify it within two ways
17
+ * You can specify target controller classes within two ways
25
18
  *
26
19
  * - Asynchronous function returning `INestApplication` instance
27
20
  * - Specify the path or directory of controller class files
28
21
  */
29
22
  input:
30
- | string
31
- | string[]
23
+ | (() => Promise<INestApplication>)
32
24
  | INestiaConfig.IInput
33
- | (() => Promise<INestApplication>);
25
+ | string[]
26
+ | string;
27
+
28
+ /**
29
+ * Building `swagger.json` is also possible.
30
+ *
31
+ * If not specified, you can't build the `swagger.json`.
32
+ */
33
+ swagger?: INestiaConfig.ISwaggerConfig;
34
34
 
35
35
  /**
36
36
  * Output directory that SDK would be placed in.