nestia 2.1.0-dev.20220501 → 2.1.0-dev.20220502

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.
File without changes
@@ -183,7 +183,7 @@ var FunctionGenerator;
183
183
  + " response: ".concat(route.encrypted, ",\n")
184
184
  + " };\n"
185
185
  + "\n"
186
- + " export function path(".concat(parameters.map(function (param) { return "".concat(param.name, ": ").concat(param.type); }).join(", "), "): string\n")
186
+ + " export function path(".concat(parameters.map(function (param) { return "".concat(param.name, ": ").concat(param.type.escapedText); }).join(", "), "): string\n")
187
187
  + " {\n"
188
188
  + " return ".concat(path, ";\n")
189
189
  + " }\n"
@@ -1 +1 @@
1
- {"version":3,"file":"SwaggerGenerator.d.ts","sourceRoot":"","sources":["../../src/generates/SwaggerGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAK5B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAK9C,yBAAiB,gBAAgB,CACjC;IACI,SAAsB,QAAQ,CAEtB,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,MAAM,EAAE,cAAc,CAAC,QAAQ,EAC/B,SAAS,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAyCnB;CA2JJ"}
1
+ {"version":3,"file":"SwaggerGenerator.d.ts","sourceRoot":"","sources":["../../src/generates/SwaggerGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAK5B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAK9C,yBAAiB,gBAAgB,CACjC;IACI,SAAsB,QAAQ,CAEtB,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,MAAM,EAAE,cAAc,CAAC,QAAQ,EAC/B,SAAS,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAsCnB;CAoKJ"}
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -129,8 +118,7 @@ var SwaggerGenerator;
129
118
  }
130
119
  finally { if (e_2) throw e_2.error; }
131
120
  }
132
- swagger.components = __assign({}, SchemaFactory_1.SchemaFactory.components(collection.storage()));
133
- swagger.nestia = "Generated by Nestia - https://github.com/samchon/nestia";
121
+ swagger.components = SchemaFactory_1.SchemaFactory.components(collection.storage());
134
122
  return [4 /*yield*/, fs_1.default.promises.writeFile(location, JSON.stringify(swagger, null, 2), "utf8")];
135
123
  case 2:
136
124
  _d.sent();
@@ -155,7 +143,10 @@ var SwaggerGenerator;
155
143
  case 2:
156
144
  _a = {
157
145
  openapi: "3.0",
158
- nestia: "",
146
+ info: {
147
+ version: "0.1.0",
148
+ title: "Generated by nestia - https://github.com/samchon/nestia"
149
+ },
159
150
  paths: {},
160
151
  components: {}
161
152
  };
@@ -197,7 +188,8 @@ var SwaggerGenerator;
197
188
  requestBody: bodyParam
198
189
  ? generate_request_body(checker, collection, route, bodyParam)
199
190
  : undefined,
200
- responses: generate_response_body(checker, collection, route)
191
+ responses: generate_response_body(checker, collection, route),
192
+ description: ""
201
193
  };
202
194
  }
203
195
  function generate_parameter(checker, collection, route, parameter) {
@@ -247,9 +239,10 @@ var SwaggerGenerator;
247
239
  return c.kind === kind &&
248
240
  (c.text === text || !text);
249
241
  });
250
- return index !== -1
242
+ var description = index !== -1
251
243
  ? (_a = comments[index + 2]) === null || _a === void 0 ? void 0 : _a.text
252
244
  : undefined;
245
+ return description || "";
253
246
  }
254
247
  function generate_schema(checker, collection, type) {
255
248
  var entity = MetadataFactory_1.MetadataFactory.generate(checker, type, collection);
@@ -1,32 +1,36 @@
1
1
  export interface ISwagger {
2
2
  openapi: "3.0";
3
- nestia: string;
3
+ info: ISwagger.IInfo;
4
4
  paths: Record<string, ISwagger.IPath>;
5
5
  components: Record<string, object>;
6
6
  }
7
7
  export declare namespace ISwagger {
8
8
  type IPath = Record<string, IRoute>;
9
9
  interface IRoute {
10
- description?: string;
10
+ description: string;
11
11
  tags: string[];
12
12
  parameters: IParameter[];
13
13
  responses: IResponseBody;
14
14
  requestBody?: IRequestBody;
15
15
  }
16
+ interface IInfo {
17
+ version: string;
18
+ title: string;
19
+ }
16
20
  interface IParameter {
17
21
  name: string;
18
22
  in: string;
19
23
  schema: string;
20
24
  required: true;
21
- description?: string;
25
+ description: string;
22
26
  }
23
27
  interface IRequestBody {
24
- description?: string;
28
+ description: string;
25
29
  content: IJsonContent;
26
30
  required: true;
27
31
  }
28
32
  type IResponseBody = Record<string, {
29
- description?: string;
33
+ description: string;
30
34
  content?: IJsonContent;
31
35
  }>;
32
36
  interface IJsonContent {
@@ -1 +1 @@
1
- {"version":3,"file":"ISwagger.d.ts","sourceRoot":"","sources":["../../src/structures/ISwagger.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IAErB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AACD,yBAAiB,QAAQ,CACzB;IACI,KAAY,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;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,CAAC;QACzB,SAAS,EAAE,aAAa,CAAC;QACzB,WAAW,CAAC,EAAE,YAAY,CAAC;KAC9B;IAED,UAAiB,KAAK;QAElB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACjB;IACD,UAAiB,UAAU;QAEvB,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,IAAI,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACvB;IACD,UAAiB,YAAY;QAEzB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,YAAY,CAAC;QACtB,QAAQ,EAAE,IAAI,CAAC;KAClB;IACD,KAAY,aAAa,GAAG,MAAM,CAAC,MAAM,EACzC;QACI,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,YAAY,CAAC;KAC1B,CAAC,CAAC;IACH,UAAiB,YAAY;QAEzB,kBAAkB,EAAE,MAAM,CAAC;KAC9B;CAEJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestia",
3
- "version": "2.1.0-dev.20220501",
3
+ "version": "2.1.0-dev.20220502",
4
4
  "description": "Automatic SDK and Document generator for the NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "ttypescript": "^1.5.13",
43
43
  "typescript": "^4.6.3",
44
44
  "typescript-is": "^0.19.0",
45
- "typescript-json": "^2.0.7",
45
+ "typescript-json": "^2.0.9-dev.20220502",
46
46
  "typescript-transform-paths": "^3.3.1"
47
47
  },
48
48
  "devDependencies": {