@acorex-platform/framework-server 0.0.30 → 0.0.32
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.
- package/background-job/src/index.d.ts +3 -0
- package/background-job/src/index.d.ts.map +1 -1
- package/background-job/src/index.js +3 -0
- package/background-job/src/index.js.map +1 -1
- package/background-job/src/lib/background-job.module.d.ts +3 -0
- package/background-job/src/lib/background-job.module.d.ts.map +1 -1
- package/background-job/src/lib/background-job.module.js +13 -1
- package/background-job/src/lib/background-job.module.js.map +1 -1
- package/background-job/src/lib/background-job.service.d.ts +9 -2
- package/background-job/src/lib/background-job.service.d.ts.map +1 -1
- package/background-job/src/lib/background-job.service.js +42 -2
- package/background-job/src/lib/background-job.service.js.map +1 -1
- package/background-job/src/lib/command-concurrency-lock.registrar.d.ts +14 -0
- package/background-job/src/lib/command-concurrency-lock.registrar.d.ts.map +1 -0
- package/background-job/src/lib/command-concurrency-lock.registrar.js +29 -0
- package/background-job/src/lib/command-concurrency-lock.registrar.js.map +1 -0
- package/background-job/src/lib/execution/background-job-cancellation.service.d.ts +5 -1
- package/background-job/src/lib/execution/background-job-cancellation.service.d.ts.map +1 -1
- package/background-job/src/lib/execution/background-job-cancellation.service.js +11 -2
- package/background-job/src/lib/execution/background-job-cancellation.service.js.map +1 -1
- package/background-job/src/lib/execution/background-job-execution.service.d.ts +15 -2
- package/background-job/src/lib/execution/background-job-execution.service.d.ts.map +1 -1
- package/background-job/src/lib/execution/background-job-execution.service.js +145 -8
- package/background-job/src/lib/execution/background-job-execution.service.js.map +1 -1
- package/background-job/src/lib/notification/background-job-notification.port.d.ts +20 -0
- package/background-job/src/lib/notification/background-job-notification.port.d.ts.map +1 -0
- package/background-job/src/lib/notification/background-job-notification.port.js +31 -0
- package/background-job/src/lib/notification/background-job-notification.port.js.map +1 -0
- package/background-job/src/lib/queue/background-job-recovery.service.d.ts +22 -0
- package/background-job/src/lib/queue/background-job-recovery.service.d.ts.map +1 -0
- package/background-job/src/lib/queue/background-job-recovery.service.js +101 -0
- package/background-job/src/lib/queue/background-job-recovery.service.js.map +1 -0
- package/background-job/src/lib/store/background-job-attempt-store.service.d.ts +12 -0
- package/background-job/src/lib/store/background-job-attempt-store.service.d.ts.map +1 -1
- package/background-job/src/lib/store/background-job-attempt-store.service.js +30 -0
- package/background-job/src/lib/store/background-job-attempt-store.service.js.map +1 -1
- package/background-job/src/lib/store/background-job-store.service.d.ts +25 -3
- package/background-job/src/lib/store/background-job-store.service.d.ts.map +1 -1
- package/background-job/src/lib/store/background-job-store.service.js +52 -24
- package/background-job/src/lib/store/background-job-store.service.js.map +1 -1
- package/background-job/src/lib/store/jql-filter.util.d.ts +1 -0
- package/background-job/src/lib/store/jql-filter.util.d.ts.map +1 -1
- package/background-job/src/lib/store/jql-filter.util.js +4 -0
- package/background-job/src/lib/store/jql-filter.util.js.map +1 -1
- package/background-job/src/lib/tray/background-job-tray-realtime.publisher.d.ts +17 -0
- package/background-job/src/lib/tray/background-job-tray-realtime.publisher.d.ts.map +1 -0
- package/background-job/src/lib/tray/background-job-tray-realtime.publisher.js +61 -0
- package/background-job/src/lib/tray/background-job-tray-realtime.publisher.js.map +1 -0
- package/core/src/lib/entity-storage/entity-mutation-events/entity-mutation-event-emitter.service.d.ts +2 -1
- package/core/src/lib/entity-storage/entity-mutation-events/entity-mutation-event-emitter.service.d.ts.map +1 -1
- package/core/src/lib/entity-storage/entity-mutation-events/entity-mutation-event-emitter.service.js +3 -0
- package/core/src/lib/entity-storage/entity-mutation-events/entity-mutation-event-emitter.service.js.map +1 -1
- package/core/src/lib/entity-storage/entity-mutation-events/entity-mutation-event.types.d.ts +12 -0
- package/core/src/lib/entity-storage/entity-mutation-events/entity-mutation-event.types.d.ts.map +1 -1
- package/core/src/lib/entity-storage/entity-mutation-events/entity-mutation-event.types.js +6 -1
- package/core/src/lib/entity-storage/entity-mutation-events/entity-mutation-event.types.js.map +1 -1
- package/core/src/lib/entity-storage/entity-storage-middleware.service.d.ts +3 -2
- package/core/src/lib/entity-storage/entity-storage-middleware.service.d.ts.map +1 -1
- package/core/src/lib/entity-storage/entity-storage-middleware.service.js +6 -2
- package/core/src/lib/entity-storage/entity-storage-middleware.service.js.map +1 -1
- package/core/src/lib/runtime/index.d.ts +3 -0
- package/core/src/lib/runtime/index.d.ts.map +1 -1
- package/core/src/lib/runtime/index.js +3 -0
- package/core/src/lib/runtime/index.js.map +1 -1
- package/core/src/lib/runtime/runtime-authz.guard.d.ts +1 -0
- package/core/src/lib/runtime/runtime-authz.guard.d.ts.map +1 -1
- package/core/src/lib/runtime/runtime-authz.guard.js +10 -0
- package/core/src/lib/runtime/runtime-authz.guard.js.map +1 -1
- package/core/src/lib/runtime/runtime-bulk-command.service.d.ts +4 -1
- package/core/src/lib/runtime/runtime-bulk-command.service.d.ts.map +1 -1
- package/core/src/lib/runtime/runtime-bulk-command.service.js +64 -17
- package/core/src/lib/runtime/runtime-bulk-command.service.js.map +1 -1
- package/core/src/lib/runtime/runtime-bulk-progress.realtime.port.d.ts +9 -0
- package/core/src/lib/runtime/runtime-bulk-progress.realtime.port.d.ts.map +1 -0
- package/core/src/lib/runtime/runtime-bulk-progress.realtime.port.js +13 -0
- package/core/src/lib/runtime/runtime-bulk-progress.realtime.port.js.map +1 -0
- package/core/src/lib/runtime/runtime-bulk-progress.store.d.ts +12 -0
- package/core/src/lib/runtime/runtime-bulk-progress.store.d.ts.map +1 -0
- package/core/src/lib/runtime/runtime-bulk-progress.store.js +61 -0
- package/core/src/lib/runtime/runtime-bulk-progress.store.js.map +1 -0
- package/core/src/lib/runtime/runtime-command.controller.d.ts +5 -1
- package/core/src/lib/runtime/runtime-command.controller.d.ts.map +1 -1
- package/core/src/lib/runtime/runtime-command.controller.js +30 -2
- package/core/src/lib/runtime/runtime-command.controller.js.map +1 -1
- package/core/src/lib/runtime/runtime-dispatcher.service.d.ts +3 -2
- package/core/src/lib/runtime/runtime-dispatcher.service.d.ts.map +1 -1
- package/core/src/lib/runtime/runtime-dispatcher.service.js +23 -2
- package/core/src/lib/runtime/runtime-dispatcher.service.js.map +1 -1
- package/core/src/lib/runtime/runtime-request-session.util.d.ts +6 -0
- package/core/src/lib/runtime/runtime-request-session.util.d.ts.map +1 -0
- package/core/src/lib/runtime/runtime-request-session.util.js +21 -0
- package/core/src/lib/runtime/runtime-request-session.util.js.map +1 -0
- package/core/src/lib/runtime/runtime.module.d.ts.map +1 -1
- package/core/src/lib/runtime/runtime.module.js +3 -0
- package/core/src/lib/runtime/runtime.module.js.map +1 -1
- package/domain/abstract/src/index.d.ts +2 -0
- package/domain/abstract/src/index.d.ts.map +1 -1
- package/domain/abstract/src/index.js +2 -0
- package/domain/abstract/src/index.js.map +1 -1
- package/domain/abstract/src/lib/commands/command-concurrency.types.d.ts +30 -0
- package/domain/abstract/src/lib/commands/command-concurrency.types.d.ts.map +1 -0
- package/domain/abstract/src/lib/commands/command-concurrency.types.js +9 -0
- package/domain/abstract/src/lib/commands/command-concurrency.types.js.map +1 -0
- package/domain/abstract/src/lib/commands/command-concurrency.util.d.ts +11 -0
- package/domain/abstract/src/lib/commands/command-concurrency.util.d.ts.map +1 -0
- package/domain/abstract/src/lib/commands/command-concurrency.util.js +53 -0
- package/domain/abstract/src/lib/commands/command-concurrency.util.js.map +1 -0
- package/domain/abstract/src/lib/commands/server-command-registry.token.d.ts +3 -0
- package/domain/abstract/src/lib/commands/server-command-registry.token.d.ts.map +1 -1
- package/domain/abstract/src/lib/commands/server-command-registry.token.js.map +1 -1
- package/domain/abstract/src/lib/commands/server-handler.decorator.d.ts +1 -0
- package/domain/abstract/src/lib/commands/server-handler.decorator.d.ts.map +1 -1
- package/domain/abstract/src/lib/commands/server-handler.decorator.js +1 -0
- package/domain/abstract/src/lib/commands/server-handler.decorator.js.map +1 -1
- package/domain/abstract/src/lib/commands/server-handler.types.d.ts +7 -0
- package/domain/abstract/src/lib/commands/server-handler.types.d.ts.map +1 -1
- package/domain/abstract/src/lib/commands/server-handler.types.js.map +1 -1
- package/domain/providers/src/lib/command-concurrency.guard.d.ts +11 -0
- package/domain/providers/src/lib/command-concurrency.guard.d.ts.map +1 -0
- package/domain/providers/src/lib/command-concurrency.guard.js +110 -0
- package/domain/providers/src/lib/command-concurrency.guard.js.map +1 -0
- package/domain/providers/src/lib/middlewares/lookup-resolver.middleware.d.ts.map +1 -1
- package/domain/providers/src/lib/middlewares/lookup-resolver.middleware.js +5 -3
- package/domain/providers/src/lib/middlewares/lookup-resolver.middleware.js.map +1 -1
- package/domain/providers/src/lib/server-command.module.d.ts.map +1 -1
- package/domain/providers/src/lib/server-command.module.js +8 -1
- package/domain/providers/src/lib/server-command.module.js.map +1 -1
- package/domain/providers/src/lib/server-command.registry.d.ts +7 -3
- package/domain/providers/src/lib/server-command.registry.d.ts.map +1 -1
- package/domain/providers/src/lib/server-command.registry.js +18 -7
- package/domain/providers/src/lib/server-command.registry.js.map +1 -1
- package/domain/providers/src/lib/utils/entity-query-fields-path-planner.util.d.ts +2 -0
- package/domain/providers/src/lib/utils/entity-query-fields-path-planner.util.d.ts.map +1 -1
- package/domain/providers/src/lib/utils/entity-query-fields-path-planner.util.js +12 -2
- package/domain/providers/src/lib/utils/entity-query-fields-path-planner.util.js.map +1 -1
- package/domain/providers/src/lib/utils/entity-relation-join.planner.d.ts.map +1 -1
- package/domain/providers/src/lib/utils/entity-relation-join.planner.js +1 -1
- package/domain/providers/src/lib/utils/entity-relation-join.planner.js.map +1 -1
- package/jql/elasticsearch/src/lib/compile/filter-compiler.js +14 -0
- package/jql/elasticsearch/src/lib/compile/filter-compiler.js.map +1 -1
- package/jql/elasticsearch/src/lib/jql-elasticsearch.engine.js +3 -0
- package/jql/elasticsearch/src/lib/jql-elasticsearch.engine.js.map +1 -1
- package/jql/schema/src/lib/generated/plugin-contributions.bootstrap.d.ts.map +1 -1
- package/jql/schema/src/lib/generated/plugin-contributions.bootstrap.js +6 -0
- package/jql/schema/src/lib/generated/plugin-contributions.bootstrap.js.map +1 -1
- package/observability/abstract/src/index.d.ts +1 -0
- package/observability/abstract/src/index.d.ts.map +1 -1
- package/observability/abstract/src/index.js +1 -0
- package/observability/abstract/src/index.js.map +1 -1
- package/observability/abstract/src/lib/entity-observability-skip.util.d.ts +11 -0
- package/observability/abstract/src/lib/entity-observability-skip.util.d.ts.map +1 -0
- package/observability/abstract/src/lib/entity-observability-skip.util.js +22 -0
- package/observability/abstract/src/lib/entity-observability-skip.util.js.map +1 -0
- package/observability/abstract/src/lib/observability.config.d.ts +2 -0
- package/observability/abstract/src/lib/observability.config.d.ts.map +1 -1
- package/observability/abstract/src/lib/observability.config.js.map +1 -1
- package/observability/abstract/src/lib/runtime-log-buffer.d.ts.map +1 -1
- package/observability/abstract/src/lib/runtime-log-buffer.js +5 -1
- package/observability/abstract/src/lib/runtime-log-buffer.js.map +1 -1
- package/observability/providers/src/lib/context/correlation-fields.util.d.ts +5 -0
- package/observability/providers/src/lib/context/correlation-fields.util.d.ts.map +1 -1
- package/observability/providers/src/lib/context/correlation-fields.util.js +4 -1
- package/observability/providers/src/lib/context/correlation-fields.util.js.map +1 -1
- package/observability/providers/src/lib/context/resolve-request-observability-entity.util.d.ts +14 -0
- package/observability/providers/src/lib/context/resolve-request-observability-entity.util.d.ts.map +1 -0
- package/observability/providers/src/lib/context/resolve-request-observability-entity.util.js +82 -0
- package/observability/providers/src/lib/context/resolve-request-observability-entity.util.js.map +1 -0
- package/observability/providers/src/lib/execution-trace/execution-trace-recorder.service.d.ts.map +1 -1
- package/observability/providers/src/lib/execution-trace/execution-trace-recorder.service.js +3 -0
- package/observability/providers/src/lib/execution-trace/execution-trace-recorder.service.js.map +1 -1
- package/observability/providers/src/lib/http/observability-context.interceptor.d.ts +3 -1
- package/observability/providers/src/lib/http/observability-context.interceptor.d.ts.map +1 -1
- package/observability/providers/src/lib/http/observability-context.interceptor.js +17 -4
- package/observability/providers/src/lib/http/observability-context.interceptor.js.map +1 -1
- package/observability/providers/src/lib/pino/pino.factory.d.ts.map +1 -1
- package/observability/providers/src/lib/pino/pino.factory.js +9 -1
- package/observability/providers/src/lib/pino/pino.factory.js.map +1 -1
- package/package.json +2 -2
- package/realtime/src/lib/delivery/socket-io-realtime.delivery.d.ts +3 -3
- package/realtime/src/lib/delivery/socket-io-realtime.delivery.d.ts.map +1 -1
- package/realtime/src/lib/delivery/socket-io-realtime.delivery.js +10 -2
- package/realtime/src/lib/delivery/socket-io-realtime.delivery.js.map +1 -1
- package/realtime/src/lib/entity-bridge/realtime-bulk-progress-bridge.listener.d.ts +9 -0
- package/realtime/src/lib/entity-bridge/realtime-bulk-progress-bridge.listener.d.ts.map +1 -0
- package/realtime/src/lib/entity-bridge/realtime-bulk-progress-bridge.listener.js +62 -0
- package/realtime/src/lib/entity-bridge/realtime-bulk-progress-bridge.listener.js.map +1 -0
- package/realtime/src/lib/gateway/realtime.gateway.d.ts +2 -2
- package/realtime/src/lib/gateway/realtime.gateway.d.ts.map +1 -1
- package/realtime/src/lib/gateway/realtime.gateway.js +1 -1
- package/realtime/src/lib/gateway/realtime.gateway.js.map +1 -1
- package/realtime/src/lib/realtime.module.d.ts.map +1 -1
- package/realtime/src/lib/realtime.module.js +8 -0
- package/realtime/src/lib/realtime.module.js.map +1 -1
- package/realtime/src/lib/topics/realtime-topics.d.ts +2 -0
- package/realtime/src/lib/topics/realtime-topics.d.ts.map +1 -1
- package/realtime/src/lib/topics/realtime-topics.js +3 -1
- package/realtime/src/lib/topics/realtime-topics.js.map +1 -1
- package/realtime/src/lib/types/realtime.types.d.ts +26 -0
- package/realtime/src/lib/types/realtime.types.d.ts.map +1 -1
- package/realtime/src/lib/types/realtime.types.js.map +1 -1
- package/search/abstract/src/lib/quick-search-content.util.d.ts.map +1 -1
- package/search/abstract/src/lib/quick-search-content.util.js +14 -1
- package/search/abstract/src/lib/quick-search-content.util.js.map +1 -1
- package/search/providers/src/lib/quick-search-index.service.d.ts +9 -1
- package/search/providers/src/lib/quick-search-index.service.d.ts.map +1 -1
- package/search/providers/src/lib/quick-search-index.service.js +53 -15
- package/search/providers/src/lib/quick-search-index.service.js.map +1 -1
- package/search/providers/src/lib/quick-search-provider.module.d.ts.map +1 -1
- package/search/providers/src/lib/quick-search-provider.module.js +12 -0
- package/search/providers/src/lib/quick-search-provider.module.js.map +1 -1
- package/search/providers/src/lib/quick-search-reindex.service.d.ts +15 -6
- package/search/providers/src/lib/quick-search-reindex.service.d.ts.map +1 -1
- package/search/providers/src/lib/quick-search-reindex.service.js +98 -12
- package/search/providers/src/lib/quick-search-reindex.service.js.map +1 -1
- package/search/providers/src/lib/quick-search-related.util.d.ts +14 -0
- package/search/providers/src/lib/quick-search-related.util.d.ts.map +1 -1
- package/search/providers/src/lib/quick-search-related.util.js +142 -8
- package/search/providers/src/lib/quick-search-related.util.js.map +1 -1
- package/security/src/lib/auth/auth.service.js +1 -1
- package/security/src/lib/auth/auth.service.js.map +1 -1
- package/swagger/src/lib/runtime-openapi.service.d.ts.map +1 -1
- package/swagger/src/lib/runtime-openapi.service.js +43 -0
- package/swagger/src/lib/runtime-openapi.service.js.map +1 -1
- package/tracing/abstract/src/index.d.ts +1 -0
- package/tracing/abstract/src/index.d.ts.map +1 -1
- package/tracing/abstract/src/index.js +1 -0
- package/tracing/abstract/src/index.js.map +1 -1
- package/tracing/abstract/src/lib/entity-log.types.d.ts +14 -0
- package/tracing/abstract/src/lib/entity-log.types.d.ts.map +1 -0
- package/tracing/abstract/src/lib/entity-log.types.js +10 -0
- package/tracing/abstract/src/lib/entity-log.types.js.map +1 -0
- package/tracing/abstract/src/lib/entity-trace.tokens.d.ts +2 -0
- package/tracing/abstract/src/lib/entity-trace.tokens.d.ts.map +1 -1
- package/tracing/abstract/src/lib/entity-trace.tokens.js.map +1 -1
- package/tracing/providers/src/lib/entity-trace-config-resolver.service.d.ts +5 -3
- package/tracing/providers/src/lib/entity-trace-config-resolver.service.d.ts.map +1 -1
- package/tracing/providers/src/lib/entity-trace-config-resolver.service.js +36 -11
- package/tracing/providers/src/lib/entity-trace-config-resolver.service.js.map +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './lib/bull-queue-root.module';
|
|
2
2
|
export * from './lib/background-job.module';
|
|
3
|
+
export * from './lib/command-concurrency-lock.registrar';
|
|
3
4
|
export * from './lib/background-job.service';
|
|
4
5
|
export * from './lib/background-job.errors';
|
|
5
6
|
export * from './lib/background-job-redis.config';
|
|
@@ -26,4 +27,6 @@ export * from './lib/queue/bull-queue-worker-registration.service';
|
|
|
26
27
|
export * from './lib/schedule/background-job-schedule-scanner.service';
|
|
27
28
|
export * from './lib/observability/background-job-observability.publisher';
|
|
28
29
|
export * from './lib/observability/background-job-sanitize.util';
|
|
30
|
+
export * from './lib/notification/background-job-notification.port';
|
|
31
|
+
export * from './lib/queue/background-job-recovery.service';
|
|
29
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/framework/server/background-job/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,kDAAkD,CAAC;AACjE,cAAc,mDAAmD,CAAC;AAClE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qDAAqD,CAAC;AACpE,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,sCAAsC,CAAC;AACrD,cAAc,oDAAoD,CAAC;AACnE,cAAc,wDAAwD,CAAC;AACvE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,kDAAkD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/framework/server/background-job/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0CAA0C,CAAC;AACzD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,kDAAkD,CAAC;AACjE,cAAc,mDAAmD,CAAC;AAClE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qDAAqD,CAAC;AACpE,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,sCAAsC,CAAC;AACrD,cAAc,oDAAoD,CAAC;AACnE,cAAc,wDAAwD,CAAC;AACvE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,kDAAkD,CAAC;AACjE,cAAc,qDAAqD,CAAC;AACpE,cAAc,6CAA6C,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./lib/bull-queue-root.module"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./lib/background-job.module"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/command-concurrency-lock.registrar"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./lib/background-job.service"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./lib/background-job.errors"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./lib/background-job-redis.config"), exports);
|
|
@@ -29,4 +30,6 @@ tslib_1.__exportStar(require("./lib/queue/bull-queue-worker-registration.service
|
|
|
29
30
|
tslib_1.__exportStar(require("./lib/schedule/background-job-schedule-scanner.service"), exports);
|
|
30
31
|
tslib_1.__exportStar(require("./lib/observability/background-job-observability.publisher"), exports);
|
|
31
32
|
tslib_1.__exportStar(require("./lib/observability/background-job-sanitize.util"), exports);
|
|
33
|
+
tslib_1.__exportStar(require("./lib/notification/background-job-notification.port"), exports);
|
|
34
|
+
tslib_1.__exportStar(require("./lib/queue/background-job-recovery.service"), exports);
|
|
32
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/framework/server/background-job/src/index.ts"],"names":[],"mappings":";;;AAAA,uEAA6C;AAC7C,sEAA4C;AAC5C,uEAA6C;AAC7C,sEAA4C;AAC5C,4EAAkD;AAClD,2EAAiD;AACjD,oFAA0D;AAC1D,mFAAyD;AACzD,4FAAkE;AAClE,2FAAiE;AACjE,2FAAiE;AACjE,4FAAkE;AAClE,sFAA4D;AAC5D,iFAAuD;AACvD,yFAA+D;AAC/D,8FAAoE;AACpE,2FAAiE;AACjE,iGAAuE;AACvE,oFAA0D;AAC1D,qFAA2D;AAC3D,wFAA8D;AAC9D,wFAA8D;AAC9D,8FAAoE;AACpE,+EAAqD;AACrD,6FAAmE;AACnE,iGAAuE;AACvE,qGAA2E;AAC3E,2FAAiE"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/framework/server/background-job/src/index.ts"],"names":[],"mappings":";;;AAAA,uEAA6C;AAC7C,sEAA4C;AAC5C,mFAAyD;AACzD,uEAA6C;AAC7C,sEAA4C;AAC5C,4EAAkD;AAClD,2EAAiD;AACjD,oFAA0D;AAC1D,mFAAyD;AACzD,4FAAkE;AAClE,2FAAiE;AACjE,2FAAiE;AACjE,4FAAkE;AAClE,sFAA4D;AAC5D,iFAAuD;AACvD,yFAA+D;AAC/D,8FAAoE;AACpE,2FAAiE;AACjE,iGAAuE;AACvE,oFAA0D;AAC1D,qFAA2D;AAC3D,wFAA8D;AAC9D,wFAA8D;AAC9D,8FAAoE;AACpE,+EAAqD;AACrD,6FAAmE;AACnE,iGAAuE;AACvE,qGAA2E;AAC3E,2FAAiE;AACjE,8FAAoE;AACpE,sFAA4D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DynamicModule, type Type } from '@nestjs/common';
|
|
2
2
|
import { type BackgroundJobRedisConnection } from './background-job-redis.config';
|
|
3
3
|
import { BackgroundJobObservabilityPublisher } from './observability/background-job-observability.publisher';
|
|
4
|
+
import { BackgroundJobNotificationPort } from './notification/background-job-notification.port';
|
|
4
5
|
export interface BackgroundJobModuleOptions {
|
|
5
6
|
/**
|
|
6
7
|
* Explicit Redis connection; defaults to `REDIS_URL` / `REDIS_HOST` env vars.
|
|
@@ -21,6 +22,8 @@ export interface BackgroundJobModuleOptions {
|
|
|
21
22
|
readonly enableQueueProcessor?: boolean;
|
|
22
23
|
/** Override the default log-only observability publisher (e.g. system-insight adapter). */
|
|
23
24
|
readonly observabilityPublisher?: Type<BackgroundJobObservabilityPublisher>;
|
|
25
|
+
/** Override the default no-op notification port (e.g. in-app communication adapter). */
|
|
26
|
+
readonly notificationPort?: Type<BackgroundJobNotificationPort>;
|
|
24
27
|
}
|
|
25
28
|
export declare class BackgroundJobModule {
|
|
26
29
|
static forRoot(options?: BackgroundJobModuleOptions): DynamicModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-job.module.d.ts","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/background-job.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAyB,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAKjF,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,+BAA+B,CAAC;AAWvC,OAAO,EACL,mCAAmC,EAEpC,MAAM,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"background-job.module.d.ts","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/background-job.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAyB,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAKjF,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,+BAA+B,CAAC;AAWvC,OAAO,EACL,mCAAmC,EAEpC,MAAM,wDAAwD,CAAC;AAChE,OAAO,EACL,6BAA6B,EAE9B,MAAM,iDAAiD,CAAC;AAqBzD,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,4BAA4B,CAAC;IAC9C;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,qEAAqE;IACrE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,2FAA2F;IAC3F,QAAQ,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAC5E,wFAAwF;IACxF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;CACjE;AAMD,qBACa,mBAAmB;IAC9B,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,0BAA+B,GAAG,aAAa;CAgFxE"}
|
|
@@ -17,8 +17,10 @@ const background_job_retry_scheduler_service_1 = require("./execution/background
|
|
|
17
17
|
const distributed_lock_port_1 = require("./lock/distributed-lock.port");
|
|
18
18
|
const redis_distributed_lock_service_1 = require("./lock/redis-distributed-lock.service");
|
|
19
19
|
const background_job_observability_publisher_1 = require("./observability/background-job-observability.publisher");
|
|
20
|
+
const background_job_notification_port_1 = require("./notification/background-job-notification.port");
|
|
20
21
|
const background_job_dispatcher_service_1 = require("./queue/background-job-dispatcher.service");
|
|
21
22
|
const background_job_failed_reconcile_service_1 = require("./queue/background-job-failed-reconcile.service");
|
|
23
|
+
const background_job_recovery_service_1 = require("./queue/background-job-recovery.service");
|
|
22
24
|
const background_job_processor_1 = require("./queue/background-job.processor");
|
|
23
25
|
const bull_queue_worker_registration_service_1 = require("./queue/bull-queue-worker-registration.service");
|
|
24
26
|
const background_job_schedule_scanner_service_1 = require("./schedule/background-job-schedule-scanner.service");
|
|
@@ -28,6 +30,8 @@ const background_job_schedule_store_service_1 = require("./store/background-job-
|
|
|
28
30
|
const background_job_command_title_resolver_1 = require("./store/background-job-command-title.resolver");
|
|
29
31
|
const background_job_capabilities_resolver_1 = require("./store/background-job-capabilities.resolver");
|
|
30
32
|
const background_job_store_service_1 = require("./store/background-job-store.service");
|
|
33
|
+
const background_job_tray_realtime_publisher_1 = require("./tray/background-job-tray-realtime.publisher");
|
|
34
|
+
const command_concurrency_lock_registrar_1 = require("./command-concurrency-lock.registrar");
|
|
31
35
|
//#endregion
|
|
32
36
|
//#region ---- Background job module ----
|
|
33
37
|
let BackgroundJobModule = BackgroundJobModule_1 = class BackgroundJobModule {
|
|
@@ -47,6 +51,8 @@ let BackgroundJobModule = BackgroundJobModule_1 = class BackgroundJobModule {
|
|
|
47
51
|
background_job_execution_service_1.BackgroundJobExecutionService,
|
|
48
52
|
background_job_dispatcher_service_1.BackgroundJobDispatcherService,
|
|
49
53
|
background_job_service_1.BackgroundJobService,
|
|
54
|
+
background_job_tray_realtime_publisher_1.BackgroundJobTrayRealtimePublisher,
|
|
55
|
+
command_concurrency_lock_registrar_1.CommandConcurrencyLockRegistrar,
|
|
50
56
|
{
|
|
51
57
|
provide: distributed_lock_port_1.DistributedLockPort,
|
|
52
58
|
useFactory: () => connection ? new redis_distributed_lock_service_1.RedisDistributedLockService(connection) : new redis_distributed_lock_service_1.InProcessLockService(),
|
|
@@ -55,6 +61,10 @@ let BackgroundJobModule = BackgroundJobModule_1 = class BackgroundJobModule {
|
|
|
55
61
|
provide: background_job_observability_publisher_1.BackgroundJobObservabilityPublisher,
|
|
56
62
|
useClass: options.observabilityPublisher ?? background_job_observability_publisher_1.LoggingBackgroundJobObservabilityPublisher,
|
|
57
63
|
},
|
|
64
|
+
{
|
|
65
|
+
provide: background_job_notification_port_1.BackgroundJobNotificationPort,
|
|
66
|
+
useClass: options.notificationPort ?? background_job_notification_port_1.NoopBackgroundJobNotificationPort,
|
|
67
|
+
},
|
|
58
68
|
];
|
|
59
69
|
if (connection) {
|
|
60
70
|
if (options.registerBullRoot !== false) {
|
|
@@ -67,7 +77,7 @@ let BackgroundJobModule = BackgroundJobModule_1 = class BackgroundJobModule {
|
|
|
67
77
|
}
|
|
68
78
|
imports.push(bullmq_1.BullModule.registerQueue({ name: background_job_1.AXP_BACKGROUND_JOBS_QUEUE }));
|
|
69
79
|
if (options.enableQueueProcessor !== false) {
|
|
70
|
-
providers.push(background_job_processor_1.BackgroundJobProcessor, background_job_failed_reconcile_service_1.BackgroundJobFailedReconcileService);
|
|
80
|
+
providers.push(background_job_processor_1.BackgroundJobProcessor, background_job_failed_reconcile_service_1.BackgroundJobFailedReconcileService, background_job_recovery_service_1.BackgroundJobRecoveryService);
|
|
71
81
|
}
|
|
72
82
|
}
|
|
73
83
|
if (options.enableScheduleScanner !== false) {
|
|
@@ -89,6 +99,8 @@ let BackgroundJobModule = BackgroundJobModule_1 = class BackgroundJobModule {
|
|
|
89
99
|
background_job_schedule_store_service_1.BackgroundJobScheduleStoreService,
|
|
90
100
|
distributed_lock_port_1.DistributedLockPort,
|
|
91
101
|
background_job_observability_publisher_1.BackgroundJobObservabilityPublisher,
|
|
102
|
+
background_job_notification_port_1.BackgroundJobNotificationPort,
|
|
103
|
+
background_job_tray_realtime_publisher_1.BackgroundJobTrayRealtimePublisher,
|
|
92
104
|
],
|
|
93
105
|
};
|
|
94
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-job.module.js","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/background-job.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAiF;AACjF,2CAA4C;AAC5C,iEAA6E;AAC7E,kFAAyF;AACzF,qFAA6F;AAC7F,+EAGuC;AACvC,qEAAgE;AAChE,+FAAyF;AACzF,yGAAmG;AACnG,mGAA6F;AAC7F,+GAAwG;AACxG,wEAAmE;AACnE,0FAG+C;AAC/C,mHAGgE;AAChE,iGAA2F;AAC3F,6GAAsG;AACtG,+EAA0E;AAC1E,2GAAoG;AACpG,gHAAyG;AAEzG,uGAAgG;AAChG,6FAAuF;AACvF,yGAAkG;AAClG,yGAAkG;AAClG,uGAEsD;AACtD,uFAAiF;
|
|
1
|
+
{"version":3,"file":"background-job.module.js","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/background-job.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAiF;AACjF,2CAA4C;AAC5C,iEAA6E;AAC7E,kFAAyF;AACzF,qFAA6F;AAC7F,+EAGuC;AACvC,qEAAgE;AAChE,+FAAyF;AACzF,yGAAmG;AACnG,mGAA6F;AAC7F,+GAAwG;AACxG,wEAAmE;AACnE,0FAG+C;AAC/C,mHAGgE;AAChE,sGAGyD;AACzD,iGAA2F;AAC3F,6GAAsG;AACtG,6FAAuF;AACvF,+EAA0E;AAC1E,2GAAoG;AACpG,gHAAyG;AAEzG,uGAAgG;AAChG,6FAAuF;AACvF,yGAAkG;AAClG,yGAAkG;AAClG,uGAEsD;AACtD,uFAAiF;AACjF,0GAAmG;AACnG,6FAAuF;AA4BvF,YAAY;AAEZ,yC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E,CAAC,CAAC,CAAC;YAC5E,IAAI,OAAO,CAAC,oBAAoB,KAAK,KAAK,EAAE,CAAC;gBAC3C,SAAS,CAAC,IAAI,CACZ,iDAAsB,EACtB,6EAAmC,EACnC,8DAA4B,CAC7B,CAAC;YACJ,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,qBAAqB,KAAK,KAAK,EAAE,CAAC;YAC5C,SAAS,CAAC,IAAI,CAAC,6EAAmC,CAAC,CAAC;QACtD,CAAC;QAED,OAAO;YACL,MAAM,EAAE,qBAAmB;YAC3B,OAAO;YACP,SAAS;YACT,OAAO,EAAE;gBACP,6CAAoB;gBACpB,kEAA8B;gBAC9B,gEAA6B;gBAC7B,sEAAgC;gBAChC,wDAAyB;gBACzB,yEAAiC;gBACjC,wEAAiC;gBACjC,uEAAgC;gBAChC,yEAAiC;gBACjC,2CAAmB;gBACnB,4EAAmC;gBACnC,gEAA6B;gBAC7B,2EAAkC;aACnC;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAjFY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,mBAAmB,CAiF/B;AAED,YAAY"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type AXPBackgroundJob, type AXPCreateBackgroundJobRequest, type AXPCreateBackgroundJobResult, type AXPCancelBackgroundJobResult, type AXPRetryBackgroundJobResult } from '@acorex-platform/framework-shared/background-job';
|
|
1
|
+
import { type AXPBackgroundJob, type AXPCreateBackgroundJobRequest, type AXPCreateBackgroundJobResult, type AXPCancelBackgroundJobResult, type AXPDismissBackgroundJobsResult, type AXPRetryBackgroundJobResult } from '@acorex-platform/framework-shared/background-job';
|
|
2
2
|
import { BackgroundJobCancellationService } from './execution/background-job-cancellation.service';
|
|
3
3
|
import { BackgroundJobDispatcherService } from './queue/background-job-dispatcher.service';
|
|
4
4
|
import { BackgroundJobAttemptStoreService } from './store/background-job-attempt-store.service';
|
|
5
5
|
import { BackgroundJobCommandTitleResolver } from './store/background-job-command-title.resolver';
|
|
6
6
|
import { BackgroundJobStoreService } from './store/background-job-store.service';
|
|
7
|
+
import { BackgroundJobTrayRealtimePublisher } from './tray/background-job-tray-realtime.publisher';
|
|
7
8
|
/**
|
|
8
9
|
* Public entry point for job lifecycle commands (spec §5.1).
|
|
9
10
|
* Server command handlers and module controllers call this service.
|
|
@@ -14,8 +15,9 @@ export declare class BackgroundJobService {
|
|
|
14
15
|
private readonly commandTitleResolver;
|
|
15
16
|
private readonly dispatcher;
|
|
16
17
|
private readonly cancellation;
|
|
18
|
+
private readonly trayRealtime;
|
|
17
19
|
private readonly logger;
|
|
18
|
-
constructor(jobStore: BackgroundJobStoreService, attemptStore: BackgroundJobAttemptStoreService, commandTitleResolver: BackgroundJobCommandTitleResolver, dispatcher: BackgroundJobDispatcherService, cancellation: BackgroundJobCancellationService);
|
|
20
|
+
constructor(jobStore: BackgroundJobStoreService, attemptStore: BackgroundJobAttemptStoreService, commandTitleResolver: BackgroundJobCommandTitleResolver, dispatcher: BackgroundJobDispatcherService, cancellation: BackgroundJobCancellationService, trayRealtime: BackgroundJobTrayRealtimePublisher);
|
|
19
21
|
createJob(request: AXPCreateBackgroundJobRequest): Promise<AXPCreateBackgroundJobResult>;
|
|
20
22
|
cancelJob(jobId: string, options?: {
|
|
21
23
|
reason?: string;
|
|
@@ -34,6 +36,11 @@ export declare class BackgroundJobService {
|
|
|
34
36
|
replayDeadLetter(jobId: string): Promise<{
|
|
35
37
|
jobId: string;
|
|
36
38
|
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Hides terminal jobs from the initiator tray (single or bulk).
|
|
41
|
+
* Only the job owner may dismiss; already-dismissed ids are skipped.
|
|
42
|
+
*/
|
|
43
|
+
dismissFromTray(jobIds: readonly string[], userId: string): Promise<AXPDismissBackgroundJobsResult>;
|
|
37
44
|
getJob(jobId: string): Promise<AXPBackgroundJob | null>;
|
|
38
45
|
private resolveCreateCommand;
|
|
39
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-job.service.d.ts","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/background-job.service.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"background-job.service.d.ts","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/background-job.service.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,gBAAgB,EAErB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAEjC,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EAEjC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,OAAO,EAAE,kCAAkC,EAAE,MAAM,+CAA+C,CAAC;AAInG;;;GAGG;AACH,qBACa,oBAAoB;IAI7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAR/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;gBAG7C,QAAQ,EAAE,yBAAyB,EACnC,YAAY,EAAE,gCAAgC,EAC9C,oBAAoB,EAAE,iCAAiC,EACvD,UAAU,EAAE,8BAA8B,EAC1C,YAAY,EAAE,gCAAgC,EAC9C,YAAY,EAAE,kCAAkC;IAK7D,SAAS,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAuFxF,SAAS,CACb,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO,GACtD,OAAO,CAAC,4BAA4B,CAAC;IAIxC,2CAA2C;IACrC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAe7D,sFAAsF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA4BnE;;;OAGG;IACG,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAwDjE;;;OAGG;IACG,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAsCnG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAQ/C,oBAAoB;CAqBnC"}
|
|
@@ -11,18 +11,20 @@ const background_job_attempt_store_service_1 = require("./store/background-job-a
|
|
|
11
11
|
const background_job_command_title_resolver_1 = require("./store/background-job-command-title.resolver");
|
|
12
12
|
const background_job_store_service_1 = require("./store/background-job-store.service");
|
|
13
13
|
const background_job_errors_1 = require("./background-job.errors");
|
|
14
|
+
const background_job_tray_realtime_publisher_1 = require("./tray/background-job-tray-realtime.publisher");
|
|
14
15
|
//#region ---- Background job facade (create / cancel / retry / replay / delete) ----
|
|
15
16
|
/**
|
|
16
17
|
* Public entry point for job lifecycle commands (spec §5.1).
|
|
17
18
|
* Server command handlers and module controllers call this service.
|
|
18
19
|
*/
|
|
19
20
|
let BackgroundJobService = BackgroundJobService_1 = class BackgroundJobService {
|
|
20
|
-
constructor(jobStore, attemptStore, commandTitleResolver, dispatcher, cancellation) {
|
|
21
|
+
constructor(jobStore, attemptStore, commandTitleResolver, dispatcher, cancellation, trayRealtime) {
|
|
21
22
|
this.jobStore = jobStore;
|
|
22
23
|
this.attemptStore = attemptStore;
|
|
23
24
|
this.commandTitleResolver = commandTitleResolver;
|
|
24
25
|
this.dispatcher = dispatcher;
|
|
25
26
|
this.cancellation = cancellation;
|
|
27
|
+
this.trayRealtime = trayRealtime;
|
|
26
28
|
this.logger = new common_1.Logger(BackgroundJobService_1.name);
|
|
27
29
|
}
|
|
28
30
|
//#region ---- Create ----
|
|
@@ -76,6 +78,9 @@ let BackgroundJobService = BackgroundJobService_1 = class BackgroundJobService {
|
|
|
76
78
|
correlationId: request.correlationId,
|
|
77
79
|
parentJobId: request.parentJobId,
|
|
78
80
|
createdAt: now,
|
|
81
|
+
...(request.statusText ? { statusText: request.statusText } : {}),
|
|
82
|
+
...(request.progress !== undefined ? { progress: request.progress } : {}),
|
|
83
|
+
...(request.currentStep ? { currentStep: request.currentStep } : {}),
|
|
79
84
|
...(request.stateInfo ? { stateInfo: request.stateInfo } : {}),
|
|
80
85
|
});
|
|
81
86
|
// History middleware may overwrite scopeInfo from the caller session;
|
|
@@ -88,6 +93,7 @@ let BackgroundJobService = BackgroundJobService_1 = class BackgroundJobService {
|
|
|
88
93
|
job.scopeInfo = scopeInfo;
|
|
89
94
|
await this.dispatcher.dispatch(job.id, 'initial');
|
|
90
95
|
job.status = 'queued';
|
|
96
|
+
await this.trayRealtime.notify(job, 'created');
|
|
91
97
|
return { jobId: job.id, job };
|
|
92
98
|
}
|
|
93
99
|
//#endregion
|
|
@@ -187,6 +193,39 @@ let BackgroundJobService = BackgroundJobService_1 = class BackgroundJobService {
|
|
|
187
193
|
await this.dispatcher.dispatch(replay.id, 'dead-letter-replay');
|
|
188
194
|
return { jobId: replay.id };
|
|
189
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Hides terminal jobs from the initiator tray (single or bulk).
|
|
198
|
+
* Only the job owner may dismiss; already-dismissed ids are skipped.
|
|
199
|
+
*/
|
|
200
|
+
async dismissFromTray(jobIds, userId) {
|
|
201
|
+
const scopedUserId = userId.trim();
|
|
202
|
+
const ids = [...new Set(jobIds.map((id) => id?.trim()).filter(Boolean))];
|
|
203
|
+
if (!scopedUserId || ids.length === 0) {
|
|
204
|
+
return { affectedIds: [] };
|
|
205
|
+
}
|
|
206
|
+
const affectedIds = [];
|
|
207
|
+
const now = new Date().toISOString();
|
|
208
|
+
for (const jobId of ids) {
|
|
209
|
+
const job = await this.jobStore.getOne(jobId);
|
|
210
|
+
if (!job) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (job.userId?.trim() !== scopedUserId) {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (!(0, background_job_1.isBackgroundJobTerminal)(job.status)) {
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
if (job.trayDismissedAt) {
|
|
220
|
+
affectedIds.push(jobId);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
await this.jobStore.patch(jobId, { trayDismissedAt: now });
|
|
224
|
+
affectedIds.push(jobId);
|
|
225
|
+
await this.trayRealtime.notify({ ...job, trayDismissedAt: now }, 'dismissed');
|
|
226
|
+
}
|
|
227
|
+
return { affectedIds };
|
|
228
|
+
}
|
|
190
229
|
//#endregion
|
|
191
230
|
//#region ---- Reads ----
|
|
192
231
|
async getJob(jobId) {
|
|
@@ -216,7 +255,8 @@ exports.BackgroundJobService = BackgroundJobService = BackgroundJobService_1 = t
|
|
|
216
255
|
background_job_attempt_store_service_1.BackgroundJobAttemptStoreService,
|
|
217
256
|
background_job_command_title_resolver_1.BackgroundJobCommandTitleResolver,
|
|
218
257
|
background_job_dispatcher_service_1.BackgroundJobDispatcherService,
|
|
219
|
-
background_job_cancellation_service_1.BackgroundJobCancellationService
|
|
258
|
+
background_job_cancellation_service_1.BackgroundJobCancellationService,
|
|
259
|
+
background_job_tray_realtime_publisher_1.BackgroundJobTrayRealtimePublisher])
|
|
220
260
|
], BackgroundJobService);
|
|
221
261
|
//#endregion
|
|
222
262
|
//# sourceMappingURL=background-job.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-job.service.js","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/background-job.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"background-job.service.js","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/background-job.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AACpD,qFAe0D;AAC1D,yGAAmG;AACnG,iGAA2F;AAC3F,uGAAgG;AAChG,yGAAkG;AAClG,uFAAiF;AACjF,mEAAmG;AACnG,0GAAmG;AAEnG,qFAAqF;AAErF;;;GAGG;AAEI,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAG/B,YACmB,QAAmC,EACnC,YAA8C,EAC9C,oBAAuD,EACvD,UAA0C,EAC1C,YAA8C,EAC9C,YAAgD;QALhD,aAAQ,GAAR,QAAQ,CAA2B;QACnC,iBAAY,GAAZ,YAAY,CAAkC;QAC9C,yBAAoB,GAApB,oBAAoB,CAAmC;QACvD,eAAU,GAAV,UAAU,CAAgC;QAC1C,iBAAY,GAAZ,YAAY,CAAkC;QAC9C,iBAAY,GAAZ,YAAY,CAAoC;QARlD,WAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAS7D,CAAC;IAEJ,0BAA0B;IAE1B,KAAK,CAAC,SAAS,CAAC,OAAsC;QACpD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QACzD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;QAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC1C,IAAI,C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C,CAAC;IACrC,CAAC;IAED,YAAY;IAEZ,2BAA2B;IAEnB,KAAK,CAAC,oBAAoB,CAChC,OAAsC;QAEtC,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;QACzC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,KAAK,GACT,IAAA,0CAAyB,EAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC;YACjD,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC9C,SAAS,CAAC;QAEZ,OAAO;YACL,GAAG;YACH,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE;YACvC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5B,CAAC;IACJ,CAAC;CAGF,CAAA;AA5RY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;6CAKkB,wDAAyB;QACrB,uEAAgC;QACxB,yEAAiC;QAC3C,kEAA8B;QAC5B,sEAAgC;QAChC,2EAAkC;GATxD,oBAAoB,CA4RhC;AAED,YAAY"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { ServerCommandRegistry } from '@acorex-platform/framework-server/domain/providers';
|
|
3
|
+
import { DistributedLockPort } from './lock/distributed-lock.port';
|
|
4
|
+
/**
|
|
5
|
+
* Hands the job-engine distributed lock to {@link ServerCommandRegistry}
|
|
6
|
+
* so `@ServerHandler({ concurrency })` can lock across API/worker processes.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CommandConcurrencyLockRegistrar implements OnModuleInit {
|
|
9
|
+
private readonly registry;
|
|
10
|
+
private readonly lock;
|
|
11
|
+
constructor(registry: ServerCommandRegistry, lock: DistributedLockPort);
|
|
12
|
+
onModuleInit(): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=command-concurrency-lock.registrar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-concurrency-lock.registrar.d.ts","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/command-concurrency-lock.registrar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAInE;;;GAGG;AACH,qBACa,+BAAgC,YAAW,YAAY;IAEhE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBADJ,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,EAAE,mBAAmB;IAG5C,YAAY,IAAI,IAAI;CAGrB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandConcurrencyLockRegistrar = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const providers_1 = require("@acorex-platform/framework-server/domain/providers");
|
|
7
|
+
const distributed_lock_port_1 = require("./lock/distributed-lock.port");
|
|
8
|
+
//#region ----- Command concurrency lock registrar -----
|
|
9
|
+
/**
|
|
10
|
+
* Hands the job-engine distributed lock to {@link ServerCommandRegistry}
|
|
11
|
+
* so `@ServerHandler({ concurrency })` can lock across API/worker processes.
|
|
12
|
+
*/
|
|
13
|
+
let CommandConcurrencyLockRegistrar = class CommandConcurrencyLockRegistrar {
|
|
14
|
+
constructor(registry, lock) {
|
|
15
|
+
this.registry = registry;
|
|
16
|
+
this.lock = lock;
|
|
17
|
+
}
|
|
18
|
+
onModuleInit() {
|
|
19
|
+
this.registry.setConcurrencyLock(this.lock);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.CommandConcurrencyLockRegistrar = CommandConcurrencyLockRegistrar;
|
|
23
|
+
exports.CommandConcurrencyLockRegistrar = CommandConcurrencyLockRegistrar = tslib_1.__decorate([
|
|
24
|
+
(0, common_1.Injectable)(),
|
|
25
|
+
tslib_1.__metadata("design:paramtypes", [providers_1.ServerCommandRegistry,
|
|
26
|
+
distributed_lock_port_1.DistributedLockPort])
|
|
27
|
+
], CommandConcurrencyLockRegistrar);
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=command-concurrency-lock.registrar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-concurrency-lock.registrar.js","sourceRoot":"","sources":["../../../../../../../libs/framework/server/background-job/src/lib/command-concurrency-lock.registrar.ts"],"names":[],"mappings":";;;;AAAA,2CAA+D;AAC/D,kFAA2F;AAC3F,wEAAmE;AAEnE,wDAAwD;AAExD;;;GAGG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAC1C,YACmB,QAA+B,EAC/B,IAAyB;QADzB,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,SAAI,GAAJ,IAAI,CAAqB;IACzC,CAAC;IAEJ,YAAY;QACV,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;CACF,CAAA;AATY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,mBAAU,GAAE;6CAGkB,iCAAqB;QACzB,2CAAmB;GAHjC,+BAA+B,CAS3C;AAED,YAAY"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AXPCancelBackgroundJobResult } from '@acorex-platform/framework-shared/background-job';
|
|
2
2
|
import { BackgroundJobCapabilitiesResolver } from '../store/background-job-capabilities.resolver';
|
|
3
3
|
import { BackgroundJobStoreService } from '../store/background-job-store.service';
|
|
4
|
+
import { BackgroundJobTrayRealtimePublisher } from '../tray/background-job-tray-realtime.publisher';
|
|
4
5
|
/**
|
|
5
6
|
* Persists cancellation state (survives worker restarts) and aborts locally
|
|
6
7
|
* running attempts via their registered `AbortController`.
|
|
@@ -11,12 +12,15 @@ import { BackgroundJobStoreService } from '../store/background-job-store.service
|
|
|
11
12
|
export declare class BackgroundJobCancellationService {
|
|
12
13
|
private readonly jobStore;
|
|
13
14
|
private readonly capabilitiesResolver;
|
|
15
|
+
private readonly trayRealtime;
|
|
14
16
|
private readonly logger;
|
|
15
17
|
/** AbortControllers for attempts running in THIS process, keyed by jobId. */
|
|
16
18
|
private readonly localControllers;
|
|
17
|
-
constructor(jobStore: BackgroundJobStoreService, capabilitiesResolver: BackgroundJobCapabilitiesResolver);
|
|
19
|
+
constructor(jobStore: BackgroundJobStoreService, capabilitiesResolver: BackgroundJobCapabilitiesResolver, trayRealtime: BackgroundJobTrayRealtimePublisher);
|
|
18
20
|
registerLocalExecution(jobId: string, controller: AbortController): void;
|
|
19
21
|
unregisterLocalExecution(jobId: string): void;
|
|
22
|
+
/** True when this process currently holds the attempt AbortController for `jobId`. */
|
|
23
|
+
isExecutingLocally(jobId: string): boolean;
|
|
20
24
|
isCancellationRequested(jobId: string): Promise<boolean>;
|
|
21
25
|
requestCancellation(jobId: string, options?: {
|
|
22
26
|
reason?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-job-cancellation.service.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/framework/server/background-job/src/lib/execution/background-job-cancellation.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AACrG,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"background-job-cancellation.service.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/framework/server/background-job/src/lib/execution/background-job-cancellation.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AACrG,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAIpG;;;;;;GAMG;AACH,qBACa,gCAAgC;IAMzC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAP/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqD;IAC5E,6EAA6E;IAC7E,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsC;gBAGpD,QAAQ,EAAE,yBAAyB,EACnC,oBAAoB,EAAE,iCAAiC,EACvD,YAAY,EAAE,kCAAkC;IAGnE,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI;IAIxE,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7C,sFAAsF;IACtF,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIpC,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxD,mBAAmB,CACvB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO,GACtD,OAAO,CAAC,4BAA4B,CAAC;CA6CzC"}
|
|
@@ -6,6 +6,7 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
const common_1 = require("@nestjs/common");
|
|
7
7
|
const background_job_capabilities_resolver_1 = require("../store/background-job-capabilities.resolver");
|
|
8
8
|
const background_job_store_service_1 = require("../store/background-job-store.service");
|
|
9
|
+
const background_job_tray_realtime_publisher_1 = require("../tray/background-job-tray-realtime.publisher");
|
|
9
10
|
//#region ---- Cancellation service (spec §5.1, §7.3) ----
|
|
10
11
|
/**
|
|
11
12
|
* Persists cancellation state (survives worker restarts) and aborts locally
|
|
@@ -15,9 +16,10 @@ const background_job_store_service_1 = require("../store/background-job-store.se
|
|
|
15
16
|
* against the persisted state; push propagation is Phase 4.
|
|
16
17
|
*/
|
|
17
18
|
let BackgroundJobCancellationService = BackgroundJobCancellationService_1 = class BackgroundJobCancellationService {
|
|
18
|
-
constructor(jobStore, capabilitiesResolver) {
|
|
19
|
+
constructor(jobStore, capabilitiesResolver, trayRealtime) {
|
|
19
20
|
this.jobStore = jobStore;
|
|
20
21
|
this.capabilitiesResolver = capabilitiesResolver;
|
|
22
|
+
this.trayRealtime = trayRealtime;
|
|
21
23
|
this.logger = new common_1.Logger(BackgroundJobCancellationService_1.name);
|
|
22
24
|
/** AbortControllers for attempts running in THIS process, keyed by jobId. */
|
|
23
25
|
this.localControllers = new Map();
|
|
@@ -28,6 +30,10 @@ let BackgroundJobCancellationService = BackgroundJobCancellationService_1 = clas
|
|
|
28
30
|
unregisterLocalExecution(jobId) {
|
|
29
31
|
this.localControllers.delete(jobId);
|
|
30
32
|
}
|
|
33
|
+
/** True when this process currently holds the attempt AbortController for `jobId`. */
|
|
34
|
+
isExecutingLocally(jobId) {
|
|
35
|
+
return this.localControllers.has(jobId);
|
|
36
|
+
}
|
|
31
37
|
async isCancellationRequested(jobId) {
|
|
32
38
|
const job = await this.jobStore.getOne(jobId);
|
|
33
39
|
return Boolean(job?.cancellationRequestedAt) || job?.status === 'cancelled';
|
|
@@ -51,6 +57,8 @@ let BackgroundJobCancellationService = BackgroundJobCancellationService_1 = clas
|
|
|
51
57
|
cancelledBy: options.cancelledBy,
|
|
52
58
|
completedAt: now,
|
|
53
59
|
});
|
|
60
|
+
job.status = 'cancelled';
|
|
61
|
+
await this.trayRealtime.notify(job, 'cancelled');
|
|
54
62
|
return { success: true, status: 'cancelled' };
|
|
55
63
|
}
|
|
56
64
|
// Running: requires cooperative cancellation support (job row, schedule, or command contributor).
|
|
@@ -73,7 +81,8 @@ exports.BackgroundJobCancellationService = BackgroundJobCancellationService;
|
|
|
73
81
|
exports.BackgroundJobCancellationService = BackgroundJobCancellationService = BackgroundJobCancellationService_1 = tslib_1.__decorate([
|
|
74
82
|
(0, common_1.Injectable)(),
|
|
75
83
|
tslib_1.__metadata("design:paramtypes", [background_job_store_service_1.BackgroundJobStoreService,
|
|
76
|
-
background_job_capabilities_resolver_1.BackgroundJobCapabilitiesResolver
|
|
84
|
+
background_job_capabilities_resolver_1.BackgroundJobCapabilitiesResolver,
|
|
85
|
+
background_job_tray_realtime_publisher_1.BackgroundJobTrayRealtimePublisher])
|
|
77
86
|
], BackgroundJobCancellationService);
|
|
78
87
|
//#endregion
|
|
79
88
|
//# sourceMappingURL=background-job-cancellation.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-job-cancellation.service.js","sourceRoot":"","sources":["../../../../../../../../libs/framework/server/background-job/src/lib/execution/background-job-cancellation.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AAEpD,wGAAkG;AAClG,wFAAkF;
|
|
1
|
+
{"version":3,"file":"background-job-cancellation.service.js","sourceRoot":"","sources":["../../../../../../../../libs/framework/server/background-job/src/lib/execution/background-job-cancellation.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AAEpD,wGAAkG;AAClG,wFAAkF;AAClF,2GAAoG;AAEpG,0DAA0D;AAE1D;;;;;;GAMG;AAEI,IAAM,gCAAgC,wCAAtC,MAAM,gCAAgC;IAK3C,YACmB,QAAmC,EACnC,oBAAuD,EACvD,YAAgD;QAFhD,aAAQ,GAAR,QAAQ,CAA2B;QACnC,yBAAoB,GAApB,oBAAoB,CAAmC;QACvD,iBAAY,GAAZ,YAAY,CAAoC;QAP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CAAC,CAAC,CAAC;QAE7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAC;IAC7D,CAAC;CACF,CAAA;AA7EY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,mBAAU,GAAE;6CAOkB,wDAAyB;QACb,wEAAiC;QACzC,2EAAkC;GARxD,gCAAgC,CA6E5C;AAED,YAAY"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ModuleRef } from '@nestjs/core';
|
|
2
|
-
import { type AXPBackgroundJob, type AXPBackgroundJobAttemptTrigger } from '@acorex-platform/framework-shared/background-job';
|
|
2
|
+
import { type AXPBackgroundJob, type AXPBackgroundJobAttempt, type AXPBackgroundJobAttemptTrigger } from '@acorex-platform/framework-shared/background-job';
|
|
3
3
|
import { ServerCommandRegistry } from '@acorex-platform/framework-server/domain/providers';
|
|
4
4
|
import { DistributedLockPort } from '../lock/distributed-lock.port';
|
|
5
5
|
import { BackgroundJobObservabilityPublisher } from '../observability/background-job-observability.publisher';
|
|
6
|
+
import { BackgroundJobNotificationPort } from '../notification/background-job-notification.port';
|
|
6
7
|
import { BackgroundJobAttemptStoreService } from '../store/background-job-attempt-store.service';
|
|
7
8
|
import { BackgroundJobScheduleStoreService } from '../store/background-job-schedule-store.service';
|
|
8
9
|
import { BackgroundJobCapabilitiesResolver } from '../store/background-job-capabilities.resolver';
|
|
@@ -10,6 +11,7 @@ import { BackgroundJobStoreService } from '../store/background-job-store.service
|
|
|
10
11
|
import { BackgroundJobAttemptFactory } from './background-job-attempt.factory';
|
|
11
12
|
import { BackgroundJobCancellationService } from './background-job-cancellation.service';
|
|
12
13
|
import { BackgroundJobRetrySchedulerService } from './background-job-retry-scheduler.service';
|
|
14
|
+
import { BackgroundJobTrayRealtimePublisher } from '../tray/background-job-tray-realtime.publisher';
|
|
13
15
|
export interface ExecuteAttemptInput {
|
|
14
16
|
jobId: string;
|
|
15
17
|
attemptTrigger: AXPBackgroundJobAttemptTrigger;
|
|
@@ -29,9 +31,11 @@ export declare class BackgroundJobExecutionService {
|
|
|
29
31
|
private readonly retryScheduler;
|
|
30
32
|
private readonly lock;
|
|
31
33
|
private readonly observability;
|
|
34
|
+
private readonly notifications;
|
|
35
|
+
private readonly trayRealtime;
|
|
32
36
|
private readonly moduleRef;
|
|
33
37
|
private readonly logger;
|
|
34
|
-
constructor(jobStore: BackgroundJobStoreService, attemptStore: BackgroundJobAttemptStoreService, scheduleStore: BackgroundJobScheduleStoreService, capabilitiesResolver: BackgroundJobCapabilitiesResolver, attemptFactory: BackgroundJobAttemptFactory, serverCommands: ServerCommandRegistry, cancellation: BackgroundJobCancellationService, retryScheduler: BackgroundJobRetrySchedulerService, lock: DistributedLockPort, observability: BackgroundJobObservabilityPublisher, moduleRef: ModuleRef);
|
|
38
|
+
constructor(jobStore: BackgroundJobStoreService, attemptStore: BackgroundJobAttemptStoreService, scheduleStore: BackgroundJobScheduleStoreService, capabilitiesResolver: BackgroundJobCapabilitiesResolver, attemptFactory: BackgroundJobAttemptFactory, serverCommands: ServerCommandRegistry, cancellation: BackgroundJobCancellationService, retryScheduler: BackgroundJobRetrySchedulerService, lock: DistributedLockPort, observability: BackgroundJobObservabilityPublisher, notifications: BackgroundJobNotificationPort, trayRealtime: BackgroundJobTrayRealtimePublisher, moduleRef: ModuleRef);
|
|
35
39
|
executeAttempt(input: ExecuteAttemptInput): Promise<void>;
|
|
36
40
|
private executeAttemptInContext;
|
|
37
41
|
/**
|
|
@@ -39,6 +43,11 @@ export declare class BackgroundJobExecutionService {
|
|
|
39
43
|
* reconciling Redis `failedReason` into the jobs UI).
|
|
40
44
|
*/
|
|
41
45
|
markQueueDeliveryFailure(jobId: string, error: unknown, job?: AXPBackgroundJob | null): Promise<boolean>;
|
|
46
|
+
/**
|
|
47
|
+
* Marks a stale `running` attempt as `abandoned` and applies the job retry policy.
|
|
48
|
+
* No-op when this process still owns the attempt.
|
|
49
|
+
*/
|
|
50
|
+
recoverAbandonedAttempt(attempt: AXPBackgroundJobAttempt): Promise<boolean>;
|
|
42
51
|
private runAttempt;
|
|
43
52
|
private ensureJobCapabilities;
|
|
44
53
|
private createRuntimeContext;
|
|
@@ -51,5 +60,9 @@ export declare class BackgroundJobExecutionService {
|
|
|
51
60
|
private trackScheduleOutcome;
|
|
52
61
|
private publishAttempt;
|
|
53
62
|
private publishJob;
|
|
63
|
+
private publishTrayTerminal;
|
|
64
|
+
private publishTrayRefresh;
|
|
65
|
+
private notifyJobTerminal;
|
|
66
|
+
private notifyScheduleThreshold;
|
|
54
67
|
}
|
|
55
68
|
//# sourceMappingURL=background-job-execution.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-job-execution.service.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/framework/server/background-job/src/lib/execution/background-job-execution.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EASL,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"background-job-execution.service.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/framework/server/background-job/src/lib/execution/background-job-execution.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EASL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAE5B,KAAK,8BAA8B,EAKpC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAW3F,OAAO,EAAE,mBAAmB,EAA8B,MAAM,+BAA+B,CAAC;AAChG,OAAO,EAAE,mCAAmC,EAAE,MAAM,yDAAyD,CAAC;AAC9G,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,gCAAgC,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,iCAAiC,EAAE,MAAM,gDAAgD,CAAC;AACnG,OAAO,EA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