@elsikora/nestjs-crud-automator 1.2.0 → 1.2.2

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 (417) 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/class/index.d.ts +1 -0
  8. package/dist/class/index.js +1 -0
  9. package/dist/class/index.js.map +1 -1
  10. package/dist/class/utility/dto/index.d.ts +2 -0
  11. package/dist/{decorator/api/route → class/utility/dto}/index.js +2 -2
  12. package/dist/class/utility/dto/index.js.map +1 -0
  13. package/dist/class/utility/dto/property/factory/boolean.class.d.ts +5 -0
  14. package/dist/class/utility/dto/property/factory/boolean.class.js +15 -0
  15. package/dist/class/utility/dto/property/factory/boolean.class.js.map +1 -0
  16. package/dist/class/utility/dto/property/factory/date.class.d.ts +5 -0
  17. package/dist/class/utility/dto/property/factory/date.class.js +15 -0
  18. package/dist/class/utility/dto/property/factory/date.class.js.map +1 -0
  19. package/dist/class/utility/dto/property/factory/index.d.ts +6 -0
  20. package/dist/{dto/exception → class/utility/dto/property/factory}/index.js +6 -7
  21. package/dist/class/utility/dto/property/factory/index.js.map +1 -0
  22. package/dist/class/utility/dto/property/factory/number.class.d.ts +5 -0
  23. package/dist/class/utility/dto/property/factory/number.class.js +19 -0
  24. package/dist/class/utility/dto/property/factory/number.class.js.map +1 -0
  25. package/dist/class/utility/dto/property/factory/object.class.d.ts +5 -0
  26. package/dist/class/utility/dto/property/factory/object.class.js +17 -0
  27. package/dist/class/utility/dto/property/factory/object.class.js.map +1 -0
  28. package/dist/class/utility/dto/property/factory/relation.class.d.ts +5 -0
  29. package/dist/class/utility/dto/property/factory/relation.class.js +11 -0
  30. package/dist/class/utility/dto/property/factory/relation.class.js.map +1 -0
  31. package/dist/class/utility/dto/property/factory/string.class.d.ts +5 -0
  32. package/dist/class/utility/dto/property/factory/string.class.js +15 -0
  33. package/dist/class/utility/dto/property/factory/string.class.js.map +1 -0
  34. package/dist/class/utility/dto/property/factory/uuid.class.d.ts +5 -0
  35. package/dist/class/utility/dto/property/factory/uuid.class.js +11 -0
  36. package/dist/class/utility/dto/property/factory/uuid.class.js.map +1 -0
  37. package/dist/class/utility/dto/property/index.d.ts +1 -0
  38. package/dist/{dto → class/utility/dto/property}/index.js +1 -1
  39. package/dist/class/utility/dto/property/index.js.map +1 -0
  40. package/dist/class/utility/dto/strategy/body.class.d.ts +6 -0
  41. package/dist/class/utility/dto/strategy/body.class.js +21 -0
  42. package/dist/class/utility/dto/strategy/body.class.js.map +1 -0
  43. package/dist/class/utility/dto/strategy/index.d.ts +4 -0
  44. package/dist/class/utility/dto/strategy/index.js +21 -0
  45. package/dist/class/utility/dto/strategy/index.js.map +1 -0
  46. package/dist/class/utility/dto/strategy/query.class.d.ts +6 -0
  47. package/dist/class/utility/dto/strategy/query.class.js +18 -0
  48. package/dist/class/utility/dto/strategy/query.class.js.map +1 -0
  49. package/dist/class/utility/dto/strategy/request.class.d.ts +6 -0
  50. package/dist/class/utility/dto/strategy/request.class.js +26 -0
  51. package/dist/class/utility/dto/strategy/request.class.js.map +1 -0
  52. package/dist/class/utility/dto/strategy/response.class.d.ts +6 -0
  53. package/dist/class/utility/dto/strategy/response.class.js +18 -0
  54. package/dist/class/utility/dto/strategy/response.class.js.map +1 -0
  55. package/dist/class/utility/index.d.ts +1 -0
  56. package/dist/class/utility/index.js +18 -0
  57. package/dist/class/utility/index.js.map +1 -0
  58. package/dist/constant/decorator/api/controller.constant.d.ts +1 -1
  59. package/dist/constant/decorator/api/controller.constant.js +2 -2
  60. package/dist/constant/decorator/api/controller.constant.js.map +1 -1
  61. package/dist/constant/decorator/api/function.constant.d.ts +1 -1
  62. package/dist/constant/decorator/api/function.constant.js +2 -2
  63. package/dist/constant/decorator/api/function.constant.js.map +1 -1
  64. package/dist/constant/decorator/api/property-describe.constant.d.ts +1 -1
  65. package/dist/constant/decorator/api/property-describe.constant.js +2 -2
  66. package/dist/constant/decorator/api/property-describe.constant.js.map +1 -1
  67. package/dist/constant/factory/dto/get-list-query.constant.d.ts +1 -2
  68. package/dist/constant/factory/dto/get-list-query.constant.js +2 -2
  69. package/dist/constant/factory/dto/get-list-query.constant.js.map +1 -1
  70. package/dist/constant/interface/api/filter.constant.d.ts +1 -1
  71. package/dist/constant/interface/api/filter.constant.js +2 -2
  72. package/dist/constant/interface/api/filter.constant.js.map +1 -1
  73. package/dist/constant/interface/api/index.d.ts +1 -0
  74. package/dist/constant/interface/api/index.js +1 -0
  75. package/dist/constant/interface/api/index.js.map +1 -1
  76. package/dist/constant/interface/api/property/string.constant.d.ts +1 -1
  77. package/dist/constant/interface/api/property/string.constant.js +2 -2
  78. package/dist/constant/interface/api/property/string.constant.js.map +1 -1
  79. package/dist/constant/interface/api/property/wallet.constant.d.ts +1 -1
  80. package/dist/constant/interface/api/property/wallet.constant.js +2 -2
  81. package/dist/constant/interface/api/property/wallet.constant.js.map +1 -1
  82. package/dist/constant/utility/dto/constant.d.ts +6 -0
  83. package/dist/constant/utility/dto/constant.js +27 -0
  84. package/dist/constant/utility/dto/constant.js.map +1 -0
  85. package/dist/decorator/api/controller.decorator.d.ts +3 -7
  86. package/dist/decorator/api/controller.decorator.js +2 -2
  87. package/dist/decorator/api/controller.decorator.js.map +1 -1
  88. package/dist/decorator/api/function/create.decorator.d.ts +2 -4
  89. package/dist/decorator/api/function/create.decorator.js +25 -17
  90. package/dist/decorator/api/function/create.decorator.js.map +1 -1
  91. package/dist/decorator/api/function/decorator.d.ts +3 -7
  92. package/dist/decorator/api/function/decorator.js +20 -16
  93. package/dist/decorator/api/function/decorator.js.map +1 -1
  94. package/dist/decorator/api/function/delete.decorator.d.ts +3 -3
  95. package/dist/decorator/api/function/delete.decorator.js +6 -6
  96. package/dist/decorator/api/function/delete.decorator.js.map +1 -1
  97. package/dist/decorator/api/function/get-list.decorator.d.ts +3 -3
  98. package/dist/decorator/api/function/get-list.decorator.js +9 -8
  99. package/dist/decorator/api/function/get-list.decorator.js.map +1 -1
  100. package/dist/decorator/api/function/get.decorator.d.ts +3 -3
  101. package/dist/decorator/api/function/get.decorator.js +8 -9
  102. package/dist/decorator/api/function/get.decorator.js.map +1 -1
  103. package/dist/decorator/api/function/update.decorator.d.ts +3 -3
  104. package/dist/decorator/api/function/update.decorator.js +10 -14
  105. package/dist/decorator/api/function/update.decorator.js.map +1 -1
  106. package/dist/decorator/api/index.d.ts +0 -1
  107. package/dist/decorator/api/index.js +0 -1
  108. package/dist/decorator/api/index.js.map +1 -1
  109. package/dist/decorator/api/method.decorator.js +58 -0
  110. package/dist/decorator/api/method.decorator.js.map +1 -1
  111. package/dist/decorator/api/property/date.decorator.js.map +1 -1
  112. package/dist/decorator/api/property/describe.decorator.js +1 -1
  113. package/dist/decorator/api/property/describe.decorator.js.map +1 -1
  114. package/dist/decorator/api/property/string.decorator.js +13 -6
  115. package/dist/decorator/api/property/string.decorator.js.map +1 -1
  116. package/dist/decorator/api/property/wallet.decorator.js +3 -3
  117. package/dist/decorator/api/property/wallet.decorator.js.map +1 -1
  118. package/dist/decorator/api/service.decorator.d.ts +3 -6
  119. package/dist/decorator/api/service.decorator.js +23 -49
  120. package/dist/decorator/api/service.decorator.js.map +1 -1
  121. package/dist/enum/decorator/api/authentication-type.enum.d.ts +1 -0
  122. package/dist/enum/decorator/api/authentication-type.enum.js +1 -0
  123. package/dist/enum/decorator/api/authentication-type.enum.js.map +1 -1
  124. package/dist/enum/decorator/api/dto-type.enum.d.ts +3 -3
  125. package/dist/enum/decorator/api/dto-type.enum.js +2 -2
  126. package/dist/enum/decorator/api/dto-type.enum.js.map +1 -1
  127. package/dist/enum/decorator/api/property/desribe-type.enum.d.ts +2 -1
  128. package/dist/enum/decorator/api/property/desribe-type.enum.js +1 -0
  129. package/dist/enum/decorator/api/property/desribe-type.enum.js.map +1 -1
  130. package/dist/factory/api/controller.factory.d.ts +8 -8
  131. package/dist/factory/api/controller.factory.js +89 -55
  132. package/dist/factory/api/controller.factory.js.map +1 -1
  133. package/dist/index.d.ts +0 -1
  134. package/dist/index.js +0 -1
  135. package/dist/index.js.map +1 -1
  136. package/dist/interceptor/correlation-id-response-body.interceptor.js +0 -8
  137. package/dist/interceptor/correlation-id-response-body.interceptor.js.map +1 -1
  138. package/dist/interface/class/dto/index.d.ts +1 -0
  139. package/dist/interface/class/dto/index.js +18 -0
  140. package/dist/interface/class/dto/index.js.map +1 -0
  141. package/dist/interface/class/dto/strategy.interface.d.ts +5 -0
  142. package/dist/{type/decorator/api/function/get-properties.type.js → interface/class/dto/strategy.interface.js} +1 -1
  143. package/dist/interface/class/dto/strategy.interface.js.map +1 -0
  144. package/dist/interface/class/index.d.ts +1 -0
  145. package/dist/interface/class/index.js +18 -0
  146. package/dist/interface/class/index.js.map +1 -0
  147. package/dist/interface/decorator/api/controller-properties.interface.d.ts +12 -7
  148. package/dist/interface/decorator/api/controller-properties.interface.js.map +1 -1
  149. package/dist/interface/decorator/api/function/create-properties.interface.d.ts +4 -0
  150. package/dist/interface/decorator/api/function/create-properties.interface.js +3 -0
  151. package/dist/interface/decorator/api/function/create-properties.interface.js.map +1 -0
  152. package/dist/interface/decorator/api/index.d.ts +1 -0
  153. package/dist/interface/decorator/api/index.js +1 -0
  154. package/dist/interface/decorator/api/index.js.map +1 -1
  155. package/dist/interface/decorator/api/method/properties.interface.d.ts +3 -2
  156. package/dist/interface/decorator/api/method/properties.interface.js.map +1 -1
  157. package/dist/interface/decorator/api/property/base-properties.interface.d.ts +1 -1
  158. package/dist/interface/decorator/api/property/base-properties.interface.js.map +1 -1
  159. package/dist/interface/dto-generate-factory.interface.d.ts +5 -0
  160. package/dist/interface/dto-generate-factory.interface.js +3 -0
  161. package/dist/interface/dto-generate-factory.interface.js.map +1 -0
  162. package/dist/interface/index.d.ts +2 -0
  163. package/dist/interface/index.js +2 -0
  164. package/dist/interface/index.js.map +1 -1
  165. package/dist/interface/utility/get-entity-columns-properties.interface.d.ts +5 -0
  166. package/dist/interface/utility/get-entity-columns-properties.interface.js +3 -0
  167. package/dist/interface/utility/get-entity-columns-properties.interface.js.map +1 -0
  168. package/dist/tsconfig.build.tsbuildinfo +1 -1
  169. package/dist/type/decorator/api/controller/constructor.type.d.ts +4 -0
  170. package/dist/type/decorator/api/{function/create-properties.type.js → controller/constructor.type.js} +1 -1
  171. package/dist/type/decorator/api/controller/constructor.type.js.map +1 -0
  172. package/dist/type/decorator/api/controller/index.d.ts +1 -0
  173. package/dist/type/decorator/api/controller/index.js +18 -0
  174. package/dist/type/decorator/api/controller/index.js.map +1 -0
  175. package/dist/type/decorator/api/function/create/executor-properties.type.d.ts +8 -0
  176. package/dist/type/decorator/api/function/create/executor-properties.type.js +3 -0
  177. package/dist/type/decorator/api/function/create/executor-properties.type.js.map +1 -0
  178. package/dist/type/decorator/api/function/create/index.d.ts +2 -0
  179. package/dist/type/decorator/api/function/create/index.js +19 -0
  180. package/dist/type/decorator/api/function/create/index.js.map +1 -0
  181. package/dist/type/decorator/api/function/{update-properties.type.js → create/properties.type.js} +1 -1
  182. package/dist/type/decorator/api/function/create/properties.type.js.map +1 -0
  183. package/dist/type/decorator/api/function/delete/executor-properties.type.d.ts +9 -0
  184. package/dist/type/decorator/api/function/delete/executor-properties.type.js +3 -0
  185. package/dist/type/decorator/api/function/delete/executor-properties.type.js.map +1 -0
  186. package/dist/type/decorator/api/function/delete/index.d.ts +1 -0
  187. package/dist/type/decorator/api/function/delete/index.js +18 -0
  188. package/dist/type/decorator/api/function/delete/index.js.map +1 -0
  189. package/dist/type/decorator/api/function/get/executor-properties.type.d.ts +7 -0
  190. package/dist/type/decorator/api/function/get/executor-properties.type.js +3 -0
  191. package/dist/type/decorator/api/function/get/executor-properties.type.js.map +1 -0
  192. package/dist/type/decorator/api/function/get/index.d.ts +2 -0
  193. package/dist/type/decorator/api/function/get/index.js +19 -0
  194. package/dist/type/decorator/api/function/get/index.js.map +1 -0
  195. package/dist/type/decorator/api/function/get/properties.type.js +3 -0
  196. package/dist/type/decorator/api/function/get/properties.type.js.map +1 -0
  197. package/dist/type/decorator/api/function/get-list/base-properties.type.d.ts +16 -0
  198. package/dist/type/decorator/api/function/get-list/base-properties.type.js +3 -0
  199. package/dist/type/decorator/api/function/get-list/base-properties.type.js.map +1 -0
  200. package/dist/type/decorator/api/function/get-list/executor-properties.type.d.ts +9 -0
  201. package/dist/type/decorator/api/function/get-list/executor-properties.type.js +3 -0
  202. package/dist/type/decorator/api/function/get-list/executor-properties.type.js.map +1 -0
  203. package/dist/type/decorator/api/function/get-list/index.d.ts +3 -0
  204. package/dist/type/decorator/api/function/get-list/index.js +20 -0
  205. package/dist/type/decorator/api/function/get-list/index.js.map +1 -0
  206. package/dist/type/decorator/api/function/get-list/properties.type.d.ts +9 -0
  207. package/dist/type/decorator/api/function/get-list/properties.type.js +3 -0
  208. package/dist/type/decorator/api/function/get-list/properties.type.js.map +1 -0
  209. package/dist/type/decorator/api/function/index.d.ts +5 -4
  210. package/dist/type/decorator/api/function/index.js +5 -4
  211. package/dist/type/decorator/api/function/index.js.map +1 -1
  212. package/dist/type/decorator/api/function/properties.type.d.ts +7 -0
  213. package/dist/type/decorator/api/function/properties.type.js +3 -0
  214. package/dist/type/decorator/api/function/properties.type.js.map +1 -0
  215. package/dist/type/decorator/api/function/update/executor-properties.type.d.ts +11 -0
  216. package/dist/type/decorator/api/function/update/executor-properties.type.js +3 -0
  217. package/dist/type/decorator/api/function/update/executor-properties.type.js.map +1 -0
  218. package/dist/type/decorator/api/function/update/index.d.ts +2 -0
  219. package/dist/type/decorator/api/function/update/index.js +19 -0
  220. package/dist/type/decorator/api/function/update/index.js.map +1 -0
  221. package/dist/type/decorator/api/function/update/properties.type.js +3 -0
  222. package/dist/type/decorator/api/function/update/properties.type.js.map +1 -0
  223. package/dist/type/decorator/api/index.d.ts +1 -0
  224. package/dist/type/decorator/api/index.js +1 -0
  225. package/dist/type/decorator/api/index.js.map +1 -1
  226. package/dist/type/decorator/api/property/describe/array/index.d.ts +2 -0
  227. package/dist/type/decorator/api/property/describe/array/index.js +19 -0
  228. package/dist/type/decorator/api/property/describe/array/index.js.map +1 -0
  229. package/dist/type/decorator/api/property/describe/array/optional-properties.type.d.ts +3 -0
  230. package/dist/type/decorator/api/property/describe/array/optional-properties.type.js +3 -0
  231. package/dist/type/decorator/api/property/describe/array/optional-properties.type.js.map +1 -0
  232. package/dist/type/decorator/api/property/describe/array/required-properties.type.d.ts +6 -0
  233. package/dist/type/decorator/api/property/describe/array/required-properties.type.js +3 -0
  234. package/dist/type/decorator/api/property/describe/array/required-properties.type.js.map +1 -0
  235. package/dist/type/decorator/api/property/describe/base-properties.type.d.ts +7 -0
  236. package/dist/type/decorator/api/property/describe/base-properties.type.js +3 -0
  237. package/dist/type/decorator/api/property/describe/base-properties.type.js.map +1 -0
  238. package/dist/type/decorator/api/property/describe/boolean-properties.type.d.ts +7 -0
  239. package/dist/type/decorator/api/property/describe/boolean-properties.type.js +3 -0
  240. package/dist/type/decorator/api/property/describe/boolean-properties.type.js.map +1 -0
  241. package/dist/type/decorator/api/property/describe/date-properties.type.d.ts +7 -0
  242. package/dist/type/decorator/api/property/describe/date-properties.type.js +3 -0
  243. package/dist/type/decorator/api/property/describe/date-properties.type.js.map +1 -0
  244. package/dist/type/decorator/api/property/describe/dto/body-properties.type.d.ts +5 -0
  245. package/dist/type/decorator/api/property/describe/dto/body-properties.type.js +3 -0
  246. package/dist/type/decorator/api/property/describe/dto/body-properties.type.js.map +1 -0
  247. package/dist/type/decorator/api/property/describe/dto/index.d.ts +5 -0
  248. package/dist/type/decorator/api/property/describe/dto/index.js +22 -0
  249. package/dist/type/decorator/api/property/describe/dto/index.js.map +1 -0
  250. package/dist/type/decorator/api/property/describe/dto/properties.type.d.ts +6 -0
  251. package/dist/type/decorator/api/property/describe/dto/properties.type.js +3 -0
  252. package/dist/type/decorator/api/property/describe/dto/properties.type.js.map +1 -0
  253. package/dist/type/decorator/api/property/describe/dto/query/get-list-properties.type.d.ts +3 -0
  254. package/dist/type/decorator/api/property/describe/dto/query/get-list-properties.type.js.map +1 -0
  255. package/dist/type/decorator/api/property/describe/dto/query/index.d.ts +2 -0
  256. package/dist/type/decorator/api/property/describe/dto/query/index.js +19 -0
  257. package/dist/type/decorator/api/property/describe/dto/query/index.js.map +1 -0
  258. package/dist/type/decorator/api/property/describe/dto/query/properties.type.d.ts +6 -0
  259. package/dist/type/decorator/api/property/describe/dto/query/properties.type.js +3 -0
  260. package/dist/type/decorator/api/property/describe/dto/query/properties.type.js.map +1 -0
  261. package/dist/type/decorator/api/property/describe/dto/request-properties.type.d.ts +5 -0
  262. package/dist/type/decorator/api/property/describe/dto/request-properties.type.js +3 -0
  263. package/dist/type/decorator/api/property/describe/dto/request-properties.type.js.map +1 -0
  264. package/dist/type/decorator/api/property/describe/dto/response-properties.type.d.ts +5 -0
  265. package/dist/type/decorator/api/property/describe/dto/response-properties.type.js +3 -0
  266. package/dist/type/decorator/api/property/describe/dto/response-properties.type.js.map +1 -0
  267. package/dist/type/decorator/api/property/describe/example-properties.type.d.ts +7 -0
  268. package/dist/type/decorator/api/property/describe/example-properties.type.js +3 -0
  269. package/dist/type/decorator/api/property/describe/example-properties.type.js.map +1 -0
  270. package/dist/type/decorator/api/property/describe/index.d.ts +12 -0
  271. package/dist/type/decorator/api/property/describe/index.js +29 -0
  272. package/dist/type/decorator/api/property/describe/index.js.map +1 -0
  273. package/dist/type/decorator/api/property/describe/number-properties.type.d.ts +13 -0
  274. package/dist/type/decorator/api/property/describe/number-properties.type.js +3 -0
  275. package/dist/type/decorator/api/property/describe/number-properties.type.js.map +1 -0
  276. package/dist/type/decorator/api/property/describe/object-properties.type.d.ts +10 -0
  277. package/dist/type/decorator/api/property/describe/object-properties.type.js +3 -0
  278. package/dist/type/decorator/api/property/describe/object-properties.type.js.map +1 -0
  279. package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.d.ts +2 -0
  280. package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.js +3 -0
  281. package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.js.map +1 -0
  282. package/dist/type/decorator/api/property/describe/properties/base-properties.type.d.ts +10 -0
  283. package/dist/type/decorator/api/property/describe/properties/base-properties.type.js +3 -0
  284. package/dist/type/decorator/api/property/describe/properties/base-properties.type.js.map +1 -0
  285. package/dist/type/decorator/api/property/describe/properties/index.d.ts +2 -0
  286. package/dist/type/decorator/api/property/describe/properties/index.js +19 -0
  287. package/dist/type/decorator/api/property/describe/properties/index.js.map +1 -0
  288. package/dist/type/decorator/api/property/describe/properties.type.d.ts +8 -0
  289. package/dist/type/decorator/api/property/describe/properties.type.js +3 -0
  290. package/dist/type/decorator/api/property/describe/properties.type.js.map +1 -0
  291. package/dist/type/decorator/api/property/describe/relation-properties.type.d.ts +6 -0
  292. package/dist/type/decorator/api/property/describe/relation-properties.type.js +3 -0
  293. package/dist/type/decorator/api/property/describe/relation-properties.type.js.map +1 -0
  294. package/dist/type/decorator/api/property/describe/string-properties.type.d.ts +13 -0
  295. package/dist/type/decorator/api/property/describe/string-properties.type.js +3 -0
  296. package/dist/type/decorator/api/property/describe/string-properties.type.js.map +1 -0
  297. package/dist/type/decorator/api/property/describe/uuid-properties.type.d.ts +7 -0
  298. package/dist/type/decorator/api/property/describe/uuid-properties.type.js +3 -0
  299. package/dist/type/decorator/api/property/describe/uuid-properties.type.js.map +1 -0
  300. package/dist/type/decorator/api/property/index.d.ts +1 -1
  301. package/dist/type/decorator/api/property/index.js +1 -1
  302. package/dist/type/decorator/api/property/index.js.map +1 -1
  303. package/dist/type/decorator/api/service-properties.type.d.ts +3 -0
  304. package/dist/type/decorator/api/service-properties.type.js +3 -0
  305. package/dist/type/decorator/api/service-properties.type.js.map +1 -0
  306. package/dist/type/index.d.ts +1 -0
  307. package/dist/type/index.js +1 -0
  308. package/dist/type/index.js.map +1 -1
  309. package/dist/type/utility/dto/generate-allowed-combination.type.d.ts +9 -0
  310. package/dist/type/utility/dto/generate-allowed-combination.type.js +3 -0
  311. package/dist/type/utility/dto/generate-allowed-combination.type.js.map +1 -0
  312. package/dist/type/utility/dto/generate-is-allowed-combination.type.d.ts +3 -0
  313. package/dist/type/utility/dto/generate-is-allowed-combination.type.js +3 -0
  314. package/dist/type/utility/dto/generate-is-allowed-combination.type.js.map +1 -0
  315. package/dist/type/utility/dto/index.d.ts +2 -0
  316. package/dist/type/utility/dto/index.js +19 -0
  317. package/dist/type/utility/dto/index.js.map +1 -0
  318. package/dist/type/utility/index.d.ts +1 -0
  319. package/dist/type/utility/index.js +18 -0
  320. package/dist/type/utility/index.js.map +1 -0
  321. package/dist/utility/api/controller/get-method-name.utility.d.ts +1 -1
  322. package/dist/utility/api/controller/get-method-name.utility.js +1 -1
  323. package/dist/utility/api/controller/get-method-name.utility.js.map +1 -1
  324. package/dist/utility/api/controller/write-method.utility.d.ts +3 -3
  325. package/dist/utility/api/controller/write-method.utility.js +2 -2
  326. package/dist/utility/api/controller/write-method.utility.js.map +1 -1
  327. package/dist/utility/api/filter-order-by-from-entity.utility.d.ts +4 -2
  328. package/dist/utility/api/filter-order-by-from-entity.utility.js +17 -14
  329. package/dist/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
  330. package/dist/utility/dto/analize.utility.js.map +1 -1
  331. package/dist/utility/dto/build-decorator.utility.d.ts +4 -0
  332. package/dist/utility/dto/build-decorator.utility.js +31 -0
  333. package/dist/utility/dto/build-decorator.utility.js.map +1 -0
  334. package/dist/utility/dto/generate-decorator.utility.d.ts +3 -0
  335. package/dist/utility/dto/generate-decorator.utility.js +15 -0
  336. package/dist/utility/dto/generate-decorator.utility.js.map +1 -0
  337. package/dist/utility/dto/generate-exception.utility.d.ts +2 -0
  338. package/dist/utility/dto/generate-exception.utility.js +88 -0
  339. package/dist/utility/dto/generate-exception.utility.js.map +1 -0
  340. package/dist/utility/dto/generate.utility.d.ts +2 -2
  341. package/dist/utility/dto/generate.utility.js +51 -308
  342. package/dist/utility/dto/generate.utility.js.map +1 -1
  343. package/dist/utility/dto/get-base-class.utility.d.ts +3 -0
  344. package/dist/utility/dto/get-base-class.utility.js +65 -0
  345. package/dist/utility/dto/get-base-class.utility.js.map +1 -0
  346. package/dist/utility/dto/get-decorator-config.utility.d.ts +3 -0
  347. package/dist/utility/dto/get-decorator-config.utility.js +21 -0
  348. package/dist/utility/dto/get-decorator-config.utility.js.map +1 -0
  349. package/dist/utility/dto/handle-date-property.utility.d.ts +5 -0
  350. package/dist/utility/dto/handle-date-property.utility.js +18 -0
  351. package/dist/utility/dto/handle-date-property.utility.js.map +1 -0
  352. package/dist/utility/dto/index.d.ts +8 -0
  353. package/dist/utility/dto/index.js +8 -0
  354. package/dist/utility/dto/index.js.map +1 -1
  355. package/dist/utility/dto/is-property-should-be-enabled.utility.d.ts +3 -0
  356. package/dist/utility/dto/is-property-should-be-enabled.utility.js +26 -0
  357. package/dist/utility/dto/is-property-should-be-enabled.utility.js.map +1 -0
  358. package/dist/utility/dto/is-should-be-generated.utility.d.ts +2 -0
  359. package/dist/utility/dto/is-should-be-generated.utility.js +25 -0
  360. package/dist/utility/dto/is-should-be-generated.utility.js.map +1 -0
  361. package/dist/utility/dto/validate-property-config.utility.d.ts +2 -0
  362. package/dist/utility/dto/validate-property-config.utility.js +14 -0
  363. package/dist/utility/dto/validate-property-config.utility.js.map +1 -0
  364. package/dist/utility/generate-entity-information.utility.js +15 -6
  365. package/dist/utility/generate-entity-information.utility.js.map +1 -1
  366. package/dist/utility/get-entity-columns.utility.d.ts +3 -2
  367. package/dist/utility/get-entity-columns.utility.js +4 -3
  368. package/dist/utility/get-entity-columns.utility.js.map +1 -1
  369. package/package.json +4 -1
  370. package/dist/class/api/base-controller.class.d.ts +0 -4
  371. package/dist/class/api/base-controller.class.js +0 -10
  372. package/dist/class/api/base-controller.class.js.map +0 -1
  373. package/dist/decorator/api/route/decorator.d.ts +0 -18
  374. package/dist/decorator/api/route/decorator.js +0 -43
  375. package/dist/decorator/api/route/decorator.js.map +0 -1
  376. package/dist/decorator/api/route/get.decorator.d.ts +0 -9
  377. package/dist/decorator/api/route/get.decorator.js +0 -53
  378. package/dist/decorator/api/route/get.decorator.js.map +0 -1
  379. package/dist/decorator/api/route/index.d.ts +0 -2
  380. package/dist/decorator/api/route/index.js.map +0 -1
  381. package/dist/dto/exception/bad-request.dto.d.ts +0 -8
  382. package/dist/dto/exception/bad-request.dto.js +0 -84
  383. package/dist/dto/exception/bad-request.dto.js.map +0 -1
  384. package/dist/dto/exception/conflict.dto.d.ts +0 -8
  385. package/dist/dto/exception/conflict.dto.js +0 -84
  386. package/dist/dto/exception/conflict.dto.js.map +0 -1
  387. package/dist/dto/exception/forbidden.dto.d.ts +0 -8
  388. package/dist/dto/exception/forbidden.dto.js +0 -84
  389. package/dist/dto/exception/forbidden.dto.js.map +0 -1
  390. package/dist/dto/exception/index.d.ts +0 -7
  391. package/dist/dto/exception/index.js.map +0 -1
  392. package/dist/dto/exception/internal-server-error.dto.d.ts +0 -8
  393. package/dist/dto/exception/internal-server-error.dto.js +0 -84
  394. package/dist/dto/exception/internal-server-error.dto.js.map +0 -1
  395. package/dist/dto/exception/not-found.dto.d.ts +0 -8
  396. package/dist/dto/exception/not-found.dto.js +0 -84
  397. package/dist/dto/exception/not-found.dto.js.map +0 -1
  398. package/dist/dto/exception/too-many-requests.dto.d.ts +0 -8
  399. package/dist/dto/exception/too-many-requests.dto.js +0 -84
  400. package/dist/dto/exception/too-many-requests.dto.js.map +0 -1
  401. package/dist/dto/exception/unauthorized.dto.d.ts +0 -8
  402. package/dist/dto/exception/unauthorized.dto.js +0 -84
  403. package/dist/dto/exception/unauthorized.dto.js.map +0 -1
  404. package/dist/dto/index.d.ts +0 -1
  405. package/dist/dto/index.js.map +0 -1
  406. package/dist/type/decorator/api/function/create-properties.type.js.map +0 -1
  407. package/dist/type/decorator/api/function/get-list-properties.type.d.ts +0 -23
  408. package/dist/type/decorator/api/function/get-list-properties.type.js.map +0 -1
  409. package/dist/type/decorator/api/function/get-properties.type.js.map +0 -1
  410. package/dist/type/decorator/api/function/update-properties.type.js.map +0 -1
  411. package/dist/type/decorator/api/property/describe-properties.type.d.ts +0 -64
  412. package/dist/type/decorator/api/property/describe-properties.type.js +0 -3
  413. package/dist/type/decorator/api/property/describe-properties.type.js.map +0 -1
  414. /package/dist/type/decorator/api/function/{create-properties.type.d.ts → create/properties.type.d.ts} +0 -0
  415. /package/dist/type/decorator/api/function/{get-properties.type.d.ts → get/properties.type.d.ts} +0 -0
  416. /package/dist/type/decorator/api/function/{update-properties.type.d.ts → update/properties.type.d.ts} +0 -0
  417. /package/dist/type/decorator/api/{function → property/describe/dto/query}/get-list-properties.type.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"string.decorator.js","sourceRoot":"/","sources":["decorator/api/property/string.decorator.ts"],"names":[],"mappings":";;AAeA,8CAUC;AAzBD,2CAAiD;AAEjD,6CAAmE;AAEnE,yDAAiD;AAEjD,qDAA8M;AAE9M,gDAA2E;AAC3E,wCAAiF;AACjF,kDAAyD;AAKzD,SAAgB,iBAAiB,CAA2B,UAA2C;IACtG,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;QACrB,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;IACrE,CAAC;IACD,eAAe,CAAI,UAAU,CAAC,CAAC;IAE/B,MAAM,kBAAkB,GAAuB,uBAAuB,CAAI,UAAU,CAAC,CAAC;IACtF,MAAM,UAAU,GAA6B,eAAe,CAAI,UAAU,EAAE,kBAAkB,CAAC,CAAC;IAEhG,OAAO,IAAA,wBAAe,EAAC,GAAG,UAAU,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,oBAAoB,CAA2B,UAA2C;IAClG,MAAM,SAAS,GAAW,MAAM,CAAC,iBAAiB,CAAC;IACnD,MAAM,SAAS,GAAW,C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AC;QAED,IAAI,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,IAAI,KAAK,2BAAoB,CAAC,SAAS,IAAI,UAAU,CAAC,IAAI,KAAK,2BAAoB,CAAC,IAAI,EAAE,CAAC;YAC/H,UAAU,CAAC,IAAI,CAAC,IAAA,yBAAO,EAAC,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;YACjD,UAAU,CAAC,IAAI,CAAC,IAAA,wBAAM,EAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;QACrE,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["import { applyDecorators } from \"@nestjs/common\";\n\nimport { ApiProperty, ApiResponseProperty } from \"@nestjs/swagger\";\n\nimport { Expose, Type } from \"class-transformer\";\n\nimport { ArrayMaxSize, ArrayMinSize, ArrayNotEmpty, IsArray, IsDate, IsEmail, IsEnum, IsIP, IsLowercase, IsOptional, IsString, IsUppercase, IsUrl, IsUUID, Length, Matches, Validate } from \"class-validator\";\n\nimport { API_PROPERTY_STRING_INTERFACE_CONSTANT } from \"../../../constant\";\nimport { EApiPropertyDataType, EApiPropertyDataTypeString } from \"../../../enum\";\nimport { IsRegularExpression } from \"../../../validator\";\n\nimport type { IApiBaseEntity, IApiPropertyStringProperties } from \"../../../interface\";\nimport type { ApiPropertyOptions } from \"@nestjs/swagger\";\n\nexport function ApiPropertyString<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void {\n\tif (properties.enum) {\n\t\tproperties = { ...properties, ...buildOptionsFromEnum(properties) };\n\t}\n\tvalidateOptions<T>(properties);\n\n\tconst apiPropertyOptions: ApiPropertyOptions = buildApiPropertyOptions<T>(properties);\n\tconst decorators: Array<PropertyDecorator> = buildDecorators<T>(properties, apiPropertyOptions);\n\n\treturn applyDecorators(...decorators);\n}\n\nfunction buildOptionsFromEnum<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>): IApiPropertyStringProperties<T> {\n\tconst minLength: number = Number.POSITIVE_INFINITY;\n\tconst maxLength: number = 0;\n\tconst returnProperties: IApiPropertyStringProperties<T> = { ...properties, maxLength, minLength };\n\n\tif (properties.enum && returnProperties.minLength !== undefined && returnProperties.maxLength !== undefined) {\n\t\tconst enumValues: Array<string> = Object.values(properties.enum) as Array<string>;\n\n\t\tfor (const value of enumValues) {\n\t\t\tconst length: number = value.length;\n\t\t\treturnProperties.minLength = Math.min(returnProperties.minLength, length);\n\t\t\treturnProperties.maxLength = Math.max(returnProperties.maxLength, length);\n\t\t}\n\n\t\treturnProperties.example = enumValues[0];\n\t\treturnProperties.pattern = `/^(${enumValues.join(\"|\")})$/`;\n\t}\n\n\treturn returnProperties;\n}\n\nfunction validateOptions<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>): void {\n\tconst errors: Array<string> = [];\n\n\tif (!properties.response && typeof properties.required !== \"boolean\") {\n\t\terrors.push(\"Required is not defined\");\n\t}\n\n\tif (properties.response && properties.required) {\n\t\terrors.push(\"Required is defined for response\");\n\t}\n\n\tif ((!properties.response && (!properties.example || !properties.pattern)) || (properties.example && properties.pattern)) {\n\t\tconst matches: null | RegExpMatchArray = properties.pattern.match(/^\\/(.*?)\\/([gimuy]*)$/);\n\n\t\tif (matches) {\n\t\t\tconst pattern: string = matches[API_PROPERTY_STRING_INTERFACE_CONSTANT.REGEX_PATTERN_INDEX];\n\t\t\tconst flags: string = matches[API_PROPERTY_STRING_INTERFACE_CONSTANT.REGEX_FLAGS_INDEX];\n\n\t\t\tconst regex: RegExp = new RegExp(pattern, flags);\n\n\t\t\tif (Array.isArray(properties.example)) {\n\t\t\t\tfor (const example of properties.example) {\n\t\t\t\t\tif (!regex.test(example)) {\n\t\t\t\t\t\terrors.push(\"RegExp pattern does not match example string: \" + example);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (!regex.test(properties.example)) {\n\t\t\t\terrors.push(\"RegExp pattern does not match example string: \" + properties.example);\n\t\t\t}\n\t\t} else {\n\t\t\terrors.push(\"Invalid RegExp format: \" + properties.pattern);\n\t\t}\n\t}\n\n\tif (!EApiPropertyDataTypeString.has(properties.type)) {\n\t\terrors.push(\"Type is not valid for string property: \" + properties.type);\n\t}\n\n\tif (properties.minLength !== undefined && properties.maxLength !== undefined && properties.minLength > properties.maxLength) {\n\t\terrors.push(\"Min length is greater than max length\");\n\t}\n\n\tif (properties.minLength !== undefined && properties.minLength < 0) {\n\t\terrors.push(\"Min length is less than 0\");\n\t}\n\n\tif (properties.maxLength !== undefined && properties.maxLength < 0) {\n\t\terrors.push(\"Max length is less than 0\");\n\t}\n\n\tif (properties.example && properties.minLength && properties.example.length < properties.minLength && !Array.isArray(properties.example)) {\n\t\terrors.push(\"Example length is less than min length\");\n\t} else if (properties.example && properties.minLength && Array.isArray(properties.example)) {\n\t\tfor (const example of properties.example) {\n\t\t\tif (example.length < properties.minLength) {\n\t\t\t\terrors.push(\"Example length is less than min length\");\n\t\t\t}\n\t\t}\n\t}\n\n\tif (properties.example && properties.maxLength && properties.example.length > properties.maxLength && !Array.isArray(properties.example)) {\n\t\terrors.push(\"Example length is greater than max length\");\n\t} else if (properties.example && properties.maxLength && Array.isArray(properties.example)) {\n\t\tfor (const example of properties.example) {\n\t\t\tif (example.length > properties.maxLength) {\n\t\t\t\terrors.push(\"Example length is greater than max length\");\n\t\t\t}\n\t\t}\n\t}\n\n\tif (properties.isArray) {\n\t\tif (properties.minItems !== undefined && properties.maxItems !== undefined && properties.minItems > properties.maxItems) {\n\t\t\terrors.push(\"Min items is greater than max items\");\n\t\t}\n\n\t\tif (properties.minItems !== undefined && properties.minItems < 0) {\n\t\t\terrors.push(\"Min items is less than 0\");\n\t\t}\n\n\t\tif (properties.maxItems !== undefined && properties.maxItems < 0) {\n\t\t\terrors.push(\"Max items is less than 0\");\n\t\t}\n\n\t\tif (properties.uniqueItems === undefined) {\n\t\t\terrors.push(\"Unique items is not defined\");\n\t\t}\n\n\t\tif (properties.uniqueItems && properties.maxItems !== undefined && properties.maxItems <= 1) {\n\t\t\terrors.push(\"Unique items is true but max items is less than or equal to 1\");\n\t\t}\n\t}\n\n\tif (errors.length > 0) {\n\t\tthrow new Error(`ApiPropertyString error: ${errors.join(\"\\n\")}`);\n\t}\n}\n\nfunction buildApiPropertyOptions<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>): ApiPropertyOptions {\n\tconst apiPropertyOptions: ApiPropertyOptions = {\n\t\tdescription: `${properties.entity.name} ${properties.description || \"\"}`,\n\t\texample: properties.example,\n\t\tformat: properties.format,\n\t\tmaxLength: properties.maxLength,\n\t\tminLength: properties.minLength,\n\t\tnullable: properties.nullable,\n\t\tpattern: properties.pattern.slice(1, -1),\n\t\trequired: !properties.response && properties.required,\n\t\ttype: EApiPropertyDataType.STRING,\n\t};\n\n\tif (properties.enum) {\n\t\tapiPropertyOptions.enum = properties.enum;\n\t}\n\n\tif (properties.isArray) {\n\t\tapiPropertyOptions.isArray = true;\n\t\tapiPropertyOptions.minItems = properties.minItems;\n\t\tapiPropertyOptions.maxItems = properties.maxItems;\n\t\tapiPropertyOptions.uniqueItems = properties.uniqueItems;\n\t}\n\n\tif (properties.isArray && properties.enum) {\n\t\tdelete apiPropertyOptions.type;\n\t} else if (properties.isArray) {\n\t\tapiPropertyOptions.type = [EApiPropertyDataType.STRING];\n\t}\n\n\treturn apiPropertyOptions;\n}\n\nfunction buildDecorators<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>, apiPropertyOptions: ApiPropertyOptions): Array<PropertyDecorator> {\n\tconst decorators: Array<PropertyDecorator> = [ApiProperty(apiPropertyOptions)];\n\n\tif (properties.response) {\n\t\tdecorators.push(ApiResponseProperty);\n\n\t\tif (properties.expose) {\n\t\t\tdecorators.push(Expose());\n\t\t}\n\t} else if (properties.isArray) {\n\t\tif (!properties.required) {\n\t\t\tdecorators.push(IsOptional());\n\t\t}\n\n\t\tdecorators.push(IsArray(), ArrayNotEmpty());\n\n\t\tif (properties.minItems) {\n\t\t\tdecorators.push(ArrayMinSize(properties.minItems));\n\t\t}\n\n\t\tif (properties.maxItems) {\n\t\t\tdecorators.push(ArrayMaxSize(properties.maxItems));\n\t\t}\n\n\t\tif (properties.enum) {\n\t\t\tdecorators.push(IsEnum(properties.enum, { each: true }));\n\t\t} else {\n\t\t\tswitch (properties.type) {\n\t\t\t\tcase EApiPropertyDataType.URL: {\n\t\t\t\t\tdecorators.push(\n\t\t\t\t\t\tIsUrl(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tprotocols: [\"https\", \"http\"],\n\t\t\t\t\t\t\t\trequire_host: true,\n\t\t\t\t\t\t\t\trequire_protocol: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ each: true },\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.UUID: {\n\t\t\t\t\tdecorators.push(IsUUID(\"all\", { each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.EMAIL: {\n\t\t\t\t\tdecorators.push(IsEmail({}, { each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.STRING: {\n\t\t\t\t\tdecorators.push(IsString({ each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.UPPERCASE_STRING: {\n\t\t\t\t\tdecorators.push(IsString({ each: true }), IsUppercase({ each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.LOWERCASE_STRING: {\n\t\t\t\t\tdecorators.push(IsString({ each: true }), IsLowercase({ each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.REGEXP: {\n\t\t\t\t\tdecorators.push(\n\t\t\t\t\t\tValidate(IsRegularExpression, {\n\t\t\t\t\t\t\teach: true,\n\t\t\t\t\t\t\tmessage: `${properties.description} must be valid regular expression string`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tMatches(new RegExp(properties.pattern.slice(1, -1))),\n\t\t\t\t\t\tType(() => RegExp),\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.IP: {\n\t\t\t\t\tdecorators.push(IsIP(API_PROPERTY_STRING_INTERFACE_CONSTANT.IP_VERSION, { each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"ApiPropertyString error: Type is not valid for string property: \" + properties.type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (properties.pattern) {\n\t\t\tdecorators.push(Matches(new RegExp(properties.pattern.slice(1, -1)), { each: true }));\n\t\t}\n\n\t\tif (properties.minLength && properties.maxItems) {\n\t\t\tdecorators.push(Length(properties.minLength, properties.maxLength, { each: true }));\n\t\t}\n\t} else {\n\t\tif (!properties.required) {\n\t\t\tdecorators.push(IsOptional());\n\t\t}\n\n\t\tif (properties.enum) {\n\t\t\tdecorators.push(IsEnum(properties.enum));\n\t\t} else {\n\t\t\tswitch (properties.type) {\n\t\t\t\tcase EApiPropertyDataType.URL: {\n\t\t\t\t\tdecorators.push(IsUrl({ protocols: [\"https\", \"http\"], require_host: true, require_protocol: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.UUID: {\n\t\t\t\t\tdecorators.push(IsUUID());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.EMAIL: {\n\t\t\t\t\tdecorators.push(IsEmail());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.STRING: {\n\t\t\t\t\tdecorators.push(IsString());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.UPPERCASE_STRING: {\n\t\t\t\t\tdecorators.push(IsString(), IsUppercase());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.LOWERCASE_STRING: {\n\t\t\t\t\tdecorators.push(IsString(), IsLowercase());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.REGEXP: {\n\t\t\t\t\tdecorators.push(\n\t\t\t\t\t\tValidate(IsRegularExpression, { message: `${properties.description} must be valid regular expression string` }),\n\t\t\t\t\t\tMatches(new RegExp(properties.pattern.slice(1, -1))),\n\t\t\t\t\t\tType(() => RegExp),\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.IP: {\n\t\t\t\t\tdecorators.push(IsIP(API_PROPERTY_STRING_INTERFACE_CONSTANT.IP_VERSION));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.DATE_TIME:\n\n\t\t\t\tcase EApiPropertyDataType.DATE: {\n\t\t\t\t\tdecorators.push(\n\t\t\t\t\t\tIsDate(),\n\t\t\t\t\t\tType(() => Date),\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"ApiPropertyString error: Type is not valid for string property: \" + properties.type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (properties.pattern && properties.type !== EApiPropertyDataType.DATE_TIME && properties.type !== EApiPropertyDataType.DATE) {\n\t\t\tdecorators.push(Matches(new RegExp(properties.pattern.slice(1, -1))));\n\t\t}\n\n\t\tif (properties.minLength && properties.maxItems) {\n\t\t\tdecorators.push(Length(properties.minLength, properties.maxLength));\n\t\t}\n\t}\n\n\treturn decorators;\n}\n"]}
