@rockster/core 0.0.2 → 0.1.0

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 (501) hide show
  1. package/access/access.module.d.ts +11 -0
  2. package/access/access.module.js +56 -0
  3. package/access/access.module.js.map +1 -0
  4. package/access/constants.d.ts +2 -0
  5. package/access/constants.js +6 -0
  6. package/access/constants.js.map +1 -0
  7. package/access/controllers/controllers.d.ts +7 -0
  8. package/access/controllers/controllers.js +18 -0
  9. package/access/controllers/controllers.js.map +1 -0
  10. package/access/controllers/scope-access-profile.controller.d.ts +17 -0
  11. package/access/controllers/scope-access-profile.controller.js +111 -0
  12. package/access/controllers/scope-access-profile.controller.js.map +1 -0
  13. package/access/controllers/scope-group-user.controller.d.ts +20 -0
  14. package/access/controllers/scope-group-user.controller.js +132 -0
  15. package/access/controllers/scope-group-user.controller.js.map +1 -0
  16. package/access/controllers/scope-group.controller.d.ts +22 -0
  17. package/access/controllers/scope-group.controller.js +177 -0
  18. package/access/controllers/scope-group.controller.js.map +1 -0
  19. package/access/controllers/scope-key.controller.d.ts +7 -0
  20. package/access/controllers/scope-key.controller.js +45 -0
  21. package/access/controllers/scope-key.controller.js.map +1 -0
  22. package/access/controllers/scope-owner.controller.d.ts +9 -0
  23. package/access/controllers/scope-owner.controller.js +80 -0
  24. package/access/controllers/scope-owner.controller.js.map +1 -0
  25. package/access/controllers/scope-user.controller.d.ts +14 -0
  26. package/access/controllers/scope-user.controller.js +109 -0
  27. package/access/controllers/scope-user.controller.js.map +1 -0
  28. package/access/decorators/context-params.decorator.d.ts +2 -0
  29. package/access/decorators/context-params.decorator.js +13 -0
  30. package/access/decorators/context-params.decorator.js.map +1 -0
  31. package/access/decorators/index.d.ts +2 -0
  32. package/access/decorators/index.js +19 -0
  33. package/access/decorators/index.js.map +1 -0
  34. package/access/decorators/scope-context-id-resolver.decorator.d.ts +10 -0
  35. package/access/decorators/scope-context-id-resolver.decorator.js +22 -0
  36. package/access/decorators/scope-context-id-resolver.decorator.js.map +1 -0
  37. package/access/entities/entities.d.ts +8 -0
  38. package/access/entities/entities.js +22 -0
  39. package/access/entities/entities.js.map +1 -0
  40. package/access/entities/index.d.ts +7 -0
  41. package/access/entities/index.js +24 -0
  42. package/access/entities/index.js.map +1 -0
  43. package/access/entities/scope-access-profile-key.d.ts +6 -0
  44. package/access/entities/scope-access-profile-key.js +40 -0
  45. package/access/entities/scope-access-profile-key.js.map +1 -0
  46. package/access/entities/scope-access-profile.d.ts +6 -0
  47. package/access/entities/scope-access-profile.js +37 -0
  48. package/access/entities/scope-access-profile.js.map +1 -0
  49. package/access/entities/scope-access.d.ts +9 -0
  50. package/access/entities/scope-access.js +58 -0
  51. package/access/entities/scope-access.js.map +1 -0
  52. package/access/entities/scope-group-user.d.ts +7 -0
  53. package/access/entities/scope-group-user.js +47 -0
  54. package/access/entities/scope-group-user.js.map +1 -0
  55. package/access/entities/scope-group.d.ts +12 -0
  56. package/access/entities/scope-group.js +72 -0
  57. package/access/entities/scope-group.js.map +1 -0
  58. package/access/entities/scope-key.d.ts +5 -0
  59. package/access/entities/scope-key.js +35 -0
  60. package/access/entities/scope-key.js.map +1 -0
  61. package/access/entities/scope-owner.d.ts +7 -0
  62. package/access/entities/scope-owner.js +45 -0
  63. package/access/entities/scope-owner.js.map +1 -0
  64. package/access/env.d.ts +10 -0
  65. package/access/env.js +10 -0
  66. package/access/env.js.map +1 -0
  67. package/access/functions/assert-context-admin-access.d.ts +15 -0
  68. package/access/functions/assert-context-admin-access.js +62 -0
  69. package/access/functions/assert-context-admin-access.js.map +1 -0
  70. package/access/functions/assert-master-or-owner.d.ts +9 -0
  71. package/access/functions/assert-master-or-owner.js +40 -0
  72. package/access/functions/assert-master-or-owner.js.map +1 -0
  73. package/access/functions/assert-scope-action-access.d.ts +32 -0
  74. package/access/functions/assert-scope-action-access.js +189 -0
  75. package/access/functions/assert-scope-action-access.js.map +1 -0
  76. package/access/functions/build-scope-resolver-initial-data.d.ts +4 -0
  77. package/access/functions/build-scope-resolver-initial-data.js +17 -0
  78. package/access/functions/build-scope-resolver-initial-data.js.map +1 -0
  79. package/access/functions/describe-action-scope.d.ts +9 -0
  80. package/access/functions/describe-action-scope.js +27 -0
  81. package/access/functions/describe-action-scope.js.map +1 -0
  82. package/access/functions/get-context-id-service.d.ts +1 -0
  83. package/access/functions/get-context-id-service.js +8 -0
  84. package/access/functions/get-context-id-service.js.map +1 -0
  85. package/access/functions/get-is-owner.d.ts +1 -0
  86. package/access/functions/get-is-owner.js +8 -0
  87. package/access/functions/get-is-owner.js.map +1 -0
  88. package/access/functions/get-user-keys.d.ts +2 -0
  89. package/access/functions/get-user-keys.js +10 -0
  90. package/access/functions/get-user-keys.js.map +1 -0
  91. package/access/functions/index.d.ts +8 -0
  92. package/access/functions/index.js +25 -0
  93. package/access/functions/index.js.map +1 -0
  94. package/access/functions/init-scope-service-executors.d.ts +3 -0
  95. package/access/functions/init-scope-service-executors.js +38 -0
  96. package/access/functions/init-scope-service-executors.js.map +1 -0
  97. package/access/functions/normalize-scope-keys.d.ts +4 -0
  98. package/access/functions/normalize-scope-keys.js +17 -0
  99. package/access/functions/normalize-scope-keys.js.map +1 -0
  100. package/access/functions/register-scope.d.ts +19 -0
  101. package/access/functions/register-scope.js +94 -0
  102. package/access/functions/register-scope.js.map +1 -0
  103. package/access/functions/resolve-scope-context-id.d.ts +9 -0
  104. package/access/functions/resolve-scope-context-id.js +71 -0
  105. package/access/functions/resolve-scope-context-id.js.map +1 -0
  106. package/access/functions/warn-if-public.d.ts +12 -0
  107. package/access/functions/warn-if-public.js +20 -0
  108. package/access/functions/warn-if-public.js.map +1 -0
  109. package/access/index.d.ts +7 -0
  110. package/access/index.js +24 -0
  111. package/access/index.js.map +1 -0
  112. package/access/interfaces/index.d.ts +3 -0
  113. package/access/interfaces/index.js +20 -0
  114. package/access/interfaces/index.js.map +1 -0
  115. package/access/interfaces/resolve-scope-context-id.d.ts +21 -0
  116. package/access/interfaces/resolve-scope-context-id.js +3 -0
  117. package/access/interfaces/resolve-scope-context-id.js.map +1 -0
  118. package/access/interfaces/scope-service-registry.d.ts +21 -0
  119. package/access/interfaces/scope-service-registry.js +3 -0
  120. package/access/interfaces/scope-service-registry.js.map +1 -0
  121. package/access/interfaces/scope-service.d.ts +11 -0
  122. package/{database/interfaces/protector.js → access/interfaces/scope-service.js} +1 -1
  123. package/access/interfaces/scope-service.js.map +1 -0
  124. package/access/models/scope-access-profile-keys-update.d.ts +5 -0
  125. package/access/models/scope-access-profile-keys-update.js +27 -0
  126. package/access/models/scope-access-profile-keys-update.js.map +1 -0
  127. package/access/models/scope-context.d.ts +4 -0
  128. package/access/models/scope-context.js +27 -0
  129. package/access/models/scope-context.js.map +1 -0
  130. package/access/models/scope-group-apply-access-profile.d.ts +6 -0
  131. package/access/models/scope-group-apply-access-profile.js +32 -0
  132. package/access/models/scope-group-apply-access-profile.js.map +1 -0
  133. package/access/models/scope-keys-update.d.ts +7 -0
  134. package/access/models/scope-keys-update.js +38 -0
  135. package/access/models/scope-keys-update.js.map +1 -0
  136. package/access/models/scope-owner.d.ts +5 -0
  137. package/access/models/scope-owner.js +32 -0
  138. package/access/models/scope-owner.js.map +1 -0
  139. package/access/models/scope-user-mapped.d.ts +9 -0
  140. package/access/models/scope-user-mapped.js +48 -0
  141. package/access/models/scope-user-mapped.js.map +1 -0
  142. package/access/models/scope-user.d.ts +9 -0
  143. package/access/models/scope-user.js +51 -0
  144. package/access/models/scope-user.js.map +1 -0
  145. package/access/queries/scope-access-profile.query.d.ts +1 -0
  146. package/access/queries/scope-access-profile.query.js +10 -0
  147. package/access/queries/scope-access-profile.query.js.map +1 -0
  148. package/access/queries/scope-group-user.query.d.ts +1 -0
  149. package/access/queries/scope-group-user.query.js +26 -0
  150. package/access/queries/scope-group-user.query.js.map +1 -0
  151. package/access/queries/scope-group.query.d.ts +1 -0
  152. package/access/queries/scope-group.query.js +19 -0
  153. package/access/queries/scope-group.query.js.map +1 -0
  154. package/access/services/index.d.ts +7 -0
  155. package/access/services/index.js +24 -0
  156. package/access/services/index.js.map +1 -0
  157. package/access/services/scope-access-profile.service.d.ts +13 -0
  158. package/access/services/scope-access-profile.service.js +75 -0
  159. package/access/services/scope-access-profile.service.js.map +1 -0
  160. package/access/services/scope-access.service.d.ts +11 -0
  161. package/access/services/scope-access.service.js +89 -0
  162. package/access/services/scope-access.service.js.map +1 -0
  163. package/access/services/scope-group-user.service.d.ts +8 -0
  164. package/access/services/scope-group-user.service.js +49 -0
  165. package/access/services/scope-group-user.service.js.map +1 -0
  166. package/access/services/scope-group.service.d.ts +17 -0
  167. package/access/services/scope-group.service.js +75 -0
  168. package/access/services/scope-group.service.js.map +1 -0
  169. package/access/services/scope-key.service.d.ts +9 -0
  170. package/access/services/scope-key.service.js +52 -0
  171. package/access/services/scope-key.service.js.map +1 -0
  172. package/access/services/scope-owner.service.d.ts +10 -0
  173. package/access/services/scope-owner.service.js +60 -0
  174. package/access/services/scope-owner.service.js.map +1 -0
  175. package/access/services/scope-service.d.ts +10 -0
  176. package/access/services/scope-service.js +52 -0
  177. package/access/services/scope-service.js.map +1 -0
  178. package/command/functions/execute-post.js +5 -7
  179. package/command/functions/execute-post.js.map +1 -1
  180. package/command/services/post-action-builder.js +21 -17
  181. package/command/services/post-action-builder.js.map +1 -1
  182. package/command/services/remove-action-builder.js +32 -22
  183. package/command/services/remove-action-builder.js.map +1 -1
  184. package/common/entities/base-entity.js +2 -0
  185. package/common/entities/base-entity.js.map +1 -1
  186. package/common/interfaces/enum/object-type.d.ts +2 -1
  187. package/common/interfaces/enum/object-type.js +1 -0
  188. package/common/interfaces/enum/object-type.js.map +1 -1
  189. package/controllers/constants/controller-transaction.d.ts +2 -0
  190. package/controllers/constants/controller-transaction.js +6 -0
  191. package/controllers/constants/controller-transaction.js.map +1 -0
  192. package/controllers/controller.controller.d.ts +1 -1
  193. package/controllers/controller.controller.js +4 -4
  194. package/controllers/controller.controller.js.map +1 -1
  195. package/controllers/decorators/controller.decorator.js +8 -0
  196. package/controllers/decorators/controller.decorator.js.map +1 -1
  197. package/controllers/decorators/index.d.ts +1 -0
  198. package/controllers/decorators/index.js +1 -0
  199. package/controllers/decorators/index.js.map +1 -1
  200. package/controllers/decorators/transaction.decorator.d.ts +7 -0
  201. package/controllers/decorators/transaction.decorator.js +23 -0
  202. package/controllers/decorators/transaction.decorator.js.map +1 -0
  203. package/controllers/interfaces/controller-object.d.ts +1 -0
  204. package/controllers/interfaces/controller-options.d.ts +1 -0
  205. package/controllers/interfaces/controller-property.d.ts +9 -0
  206. package/controllers/services/default-action-builder.js +14 -0
  207. package/controllers/services/default-action-builder.js.map +1 -1
  208. package/controllers/services/restful-action-builder.js +25 -1
  209. package/controllers/services/restful-action-builder.js.map +1 -1
  210. package/core/contexts/request-context.d.ts +5 -0
  211. package/core/contexts/request-context.js +6 -0
  212. package/core/contexts/request-context.js.map +1 -0
  213. package/core/core.controller.d.ts +1 -0
  214. package/core/core.controller.js +15 -2
  215. package/core/core.controller.js.map +1 -1
  216. package/core/functions/create-interceptor.js +2 -2
  217. package/core/functions/create-interceptor.js.map +1 -1
  218. package/core/functions/resolve-action-transactional.d.ts +3 -0
  219. package/core/functions/resolve-action-transactional.js +10 -0
  220. package/core/functions/resolve-action-transactional.js.map +1 -0
  221. package/core/interfaces/action-def.d.ts +2 -5
  222. package/core/interfaces/action-docs.d.ts +15 -0
  223. package/core/interfaces/action-handle.d.ts +5 -0
  224. package/core/interfaces/action-handle.js +3 -0
  225. package/core/interfaces/action-handle.js.map +1 -0
  226. package/core/interfaces/core-options.d.ts +1 -0
  227. package/core/interfaces/interceptor.d.ts +1 -1
  228. package/core/interfaces/object.d.ts +3 -2
  229. package/core/interfaces/request-context.d.ts +7 -2
  230. package/core/services/request-executor.d.ts +8 -0
  231. package/core/services/request-executor.js +88 -0
  232. package/core/services/request-executor.js.map +1 -1
  233. package/core/services/request-router.js +5 -4
  234. package/core/services/request-router.js.map +1 -1
  235. package/database/database.controller.d.ts +1 -3
  236. package/database/database.controller.js +1 -5
  237. package/database/database.controller.js.map +1 -1
  238. package/database/decorators/entity.decorator.d.ts +3 -1
  239. package/database/decorators/entity.decorator.js +14 -5
  240. package/database/decorators/entity.decorator.js.map +1 -1
  241. package/database/decorators/external-column.decorator.d.ts +17 -0
  242. package/database/decorators/external-column.decorator.js +30 -0
  243. package/database/decorators/external-column.decorator.js.map +1 -0
  244. package/database/decorators/index.d.ts +1 -0
  245. package/database/decorators/index.js +1 -0
  246. package/database/decorators/index.js.map +1 -1
  247. package/database/decorators/protect-entity.decorator.d.ts +1 -0
  248. package/database/decorators/protect-entity.decorator.js +2 -3
  249. package/database/decorators/protect-entity.decorator.js.map +1 -1
  250. package/database/decorators/protected-entity.decorator.d.ts +1 -0
  251. package/database/decorators/protected-entity.decorator.js +2 -16
  252. package/database/decorators/protected-entity.decorator.js.map +1 -1
  253. package/database/decorators/relation.decorator.d.ts +2 -2
  254. package/database/decorators/relation.decorator.js.map +1 -1
  255. package/database/extensions/select-query-builder.d.ts +1 -5
  256. package/database/extensions/select-query-builder.js.map +1 -1
  257. package/database/functions/find-relation.d.ts +2 -1
  258. package/database/functions/find-relation.js +3 -3
  259. package/database/functions/find-relation.js.map +1 -1
  260. package/database/functions/generate-entity-id.d.ts +2 -0
  261. package/database/functions/{generate-id.js → generate-entity-id.js} +3 -3
  262. package/database/functions/generate-entity-id.js.map +1 -0
  263. package/database/functions/get-relations.d.ts +1 -1
  264. package/database/functions/inject-repository-handle.js +4 -3
  265. package/database/functions/inject-repository-handle.js.map +1 -1
  266. package/database/functions/use-transaction.d.ts +1 -0
  267. package/database/functions/use-transaction.js +2 -6
  268. package/database/functions/use-transaction.js.map +1 -1
  269. package/database/interfaces/entity-dto-object.d.ts +7 -0
  270. package/database/interfaces/entity-dto-object.js +3 -0
  271. package/database/interfaces/entity-dto-object.js.map +1 -0
  272. package/database/interfaces/entity-object.d.ts +0 -6
  273. package/database/interfaces/entity-property.d.ts +12 -0
  274. package/database/interfaces/index.d.ts +0 -1
  275. package/database/interfaces/index.js +0 -1
  276. package/database/interfaces/index.js.map +1 -1
  277. package/database/interfaces/path.d.ts +6 -2
  278. package/database/interfaces/repository.d.ts +8 -8
  279. package/database/interfaces/virtual-select.d.ts +4 -0
  280. package/database/interfaces/virtual-select.js +3 -0
  281. package/database/interfaces/virtual-select.js.map +1 -0
  282. package/database/services/repository.service.d.ts +1 -1
  283. package/database/services/repository.service.js +3 -6
  284. package/database/services/repository.service.js.map +1 -1
  285. package/docs/docs.module.js +3 -1
  286. package/docs/docs.module.js.map +1 -1
  287. package/docs/migrations/1747584000000-CreateDocsTables.d.ts +5 -0
  288. package/docs/migrations/1747584000000-CreateDocsTables.js +90 -0
  289. package/docs/migrations/1747584000000-CreateDocsTables.js.map +1 -0
  290. package/docs/migrations/migrations.d.ts +2 -0
  291. package/docs/migrations/migrations.js +8 -0
  292. package/docs/migrations/migrations.js.map +1 -0
  293. package/docs/queries/docs-controller-action.query.d.ts +1 -1
  294. package/docs/queries/docs-controller.query.d.ts +1 -1
  295. package/docs/queries/docs-model.query.d.ts +1 -1
  296. package/docs/queries/docs-model.query.js +1 -1
  297. package/docs/queries/docs-model.query.js.map +1 -1
  298. package/docs/queries/docs-version.query.d.ts +1 -1
  299. package/docs/services/docs-version.service.js +6 -3
  300. package/docs/services/docs-version.service.js.map +1 -1
  301. package/forms/queries/form.query.d.ts +1 -1
  302. package/forms/queries/property.query.d.ts +1 -1
  303. package/global.d.ts +2 -0
  304. package/global.js +2 -1
  305. package/global.js.map +1 -1
  306. package/http/http.controller.d.ts +2 -0
  307. package/http/http.controller.js +3 -2
  308. package/http/http.controller.js.map +1 -1
  309. package/index.d.ts +5 -2
  310. package/index.js +4 -7
  311. package/index.js.map +1 -1
  312. package/jobs/jobs.controller.d.ts +2 -0
  313. package/jobs/jobs.controller.js +22 -16
  314. package/jobs/jobs.controller.js.map +1 -1
  315. package/package.json +70 -69
  316. package/query/functions/add-join.js +8 -16
  317. package/query/functions/add-join.js.map +1 -1
  318. package/query/functions/collect-external-column-owners.d.ts +10 -0
  319. package/query/functions/collect-external-column-owners.js +100 -0
  320. package/query/functions/collect-external-column-owners.js.map +1 -0
  321. package/query/functions/create-query-builder.js +47 -28
  322. package/query/functions/create-query-builder.js.map +1 -1
  323. package/query/functions/create-query-cache-hash.d.ts +16 -0
  324. package/query/functions/create-query-cache-hash.js +70 -0
  325. package/query/functions/create-query-cache-hash.js.map +1 -0
  326. package/query/functions/create-query.d.ts +8 -3
  327. package/query/functions/create-query.js +12 -9
  328. package/query/functions/create-query.js.map +1 -1
  329. package/query/functions/describe-query-filter.js +3 -2
  330. package/query/functions/describe-query-filter.js.map +1 -1
  331. package/query/functions/execute-query.js +89 -9
  332. package/query/functions/execute-query.js.map +1 -1
  333. package/query/functions/expand-select-with-external-dependencies.d.ts +9 -0
  334. package/query/functions/expand-select-with-external-dependencies.js +34 -0
  335. package/query/functions/expand-select-with-external-dependencies.js.map +1 -0
  336. package/query/functions/external-column-owner-path.d.ts +5 -0
  337. package/query/functions/external-column-owner-path.js +18 -0
  338. package/query/functions/external-column-owner-path.js.map +1 -0
  339. package/query/functions/get-entity-object-class.d.ts +2 -0
  340. package/query/functions/get-entity-object-class.js +12 -0
  341. package/query/functions/get-entity-object-class.js.map +1 -0
  342. package/query/functions/get-native-select.js +3 -0
  343. package/query/functions/get-native-select.js.map +1 -1
  344. package/query/functions/load-properties.d.ts +20 -2
  345. package/query/functions/load-properties.js +190 -40
  346. package/query/functions/load-properties.js.map +1 -1
  347. package/query/functions/map-query-property-to-column-name.js +1 -1
  348. package/query/functions/map-query-property-to-column-name.js.map +1 -1
  349. package/query/functions/query-structure-cache.d.ts +24 -0
  350. package/query/functions/query-structure-cache.js +66 -0
  351. package/query/functions/query-structure-cache.js.map +1 -0
  352. package/query/interfaces/query.d.ts +44 -1
  353. package/query/services/query-action-builder.d.ts +4 -1
  354. package/query/services/query-action-builder.js +26 -12
  355. package/query/services/query-action-builder.js.map +1 -1
  356. package/remote-logs/dtos/index.d.ts +2 -0
  357. package/remote-logs/dtos/index.js +19 -0
  358. package/remote-logs/dtos/index.js.map +1 -0
  359. package/remote-logs/dtos/remote-log-hooks.dto.d.ts +72 -0
  360. package/remote-logs/dtos/remote-log-hooks.dto.js +280 -0
  361. package/remote-logs/dtos/remote-log-hooks.dto.js.map +1 -0
  362. package/remote-logs/dtos/remote-log-search.dto.d.ts +34 -0
  363. package/remote-logs/dtos/remote-log-search.dto.js +146 -0
  364. package/remote-logs/dtos/remote-log-search.dto.js.map +1 -0
  365. package/remote-logs/environment.d.ts +4 -0
  366. package/remote-logs/environment.js +5 -0
  367. package/remote-logs/environment.js.map +1 -0
  368. package/remote-logs/index.d.ts +3 -0
  369. package/remote-logs/index.js +20 -0
  370. package/remote-logs/index.js.map +1 -0
  371. package/remote-logs/interfaces/index.d.ts +1 -0
  372. package/remote-logs/interfaces/index.js +18 -0
  373. package/remote-logs/interfaces/index.js.map +1 -0
  374. package/remote-logs/interfaces/remote-logs-module-options.d.ts +8 -0
  375. package/remote-logs/interfaces/remote-logs-module-options.js +3 -0
  376. package/remote-logs/interfaces/remote-logs-module-options.js.map +1 -0
  377. package/remote-logs/remote-logs-hooks.controller.d.ts +60 -0
  378. package/remote-logs/remote-logs-hooks.controller.js +331 -0
  379. package/remote-logs/remote-logs-hooks.controller.js.map +1 -0
  380. package/remote-logs/remote-logs.controller.d.ts +8 -0
  381. package/remote-logs/remote-logs.controller.js +41 -0
  382. package/remote-logs/remote-logs.controller.js.map +1 -0
  383. package/remote-logs/remote-logs.module.d.ts +12 -0
  384. package/remote-logs/remote-logs.module.js +107 -0
  385. package/remote-logs/remote-logs.module.js.map +1 -0
  386. package/remote-logs/services/opensearch.service.d.ts +13 -0
  387. package/remote-logs/services/opensearch.service.js +167 -0
  388. package/remote-logs/services/opensearch.service.js.map +1 -0
  389. package/security/auth.controller.js +4 -4
  390. package/security/auth.controller.js.map +1 -1
  391. package/security/env.js.map +1 -1
  392. package/security/functions/add-protected.d.ts +2 -2
  393. package/security/functions/add-protected.js +8 -5
  394. package/security/functions/add-protected.js.map +1 -1
  395. package/security/functions/create-authentication-interceptor.d.ts +44 -0
  396. package/security/functions/create-authentication-interceptor.js +114 -0
  397. package/security/functions/create-authentication-interceptor.js.map +1 -0
  398. package/security/functions/find-auth-context.d.ts +1 -2
  399. package/security/functions/find-auth-context.js +6 -11
  400. package/security/functions/find-auth-context.js.map +1 -1
  401. package/security/index.d.ts +1 -0
  402. package/security/index.js +1 -0
  403. package/security/index.js.map +1 -1
  404. package/security/interfaces/authorization-schema.d.ts +3 -1
  405. package/security/requests/security.request.js +1 -1
  406. package/security/requests/security.request.js.map +1 -1
  407. package/security/services/authorization.service.d.ts +5 -3
  408. package/security/services/authorization.service.js +56 -37
  409. package/security/services/authorization.service.js.map +1 -1
  410. package/storage/services/routes.service.js +1 -1
  411. package/storage/services/routes.service.js.map +1 -1
  412. package/tasks/constants.d.ts +3 -0
  413. package/tasks/constants.js +2 -1
  414. package/tasks/constants.js.map +1 -1
  415. package/tasks/controllers/task.controller.d.ts +3 -2
  416. package/tasks/controllers/task.controller.js +11 -40
  417. package/tasks/controllers/task.controller.js.map +1 -1
  418. package/tasks/decorators/index.d.ts +1 -0
  419. package/tasks/decorators/index.js +1 -0
  420. package/tasks/decorators/index.js.map +1 -1
  421. package/tasks/decorators/task-payload.decorator.d.ts +1 -0
  422. package/tasks/decorators/task-payload.decorator.js +12 -0
  423. package/tasks/decorators/task-payload.decorator.js.map +1 -0
  424. package/tasks/decorators/task.decorator.js +6 -2
  425. package/tasks/decorators/task.decorator.js.map +1 -1
  426. package/tasks/functions/compile-all-task-post-hooks.d.ts +1 -0
  427. package/tasks/functions/compile-all-task-post-hooks.js +27 -0
  428. package/tasks/functions/compile-all-task-post-hooks.js.map +1 -0
  429. package/tasks/functions/compile-task-hook-handle.d.ts +6 -0
  430. package/tasks/functions/compile-task-hook-handle.js +67 -0
  431. package/tasks/functions/compile-task-hook-handle.js.map +1 -0
  432. package/tasks/functions/create-task-hook.d.ts +9 -0
  433. package/tasks/functions/create-task-hook.js +13 -0
  434. package/tasks/functions/create-task-hook.js.map +1 -0
  435. package/tasks/functions/{create-task-message-receptor.d.ts → create-task-message-post.d.ts} +1 -1
  436. package/tasks/functions/{create-task-message-receptor.js → create-task-message-post.js} +10 -3
  437. package/tasks/functions/create-task-message-post.js.map +1 -0
  438. package/tasks/functions/register-task-post-hook-interceptors.d.ts +3 -0
  439. package/tasks/functions/register-task-post-hook-interceptors.js +86 -0
  440. package/tasks/functions/register-task-post-hook-interceptors.js.map +1 -0
  441. package/tasks/functions/run-task-post-hooks.d.ts +11 -0
  442. package/tasks/functions/run-task-post-hooks.js +18 -0
  443. package/tasks/functions/run-task-post-hooks.js.map +1 -0
  444. package/tasks/functions/task-message-operations.d.ts +18 -0
  445. package/tasks/functions/task-message-operations.js +100 -0
  446. package/tasks/functions/task-message-operations.js.map +1 -0
  447. package/tasks/functions/validate-task-payload.d.ts +2 -0
  448. package/tasks/functions/validate-task-payload.js +19 -0
  449. package/tasks/functions/validate-task-payload.js.map +1 -0
  450. package/tasks/hook-constants.d.ts +2 -0
  451. package/tasks/hook-constants.js +6 -0
  452. package/tasks/hook-constants.js.map +1 -0
  453. package/tasks/index.d.ts +3 -0
  454. package/tasks/index.js +3 -0
  455. package/tasks/index.js.map +1 -1
  456. package/tasks/interfaces/compiled-task-post-hooks.d.ts +17 -0
  457. package/tasks/interfaces/compiled-task-post-hooks.js +3 -0
  458. package/tasks/interfaces/compiled-task-post-hooks.js.map +1 -0
  459. package/tasks/interfaces/index.d.ts +3 -0
  460. package/tasks/interfaces/index.js +3 -0
  461. package/tasks/interfaces/index.js.map +1 -1
  462. package/tasks/interfaces/task-hook.d.ts +16 -0
  463. package/tasks/interfaces/task-hook.js +8 -0
  464. package/tasks/interfaces/task-hook.js.map +1 -0
  465. package/tasks/interfaces/task-object.d.ts +6 -2
  466. package/tasks/interfaces/task-post-hook.d.ts +2 -0
  467. package/tasks/interfaces/task-post-hook.js +3 -0
  468. package/tasks/interfaces/task-post-hook.js.map +1 -0
  469. package/tasks/interfaces/task-post-intercept.d.ts +1 -8
  470. package/tasks/interfaces/task-runner.d.ts +2 -1
  471. package/tasks/interfaces/task-settings.d.ts +7 -0
  472. package/tasks/services/task-runner.service.d.ts +24 -3
  473. package/tasks/services/task-runner.service.js +68 -28
  474. package/tasks/services/task-runner.service.js.map +1 -1
  475. package/translations/controllers/translation.controller.js +12 -9
  476. package/translations/controllers/translation.controller.js.map +1 -1
  477. package/translations/functions/create-translation-values.js +2 -5
  478. package/translations/functions/create-translation-values.js.map +1 -1
  479. package/translations/migrations/1723760669185-CreateTranslationTables.js +3 -3
  480. package/translations/migrations/1723760669185-CreateTranslationTables.js.map +1 -1
  481. package/translations/queries/translation-config.query.d.ts +1 -1
  482. package/translations/queries/translation-values.query.d.ts +1 -1
  483. package/translations/queries/translation-values.query.js +1 -1
  484. package/translations/queries/translation-values.query.js.map +1 -1
  485. package/translations/translations.controller.d.ts +1 -1
  486. package/translations/translations.controller.js +4 -4
  487. package/translations/translations.controller.js.map +1 -1
  488. package/database/functions/generate-id.d.ts +0 -2
  489. package/database/functions/generate-id.js.map +0 -1
  490. package/database/functions/use-protector.d.ts +0 -2
  491. package/database/functions/use-protector.js +0 -11
  492. package/database/functions/use-protector.js.map +0 -1
  493. package/database/interfaces/protector.d.ts +0 -51
  494. package/database/interfaces/protector.js.map +0 -1
  495. package/database/services/protect-builder.d.ts +0 -59
  496. package/database/services/protect-builder.js +0 -524
  497. package/database/services/protect-builder.js.map +0 -1
  498. package/security/functions/add-protect.d.ts +0 -2
  499. package/security/functions/add-protect.js +0 -11
  500. package/security/functions/add-protect.js.map +0 -1
  501. package/tasks/functions/create-task-message-receptor.js.map +0 -1
