@rockster/core 0.0.4 → 0.1.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 (318) hide show
  1. package/access/access.module.js +3 -7
  2. package/access/access.module.js.map +1 -1
  3. package/access/constants.d.ts +2 -0
  4. package/access/constants.js +6 -0
  5. package/access/constants.js.map +1 -0
  6. package/access/controllers/controllers.d.ts +2 -1
  7. package/access/controllers/controllers.js +3 -1
  8. package/access/controllers/controllers.js.map +1 -1
  9. package/access/controllers/scope-access-profile.controller.d.ts +17 -0
  10. package/access/controllers/scope-access-profile.controller.js +111 -0
  11. package/access/controllers/scope-access-profile.controller.js.map +1 -0
  12. package/access/controllers/scope-group-user.controller.d.ts +11 -4
  13. package/access/controllers/scope-group-user.controller.js +57 -9
  14. package/access/controllers/scope-group-user.controller.js.map +1 -1
  15. package/access/controllers/scope-group.controller.d.ts +8 -5
  16. package/access/controllers/scope-group.controller.js +66 -12
  17. package/access/controllers/scope-group.controller.js.map +1 -1
  18. package/access/controllers/scope-owner.controller.d.ts +3 -2
  19. package/access/controllers/scope-owner.controller.js +18 -4
  20. package/access/controllers/scope-owner.controller.js.map +1 -1
  21. package/access/controllers/scope-user.controller.d.ts +2 -2
  22. package/access/controllers/scope-user.controller.js +19 -5
  23. package/access/controllers/scope-user.controller.js.map +1 -1
  24. package/access/decorators/context-params.decorator.d.ts +2 -0
  25. package/access/decorators/context-params.decorator.js +13 -0
  26. package/access/decorators/context-params.decorator.js.map +1 -0
  27. package/access/decorators/index.d.ts +2 -0
  28. package/access/decorators/index.js +19 -0
  29. package/access/decorators/index.js.map +1 -0
  30. package/access/decorators/scope-context-id-resolver.decorator.d.ts +10 -0
  31. package/access/decorators/scope-context-id-resolver.decorator.js +22 -0
  32. package/access/decorators/scope-context-id-resolver.decorator.js.map +1 -0
  33. package/access/entities/entities.d.ts +3 -1
  34. package/access/entities/entities.js +4 -0
  35. package/access/entities/entities.js.map +1 -1
  36. package/access/entities/index.d.ts +2 -0
  37. package/access/entities/index.js +2 -0
  38. package/access/entities/index.js.map +1 -1
  39. package/access/entities/scope-access-profile-key.d.ts +6 -0
  40. package/access/entities/scope-access-profile-key.js +40 -0
  41. package/access/entities/scope-access-profile-key.js.map +1 -0
  42. package/access/entities/scope-access-profile.d.ts +6 -0
  43. package/access/entities/scope-access-profile.js +37 -0
  44. package/access/entities/scope-access-profile.js.map +1 -0
  45. package/access/entities/scope-group.d.ts +3 -0
  46. package/access/entities/scope-group.js +16 -0
  47. package/access/entities/scope-group.js.map +1 -1
  48. package/access/functions/assert-context-admin-access.d.ts +15 -0
  49. package/access/functions/assert-context-admin-access.js +62 -0
  50. package/access/functions/assert-context-admin-access.js.map +1 -0
  51. package/access/functions/assert-master-or-owner.d.ts +9 -0
  52. package/access/functions/assert-master-or-owner.js +40 -0
  53. package/access/functions/assert-master-or-owner.js.map +1 -0
  54. package/access/functions/assert-scope-action-access.d.ts +32 -0
  55. package/access/functions/assert-scope-action-access.js +189 -0
  56. package/access/functions/assert-scope-action-access.js.map +1 -0
  57. package/access/functions/build-scope-resolver-initial-data.d.ts +4 -0
  58. package/access/functions/build-scope-resolver-initial-data.js +17 -0
  59. package/access/functions/build-scope-resolver-initial-data.js.map +1 -0
  60. package/access/functions/describe-action-scope.d.ts +9 -0
  61. package/access/functions/describe-action-scope.js +27 -0
  62. package/access/functions/describe-action-scope.js.map +1 -0
  63. package/access/functions/index.d.ts +5 -0
  64. package/access/functions/index.js +5 -0
  65. package/access/functions/index.js.map +1 -1
  66. package/access/functions/init-scope-service-executors.d.ts +3 -0
  67. package/access/functions/init-scope-service-executors.js +38 -0
  68. package/access/functions/init-scope-service-executors.js.map +1 -0
  69. package/access/functions/normalize-scope-keys.d.ts +4 -0
  70. package/access/functions/normalize-scope-keys.js +17 -0
  71. package/access/functions/normalize-scope-keys.js.map +1 -0
  72. package/access/functions/register-scope.d.ts +16 -5
  73. package/access/functions/register-scope.js +57 -45
  74. package/access/functions/register-scope.js.map +1 -1
  75. package/access/functions/resolve-scope-context-id.d.ts +9 -0
  76. package/access/functions/resolve-scope-context-id.js +71 -0
  77. package/access/functions/resolve-scope-context-id.js.map +1 -0
  78. package/access/functions/warn-if-public.d.ts +12 -0
  79. package/access/functions/warn-if-public.js +20 -0
  80. package/access/functions/warn-if-public.js.map +1 -0
  81. package/access/index.d.ts +2 -0
  82. package/access/index.js +2 -0
  83. package/access/index.js.map +1 -1
  84. package/access/interfaces/index.d.ts +1 -0
  85. package/access/interfaces/index.js +1 -0
  86. package/access/interfaces/index.js.map +1 -1
  87. package/access/interfaces/resolve-scope-context-id.d.ts +21 -0
  88. package/access/interfaces/resolve-scope-context-id.js +3 -0
  89. package/access/interfaces/resolve-scope-context-id.js.map +1 -0
  90. package/access/interfaces/scope-service-registry.d.ts +16 -1
  91. package/access/interfaces/scope-service.d.ts +6 -7
  92. package/access/models/scope-access-profile-keys-update.d.ts +5 -0
  93. package/access/models/scope-access-profile-keys-update.js +27 -0
  94. package/access/models/scope-access-profile-keys-update.js.map +1 -0
  95. package/access/models/scope-group-apply-access-profile.d.ts +6 -0
  96. package/access/models/scope-group-apply-access-profile.js +32 -0
  97. package/access/models/scope-group-apply-access-profile.js.map +1 -0
  98. package/access/models/scope-user-mapped.d.ts +1 -0
  99. package/access/models/scope-user-mapped.js +6 -0
  100. package/access/models/scope-user-mapped.js.map +1 -1
  101. package/access/models/scope-user.js +4 -2
  102. package/access/models/scope-user.js.map +1 -1
  103. package/access/queries/scope-access-profile.query.d.ts +1 -0
  104. package/access/queries/scope-access-profile.query.js +10 -0
  105. package/access/queries/scope-access-profile.query.js.map +1 -0
  106. package/access/queries/scope-group.query.js +9 -2
  107. package/access/queries/scope-group.query.js.map +1 -1
  108. package/access/services/index.d.ts +1 -0
  109. package/access/services/index.js +1 -0
  110. package/access/services/index.js.map +1 -1
  111. package/access/services/scope-access-profile.service.d.ts +13 -0
  112. package/access/services/scope-access-profile.service.js +75 -0
  113. package/access/services/scope-access-profile.service.js.map +1 -0
  114. package/access/services/scope-access.service.js +4 -2
  115. package/access/services/scope-access.service.js.map +1 -1
  116. package/access/services/scope-group-user.service.js +2 -2
  117. package/access/services/scope-group-user.service.js.map +1 -1
  118. package/access/services/scope-group.service.d.ts +10 -0
  119. package/access/services/scope-group.service.js +38 -1
  120. package/access/services/scope-group.service.js.map +1 -1
  121. package/access/services/scope-owner.service.d.ts +3 -0
  122. package/access/services/scope-owner.service.js +26 -1
  123. package/access/services/scope-owner.service.js.map +1 -1
  124. package/command/services/post-action-builder.js +19 -17
  125. package/command/services/post-action-builder.js.map +1 -1
  126. package/command/services/remove-action-builder.js +30 -22
  127. package/command/services/remove-action-builder.js.map +1 -1
  128. package/controllers/interfaces/controller-property.d.ts +7 -1
  129. package/controllers/services/default-action-builder.js +12 -30
  130. package/controllers/services/default-action-builder.js.map +1 -1
  131. package/controllers/services/restful-action-builder.js +25 -1
  132. package/controllers/services/restful-action-builder.js.map +1 -1
  133. package/core/contexts/request-context.d.ts +5 -0
  134. package/core/contexts/request-context.js +6 -0
  135. package/core/contexts/request-context.js.map +1 -0
  136. package/core/core.controller.js +6 -1
  137. package/core/core.controller.js.map +1 -1
  138. package/core/interfaces/action-docs.d.ts +15 -0
  139. package/core/interfaces/request-context.d.ts +5 -0
  140. package/core/services/request-router.js +2 -1
  141. package/core/services/request-router.js.map +1 -1
  142. package/database/database.controller.d.ts +1 -3
  143. package/database/database.controller.js +1 -5
  144. package/database/database.controller.js.map +1 -1
  145. package/database/decorators/protect-entity.decorator.d.ts +1 -0
  146. package/database/decorators/protect-entity.decorator.js +2 -3
  147. package/database/decorators/protect-entity.decorator.js.map +1 -1
  148. package/database/decorators/protected-entity.decorator.d.ts +1 -0
  149. package/database/decorators/protected-entity.decorator.js +2 -16
  150. package/database/decorators/protected-entity.decorator.js.map +1 -1
  151. package/database/functions/inject-repository-handle.js +4 -3
  152. package/database/functions/inject-repository-handle.js.map +1 -1
  153. package/database/interfaces/entity-object.d.ts +0 -6
  154. package/database/interfaces/index.d.ts +0 -1
  155. package/database/interfaces/index.js +0 -1
  156. package/database/interfaces/index.js.map +1 -1
  157. package/database/interfaces/repository.d.ts +8 -8
  158. package/docs/docs.module.js +3 -1
  159. package/docs/docs.module.js.map +1 -1
  160. package/docs/migrations/1747584000000-CreateDocsTables.d.ts +5 -0
  161. package/docs/migrations/1747584000000-CreateDocsTables.js +90 -0
  162. package/docs/migrations/1747584000000-CreateDocsTables.js.map +1 -0
  163. package/docs/migrations/migrations.d.ts +2 -0
  164. package/docs/migrations/migrations.js +8 -0
  165. package/docs/migrations/migrations.js.map +1 -0
  166. package/global.d.ts +2 -0
  167. package/global.js +1 -0
  168. package/global.js.map +1 -1
  169. package/index.d.ts +2 -1
  170. package/index.js +2 -1
  171. package/index.js.map +1 -1
  172. package/jobs/jobs.controller.d.ts +2 -0
  173. package/jobs/jobs.controller.js +20 -16
  174. package/jobs/jobs.controller.js.map +1 -1
  175. package/package.json +70 -70
  176. package/query/functions/add-join.js +2 -13
  177. package/query/functions/add-join.js.map +1 -1
  178. package/query/functions/create-query-builder.js +0 -10
  179. package/query/functions/create-query-builder.js.map +1 -1
  180. package/query/functions/execute-query.js +34 -0
  181. package/query/functions/execute-query.js.map +1 -1
  182. package/query/functions/load-properties.js +73 -5
  183. package/query/functions/load-properties.js.map +1 -1
  184. package/query/services/query-action-builder.js +12 -18
  185. package/query/services/query-action-builder.js.map +1 -1
  186. package/remote-logs/dtos/index.d.ts +2 -0
  187. package/remote-logs/dtos/index.js +19 -0
  188. package/remote-logs/dtos/index.js.map +1 -0
  189. package/remote-logs/dtos/remote-log-hooks.dto.d.ts +72 -0
  190. package/remote-logs/dtos/remote-log-hooks.dto.js +280 -0
  191. package/remote-logs/dtos/remote-log-hooks.dto.js.map +1 -0
  192. package/remote-logs/dtos/remote-log-search.dto.d.ts +34 -0
  193. package/remote-logs/dtos/remote-log-search.dto.js +146 -0
  194. package/remote-logs/dtos/remote-log-search.dto.js.map +1 -0
  195. package/remote-logs/environment.d.ts +4 -0
  196. package/remote-logs/environment.js +5 -0
  197. package/remote-logs/environment.js.map +1 -0
  198. package/remote-logs/index.d.ts +3 -0
  199. package/remote-logs/index.js +20 -0
  200. package/remote-logs/index.js.map +1 -0
  201. package/remote-logs/interfaces/index.d.ts +1 -0
  202. package/remote-logs/interfaces/index.js +18 -0
  203. package/remote-logs/interfaces/index.js.map +1 -0
  204. package/remote-logs/interfaces/remote-logs-module-options.d.ts +8 -0
  205. package/remote-logs/interfaces/remote-logs-module-options.js +3 -0
  206. package/remote-logs/interfaces/remote-logs-module-options.js.map +1 -0
  207. package/remote-logs/remote-logs-hooks.controller.d.ts +60 -0
  208. package/remote-logs/remote-logs-hooks.controller.js +331 -0
  209. package/remote-logs/remote-logs-hooks.controller.js.map +1 -0
  210. package/remote-logs/remote-logs.controller.d.ts +8 -0
  211. package/remote-logs/remote-logs.controller.js +41 -0
  212. package/remote-logs/remote-logs.controller.js.map +1 -0
  213. package/remote-logs/remote-logs.module.d.ts +12 -0
  214. package/remote-logs/remote-logs.module.js +107 -0
  215. package/remote-logs/remote-logs.module.js.map +1 -0
  216. package/remote-logs/services/opensearch.service.d.ts +13 -0
  217. package/remote-logs/services/opensearch.service.js +167 -0
  218. package/remote-logs/services/opensearch.service.js.map +1 -0
  219. package/security/auth.controller.js +4 -4
  220. package/security/auth.controller.js.map +1 -1
  221. package/security/functions/add-protected.d.ts +2 -2
  222. package/security/functions/add-protected.js +8 -5
  223. package/security/functions/add-protected.js.map +1 -1
  224. package/security/functions/create-authentication-interceptor.d.ts +44 -0
  225. package/security/functions/create-authentication-interceptor.js +114 -0
  226. package/security/functions/create-authentication-interceptor.js.map +1 -0
  227. package/security/functions/find-auth-context.d.ts +1 -2
  228. package/security/functions/find-auth-context.js +6 -11
  229. package/security/functions/find-auth-context.js.map +1 -1
  230. package/security/index.d.ts +1 -0
  231. package/security/index.js +1 -0
  232. package/security/index.js.map +1 -1
  233. package/security/interfaces/authorization-schema.d.ts +3 -1
  234. package/security/services/authorization.service.d.ts +5 -3
  235. package/security/services/authorization.service.js +56 -37
  236. package/security/services/authorization.service.js.map +1 -1
  237. package/storage/services/routes.service.js +1 -1
  238. package/storage/services/routes.service.js.map +1 -1
  239. package/tasks/constants.d.ts +3 -0
  240. package/tasks/constants.js +2 -1
  241. package/tasks/constants.js.map +1 -1
  242. package/tasks/controllers/task.controller.d.ts +3 -2
  243. package/tasks/controllers/task.controller.js +11 -40
  244. package/tasks/controllers/task.controller.js.map +1 -1
  245. package/tasks/decorators/index.d.ts +1 -0
  246. package/tasks/decorators/index.js +1 -0
  247. package/tasks/decorators/index.js.map +1 -1
  248. package/tasks/decorators/task-payload.decorator.d.ts +1 -0
  249. package/tasks/decorators/task-payload.decorator.js +12 -0
  250. package/tasks/decorators/task-payload.decorator.js.map +1 -0
  251. package/tasks/decorators/task.decorator.js +3 -0
  252. package/tasks/decorators/task.decorator.js.map +1 -1
  253. package/tasks/functions/compile-all-task-post-hooks.d.ts +1 -0
  254. package/tasks/functions/compile-all-task-post-hooks.js +27 -0
  255. package/tasks/functions/compile-all-task-post-hooks.js.map +1 -0
  256. package/tasks/functions/compile-task-hook-handle.d.ts +6 -0
  257. package/tasks/functions/compile-task-hook-handle.js +67 -0
  258. package/tasks/functions/compile-task-hook-handle.js.map +1 -0
  259. package/tasks/functions/create-task-hook.d.ts +9 -0
  260. package/tasks/functions/create-task-hook.js +13 -0
  261. package/tasks/functions/create-task-hook.js.map +1 -0
  262. package/tasks/functions/create-task-message-post.js +2 -0
  263. package/tasks/functions/create-task-message-post.js.map +1 -1
  264. package/tasks/functions/register-task-post-hook-interceptors.d.ts +3 -0
  265. package/tasks/functions/register-task-post-hook-interceptors.js +86 -0
  266. package/tasks/functions/register-task-post-hook-interceptors.js.map +1 -0
  267. package/tasks/functions/run-task-post-hooks.d.ts +11 -0
  268. package/tasks/functions/run-task-post-hooks.js +18 -0
  269. package/tasks/functions/run-task-post-hooks.js.map +1 -0
  270. package/tasks/functions/task-message-operations.d.ts +18 -0
  271. package/tasks/functions/task-message-operations.js +100 -0
  272. package/tasks/functions/task-message-operations.js.map +1 -0
  273. package/tasks/functions/validate-task-payload.d.ts +2 -0
  274. package/tasks/functions/validate-task-payload.js +19 -0
  275. package/tasks/functions/validate-task-payload.js.map +1 -0
  276. package/tasks/hook-constants.d.ts +2 -0
  277. package/tasks/hook-constants.js +6 -0
  278. package/tasks/hook-constants.js.map +1 -0
  279. package/tasks/index.d.ts +3 -0
  280. package/tasks/index.js +3 -0
  281. package/tasks/index.js.map +1 -1
  282. package/tasks/interfaces/compiled-task-post-hooks.d.ts +17 -0
  283. package/tasks/interfaces/compiled-task-post-hooks.js +3 -0
  284. package/tasks/interfaces/compiled-task-post-hooks.js.map +1 -0
  285. package/tasks/interfaces/index.d.ts +3 -0
  286. package/tasks/interfaces/index.js +3 -0
  287. package/tasks/interfaces/index.js.map +1 -1
  288. package/tasks/interfaces/task-hook.d.ts +16 -0
  289. package/tasks/interfaces/task-hook.js +8 -0
  290. package/tasks/interfaces/task-hook.js.map +1 -0
  291. package/tasks/interfaces/task-object.d.ts +4 -0
  292. package/tasks/interfaces/task-post-hook.d.ts +2 -0
  293. package/{database/interfaces/protector.js → tasks/interfaces/task-post-hook.js} +1 -1
  294. package/tasks/interfaces/task-post-hook.js.map +1 -0
  295. package/tasks/interfaces/task-settings.d.ts +5 -0
  296. package/tasks/services/task-runner.service.d.ts +24 -3
  297. package/tasks/services/task-runner.service.js +66 -28
  298. package/tasks/services/task-runner.service.js.map +1 -1
  299. package/translations/controllers/translation.controller.d.ts +3 -1
  300. package/translations/controllers/translation.controller.js +17 -3
  301. package/translations/controllers/translation.controller.js.map +1 -1
  302. package/translations/services/translations.service.d.ts +1 -0
  303. package/translations/services/translations.service.js +25 -6
  304. package/translations/services/translations.service.js.map +1 -1
  305. package/translations/services/translator.service.d.ts +1 -0
  306. package/translations/services/translator.service.js +6 -0
  307. package/translations/services/translator.service.js.map +1 -1
  308. package/database/functions/use-protector.d.ts +0 -2
  309. package/database/functions/use-protector.js +0 -11
  310. package/database/functions/use-protector.js.map +0 -1
  311. package/database/interfaces/protector.d.ts +0 -51
  312. package/database/interfaces/protector.js.map +0 -1
  313. package/database/services/protect-builder.d.ts +0 -60
  314. package/database/services/protect-builder.js +0 -524
  315. package/database/services/protect-builder.js.map +0 -1
  316. package/security/functions/add-protect.d.ts +0 -2
  317. package/security/functions/add-protect.js +0 -11
  318. package/security/functions/add-protect.js.map +0 -1
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.queryTaskMessages = queryTaskMessages;
4
+ exports.createTaskMessage = createTaskMessage;
5
+ exports.retryTaskMessage = retryTaskMessage;
6
+ const common_1 = require("@rockster/common");
7
+ const tasks_1 = require("@rockster/common/tasks");
8
+ const execute_post_1 = require("../../command/functions/execute-post");
9
+ const use_repository_1 = require("../../database/functions/use-repository");
10
+ const execute_query_1 = require("../../query/functions/execute-query");
11
+ const generate_entity_id_1 = require("./generate-entity-id");
12
+ const request_context_1 = require("../../core/contexts/request-context");
13
+ const task_hook_1 = require("../interfaces/task-hook");
14
+ const run_task_post_hooks_1 = require("./run-task-post-hooks");
15
+ const validate_task_payload_1 = require("./validate-task-payload");
16
+ function isTaskObjectNote(task) {
17
+ return typeof task === "object" && task != null && "objectKey" in task;
18
+ }
19
+ function resolveTaskObject(task) {
20
+ if (isTaskObjectNote(task)) {
21
+ return task;
22
+ }
23
+ return core.storage.findObject(task);
24
+ }
25
+ const createEmptyRequestContext = () => ({
26
+ response: {},
27
+ request: {},
28
+ pendings: [],
29
+ callbacks: {
30
+ success: [],
31
+ error: [],
32
+ },
33
+ onSuccess: async () => { },
34
+ onError: async () => { },
35
+ });
36
+ function resolveRequestContext(options) {
37
+ return options?.requestContext
38
+ ?? request_context_1.requestContextStore.getStore()
39
+ ?? createEmptyRequestContext();
40
+ }
41
+ /** Same semantics as {@link TaskController.query}. */
42
+ async function queryTaskMessages(content) {
43
+ return (0, execute_query_1.executeQuery)({ content });
44
+ }
45
+ async function createTaskMessage(task, payload, options) {
46
+ const object = resolveTaskObject(task);
47
+ const skipPhases = new Set(options?.skipPhases ?? []);
48
+ const requestContext = resolveRequestContext(options);
49
+ const Payload = object.payload();
50
+ if (!skipPhases.has(task_hook_1.taskHookPhase.beforeValidation)) {
51
+ await (0, run_task_post_hooks_1.runTaskPostHooks)(object, task_hook_1.taskHookPhase.beforeValidation, {
52
+ payload,
53
+ requestContext,
54
+ });
55
+ await (0, validate_task_payload_1.validateTaskPayload)(Payload, payload);
56
+ }
57
+ const data = {
58
+ id: (0, generate_entity_id_1.generateEntityId)(),
59
+ partitionId: object.nextPartitionId(),
60
+ payload,
61
+ createdAt: new Date(),
62
+ lastModifiedAt: new Date(),
63
+ };
64
+ if (!skipPhases.has(task_hook_1.taskHookPhase.beforeExecute)) {
65
+ await (0, run_task_post_hooks_1.runTaskPostHooks)(object, task_hook_1.taskHookPhase.beforeExecute, {
66
+ payload,
67
+ requestContext,
68
+ message: data,
69
+ });
70
+ }
71
+ return (0, execute_post_1.executePost)({
72
+ type: "create",
73
+ target: object.MessageModel,
74
+ idProperty: "id",
75
+ data,
76
+ });
77
+ }
78
+ /** Same semantics as {@link TaskController.retry}. */
79
+ async function retryTaskMessage(object, message) {
80
+ const repository = (0, use_repository_1.useRepository)(object.MessageModel);
81
+ const stored = await repository.findOneBy({
82
+ id: message.id,
83
+ });
84
+ if (!stored || stored.status !== tasks_1.TaskMessageStatus.failed) {
85
+ throw new common_1.BadRequestError({
86
+ message: `Reprocessing unavailable for this task`,
87
+ });
88
+ }
89
+ const data = {
90
+ payload: message.payload,
91
+ lastModifiedAt: new Date(),
92
+ status: tasks_1.TaskMessageStatus.pending,
93
+ };
94
+ await repository.update({
95
+ id: message.id,
96
+ partitionId: stored.partitionId,
97
+ }, data);
98
+ return { ...stored, ...data };
99
+ }
100
+ //# sourceMappingURL=task-message-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-message-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AAC,CAAC;IACtD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC;QACvC,EAAE,EAAE,OAAO,CAAC,EAAE;KAChB,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,yBAAiB,CAAC,MAAM,EAAE,CAAC;QACzD,MAAM,IAAI,wBAAe,CAAC;YACvB,OAAO,EAAE,wCAAwC;SACnD,CAAC,CAAC;IACN,CAAC;IAED,MAAM,IAAI,GAAG;QACV,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,cAAc,EAAE,IAAI,IAAI,EAAE;QAC1B,MAAM,EAAE,yBAAiB,CAAC,OAAO;KACnC,CAAC;IAEF,MAAM,UAAU,CAAC,MAAM,CACpB;QACG,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,WAAW,EAAE,MAAM,CAAC,WAAW;KACjC,EACD,IAAI,CACN,CAAC;IAEF,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Instantiable } from "@rockster/common";
2
+ export declare const validateTaskPayload: (Payload: Instantiable, payload: unknown) => Promise<void>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateTaskPayload = void 0;
4
+ const class_pipe_1 = require("@rockster/class-pipe");
5
+ const global_1 = require("../../global");
6
+ const validateTaskPayload = async (Payload, payload) => {
7
+ const sanitized = {};
8
+ const errors = await (0, class_pipe_1.validate)(Payload, payload, sanitized, {
9
+ groups: [global_1.actionGroups.create],
10
+ });
11
+ if (errors) {
12
+ throw errors;
13
+ }
14
+ if (payload && typeof payload === "object" && !Array.isArray(payload)) {
15
+ Object.assign(payload, sanitized);
16
+ }
17
+ };
18
+ exports.validateTaskPayload = validateTaskPayload;
19
+ //# sourceMappingURL=validate-task-payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-task-payload.js","sourceRoot":"./","sources":["tasks/functions/validate-task-payload.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,yCAA4C;AAErC,MAAM,mBAAmB,GAAG,KAAK,EACrC,OAAqB,EACrB,OAAgB,EACF,EAAE;IAChB,MAAM,SAAS,GAAG,EAA6B,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAQ,EAC1B,OAAO,EACP,OAAO,EACP,SAAS,EACT;QACG,MAAM,EAAE,CAAC,qBAAY,CAAC,MAAM,CAAC;KAC/B,CACH,CAAC;IAEF,IAAI,MAAM,EAAE,CAAC;QACV,MAAM,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACrE,MAAM,CAAC,MAAM,CAAC,OAAiB,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,mBAAmB,uBAqB9B"}
@@ -0,0 +1,2 @@
1
+ export declare const TASK_PAYLOAD_KEY = "TASK_PAYLOAD";
2
+ export declare const TASK_MESSAGE_KEY = "TASK_MESSAGE";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TASK_MESSAGE_KEY = exports.TASK_PAYLOAD_KEY = void 0;
4
+ exports.TASK_PAYLOAD_KEY = 'TASK_PAYLOAD';
5
+ exports.TASK_MESSAGE_KEY = 'TASK_MESSAGE';
6
+ //# sourceMappingURL=hook-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook-constants.js","sourceRoot":"./","sources":["tasks/hook-constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,cAAc,CAAC;AAClC,QAAA,gBAAgB,GAAG,cAAc,CAAC"}
package/tasks/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export * from './interfaces';
2
2
  export * from './decorators';
