@elsikora/nestjs-crud-automator 1.2.0 → 1.2.1

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 (179) hide show
  1. package/dist/class/api/base-service.class.d.ts +5 -5
  2. package/dist/class/api/base-service.class.js +19 -10
  3. package/dist/class/api/base-service.class.js.map +1 -1
  4. package/dist/class/api/index.d.ts +0 -1
  5. package/dist/class/api/index.js +0 -1
  6. package/dist/class/api/index.js.map +1 -1
  7. package/dist/constant/decorator/api/controller.constant.d.ts +1 -1
  8. package/dist/constant/decorator/api/controller.constant.js +2 -2
  9. package/dist/constant/decorator/api/controller.constant.js.map +1 -1
  10. package/dist/constant/decorator/api/function.constant.d.ts +1 -1
  11. package/dist/constant/decorator/api/function.constant.js +2 -2
  12. package/dist/constant/decorator/api/function.constant.js.map +1 -1
  13. package/dist/constant/decorator/api/property-describe.constant.d.ts +1 -1
  14. package/dist/constant/decorator/api/property-describe.constant.js +2 -2
  15. package/dist/constant/decorator/api/property-describe.constant.js.map +1 -1
  16. package/dist/constant/factory/dto/get-list-query.constant.d.ts +1 -2
  17. package/dist/constant/factory/dto/get-list-query.constant.js +2 -2
  18. package/dist/constant/factory/dto/get-list-query.constant.js.map +1 -1
  19. package/dist/constant/interface/api/filter.constant.d.ts +1 -1
  20. package/dist/constant/interface/api/filter.constant.js +2 -2
  21. package/dist/constant/interface/api/filter.constant.js.map +1 -1
  22. package/dist/constant/interface/api/index.d.ts +1 -0
  23. package/dist/constant/interface/api/index.js +1 -0
  24. package/dist/constant/interface/api/index.js.map +1 -1
  25. package/dist/constant/interface/api/property/string.constant.d.ts +1 -1
  26. package/dist/constant/interface/api/property/string.constant.js +2 -2
  27. package/dist/constant/interface/api/property/string.constant.js.map +1 -1
  28. package/dist/constant/interface/api/property/wallet.constant.d.ts +1 -1
  29. package/dist/constant/interface/api/property/wallet.constant.js +2 -2
  30. package/dist/constant/interface/api/property/wallet.constant.js.map +1 -1
  31. package/dist/decorator/api/function/create/executor-properties.type.d.ts +8 -0
  32. package/dist/{type/decorator/api/property/describe-properties.type.js → decorator/api/function/create/executor-properties.type.js} +1 -1
  33. package/dist/decorator/api/function/create/executor-properties.type.js.map +1 -0
  34. package/dist/decorator/api/function/create/index.d.ts +1 -0
  35. package/dist/decorator/api/function/create/index.js +18 -0
  36. package/dist/decorator/api/function/create/index.js.map +1 -0
  37. package/dist/decorator/api/function/create.decorator.d.ts +2 -4
  38. package/dist/decorator/api/function/create.decorator.js +16 -14
  39. package/dist/decorator/api/function/create.decorator.js.map +1 -1
  40. package/dist/decorator/api/function/decorator.d.ts +4 -3
  41. package/dist/decorator/api/function/decorator.js +17 -14
  42. package/dist/decorator/api/function/decorator.js.map +1 -1
  43. package/dist/decorator/api/function/delete.decorator.d.ts +3 -3
  44. package/dist/decorator/api/function/delete.decorator.js +2 -2
  45. package/dist/decorator/api/function/delete.decorator.js.map +1 -1
  46. package/dist/decorator/api/function/get-list.decorator.d.ts +3 -3
  47. package/dist/decorator/api/function/get-list.decorator.js +4 -4
  48. package/dist/decorator/api/function/get-list.decorator.js.map +1 -1
  49. package/dist/decorator/api/function/get.decorator.d.ts +3 -3
  50. package/dist/decorator/api/function/get.decorator.js +3 -4
  51. package/dist/decorator/api/function/get.decorator.js.map +1 -1
  52. package/dist/decorator/api/function/index.d.ts +1 -0
  53. package/dist/decorator/api/function/index.js +1 -0
  54. package/dist/decorator/api/function/index.js.map +1 -1
  55. package/dist/decorator/api/function/update.decorator.d.ts +3 -3
  56. package/dist/decorator/api/function/update.decorator.js +6 -11
  57. package/dist/decorator/api/function/update.decorator.js.map +1 -1
  58. package/dist/decorator/api/property/describe.decorator.js +1 -1
  59. package/dist/decorator/api/property/describe.decorator.js.map +1 -1
  60. package/dist/decorator/api/property/string.decorator.js +4 -4
  61. package/dist/decorator/api/property/string.decorator.js.map +1 -1
  62. package/dist/decorator/api/property/wallet.decorator.js +3 -3
  63. package/dist/decorator/api/property/wallet.decorator.js.map +1 -1
  64. package/dist/decorator/api/route/decorator.js.map +1 -1
  65. package/dist/decorator/api/service.decorator.d.ts +4 -4
  66. package/dist/decorator/api/service.decorator.js +7 -32
  67. package/dist/decorator/api/service.decorator.js.map +1 -1
  68. package/dist/enum/decorator/api/dto-type.enum.d.ts +3 -3
  69. package/dist/enum/decorator/api/dto-type.enum.js +2 -2
  70. package/dist/enum/decorator/api/dto-type.enum.js.map +1 -1
  71. package/dist/factory/api/controller.factory.d.ts +1 -1
  72. package/dist/factory/api/controller.factory.js +15 -15
  73. package/dist/factory/api/controller.factory.js.map +1 -1
  74. package/dist/interface/decorator/api/controller-properties.interface.d.ts +1 -1
  75. package/dist/interface/decorator/api/controller-properties.interface.js.map +1 -1
  76. package/dist/interface/decorator/api/function/create-properties.interface.d.ts +4 -0
  77. package/dist/interface/decorator/api/function/create-properties.interface.js +3 -0
  78. package/dist/interface/decorator/api/function/create-properties.interface.js.map +1 -0
  79. package/dist/interface/decorator/api/property/base-properties.interface.d.ts +1 -1
  80. package/dist/interface/decorator/api/property/base-properties.interface.js.map +1 -1
  81. package/dist/interface/utility/get-entity-columns-properties.interface.d.ts +5 -0
  82. package/dist/interface/utility/get-entity-columns-properties.interface.js +3 -0
  83. package/dist/interface/utility/get-entity-columns-properties.interface.js.map +1 -0
  84. package/dist/tsconfig.build.tsbuildinfo +1 -1
  85. package/dist/type/decorator/api/property/describe/array/index.d.ts +2 -0
  86. package/dist/type/decorator/api/property/describe/array/index.js +19 -0
  87. package/dist/type/decorator/api/property/describe/array/index.js.map +1 -0
  88. package/dist/type/decorator/api/property/describe/array/optional-properties.type.d.ts +3 -0
  89. package/dist/type/decorator/api/property/describe/array/optional-properties.type.js +3 -0
  90. package/dist/type/decorator/api/property/describe/array/optional-properties.type.js.map +1 -0
  91. package/dist/type/decorator/api/property/describe/array/required-properties.type.d.ts +6 -0
  92. package/dist/type/decorator/api/property/describe/array/required-properties.type.js +3 -0
  93. package/dist/type/decorator/api/property/describe/array/required-properties.type.js.map +1 -0
  94. package/dist/type/decorator/api/property/describe/base-properties.type.d.ts +7 -0
  95. package/dist/type/decorator/api/property/describe/base-properties.type.js +3 -0
  96. package/dist/type/decorator/api/property/describe/base-properties.type.js.map +1 -0
  97. package/dist/type/decorator/api/property/describe/boolean-properties.type.d.ts +7 -0
  98. package/dist/type/decorator/api/property/describe/boolean-properties.type.js +3 -0
  99. package/dist/type/decorator/api/property/describe/boolean-properties.type.js.map +1 -0
  100. package/dist/type/decorator/api/property/describe/date-properties.type.d.ts +7 -0
  101. package/dist/type/decorator/api/property/describe/date-properties.type.js +3 -0
  102. package/dist/type/decorator/api/property/describe/date-properties.type.js.map +1 -0
  103. package/dist/type/decorator/api/property/describe/dto/body-properties.type.d.ts +5 -0
  104. package/dist/type/decorator/api/property/describe/dto/body-properties.type.js +3 -0
  105. package/dist/type/decorator/api/property/describe/dto/body-properties.type.js.map +1 -0
  106. package/dist/type/decorator/api/property/describe/dto/index.d.ts +5 -0
  107. package/dist/type/decorator/api/property/describe/dto/index.js +22 -0
  108. package/dist/type/decorator/api/property/describe/dto/index.js.map +1 -0
  109. package/dist/type/decorator/api/property/describe/dto/properties.type.d.ts +6 -0
  110. package/dist/type/decorator/api/property/describe/dto/properties.type.js +3 -0
  111. package/dist/type/decorator/api/property/describe/dto/properties.type.js.map +1 -0
  112. package/dist/type/decorator/api/property/describe/dto/query/get-list-properties.type.d.ts +3 -0
  113. package/dist/type/decorator/api/property/describe/dto/query/get-list-properties.type.js +3 -0
  114. package/dist/type/decorator/api/property/describe/dto/query/get-list-properties.type.js.map +1 -0
  115. package/dist/type/decorator/api/property/describe/dto/query/index.d.ts +2 -0
  116. package/dist/type/decorator/api/property/describe/dto/query/index.js +19 -0
  117. package/dist/type/decorator/api/property/describe/dto/query/index.js.map +1 -0
  118. package/dist/type/decorator/api/property/describe/dto/query/properties.type.d.ts +6 -0
  119. package/dist/type/decorator/api/property/describe/dto/query/properties.type.js +3 -0
  120. package/dist/type/decorator/api/property/describe/dto/query/properties.type.js.map +1 -0
  121. package/dist/type/decorator/api/property/describe/dto/request-properties.type.d.ts +5 -0
  122. package/dist/type/decorator/api/property/describe/dto/request-properties.type.js +3 -0
  123. package/dist/type/decorator/api/property/describe/dto/request-properties.type.js.map +1 -0
  124. package/dist/type/decorator/api/property/describe/dto/response-properties.type.d.ts +5 -0
  125. package/dist/type/decorator/api/property/describe/dto/response-properties.type.js +3 -0
  126. package/dist/type/decorator/api/property/describe/dto/response-properties.type.js.map +1 -0
  127. package/dist/type/decorator/api/property/describe/example-properties.type.d.ts +7 -0
  128. package/dist/type/decorator/api/property/describe/example-properties.type.js +3 -0
  129. package/dist/type/decorator/api/property/describe/example-properties.type.js.map +1 -0
  130. package/dist/type/decorator/api/property/describe/index.d.ts +12 -0
  131. package/dist/type/decorator/api/property/describe/index.js +29 -0
  132. package/dist/type/decorator/api/property/describe/index.js.map +1 -0
  133. package/dist/type/decorator/api/property/describe/number-properties.type.d.ts +13 -0
  134. package/dist/type/decorator/api/property/describe/number-properties.type.js +3 -0
  135. package/dist/type/decorator/api/property/describe/number-properties.type.js.map +1 -0
  136. package/dist/type/decorator/api/property/describe/object-properties.type.d.ts +8 -0
  137. package/dist/type/decorator/api/property/describe/object-properties.type.js +3 -0
  138. package/dist/type/decorator/api/property/describe/object-properties.type.js.map +1 -0
  139. package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.d.ts +2 -0
  140. package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.js +3 -0
  141. package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.js.map +1 -0
  142. package/dist/type/decorator/api/property/describe/properties/base-properties.type.d.ts +10 -0
  143. package/dist/type/decorator/api/property/describe/properties/base-properties.type.js +3 -0
  144. package/dist/type/decorator/api/property/describe/properties/base-properties.type.js.map +1 -0
  145. package/dist/type/decorator/api/property/describe/properties/index.d.ts +2 -0
  146. package/dist/type/decorator/api/property/describe/properties/index.js +19 -0
  147. package/dist/type/decorator/api/property/describe/properties/index.js.map +1 -0
  148. package/dist/type/decorator/api/property/describe/properties.type.d.ts +7 -0
  149. package/dist/type/decorator/api/property/describe/properties.type.js +3 -0
  150. package/dist/type/decorator/api/property/describe/properties.type.js.map +1 -0
  151. package/dist/type/decorator/api/property/describe/string-properties.type.d.ts +13 -0
  152. package/dist/type/decorator/api/property/describe/string-properties.type.js +3 -0
  153. package/dist/type/decorator/api/property/describe/string-properties.type.js.map +1 -0
  154. package/dist/type/decorator/api/property/describe/uuid-properties.type.d.ts +7 -0
  155. package/dist/type/decorator/api/property/describe/uuid-properties.type.js +3 -0
  156. package/dist/type/decorator/api/property/describe/uuid-properties.type.js.map +1 -0
  157. package/dist/type/decorator/api/property/index.d.ts +1 -1
  158. package/dist/type/decorator/api/property/index.js +1 -1
  159. package/dist/type/decorator/api/property/index.js.map +1 -1
  160. package/dist/utility/api/controller/get-method-name.utility.d.ts +1 -1
  161. package/dist/utility/api/controller/get-method-name.utility.js +1 -1
  162. package/dist/utility/api/controller/get-method-name.utility.js.map +1 -1
  163. package/dist/utility/api/controller/write-method.utility.d.ts +1 -1
  164. package/dist/utility/api/controller/write-method.utility.js.map +1 -1
  165. package/dist/utility/api/filter-order-by-from-entity.utility.d.ts +4 -2
  166. package/dist/utility/api/filter-order-by-from-entity.utility.js +17 -13
  167. package/dist/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
  168. package/dist/utility/dto/generate.utility.d.ts +1 -1
  169. package/dist/utility/dto/generate.utility.js +96 -90
  170. package/dist/utility/dto/generate.utility.js.map +1 -1
  171. package/dist/utility/get-entity-columns.utility.d.ts +3 -2
  172. package/dist/utility/get-entity-columns.utility.js +4 -3
  173. package/dist/utility/get-entity-columns.utility.js.map +1 -1
  174. package/package.json +1 -1
  175. package/dist/class/api/base-controller.class.d.ts +0 -4
  176. package/dist/class/api/base-controller.class.js +0 -10
  177. package/dist/class/api/base-controller.class.js.map +0 -1
  178. package/dist/type/decorator/api/property/describe-properties.type.d.ts +0 -64
  179. package/dist/type/decorator/api/property/describe-properties.type.js.map +0 -1
