@nest-omni/core 1.0.1 → 1.0.3

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 (528) hide show
  1. package/package.json +10 -3
  2. package/dist/boilerplate.polyfill.d.ts +0 -39
  3. package/dist/boilerplate.polyfill.js +0 -66
  4. package/dist/boilerplate.polyfill.js.map +0 -1
  5. package/dist/common/abstract-client.service.d.ts +0 -16
  6. package/dist/common/abstract-client.service.js +0 -26
  7. package/dist/common/abstract-client.service.js.map +0 -1
  8. package/dist/common/abstract.entity.d.ts +0 -17
  9. package/dist/common/abstract.entity.js +0 -71
  10. package/dist/common/abstract.entity.js.map +0 -1
  11. package/dist/common/dto/abstract.dto.d.ts +0 -13
  12. package/dist/common/dto/abstract.dto.js +0 -63
  13. package/dist/common/dto/abstract.dto.js.map +0 -1
  14. package/dist/common/dto/bulk-id.dto.d.ts +0 -3
  15. package/dist/common/dto/bulk-id.dto.js +0 -29
  16. package/dist/common/dto/bulk-id.dto.js.map +0 -1
  17. package/dist/common/dto/create-translation.dto.d.ts +0 -5
  18. package/dist/common/dto/create-translation.dto.js +0 -28
  19. package/dist/common/dto/create-translation.dto.js.map +0 -1
  20. package/dist/common/dto/page-meta.dto.d.ts +0 -15
  21. package/dist/common/dto/page-meta.dto.js +0 -55
  22. package/dist/common/dto/page-meta.dto.js.map +0 -1
  23. package/dist/common/dto/page-options.dto.d.ts +0 -8
  24. package/dist/common/dto/page-options.dto.js +0 -52
  25. package/dist/common/dto/page-options.dto.js.map +0 -1
  26. package/dist/common/dto/page.dto.d.ts +0 -11
  27. package/dist/common/dto/page.dto.js +0 -61
  28. package/dist/common/dto/page.dto.js.map +0 -1
  29. package/dist/common/utils.d.ts +0 -3
  30. package/dist/common/utils.js +0 -26
  31. package/dist/common/utils.js.map +0 -1
  32. package/dist/constants/index.d.ts +0 -4
  33. package/dist/constants/index.js +0 -21
  34. package/dist/constants/index.js.map +0 -1
  35. package/dist/constants/language-code.d.ts +0 -5
  36. package/dist/constants/language-code.js +0 -10
  37. package/dist/constants/language-code.js.map +0 -1
  38. package/dist/constants/order.d.ts +0 -4
  39. package/dist/constants/order.js +0 -9
  40. package/dist/constants/order.js.map +0 -1
  41. package/dist/constants/role-type.d.ts +0 -4
  42. package/dist/constants/role-type.js +0 -9
  43. package/dist/constants/role-type.js.map +0 -1
  44. package/dist/constants/token-type.d.ts +0 -4
  45. package/dist/constants/token-type.js +0 -9
  46. package/dist/constants/token-type.js.map +0 -1
  47. package/dist/decorators/api-page-ok-response.decorator.d.ts +0 -5
  48. package/dist/decorators/api-page-ok-response.decorator.js +0 -26
  49. package/dist/decorators/api-page-ok-response.decorator.js.map +0 -1
  50. package/dist/decorators/auth-user.decorator.d.ts +0 -1
  51. package/dist/decorators/auth-user.decorator.js +0 -16
  52. package/dist/decorators/auth-user.decorator.js.map +0 -1
  53. package/dist/decorators/controller.decorator.d.ts +0 -1
  54. package/dist/decorators/controller.decorator.js +0 -12
  55. package/dist/decorators/controller.decorator.js.map +0 -1
  56. package/dist/decorators/field.decorators.d.ts +0 -71
  57. package/dist/decorators/field.decorators.js +0 -457
  58. package/dist/decorators/field.decorators.js.map +0 -1
  59. package/dist/decorators/http.decorators.d.ts +0 -3
  60. package/dist/decorators/http.decorators.js +0 -9
  61. package/dist/decorators/http.decorators.js.map +0 -1
  62. package/dist/decorators/index.d.ts +0 -12
  63. package/dist/decorators/index.js +0 -29
  64. package/dist/decorators/index.js.map +0 -1
  65. package/dist/decorators/omni-auth.decorator.d.ts +0 -8
  66. package/dist/decorators/omni-auth.decorator.js +0 -36
  67. package/dist/decorators/omni-auth.decorator.js.map +0 -1
  68. package/dist/decorators/operation.decorator.d.ts +0 -1
  69. package/dist/decorators/operation.decorator.js +0 -7
  70. package/dist/decorators/operation.decorator.js.map +0 -1
  71. package/dist/decorators/property.decorators.d.ts +0 -15
  72. package/dist/decorators/property.decorators.js +0 -43
  73. package/dist/decorators/property.decorators.js.map +0 -1
  74. package/dist/decorators/public-route.decorator.d.ts +0 -3
  75. package/dist/decorators/public-route.decorator.js +0 -8
  76. package/dist/decorators/public-route.decorator.js.map +0 -1
  77. package/dist/decorators/swagger.schema.d.ts +0 -5
  78. package/dist/decorators/swagger.schema.js +0 -80
  79. package/dist/decorators/swagger.schema.js.map +0 -1
  80. package/dist/decorators/timestamp-column.decorator.d.ts +0 -1
  81. package/dist/decorators/timestamp-column.decorator.js +0 -29
  82. package/dist/decorators/timestamp-column.decorator.js.map +0 -1
  83. package/dist/decorators/transform.decorators.d.ts +0 -8
  84. package/dist/decorators/transform.decorators.js +0 -96
  85. package/dist/decorators/transform.decorators.js.map +0 -1
  86. package/dist/decorators/translate.decorator.d.ts +0 -5
  87. package/dist/decorators/translate.decorator.js +0 -18
  88. package/dist/decorators/translate.decorator.js.map +0 -1
  89. package/dist/decorators/use-dto.decorator.d.ts +0 -4
  90. package/dist/decorators/use-dto.decorator.js +0 -10
  91. package/dist/decorators/use-dto.decorator.js.map +0 -1
  92. package/dist/decorators/user-check.decorator.d.ts +0 -6
  93. package/dist/decorators/user-check.decorator.js +0 -22
  94. package/dist/decorators/user-check.decorator.js.map +0 -1
  95. package/dist/decorators/user.decorator.d.ts +0 -8
  96. package/dist/decorators/user.decorator.js +0 -39
  97. package/dist/decorators/user.decorator.js.map +0 -1
  98. package/dist/decorators/user_auth.decorator.d.ts +0 -1
  99. package/dist/decorators/user_auth.decorator.js +0 -17
  100. package/dist/decorators/user_auth.decorator.js.map +0 -1
  101. package/dist/decorators/validator.decorators.d.ts +0 -10
  102. package/dist/decorators/validator.decorators.js +0 -63
  103. package/dist/decorators/validator.decorators.js.map +0 -1
  104. package/dist/exceptions/file-not-image.exception.d.ts +0 -4
  105. package/dist/exceptions/file-not-image.exception.js +0 -11
  106. package/dist/exceptions/file-not-image.exception.js.map +0 -1
  107. package/dist/exceptions/index.d.ts +0 -2
  108. package/dist/exceptions/index.js +0 -19
  109. package/dist/exceptions/index.js.map +0 -1
  110. package/dist/exceptions/page-type.exception.d.ts +0 -4
  111. package/dist/exceptions/page-type.exception.js +0 -11
  112. package/dist/exceptions/page-type.exception.js.map +0 -1
  113. package/dist/exceptions/user-not-found.exception.d.ts +0 -4
  114. package/dist/exceptions/user-not-found.exception.js +0 -11
  115. package/dist/exceptions/user-not-found.exception.js.map +0 -1
  116. package/dist/filters/bad-request.filter.d.ts +0 -5
  117. package/dist/filters/bad-request.filter.js +0 -65
  118. package/dist/filters/bad-request.filter.js.map +0 -1
  119. package/dist/filters/constraint-errors.d.ts +0 -1
  120. package/dist/filters/constraint-errors.js +0 -7
  121. package/dist/filters/constraint-errors.js.map +0 -1
  122. package/dist/filters/index.d.ts +0 -3
  123. package/dist/filters/index.js +0 -20
  124. package/dist/filters/index.js.map +0 -1
  125. package/dist/filters/query-failed.filter.d.ts +0 -10
  126. package/dist/filters/query-failed.filter.js +0 -43
  127. package/dist/filters/query-failed.filter.js.map +0 -1
  128. package/dist/guards/auth.guard.d.ts +0 -4
  129. package/dist/guards/auth.guard.js +0 -13
  130. package/dist/guards/auth.guard.js.map +0 -1
  131. package/dist/guards/roles.guard.d.ts +0 -7
  132. package/dist/guards/roles.guard.js +0 -36
  133. package/dist/guards/roles.guard.js.map +0 -1
  134. package/dist/health-checker/health-checker.controller.d.ts +0 -15
  135. package/dist/health-checker/health-checker.controller.js +0 -68
  136. package/dist/health-checker/health-checker.controller.js.map +0 -1
  137. package/dist/health-checker/health-checker.module.d.ts +0 -2
  138. package/dist/health-checker/health-checker.module.js +0 -26
  139. package/dist/health-checker/health-checker.module.js.map +0 -1
  140. package/dist/health-checker/health-indicators/service.indicator.d.ts +0 -8
  141. package/dist/health-checker/health-indicators/service.indicator.js +0 -57
  142. package/dist/health-checker/health-indicators/service.indicator.js.map +0 -1
  143. package/dist/helpers/common.helper.d.ts +0 -3
  144. package/dist/helpers/common.helper.js +0 -37
  145. package/dist/helpers/common.helper.js.map +0 -1
  146. package/dist/helpers/date.helper.d.ts +0 -10
  147. package/dist/helpers/date.helper.js +0 -59
  148. package/dist/helpers/date.helper.js.map +0 -1
  149. package/dist/helpers/excel.helper.d.ts +0 -12
  150. package/dist/helpers/excel.helper.js +0 -250
  151. package/dist/helpers/excel.helper.js.map +0 -1
  152. package/dist/helpers/index.d.ts +0 -3
  153. package/dist/helpers/index.js +0 -20
  154. package/dist/helpers/index.js.map +0 -1
  155. package/dist/index.d.ts +0 -11
  156. package/dist/index.js +0 -28
  157. package/dist/index.js.map +0 -1
  158. package/dist/interceptors/auth-user.interceptor.d.ts +0 -4
  159. package/dist/interceptors/auth-user.interceptor.js +0 -25
  160. package/dist/interceptors/auth-user.interceptor.js.map +0 -1
  161. package/dist/interceptors/index.d.ts +0 -2
  162. package/dist/interceptors/index.js +0 -19
  163. package/dist/interceptors/index.js.map +0 -1
  164. package/dist/interceptors/language-interceptor.service.d.ts +0 -6
  165. package/dist/interceptors/language-interceptor.service.js +0 -31
  166. package/dist/interceptors/language-interceptor.service.js.map +0 -1
  167. package/dist/interceptors/translation-interceptor.service.d.ts +0 -5
  168. package/dist/interceptors/translation-interceptor.service.js +0 -35
  169. package/dist/interceptors/translation-interceptor.service.js.map +0 -1
  170. package/dist/interfaces/IApiFile.d.ts +0 -4
  171. package/dist/interfaces/IApiFile.js +0 -3
  172. package/dist/interfaces/IApiFile.js.map +0 -1
  173. package/dist/interfaces/IFile.d.ts +0 -9
  174. package/dist/interfaces/IFile.js +0 -3
  175. package/dist/interfaces/IFile.js.map +0 -1
  176. package/dist/interfaces/ITranslationDecoratorInterface.d.ts +0 -3
  177. package/dist/interfaces/ITranslationDecoratorInterface.js +0 -3
  178. package/dist/interfaces/ITranslationDecoratorInterface.js.map +0 -1
  179. package/dist/interfaces/index.d.ts +0 -3
  180. package/dist/interfaces/index.js +0 -20
  181. package/dist/interfaces/index.js.map +0 -1
  182. package/dist/interfaces/response.d.ts +0 -25
  183. package/dist/interfaces/response.js +0 -3
  184. package/dist/interfaces/response.js.map +0 -1
  185. package/dist/middlewares/index.d.ts +0 -3
  186. package/dist/middlewares/index.js +0 -20
  187. package/dist/middlewares/index.js.map +0 -1
  188. package/dist/middlewares/omni-auth.middleware.d.ts +0 -1
  189. package/dist/middlewares/omni-auth.middleware.js +0 -14
  190. package/dist/middlewares/omni-auth.middleware.js.map +0 -1
  191. package/dist/middlewares/powerby.middleware.d.ts +0 -1
  192. package/dist/middlewares/powerby.middleware.js +0 -11
  193. package/dist/middlewares/powerby.middleware.js.map +0 -1
  194. package/dist/middlewares/request-id.middleware.d.ts +0 -7
  195. package/dist/middlewares/request-id.middleware.js +0 -23
  196. package/dist/middlewares/request-id.middleware.js.map +0 -1
  197. package/dist/providers/context.provider.d.ts +0 -32
  198. package/dist/providers/context.provider.js +0 -71
  199. package/dist/providers/context.provider.js.map +0 -1
  200. package/dist/providers/generator.provider.d.ts +0 -9
  201. package/dist/providers/generator.provider.js +0 -51
  202. package/dist/providers/generator.provider.js.map +0 -1
  203. package/dist/providers/index.d.ts +0 -2
  204. package/dist/providers/index.js +0 -19
  205. package/dist/providers/index.js.map +0 -1
  206. package/dist/setup/bootstrap.setup.d.ts +0 -5
  207. package/dist/setup/bootstrap.setup.js +0 -102
  208. package/dist/setup/bootstrap.setup.js.map +0 -1
  209. package/dist/setup/index.d.ts +0 -1
  210. package/dist/setup/index.js +0 -18
  211. package/dist/setup/index.js.map +0 -1
  212. package/dist/setup-swagger.d.ts +0 -2
  213. package/dist/setup-swagger.js +0 -63
  214. package/dist/setup-swagger.js.map +0 -1
  215. package/dist/shared/index.d.ts +0 -2
  216. package/dist/shared/index.js +0 -19
  217. package/dist/shared/index.js.map +0 -1
  218. package/dist/shared/serviceRegistryModule.d.ts +0 -2
  219. package/dist/shared/serviceRegistryModule.js +0 -102
  220. package/dist/shared/serviceRegistryModule.js.map +0 -1
  221. package/dist/shared/services/api-config.service.d.ts +0 -70
  222. package/dist/shared/services/api-config.service.js +0 -286
  223. package/dist/shared/services/api-config.service.js.map +0 -1
  224. package/dist/shared/services/aws-s3.service.d.ts +0 -10
  225. package/dist/shared/services/aws-s3.service.js +0 -49
  226. package/dist/shared/services/aws-s3.service.js.map +0 -1
  227. package/dist/shared/services/generator.service.d.ts +0 -4
  228. package/dist/shared/services/generator.service.js +0 -24
  229. package/dist/shared/services/generator.service.js.map +0 -1
  230. package/dist/shared/services/index.d.ts +0 -5
  231. package/dist/shared/services/index.js +0 -22
  232. package/dist/shared/services/index.js.map +0 -1
  233. package/dist/shared/services/translation.service.d.ts +0 -9
  234. package/dist/shared/services/translation.service.js +0 -61
  235. package/dist/shared/services/translation.service.js.map +0 -1
  236. package/dist/shared/services/validator.service.d.ts +0 -3
  237. package/dist/shared/services/validator.service.js +0 -21
  238. package/dist/shared/services/validator.service.js.map +0 -1
  239. package/dist/snake-naming.strategy.d.ts +0 -11
  240. package/dist/snake-naming.strategy.js +0 -38
  241. package/dist/snake-naming.strategy.js.map +0 -1
  242. package/dist/tsconfig.tsbuildinfo +0 -1
  243. package/dist/types.d.ts +0 -9
  244. package/dist/types.js +0 -3
  245. package/dist/types.js.map +0 -1
  246. package/dist/validators/file-mimetype.validator.d.ts +0 -13
  247. package/dist/validators/file-mimetype.validator.js +0 -24
  248. package/dist/validators/file-mimetype.validator.js.map +0 -1
  249. package/dist/validators/index.d.ts +0 -3
  250. package/dist/validators/index.js +0 -20
  251. package/dist/validators/index.js.map +0 -1
  252. package/dist/validators/is-exists.validator.d.ts +0 -18
  253. package/dist/validators/is-exists.validator.js +0 -52
  254. package/dist/validators/is-exists.validator.js.map +0 -1
  255. package/dist/validators/is-unique.validator.d.ts +0 -17
  256. package/dist/validators/is-unique.validator.js +0 -83
  257. package/dist/validators/is-unique.validator.js.map +0 -1
  258. package/dist/validators/phone-country-code.validator.d.ts +0 -2
  259. package/dist/validators/phone-country-code.validator.js +0 -31
  260. package/dist/validators/phone-country-code.validator.js.map +0 -1
  261. package/dist/validators/same-as.validator.d.ts +0 -2
  262. package/dist/validators/same-as.validator.js +0 -26
  263. package/dist/validators/same-as.validator.js.map +0 -1
  264. package/dist/validators/skip-empty.validator.d.ts +0 -1
  265. package/dist/validators/skip-empty.validator.js +0 -19
  266. package/dist/validators/skip-empty.validator.js.map +0 -1
  267. package/src/boilerplate.polyfill.d.ts +0 -39
  268. package/src/boilerplate.polyfill.js +0 -78
  269. package/src/boilerplate.polyfill.ts +0 -202
  270. package/src/common/abstract-client.service.d.ts +0 -20
  271. package/src/common/abstract-client.service.js +0 -39
  272. package/src/common/abstract-client.service.ts +0 -56
  273. package/src/common/abstract.entity.d.ts +0 -24
  274. package/src/common/abstract.entity.js +0 -152
  275. package/src/common/abstract.entity.ts +0 -73
  276. package/src/common/dto/abstract.dto.d.ts +0 -13
  277. package/src/common/dto/abstract.dto.js +0 -96
  278. package/src/common/dto/abstract.dto.ts +0 -64
  279. package/src/common/dto/bulk-id.dto.d.ts +0 -3
  280. package/src/common/dto/bulk-id.dto.js +0 -63
  281. package/src/common/dto/bulk-id.dto.ts +0 -13
  282. package/src/common/dto/create-translation.dto.d.ts +0 -5
  283. package/src/common/dto/create-translation.dto.js +0 -63
  284. package/src/common/dto/create-translation.dto.ts +0 -10
  285. package/src/common/dto/page-meta.dto.d.ts +0 -15
  286. package/src/common/dto/page-meta.dto.js +0 -88
  287. package/src/common/dto/page-meta.dto.ts +0 -37
  288. package/src/common/dto/page-options.dto.d.ts +0 -8
  289. package/src/common/dto/page-options.dto.js +0 -87
  290. package/src/common/dto/page-options.dto.ts +0 -35
  291. package/src/common/dto/page.dto.d.ts +0 -11
  292. package/src/common/dto/page.dto.js +0 -94
  293. package/src/common/dto/page.dto.ts +0 -36
  294. package/src/common/utils.d.ts +0 -14
  295. package/src/common/utils.js +0 -39
  296. package/src/common/utils.ts +0 -45
  297. package/src/constants/index.d.ts +0 -4
  298. package/src/constants/index.js +0 -20
  299. package/src/constants/index.ts +0 -4
  300. package/src/constants/language-code.d.ts +0 -5
  301. package/src/constants/language-code.js +0 -10
  302. package/src/constants/language-code.ts +0 -7
  303. package/src/constants/order.d.ts +0 -4
  304. package/src/constants/order.js +0 -8
  305. package/src/constants/order.ts +0 -4
  306. package/src/constants/role-type.d.ts +0 -4
  307. package/src/constants/role-type.js +0 -8
  308. package/src/constants/role-type.ts +0 -4
  309. package/src/constants/token-type.d.ts +0 -4
  310. package/src/constants/token-type.js +0 -8
  311. package/src/constants/token-type.ts +0 -4
  312. package/src/decorators/api-page-ok-response.decorator.d.ts +0 -5
  313. package/src/decorators/api-page-ok-response.decorator.js +0 -25
  314. package/src/decorators/api-page-ok-response.decorator.ts +0 -31
  315. package/src/decorators/auth-user.decorator.d.ts +0 -1
  316. package/src/decorators/auth-user.decorator.js +0 -15
  317. package/src/decorators/auth-user.decorator.ts +0 -16
  318. package/src/decorators/controller.decorator.d.ts +0 -1
  319. package/src/decorators/controller.decorator.js +0 -34
  320. package/src/decorators/controller.decorator.ts +0 -8
  321. package/src/decorators/field.decorators.d.ts +0 -71
  322. package/src/decorators/field.decorators.js +0 -455
  323. package/src/decorators/field.decorators.ts +0 -773
  324. package/src/decorators/http.decorators.d.ts +0 -3
  325. package/src/decorators/http.decorators.js +0 -8
  326. package/src/decorators/http.decorators.ts +0 -10
  327. package/src/decorators/index.d.ts +0 -12
  328. package/src/decorators/index.js +0 -28
  329. package/src/decorators/index.ts +0 -12
  330. package/src/decorators/omni-auth.decorator.d.ts +0 -8
  331. package/src/decorators/omni-auth.decorator.js +0 -60
  332. package/src/decorators/omni-auth.decorator.ts +0 -46
  333. package/src/decorators/operation.decorator.d.ts +0 -1
  334. package/src/decorators/operation.decorator.js +0 -6
  335. package/src/decorators/operation.decorator.ts +0 -4
  336. package/src/decorators/property.decorators.d.ts +0 -15
  337. package/src/decorators/property.decorators.js +0 -36
  338. package/src/decorators/property.decorators.ts +0 -62
  339. package/src/decorators/public-route.decorator.d.ts +0 -3
  340. package/src/decorators/public-route.decorator.js +0 -8
  341. package/src/decorators/public-route.decorator.ts +0 -8
  342. package/src/decorators/swagger.schema.d.ts +0 -5
  343. package/src/decorators/swagger.schema.js +0 -82
  344. package/src/decorators/swagger.schema.ts +0 -117
  345. package/src/decorators/timestamp-column.decorator.d.ts +0 -1
  346. package/src/decorators/timestamp-column.decorator.js +0 -28
  347. package/src/decorators/timestamp-column.decorator.ts +0 -29
  348. package/src/decorators/transform.decorators.d.ts +0 -35
  349. package/src/decorators/transform.decorators.js +0 -122
  350. package/src/decorators/transform.decorators.ts +0 -147
  351. package/src/decorators/translate.decorator.d.ts +0 -5
  352. package/src/decorators/translate.decorator.js +0 -18
  353. package/src/decorators/translate.decorator.ts +0 -19
  354. package/src/decorators/use-dto.decorator.d.ts +0 -4
  355. package/src/decorators/use-dto.decorator.js +0 -9
  356. package/src/decorators/use-dto.decorator.ts +0 -11
  357. package/src/decorators/user-check.decorator.d.ts +0 -6
  358. package/src/decorators/user-check.decorator.js +0 -44
  359. package/src/decorators/user-check.decorator.ts +0 -30
  360. package/src/decorators/user.decorator.d.ts +0 -8
  361. package/src/decorators/user.decorator.js +0 -62
  362. package/src/decorators/user.decorator.ts +0 -48
  363. package/src/decorators/user_auth.decorator.d.ts +0 -1
  364. package/src/decorators/user_auth.decorator.js +0 -16
  365. package/src/decorators/user_auth.decorator.ts +0 -15
  366. package/src/decorators/validator.decorators.d.ts +0 -10
  367. package/src/decorators/validator.decorators.js +0 -59
  368. package/src/decorators/validator.decorators.ts +0 -78
  369. package/src/exceptions/file-not-image.exception.d.ts +0 -4
  370. package/src/exceptions/file-not-image.exception.js +0 -10
  371. package/src/exceptions/file-not-image.exception.ts +0 -7
  372. package/src/exceptions/index.d.ts +0 -2
  373. package/src/exceptions/index.js +0 -18
  374. package/src/exceptions/index.ts +0 -2
  375. package/src/exceptions/page-type.exception.d.ts +0 -4
  376. package/src/exceptions/page-type.exception.js +0 -10
  377. package/src/exceptions/page-type.exception.ts +0 -7
  378. package/src/exceptions/user-not-found.exception.d.ts +0 -4
  379. package/src/exceptions/user-not-found.exception.js +0 -10
  380. package/src/exceptions/user-not-found.exception.ts +0 -7
  381. package/src/filters/bad-request.filter.d.ts +0 -5
  382. package/src/filters/bad-request.filter.js +0 -104
  383. package/src/filters/bad-request.filter.ts +0 -67
  384. package/src/filters/constraint-errors.d.ts +0 -1
  385. package/src/filters/constraint-errors.js +0 -7
  386. package/src/filters/constraint-errors.ts +0 -5
  387. package/src/filters/index.d.ts +0 -3
  388. package/src/filters/index.js +0 -19
  389. package/src/filters/index.ts +0 -3
  390. package/src/filters/query-failed.filter.d.ts +0 -10
  391. package/src/filters/query-failed.filter.js +0 -81
  392. package/src/filters/query-failed.filter.ts +0 -32
  393. package/src/health-checker/health-checker.controller.d.ts +0 -15
  394. package/src/health-checker/health-checker.controller.js +0 -104
  395. package/src/health-checker/health-checker.controller.ts +0 -51
  396. package/src/health-checker/health-checker.module.d.ts +0 -2
  397. package/src/health-checker/health-checker.module.js +0 -69
  398. package/src/health-checker/health-checker.module.ts +0 -13
  399. package/src/health-checker/health-indicators/service.indicator.d.ts +0 -8
  400. package/src/health-checker/health-indicators/service.indicator.js +0 -102
  401. package/src/health-checker/health-indicators/service.indicator.ts +0 -44
  402. package/src/helpers/common.helper.d.ts +0 -16
  403. package/src/helpers/common.helper.js +0 -49
  404. package/src/helpers/common.helper.ts +0 -49
  405. package/src/helpers/date.helper.d.ts +0 -10
  406. package/src/helpers/date.helper.js +0 -81
  407. package/src/helpers/date.helper.ts +0 -64
  408. package/src/helpers/excel.helper.d.ts +0 -27
  409. package/src/helpers/excel.helper.js +0 -338
  410. package/src/helpers/index.d.ts +0 -3
  411. package/src/helpers/index.js +0 -19
  412. package/src/helpers/index.ts +0 -3
  413. package/src/i18n/en_US/validation.json +0 -38
  414. package/src/i18n/zh_CN/validation.json +0 -38
  415. package/src/index.d.ts +0 -11
  416. package/src/index.js +0 -28
  417. package/src/index.ts +0 -12
  418. package/src/interceptors/auth-user.interceptor.d.ts +0 -4
  419. package/src/interceptors/auth-user.interceptor.js +0 -68
  420. package/src/interceptors/auth-user.interceptor.ts +0 -20
  421. package/src/interceptors/index.d.ts +0 -2
  422. package/src/interceptors/index.js +0 -18
  423. package/src/interceptors/index.ts +0 -2
  424. package/src/interceptors/language-interceptor.service.d.ts +0 -6
  425. package/src/interceptors/language-interceptor.service.js +0 -74
  426. package/src/interceptors/language-interceptor.service.ts +0 -31
  427. package/src/interceptors/translation-interceptor.service.d.ts +0 -5
  428. package/src/interceptors/translation-interceptor.service.js +0 -83
  429. package/src/interceptors/translation-interceptor.service.ts +0 -43
  430. package/src/interfaces/IApiFile.d.ts +0 -4
  431. package/src/interfaces/IApiFile.js +0 -2
  432. package/src/interfaces/IApiFile.ts +0 -4
  433. package/src/interfaces/IFile.d.ts +0 -9
  434. package/src/interfaces/IFile.js +0 -2
  435. package/src/interfaces/IFile.ts +0 -8
  436. package/src/interfaces/ITranslationDecoratorInterface.d.ts +0 -3
  437. package/src/interfaces/ITranslationDecoratorInterface.js +0 -2
  438. package/src/interfaces/ITranslationDecoratorInterface.ts +0 -3
  439. package/src/interfaces/index.d.ts +0 -3
  440. package/src/interfaces/index.js +0 -19
  441. package/src/interfaces/index.ts +0 -3
  442. package/src/interfaces/response.d.ts +0 -25
  443. package/src/interfaces/response.js +0 -2
  444. package/src/interfaces/response.ts +0 -37
  445. package/src/middlewares/index.d.ts +0 -3
  446. package/src/middlewares/index.js +0 -19
  447. package/src/middlewares/index.ts +0 -3
  448. package/src/middlewares/omni-auth.middleware.d.ts +0 -1
  449. package/src/middlewares/omni-auth.middleware.js +0 -13
  450. package/src/middlewares/omni-auth.middleware.ts +0 -10
  451. package/src/middlewares/powerby.middleware.d.ts +0 -1
  452. package/src/middlewares/powerby.middleware.js +0 -10
  453. package/src/middlewares/powerby.middleware.ts +0 -6
  454. package/src/middlewares/request-id.middleware.d.ts +0 -7
  455. package/src/middlewares/request-id.middleware.js +0 -22
  456. package/src/middlewares/request-id.middleware.ts +0 -28
  457. package/src/providers/context.provider.d.ts +0 -32
  458. package/src/providers/context.provider.js +0 -73
  459. package/src/providers/context.provider.ts +0 -98
  460. package/src/providers/generator.provider.d.ts +0 -13
  461. package/src/providers/generator.provider.js +0 -54
  462. package/src/providers/generator.provider.ts +0 -66
  463. package/src/providers/index.d.ts +0 -2
  464. package/src/providers/index.js +0 -18
  465. package/src/providers/index.ts +0 -2
  466. package/src/setup/bootstrap.setup.d.ts +0 -5
  467. package/src/setup/bootstrap.setup.js +0 -138
  468. package/src/setup/bootstrap.setup.ts +0 -139
  469. package/src/setup/index.d.ts +0 -1
  470. package/src/setup/index.js +0 -17
  471. package/src/setup/index.ts +0 -1
  472. package/src/setup/microservices.setup.js +0 -55
  473. package/src/setup-swagger.d.ts +0 -2
  474. package/src/setup-swagger.js +0 -62
  475. package/src/setup-swagger.ts +0 -67
  476. package/src/shared/index.d.ts +0 -2
  477. package/src/shared/index.js +0 -18
  478. package/src/shared/index.ts +0 -2
  479. package/src/shared/serviceRegistryModule.d.ts +0 -2
  480. package/src/shared/serviceRegistryModule.js +0 -176
  481. package/src/shared/serviceRegistryModule.ts +0 -110
  482. package/src/shared/services/api-config.service.d.ts +0 -73
  483. package/src/shared/services/api-config.service.js +0 -335
  484. package/src/shared/services/api-config.service.ts +0 -319
  485. package/src/shared/services/aws-s3.service.d.ts +0 -10
  486. package/src/shared/services/aws-s3.service.js +0 -96
  487. package/src/shared/services/aws-s3.service.ts +0 -39
  488. package/src/shared/services/generator.service.d.ts +0 -4
  489. package/src/shared/services/generator.service.js +0 -67
  490. package/src/shared/services/generator.service.ts +0 -13
  491. package/src/shared/services/index.d.ts +0 -5
  492. package/src/shared/services/index.js +0 -21
  493. package/src/shared/services/index.ts +0 -5
  494. package/src/shared/services/translation.service.d.ts +0 -9
  495. package/src/shared/services/translation.service.js +0 -109
  496. package/src/shared/services/translation.service.ts +0 -59
  497. package/src/shared/services/validator.service.d.ts +0 -3
  498. package/src/shared/services/validator.service.js +0 -64
  499. package/src/shared/services/validator.service.ts +0 -10
  500. package/src/snake-naming.strategy.d.ts +0 -11
  501. package/src/snake-naming.strategy.js +0 -37
  502. package/src/snake-naming.strategy.ts +0 -64
  503. package/src/types.d.ts +0 -9
  504. package/src/types.js +0 -2
  505. package/src/types.ts +0 -44
  506. package/src/validators/file-mimetype.validator.d.ts +0 -13
  507. package/src/validators/file-mimetype.validator.js +0 -21
  508. package/src/validators/file-mimetype.validator.ts +0 -34
  509. package/src/validators/index.d.ts +0 -3
  510. package/src/validators/index.js +0 -19
  511. package/src/validators/index.ts +0 -3
  512. package/src/validators/is-exists.validator.d.ts +0 -18
  513. package/src/validators/is-exists.validator.js +0 -99
  514. package/src/validators/is-exists.validator.ts +0 -60
  515. package/src/validators/is-unique.validator.d.ts +0 -17
  516. package/src/validators/is-unique.validator.js +0 -131
  517. package/src/validators/is-unique.validator.ts +0 -93
  518. package/src/validators/phone-country-code.validator.d.ts +0 -2
  519. package/src/validators/phone-country-code.validator.js +0 -30
  520. package/src/validators/phone-country-code.validator.ts +0 -36
  521. package/src/validators/same-as.validator.d.ts +0 -2
  522. package/src/validators/same-as.validator.js +0 -25
  523. package/src/validators/same-as.validator.ts +0 -27
  524. package/src/validators/skip-empty.validator.d.ts +0 -6
  525. package/src/validators/skip-empty.validator.js +0 -23
  526. package/src/validators/skip-empty.validator.ts +0 -25
  527. package/tsconfig.json +0 -21
  528. package/tsconfig.lib.json +0 -16
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
- var _, done = false;
8
- for (var i = decorators.length - 1; i >= 0; i--) {
9
- var context = {};
10
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
- if (kind === "accessor") {
15
- if (result === void 0) continue;
16
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
- if (_ = accept(result.get)) descriptor.get = _;
18
- if (_ = accept(result.set)) descriptor.set = _;
19
- if (_ = accept(result.init)) initializers.unshift(_);
20
- }
21
- else if (_ = accept(result)) {
22
- if (kind === "field") initializers.unshift(_);
23
- else descriptor[key] = _;
24
- }
25
- }
26
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
- done = true;
28
- };
29
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
- var useValue = arguments.length > 2;
31
- for (var i = 0; i < initializers.length; i++) {
32
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
- }
34
- return useValue ? value : void 0;
35
- };
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
46
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
47
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.AwsS3Service = void 0;
54
- const client_s3_1 = require("@aws-sdk/client-s3");
55
- const common_1 = require("@nestjs/common");
56
- const mime_types_1 = __importDefault(require("mime-types"));
57
- let AwsS3Service = (() => {
58
- let _classDecorators = [(0, common_1.Injectable)()];
59
- let _classDescriptor;
60
- let _classExtraInitializers = [];
61
- let _classThis;
62
- var AwsS3Service = _classThis = class {
63
- constructor(configService, generatorService) {
64
- this.configService = configService;
65
- this.generatorService = generatorService;
66
- const awsS3Config = configService.awsS3Config;
67
- this.s3 = new client_s3_1.S3({
68
- apiVersion: awsS3Config.bucketApiVersion,
69
- region: awsS3Config.bucketRegion,
70
- });
71
- }
72
- uploadImage(file) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- const fileName = this.generatorService.fileName(mime_types_1.default.extension(file.mimetype));
75
- const key = 'images/' + fileName;
76
- yield this.s3.putObject({
77
- Bucket: this.configService.awsS3Config.bucketName,
78
- Body: file.buffer,
79
- ACL: 'public-read',
80
- Key: key,
81
- });
82
- return key;
83
- });
84
- }
85
- };
86
- __setFunctionName(_classThis, "AwsS3Service");
87
- (() => {
88
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
89
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
90
- AwsS3Service = _classThis = _classDescriptor.value;
91
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
92
- __runInitializers(_classThis, _classExtraInitializers);
93
- })();
94
- return AwsS3Service = _classThis;
95
- })();
96
- exports.AwsS3Service = AwsS3Service;
@@ -1,39 +0,0 @@
1
- import { S3 } from '@aws-sdk/client-s3';
2
- import { Injectable } from '@nestjs/common';
3
- import mime from 'mime-types';
4
-
5
- import type { IFile } from '../../interfaces';
6
- import { ApiConfigService } from './api-config.service';
7
- import { GeneratorService } from './generator.service';
8
-
9
- @Injectable()
10
- export class AwsS3Service {
11
- private readonly s3: S3;
12
-
13
- constructor(
14
- public configService: ApiConfigService,
15
- public generatorService: GeneratorService,
16
- ) {
17
- const awsS3Config = configService.awsS3Config;
18
-
19
- this.s3 = new S3({
20
- apiVersion: awsS3Config.bucketApiVersion,
21
- region: awsS3Config.bucketRegion,
22
- });
23
- }
24
-
25
- async uploadImage(file: IFile): Promise<string> {
26
- const fileName = this.generatorService.fileName(
27
- <string>mime.extension(file.mimetype),
28
- );
29
- const key = 'images/' + fileName;
30
- await this.s3.putObject({
31
- Bucket: this.configService.awsS3Config.bucketName,
32
- Body: file.buffer,
33
- ACL: 'public-read',
34
- Key: key,
35
- });
36
-
37
- return key;
38
- }
39
- }
@@ -1,4 +0,0 @@
1
- export declare class GeneratorService {
2
- uuid(): string;
3
- fileName(ext: string): string;
4
- }
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
- var _, done = false;
8
- for (var i = decorators.length - 1; i >= 0; i--) {
9
- var context = {};
10
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
- if (kind === "accessor") {
15
- if (result === void 0) continue;
16
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
- if (_ = accept(result.get)) descriptor.get = _;
18
- if (_ = accept(result.set)) descriptor.set = _;
19
- if (_ = accept(result.init)) initializers.unshift(_);
20
- }
21
- else if (_ = accept(result)) {
22
- if (kind === "field") initializers.unshift(_);
23
- else descriptor[key] = _;
24
- }
25
- }
26
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
- done = true;
28
- };
29
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
- var useValue = arguments.length > 2;
31
- for (var i = 0; i < initializers.length; i++) {
32
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
- }
34
- return useValue ? value : void 0;
35
- };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.GeneratorService = void 0;
42
- const common_1 = require("@nestjs/common");
43
- const uuid_1 = require("uuid");
44
- let GeneratorService = (() => {
45
- let _classDecorators = [(0, common_1.Injectable)()];
46
- let _classDescriptor;
47
- let _classExtraInitializers = [];
48
- let _classThis;
49
- var GeneratorService = _classThis = class {
50
- uuid() {
51
- return (0, uuid_1.v1)();
52
- }
53
- fileName(ext) {
54
- return this.uuid() + '.' + ext;
55
- }
56
- };
57
- __setFunctionName(_classThis, "GeneratorService");
58
- (() => {
59
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
60
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
61
- GeneratorService = _classThis = _classDescriptor.value;
62
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
63
- __runInitializers(_classThis, _classExtraInitializers);
64
- })();
65
- return GeneratorService = _classThis;
66
- })();
67
- exports.GeneratorService = GeneratorService;
@@ -1,13 +0,0 @@
1
- import { Injectable } from '@nestjs/common';
2
- import { v1 as uuid } from 'uuid';
3
-
4
- @Injectable()
5
- export class GeneratorService {
6
- public uuid(): string {
7
- return uuid();
8
- }
9
-
10
- public fileName(ext: string): string {
11
- return this.uuid() + '.' + ext;
12
- }
13
- }
@@ -1,5 +0,0 @@
1
- export * from './api-config.service';
2
- export * from './aws-s3.service';
3
- export * from './generator.service';
4
- export * from './translation.service';
5
- export * from './validator.service';
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./api-config.service"), exports);
18
- __exportStar(require("./aws-s3.service"), exports);
19
- __exportStar(require("./generator.service"), exports);
20
- __exportStar(require("./translation.service"), exports);
21
- __exportStar(require("./validator.service"), exports);
@@ -1,5 +0,0 @@
1
- export * from './api-config.service';
2
- export * from './aws-s3.service';
3
- export * from './generator.service';
4
- export * from './translation.service';
5
- export * from './validator.service';
@@ -1,9 +0,0 @@
1
- import type { TranslateOptions } from 'nestjs-i18n';
2
- import { I18nService } from 'nestjs-i18n';
3
- import { AbstractDto } from '../../common/dto/abstract.dto';
4
- export declare class TranslationService {
5
- private readonly i18n;
6
- constructor(i18n: I18nService);
7
- translate(key: string, options?: TranslateOptions): Promise<string>;
8
- translateNecessaryKeys<T extends AbstractDto>(dto: T): Promise<T>;
9
- }
@@ -1,109 +0,0 @@
1
- "use strict";
2
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
- var _, done = false;
8
- for (var i = decorators.length - 1; i >= 0; i--) {
9
- var context = {};
10
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
- if (kind === "accessor") {
15
- if (result === void 0) continue;
16
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
- if (_ = accept(result.get)) descriptor.get = _;
18
- if (_ = accept(result.set)) descriptor.set = _;
19
- if (_ = accept(result.init)) initializers.unshift(_);
20
- }
21
- else if (_ = accept(result)) {
22
- if (kind === "field") initializers.unshift(_);
23
- else descriptor[key] = _;
24
- }
25
- }
26
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
- done = true;
28
- };
29
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
- var useValue = arguments.length > 2;
31
- for (var i = 0; i < initializers.length; i++) {
32
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
- }
34
- return useValue ? value : void 0;
35
- };
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
46
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
47
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.TranslationService = void 0;
51
- const common_1 = require("@nestjs/common");
52
- const lodash_1 = require("lodash");
53
- const abstract_dto_1 = require("../../common/dto/abstract.dto");
54
- const decorators_1 = require("../../decorators");
55
- const providers_1 = require("../../providers");
56
- let TranslationService = (() => {
57
- let _classDecorators = [(0, common_1.Injectable)()];
58
- let _classDescriptor;
59
- let _classExtraInitializers = [];
60
- let _classThis;
61
- var TranslationService = _classThis = class {
62
- constructor(i18n) {
63
- this.i18n = i18n;
64
- }
65
- translate(key, options) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- return this.i18n.translate(`${key}`, Object.assign(Object.assign({}, options), { lang: providers_1.ContextProvider.getLanguage() }));
68
- });
69
- }
70
- translateNecessaryKeys(dto) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- if ((0, lodash_1.isString)(dto)) {
73
- return dto;
74
- }
75
- yield Promise.all((0, lodash_1.map)(dto, (value, key) => __awaiter(this, void 0, void 0, function* () {
76
- var _a;
77
- if ((0, lodash_1.isString)(value)) {
78
- const translateDec = Reflect.getMetadata(decorators_1.STATIC_TRANSLATION_DECORATOR_KEY, dto, key);
79
- if (translateDec) {
80
- return this.translate(`${(_a = translateDec.translationKey) !== null && _a !== void 0 ? _a : key}.${value}`);
81
- }
82
- return;
83
- }
84
- if (value instanceof abstract_dto_1.AbstractDto) {
85
- return this.translateNecessaryKeys(value);
86
- }
87
- if ((0, lodash_1.isArray)(value)) {
88
- return Promise.all((0, lodash_1.map)(value, (v) => {
89
- if (v instanceof abstract_dto_1.AbstractDto) {
90
- return this.translateNecessaryKeys(v);
91
- }
92
- }));
93
- }
94
- })));
95
- return dto;
96
- });
97
- }
98
- };
99
- __setFunctionName(_classThis, "TranslationService");
100
- (() => {
101
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
102
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
103
- TranslationService = _classThis = _classDescriptor.value;
104
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
105
- __runInitializers(_classThis, _classExtraInitializers);
106
- })();
107
- return TranslationService = _classThis;
108
- })();
109
- exports.TranslationService = TranslationService;
@@ -1,59 +0,0 @@
1
- import { Injectable } from '@nestjs/common';
2
- import { isArray, isString, map } from 'lodash';
3
- import type { TranslateOptions } from 'nestjs-i18n';
4
- import { I18nService } from 'nestjs-i18n';
5
-
6
- import { AbstractDto } from '../../common/dto/abstract.dto';
7
- import { STATIC_TRANSLATION_DECORATOR_KEY } from '../../decorators';
8
- import type { ITranslationDecoratorInterface } from '../../interfaces';
9
- import { ContextProvider } from '../../providers';
10
-
11
- @Injectable()
12
- export class TranslationService {
13
- constructor(private readonly i18n: I18nService) {}
14
-
15
- async translate(key: string, options?: TranslateOptions): Promise<string> {
16
- return this.i18n.translate(`${key}`, {
17
- ...options,
18
- lang: ContextProvider.getLanguage(),
19
- });
20
- }
21
-
22
- async translateNecessaryKeys<T extends AbstractDto>(dto: T): Promise<T> {
23
- if (isString(dto)) {
24
- return dto;
25
- }
26
- await Promise.all(
27
- map(dto, async (value, key) => {
28
- if (isString(value)) {
29
- const translateDec: ITranslationDecoratorInterface | undefined =
30
- Reflect.getMetadata(STATIC_TRANSLATION_DECORATOR_KEY, dto, key);
31
-
32
- if (translateDec) {
33
- return this.translate(
34
- `${translateDec.translationKey ?? key}.${value}`,
35
- );
36
- }
37
-
38
- return;
39
- }
40
-
41
- if (value instanceof AbstractDto) {
42
- return this.translateNecessaryKeys(value);
43
- }
44
-
45
- if (isArray(value)) {
46
- return Promise.all(
47
- map(value, (v) => {
48
- if (v instanceof AbstractDto) {
49
- return this.translateNecessaryKeys(v);
50
- }
51
- }),
52
- );
53
- }
54
- }),
55
- );
56
-
57
- return dto;
58
- }
59
- }
@@ -1,3 +0,0 @@
1
- export declare class ValidatorService {
2
- isImage(mimeType: string): boolean;
3
- }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
- var _, done = false;
8
- for (var i = decorators.length - 1; i >= 0; i--) {
9
- var context = {};
10
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
- if (kind === "accessor") {
15
- if (result === void 0) continue;
16
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
- if (_ = accept(result.get)) descriptor.get = _;
18
- if (_ = accept(result.set)) descriptor.set = _;
19
- if (_ = accept(result.init)) initializers.unshift(_);
20
- }
21
- else if (_ = accept(result)) {
22
- if (kind === "field") initializers.unshift(_);
23
- else descriptor[key] = _;
24
- }
25
- }
26
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
- done = true;
28
- };
29
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
- var useValue = arguments.length > 2;
31
- for (var i = 0; i < initializers.length; i++) {
32
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
- }
34
- return useValue ? value : void 0;
35
- };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.ValidatorService = void 0;
42
- const common_1 = require("@nestjs/common");
43
- let ValidatorService = (() => {
44
- let _classDecorators = [(0, common_1.Injectable)()];
45
- let _classDescriptor;
46
- let _classExtraInitializers = [];
47
- let _classThis;
48
- var ValidatorService = _classThis = class {
49
- isImage(mimeType) {
50
- const imageMimeTypes = ['image/jpeg', 'image/png'];
51
- return imageMimeTypes.includes(mimeType);
52
- }
53
- };
54
- __setFunctionName(_classThis, "ValidatorService");
55
- (() => {
56
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
57
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
58
- ValidatorService = _classThis = _classDescriptor.value;
59
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
60
- __runInitializers(_classThis, _classExtraInitializers);
61
- })();
62
- return ValidatorService = _classThis;
63
- })();
64
- exports.ValidatorService = ValidatorService;
@@ -1,10 +0,0 @@
1
- import { Injectable } from '@nestjs/common';
2
-
3
- @Injectable()
4
- export class ValidatorService {
5
- public isImage(mimeType: string): boolean {
6
- const imageMimeTypes = ['image/jpeg', 'image/png'];
7
-
8
- return imageMimeTypes.includes(mimeType);
9
- }
10
- }
@@ -1,11 +0,0 @@
1
- import type { NamingStrategyInterface } from 'typeorm';
2
- import { DefaultNamingStrategy } from 'typeorm';
3
- export declare class SnakeNamingStrategy extends DefaultNamingStrategy implements NamingStrategyInterface {
4
- tableName(className: string, customName: string | undefined): string;
5
- columnName(propertyName: string, customName: string | undefined, embeddedPrefixes: string[]): string;
6
- relationName(propertyName: string): string;
7
- joinColumnName(relationName: string, referencedColumnName: string): string;
8
- joinTableName(firstTableName: string, secondTableName: string, firstPropertyName: string, _secondPropertyName: string): string;
9
- joinTableColumnName(tableName: string, propertyName: string, columnName?: string): string;
10
- classTableInheritanceParentColumnName(parentTableName: string, parentTableIdPropertyName: string): string;
11
- }
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SnakeNamingStrategy = void 0;
4
- const typeorm_1 = require("typeorm");
5
- const StringUtils_1 = require("typeorm/util/StringUtils");
6
- class SnakeNamingStrategy extends typeorm_1.DefaultNamingStrategy {
7
- tableName(className, customName) {
8
- if (className.includes('Entity')) {
9
- className = className.replace('Entity', '');
10
- }
11
- return customName !== null && customName !== void 0 ? customName : (0, StringUtils_1.snakeCase)(className);
12
- }
13
- columnName(propertyName, customName, embeddedPrefixes) {
14
- return ((0, StringUtils_1.snakeCase)(embeddedPrefixes.join('_')) +
15
- (customName !== null && customName !== void 0 ? customName : (0, StringUtils_1.snakeCase)(propertyName)));
16
- }
17
- relationName(propertyName) {
18
- return (0, StringUtils_1.snakeCase)(propertyName);
19
- }
20
- joinColumnName(relationName, referencedColumnName) {
21
- return (0, StringUtils_1.snakeCase)(relationName + '_' + referencedColumnName);
22
- }
23
- joinTableName(firstTableName, secondTableName, firstPropertyName, _secondPropertyName) {
24
- return (0, StringUtils_1.snakeCase)(firstTableName +
25
- '_' +
26
- firstPropertyName.replace(/\./gi, '_') +
27
- '_' +
28
- secondTableName);
29
- }
30
- joinTableColumnName(tableName, propertyName, columnName) {
31
- return (0, StringUtils_1.snakeCase)(tableName + '_' + (columnName !== null && columnName !== void 0 ? columnName : propertyName));
32
- }
33
- classTableInheritanceParentColumnName(parentTableName, parentTableIdPropertyName) {
34
- return (0, StringUtils_1.snakeCase)(`${parentTableName}_${parentTableIdPropertyName}`);
35
- }
36
- }
37
- exports.SnakeNamingStrategy = SnakeNamingStrategy;
@@ -1,64 +0,0 @@
1
- import type { NamingStrategyInterface } from 'typeorm';
2
- import { DefaultNamingStrategy } from 'typeorm';
3
- import { snakeCase } from 'typeorm/util/StringUtils';
4
-
5
- export class SnakeNamingStrategy
6
- extends DefaultNamingStrategy
7
- implements NamingStrategyInterface
8
- {
9
- tableName(className: string, customName: string | undefined): string {
10
- if (className.includes('Entity')) {
11
- className = className.replace('Entity', '');
12
- }
13
- return customName ?? snakeCase(className);
14
- }
15
-
16
- columnName(
17
- propertyName: string,
18
- customName: string | undefined,
19
- embeddedPrefixes: string[],
20
- ): string {
21
- return (
22
- snakeCase(embeddedPrefixes.join('_')) +
23
- (customName ?? snakeCase(propertyName))
24
- );
25
- }
26
-
27
- relationName(propertyName: string): string {
28
- return snakeCase(propertyName);
29
- }
30
-
31
- joinColumnName(relationName: string, referencedColumnName: string): string {
32
- return snakeCase(relationName + '_' + referencedColumnName);
33
- }
34
-
35
- joinTableName(
36
- firstTableName: string,
37
- secondTableName: string,
38
- firstPropertyName: string,
39
- _secondPropertyName: string,
40
- ): string {
41
- return snakeCase(
42
- firstTableName +
43
- '_' +
44
- firstPropertyName.replace(/\./gi, '_') +
45
- '_' +
46
- secondTableName,
47
- );
48
- }
49
-
50
- joinTableColumnName(
51
- tableName: string,
52
- propertyName: string,
53
- columnName?: string,
54
- ): string {
55
- return snakeCase(tableName + '_' + (columnName ?? propertyName));
56
- }
57
-
58
- classTableInheritanceParentColumnName(
59
- parentTableName: string,
60
- parentTableIdPropertyName: string,
61
- ): string {
62
- return snakeCase(`${parentTableName}_${parentTableIdPropertyName}`);
63
- }
64
- }
package/src/types.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export type Constructor<T, Arguments extends unknown[] = undefined[]> = new (...arguments_: Arguments) => T;
2
- export type Plain<T> = T;
3
- export type PathImpl<T, Key extends keyof T> = Key extends string ? T[Key] extends Record<string, any> ? `${Key}.${PathImpl<T[Key], Exclude<keyof T[Key], keyof any[]>> & string}` | `${Key}.${Exclude<keyof T[Key], keyof any[]> & string}` : never : never;
4
- export type PathImpl2<T> = PathImpl<T, keyof T> | keyof T;
5
- export type Path<T> = keyof T extends string ? PathImpl2<T> extends string | keyof T ? PathImpl2<T> : keyof T : never;
6
- export type PathValue<T, P extends Path<T>> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? Rest extends Path<T[Key]> ? PathValue<T[Key], Rest> : never : never : P extends keyof T ? T[P] : never;
7
- export type KeyOfType<Entity, U> = {
8
- [P in keyof Required<Entity>]: Required<Entity>[P] extends U ? P : Required<Entity>[P] extends U[] ? P : never;
9
- }[keyof Entity];
package/src/types.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });