@rockster/core 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (801) hide show
  1. package/cache/cache-cleaner.d.ts +7 -0
  2. package/cache/cache-cleaner.js +28 -0
  3. package/cache/cache.controller.d.ts +10 -0
  4. package/cache/cache.controller.js +53 -0
  5. package/cache/constants.d.ts +5 -0
  6. package/cache/constants.js +6 -0
  7. package/cache/decorators/index.d.ts +2 -0
  8. package/cache/decorators/index.js +18 -0
  9. package/cache/decorators/inject-cache.decorator.d.ts +1 -0
  10. package/cache/decorators/inject-cache.decorator.js +14 -0
  11. package/cache/decorators/key-value.d.ts +2 -0
  12. package/cache/decorators/key-value.js +40 -0
  13. package/cache/functions/get-cache.d.ts +1 -0
  14. package/cache/functions/get-cache.js +8 -0
  15. package/cache/functions/get-key.-handle.d.ts +2 -0
  16. package/cache/functions/get-key.-handle.js +23 -0
  17. package/cache/index.d.ts +3 -0
  18. package/cache/index.js +19 -0
  19. package/cache/interfaces/cache-instance.d.ts +4 -0
  20. package/cache/interfaces/cache-instance.js +2 -0
  21. package/cache/interfaces/cache-key-options.d.ts +6 -0
  22. package/cache/interfaces/cache-key-options.js +2 -0
  23. package/cache/interfaces/cache-options.d.ts +12 -0
  24. package/cache/interfaces/cache-options.js +2 -0
  25. package/cache/interfaces/get-key-value-handle.d.ts +1 -0
  26. package/cache/interfaces/get-key-value-handle.js +2 -0
  27. package/cache/interfaces/index.d.ts +4 -0
  28. package/cache/interfaces/index.js +20 -0
  29. package/command/constants.d.ts +4 -0
  30. package/command/constants.js +7 -0
  31. package/command/decorators/index.d.ts +6 -0
  32. package/command/decorators/index.js +22 -0
  33. package/command/decorators/only-modify.decorator.d.ts +1 -0
  34. package/command/decorators/only-modify.decorator.js +14 -0
  35. package/command/decorators/post-action.decorator.d.ts +2 -0
  36. package/command/decorators/post-action.decorator.js +26 -0
  37. package/command/decorators/post-content.decorator.d.ts +1 -0
  38. package/command/decorators/post-content.decorator.js +11 -0
  39. package/command/decorators/read-only.decorator.d.ts +1 -0
  40. package/command/decorators/read-only.decorator.js +14 -0
  41. package/command/decorators/remove-action.decorator.d.ts +2 -0
  42. package/command/decorators/remove-action.decorator.js +27 -0
  43. package/command/decorators/remove-content.decorator.d.ts +1 -0
  44. package/command/decorators/remove-content.decorator.js +11 -0
  45. package/command/functions/execute-post.d.ts +2 -0
  46. package/command/functions/execute-post.js +50 -0
  47. package/command/functions/execute-remove.d.ts +4 -0
  48. package/command/functions/execute-remove.js +50 -0
  49. package/command/interfaces/command-property.d.ts +7 -0
  50. package/command/interfaces/command-property.js +2 -0
  51. package/command/interfaces/index.d.ts +5 -0
  52. package/command/interfaces/index.js +21 -0
  53. package/command/interfaces/post-action-options.d.ts +23 -0
  54. package/command/interfaces/post-action-options.js +2 -0
  55. package/command/interfaces/post-content.d.ts +8 -0
  56. package/command/interfaces/post-content.js +2 -0
  57. package/command/interfaces/remove-aciton-options.d.ts +23 -0
  58. package/command/interfaces/remove-aciton-options.js +2 -0
  59. package/command/interfaces/remove-content.d.ts +5 -0
  60. package/command/interfaces/remove-content.js +2 -0
  61. package/command/services/post-action-builder.d.ts +19 -0
  62. package/command/services/post-action-builder.js +219 -0
  63. package/command/services/remove-action-builder.d.ts +14 -0
  64. package/command/services/remove-action-builder.js +165 -0
  65. package/command/utils/deep-merge-keep-undefined.d.ts +1 -0
  66. package/command/utils/deep-merge-keep-undefined.js +18 -0
  67. package/common/entities/base-entity.d.ts +7 -0
  68. package/common/entities/base-entity.js +47 -0
  69. package/common/index.d.ts +1 -0
  70. package/common/index.js +17 -0
  71. package/common/interfaces/enum/index.d.ts +3 -0
  72. package/common/interfaces/enum/index.js +19 -0
  73. package/common/interfaces/enum/object-type.d.ts +12 -0
  74. package/common/interfaces/enum/object-type.js +16 -0
  75. package/common/interfaces/enum/property-type.d.ts +7 -0
  76. package/common/interfaces/enum/property-type.js +11 -0
  77. package/common/interfaces/enum/request-status.d.ts +3 -0
  78. package/common/interfaces/enum/request-status.js +7 -0
  79. package/common/interfaces/get-type-callback.d.ts +2 -0
  80. package/common/interfaces/get-type-callback.js +2 -0
  81. package/common/interfaces/index.d.ts +2 -0
  82. package/common/interfaces/index.js +18 -0
  83. package/common/models/executed-response.d.ts +3 -0
  84. package/common/models/executed-response.js +22 -0
  85. package/controllers/constants.d.ts +11 -0
  86. package/controllers/constants.js +14 -0
  87. package/controllers/controller.controller.d.ts +19 -0
  88. package/controllers/controller.controller.js +50 -0
  89. package/controllers/decorators/actions/action-content.decorator.d.ts +2 -0
  90. package/controllers/decorators/actions/action-content.decorator.js +20 -0
  91. package/controllers/decorators/actions/action.decorator.d.ts +2 -0
  92. package/controllers/decorators/actions/action.decorator.js +28 -0
  93. package/controllers/decorators/actions/index.d.ts +2 -0
  94. package/controllers/decorators/actions/index.js +18 -0
  95. package/controllers/decorators/controller.decorator.d.ts +3 -0
  96. package/controllers/decorators/controller.decorator.js +32 -0
  97. package/controllers/decorators/http-methods/custom-response.decorator.d.ts +1 -0
  98. package/controllers/decorators/http-methods/custom-response.decorator.js +14 -0
  99. package/controllers/decorators/http-methods/delete.decorator.d.ts +1 -0
  100. package/controllers/decorators/http-methods/delete.decorator.js +16 -0
  101. package/controllers/decorators/http-methods/from-body.decorator.d.ts +3 -0
  102. package/controllers/decorators/http-methods/from-body.decorator.js +24 -0
  103. package/controllers/decorators/http-methods/from-headers.decorator.d.ts +1 -0
  104. package/controllers/decorators/http-methods/from-headers.decorator.js +21 -0
  105. package/controllers/decorators/http-methods/from-params.decorator.d.ts +1 -0
  106. package/controllers/decorators/http-methods/from-params.decorator.js +21 -0
  107. package/controllers/decorators/http-methods/from-query.decorator.d.ts +1 -0
  108. package/controllers/decorators/http-methods/from-query.decorator.js +21 -0
  109. package/controllers/decorators/http-methods/get.decorator.d.ts +1 -0
  110. package/controllers/decorators/http-methods/get.decorator.js +16 -0
  111. package/controllers/decorators/http-methods/http-req.decorator.d.ts +1 -0
  112. package/controllers/decorators/http-methods/http-req.decorator.js +10 -0
  113. package/controllers/decorators/http-methods/index.d.ts +12 -0
  114. package/controllers/decorators/http-methods/index.js +28 -0
  115. package/controllers/decorators/http-methods/patch.decorator.d.ts +1 -0
  116. package/controllers/decorators/http-methods/patch.decorator.js +16 -0
  117. package/controllers/decorators/http-methods/post.decorator.d.ts +1 -0
  118. package/controllers/decorators/http-methods/post.decorator.js +16 -0
  119. package/controllers/decorators/http-methods/put.decorator.d.ts +1 -0
  120. package/controllers/decorators/http-methods/put.decorator.js +16 -0
  121. package/controllers/decorators/http-methods/response-type.decorator.d.ts +6 -0
  122. package/controllers/decorators/http-methods/response-type.decorator.js +19 -0
  123. package/controllers/decorators/index.d.ts +5 -0
  124. package/controllers/decorators/index.js +21 -0
  125. package/controllers/decorators/no-auth.decorator.d.ts +1 -0
  126. package/controllers/decorators/no-auth.decorator.js +11 -0
  127. package/controllers/decorators/request-context.decorator.d.ts +1 -0
  128. package/controllers/decorators/request-context.decorator.js +11 -0
  129. package/controllers/decorators/session.decorator.d.ts +1 -0
  130. package/controllers/decorators/session.decorator.js +10 -0
  131. package/controllers/index.d.ts +2 -0
  132. package/controllers/index.js +18 -0
  133. package/controllers/interfaces/action-options.d.ts +31 -0
  134. package/controllers/interfaces/action-options.js +2 -0
  135. package/controllers/interfaces/content-options.d.ts +5 -0
  136. package/controllers/interfaces/content-options.js +2 -0
  137. package/controllers/interfaces/controller-object.d.ts +7 -0
  138. package/controllers/interfaces/controller-object.js +2 -0
  139. package/controllers/interfaces/controller-options.d.ts +4 -0
  140. package/controllers/interfaces/controller-options.js +2 -0
  141. package/controllers/interfaces/controller-property.d.ts +34 -0
  142. package/controllers/interfaces/controller-property.js +2 -0
  143. package/controllers/interfaces/enum/index.d.ts +1 -0
  144. package/controllers/interfaces/enum/index.js +17 -0
  145. package/controllers/interfaces/enum/request-interceptor.d.ts +3 -0
  146. package/controllers/interfaces/enum/request-interceptor.js +6 -0
  147. package/controllers/interfaces/get-only-data.d.ts +3 -0
  148. package/controllers/interfaces/get-only-data.js +2 -0
  149. package/controllers/interfaces/index.d.ts +9 -0
  150. package/controllers/interfaces/index.js +25 -0
  151. package/controllers/interfaces/on-before-validation-data.d.ts +4 -0
  152. package/controllers/interfaces/on-before-validation-data.js +2 -0
  153. package/controllers/interfaces/response-options.d.ts +5 -0
  154. package/controllers/interfaces/response-options.js +3 -0
  155. package/controllers/services/default-action-builder.d.ts +14 -0
  156. package/controllers/services/default-action-builder.js +166 -0
  157. package/controllers/services/restful-action-builder.d.ts +11 -0
  158. package/controllers/services/restful-action-builder.js +132 -0
  159. package/core/core.controller.d.ts +41 -0
  160. package/core/core.controller.js +208 -0
  161. package/core/functions/bootstrap.d.ts +3 -0
  162. package/core/functions/bootstrap.js +13 -0
  163. package/core/functions/create-action.d.ts +2 -0
  164. package/core/functions/create-action.js +18 -0
  165. package/core/functions/create-interceptor.d.ts +12 -0
  166. package/core/functions/create-interceptor.js +76 -0
  167. package/core/functions/format-message.d.ts +2 -0
  168. package/core/functions/format-message.js +7 -0
  169. package/core/functions/get-action-path.d.ts +1 -0
  170. package/core/functions/get-action-path.js +7 -0
  171. package/core/functions/get-env.d.ts +11 -0
  172. package/core/functions/get-env.js +19 -0
  173. package/core/functions/get-node-key.d.ts +1 -0
  174. package/core/functions/get-node-key.js +7 -0
  175. package/core/functions/get-other-types.d.ts +2 -0
  176. package/core/functions/get-other-types.js +19 -0
  177. package/core/index.d.ts +10 -0
  178. package/core/index.js +26 -0
  179. package/core/interfaces/action-def.d.ts +16 -0
  180. package/core/interfaces/action-def.js +2 -0
  181. package/core/interfaces/action-docs.d.ts +10 -0
  182. package/core/interfaces/action-docs.js +2 -0
  183. package/core/interfaces/core-options.d.ts +32 -0
  184. package/core/interfaces/core-options.js +2 -0
  185. package/core/interfaces/docs-options.d.ts +3 -0
  186. package/core/interfaces/docs-options.js +2 -0
  187. package/core/interfaces/enum/connect-type.d.ts +4 -0
  188. package/core/interfaces/enum/connect-type.js +8 -0
  189. package/core/interfaces/enum/index.d.ts +1 -0
  190. package/core/interfaces/enum/index.js +17 -0
  191. package/core/interfaces/format-message-options.d.ts +6 -0
  192. package/core/interfaces/format-message-options.js +2 -0
  193. package/core/interfaces/forms-options.d.ts +3 -0
  194. package/core/interfaces/forms-options.js +2 -0
  195. package/core/interfaces/index.d.ts +23 -0
  196. package/core/interfaces/index.js +39 -0
  197. package/core/interfaces/interceptor.d.ts +38 -0
  198. package/core/interfaces/interceptor.js +7 -0
  199. package/core/interfaces/locale-options.d.ts +5 -0
  200. package/core/interfaces/locale-options.js +2 -0
  201. package/core/interfaces/mapper.d.ts +3 -0
  202. package/core/interfaces/mapper.js +2 -0
  203. package/core/interfaces/object-docs.d.ts +5 -0
  204. package/core/interfaces/object-docs.js +3 -0
  205. package/core/interfaces/object.d.ts +15 -0
  206. package/core/interfaces/object.js +2 -0
  207. package/core/interfaces/pending-action.d.ts +10 -0
  208. package/core/interfaces/pending-action.js +2 -0
  209. package/core/interfaces/property-docs.d.ts +5 -0
  210. package/core/interfaces/property-docs.js +2 -0
  211. package/core/interfaces/property.d.ts +9 -0
  212. package/core/interfaces/property.js +2 -0
  213. package/core/interfaces/request-callback-handle.d.ts +3 -0
  214. package/core/interfaces/request-callback-handle.js +2 -0
  215. package/core/interfaces/request-callback.d.ts +4 -0
  216. package/core/interfaces/request-callback.js +2 -0
  217. package/core/interfaces/request-callbacks.d.ts +5 -0
  218. package/core/interfaces/request-callbacks.js +2 -0
  219. package/core/interfaces/request-context.d.ts +28 -0
  220. package/core/interfaces/request-context.js +2 -0
  221. package/core/interfaces/request-data.d.ts +6 -0
  222. package/core/interfaces/request-data.js +2 -0
  223. package/core/interfaces/router-options.d.ts +5 -0
  224. package/core/interfaces/router-options.js +2 -0
  225. package/core/interfaces/sanitizer.d.ts +4 -0
  226. package/core/interfaces/sanitizer.js +2 -0
  227. package/core/interfaces/storage-options.d.ts +6 -0
  228. package/core/interfaces/storage-options.js +2 -0
  229. package/core/interfaces/translations-options.d.ts +7 -0
  230. package/core/interfaces/translations-options.js +2 -0
  231. package/core/interfaces/transport-options.d.ts +3 -0
  232. package/core/interfaces/transport-options.js +2 -0
  233. package/core/services/context-builder.d.ts +15 -0
  234. package/core/services/context-builder.js +91 -0
  235. package/core/services/locale-service.d.ts +13 -0
  236. package/core/services/locale-service.js +71 -0
  237. package/core/services/node-control.service.d.ts +5 -0
  238. package/core/services/node-control.service.js +46 -0
  239. package/core/services/object-loader.d.ts +10 -0
  240. package/core/services/object-loader.js +27 -0
  241. package/core/services/request-executor.d.ts +9 -0
  242. package/core/services/request-executor.js +108 -0
  243. package/core/services/request-router.d.ts +15 -0
  244. package/core/services/request-router.js +127 -0
  245. package/database/contexts/index.d.ts +1 -0
  246. package/database/contexts/index.js +17 -0
  247. package/database/contexts/transaction-context.d.ts +6 -0
  248. package/database/contexts/transaction-context.js +5 -0
  249. package/database/database.controller.d.ts +20 -0
  250. package/database/database.controller.js +92 -0
  251. package/database/decorators/column.decorator.d.ts +72 -0
  252. package/database/decorators/column.decorator.js +9 -0
  253. package/database/decorators/entity.decorator.d.ts +2 -0
  254. package/database/decorators/entity.decorator.js +10 -0
  255. package/database/decorators/id-generated.decorator.d.ts +30 -0
  256. package/database/decorators/id-generated.decorator.js +76 -0
  257. package/database/decorators/id.decorator.d.ts +13 -0
  258. package/database/decorators/id.decorator.js +27 -0
  259. package/database/decorators/index.d.ts +13 -0
  260. package/database/decorators/index.js +29 -0
  261. package/database/decorators/inject-data-source.decorator.d.ts +1 -0
  262. package/database/decorators/inject-data-source.decorator.js +13 -0
  263. package/database/decorators/inject-repository.decorator.d.ts +2 -0
  264. package/database/decorators/inject-repository.decorator.js +17 -0
  265. package/database/decorators/protect-context-column.decorator.d.ts +3 -0
  266. package/database/decorators/protect-context-column.decorator.js +11 -0
  267. package/database/decorators/protect-entity.decorator.d.ts +4 -0
  268. package/database/decorators/protect-entity.decorator.js +12 -0
  269. package/database/decorators/protect-key-column.decorator.d.ts +2 -0
  270. package/database/decorators/protect-key-column.decorator.js +11 -0
  271. package/database/decorators/protect-target-column.decorator.d.ts +3 -0
  272. package/database/decorators/protect-target-column.decorator.js +11 -0
  273. package/database/decorators/protected-entity.decorator.d.ts +8 -0
  274. package/database/decorators/protected-entity.decorator.js +25 -0
  275. package/database/decorators/relation.decorator.d.ts +3 -0
  276. package/database/decorators/relation.decorator.js +13 -0
  277. package/database/decorators/virtual-column.decorator.d.ts +4 -0
  278. package/database/decorators/virtual-column.decorator.js +16 -0
  279. package/database/environment.d.ts +21 -0
  280. package/database/environment.js +25 -0
  281. package/database/exports/index.d.ts +1 -0
  282. package/database/exports/index.js +17 -0
  283. package/database/exports/typeorm.d.ts +1 -0
  284. package/database/exports/typeorm.js +9 -0
  285. package/database/extensions/select-query-builder.d.ts +11 -0
  286. package/database/extensions/select-query-builder.js +21 -0
  287. package/database/functions/column-decorator.d.ts +6 -0
  288. package/database/functions/column-decorator.js +31 -0
  289. package/database/functions/create-entity.d.ts +7 -0
  290. package/database/functions/create-entity.js +51 -0
  291. package/database/functions/create-new-class.d.ts +1 -0
  292. package/database/functions/create-new-class.js +16 -0
  293. package/database/functions/entity-decorator.d.ts +3 -0
  294. package/database/functions/entity-decorator.js +29 -0
  295. package/database/functions/execute-if-not-exists-column.d.ts +3 -0
  296. package/database/functions/execute-if-not-exists-column.js +16 -0
  297. package/database/functions/execute-if-not-exists-table.d.ts +3 -0
  298. package/database/functions/execute-if-not-exists-table.js +14 -0
  299. package/database/functions/find-relation.d.ts +3 -0
  300. package/database/functions/find-relation.js +43 -0
  301. package/database/functions/generate-id.d.ts +2 -0
  302. package/database/functions/generate-id.js +14 -0
  303. package/database/functions/get-column-type.d.ts +3 -0
  304. package/database/functions/get-column-type.js +18 -0
  305. package/database/functions/get-id-property.d.ts +3 -0
  306. package/database/functions/get-id-property.js +14 -0
  307. package/database/functions/get-name-by-strategy.d.ts +6 -0
  308. package/database/functions/get-name-by-strategy.js +9 -0
  309. package/database/functions/get-primitive-type.d.ts +3 -0
  310. package/database/functions/get-primitive-type.js +8 -0
  311. package/database/functions/get-relations.d.ts +2 -0
  312. package/database/functions/get-relations.js +12 -0
  313. package/database/functions/has-update.d.ts +2 -0
  314. package/database/functions/has-update.js +7 -0
  315. package/database/functions/inject-repository-handle.d.ts +2 -0
  316. package/database/functions/inject-repository-handle.js +36 -0
  317. package/database/functions/object-to-jsonb.d.ts +1 -0
  318. package/database/functions/object-to-jsonb.js +36 -0
  319. package/database/functions/register-column.d.ts +7 -0
  320. package/database/functions/register-column.js +16 -0
  321. package/database/functions/register-entity.d.ts +5 -0
  322. package/database/functions/register-entity.js +8 -0
  323. package/database/functions/register-generated-id.d.ts +6 -0
  324. package/database/functions/register-generated-id.js +8 -0
  325. package/database/functions/register-id.d.ts +7 -0
  326. package/database/functions/register-id.js +8 -0
  327. package/database/functions/register-relation.d.ts +8 -0
  328. package/database/functions/register-relation.js +12 -0
  329. package/database/functions/relation-decorator.d.ts +4 -0
  330. package/database/functions/relation-decorator.js +74 -0
  331. package/database/functions/use-protector.d.ts +2 -0
  332. package/database/functions/use-protector.js +10 -0
  333. package/database/functions/use-repository.d.ts +2 -0
  334. package/database/functions/use-repository.js +10 -0
  335. package/database/functions/use-transaction.d.ts +1 -0
  336. package/database/functions/use-transaction.js +12 -0
  337. package/database/index.d.ts +16 -0
  338. package/database/index.js +32 -0
  339. package/database/interfaces/base-columns-name-override.d.ts +6 -0
  340. package/database/interfaces/base-columns-name-override.js +2 -0
  341. package/database/interfaces/column-def.d.ts +26 -0
  342. package/database/interfaces/column-def.js +2 -0
  343. package/database/interfaces/connection.options.d.ts +15 -0
  344. package/database/interfaces/connection.options.js +2 -0
  345. package/database/interfaces/direact-alias.d.ts +1 -0
  346. package/database/interfaces/direact-alias.js +2 -0
  347. package/database/interfaces/entity-object.d.ts +15 -0
  348. package/database/interfaces/entity-object.js +2 -0
  349. package/database/interfaces/entity-options.d.ts +15 -0
  350. package/database/interfaces/entity-options.js +2 -0
  351. package/database/interfaces/entity-property.d.ts +19 -0
  352. package/database/interfaces/entity-property.js +2 -0
  353. package/database/interfaces/enum/column-def-type.d.ts +5 -0
  354. package/database/interfaces/enum/column-def-type.js +9 -0
  355. package/database/interfaces/enum/index.d.ts +5 -0
  356. package/database/interfaces/enum/index.js +21 -0
  357. package/database/interfaces/enum/naming-strategy-type.d.ts +5 -0
  358. package/database/interfaces/enum/naming-strategy-type.js +9 -0
  359. package/database/interfaces/enum/nano-id-alphabet-type.d.ts +14 -0
  360. package/database/interfaces/enum/nano-id-alphabet-type.js +18 -0
  361. package/database/interfaces/enum/order-by-direction.d.ts +4 -0
  362. package/database/interfaces/enum/order-by-direction.js +8 -0
  363. package/database/interfaces/enum/primary-strategy-type.d.ts +5 -0
  364. package/database/interfaces/enum/primary-strategy-type.js +9 -0
  365. package/database/interfaces/enum/relation-path-type.d.ts +4 -0
  366. package/database/interfaces/enum/relation-path-type.js +8 -0
  367. package/database/interfaces/execute-callback.d.ts +3 -0
  368. package/database/interfaces/execute-callback.js +2 -0
  369. package/database/interfaces/id-column-def.d.ts +6 -0
  370. package/database/interfaces/id-column-def.js +2 -0
  371. package/database/interfaces/index.d.ts +17 -0
  372. package/database/interfaces/index.js +33 -0
  373. package/database/interfaces/inverse-alias.d.ts +5 -0
  374. package/database/interfaces/inverse-alias.js +2 -0
  375. package/database/interfaces/nano-id-column-options.d.ts +12 -0
  376. package/database/interfaces/nano-id-column-options.js +2 -0
  377. package/database/interfaces/path.d.ts +43 -0
  378. package/database/interfaces/path.js +2 -0
  379. package/database/interfaces/protector.d.ts +51 -0
  380. package/database/interfaces/protector.js +2 -0
  381. package/database/interfaces/register-one-to-many-handle.d.ts +3 -0
  382. package/database/interfaces/register-one-to-many-handle.js +2 -0
  383. package/database/interfaces/register-one-to-many.d.ts +6 -0
  384. package/database/interfaces/register-one-to-many.js +2 -0
  385. package/database/interfaces/relation-def.d.ts +8 -0
  386. package/database/interfaces/relation-def.js +2 -0
  387. package/database/interfaces/relation-path.d.ts +10 -0
  388. package/database/interfaces/relation-path.js +2 -0
  389. package/database/interfaces/relation.options.d.ts +9 -0
  390. package/database/interfaces/relation.options.js +2 -0
  391. package/database/interfaces/repository.d.ts +8 -0
  392. package/database/interfaces/repository.js +2 -0
  393. package/database/migrations/1737637321043-UUIDVarcharMigration.d.ts +5 -0
  394. package/database/migrations/1737637321043-UUIDVarcharMigration.js +81 -0
  395. package/database/migrations/use-uuid-varchar-migration.d.ts +2 -0
  396. package/database/migrations/use-uuid-varchar-migration.js +10 -0
  397. package/database/services/paths-builder.d.ts +12 -0
  398. package/database/services/paths-builder.js +82 -0
  399. package/database/services/protect-builder.d.ts +59 -0
  400. package/database/services/protect-builder.js +523 -0
  401. package/database/services/repository.service.d.ts +14 -0
  402. package/database/services/repository.service.js +75 -0
  403. package/forms/entities/form.d.ts +8 -0
  404. package/forms/entities/form.js +61 -0
  405. package/forms/entities/property.d.ts +7 -0
  406. package/forms/entities/property.js +51 -0
  407. package/forms/forms.controller.d.ts +8 -0
  408. package/forms/forms.controller.js +59 -0
  409. package/forms/interfaces/form-item.d.ts +5 -0
  410. package/forms/interfaces/form-item.js +2 -0
  411. package/forms/interfaces/form.d.ts +8 -0
  412. package/forms/interfaces/form.js +2 -0
  413. package/forms/interfaces/property.d.ts +6 -0
  414. package/forms/interfaces/property.js +2 -0
  415. package/forms/migrations/1725969116484-CreateFormsTables.d.ts +5 -0
  416. package/forms/migrations/1725969116484-CreateFormsTables.js +38 -0
  417. package/forms/models/form-load.request.d.ts +3 -0
  418. package/forms/models/form-load.request.js +21 -0
  419. package/forms/queries/form.query.d.ts +1 -0
  420. package/forms/queries/form.query.js +9 -0
  421. package/forms/queries/property.query.d.ts +1 -0
  422. package/forms/queries/property.query.js +9 -0
  423. package/forms/requests/form.request.d.ts +14 -0
  424. package/forms/requests/form.request.js +83 -0
  425. package/forms/requests/property.request.d.ts +8 -0
  426. package/forms/requests/property.request.js +65 -0
  427. package/forms/services/form.service.d.ts +20 -0
  428. package/forms/services/form.service.js +64 -0
  429. package/forms/services/property.service.d.ts +6 -0
  430. package/forms/services/property.service.js +30 -0
  431. package/forms/utils/build-form-validator.d.ts +11 -0
  432. package/forms/utils/build-form-validator.js +30 -0
  433. package/forms/utils/get-form-items.d.ts +2 -0
  434. package/forms/utils/get-form-items.js +20 -0
  435. package/global.d.ts +52 -0
  436. package/global.js +50 -0
  437. package/http/http.controller.d.ts +25 -0
  438. package/http/http.controller.js +137 -0
  439. package/http/index.d.ts +2 -0
  440. package/http/index.js +18 -0
  441. package/http/interfaces/csrf.options.d.ts +11 -0
  442. package/http/interfaces/csrf.options.js +2 -0
  443. package/http/interfaces/http-request.d.ts +6 -0
  444. package/http/interfaces/http-request.js +2 -0
  445. package/http/interfaces/http-response.d.ts +4 -0
  446. package/http/interfaces/http-response.js +3 -0
  447. package/http/interfaces/http-settings.d.ts +13 -0
  448. package/http/interfaces/http-settings.js +2 -0
  449. package/http/interfaces/http-use.d.ts +6 -0
  450. package/http/interfaces/http-use.js +2 -0
  451. package/http/interfaces/index.d.ts +6 -0
  452. package/http/interfaces/index.js +22 -0
  453. package/http/interfaces/route.d.ts +10 -0
  454. package/http/interfaces/route.js +2 -0
  455. package/index.d.ts +44 -0
  456. package/index.js +65 -0
  457. package/jobs/constants.d.ts +2 -0
  458. package/jobs/constants.js +4 -0
  459. package/jobs/decorators/index.d.ts +1 -0
  460. package/jobs/decorators/index.js +17 -0
  461. package/jobs/decorators/job.decorator.d.ts +11 -0
  462. package/jobs/decorators/job.decorator.js +26 -0
  463. package/jobs/interfaces/index.d.ts +3 -0
  464. package/jobs/interfaces/index.js +19 -0
  465. package/jobs/interfaces/job-data.d.ts +13 -0
  466. package/jobs/interfaces/job-data.js +2 -0
  467. package/jobs/interfaces/job-executor.d.ts +3 -0
  468. package/jobs/interfaces/job-executor.js +2 -0
  469. package/jobs/interfaces/job-object.d.ts +6 -0
  470. package/jobs/interfaces/job-object.js +2 -0
  471. package/jobs/interfaces/job.options.d.ts +1 -0
  472. package/jobs/interfaces/job.options.js +2 -0
  473. package/jobs/jobs.controller.d.ts +18 -0
  474. package/jobs/jobs.controller.js +122 -0
  475. package/module/decorators/index.d.ts +4 -0
  476. package/module/decorators/index.js +20 -0
  477. package/module/decorators/module.decorator.d.ts +2 -0
  478. package/module/decorators/module.decorator.js +16 -0
  479. package/module/decorators/on-after-app-start.d.ts +1 -0
  480. package/module/decorators/on-after-app-start.js +11 -0
  481. package/module/decorators/on-after-database-init.d.ts +1 -0
  482. package/module/decorators/on-after-database-init.js +11 -0
  483. package/module/decorators/on-module-init.d.ts +1 -0
  484. package/module/decorators/on-module-init.js +11 -0
  485. package/module/index.d.ts +3 -0
  486. package/module/index.js +19 -0
  487. package/module/interfaces/index.d.ts +3 -0
  488. package/module/interfaces/index.js +19 -0
  489. package/module/interfaces/module-events.d.ts +5 -0
  490. package/module/interfaces/module-events.js +2 -0
  491. package/module/interfaces/module-object.d.ts +7 -0
  492. package/module/interfaces/module-object.js +2 -0
  493. package/module/interfaces/module-options.d.ts +8 -0
  494. package/module/interfaces/module-options.js +2 -0
  495. package/module/module.controller.d.ts +31 -0
  496. package/module/module.controller.js +159 -0
  497. package/package.json +70 -0
  498. package/query/constants.d.ts +2 -0
  499. package/query/constants.js +5 -0
  500. package/query/decorators/index.d.ts +1 -0
  501. package/query/decorators/index.js +17 -0
  502. package/query/decorators/query-content.decorator.d.ts +1 -0
  503. package/query/decorators/query-content.decorator.js +11 -0
  504. package/query/functions/add-join.d.ts +5 -0
  505. package/query/functions/add-join.js +37 -0
  506. package/query/functions/create-query-builder.d.ts +4 -0
  507. package/query/functions/create-query-builder.js +54 -0
  508. package/query/functions/create-query.d.ts +5 -0
  509. package/query/functions/create-query.js +96 -0
  510. package/query/functions/describe-query-filter.d.ts +7 -0
  511. package/query/functions/describe-query-filter.js +298 -0
  512. package/query/functions/execute-query.d.ts +11 -0
  513. package/query/functions/execute-query.js +74 -0
  514. package/query/functions/get-column-path.d.ts +2 -0
  515. package/query/functions/get-column-path.js +14 -0
  516. package/query/functions/get-native-select.d.ts +2 -0
  517. package/query/functions/get-native-select.js +9 -0
  518. package/query/functions/load-properties.d.ts +19 -0
  519. package/query/functions/load-properties.js +138 -0
  520. package/query/functions/map-query-property-to-column-name.d.ts +3 -0
  521. package/query/functions/map-query-property-to-column-name.js +17 -0
  522. package/query/functions/replace-property-key-to-column-name.d.ts +1 -0
  523. package/query/functions/replace-property-key-to-column-name.js +10 -0
  524. package/query/interfaces/index.d.ts +3 -0
  525. package/query/interfaces/index.js +19 -0
  526. package/query/interfaces/query-action-options.d.ts +14 -0
  527. package/query/interfaces/query-action-options.js +2 -0
  528. package/query/interfaces/query-object.d.ts +10 -0
  529. package/query/interfaces/query-object.js +2 -0
  530. package/query/interfaces/query.d.ts +54 -0
  531. package/query/interfaces/query.js +2 -0
  532. package/query/models/base-query-response.d.ts +12 -0
  533. package/query/models/base-query-response.js +41 -0
  534. package/query/services/query-action-builder.d.ts +14 -0
  535. package/query/services/query-action-builder.js +145 -0
  536. package/security/auth.controller.d.ts +8 -0
  537. package/security/auth.controller.js +68 -0
  538. package/security/constants.d.ts +0 -0
  539. package/security/constants.js +2 -0
  540. package/security/env.d.ts +7 -0
  541. package/security/env.js +8 -0
  542. package/security/functions/add-protect.d.ts +2 -0
  543. package/security/functions/add-protect.js +10 -0
  544. package/security/functions/add-protected.d.ts +3 -0
  545. package/security/functions/add-protected.js +23 -0
  546. package/security/functions/create-authorization.d.ts +2 -0
  547. package/security/functions/create-authorization.js +12 -0
  548. package/security/functions/find-auth-context.d.ts +3 -0
  549. package/security/functions/find-auth-context.js +25 -0
  550. package/security/functions/is-auth-enabled.d.ts +1 -0
  551. package/security/functions/is-auth-enabled.js +7 -0
  552. package/security/functions/use-auth.d.ts +1 -0
  553. package/security/functions/use-auth.js +8 -0
  554. package/security/index.d.ts +3 -0
  555. package/security/index.js +19 -0
  556. package/security/interceptors/index.d.ts +1 -0
  557. package/security/interceptors/index.js +17 -0
  558. package/security/interceptors/is-authorized.interceptor.d.ts +2 -0
  559. package/security/interceptors/is-authorized.interceptor.js +34 -0
  560. package/security/interfaces/auth-controller.d.ts +7 -0
  561. package/security/interfaces/auth-controller.js +2 -0
  562. package/security/interfaces/auth-object.d.ts +6 -0
  563. package/security/interfaces/auth-object.js +2 -0
  564. package/security/interfaces/auth-property.d.ts +4 -0
  565. package/security/interfaces/auth-property.js +2 -0
  566. package/security/interfaces/authorization-schema.d.ts +26 -0
  567. package/security/interfaces/authorization-schema.js +2 -0
  568. package/security/interfaces/index.d.ts +6 -0
  569. package/security/interfaces/index.js +22 -0
  570. package/security/interfaces/security-options.d.ts +8 -0
  571. package/security/interfaces/security-options.js +2 -0
  572. package/security/interfaces/ssl-certificate.d.ts +4 -0
  573. package/security/interfaces/ssl-certificate.js +2 -0
  574. package/security/models/auth-context-data.d.ts +4 -0
  575. package/security/models/auth-context-data.js +25 -0
  576. package/security/models/auth-context.d.ts +9 -0
  577. package/security/models/auth-context.js +48 -0
  578. package/security/models/auth-key.d.ts +7 -0
  579. package/security/models/auth-key.js +36 -0
  580. package/security/models/get-user-permissions-payload.d.ts +4 -0
  581. package/security/models/get-user-permissions-payload.js +21 -0
  582. package/security/models/get-user-permissions-response.d.ts +3 -0
  583. package/security/models/get-user-permissions-response.js +22 -0
  584. package/security/models/set-user-permissions-payload.d.ts +5 -0
  585. package/security/models/set-user-permissions-payload.js +26 -0
  586. package/security/requests/security.request.d.ts +14 -0
  587. package/security/requests/security.request.js +75 -0
  588. package/security/services/authorization.service.d.ts +11 -0
  589. package/security/services/authorization.service.js +60 -0
  590. package/storage/entities/metadata.entity.d.ts +19 -0
  591. package/storage/entities/metadata.entity.js +86 -0
  592. package/storage/entities/storage.entity.d.ts +6 -0
  593. package/storage/entities/storage.entity.js +32 -0
  594. package/storage/env.d.ts +9 -0
  595. package/storage/env.js +9 -0
  596. package/storage/functions/index.d.ts +1 -0
  597. package/storage/functions/index.js +17 -0
  598. package/storage/functions/set-storage-settings.d.ts +2 -0
  599. package/storage/functions/set-storage-settings.js +13 -0
  600. package/storage/index.d.ts +2 -0
  601. package/storage/index.js +18 -0
  602. package/storage/interfaces/directory-metadata.d.ts +6 -0
  603. package/storage/interfaces/directory-metadata.js +2 -0
  604. package/storage/interfaces/enum/gcp-credentials-type.d.ts +3 -0
  605. package/storage/interfaces/enum/gcp-credentials-type.js +7 -0
  606. package/storage/interfaces/enum/index.d.ts +3 -0
  607. package/storage/interfaces/enum/index.js +19 -0
  608. package/storage/interfaces/enum/metadata-type.d.ts +4 -0
  609. package/storage/interfaces/enum/metadata-type.js +8 -0
  610. package/storage/interfaces/enum/storage-type.d.ts +3 -0
  611. package/storage/interfaces/enum/storage-type.js +7 -0
  612. package/storage/interfaces/file-metadata.d.ts +12 -0
  613. package/storage/interfaces/file-metadata.js +2 -0
  614. package/storage/interfaces/index.d.ts +7 -0
  615. package/storage/interfaces/index.js +23 -0
  616. package/storage/interfaces/metadata.d.ts +18 -0
  617. package/storage/interfaces/metadata.js +2 -0
  618. package/storage/interfaces/storage-controller.d.ts +13 -0
  619. package/storage/interfaces/storage-controller.js +2 -0
  620. package/storage/interfaces/storage-settings.d.ts +16 -0
  621. package/storage/interfaces/storage-settings.js +2 -0
  622. package/storage/interfaces/storage.d.ts +7 -0
  623. package/storage/interfaces/storage.js +2 -0
  624. package/storage/services/routes.service.d.ts +31 -0
  625. package/storage/services/routes.service.js +384 -0
  626. package/storage/services/storage.service.d.ts +10 -0
  627. package/storage/services/storage.service.js +92 -0
  628. package/storage/storage.controller.d.ts +10 -0
  629. package/storage/storage.controller.js +49 -0
  630. package/tasks/constants.d.ts +12 -0
  631. package/tasks/constants.js +21 -0
  632. package/tasks/decorators/index.d.ts +1 -0
  633. package/tasks/decorators/index.js +17 -0
  634. package/tasks/decorators/task.decorator.d.ts +2 -0
  635. package/tasks/decorators/task.decorator.js +45 -0
  636. package/tasks/functions/create-task-message-find.d.ts +3 -0
  637. package/tasks/functions/create-task-message-find.js +23 -0
  638. package/tasks/functions/create-task-message-model.d.ts +3 -0
  639. package/tasks/functions/create-task-message-model.js +11 -0
  640. package/tasks/functions/create-task-message-receptor.d.ts +3 -0
  641. package/tasks/functions/create-task-message-receptor.js +23 -0
  642. package/tasks/functions/create-task-message-retry.d.ts +3 -0
  643. package/tasks/functions/create-task-message-retry.js +22 -0
  644. package/tasks/functions/create-task-message-schema.d.ts +182 -0
  645. package/tasks/functions/create-task-message-schema.js +20 -0
  646. package/tasks/functions/create-task-message-trigger.d.ts +2 -0
  647. package/tasks/functions/create-task-message-trigger.js +18 -0
  648. package/tasks/functions/create-task-naming.d.ts +2 -0
  649. package/tasks/functions/create-task-naming.js +31 -0
  650. package/tasks/functions/generate-entity-id.d.ts +1 -0
  651. package/tasks/functions/generate-entity-id.js +5 -0
  652. package/tasks/functions/get-check-table-exists-script.d.ts +1 -0
  653. package/tasks/functions/get-check-table-exists-script.js +12 -0
  654. package/tasks/functions/get-create-table-partition-script.d.ts +2 -0
  655. package/tasks/functions/get-create-table-partition-script.js +10 -0
  656. package/tasks/functions/get-create-table-script.d.ts +1 -0
  657. package/tasks/functions/get-create-table-script.js +22 -0
  658. package/tasks/functions/get-database-connection-name.d.ts +1 -0
  659. package/tasks/functions/get-database-connection-name.js +8 -0
  660. package/tasks/functions/get-database-uri.d.ts +1 -0
  661. package/tasks/functions/get-database-uri.js +8 -0
  662. package/tasks/functions/get-partitions-of-table-script.d.ts +1 -0
  663. package/tasks/functions/get-partitions-of-table-script.js +10 -0
  664. package/tasks/functions/get-pending-task-script.d.ts +2 -0
  665. package/tasks/functions/get-pending-task-script.js +19 -0
  666. package/tasks/functions/parse-task-message-search.d.ts +20 -0
  667. package/tasks/functions/parse-task-message-search.js +62 -0
  668. package/tasks/functions/throw-task-error.d.ts +1 -0
  669. package/tasks/functions/throw-task-error.js +7 -0
  670. package/tasks/index.d.ts +3 -0
  671. package/tasks/index.js +19 -0
  672. package/tasks/interfaces/index.d.ts +6 -0
  673. package/tasks/interfaces/index.js +22 -0
  674. package/tasks/interfaces/task-naming.d.ts +11 -0
  675. package/tasks/interfaces/task-naming.js +2 -0
  676. package/tasks/interfaces/task-object.d.ts +17 -0
  677. package/tasks/interfaces/task-object.js +2 -0
  678. package/tasks/interfaces/task-post-intercept.d.ts +8 -0
  679. package/tasks/interfaces/task-post-intercept.js +2 -0
  680. package/tasks/interfaces/task-runner.d.ts +6 -0
  681. package/tasks/interfaces/task-runner.js +2 -0
  682. package/tasks/interfaces/task-search-intercept.d.ts +4 -0
  683. package/tasks/interfaces/task-search-intercept.js +2 -0
  684. package/tasks/interfaces/task-settings.d.ts +15 -0
  685. package/tasks/interfaces/task-settings.js +2 -0
  686. package/tasks/models/task-error.d.ts +8 -0
  687. package/tasks/models/task-error.js +40 -0
  688. package/tasks/models/task-message-find.d.ts +3 -0
  689. package/tasks/models/task-message-find.js +21 -0
  690. package/tasks/models/task-message.d.ts +13 -0
  691. package/tasks/models/task-message.js +57 -0
  692. package/tasks/requests/task.request.d.ts +17 -0
  693. package/tasks/requests/task.request.js +71 -0
  694. package/tasks/services/task-manager.service.d.ts +10 -0
  695. package/tasks/services/task-manager.service.js +60 -0
  696. package/tasks/services/task-runner.service.d.ts +16 -0
  697. package/tasks/services/task-runner.service.js +88 -0
  698. package/tasks/tasks.controller.d.ts +19 -0
  699. package/tasks/tasks.controller.js +75 -0
  700. package/translations/entities/translation-config.entity.d.ts +9 -0
  701. package/translations/entities/translation-config.entity.js +65 -0
  702. package/translations/entities/translation-values.entity.d.ts +10 -0
  703. package/translations/entities/translation-values.entity.js +53 -0
  704. package/translations/env.d.ts +2 -0
  705. package/translations/env.js +7 -0
  706. package/translations/functions/check-can-use.d.ts +1 -0
  707. package/translations/functions/check-can-use.js +10 -0
  708. package/translations/functions/create-translation-config.d.ts +3 -0
  709. package/translations/functions/create-translation-config.js +19 -0
  710. package/translations/functions/create-translation-values.d.ts +3 -0
  711. package/translations/functions/create-translation-values.js +22 -0
  712. package/translations/functions/get-translation-config.d.ts +3 -0
  713. package/translations/functions/get-translation-config.js +14 -0
  714. package/translations/interfaces/translation-config.d.ts +8 -0
  715. package/translations/interfaces/translation-config.js +2 -0
  716. package/translations/interfaces/translation-values.d.ts +9 -0
  717. package/translations/interfaces/translation-values.js +2 -0
  718. package/translations/interfaces/translator-handle.d.ts +4 -0
  719. package/translations/interfaces/translator-handle.js +2 -0
  720. package/translations/migrations/1723760669185-CreateTranslationTables.d.ts +5 -0
  721. package/translations/migrations/1723760669185-CreateTranslationTables.js +43 -0
  722. package/translations/models/get-values.request.d.ts +5 -0
  723. package/translations/models/get-values.request.js +25 -0
  724. package/translations/models/get-values.response.d.ts +4 -0
  725. package/translations/models/get-values.response.js +20 -0
  726. package/translations/queries/translation-config.query.d.ts +1 -0
  727. package/translations/queries/translation-config.query.js +9 -0
  728. package/translations/queries/translation-values.query.d.ts +1 -0
  729. package/translations/queries/translation-values.query.js +16 -0
  730. package/translations/requests/translation.request.d.ts +16 -0
  731. package/translations/requests/translation.request.js +99 -0
  732. package/translations/services/translations.service.d.ts +11 -0
  733. package/translations/services/translations.service.js +56 -0
  734. package/translations/services/translator.service.d.ts +11 -0
  735. package/translations/services/translator.service.js +56 -0
  736. package/translations/translations.controller.d.ts +8 -0
  737. package/translations/translations.controller.js +57 -0
  738. package/transport/entities/transport-client.d.ts +12 -0
  739. package/transport/entities/transport-client.js +67 -0
  740. package/transport/entities/transport-gateway-status.d.ts +9 -0
  741. package/transport/entities/transport-gateway-status.js +51 -0
  742. package/transport/entities/transport-gateway.d.ts +6 -0
  743. package/transport/entities/transport-gateway.js +35 -0
  744. package/transport/environment.d.ts +4 -0
  745. package/transport/environment.js +6 -0
  746. package/transport/index.d.ts +2 -0
  747. package/transport/index.js +18 -0
  748. package/transport/interfaces/index.d.ts +1 -0
  749. package/transport/interfaces/index.js +17 -0
  750. package/transport/interfaces/transport-module-options.d.ts +14 -0
  751. package/transport/interfaces/transport-module-options.js +8 -0
  752. package/transport/transport.module.d.ts +5 -0
  753. package/transport/transport.module.js +38 -0
  754. package/web-socket/constants.d.ts +1 -0
  755. package/web-socket/constants.js +4 -0
  756. package/web-socket/functions/encode-message.d.ts +2 -0
  757. package/web-socket/functions/encode-message.js +14 -0
  758. package/web-socket/functions/get-fake-http-context.d.ts +26 -0
  759. package/web-socket/functions/get-fake-http-context.js +55 -0
  760. package/web-socket/functions/get-ip-address.d.ts +1 -0
  761. package/web-socket/functions/get-ip-address.js +23 -0
  762. package/web-socket/functions/parse-message.d.ts +1 -0
  763. package/web-socket/functions/parse-message.js +10 -0
  764. package/web-socket/index.d.ts +5 -0
  765. package/web-socket/index.js +21 -0
  766. package/web-socket/interfaces/client.d.ts +15 -0
  767. package/web-socket/interfaces/client.js +2 -0
  768. package/web-socket/interfaces/enum/client-type.d.ts +4 -0
  769. package/web-socket/interfaces/enum/client-type.js +8 -0
  770. package/web-socket/interfaces/enum/index.d.ts +3 -0
  771. package/web-socket/interfaces/enum/index.js +19 -0
  772. package/web-socket/interfaces/enum/message-type.d.ts +6 -0
  773. package/web-socket/interfaces/enum/message-type.js +10 -0
  774. package/web-socket/interfaces/enum/ws-connection-type.d.ts +4 -0
  775. package/web-socket/interfaces/enum/ws-connection-type.js +8 -0
  776. package/web-socket/interfaces/index.d.ts +4 -0
  777. package/web-socket/interfaces/index.js +20 -0
  778. package/web-socket/interfaces/message.d.ts +30 -0
  779. package/web-socket/interfaces/message.js +2 -0
  780. package/web-socket/interfaces/ws-connection.d.ts +4 -0
  781. package/web-socket/interfaces/ws-connection.js +2 -0
  782. package/web-socket/web-socket.controller.d.ts +25 -0
  783. package/web-socket/web-socket.controller.js +184 -0
  784. package/workers/functions/decode-message.d.ts +2 -0
  785. package/workers/functions/decode-message.js +7 -0
  786. package/workers/functions/dispatch-task.d.ts +2 -0
  787. package/workers/functions/dispatch-task.js +23 -0
  788. package/workers/functions/encode-message.d.ts +2 -0
  789. package/workers/functions/encode-message.js +7 -0
  790. package/workers/interfaces/enum/index.d.ts +1 -0
  791. package/workers/interfaces/enum/index.js +17 -0
  792. package/workers/interfaces/enum/worker-message-type.d.ts +6 -0
  793. package/workers/interfaces/enum/worker-message-type.js +10 -0
  794. package/workers/interfaces/index.d.ts +3 -0
  795. package/workers/interfaces/index.js +19 -0
  796. package/workers/interfaces/worker-data.d.ts +9 -0
  797. package/workers/interfaces/worker-data.js +2 -0
  798. package/workers/interfaces/worker-message.d.ts +20 -0
  799. package/workers/interfaces/worker-message.js +2 -0
  800. package/workers/workers.controller.d.ts +6 -0
  801. package/workers/workers.controller.js +72 -0
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TranslationConfig = void 0;
13
+ const common_1 = require("@rockster/common");
14
+ const database_1 = require("../../database");
15
+ const class_pipe_1 = require("@rockster/class-pipe");
16
+ let TranslationConfig = class TranslationConfig {
17
+ };
18
+ exports.TranslationConfig = TranslationConfig;
19
+ __decorate([
20
+ (0, class_pipe_1.Expose)(),
21
+ (0, class_pipe_1.IsOptional)(),
22
+ (0, class_pipe_1.IsString)(),
23
+ (0, database_1.IdGenerated)('nanoid'),
24
+ __metadata("design:type", String)
25
+ ], TranslationConfig.prototype, "id", void 0);
26
+ __decorate([
27
+ (0, class_pipe_1.Expose)(),
28
+ (0, class_pipe_1.IsString)(),
29
+ (0, database_1.Column)({
30
+ unique: true
31
+ }),
32
+ __metadata("design:type", String)
33
+ ], TranslationConfig.prototype, "referenceId", void 0);
34
+ __decorate([
35
+ (0, class_pipe_1.Expose)(),
36
+ (0, class_pipe_1.IsOptional)(),
37
+ (0, class_pipe_1.IsString)(),
38
+ (0, class_pipe_1.IsArray)(),
39
+ (0, database_1.Column)({
40
+ type: 'jsonb',
41
+ default: '[]'
42
+ }),
43
+ __metadata("design:type", Array)
44
+ ], TranslationConfig.prototype, "keys", void 0);
45
+ __decorate([
46
+ (0, class_pipe_1.Expose)(),
47
+ (0, class_pipe_1.IsOptional)(),
48
+ (0, class_pipe_1.IsString)(),
49
+ (0, class_pipe_1.IsArray)(),
50
+ (0, database_1.Column)({
51
+ type: 'jsonb',
52
+ default: '[]'
53
+ }),
54
+ __metadata("design:type", Array)
55
+ ], TranslationConfig.prototype, "locales", void 0);
56
+ __decorate([
57
+ (0, class_pipe_1.Expose)(),
58
+ (0, class_pipe_1.IsOptional)(),
59
+ (0, class_pipe_1.IsIn)(common_1.Locale),
60
+ (0, database_1.Column)({ type: 'varchar' }),
61
+ __metadata("design:type", String)
62
+ ], TranslationConfig.prototype, "default", void 0);
63
+ exports.TranslationConfig = TranslationConfig = __decorate([
64
+ (0, database_1.Entity)()
65
+ ], TranslationConfig);
@@ -0,0 +1,10 @@
1
+ import { Locale, Dictionary } from "@rockster/common";
2
+ import { ITranslationValues } from "../interfaces/translation-values";
3
+ import { ITranslationConfig } from "../interfaces/translation-config";
4
+ export declare class TranslationValues implements ITranslationValues {
5
+ translationConfigId: string;
6
+ id: string;
7
+ locale: Locale;
8
+ values: Dictionary<string>;
9
+ translationConfig?: ITranslationConfig;
10
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TranslationValues = void 0;
13
+ const common_1 = require("@rockster/common");
14
+ const translation_config_entity_1 = require("./translation-config.entity");
15
+ const database_1 = require("../../database");
16
+ const class_pipe_1 = require("@rockster/class-pipe");
17
+ let TranslationValues = class TranslationValues {
18
+ };
19
+ exports.TranslationValues = TranslationValues;
20
+ __decorate([
21
+ (0, class_pipe_1.Expose)(),
22
+ (0, class_pipe_1.IsRequired)(),
23
+ (0, class_pipe_1.IsString)(),
24
+ (0, database_1.Relation)(() => translation_config_entity_1.TranslationConfig),
25
+ __metadata("design:type", String)
26
+ ], TranslationValues.prototype, "translationConfigId", void 0);
27
+ __decorate([
28
+ (0, class_pipe_1.Expose)(),
29
+ (0, class_pipe_1.IsString)(),
30
+ (0, class_pipe_1.IsOptional)(),
31
+ (0, database_1.IdGenerated)('nanoid'),
32
+ __metadata("design:type", String)
33
+ ], TranslationValues.prototype, "id", void 0);
34
+ __decorate([
35
+ (0, class_pipe_1.Expose)(),
36
+ (0, class_pipe_1.IsRequired)(),
37
+ (0, class_pipe_1.IsIn)(Object.values(common_1.Locale)),
38
+ (0, database_1.Column)({ type: 'varchar' }),
39
+ __metadata("design:type", String)
40
+ ], TranslationValues.prototype, "locale", void 0);
41
+ __decorate([
42
+ (0, class_pipe_1.Expose)({ ignoreType: true }),
43
+ (0, class_pipe_1.IsRequired)(),
44
+ (0, class_pipe_1.IsObject)(),
45
+ (0, database_1.Column)({
46
+ type: 'jsonb',
47
+ default: '{}'
48
+ }),
49
+ __metadata("design:type", Object)
50
+ ], TranslationValues.prototype, "values", void 0);
51
+ exports.TranslationValues = TranslationValues = __decorate([
52
+ (0, database_1.Entity)()
53
+ ], TranslationValues);
@@ -0,0 +1,2 @@
1
+ import { TranslationsOptions } from "../core";
2
+ export declare const env: TranslationsOptions;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.env = void 0;
4
+ exports.env = {
5
+ activate: false,
6
+ cacheTTL: 3600
7
+ };
@@ -0,0 +1 @@
1
+ export declare const checkCanUse: () => void;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkCanUse = void 0;
4
+ const env_1 = require("../env");
5
+ const checkCanUse = () => {
6
+ if (!env_1.env.activate) {
7
+ throw new Error('Translations disabled');
8
+ }
9
+ };
10
+ exports.checkCanUse = checkCanUse;
@@ -0,0 +1,3 @@
1
+ import { TranslationConfig } from "../entities/translation-config.entity";
2
+ import { ITranslationConfig } from "../interfaces/translation-config";
3
+ export declare const createTranslationConfig: (config: Omit<ITranslationConfig, "id">) => Promise<Omit<ITranslationConfig, "id"> & TranslationConfig>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTranslationConfig = void 0;
4
+ const use_repository_1 = require("../../database/functions/use-repository");
5
+ const translation_config_entity_1 = require("../entities/translation-config.entity");
6
+ const check_can_use_1 = require("./check-can-use");
7
+ const __1 = require("../..");
8
+ const transaction_context_1 = require("../../database/contexts/transaction-context");
9
+ const createTranslationConfig = async (config) => {
10
+ (0, check_can_use_1.checkCanUse)();
11
+ const transactionContext = transaction_context_1.transactionContextStore.getStore();
12
+ const entityManager = transactionContext?.entityManager;
13
+ const repository = entityManager
14
+ ? entityManager.getRepository(translation_config_entity_1.TranslationConfig)
15
+ : (0, use_repository_1.useRepository)(translation_config_entity_1.TranslationConfig);
16
+ (0, __1.generateEntityId)(repository.target, config);
17
+ return repository.save(config);
18
+ };
19
+ exports.createTranslationConfig = createTranslationConfig;
@@ -0,0 +1,3 @@
1
+ import { TranslationValues } from '../entities/translation-values.entity';
2
+ import { ITranslationValues } from '../interfaces/translation-values';
3
+ export declare const createTranslationValues: (values: Omit<ITranslationValues, "id">) => Promise<Omit<ITranslationValues, "id"> & TranslationValues>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createTranslationValues = void 0;
7
+ const transaction_context_1 = require("../../database/contexts/transaction-context");
8
+ const generate_id_1 = __importDefault(require("../../database/functions/generate-id"));
9
+ const use_repository_1 = require("../../database/functions/use-repository");
10
+ const translation_values_entity_1 = require("../entities/translation-values.entity");
11
+ const check_can_use_1 = require("./check-can-use");
12
+ const createTranslationValues = async (values) => {
13
+ (0, check_can_use_1.checkCanUse)();
14
+ const transactionContext = transaction_context_1.transactionContextStore.getStore();
15
+ const entityManager = transactionContext?.entityManager;
16
+ const repository = entityManager
17
+ ? entityManager.getRepository(translation_values_entity_1.TranslationValues)
18
+ : (0, use_repository_1.useRepository)(translation_values_entity_1.TranslationValues);
19
+ (0, generate_id_1.default)(repository.target, values);
20
+ return repository.save(values);
21
+ };
22
+ exports.createTranslationValues = createTranslationValues;
@@ -0,0 +1,3 @@
1
+ import { EntityManager, FindOneOptions } from "typeorm";
2
+ import { TranslationConfig } from "../entities/translation-config.entity";
3
+ export declare const getTranslationConfig: (options: FindOneOptions<TranslationConfig>, entityManager: EntityManager) => Promise<TranslationConfig>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTranslationConfig = void 0;
4
+ const use_repository_1 = require("../../database/functions/use-repository");
5
+ const translation_config_entity_1 = require("../entities/translation-config.entity");
6
+ const check_can_use_1 = require("./check-can-use");
7
+ const getTranslationConfig = async (options, entityManager) => {
8
+ (0, check_can_use_1.checkCanUse)();
9
+ const repository = entityManager
10
+ ? entityManager.getRepository(translation_config_entity_1.TranslationConfig)
11
+ : (0, use_repository_1.useRepository)(translation_config_entity_1.TranslationConfig);
12
+ return repository.findOne(options);
13
+ };
14
+ exports.getTranslationConfig = getTranslationConfig;
@@ -0,0 +1,8 @@
1
+ import { Locale } from "@rockster/common";
2
+ export interface ITranslationConfig {
3
+ id: string;
4
+ referenceId: string;
5
+ default: Locale;
6
+ keys?: string[];
7
+ locales?: Locale[];
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { Dictionary, Locale } from "@rockster/common";
2
+ import { ITranslationConfig } from "./translation-config";
3
+ export interface ITranslationValues {
4
+ id: string;
5
+ translationConfigId: string;
6
+ locale: Locale;
7
+ values: Dictionary<string>;
8
+ translationConfig?: ITranslationConfig;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { Dictionary } from "@rockster/common";
2
+ export type TranslatorHandle = {
3
+ (key: string, replaces?: Dictionary<string>): string;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class CreateTranslationTables1723760669185 implements MigrationInterface {
3
+ up(queryRunner: QueryRunner): Promise<void>;
4
+ down(queryRunner: QueryRunner): Promise<void>;
5
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateTranslationTables1723760669185 = void 0;
4
+ const database_1 = require("../../database");
5
+ class CreateTranslationTables1723760669185 {
6
+ async up(queryRunner) {
7
+ await (0, database_1.executeIfNotExistsTable)('translation_config', queryRunner, async () => {
8
+ await queryRunner.query(`
9
+ create table translation_config
10
+ (
11
+ id varchar not null
12
+ constraint PK_8427c3ffc46a55b0a81aadcc94e primary key,
13
+ reference_id varchar not null,
14
+ keys jsonb default '[]'::jsonb not null,
15
+ locales jsonb default '[]'::jsonb not null,
16
+ "default" varchar not null
17
+ );
18
+
19
+ create unique index idx_unique_reference_id
20
+ on translation_config (reference_id);
21
+ `);
22
+ });
23
+ await (0, database_1.executeIfNotExistsTable)('translation_values', queryRunner, async () => {
24
+ await queryRunner.query(`
25
+ create table translation_values
26
+ (
27
+ translation_config_id varchar not null
28
+ constraint FK_0b56598e8fbae363ccf05f6199a
29
+ references translation_config,
30
+ id varchar not null
31
+ constraint PK_c7f4573ffed80531e93aab5cc55 primary key,
32
+ locale varchar not null,
33
+ values jsonb default '{}'::jsonb not null
34
+ );
35
+ `);
36
+ });
37
+ }
38
+ async down(queryRunner) {
39
+ await queryRunner.query(`drop table if exists translation_values;`);
40
+ await queryRunner.query(`drop table if exists translation_config;`);
41
+ }
42
+ }
43
+ exports.CreateTranslationTables1723760669185 = CreateTranslationTables1723760669185;
@@ -0,0 +1,5 @@
1
+ import { Locale } from "@rockster/common";
2
+ export declare class GetValuesRequest {
3
+ referenceId: string;
4
+ locale: Locale;
5
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GetValuesRequest = void 0;
13
+ const class_pipe_1 = require("@rockster/class-pipe");
14
+ const common_1 = require("@rockster/common");
15
+ class GetValuesRequest {
16
+ }
17
+ exports.GetValuesRequest = GetValuesRequest;
18
+ __decorate([
19
+ (0, class_pipe_1.IsString)(),
20
+ __metadata("design:type", String)
21
+ ], GetValuesRequest.prototype, "referenceId", void 0);
22
+ __decorate([
23
+ (0, class_pipe_1.IsIn)(Object.values(common_1.Locale)),
24
+ __metadata("design:type", String)
25
+ ], GetValuesRequest.prototype, "locale", void 0);
@@ -0,0 +1,4 @@
1
+ import { Dictionary } from "@rockster/common";
2
+ export declare class GetValuesResponse {
3
+ values: Dictionary<string>;
4
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GetValuesResponse = void 0;
13
+ const class_pipe_1 = require("@rockster/class-pipe");
14
+ class GetValuesResponse {
15
+ }
16
+ exports.GetValuesResponse = GetValuesResponse;
17
+ __decorate([
18
+ (0, class_pipe_1.Expose)({ ignoreType: true }),
19
+ __metadata("design:type", Object)
20
+ ], GetValuesResponse.prototype, "values", void 0);
@@ -0,0 +1 @@
1
+ export declare const TranslationConfigQuery: (options?: import("../..").QueryActionOptions) => (target: any, propertyKey: string) => void;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TranslationConfigQuery = void 0;
4
+ const create_query_1 = require("../../query/functions/create-query");
5
+ const translation_config_entity_1 = require("../entities/translation-config.entity");
6
+ exports.TranslationConfigQuery = (0, create_query_1.createQuery)({
7
+ alias: 'translationConfig',
8
+ target: () => translation_config_entity_1.TranslationConfig
9
+ });
@@ -0,0 +1 @@
1
+ export declare const TranslationValuesQuery: (options?: import("../..").QueryActionOptions) => (target: any, propertyKey: string) => void;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TranslationValuesQuery = void 0;
4
+ const create_query_1 = require("../../query/functions/create-query");
5
+ const translation_config_entity_1 = require("../entities/translation-config.entity");
6
+ const translation_values_entity_1 = require("../entities/translation-values.entity");
7
+ exports.TranslationValuesQuery = (0, create_query_1.createQuery)({
8
+ alias: 'translationValues',
9
+ target: () => translation_values_entity_1.TranslationValues,
10
+ paths: {
11
+ translationConfig: (0, create_query_1.directPath)({
12
+ alias: 'translationConfig',
13
+ target: () => translation_config_entity_1.TranslationConfig
14
+ })
15
+ }
16
+ });
@@ -0,0 +1,16 @@
1
+ import { IPostContent } from '../../command/interfaces';
2
+ import { TranslationConfig } from '../entities/translation-config.entity';
3
+ import { IQueryContent } from '../../query/interfaces';
4
+ import { GetValuesRequest } from '../models/get-values.request';
5
+ import { GetValuesResponse } from '../models/get-values.response';
6
+ import { TranslationsService } from '../services/translations.service';
7
+ import { ITranslationValues } from '../interfaces/translation-values';
8
+ export declare class TranslationRequest {
9
+ protected readonly translationsService: TranslationsService;
10
+ constructor(translationsService: TranslationsService);
11
+ postConfig(content: IPostContent<TranslationConfig>): Promise<TranslationConfig>;
12
+ postValues(content: IPostContent<ITranslationValues>): Promise<ITranslationValues>;
13
+ queryConfig(content: IQueryContent<TranslationConfig>): Promise<import("../../query/interfaces").Query<TranslationConfig>>;
14
+ queryValues(content: IQueryContent<TranslationConfig>): Promise<import("../../query/interfaces").Query<TranslationConfig>>;
15
+ getValues(content: GetValuesRequest): Promise<GetValuesResponse>;
16
+ }
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TranslationRequest = void 0;
16
+ const translation_config_entity_1 = require("../entities/translation-config.entity");
17
+ const execute_post_1 = require("../../command/functions/execute-post");
18
+ const translation_config_query_1 = require("../queries/translation-config.query");
19
+ const decorators_1 = require("../../query/decorators");
20
+ const translation_values_query_1 = require("../queries/translation-values.query");
21
+ const execute_query_1 = require("../../query/functions/execute-query");
22
+ const get_values_request_1 = require("../models/get-values.request");
23
+ const get_values_response_1 = require("../models/get-values.response");
24
+ const translations_service_1 = require("../services/translations.service");
25
+ const translation_values_entity_1 = require("../entities/translation-values.entity");
26
+ const decorators_2 = require("../../command/decorators");
27
+ const controllers_1 = require("../../controllers");
28
+ let TranslationRequest = class TranslationRequest {
29
+ constructor(translationsService) {
30
+ this.translationsService = translationsService;
31
+ }
32
+ async postConfig(content) {
33
+ return (0, execute_post_1.executePost)(content);
34
+ }
35
+ async postValues(content) {
36
+ return (0, execute_post_1.executePost)(content);
37
+ }
38
+ async queryConfig(content) {
39
+ return (0, execute_query_1.executeQuery)({ content: content });
40
+ }
41
+ async queryValues(content) {
42
+ return (0, execute_query_1.executeQuery)({ content: content });
43
+ }
44
+ async getValues(content) {
45
+ const values = await this
46
+ .translationsService
47
+ .getValues(content.referenceId, content.locale);
48
+ return {
49
+ values: values
50
+ };
51
+ }
52
+ };
53
+ exports.TranslationRequest = TranslationRequest;
54
+ __decorate([
55
+ (0, decorators_2.PostAction)({
56
+ type: () => translation_config_entity_1.TranslationConfig
57
+ }),
58
+ __param(0, (0, decorators_2.PostContent)()),
59
+ __metadata("design:type", Function),
60
+ __metadata("design:paramtypes", [Object]),
61
+ __metadata("design:returntype", Promise)
62
+ ], TranslationRequest.prototype, "postConfig", null);
63
+ __decorate([
64
+ (0, decorators_2.PostAction)({
65
+ type: () => translation_values_entity_1.TranslationValues
66
+ }),
67
+ __param(0, (0, decorators_2.PostContent)()),
68
+ __metadata("design:type", Function),
69
+ __metadata("design:paramtypes", [Object]),
70
+ __metadata("design:returntype", Promise)
71
+ ], TranslationRequest.prototype, "postValues", null);
72
+ __decorate([
73
+ (0, translation_config_query_1.TranslationConfigQuery)(),
74
+ __param(0, (0, decorators_1.QueryContent)()),
75
+ __metadata("design:type", Function),
76
+ __metadata("design:paramtypes", [Object]),
77
+ __metadata("design:returntype", Promise)
78
+ ], TranslationRequest.prototype, "queryConfig", null);
79
+ __decorate([
80
+ (0, translation_values_query_1.TranslationValuesQuery)(),
81
+ __param(0, (0, decorators_1.QueryContent)()),
82
+ __metadata("design:type", Function),
83
+ __metadata("design:paramtypes", [Object]),
84
+ __metadata("design:returntype", Promise)
85
+ ], TranslationRequest.prototype, "queryValues", null);
86
+ __decorate([
87
+ (0, controllers_1.Action)({
88
+ response: () => get_values_response_1.GetValuesResponse,
89
+ public: true
90
+ }),
91
+ __param(0, (0, controllers_1.ActionContent)()),
92
+ __metadata("design:type", Function),
93
+ __metadata("design:paramtypes", [get_values_request_1.GetValuesRequest]),
94
+ __metadata("design:returntype", Promise)
95
+ ], TranslationRequest.prototype, "getValues", null);
96
+ exports.TranslationRequest = TranslationRequest = __decorate([
97
+ (0, controllers_1.Controller)(),
98
+ __metadata("design:paramtypes", [translations_service_1.TranslationsService])
99
+ ], TranslationRequest);
@@ -0,0 +1,11 @@
1
+ import { Locale } from "@rockster/common";
2
+ import { TranslationValues } from "../entities/translation-values.entity";
3
+ import { Repository } from 'typeorm';
4
+ import { CacheInstance } from "../../cache";
5
+ export declare class TranslationsService {
6
+ protected repository: Repository<TranslationValues>;
7
+ protected cache: CacheInstance;
8
+ getValues(referenceId: string, locale: Locale): Promise<{
9
+ [x: string]: string;
10
+ }>;
11
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TranslationsService = void 0;
13
+ const class_injector_1 = require("@rockster/class-injector");
14
+ const translation_values_entity_1 = require("../entities/translation-values.entity");
15
+ const translation_config_entity_1 = require("../entities/translation-config.entity");
16
+ const database_1 = require("../../database");
17
+ const typeorm_1 = require("typeorm");
18
+ const cache_1 = require("../../cache");
19
+ let TranslationsService = class TranslationsService {
20
+ async getValues(referenceId, locale) {
21
+ const values = await this
22
+ .repository
23
+ .createQueryBuilder('translationValues')
24
+ .leftJoinAndMapOne('translationValues.translationConfig', translation_config_entity_1.TranslationConfig, 'translationConfig', `translationValues.translation_config_id = translationConfig.id`)
25
+ .where(`
26
+ (translationConfig.reference_id = '${referenceId}'
27
+ AND translationValues.locale = '${locale}')
28
+ OR translationValues.locale = translationConfig.default
29
+ `)
30
+ .getMany();
31
+ const _default = values
32
+ .find((value) => {
33
+ return value.translationConfig?.default === value.locale;
34
+ }) || { values: {} };
35
+ const _requested = values
36
+ .find((value) => {
37
+ return value.locale === locale;
38
+ }) || { values: {} };
39
+ return {
40
+ ..._default.values,
41
+ ..._requested.values
42
+ };
43
+ }
44
+ };
45
+ exports.TranslationsService = TranslationsService;
46
+ __decorate([
47
+ (0, database_1.InjectRepository)(() => translation_values_entity_1.TranslationValues),
48
+ __metadata("design:type", typeorm_1.Repository)
49
+ ], TranslationsService.prototype, "repository", void 0);
50
+ __decorate([
51
+ (0, cache_1.InjectCache)(),
52
+ __metadata("design:type", Object)
53
+ ], TranslationsService.prototype, "cache", void 0);
54
+ exports.TranslationsService = TranslationsService = __decorate([
55
+ (0, class_injector_1.Injectable)()
56
+ ], TranslationsService);
@@ -0,0 +1,11 @@
1
+ import { TranslationsService } from "./translations.service";
2
+ import { CacheClient } from "../../cache";
3
+ import { Dictionary, Locale } from "@rockster/common";
4
+ import { TranslatorHandle } from "../interfaces/translator-handle";
5
+ export declare class TranslatorService {
6
+ protected translationsService: TranslationsService;
7
+ protected cache: CacheClient;
8
+ constructor(translationsService: TranslationsService);
9
+ useValues(referenceId: string, locale: Locale): Promise<TranslatorHandle>;
10
+ protected getHandle(values: Dictionary<string>): TranslatorHandle;
11
+ }