@@ -2,9 +2,9 @@ import type { IApiGetListResponseResult } from "../../interface";
2
2
  import type { TApiFunctionCreateProperties, TApiFunctionGetListProperties, TApiFunctionGetProperties, TApiFunctionUpdateProperties } from "../../type";
3
3
  import type { FindOptionsRelations } from "typeorm";
4
4
  export declare class BaseApiService<E> {
5
- create(_properties: TApiFunctionCreateProperties<E>): Promise<E>;
6
- delete(_id: string): Promise<void>;
7
- get(_id: string, _properties?: TApiFunctionGetProperties<E>, _relations?: FindOptionsRelations<E>): Promise<E>;
8
- getList(_properties: TApiFunctionGetListProperties<E>, _relations?: FindOptionsRelations<E>): Promise<IApiGetListResponseResult<E>>;
9
- update(_id: string, _properties: TApiFunctionUpdateProperties<E>): Promise<E>;
5
+ create(properties: TApiFunctionCreateProperties<E>): Promise<E>;
6
+ delete(id: string): Promise<void>;
7
+ get(id: string, properties?: TApiFunctionGetProperties<E>, relations?: FindOptionsRelations<E>): Promise<E>;
8
+ getList(properties: TApiFunctionGetListProperties<E>, relations?: FindOptionsRelations<E>): Promise<IApiGetListResponseResult<E>>;
9
+ update(id: string, properties: TApiFunctionUpdateProperties<E>): Promise<E>;
10
10
  }
@@ -2,20 +2,29 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseApiService = void 0;
4
4
  class BaseApiService {
5
- create(_properties) {
6
- return null;
5
+ create(properties) {
6
+ void properties;
7
+ return Promise.resolve({});
7
8
  }
8
- delete(_id) {
9
- return null;
9
+ delete(id) {
10
+ void id;
11
+ return Promise.resolve();
10
12
  }
11
- get(_id, _properties, _relations) {
12
- return null;
13
+ get(id, properties, relations) {
14
+ void id;
15
+ void properties;
16
+ void relations;
17
+ return Promise.resolve({});
13
18
  }
14
- getList(_properties, _relations) {
15
- return null;
19
+ getList(properties, relations) {
20
+ void properties;
21
+ void relations;
22
+ return Promise.resolve({ items: [], total: 0 });
16
23
  }
17
- update(_id, _properties) {
18
- return null;
24
+ update(id, properties) {
25
+ void id;
26
+ void properties;
27
+ return Promise.resolve({});
19
28
  }
20
29
  }
21
30
  exports.BaseApiService = BaseApiService;
@@ -1 +1 @@
1
- {"version":3,"file":"base-service.class.js","sourceRoot":"/","sources":["class/api/base-service.class.ts"],"names":[],"mappings":";;;AAMA,MAAa,cAAc;IAC1B,MAAM,CAAC,WAA4C;QAClD,OAAO,IAAW,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,GAAW;QACjB,OAAO,IAAW,CAAC;IACpB,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,WAA0C,EAAE,UAAoC;QAChG,OAAO,IAAW,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,WAA6C,EAAE,UAAoC;QAC1F,OAAO,IAAW,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,WAA4C;QAC/D,OAAO,IAAW,CAAC;IACpB,CAAC;CACD;AApBD,wCAoBC","sourcesContent":["import type { IApiGetListResponseResult } from \"../../interface\";\n\nimport type { TApiFunctionCreateProperties, TApiFunctionGetListProperties, TApiFunctionGetProperties, TApiFunctionUpdateProperties } from \"../../type\";\n\nimport type { FindOptionsRelations } from \"typeorm\";\n\nexport class BaseApiService<E> {\n\tcreate(_properties: TApiFunctionCreateProperties<E>): Promise<E> {\n\t\treturn null as any;\n\t}\n\n\tdelete(_id: string): Promise<void> {\n\t\treturn null as any;\n\t}\n\n\tget(_id: string, _properties?: TApiFunctionGetProperties<E>, _relations?: FindOptionsRelations<E>): Promise<E> {\n\t\treturn null as any;\n\t}\n\n\tgetList(_properties: TApiFunctionGetListProperties<E>, _relations?: FindOptionsRelations<E>): Promise<IApiGetListResponseResult<E>> {\n\t\treturn null as any;\n\t}\n\n\tupdate(_id: string, _properties: TApiFunctionUpdateProperties<E>): Promise<E> {\n\t\treturn null as any;\n\t}\n}\n"]}
1
+ {"version":3,"file":"base-service.class.js","sourceRoot":"/","sources":["class/api/base-service.class.ts"],"names":[],"mappings":";;;AAIA,MAAa,cAAc;IAC1B,MAAM,CAAC,UAA2C;QACjD,KAAK,UAAU,CAAC;QAEhB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,EAAU;QAChB,KAAK,EAAE,CAAC;QAER,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,UAAyC,EAAE,SAAmC;QAC7F,KAAK,EAAE,CAAC;QACR,KAAK,UAAU,CAAC;QAChB,KAAK,SAAS,CAAC;QAEf,OAAO,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,CAAC,UAA4C,EAAE,SAAmC;QACxF,KAAK,UAAU,CAAC;QAChB,KAAK,SAAS,CAAC;QAEf,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAA6C,CAAC,CAAC;IAC5F,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,UAA2C;QAC7D,KAAK,EAAE,CAAC;QACR,KAAK,UAAU,CAAC;QAEhB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC,CAAC;IACjC,CAAC;CACD;AAlCD,wCAkCC","sourcesContent":["import type { IApiGetListResponseResult } from \"../../interface\";\nimport type { TApiFunctionCreateProperties, TApiFunctionGetListProperties, TApiFunctionGetProperties, TApiFunctionUpdateProperties } from \"../../type\";\nimport type { FindOptionsRelations } from \"typeorm\";\n\nexport class BaseApiService<E> {\n\tcreate(properties: TApiFunctionCreateProperties<E>): Promise<E> {\n\t\tvoid properties;\n\n\t\treturn Promise.resolve({} as E);\n\t}\n\n\tdelete(id: string): Promise<void> {\n\t\tvoid id;\n\n\t\treturn Promise.resolve();\n\t}\n\n\tget(id: string, properties?: TApiFunctionGetProperties<E>, relations?: FindOptionsRelations<E>): Promise<E> {\n\t\tvoid id;\n\t\tvoid properties;\n\t\tvoid relations;\n\n\t\treturn Promise.resolve({} as E);\n\t}\n\n\tgetList(properties: TApiFunctionGetListProperties<E>, relations?: FindOptionsRelations<E>): Promise<IApiGetListResponseResult<E>> {\n\t\tvoid properties;\n\t\tvoid relations;\n\n\t\treturn Promise.resolve({ items: [], total: 0 } as unknown as IApiGetListResponseResult<E>);\n\t}\n\n\tupdate(id: string, properties: TApiFunctionUpdateProperties<E>): Promise<E> {\n\t\tvoid id;\n\t\tvoid properties;\n\n\t\treturn Promise.resolve({} as E);\n\t}\n}\n"]}
@@ -1,2 +1 @@
1
1
  export * from "./base-service.class";
2
- export * from "./base-controller.class";
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./base-service.class"), exports);
18
- __exportStar(require("./base-controller.class"), exports);
19
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["class/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,0DAAwC","sourcesContent":["export * from \"./base-service.class\";\nexport * from \"./base-controller.class\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["class/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC","sourcesContent":["export * from \"./base-service.class\";\n"]}
@@ -1,3 +1,3 @@
1
- export declare const API_CONTROLLER_DECORATOR_CONSTANT: {
1
+ export declare const CONTROLLER_API_DECORATOR_CONSTANT: {
2
2
  readonly RESERVED_METHOD_PREFIX: string;
3
3
  };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_CONTROLLER_DECORATOR_CONSTANT = void 0;
3
+ exports.CONTROLLER_API_DECORATOR_CONSTANT = void 0;
4
4
  const RESERVED_METHOD_PREFIX = "apiController";
5
- exports.API_CONTROLLER_DECORATOR_CONSTANT = {
5
+ exports.CONTROLLER_API_DECORATOR_CONSTANT = {
6
6
  RESERVED_METHOD_PREFIX,
7
7
  };
8
8
  //# sourceMappingURL=controller.constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"controller.constant.js","sourceRoot":"/","sources":["constant/decorator/api/controller.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAW,eAAe,CAAC;AAE1C,QAAA,iCAAiC,GAE1C;IACH,sBAAsB;CACb,CAAC","sourcesContent":["const RESERVED_METHOD_PREFIX: string = \"apiController\";\n\nexport const API_CONTROLLER_DECORATOR_CONSTANT: {\n\treadonly RESERVED_METHOD_PREFIX: string;\n} = {\n\tRESERVED_METHOD_PREFIX,\n} as const;\n"]}
1
+ {"version":3,"file":"controller.constant.js","sourceRoot":"/","sources":["constant/decorator/api/controller.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAW,eAAe,CAAC;AAE1C,QAAA,iCAAiC,GAE1C;IACH,sBAAsB;CACb,CAAC","sourcesContent":["const RESERVED_METHOD_PREFIX: string = \"apiController\";\n\nexport const CONTROLLER_API_DECORATOR_CONSTANT: {\n\treadonly RESERVED_METHOD_PREFIX: string;\n} = {\n\tRESERVED_METHOD_PREFIX,\n} as const;\n"]}
@@ -1,4 +1,4 @@
1
1
  import { EFilterOrderDirection } from "../../../enum";
2
- export declare const API_FUNCTION_DECORATOR_CONSTANT: {
2
+ export declare const FUNCTION_API_DECORATOR_CONSTANT: {
3
3
  readonly DEFAULT_FILTER_ORDER_BY_DIRECTION: EFilterOrderDirection;
4
4
  };
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_FUNCTION_DECORATOR_CONSTANT = void 0;
3
+ exports.FUNCTION_API_DECORATOR_CONSTANT = void 0;
4
4
  const enum_1 = require("../../../enum");
5
5
  const DEFAULT_FILTER_ORDER_BY_DIRECTION = enum_1.EFilterOrderDirection.ASC;
6
- exports.API_FUNCTION_DECORATOR_CONSTANT = {
6
+ exports.FUNCTION_API_DECORATOR_CONSTANT = {
7
7
  DEFAULT_FILTER_ORDER_BY_DIRECTION,
8
8
  };
9
9
  //# sourceMappingURL=function.constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"function.constant.js","sourceRoot":"/","sources":["constant/decorator/api/function.constant.ts"],"names":[],"mappings":";;;AAAA,wCAAsD;AAEtD,MAAM,iCAAiC,GAA0B,4BAAqB,CAAC,GAAG,CAAC;AAE9E,QAAA,+BAA+B,GAExC;IACH,iCAAiC;CACxB,CAAC","sourcesContent":["import { EFilterOrderDirection } from \"../../../enum\";\n\nconst DEFAULT_FILTER_ORDER_BY_DIRECTION: EFilterOrderDirection = EFilterOrderDirection.ASC;\n\nexport const API_FUNCTION_DECORATOR_CONSTANT: {\n\treadonly DEFAULT_FILTER_ORDER_BY_DIRECTION: EFilterOrderDirection;\n} = {\n\tDEFAULT_FILTER_ORDER_BY_DIRECTION,\n} as const;\n"]}
1
+ {"version":3,"file":"function.constant.js","sourceRoot":"/","sources":["constant/decorator/api/function.constant.ts"],"names":[],"mappings":";;;AAAA,wCAAsD;AAEtD,MAAM,iCAAiC,GAA0B,4BAAqB,CAAC,GAAG,CAAC;AAE9E,QAAA,+BAA+B,GAExC;IACH,iCAAiC;CACxB,CAAC","sourcesContent":["import { EFilterOrderDirection } from \"../../../enum\";\n\nconst DEFAULT_FILTER_ORDER_BY_DIRECTION: EFilterOrderDirection = EFilterOrderDirection.ASC;\n\nexport const FUNCTION_API_DECORATOR_CONSTANT: {\n\treadonly DEFAULT_FILTER_ORDER_BY_DIRECTION: EFilterOrderDirection;\n} = {\n\tDEFAULT_FILTER_ORDER_BY_DIRECTION,\n} as const;\n"]}
@@ -1,3 +1,3 @@
1
- export declare const API_PROPERTY_DESCRIBE_DECORATOR_CONSTANT: {
1
+ export declare const PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT: {
2
2
  readonly METADATA_PROPERTY_NAME: string;
3
3
  };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_PROPERTY_DESCRIBE_DECORATOR_CONSTANT = void 0;
3
+ exports.PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT = void 0;
4
4
  const METADATA_PROPERTY_NAME = "API_PROPERTY_DESCRIBE";
5
- exports.API_PROPERTY_DESCRIBE_DECORATOR_CONSTANT = {
5
+ exports.PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT = {
6
6
  METADATA_PROPERTY_NAME,
7
7
  };
8
8
  //# sourceMappingURL=property-describe.constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"property-describe.constant.js","sourceRoot":"/","sources":["constant/decorator/api/property-describe.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAW,uBAAuB,CAAC;AAElD,QAAA,wCAAwC,GAEjD;IACH,sBAAsB;CACb,CAAC","sourcesContent":["const METADATA_PROPERTY_NAME: string = \"API_PROPERTY_DESCRIBE\";\n\nexport const API_PROPERTY_DESCRIBE_DECORATOR_CONSTANT: {\n\treadonly METADATA_PROPERTY_NAME: string;\n} = {\n\tMETADATA_PROPERTY_NAME,\n} as const;\n"]}
1
+ {"version":3,"file":"property-describe.constant.js","sourceRoot":"/","sources":["constant/decorator/api/property-describe.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAW,uBAAuB,CAAC;AAElD,QAAA,wCAAwC,GAEjD;IACH,sBAAsB;CACb,CAAC","sourcesContent":["const METADATA_PROPERTY_NAME: string = \"API_PROPERTY_DESCRIBE\";\n\nexport const PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT: {\n\treadonly METADATA_PROPERTY_NAME: string;\n} = {\n\tMETADATA_PROPERTY_NAME,\n} as const;\n"]}
@@ -1,7 +1,6 @@
1
- declare const GET_LIST_QUERY_DTO_FACTOR_CONSTANT: {
1
+ export declare const GET_LIST_QUERY_DTO_FACTORY_CONSTANT: {
2
2
  readonly MAXIMUM_LIST_LENGTH: number;
3
3
  readonly MAXIMUM_LIST_PAGES_COUNT: number;
4
4
  readonly MINIMUM_LIST_LENGTH: number;
5
5
  readonly MINIMUM_LIST_PAGES_COUNT: number;
6
6
  };
7
- export default GET_LIST_QUERY_DTO_FACTOR_CONSTANT;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_LIST_QUERY_DTO_FACTORY_CONSTANT = void 0;
3
4
  const MINIMUM_LIST_LENGTH = 1;
4
5
  const MAXIMUM_LIST_LENGTH = 100;
5
6
  const MINIMUM_LIST_PAGES_COUNT = 1;
6
7
  const MAXIMUM_LIST_PAGES_COUNT = 100;
7
- const GET_LIST_QUERY_DTO_FACTOR_CONSTANT = {
8
+ exports.GET_LIST_QUERY_DTO_FACTORY_CONSTANT = {
8
9
  MAXIMUM_LIST_LENGTH,
9
10
  MAXIMUM_LIST_PAGES_COUNT,
10
11
  MINIMUM_LIST_LENGTH,
11
12
  MINIMUM_LIST_PAGES_COUNT,
12
13
  };
13
- exports.default = GET_LIST_QUERY_DTO_FACTOR_CONSTANT;
14
14
  //# sourceMappingURL=get-list-query.constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-list-query.constant.js","sourceRoot":"/","sources":["constant/factory/dto/get-list-query.constant.ts"],"names":[],"mappings":";;AAAA,MAAM,mBAAmB,GAAW,CAAC,CAAC;AACtC,MAAM,mBAAmB,GAAW,GAAG,CAAC;AACxC,MAAM,wBAAwB,GAAW,CAAC,CAAC;AAC3C,MAAM,wBAAwB,GAAW,GAAG,CAAC;AAE7C,MAAM,kCAAkC,GAKpC;IACA,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,wBAAwB;CAClB,CAAC;AAEX,kBAAe,kCAAkC,CAAC","sourcesContent":["const MINIMUM_LIST_LENGTH: number = 1;\nconst MAXIMUM_LIST_LENGTH: number = 100;\nconst MINIMUM_LIST_PAGES_COUNT: number = 1;\nconst MAXIMUM_LIST_PAGES_COUNT: number = 100;\n\nconst GET_LIST_QUERY_DTO_FACTOR_CONSTANT: {\n readonly MAXIMUM_LIST_LENGTH: number;\n readonly MAXIMUM_LIST_PAGES_COUNT: number;\n readonly MINIMUM_LIST_LENGTH: number;\n readonly MINIMUM_LIST_PAGES_COUNT: number;\n} = {\n MAXIMUM_LIST_LENGTH,\n MAXIMUM_LIST_PAGES_COUNT,\n MINIMUM_LIST_LENGTH,\n MINIMUM_LIST_PAGES_COUNT,\n} as const;\n\nexport default GET_LIST_QUERY_DTO_FACTOR_CONSTANT;\n"]}
1
+ {"version":3,"file":"get-list-query.constant.js","sourceRoot":"/","sources":["constant/factory/dto/get-list-query.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,mBAAmB,GAAW,CAAC,CAAC;AACtC,MAAM,mBAAmB,GAAW,GAAG,CAAC;AACxC,MAAM,wBAAwB,GAAW,CAAC,CAAC;AAC3C,MAAM,wBAAwB,GAAW,GAAG,CAAC;AAEhC,QAAA,mCAAmC,GAK5C;IACH,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,wBAAwB;CACf,CAAC","sourcesContent":["const MINIMUM_LIST_LENGTH: number = 1;\nconst MAXIMUM_LIST_LENGTH: number = 100;\nconst MINIMUM_LIST_PAGES_COUNT: number = 1;\nconst MAXIMUM_LIST_PAGES_COUNT: number = 100;\n\nexport const GET_LIST_QUERY_DTO_FACTORY_CONSTANT: {\n\treadonly MAXIMUM_LIST_LENGTH: number;\n\treadonly MAXIMUM_LIST_PAGES_COUNT: number;\n\treadonly MINIMUM_LIST_LENGTH: number;\n\treadonly MINIMUM_LIST_PAGES_COUNT: number;\n} = {\n\tMAXIMUM_LIST_LENGTH,\n\tMAXIMUM_LIST_PAGES_COUNT,\n\tMINIMUM_LIST_LENGTH,\n\tMINIMUM_LIST_PAGES_COUNT,\n} as const;\n"]}
@@ -1,3 +1,3 @@
1
- export declare const API_FILTER_INTERFACE_CONSTANT: {
1
+ export declare const FILTER_API_INTERFACE_CONSTANT: {
2
2
  readonly ALLOWED_ENTITY_TO_FILTER_COLUMNS: Array<string>;
3
3
  };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_FILTER_INTERFACE_CONSTANT = void 0;
3
+ exports.FILTER_API_INTERFACE_CONSTANT = void 0;
4
4
  const ALLOWED_ENTITY_TO_FILTER_COLUMNS = ["string", "text", "varchar", "char", "number", "int", "integer", "tinyint", "smallint", "mediumint", "bigint", "float", "double", "decimal", "date", "datetime", "timestamp"];
5
- exports.API_FILTER_INTERFACE_CONSTANT = {
5
+ exports.FILTER_API_INTERFACE_CONSTANT = {
6
6
  ALLOWED_ENTITY_TO_FILTER_COLUMNS,
7
7
  };
8
8
  //# sourceMappingURL=filter.constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter.constant.js","sourceRoot":"/","sources":["constant/interface/api/filter.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,gCAAgC,GAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAE1N,QAAA,6BAA6B,GAEtC;IACH,gCAAgC;CACvB,CAAC","sourcesContent":["const ALLOWED_ENTITY_TO_FILTER_COLUMNS: Array<string> = [\"string\", \"text\", \"varchar\", \"char\", \"number\", \"int\", \"integer\", \"tinyint\", \"smallint\", \"mediumint\", \"bigint\", \"float\", \"double\", \"decimal\", \"date\", \"datetime\", \"timestamp\"];\n\nexport const API_FILTER_INTERFACE_CONSTANT: {\n\treadonly ALLOWED_ENTITY_TO_FILTER_COLUMNS: Array<string>;\n} = {\n\tALLOWED_ENTITY_TO_FILTER_COLUMNS,\n} as const;\n"]}
1
+ {"version":3,"file":"filter.constant.js","sourceRoot":"/","sources":["constant/interface/api/filter.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,gCAAgC,GAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAE1N,QAAA,6BAA6B,GAEtC;IACH,gCAAgC;CACvB,CAAC","sourcesContent":["const ALLOWED_ENTITY_TO_FILTER_COLUMNS: Array<string> = [\"string\", \"text\", \"varchar\", \"char\", \"number\", \"int\", \"integer\", \"tinyint\", \"smallint\", \"mediumint\", \"bigint\", \"float\", \"double\", \"decimal\", \"date\", \"datetime\", \"timestamp\"];\n\nexport const FILTER_API_INTERFACE_CONSTANT: {\n\treadonly ALLOWED_ENTITY_TO_FILTER_COLUMNS: Array<string>;\n} = {\n\tALLOWED_ENTITY_TO_FILTER_COLUMNS,\n} as const;\n"]}
@@ -1 +1,2 @@
1
1
  export * from "./property";
2
+ export * from "./filter.constant";
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./property"), exports);
18
+ __exportStar(require("./filter.constant"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["constant/interface/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B","sourcesContent":["export * from \"./property\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["constant/interface/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,oDAAkC","sourcesContent":["export * from \"./property\";\nexport * from \"./filter.constant\";\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { IsIpVersion } from "class-validator/types/decorator/string/IsIP";
2
- export declare const API_PROPERTY_STRING_INTERFACE_CONSTANT: {
2
+ export declare const STRING_PROPERTY_API_INTERFACE_CONSTANT: {
3
3
  readonly IP_VERSION: IsIpVersion;
4
4
  readonly REGEX_FLAGS_INDEX: number;
5
5
  readonly REGEX_PATTERN_INDEX: number;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_PROPERTY_STRING_INTERFACE_CONSTANT = void 0;
3
+ exports.STRING_PROPERTY_API_INTERFACE_CONSTANT = void 0;
4
4
  const REGEX_PATTERN_INDEX = 1;
5
5
  const REGEX_FLAGS_INDEX = 2;
6
6
  const IP_VERSION = 4;
7
- exports.API_PROPERTY_STRING_INTERFACE_CONSTANT = {
7
+ exports.STRING_PROPERTY_API_INTERFACE_CONSTANT = {
8
8
  IP_VERSION,
9
9
  REGEX_FLAGS_INDEX,
10
10
  REGEX_PATTERN_INDEX,
@@ -1 +1 @@
1
- {"version":3,"file":"string.constant.js","sourceRoot":"/","sources":["constant/interface/api/property/string.constant.ts"],"names":[],"mappings":";;;AAEA,MAAM,mBAAmB,GAAW,CAAC,CAAC;AACtC,MAAM,iBAAiB,GAAW,CAAC,CAAC;AACpC,MAAM,UAAU,GAAgB,CAAC,CAAC;AAErB,QAAA,sCAAsC,GAI/C;IACH,UAAU;IACV,iBAAiB;IACjB,mBAAmB;CACV,CAAC","sourcesContent":["import type { IsIpVersion } from \"class-validator/types/decorator/string/IsIP\";\n\nconst REGEX_PATTERN_INDEX: number = 1;\nconst REGEX_FLAGS_INDEX: number = 2;\nconst IP_VERSION: IsIpVersion = 4;\n\nexport const API_PROPERTY_STRING_INTERFACE_CONSTANT: {\n\treadonly IP_VERSION: IsIpVersion;\n\treadonly REGEX_FLAGS_INDEX: number;\n\treadonly REGEX_PATTERN_INDEX: number;\n} = {\n\tIP_VERSION,\n\tREGEX_FLAGS_INDEX,\n\tREGEX_PATTERN_INDEX,\n} as const;\n"]}
1
+ {"version":3,"file":"string.constant.js","sourceRoot":"/","sources":["constant/interface/api/property/string.constant.ts"],"names":[],"mappings":";;;AAEA,MAAM,mBAAmB,GAAW,CAAC,CAAC;AACtC,MAAM,iBAAiB,GAAW,CAAC,CAAC;AACpC,MAAM,UAAU,GAAgB,CAAC,CAAC;AAErB,QAAA,sCAAsC,GAI/C;IACH,UAAU;IACV,iBAAiB;IACjB,mBAAmB;CACV,CAAC","sourcesContent":["import type { IsIpVersion } from \"class-validator/types/decorator/string/IsIP\";\n\nconst REGEX_PATTERN_INDEX: number = 1;\nconst REGEX_FLAGS_INDEX: number = 2;\nconst IP_VERSION: IsIpVersion = 4;\n\nexport const STRING_PROPERTY_API_INTERFACE_CONSTANT: {\n\treadonly IP_VERSION: IsIpVersion;\n\treadonly REGEX_FLAGS_INDEX: number;\n\treadonly REGEX_PATTERN_INDEX: number;\n} = {\n\tIP_VERSION,\n\tREGEX_FLAGS_INDEX,\n\tREGEX_PATTERN_INDEX,\n} as const;\n"]}
@@ -1,4 +1,4 @@
1
- export declare const API_PROPERTY_WALLET_INTERFACE_CONSTANT: {
1
+ export declare const WALLET_PROPERTY_API_INTERFACE_CONSTANT: {
2
2
  readonly EXAMPLE: number;
3
3
  readonly MAXIMUM: number;
4
4
  readonly MINIMUM: number;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_PROPERTY_WALLET_INTERFACE_CONSTANT = void 0;
3
+ exports.WALLET_PROPERTY_API_INTERFACE_CONSTANT = void 0;
4
4
  const MINIMUM = 10_000_000_000;
5
5
  const MAXIMUM = 999_999_999_999;
6
6
  const EXAMPLE = 18_143_008_867;
7
- exports.API_PROPERTY_WALLET_INTERFACE_CONSTANT = {
7
+ exports.WALLET_PROPERTY_API_INTERFACE_CONSTANT = {
8
8
  EXAMPLE,
9
9
  MAXIMUM,
10
10
  MINIMUM,
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.constant.js","sourceRoot":"/","sources":["constant/interface/api/property/wallet.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAW,cAAc,CAAC;AACvC,MAAM,OAAO,GAAW,eAAe,CAAC;AACxC,MAAM,OAAO,GAAW,cAAc,CAAC;AAE1B,QAAA,sCAAsC,GAI/C;IACH,OAAO;IACP,OAAO;IACP,OAAO;CACE,CAAC","sourcesContent":["const MINIMUM: number = 10_000_000_000;\nconst MAXIMUM: number = 999_999_999_999;\nconst EXAMPLE: number = 18_143_008_867;\n\nexport const API_PROPERTY_WALLET_INTERFACE_CONSTANT: {\n\treadonly EXAMPLE: number;\n\treadonly MAXIMUM: number;\n\treadonly MINIMUM: number;\n} = {\n\tEXAMPLE,\n\tMAXIMUM,\n\tMINIMUM,\n} as const;\n"]}
1
+ {"version":3,"file":"wallet.constant.js","sourceRoot":"/","sources":["constant/interface/api/property/wallet.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAW,cAAc,CAAC;AACvC,MAAM,OAAO,GAAW,eAAe,CAAC;AACxC,MAAM,OAAO,GAAW,cAAc,CAAC;AAE1B,QAAA,sCAAsC,GAI/C;IACH,OAAO;IACP,OAAO;IACP,OAAO;CACE,CAAC","sourcesContent":["const MINIMUM: number = 10_000_000_000;\nconst MAXIMUM: number = 999_999_999_999;\nconst EXAMPLE: number = 18_143_008_867;\n\nexport const WALLET_PROPERTY_API_INTERFACE_CONSTANT: {\n\treadonly EXAMPLE: number;\n\treadonly MAXIMUM: number;\n\treadonly MINIMUM: number;\n} = {\n\tEXAMPLE,\n\tMAXIMUM,\n\tMINIMUM,\n} as const;\n"]}
@@ -0,0 +1,8 @@
1
+ import type { IApiBaseEntity } from "../../../../interface";
2
+ import type { TApiFunctionCreateProperties } from "../../../../type";
3
+ import type { Repository } from "typeorm";
4
+ export interface IApiFunctionCreateExecutorProperties<E extends IApiBaseEntity> {
5
+ entity: IApiBaseEntity;
6
+ properties: TApiFunctionCreateProperties<E>;
7
+ repository: Repository<E>;
8
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=describe-properties.type.js.map
3
+ //# sourceMappingURL=executor-properties.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor-properties.type.js","sourceRoot":"/","sources":["decorator/api/function/create/executor-properties.type.ts"],"names":[],"mappings":"","sourcesContent":["import type { IApiBaseEntity } from \"../../../../interface\";\n\nimport type { TApiFunctionCreateProperties } from \"../../../../type\";\nimport type { Repository } from \"typeorm\";\n\nexport interface IApiFunctionCreateExecutorProperties<E extends IApiBaseEntity> {\n\tentity: IApiBaseEntity;\n\tproperties: TApiFunctionCreateProperties<E>;\n\trepository: Repository<E>;\n}\n"]}
@@ -0,0 +1 @@
1
+ export * from "./executor-properties.type";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./executor-properties.type"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["decorator/api/function/create/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C","sourcesContent":["export * from \"./executor-properties.type\";\n"]}
@@ -1,4 +1,2 @@
1
- import type { BaseEntity } from "typeorm";
2
- export declare function ApiFunctionCreate<E extends BaseEntity>(options: {
3
- model: new () => E;
4
- }): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
1
+ import type { IApiFunctionCreateProperties } from "../../../interface/decorator/api/function/create-properties.interface";
2
+ export declare function ApiFunctionCreate(properties: IApiFunctionCreateProperties): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -4,39 +4,41 @@ exports.ApiFunctionCreate = ApiFunctionCreate;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const enum_1 = require("../../../enum");
6
6
  const utility_1 = require("../../../utility");
7
- const get_entity_columns_utility_1 = require("../../../utility/get-entity-columns.utility");
8
- async function executor(repository, entityType, properties) {
7
+ async function executor(options) {
8
+ const { entity, properties, repository } = options;
9
9
  try {
10
- const allColumns = (0, get_entity_columns_utility_1.GetEntityColumns)(entityType);
11
- const autoGeneratedColumns = (0, get_entity_columns_utility_1.GetEntityColumns)(entityType, true);
12
- const filteredProperties = Object.keys(properties).reduce((accumulator, key) => {
10
+ const allColumns = (0, utility_1.GetEntityColumns)({ entity });
11
+ const autoGeneratedColumns = (0, utility_1.GetEntityColumns)({ entity, shouldTakeGeneratedOnly: true });
12
+ const filteredProperties = {};
13
+ for (const key of Object.keys(properties)) {
13
14
  if (allColumns.includes(key) && !autoGeneratedColumns.includes(key)) {
14
- accumulator[key] = properties[key];
15
+ filteredProperties[key] = properties[key];
15
16
  }
16
- return accumulator;
17
- }, {});
17
+ }
18
18
  const newEntity = repository.create(filteredProperties);
19
19
  return await repository.save(newEntity);
20
20
  }
21
21
  catch (error) {
22
- console.log(error);
23
22
  if (error instanceof common_1.HttpException) {
24
23
  throw error;
25
24
  }
26
25
  throw new common_1.InternalServerErrorException((0, utility_1.ErrorString)({
27
- entity: entityType,
26
+ entity: entity,
28
27
  type: enum_1.EErrorStringAction.CREATING_ERROR,
29
28
  }));
30
29
  }
31
30
  }
32
- function ApiFunctionCreate(options) {
33
- return function (_target, _propertyKey, descriptor) {
31
+ function ApiFunctionCreate(properties) {
32
+ const { entity } = properties;
33
+ return function (target, propertyKey, descriptor) {
34
+ void target;
35
+ void propertyKey;
34
36
  descriptor.value = async function (properties) {
35
37
  const repository = this.repository;
36
38
  if (!repository) {
37
- throw new Error("Repository is not available in this context");
39
+ throw (0, utility_1.ErrorException)("Repository is not available in this context");
38
40
  }
39
- return executor(repository, options.model, properties);
41
+ return executor({ entity, properties, repository });
40
42
  };
41
43
  return descriptor;
42
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"create.decorator.js","sourceRoot":"/","sources":["decorator/api/function/create.decorator.ts"],"names":[],"mappings":";;AA2CA,8CAmBC;AA9DD,2CAA6E;AAE7E,wCAAmD;AAEnD,8CAA+C;AAC/C,4FAA+E;AAM/E,KAAK,UAAU,QAAQ,CAAuB,UAAyB,EAAE,UAAuB,EAAE,UAA2C;IAC5I,IAAI,CAAC;QACJ,MAAM,UAAU,GAAG,IAAA,6CAAgB,EAAC,UAAU,CAAC,CAAC;QAChD,MAAM,oBAAoB,GAAG,IAAA,6CAAgB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAEhE,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE,EAAE;YAC9E,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAc,CAAC,EAAE,CAAC;gBAC1F,WAAmB,CAAC,GAAG,CAAC,GAAI,UAAkB,CAAC,GAAG,CAAC,CAAC;YACtD,CAAC;YAED,OAAO,WAAW,CAAC;QACpB,CAAC,EAAE,EAAoB,CAAC,CAAC;QAEzB,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAExD,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEnB,IAAI,KAAK,YAAY,sBAAa,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC;QACb,CAAC;QAED,MAAM,IAAI,qCAA4B,CACrC,IAAA,qBAAW,EAAC;YACX,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,yBAAkB,CAAC,cAAc;SACvC,CAAC,CACF,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAgB,iBAAiB,CAAuB,OAA+B;IACtF,OAAO,UAAU,OAAY,EAAE,YAAoB,EAAE,UAA8B;QAClF,UAAU,CAAC,KAAK,GAAG,KAAK,WAIvB,UAA4E;YAE5E,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU,CAAC;YAElD,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAChE,CAAC;YAED,OAAO,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { HttpException, InternalServerErrorException } from \"@nestjs/common\";\n\nimport { EErrorStringAction } from \"../../../enum\";\n\nimport { ErrorString } from \"../../../utility\";\nimport { GetEntityColumns } from \"../../../utility/get-entity-columns.utility\";\n\nimport type { TApiFunctionCreateProperties } from \"../../../type\";\n\nimport type { BaseEntity, DeepPartial, Repository } from \"typeorm\";\n\nasync function executor<E extends BaseEntity>(repository: Repository<E>, entityType: new () => E, properties: TApiFunctionCreateProperties<E>): Promise<E> {\n\ttry {\n\t\tconst allColumns = GetEntityColumns(entityType);\n\t\tconst autoGeneratedColumns = GetEntityColumns(entityType, true);\n\n\t\tconst filteredProperties = Object.keys(properties).reduce((accumulator, key) => {\n\t\t\tif (allColumns.includes(key as keyof E) && !autoGeneratedColumns.includes(key as keyof E)) {\n\t\t\t\t(accumulator as any)[key] = (properties as any)[key];\n\t\t\t}\n\n\t\t\treturn accumulator;\n\t\t}, {} as DeepPartial<E>);\n\n\t\tconst newEntity = repository.create(filteredProperties);\n\n\t\treturn await repository.save(newEntity);\n\t} catch (error) {\n\t\tconsole.log(error);\n\n\t\tif (error instanceof HttpException) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tthrow new InternalServerErrorException(\n\t\t\tErrorString({\n\t\t\t\tentity: entityType,\n\t\t\t\ttype: EErrorStringAction.CREATING_ERROR,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nexport function ApiFunctionCreate<E extends BaseEntity>(options: { model: new () => E }) {\n\treturn function (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) {\n\t\tdescriptor.value = async function (\n\t\t\tthis: {\n\t\t\t\trepository: Repository<E>;\n\t\t\t},\n\t\t\tproperties: TApiFunctionCreateProperties<InstanceType<typeof options.model>>,\n\t\t) {\n\t\t\tconst repository: Repository<E> = this.repository;\n\n\t\t\tif (!repository) {\n\t\t\t\tthrow new Error(\"Repository is not available in this context\");\n\t\t\t}\n\n\t\t\treturn executor(repository, options.model, properties);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}
1
+ {"version":3,"file":"create.decorator.js","sourceRoot":"/","sources":["decorator/api/function/create.decorator.ts"],"names":[],"mappings":";;AA6CA,8CAwBC;AArED,2CAA6E;AAE7E,wCAAmD;AAEnD,8CAAiF;AASjF,KAAK,UAAU,QAAQ,CAA2B,OAAgD;IACjG,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAA4C,OAAO,CAAC;IAE5F,IAAI,CAAC;QACJ,MAAM,UAAU,GAAmB,IAAA,0BAAgB,EAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAChE,MAAM,oBAAoB,GAAmB,IAAA,0BAAgB,EAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC,CAAC;QAEzG,MAAM,kBAAkB,GAAmB,EAAoB,CAAC;QAEhE,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAiD,EAAE,CAAC;YAC3F,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpE,kBAA+C,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;YACzE,CAAC;QACF,CAAC;QAED,MAAM,SAAS,GAAM,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAE3D,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,sBAAa,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC;QACb,CAAC;QAED,MAAM,IAAI,qCAA4B,CACrC,IAAA,qBAAW,EAAC;YACX,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,yBAAkB,CAAC,cAAc;SACvC,CAAC,CACF,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAgB,iBAAiB,CAAC,UAAwC;IACzE,MAAM,EAAE,MAAM,EAAE,GAAiC,UAAU,CAAC;IAE5D,OAAO,UAAU,MAAe,EAAE,WAAmB,EAAE,UAA8B;QACpF,KAAK,MAAM,CAAC;QACZ,KAAK,WAAW,CAAC;QAEjB,UAAU,CAAC,KAAK,GAAG,KAAK,WAIvB,UAAuD;YAEvD,MAAM,UAAU,GAA8B,IAAI,CAAC,UAAU,CAAC;YAE9D,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,MAAM,IAAA,wBAAc,EAAC,6CAA6C,CAAC,CAAC;YACrE,CAAC;YAED,OAAO,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;QACrD,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { HttpException, InternalServerErrorException } from \"@nestjs/common\";\n\nimport { EErrorStringAction } from \"../../../enum\";\n\nimport { ErrorException, ErrorString, GetEntityColumns } from \"../../../utility\";\n\nimport type { IApiFunctionCreateExecutorProperties } from \"./create\";\nimport type { IApiBaseEntity } from \"../../../interface\";\nimport type { IApiFunctionCreateProperties } from \"../../../interface/decorator/api/function/create-properties.interface\";\nimport type { TApiFunctionCreateProperties } from \"../../../type\";\n\nimport type { DeepPartial, Repository } from \"typeorm\";\n\nasync function executor<E extends IApiBaseEntity>(options: IApiFunctionCreateExecutorProperties<E>): Promise<E> {\n\tconst { entity, properties, repository }: IApiFunctionCreateExecutorProperties<E> = options;\n\n\ttry {\n\t\tconst allColumns: Array<keyof E> = GetEntityColumns({ entity });\n\t\tconst autoGeneratedColumns: Array<keyof E> = GetEntityColumns({ entity, shouldTakeGeneratedOnly: true });\n\n\t\tconst filteredProperties: DeepPartial<E> = {} as DeepPartial<E>;\n\n\t\tfor (const key of Object.keys(properties) as Array<keyof TApiFunctionCreateProperties<E>>) {\n\t\t\tif (allColumns.includes(key) && !autoGeneratedColumns.includes(key)) {\n\t\t\t\t(filteredProperties as Record<keyof E, unknown>)[key] = properties[key];\n\t\t\t}\n\t\t}\n\n\t\tconst newEntity: E = repository.create(filteredProperties);\n\n\t\treturn await repository.save(newEntity);\n\t} catch (error) {\n\t\tif (error instanceof HttpException) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tthrow new InternalServerErrorException(\n\t\t\tErrorString({\n\t\t\t\tentity: entity,\n\t\t\t\ttype: EErrorStringAction.CREATING_ERROR,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nexport function ApiFunctionCreate(properties: IApiFunctionCreateProperties) {\n\tconst { entity }: IApiFunctionCreateProperties = properties;\n\n\treturn function (target: unknown, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\t\tvoid target;\n\t\tvoid propertyKey;\n\n\t\tdescriptor.value = async function (\n\t\t\tthis: {\n\t\t\t\trepository: Repository<typeof entity>;\n\t\t\t},\n\t\t\tproperties: TApiFunctionCreateProperties<typeof entity>,\n\t\t): Promise<IApiBaseEntity> {\n\t\t\tconst repository: Repository<typeof entity> = this.repository;\n\n\t\t\tif (!repository) {\n\t\t\t\tthrow ErrorException(\"Repository is not available in this context\");\n\t\t\t}\n\n\t\t\treturn executor({ entity, properties, repository });\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import { EApiFunctionType } from "../../../enum";
2
- import type { BaseEntity, FindOptionsRelations } from "typeorm";
3
- export declare function ApiFunction<E extends BaseEntity>(options: {
2
+ import type { IApiBaseEntity } from "../../../interface";
3
+ import type { FindOptionsRelations } from "typeorm";
4
+ export declare function ApiFunction<E extends IApiBaseEntity, R>(options: {
4
5
  model: new () => E;
5
6
  relations?: FindOptionsRelations<E>;
6
7
  type: EApiFunctionType;
7
- }): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
8
+ }): (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -2,42 +2,45 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiFunction = ApiFunction;
4
4
  const enum_1 = require("../../../enum");
5
+ const utility_1 = require("../../../utility");
5
6
  const create_decorator_1 = require("./create.decorator");
6
7
  const delete_decorator_1 = require("./delete.decorator");
7
8
  const get_list_decorator_1 = require("./get-list.decorator");
8
9
  const get_decorator_1 = require("./get.decorator");
9
10
  const update_decorator_1 = require("./update.decorator");
10
11
  function ApiFunction(options) {
11
- return function (_target, _propertyKey, descriptor) {
12
+ return function (_target, propertyKey, descriptor) {
12
13
  const originalMethod = descriptor.value;
13
14
  descriptor.value = function (...arguments_) {
15
+ let decoratorFunction;
14
16
  switch (options.type) {
15
17
  case enum_1.EApiFunctionType.GET_LIST: {
16
- return (0, get_list_decorator_1.ApiFunctionGetList)({ model: options.model })(this, _propertyKey, { value: originalMethod }).value.apply(this, arguments_);
18
+ decoratorFunction = (0, get_list_decorator_1.ApiFunctionGetList)({ model: options.model });
19
+ break;
17
20
  }
18
21
  case enum_1.EApiFunctionType.GET: {
19
- return (0, get_decorator_1.ApiFunctionGet)({ model: options.model })(this, _propertyKey, { value: originalMethod }).value.apply(this, arguments_);
22
+ decoratorFunction = (0, get_decorator_1.ApiFunctionGet)({ model: options.model });
23
+ break;
20
24
  }
21
25
  case enum_1.EApiFunctionType.CREATE: {
22
- return (0, create_decorator_1.ApiFunctionCreate)({ model: options.model })(this, _propertyKey, {
23
- value: originalMethod,
24
- }).value.apply(this, arguments_);
26
+ decoratorFunction = (0, create_decorator_1.ApiFunctionCreate)({ entity: options.model });
27
+ break;
25
28
  }
26
29
  case enum_1.EApiFunctionType.UPDATE: {
27
- return (0, update_decorator_1.ApiFunctionUpdate)({ model: options.model })(this, _propertyKey, {
28
- value: originalMethod,
29
- }).value.apply(this, arguments_);
30
+ decoratorFunction = (0, update_decorator_1.ApiFunctionUpdate)({ model: options.model });
31
+ break;
30
32
  }
31
33
  case enum_1.EApiFunctionType.DELETE: {
32
- return (0, delete_decorator_1.ApiFunctionDelete)({ model: options.model })(this, _propertyKey, {
33
- value: originalMethod,
34
- }).value.apply(this, arguments_);
34
+ decoratorFunction = (0, delete_decorator_1.ApiFunctionDelete)({ model: options.model });
35
+ break;
35
36
  }
36
37
  default: {
37
- throw new Error("Unsupported function");
38
+ throw (0, utility_1.ErrorException)("Unsupported function");
38
39
  }
39
40
  }
40
- return originalMethod.apply(this, arguments_);
41
+ const modifiedDescriptor = decoratorFunction(this, propertyKey, { value: originalMethod });
42
+ const modifiedMethod = modifiedDescriptor.value;
43
+ return modifiedMethod.apply(this, arguments_);
41
44
  };
42
45
  return descriptor;
43
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"decorator.js","sourceRoot":"/","sources":["decorator/api/function/decorator.ts"],"names":[],"mappings":";;AAUA,kCA0CC;AApDD,wCAAiD;AAEjD,yDAAuD;AACvD,yDAAuD;AACvD,6DAA0D;AAC1D,mDAAiD;AACjD,yDAAuD;AAIvD,SAAgB,WAAW,CAAuB,OAA4F;IAC7I,OAAO,UAAU,OAAY,EAAE,YAAoB,EAAE,UAA8B;QAClF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,UAA+C,GAAG,UAAsB;YAC1F,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;gBACtB,KAAK,uBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAChC,OAAO,IAAA,uCAAkB,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAClI,CAAC;gBAED,KAAK,uBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;oBAC3B,OAAO,IAAA,8BAAc,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAC9H,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,OAAO,IAAA,oCAAiB,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE;wBACtE,KAAK,EAAE,cAAc;qBACrB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAClC,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,OAAO,IAAA,oCAAiB,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE;wBACtE,KAAK,EAAE,cAAc;qBACrB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAClC,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,OAAO,IAAA,oCAAiB,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE;wBACtE,KAAK,EAAE,cAAc;qBACrB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAClC,CAAC;gBAED,OAAO,CAAC,CAAC,CAAC;oBACT,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;gBACzC,CAAC;YACF,CAAC;YAED,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC/C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { EApiFunctionType } from \"../../../enum\";\n\nimport { ApiFunctionCreate } from \"./create.decorator\";\nimport { ApiFunctionDelete } from \"./delete.decorator\";\nimport { ApiFunctionGetList } from \"./get-list.decorator\";\nimport { ApiFunctionGet } from \"./get.decorator\";\nimport { ApiFunctionUpdate } from \"./update.decorator\";\n\nimport type { BaseEntity, FindOptionsRelations, Repository } from \"typeorm\";\n\nexport function ApiFunction<E extends BaseEntity>(options: { model: new () => E; relations?: FindOptionsRelations<E>; type: EApiFunctionType }) {\n\treturn function (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) {\n\t\tconst originalMethod = descriptor.value;\n\n\t\tdescriptor.value = function (this: { repository: Repository<E> }, ...arguments_: Array<any>) {\n\t\t\tswitch (options.type) {\n\t\t\t\tcase EApiFunctionType.GET_LIST: {\n\t\t\t\t\treturn ApiFunctionGetList({ model: options.model })(this, _propertyKey, { value: originalMethod }).value.apply(this, arguments_);\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.GET: {\n\t\t\t\t\treturn ApiFunctionGet({ model: options.model })(this, _propertyKey, { value: originalMethod }).value.apply(this, arguments_);\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.CREATE: {\n\t\t\t\t\treturn ApiFunctionCreate({ model: options.model })(this, _propertyKey, {\n\t\t\t\t\t\tvalue: originalMethod,\n\t\t\t\t\t}).value.apply(this, arguments_);\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.UPDATE: {\n\t\t\t\t\treturn ApiFunctionUpdate({ model: options.model })(this, _propertyKey, {\n\t\t\t\t\t\tvalue: originalMethod,\n\t\t\t\t\t}).value.apply(this, arguments_);\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.DELETE: {\n\t\t\t\t\treturn ApiFunctionDelete({ model: options.model })(this, _propertyKey, {\n\t\t\t\t\t\tvalue: originalMethod,\n\t\t\t\t\t}).value.apply(this, arguments_);\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"Unsupported function\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn originalMethod.apply(this, arguments_);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}
1
+ {"version":3,"file":"decorator.js","sourceRoot":"/","sources":["decorator/api/function/decorator.ts"],"names":[],"mappings":";;AAeA,kCAqDC;AApED,wCAAiD;AAEjD,8CAAkD;AAElD,yDAAuD;AACvD,yDAAuD;AACvD,6DAA0D;AAC1D,mDAAiD;AACjD,yDAAuD;AAOvD,SAAgB,WAAW,CAA8B,OAA4F;IAEpJ,OAAO,UAAU,OAAgB,EAAE,WAAmB,EAAE,UAA8B;QACrF,MAAM,cAAc,GAAY,UAAU,CAAC,KAAK,CAAC;QAGjD,UAAU,CAAC,KAAK,GAAG,UAA+C,GAAG,UAAsB;YAC1F,IAAI,iBAAqC,CAAC;YAE1C,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;gBACtB,KAAK,uBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAChC,iBAAiB,GAAG,IAAA,uCAAkB,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;oBAEjE,MAAM;gBACP,CAAC;gBAED,KAAK,uBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;oBAC3B,iBAAiB,GAAG,IAAA,8BAAc,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;oBAE7D,MAAM;gBACP,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,iBAAiB,GAAG,IAAA,oCAAiB,EAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;oBAEjE,MAAM;gBACP,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,iBAAiB,GAAG,IAAA,oCAAiB,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;oBAEhE,MAAM;gBACP,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,iBAAiB,GAAG,IAAA,oCAAiB,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;oBAEhE,MAAM;gBACP,CAAC;gBAED,OAAO,CAAC,CAAC,CAAC;oBACT,MAAM,IAAA,wBAAc,EAAC,sBAAsB,CAAC,CAAC;gBAC9C,CAAC;YACF,CAAC;YAED,MAAM,kBAAkB,GAAuB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC;YAC/G,MAAM,cAAc,GAAsC,kBAAkB,CAAC,KAA0C,CAAC;YAExH,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC/C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { EApiFunctionType } from \"../../../enum\";\n\nimport { ErrorException } from \"../../../utility\";\n\nimport { ApiFunctionCreate } from \"./create.decorator\";\nimport { ApiFunctionDelete } from \"./delete.decorator\";\nimport { ApiFunctionGetList } from \"./get-list.decorator\";\nimport { ApiFunctionGet } from \"./get.decorator\";\nimport { ApiFunctionUpdate } from \"./update.decorator\";\n\nimport type { IApiBaseEntity } from \"../../../interface\";\nimport type { FindOptionsRelations, Repository } from \"typeorm\";\n\ntype TDecoratorFunction = (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;\n\nexport function ApiFunction<E extends IApiBaseEntity, R>(options: { model: new () => E; relations?: FindOptionsRelations<E>; type: EApiFunctionType }) {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\treturn function (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\t\tconst originalMethod: unknown = descriptor.value;\n\n\t\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\t\tdescriptor.value = function (this: { repository: Repository<E> }, ...arguments_: Array<any>): any {\n\t\t\tlet decoratorFunction: TDecoratorFunction;\n\n\t\t\tswitch (options.type) {\n\t\t\t\tcase EApiFunctionType.GET_LIST: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionGetList({ model: options.model });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.GET: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionGet({ model: options.model });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.CREATE: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionCreate({ entity: options.model });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.UPDATE: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionUpdate({ model: options.model });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.DELETE: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionDelete({ model: options.model });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow ErrorException(\"Unsupported function\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst modifiedDescriptor: PropertyDescriptor = decoratorFunction(this, propertyKey, { value: originalMethod });\n\t\t\tconst modifiedMethod: (...arguments__: Array<any>) => R = modifiedDescriptor.value as (...arguments__: Array<any>) => R;\n\n\t\t\treturn modifiedMethod.apply(this, arguments_);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { BaseEntity } from "typeorm";
2
- export declare function ApiFunctionDelete<E extends BaseEntity>(options: {
1
+ import type { IApiBaseEntity } from "../../../interface";
2
+ export declare function ApiFunctionDelete<E extends IApiBaseEntity>(options: {
3
3
  model: new () => E;
4
- }): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
4
+ }): (_target: unknown, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -28,7 +28,7 @@ function ApiFunctionDelete(options) {
28
28
  descriptor.value = async function (id) {
29
29
  const repository = this.repository;
30
30
  if (!repository) {
31
- throw new Error("Repository is not available in this context");
31
+ throw (0, utility_1.ErrorException)("Repository is not available in this context");
32
32
  }
33
33
  if (!getFunction) {
34
34
  const getDescriptor = {
@@ -41,7 +41,7 @@ function ApiFunctionDelete(options) {
41
41
  getFunction = getDescriptor.value.bind(this);
42
42
  }
43
43
  else {
44
- throw new Error("Get function is not properly decorated");
44
+ throw (0, utility_1.ErrorException)("Get function is not properly decorated");
45
45
  }
46
46
  }
47
47
  return executor(repository, options.model, id, getFunction);
@@ -1 +1 @@
1
- {"version":3,"file":"delete.decorator.js","sourceRoot":"/","sources":["decorator/api/function/delete.decorator.ts"],"names":[],"mappings":";;AA+BA,8CAqCC;AApED,2CAA6E;AAE7E,wCAAmD;AACnD,8CAA+C;AAE/C,mDAAiD;AAKjD,KAAK,UAAU,QAAQ,CAAuB,UAAyB,EAAE,UAAuB,EAAE,EAAmB,EAAE,WAAkF;IACxM,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEhD,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEnB,IAAI,KAAK,YAAY,sBAAa,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC;QACb,CAAC;QAED,MAAM,IAAI,qCAA4B,CACrC,IAAA,qBAAW,EAAC;YACX,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,yBAAkB,CAAC,cAAc;SACvC,CAAC,CACF,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAgB,iBAAiB,CAAuB,OAA+B;IACtF,OAAO,UAAU,OAAY,EAAE,YAAoB,EAAE,UAA8B;QAClF,MAAM,YAAY,GAAG,IAAA,8BAAc,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC9D,IAAI,WAAkF,CAAC;QAEvF,UAAU,CAAC,KAAK,GAAG,KAAK,WAIvB,EAAmB;YAEnB,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU,CAAC;YAElD,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAChE,CAAC;YAED,IAAI,CAAC,WAAW,EAAE,CAAC;gBAClB,MAAM,aAAa,GAAmG;oBACrH,KAAK,EAAE;wBACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBACrD,CAAC;iBACD,CAAC;gBACF,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;gBAEzC,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;oBACzB,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9C,CAAC;qBAAM,CAAC;oBACP,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;gBAC3D,CAAC;YACF,CAAC;YAED,OAAO,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QAC7D,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { HttpException, InternalServerErrorException } from \"@nestjs/common\";\n\nimport { EErrorStringAction } from \"../../../enum\";\nimport { ErrorString } from \"../../../utility\";\n\nimport { ApiFunctionGet } from \"./get.decorator\";\n\nimport type { TApiFunctionGetProperties } from \"../../../type\";\nimport type { BaseEntity, Repository } from \"typeorm\";\n\nasync function executor<E extends BaseEntity>(repository: Repository<E>, entityType: new () => E, id: number | string, getFunction: (id: string, properties?: TApiFunctionGetProperties<E>) => Promise<E>): Promise<void> {\n\ttry {\n\t\tconst entity = await getFunction(id.toString());\n\n\t\tawait repository.remove(entity);\n\t} catch (error) {\n\t\tconsole.log(error);\n\n\t\tif (error instanceof HttpException) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tthrow new InternalServerErrorException(\n\t\t\tErrorString({\n\t\t\t\tentity: entityType,\n\t\t\t\ttype: EErrorStringAction.DELETING_ERROR,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nexport function ApiFunctionDelete<E extends BaseEntity>(options: { model: new () => E }) {\n\treturn function (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) {\n\t\tconst getDecorator = ApiFunctionGet({ model: options.model });\n\t\tlet getFunction: (id: string, properties?: TApiFunctionGetProperties<E>) => Promise<E>;\n\n\t\tdescriptor.value = async function (\n\t\t\tthis: {\n\t\t\t\trepository: Repository<E>;\n\t\t\t},\n\t\t\tid: number | string,\n\t\t) {\n\t\t\tconst repository: Repository<E> = this.repository;\n\n\t\t\tif (!repository) {\n\t\t\t\tthrow new Error(\"Repository is not available in this context\");\n\t\t\t}\n\n\t\t\tif (!getFunction) {\n\t\t\t\tconst getDescriptor: TypedPropertyDescriptor<(id: string, properties?: TApiFunctionGetProperties<E>) => Promise<E>> = {\n\t\t\t\t\tvalue: function () {\n\t\t\t\t\t\treturn Promise.reject(new Error(\"Not implemented\"));\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tgetDecorator(this, \"get\", getDescriptor);\n\n\t\t\t\tif (getDescriptor.value) {\n\t\t\t\t\tgetFunction = getDescriptor.value.bind(this);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(\"Get function is not properly decorated\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn executor(repository, options.model, id, getFunction);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}
1
+ {"version":3,"file":"delete.decorator.js","sourceRoot":"/","sources":["decorator/api/function/delete.decorator.ts"],"names":[],"mappings":";;AAkCA,8CAsCC;AAxED,2CAA6E;AAE7E,wCAAmD;AAEnD,8CAA+D;AAE/D,mDAAiD;AAOjD,KAAK,UAAU,QAAQ,CAA2B,UAAyB,EAAE,UAAuB,EAAE,EAAmB,EAAE,WAAkF;IAC5M,IAAI,CAAC;QACJ,MAAM,MAAM,GAAM,MAAM,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEnD,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEnB,IAAI,KAAK,YAAY,sBAAa,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC;QACb,CAAC;QAED,MAAM,IAAI,qCAA4B,CACrC,IAAA,qBAAW,EAAC;YACX,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,yBAAkB,CAAC,cAAc;SACvC,CAAC,CACF,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAgB,iBAAiB,CAA2B,OAA+B;IAE1F,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B;QACtF,MAAM,YAAY,GAA+F,IAAA,8BAAc,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1J,IAAI,WAAkF,CAAC;QAEvF,UAAU,CAAC,KAAK,GAAG,KAAK,WAIvB,EAAmB;YAEnB,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU,CAAC;YAElD,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,MAAM,IAAA,wBAAc,EAAC,6CAA6C,CAAC,CAAC;YACrE,CAAC;YAED,IAAI,CAAC,WAAW,EAAE,CAAC;gBAClB,MAAM,aAAa,GAAmG;oBACrH,KAAK,EAAE;wBACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBACrD,CAAC;iBACD,CAAC;gBACF,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;gBAEzC,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;oBACzB,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9C,CAAC;qBAAM,CAAC;oBACP,MAAM,IAAA,wBAAc,EAAC,wCAAwC,CAAC,CAAC;gBAChE,CAAC;YACF,CAAC;YAED,OAAO,QAAQ,CAAI,UAAU,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QAChE,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { HttpException, InternalServerErrorException } from \"@nestjs/common\";\n\nimport { EErrorStringAction } from \"../../../enum\";\n\nimport { ErrorException, ErrorString } from \"../../../utility\";\n\nimport { ApiFunctionGet } from \"./get.decorator\";\n\nimport type { IApiBaseEntity } from \"../../../interface\";\n\nimport type { TApiFunctionGetProperties } from \"../../../type\";\nimport type { Repository } from \"typeorm\";\n\nasync function executor<E extends IApiBaseEntity>(repository: Repository<E>, entityType: new () => E, id: number | string, getFunction: (id: string, properties?: TApiFunctionGetProperties<E>) => Promise<E>): Promise<void> {\n\ttry {\n\t\tconst entity: E = await getFunction(id.toString());\n\n\t\tawait repository.remove(entity);\n\t} catch (error) {\n\t\tconsole.log(error);\n\n\t\tif (error instanceof HttpException) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tthrow new InternalServerErrorException(\n\t\t\tErrorString({\n\t\t\t\tentity: entityType,\n\t\t\t\ttype: EErrorStringAction.DELETING_ERROR,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nexport function ApiFunctionDelete<E extends IApiBaseEntity>(options: { model: new () => E }) {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\treturn function (_target: unknown, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\t\tconst getDecorator: (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor = ApiFunctionGet({ model: options.model });\n\t\tlet getFunction: (id: string, properties?: TApiFunctionGetProperties<E>) => Promise<E>;\n\n\t\tdescriptor.value = async function (\n\t\t\tthis: {\n\t\t\t\trepository: Repository<E>;\n\t\t\t},\n\t\t\tid: number | string,\n\t\t): Promise<void> {\n\t\t\tconst repository: Repository<E> = this.repository;\n\n\t\t\tif (!repository) {\n\t\t\t\tthrow ErrorException(\"Repository is not available in this context\");\n\t\t\t}\n\n\t\t\tif (!getFunction) {\n\t\t\t\tconst getDescriptor: TypedPropertyDescriptor<(id: string, properties?: TApiFunctionGetProperties<E>) => Promise<E>> = {\n\t\t\t\t\tvalue: function () {\n\t\t\t\t\t\treturn Promise.reject(new Error(\"Not implemented\"));\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tgetDecorator(this, \"get\", getDescriptor);\n\n\t\t\t\tif (getDescriptor.value) {\n\t\t\t\t\tgetFunction = getDescriptor.value.bind(this);\n\t\t\t\t} else {\n\t\t\t\t\tthrow ErrorException(\"Get function is not properly decorated\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn executor<E>(repository, options.model, id, getFunction);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}