nestia 2.1.11 → 2.2.0-dev.20220625

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.
Files changed (85) hide show
  1. package/README.md +28 -29
  2. package/lib/IConfiguration.d.ts +5 -6
  3. package/lib/NestiaApplication.d.ts +0 -1
  4. package/lib/NestiaApplication.js +12 -10
  5. package/lib/analyses/ControllerAnalyzer.d.ts +0 -1
  6. package/lib/analyses/ControllerAnalyzer.js +11 -5
  7. package/lib/analyses/GenericAnalyzer.d.ts +0 -1
  8. package/lib/analyses/GenericAnalyzer.js +1 -1
  9. package/lib/analyses/ImportAnalyzer.d.ts +2 -3
  10. package/lib/analyses/ImportAnalyzer.js +15 -5
  11. package/lib/analyses/ReflectAnalyzer.d.ts +0 -1
  12. package/lib/analyses/ReflectAnalyzer.js +19 -12
  13. package/lib/analyses/SourceFinder.d.ts +0 -1
  14. package/lib/executable/internal/CompilerOptions.d.ts +0 -1
  15. package/lib/executable/internal/CompilerOptions.js +3 -6
  16. package/lib/executable/internal/NestiaCommand.d.ts +0 -1
  17. package/lib/executable/internal/NestiaCommand.js +6 -6
  18. package/lib/executable/internal/NestiaConfig.d.ts +0 -1
  19. package/lib/executable/internal/NestiaConfig.js +574 -186
  20. package/lib/executable/internal/nestia.config.getter.d.ts +0 -1
  21. package/lib/executable/nestia.d.ts +0 -1
  22. package/lib/executable/nestia.js +1 -1
  23. package/lib/generates/FileGenerator.d.ts +0 -1
  24. package/lib/generates/FileGenerator.js +29 -24
  25. package/lib/generates/FunctionGenerator.d.ts +0 -1
  26. package/lib/generates/FunctionGenerator.js +69 -56
  27. package/lib/generates/SdkGenerator.d.ts +0 -1
  28. package/lib/generates/SwaggerGenerator.d.ts +0 -1
  29. package/lib/generates/SwaggerGenerator.js +89 -63
  30. package/lib/index.d.ts +0 -1
  31. package/lib/module.d.ts +0 -1
  32. package/lib/structures/IController.d.ts +0 -1
  33. package/lib/structures/IRoute.d.ts +3 -4
  34. package/lib/structures/ISwagger.d.ts +5 -1
  35. package/lib/structures/ITypeTuple.d.ts +5 -0
  36. package/lib/structures/{IMetadata.js → ITypeTuple.js} +1 -1
  37. package/lib/structures/MethodType.d.ts +0 -1
  38. package/lib/structures/MethodType.js +7 -1
  39. package/lib/structures/ParamCategory.d.ts +0 -1
  40. package/lib/structures/TypeEntry.d.ts +0 -1
  41. package/lib/structures/TypeEntry.js +3 -3
  42. package/lib/utils/ArrayUtil.d.ts +0 -1
  43. package/lib/utils/DirectoryUtil.d.ts +0 -1
  44. package/lib/utils/ImportDictionary.d.ts +0 -1
  45. package/lib/utils/ImportDictionary.js +4 -1
  46. package/lib/utils/MapUtil.d.ts +0 -1
  47. package/lib/utils/StringUtil.d.ts +0 -1
  48. package/package.json +11 -5
  49. package/lib/IConfiguration.d.ts.map +0 -1
  50. package/lib/NestiaApplication.d.ts.map +0 -1
  51. package/lib/analyses/ControllerAnalyzer.d.ts.map +0 -1
  52. package/lib/analyses/GenericAnalyzer.d.ts.map +0 -1
  53. package/lib/analyses/ImportAnalyzer.d.ts.map +0 -1
  54. package/lib/analyses/ReflectAnalyzer.d.ts.map +0 -1
  55. package/lib/analyses/SourceFinder.d.ts.map +0 -1
  56. package/lib/executable/internal/CompilerOptions.d.ts.map +0 -1
  57. package/lib/executable/internal/NestiaCommand.d.ts.map +0 -1
  58. package/lib/executable/internal/NestiaConfig.d.ts.map +0 -1
  59. package/lib/executable/internal/nestia.config.getter.d.ts.map +0 -1
  60. package/lib/executable/nestia.d.ts.map +0 -1
  61. package/lib/factories/TypeFactry.d.ts +0 -7
  62. package/lib/factories/TypeFactry.d.ts.map +0 -1
  63. package/lib/factories/TypeFactry.js +0 -76
  64. package/lib/generates/FileGenerator.d.ts.map +0 -1
  65. package/lib/generates/FunctionGenerator.d.ts.map +0 -1
  66. package/lib/generates/SdkGenerator.d.ts.map +0 -1
  67. package/lib/generates/SwaggerGenerator.d.ts.map +0 -1
  68. package/lib/index.d.ts.map +0 -1
  69. package/lib/module.d.ts.map +0 -1
  70. package/lib/structures/IController.d.ts.map +0 -1
  71. package/lib/structures/IMetadata.d.ts +0 -21
  72. package/lib/structures/IMetadata.d.ts.map +0 -1
  73. package/lib/structures/IRoute.d.ts.map +0 -1
  74. package/lib/structures/ISwagger.d.ts.map +0 -1
  75. package/lib/structures/IType.d.ts +0 -6
  76. package/lib/structures/IType.d.ts.map +0 -1
  77. package/lib/structures/IType.js +0 -3
  78. package/lib/structures/MethodType.d.ts.map +0 -1
  79. package/lib/structures/ParamCategory.d.ts.map +0 -1
  80. package/lib/structures/TypeEntry.d.ts.map +0 -1
  81. package/lib/utils/ArrayUtil.d.ts.map +0 -1
  82. package/lib/utils/DirectoryUtil.d.ts.map +0 -1
  83. package/lib/utils/ImportDictionary.d.ts.map +0 -1
  84. package/lib/utils/MapUtil.d.ts.map +0 -1
  85. package/lib/utils/StringUtil.d.ts.map +0 -1
@@ -2,6 +2,7 @@ import { IJsonComponents } from "typescript-json/lib/structures/IJsonComponents"
2
2
  import { IJsonSchema } from "typescript-json/lib/structures/IJsonSchema";
3
3
  export interface ISwagger {
4
4
  openapi: "3.0";
5
+ servers: ISwagger.IServer[];
5
6
  info: ISwagger.IInfo;
6
7
  paths: Record<string, ISwagger.IPath>;
7
8
  components: IJsonComponents;
@@ -36,10 +37,13 @@ export declare namespace ISwagger {
36
37
  description: string;
37
38
  content?: IJsonContent;
38
39
  }>;
40
+ interface IServer {
41
+ url: string;
42
+ description?: string;
43
+ }
39
44
  interface IJsonContent {
40
45
  "application/json": {
41
46
  schema: IJsonSchema;
42
47
  };
43
48
  }
44
49
  }
45
- //# sourceMappingURL=ISwagger.d.ts.map
@@ -0,0 +1,5 @@
1
+ import ts from "typescript";
2
+ export interface ITypeTuple {
3
+ type: ts.Type;
4
+ name: string;
5
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IMetadata.js.map
3
+ //# sourceMappingURL=ITypeTuple.js.map
@@ -2,4 +2,3 @@ export declare type MethodType = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2
2
  export declare namespace MethodType {
3
3
  const VALUES: MethodType[];
4
4
  }
5
- //# sourceMappingURL=MethodType.d.ts.map
@@ -3,6 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MethodType = void 0;
4
4
  var MethodType;
5
5
  (function (MethodType) {
6
- MethodType.VALUES = ["GET", "POST", "PUT", "PATCH", "DELETE"];
6
+ MethodType.VALUES = [
7
+ "GET",
8
+ "POST",
9
+ "PUT",
10
+ "PATCH",
11
+ "DELETE",
12
+ ];
7
13
  })(MethodType = exports.MethodType || (exports.MethodType = {}));
8
14
  //# sourceMappingURL=MethodType.js.map
@@ -1,2 +1 @@
1
1
  export declare type ParamCategory = "param" | "query" | "body";
2
- //# sourceMappingURL=ParamCategory.d.ts.map
@@ -7,4 +7,3 @@ export declare class TypeEntry {
7
7
  equals(obj: TypeEntry): boolean;
8
8
  hashCode(): number;
9
9
  }
10
- //# sourceMappingURL=TypeEntry.d.ts.map
@@ -9,9 +9,9 @@ var TypeEntry = /** @class */ (function () {
9
9
  this.required = required;
10
10
  }
11
11
  TypeEntry.prototype.equals = function (obj) {
12
- return this.type === obj.type
13
- && this.nullable === obj.nullable
14
- && this.required === obj.required;
12
+ return (this.type === obj.type &&
13
+ this.nullable === obj.nullable &&
14
+ this.required === obj.required);
15
15
  };
16
16
  TypeEntry.prototype.hashCode = function () {
17
17
  return (0, hash_1.hash)(this.type, this.nullable, this.required);
@@ -3,4 +3,3 @@ export declare namespace ArrayUtil {
3
3
  function asyncMap<Input, Output>(array: Input[], closure: (input: Input) => Promise<Output>): Promise<Output[]>;
4
4
  function asyncFilter<Input>(array: Input[], closure: (input: Input) => Promise<boolean>): Promise<Input[]>;
5
5
  }
6
- //# sourceMappingURL=ArrayUtil.d.ts.map
@@ -3,4 +3,3 @@ export declare namespace DirectoryUtil {
3
3
  function remake(path: string): Promise<void>;
4
4
  function copy(from: string, to: string): Promise<void>;
5
5
  }
6
- //# sourceMappingURL=DirectoryUtil.d.ts.map
@@ -4,4 +4,3 @@ export declare class ImportDictionary {
4
4
  emplace(file: string, realistic: boolean, instance: string): void;
5
5
  toScript(outDir: string): string;
6
6
  }
7
- //# sourceMappingURL=ImportDictionary.d.ts.map
@@ -42,7 +42,10 @@ var ImportDictionary = /** @class */ (function () {
42
42
  try {
43
43
  for (var _b = __values(this.dict_), _c = _b.next(); !_c.done; _c = _b.next()) {
44
44
  var it = _c.value;
45
- var file = path_1.default.relative(outDir, it.first).split("\\").join("/");
45
+ var file = path_1.default
46
+ .relative(outDir, it.first)
47
+ .split("\\")
48
+ .join("/");
46
49
  var realistic = it.second.first;
47
50
  var instances = it.second.second.toJSON();
48
51
  statements.push("import ".concat(!realistic ? "type " : "", "{ ").concat(instances.join(", "), " } from \"./").concat(file, "\";"));
@@ -1,4 +1,3 @@
1
1
  export declare namespace MapUtil {
2
2
  function take<Key, T>(dict: Map<Key, T>, key: Key, generator: () => T): T;
3
3
  }
4
- //# sourceMappingURL=MapUtil.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export declare namespace StringUtil {
2
2
  function betweens(str: string, start: string, end: string): string[];
3
3
  }
4
- //# sourceMappingURL=StringUtil.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestia",
3
- "version": "2.1.11",
3
+ "version": "2.2.0-dev.20220625",
4
4
  "description": "Automatic SDK and Document generator for the NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -10,6 +10,9 @@
10
10
  "scripts": {
11
11
  "build": "rimraf lib && ttsc",
12
12
  "dev": "npm run build -- --watch",
13
+ "eslint": "eslint src",
14
+ "eslint:fix": "eslint src --fix",
15
+ "prettier": "prettier src --write",
13
16
  "test": "node lib/test"
14
17
  },
15
18
  "repository": {
@@ -41,9 +44,8 @@
41
44
  "tsconfig-paths": "^3.14.1",
42
45
  "tstl": "^2.5.6",
43
46
  "ttypescript": "^1.5.13",
44
- "typescript": "^4.7.2",
45
- "typescript-is": "^0.19.0",
46
- "typescript-json": "^2.1.4",
47
+ "typescript": "^4.7.4",
48
+ "typescript-json": "^3.0.0-dev.20220625",
47
49
  "typescript-transform-paths": "^3.3.1"
48
50
  },
49
51
  "devDependencies": {
@@ -51,7 +53,11 @@
51
53
  "@types/glob": "^7.2.0",
52
54
  "@types/node": "^17.0.23",
53
55
  "@types/reflect-metadata": "^0.1.0",
54
- "nestia-helper": "^2.1.1",
56
+ "@typescript-eslint/eslint-plugin": "^5.26.0",
57
+ "@typescript-eslint/parser": "^5.26.0",
58
+ "eslint": "^8.16.0",
59
+ "nestia-helper": "^2.2.0-dev.20220625",
60
+ "prettier": "^2.6.2",
55
61
  "rimraf": "^3.0.2"
56
62
  }
57
63
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"IConfiguration.d.ts","sourceRoot":"","sources":["../src/IConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAE3B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC;IAEjD;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC;IAErC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC;CACrC;AACD,yBAAiB,cAAc,CAC/B;IACI;;;OAGG;IACH,UAAiB,MAAM;QAEnB;;WAEG;QACH,OAAO,EAAE,MAAM,EAAE,CAAC;QAElB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB;IAED;;OAEG;IACH,UAAiB,QAAQ;QAErB;;;;;;WAMG;QACH,MAAM,EAAE,MAAM,CAAC;KAClB;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NestiaApplication.d.ts","sourceRoot":"","sources":["../src/NestiaApplication.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+C;gBAE5D,MAAM,EAAE,cAAc;IA8B5B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAapB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAgBvB,QAAQ;IAkDtB,OAAO,CAAC,OAAO;YA2BD,eAAe;CAShC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ControllerAnalyzer.d.ts","sourceRoot":"","sources":["../../src/analyses/ControllerAnalyzer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAM9C,yBAAiB,kBAAkB,CACnC;IACI,SAAgB,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,GAAG,MAAM,EAAE,CAc7G;CA+JJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenericAnalyzer.d.ts","sourceRoot":"","sources":["../../src/analyses/GenericAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,yBAAiB,eAAe,CAChC;IACI,KAAY,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAEnD,SAAgB,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,GAAG,UAAU,CAK3F;CAmCJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImportAnalyzer.d.ts","sourceRoot":"","sources":["../../src/analyses/ImportAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,yBAAiB,cAAc,CAC/B;IACI,UAAiB,OAAO;QAEpB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC/B,KAAK,EAAE,MAAM,CAAC;KACjB;IAED,KAAY,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1D,SAAgB,OAAO,CAEf,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,WAAW,EAAE,eAAe,CAAC,UAAU,EACvC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,EAAE,CAAC,IAAI,GACd,KAAK,CAMX;CAiHJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReflectAnalyzer.d.ts","sourceRoot":"","sources":["../../src/analyses/ReflectAnalyzer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAQxD,yBAAiB,eAAe,CAChC;IACI,SAAsB,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAiBxF;CAqNJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SourceFinder.d.ts","sourceRoot":"","sources":["../../src/analyses/SourceFinder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,yBAAiB,YAAY,CAC7B;IACI,SAAsB,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQ1E;CAwDJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CompilerOptions.d.ts","sourceRoot":"","sources":["../../../src/executable/internal/CompilerOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,yBAAiB,eAAe,CAChC;IAeW,MAAM,eAAe;;;;;;;;KAI3B,CAAC;IAEF,SAAgB,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAoCtF;CAaJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NestiaCommand.d.ts","sourceRoot":"","sources":["../../../src/executable/internal/NestiaCommand.ts"],"names":[],"mappings":"AAuBA,yBAAiB,aAAa,CAC9B;IACI,SAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,OAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAa3E;IAED,SAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,OAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB/E;CAqGJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NestiaConfig.d.ts","sourceRoot":"","sources":["../../../src/executable/internal/NestiaConfig.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,yBAAiB,YAAY,CAC7B;IACI,SAAgB,GAAG,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAGpD;CAuCJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"nestia.config.getter.d.ts","sourceRoot":"","sources":["../../../src/executable/internal/nestia.config.getter.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"nestia.d.ts","sourceRoot":"","sources":["../../src/executable/nestia.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import ts from "typescript";
2
- export declare namespace TypeFactory {
3
- function escape(checker: ts.TypeChecker, type: ts.Type): [ts.Type, boolean];
4
- function is_function(node: ts.Node): boolean;
5
- function full_name(checker: ts.TypeChecker, type: ts.Type): string;
6
- }
7
- //# sourceMappingURL=TypeFactry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeFactry.d.ts","sourceRoot":"","sources":["../../src/factories/TypeFactry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,yBAAiB,WAAW,CAC5B;IACI,SAAgB,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAIjF;IAED,SAAgB,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAGlD;IAuCD,SAAgB,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,CAoCxE;CAiBJ"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TypeFactory = void 0;
7
- var typescript_1 = __importDefault(require("typescript"));
8
- var TypeFactory;
9
- (function (TypeFactory) {
10
- function escape(checker, type) {
11
- var converted = get_return_type(checker, type, "toJSON");
12
- return [converted || type, !!converted];
13
- }
14
- TypeFactory.escape = escape;
15
- function is_function(node) {
16
- return get_function(node) !== null;
17
- }
18
- TypeFactory.is_function = is_function;
19
- function get_function(node) {
20
- return typescript_1.default.isFunctionLike(node)
21
- ? node
22
- : (typescript_1.default.isPropertyAssignment(node) || typescript_1.default.isPropertyDeclaration(node))
23
- ? typescript_1.default.isFunctionLike(node.initializer)
24
- ? node.initializer
25
- : null
26
- : null;
27
- }
28
- function get_return_type(checker, type, name) {
29
- // FIND TO-JSON METHOD
30
- var symbol = type.getProperty(name);
31
- if (!symbol)
32
- return null;
33
- else if (!symbol.declarations || !symbol.declarations[0])
34
- return null;
35
- // GET FUNCTION DECLARATION
36
- var declaration = symbol.declarations[0];
37
- var functor = get_function(declaration);
38
- if (functor === null)
39
- return null;
40
- // RETURNS THE RETURN-TYPE
41
- var signature = checker.getSignatureFromDeclaration(functor);
42
- return signature ? signature.getReturnType() : null;
43
- }
44
- function full_name(checker, type) {
45
- // PRIMITIVE
46
- var symbol = type.aliasSymbol || type.getSymbol();
47
- if (symbol === undefined)
48
- return checker.typeToString(type, undefined, undefined);
49
- // UNION OR INTERSECT
50
- else if (type.aliasSymbol === undefined && type.isUnionOrIntersection()) {
51
- var joiner = type.isIntersection() ? " & " : " | ";
52
- return type.types.map(function (child) { return full_name(checker, child); }).join(joiner);
53
- }
54
- //----
55
- // SPECIALIZATION
56
- //----
57
- var name = get_name(symbol);
58
- // CHECK GENERIC
59
- var generic = checker.getTypeArguments(type);
60
- return generic.length
61
- ? name === "Promise"
62
- ? full_name(checker, generic[0])
63
- : "".concat(name, "<").concat(generic.map(function (child) { return full_name(checker, child); }).join(", "), ">")
64
- : name;
65
- }
66
- TypeFactory.full_name = full_name;
67
- function explore_name(name, decl) {
68
- return typescript_1.default.isModuleBlock(decl)
69
- ? explore_name("".concat(decl.parent.name.getText(), ".").concat(name), decl.parent.parent)
70
- : name;
71
- }
72
- function get_name(symbol) {
73
- return explore_name(symbol.escapedName.toString(), symbol.getDeclarations()[0].parent);
74
- }
75
- })(TypeFactory = exports.TypeFactory || (exports.TypeFactory = {}));
76
- //# sourceMappingURL=TypeFactry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileGenerator.d.ts","sourceRoot":"","sources":["../../src/generates/FileGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,yBAAiB,aAAa,CAC9B;IAII,SAAsB,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAYzF;CAyHJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FunctionGenerator.d.ts","sourceRoot":"","sources":["../../src/generates/FunctionGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,yBAAiB,iBAAiB,CAClC;IACI,SAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAStE;CAqNJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SdkGenerator.d.ts","sourceRoot":"","sources":["../../src/generates/SdkGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,yBAAiB,YAAY,CAC7B;IACI,SAAsB,QAAQ,CAEtB,QAAQ,EAAE,EAAE,CAAC,WAAW,EACxB,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CA0BnB;IAEM,MAAM,WAAW,QAAiD,CAAC;CAC7E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwaggerGenerator.d.ts","sourceRoot":"","sources":["../../src/generates/SwaggerGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAU5B,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,CA0CnB;CAgOJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,eAAe,MAAM,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IController.d.ts","sourceRoot":"","sources":["../../src/structures/IController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,WAAW;IAExB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC;CACtC;AAED,yBAAiB,WAAW,CAC5B;IACI,UAAiB,SAAS;QAEtB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QAEnB,UAAU,EAAE,UAAU,EAAE,CAAC;KAC5B;IAED,UAAiB,UAAU;QAEvB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,QAAQ,EAAE,aAAa,CAAC;QACxB,SAAS,EAAE,OAAO,CAAC;KACtB;CACJ"}
@@ -1,21 +0,0 @@
1
- export interface IMetadata {
2
- atomics: Set<string>;
3
- arraies: Map<string, IMetadata | null>;
4
- objects: Set<string>;
5
- nullable: boolean;
6
- required: boolean;
7
- description?: string;
8
- }
9
- export declare namespace IMetadata {
10
- interface IObject {
11
- description: string;
12
- properties: Record<string, IMetadata | null>;
13
- nullable: boolean;
14
- }
15
- interface IApplication {
16
- metadata: IMetadata;
17
- storage: IStorage;
18
- }
19
- type IStorage = Record<string, IMetadata.IObject>;
20
- }
21
- //# sourceMappingURL=IMetadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMetadata.d.ts","sourceRoot":"","sources":["../../src/structures/IMetadata.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IAEtB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,GAAC,IAAI,CAAC,CAAC;IACrC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,yBAAiB,SAAS,CAC1B;IACI,UAAiB,OAAO;QAEpB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;QAC7C,QAAQ,EAAE,OAAO,CAAC;KACrB;IAED,UAAiB,YAAY;QAEzB,QAAQ,EAAE,SAAS,CAAC;QACpB,OAAO,EAAE,QAAQ,CAAC;KACrB;IACD,KAAY,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC5D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRoute.d.ts","sourceRoot":"","sources":["../../src/structures/IRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,MAAM;IAEnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IAEnB,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;IAChC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC;IAEd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,EAAE,CAAC,iBAAiB,EAAE,CAAC;IACjC,IAAI,EAAE,EAAE,CAAC,YAAY,EAAE,CAAC;CAC3B;AAED,yBAAiB,MAAM,CACvB;IACI,UAAiB,UAAU;QAEvB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,QAAQ,EAAE,aAAa,CAAC;QACxB,SAAS,EAAE,OAAO,CAAC;QACnB,IAAI,EAAE,KAAK,CAAC;KACf;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ISwagger.d.ts","sourceRoot":"","sources":["../../src/structures/ISwagger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAEzE,MAAM,WAAW,QAAQ;IAErB,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtC,UAAU,EAAE,eAAe,CAAC;CAC/B;AACD,yBAAiB,QAAQ,CACzB;IACI,KAAY,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,UAAiB,MAAM;QAEnB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,UAAU,EAAE,UAAU,EAAE,CAAC;QACzB,SAAS,EAAE,aAAa,CAAC;QACzB,WAAW,CAAC,EAAE,YAAY,CAAC;QAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;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,WAAW,CAAC;QACpB,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;IAEH,UAAiB,YAAY;QAEzB,kBAAkB,EAAE;YAChB,MAAM,EAAE,WAAW,CAAC;SACvB,CAAC;KACL;CAEJ"}
@@ -1,6 +0,0 @@
1
- import ts from "typescript";
2
- export interface IType {
3
- metadata: ts.Type;
4
- escapedText: string;
5
- }
6
- //# sourceMappingURL=IType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IType.d.ts","sourceRoot":"","sources":["../../src/structures/IType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,WAAW,KAAK;IAElB,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACvB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MethodType.d.ts","sourceRoot":"","sources":["../../src/structures/MethodType.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE,yBAAiB,UAAU,CAC3B;IACW,MAAM,MAAM,EAAE,UAAU,EAA8C,CAAC;CACjF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParamCategory.d.ts","sourceRoot":"","sources":["../../src/structures/ParamCategory.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeEntry.d.ts","sourceRoot":"","sources":["../../src/structures/TypeEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,qBAAa,SAAS;aAIM,IAAI,EAAE,EAAE,CAAC,IAAI;aACb,QAAQ,EAAE,OAAO;aACjB,QAAQ,EAAE,OAAO;gBAFjB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO;IAKlC,MAAM,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO;IAO/B,QAAQ,IAAI,MAAM;CAI5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArrayUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ArrayUtil.ts"],"names":[],"mappings":"AAAA,yBAAiB,SAAS,CAC1B;IACI,SAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,GAAG,OAAO,CAGzD;IAED,SAAsB,QAAQ,CAAC,KAAK,EAAE,MAAM,EACvC,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAMlF;IAED,SAAsB,WAAW,CAAC,KAAK,EAClC,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAOlF;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DirectoryUtil.d.ts","sourceRoot":"","sources":["../../src/utils/DirectoryUtil.ts"],"names":[],"mappings":"AAGA,yBAAiB,aAAa,CAC9B;IACI,SAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxD;IAED,SAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxD;IAED,SAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlE;CAuBJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImportDictionary.d.ts","sourceRoot":"","sources":["../../src/utils/ImportDictionary.ts"],"names":[],"mappings":"AAMA,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkE;IAEjF,KAAK,IAAI,OAAO;IAKhB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAiBjE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CAa1C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MapUtil.d.ts","sourceRoot":"","sources":["../../src/utils/MapUtil.ts"],"names":[],"mappings":"AAAA,yBAAiB,OAAO,CACxB;IACI,SAAgB,IAAI,CAAC,GAAG,EAAE,CAAC,EACtB,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,CASvD;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../../src/utils/StringUtil.ts"],"names":[],"mappings":"AAAA,yBAAiB,UAAU,CAC3B;IACI,SAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAM1E;CACJ"}