1
+ {"version":3,"file":"string.decorator.js","sourceRoot":"/","sources":["decorator/api/property/string.decorator.ts"],"names":[],"mappings":";;AAeA,8CAcC;AA7BD,2CAAiD;AAEjD,6CAAmE;AAEnE,yDAA0D;AAE1D,qDAA8M;AAE9M,gDAA2E;AAC3E,wCAAiF;AACjF,kDAAyD;AAKzD,SAAgB,iBAAiB,CAA2B,UAA2C;IACtG,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;QACrB,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;IACrE,CAAC;IACD,eAAe,CAAI,UAAU,CAAC,CAAC;IAE/B,MAAM,kBAAkB,GAAuB,uBAAuB,CAAI,UAAU,CAAC,CAAC;IACtF,MAAM,UAAU,GAA6B,eAAe,CAAI,UAAU,EAAE,kBAAkB,CAAC,CAAC;IAEhG,IAAI,UAAU,CAAC,WAAW,KAAK,wBAAwB,EAAE,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,IAAA,wBAAe,EAAC,GAAG,UAAU,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,oBAAoB,CAA2B,UAA2C;IAClG,MAAM,SAAS,GAAW,MAAM,CAAC,iBAAiB,CAAC;IACnD,MAAM,SAAS,GAAW,CAAC,CAAC;IAC5B,MAAM,gBAAgB,GAAoC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IAElG,IAAI,UAAU,CAAC,IAAI,IAAI,gBAAgB,CAAC,SAAS,KAAK,SAAS,IAAI,gBAAgB,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC7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AC,IAAI,KAAK,2BAAoB,CAAC,SAAS,IAAI,UAAU,CAAC,IAAI,KAAK,2BAAoB,CAAC,IAAI,EAAE,CAAC;YAC/H,UAAU,CAAC,IAAI,CAAC,IAAA,yBAAO,EAAC,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;YACjD,UAAU,CAAC,IAAI,CAAC,IAAA,wBAAM,EAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;QACrE,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["import { applyDecorators } from \"@nestjs/common\";\n\nimport { ApiProperty, ApiResponseProperty } from \"@nestjs/swagger\";\n\nimport { Exclude, Expose, Type } from \"class-transformer\";\n\nimport { ArrayMaxSize, ArrayMinSize, ArrayNotEmpty, IsArray, IsDate, IsEmail, IsEnum, IsIP, IsLowercase, IsOptional, IsString, IsUppercase, IsUrl, IsUUID, Length, Matches, Validate } from \"class-validator\";\n\nimport { STRING_PROPERTY_API_INTERFACE_CONSTANT } from \"../../../constant\";\nimport { EApiPropertyDataType, EApiPropertyDataTypeString } from \"../../../enum\";\nimport { IsRegularExpression } from \"../../../validator\";\n\nimport type { IApiBaseEntity, IApiPropertyStringProperties } from \"../../../interface\";\nimport type { ApiPropertyOptions } from \"@nestjs/swagger\";\n\nexport function ApiPropertyString<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void {\n\tif (properties.enum) {\n\t\tproperties = { ...properties, ...buildOptionsFromEnum(properties) };\n\t}\n\tvalidateOptions<T>(properties);\n\n\tconst apiPropertyOptions: ApiPropertyOptions = buildApiPropertyOptions<T>(properties);\n\tconst decorators: Array<PropertyDecorator> = buildDecorators<T>(properties, apiPropertyOptions);\n\n\tif (properties.description === \"message amount pattern\") {\n\t\tconsole.log(\"PODSOS\", apiPropertyOptions);\n\t}\n\n\treturn applyDecorators(...decorators);\n}\n\nfunction buildOptionsFromEnum<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>): IApiPropertyStringProperties<T> {\n\tconst minLength: number = Number.POSITIVE_INFINITY;\n\tconst maxLength: number = 0;\n\tconst returnProperties: IApiPropertyStringProperties<T> = { ...properties, maxLength, minLength };\n\n\tif (properties.enum && returnProperties.minLength !== undefined && returnProperties.maxLength !== undefined) {\n\t\tconst enumValues: Array<string> = Object.values(properties.enum) as Array<string>;\n\n\t\tfor (const value of enumValues) {\n\t\t\tconst length: number = value.length;\n\t\t\treturnProperties.minLength = Math.min(returnProperties.minLength, length);\n\t\t\treturnProperties.maxLength = Math.max(returnProperties.maxLength, length);\n\t\t}\n\n\t\treturnProperties.example = enumValues[0];\n\t\treturnProperties.pattern = `/^(${enumValues.join(\"|\")})$/`;\n\t}\n\n\treturn returnProperties;\n}\n\nfunction validateOptions<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>): void {\n\tconst errors: Array<string> = [];\n\n\tif (!properties.response && typeof properties.required !== \"boolean\") {\n\t\terrors.push(\"Required is not defined\");\n\t}\n\n\tif (properties.response && properties.required) {\n\t\terrors.push(\"Required is defined for response\");\n\t}\n\n\tif ((!properties.response && (!properties.example || !properties.pattern)) || (properties.example && properties.pattern)) {\n\t\tconst matches: null | RegExpMatchArray = properties.pattern.match(/^\\/(.*?)\\/([gimuy]*)$/);\n\n\t\tif (matches) {\n\t\t\tconst pattern: string = matches[STRING_PROPERTY_API_INTERFACE_CONSTANT.REGEX_PATTERN_INDEX];\n\t\t\tconst flags: string = matches[STRING_PROPERTY_API_INTERFACE_CONSTANT.REGEX_FLAGS_INDEX];\n\n\t\t\tconst regex: RegExp = new RegExp(pattern, flags);\n\n\t\t\tif (Array.isArray(properties.example)) {\n\t\t\t\tfor (const example of properties.example) {\n\t\t\t\t\tif (!regex.test(example)) {\n\t\t\t\t\t\terrors.push(\"RegExp pattern does not match example string: \" + example);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (!regex.test(properties.example)) {\n\t\t\t\terrors.push(\"RegExp pattern does not match example string: \" + properties.example);\n\t\t\t}\n\t\t} else {\n\t\t\terrors.push(\"Invalid RegExp format: \" + properties.pattern);\n\t\t}\n\t}\n\n\tif (!EApiPropertyDataTypeString.has(properties.type)) {\n\t\terrors.push(\"Type is not valid for string property: \" + properties.type);\n\t}\n\n\tif (properties.minLength !== undefined && properties.maxLength !== undefined && properties.minLength > properties.maxLength) {\n\t\terrors.push(\"Min length is greater than max length\");\n\t}\n\n\tif (properties.minLength !== undefined && properties.minLength < 0) {\n\t\terrors.push(\"Min length is less than 0\");\n\t}\n\n\tif (properties.maxLength !== undefined && properties.maxLength < 0) {\n\t\terrors.push(\"Max length is less than 0\");\n\t}\n\n\tif (properties.example && properties.minLength && properties.example.length < properties.minLength && !Array.isArray(properties.example)) {\n\t\terrors.push(\"Example length is less than min length\");\n\t} else if (properties.example && properties.minLength && Array.isArray(properties.example)) {\n\t\tfor (const example of properties.example) {\n\t\t\tif (example.length < properties.minLength) {\n\t\t\t\terrors.push(\"Example length is less than min length\");\n\t\t\t}\n\t\t}\n\t}\n\n\tif (properties.example && properties.maxLength && properties.example.length > properties.maxLength && !Array.isArray(properties.example)) {\n\t\terrors.push(\"Example length is greater than max length\");\n\t} else if (properties.example && properties.maxLength && Array.isArray(properties.example)) {\n\t\tfor (const example of properties.example) {\n\t\t\tif (example.length > properties.maxLength) {\n\t\t\t\terrors.push(\"Example length is greater than max length\");\n\t\t\t}\n\t\t}\n\t}\n\n\tif (properties.isArray) {\n\t\tif (properties.minItems !== undefined && properties.maxItems !== undefined && properties.minItems > properties.maxItems) {\n\t\t\terrors.push(\"Min items is greater than max items\");\n\t\t}\n\n\t\tif (properties.minItems !== undefined && properties.minItems < 0) {\n\t\t\terrors.push(\"Min items is less than 0\");\n\t\t}\n\n\t\tif (properties.maxItems !== undefined && properties.maxItems < 0) {\n\t\t\terrors.push(\"Max items is less than 0\");\n\t\t}\n\n\t\tif (properties.uniqueItems === undefined) {\n\t\t\terrors.push(\"Unique items is not defined\");\n\t\t}\n\n\t\tif (properties.uniqueItems && properties.maxItems !== undefined && properties.maxItems <= 1) {\n\t\t\terrors.push(\"Unique items is true but max items is less than or equal to 1\");\n\t\t}\n\t}\n\n\tif (errors.length > 0) {\n\t\tthrow new Error(`ApiPropertyString error: ${errors.join(\"\\n\")}`);\n\t}\n}\n\nfunction buildApiPropertyOptions<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>): ApiPropertyOptions {\n\tconst apiPropertyOptions: ApiPropertyOptions & Record<string, any> = {\n\t\tdescription: `${properties.entity.name} ${properties.description || \"\"}`,\n\t\texample: properties.example,\n\t\texpose: properties.expose,\n\t\tformat: properties.format,\n\t\tmaxLength: properties.maxLength,\n\t\tminLength: properties.minLength,\n\t\tnullable: properties.nullable,\n\t\tpattern: properties.pattern.slice(1, -1),\n\t\trequired: !properties.response && properties.required,\n\t\ttype: EApiPropertyDataType.STRING,\n\t};\n\n\tif (properties.enum) {\n\t\tapiPropertyOptions.enum = properties.enum;\n\t}\n\n\tif (properties.isArray) {\n\t\tapiPropertyOptions.isArray = true;\n\t\tapiPropertyOptions.minItems = properties.minItems;\n\t\tapiPropertyOptions.maxItems = properties.maxItems;\n\t\tapiPropertyOptions.uniqueItems = properties.uniqueItems;\n\t}\n\n\tif (properties.isArray && properties.enum) {\n\t\tdelete apiPropertyOptions.type;\n\t} else if (properties.isArray) {\n\t\tapiPropertyOptions.type = [EApiPropertyDataType.STRING];\n\t}\n\n\treturn apiPropertyOptions;\n}\n\nfunction buildDecorators<T extends IApiBaseEntity>(properties: IApiPropertyStringProperties<T>, apiPropertyOptions: ApiPropertyOptions): Array<PropertyDecorator> {\n\tconst decorators: Array<PropertyDecorator> = [ApiProperty(apiPropertyOptions)];\n\n\tif (properties.response) {\n\t\tdecorators.push(ApiResponseProperty());\n\n\t\tif (properties.expose === undefined || properties.expose) {\n\t\t\tdecorators.push(Expose());\n\t\t} else {\n\t\t\tdecorators.push(Exclude());\n\t\t}\n\t} else if (properties.isArray) {\n\t\tif (!properties.required) {\n\t\t\tdecorators.push(IsOptional());\n\t\t}\n\n\t\tdecorators.push(IsArray(), ArrayNotEmpty());\n\n\t\tif (properties.minItems) {\n\t\t\tdecorators.push(ArrayMinSize(properties.minItems));\n\t\t}\n\n\t\tif (properties.maxItems) {\n\t\t\tdecorators.push(ArrayMaxSize(properties.maxItems));\n\t\t}\n\n\t\tif (properties.enum) {\n\t\t\tdecorators.push(IsEnum(properties.enum, { each: true }));\n\t\t} else {\n\t\t\tswitch (properties.type) {\n\t\t\t\tcase EApiPropertyDataType.URL: {\n\t\t\t\t\tdecorators.push(\n\t\t\t\t\t\tIsUrl(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tprotocols: [\"https\", \"http\"],\n\t\t\t\t\t\t\t\trequire_host: true,\n\t\t\t\t\t\t\t\trequire_protocol: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ each: true },\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.UUID: {\n\t\t\t\t\tdecorators.push(IsUUID(\"all\", { each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.EMAIL: {\n\t\t\t\t\tdecorators.push(IsEmail({}, { each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.STRING: {\n\t\t\t\t\tdecorators.push(IsString({ each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.UPPERCASE_STRING: {\n\t\t\t\t\tdecorators.push(IsString({ each: true }), IsUppercase({ each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.LOWERCASE_STRING: {\n\t\t\t\t\tdecorators.push(IsString({ each: true }), IsLowercase({ each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.REGEXP: {\n\t\t\t\t\tdecorators.push(\n\t\t\t\t\t\tValidate(IsRegularExpression, {\n\t\t\t\t\t\t\teach: true,\n\t\t\t\t\t\t\tmessage: `${properties.description} must be valid regular expression string`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tMatches(new RegExp(properties.pattern.slice(1, -1))),\n\t\t\t\t\t\tType(() => RegExp),\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.IP: {\n\t\t\t\t\tdecorators.push(IsIP(STRING_PROPERTY_API_INTERFACE_CONSTANT.IP_VERSION, { each: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"ApiPropertyString error: Type is not valid for string property: \" + properties.type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (properties.pattern) {\n\t\t\tdecorators.push(Matches(new RegExp(properties.pattern.slice(1, -1)), { each: true }));\n\t\t}\n\n\t\tif (properties.minLength && properties.maxItems) {\n\t\t\tdecorators.push(Length(properties.minLength, properties.maxLength, { each: true }));\n\t\t}\n\t} else {\n\t\tif (!properties.required) {\n\t\t\tdecorators.push(IsOptional());\n\t\t}\n\n\t\tif (properties.enum) {\n\t\t\tdecorators.push(IsEnum(properties.enum));\n\t\t} else {\n\t\t\tswitch (properties.type) {\n\t\t\t\tcase EApiPropertyDataType.URL: {\n\t\t\t\t\tdecorators.push(IsUrl({ protocols: [\"https\", \"http\"], require_host: true, require_protocol: true }));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.UUID: {\n\t\t\t\t\tdecorators.push(IsUUID());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.EMAIL: {\n\t\t\t\t\tdecorators.push(IsEmail());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.STRING: {\n\t\t\t\t\tdecorators.push(IsString());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.UPPERCASE_STRING: {\n\t\t\t\t\tdecorators.push(IsString(), IsUppercase());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.LOWERCASE_STRING: {\n\t\t\t\t\tdecorators.push(IsString(), IsLowercase());\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.REGEXP: {\n\t\t\t\t\tdecorators.push(\n\t\t\t\t\t\tValidate(IsRegularExpression, { message: `${properties.description} must be valid regular expression string` }),\n\t\t\t\t\t\tMatches(new RegExp(properties.pattern.slice(1, -1))),\n\t\t\t\t\t\tType(() => RegExp),\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.IP: {\n\t\t\t\t\tdecorators.push(IsIP(STRING_PROPERTY_API_INTERFACE_CONSTANT.IP_VERSION));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiPropertyDataType.DATE_TIME:\n\n\t\t\t\tcase EApiPropertyDataType.DATE: {\n\t\t\t\t\tdecorators.push(\n\t\t\t\t\t\tIsDate(),\n\t\t\t\t\t\tType(() => Date),\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"ApiPropertyString error: Type is not valid for string property: \" + properties.type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (properties.pattern && properties.type !== EApiPropertyDataType.DATE_TIME && properties.type !== EApiPropertyDataType.DATE) {\n\t\t\tdecorators.push(Matches(new RegExp(properties.pattern.slice(1, -1))));\n\t\t}\n\n\t\tif (properties.minLength && properties.maxItems) {\n\t\t\tdecorators.push(Length(properties.minLength, properties.maxLength));\n\t\t}\n\t}\n\n\treturn decorators;\n}\n"]}
@@ -9,10 +9,10 @@ function ApiPropertyWallet(properties) {
9
9
  const apiPropertyOptions = {
10
10
  description: "wallet number",
11
11
  entity: properties.entity,
12
- example: constant_1.API_PROPERTY_WALLET_INTERFACE_CONSTANT.EXAMPLE,
12
+ example: constant_1.WALLET_PROPERTY_API_INTERFACE_CONSTANT.EXAMPLE,
13
13
  expose: properties.expose,
14
- maximum: constant_1.API_PROPERTY_WALLET_INTERFACE_CONSTANT.MAXIMUM,
15
- minimum: constant_1.API_PROPERTY_WALLET_INTERFACE_CONSTANT.MINIMUM,
14
+ maximum: constant_1.WALLET_PROPERTY_API_INTERFACE_CONSTANT.MAXIMUM,
15
+ minimum: constant_1.WALLET_PROPERTY_API_INTERFACE_CONSTANT.MINIMUM,
16
16
  multipleOf: 1,
17
17
  nullable: properties.nullable,
18
18
  required: !properties.response && properties.required,
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.decorator.js","sourceRoot":"/","sources":["decorator/api/property/wallet.decorator.ts"],"names":[],"mappings":";;AAUA,8CAkBC;AA5BD,2CAAiD;AAEjD,gDAA2E;AAE3E,wCAAqD;AAErD,yDAAuD;AAIvD,SAAgB,iBAAiB,CAA2B,UAAyC;IACpG,MAAM,kBAAkB,GAAoC;QAC3D,WAAW,EAAE,eAAe;QAC5B,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,OAAO,EAAE,iDAAsC,CAAC,OAAO;QACvD,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,OAAO,EAAE,iDAAsC,CAAC,OAAO;QACvD,OAAO,EAAE,iDAAsC,CAAC,OAAO;QACvD,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,QAAQ,EAAE,CAAC,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,QAAQ;QACrD,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,IAAI,EAAE,2BAAoB,CAAC,OAAO;KAClC,CAAC;IAEF,MAAM,UAAU,GAA6B,CAAC,IAAA,oCAAiB,EAAC,EAAE,GAAG,kBAAkB,EAAE,CAAC,CAAC,CAAC;IAE5F,OAAO,IAAA,wBAAe,EAAC,GAAG,UAAU,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import { applyDecorators } from \"@nestjs/common\";\n\nimport { API_PROPERTY_WALLET_INTERFACE_CONSTANT } from \"../../../constant\";\n\nimport { EApiPropertyDataType } from \"../../../enum\";\n\nimport { ApiPropertyNumber } from \"./number.decorator\";\n\nimport type { IApiBaseEntity, IApiPropertyBaseProperties, IApiPropertyNumberProperties } from \"../../../interface\";\n\nexport function ApiPropertyWallet<T extends IApiBaseEntity>(properties: IApiPropertyBaseProperties<T>): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void {\n\tconst apiPropertyOptions: IApiPropertyNumberProperties<T> = {\n\t\tdescription: \"wallet number\",\n\t\tentity: properties.entity,\n\t\texample: API_PROPERTY_WALLET_INTERFACE_CONSTANT.EXAMPLE,\n\t\texpose: properties.expose,\n\t\tmaximum: API_PROPERTY_WALLET_INTERFACE_CONSTANT.MAXIMUM,\n\t\tminimum: API_PROPERTY_WALLET_INTERFACE_CONSTANT.MINIMUM,\n\t\tmultipleOf: 1,\n\t\tnullable: properties.nullable,\n\t\trequired: !properties.response && properties.required,\n\t\tresponse: properties.response,\n\t\ttype: EApiPropertyDataType.INTEGER,\n\t};\n\n\tconst decorators: Array<PropertyDecorator> = [ApiPropertyNumber({ ...apiPropertyOptions })];\n\n\treturn applyDecorators(...decorators);\n}\n"]}
1
+ {"version":3,"file":"wallet.decorator.js","sourceRoot":"/","sources":["decorator/api/property/wallet.decorator.ts"],"names":[],"mappings":";;AAUA,8CAkBC;AA5BD,2CAAiD;AAEjD,gDAA2E;AAE3E,wCAAqD;AAErD,yDAAuD;AAIvD,SAAgB,iBAAiB,CAA2B,UAAyC;IACpG,MAAM,kBAAkB,GAAoC;QAC3D,WAAW,EAAE,eAAe;QAC5B,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,OAAO,EAAE,iDAAsC,CAAC,OAAO;QACvD,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,OAAO,EAAE,iDAAsC,CAAC,OAAO;QACvD,OAAO,EAAE,iDAAsC,CAAC,OAAO;QACvD,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,QAAQ,EAAE,CAAC,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,QAAQ;QACrD,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,IAAI,EAAE,2BAAoB,CAAC,OAAO;KAClC,CAAC;IAEF,MAAM,UAAU,GAA6B,CAAC,IAAA,oCAAiB,EAAC,EAAE,GAAG,kBAAkB,EAAE,CAAC,CAAC,CAAC;IAE5F,OAAO,IAAA,wBAAe,EAAC,GAAG,UAAU,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import { applyDecorators } from \"@nestjs/common\";\n\nimport { WALLET_PROPERTY_API_INTERFACE_CONSTANT } from \"../../../constant\";\n\nimport { EApiPropertyDataType } from \"../../../enum\";\n\nimport { ApiPropertyNumber } from \"./number.decorator\";\n\nimport type { IApiBaseEntity, IApiPropertyBaseProperties, IApiPropertyNumberProperties } from \"../../../interface\";\n\nexport function ApiPropertyWallet<T extends IApiBaseEntity>(properties: IApiPropertyBaseProperties<T>): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void {\n\tconst apiPropertyOptions: IApiPropertyNumberProperties<T> = {\n\t\tdescription: \"wallet number\",\n\t\tentity: properties.entity,\n\t\texample: WALLET_PROPERTY_API_INTERFACE_CONSTANT.EXAMPLE,\n\t\texpose: properties.expose,\n\t\tmaximum: WALLET_PROPERTY_API_INTERFACE_CONSTANT.MAXIMUM,\n\t\tminimum: WALLET_PROPERTY_API_INTERFACE_CONSTANT.MINIMUM,\n\t\tmultipleOf: 1,\n\t\tnullable: properties.nullable,\n\t\trequired: !properties.response && properties.required,\n\t\tresponse: properties.response,\n\t\ttype: EApiPropertyDataType.INTEGER,\n\t};\n\n\tconst decorators: Array<PropertyDecorator> = [ApiPropertyNumber({ ...apiPropertyOptions })];\n\n\treturn applyDecorators(...decorators);\n}\n"]}
@@ -1,6 +1,3 @@
1
- import "reflect-metadata";
2
- import type { BaseEntity, EntityTarget, FindOptionsRelations } from "typeorm";
3
- export declare function ApiService<E extends BaseEntity>(options: {
4
- entity: EntityTarget<E>;
5
- relations?: FindOptionsRelations<E>;
6
- }): <TFunction extends new (...arguments_: Array<any>) => {}>(target: TFunction) => TFunction;
1
+ import type { IApiBaseEntity } from "../../interface";
2
+ import type { TApiServiceProperties } from "../../type/decorator/api/service-properties.type";
3
+ export declare function ApiService<E extends IApiBaseEntity>(properties: TApiServiceProperties<E>): <TFunction extends new (...arguments_: Array<any>) => {}>(target: TFunction) => TFunction;
@@ -1,34 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiService = ApiService;
4
- require("reflect-metadata");
5
4
  const enum_1 = require("../../enum");
6
5
  const function_1 = require("./function");
7
- const API_SERVICE_METADATA_KEY = Symbol("ApiServiceMetadata");
8
- function ApiService(options) {
6
+ function ApiService(properties) {
7
+ const { entity } = properties;
9
8
  return function (target) {
10
9
  const originalConstructor = target;
11
10
  const ExtendedClass = class extends originalConstructor {
12
- constructor(...arguments_) {
13
- super(...arguments_);
11
+ constructor(..._arguments) {
12
+ super(..._arguments);
14
13
  if (!this.hasOwnProperty(enum_1.EApiFunctionType.GET_LIST)) {
15
14
  Object.defineProperty(this, enum_1.EApiFunctionType.GET_LIST, {
16
15
  configurable: true,
17
16
  enumerable: true,
18
- value: async function (properties) {
17
+ value: async function (properties, relations) {
19
18
  const apiFunctionDecorator = (0, function_1.ApiFunction)({
20
- model: options.entity,
21
- relations: options.relations,
19
+ entity,
20
+ relations,
22
21
  type: enum_1.EApiFunctionType.GET_LIST,
23
22
  });
24
23
  const descriptor = {
25
24
  configurable: true,
26
25
  enumerable: true,
27
- value: function () { },
26
+ value: () => void 0,
28
27
  writable: true,
29
28
  };
30
29
  const decoratedDescriptor = apiFunctionDecorator(this, enum_1.EApiFunctionType.GET_LIST, descriptor);
31
- return Reflect.apply(decoratedDescriptor.value, this, [properties]);
30
+ return decoratedDescriptor.value.call(this, properties);
32
31
  },
33
32
  writable: true,
34
33
  });
@@ -37,20 +36,20 @@ function ApiService(options) {
37
36
  Object.defineProperty(this, enum_1.EApiFunctionType.GET, {
38
37
  configurable: true,
39
38
  enumerable: true,
40
- value: async function (id, properties) {
39
+ value: async function (id, properties, relations) {
41
40
  const apiFunctionDecorator = (0, function_1.ApiFunction)({
42
- model: options.entity,
43
- relations: options.relations,
41
+ entity,
42
+ relations,
44
43
  type: enum_1.EApiFunctionType.GET,
45
44
  });
46
45
  const descriptor = {
47
46
  configurable: true,
48
47
  enumerable: true,
49
- value: function () { },
48
+ value: () => void 0,
50
49
  writable: true,
51
50
  };
52
51
  const decoratedDescriptor = apiFunctionDecorator(this, enum_1.EApiFunctionType.GET, descriptor);
53
- return Reflect.apply(decoratedDescriptor.value, this, [id, properties]);
52
+ return decoratedDescriptor.value.call(this, id, properties);
54
53
  },
55
54
  writable: true,
56
55
  });
@@ -61,18 +60,17 @@ function ApiService(options) {
61
60
  enumerable: true,
62
61
  value: async function (properties) {
63
62
  const apiFunctionDecorator = (0, function_1.ApiFunction)({
64
- model: options.entity,
65
- relations: options.relations,
63
+ entity,
66
64
  type: enum_1.EApiFunctionType.CREATE,
67
65
  });
68
66
  const descriptor = {
69
67
  configurable: true,
70
68
  enumerable: true,
71
- value: function () { },
69
+ value: () => void 0,
72
70
  writable: true,
73
71
  };
74
72
  const decoratedDescriptor = apiFunctionDecorator(this, enum_1.EApiFunctionType.CREATE, descriptor);
75
- return Reflect.apply(decoratedDescriptor.value, this, [properties]);
73
+ return decoratedDescriptor.value.call(this, properties);
76
74
  },
77
75
  writable: true,
78
76
  });
@@ -83,18 +81,17 @@ function ApiService(options) {
83
81
  enumerable: true,
84
82
  value: async function (id, properties) {
85
83
  const apiFunctionDecorator = (0, function_1.ApiFunction)({
86
- model: options.entity,
87
- relations: options.relations,
84
+ entity,
88
85
  type: enum_1.EApiFunctionType.UPDATE,
89
86
  });
90
87
  const descriptor = {
91
88
  configurable: true,
92
89
  enumerable: true,
93
- value: function () { },
90
+ value: () => void 0,
94
91
  writable: true,
95
92
  };
96
93
  const decoratedDescriptor = apiFunctionDecorator(this, enum_1.EApiFunctionType.UPDATE, descriptor);
97
- return Reflect.apply(decoratedDescriptor.value, this, [id, properties]);
94
+ return decoratedDescriptor.value.call(this, id, properties);
98
95
  },
99
96
  writable: true,
100
97
  });
@@ -105,46 +102,23 @@ function ApiService(options) {
105
102
  enumerable: true,
106
103
  value: async function (id) {
107
104
  const apiFunctionDecorator = (0, function_1.ApiFunction)({
108
- model: options.entity,
105
+ entity,
109
106
  type: enum_1.EApiFunctionType.DELETE,
110
107
  });
111
108
  const descriptor = {
112
109
  configurable: true,
113
110
  enumerable: true,
114
- value: function () { },
111
+ value: () => void 0,
115
112
  writable: true,
116
113
  };
117
114
  const decoratedDescriptor = apiFunctionDecorator(this, enum_1.EApiFunctionType.DELETE, descriptor);
118
- return Reflect.apply(decoratedDescriptor.value, this, [id]);
115
+ return decoratedDescriptor.value.call(this, id);
119
116
  },
120
117
  writable: true,
121
118
  });
122
119
  }
123
120
  }
124
121
  };
125
- Reflect.defineMetadata(API_SERVICE_METADATA_KEY, {
126
- createMetadata: {
127
- model: options.entity,
128
- type: enum_1.EApiFunctionType.CREATE,
129
- },
130
- deleteMetadata: {
131
- model: options.entity,
132
- type: enum_1.EApiFunctionType.DELETE,
133
- },
134
- entity: options.entity,
135
- getListMetadata: {
136
- model: options.entity,
137
- type: enum_1.EApiFunctionType.GET_LIST,
138
- },
139
- getMetadata: {
140
- model: options.entity,
141
- type: enum_1.EApiFunctionType.GET,
142
- },
143
- updateMetadata: {
144
- model: options.entity,
145
- type: enum_1.EApiFunctionType.UPDATE,
146
- },
147
- }, ExtendedClass);
148
122
  Object.setPrototypeOf(ExtendedClass, originalConstructor);
149
123
  return ExtendedClass;
150
124
  };
@@ -1 +1 @@
1
- {"version":3,"file":"service.decorator.js","sourceRoot":"/","sources":["decorator/api/service.decorator.ts"],"names":[],"mappings":";;AAaA,gCA2KC;AAxLD,4BAA0B;AAE1B,qCAA8C;AAE9C,yCAAyC;AAOzC,MAAM,wBAAwB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAE9D,SAAgB,UAAU,CAAuB,OAAyE;IACzH,OAAO,UAAmE,MAAiB;QAC1F,MAAM,mBAAmB,GAAG,MAAM,CAAC;QAEnC,MAAM,aAAa,GAAG,KAAM,SAAQ,mBAAmB;YACtD,YAAY,GAAG,UAAsB;gBACpC,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC;gBAErB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,uBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACrD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,uBAAgB,CAAC,QAAQ,EAAE;wBACtD,YAAY,EAAE,IAAI;wBAClB,UAAU,EAAE,IAAI;wBAChB,KAAK,EAAE,KAAK,WAAW,UAA4C;4BAClE,MAAM,oBAAoB,GAAG,IAAA,sBAAW,EAAC;gCACxC,KAAK,EAAE,OAAO,CAAC,MAA8B;gCAC7C,SAAS,EAAE,OAAO,CAAC,SAAS;gCAC5B,IAAI,EAAE,uBAAgB,CAAC,QAAQ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AK,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;wBAC7D,CAAC;wBACD,QAAQ,EAAE,IAAI;qBACd,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;SACD,CAAC;QAEF,OAAO,CAAC,cAAc,CACrB,wBAAwB,EACxB;YACC,cAAc,EAAE;gBACf,KAAK,EAAE,OAAO,CAAC,MAAM;gBACrB,IAAI,EAAE,uBAAgB,CAAC,MAAM;aAC7B;YACD,cAAc,EAAE;gBACf,KAAK,EAAE,OAAO,CAAC,MAAM;gBACrB,IAAI,EAAE,uBAAgB,CAAC,MAAM;aAC7B;YACD,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,eAAe,EAAE;gBAChB,KAAK,EAAE,OAAO,CAAC,MAAM;gBACrB,IAAI,EAAE,uBAAgB,CAAC,QAAQ;aAC/B;YACD,WAAW,EAAE;gBACZ,KAAK,EAAE,OAAO,CAAC,MAAM;gBACrB,IAAI,EAAE,uBAAgB,CAAC,GAAG;aAC1B;YACD,cAAc,EAAE;gBACf,KAAK,EAAE,OAAO,CAAC,MAAM;gBACrB,IAAI,EAAE,uBAAgB,CAAC,MAAM;aAC7B;SACD,EACD,aAAa,CACb,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;QAE1D,OAAO,aAA0B,CAAC;IACnC,CAAC,CAAC;AACH,CAAC","sourcesContent":["import \"reflect-metadata\";\n\nimport { EApiFunctionType } from \"../../enum\";\n\nimport { ApiFunction } from \"./function\";\n\nimport type { IApiGetListResponseResult } from \"../../interface\";\n\nimport type { TApiFunctionCreateProperties, TApiFunctionGetListProperties, TApiFunctionGetProperties, TApiFunctionUpdateProperties } from \"../../type\";\nimport type { BaseEntity, EntityTarget, FindOptionsRelations } from \"typeorm\";\n\nconst API_SERVICE_METADATA_KEY = Symbol(\"ApiServiceMetadata\");\n\nexport function ApiService<E extends BaseEntity>(options: { entity: EntityTarget<E>; relations?: FindOptionsRelations<E> }) {\n\treturn function <TFunction extends new (...arguments_: Array<any>) => {}>(target: TFunction) {\n\t\tconst originalConstructor = target;\n\n\t\tconst ExtendedClass = class extends originalConstructor {\n\t\t\tconstructor(...arguments_: Array<any>) {\n\t\t\t\tsuper(...arguments_);\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.GET_LIST)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.GET_LIST, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (properties: TApiFunctionGetListProperties<E>): Promise<IApiGetListResponseResult<E>> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator = ApiFunction({\n\t\t\t\t\t\t\t\tmodel: options.entity as new () => BaseEntity,\n\t\t\t\t\t\t\t\trelations: options.relations,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.GET_LIST,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: function () {},\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.GET_LIST, descriptor);\n\n\t\t\t\t\t\t\treturn Reflect.apply(decoratedDescriptor.value, this, [properties]);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.GET)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.GET, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (id: string, properties: TApiFunctionGetProperties<E>): Promise<E> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator = ApiFunction({\n\t\t\t\t\t\t\t\tmodel: options.entity as new () => BaseEntity,\n\t\t\t\t\t\t\t\trelations: options.relations,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.GET,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: function () {},\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.GET, descriptor);\n\n\t\t\t\t\t\t\treturn Reflect.apply(decoratedDescriptor.value, this, [id, properties]);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.CREATE)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.CREATE, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (properties: TApiFunctionCreateProperties<E>): Promise<E> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator = ApiFunction({\n\t\t\t\t\t\t\t\tmodel: options.entity as new () => BaseEntity,\n\t\t\t\t\t\t\t\trelations: options.relations,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.CREATE,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: function () {},\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.CREATE, descriptor);\n\n\t\t\t\t\t\t\treturn Reflect.apply(decoratedDescriptor.value, this, [properties]);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.UPDATE)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.UPDATE, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (id: string, properties: TApiFunctionUpdateProperties<E>): Promise<E> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator = ApiFunction({\n\t\t\t\t\t\t\t\tmodel: options.entity as new () => BaseEntity,\n\t\t\t\t\t\t\t\trelations: options.relations,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.UPDATE,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: function () {},\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.UPDATE, descriptor);\n\n\t\t\t\t\t\t\treturn Reflect.apply(decoratedDescriptor.value, this, [id, properties]);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.DELETE)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.DELETE, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (id: string): Promise<void> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator = ApiFunction({\n\t\t\t\t\t\t\t\tmodel: options.entity as new () => BaseEntity,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.DELETE,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: function () {},\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.DELETE, descriptor);\n\n\t\t\t\t\t\t\treturn Reflect.apply(decoratedDescriptor.value, this, [id]);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tReflect.defineMetadata(\n\t\t\tAPI_SERVICE_METADATA_KEY,\n\t\t\t{\n\t\t\t\tcreateMetadata: {\n\t\t\t\t\tmodel: options.entity,\n\t\t\t\t\ttype: EApiFunctionType.CREATE,\n\t\t\t\t},\n\t\t\t\tdeleteMetadata: {\n\t\t\t\t\tmodel: options.entity,\n\t\t\t\t\ttype: EApiFunctionType.DELETE,\n\t\t\t\t},\n\t\t\t\tentity: options.entity,\n\t\t\t\tgetListMetadata: {\n\t\t\t\t\tmodel: options.entity,\n\t\t\t\t\ttype: EApiFunctionType.GET_LIST,\n\t\t\t\t},\n\t\t\t\tgetMetadata: {\n\t\t\t\t\tmodel: options.entity,\n\t\t\t\t\ttype: EApiFunctionType.GET,\n\t\t\t\t},\n\t\t\t\tupdateMetadata: {\n\t\t\t\t\tmodel: options.entity,\n\t\t\t\t\ttype: EApiFunctionType.UPDATE,\n\t\t\t\t},\n\t\t\t},\n\t\t\tExtendedClass,\n\t\t);\n\n\t\tObject.setPrototypeOf(ExtendedClass, originalConstructor);\n\n\t\treturn ExtendedClass as TFunction;\n\t};\n}\n"]}
1
+ {"version":3,"file":"service.decorator.js","sourceRoot":"/","sources":["decorator/api/service.decorator.ts"],"names":[],"mappings":";;AAWA,gCA0KC;AArLD,qCAA8C;AAE9C,yCAAyC;AASzC,SAAgB,UAAU,CAA2B,UAAoC;IACxF,MAAM,EAAE,MA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GAAkG,IAAA,sBAAW,EAAC;gCACvI,MAAM;gCACN,IAAI,EAAE,uBAAgB,CAAC,MAAM;6BAC7B,CAAC,CAAC;4BAEH,MAAM,UAAU,GAKZ;gCACH,YAAY,EAAE,IAAI;gCAClB,UAAU,EAAE,IAAI;gCAChB,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;gCACnB,QAAQ,EAAE,IAAI;6BACd,CAAC;4BAEF,MAAM,mBAAmB,GAAuB,oBAAoB,CAAC,IAAI,EAAE,uBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;4BAEhH,OAAQ,mBAAmB,CAAC,KAAkD,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;wBAC/F,CAAC;wBACD,QAAQ,EAAE,IAAI;qBACd,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;SACD,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;QAE1D,OAAO,aAA0B,CAAC;IACnC,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { EApiFunctionType } from \"../../enum\";\n\nimport { ApiFunction } from \"./function\";\n\nimport type { IApiBaseEntity, IApiGetListResponseResult } from \"../../interface\";\n\nimport type { TApiFunctionCreateProperties, TApiFunctionGetListProperties, TApiFunctionGetProperties, TApiFunctionUpdateProperties } from \"../../type\";\nimport type { TApiServiceProperties } from \"../../type/decorator/api/service-properties.type\";\n\nimport type { FindOptionsRelations } from \"typeorm\";\n\nexport function ApiService<E extends IApiBaseEntity>(properties: TApiServiceProperties<E>) {\n\tconst { entity }: TApiServiceProperties<E> = properties;\n\n\treturn function <TFunction extends new (...arguments_: Array<any>) => {}>(target: TFunction): TFunction {\n\t\tconst originalConstructor: TFunction = target;\n\n\t\tconst ExtendedClass: { new (...arguments_: Array<any>): {}; prototype: {} } = class extends originalConstructor {\n\t\t\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\t\t\tconstructor(..._arguments: Array<any>) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\t\tsuper(..._arguments);\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.GET_LIST)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.GET_LIST, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (properties: TApiFunctionGetListProperties<E>, relations: FindOptionsRelations<E>): Promise<IApiGetListResponseResult<E>> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator: (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor = ApiFunction({\n\t\t\t\t\t\t\t\tentity,\n\t\t\t\t\t\t\t\trelations,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.GET_LIST,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor: {\n\t\t\t\t\t\t\t\tconfigurable: boolean;\n\t\t\t\t\t\t\t\tenumerable: boolean;\n\t\t\t\t\t\t\t\tvalue: () => void;\n\t\t\t\t\t\t\t\twritable: boolean;\n\t\t\t\t\t\t\t} = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: () => void 0,\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.GET_LIST, descriptor);\n\n\t\t\t\t\t\t\treturn (decoratedDescriptor.value as (this: any, properties: TApiFunctionGetListProperties<E>) => Promise<IApiGetListResponseResult<E>>).call(this, properties);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.GET)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.GET, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (id: string, properties: TApiFunctionGetProperties<E>, relations: FindOptionsRelations<E>): Promise<E> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator: (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor = ApiFunction({\n\t\t\t\t\t\t\t\tentity,\n\t\t\t\t\t\t\t\trelations,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.GET,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor: {\n\t\t\t\t\t\t\t\tconfigurable: boolean;\n\t\t\t\t\t\t\t\tenumerable: boolean;\n\t\t\t\t\t\t\t\tvalue: () => void;\n\t\t\t\t\t\t\t\twritable: boolean;\n\t\t\t\t\t\t\t} = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: () => void 0,\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.GET, descriptor);\n\n\t\t\t\t\t\t\treturn (decoratedDescriptor.value as (this: any, id: string, properties: TApiFunctionGetProperties<E>) => Promise<E>).call(this, id, properties);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.CREATE)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.CREATE, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (properties: TApiFunctionCreateProperties<E>): Promise<E> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator: (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor = ApiFunction({\n\t\t\t\t\t\t\t\tentity,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.CREATE,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor: {\n\t\t\t\t\t\t\t\tconfigurable: boolean;\n\t\t\t\t\t\t\t\tenumerable: boolean;\n\t\t\t\t\t\t\t\tvalue: () => void;\n\t\t\t\t\t\t\t\twritable: boolean;\n\t\t\t\t\t\t\t} = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: () => void 0,\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.CREATE, descriptor);\n\n\t\t\t\t\t\t\treturn (decoratedDescriptor.value as (this: any, properties: TApiFunctionCreateProperties<E>) => Promise<E>).call(this, properties);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.UPDATE)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.UPDATE, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (id: string, properties: TApiFunctionUpdateProperties<E>): Promise<E> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator: (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor = ApiFunction({\n\t\t\t\t\t\t\t\tentity,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.UPDATE,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor: {\n\t\t\t\t\t\t\t\tconfigurable: boolean;\n\t\t\t\t\t\t\t\tenumerable: boolean;\n\t\t\t\t\t\t\t\tvalue: () => void;\n\t\t\t\t\t\t\t\twritable: boolean;\n\t\t\t\t\t\t\t} = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: () => void 0,\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.UPDATE, descriptor);\n\n\t\t\t\t\t\t\treturn (decoratedDescriptor.value as (this: any, id: string, properties: TApiFunctionUpdateProperties<E>) => Promise<E>).call(this, id, properties);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!this.hasOwnProperty(EApiFunctionType.DELETE)) {\n\t\t\t\t\tObject.defineProperty(this, EApiFunctionType.DELETE, {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: async function (id: string): Promise<void> {\n\t\t\t\t\t\t\tconst apiFunctionDecorator: (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor = ApiFunction({\n\t\t\t\t\t\t\t\tentity,\n\t\t\t\t\t\t\t\ttype: EApiFunctionType.DELETE,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst descriptor: {\n\t\t\t\t\t\t\t\tconfigurable: boolean;\n\t\t\t\t\t\t\t\tenumerable: boolean;\n\t\t\t\t\t\t\t\tvalue: () => void;\n\t\t\t\t\t\t\t\twritable: boolean;\n\t\t\t\t\t\t\t} = {\n\t\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\t\tvalue: () => void 0,\n\t\t\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst decoratedDescriptor: PropertyDescriptor = apiFunctionDecorator(this, EApiFunctionType.DELETE, descriptor);\n\n\t\t\t\t\t\t\treturn (decoratedDescriptor.value as (this: any, id: string) => Promise<void>).call(this, id);\n\t\t\t\t\t\t},\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tObject.setPrototypeOf(ExtendedClass, originalConstructor);\n\n\t\treturn ExtendedClass as TFunction;\n\t};\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  export declare enum EApiAuthenticationType {
2
2
  ACCOUNT = "account",
3
3
  ADMIN = "admin",
4
+ MERCHANT = "merchant",
4
5
  USER = "user"
5
6
  }
@@ -5,6 +5,7 @@ var EApiAuthenticationType;
5
5
  (function (EApiAuthenticationType) {
6
6
  EApiAuthenticationType["ACCOUNT"] = "account";
7
7
  EApiAuthenticationType["ADMIN"] = "admin";
8
+ EApiAuthenticationType["MERCHANT"] = "merchant";
8
9
  EApiAuthenticationType["USER"] = "user";
9
10
  })(EApiAuthenticationType || (exports.EApiAuthenticationType = EApiAuthenticationType = {}));
10
11
  //# sourceMappingURL=authentication-type.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authentication-type.enum.js","sourceRoot":"/","sources":["enum/decorator/api/authentication-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IACjC,6CAAmB,CAAA;IACnB,yCAAe,CAAA;IACf,uCAAa,CAAA;AACd,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC","sourcesContent":["export enum EApiAuthenticationType {\n\tACCOUNT = \"account\",\n\tADMIN = \"admin\",\n\tUSER = \"user\",\n}\n"]}
1
+ {"version":3,"file":"authentication-type.enum.js","sourceRoot":"/","sources":["enum/decorator/api/authentication-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAKX;AALD,WAAY,sBAAsB;IACjC,6CAAmB,CAAA;IACnB,yCAAe,CAAA;IACf,+CAAqB,CAAA;IACrB,uCAAa,CAAA;AACd,CAAC,EALW,sBAAsB,sCAAtB,sBAAsB,QAKjC","sourcesContent":["export enum EApiAuthenticationType {\n\tACCOUNT = \"account\",\n\tADMIN = \"admin\",\n\tMERCHANT = \"merchant\",\n\tUSER = \"user\",\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  export declare enum EApiDtoType {
2
- REQUEST = "request",
3
- RESPONSE = "response",
2
+ BODY = "body",
4
3
  QUERY = "query",
5
- BODY = "body"
4
+ REQUEST = "request",
5
+ RESPONSE = "response"
6
6
  }
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EApiDtoType = void 0;
4
4
  var EApiDtoType;
5
5
  (function (EApiDtoType) {
6
+ EApiDtoType["BODY"] = "body";
7
+ EApiDtoType["QUERY"] = "query";
6
8
  EApiDtoType["REQUEST"] = "request";
7
9
  EApiDtoType["RESPONSE"] = "response";
8
- EApiDtoType["QUERY"] = "query";
9
- EApiDtoType["BODY"] = "body";
10
10
  })(EApiDtoType || (exports.EApiDtoType = EApiDtoType = {}));
11
11
  //# sourceMappingURL=dto-type.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dto-type.enum.js","sourceRoot":"/","sources":["enum/decorator/api/dto-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,4BAAa,CAAA;AACjB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB","sourcesContent":["export enum EApiDtoType {\n REQUEST = \"request\",\n RESPONSE = \"response\",\n QUERY = \"query\",\n BODY = \"body\",\n}\n"]}
1
+ {"version":3,"file":"dto-type.enum.js","sourceRoot":"/","sources":["enum/decorator/api/dto-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAKX;AALD,WAAY,WAAW;IACtB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;AACtB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB","sourcesContent":["export enum EApiDtoType {\n\tBODY = \"body\",\n\tQUERY = \"query\",\n\tREQUEST = \"request\",\n\tRESPONSE = \"response\",\n}\n"]}
@@ -4,5 +4,6 @@ export declare enum EApiPropertyDescribeType {
4
4
  NUMBER = "number",
5
5
  OBJECT = "object",
6
6
  STRING = "string",
7
- UUID = "uuid"
7
+ UUID = "uuid",
8
+ RELATION = "relation"
8
9
  }
@@ -9,5 +9,6 @@ var EApiPropertyDescribeType;
9
9
  EApiPropertyDescribeType["OBJECT"] = "object";
10
10
  EApiPropertyDescribeType["STRING"] = "string";
11
11
  EApiPropertyDescribeType["UUID"] = "uuid";
12
+ EApiPropertyDescribeType["RELATION"] = "relation";
12
13
  })(EApiPropertyDescribeType || (exports.EApiPropertyDescribeType = EApiPropertyDescribeType = {}));
13
14
  //# sourceMappingURL=desribe-type.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"desribe-type.enum.js","sourceRoot":"/","sources":["enum/decorator/api/property/desribe-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,wBAOX;AAPD,WAAY,wBAAwB;IACnC,+CAAmB,CAAA;IACnB,yCAAa,CAAA;IACb,6CAAiB,CAAA;IACjB,6CAAiB,CAAA;IACjB,6CAAiB,CAAA;IACjB,yCAAa,CAAA;AACd,CAAC,EAPW,wBAAwB,wCAAxB,wBAAwB,QAOnC","sourcesContent":["export enum EApiPropertyDescribeType {\n\tBOOLEAN = \"boolean\",\n\tDATE = \"date\",\n\tNUMBER = \"number\",\n\tOBJECT = \"object\",\n\tSTRING = \"string\",\n\tUUID = \"uuid\",\n}\n"]}
1
+ {"version":3,"file":"desribe-type.enum.js","sourceRoot":"/","sources":["enum/decorator/api/property/desribe-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,wBAQX;AARD,WAAY,wBAAwB;IACnC,+CAAmB,CAAA;IACnB,yCAAa,CAAA;IACb,6CAAiB,CAAA;IACjB,6CAAiB,CAAA;IACjB,6CAAiB,CAAA;IACjB,yCAAa,CAAA;IACb,iDAAqB,CAAA;AACtB,CAAC,EARW,wBAAwB,wCAAxB,wBAAwB,QAQnC","sourcesContent":["export enum EApiPropertyDescribeType {\n\tBOOLEAN = \"boolean\",\n\tDATE = \"date\",\n\tNUMBER = \"number\",\n\tOBJECT = \"object\",\n\tSTRING = \"string\",\n\tUUID = \"uuid\",\n\tRELATION = \"relation\",\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { EApiRouteType } from "../../enum";
2
2
  import type { BaseApiService } from "../../class";
3
- import type { IApiEntity } from "../../interface";
3
+ import type { IApiBaseEntity, IApiEntity } from "../../interface";
4
4
  import type { IApiControllerProperties, IApiControllerPropertiesRoute } from "../../interface/decorator/api/controller-properties.interface";
5
5
  export declare class ApiControllerFactory<E> {
6
6
  protected target: new (...arguments_: Array<any>) => {
@@ -15,14 +15,14 @@ export declare class ApiControllerFactory<E> {
15
15
  }, properties: IApiControllerProperties<E>);
16
16
  applyDecorators(method: EApiRouteType, methodName: string, routeConfig: IApiControllerPropertiesRoute<E>, decorators: Array<MethodDecorator> | Array<PropertyDecorator>): void;
17
17
  applyMetadata(method: EApiRouteType, methodName: string, routeConfig: IApiControllerPropertiesRoute<E>): void;
18
- writeDtoToSwagger(method: EApiRouteType, routeConfig: IApiControllerPropertiesRoute<E>): void;
19
18
  createMethod(method: EApiRouteType): void;
20
- protected [EApiRouteType.CREATE](methodName: string): void;
21
- protected [EApiRouteType.DELETE](methodName: string, entity: IApiEntity): void;
22
- protected [EApiRouteType.GET](methodName: string, entity: IApiEntity): void;
23
- protected [EApiRouteType.GET_LIST](methodName: string): void;
24
- protected [EApiRouteType.PARTIAL_UPDATE](methodName: string, entity: IApiEntity): void;
25
- protected [EApiRouteType.UPDATE](methodName: string, entity: IApiEntity): void;
19
+ protected [EApiRouteType.CREATE](_method: EApiRouteType, methodName: string): void;
20
+ protected [EApiRouteType.DELETE](_method: EApiRouteType, methodName: string, _entity: IApiEntity, entityMetadata: IApiEntity): void;
21
+ protected [EApiRouteType.GET](method: EApiRouteType, methodName: string, entity: IApiBaseEntity, entityMetadata: IApiEntity): void;
22
+ protected [EApiRouteType.GET_LIST](_method: EApiRouteType, methodName: string): void;
23
+ protected [EApiRouteType.PARTIAL_UPDATE](_method: EApiRouteType, methodName: string, entity: IApiEntity): void;
24
+ protected [EApiRouteType.UPDATE](_method: EApiRouteType, methodName: string, entity: IApiEntity): void;
26
25
  init(): void;
26
+ writeDtoToSwagger(method: EApiRouteType, routeConfig: IApiControllerPropertiesRoute<E>, entityMetadata: IApiEntity): void;
27
27
  protected get targetPrototype(): InstanceType<typeof this.target>;
28
28
  }