3
+ export * from './hook-constants';
4
+ export * from './functions/create-task-hook';
3
5
  export * from './functions/throw-task-error';
6
+ export * from './functions/task-message-operations';
4
7
  export * from './tasks.module';
5
8
  export * from './models';
package/tasks/index.js CHANGED
@@ -16,7 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./interfaces"), exports);
18
18
  __exportStar(require("./decorators"), exports);
19
+ __exportStar(require("./hook-constants"), exports);
20
+ __exportStar(require("./functions/create-task-hook"), exports);
19
21
  __exportStar(require("./functions/throw-task-error"), exports);
22
+ __exportStar(require("./functions/task-message-operations"), exports);
20
23
  __exportStar(require("./tasks.module"), exports);
21
24
  __exportStar(require("./models"), exports);
22
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"./","sources":["tasks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,+DAA6C;AAC7C,iDAA+B;AAC/B,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"./","sources":["tasks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,+DAA6C;AAC7C,+DAA6C;AAC7C,sEAAoD;AACpD,iDAA+B;AAC/B,2CAAyB"}
@@ -0,0 +1,17 @@
1
+ import { Dictionary } from "@rockster/common";
2
+ import { IRequestContext } from "../../core/interfaces/request-context";
3
+ import { ITaskMessage } from "@rockster/common/tasks";
4
+ export type TaskPostHookInitialData = Dictionary<unknown> & {
5
+ payload: unknown;
6
+ requestContext?: IRequestContext;
7
+ message?: Partial<ITaskMessage>;
8
+ };
9
+ export type TaskPostHookHandle = {
10
+ (initialData: TaskPostHookInitialData): Promise<void>;
11
+ interceptorName: string;
12
+ phase: string;
13
+ };
14
+ export type CompiledTaskPostHooks = {
15
+ beforeValidation: TaskPostHookHandle[];
16
+ beforeExecute: TaskPostHookHandle[];
17
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=compiled-task-post-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiled-task-post-hooks.js","sourceRoot":"./","sources":["tasks/interfaces/compiled-task-post-hooks.ts"],"names":[],"mappings":""}
@@ -1,5 +1,8 @@
1
1
  export * from './task-naming';
2
2
  export * from './task-object';
3
+ export * from './task-hook';
4
+ export * from './task-post-hook';
5
+ export * from './compiled-task-post-hooks';
3
6
  export * from './task-post-intercept';
4
7
  export * from './task-runner';
5
8
  export * from './task-search-intercept';
@@ -16,6 +16,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./task-naming"), exports);
18
18
  __exportStar(require("./task-object"), exports);
19
+ __exportStar(require("./task-hook"), exports);
20
+ __exportStar(require("./task-post-hook"), exports);
21
+ __exportStar(require("./compiled-task-post-hooks"), exports);
19
22
  __exportStar(require("./task-post-intercept"), exports);
20
23
  __exportStar(require("./task-runner"), exports);
21
24
  __exportStar(require("./task-search-intercept"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"./","sources":["tasks/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,gDAA8B;AAC9B,wDAAsC;AACtC,gDAA8B;AAC9B,0DAAwC;AACxC,kDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"./","sources":["tasks/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,gDAA8B;AAC9B,8CAA4B;AAC5B,mDAAiC;AACjC,6DAA2C;AAC3C,wDAAsC;AACtC,gDAA8B;AAC9B,0DAAwC;AACxC,kDAAgC"}
@@ -0,0 +1,16 @@
1
+ import { Instantiable } from "@rockster/common";
2
+ export declare const taskHookPhase: {
3
+ readonly beforeValidation: "taskHook.beforeValidation";
4
+ readonly beforeExecute: "taskHook.beforeExecute";
5
+ };
6
+ export type TaskHookPhase = typeof taskHookPhase[keyof typeof taskHookPhase];
7
+ export type TaskHookDef = {
8
+ name: string;
9
+ phase: TaskHookPhase;
10
+ executor: Instantiable;
11
+ };
12
+ export type TaskHook = TaskHookDef & {
13
+ instance?: {
14
+ intercept(...args: unknown[]): Promise<unknown>;
15
+ };
16
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.taskHookPhase = void 0;
4
+ exports.taskHookPhase = {
5
+ beforeValidation: 'taskHook.beforeValidation',
6
+ beforeExecute: 'taskHook.beforeExecute',
7
+ };
8
+ //# sourceMappingURL=task-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-hook.js","sourceRoot":"./","sources":["tasks/interfaces/task-hook.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAG;IAC1B,gBAAgB,EAAE,2BAA2B;IAC7C,aAAa,EAAE,wBAAwB;CAChC,CAAC"}
@@ -4,6 +4,8 @@ import { IObject } from "../../core";
4
4
  import { ITaskSettings } from "./task-settings";
5
5
  import { PgTableWithColumns } from "drizzle-orm/pg-core";
6
6
  import { ITaskNaming } from "./task-naming";
7
+ import { CompiledTaskPostHooks } from "./compiled-task-post-hooks";
8
+ import { TaskPostHook } from "./task-post-hook";
7
9
  import { TaskPostIntercept } from "./task-post-intercept";
8
10
  export interface ITaskObject extends IObject {
9
11
  type: ObjectType.task;
@@ -16,4 +18,6 @@ export interface ITaskObject extends IObject {
16
18
  naming: ITaskNaming;
17
19
  nextPartitionId: () => number;
18
20
  postInterceptors?: TaskPostIntercept[];
21
+ postHooks?: TaskPostHook[];
22
+ compiledPostHooks?: CompiledTaskPostHooks;
19
23
  }
@@ -0,0 +1,2 @@
1
+ import { TaskHookDef } from "./task-hook";
2
+ export type TaskPostHook = TaskHookDef;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=protector.js.map
3
+ //# sourceMappingURL=task-post-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-post-hook.js","sourceRoot":"./","sources":["tasks/interfaces/task-post-hook.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import { GetTypeCallback } from "@rockster/common";
2
+ import { TaskPostHook } from "./task-post-hook";
2
3
  import { TaskPostIntercept } from "./task-post-intercept";
3
4
  export interface ITaskSettings<T> {
4
5
  /**Executor for any message */
@@ -13,5 +14,9 @@ export interface ITaskSettings<T> {
13
14
  retentionDays?: number;
14
15
  /**limit: 100. Indicates how many messages the runner will recieve to proccess*/
15
16
  messagesLimit?: number;
17
+ /**
18
+ * @deprecated Use `postHooks` instead.
19
+ */
16
20
  postInterceptors?: TaskPostIntercept[];
21
+ postHooks?: TaskPostHook[];
17
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,51 +44,69 @@ 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
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
95
  runtimeMs: stopwatch.stop(),
67
- payload: message.payload
96
+ payload: message.payload,
68
97
  });
69
98
  }
70
99
  catch (error) {
71
100
  const taskError = error;
72
- taskError.infos = getErrorInfos(error).message;
73
- 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";
74
107
  await task.repository.update({
75
108
  id: message.id,
76
- partitionId: message.partitionId
109
+ partitionId: message.partitionId,
77
110
  }, {
78
111
  status: tasks_1.TaskMessageStatus.failed,
79
112
  lastModifiedAt: new Date(),
@@ -81,7 +114,7 @@ let TaskRunnerService = TaskRunnerService_1 = class TaskRunnerService {
81
114
  runtimeMs: stopwatch.stop(),
82
115
  internalError: taskError,
83
116
  error: isExpose ? taskError : null,
84
- payload: message.payload
117
+ payload: message.payload,
85
118
  });
86
119
  }
87
120
  }
@@ -96,12 +129,17 @@ let TaskRunnerService = TaskRunnerService_1 = class TaskRunnerService {
96
129
  error: row.error,
97
130
  internalError: row.internal_error,
98
131
  payload: row.payload,
99
- runtimeMs: row.runtime_ms
132
+ runtimeMs: row.runtime_ms,
100
133
  };
101
134
  }
102
135
  };
103
136
  exports.TaskRunnerService = TaskRunnerService;
104
- 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. */
105
143
  TaskRunnerService.done = false;
106
144
  exports.TaskRunnerService = TaskRunnerService = TaskRunnerService_1 = __decorate([
107
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,IAAI,CAAC,eAAe,EAAE,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAA+B;QAC9C,MAAM,MAAM,GAAG,MAAM,IAAA,+BAAc,EAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACxD,MAAM,UAAU,GAAG,IAAA,8BAAa,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACb,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,UAAU;SACxB,CAAC,CAAC;IACN,CAAC;IAES,KAAK,CAAC,eAAe;QAC5B,IAAI,CAAC;YACF,IAAI,mBAAiB,CAAC,OAAO;gBAAE,OAAO;YACtC,mBAAiB,CAAC,OAAO,GAAG,IAAI,CAAC;YACjC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC7B,MAAM,KAAK,GAAG,IAAA,8CAAoB,EAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACtE,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAkC,CAAC;gBAC1F,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ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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"}
@@ -5,9 +5,11 @@ import { GetValuesRequest } from '../models/get-values.request';
5
5
  import { GetValuesResponse } from '../models/get-values.response';
6
6
  import { TranslationsService } from '../services/translations.service';
7
7
  import { ITranslationValues } from '../interfaces/translation-values';
8
+ import { TranslatorService } from '../services/translator.service';
8
9
  export declare class TranslationController {
9
10
  protected readonly translationsService: TranslationsService;
10
- constructor(translationsService: TranslationsService);
11
+ protected readonly translatorService: TranslatorService;
12
+ constructor(translationsService: TranslationsService, translatorService: TranslatorService);
11
13
  postConfig(content: IPostContent<TranslationConfig>): Promise<TranslationConfig>;
12
14
  postValues(content: IPostContent<ITranslationValues>): Promise<ITranslationValues>;
13
15
  queryConfig(content: IQueryContent<TranslationConfig>): Promise<import("../../query/interfaces").Query<TranslationConfig>>;
@@ -28,15 +28,28 @@ const post_action_decorator_1 = require("../../command/decorators/post-action.de
28
28
  const post_content_decorator_1 = require("../../command/decorators/post-content.decorator");
29
29
  const action_content_decorator_1 = require("../../controllers/decorators/actions/action-content.decorator");
30
30
  const action_decorator_1 = require("../../controllers/decorators/actions/action.decorator");
31
+ const translator_service_1 = require("../services/translator.service");
31
32
  let TranslationController = class TranslationController {
32
- constructor(translationsService) {
33
+ constructor(translationsService, translatorService) {
33
34
  this.translationsService = translationsService;
35
+ this.translatorService = translatorService;
34
36
  }
35
37
  async postConfig(content) {
36
38
  return (0, execute_post_1.executePost)(content);
37
39
  }
38
40
  async postValues(content) {
39
- return (0, execute_post_1.executePost)(content);
41
+ const result = await (0, execute_post_1.executePost)(content);
42
+ const configId = result?.translationConfigId
43
+ ?? content.data?.translationConfigId;
44
+ if (configId) {
45
+ const referenceId = await this
46
+ .translationsService
47
+ .getReferenceIdForConfig(configId);
48
+ if (referenceId) {
49
+ await this.translatorService.invalidateReference(referenceId);
50
+ }
51
+ }
52
+ return result;
40
53
  }
41
54
  async queryConfig(content) {
42
55
  return (0, execute_query_1.executeQuery)({ content: content });
@@ -98,6 +111,7 @@ __decorate([
98
111
  ], TranslationController.prototype, "getValues", null);
99
112
  exports.TranslationController = TranslationController = __decorate([
100
113
  (0, controller_decorator_1.Controller)(),
101
- __metadata("design:paramtypes", [translations_service_1.TranslationsService])
114
+ __metadata("design:paramtypes", [translations_service_1.TranslationsService,
115
+ translator_service_1.TranslatorService])
102
116
  ], TranslationController);
103
117
  //# 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;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,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,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AyC;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;AApEY,sDAAqB;AAUzB;IAHL,IAAA,kCAAU,EAAC;QACT,IAAI,EAAE,GAAG,EAAE,CAAC,6CAAiB;KAC/B,CAAC;IAEE,WAAA,IAAA,oCAAW,GAAE,CAAA;;;;uDAGhB;AAKK;IAHL,IAAA,kCAAU,EAAC;QACT,IAAI,EAAE,GAAG,EAAE,CAAC,6CAAiB;KAC/B,CAAC;IAEE,WAAA,IAAA,oCAAW,GAAE,CAAA;;;;uDAchB;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,yBAAM,EAAC;QACL,QAAQ,EAAE,GAAG,EAAE,CAAC,uCAAiB;QACjC,MAAM,EAAE,IAAI;KACd,CAAC;IAEE,WAAA,IAAA,wCAAa,GAAE,CAAA;;qCAAU,qCAAgB;;sDAY5C;gCAnES,qBAAqB;IADjC,IAAA,iCAAU,GAAE;qCAIiC,0CAAmB;QACrB,sCAAiB;GAJhD,qBAAqB,CAoEjC"}
@@ -8,4 +8,5 @@ export declare class TranslationsService {
8
8
  getValues(referenceId: string, locale: Locale): Promise<{
9
9
  [x: string]: string;
10
10
  }>;
11
+ getReferenceIdForConfig(translationConfigId: string): Promise<string | null>;
11
12
  }