@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,71 @@
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 LocaleService_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.LocaleService = void 0;
14
+ const intl_1 = require("@formatjs/intl");
15
+ const class_injector_1 = require("@rockster/class-injector");
16
+ const common_1 = require("@rockster/common");
17
+ const logger_1 = require("@rockster/logger");
18
+ const path_1 = require("path");
19
+ let LocaleService = LocaleService_1 = class LocaleService {
20
+ get default() {
21
+ return LocaleService_1._default;
22
+ }
23
+ get cache() {
24
+ return LocaleService_1._cache;
25
+ }
26
+ get memory() {
27
+ return LocaleService_1._memory;
28
+ }
29
+ init() {
30
+ if (!core.options.locale) {
31
+ return;
32
+ }
33
+ const logger = new logger_1.Logger('Locale');
34
+ const options = core.options.locale;
35
+ const directory = options.directory;
36
+ const localeFiles = tryReadDir(directory);
37
+ LocaleService_1._default = options.default;
38
+ for (const localeFile of localeFiles) {
39
+ const filePath = (0, path_1.join)(directory, localeFile);
40
+ const messages = require(filePath);
41
+ const [name] = localeFile.split('.');
42
+ const locale = common_1.Locale[name.replace('-', '')];
43
+ if (!locale) {
44
+ logger.throw(new Error(`${name} is not a valid locale`));
45
+ }
46
+ const config = {
47
+ locale,
48
+ messages,
49
+ onError: () => { }
50
+ };
51
+ this.memory[locale] = (0, intl_1.createIntl)(config, this.cache);
52
+ }
53
+ }
54
+ formatMessage({ locale, messageKey, replaces }) {
55
+ const intl = this.memory[locale || this.default] ||
56
+ this.memory[this.default];
57
+ return intl.formatMessage({ id: messageKey }, replaces);
58
+ }
59
+ };
60
+ exports.LocaleService = LocaleService;
61
+ LocaleService._cache = (0, intl_1.createIntlCache)();
62
+ LocaleService._memory = {};
63
+ __decorate([
64
+ (0, class_injector_1.OnCreate)(),
65
+ __metadata("design:type", Function),
66
+ __metadata("design:paramtypes", []),
67
+ __metadata("design:returntype", void 0)
68
+ ], LocaleService.prototype, "init", null);
69
+ exports.LocaleService = LocaleService = LocaleService_1 = __decorate([
70
+ (0, class_injector_1.Injectable)()
71
+ ], LocaleService);
@@ -0,0 +1,5 @@
1
+ import { CacheClient } from "../../cache";
2
+ export declare class NodeControlService {
3
+ protected cache: CacheClient;
4
+ registerNode(): Promise<void>;
5
+ }
@@ -0,0 +1,46 @@
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.NodeControlService = void 0;
13
+ const class_injector_1 = require("@rockster/class-injector");
14
+ const get_ip_address_1 = require("../../web-socket/functions/get-ip-address");
15
+ const crypto_1 = require("crypto");
16
+ const uuid_1 = require("uuid");
17
+ const cache_1 = require("../../cache");
18
+ let NodeControlService = class NodeControlService {
19
+ async registerNode() {
20
+ const address = (0, get_ip_address_1.getIpAddress)();
21
+ const port = core.options.port;
22
+ const url = `${address}:${port}`;
23
+ const privateKey = (0, crypto_1.createHmac)('sha256', (0, uuid_1.v4)()).digest('hex');
24
+ const key = `ROCKET:NODE:${core.options.name}:${url}`;
25
+ core.privateKey = privateKey;
26
+ core.nodeKey = key;
27
+ await this.cache.set(key, JSON.stringify({
28
+ address: address,
29
+ port: port,
30
+ url: url,
31
+ privateKey: privateKey,
32
+ }));
33
+ await this.cache.expire(key, 600);
34
+ setTimeout(() => {
35
+ this.registerNode();
36
+ }, 600000);
37
+ }
38
+ };
39
+ exports.NodeControlService = NodeControlService;
40
+ __decorate([
41
+ (0, cache_1.InjectCache)(),
42
+ __metadata("design:type", Object)
43
+ ], NodeControlService.prototype, "cache", void 0);
44
+ exports.NodeControlService = NodeControlService = __decorate([
45
+ (0, class_injector_1.Injectable)()
46
+ ], NodeControlService);
@@ -0,0 +1,10 @@
1
+ import { Instantiable } from "@rockster/common";
2
+ import { ObjectNote } from "@rockster/class-memory";
3
+ import { Object } from "../interfaces";
4
+ import { ObjectType } from "../../common";
5
+ export declare abstract class ObjectLoader<T extends Object> {
6
+ protected abstract objects: ObjectNote<T>[];
7
+ abstract build(targets: Instantiable[]): Promise<void> | void;
8
+ protected load(current: ObjectNote<Object>[], type: ObjectType, targets: Instantiable[]): ObjectNote<Object>[];
9
+ protected each(callback: (object: ObjectNote<T>) => Promise<void>): Promise<void>;
10
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObjectLoader = void 0;
4
+ class ObjectLoader {
5
+ load(current, type, targets) {
6
+ for (const target of targets) {
7
+ const object = core
8
+ .storage
9
+ .findObject(target);
10
+ if (object?.type === type) {
11
+ const compare = (source, target) => (source.objectClass === target.objectClass);
12
+ current.pushIfNotExists(object, compare);
13
+ }
14
+ }
15
+ return current;
16
+ }
17
+ async each(callback) {
18
+ for (const object of this.objects) {
19
+ if (object.initialized) {
20
+ continue;
21
+ }
22
+ await callback(object);
23
+ object.initialized = true;
24
+ }
25
+ }
26
+ }
27
+ exports.ObjectLoader = ObjectLoader;
@@ -0,0 +1,9 @@
1
+ import { PendingAction, IRequestContext } from "../interfaces";
2
+ export declare class RequestExecutor {
3
+ executeByDataSource(context: IRequestContext): Promise<import("@rockster/common").Dictionary<any>>;
4
+ executeByTransaction(context: IRequestContext): Promise<import("@rockster/common").Dictionary<any>>;
5
+ protected executeBefore(context: IRequestContext): Promise<void>;
6
+ protected executeActions(context: IRequestContext): Promise<void>;
7
+ protected executeSuccessCallbacks(context: IRequestContext): Promise<void>;
8
+ protected executeErrorCallbacks(error: Error, pending: PendingAction, context: IRequestContext): Promise<void>;
9
+ }
@@ -0,0 +1,108 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.RequestExecutor = void 0;
10
+ const class_injector_1 = require("@rockster/class-injector");
11
+ const transaction_context_1 = require("../../database/contexts/transaction-context");
12
+ let RequestExecutor = class RequestExecutor {
13
+ async executeByDataSource(context) {
14
+ for (const pending of context.pendings) {
15
+ try {
16
+ await pending.action.onBefore(pending, context);
17
+ }
18
+ catch (error) {
19
+ error.requestRef = pending.requestRef;
20
+ throw error;
21
+ }
22
+ }
23
+ for (const pending of context.pendings) {
24
+ try {
25
+ await pending.action.execute(pending, context);
26
+ }
27
+ catch (error) {
28
+ error.requestRef = pending.requestRef;
29
+ throw error;
30
+ }
31
+ }
32
+ return context.response;
33
+ }
34
+ async executeByTransaction(context) {
35
+ await this.executeBefore(context);
36
+ await this.executeActions(context);
37
+ await this.executeSuccessCallbacks(context);
38
+ return context.response;
39
+ }
40
+ async executeBefore(context) {
41
+ for (const pending of context.pendings) {
42
+ try {
43
+ await pending.action.onBefore(pending, context);
44
+ }
45
+ catch (error) {
46
+ error.requestRef = pending.requestRef;
47
+ await this
48
+ .executeErrorCallbacks(error, pending, context);
49
+ throw error;
50
+ }
51
+ }
52
+ }
53
+ async executeActions(context) {
54
+ let actionError;
55
+ const dataSource = core.database.dataSource;
56
+ const queryRunner = dataSource.createQueryRunner();
57
+ const entityManager = queryRunner.manager;
58
+ context.entityManager = entityManager;
59
+ await transaction_context_1.transactionContextStore.run({ entityManager }, async () => {
60
+ try {
61
+ await queryRunner.connect();
62
+ await queryRunner.startTransaction();
63
+ for (const pending of context.pendings) {
64
+ try {
65
+ await pending.action.execute(pending, context);
66
+ }
67
+ catch (error) {
68
+ error.requestRef = pending.requestRef;
69
+ actionError = error;
70
+ await this
71
+ .executeErrorCallbacks(error, pending, context);
72
+ throw error;
73
+ }
74
+ }
75
+ await queryRunner.commitTransaction();
76
+ }
77
+ catch (error) {
78
+ await queryRunner.rollbackTransaction();
79
+ }
80
+ finally {
81
+ await queryRunner.release();
82
+ }
83
+ });
84
+ if (actionError) {
85
+ throw actionError;
86
+ }
87
+ }
88
+ async executeSuccessCallbacks(context) {
89
+ for (const callback of context.callbacks.success) {
90
+ await callback.handle();
91
+ }
92
+ }
93
+ async executeErrorCallbacks(error, pending, context) {
94
+ const callbacks = context
95
+ .callbacks
96
+ .error
97
+ .filter((callback) => {
98
+ return callback.name === pending.path;
99
+ });
100
+ for (const callback of callbacks) {
101
+ await callback.handle(error);
102
+ }
103
+ }
104
+ };
105
+ exports.RequestExecutor = RequestExecutor;
106
+ exports.RequestExecutor = RequestExecutor = __decorate([
107
+ (0, class_injector_1.Injectable)()
108
+ ], RequestExecutor);
@@ -0,0 +1,15 @@
1
+ import { HttpController } from "../../http";
2
+ import { RequestExecutor } from "./request-executor";
3
+ import { ContextBuilder } from "./context-builder";
4
+ import { Logger } from "@rockster/logger";
5
+ export declare class RequestRouter {
6
+ protected contextBuilder: ContextBuilder;
7
+ protected requestExecutor: RequestExecutor;
8
+ protected requestPath: string;
9
+ protected docsPath: string;
10
+ protected logger: Logger;
11
+ constructor(contextBuilder: ContextBuilder, requestExecutor: RequestExecutor);
12
+ start(http: HttpController): void;
13
+ protected postRequest(http: HttpController): void;
14
+ protected getDocs(http: HttpController): void;
15
+ }
@@ -0,0 +1,127 @@
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.RequestRouter = void 0;
13
+ const class_injector_1 = require("@rockster/class-injector");
14
+ const security_1 = require("../../security");
15
+ const request_executor_1 = require("./request-executor");
16
+ const context_builder_1 = require("./context-builder");
17
+ const logger_1 = require("@rockster/logger");
18
+ const database_1 = require("../../database");
19
+ const use_auth_1 = require("../../security/functions/use-auth");
20
+ const class_pipe_1 = require("@rockster/class-pipe");
21
+ const common_1 = require("@rockster/common");
22
+ let RequestRouter = class RequestRouter {
23
+ constructor(contextBuilder, requestExecutor) {
24
+ this.contextBuilder = contextBuilder;
25
+ this.requestExecutor = requestExecutor;
26
+ this.requestPath = '/request';
27
+ this.docsPath = '/docs';
28
+ this.logger = new logger_1.Logger('Docs');
29
+ }
30
+ start(http) {
31
+ this.postRequest(http);
32
+ this.getDocs(http);
33
+ }
34
+ postRequest(http) {
35
+ const method = common_1.HttpMethod.post;
36
+ const transaction = (0, database_1.useTransaction)();
37
+ const execute = transaction
38
+ ? this
39
+ .requestExecutor
40
+ .executeByTransaction
41
+ .bind(this.requestExecutor)
42
+ : this
43
+ .requestExecutor
44
+ .executeByDataSource
45
+ .bind(this.requestExecutor);
46
+ http.addRoute(method, this.requestPath, async (req, res) => {
47
+ try {
48
+ const requestContext = this
49
+ .contextBuilder
50
+ .build({
51
+ body: req.body,
52
+ headers: req.headers,
53
+ httpRequest: req
54
+ });
55
+ if (requestContext.isAuthenticated && (0, security_1.isAuthEnabled)() && !req.isWs) {
56
+ requestContext.session = await (0, use_auth_1.useAuth)().httpInterceptor(req);
57
+ }
58
+ if (req.isWs) {
59
+ requestContext.session = req.session;
60
+ }
61
+ const result = await execute(requestContext);
62
+ res.status(common_1.HttpStatus.ok).json(result);
63
+ }
64
+ catch (error) {
65
+ const code = error.httpCode || common_1.HttpStatus.internalServerError;
66
+ const body = code === common_1.HttpStatus.internalServerError ? null : error;
67
+ res.status(code).json(body);
68
+ core.options?.onRequestError?.apply(this, [error]);
69
+ }
70
+ });
71
+ }
72
+ getDocs(http) {
73
+ const method = common_1.HttpMethod.get;
74
+ const actions = core
75
+ .actions
76
+ .filter((action) => {
77
+ return action.docs;
78
+ })
79
+ .map((action) => {
80
+ return action.docs;
81
+ });
82
+ const models = core.models.map((model) => {
83
+ const objectDocs = (0, class_pipe_1.getDocs)(model);
84
+ objectDocs.properties.forEach((propertyDocs) => {
85
+ const propertyNote = core
86
+ .storage
87
+ .findProperty(model, propertyDocs.name);
88
+ propertyDocs.onlyModify = propertyNote?.onlyModify;
89
+ propertyDocs.readOnly = propertyNote?.readOnly;
90
+ });
91
+ return objectDocs;
92
+ });
93
+ if (core.options.docs) {
94
+ if (core.options.docs.public) {
95
+ http.addRoute(method, this.docsPath, (req, res) => {
96
+ res.status(common_1.HttpStatus.ok).json({
97
+ actions,
98
+ models
99
+ });
100
+ });
101
+ }
102
+ else {
103
+ http.addRoute(method, this.docsPath, async (req, res) => {
104
+ try {
105
+ await (0, use_auth_1.useAuth)().httpInterceptor(req);
106
+ res.status(common_1.HttpStatus.ok).json({
107
+ actions,
108
+ models
109
+ });
110
+ }
111
+ catch (error) {
112
+ const code = error.httpCode ||
113
+ common_1.HttpStatus.internalServerError;
114
+ res.status(code).json(error);
115
+ }
116
+ });
117
+ }
118
+ this.logger.log('Enabled');
119
+ }
120
+ }
121
+ };
122
+ exports.RequestRouter = RequestRouter;
123
+ exports.RequestRouter = RequestRouter = __decorate([
124
+ (0, class_injector_1.Injectable)(),
125
+ __metadata("design:paramtypes", [context_builder_1.ContextBuilder,
126
+ request_executor_1.RequestExecutor])
127
+ ], RequestRouter);
@@ -0,0 +1 @@
1
+ export * from './transaction-context';
@@ -0,0 +1,17 @@
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("./transaction-context"), exports);
@@ -0,0 +1,6 @@
1
+ import { AsyncLocalStorage } from "async_hooks";
2
+ import { EntityManager } from "typeorm";
3
+ export type TransactionContextStore = {
4
+ entityManager: EntityManager;
5
+ };
6
+ export declare const transactionContextStore: AsyncLocalStorage<TransactionContextStore>;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transactionContextStore = void 0;
4
+ const async_hooks_1 = require("async_hooks");
5
+ exports.transactionContextStore = new async_hooks_1.AsyncLocalStorage();
@@ -0,0 +1,20 @@
1
+ import { Instantiable } from "@rockster/common";
2
+ import { DataSource } from "typeorm";
3
+ import { ObjectNote } from "@rockster/class-memory";
4
+ import { ObjectLoader } from "../core";
5
+ import { IEntityObject } from "./interfaces";
6
+ import { PathsBuilder } from "./services/paths-builder";
7
+ import { ProtectBuilder } from "./services/protect-builder";
8
+ export declare class DatabaseController extends ObjectLoader<IEntityObject> {
9
+ protected pathsBuilder: PathsBuilder;
10
+ protected protectBuilder: ProtectBuilder;
11
+ static _objects: ObjectNote<IEntityObject>[];
12
+ static _dataSource: DataSource;
13
+ protected get objects(): ObjectNote<IEntityObject>[];
14
+ get dataSource(): DataSource;
15
+ protected set dataSource(value: DataSource);
16
+ constructor(pathsBuilder: PathsBuilder, protectBuilder: ProtectBuilder);
17
+ addMigrations(migrations: (string | Function)[]): Promise<void>;
18
+ build(targets: Instantiable[]): Promise<void>;
19
+ initialize(): Promise<void>;
20
+ }
@@ -0,0 +1,92 @@
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 DatabaseController_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.DatabaseController = void 0;
14
+ const class_injector_1 = require("@rockster/class-injector");
15
+ const typeorm_1 = require("typeorm");
16
+ const logger_1 = require("@rockster/logger");
17
+ const core_1 = require("../core");
18
+ const common_1 = require("../common");
19
+ const paths_builder_1 = require("./services/paths-builder");
20
+ const protect_builder_1 = require("./services/protect-builder");
21
+ const environment_1 = require("./environment");
22
+ const typeorm_naming_strategies_1 = require("typeorm-naming-strategies");
23
+ let DatabaseController = DatabaseController_1 = class DatabaseController extends core_1.ObjectLoader {
24
+ get objects() {
25
+ return DatabaseController_1._objects;
26
+ }
27
+ get dataSource() {
28
+ return DatabaseController_1._dataSource;
29
+ }
30
+ set dataSource(value) {
31
+ DatabaseController_1._dataSource = value;
32
+ }
33
+ constructor(pathsBuilder, protectBuilder) {
34
+ super();
35
+ this.pathsBuilder = pathsBuilder;
36
+ this.protectBuilder = protectBuilder;
37
+ }
38
+ async addMigrations(migrations) {
39
+ if (!core.options?.database.migrations) {
40
+ core.options.database = {
41
+ ...core.options.database,
42
+ migrations: []
43
+ };
44
+ }
45
+ migrations.forEach((migration) => {
46
+ const migrations = core
47
+ .options
48
+ .database
49
+ .migrations;
50
+ migrations.push(migration);
51
+ });
52
+ }
53
+ async build(targets) {
54
+ super.load(this.objects, common_1.ObjectType.entity, targets);
55
+ await this.each(async (object) => {
56
+ await this.pathsBuilder.build(object);
57
+ await this.protectBuilder.build(object);
58
+ });
59
+ }
60
+ async initialize() {
61
+ if (this.dataSource) {
62
+ return;
63
+ }
64
+ environment_1.environment
65
+ .oneToManyRegistrations
66
+ .forEach((value) => {
67
+ value.handle();
68
+ });
69
+ const logger = new logger_1.Logger('Database');
70
+ this.dataSource =
71
+ new typeorm_1.DataSource({
72
+ type: 'postgres',
73
+ ...core.options.database,
74
+ namingStrategy: new typeorm_naming_strategies_1.SnakeNamingStrategy(),
75
+ entities: this
76
+ .objects
77
+ .map((entity) => {
78
+ return entity.objectClass;
79
+ })
80
+ });
81
+ await this.dataSource.initialize();
82
+ core.database = this;
83
+ logger.log('Successfully connected');
84
+ }
85
+ };
86
+ exports.DatabaseController = DatabaseController;
87
+ DatabaseController._objects = [];
88
+ exports.DatabaseController = DatabaseController = DatabaseController_1 = __decorate([
89
+ (0, class_injector_1.Injectable)(),
90
+ __metadata("design:paramtypes", [paths_builder_1.PathsBuilder,
91
+ protect_builder_1.ProtectBuilder])
92
+ ], DatabaseController);
@@ -0,0 +1,72 @@
1
+ import { ColumnOptions } from "typeorm";
2
+ import { ColumnCommonOptions } from "typeorm/decorator/options/ColumnCommonOptions";
3
+ import { ColumnEmbeddedOptions } from "typeorm/decorator/options/ColumnEmbeddedOptions";
4
+ import { ColumnEnumOptions } from "typeorm/decorator/options/ColumnEnumOptions";
5
+ import { ColumnHstoreOptions } from "typeorm/decorator/options/ColumnHstoreOptions";
6
+ import { ColumnNumericOptions } from "typeorm/decorator/options/ColumnNumericOptions";
7
+ import { ColumnWithLengthOptions } from "typeorm/decorator/options/ColumnWithLengthOptions";
8
+ import { SpatialColumnOptions } from "typeorm/decorator/options/SpatialColumnOptions";
9
+ import { SimpleColumnType, SpatialColumnType, WithLengthColumnType, WithPrecisionColumnType } from "typeorm/driver/types/ColumnTypes";
10
+ /**
11
+ * Column decorator is used to mark a specific class property as a table column. Only properties decorated with this
12
+ * decorator will be persisted to the database when entity be saved.
13
+ */
14
+ export declare function Column(): any;
15
+ /**
16
+ * Column decorator is used to mark a specific class property as a table column.
17
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
18
+ */
19
+ export declare function Column(options: ColumnOptions): any;
20
+ /**
21
+ * Column decorator is used to mark a specific class property as a table column.
22
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
23
+ */
24
+ export declare function Column(type: SimpleColumnType, options?: ColumnCommonOptions): any;
25
+ /**
26
+ * Column decorator is used to mark a specific class property as a table column.
27
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
28
+ */
29
+ export declare function Column(type: SpatialColumnType, options?: ColumnCommonOptions & SpatialColumnOptions): any;
30
+ /**
31
+ * Column decorator is used to mark a specific class property as a table column.
32
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
33
+ */
34
+ export declare function Column(type: WithLengthColumnType, options?: ColumnCommonOptions & ColumnWithLengthOptions): any;
35
+ /**
36
+ * Column decorator is used to mark a specific class property as a table column.
37
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
38
+ */
39
+ /**
40
+ * Column decorator is used to mark a specific class property as a table column.
41
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
42
+ */
43
+ export declare function Column(type: WithPrecisionColumnType, options?: ColumnCommonOptions & ColumnNumericOptions): any;
44
+ /**
45
+ * Column decorator is used to mark a specific class property as a table column.
46
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
47
+ */
48
+ export declare function Column(type: "enum", options?: ColumnCommonOptions & ColumnEnumOptions): any;
49
+ /**
50
+ * Column decorator is used to mark a specific class property as a table column.
51
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
52
+ */
53
+ export declare function Column(type: "simple-enum", options?: ColumnCommonOptions & ColumnEnumOptions): any;
54
+ /**
55
+ * Column decorator is used to mark a specific class property as a table column.
56
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
57
+ */
58
+ export declare function Column(type: "set", options?: ColumnCommonOptions & ColumnEnumOptions): any;
59
+ /**
60
+ * Column decorator is used to mark a specific class property as a table column.
61
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
62
+ */
63
+ export declare function Column(type: "hstore", options?: ColumnCommonOptions & ColumnHstoreOptions): any;
64
+ /**
65
+ * Column decorator is used to mark a specific class property as a table column.
66
+ * Only properties decorated with this decorator will be persisted to the database when entity be saved.
67
+ *
68
+ * Property in entity can be marked as Embedded, and on persist all columns from the embedded are mapped to the
69
+ * single table of the entity where Embedded is used. And on hydration all columns which supposed to be in the
70
+ * embedded will be mapped to it from the single table.
71
+ */
72
+ export declare function Column(type: (type?: any) => Function, options?: ColumnEmbeddedOptions): any;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Column = Column;
4
+ const column_decorator_1 = require("../functions/column-decorator");
5
+ function Column(type, options) {
6
+ return (target, propertyKey) => {
7
+ (0, column_decorator_1.columnDecorator)(target, propertyKey, type, options);
8
+ };
9
+ }
@@ -0,0 +1,2 @@
1
+ import { IEntityOptions } from "../interfaces";
2
+ export declare const Entity: (options?: IEntityOptions) => (target: any) => void;