@@ -1,4 +1,6 @@
1
1
  import { GetTypeCallback } from "@rockster/common";
2
+ import { TaskPostHook } from "./task-post-hook";
3
+ import { TaskPostIntercept } from "./task-post-intercept";
2
4
  export interface ITaskSettings<T> {
3
5
  /**Executor for any message */
4
6
  input: GetTypeCallback;
@@ -12,4 +14,9 @@ export interface ITaskSettings<T> {
12
14
  retentionDays?: number;
13
15
  /**limit: 100. Indicates how many messages the runner will recieve to proccess*/
14
16
  messagesLimit?: number;
17
+ /**
18
+ * @deprecated Use `postHooks` instead.
19
+ */
20
+ postInterceptors?: TaskPostIntercept[];
21
+ postHooks?: TaskPostHook[];
15
22
  }
@@ -9,15 +9,36 @@ type TaskRunner = {
9
9
  runner: ITaskRunner<any>;
10
10
  repository: Repository<ITaskMessage>;
11
11
  };
12
+ /**
13
+ * Worker-side task dispatcher: claims pending rows with `SKIP LOCKED`, runs runners concurrently
14
+ * up to {@link TaskRunnerService.maxConcurrentTaskMessages}, without blocking the poll interval on
15
+ * long-running `onRun` handlers.
16
+ */
12
17
  export declare class TaskRunnerService {
13
- private static running;
18
+ /**
19
+ * Max concurrent task **messages** being executed at once (per worker thread / process).
20
+ * Tune here if workloads need more / less parallelism.
21
+ */
22
+ static readonly maxConcurrentTaskMessages = 50;
23
+ /** @deprecated Reserved for future graceful shutdown hooks; not read by the runner today. */
14
24
  private static done;
15
25
  tasks: TaskRunner[];
26
+ /** Messages currently in `onRun` or DB update after run (best-effort counter). */
27
+ private inFlightCount;
28
+ /** Serializes {@link fillPool} so two ticks cannot claim overlapping capacity. */
29
+ private drainChain;
16
30
  activeTimer(): void;
17
31
  constructor();
32
+ /** How many task messages are executing right now (0 … {@link maxConcurrentTaskMessages}). */
33
+ getConcurrentInFlight(): number;
18
34
  startRunner(object: ObjectNote<ITaskObject>): Promise<void>;
19
- protected processMessages(): Promise<void>;
20
- protected eachMessage(task: TaskRunner, message: TaskMessage<any>): Promise<void>;
35
+ protected scheduleFillPool(): void;
36
+ /**
37
+ * Claims pending messages up to remaining global capacity and **starts** them without awaiting
38
+ * completion (each execution decrements {@link inFlightCount} in `finally`).
39
+ */
40
+ protected fillPool(): Promise<void>;
41
+ protected executeTaskMessage(task: TaskRunner, message: TaskMessage<any>): Promise<void>;
21
42
  protected mapMessage(row: any): TaskMessage<any>;
22
43
  }
23
44
  export {};
@@ -15,13 +15,28 @@ const get_pending_task_script_1 = require("../functions/get-pending-task-script"
15
15
  const use_repository_1 = require("../../database/functions/use-repository");
16
16
  const tasks_1 = require("@rockster/common/tasks");
17
17
  const class_injector_1 = require("@rockster/class-injector");
18
+ /**
19
+ * Worker-side task dispatcher: claims pending rows with `SKIP LOCKED`, runs runners concurrently
20
+ * up to {@link TaskRunnerService.maxConcurrentTaskMessages}, without blocking the poll interval on
21
+ * long-running `onRun` handlers.
22
+ */
18
23
  let TaskRunnerService = TaskRunnerService_1 = class TaskRunnerService {
19
24
  activeTimer() {
20
25
  TaskRunnerService_1.done = true;
21
26
  }
22
27
  constructor() {
23
28
  this.tasks = [];
24
- setInterval(() => this.processMessages(), 500);
29
+ /** Messages currently in `onRun` or DB update after run (best-effort counter). */
30
+ this.inFlightCount = 0;
31
+ /** Serializes {@link fillPool} so two ticks cannot claim overlapping capacity. */
32
+ this.drainChain = Promise.resolve();
33
+ setInterval(() => {
34
+ this.scheduleFillPool();
35
+ }, 500);
36
+ }
37
+ /** How many task messages are executing right now (0 … {@link maxConcurrentTaskMessages}). */
38
+ getConcurrentInFlight() {
39
+ return this.inFlightCount;
25
40
  }
26
41
  async startRunner(object) {
27
42
  const runner = await (0, class_injector_1.createInstance)(object.objectClass);
@@ -29,57 +44,77 @@ let TaskRunnerService = TaskRunnerService_1 = class TaskRunnerService {
29
44
  this.tasks.push({
30
45
  object: object,
31
46
  runner: runner,
32
- repository: repository
47
+ repository: repository,
33
48
  });
34
49
  }
35
- async processMessages() {
36
- try {
37
- if (TaskRunnerService_1.running)
38
- return;
39
- TaskRunnerService_1.running = true;
40
- for (const task of this.tasks) {
41
- const query = (0, get_pending_task_script_1.getPendingTaskScript)(task.object.naming, core.workerId);
42
- const messages = (await task.repository.query(query))[0];
43
- await Promise.all(messages.map((message) => this.eachMessage(task, this.mapMessage(message))));
50
+ scheduleFillPool() {
51
+ this.drainChain = this.drainChain
52
+ .then(() => this.fillPool())
53
+ .catch(() => {
54
+ // Swallow: next interval will retry; avoid breaking the chain.
55
+ });
56
+ }
57
+ /**
58
+ * Claims pending messages up to remaining global capacity and **starts** them without awaiting
59
+ * completion (each execution decrements {@link inFlightCount} in `finally`).
60
+ */
61
+ async fillPool() {
62
+ const max = TaskRunnerService_1.maxConcurrentTaskMessages;
63
+ for (const task of this.tasks) {
64
+ while (this.inFlightCount < max) {
65
+ const room = max - this.inFlightCount;
66
+ const query = (0, get_pending_task_script_1.getPendingTaskScript)(task.object.naming, core.workerId, room);
67
+ const rows = (await task.repository.query(query))[0];
68
+ const rawMessages = Array.isArray(rows) ? rows : [];
69
+ if (rawMessages.length === 0) {
70
+ break;
71
+ }
72
+ for (const row of rawMessages) {
73
+ const message = this.mapMessage(row);
74
+ this.inFlightCount++;
75
+ void this.executeTaskMessage(task, message).finally(() => {
76
+ this.inFlightCount--;
77
+ });
78
+ }
44
79
  }
45
- TaskRunnerService_1.running = false;
46
- }
47
- catch (error) {
48
- TaskRunnerService_1.running = false;
49
80
  }
50
81
  }
51
- async eachMessage(task, message) {
82
+ async executeTaskMessage(task, message) {
52
83
  const stopwatch = getTimer();
53
84
  try {
54
85
  stopwatch.start();
55
- await task
56
- .runner
57
- .onRun({
58
- message: message.payload
86
+ await task.runner.onRun({
87
+ message: message,
59
88
  });
60
89
  await task.repository.update({
61
90
  id: message.id,
62
- partitionId: message.partitionId
91
+ partitionId: message.partitionId,
63
92
  }, {
64
93
  status: tasks_1.TaskMessageStatus.completed,
65
94
  lastModifiedAt: new Date(),
66
- runtimeMs: stopwatch.stop()
95
+ runtimeMs: stopwatch.stop(),
96
+ payload: message.payload,
67
97
  });
68
98
  }
69
99
  catch (error) {
70
100
  const taskError = error;
71
- taskError.infos = getErrorInfos(error).message;
72
- const isExpose = error.constructor.name !== 'Error';
101
+ const { message: errorDetail } = getErrorInfos(error);
102
+ taskError.infos = errorDetail;
103
+ if (errorDetail?.trim()) {
104
+ taskError.message = errorDetail.trim().split("\n")[0].trim();
105
+ }
106
+ const isExpose = error.constructor.name !== "Error";
73
107
  await task.repository.update({
74
108
  id: message.id,
75
- partitionId: message.partitionId
109
+ partitionId: message.partitionId,
76
110
  }, {
77
111
  status: tasks_1.TaskMessageStatus.failed,
78
112
  lastModifiedAt: new Date(),
79
113
  attempts: message.attempts + 1,
80
114
  runtimeMs: stopwatch.stop(),
81
115
  internalError: taskError,
82
- error: isExpose ? taskError : null
116
+ error: isExpose ? taskError : null,
117
+ payload: message.payload,
83
118
  });
84
119
  }
85
120
  }
@@ -94,12 +129,17 @@ let TaskRunnerService = TaskRunnerService_1 = class TaskRunnerService {
94
129
  error: row.error,
95
130
  internalError: row.internal_error,
96
131
  payload: row.payload,
97
- runtimeMs: row.runtime_ms
132
+ runtimeMs: row.runtime_ms,
98
133
  };
99
134
  }
100
135
  };
101
136
  exports.TaskRunnerService = TaskRunnerService;
102
- TaskRunnerService.running = false;
137
+ /**
138
+ * Max concurrent task **messages** being executed at once (per worker thread / process).
139
+ * Tune here if workloads need more / less parallelism.
140
+ */
141
+ TaskRunnerService.maxConcurrentTaskMessages = 50;
142
+ /** @deprecated Reserved for future graceful shutdown hooks; not read by the runner today. */
103
143
  TaskRunnerService.done = false;
104
144
  exports.TaskRunnerService = TaskRunnerService = TaskRunnerService_1 = __decorate([
105
145
  (0, class_injector_1.Injectable)(),
@@ -1 +1 @@
1
- {"version":3,"file":"task-runner.service.js","sourceRoot":"./","sources":["tasks/services/task-runner.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAGA,kFAA4E;AAE5E,4EAAwE;AACxE,kDAIgC;AAChC,6DAGkC;AAU3B,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAM3B,WAAW;QACR,mBAAiB,CAAC,IAAI,GAAG,IAAI,CAAC;IACjC,CAAC;IAED;QANA,UAAK,GAAG,EAAkB,CAAC;QAOxB,WAAW,CAAC,GAAG,EAAE,CAAC,IA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AW,CAAC,IAAI,KAAK,OAAO,CAAC;YACpD,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB;gBACG,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,WAAW,EAAE,OAAO,CAAC,WAAW;aAClC,EACD;gBACG,MAAM,EAAE,yBAAiB,CAAC,MAAM;gBAChC,cAAc,EAAE,IAAI,IAAI,EAAE;gBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,CAAC;gBAC9B,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE;gBAC3B,aAAa,EAAE,SAAS;gBACxB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;gBAClC,OAAO,EAAE,OAAO,CAAC,OAAO;aAC1B,CACH,CAAC;QACL,CAAC;IACJ,CAAC;IAES,UAAU,CAAC,GAAG;QACrB,OAAO;YACJ,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,WAAW,EAAE,GAAG,CAAC,YAAY;YAC7B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,SAAS,EAAE,GAAG,CAAC,UAAU;YACzB,cAAc,EAAE,GAAG,CAAC,gBAAgB;YACpC,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,aAAa,EAAE,GAAG,CAAC,cAAc;YACjC,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,SAAS,EAAE,GAAG,CAAC,UAAU;SAC3B,CAAC;IACL,CAAC;;AA/IS,8CAAiB;AAC3B;;;GAGG;AACoB,2CAAyB,GAAG,EAAE,AAAL,CAAM;AAEtD,6FAA6F;AAC9E,sBAAI,GAAG,KAAK,AAAR,CAAS;4BARlB,iBAAiB;IAD7B,IAAA,2BAAU,GAAE;;GACA,iBAAiB,CAgJ7B"}
@@ -23,8 +23,11 @@ const get_values_request_1 = require("../models/get-values.request");
23
23
  const get_values_response_1 = require("../models/get-values.response");
24
24
  const translations_service_1 = require("../services/translations.service");
25
25
  const translation_values_entity_1 = require("../entities/translation-values.entity");
26
- const decorators_2 = require("../../command/decorators");
27
- const controllers_1 = require("../../controllers");
26
+ const controller_decorator_1 = require("../../controllers/decorators/controller.decorator");
27
+ const post_action_decorator_1 = require("../../command/decorators/post-action.decorator");
28
+ const post_content_decorator_1 = require("../../command/decorators/post-content.decorator");
29
+ const action_content_decorator_1 = require("../../controllers/decorators/actions/action-content.decorator");
30
+ const action_decorator_1 = require("../../controllers/decorators/actions/action.decorator");
28
31
  let TranslationController = class TranslationController {
29
32
  constructor(translationsService) {
30
33
  this.translationsService = translationsService;
@@ -52,19 +55,19 @@ let TranslationController = class TranslationController {
52
55
  };
53
56
  exports.TranslationController = TranslationController;
54
57
  __decorate([
55
- (0, decorators_2.PostAction)({
58
+ (0, post_action_decorator_1.PostAction)({
56
59
  type: () => translation_config_entity_1.TranslationConfig
57
60
  }),
58
- __param(0, (0, decorators_2.PostContent)()),
61
+ __param(0, (0, post_content_decorator_1.PostContent)()),
59
62
  __metadata("design:type", Function),
60
63
  __metadata("design:paramtypes", [Object]),
61
64
  __metadata("design:returntype", Promise)
62
65
  ], TranslationController.prototype, "postConfig", null);
63
66
  __decorate([
64
- (0, decorators_2.PostAction)({
67
+ (0, post_action_decorator_1.PostAction)({
65
68
  type: () => translation_values_entity_1.TranslationValues
66
69
  }),
67
- __param(0, (0, decorators_2.PostContent)()),
70
+ __param(0, (0, post_content_decorator_1.PostContent)()),
68
71
  __metadata("design:type", Function),
69
72
  __metadata("design:paramtypes", [Object]),
70
73
  __metadata("design:returntype", Promise)
@@ -84,17 +87,17 @@ __decorate([
84
87
  __metadata("design:returntype", Promise)
85
88
  ], TranslationController.prototype, "queryValues", null);
86
89
  __decorate([
87
- (0, controllers_1.Action)({
90
+ (0, action_decorator_1.Action)({
88
91
  response: () => get_values_response_1.GetValuesResponse,
89
92
  public: true
90
93
  }),
91
- __param(0, (0, controllers_1.ActionContent)()),
94
+ __param(0, (0, action_content_decorator_1.ActionContent)()),
92
95
  __metadata("design:type", Function),
93
96
  __metadata("design:paramtypes", [get_values_request_1.GetValuesRequest]),
94
97
  __metadata("design:returntype", Promise)
95
98
  ], TranslationController.prototype, "getValues", null);
96
99
  exports.TranslationController = TranslationController = __decorate([
97
- (0, controllers_1.Controller)(),
100
+ (0, controller_decorator_1.Controller)(),
98
101
  __metadata("design:paramtypes", [translations_service_1.TranslationsService])
99
102
  ], TranslationController);
100
103
  //# sourceMappingURL=translation.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"translation.controller.js","sourceRoot":"./","sources":["translations/controllers/translation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,qFAA0E;AAC1E,uEAAmE;AAEnE,kFAA6E;AAE7E,uDAAsD;AACtD,kFAA6E;AAC7E,uEAAmE;AACnE,qEAAgE;AAChE,uEAAkE;AAClE,2EAAuE;AAEvE,qFAA0E;AAC1E,yDAGkC;AAClC,mDAI2B;AAGpB,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAE/B,YACsB,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAC3D,CAAC;IAKE,AAAN,KAAK,CAAC,UAAU,CACE,OAAwC;QAEvD,OAAO,IAAA,0BAAW,EAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAKK,AAAN,KAAK,CAAC,UAAU,CACE,OAAyC;QAExD,OAAO,IAAA,0BAAW,EAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CACE,OAAyC;QAEzD,OAAO,IAAA,4BAAY,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CACE,OAAyC;QAEzD,OAAO,IAAA,4BAAY,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAMK,AAAN,KAAK,CAAC,SAAS,CACK,OAAyB;QAE1C,MAAM,MAAM,GAAG,MAAM,IAAI;aACrB,mBAAmB;aACnB,SAAS,CACP,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,MAAM,CAChB,CAAC;QAEL,OAAO;YACJ,MAAM,EAAE,MAAM;SACK,CAAC;IAC1B,CAAC;CACH,CAAA;AAxDY,sDAAqB;AASzB;IAHL,IAAA,uBAAU,EAAC;QACT,IAAI,EAAE,GAAG,EAAE,CAAC,6CAAiB;KAC/B,CAAC;IAEE,WAAA,IAAA,wBAAW,GAAE,CAAA;;;;uDAGhB;AAKK;IAHL,IAAA,uBAAU,EAAC;QACT,IAAI,EAAE,GAAG,EAAE,CAAC,6CAAiB;KAC/B,CAAC;IAEE,WAAA,IAAA,wBAAW,GAAE,CAAA;;;;uDAGhB;AAGK;IADL,IAAA,iDAAsB,GAAE;IAErB,WAAA,IAAA,yBAAY,GAAE,CAAA;;;;wDAGjB;AAGK;IADL,IAAA,iDAAsB,GAAE;IAErB,WAAA,IAAA,yBAAY,GAAE,CAAA;;;;wDAGjB;AAMK;IAJL,IAAA,oBAAM,EAAC;QACL,QAAQ,EAAE,GAAG,EAAE,CAAC,uCAAiB;QACjC,MAAM,EAAE,IAAI;KACd,CAAC;IAEE,WAAA,IAAA,2BAAa,GAAE,CAAA;;qCAAU,qCAAgB;;sDAY5C;gCAvDS,qBAAqB;IADjC,IAAA,wBAAU,GAAE;qCAIiC,0CAAmB;GAHpD,qBAAqB,CAwDjC"}
1
+ {"version":3,"file":"translation.controller.js","sourceRoot":"./","sources":["translations/controllers/translation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,qFAA0E;AAC1E,uEAAmE;AACnE,kFAA6E;AAE7E,uDAAsD;AACtD,kFAA6E;AAC7E,uEAAmE;AACnE,qEAAgE;AAChE,uEAAkE;AAClE,2EAAuE;AAEvE,qFAA0E;AAC1E,4FAA+E;AAC/E,0FAA4E;AAC5E,4FAA8E;AAC9E,4GAA8F;AAC9F,4FAA+E;AAGxE,IAAM,qBA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,GAAE,CAAA;;;;wDAGjB;AAMK;IAJL,IAAA,yBAAM,EAAC;QACL,QAAQ,EAAE,GAAG,EAAE,CAAC,uCAAiB;QACjC,MAAM,EAAE,IAAI;KACd,CAAC;IAEE,WAAA,IAAA,wCAAa,GAAE,CAAA;;qCAAU,qCAAgB;;sDAY5C;gCAvDS,qBAAqB;IADjC,IAAA,iCAAU,GAAE;qCAIiC,0CAAmB;GAHpD,qBAAqB,CAwDjC"}
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.createTranslationValues = void 0;
7
4
  const transaction_context_1 = require("../../database/contexts/transaction-context");
8
- const generate_id_1 = __importDefault(require("../../database/functions/generate-id"));
5
+ const generate_entity_id_1 = require("../../database/functions/generate-entity-id");
9
6
  const use_repository_1 = require("../../database/functions/use-repository");
10
7
  const translation_values_entity_1 = require("../entities/translation-values.entity");
11
8
  const check_can_use_1 = require("./check-can-use");
@@ -16,7 +13,7 @@ const createTranslationValues = async (values) => {
16
13
  const repository = entityManager
17
14
  ? entityManager.getRepository(translation_values_entity_1.TranslationValues)
18
15
  : (0, use_repository_1.useRepository)(translation_values_entity_1.TranslationValues);
19
- (0, generate_id_1.default)(repository.target, values);
16
+ values.id = (0, generate_entity_id_1.generateEntityId)(translation_values_entity_1.TranslationValues, values);
20
17
  return repository.save(values);
21
18
  };
22
19
  exports.createTranslationValues = createTranslationValues;
@@ -1 +1 @@
1
- {"version":3,"file":"create-translation-values.js","sourceRoot":"./","sources":["translations/functions/create-translation-values.ts"],"names":[],"mappings":";;;;;;AAAA,qFAAsF;AACtF,uFAA8D;AAC9D,4EAAwE;AACxE,qFAA0E;AAE1E,mDAA8C;AAEvC,MAAM,uBAAuB,GAAG,KAAK,EACzC,MAAsC,EACvC,EAAE;IACD,IAAA,2BAAW,GAAE,CAAC;IACd,MAAM,kBAAkB,GAAG,6CAAuB,CAAC,QAAQ,EAAE,CAAC;IAC9D,MAAM,aAAa,GAAG,kBAAkB,EAAE,aAAa,CAAC;IACxD,MAAM,UAAU,GAAG,aAAa;QAC7B,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,6CAAiB,CAAC;QAChD,CAAC,CAAC,IAAA,8BAAa,EAAC,6CAAiB,CAAC,CAAC;IACtC,IAAA,qBAAU,EAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC,CAAA;AAXY,QAAA,uBAAuB,2BAWnC"}
1
+ {"version":3,"file":"create-translation-values.js","sourceRoot":"./","sources":["translations/functions/create-translation-values.ts"],"names":[],"mappings":";;;AAAA,qFAAsF;AACtF,oFAA+E;AAC/E,4EAAwE;AACxE,qFAA0E;AAE1E,mDAA8C;AAEvC,MAAM,uBAAuB,GAAG,KAAK,EACzC,MAAsC,EACvC,EAAE;IACD,IAAA,2BAAW,GAAE,CAAC;IACd,MAAM,kBAAkB,GAAG,6CAAuB,CAAC,QAAQ,EAAE,CAAC;IAC9D,MAAM,aAAa,GAAG,kBAAkB,EAAE,aAAa,CAAC;IACxD,MAAM,UAAU,GAAG,aAAa;QAC7B,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,6CAAiB,CAAC;QAChD,CAAC,CAAC,IAAA,8BAAa,EAAC,6CAAiB,CAAC,CAAC;IACrC,MAA6B,CAAC,EAAE,GAAG,IAAA,qCAAgB,EAAC,6CAAiB,EAAE,MAAM,CAAC,CAAC;IAChF,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC,CAAA;AAXY,QAAA,uBAAuB,2BAWnC"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateTranslationTables1723760669185 = void 0;
4
- const database_1 = require("../../database");
4
+ const execute_if_not_exists_table_1 = require("../../database/functions/execute-if-not-exists-table");
5
5
  class CreateTranslationTables1723760669185 {
6
6
  async up(queryRunner) {
7
- await (0, database_1.executeIfNotExistsTable)('translation_config', queryRunner, async () => {
7
+ await (0, execute_if_not_exists_table_1.executeIfNotExistsTable)('translation_config', queryRunner, async () => {
8
8
  await queryRunner.query(`
9
9
  create table translation_config
10
10
  (
@@ -20,7 +20,7 @@ class CreateTranslationTables1723760669185 {
20
20
  on translation_config (reference_id);
21
21
  `);
22
22
  });
23
- await (0, database_1.executeIfNotExistsTable)('translation_values', queryRunner, async () => {
23
+ await (0, execute_if_not_exists_table_1.executeIfNotExistsTable)('translation_values', queryRunner, async () => {
24
24
  await queryRunner.query(`
25
25
  create table translation_values
26
26
  (
@@ -1 +1 @@
1
- {"version":3,"file":"1723760669185-CreateTranslationTables.js","sourceRoot":"./","sources":["translations/migrations/1723760669185-CreateTranslationTables.ts"],"names":[],"mappings":";;;AAIA,6CAAyD;AAEzD,MAAa,oCAAoC;IAEvC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACrC,MAAM,IAAA,kCAAuB,EAC1B,oBAAoB,EACpB,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;aAavB,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;QACN,MAAM,IAAA,kCAAuB,EAC1B,oBAAoB,EACpB,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;aAWvB,CAAC,CAAC;QACN,CAAC,CACH,CAAA;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACpE,MAAM,WAAW,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;IACvE,CAAC;CACH;AA9CD,oFA8CC"}
1
+ {"version":3,"file":"1723760669185-CreateTranslationTables.js","sourceRoot":"./","sources":["translations/migrations/1723760669185-CreateTranslationTables.ts"],"names":[],"mappings":";;;AACA,sGAA+F;AAE/F,MAAa,oCAAoC;IAEvC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACrC,MAAM,IAAA,qDAAuB,EAC1B,oBAAoB,EACpB,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;aAavB,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;QACN,MAAM,IAAA,qDAAuB,EAC1B,oBAAoB,EACpB,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;aAWvB,CAAC,CAAC;QACN,CAAC,CACH,CAAA;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACpE,MAAM,WAAW,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;IACvE,CAAC;CACH;AA9CD,oFA8CC"}
@@ -1 +1 @@
1
- export declare const TranslationConfigQuery: (options?: import("../..").QueryActionOptions) => (target: any, propertyKey: string) => void;
1
+ export declare const TranslationConfigQuery: import("../../query/functions/create-query").QueryDecoratorFactory;
@@ -1 +1 @@
1
- export declare const TranslationValuesQuery: (options?: import("../..").QueryActionOptions) => (target: any, propertyKey: string) => void;
1
+ export declare const TranslationValuesQuery: import("../../query/functions/create-query").QueryDecoratorFactory;
@@ -8,7 +8,7 @@ exports.TranslationValuesQuery = (0, create_query_1.createQuery)({
8
8
  alias: 'translationValues',
9
9
  target: () => translation_values_entity_1.TranslationValues,
10
10
  paths: {
11
- translationConfig: (0, create_query_1.directPath)({
11
+ translationConfig: (0, create_query_1.joinOne)({
12
12
  alias: 'translationConfig',
13
13
  target: () => translation_config_entity_1.TranslationConfig
14
14
  })
@@ -1 +1 @@
1
- {"version":3,"file":"translation-values.query.js","sourceRoot":"./","sources":["translations/queries/translation-values.query.ts"],"names":[],"mappings":";;;AAAA,qEAG4C;AAC5C,qFAA0E;AAC1E,qFAA0E;AAE7D,QAAA,sBAAsB,GAAG,IAAA,0BAAW,EAAC;IAC/C,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,6CAAiB;IAC/B,KAAK,EAAE;QACJ,iBAAiB,EAAE,IAAA,yBAAU,EAAC;YAC3B,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,6CAAiB;SACjC,CAAC;KACJ;CACH,CAAC,CAAA"}
1
+ {"version":3,"file":"translation-values.query.js","sourceRoot":"./","sources":["translations/queries/translation-values.query.ts"],"names":[],"mappings":";;;AAAA,qEAG4C;AAC5C,qFAA0E;AAC1E,qFAA0E;AAE7D,QAAA,sBAAsB,GAAG,IAAA,0BAAW,EAAC;IAC/C,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,6CAAiB;IAC/B,KAAK,EAAE;QACJ,iBAAiB,EAAE,IAAA,sBAAO,EAAC;YACxB,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,6CAAiB;SACjC,CAAC;KACJ;CACH,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
- import { DatabaseController } from "../database";
2
1
  import { Logger } from "@rockster/logger";
2
+ import { DatabaseController } from "../database/database.controller";
3
3
  export declare class TranslationsController {
4
4
  protected databaseController: DatabaseController;
5
5
  protected logger: Logger;
@@ -11,14 +11,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TranslationsController = void 0;
13
13
  const class_injector_1 = require("@rockster/class-injector");
14
- const database_1 = require("../database");
15
14
  const logger_1 = require("@rockster/logger");
16
15
  const translation_config_entity_1 = require("./entities/translation-config.entity");
17
16
  const translation_values_entity_1 = require("./entities/translation-values.entity");
18
17
  const translation_controller_1 = require("./controllers/translation.controller");
19
18
  const _1723760669185_CreateTranslationTables_1 = require("./migrations/1723760669185-CreateTranslationTables");
20
19
  const env_1 = require("./env");
21
- const module_1 = require("../module");
20
+ const database_controller_1 = require("../database/database.controller");
21
+ const module_controller_1 = require("../module/module.controller");
22
22
  let TranslationsController = class TranslationsController {
23
23
  constructor(databaseController) {
24
24
  this.databaseController = databaseController;
@@ -42,7 +42,7 @@ let TranslationsController = class TranslationsController {
42
42
  await this
43
43
  .databaseController
44
44
  .addMigrations([_1723760669185_CreateTranslationTables_1.CreateTranslationTables1723760669185]);
45
- await module_1.ModuleController
45
+ await module_controller_1.ModuleController
46
46
  .instance
47
47
  .loadRequests([translation_controller_1.TranslationController]);
48
48
  this.logger.log('Enabled');
@@ -51,6 +51,6 @@ let TranslationsController = class TranslationsController {
51
51
  exports.TranslationsController = TranslationsController;
52
52
  exports.TranslationsController = TranslationsController = __decorate([
53
53
  (0, class_injector_1.Injectable)(),
54
- __metadata("design:paramtypes", [database_1.DatabaseController])
54
+ __metadata("design:paramtypes", [database_controller_1.DatabaseController])
55
55
  ], TranslationsController);
56
56
  //# sourceMappingURL=translations.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"translations.controller.js","sourceRoot":"./","sources":["translations/translations.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAsD;AACtD,0CAAiD;AACjD,6CAA0C;AAC1C,oFAAyE;AACzE,oFAAyE;AACzE,iFAA6E;AAC7E,+GAA0G;AAC1G,+BAA4B;AAC5B,sCAA6C;AAGtC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAIhC,YACa,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAHzC,WAAM,GAAG,IAAI,eAAM,CAAC,cAAc,CAAC,CAAC;IAI3C,CAAC;IAEJ,KAAK,CAAC,KAAK;QAER,MAAM,OAAO,GAAG,IAAI;aAChB,OAAO;aACP,YAAY,CAAA;QAEhB,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAEnC,SAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;QACpB,SAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,SAAG,CAAC,QAAQ,CAAC;QAEhD,MAAM,IAAI;aACN,kBAAkB;aAClB,KAAK,CAAC;YACJ,6CAAiB;YACjB,6CAAiB;SACnB,CAAC,CAAC;QAEN,MAAM,IAAI;aACN,kBAAkB;aAClB,aAAa,CAAC,CAAC,6EAAoC,CAAC,CAAC,CAAC;QAE1D,MAAM,yBAAgB;aAClB,QAAQ;aACR,YAAY,CAAC,CAAC,8CAAqB,CAAC,CAAC,CAAC;QAE1C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;CACH,CAAA;AApCY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,2BAAU,GAAE;qCAMuB,6BAAkB;GALzC,sBAAsB,CAoClC"}
1
+ {"version":3,"file":"translations.controller.js","sourceRoot":"./","sources":["translations/translations.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAsD;AACtD,6CAA0C;AAC1C,oFAAyE;AACzE,oFAAyE;AACzE,iFAA6E;AAC7E,+GAA0G;AAC1G,+BAA4B;AAC5B,yEAAqE;AACrE,mEAA+D;AAGxD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAIhC,YACa,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAHzC,WAAM,GAAG,IAAI,eAAM,CAAC,cAAc,CAAC,CAAC;IAI3C,CAAC;IAEJ,KAAK,CAAC,KAAK;QAER,MAAM,OAAO,GAAG,IAAI;aAChB,OAAO;aACP,YAAY,CAAA;QAEhB,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAEnC,SAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;QACpB,SAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,SAAG,CAAC,QAAQ,CAAC;QAEhD,MAAM,IAAI;aACN,kBAAkB;aAClB,KAAK,CAAC;YACJ,6CAAiB;YACjB,6CAAiB;SACnB,CAAC,CAAC;QAEN,MAAM,IAAI;aACN,kBAAkB;aAClB,aAAa,CAAC,CAAC,6EAAoC,CAAC,CAAC,CAAC;QAE1D,MAAM,oCAAgB;aAClB,QAAQ;aACR,YAAY,CAAC,CAAC,8CAAqB,CAAC,CAAC,CAAC;QAE1C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;CACH,CAAA;AApCY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,2BAAU,GAAE;qCAMuB,wCAAkB;GALzC,sBAAsB,CAoClC"}
@@ -1,2 +0,0 @@
1
- import { EntityTarget } from "typeorm";
2
- export default function generateId<T>(target: EntityTarget<T>, data?: T): string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-id.js","sourceRoot":"./","sources":["database/functions/generate-id.ts"],"names":[],"mappings":";;AAGA,6BAYC;AAfD,uDAAkD;AAGlD,SAAwB,UAAU,CAAI,MAAuB,EAAE,IAAQ;IACpE,MAAM,UAAU,GAAG,IAAA,+BAAa,EAAC,MAAM,CAAC,CAAC;IACzC,IAAI,OAAO,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;IAEpC,IAAI,CAAC,IAAI;QACN,OAAO,OAAO,CAAC;IAElB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;IAC1C,CAAC;IAED,OAAO,OAAO,CAAC;AAClB,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Instantiable } from "@rockster/common";
2
- export declare const useProtector: (target: Instantiable) => import("../interfaces").Protector;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useProtector = void 0;
4
- const useProtector = (target) => {
5
- const object = core
6
- .storage
7
- .findObject(target);
8
- return object.protector;
9
- };
10
- exports.useProtector = useProtector;
11
- //# sourceMappingURL=use-protector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-protector.js","sourceRoot":"./","sources":["database/functions/use-protector.ts"],"names":[],"mappings":";;;AAIO,MAAM,YAAY,GAAG,CAAC,MAAoB,EAAE,EAAE;IAClD,MAAM,MAAM,GAAG,IAAI;SACf,OAAO;SACP,UAAU,CAAC,MAAM,CACO,CAAC;IAC7B,OAAO,MAAM,CAAC,SAAS,CAAC;AAC3B,CAAC,CAAA;AANY,QAAA,YAAY,gBAMxB"}
@@ -1,51 +0,0 @@
1
- import { Dictionary, Instantiable } from "@rockster/common";
2
- import { EntityManager, SelectQueryBuilder } from "typeorm";
3
- export type IsAuthorizedHandle = {
4
- (args: {
5
- userId: string;
6
- keys: string[];
7
- contextId?: string;
8
- entityManager?: EntityManager;
9
- context?: string;
10
- }): Promise<void>;
11
- };
12
- export type GetUserPermissionsHandle = {
13
- (args: {
14
- userId: string;
15
- targetUserId: string;
16
- contextId: string;
17
- entityManager?: EntityManager;
18
- context: string;
19
- }): Promise<string[]>;
20
- };
21
- export type SetUserPermissionsHandle = {
22
- (args: {
23
- userId: string;
24
- targetUserId: string;
25
- contextId: string;
26
- entityManager?: EntityManager;
27
- context: string;
28
- accessKeys: string[];
29
- }): Promise<void>;
30
- };
31
- export type Protector = {
32
- target: Instantiable;
33
- rootCondition?: (args: {
34
- rootAlias: string;
35
- queryBuilder: SelectQueryBuilder<any>;
36
- userId: string;
37
- contextParams: Dictionary<any>;
38
- }) => SelectQueryBuilder<any>;
39
- relationCondition?: (args: {
40
- userId: string;
41
- contextParams: Dictionary<any>;
42
- alias: string;
43
- rootPath: Instantiable;
44
- }) => string;
45
- canRemove?: (userId: string, entityId: string, entityManager?: EntityManager) => Promise<void>;
46
- canModify?: <Entity>(userId: string, value: Entity, entityManager?: EntityManager) => Promise<void>;
47
- canCreate?: <Entity>(userId: string, value: Entity, entityManager?: EntityManager) => Promise<void>;
48
- isAuthorized?: IsAuthorizedHandle;
49
- getUserPermissions?: GetUserPermissionsHandle;
50
- setUserPermissions?: SetUserPermissionsHandle;
51
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"protector.js","sourceRoot":"./","sources":["database/interfaces/protector.ts"],"names":[],"mappings":""}
@@ -1,59 +0,0 @@
1
- import { ObjectNote, PropertyNote } from "@rockster/class-memory";
2
- import { IEntityObject, IEntityProperty } from "../interfaces";
3
- import { Dictionary, Instantiable } from "@rockster/common";
4
- import { IProtectedEntityOptions } from "..";
5
- import { EntityManager } from "typeorm";
6
- import { GetUserPermissionsHandle, SetUserPermissionsHandle } from "../interfaces/protector";
7
- type ProtectedData = {
8
- object: ObjectNote<IEntityObject>;
9
- context?: PropertyNote<IEntityProperty>;
10
- options?: IProtectedEntityOptions;
11
- isContext: boolean;
12
- };
13
- type ProtectorData = {
14
- object: ObjectNote<IEntityObject>;
15
- target: PropertyNote<IEntityProperty>;
16
- context?: PropertyNote<IEntityProperty>;
17
- key?: PropertyNote<IEntityProperty>;
18
- };
19
- export declare class ProtectBuilder {
20
- build(object: ObjectNote<IEntityObject>): Promise<void>;
21
- protected buildProtectorConfig(object: ObjectNote<IEntityObject>): void;
22
- protected getRepository(target: Instantiable, entityManager?: EntityManager): import("typeorm").Repository<any>;
23
- protected createQueryBuilder({ authKeys, data, protectorData, userId, displayContext, entityManager, protectedData }: {
24
- protectorData: ProtectorData;
25
- userId: string;
26
- data: any;
27
- authKeys: string[];
28
- displayContext?: string;
29
- entityManager?: EntityManager;
30
- protectedData?: ProtectedData;
31
- }): import("typeorm").SelectQueryBuilder<any>;
32
- protected buildFilterKeys(protectorAlias: string, protectorKey: string, keys: string[]): string;
33
- protected getQueryContextAndKeyCondition(protectorData: ProtectorData, protectedData: ProtectedData, protectorAlias: string, alias: string, contextParams: Dictionary<any>, rootPath?: Instantiable): {
34
- context: string;
35
- key: string;
36
- };
37
- protected buildProtectedConfig(object: ObjectNote<IEntityObject>): void;
38
- protected getSetUserPermissions(data: ProtectorData): SetUserPermissionsHandle;
39
- protected getGetUserPermissions(data: ProtectorData): GetUserPermissionsHandle;
40
- protected getAuthContextFilter(targetUserId: string, data: ProtectorData, contextId: string): {
41
- where: {
42
- [x: string]: string;
43
- };
44
- keyProperty: PropertyNote<IEntityProperty>;
45
- contextProperty: PropertyNote<IEntityProperty>;
46
- targetProperty: PropertyNote<IEntityProperty>;
47
- };
48
- protected checkIsAuthorized({ data, userId, entityManager, keys, context, contextId }: {
49
- data: ProtectorData;
50
- entityManager?: EntityManager;
51
- keys: string[];
52
- context: string;
53
- contextId: string;
54
- userId: string;
55
- }): Promise<void>;
56
- protected getProtectedData(protector: ProtectorData, object: ObjectNote<IEntityObject>): ProtectedData;
57
- protected getProtectorData(protector: Instantiable): ProtectorData;
58
- }
59
- export {};