@nestia/migrate 0.4.2 → 0.4.5

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.
@@ -34,7 +34,7 @@ class NestiaMigrateApplication {
34
34
  };
35
35
  this.swagger = (input => {
36
36
  const __is = input => {
37
- const $io0 = input => "string" === typeof input.openapi && RegExp(/^3\.0\.[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/).test(input.openapi) && ("object" === typeof input.info && null !== input.info && $io1(input.info)) && (Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io4(elem))) && ("object" === typeof input.components && null !== input.components && false === Array.isArray(input.components) && $io5(input.components)) && ("object" === typeof input.paths && null !== input.paths && false === Array.isArray(input.paths) && $io30(input.paths)) && (undefined === input.security || Array.isArray(input.security) && input.security.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io40(elem)));
37
+ const $io0 = input => "string" === typeof input.openapi && RegExp(/^3\.0\.[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/).test(input.openapi) && ("object" === typeof input.info && null !== input.info && $io1(input.info)) && (Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io4(elem))) && ("object" === typeof input.components && null !== input.components && false === Array.isArray(input.components) && $io5(input.components)) && ("object" === typeof input.paths && null !== input.paths && false === Array.isArray(input.paths) && $io30(input.paths)) && (undefined === input.security || Array.isArray(input.security) && input.security.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io42(elem)));
38
38
  const $io1 = input => "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) && $io2(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && $io3(input.license)) && "string" === typeof input.version;
39
39
  const $io2 = 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));
40
40
  const $io3 = 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));
@@ -101,22 +101,24 @@ class NestiaMigrateApplication {
101
101
  return "object" === typeof value && null !== value && false === Array.isArray(value) && $io32(value);
102
102
  return true;
103
103
  });
104
- const $io32 = input => (undefined === input.parameters || Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && $io33(elem))) && (undefined === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && $io34(input.requestBody)) && (undefined === input.responses || "object" === typeof input.responses && null !== input.responses && false === Array.isArray(input.responses) && $io38(input.responses)) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.security || Array.isArray(input.security) && input.security.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io40(elem))) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (undefined === input["x-nestia-jsDocTags"] || Array.isArray(input["x-nestia-jsDocTags"]) && input["x-nestia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io41(elem)));
104
+ const $io32 = input => (undefined === input.parameters || Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && $io33(elem))) && (undefined === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && $io34(input.requestBody)) && (undefined === input.responses || "object" === typeof input.responses && null !== input.responses && false === Array.isArray(input.responses) && $io40(input.responses)) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.security || Array.isArray(input.security) && input.security.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io42(elem))) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (undefined === input["x-nestia-jsDocTags"] || Array.isArray(input["x-nestia-jsDocTags"]) && input["x-nestia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io43(elem)));
105
105
  const $io33 = input => (undefined === input.name || "string" === typeof input.name) && ("header" === input["in"] || "query" === input["in"] || "cookie" === input["in"] || "path" === input["in"]) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && $iu0(input.schema)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description);
106
106
  const $io34 = input => (undefined === input.description || "string" === typeof input.description) && ("object" === typeof input.content && null !== input.content && false === Array.isArray(input.content) && $io35(input.content)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input["x-nestia-encrypted"] || "boolean" === typeof input["x-nestia-encrypted"]);
107
- const $io35 = input => (undefined === input["text/plain"] || "object" === typeof input["text/plain"] && null !== input["text/plain"] && $io36(input["text/plain"])) && (undefined === input["application/json"] || "object" === typeof input["application/json"] && null !== input["application/json"] && $io37(input["application/json"]));
107
+ const $io35 = input => (undefined === input["text/plain"] || "object" === typeof input["text/plain"] && null !== input["text/plain"] && $io36(input["text/plain"])) && (undefined === input["application/json"] || "object" === typeof input["application/json"] && null !== input["application/json"] && $io37(input["application/json"])) && (undefined === input["application/x-www-form-urlencoded"] || "object" === typeof input["application/x-www-form-urlencoded"] && null !== input["application/x-www-form-urlencoded"] && $io38(input["application/x-www-form-urlencoded"])) && (undefined === input["*/*"] || "object" === typeof input["*/*"] && null !== input["*/*"] && $io39(input["*/*"]));
108
108
  const $io36 = input => "object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && $iu0(input.schema);
109
109
  const $io37 = input => "object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && $iu0(input.schema);
110
- const $io38 = input => Object.keys(input).every(key => {
110
+ const $io38 = input => "object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && $iu0(input.schema);
111
+ const $io39 = input => "object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && $iu0(input.schema);
112
+ const $io40 = input => Object.keys(input).every(key => {
111
113
  const value = input[key];
112
114
  if (undefined === value)
113
115
  return true;
114
116
  if (RegExp(/(.*)/).test(key))
115
- return "object" === typeof value && null !== value && false === Array.isArray(value) && $io39(value);
117
+ return "object" === typeof value && null !== value && false === Array.isArray(value) && $io41(value);
116
118
  return true;
117
119
  });
118
- const $io39 = input => (undefined === input.description || "string" === typeof input.description) && (undefined === input.content || "object" === typeof input.content && null !== input.content && false === Array.isArray(input.content) && $io35(input.content)) && (undefined === input["x-nestia-encrypted"] || "boolean" === typeof input["x-nestia-encrypted"]);
119
- const $io40 = input => Object.keys(input).every(key => {
120
+ const $io41 = input => (undefined === input.description || "string" === typeof input.description) && (undefined === input.content || "object" === typeof input.content && null !== input.content && false === Array.isArray(input.content) && $io35(input.content)) && (undefined === input["x-nestia-encrypted"] || "boolean" === typeof input["x-nestia-encrypted"]);
121
+ const $io42 = input => Object.keys(input).every(key => {
120
122
  const value = input[key];
121
123
  if (undefined === value)
122
124
  return true;
@@ -124,8 +126,8 @@ class NestiaMigrateApplication {
124
126
  return Array.isArray(value) && value.every(elem => "string" === typeof elem);
125
127
  return true;
126
128
  });
127
- const $io41 = input => "string" === typeof input.name && (undefined === input.text || Array.isArray(input.text) && input.text.every(elem => "object" === typeof elem && null !== elem && $io42(elem)));
128
- const $io42 = input => "string" === typeof input.text && "string" === typeof input.kind;
129
+ const $io43 = input => "string" === typeof input.name && (undefined === input.text || Array.isArray(input.text) && input.text.every(elem => "object" === typeof elem && null !== elem && $io44(elem)));
130
+ const $io44 = input => "string" === typeof input.text && "string" === typeof input.kind;
129
131
  const $iu0 = input => (() => {
130
132
  if ("null" === input.type)
131
133
  return $io8(input);
@@ -222,7 +224,7 @@ class NestiaMigrateApplication {
222
224
  path: _path + ".security[" + _index2 + "]",
223
225
  expected: "Record<string, Array<string>>",
224
226
  value: elem
225
- })) && $ao40(elem, _path + ".security[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
227
+ })) && $ao42(elem, _path + ".security[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
226
228
  path: _path + ".security[" + _index2 + "]",
227
229
  expected: "Record<string, Array<string>>",
228
230
  value: elem
@@ -1169,7 +1171,7 @@ class NestiaMigrateApplication {
1169
1171
  path: _path + ".responses",
1170
1172
  expected: "(ISwaggerRoute.IResponseBody | undefined)",
1171
1173
  value: input.responses
1172
- })) && $ao38(input.responses, _path + ".responses", true && _exceptionable) || $guard(_exceptionable, {
1174
+ })) && $ao40(input.responses, _path + ".responses", true && _exceptionable) || $guard(_exceptionable, {
1173
1175
  path: _path + ".responses",
1174
1176
  expected: "(ISwaggerRoute.IResponseBody | undefined)",
1175
1177
  value: input.responses
@@ -1193,7 +1195,7 @@ class NestiaMigrateApplication {
1193
1195
  path: _path + ".security[" + _index12 + "]",
1194
1196
  expected: "Record<string, Array<string>>",
1195
1197
  value: elem
1196
- })) && $ao40(elem, _path + ".security[" + _index12 + "]", true && _exceptionable) || $guard(_exceptionable, {
1198
+ })) && $ao42(elem, _path + ".security[" + _index12 + "]", true && _exceptionable) || $guard(_exceptionable, {
1197
1199
  path: _path + ".security[" + _index12 + "]",
1198
1200
  expected: "Record<string, Array<string>>",
1199
1201
  value: elem
@@ -1221,7 +1223,7 @@ class NestiaMigrateApplication {
1221
1223
  path: _path + "[\"x-nestia-jsDocTags\"][" + _index14 + "]",
1222
1224
  expected: "IJsDocTagInfo",
1223
1225
  value: elem
1224
- })) && $ao41(elem, _path + "[\"x-nestia-jsDocTags\"][" + _index14 + "]", true && _exceptionable) || $guard(_exceptionable, {
1226
+ })) && $ao43(elem, _path + "[\"x-nestia-jsDocTags\"][" + _index14 + "]", true && _exceptionable) || $guard(_exceptionable, {
1225
1227
  path: _path + "[\"x-nestia-jsDocTags\"][" + _index14 + "]",
1226
1228
  expected: "IJsDocTagInfo",
1227
1229
  value: elem
@@ -1292,6 +1294,22 @@ class NestiaMigrateApplication {
1292
1294
  path: _path + "[\"application/json\"]",
1293
1295
  expected: "(__type.o1 | undefined)",
1294
1296
  value: input["application/json"]
1297
+ })) && (undefined === input["application/x-www-form-urlencoded"] || ("object" === typeof input["application/x-www-form-urlencoded"] && null !== input["application/x-www-form-urlencoded"] || $guard(_exceptionable, {
1298
+ path: _path + "[\"application/x-www-form-urlencoded\"]",
1299
+ expected: "(__type.o2 | undefined)",
1300
+ value: input["application/x-www-form-urlencoded"]
1301
+ })) && $ao38(input["application/x-www-form-urlencoded"], _path + "[\"application/x-www-form-urlencoded\"]", true && _exceptionable) || $guard(_exceptionable, {
1302
+ path: _path + "[\"application/x-www-form-urlencoded\"]",
1303
+ expected: "(__type.o2 | undefined)",
1304
+ value: input["application/x-www-form-urlencoded"]
1305
+ })) && (undefined === input["*/*"] || ("object" === typeof input["*/*"] && null !== input["*/*"] || $guard(_exceptionable, {
1306
+ path: _path + "[\"*/*\"]",
1307
+ expected: "(__type.o3 | undefined)",
1308
+ value: input["*/*"]
1309
+ })) && $ao39(input["*/*"], _path + "[\"*/*\"]", true && _exceptionable) || $guard(_exceptionable, {
1310
+ path: _path + "[\"*/*\"]",
1311
+ expected: "(__type.o3 | undefined)",
1312
+ value: input["*/*"]
1295
1313
  }));
1296
1314
  const $ao36 = (input, _path, _exceptionable = true) => ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) || $guard(_exceptionable, {
1297
1315
  path: _path + ".schema",
@@ -1311,23 +1329,41 @@ class NestiaMigrateApplication {
1311
1329
  expected: "(ISwaggerSchema.IAnyOf | ISwaggerSchema.IArray | ISwaggerSchema.IBoolean | ISwaggerSchema.IInteger | ISwaggerSchema.INullOnly | ISwaggerSchema.INumber | ISwaggerSchema.IObject | ISwaggerSchema.IOneOf | ISwaggerSchema.IReference | ISwaggerSchema.IString | ISwaggerSchema.IUnknown)",
1312
1330
  value: input.schema
1313
1331
  });
1314
- const $ao38 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1332
+ const $ao38 = (input, _path, _exceptionable = true) => ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) || $guard(_exceptionable, {
1333
+ path: _path + ".schema",
1334
+ expected: "(ISwaggerSchema.IAnyOf | ISwaggerSchema.IArray | ISwaggerSchema.IBoolean | ISwaggerSchema.IInteger | ISwaggerSchema.INullOnly | ISwaggerSchema.INumber | ISwaggerSchema.IObject | ISwaggerSchema.IOneOf | ISwaggerSchema.IReference | ISwaggerSchema.IString | ISwaggerSchema.IUnknown)",
1335
+ value: input.schema
1336
+ })) && $au0(input.schema, _path + ".schema", true && _exceptionable) || $guard(_exceptionable, {
1337
+ path: _path + ".schema",
1338
+ expected: "(ISwaggerSchema.IAnyOf | ISwaggerSchema.IArray | ISwaggerSchema.IBoolean | ISwaggerSchema.IInteger | ISwaggerSchema.INullOnly | ISwaggerSchema.INumber | ISwaggerSchema.IObject | ISwaggerSchema.IOneOf | ISwaggerSchema.IReference | ISwaggerSchema.IString | ISwaggerSchema.IUnknown)",
1339
+ value: input.schema
1340
+ });
1341
+ const $ao39 = (input, _path, _exceptionable = true) => ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) || $guard(_exceptionable, {
1342
+ path: _path + ".schema",
1343
+ expected: "(ISwaggerSchema.IAnyOf | ISwaggerSchema.IArray | ISwaggerSchema.IBoolean | ISwaggerSchema.IInteger | ISwaggerSchema.INullOnly | ISwaggerSchema.INumber | ISwaggerSchema.IObject | ISwaggerSchema.IOneOf | ISwaggerSchema.IReference | ISwaggerSchema.IString | ISwaggerSchema.IUnknown)",
1344
+ value: input.schema
1345
+ })) && $au0(input.schema, _path + ".schema", true && _exceptionable) || $guard(_exceptionable, {
1346
+ path: _path + ".schema",
1347
+ expected: "(ISwaggerSchema.IAnyOf | ISwaggerSchema.IArray | ISwaggerSchema.IBoolean | ISwaggerSchema.IInteger | ISwaggerSchema.INullOnly | ISwaggerSchema.INumber | ISwaggerSchema.IObject | ISwaggerSchema.IOneOf | ISwaggerSchema.IReference | ISwaggerSchema.IString | ISwaggerSchema.IUnknown)",
1348
+ value: input.schema
1349
+ });
1350
+ const $ao40 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1315
1351
  const value = input[key];
1316
1352
  if (undefined === value)
1317
1353
  return true;
1318
1354
  if (RegExp(/(.*)/).test(key))
1319
1355
  return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
1320
1356
  path: _path + $join(key),
1321
- expected: "__type.o2",
1357
+ expected: "__type.o4",
1322
1358
  value: value
1323
- })) && $ao39(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
1359
+ })) && $ao41(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
1324
1360
  path: _path + $join(key),
1325
- expected: "__type.o2",
1361
+ expected: "__type.o4",
1326
1362
  value: value
1327
1363
  });
1328
1364
  return true;
1329
1365
  });
1330
- const $ao39 = (input, _path, _exceptionable = true) => (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
1366
+ const $ao41 = (input, _path, _exceptionable = true) => (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
1331
1367
  path: _path + ".description",
1332
1368
  expected: "(string | undefined)",
1333
1369
  value: input.description
@@ -1344,7 +1380,7 @@ class NestiaMigrateApplication {
1344
1380
  expected: "(boolean | undefined)",
1345
1381
  value: input["x-nestia-encrypted"]
1346
1382
  }));
1347
- const $ao40 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1383
+ const $ao42 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1348
1384
  const value = input[key];
1349
1385
  if (undefined === value)
1350
1386
  return true;
@@ -1364,7 +1400,7 @@ class NestiaMigrateApplication {
1364
1400
  });
1365
1401
  return true;
1366
1402
  });
1367
- const $ao41 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
1403
+ const $ao43 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
1368
1404
  path: _path + ".name",
1369
1405
  expected: "string",
1370
1406
  value: input.name
@@ -1376,7 +1412,7 @@ class NestiaMigrateApplication {
1376
1412
  path: _path + ".text[" + _index16 + "]",
1377
1413
  expected: "IJsDocTagInfo.IText",
1378
1414
  value: elem
1379
- })) && $ao42(elem, _path + ".text[" + _index16 + "]", true && _exceptionable) || $guard(_exceptionable, {
1415
+ })) && $ao44(elem, _path + ".text[" + _index16 + "]", true && _exceptionable) || $guard(_exceptionable, {
1380
1416
  path: _path + ".text[" + _index16 + "]",
1381
1417
  expected: "IJsDocTagInfo.IText",
1382
1418
  value: elem
@@ -1385,7 +1421,7 @@ class NestiaMigrateApplication {
1385
1421
  expected: "(Array<IJsDocTagInfo.IText> | undefined)",
1386
1422
  value: input.text
1387
1423
  }));
1388
- const $ao42 = (input, _path, _exceptionable = true) => ("string" === typeof input.text || $guard(_exceptionable, {
1424
+ const $ao44 = (input, _path, _exceptionable = true) => ("string" === typeof input.text || $guard(_exceptionable, {
1389
1425
  path: _path + ".text",
1390
1426
  expected: "string",
1391
1427
  value: input.text
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateApplication.js","source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;;;;;;;;;;;;;;;;;;;;;;;;WAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAEM,OAAO;QACV,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;YACrB,IAAI,CAAC,OAAO,GAAG,qCAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,KAAK;QACR,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE;YACrB,MAAM,OAAO,GAAoB,IAAI,CAAC,OAAO,EAAE,CAAC;YAChD,IAAI,CAAC,KAAK,GAAG,qCAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CACzD,OAAO,CACV,CAAC;SACL;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CA8BJ;AAvDD,4DAuDC"}
@@ -45,12 +45,17 @@ exports.TEMPLATE = [
45
45
  {
46
46
  "location": "",
47
47
  "file": "nestia.config.ts",
48
- "content": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: \"src/controllers\",\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n },\r\n primitive: false,\r\n simulate: true,\r\n e2e: \"test\",\r\n};\r\nexport default NESTIA_CONFIG;\r\n"
48
+ "content": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\n\r\nimport { MyModule } from \"./src/MyModule\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: async () => NestFactory.create(await MyModule()),\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n },\r\n distribute: \"packages/api\",\r\n simulate: true,\r\n e2e: \"test\",\r\n};\r\nexport default NESTIA_CONFIG;\r\n"
49
49
  },
50
50
  {
51
51
  "location": "",
52
52
  "file": "package.json",
53
- "content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"----------------------------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"prepare\": \"ts-patch install\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"-----------------------------------------------\": \"\",\r\n \"start\": \"node lib/executable/server\",\r\n \"test\": \"node bin/test\",\r\n \"------------------------------------------------\": \"\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.3.6\",\r\n \"@nestia/sdk\": \"^2.1.5\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^3.3.1\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^5.40.0\",\r\n \"@typescript-eslint/parser\": \"^5.40.0\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"eslint-plugin-deprecation\": \"^1.4.1\",\r\n \"nestia\": \"^4.5.0\",\r\n \"prettier\": \"^2.7.1\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.0\",\r\n \"typescript\": \"^5.2.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.1.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.1.5\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}\r\n"
53
+ "content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"----------------------------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"prepare\": \"ts-patch install\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"-----------------------------------------------\": \"\",\r\n \"start\": \"node lib/executable/server\",\r\n \"test\": \"node bin/test\",\r\n \"------------------------------------------------\": \"\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.3.6\",\r\n \"@nestia/sdk\": \"^2.3.3\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^3.3.1\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^5.40.0\",\r\n \"@typescript-eslint/parser\": \"^5.40.0\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"eslint-plugin-deprecation\": \"^1.4.1\",\r\n \"nestia\": \"^5.0.2\",\r\n \"prettier\": \"^2.7.1\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.0\",\r\n \"typescript\": \"^5.2.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.3.3\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.2.3\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}\r\n"
54
+ },
55
+ {
56
+ "location": "/packages/api",
57
+ "file": ".gitignore",
58
+ "content": "lib/\r\nnode_modules/\r\n\r\nswagger.json"
54
59
  },
55
60
  {
56
61
  "location": "/packages/api",
@@ -60,22 +65,17 @@ exports.TEMPLATE = [
60
65
  {
61
66
  "location": "/packages/api",
62
67
  "file": "package.json",
63
- "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.0.0\",\r\n \"description\": \"API for PROJECT\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.1.5\",\r\n \"typia\": \"^5.1.5\"\r\n }\r\n}\r\n"
68
+ "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.2.2\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.3.3\",\r\n \"typia\": \"^5.2.3\"\r\n }\r\n}"
64
69
  },
65
70
  {
66
71
  "location": "/packages/api",
67
72
  "file": "README.md",
68
- "content": "# SDK for Client Developers\r\n## Outline\r\n[`@ORGANIZATION/PROJECT`](https://github.com/samchon/nestia-template) provides SDK (Software Development Kit) for convenience.\r\n\r\nFor the client developers who are connecting to this backend server, [`@ORGANIZATION/PROJECT`](https://github.com/samchon/nestia-template) provides not API documents like the Swagger, but provides the API interaction library, one of the typical SDK (Software Development Kit) for the convenience.\r\n\r\nWith the SDK, client developers never need to re-define the duplicated API interfaces. Just utilize the provided interfaces and asynchronous functions defined in the SDK. It would be much convenient than any other Rest API solutions.\r\n\r\n```bash\r\nnpm install --save @ORGANIZATION/PROJECT-api\r\n```\r\n\r\n\r\n\r\n\r\n## Usage\r\nImport the `@ORGANIZATION/PROJECT-api` and enjoy the auto-completion.\r\n\r\n```typescript\r\nimport api from \"@ORGINIZATION/PROJECT-api\";\r\n\r\nimport { IBbsArticle } from \"@ORGANIZATION/PROJECT-api/lib/structures/bbs/IBbsArticle\";\r\n\r\nasync function main(): Promise<void>\r\n{\r\n //----\r\n // PREPARATIONS\r\n //----\r\n // CONNECTION INFO\r\n const connection: api.IConnection = {\r\n host: \"http://127.0.0.1:37001\",\r\n };\r\n\r\n const article: IBbsArticle = await api.functional.bbs.articles.store(\r\n connection,\r\n \"general\",\r\n {\r\n writer: \"Robot\",\r\n title: \"Hello, world!\",\r\n body: \"Hello, I'm test automation robot\",\r\n format: \"txt\",\r\n files: [\r\n {\r\n name: \"logo\",\r\n extension: \"png\",\r\n url: \"https://somewhere.com/logo.png\",\r\n },\r\n ],\r\n password: \"1234\",\r\n },\r\n );\r\n typia.assertEquals(stored);\r\n\r\n const page: IPage<IBbsArticle> = await api.functional.bbs.articles.index(\r\n connection,\r\n \"general\",\r\n {\r\n limit: 100,\r\n search: {\r\n writer: \"Robot\"\r\n }\r\n }\r\n );\r\n await typia.assertEquals(page);\r\n}\r\n```"
69
- },
70
- {
71
- "location": "/packages/api",
72
- "file": "swagger.json",
73
- "content": "{\r\n \"openapi\": \"3.0.1\",\r\n \"servers\": [\r\n {\r\n \"url\": \"http://localhost:37001\",\r\n \"description\": \"Local Server\"\r\n }\r\n ],\r\n \"info\": {\r\n \"version\": \"0.1.0\",\r\n \"title\": \"@ORGANIZATION/PROJECT\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"license\": {\r\n \"name\": \"MIT\"\r\n }\r\n },\r\n \"paths\": {\r\n \"/bbs/articles/{section}\": {\r\n \"patch\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target section\",\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"Pagination request info with searching and sorting options\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IRequest\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Paged articles witb summarization\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IPage_lt_IBbsArticle.ISummary_gt_\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"List up entire articles, but paginated and summarized\",\r\n \"description\": \"List up entire articles, but paginated and summarized.\\n\\nThis method is for listing up summarized articles with pagination.\\n\\nIf you want, you can search and sort articles with specific conditions.\",\r\n \"x-nestia-namespace\": \"bbs.articles.index\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Pagination request info with searching and sorting options\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Paged articles witb summarization\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"PATCH\"\r\n },\r\n \"post\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target section\",\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"New article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IStore\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Newly created article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Store a new article\",\r\n \"description\": \"Store a new article.\\n\\nStore a new article and returns its detailed record info.\",\r\n \"x-nestia-namespace\": \"bbs.articles.store\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"New article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Newly created article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"POST\"\r\n }\r\n },\r\n \"/bbs/articles/{section}/{id}\": {\r\n \"get\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target section\",\r\n \"required\": true\r\n },\r\n {\r\n \"name\": \"id\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target articles id\",\r\n \"required\": true\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Detailed article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Get an article with detailed info\",\r\n \"description\": \"Get an article with detailed info.\\n\\nOpen an article with detailed info, increasing reading count.\",\r\n \"x-nestia-namespace\": \"bbs.articles.at\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"id\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target articles id\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Detailed article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"GET\"\r\n },\r\n \"put\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target section\",\r\n \"required\": true\r\n },\r\n {\r\n \"name\": \"id\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"description\": \"Target articles id\",\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"Content to update\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IUpdate\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Newly created content info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISnapshot\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Update article\",\r\n \"description\": \"Update article.\\n\\nWhen updating, this BBS system does not overwrite the content, but accumulate it.\\nTherefore, whenever an article being updated, length of {@link IBbsArticle.snapshots }\\nwould be increased and accumulated.\",\r\n \"x-nestia-namespace\": \"bbs.articles.update\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"id\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target articles id\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Content to update\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Newly created content info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"PUT\"\r\n }\r\n }\r\n },\r\n \"components\": {\r\n \"schemas\": {\r\n \"IBbsArticle.IRequest\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"search\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IRequest.ISearch\"\r\n },\r\n \"sort\": {\r\n \"description\": \"Sorting options.\\n\\nThe plus sign means ASC and minus sign means DESC.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"description\": \"Sorting options.\\n\\nThe plus sign means ASC and minus sign means DESC.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"-writer\",\r\n \"-title\",\r\n \"-created_at\",\r\n \"-updated_at\",\r\n \"+writer\",\r\n \"+title\",\r\n \"+created_at\",\r\n \"+updated_at\"\r\n ]\r\n }\r\n },\r\n \"page\": {\r\n \"description\": \"Page number.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"integer\"\r\n },\r\n \"limit\": {\r\n \"description\": \"Limitation of records per a page.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"integer\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"description\": \"Page request info with some options.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IRequest.ISearch\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"writer\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"description\": \"Searching options.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IPage_lt_IBbsArticle.ISummary_gt_\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"pagination\": {\r\n \"$ref\": \"#/components/schemas/IPage.IPagination\"\r\n },\r\n \"data\": {\r\n \"description\": \"List of records.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISummary\"\r\n }\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"pagination\",\r\n \"data\"\r\n ],\r\n \"description\": \"A page.\\n\\nCollection of records with pagination indformation.\",\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"author\",\r\n \"text\": [\r\n {\r\n \"text\": \"Samchon\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n \"IPage.IPagination\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"current\": {\r\n \"description\": \"Current page number.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"integer\"\r\n },\r\n \"limit\": {\r\n \"description\": \"Limitation of records per a page.\",\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"default\",\r\n \"text\": [\r\n {\r\n \"text\": \"100\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"integer\",\r\n \"default\": 100\r\n },\r\n \"records\": {\r\n \"description\": \"Count of total records in database.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"integer\"\r\n },\r\n \"pages\": {\r\n \"description\": \"Number of total pages.\\n\\nEqual to {@link records } / {@link limit } with ceiling.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"integer\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"current\",\r\n \"limit\",\r\n \"records\",\r\n \"pages\"\r\n ],\r\n \"description\": \"Page information.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.ISummary\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"writer\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"created_at\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"updated_at\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"writer\",\r\n \"title\",\r\n \"created_at\",\r\n \"updated_at\"\r\n ],\r\n \"description\": \"Summarized info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"description\": \"Primary Key.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"section\": {\r\n \"description\": \"Section code.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"writer\": {\r\n \"description\": \"Name of nickname of writer.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"snapshots\": {\r\n \"description\": \"List of snapshot contents.\\n\\nWhenever updating an article, its contents would be accumulated.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISnapshot\"\r\n }\r\n },\r\n \"created_at\": {\r\n \"description\": \"Creation time of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"section\",\r\n \"writer\",\r\n \"snapshots\",\r\n \"created_at\"\r\n ],\r\n \"description\": \"BBS article.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.ISnapshot\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"description\": \"Primary key of individual content.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"created_at\": {\r\n \"description\": \"Creation time of this content.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"created_at\",\r\n \"title\",\r\n \"format\",\r\n \"body\",\r\n \"files\"\r\n ],\r\n \"description\": \"Content info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IAttachmentFile\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"maxLength\": 255,\r\n \"minLength\": 1,\r\n \"nullable\": true\r\n },\r\n \"extension\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"maxLength\": 8,\r\n \"minLength\": 1,\r\n \"nullable\": true\r\n },\r\n \"url\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"url\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"name\",\r\n \"extension\",\r\n \"url\"\r\n ],\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IStore\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"writer\": {\r\n \"description\": \"Name or nickname of the writer.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n },\r\n \"password\": {\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"writer\",\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\",\r\n \"password\"\r\n ],\r\n \"description\": \"Store info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IUpdate\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n },\r\n \"password\": {\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\",\r\n \"password\"\r\n ],\r\n \"description\": \"Update info.\",\r\n \"x-typia-jsDocTags\": []\r\n }\r\n }\r\n }\r\n}"
73
+ "content": "# SDK Library\r\nThis is a SDK library generated by [`nestia`](https://nestia.io).\r\n\r\nWith this SDK library, you can easily and safely interact with backend server.\r\n\r\nJust import and call some API functions like gif image below:\r\n\r\n![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)\r\n\r\n> Left is server code, and right is client code utilizing the SDK\r\n\r\n\r\n\r\n\r\n# What [`Nestia`](https://nestia.io) is:\r\n![Nestia Logo](https://nestia.io/logo.png)\r\n\r\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)\r\n[![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\r\n[![Downloads](https://img.shields.io/npm/dm/nestia.svg)](https://www.npmjs.com/package/nestia)\r\n[![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)\r\n[![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)\r\n\r\n[Nestia](https://nestia.io) is a set of helper libraries for NestJS, supporting below features:\r\n\r\n - `@nestia/core`: super-fast decorators\r\n - `@nestia/sdk`\r\n - SDK generator for clients\r\n - Swagger generator evolved than ever\r\n - Automatic E2E test functions generator\r\n - `nestia`: just CLI (command line interface) tool\r\n\r\n> **Note**\r\n> \r\n> - **Only one line** required, with pure TypeScript type\r\n> - Runtime validator is **20,000x faster** than `class-validator`\r\n> - JSON serialization is **200x faster** than `class-transformer`\r\n> - SDK is similar with [tRPC](https://trpc.io), but much advanced"
74
74
  },
75
75
  {
76
76
  "location": "/packages/api",
77
77
  "file": "tsconfig.json",
78
- "content": "{\r\n \"extends\": \"../../tsconfig.json\",\r\n \"compilerOptions\": {\r\n \"target\": \"ES5\",\r\n \"declaration\": true,\r\n \"outDir\": \"lib\",\r\n \"downlevelIteration\": true,\r\n \"lib\": [\r\n \"DOM\",\r\n \"ES2015\",\r\n ]\r\n },\r\n \"include\": [\"../../src/api\"],\r\n \"exclude\": [\"node_modules\"],\r\n}"
78
+ "content": "{\r\n \"compilerOptions\": {\r\n /* Visit https://aka.ms/tsconfig to read more about this file */\r\n /* Projects */\r\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\r\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\r\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\r\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\r\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\r\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\r\n /* Language and Environment */\r\n \"target\": \"ES5\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\r\n \"lib\": [\r\n \"DOM\",\r\n \"ES2015\"\r\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */// \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\r\n // \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\r\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\r\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\r\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\r\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\r\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\r\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\r\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\r\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\r\n /* Modules */\r\n \"module\": \"commonjs\", /* Specify what module code is generated. */// \"rootDir\": \"./\", /* Specify the root folder within your source files. */\r\n // \"moduleResolution\": \"node\", /* Specify how TypeScript looks up a file from a given module specifier. */\r\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\r\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\r\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\r\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\r\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\r\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\r\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\r\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\r\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\r\n /* JavaScript Support */\r\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\r\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\r\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\r\n /* Emit */\r\n \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */// \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\r\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\r\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */// \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\r\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */// \"removeComments\": true, /* Disable emitting comments. */\r\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\r\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\r\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\r\n \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */// \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\r\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\r\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\r\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\r\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\r\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */// \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\r\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\r\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\r\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\r\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\r\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\r\n /* Interop Constraints */\r\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\r\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\r\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\r\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. *//* Type Checking */\r\n \"strict\": true, /* Enable all strict type-checking options. */// \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\r\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\r\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\r\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\r\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\r\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\r\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\r\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\r\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\r\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\r\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\r\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\r\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\r\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\r\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\r\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\r\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\r\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\r\n /* Completeness */\r\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\r\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\r\n \"plugins\": [\r\n {\r\n \"transform\": \"typia/lib/transform\"\r\n }\r\n ],\r\n \"strictNullChecks\": true\r\n },\r\n \"include\": [\r\n \"../../src/api\"\r\n ]\r\n}"
79
79
  },
80
80
  {
81
81
  "location": "",
@@ -87,30 +87,35 @@ exports.TEMPLATE = [
87
87
  "file": "README.md",
88
88
  "content": "# Nestia Template\r\n## Outline\r\n[![Build Status](https://github.com/samchon/nestia-template/workflows/build/badge.svg)](https://github.com/samchon/nestia-template/actions?query=workflow%3Abuild)\r\n\r\nA template repository for backend projects using [nestia](https://github.com/samchon/nestia).\r\n\r\nYou can create a new project from this boilerplate by running below command:\r\n\r\n```bash\r\nnpx nestia start <directory>\r\n```\r\n\r\nFor reference, this is a minimal boilerplate project concentrating only on [nestia](https://github.com/samchon/nestia) SDK generation. If you wanna much detailed boilerplate project even configured DB and Non-distruptive update system, visit [samchon/backend](https://github.com/samchon/backend) and create a new repository from that.\r\n\r\n\r\n\r\n\r\n## Directories and Files\r\nThis template project has categorized directories like below.\r\n\r\nAs you can see from the below, all of the Backend source files are placed into the [src](src/) directory. When you build the TypeScript source files, compiled files would be placed into the `lib` directory following the [tsconfig.json](tsconfig.json) configuration. Otherwise you build client [SDK](#32-sdk) library for npm publishing and their compiled files would be placed into the [packages](packages) directory.\r\n\r\n - [packages/api/](packages/api): SDK module built by `npm run build:api`\r\n - [src/](src): Backend source directory\r\n - [src/api/](src/api/): Client SDK that would be published to the `@ORGANIZATION/PROJECT-api`\r\n - [**src/api/functional/**](src/api/functional/): API functions generated by the [`nestia`](https://github.com/samchon/nestia)\r\n - [**src/api/structures/**](src/api/structures/): DTO structures\r\n - [src/controllers/](src/controllers/): Controller classes of the Main Program\r\n - [**test/**](test): Test Automation Program\r\n - [nestia.config.ts](nestia.config.ts): Configuration file of [`nestia`](https://github.com/samchon/nestia)\r\n - [package.json](package.json): NPM configuration\r\n - [tsconfig.json](tsconfig.json): TypeScript configuration for the main program\r\n - [tsconfig.api.json](tsconfig.api.json): TypeScript configuration for the SDK generation\r\n\r\n\r\n\r\n\r\n## NPM Run Commands\r\nList of the run commands defined in the [package.json](package.json) are like below:\r\n\r\n - `build`: Build everything\r\n - `build:api`: Build client SDK libray for the client developers\r\n - `build:main`: Build main program (`src` directory)\r\n - `build:sdk`: Build SDK into main program only\r\n - `build:swagger`: Build Swagger Documents\r\n - `build:test` Build test automation program (`test` directory)\r\n - `dev`: Incremental build for development (test program)\r\n - `eslint` & `eslint:fix` & `prettier`: Prettier and ESLint execution\r\n - `start`: Start local NestJS server\r\n - `test`: Run test automation program\r\n\r\n\r\n\r\n\r\n## Specialization\r\nTransform this template project to be yours.\r\n\r\nWhen you've created a new backend project through this template project, you can specialize it to be suitable for you by changing some words. Replace below words through IDE specific function like `Edit > Replace in Files` (*Ctrl + Shift + H*), who've been supported by the VSCode.\r\n\r\n| Before | After\r\n|-----------------|----------------------------------------\r\n| ORGANIZATION | Your account or corporation name\r\n| PROJECT | Your own project name\r\n| AUTHOR | Author name\r\n| https://github.com/samchon/nestia-template | Your repository URL\r\n\r\n\r\n\r\n\r\n## Test Driven Development\r\nWith [nestia](https://github.com/samchon/nestia) helps to accomplish TDD (Test Driven Development). \r\n\r\nJust define DTOs and API controllers' methods (only declarations) first. After the definitions, and build SDK (Software Development Kit) through [nestia](https://github.com/samchon/nestia) (`npm run build:sdk`). After buildling those SDK, develop test automation program using the SDK, following use-case scenarios in the framework of client side.\r\n\r\nDuring the test automation program development, you can find that which API is mis-designed or which requirement analysis is not exact. Development of the main program must be the last step after such validation process during TDD.\r\n\r\n> Visit the [samchon/backend](https://github.com/samchon/backend), then you may find much detailed story about this TDD.\r\n>\r\n> 1. Definitions\r\n> 2. SDK\r\n> 3. Test Automation Program\r\n> 4. Main Program\r\n\r\n```typescript\r\nimport typia from \"typia\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api/lib/index\";\r\nimport { IBbsArticle } from \"@ORGANIZATION/PROJECT-api/lib/structures/bbs/IBbsArticle\";\r\n\r\nimport { ArrayUtil } from \"../../../../utils/ArrayUtil\";\r\nimport { GaffComparator } from \"../../../internal/GaffComparator\";\r\nimport { RandomGenerator } from \"../../../internal/RandomGenerator\";\r\nimport { validate_index_sort } from \"../../../internal/validate_index_sort\";\r\n\r\nexport async function test_api_bbs_article_index_sort(\r\n connection: api.IConnection,\r\n): Promise<void> {\r\n // GENERATE 100 ARTICLES\r\n const section: string = \"general\";\r\n const articles: IBbsArticle[] = await ArrayUtil.asyncRepeat(100, () =>\r\n api.functional.bbs.articles.store(connection, section, {\r\n writer: RandomGenerator.name(),\r\n title: RandomGenerator.paragraph(),\r\n body: RandomGenerator.content(),\r\n format: \"txt\",\r\n files: [],\r\n password: RandomGenerator.alphabets(8),\r\n }),\r\n );\r\n typia.assertEquals(articles);\r\n\r\n // PREPARE VALIDATOR\r\n const validator = validate_index_sort(\"BbsArticleProvider.index()\")(\r\n (input: IBbsArticle.IRequest) =>\r\n api.functional.bbs.articles.index(connection, section, input),\r\n );\r\n\r\n // DO VALIDATE\r\n const components = [\r\n validator(\"created_at\")(GaffComparator.dates((x) => x.created_at)),\r\n validator(\"updated_at\")(GaffComparator.dates((x) => x.updated_at)),\r\n validator(\"title\")(GaffComparator.strings((x) => x.title)),\r\n validator(\"writer\")(GaffComparator.strings((x) => x.writer)),\r\n validator(\r\n \"writer\",\r\n \"title\",\r\n )(GaffComparator.strings((x) => [x.writer, x.title])),\r\n ];\r\n for (const comp of components) {\r\n await comp(\"+\");\r\n await comp(\"-\");\r\n }\r\n}\r\n```"
89
89
  },
90
+ {
91
+ "location": "/src/executable",
92
+ "file": "server.ts",
93
+ "content": "import fs from \"fs\";\r\nimport { randint } from \"tstl/algorithm/random\";\r\nimport { Singleton } from \"tstl/thread/Singleton\";\r\n\r\nimport { MyBackend } from \"../MyBackend\";\r\nimport { MyConfiguration } from \"../MyConfiguration\";\r\nimport { ErrorUtil } from \"../utils/ErrorUtil\";\r\n\r\nconst EXTENSION = __filename.substring(__filename.length - 2);\r\nif (EXTENSION === \"js\") require(\"source-map-support/register\");\r\n\r\nconst directory = new Singleton(async () => {\r\n await mkdir(`${MyConfiguration.ROOT}/assets`);\r\n await mkdir(`${MyConfiguration.ROOT}/assets/logs`);\r\n await mkdir(`${MyConfiguration.ROOT}/assets/logs/errors`);\r\n});\r\n\r\nfunction cipher(val: number): string {\r\n if (val < 10) return \"0\" + val;\r\n else return String(val);\r\n}\r\n\r\nasync function mkdir(path: string): Promise<void> {\r\n try {\r\n await fs.promises.mkdir(path);\r\n } catch {}\r\n}\r\n\r\nasync function handle_error(exp: any): Promise<void> {\r\n try {\r\n const date: Date = new Date();\r\n const fileName: string = `${date.getFullYear()}${cipher(\r\n date.getMonth() + 1,\r\n )}${cipher(date.getDate())}${cipher(date.getHours())}${cipher(\r\n date.getMinutes(),\r\n )}${cipher(date.getSeconds())}.${randint(0, Number.MAX_SAFE_INTEGER)}`;\r\n const content: string = JSON.stringify(ErrorUtil.toJSON(exp), null, 4);\r\n\r\n await directory.get();\r\n await fs.promises.writeFile(\r\n `${MyConfiguration.ROOT}/assets/logs/errors/${fileName}.log`,\r\n content,\r\n \"utf8\",\r\n );\r\n } catch {}\r\n}\r\n\r\nasync function main(): Promise<void> {\r\n // BACKEND SEVER\r\n const backend: MyBackend = new MyBackend();\r\n await backend.open();\r\n\r\n // UNEXPECTED ERRORS\r\n global.process.on(\"uncaughtException\", handle_error);\r\n global.process.on(\"unhandledRejection\", handle_error);\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
94
+ },
90
95
  {
91
96
  "location": "/src",
92
- "file": "Backend.ts",
93
- "content": "import core from \"@nestia/core\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\nimport {\r\n FastifyAdapter,\r\n NestFastifyApplication,\r\n} from \"@nestjs/platform-fastify\";\r\n\r\nimport { Configuration } from \"./Configuration\";\r\n\r\nexport class Backend {\r\n private application_?: NestFastifyApplication;\r\n\r\n public async open(): Promise<void> {\r\n //----\r\n // OPEN THE BACKEND SERVER\r\n //----\r\n // MOUNT CONTROLLERS\r\n this.application_ = await NestFactory.create(\r\n await core.DynamicModule.mount(__dirname + \"/controllers\"),\r\n new FastifyAdapter(),\r\n { logger: false },\r\n );\r\n\r\n // DO OPEN\r\n this.application_.enableCors();\r\n await this.application_.listen(Configuration.API_PORT());\r\n\r\n //----\r\n // POST-PROCESSES\r\n //----\r\n // INFORM TO THE PM2\r\n if (process.send) process.send(\"ready\");\r\n\r\n // WHEN KILL COMMAND COMES\r\n process.on(\"SIGINT\", async () => {\r\n await this.close();\r\n process.exit(0);\r\n });\r\n }\r\n\r\n public async close(): Promise<void> {\r\n if (this.application_ === undefined) return;\r\n\r\n // DO CLOSE\r\n await this.application_.close();\r\n delete this.application_;\r\n }\r\n}\r\n"
97
+ "file": "MyBackend.ts",
98
+ "content": "import { NestFactory } from \"@nestjs/core\";\r\nimport {\r\n FastifyAdapter,\r\n NestFastifyApplication,\r\n} from \"@nestjs/platform-fastify\";\r\n\r\nimport { MyConfiguration } from \"./MyConfiguration\";\r\nimport { MyModule } from \"./MyModule\";\r\n\r\nexport class MyBackend {\r\n private application_?: NestFastifyApplication;\r\n\r\n public async open(): Promise<void> {\r\n //----\r\n // OPEN THE BACKEND SERVER\r\n //----\r\n // MOUNT CONTROLLERS\r\n this.application_ = await NestFactory.create(\r\n await MyModule(),\r\n new FastifyAdapter(),\r\n { logger: false },\r\n );\r\n\r\n // DO OPEN\r\n this.application_.enableCors();\r\n await this.application_.listen(MyConfiguration.API_PORT());\r\n\r\n //----\r\n // POST-PROCESSES\r\n //----\r\n // INFORM TO THE PM2\r\n if (process.send) process.send(\"ready\");\r\n\r\n // WHEN KILL COMMAND COMES\r\n process.on(\"SIGINT\", async () => {\r\n await this.close();\r\n process.exit(0);\r\n });\r\n }\r\n\r\n public async close(): Promise<void> {\r\n if (this.application_ === undefined) return;\r\n\r\n // DO CLOSE\r\n await this.application_.close();\r\n delete this.application_;\r\n }\r\n}\r\n"
94
99
  },
95
100
  {
96
101
  "location": "/src",
97
- "file": "Configuration.ts",
98
- "content": "import path from \"path\";\r\n\r\nexport namespace Configuration {\r\n export const API_PORT = () => 37001;\r\n\r\n export const ROOT = __filename.includes(\r\n path.join(\"bin\", \"src\", \"ShoppingConfiguration\"),\r\n )\r\n ? path.resolve(__dirname + \"/../..\")\r\n : path.resolve(__dirname + \"/..\");\r\n}\r\n"
102
+ "file": "MyConfiguration.ts",
103
+ "content": "import path from \"path\";\r\n\r\nexport namespace MyConfiguration {\r\n export const API_PORT = () => 37001;\r\n\r\n export const ROOT = (() => {\r\n const splitted: string[] = __dirname.split(path.sep);\r\n return splitted.at(-1) === \"src\" && splitted.at(-2) === \"bin\"\r\n ? path.resolve(__dirname + \"/../..\")\r\n : path.resolve(__dirname + \"/..\");\r\n })();\r\n}\r\n"
99
104
  },
100
105
  {
101
- "location": "/src/executable",
102
- "file": "server.ts",
103
- "content": "import fs from \"fs\";\r\nimport { randint } from \"tstl/algorithm/random\";\r\nimport { Singleton } from \"tstl/thread/Singleton\";\r\n\r\nimport { Backend } from \"../Backend\";\r\nimport { Configuration } from \"../Configuration\";\r\nimport { ErrorUtil } from \"../utils/ErrorUtil\";\r\n\r\nconst EXTENSION = __filename.substring(__filename.length - 2);\r\nif (EXTENSION === \"js\") require(\"source-map-support/register\");\r\n\r\nconst directory = new Singleton(async () => {\r\n await mkdir(`${Configuration.ROOT}/assets`);\r\n await mkdir(`${Configuration.ROOT}/assets/logs`);\r\n await mkdir(`${Configuration.ROOT}/assets/logs/errors`);\r\n});\r\n\r\nfunction cipher(val: number): string {\r\n if (val < 10) return \"0\" + val;\r\n else return String(val);\r\n}\r\n\r\nasync function mkdir(path: string): Promise<void> {\r\n try {\r\n await fs.promises.mkdir(path);\r\n } catch {}\r\n}\r\n\r\nasync function handle_error(exp: any): Promise<void> {\r\n try {\r\n const date: Date = new Date();\r\n const fileName: string = `${date.getFullYear()}${cipher(\r\n date.getMonth() + 1,\r\n )}${cipher(date.getDate())}${cipher(date.getHours())}${cipher(\r\n date.getMinutes(),\r\n )}${cipher(date.getSeconds())}.${randint(0, Number.MAX_SAFE_INTEGER)}`;\r\n const content: string = JSON.stringify(ErrorUtil.toJSON(exp), null, 4);\r\n\r\n await directory.get();\r\n await fs.promises.writeFile(\r\n `${Configuration.ROOT}/assets/logs/errors/${fileName}.log`,\r\n content,\r\n \"utf8\",\r\n );\r\n } catch {}\r\n}\r\n\r\nasync function main(): Promise<void> {\r\n // BACKEND SEVER\r\n const backend: Backend = new Backend();\r\n await backend.open();\r\n\r\n // UNEXPECTED ERRORS\r\n global.process.on(\"uncaughtException\", handle_error);\r\n global.process.on(\"unhandledRejection\", handle_error);\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
106
+ "location": "/src",
107
+ "file": "MyGlobal.ts",
108
+ "content": "/* eslint-disable */\r\nexport namespace MyGlobal {\r\n export let testing: boolean = false;\r\n}\r\n"
104
109
  },
105
110
  {
106
111
  "location": "/src",
107
- "file": "SGlobal.ts",
108
- "content": "/* eslint-disable */\r\nexport namespace SGlobal {\r\n export let testing: boolean = false;\r\n}\r\n"
112
+ "file": "MyModule.ts",
113
+ "content": "import { DynamicModule } from \"@nestia/core\";\r\n\r\nexport const MyModule = () => DynamicModule.mount(__dirname + \"/controllers\");\r\n"
109
114
  },
110
115
  {
111
116
  "location": "/src/utils",
112
117
  "file": "ErrorUtil.ts",
113
- "content": "import fs from \"fs\";\r\nimport { randint } from \"tstl/algorithm/random\";\r\nimport { Singleton } from \"tstl/thread/Singleton\";\r\n\r\nimport { Configuration } from \"../Configuration\";\r\n\r\nimport serializeError = require(\"serialize-error\");\r\n\r\nexport namespace ErrorUtil {\r\n export const toJSON = (err: any): object =>\r\n err instanceof Object && err.toJSON instanceof Function\r\n ? err.toJSON()\r\n : serializeError(err);\r\n\r\n export const log =\r\n (prefix: string) =>\r\n async (error: string | object | Error): Promise<void> => {\r\n try {\r\n if (error instanceof Error) error = toJSON(error);\r\n\r\n const date: Date = new Date();\r\n const fileName: string = `${date.getFullYear()}${cipher(\r\n date.getMonth() + 1,\r\n )}${cipher(date.getDate())}${cipher(date.getHours())}${cipher(\r\n date.getMinutes(),\r\n )}${cipher(date.getSeconds())}.${randint(\r\n 0,\r\n Number.MAX_SAFE_INTEGER,\r\n )}`;\r\n const content: string = JSON.stringify(error, null, 4);\r\n\r\n await directory.get();\r\n await fs.promises.writeFile(\r\n `${Configuration.ROOT}/assets/logs/errors/${prefix}_${fileName}.log`,\r\n content,\r\n \"utf8\",\r\n );\r\n } catch {}\r\n };\r\n}\r\n\r\nconst cipher = (val: number): string => String(val).padStart(2, \"0\");\r\nconst directory = new Singleton(async () => {\r\n await mkdir(`${Configuration.ROOT}/assets/logs`);\r\n await mkdir(`${Configuration.ROOT}/assets/logs/errors`);\r\n});\r\nasync function mkdir(path: string): Promise<void> {\r\n try {\r\n await fs.promises.mkdir(path);\r\n } catch {}\r\n}\r\n"
118
+ "content": "import fs from \"fs\";\r\nimport { randint } from \"tstl/algorithm/random\";\r\nimport { Singleton } from \"tstl/thread/Singleton\";\r\n\r\nimport { MyConfiguration } from \"../MyConfiguration\";\r\n\r\nimport serializeError = require(\"serialize-error\");\r\n\r\nexport namespace ErrorUtil {\r\n export const toJSON = (err: any): object =>\r\n err instanceof Object && err.toJSON instanceof Function\r\n ? err.toJSON()\r\n : serializeError(err);\r\n\r\n export const log =\r\n (prefix: string) =>\r\n async (error: string | object | Error): Promise<void> => {\r\n try {\r\n if (error instanceof Error) error = toJSON(error);\r\n\r\n const date: Date = new Date();\r\n const fileName: string = `${date.getFullYear()}${cipher(\r\n date.getMonth() + 1,\r\n )}${cipher(date.getDate())}${cipher(date.getHours())}${cipher(\r\n date.getMinutes(),\r\n )}${cipher(date.getSeconds())}.${randint(\r\n 0,\r\n Number.MAX_SAFE_INTEGER,\r\n )}`;\r\n const content: string = JSON.stringify(error, null, 4);\r\n\r\n await directory.get();\r\n await fs.promises.writeFile(\r\n `${MyConfiguration.ROOT}/assets/logs/errors/${prefix}_${fileName}.log`,\r\n content,\r\n \"utf8\",\r\n );\r\n } catch {}\r\n };\r\n}\r\n\r\nconst cipher = (val: number): string => String(val).padStart(2, \"0\");\r\nconst directory = new Singleton(async () => {\r\n await mkdir(`${MyConfiguration.ROOT}/assets/logs`);\r\n await mkdir(`${MyConfiguration.ROOT}/assets/logs/errors`);\r\n});\r\nasync function mkdir(path: string): Promise<void> {\r\n try {\r\n await fs.promises.mkdir(path);\r\n } catch {}\r\n}\r\n"
114
119
  },
115
120
  {
116
121
  "location": "/src/utils",
@@ -125,7 +130,7 @@ exports.TEMPLATE = [
125
130
  {
126
131
  "location": "/test",
127
132
  "file": "index.ts",
128
- "content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nimport { Backend } from \"../src/Backend\";\r\nimport { Configuration } from \"../src/Configuration\";\r\nimport { SGlobal } from \"../src/SGlobal\";\r\nimport { ArgumentParser } from \"./helpers/ArgumentParser\";\r\n\r\ninterface IOptions {\r\n include?: string[];\r\n exclude?: string[];\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n // command.option(\"--mode <string>\", \"target mode\");\r\n // command.option(\"--reset <true|false>\", \"reset local DB or not\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n\r\n prompt;\r\n\r\n return action(async (options) => {\r\n // if (typeof options.reset === \"string\")\r\n // options.reset = options.reset === \"true\";\r\n // options.mode ??= await prompt.select(\"mode\")(\"Select mode\")([\r\n // \"LOCAL\",\r\n // \"DEV\",\r\n // \"REAL\",\r\n // ]);\r\n // options.reset ??= await prompt.boolean(\"reset\")(\"Reset local DB\");\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nasync function main(): Promise<void> {\r\n const options: IOptions = await getOptions();\r\n SGlobal.testing = true;\r\n\r\n // BACKEND SERVER\r\n const backend: Backend = new Backend();\r\n await backend.open();\r\n\r\n //----\r\n // CLINET CONNECTOR\r\n //----\r\n // DO TEST\r\n const connection: api.IConnection = {\r\n host: `http://127.0.0.1:${await Configuration.API_PORT()}`,\r\n };\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n host: connection.host,\r\n encryption: connection.encryption,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n })(__dirname + \"/features\");\r\n\r\n await backend.close();\r\n\r\n const failures: DynamicExecutor.IReport.IExecution[] =\r\n report.executions.filter((exec) => exec.error !== null);\r\n if (failures.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n for (const f of failures) console.log(f.error);\r\n process.exit(-1);\r\n }\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
133
+ "content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nimport { MyBackend } from \"../src/MyBackend\";\r\nimport { MyConfiguration } from \"../src/MyConfiguration\";\r\nimport { MyGlobal } from \"../src/MyGlobal\";\r\nimport { ArgumentParser } from \"./helpers/ArgumentParser\";\r\n\r\ninterface IOptions {\r\n include?: string[];\r\n exclude?: string[];\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n // command.option(\"--mode <string>\", \"target mode\");\r\n // command.option(\"--reset <true|false>\", \"reset local DB or not\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n\r\n prompt;\r\n\r\n return action(async (options) => {\r\n // if (typeof options.reset === \"string\")\r\n // options.reset = options.reset === \"true\";\r\n // options.mode ??= await prompt.select(\"mode\")(\"Select mode\")([\r\n // \"LOCAL\",\r\n // \"DEV\",\r\n // \"REAL\",\r\n // ]);\r\n // options.reset ??= await prompt.boolean(\"reset\")(\"Reset local DB\");\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nasync function main(): Promise<void> {\r\n const options: IOptions = await getOptions();\r\n MyGlobal.testing = true;\r\n\r\n // BACKEND SERVER\r\n const backend: MyBackend = new MyBackend();\r\n await backend.open();\r\n\r\n //----\r\n // CLINET CONNECTOR\r\n //----\r\n // DO TEST\r\n const connection: api.IConnection = {\r\n host: `http://127.0.0.1:${MyConfiguration.API_PORT()}`,\r\n };\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n host: connection.host,\r\n encryption: connection.encryption,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n })(__dirname + \"/features\");\r\n\r\n await backend.close();\r\n\r\n const failures: DynamicExecutor.IReport.IExecution[] =\r\n report.executions.filter((exec) => exec.error !== null);\r\n if (failures.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n for (const f of failures) console.log(f.error);\r\n process.exit(-1);\r\n }\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
129
134
  },
130
135
  {
131
136
  "location": "/test",
@@ -1 +1 @@
1
- {"version":3,"file":"TEMPLATE.js","sourceRoot":"","sources":["../../src/bundles/TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACpB;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,6lCAA6lC;KAC3mC;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,gBAAgB;QACxB,SAAS,EAAE,qtBAAqtB;KACnuB;IACD;QACI,UAAU,EAAE,oBAAoB;QAChC,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,+lBAA+lB;KAC7mB;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,sFAAsF;KACpG;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,iBAAiB;QACzB,SAAS,EAAE,iIAAiI;KAC/I;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,u6CAAu6C;KACr7C;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,mQAAmQ;KACjR;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,inCAAinC;KAC/nC;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,kBAAkB;QAC1B,SAAS,EAAE,oiBAAoiB;KACljB;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,w0FAAw0F;KACt1F;IACD;QACI,UAAU,E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,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,24FAA24F;KACz5F;IACD;QACI,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,yJAAyJ;KACvK;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,y8XAAy8X;KACv9X;CACJ,CAAA"}
1
+ {"version":3,"file":"TEMPLATE.js","sourceRoot":"","sources":["../../src/bundles/TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACpB;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,6lCAA6lC;KAC3mC;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,gBAAgB;QACxB,SAAS,EAAE,qtBAAqtB;KACnuB;IACD;QACI,UAAU,EAAE,oBAAoB;QAChC,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,+lBAA+lB;KAC7mB;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,sFAAsF;KACpG;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,iBAAiB;QACzB,SAAS,EAAE,iIAAiI;KAC/I;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,u6CAAu6C;KACr7C;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,mQAAmQ;KACjR;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,inCAAinC;KAC/nC;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,kBAAkB;QAC1B,SAAS,EAAE,krBAAkrB;KAChsB;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,w0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ACtY;IACD;QACI,UAAU,EAAE,eAAe;QAC3B,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,wtFAAwtF;KACtuF;IACD;QACI,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,s5FAAs5F;KACp6F;IACD;QACI,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,yJAAyJ;KACvK;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,y8XAAy8X;KACv9X;CACJ,CAAA"}
@@ -12,7 +12,7 @@ var RouteProgrammer;
12
12
  const body = emplaceBodySchema(emplaceReference(swagger)("body"))(route.requestBody);
13
13
  const success = emplaceBodySchema(emplaceReference(swagger)("response"))((_b = (_a = route.responses) === null || _a === void 0 ? void 0 : _a["201"]) !== null && _b !== void 0 ? _b : (_c = route.responses) === null || _c === void 0 ? void 0 : _c["200"]);
14
14
  if (body === false || success === false) {
15
- console.log(`Failed to migrate ${props.method.toUpperCase()} ${props.path}: @nestia/migrate supports only application/json or text/plain format yet.`);
15
+ console.log(`Failed to migrate ${props.method.toUpperCase()} ${props.path}: @nestia/migrate supports only application/json, application/x-www-form-urlencoded or text/plain format yet.`);
16
16
  return null;
17
17
  }
18
18
  else if (SUPPORTED_METHODS.has(props.method.toUpperCase()) === false) {
@@ -214,7 +214,7 @@ var RouteProgrammer;
214
214
  const json = entries.find((e) => meta["x-nestia-encrypted"] === true
215
215
  ? e[0].includes("text/plain") ||
216
216
  e[0].includes("application/json")
217
- : e[0].includes("application/json"));
217
+ : e[0].includes("application/json") || e[0].includes("*/*"));
218
218
  if (json) {
219
219
  const { schema } = json[1];
220
220
  return {
@@ -225,6 +225,16 @@ var RouteProgrammer;
225
225
  "x-nestia-encrypted": meta["x-nestia-encrypted"],
226
226
  };
227
227
  }
228
+ const query = entries.find((e) => e[0].includes("application/x-www-form-urlencoded"));
229
+ if (query) {
230
+ const { schema } = query[1];
231
+ return {
232
+ type: "application/x-www-form-urlencoded",
233
+ schema: isNotObjectLiteral(schema)
234
+ ? schema
235
+ : emplacer(schema),
236
+ };
237
+ }
228
238
  const text = entries.find((e) => e[0].includes("text/plain"));
229
239
  if (text)
230
240
  return { type: "text/plain", schema: { type: "string" } };
@@ -238,7 +248,7 @@ var RouteProgrammer;
238
248
  return { $ref: `#/components/schemas/${name}` };
239
249
  };
240
250
  RouteProgrammer.write = (components) => (references) => (importer) => (route) => {
241
- var _a, _b, _c;
251
+ var _a, _b, _c, _d;
242
252
  const output = route.success
243
253
  ? SchemaProgrammer_1.SchemaProgrammer.write(components)(references)(importer)(route.success.schema)
244
254
  : "void";
@@ -253,14 +263,19 @@ var RouteProgrammer;
253
263
  `@${external("@nestjs/common")("Header")}("Content-Type", "text/plain")`,
254
264
  `@${methoder((str) => external("@nestjs/common")(str))}`,
255
265
  ]
256
- : route.method === "head"
266
+ : ((_c = route.success) === null || _c === void 0 ? void 0 : _c.type) ===
267
+ "application/x-www-form-urlencoded"
257
268
  ? [
258
- `@${external("@nestjs/common")("Head")}${methoder(() => "")}`,
269
+ `@${external("@nestia/core")("TypedQuery")}.${methoder((str) => str)}`,
259
270
  ]
260
- : [
261
- `@${external("@nestia/core")("TypedRoute")}.${methoder((str) => str)}`,
262
- ];
263
- for (const [key, value] of Object.entries((_c = route.exceptions) !== null && _c !== void 0 ? _c : {}))
271
+ : route.method === "head"
272
+ ? [
273
+ `@${external("@nestjs/common")("Head")}${methoder(() => "")}`,
274
+ ]
275
+ : [
276
+ `@${external("@nestia/core")("TypedRoute")}.${methoder((str) => str)}`,
277
+ ];
278
+ for (const [key, value] of Object.entries((_d = route.exceptions) !== null && _d !== void 0 ? _d : {}))
264
279
  decorator.push(`@${external("@nestia/core")("TypedException")}<${SchemaProgrammer_1.SchemaProgrammer.write(components)(references)(importer)(value.schema)}>(${isNaN(Number(key)) ? JSON.stringify(key) : key}, ${JSON.stringify(value.description)})`);
265
280
  const content = [
266
281
  ...(route.description
@@ -294,9 +309,14 @@ var RouteProgrammer;
294
309
  ? [
295
310
  ` @${external("@nestia/core")("TypedBody")}() body: ${SchemaProgrammer_1.SchemaProgrammer.write(components)(references)(importer)(route.body.schema)},`,
296
311
  ]
297
- : [
298
- ` @${external("@nestia/core")("PlainBody")}() body: string,`,
299
- ]
312
+ : route.body.type ===
313
+ "application/x-www-form-urlencoded"
314
+ ? [
315
+ ` @${external("@nestia/core")("TypedQuery")}.Body() body: ${SchemaProgrammer_1.SchemaProgrammer.write(components)(references)(importer)(route.body.schema)},`,
316
+ ]
317
+ : [
318
+ ` @${external("@nestia/core")("PlainBody")}() body: string,`,
319
+ ]
300
320
  : []),
301
321
  `): Promise<${output}> {`,
302
322
  ...route.parameters.map((p) => ` ${StringUtil_1.StringUtil.normalize(p.key)};`),
@@ -1 +1 @@
1
- {"version":3,"file":"RouteProgrammer.js","sourceRoot":"","sources":["../../src/programmers/RouteProgrammer.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAOlD,8DAA2D;AAC3D,oDAAiD;AAEjD,yDAAsD;AAEtD,IAAiB,eAAe,CAwc/B;AAxcD,WAAiB,eAAe;IACf,uBAAO,GAChB,CAAC,OAAiB,EAAE,EAAE,CACtB,CAAC,KAAuC,EAAE,EAAE,CAC5C,CAAC,KAAoB,EAAwB,EAAE;;QAC3C,MAAM,IAAI,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAC7D,KAAK,CAAC,WAAW,CACpB,CAAC;QACF,MAAM,OAAO,GAAG,iBAAiB,CAC7B,gBAAgB,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CACxC,CAAC,MAAA,MAAA,KAAK,CAAC,SAAS,0CAAG,KAAK,CAAC,mCAAI,MAAA,KAAK,CAAC,SAAS,0CAAG,KAAK,CAAC,CAAC,CAAC;QACxD,IAAI,IAAI,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,EAAE;YACrC,O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AAQ;IACR,MAAM;CACT,CAAC,CAAC"}
@@ -20,7 +20,7 @@ export declare namespace IMigrateRoute {
20
20
  description?: string;
21
21
  }
22
22
  interface IBody {
23
- type: "text/plain" | "application/json";
23
+ type: "text/plain" | "application/json" | "application/x-www-form-urlencoded";
24
24
  schema: ISwaggerSchema;
25
25
  "x-nestia-encrypted"?: boolean;
26
26
  }
@@ -37,5 +37,11 @@ export declare namespace ISwaggerRoute {
37
37
  "application/json"?: {
38
38
  schema: ISwaggerSchema;
39
39
  };
40
+ "application/x-www-form-urlencoded"?: {
41
+ schema: ISwaggerSchema;
42
+ };
43
+ "*/*"?: {
44
+ schema: ISwaggerSchema;
45
+ };
40
46
  }
41
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/migrate",
3
- "version": "0.4.2",
3
+ "version": "0.4.5",
4
4
  "description": "Migration program from swagger to NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "homepage": "https://github.com/samchon/nestia#readme",
32
32
  "devDependencies": {
33
- "@nestia/core": "^2.1.5",
34
- "@nestia/fetcher": "^2.1.5",
33
+ "@nestia/core": "^2.3.3",
34
+ "@nestia/fetcher": "^2.3.3",
35
35
  "@trivago/prettier-plugin-sort-imports": "^4.1.1",
36
36
  "@types/node": "^20.3.3",
37
37
  "prettier": "^2.8.8",
@@ -45,7 +45,7 @@
45
45
  "typescript-transform-paths": "^3.4.6"
46
46
  },
47
47
  "dependencies": {
48
- "typia": "^5.1.5"
48
+ "typia": "^5.2.3"
49
49
  },
50
50
  "files": [
51
51
  "lib",
@@ -42,12 +42,17 @@ export const TEMPLATE = [
42
42
  {
43
43
  "location": "",
44
44
  "file": "nestia.config.ts",
45
- "content": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: \"src/controllers\",\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n },\r\n primitive: false,\r\n simulate: true,\r\n e2e: \"test\",\r\n};\r\nexport default NESTIA_CONFIG;\r\n"
45
+ "content": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\n\r\nimport { MyModule } from \"./src/MyModule\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: async () => NestFactory.create(await MyModule()),\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n },\r\n distribute: \"packages/api\",\r\n simulate: true,\r\n e2e: \"test\",\r\n};\r\nexport default NESTIA_CONFIG;\r\n"
46
46
  },
47
47
  {
48
48
  "location": "",
49
49
  "file": "package.json",
50
- "content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"----------------------------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"prepare\": \"ts-patch install\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"-----------------------------------------------\": \"\",\r\n \"start\": \"node lib/executable/server\",\r\n \"test\": \"node bin/test\",\r\n \"------------------------------------------------\": \"\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.3.6\",\r\n \"@nestia/sdk\": \"^2.1.5\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^3.3.1\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^5.40.0\",\r\n \"@typescript-eslint/parser\": \"^5.40.0\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"eslint-plugin-deprecation\": \"^1.4.1\",\r\n \"nestia\": \"^4.5.0\",\r\n \"prettier\": \"^2.7.1\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.0\",\r\n \"typescript\": \"^5.2.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.1.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.1.5\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}\r\n"
50
+ "content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"----------------------------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"prepare\": \"ts-patch install\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"-----------------------------------------------\": \"\",\r\n \"start\": \"node lib/executable/server\",\r\n \"test\": \"node bin/test\",\r\n \"------------------------------------------------\": \"\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.3.6\",\r\n \"@nestia/sdk\": \"^2.3.3\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^3.3.1\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^5.40.0\",\r\n \"@typescript-eslint/parser\": \"^5.40.0\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"eslint-plugin-deprecation\": \"^1.4.1\",\r\n \"nestia\": \"^5.0.2\",\r\n \"prettier\": \"^2.7.1\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.0\",\r\n \"typescript\": \"^5.2.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.3.3\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.2.3\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}\r\n"
51
+ },
52
+ {
53
+ "location": "/packages/api",
54
+ "file": ".gitignore",
55
+ "content": "lib/\r\nnode_modules/\r\n\r\nswagger.json"
51
56
  },
52
57
  {
53
58
  "location": "/packages/api",
@@ -57,22 +62,17 @@ export const TEMPLATE = [
57
62
  {
58
63
  "location": "/packages/api",
59
64
  "file": "package.json",
60
- "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.0.0\",\r\n \"description\": \"API for PROJECT\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.1.5\",\r\n \"typia\": \"^5.1.5\"\r\n }\r\n}\r\n"
65
+ "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.2.2\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.3.3\",\r\n \"typia\": \"^5.2.3\"\r\n }\r\n}"
61
66
  },
62
67
  {
63
68
  "location": "/packages/api",
64
69
  "file": "README.md",
65
- "content": "# SDK for Client Developers\r\n## Outline\r\n[`@ORGANIZATION/PROJECT`](https://github.com/samchon/nestia-template) provides SDK (Software Development Kit) for convenience.\r\n\r\nFor the client developers who are connecting to this backend server, [`@ORGANIZATION/PROJECT`](https://github.com/samchon/nestia-template) provides not API documents like the Swagger, but provides the API interaction library, one of the typical SDK (Software Development Kit) for the convenience.\r\n\r\nWith the SDK, client developers never need to re-define the duplicated API interfaces. Just utilize the provided interfaces and asynchronous functions defined in the SDK. It would be much convenient than any other Rest API solutions.\r\n\r\n```bash\r\nnpm install --save @ORGANIZATION/PROJECT-api\r\n```\r\n\r\n\r\n\r\n\r\n## Usage\r\nImport the `@ORGANIZATION/PROJECT-api` and enjoy the auto-completion.\r\n\r\n```typescript\r\nimport api from \"@ORGINIZATION/PROJECT-api\";\r\n\r\nimport { IBbsArticle } from \"@ORGANIZATION/PROJECT-api/lib/structures/bbs/IBbsArticle\";\r\n\r\nasync function main(): Promise<void>\r\n{\r\n //----\r\n // PREPARATIONS\r\n //----\r\n // CONNECTION INFO\r\n const connection: api.IConnection = {\r\n host: \"http://127.0.0.1:37001\",\r\n };\r\n\r\n const article: IBbsArticle = await api.functional.bbs.articles.store(\r\n connection,\r\n \"general\",\r\n {\r\n writer: \"Robot\",\r\n title: \"Hello, world!\",\r\n body: \"Hello, I'm test automation robot\",\r\n format: \"txt\",\r\n files: [\r\n {\r\n name: \"logo\",\r\n extension: \"png\",\r\n url: \"https://somewhere.com/logo.png\",\r\n },\r\n ],\r\n password: \"1234\",\r\n },\r\n );\r\n typia.assertEquals(stored);\r\n\r\n const page: IPage<IBbsArticle> = await api.functional.bbs.articles.index(\r\n connection,\r\n \"general\",\r\n {\r\n limit: 100,\r\n search: {\r\n writer: \"Robot\"\r\n }\r\n }\r\n );\r\n await typia.assertEquals(page);\r\n}\r\n```"
66
- },
67
- {
68
- "location": "/packages/api",
69
- "file": "swagger.json",
70
- "content": "{\r\n \"openapi\": \"3.0.1\",\r\n \"servers\": [\r\n {\r\n \"url\": \"http://localhost:37001\",\r\n \"description\": \"Local Server\"\r\n }\r\n ],\r\n \"info\": {\r\n \"version\": \"0.1.0\",\r\n \"title\": \"@ORGANIZATION/PROJECT\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"license\": {\r\n \"name\": \"MIT\"\r\n }\r\n },\r\n \"paths\": {\r\n \"/bbs/articles/{section}\": {\r\n \"patch\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target section\",\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"Pagination request info with searching and sorting options\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IRequest\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Paged articles witb summarization\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IPage_lt_IBbsArticle.ISummary_gt_\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"List up entire articles, but paginated and summarized\",\r\n \"description\": \"List up entire articles, but paginated and summarized.\\n\\nThis method is for listing up summarized articles with pagination.\\n\\nIf you want, you can search and sort articles with specific conditions.\",\r\n \"x-nestia-namespace\": \"bbs.articles.index\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Pagination request info with searching and sorting options\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Paged articles witb summarization\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"PATCH\"\r\n },\r\n \"post\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target section\",\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"New article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IStore\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Newly created article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Store a new article\",\r\n \"description\": \"Store a new article.\\n\\nStore a new article and returns its detailed record info.\",\r\n \"x-nestia-namespace\": \"bbs.articles.store\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"New article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Newly created article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"POST\"\r\n }\r\n },\r\n \"/bbs/articles/{section}/{id}\": {\r\n \"get\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target section\",\r\n \"required\": true\r\n },\r\n {\r\n \"name\": \"id\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target articles id\",\r\n \"required\": true\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Detailed article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Get an article with detailed info\",\r\n \"description\": \"Get an article with detailed info.\\n\\nOpen an article with detailed info, increasing reading count.\",\r\n \"x-nestia-namespace\": \"bbs.articles.at\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"id\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target articles id\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Detailed article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"GET\"\r\n },\r\n \"put\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"description\": \"Target section\",\r\n \"required\": true\r\n },\r\n {\r\n \"name\": \"id\",\r\n \"in\": \"path\",\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"description\": \"Target articles id\",\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"Content to update\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IUpdate\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Newly created content info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISnapshot\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Update article\",\r\n \"description\": \"Update article.\\n\\nWhen updating, this BBS system does not overwrite the content, but accumulate it.\\nTherefore, whenever an article being updated, length of {@link IBbsArticle.snapshots }\\nwould be increased and accumulated.\",\r\n \"x-nestia-namespace\": \"bbs.articles.update\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"id\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target articles id\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Content to update\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Newly created content info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"PUT\"\r\n }\r\n }\r\n },\r\n \"components\": {\r\n \"schemas\": {\r\n \"IBbsArticle.IRequest\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"search\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IRequest.ISearch\"\r\n },\r\n \"sort\": {\r\n \"description\": \"Sorting options.\\n\\nThe plus sign means ASC and minus sign means DESC.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"description\": \"Sorting options.\\n\\nThe plus sign means ASC and minus sign means DESC.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"-writer\",\r\n \"-title\",\r\n \"-created_at\",\r\n \"-updated_at\",\r\n \"+writer\",\r\n \"+title\",\r\n \"+created_at\",\r\n \"+updated_at\"\r\n ]\r\n }\r\n },\r\n \"page\": {\r\n \"description\": \"Page number.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"integer\"\r\n },\r\n \"limit\": {\r\n \"description\": \"Limitation of records per a page.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"integer\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"description\": \"Page request info with some options.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IRequest.ISearch\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"writer\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"description\": \"Searching options.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IPage_lt_IBbsArticle.ISummary_gt_\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"pagination\": {\r\n \"$ref\": \"#/components/schemas/IPage.IPagination\"\r\n },\r\n \"data\": {\r\n \"description\": \"List of records.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISummary\"\r\n }\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"pagination\",\r\n \"data\"\r\n ],\r\n \"description\": \"A page.\\n\\nCollection of records with pagination indformation.\",\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"author\",\r\n \"text\": [\r\n {\r\n \"text\": \"Samchon\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n \"IPage.IPagination\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"current\": {\r\n \"description\": \"Current page number.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"integer\"\r\n },\r\n \"limit\": {\r\n \"description\": \"Limitation of records per a page.\",\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"default\",\r\n \"text\": [\r\n {\r\n \"text\": \"100\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"integer\",\r\n \"default\": 100\r\n },\r\n \"records\": {\r\n \"description\": \"Count of total records in database.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"integer\"\r\n },\r\n \"pages\": {\r\n \"description\": \"Number of total pages.\\n\\nEqual to {@link records } / {@link limit } with ceiling.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"integer\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"current\",\r\n \"limit\",\r\n \"records\",\r\n \"pages\"\r\n ],\r\n \"description\": \"Page information.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.ISummary\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"writer\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"created_at\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"updated_at\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"writer\",\r\n \"title\",\r\n \"created_at\",\r\n \"updated_at\"\r\n ],\r\n \"description\": \"Summarized info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"description\": \"Primary Key.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"section\": {\r\n \"description\": \"Section code.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"writer\": {\r\n \"description\": \"Name of nickname of writer.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"snapshots\": {\r\n \"description\": \"List of snapshot contents.\\n\\nWhenever updating an article, its contents would be accumulated.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISnapshot\"\r\n }\r\n },\r\n \"created_at\": {\r\n \"description\": \"Creation time of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"section\",\r\n \"writer\",\r\n \"snapshots\",\r\n \"created_at\"\r\n ],\r\n \"description\": \"BBS article.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.ISnapshot\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"description\": \"Primary key of individual content.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"created_at\": {\r\n \"description\": \"Creation time of this content.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"created_at\",\r\n \"title\",\r\n \"format\",\r\n \"body\",\r\n \"files\"\r\n ],\r\n \"description\": \"Content info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IAttachmentFile\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"maxLength\": 255,\r\n \"minLength\": 1,\r\n \"nullable\": true\r\n },\r\n \"extension\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"maxLength\": 8,\r\n \"minLength\": 1,\r\n \"nullable\": true\r\n },\r\n \"url\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"url\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"name\",\r\n \"extension\",\r\n \"url\"\r\n ],\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IStore\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"writer\": {\r\n \"description\": \"Name or nickname of the writer.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n },\r\n \"password\": {\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"writer\",\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\",\r\n \"password\"\r\n ],\r\n \"description\": \"Store info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IUpdate\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n },\r\n \"password\": {\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\",\r\n \"password\"\r\n ],\r\n \"description\": \"Update info.\",\r\n \"x-typia-jsDocTags\": []\r\n }\r\n }\r\n }\r\n}"
70
+ "content": "# SDK Library\r\nThis is a SDK library generated by [`nestia`](https://nestia.io).\r\n\r\nWith this SDK library, you can easily and safely interact with backend server.\r\n\r\nJust import and call some API functions like gif image below:\r\n\r\n![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)\r\n\r\n> Left is server code, and right is client code utilizing the SDK\r\n\r\n\r\n\r\n\r\n# What [`Nestia`](https://nestia.io) is:\r\n![Nestia Logo](https://nestia.io/logo.png)\r\n\r\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)\r\n[![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\r\n[![Downloads](https://img.shields.io/npm/dm/nestia.svg)](https://www.npmjs.com/package/nestia)\r\n[![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)\r\n[![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)\r\n\r\n[Nestia](https://nestia.io) is a set of helper libraries for NestJS, supporting below features:\r\n\r\n - `@nestia/core`: super-fast decorators\r\n - `@nestia/sdk`\r\n - SDK generator for clients\r\n - Swagger generator evolved than ever\r\n - Automatic E2E test functions generator\r\n - `nestia`: just CLI (command line interface) tool\r\n\r\n> **Note**\r\n> \r\n> - **Only one line** required, with pure TypeScript type\r\n> - Runtime validator is **20,000x faster** than `class-validator`\r\n> - JSON serialization is **200x faster** than `class-transformer`\r\n> - SDK is similar with [tRPC](https://trpc.io), but much advanced"
71
71
  },
72
72
  {
73
73
  "location": "/packages/api",
74
74
  "file": "tsconfig.json",
75
- "content": "{\r\n \"extends\": \"../../tsconfig.json\",\r\n \"compilerOptions\": {\r\n \"target\": \"ES5\",\r\n \"declaration\": true,\r\n \"outDir\": \"lib\",\r\n \"downlevelIteration\": true,\r\n \"lib\": [\r\n \"DOM\",\r\n \"ES2015\",\r\n ]\r\n },\r\n \"include\": [\"../../src/api\"],\r\n \"exclude\": [\"node_modules\"],\r\n}"
75
+ "content": "{\r\n \"compilerOptions\": {\r\n /* Visit https://aka.ms/tsconfig to read more about this file */\r\n /* Projects */\r\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\r\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\r\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\r\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\r\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\r\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\r\n /* Language and Environment */\r\n \"target\": \"ES5\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\r\n \"lib\": [\r\n \"DOM\",\r\n \"ES2015\"\r\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */// \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\r\n // \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\r\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\r\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\r\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\r\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\r\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\r\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\r\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\r\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\r\n /* Modules */\r\n \"module\": \"commonjs\", /* Specify what module code is generated. */// \"rootDir\": \"./\", /* Specify the root folder within your source files. */\r\n // \"moduleResolution\": \"node\", /* Specify how TypeScript looks up a file from a given module specifier. */\r\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\r\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\r\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\r\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\r\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\r\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\r\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\r\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\r\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\r\n /* JavaScript Support */\r\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\r\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\r\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\r\n /* Emit */\r\n \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */// \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\r\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\r\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */// \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\r\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */// \"removeComments\": true, /* Disable emitting comments. */\r\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\r\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\r\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\r\n \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */// \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\r\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\r\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\r\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\r\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\r\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */// \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\r\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\r\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\r\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\r\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\r\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\r\n /* Interop Constraints */\r\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\r\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\r\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\r\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. *//* Type Checking */\r\n \"strict\": true, /* Enable all strict type-checking options. */// \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\r\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\r\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\r\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\r\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\r\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\r\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\r\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\r\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\r\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\r\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\r\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\r\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\r\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\r\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\r\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\r\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\r\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\r\n /* Completeness */\r\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\r\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\r\n \"plugins\": [\r\n {\r\n \"transform\": \"typia/lib/transform\"\r\n }\r\n ],\r\n \"strictNullChecks\": true\r\n },\r\n \"include\": [\r\n \"../../src/api\"\r\n ]\r\n}"
76
76
  },
77
77
  {
78
78
  "location": "",
@@ -84,30 +84,35 @@ export const TEMPLATE = [
84
84
  "file": "README.md",
85
85
  "content": "# Nestia Template\r\n## Outline\r\n[![Build Status](https://github.com/samchon/nestia-template/workflows/build/badge.svg)](https://github.com/samchon/nestia-template/actions?query=workflow%3Abuild)\r\n\r\nA template repository for backend projects using [nestia](https://github.com/samchon/nestia).\r\n\r\nYou can create a new project from this boilerplate by running below command:\r\n\r\n```bash\r\nnpx nestia start <directory>\r\n```\r\n\r\nFor reference, this is a minimal boilerplate project concentrating only on [nestia](https://github.com/samchon/nestia) SDK generation. If you wanna much detailed boilerplate project even configured DB and Non-distruptive update system, visit [samchon/backend](https://github.com/samchon/backend) and create a new repository from that.\r\n\r\n\r\n\r\n\r\n## Directories and Files\r\nThis template project has categorized directories like below.\r\n\r\nAs you can see from the below, all of the Backend source files are placed into the [src](src/) directory. When you build the TypeScript source files, compiled files would be placed into the `lib` directory following the [tsconfig.json](tsconfig.json) configuration. Otherwise you build client [SDK](#32-sdk) library for npm publishing and their compiled files would be placed into the [packages](packages) directory.\r\n\r\n - [packages/api/](packages/api): SDK module built by `npm run build:api`\r\n - [src/](src): Backend source directory\r\n - [src/api/](src/api/): Client SDK that would be published to the `@ORGANIZATION/PROJECT-api`\r\n - [**src/api/functional/**](src/api/functional/): API functions generated by the [`nestia`](https://github.com/samchon/nestia)\r\n - [**src/api/structures/**](src/api/structures/): DTO structures\r\n - [src/controllers/](src/controllers/): Controller classes of the Main Program\r\n - [**test/**](test): Test Automation Program\r\n - [nestia.config.ts](nestia.config.ts): Configuration file of [`nestia`](https://github.com/samchon/nestia)\r\n - [package.json](package.json): NPM configuration\r\n - [tsconfig.json](tsconfig.json): TypeScript configuration for the main program\r\n - [tsconfig.api.json](tsconfig.api.json): TypeScript configuration for the SDK generation\r\n\r\n\r\n\r\n\r\n## NPM Run Commands\r\nList of the run commands defined in the [package.json](package.json) are like below:\r\n\r\n - `build`: Build everything\r\n - `build:api`: Build client SDK libray for the client developers\r\n - `build:main`: Build main program (`src` directory)\r\n - `build:sdk`: Build SDK into main program only\r\n - `build:swagger`: Build Swagger Documents\r\n - `build:test` Build test automation program (`test` directory)\r\n - `dev`: Incremental build for development (test program)\r\n - `eslint` & `eslint:fix` & `prettier`: Prettier and ESLint execution\r\n - `start`: Start local NestJS server\r\n - `test`: Run test automation program\r\n\r\n\r\n\r\n\r\n## Specialization\r\nTransform this template project to be yours.\r\n\r\nWhen you've created a new backend project through this template project, you can specialize it to be suitable for you by changing some words. Replace below words through IDE specific function like `Edit > Replace in Files` (*Ctrl + Shift + H*), who've been supported by the VSCode.\r\n\r\n| Before | After\r\n|-----------------|----------------------------------------\r\n| ORGANIZATION | Your account or corporation name\r\n| PROJECT | Your own project name\r\n| AUTHOR | Author name\r\n| https://github.com/samchon/nestia-template | Your repository URL\r\n\r\n\r\n\r\n\r\n## Test Driven Development\r\nWith [nestia](https://github.com/samchon/nestia) helps to accomplish TDD (Test Driven Development). \r\n\r\nJust define DTOs and API controllers' methods (only declarations) first. After the definitions, and build SDK (Software Development Kit) through [nestia](https://github.com/samchon/nestia) (`npm run build:sdk`). After buildling those SDK, develop test automation program using the SDK, following use-case scenarios in the framework of client side.\r\n\r\nDuring the test automation program development, you can find that which API is mis-designed or which requirement analysis is not exact. Development of the main program must be the last step after such validation process during TDD.\r\n\r\n> Visit the [samchon/backend](https://github.com/samchon/backend), then you may find much detailed story about this TDD.\r\n>\r\n> 1. Definitions\r\n> 2. SDK\r\n> 3. Test Automation Program\r\n> 4. Main Program\r\n\r\n```typescript\r\nimport typia from \"typia\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api/lib/index\";\r\nimport { IBbsArticle } from \"@ORGANIZATION/PROJECT-api/lib/structures/bbs/IBbsArticle\";\r\n\r\nimport { ArrayUtil } from \"../../../../utils/ArrayUtil\";\r\nimport { GaffComparator } from \"../../../internal/GaffComparator\";\r\nimport { RandomGenerator } from \"../../../internal/RandomGenerator\";\r\nimport { validate_index_sort } from \"../../../internal/validate_index_sort\";\r\n\r\nexport async function test_api_bbs_article_index_sort(\r\n connection: api.IConnection,\r\n): Promise<void> {\r\n // GENERATE 100 ARTICLES\r\n const section: string = \"general\";\r\n const articles: IBbsArticle[] = await ArrayUtil.asyncRepeat(100, () =>\r\n api.functional.bbs.articles.store(connection, section, {\r\n writer: RandomGenerator.name(),\r\n title: RandomGenerator.paragraph(),\r\n body: RandomGenerator.content(),\r\n format: \"txt\",\r\n files: [],\r\n password: RandomGenerator.alphabets(8),\r\n }),\r\n );\r\n typia.assertEquals(articles);\r\n\r\n // PREPARE VALIDATOR\r\n const validator = validate_index_sort(\"BbsArticleProvider.index()\")(\r\n (input: IBbsArticle.IRequest) =>\r\n api.functional.bbs.articles.index(connection, section, input),\r\n );\r\n\r\n // DO VALIDATE\r\n const components = [\r\n validator(\"created_at\")(GaffComparator.dates((x) => x.created_at)),\r\n validator(\"updated_at\")(GaffComparator.dates((x) => x.updated_at)),\r\n validator(\"title\")(GaffComparator.strings((x) => x.title)),\r\n validator(\"writer\")(GaffComparator.strings((x) => x.writer)),\r\n validator(\r\n \"writer\",\r\n \"title\",\r\n )(GaffComparator.strings((x) => [x.writer, x.title])),\r\n ];\r\n for (const comp of components) {\r\n await comp(\"+\");\r\n await comp(\"-\");\r\n }\r\n}\r\n```"
86
86
  },
87
+ {
88
+ "location": "/src/executable",
89
+ "file": "server.ts",
90
+ "content": "import fs from \"fs\";\r\nimport { randint } from \"tstl/algorithm/random\";\r\nimport { Singleton } from \"tstl/thread/Singleton\";\r\n\r\nimport { MyBackend } from \"../MyBackend\";\r\nimport { MyConfiguration } from \"../MyConfiguration\";\r\nimport { ErrorUtil } from \"../utils/ErrorUtil\";\r\n\r\nconst EXTENSION = __filename.substring(__filename.length - 2);\r\nif (EXTENSION === \"js\") require(\"source-map-support/register\");\r\n\r\nconst directory = new Singleton(async () => {\r\n await mkdir(`${MyConfiguration.ROOT}/assets`);\r\n await mkdir(`${MyConfiguration.ROOT}/assets/logs`);\r\n await mkdir(`${MyConfiguration.ROOT}/assets/logs/errors`);\r\n});\r\n\r\nfunction cipher(val: number): string {\r\n if (val < 10) return \"0\" + val;\r\n else return String(val);\r\n}\r\n\r\nasync function mkdir(path: string): Promise<void> {\r\n try {\r\n await fs.promises.mkdir(path);\r\n } catch {}\r\n}\r\n\r\nasync function handle_error(exp: any): Promise<void> {\r\n try {\r\n const date: Date = new Date();\r\n const fileName: string = `${date.getFullYear()}${cipher(\r\n date.getMonth() + 1,\r\n )}${cipher(date.getDate())}${cipher(date.getHours())}${cipher(\r\n date.getMinutes(),\r\n )}${cipher(date.getSeconds())}.${randint(0, Number.MAX_SAFE_INTEGER)}`;\r\n const content: string = JSON.stringify(ErrorUtil.toJSON(exp), null, 4);\r\n\r\n await directory.get();\r\n await fs.promises.writeFile(\r\n `${MyConfiguration.ROOT}/assets/logs/errors/${fileName}.log`,\r\n content,\r\n \"utf8\",\r\n );\r\n } catch {}\r\n}\r\n\r\nasync function main(): Promise<void> {\r\n // BACKEND SEVER\r\n const backend: MyBackend = new MyBackend();\r\n await backend.open();\r\n\r\n // UNEXPECTED ERRORS\r\n global.process.on(\"uncaughtException\", handle_error);\r\n global.process.on(\"unhandledRejection\", handle_error);\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
91
+ },
87
92
  {
88
93
  "location": "/src",
89
- "file": "Backend.ts",
90
- "content": "import core from \"@nestia/core\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\nimport {\r\n FastifyAdapter,\r\n NestFastifyApplication,\r\n} from \"@nestjs/platform-fastify\";\r\n\r\nimport { Configuration } from \"./Configuration\";\r\n\r\nexport class Backend {\r\n private application_?: NestFastifyApplication;\r\n\r\n public async open(): Promise<void> {\r\n //----\r\n // OPEN THE BACKEND SERVER\r\n //----\r\n // MOUNT CONTROLLERS\r\n this.application_ = await NestFactory.create(\r\n await core.DynamicModule.mount(__dirname + \"/controllers\"),\r\n new FastifyAdapter(),\r\n { logger: false },\r\n );\r\n\r\n // DO OPEN\r\n this.application_.enableCors();\r\n await this.application_.listen(Configuration.API_PORT());\r\n\r\n //----\r\n // POST-PROCESSES\r\n //----\r\n // INFORM TO THE PM2\r\n if (process.send) process.send(\"ready\");\r\n\r\n // WHEN KILL COMMAND COMES\r\n process.on(\"SIGINT\", async () => {\r\n await this.close();\r\n process.exit(0);\r\n });\r\n }\r\n\r\n public async close(): Promise<void> {\r\n if (this.application_ === undefined) return;\r\n\r\n // DO CLOSE\r\n await this.application_.close();\r\n delete this.application_;\r\n }\r\n}\r\n"
94
+ "file": "MyBackend.ts",
95
+ "content": "import { NestFactory } from \"@nestjs/core\";\r\nimport {\r\n FastifyAdapter,\r\n NestFastifyApplication,\r\n} from \"@nestjs/platform-fastify\";\r\n\r\nimport { MyConfiguration } from \"./MyConfiguration\";\r\nimport { MyModule } from \"./MyModule\";\r\n\r\nexport class MyBackend {\r\n private application_?: NestFastifyApplication;\r\n\r\n public async open(): Promise<void> {\r\n //----\r\n // OPEN THE BACKEND SERVER\r\n //----\r\n // MOUNT CONTROLLERS\r\n this.application_ = await NestFactory.create(\r\n await MyModule(),\r\n new FastifyAdapter(),\r\n { logger: false },\r\n );\r\n\r\n // DO OPEN\r\n this.application_.enableCors();\r\n await this.application_.listen(MyConfiguration.API_PORT());\r\n\r\n //----\r\n // POST-PROCESSES\r\n //----\r\n // INFORM TO THE PM2\r\n if (process.send) process.send(\"ready\");\r\n\r\n // WHEN KILL COMMAND COMES\r\n process.on(\"SIGINT\", async () => {\r\n await this.close();\r\n process.exit(0);\r\n });\r\n }\r\n\r\n public async close(): Promise<void> {\r\n if (this.application_ === undefined) return;\r\n\r\n // DO CLOSE\r\n await this.application_.close();\r\n delete this.application_;\r\n }\r\n}\r\n"
91
96
  },
92
97
  {
93
98
  "location": "/src",
94
- "file": "Configuration.ts",
95
- "content": "import path from \"path\";\r\n\r\nexport namespace Configuration {\r\n export const API_PORT = () => 37001;\r\n\r\n export const ROOT = __filename.includes(\r\n path.join(\"bin\", \"src\", \"ShoppingConfiguration\"),\r\n )\r\n ? path.resolve(__dirname + \"/../..\")\r\n : path.resolve(__dirname + \"/..\");\r\n}\r\n"
99
+ "file": "MyConfiguration.ts",
100
+ "content": "import path from \"path\";\r\n\r\nexport namespace MyConfiguration {\r\n export const API_PORT = () => 37001;\r\n\r\n export const ROOT = (() => {\r\n const splitted: string[] = __dirname.split(path.sep);\r\n return splitted.at(-1) === \"src\" && splitted.at(-2) === \"bin\"\r\n ? path.resolve(__dirname + \"/../..\")\r\n : path.resolve(__dirname + \"/..\");\r\n })();\r\n}\r\n"
96
101
  },
97
102
  {
98
- "location": "/src/executable",
99
- "file": "server.ts",
100
- "content": "import fs from \"fs\";\r\nimport { randint } from \"tstl/algorithm/random\";\r\nimport { Singleton } from \"tstl/thread/Singleton\";\r\n\r\nimport { Backend } from \"../Backend\";\r\nimport { Configuration } from \"../Configuration\";\r\nimport { ErrorUtil } from \"../utils/ErrorUtil\";\r\n\r\nconst EXTENSION = __filename.substring(__filename.length - 2);\r\nif (EXTENSION === \"js\") require(\"source-map-support/register\");\r\n\r\nconst directory = new Singleton(async () => {\r\n await mkdir(`${Configuration.ROOT}/assets`);\r\n await mkdir(`${Configuration.ROOT}/assets/logs`);\r\n await mkdir(`${Configuration.ROOT}/assets/logs/errors`);\r\n});\r\n\r\nfunction cipher(val: number): string {\r\n if (val < 10) return \"0\" + val;\r\n else return String(val);\r\n}\r\n\r\nasync function mkdir(path: string): Promise<void> {\r\n try {\r\n await fs.promises.mkdir(path);\r\n } catch {}\r\n}\r\n\r\nasync function handle_error(exp: any): Promise<void> {\r\n try {\r\n const date: Date = new Date();\r\n const fileName: string = `${date.getFullYear()}${cipher(\r\n date.getMonth() + 1,\r\n )}${cipher(date.getDate())}${cipher(date.getHours())}${cipher(\r\n date.getMinutes(),\r\n )}${cipher(date.getSeconds())}.${randint(0, Number.MAX_SAFE_INTEGER)}`;\r\n const content: string = JSON.stringify(ErrorUtil.toJSON(exp), null, 4);\r\n\r\n await directory.get();\r\n await fs.promises.writeFile(\r\n `${Configuration.ROOT}/assets/logs/errors/${fileName}.log`,\r\n content,\r\n \"utf8\",\r\n );\r\n } catch {}\r\n}\r\n\r\nasync function main(): Promise<void> {\r\n // BACKEND SEVER\r\n const backend: Backend = new Backend();\r\n await backend.open();\r\n\r\n // UNEXPECTED ERRORS\r\n global.process.on(\"uncaughtException\", handle_error);\r\n global.process.on(\"unhandledRejection\", handle_error);\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
103
+ "location": "/src",
104
+ "file": "MyGlobal.ts",
105
+ "content": "/* eslint-disable */\r\nexport namespace MyGlobal {\r\n export let testing: boolean = false;\r\n}\r\n"
101
106
  },
102
107
  {
103
108
  "location": "/src",
104
- "file": "SGlobal.ts",
105
- "content": "/* eslint-disable */\r\nexport namespace SGlobal {\r\n export let testing: boolean = false;\r\n}\r\n"
109
+ "file": "MyModule.ts",
110
+ "content": "import { DynamicModule } from \"@nestia/core\";\r\n\r\nexport const MyModule = () => DynamicModule.mount(__dirname + \"/controllers\");\r\n"
106
111
  },
107
112
  {
108
113
  "location": "/src/utils",
109
114
  "file": "ErrorUtil.ts",
110
- "content": "import fs from \"fs\";\r\nimport { randint } from \"tstl/algorithm/random\";\r\nimport { Singleton } from \"tstl/thread/Singleton\";\r\n\r\nimport { Configuration } from \"../Configuration\";\r\n\r\nimport serializeError = require(\"serialize-error\");\r\n\r\nexport namespace ErrorUtil {\r\n export const toJSON = (err: any): object =>\r\n err instanceof Object && err.toJSON instanceof Function\r\n ? err.toJSON()\r\n : serializeError(err);\r\n\r\n export const log =\r\n (prefix: string) =>\r\n async (error: string | object | Error): Promise<void> => {\r\n try {\r\n if (error instanceof Error) error = toJSON(error);\r\n\r\n const date: Date = new Date();\r\n const fileName: string = `${date.getFullYear()}${cipher(\r\n date.getMonth() + 1,\r\n )}${cipher(date.getDate())}${cipher(date.getHours())}${cipher(\r\n date.getMinutes(),\r\n )}${cipher(date.getSeconds())}.${randint(\r\n 0,\r\n Number.MAX_SAFE_INTEGER,\r\n )}`;\r\n const content: string = JSON.stringify(error, null, 4);\r\n\r\n await directory.get();\r\n await fs.promises.writeFile(\r\n `${Configuration.ROOT}/assets/logs/errors/${prefix}_${fileName}.log`,\r\n content,\r\n \"utf8\",\r\n );\r\n } catch {}\r\n };\r\n}\r\n\r\nconst cipher = (val: number): string => String(val).padStart(2, \"0\");\r\nconst directory = new Singleton(async () => {\r\n await mkdir(`${Configuration.ROOT}/assets/logs`);\r\n await mkdir(`${Configuration.ROOT}/assets/logs/errors`);\r\n});\r\nasync function mkdir(path: string): Promise<void> {\r\n try {\r\n await fs.promises.mkdir(path);\r\n } catch {}\r\n}\r\n"
115
+ "content": "import fs from \"fs\";\r\nimport { randint } from \"tstl/algorithm/random\";\r\nimport { Singleton } from \"tstl/thread/Singleton\";\r\n\r\nimport { MyConfiguration } from \"../MyConfiguration\";\r\n\r\nimport serializeError = require(\"serialize-error\");\r\n\r\nexport namespace ErrorUtil {\r\n export const toJSON = (err: any): object =>\r\n err instanceof Object && err.toJSON instanceof Function\r\n ? err.toJSON()\r\n : serializeError(err);\r\n\r\n export const log =\r\n (prefix: string) =>\r\n async (error: string | object | Error): Promise<void> => {\r\n try {\r\n if (error instanceof Error) error = toJSON(error);\r\n\r\n const date: Date = new Date();\r\n const fileName: string = `${date.getFullYear()}${cipher(\r\n date.getMonth() + 1,\r\n )}${cipher(date.getDate())}${cipher(date.getHours())}${cipher(\r\n date.getMinutes(),\r\n )}${cipher(date.getSeconds())}.${randint(\r\n 0,\r\n Number.MAX_SAFE_INTEGER,\r\n )}`;\r\n const content: string = JSON.stringify(error, null, 4);\r\n\r\n await directory.get();\r\n await fs.promises.writeFile(\r\n `${MyConfiguration.ROOT}/assets/logs/errors/${prefix}_${fileName}.log`,\r\n content,\r\n \"utf8\",\r\n );\r\n } catch {}\r\n };\r\n}\r\n\r\nconst cipher = (val: number): string => String(val).padStart(2, \"0\");\r\nconst directory = new Singleton(async () => {\r\n await mkdir(`${MyConfiguration.ROOT}/assets/logs`);\r\n await mkdir(`${MyConfiguration.ROOT}/assets/logs/errors`);\r\n});\r\nasync function mkdir(path: string): Promise<void> {\r\n try {\r\n await fs.promises.mkdir(path);\r\n } catch {}\r\n}\r\n"
111
116
  },
112
117
  {
113
118
  "location": "/src/utils",
@@ -122,7 +127,7 @@ export const TEMPLATE = [
122
127
  {
123
128
  "location": "/test",
124
129
  "file": "index.ts",
125
- "content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nimport { Backend } from \"../src/Backend\";\r\nimport { Configuration } from \"../src/Configuration\";\r\nimport { SGlobal } from \"../src/SGlobal\";\r\nimport { ArgumentParser } from \"./helpers/ArgumentParser\";\r\n\r\ninterface IOptions {\r\n include?: string[];\r\n exclude?: string[];\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n // command.option(\"--mode <string>\", \"target mode\");\r\n // command.option(\"--reset <true|false>\", \"reset local DB or not\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n\r\n prompt;\r\n\r\n return action(async (options) => {\r\n // if (typeof options.reset === \"string\")\r\n // options.reset = options.reset === \"true\";\r\n // options.mode ??= await prompt.select(\"mode\")(\"Select mode\")([\r\n // \"LOCAL\",\r\n // \"DEV\",\r\n // \"REAL\",\r\n // ]);\r\n // options.reset ??= await prompt.boolean(\"reset\")(\"Reset local DB\");\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nasync function main(): Promise<void> {\r\n const options: IOptions = await getOptions();\r\n SGlobal.testing = true;\r\n\r\n // BACKEND SERVER\r\n const backend: Backend = new Backend();\r\n await backend.open();\r\n\r\n //----\r\n // CLINET CONNECTOR\r\n //----\r\n // DO TEST\r\n const connection: api.IConnection = {\r\n host: `http://127.0.0.1:${await Configuration.API_PORT()}`,\r\n };\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n host: connection.host,\r\n encryption: connection.encryption,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n })(__dirname + \"/features\");\r\n\r\n await backend.close();\r\n\r\n const failures: DynamicExecutor.IReport.IExecution[] =\r\n report.executions.filter((exec) => exec.error !== null);\r\n if (failures.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n for (const f of failures) console.log(f.error);\r\n process.exit(-1);\r\n }\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
130
+ "content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nimport { MyBackend } from \"../src/MyBackend\";\r\nimport { MyConfiguration } from \"../src/MyConfiguration\";\r\nimport { MyGlobal } from \"../src/MyGlobal\";\r\nimport { ArgumentParser } from \"./helpers/ArgumentParser\";\r\n\r\ninterface IOptions {\r\n include?: string[];\r\n exclude?: string[];\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n // command.option(\"--mode <string>\", \"target mode\");\r\n // command.option(\"--reset <true|false>\", \"reset local DB or not\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n\r\n prompt;\r\n\r\n return action(async (options) => {\r\n // if (typeof options.reset === \"string\")\r\n // options.reset = options.reset === \"true\";\r\n // options.mode ??= await prompt.select(\"mode\")(\"Select mode\")([\r\n // \"LOCAL\",\r\n // \"DEV\",\r\n // \"REAL\",\r\n // ]);\r\n // options.reset ??= await prompt.boolean(\"reset\")(\"Reset local DB\");\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nasync function main(): Promise<void> {\r\n const options: IOptions = await getOptions();\r\n MyGlobal.testing = true;\r\n\r\n // BACKEND SERVER\r\n const backend: MyBackend = new MyBackend();\r\n await backend.open();\r\n\r\n //----\r\n // CLINET CONNECTOR\r\n //----\r\n // DO TEST\r\n const connection: api.IConnection = {\r\n host: `http://127.0.0.1:${MyConfiguration.API_PORT()}`,\r\n };\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n host: connection.host,\r\n encryption: connection.encryption,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n })(__dirname + \"/features\");\r\n\r\n await backend.close();\r\n\r\n const failures: DynamicExecutor.IReport.IExecution[] =\r\n report.executions.filter((exec) => exec.error !== null);\r\n if (failures.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n for (const f of failures) console.log(f.error);\r\n process.exit(-1);\r\n }\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
126
131
  },
127
132
  {
128
133
  "location": "/test",
@@ -25,7 +25,7 @@ export namespace RouteProgrammer {
25
25
  console.log(
26
26
  `Failed to migrate ${props.method.toUpperCase()} ${
27
27
  props.path
28
- }: @nestia/migrate supports only application/json or text/plain format yet.`,
28
+ }: @nestia/migrate supports only application/json, application/x-www-form-urlencoded or text/plain format yet.`,
29
29
  );
30
30
  return null;
31
31
  } else if (
@@ -294,9 +294,8 @@ export namespace RouteProgrammer {
294
294
  meta["x-nestia-encrypted"] === true
295
295
  ? e[0].includes("text/plain") ||
296
296
  e[0].includes("application/json")
297
- : e[0].includes("application/json"),
297
+ : e[0].includes("application/json") || e[0].includes("*/*"),
298
298
  );
299
-
300
299
  if (json) {
301
300
  const { schema } = json[1];
302
301
  return {
@@ -308,6 +307,19 @@ export namespace RouteProgrammer {
308
307
  };
309
308
  }
310
309
 
310
+ const query = entries.find((e) =>
311
+ e[0].includes("application/x-www-form-urlencoded"),
312
+ );
313
+ if (query) {
314
+ const { schema } = query[1];
315
+ return {
316
+ type: "application/x-www-form-urlencoded",
317
+ schema: isNotObjectLiteral(schema)
318
+ ? schema
319
+ : emplacer(schema),
320
+ };
321
+ }
322
+
311
323
  const text = entries.find((e) => e[0].includes("text/plain"));
312
324
  if (text) return { type: "text/plain", schema: { type: "string" } };
313
325
  return false;
@@ -356,6 +368,13 @@ export namespace RouteProgrammer {
356
368
  external("@nestjs/common")(str),
357
369
  )}`,
358
370
  ]
371
+ : route.success?.type ===
372
+ "application/x-www-form-urlencoded"
373
+ ? [
374
+ `@${external("@nestia/core")(
375
+ "TypedQuery",
376
+ )}.${methoder((str) => str)}`,
377
+ ]
359
378
  : route.method === "head"
360
379
  ? [
361
380
  `@${external("@nestjs/common")("Head")}${methoder(
@@ -429,6 +448,15 @@ export namespace RouteProgrammer {
429
448
  references,
430
449
  )(importer)(route.body.schema)},`,
431
450
  ]
451
+ : route.body.type ===
452
+ "application/x-www-form-urlencoded"
453
+ ? [
454
+ ` @${external("@nestia/core")(
455
+ "TypedQuery",
456
+ )}.Body() body: ${SchemaProgrammer.write(
457
+ components,
458
+ )(references)(importer)(route.body.schema)},`,
459
+ ]
432
460
  : [
433
461
  ` @${external("@nestia/core")(
434
462
  "PlainBody",
@@ -22,7 +22,10 @@ export namespace IMigrateRoute {
22
22
  description?: string;
23
23
  }
24
24
  export interface IBody {
25
- type: "text/plain" | "application/json";
25
+ type:
26
+ | "text/plain"
27
+ | "application/json"
28
+ | "application/x-www-form-urlencoded";
26
29
  schema: ISwaggerSchema;
27
30
  "x-nestia-encrypted"?: boolean;
28
31
  }
@@ -42,5 +42,11 @@ export namespace ISwaggerRoute {
42
42
  "application/json"?: {
43
43
  schema: ISwaggerSchema;
44
44
  };
45
+ "application/x-www-form-urlencoded"?: {
46
+ schema: ISwaggerSchema;
47
+ };
48
+ "*/*"?: {
49
+ schema: ISwaggerSchema;
50
+ };
45
51
  }
46
52
  }