@nest-batch/core 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +368 -0
- package/dist/src/adapters/in-process.adapter.d.ts +140 -0
- package/dist/src/adapters/in-process.adapter.d.ts.map +1 -0
- package/dist/src/adapters/in-process.adapter.js +86 -0
- package/dist/src/adapters/in-process.adapter.js.map +1 -0
- package/dist/src/adapters/index.d.ts +18 -0
- package/dist/src/adapters/index.d.ts.map +1 -0
- package/dist/src/adapters/index.js +35 -0
- package/dist/src/adapters/index.js.map +1 -0
- package/dist/src/builder/batch-builder.d.ts +26 -0
- package/dist/src/builder/batch-builder.d.ts.map +1 -0
- package/dist/src/builder/batch-builder.js +25 -0
- package/dist/src/builder/batch-builder.js.map +1 -0
- package/dist/src/builder/flow-builder.d.ts +59 -0
- package/dist/src/builder/flow-builder.d.ts.map +1 -0
- package/dist/src/builder/flow-builder.js +115 -0
- package/dist/src/builder/flow-builder.js.map +1 -0
- package/dist/src/builder/index.d.ts +5 -0
- package/dist/src/builder/index.d.ts.map +1 -0
- package/dist/src/builder/index.js +23 -0
- package/dist/src/builder/index.js.map +1 -0
- package/dist/src/builder/job-builder.d.ts +76 -0
- package/dist/src/builder/job-builder.d.ts.map +1 -0
- package/dist/src/builder/job-builder.js +166 -0
- package/dist/src/builder/job-builder.js.map +1 -0
- package/dist/src/builder/step-builder.d.ts +74 -0
- package/dist/src/builder/step-builder.d.ts.map +1 -0
- package/dist/src/builder/step-builder.js +144 -0
- package/dist/src/builder/step-builder.js.map +1 -0
- package/dist/src/compiler/builder-types.d.ts +20 -0
- package/dist/src/compiler/builder-types.d.ts.map +1 -0
- package/dist/src/compiler/builder-types.js +6 -0
- package/dist/src/compiler/builder-types.js.map +1 -0
- package/dist/src/compiler/definition-compiler.d.ts +99 -0
- package/dist/src/compiler/definition-compiler.d.ts.map +1 -0
- package/dist/src/compiler/definition-compiler.js +257 -0
- package/dist/src/compiler/definition-compiler.js.map +1 -0
- package/dist/src/compiler/index.d.ts +3 -0
- package/dist/src/compiler/index.d.ts.map +1 -0
- package/dist/src/compiler/index.js +21 -0
- package/dist/src/compiler/index.js.map +1 -0
- package/dist/src/core/errors.d.ts +77 -0
- package/dist/src/core/errors.d.ts.map +1 -0
- package/dist/src/core/errors.js +170 -0
- package/dist/src/core/errors.js.map +1 -0
- package/dist/src/core/execution-context/index.d.ts +4 -0
- package/dist/src/core/execution-context/index.d.ts.map +1 -0
- package/dist/src/core/execution-context/index.js +22 -0
- package/dist/src/core/execution-context/index.js.map +1 -0
- package/dist/src/core/execution-context/json-value.d.ts +5 -0
- package/dist/src/core/execution-context/json-value.d.ts.map +1 -0
- package/dist/src/core/execution-context/json-value.js +6 -0
- package/dist/src/core/execution-context/json-value.js.map +1 -0
- package/dist/src/core/execution-context/serializer.d.ts +4 -0
- package/dist/src/core/execution-context/serializer.d.ts.map +1 -0
- package/dist/src/core/execution-context/serializer.js +34 -0
- package/dist/src/core/execution-context/serializer.js.map +1 -0
- package/dist/src/core/execution-context/validator.d.ts +18 -0
- package/dist/src/core/execution-context/validator.d.ts.map +1 -0
- package/dist/src/core/execution-context/validator.js +90 -0
- package/dist/src/core/execution-context/validator.js.map +1 -0
- package/dist/src/core/index.d.ts +8 -0
- package/dist/src/core/index.d.ts.map +1 -0
- package/dist/src/core/index.js +26 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/ir/decider-definition.d.ts +20 -0
- package/dist/src/core/ir/decider-definition.d.ts.map +1 -0
- package/dist/src/core/ir/decider-definition.js +6 -0
- package/dist/src/core/ir/decider-definition.js.map +1 -0
- package/dist/src/core/ir/index.d.ts +8 -0
- package/dist/src/core/ir/index.d.ts.map +1 -0
- package/dist/src/core/ir/index.js +26 -0
- package/dist/src/core/ir/index.js.map +1 -0
- package/dist/src/core/ir/job-definition.d.ts +15 -0
- package/dist/src/core/ir/job-definition.d.ts.map +1 -0
- package/dist/src/core/ir/job-definition.js +6 -0
- package/dist/src/core/ir/job-definition.js.map +1 -0
- package/dist/src/core/ir/listener-definition.d.ts +10 -0
- package/dist/src/core/ir/listener-definition.d.ts.map +1 -0
- package/dist/src/core/ir/listener-definition.js +6 -0
- package/dist/src/core/ir/listener-definition.js.map +1 -0
- package/dist/src/core/ir/policy-config.d.ts +24 -0
- package/dist/src/core/ir/policy-config.d.ts.map +1 -0
- package/dist/src/core/ir/policy-config.js +6 -0
- package/dist/src/core/ir/policy-config.js.map +1 -0
- package/dist/src/core/ir/refs.d.ts +42 -0
- package/dist/src/core/ir/refs.d.ts.map +1 -0
- package/dist/src/core/ir/refs.js +18 -0
- package/dist/src/core/ir/refs.js.map +1 -0
- package/dist/src/core/ir/step-definition.d.ts +59 -0
- package/dist/src/core/ir/step-definition.d.ts.map +1 -0
- package/dist/src/core/ir/step-definition.js +6 -0
- package/dist/src/core/ir/step-definition.js.map +1 -0
- package/dist/src/core/ir/transition-definition.d.ts +8 -0
- package/dist/src/core/ir/transition-definition.d.ts.map +1 -0
- package/dist/src/core/ir/transition-definition.js +6 -0
- package/dist/src/core/ir/transition-definition.js.map +1 -0
- package/dist/src/core/item/index.d.ts +2 -0
- package/dist/src/core/item/index.d.ts.map +1 -0
- package/dist/src/core/item/index.js +20 -0
- package/dist/src/core/item/index.js.map +1 -0
- package/dist/src/core/item/interfaces.d.ts +64 -0
- package/dist/src/core/item/interfaces.d.ts.map +1 -0
- package/dist/src/core/item/interfaces.js +6 -0
- package/dist/src/core/item/interfaces.js.map +1 -0
- package/dist/src/core/repository/index.d.ts +3 -0
- package/dist/src/core/repository/index.d.ts.map +1 -0
- package/dist/src/core/repository/index.js +21 -0
- package/dist/src/core/repository/index.js.map +1 -0
- package/dist/src/core/repository/job-repository.d.ts +60 -0
- package/dist/src/core/repository/job-repository.d.ts.map +1 -0
- package/dist/src/core/repository/job-repository.js +27 -0
- package/dist/src/core/repository/job-repository.js.map +1 -0
- package/dist/src/core/repository/types.d.ts +84 -0
- package/dist/src/core/repository/types.d.ts.map +1 -0
- package/dist/src/core/repository/types.js +6 -0
- package/dist/src/core/repository/types.js.map +1 -0
- package/dist/src/core/status.d.ts +29 -0
- package/dist/src/core/status.d.ts.map +1 -0
- package/dist/src/core/status.js +58 -0
- package/dist/src/core/status.js.map +1 -0
- package/dist/src/core/transaction/index.d.ts +2 -0
- package/dist/src/core/transaction/index.d.ts.map +1 -0
- package/dist/src/core/transaction/index.js +20 -0
- package/dist/src/core/transaction/index.js.map +1 -0
- package/dist/src/core/transaction/transaction-manager.d.ts +8 -0
- package/dist/src/core/transaction/transaction-manager.d.ts.map +1 -0
- package/dist/src/core/transaction/transaction-manager.js +14 -0
- package/dist/src/core/transaction/transaction-manager.js.map +1 -0
- package/dist/src/core/validation/definition-validator.d.ts +46 -0
- package/dist/src/core/validation/definition-validator.d.ts.map +1 -0
- package/dist/src/core/validation/definition-validator.js +177 -0
- package/dist/src/core/validation/definition-validator.js.map +1 -0
- package/dist/src/core/validation/index.d.ts +2 -0
- package/dist/src/core/validation/index.d.ts.map +1 -0
- package/dist/src/core/validation/index.js +20 -0
- package/dist/src/core/validation/index.js.map +1 -0
- package/dist/src/decorators/constants.d.ts +10 -0
- package/dist/src/decorators/constants.d.ts.map +1 -0
- package/dist/src/decorators/constants.js +50 -0
- package/dist/src/decorators/constants.js.map +1 -0
- package/dist/src/decorators/flow.decorator.d.ts +25 -0
- package/dist/src/decorators/flow.decorator.d.ts.map +1 -0
- package/dist/src/decorators/flow.decorator.js +19 -0
- package/dist/src/decorators/flow.decorator.js.map +1 -0
- package/dist/src/decorators/index.d.ts +8 -0
- package/dist/src/decorators/index.d.ts.map +1 -0
- package/dist/src/decorators/index.js +26 -0
- package/dist/src/decorators/index.js.map +1 -0
- package/dist/src/decorators/item.decorators.d.ts +32 -0
- package/dist/src/decorators/item.decorators.d.ts.map +1 -0
- package/dist/src/decorators/item.decorators.js +40 -0
- package/dist/src/decorators/item.decorators.js.map +1 -0
- package/dist/src/decorators/job.decorator.d.ts +11 -0
- package/dist/src/decorators/job.decorator.d.ts.map +1 -0
- package/dist/src/decorators/job.decorator.js +17 -0
- package/dist/src/decorators/job.decorator.js.map +1 -0
- package/dist/src/decorators/listener.decorators.d.ts +56 -0
- package/dist/src/decorators/listener.decorators.d.ts.map +1 -0
- package/dist/src/decorators/listener.decorators.js +157 -0
- package/dist/src/decorators/listener.decorators.js.map +1 -0
- package/dist/src/decorators/step.decorator.d.ts +25 -0
- package/dist/src/decorators/step.decorator.d.ts.map +1 -0
- package/dist/src/decorators/step.decorator.js +21 -0
- package/dist/src/decorators/step.decorator.js.map +1 -0
- package/dist/src/decorators/tasklet.decorator.d.ts +7 -0
- package/dist/src/decorators/tasklet.decorator.d.ts.map +1 -0
- package/dist/src/decorators/tasklet.decorator.js +21 -0
- package/dist/src/decorators/tasklet.decorator.js.map +1 -0
- package/dist/src/execution/batch-worker-runner.d.ts +27 -0
- package/dist/src/execution/batch-worker-runner.d.ts.map +1 -0
- package/dist/src/execution/batch-worker-runner.js +147 -0
- package/dist/src/execution/batch-worker-runner.js.map +1 -0
- package/dist/src/execution/chunk-step-executor.d.ts +86 -0
- package/dist/src/execution/chunk-step-executor.d.ts.map +1 -0
- package/dist/src/execution/chunk-step-executor.js +482 -0
- package/dist/src/execution/chunk-step-executor.js.map +1 -0
- package/dist/src/execution/execution-strategy.d.ts +110 -0
- package/dist/src/execution/execution-strategy.d.ts.map +1 -0
- package/dist/src/execution/execution-strategy.js +13 -0
- package/dist/src/execution/execution-strategy.js.map +1 -0
- package/dist/src/execution/external-task-execution-strategy.d.ts +36 -0
- package/dist/src/execution/external-task-execution-strategy.d.ts.map +1 -0
- package/dist/src/execution/external-task-execution-strategy.js +97 -0
- package/dist/src/execution/external-task-execution-strategy.js.map +1 -0
- package/dist/src/execution/in-process-execution-strategy.d.ts +129 -0
- package/dist/src/execution/in-process-execution-strategy.d.ts.map +1 -0
- package/dist/src/execution/in-process-execution-strategy.js +141 -0
- package/dist/src/execution/in-process-execution-strategy.js.map +1 -0
- package/dist/src/execution/index.d.ts +14 -0
- package/dist/src/execution/index.d.ts.map +1 -0
- package/dist/src/execution/index.js +32 -0
- package/dist/src/execution/index.js.map +1 -0
- package/dist/src/execution/job-executor.d.ts +145 -0
- package/dist/src/execution/job-executor.d.ts.map +1 -0
- package/dist/src/execution/job-executor.js +475 -0
- package/dist/src/execution/job-executor.js.map +1 -0
- package/dist/src/execution/job-explorer.d.ts +15 -0
- package/dist/src/execution/job-explorer.d.ts.map +1 -0
- package/dist/src/execution/job-explorer.js +84 -0
- package/dist/src/execution/job-explorer.js.map +1 -0
- package/dist/src/execution/job-key.d.ts +3 -0
- package/dist/src/execution/job-key.d.ts.map +1 -0
- package/dist/src/execution/job-key.js +43 -0
- package/dist/src/execution/job-key.js.map +1 -0
- package/dist/src/execution/job-launcher.d.ts +75 -0
- package/dist/src/execution/job-launcher.d.ts.map +1 -0
- package/dist/src/execution/job-launcher.js +112 -0
- package/dist/src/execution/job-launcher.js.map +1 -0
- package/dist/src/execution/job-operator.d.ts +22 -0
- package/dist/src/execution/job-operator.d.ts.map +1 -0
- package/dist/src/execution/job-operator.js +125 -0
- package/dist/src/execution/job-operator.js.map +1 -0
- package/dist/src/execution/listener-invoker.d.ts +164 -0
- package/dist/src/execution/listener-invoker.d.ts.map +1 -0
- package/dist/src/execution/listener-invoker.js +246 -0
- package/dist/src/execution/listener-invoker.js.map +1 -0
- package/dist/src/execution/ref-resolver.d.ts +40 -0
- package/dist/src/execution/ref-resolver.d.ts.map +1 -0
- package/dist/src/execution/ref-resolver.js +41 -0
- package/dist/src/execution/ref-resolver.js.map +1 -0
- package/dist/src/execution/tasklet-step-executor.d.ts +79 -0
- package/dist/src/execution/tasklet-step-executor.d.ts.map +1 -0
- package/dist/src/execution/tasklet-step-executor.js +138 -0
- package/dist/src/execution/tasklet-step-executor.js.map +1 -0
- package/dist/src/explorer/batch-explorer.d.ts +138 -0
- package/dist/src/explorer/batch-explorer.d.ts.map +1 -0
- package/dist/src/explorer/batch-explorer.js +167 -0
- package/dist/src/explorer/batch-explorer.js.map +1 -0
- package/dist/src/explorer/index.d.ts +2 -0
- package/dist/src/explorer/index.d.ts.map +1 -0
- package/dist/src/explorer/index.js +20 -0
- package/dist/src/explorer/index.js.map +1 -0
- package/dist/src/flow/flow-evaluator.d.ts +30 -0
- package/dist/src/flow/flow-evaluator.d.ts.map +1 -0
- package/dist/src/flow/flow-evaluator.js +80 -0
- package/dist/src/flow/flow-evaluator.js.map +1 -0
- package/dist/src/flow/index.d.ts +2 -0
- package/dist/src/flow/index.d.ts.map +1 -0
- package/dist/src/flow/index.js +20 -0
- package/dist/src/flow/index.js.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +90 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/io/checkpoint.d.ts +7 -0
- package/dist/src/io/checkpoint.d.ts.map +1 -0
- package/dist/src/io/checkpoint.js +56 -0
- package/dist/src/io/checkpoint.js.map +1 -0
- package/dist/src/io/database.d.ts +50 -0
- package/dist/src/io/database.d.ts.map +1 -0
- package/dist/src/io/database.js +108 -0
- package/dist/src/io/database.js.map +1 -0
- package/dist/src/io/file-readers.d.ts +54 -0
- package/dist/src/io/file-readers.d.ts.map +1 -0
- package/dist/src/io/file-readers.js +167 -0
- package/dist/src/io/file-readers.js.map +1 -0
- package/dist/src/io/file-writers.d.ts +31 -0
- package/dist/src/io/file-writers.d.ts.map +1 -0
- package/dist/src/io/file-writers.js +80 -0
- package/dist/src/io/file-writers.js.map +1 -0
- package/dist/src/io/index.d.ts +6 -0
- package/dist/src/io/index.d.ts.map +1 -0
- package/dist/src/io/index.js +24 -0
- package/dist/src/io/index.js.map +1 -0
- package/dist/src/io/s3.d.ts +50 -0
- package/dist/src/io/s3.d.ts.map +1 -0
- package/dist/src/io/s3.js +96 -0
- package/dist/src/io/s3.js.map +1 -0
- package/dist/src/listeners/builtin-listeners.d.ts +77 -0
- package/dist/src/listeners/builtin-listeners.d.ts.map +1 -0
- package/dist/src/listeners/builtin-listeners.js +108 -0
- package/dist/src/listeners/builtin-listeners.js.map +1 -0
- package/dist/src/listeners/index.d.ts +8 -0
- package/dist/src/listeners/index.d.ts.map +1 -0
- package/dist/src/listeners/index.js +25 -0
- package/dist/src/listeners/index.js.map +1 -0
- package/dist/src/module/adapter-options.d.ts +39 -0
- package/dist/src/module/adapter-options.d.ts.map +1 -0
- package/dist/src/module/adapter-options.js +34 -0
- package/dist/src/module/adapter-options.js.map +1 -0
- package/dist/src/module/adapter.d.ts +157 -0
- package/dist/src/module/adapter.d.ts.map +1 -0
- package/dist/src/module/adapter.js +80 -0
- package/dist/src/module/adapter.js.map +1 -0
- package/dist/src/module/batch-schedule-registry.d.ts +110 -0
- package/dist/src/module/batch-schedule-registry.d.ts.map +1 -0
- package/dist/src/module/batch-schedule-registry.js +0 -0
- package/dist/src/module/batch-schedule-registry.js.map +1 -0
- package/dist/src/module/index.d.ts +14 -0
- package/dist/src/module/index.d.ts.map +1 -0
- package/dist/src/module/index.js +31 -0
- package/dist/src/module/index.js.map +1 -0
- package/dist/src/module/nest-batch.module.d.ts +236 -0
- package/dist/src/module/nest-batch.module.d.ts.map +1 -0
- package/dist/src/module/nest-batch.module.js +475 -0
- package/dist/src/module/nest-batch.module.js.map +1 -0
- package/dist/src/module/tokens.d.ts +83 -0
- package/dist/src/module/tokens.d.ts.map +1 -0
- package/dist/src/module/tokens.js +58 -0
- package/dist/src/module/tokens.js.map +1 -0
- package/dist/src/observability/event-types.d.ts +55 -0
- package/dist/src/observability/event-types.d.ts.map +1 -0
- package/dist/src/observability/event-types.js +36 -0
- package/dist/src/observability/event-types.js.map +1 -0
- package/dist/src/observability/exporters.d.ts +35 -0
- package/dist/src/observability/exporters.d.ts.map +1 -0
- package/dist/src/observability/exporters.js +93 -0
- package/dist/src/observability/exporters.js.map +1 -0
- package/dist/src/observability/index.d.ts +3 -0
- package/dist/src/observability/index.d.ts.map +1 -0
- package/dist/src/observability/index.js +21 -0
- package/dist/src/observability/index.js.map +1 -0
- package/dist/src/partition-helpers.d.ts +127 -0
- package/dist/src/partition-helpers.d.ts.map +1 -0
- package/dist/src/partition-helpers.js +136 -0
- package/dist/src/partition-helpers.js.map +1 -0
- package/dist/src/policies/backoff.d.ts +3 -0
- package/dist/src/policies/backoff.d.ts.map +1 -0
- package/dist/src/policies/backoff.js +34 -0
- package/dist/src/policies/backoff.js.map +1 -0
- package/dist/src/policies/index.d.ts +4 -0
- package/dist/src/policies/index.d.ts.map +1 -0
- package/dist/src/policies/index.js +22 -0
- package/dist/src/policies/index.js.map +1 -0
- package/dist/src/policies/retry-policy.d.ts +13 -0
- package/dist/src/policies/retry-policy.d.ts.map +1 -0
- package/dist/src/policies/retry-policy.js +55 -0
- package/dist/src/policies/retry-policy.js.map +1 -0
- package/dist/src/policies/skip-policy.d.ts +12 -0
- package/dist/src/policies/skip-policy.d.ts.map +1 -0
- package/dist/src/policies/skip-policy.js +44 -0
- package/dist/src/policies/skip-policy.js.map +1 -0
- package/dist/src/registry/index.d.ts +2 -0
- package/dist/src/registry/index.d.ts.map +1 -0
- package/dist/src/registry/index.js +20 -0
- package/dist/src/registry/index.js.map +1 -0
- package/dist/src/registry/job-registry.d.ts +16 -0
- package/dist/src/registry/job-registry.d.ts.map +1 -0
- package/dist/src/registry/job-registry.js +50 -0
- package/dist/src/registry/job-registry.js.map +1 -0
- package/dist/src/repository/id-generator.d.ts +18 -0
- package/dist/src/repository/id-generator.d.ts.map +1 -0
- package/dist/src/repository/id-generator.js +37 -0
- package/dist/src/repository/id-generator.js.map +1 -0
- package/dist/src/repository/in-memory/in-memory-job-repository.d.ts +49 -0
- package/dist/src/repository/in-memory/in-memory-job-repository.d.ts.map +1 -0
- package/dist/src/repository/in-memory/in-memory-job-repository.js +291 -0
- package/dist/src/repository/in-memory/in-memory-job-repository.js.map +1 -0
- package/dist/src/repository/in-memory/index.d.ts +2 -0
- package/dist/src/repository/in-memory/index.d.ts.map +1 -0
- package/dist/src/repository/in-memory/index.js +20 -0
- package/dist/src/repository/in-memory/index.js.map +1 -0
- package/dist/src/repository/index.d.ts +4 -0
- package/dist/src/repository/index.d.ts.map +1 -0
- package/dist/src/repository/index.js +22 -0
- package/dist/src/repository/index.js.map +1 -0
- package/dist/src/repository/uuid-v7.d.ts +20 -0
- package/dist/src/repository/uuid-v7.d.ts.map +1 -0
- package/dist/src/repository/uuid-v7.js +31 -0
- package/dist/src/repository/uuid-v7.js.map +1 -0
- package/dist/src/scheduling/batch-scheduled.d.ts +87 -0
- package/dist/src/scheduling/batch-scheduled.d.ts.map +1 -0
- package/dist/src/scheduling/batch-scheduled.js +170 -0
- package/dist/src/scheduling/batch-scheduled.js.map +1 -0
- package/dist/src/transaction/in-memory-transaction-manager.d.ts +16 -0
- package/dist/src/transaction/in-memory-transaction-manager.d.ts.map +1 -0
- package/dist/src/transaction/in-memory-transaction-manager.js +33 -0
- package/dist/src/transaction/in-memory-transaction-manager.js.map +1 -0
- package/dist/src/transaction/index.d.ts +2 -0
- package/dist/src/transaction/index.d.ts.map +1 -0
- package/dist/src/transaction/index.js +20 -0
- package/dist/src/transaction/index.js.map +1 -0
- package/dist/tests/contracts/index.d.ts +26 -0
- package/dist/tests/contracts/index.d.ts.map +1 -0
- package/dist/tests/contracts/index.js +37 -0
- package/dist/tests/contracts/index.js.map +1 -0
- package/dist/tests/contracts/job-repository.contract.d.ts +46 -0
- package/dist/tests/contracts/job-repository.contract.d.ts.map +1 -0
- package/dist/tests/contracts/job-repository.contract.js +644 -0
- package/dist/tests/contracts/job-repository.contract.js.map +1 -0
- package/package.json +80 -0
- package/src/adapters/in-process.adapter.ts +182 -0
- package/src/adapters/index.ts +17 -0
- package/src/builder/batch-builder.ts +32 -0
- package/src/builder/flow-builder.ts +141 -0
- package/src/builder/index.ts +4 -0
- package/src/builder/job-builder.ts +206 -0
- package/src/builder/step-builder.ts +190 -0
- package/src/compiler/builder-types.ts +27 -0
- package/src/compiler/definition-compiler.ts +325 -0
- package/src/compiler/index.ts +2 -0
- package/src/core/errors.ts +125 -0
- package/src/core/execution-context/index.ts +3 -0
- package/src/core/execution-context/json-value.ts +3 -0
- package/src/core/execution-context/serializer.ts +21 -0
- package/src/core/execution-context/validator.ts +103 -0
- package/src/core/index.ts +7 -0
- package/src/core/ir/decider-definition.ts +25 -0
- package/src/core/ir/index.ts +7 -0
- package/src/core/ir/job-definition.ts +15 -0
- package/src/core/ir/listener-definition.ts +19 -0
- package/src/core/ir/policy-config.ts +19 -0
- package/src/core/ir/refs.ts +42 -0
- package/src/core/ir/step-definition.ts +62 -0
- package/src/core/ir/transition-definition.ts +9 -0
- package/src/core/item/index.ts +1 -0
- package/src/core/item/interfaces.ts +70 -0
- package/src/core/repository/index.ts +2 -0
- package/src/core/repository/job-repository.ts +100 -0
- package/src/core/repository/types.ts +91 -0
- package/src/core/status.ts +31 -0
- package/src/core/transaction/index.ts +1 -0
- package/src/core/transaction/transaction-manager.ts +8 -0
- package/src/core/validation/definition-validator.ts +215 -0
- package/src/core/validation/index.ts +1 -0
- package/src/decorators/constants.ts +9 -0
- package/src/decorators/flow.decorator.ts +31 -0
- package/src/decorators/index.ts +7 -0
- package/src/decorators/item.decorators.ts +51 -0
- package/src/decorators/job.decorator.ts +16 -0
- package/src/decorators/listener.decorators.ts +142 -0
- package/src/decorators/step.decorator.ts +33 -0
- package/src/decorators/tasklet.decorator.ts +14 -0
- package/src/execution/batch-worker-runner.ts +142 -0
- package/src/execution/chunk-step-executor.ts +594 -0
- package/src/execution/execution-strategy.ts +115 -0
- package/src/execution/external-task-execution-strategy.ts +104 -0
- package/src/execution/in-process-execution-strategy.ts +207 -0
- package/src/execution/index.ts +13 -0
- package/src/execution/job-executor.ts +553 -0
- package/src/execution/job-explorer.ts +73 -0
- package/src/execution/job-key.ts +35 -0
- package/src/execution/job-launcher.ts +132 -0
- package/src/execution/job-operator.ts +127 -0
- package/src/execution/listener-invoker.ts +389 -0
- package/src/execution/ref-resolver.ts +64 -0
- package/src/execution/tasklet-step-executor.ts +182 -0
- package/src/explorer/batch-explorer.ts +251 -0
- package/src/explorer/index.ts +1 -0
- package/src/flow/flow-evaluator.ts +89 -0
- package/src/flow/index.ts +1 -0
- package/src/index.ts +24 -0
- package/src/io/checkpoint.ts +47 -0
- package/src/io/database.ts +114 -0
- package/src/io/file-readers.ts +191 -0
- package/src/io/file-writers.ts +99 -0
- package/src/io/index.ts +5 -0
- package/src/io/s3.ts +117 -0
- package/src/listeners/builtin-listeners.ts +151 -0
- package/src/listeners/index.ts +7 -0
- package/src/module/adapter-options.ts +38 -0
- package/src/module/adapter.ts +160 -0
- package/src/module/batch-schedule-registry.ts +0 -0
- package/src/module/index.ts +13 -0
- package/src/module/nest-batch.module.ts +674 -0
- package/src/module/tokens.ts +95 -0
- package/src/observability/event-types.ts +61 -0
- package/src/observability/exporters.ts +96 -0
- package/src/observability/index.ts +2 -0
- package/src/partition-helpers.ts +204 -0
- package/src/policies/backoff.ts +22 -0
- package/src/policies/index.ts +3 -0
- package/src/policies/retry-policy.ts +57 -0
- package/src/policies/skip-policy.ts +51 -0
- package/src/registry/index.ts +1 -0
- package/src/registry/job-registry.ts +42 -0
- package/src/repository/id-generator.ts +25 -0
- package/src/repository/in-memory/in-memory-job-repository.ts +334 -0
- package/src/repository/in-memory/index.ts +1 -0
- package/src/repository/index.ts +3 -0
- package/src/repository/uuid-v7.ts +40 -0
- package/src/scheduling/batch-scheduled.ts +257 -0
- package/src/transaction/in-memory-transaction-manager.ts +23 -0
- package/src/transaction/index.ts +1 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { FlowExecutionStatus } from '../core/status';
|
|
3
|
+
export interface OnTransitionOptions {
|
|
4
|
+
fromStep: string;
|
|
5
|
+
onStatus: FlowExecutionStatus | string;
|
|
6
|
+
toStep: string | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Declarative flow transition. The decorated method is a marker; the
|
|
10
|
+
* compiler reads its metadata to build a `TransitionDefinition`.
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* ```typescript
|
|
14
|
+
* @Jobable({ id: 'my-job' })
|
|
15
|
+
* class MyJob {
|
|
16
|
+
* @Stepable({ id: 'step1' }) @Tasklet() async step1() {}
|
|
17
|
+
* @Stepable({ id: 'recovery' }) @Tasklet() async recovery() {}
|
|
18
|
+
*
|
|
19
|
+
* @OnTransition({ fromStep: 'step1', onStatus: 'FAILED', toStep: 'recovery' })
|
|
20
|
+
* onFail() {}
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function OnTransition(options: OnTransitionOptions): MethodDecorator;
|
|
25
|
+
//# sourceMappingURL=flow.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.decorator.d.ts","sourceRoot":"","sources":["../../../src/decorators/flow.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAAC;IACvC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,eAAe,CAI1E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "OnTransition", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return OnTransition;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
require("reflect-metadata");
|
|
12
|
+
const _constants = require("./constants");
|
|
13
|
+
function OnTransition(options) {
|
|
14
|
+
return (target, propertyKey, _descriptor)=>{
|
|
15
|
+
Reflect.defineMetadata(_constants.BATCH_TRANSITION_METADATA, options, target, propertyKey);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=flow.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/decorators/flow.decorator.ts"],"sourcesContent":["import 'reflect-metadata';\nimport { BATCH_TRANSITION_METADATA } from './constants';\nimport type { FlowExecutionStatus } from '../core/status';\n\nexport interface OnTransitionOptions {\n fromStep: string;\n onStatus: FlowExecutionStatus | string; // string allowed for enum name lookup\n toStep: string | null;\n}\n\n/**\n * Declarative flow transition. The decorated method is a marker; the\n * compiler reads its metadata to build a `TransitionDefinition`.\n *\n * Usage:\n * ```typescript\n * @Jobable({ id: 'my-job' })\n * class MyJob {\n * @Stepable({ id: 'step1' }) @Tasklet() async step1() {}\n * @Stepable({ id: 'recovery' }) @Tasklet() async recovery() {}\n *\n * @OnTransition({ fromStep: 'step1', onStatus: 'FAILED', toStep: 'recovery' })\n * onFail() {}\n * }\n * ```\n */\nexport function OnTransition(options: OnTransitionOptions): MethodDecorator {\n return (target: object, propertyKey: string | symbol, _descriptor: PropertyDescriptor) => {\n Reflect.defineMetadata(BATCH_TRANSITION_METADATA, options, target, propertyKey);\n };\n}\n"],"names":["OnTransition","options","target","propertyKey","_descriptor","Reflect","defineMetadata","BATCH_TRANSITION_METADATA"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;QA1BT;2BACmC;AAyBnC,SAASA,aAAaC,OAA4B;IACvD,OAAO,CAACC,QAAgBC,aAA8BC;QACpDC,QAAQC,cAAc,CAACC,oCAAyB,EAAEN,SAASC,QAAQC;IACrE;AACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './job.decorator';
|
|
3
|
+
export * from './step.decorator';
|
|
4
|
+
export * from './tasklet.decorator';
|
|
5
|
+
export * from './item.decorators';
|
|
6
|
+
export * from './listener.decorators';
|
|
7
|
+
export * from './flow.decorator';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./constants"), exports);
|
|
6
|
+
_export_star(require("./job.decorator"), exports);
|
|
7
|
+
_export_star(require("./step.decorator"), exports);
|
|
8
|
+
_export_star(require("./tasklet.decorator"), exports);
|
|
9
|
+
_export_star(require("./item.decorators"), exports);
|
|
10
|
+
_export_star(require("./listener.decorators"), exports);
|
|
11
|
+
_export_star(require("./flow.decorator"), exports);
|
|
12
|
+
function _export_star(from, to) {
|
|
13
|
+
Object.keys(from).forEach(function(k) {
|
|
14
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
15
|
+
Object.defineProperty(to, k, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return from[k];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return from;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/decorators/index.ts"],"sourcesContent":["export * from './constants';\nexport * from './job.decorator';\nexport * from './step.decorator';\nexport * from './tasklet.decorator';\nexport * from './item.decorators';\nexport * from './listener.decorators';\nexport * from './flow.decorator';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
/**
|
|
3
|
+
* Marks a method as the `ItemReader.read()` handler for a chunk step.
|
|
4
|
+
*
|
|
5
|
+
* Contract:
|
|
6
|
+
* - Method may return `Promise<T | null>` (null = EOF) OR
|
|
7
|
+
* `AsyncIterable<T>` for streaming-style readers.
|
|
8
|
+
* - Exactly one `@ItemReader()` per chunk step.
|
|
9
|
+
* - Metadata stored on the prototype method under `BATCH_ITEM_READER_METADATA`
|
|
10
|
+
* so the DefinitionCompiler can resolve it to a `ReaderRef`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ItemReader(): MethodDecorator;
|
|
13
|
+
/**
|
|
14
|
+
* Marks a method as the `ItemProcessor.process(item)` handler for a chunk step.
|
|
15
|
+
*
|
|
16
|
+
* Contract:
|
|
17
|
+
* - Receives a single item, returns the (possibly transformed) item.
|
|
18
|
+
* - Returning `null` or `undefined` filters the item out of the chunk.
|
|
19
|
+
* - Exactly one `@ItemProcessor()` per chunk step (or none — processor is optional).
|
|
20
|
+
* - Metadata stored on the prototype method under `BATCH_ITEM_PROCESSOR_METADATA`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ItemProcessor(): MethodDecorator;
|
|
23
|
+
/**
|
|
24
|
+
* Marks a method as the `ItemWriter.write(items)` handler for a chunk step.
|
|
25
|
+
*
|
|
26
|
+
* Contract:
|
|
27
|
+
* - Receives an array of items for the chunk, returns `Promise<void>`.
|
|
28
|
+
* - Exactly one `@ItemWriter()` per chunk step.
|
|
29
|
+
* - Metadata stored on the prototype method under `BATCH_ITEM_WRITER_METADATA`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ItemWriter(): MethodDecorator;
|
|
32
|
+
//# sourceMappingURL=item.decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.decorators.d.ts","sourceRoot":"","sources":["../../../src/decorators/item.decorators.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAO1B;;;;;;;;;GASG;AACH,wBAAgB,UAAU,IAAI,eAAe,CAI5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,eAAe,CAI/C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,eAAe,CAI5C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get ItemProcessor () {
|
|
13
|
+
return ItemProcessor;
|
|
14
|
+
},
|
|
15
|
+
get ItemReader () {
|
|
16
|
+
return ItemReader;
|
|
17
|
+
},
|
|
18
|
+
get ItemWriter () {
|
|
19
|
+
return ItemWriter;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
require("reflect-metadata");
|
|
23
|
+
const _constants = require("./constants");
|
|
24
|
+
function ItemReader() {
|
|
25
|
+
return (target, propertyKey, _descriptor)=>{
|
|
26
|
+
Reflect.defineMetadata(_constants.BATCH_ITEM_READER_METADATA, true, target, propertyKey);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function ItemProcessor() {
|
|
30
|
+
return (target, propertyKey, _descriptor)=>{
|
|
31
|
+
Reflect.defineMetadata(_constants.BATCH_ITEM_PROCESSOR_METADATA, true, target, propertyKey);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function ItemWriter() {
|
|
35
|
+
return (target, propertyKey, _descriptor)=>{
|
|
36
|
+
Reflect.defineMetadata(_constants.BATCH_ITEM_WRITER_METADATA, true, target, propertyKey);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=item.decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/decorators/item.decorators.ts"],"sourcesContent":["import 'reflect-metadata';\nimport {\n BATCH_ITEM_READER_METADATA,\n BATCH_ITEM_PROCESSOR_METADATA,\n BATCH_ITEM_WRITER_METADATA,\n} from './constants';\n\n/**\n * Marks a method as the `ItemReader.read()` handler for a chunk step.\n *\n * Contract:\n * - Method may return `Promise<T | null>` (null = EOF) OR\n * `AsyncIterable<T>` for streaming-style readers.\n * - Exactly one `@ItemReader()` per chunk step.\n * - Metadata stored on the prototype method under `BATCH_ITEM_READER_METADATA`\n * so the DefinitionCompiler can resolve it to a `ReaderRef`.\n */\nexport function ItemReader(): MethodDecorator {\n return (target: object, propertyKey: string | symbol, _descriptor: PropertyDescriptor) => {\n Reflect.defineMetadata(BATCH_ITEM_READER_METADATA, true, target, propertyKey);\n };\n}\n\n/**\n * Marks a method as the `ItemProcessor.process(item)` handler for a chunk step.\n *\n * Contract:\n * - Receives a single item, returns the (possibly transformed) item.\n * - Returning `null` or `undefined` filters the item out of the chunk.\n * - Exactly one `@ItemProcessor()` per chunk step (or none — processor is optional).\n * - Metadata stored on the prototype method under `BATCH_ITEM_PROCESSOR_METADATA`.\n */\nexport function ItemProcessor(): MethodDecorator {\n return (target: object, propertyKey: string | symbol, _descriptor: PropertyDescriptor) => {\n Reflect.defineMetadata(BATCH_ITEM_PROCESSOR_METADATA, true, target, propertyKey);\n };\n}\n\n/**\n * Marks a method as the `ItemWriter.write(items)` handler for a chunk step.\n *\n * Contract:\n * - Receives an array of items for the chunk, returns `Promise<void>`.\n * - Exactly one `@ItemWriter()` per chunk step.\n * - Metadata stored on the prototype method under `BATCH_ITEM_WRITER_METADATA`.\n */\nexport function ItemWriter(): MethodDecorator {\n return (target: object, propertyKey: string | symbol, _descriptor: PropertyDescriptor) => {\n Reflect.defineMetadata(BATCH_ITEM_WRITER_METADATA, true, target, propertyKey);\n };\n}\n"],"names":["ItemProcessor","ItemReader","ItemWriter","target","propertyKey","_descriptor","Reflect","defineMetadata","BATCH_ITEM_READER_METADATA","BATCH_ITEM_PROCESSOR_METADATA","BATCH_ITEM_WRITER_METADATA"],"mappings":";;;;;;;;;;;QAgCgBA;eAAAA;;QAfAC;eAAAA;;QA6BAC;eAAAA;;;QA9CT;2BAKA;AAYA,SAASD;IACd,OAAO,CAACE,QAAgBC,aAA8BC;QACpDC,QAAQC,cAAc,CAACC,qCAA0B,EAAE,MAAML,QAAQC;IACnE;AACF;AAWO,SAASJ;IACd,OAAO,CAACG,QAAgBC,aAA8BC;QACpDC,QAAQC,cAAc,CAACE,wCAA6B,EAAE,MAAMN,QAAQC;IACtE;AACF;AAUO,SAASF;IACd,OAAO,CAACC,QAAgBC,aAA8BC;QACpDC,QAAQC,cAAc,CAACG,qCAA0B,EAAE,MAAMP,QAAQC;IACnE;AACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface JobableOptions {
|
|
2
|
+
id: string;
|
|
3
|
+
restartable?: boolean;
|
|
4
|
+
allowDuplicateInstances?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Class decorator that marks a class as a batch job.
|
|
8
|
+
* Metadata: { id, restartable, allowDuplicateInstances }
|
|
9
|
+
*/
|
|
10
|
+
export declare function Jobable(options: JobableOptions): ClassDecorator;
|
|
11
|
+
//# sourceMappingURL=job.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job.decorator.d.ts","sourceRoot":"","sources":["../../../src/decorators/job.decorator.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAE/D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Jobable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return Jobable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _common = require("@nestjs/common");
|
|
12
|
+
const _constants = require("./constants");
|
|
13
|
+
function Jobable(options) {
|
|
14
|
+
return (0, _common.SetMetadata)(_constants.BATCH_JOB_METADATA, options);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=job.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/decorators/job.decorator.ts"],"sourcesContent":["import { SetMetadata } from '@nestjs/common';\nimport { BATCH_JOB_METADATA } from './constants';\n\nexport interface JobableOptions {\n id: string;\n restartable?: boolean;\n allowDuplicateInstances?: boolean;\n}\n\n/**\n * Class decorator that marks a class as a batch job.\n * Metadata: { id, restartable, allowDuplicateInstances }\n */\nexport function Jobable(options: JobableOptions): ClassDecorator {\n return SetMetadata(BATCH_JOB_METADATA, options);\n}\n"],"names":["Jobable","options","SetMetadata","BATCH_JOB_METADATA"],"mappings":";;;;+BAagBA;;;eAAAA;;;wBAbY;2BACO;AAY5B,SAASA,QAAQC,OAAuB;IAC7C,OAAOC,IAAAA,mBAAW,EAACC,6BAAkB,EAAEF;AACzC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { ListenerKind, ListenerPhase } from '../core/ir/listener-definition';
|
|
3
|
+
/**
|
|
4
|
+
* Stored under `BATCH_LISTENER_METADATA` for each listener method.
|
|
5
|
+
* Mirrors `ListenerDefinition` minus the resolved `ref` (which the
|
|
6
|
+
* DefinitionCompiler fills in by walking the class).
|
|
7
|
+
*
|
|
8
|
+
* The `skip` kind is special: it has no before/after/on-error phase,
|
|
9
|
+
* it is a single fire-and-forget callback per skip event. We record
|
|
10
|
+
* `phase: 'after'` as a placeholder so the metadata shape stays uniform;
|
|
11
|
+
* the skip dispatch table is built in Task 25.
|
|
12
|
+
*/
|
|
13
|
+
export interface ListenerOptions {
|
|
14
|
+
kind: ListenerKind;
|
|
15
|
+
phase: ListenerPhase;
|
|
16
|
+
nonCritical?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Fires before a job execution starts. */
|
|
19
|
+
export declare const BeforeJob: () => MethodDecorator;
|
|
20
|
+
/** Fires after a job execution finishes (regardless of status). */
|
|
21
|
+
export declare const AfterJob: () => MethodDecorator;
|
|
22
|
+
/** Fires before a step execution starts. */
|
|
23
|
+
export declare const BeforeStep: () => MethodDecorator;
|
|
24
|
+
/** Fires after a step execution finishes (regardless of status). */
|
|
25
|
+
export declare const AfterStep: () => MethodDecorator;
|
|
26
|
+
/** Fires before each chunk (read-process-write cycle) starts. */
|
|
27
|
+
export declare const BeforeChunk: () => MethodDecorator;
|
|
28
|
+
/** Fires after each chunk finishes successfully. */
|
|
29
|
+
export declare const AfterChunk: () => MethodDecorator;
|
|
30
|
+
/** Fires when a chunk throws (allows rollback hooks / telemetry). */
|
|
31
|
+
export declare const OnChunkError: () => MethodDecorator;
|
|
32
|
+
/** Fires before each item is read. */
|
|
33
|
+
export declare const BeforeRead: () => MethodDecorator;
|
|
34
|
+
/** Fires after each item is successfully read. */
|
|
35
|
+
export declare const AfterRead: () => MethodDecorator;
|
|
36
|
+
/** Fires when the reader throws. */
|
|
37
|
+
export declare const OnReadError: () => MethodDecorator;
|
|
38
|
+
/** Fires before each item is processed. */
|
|
39
|
+
export declare const BeforeProcess: () => MethodDecorator;
|
|
40
|
+
/** Fires after each item is successfully processed. */
|
|
41
|
+
export declare const AfterProcess: () => MethodDecorator;
|
|
42
|
+
/** Fires when the processor throws. */
|
|
43
|
+
export declare const OnProcessError: () => MethodDecorator;
|
|
44
|
+
/** Fires before the writer receives a chunk. */
|
|
45
|
+
export declare const BeforeWrite: () => MethodDecorator;
|
|
46
|
+
/** Fires after the writer successfully writes a chunk. */
|
|
47
|
+
export declare const AfterWrite: () => MethodDecorator;
|
|
48
|
+
/** Fires when the writer throws. */
|
|
49
|
+
export declare const OnWriteError: () => MethodDecorator;
|
|
50
|
+
/** Fires when a read is skipped (after the skip policy decides to skip). */
|
|
51
|
+
export declare const OnSkipRead: () => MethodDecorator;
|
|
52
|
+
/** Fires when a processed item is skipped. */
|
|
53
|
+
export declare const OnSkipProcess: () => MethodDecorator;
|
|
54
|
+
/** Fires when a write is skipped. */
|
|
55
|
+
export declare const OnSkipWrite: () => MethodDecorator;
|
|
56
|
+
//# sourceMappingURL=listener.decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listener.decorators.d.ts","sourceRoot":"","sources":["../../../src/decorators/listener.decorators.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAElF;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,aAAa,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAoBD,2CAA2C;AAC3C,eAAO,MAAM,SAAS,QAAO,eACwB,CAAC;AAEtD,mEAAmE;AACnE,eAAO,MAAM,QAAQ,QAAO,eACwB,CAAC;AAMrD,4CAA4C;AAC5C,eAAO,MAAM,UAAU,QAAO,eACwB,CAAC;AAEvD,oEAAoE;AACpE,eAAO,MAAM,SAAS,QAAO,eACwB,CAAC;AAMtD,iEAAiE;AACjE,eAAO,MAAM,WAAW,QAAO,eACwB,CAAC;AAExD,oDAAoD;AACpD,eAAO,MAAM,UAAU,QAAO,eACwB,CAAC;AAEvD,qEAAqE;AACrE,eAAO,MAAM,YAAY,QAAO,eACyB,CAAC;AAM1D,sCAAsC;AACtC,eAAO,MAAM,UAAU,QAAO,eAC6B,CAAC;AAE5D,kDAAkD;AAClD,eAAO,MAAM,SAAS,QAAO,eAC6B,CAAC;AAE3D,oCAAoC;AACpC,eAAO,MAAM,WAAW,QAAO,eAC8B,CAAC;AAM9D,2CAA2C;AAC3C,eAAO,MAAM,aAAa,QAAO,eAC6B,CAAC;AAE/D,uDAAuD;AACvD,eAAO,MAAM,YAAY,QAAO,eAC6B,CAAC;AAE9D,uCAAuC;AACvC,eAAO,MAAM,cAAc,QAAO,eAC8B,CAAC;AAMjE,gDAAgD;AAChD,eAAO,MAAM,WAAW,QAAO,eAC6B,CAAC;AAE7D,0DAA0D;AAC1D,eAAO,MAAM,UAAU,QAAO,eAC6B,CAAC;AAE5D,oCAAoC;AACpC,eAAO,MAAM,YAAY,QAAO,eAC8B,CAAC;AAW/D,4EAA4E;AAC5E,eAAO,MAAM,UAAU,QAAO,eACuB,CAAC;AAEtD,8CAA8C;AAC9C,eAAO,MAAM,aAAa,QAAO,eACoB,CAAC;AAEtD,qCAAqC;AACrC,eAAO,MAAM,WAAW,QAAO,eACsB,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get AfterChunk () {
|
|
13
|
+
return AfterChunk;
|
|
14
|
+
},
|
|
15
|
+
get AfterJob () {
|
|
16
|
+
return AfterJob;
|
|
17
|
+
},
|
|
18
|
+
get AfterProcess () {
|
|
19
|
+
return AfterProcess;
|
|
20
|
+
},
|
|
21
|
+
get AfterRead () {
|
|
22
|
+
return AfterRead;
|
|
23
|
+
},
|
|
24
|
+
get AfterStep () {
|
|
25
|
+
return AfterStep;
|
|
26
|
+
},
|
|
27
|
+
get AfterWrite () {
|
|
28
|
+
return AfterWrite;
|
|
29
|
+
},
|
|
30
|
+
get BeforeChunk () {
|
|
31
|
+
return BeforeChunk;
|
|
32
|
+
},
|
|
33
|
+
get BeforeJob () {
|
|
34
|
+
return BeforeJob;
|
|
35
|
+
},
|
|
36
|
+
get BeforeProcess () {
|
|
37
|
+
return BeforeProcess;
|
|
38
|
+
},
|
|
39
|
+
get BeforeRead () {
|
|
40
|
+
return BeforeRead;
|
|
41
|
+
},
|
|
42
|
+
get BeforeStep () {
|
|
43
|
+
return BeforeStep;
|
|
44
|
+
},
|
|
45
|
+
get BeforeWrite () {
|
|
46
|
+
return BeforeWrite;
|
|
47
|
+
},
|
|
48
|
+
get OnChunkError () {
|
|
49
|
+
return OnChunkError;
|
|
50
|
+
},
|
|
51
|
+
get OnProcessError () {
|
|
52
|
+
return OnProcessError;
|
|
53
|
+
},
|
|
54
|
+
get OnReadError () {
|
|
55
|
+
return OnReadError;
|
|
56
|
+
},
|
|
57
|
+
get OnSkipProcess () {
|
|
58
|
+
return OnSkipProcess;
|
|
59
|
+
},
|
|
60
|
+
get OnSkipRead () {
|
|
61
|
+
return OnSkipRead;
|
|
62
|
+
},
|
|
63
|
+
get OnSkipWrite () {
|
|
64
|
+
return OnSkipWrite;
|
|
65
|
+
},
|
|
66
|
+
get OnWriteError () {
|
|
67
|
+
return OnWriteError;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
require("reflect-metadata");
|
|
71
|
+
const _constants = require("./constants");
|
|
72
|
+
function defineListener(target, propertyKey, options) {
|
|
73
|
+
Reflect.defineMetadata(_constants.BATCH_LISTENER_METADATA, options, target, propertyKey);
|
|
74
|
+
}
|
|
75
|
+
function listenerDecorator(options) {
|
|
76
|
+
return (target, propertyKey, _descriptor)=>{
|
|
77
|
+
defineListener(target, propertyKey, options);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const BeforeJob = ()=>listenerDecorator({
|
|
81
|
+
kind: 'job',
|
|
82
|
+
phase: 'before'
|
|
83
|
+
});
|
|
84
|
+
const AfterJob = ()=>listenerDecorator({
|
|
85
|
+
kind: 'job',
|
|
86
|
+
phase: 'after'
|
|
87
|
+
});
|
|
88
|
+
const BeforeStep = ()=>listenerDecorator({
|
|
89
|
+
kind: 'step',
|
|
90
|
+
phase: 'before'
|
|
91
|
+
});
|
|
92
|
+
const AfterStep = ()=>listenerDecorator({
|
|
93
|
+
kind: 'step',
|
|
94
|
+
phase: 'after'
|
|
95
|
+
});
|
|
96
|
+
const BeforeChunk = ()=>listenerDecorator({
|
|
97
|
+
kind: 'chunk',
|
|
98
|
+
phase: 'before'
|
|
99
|
+
});
|
|
100
|
+
const AfterChunk = ()=>listenerDecorator({
|
|
101
|
+
kind: 'chunk',
|
|
102
|
+
phase: 'after'
|
|
103
|
+
});
|
|
104
|
+
const OnChunkError = ()=>listenerDecorator({
|
|
105
|
+
kind: 'chunk',
|
|
106
|
+
phase: 'on-error'
|
|
107
|
+
});
|
|
108
|
+
const BeforeRead = ()=>listenerDecorator({
|
|
109
|
+
kind: 'item-read',
|
|
110
|
+
phase: 'before'
|
|
111
|
+
});
|
|
112
|
+
const AfterRead = ()=>listenerDecorator({
|
|
113
|
+
kind: 'item-read',
|
|
114
|
+
phase: 'after'
|
|
115
|
+
});
|
|
116
|
+
const OnReadError = ()=>listenerDecorator({
|
|
117
|
+
kind: 'item-read',
|
|
118
|
+
phase: 'on-error'
|
|
119
|
+
});
|
|
120
|
+
const BeforeProcess = ()=>listenerDecorator({
|
|
121
|
+
kind: 'item-process',
|
|
122
|
+
phase: 'before'
|
|
123
|
+
});
|
|
124
|
+
const AfterProcess = ()=>listenerDecorator({
|
|
125
|
+
kind: 'item-process',
|
|
126
|
+
phase: 'after'
|
|
127
|
+
});
|
|
128
|
+
const OnProcessError = ()=>listenerDecorator({
|
|
129
|
+
kind: 'item-process',
|
|
130
|
+
phase: 'on-error'
|
|
131
|
+
});
|
|
132
|
+
const BeforeWrite = ()=>listenerDecorator({
|
|
133
|
+
kind: 'item-write',
|
|
134
|
+
phase: 'before'
|
|
135
|
+
});
|
|
136
|
+
const AfterWrite = ()=>listenerDecorator({
|
|
137
|
+
kind: 'item-write',
|
|
138
|
+
phase: 'after'
|
|
139
|
+
});
|
|
140
|
+
const OnWriteError = ()=>listenerDecorator({
|
|
141
|
+
kind: 'item-write',
|
|
142
|
+
phase: 'on-error'
|
|
143
|
+
});
|
|
144
|
+
const OnSkipRead = ()=>listenerDecorator({
|
|
145
|
+
kind: 'skip',
|
|
146
|
+
phase: 'after'
|
|
147
|
+
});
|
|
148
|
+
const OnSkipProcess = ()=>listenerDecorator({
|
|
149
|
+
kind: 'skip',
|
|
150
|
+
phase: 'after'
|
|
151
|
+
});
|
|
152
|
+
const OnSkipWrite = ()=>listenerDecorator({
|
|
153
|
+
kind: 'skip',
|
|
154
|
+
phase: 'after'
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=listener.decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/decorators/listener.decorators.ts"],"sourcesContent":["import 'reflect-metadata';\nimport { BATCH_LISTENER_METADATA } from './constants';\nimport type { ListenerKind, ListenerPhase } from '../core/ir/listener-definition';\n\n/**\n * Stored under `BATCH_LISTENER_METADATA` for each listener method.\n * Mirrors `ListenerDefinition` minus the resolved `ref` (which the\n * DefinitionCompiler fills in by walking the class).\n *\n * The `skip` kind is special: it has no before/after/on-error phase,\n * it is a single fire-and-forget callback per skip event. We record\n * `phase: 'after'` as a placeholder so the metadata shape stays uniform;\n * the skip dispatch table is built in Task 25.\n */\nexport interface ListenerOptions {\n kind: ListenerKind;\n phase: ListenerPhase;\n nonCritical?: boolean;\n}\n\nfunction defineListener(\n target: object,\n propertyKey: string | symbol,\n options: ListenerOptions,\n): void {\n Reflect.defineMetadata(BATCH_LISTENER_METADATA, options, target, propertyKey);\n}\n\nfunction listenerDecorator(options: ListenerOptions): MethodDecorator {\n return (target: object, propertyKey: string | symbol, _descriptor: PropertyDescriptor) => {\n defineListener(target, propertyKey, options);\n };\n}\n\n// ---------------------------------------------------------------------------\n// Job-level listeners (2)\n// ---------------------------------------------------------------------------\n\n/** Fires before a job execution starts. */\nexport const BeforeJob = (): MethodDecorator =>\n listenerDecorator({ kind: 'job', phase: 'before' });\n\n/** Fires after a job execution finishes (regardless of status). */\nexport const AfterJob = (): MethodDecorator =>\n listenerDecorator({ kind: 'job', phase: 'after' });\n\n// ---------------------------------------------------------------------------\n// Step-level listeners (2)\n// ---------------------------------------------------------------------------\n\n/** Fires before a step execution starts. */\nexport const BeforeStep = (): MethodDecorator =>\n listenerDecorator({ kind: 'step', phase: 'before' });\n\n/** Fires after a step execution finishes (regardless of status). */\nexport const AfterStep = (): MethodDecorator =>\n listenerDecorator({ kind: 'step', phase: 'after' });\n\n// ---------------------------------------------------------------------------\n// Chunk-level listeners (3)\n// ---------------------------------------------------------------------------\n\n/** Fires before each chunk (read-process-write cycle) starts. */\nexport const BeforeChunk = (): MethodDecorator =>\n listenerDecorator({ kind: 'chunk', phase: 'before' });\n\n/** Fires after each chunk finishes successfully. */\nexport const AfterChunk = (): MethodDecorator =>\n listenerDecorator({ kind: 'chunk', phase: 'after' });\n\n/** Fires when a chunk throws (allows rollback hooks / telemetry). */\nexport const OnChunkError = (): MethodDecorator =>\n listenerDecorator({ kind: 'chunk', phase: 'on-error' });\n\n// ---------------------------------------------------------------------------\n// ItemRead listeners (3)\n// ---------------------------------------------------------------------------\n\n/** Fires before each item is read. */\nexport const BeforeRead = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-read', phase: 'before' });\n\n/** Fires after each item is successfully read. */\nexport const AfterRead = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-read', phase: 'after' });\n\n/** Fires when the reader throws. */\nexport const OnReadError = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-read', phase: 'on-error' });\n\n// ---------------------------------------------------------------------------\n// ItemProcess listeners (3)\n// ---------------------------------------------------------------------------\n\n/** Fires before each item is processed. */\nexport const BeforeProcess = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-process', phase: 'before' });\n\n/** Fires after each item is successfully processed. */\nexport const AfterProcess = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-process', phase: 'after' });\n\n/** Fires when the processor throws. */\nexport const OnProcessError = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-process', phase: 'on-error' });\n\n// ---------------------------------------------------------------------------\n// ItemWrite listeners (3)\n// ---------------------------------------------------------------------------\n\n/** Fires before the writer receives a chunk. */\nexport const BeforeWrite = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-write', phase: 'before' });\n\n/** Fires after the writer successfully writes a chunk. */\nexport const AfterWrite = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-write', phase: 'after' });\n\n/** Fires when the writer throws. */\nexport const OnWriteError = (): MethodDecorator =>\n listenerDecorator({ kind: 'item-write', phase: 'on-error' });\n\n// ---------------------------------------------------------------------------\n// Skip listeners (3)\n//\n// Skip listeners are not phase-based — each kind handles a distinct skip\n// event emitted by the corresponding read/process/write. We store them\n// under `kind: 'skip'` with `phase: 'after'` as a placeholder so the\n// metadata shape is uniform; the dispatch table is built in Task 25.\n// ---------------------------------------------------------------------------\n\n/** Fires when a read is skipped (after the skip policy decides to skip). */\nexport const OnSkipRead = (): MethodDecorator =>\n listenerDecorator({ kind: 'skip', phase: 'after' });\n\n/** Fires when a processed item is skipped. */\nexport const OnSkipProcess = (): MethodDecorator =>\n listenerDecorator({ kind: 'skip', phase: 'after' });\n\n/** Fires when a write is skipped. */\nexport const OnSkipWrite = (): MethodDecorator =>\n listenerDecorator({ kind: 'skip', phase: 'after' });\n"],"names":["AfterChunk","AfterJob","AfterProcess","AfterRead","AfterStep","AfterWrite","BeforeChunk","BeforeJob","BeforeProcess","BeforeRead","BeforeStep","BeforeWrite","OnChunkError","OnProcessError","OnReadError","OnSkipProcess","OnSkipRead","OnSkipWrite","OnWriteError","defineListener","target","propertyKey","options","Reflect","defineMetadata","BATCH_LISTENER_METADATA","listenerDecorator","_descriptor","kind","phase"],"mappings":";;;;;;;;;;;QAmEaA;eAAAA;;QAxBAC;eAAAA;;QAwDAC;eAAAA;;QAhBAC;eAAAA;;QA5BAC;eAAAA;;QA4DAC;eAAAA;;QApDAC;eAAAA;;QAxBAC;eAAAA;;QAwDAC;eAAAA;;QAhBAC;eAAAA;;QA5BAC;eAAAA;;QA4DAC;eAAAA;;QAxCAC;eAAAA;;QAgCAC;eAAAA;;QAhBAC;eAAAA;;QAiDAC;eAAAA;;QAJAC;eAAAA;;QAQAC;eAAAA;;QArBAC;eAAAA;;;QAvHN;2BACiC;AAmBxC,SAASC,eACPC,MAAc,EACdC,WAA4B,EAC5BC,OAAwB;IAExBC,QAAQC,cAAc,CAACC,kCAAuB,EAAEH,SAASF,QAAQC;AACnE;AAEA,SAASK,kBAAkBJ,OAAwB;IACjD,OAAO,CAACF,QAAgBC,aAA8BM;QACpDR,eAAeC,QAAQC,aAAaC;IACtC;AACF;AAOO,MAAMf,YAAY,IACvBmB,kBAAkB;QAAEE,MAAM;QAAOC,OAAO;IAAS;AAG5C,MAAM5B,WAAW,IACtByB,kBAAkB;QAAEE,MAAM;QAAOC,OAAO;IAAQ;AAO3C,MAAMnB,aAAa,IACxBgB,kBAAkB;QAAEE,MAAM;QAAQC,OAAO;IAAS;AAG7C,MAAMzB,YAAY,IACvBsB,kBAAkB;QAAEE,MAAM;QAAQC,OAAO;IAAQ;AAO5C,MAAMvB,cAAc,IACzBoB,kBAAkB;QAAEE,MAAM;QAASC,OAAO;IAAS;AAG9C,MAAM7B,aAAa,IACxB0B,kBAAkB;QAAEE,MAAM;QAASC,OAAO;IAAQ;AAG7C,MAAMjB,eAAe,IAC1Bc,kBAAkB;QAAEE,MAAM;QAASC,OAAO;IAAW;AAOhD,MAAMpB,aAAa,IACxBiB,kBAAkB;QAAEE,MAAM;QAAaC,OAAO;IAAS;AAGlD,MAAM1B,YAAY,IACvBuB,kBAAkB;QAAEE,MAAM;QAAaC,OAAO;IAAQ;AAGjD,MAAMf,cAAc,IACzBY,kBAAkB;QAAEE,MAAM;QAAaC,OAAO;IAAW;AAOpD,MAAMrB,gBAAgB,IAC3BkB,kBAAkB;QAAEE,MAAM;QAAgBC,OAAO;IAAS;AAGrD,MAAM3B,eAAe,IAC1BwB,kBAAkB;QAAEE,MAAM;QAAgBC,OAAO;IAAQ;AAGpD,MAAMhB,iBAAiB,IAC5Ba,kBAAkB;QAAEE,MAAM;QAAgBC,OAAO;IAAW;AAOvD,MAAMlB,cAAc,IACzBe,kBAAkB;QAAEE,MAAM;QAAcC,OAAO;IAAS;AAGnD,MAAMxB,aAAa,IACxBqB,kBAAkB;QAAEE,MAAM;QAAcC,OAAO;IAAQ;AAGlD,MAAMX,eAAe,IAC1BQ,kBAAkB;QAAEE,MAAM;QAAcC,OAAO;IAAW;AAYrD,MAAMb,aAAa,IACxBU,kBAAkB;QAAEE,MAAM;QAAQC,OAAO;IAAQ;AAG5C,MAAMd,gBAAgB,IAC3BW,kBAAkB;QAAEE,MAAM;QAAQC,OAAO;IAAQ;AAG5C,MAAMZ,cAAc,IACzBS,kBAAkB;QAAEE,MAAM;QAAQC,OAAO;IAAQ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { ChunkPartitionConfig, RetryPolicyConfig, SkipPolicyConfig } from '../core/ir';
|
|
3
|
+
export interface StepableOptions {
|
|
4
|
+
id: string;
|
|
5
|
+
chunkSize?: number;
|
|
6
|
+
skipPolicy?: SkipPolicyConfig;
|
|
7
|
+
retryPolicy?: RetryPolicyConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Optional partition configuration forwarded to the compiled
|
|
10
|
+
* `ChunkStepDefinition.partitions`. See `docs/RELEASE-0.2.0.md §6`
|
|
11
|
+
* and `packages/core/src/partition-helpers.ts` for the contract.
|
|
12
|
+
* Tasklet steps ignore this field.
|
|
13
|
+
*/
|
|
14
|
+
partitions?: ChunkPartitionConfig;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Method decorator that marks a method as a batch step.
|
|
18
|
+
* When `chunkSize` is 0/undefined and `@Tasklet()` is also present, the step is a tasklet step.
|
|
19
|
+
* Otherwise, the method must NOT be marked with `@Tasklet()` and step is a chunk step (uses the class-level reader/processor/writer).
|
|
20
|
+
*
|
|
21
|
+
* NOTE: The actual chunk step is assembled by the `DefinitionCompiler` from
|
|
22
|
+
* class-level `@ItemReader`/`@ItemProcessor`/`@ItemWriter` methods.
|
|
23
|
+
*/
|
|
24
|
+
export declare function Stepable(options: StepableOptions): MethodDecorator;
|
|
25
|
+
//# sourceMappingURL=step.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.decorator.d.ts","sourceRoot":"","sources":["../../../src/decorators/step.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE5F,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CAMlE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Stepable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return Stepable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
require("reflect-metadata");
|
|
12
|
+
const _constants = require("./constants");
|
|
13
|
+
function Stepable(options) {
|
|
14
|
+
return (target, propertyKey, descriptor)=>{
|
|
15
|
+
Reflect.defineMetadata(_constants.BATCH_STEP_METADATA, options, target, propertyKey);
|
|
16
|
+
// Also stash on the function itself so explorer can read both
|
|
17
|
+
Reflect.defineMetadata(_constants.BATCH_STEP_METADATA, options, descriptor.value);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=step.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/decorators/step.decorator.ts"],"sourcesContent":["import 'reflect-metadata';\nimport { BATCH_STEP_METADATA } from './constants';\nimport type { ChunkPartitionConfig, RetryPolicyConfig, SkipPolicyConfig } from '../core/ir';\n\nexport interface StepableOptions {\n id: string;\n chunkSize?: number; // 0 or undefined = tasklet step\n skipPolicy?: SkipPolicyConfig;\n retryPolicy?: RetryPolicyConfig;\n /**\n * Optional partition configuration forwarded to the compiled\n * `ChunkStepDefinition.partitions`. See `docs/RELEASE-0.2.0.md §6`\n * and `packages/core/src/partition-helpers.ts` for the contract.\n * Tasklet steps ignore this field.\n */\n partitions?: ChunkPartitionConfig;\n}\n\n/**\n * Method decorator that marks a method as a batch step.\n * When `chunkSize` is 0/undefined and `@Tasklet()` is also present, the step is a tasklet step.\n * Otherwise, the method must NOT be marked with `@Tasklet()` and step is a chunk step (uses the class-level reader/processor/writer).\n *\n * NOTE: The actual chunk step is assembled by the `DefinitionCompiler` from\n * class-level `@ItemReader`/`@ItemProcessor`/`@ItemWriter` methods.\n */\nexport function Stepable(options: StepableOptions): MethodDecorator {\n return (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n Reflect.defineMetadata(BATCH_STEP_METADATA, options, target, propertyKey);\n // Also stash on the function itself so explorer can read both\n Reflect.defineMetadata(BATCH_STEP_METADATA, options, descriptor.value as object);\n };\n}\n"],"names":["Stepable","options","target","propertyKey","descriptor","Reflect","defineMetadata","BATCH_STEP_METADATA","value"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;QA1BT;2BAC6B;AAyB7B,SAASA,SAASC,OAAwB;IAC/C,OAAO,CAACC,QAAgBC,aAA8BC;QACpDC,QAAQC,cAAc,CAACC,8BAAmB,EAAEN,SAASC,QAAQC;QAC7D,8DAA8D;QAC9DE,QAAQC,cAAc,CAACC,8BAAmB,EAAEN,SAASG,WAAWI,KAAK;IACvE;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasklet.decorator.d.ts","sourceRoot":"","sources":["../../../src/decorators/tasklet.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B;;;GAGG;AACH,wBAAgB,OAAO,IAAI,eAAe,CAMzC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Tasklet", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return Tasklet;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
require("reflect-metadata");
|
|
12
|
+
const _constants = require("./constants");
|
|
13
|
+
function Tasklet() {
|
|
14
|
+
return (target, propertyKey, descriptor)=>{
|
|
15
|
+
Reflect.defineMetadata(_constants.BATCH_TASKLET_METADATA, true, descriptor.value);
|
|
16
|
+
// Also stash on the prototype method so explorer can read both
|
|
17
|
+
Reflect.defineMetadata(_constants.BATCH_TASKLET_METADATA, true, target, propertyKey);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=tasklet.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/decorators/tasklet.decorator.ts"],"sourcesContent":["import 'reflect-metadata';\nimport { BATCH_TASKLET_METADATA } from './constants';\n\n/**\n * Method decorator that marks a `@Stepable` method as a tasklet handler\n * (single execution, not a chunk loop).\n */\nexport function Tasklet(): MethodDecorator {\n return (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n Reflect.defineMetadata(BATCH_TASKLET_METADATA, true, descriptor.value as object);\n // Also stash on the prototype method so explorer can read both\n Reflect.defineMetadata(BATCH_TASKLET_METADATA, true, target, propertyKey);\n };\n}\n"],"names":["Tasklet","target","propertyKey","descriptor","Reflect","defineMetadata","BATCH_TASKLET_METADATA","value"],"mappings":";;;;+BAOgBA;;;eAAAA;;;QAPT;2BACgC;AAMhC,SAASA;IACd,OAAO,CAACC,QAAgBC,aAA8BC;QACpDC,QAAQC,cAAc,CAACC,iCAAsB,EAAE,MAAMH,WAAWI,KAAK;QACrE,+DAA+D;QAC/DH,QAAQC,cAAc,CAACC,iCAAsB,EAAE,MAAML,QAAQC;IAC/D;AACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { JobParameters, JobExecution } from '../core/repository';
|
|
2
|
+
import { JobRepository } from '../core/repository';
|
|
3
|
+
import { JobStatus } from '../core/status';
|
|
4
|
+
import { JobRegistry } from '../registry/job-registry';
|
|
5
|
+
import { JobExecutor } from './job-executor';
|
|
6
|
+
export interface BatchWorkerRunOptions {
|
|
7
|
+
readonly jobExecutionId?: string;
|
|
8
|
+
readonly executionId?: string;
|
|
9
|
+
readonly jobId?: string;
|
|
10
|
+
readonly params?: JobParameters;
|
|
11
|
+
readonly partitionIndex?: number;
|
|
12
|
+
readonly partitionCount?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface BatchWorkerRunResult {
|
|
15
|
+
readonly jobExecution: JobExecution;
|
|
16
|
+
readonly status: JobStatus;
|
|
17
|
+
readonly processExitCode: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class BatchWorkerRunner {
|
|
20
|
+
private readonly registry;
|
|
21
|
+
private readonly repository;
|
|
22
|
+
private readonly jobExecutor;
|
|
23
|
+
constructor(registry: JobRegistry, repository: JobRepository, jobExecutor: JobExecutor);
|
|
24
|
+
run(options: BatchWorkerRunOptions): Promise<BatchWorkerRunResult>;
|
|
25
|
+
}
|
|
26
|
+
export declare function parseBatchWorkerArgs(argv: readonly string[]): BatchWorkerRunOptions;
|
|
27
|
+
//# sourceMappingURL=batch-worker-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-worker-runner.d.ts","sourceRoot":"","sources":["../../../src/execution/batch-worker-runner.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,qBACa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAFX,QAAQ,EAAE,WAAW,EACrB,UAAU,EAAE,aAAa,EACzB,WAAW,EAAE,WAAW;IAGrC,GAAG,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAmDzE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,qBAAqB,CAgDnF"}
|