@hatchet-dev/typescript-sdk 1.13.1 → 1.15.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/docs/doc_types.d.ts +12 -0
- package/docs/doc_types.js +62 -0
- package/docs/generate.js +87 -0
- package/docs/paths.d.ts +2 -0
- package/docs/paths.js +16 -0
- package/docs/shared.d.ts +3 -0
- package/docs/shared.js +6 -0
- package/package.json +5 -4
- package/{clients → src/clients}/admin/admin-client.d.ts +17 -9
- package/{clients → src/clients}/admin/admin-client.js +26 -10
- package/{clients → src/clients}/dispatcher/action-listener.d.ts +4 -4
- package/{clients → src/clients}/dispatcher/action-listener.js +3 -3
- package/{clients → src/clients}/dispatcher/dispatcher-client.d.ts +10 -10
- package/{clients → src/clients}/dispatcher/dispatcher-client.js +5 -5
- package/{clients → src/clients}/dispatcher/heartbeat/heartbeat-controller.d.ts +2 -2
- package/{clients → src/clients}/dispatcher/heartbeat/heartbeat-controller.js +14 -2
- package/{clients → src/clients}/dispatcher/heartbeat/heartbeat-worker.js +7 -6
- package/{clients → src/clients}/event/event-client.d.ts +8 -9
- package/{clients → src/clients}/event/event-client.js +6 -6
- package/{clients → src/clients}/hatchet-client/client-config.d.ts +17 -7
- package/{clients → src/clients}/hatchet-client/client-config.js +3 -0
- package/{clients → src/clients}/hatchet-client/hatchet-logger.d.ts +1 -1
- package/{clients → src/clients}/hatchet-client/hatchet-logger.js +2 -1
- package/src/clients/hatchet-client/index.d.ts +3 -0
- package/{clients → src/clients}/hatchet-client/index.js +2 -2
- package/{clients → src/clients}/listeners/durable-listener/durable-listener-client.d.ts +11 -5
- package/{clients → src/clients}/listeners/durable-listener/durable-listener-client.js +9 -1
- package/{clients → src/clients}/listeners/durable-listener/pooled-durable-listener-client.d.ts +11 -4
- package/{clients → src/clients}/listeners/durable-listener/pooled-durable-listener-client.js +68 -16
- package/{clients → src/clients}/listeners/run-listener/child-listener-client.d.ts +3 -3
- package/{clients → src/clients}/listeners/run-listener/child-listener-client.js +4 -3
- package/{clients → src/clients}/listeners/run-listener/pooled-child-listener-client.d.ts +11 -3
- package/{clients → src/clients}/listeners/run-listener/pooled-child-listener-client.js +65 -9
- package/src/clients/rest/api.js +21 -0
- package/{clients → src/clients}/rest/generated/Api.d.ts +2 -2
- package/{clients → src/clients}/rest/generated/data-contracts.d.ts +6 -0
- package/{index.d.ts → src/index.d.ts} +3 -4
- package/{index.js → src/index.js} +3 -4
- package/{examples → src/legacy/examples}/affinity-workers.js +2 -2
- package/{examples → src/legacy/examples}/bulk-fanout-trigger.js +1 -1
- package/{examples → src/legacy/examples}/bulk-fanout-worker.js +1 -1
- package/{examples → src/legacy/examples}/bulk-trigger.js +1 -1
- package/{examples → src/legacy/examples}/concurrency/cancel-in-progress/concurrency-event.js +1 -1
- package/{examples → src/legacy/examples}/concurrency/cancel-in-progress/concurrency-worker.js +1 -1
- package/{examples → src/legacy/examples}/concurrency/group-round-robin/concurrency-event.js +1 -1
- package/{examples → src/legacy/examples}/concurrency/group-round-robin/concurrency-worker-expression.js +2 -2
- package/{examples → src/legacy/examples}/concurrency/group-round-robin/concurrency-worker-key-fn.js +2 -2
- package/{examples → src/legacy/examples}/crons/cron-worker.d.ts +1 -1
- package/{examples → src/legacy/examples}/crons/cron-worker.js +1 -1
- package/{examples → src/legacy/examples}/crons/programatic-crons.js +1 -1
- package/{examples → src/legacy/examples}/dag-worker.js +1 -1
- package/{examples → src/legacy/examples}/example-event-with-results.js +2 -2
- package/{examples → src/legacy/examples}/example-event.js +1 -1
- package/{examples → src/legacy/examples}/fanout-worker.js +1 -1
- package/{examples → src/legacy/examples}/logger.js +1 -1
- package/{examples → src/legacy/examples}/manual-trigger.js +1 -1
- package/{examples → src/legacy/examples}/multi-workflow.js +1 -1
- package/{examples → src/legacy/examples}/namespaced-worker.js +1 -1
- package/{examples → src/legacy/examples}/on-failure.js +1 -1
- package/{examples → src/legacy/examples}/rate-limit/events.js +1 -1
- package/{examples → src/legacy/examples}/rate-limit/worker.js +2 -2
- package/{examples → src/legacy/examples}/retries-with-backoff.js +1 -1
- package/{examples → src/legacy/examples}/retries-worker.js +1 -1
- package/{examples → src/legacy/examples}/scheduled-runs/programatic-schedules.js +1 -1
- package/{examples → src/legacy/examples}/simple-worker.d.ts +1 -1
- package/{examples → src/legacy/examples}/simple-worker.js +1 -1
- package/{examples → src/legacy/examples}/sticky-trigger.js +1 -1
- package/{examples → src/legacy/examples}/sticky-worker-with-check.js +2 -2
- package/{examples → src/legacy/examples}/sticky-worker.js +2 -2
- package/{examples → src/legacy/examples}/stream-by-additional-meta.js +2 -2
- package/{clients/hatchet-client/hatchet-client.d.ts → src/legacy/legacy-client.d.ts} +8 -13
- package/src/legacy/legacy-client.js +67 -0
- package/src/legacy/legacy-transformer.d.ts +38 -0
- package/src/legacy/legacy-transformer.js +181 -0
- package/{step.d.ts → src/legacy/step.d.ts} +30 -31
- package/{step.js → src/legacy/step.js} +17 -16
- package/{workflow.d.ts → src/legacy/workflow.d.ts} +47 -50
- package/{workflow.js → src/legacy/workflow.js} +3 -6
- package/{protoc → src/protoc}/v1/workflows.d.ts +8 -0
- package/{protoc → src/protoc}/v1/workflows.js +109 -2
- package/{protoc → src/protoc}/workflows/workflows.d.ts +9 -0
- package/{protoc → src/protoc}/workflows/workflows.js +109 -2
- package/src/sdk.d.ts +2 -0
- package/{sdk.js → src/sdk.js} +1 -1
- package/src/step.d.ts +1 -0
- package/{clients/worker/index.js → src/step.js} +4 -1
- package/src/util/abort-error.d.ts +38 -0
- package/src/util/abort-error.js +58 -0
- package/{util → src/util}/config-loader/config-loader.d.ts +1 -1
- package/{util → src/util}/config-loader/config-loader.js +1 -1
- package/{util → src/util}/grpc-helpers.d.ts +1 -1
- package/src/util/hatchet-promise/hatchet-promise.d.ts +13 -0
- package/{util → src/util}/hatchet-promise/hatchet-promise.js +3 -2
- package/src/util/logger/index.d.ts +2 -0
- package/{util → src/util}/logger/index.js +1 -0
- package/{util → src/util}/logger/logger.d.ts +1 -1
- package/src/util/logger/task-run-log.d.ts +3 -0
- package/src/util/logger/task-run-log.js +20 -0
- package/{util → src/util}/sleep.d.ts +5 -2
- package/src/util/sleep.js +37 -0
- package/{util → src/util}/workflow-run-ref.d.ts +9 -3
- package/{util → src/util}/workflow-run-ref.js +5 -3
- package/{v1 → src/v1}/client/admin.d.ts +24 -8
- package/{v1 → src/v1}/client/admin.js +50 -18
- package/{v1 → src/v1}/client/client.d.ts +59 -23
- package/{v1 → src/v1}/client/client.interface.d.ts +9 -2
- package/{v1 → src/v1}/client/client.js +73 -35
- package/{v1 → src/v1}/client/features/cel.d.ts +1 -1
- package/{v1 → src/v1}/client/features/cel.js +1 -1
- package/{v1 → src/v1}/client/features/crons.d.ts +8 -6
- package/{v1 → src/v1}/client/features/crons.js +6 -5
- package/{v1 → src/v1}/client/features/filters.d.ts +30 -0
- package/{v1 → src/v1}/client/features/filters.js +30 -0
- package/{v1 → src/v1}/client/features/metrics.d.ts +10 -6
- package/{v1 → src/v1}/client/features/metrics.js +10 -6
- package/src/v1/client/features/ratelimits.d.ts +30 -0
- package/{v1 → src/v1}/client/features/ratelimits.js +13 -3
- package/{v1 → src/v1}/client/features/runs.d.ts +43 -8
- package/{v1 → src/v1}/client/features/runs.js +38 -3
- package/{v1 → src/v1}/client/features/schedules.d.ts +7 -4
- package/{v1 → src/v1}/client/features/schedules.js +7 -5
- package/{v1 → src/v1}/client/features/tenant.d.ts +4 -1
- package/src/v1/client/features/webhooks.d.ts +54 -0
- package/{v1 → src/v1}/client/features/webhooks.js +31 -5
- package/src/v1/client/features/workers.d.ts +38 -0
- package/{v1 → src/v1}/client/features/workers.js +25 -1
- package/src/v1/client/features/workflows.d.ts +42 -0
- package/{v1 → src/v1}/client/features/workflows.js +27 -10
- package/{v1 → src/v1}/client/worker/context.d.ts +78 -18
- package/{v1 → src/v1}/client/worker/context.js +120 -27
- package/{v1 → src/v1}/client/worker/deprecated/deprecation.d.ts +1 -1
- package/{v1 → src/v1}/client/worker/deprecated/legacy-registration.d.ts +2 -2
- package/{v1 → src/v1}/client/worker/deprecated/legacy-registration.js +2 -2
- package/{v1 → src/v1}/client/worker/deprecated/legacy-v1-worker.d.ts +5 -5
- package/{v1 → src/v1}/client/worker/deprecated/legacy-v1-worker.js +2 -2
- package/{v1 → src/v1}/client/worker/deprecated/legacy-worker.js +9 -7
- package/{v1 → src/v1}/client/worker/health-server.d.ts +1 -1
- package/{v1 → src/v1}/client/worker/slot-utils.d.ts +3 -3
- package/{v1 → src/v1}/client/worker/worker-internal.d.ts +13 -22
- package/{v1 → src/v1}/client/worker/worker-internal.js +232 -216
- package/{v1 → src/v1}/client/worker/worker.d.ts +19 -19
- package/{v1 → src/v1}/client/worker/worker.js +45 -30
- package/{v1 → src/v1}/conditions/transformer.d.ts +1 -1
- package/{v1 → src/v1}/declaration.d.ts +120 -15
- package/{v1 → src/v1}/declaration.js +118 -10
- package/src/v1/examples/__e2e__/harness.d.ts +19 -0
- package/src/v1/examples/__e2e__/harness.js +70 -0
- package/{v1 → src/v1}/examples/affinity/affinity-workers.js +4 -4
- package/src/v1/examples/bulk_fanout/workflow.d.ts +9 -0
- package/src/v1/examples/bulk_fanout/workflow.js +34 -0
- package/src/v1/examples/bulk_operations/workflow.d.ts +3 -0
- package/src/v1/examples/bulk_operations/workflow.js +44 -0
- package/src/v1/examples/cancellation/cancellation-workflow.d.ts +2 -0
- package/src/v1/examples/cancellation/cancellation-workflow.js +69 -0
- package/src/v1/examples/cancellation/run.js +53 -0
- package/src/v1/examples/cancellation/worker.js +29 -0
- package/{v1 → src/v1}/examples/cancellations/run.js +1 -1
- package/{v1 → src/v1}/examples/cancellations/workflow.js +1 -1
- package/{v1 → src/v1}/examples/concurrency-rr/workflow.js +1 -1
- package/src/v1/examples/concurrency-types.d.ts +5 -0
- package/src/v1/examples/concurrency_cancel_in_progress/workflow.d.ts +9 -0
- package/src/v1/examples/concurrency_cancel_in_progress/workflow.js +45 -0
- package/src/v1/examples/concurrency_cancel_newest/workflow.d.ts +9 -0
- package/src/v1/examples/concurrency_cancel_newest/workflow.js +45 -0
- package/src/v1/examples/concurrency_limit_rr/load.js +54 -0
- package/src/v1/examples/concurrency_limit_rr/run.js +39 -0
- package/src/v1/examples/concurrency_limit_rr/worker.js +24 -0
- package/src/v1/examples/concurrency_limit_rr/workflow.d.ts +12 -0
- package/src/v1/examples/concurrency_limit_rr/workflow.js +62 -0
- package/src/v1/examples/concurrency_multiple_keys/workflow.d.ts +12 -0
- package/src/v1/examples/concurrency_multiple_keys/workflow.js +42 -0
- package/src/v1/examples/concurrency_workflow_level/workflow.d.ts +13 -0
- package/src/v1/examples/concurrency_workflow_level/workflow.js +49 -0
- package/{v1/examples/dag_match_condition → src/v1/examples/conditions}/complex-workflow.js +2 -2
- package/{v1/examples/dag_match_condition → src/v1/examples/conditions}/workflow.js +2 -2
- package/{v1 → src/v1}/examples/dag/interface-workflow.d.ts +2 -2
- package/src/v1/examples/dag_match_condition/complex-workflow.d.ts +1 -0
- package/src/v1/examples/dag_match_condition/complex-workflow.js +107 -0
- package/src/v1/examples/dag_match_condition/run.js +25 -0
- package/src/v1/examples/dag_match_condition/worker.js +24 -0
- package/src/v1/examples/dag_match_condition/workflow.d.ts +11 -0
- package/src/v1/examples/dag_match_condition/workflow.js +41 -0
- package/{v1 → src/v1}/examples/deep/workflow.js +1 -1
- package/src/v1/examples/durable/workflow.d.ts +7 -0
- package/src/v1/examples/durable/workflow.js +116 -0
- package/{v1 → src/v1}/examples/durable-event/workflow.js +1 -1
- package/src/v1/examples/durable-sleep/event.js +28 -0
- package/{v1 → src/v1}/examples/durable-sleep/workflow.js +1 -1
- package/src/v1/examples/durable_event/event.js +28 -0
- package/src/v1/examples/durable_event/run.js +30 -0
- package/src/v1/examples/durable_event/worker.js +24 -0
- package/src/v1/examples/durable_event/workflow.d.ts +6 -0
- package/src/v1/examples/durable_event/workflow.js +46 -0
- package/src/v1/examples/durable_sleep/event.js +28 -0
- package/src/v1/examples/durable_sleep/run.js +30 -0
- package/src/v1/examples/durable_sleep/worker.js +24 -0
- package/src/v1/examples/durable_sleep/workflow.d.ts +1 -0
- package/src/v1/examples/durable_sleep/workflow.js +31 -0
- package/src/v1/examples/e2e-worker.js +82 -0
- package/src/v1/examples/events/filter.js +32 -0
- package/{v1 → src/v1}/examples/hatchet-client.d.ts +1 -1
- package/{v1 → src/v1}/examples/hatchet-client.js +1 -1
- package/{v1 → src/v1}/examples/high-memory/workflow-with-child.js +1 -1
- package/{v1 → src/v1}/examples/landing_page/durable-excution.js +1 -1
- package/{v1 → src/v1}/examples/landing_page/flow-control.js +1 -1
- package/src/v1/examples/legacy/workflow.d.ts +2 -0
- package/{examples → src/v1/examples/logger}/byo-logger.js +1 -1
- package/src/v1/examples/logger/workflow.d.ts +2 -0
- package/src/v1/examples/logger/workflow.js +38 -0
- package/src/v1/examples/logging/byo-logger.js +73 -0
- package/src/v1/examples/logging/logger.js +46 -0
- package/{v1 → src/v1}/examples/middleware/client.d.ts +1 -1
- package/{v1 → src/v1}/examples/middleware/client.js +1 -1
- package/{v1 → src/v1}/examples/middleware/recipes.js +1 -1
- package/{v1 → src/v1}/examples/migration-guides/hatchet-client.d.ts +1 -1
- package/{v1 → src/v1}/examples/migration-guides/hatchet-client.js +1 -1
- package/{v1 → src/v1}/examples/multiple_wf_concurrency/workflow.d.ts +1 -1
- package/{v1 → src/v1}/examples/multiple_wf_concurrency/workflow.js +3 -3
- package/{v1 → src/v1}/examples/non_retryable/workflow.js +1 -1
- package/src/v1/examples/on_event/event.js +53 -0
- package/src/v1/examples/on_event/worker.js +24 -0
- package/src/v1/examples/on_event/workflow.d.ts +19 -0
- package/src/v1/examples/on_event/workflow.js +60 -0
- package/{v1 → src/v1}/examples/on_failure/workflow.d.ts +1 -0
- package/{v1 → src/v1}/examples/on_failure/workflow.js +12 -7
- package/{v1 → src/v1}/examples/priority/run.js +1 -1
- package/src/v1/examples/priority/workflow.d.ts +8 -0
- package/{v1 → src/v1}/examples/priority/workflow.js +2 -2
- package/{v1 → src/v1}/examples/quickstart/hatchet-client.d.ts +1 -1
- package/{v1 → src/v1}/examples/quickstart/hatchet-client.js +1 -1
- package/src/v1/examples/quickstart/run.d.ts +1 -0
- package/src/v1/examples/quickstart/worker.d.ts +1 -0
- package/src/v1/examples/rate_limit/workflow.d.ts +1 -0
- package/{v1 → src/v1}/examples/rate_limit/workflow.js +1 -1
- package/src/v1/examples/retries/run.d.ts +1 -0
- package/src/v1/examples/retries/worker.d.ts +1 -0
- package/{v1 → src/v1}/examples/retries/workflow.js +2 -2
- package/src/v1/examples/return_exceptions/workflow.d.ts +6 -0
- package/src/v1/examples/return_exceptions/workflow.js +22 -0
- package/src/v1/examples/run_details/workflow.d.ts +4 -0
- package/src/v1/examples/run_details/workflow.js +65 -0
- package/src/v1/examples/runtime_affinity/workflow.d.ts +3 -0
- package/src/v1/examples/runtime_affinity/workflow.js +19 -0
- package/src/v1/examples/simple/bulk.d.ts +1 -0
- package/src/v1/examples/simple/client-run.d.ts +1 -0
- package/src/v1/examples/simple/cron.d.ts +1 -0
- package/src/v1/examples/simple/delay.d.ts +1 -0
- package/src/v1/examples/simple/e2e-workflows.d.ts +14 -0
- package/src/v1/examples/simple/e2e-workflows.js +27 -0
- package/src/v1/examples/simple/enqueue.d.ts +1 -0
- package/{v1 → src/v1}/examples/simple/enqueue.js +2 -2
- package/src/v1/examples/simple/replay-cancel.d.ts +1 -0
- package/{v1 → src/v1}/examples/simple/replay-cancel.js +1 -1
- package/src/v1/examples/simple/schedule.d.ts +1 -0
- package/src/v1/examples/simple/typed-run-methods.d.ts +1 -0
- package/src/v1/examples/simple/worker.d.ts +1 -0
- package/src/v1/examples/sticky/run.d.ts +1 -0
- package/src/v1/examples/sticky/worker.d.ts +1 -0
- package/src/v1/examples/sticky/workflow.d.ts +5 -0
- package/{v1 → src/v1}/examples/sticky/workflow.js +2 -2
- package/src/v1/examples/streaming/run.d.ts +1 -0
- package/src/v1/examples/streaming/worker.d.ts +1 -0
- package/src/v1/examples/timeout/run.d.ts +1 -0
- package/src/v1/examples/timeout/run.js +30 -0
- package/src/v1/examples/timeout/worker.d.ts +1 -0
- package/src/v1/examples/timeout/worker.js +25 -0
- package/src/v1/examples/timeout/workflow.d.ts +10 -0
- package/src/v1/examples/timeout/workflow.js +56 -0
- package/src/v1/examples/timeouts/run.d.ts +1 -0
- package/src/v1/examples/timeouts/worker.d.ts +1 -0
- package/{v1 → src/v1}/examples/timeouts/workflow.js +1 -1
- package/src/v1/examples/webhooks/workflow.d.ts +5 -0
- package/src/v1/examples/webhooks/workflow.js +23 -0
- package/{v1 → src/v1}/examples/with_timeouts/workflow.js +1 -1
- package/{v1 → src/v1}/index.d.ts +1 -0
- package/{v1 → src/v1}/index.js +1 -0
- package/{v1 → src/v1}/parent-run-context-vars.d.ts +6 -0
- package/{v1 → src/v1}/parent-run-context-vars.js +3 -0
- package/{v1 → src/v1}/task.d.ts +22 -7
- package/src/v1/task.js +14 -0
- package/{v1 → src/v1}/types.d.ts +1 -1
- package/src/v1/types.js +2 -0
- package/src/version.d.ts +1 -0
- package/{version.js → src/version.js} +1 -1
- package/src/workflow.d.ts +3 -0
- package/src/workflow.js +25 -0
- package/clients/hatchet-client/hatchet-client.js +0 -108
- package/clients/hatchet-client/index.d.ts +0 -3
- package/clients/rest/api.js +0 -13
- package/clients/worker/handler.d.ts +0 -50
- package/clients/worker/handler.js +0 -214
- package/clients/worker/index.d.ts +0 -1
- package/clients/worker/worker.d.ts +0 -59
- package/clients/worker/worker.js +0 -568
- package/examples/webhooks.js +0 -45
- package/sdk.d.ts +0 -2
- package/util/hatchet-promise/hatchet-promise.d.ts +0 -6
- package/util/logger/index.d.ts +0 -1
- package/util/sleep.js +0 -14
- package/v1/client/features/ratelimits.d.ts +0 -20
- package/v1/client/features/webhooks.d.ts +0 -28
- package/v1/client/features/workers.d.ts +0 -14
- package/v1/client/features/workflows.d.ts +0 -24
- package/v1/examples/legacy/workflow.d.ts +0 -2
- package/v1/examples/priority/workflow.d.ts +0 -8
- package/v1/examples/sticky/workflow.d.ts +0 -5
- package/v1/task.js +0 -11
- package/version.d.ts +0 -1
- /package/{clients/dispatcher/heartbeat/heartbeat-worker.d.ts → docs/generate.d.ts} +0 -0
- /package/{clients → src/clients}/admin/index.d.ts +0 -0
- /package/{clients → src/clients}/admin/index.js +0 -0
- /package/{examples/affinity-workers.d.ts → src/clients/dispatcher/heartbeat/heartbeat-worker.d.ts} +0 -0
- /package/{clients → src/clients}/rest/api.d.ts +0 -0
- /package/{clients → src/clients}/rest/generated/Api.js +0 -0
- /package/{clients → src/clients}/rest/generated/data-contracts.js +0 -0
- /package/{clients → src/clients}/rest/generated/http-client.d.ts +0 -0
- /package/{clients → src/clients}/rest/generated/http-client.js +0 -0
- /package/{clients → src/clients}/rest/index.d.ts +0 -0
- /package/{clients → src/clients}/rest/index.js +0 -0
- /package/{v1/examples/affinity → src/legacy/examples}/affinity-workers.d.ts +0 -0
- /package/{examples → src/legacy/examples}/bulk-fanout-trigger.d.ts +0 -0
- /package/{examples → src/legacy/examples}/bulk-fanout-worker.d.ts +0 -0
- /package/{examples → src/legacy/examples}/bulk-trigger.d.ts +0 -0
- /package/{examples → src/legacy/examples}/byo-logger.d.ts +0 -0
- /package/{v1/examples/logging → src/legacy/examples}/byo-logger.js +0 -0
- /package/{examples → src/legacy/examples}/concurrency/cancel-in-progress/concurrency-event.d.ts +0 -0
- /package/{examples → src/legacy/examples}/concurrency/cancel-in-progress/concurrency-worker.d.ts +0 -0
- /package/{examples → src/legacy/examples}/concurrency/group-round-robin/concurrency-event.d.ts +0 -0
- /package/{examples → src/legacy/examples}/concurrency/group-round-robin/concurrency-worker-expression.d.ts +0 -0
- /package/{examples → src/legacy/examples}/concurrency/group-round-robin/concurrency-worker-key-fn.d.ts +0 -0
- /package/{examples → src/legacy/examples}/crons/programatic-crons.d.ts +0 -0
- /package/{examples → src/legacy/examples}/dag-worker.d.ts +0 -0
- /package/{examples → src/legacy/examples}/example-event-with-results.d.ts +0 -0
- /package/{examples → src/legacy/examples}/example-event.d.ts +0 -0
- /package/{examples → src/legacy/examples}/fanout-worker.d.ts +0 -0
- /package/{examples → src/legacy/examples}/logger.d.ts +0 -0
- /package/{examples → src/legacy/examples}/manual-trigger.d.ts +0 -0
- /package/{examples → src/legacy/examples}/multi-workflow.d.ts +0 -0
- /package/{examples → src/legacy/examples}/namespaced-worker.d.ts +0 -0
- /package/{examples → src/legacy/examples}/on-failure.d.ts +0 -0
- /package/{examples → src/legacy/examples}/rate-limit/events.d.ts +0 -0
- /package/{examples → src/legacy/examples}/rate-limit/worker.d.ts +0 -0
- /package/{examples → src/legacy/examples}/retries-with-backoff.d.ts +0 -0
- /package/{examples → src/legacy/examples}/retries-worker.d.ts +0 -0
- /package/{examples → src/legacy/examples}/scheduled-runs/programatic-schedules.d.ts +0 -0
- /package/{examples → src/legacy/examples}/sticky-trigger.d.ts +0 -0
- /package/{examples → src/legacy/examples}/sticky-worker-with-check.d.ts +0 -0
- /package/{examples → src/legacy/examples}/sticky-worker.d.ts +0 -0
- /package/{examples → src/legacy/examples}/stream-by-additional-meta.d.ts +0 -0
- /package/{protoc → src/protoc}/dispatcher/dispatcher.d.ts +0 -0
- /package/{protoc → src/protoc}/dispatcher/dispatcher.js +0 -0
- /package/{protoc → src/protoc}/dispatcher/index.d.ts +0 -0
- /package/{protoc → src/protoc}/dispatcher/index.js +0 -0
- /package/{protoc → src/protoc}/events/events.d.ts +0 -0
- /package/{protoc → src/protoc}/events/events.js +0 -0
- /package/{protoc → src/protoc}/events/index.d.ts +0 -0
- /package/{protoc → src/protoc}/events/index.js +0 -0
- /package/{protoc → src/protoc}/google/protobuf/timestamp.d.ts +0 -0
- /package/{protoc → src/protoc}/google/protobuf/timestamp.js +0 -0
- /package/{protoc → src/protoc}/google/protobuf/wrappers.d.ts +0 -0
- /package/{protoc → src/protoc}/google/protobuf/wrappers.js +0 -0
- /package/{protoc → src/protoc}/v1/dispatcher.d.ts +0 -0
- /package/{protoc → src/protoc}/v1/dispatcher.js +0 -0
- /package/{protoc → src/protoc}/v1/shared/condition.d.ts +0 -0
- /package/{protoc → src/protoc}/v1/shared/condition.js +0 -0
- /package/{protoc → src/protoc}/workflows/index.d.ts +0 -0
- /package/{protoc → src/protoc}/workflows/index.js +0 -0
- /package/{protoc → src/protoc}/workflows/v1-admin.d.ts +0 -0
- /package/{protoc → src/protoc}/workflows/v1-admin.js +0 -0
- /package/{util → src/util}/apply-namespace.d.ts +0 -0
- /package/{util → src/util}/apply-namespace.js +0 -0
- /package/{util → src/util}/batch.d.ts +0 -0
- /package/{util → src/util}/batch.js +0 -0
- /package/{util → src/util}/config-loader/index.d.ts +0 -0
- /package/{util → src/util}/config-loader/index.js +0 -0
- /package/{util → src/util}/config-loader/token.d.ts +0 -0
- /package/{util → src/util}/config-loader/token.js +0 -0
- /package/{util → src/util}/errors/hatchet-error.d.ts +0 -0
- /package/{util → src/util}/errors/hatchet-error.js +0 -0
- /package/{util → src/util}/grpc-helpers.js +0 -0
- /package/{util → src/util}/logger/logger.js +0 -0
- /package/{util → src/util}/parse.d.ts +0 -0
- /package/{util → src/util}/parse.js +0 -0
- /package/{util → src/util}/retrier.d.ts +0 -0
- /package/{util → src/util}/retrier.js +0 -0
- /package/{util → src/util}/thread-helper.d.ts +0 -0
- /package/{util → src/util}/thread-helper.js +0 -0
- /package/{util → src/util}/uuid.d.ts +0 -0
- /package/{util → src/util}/uuid.js +0 -0
- /package/{v1 → src/v1}/client/client.interface.js +0 -0
- /package/{v1 → src/v1}/client/duration.d.ts +0 -0
- /package/{v1 → src/v1}/client/duration.js +0 -0
- /package/{v1 → src/v1}/client/features/index.d.ts +0 -0
- /package/{v1 → src/v1}/client/features/index.js +0 -0
- /package/{v1 → src/v1}/client/features/tenant.js +0 -0
- /package/{v1 → src/v1}/client/worker/deprecated/deprecation.js +0 -0
- /package/{v1 → src/v1}/client/worker/deprecated/index.d.ts +0 -0
- /package/{v1 → src/v1}/client/worker/deprecated/index.js +0 -0
- /package/{v1 → src/v1}/client/worker/deprecated/legacy-worker.d.ts +0 -0
- /package/{v1 → src/v1}/client/worker/health-server.js +0 -0
- /package/{v1 → src/v1}/client/worker/slot-utils.js +0 -0
- /package/{v1 → src/v1}/conditions/base.d.ts +0 -0
- /package/{v1 → src/v1}/conditions/base.js +0 -0
- /package/{v1 → src/v1}/conditions/index.d.ts +0 -0
- /package/{v1 → src/v1}/conditions/index.js +0 -0
- /package/{v1 → src/v1}/conditions/parent-condition.d.ts +0 -0
- /package/{v1 → src/v1}/conditions/parent-condition.js +0 -0
- /package/{v1 → src/v1}/conditions/sleep-condition.d.ts +0 -0
- /package/{v1 → src/v1}/conditions/sleep-condition.js +0 -0
- /package/{v1 → src/v1}/conditions/transformer.js +0 -0
- /package/{v1 → src/v1}/conditions/user-event-condition.d.ts +0 -0
- /package/{v1 → src/v1}/conditions/user-event-condition.js +0 -0
- /package/{examples/webhooks.d.ts → src/v1/examples/affinity/affinity-workers.d.ts} +0 -0
- /package/{v1/examples/cancellations → src/v1/examples/cancellation}/run.d.ts +0 -0
- /package/{v1/examples/cancellations → src/v1/examples/cancellation}/worker.d.ts +0 -0
- /package/{v1/examples/child_workflows → src/v1/examples/cancellations}/run.d.ts +0 -0
- /package/{v1/examples/child_workflows → src/v1/examples/cancellations}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/cancellations/worker.js +0 -0
- /package/{v1 → src/v1}/examples/cancellations/workflow.d.ts +0 -0
- /package/{v1/examples/concurrency-rr → src/v1/examples/child_workflows}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/child_workflows/run.js +0 -0
- /package/{v1/examples/concurrency-rr → src/v1/examples/child_workflows}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/child_workflows/worker.js +0 -0
- /package/{v1 → src/v1}/examples/child_workflows/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/child_workflows/workflow.js +0 -0
- /package/{v1 → src/v1}/examples/concurrency-rr/load.d.ts +0 -0
- /package/{v1 → src/v1}/examples/concurrency-rr/load.js +0 -0
- /package/{v1/examples/dag → src/v1/examples/concurrency-rr}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/concurrency-rr/run.js +0 -0
- /package/{v1/examples/dag → src/v1/examples/concurrency-rr}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/concurrency-rr/worker.js +0 -0
- /package/{v1 → src/v1}/examples/concurrency-rr/workflow.d.ts +0 -0
- /package/{v1/types.js → src/v1/examples/concurrency-types.js} +0 -0
- /package/{v1/examples/dag_match_condition/event.d.ts → src/v1/examples/concurrency_limit_rr/load.d.ts} +0 -0
- /package/{v1/examples/dag_match_condition → src/v1/examples/concurrency_limit_rr}/run.d.ts +0 -0
- /package/{v1/examples/dag_match_condition → src/v1/examples/concurrency_limit_rr}/worker.d.ts +0 -0
- /package/{v1/examples/dag_match_condition → src/v1/examples/conditions}/complex-workflow.d.ts +0 -0
- /package/{v1/examples/durable-event → src/v1/examples/conditions}/event.d.ts +0 -0
- /package/{v1/examples/dag_match_condition → src/v1/examples/conditions}/event.js +0 -0
- /package/{v1/examples/deep → src/v1/examples/conditions}/run.d.ts +0 -0
- /package/{v1/examples/dag_match_condition → src/v1/examples/conditions}/run.js +0 -0
- /package/{v1/examples/deep → src/v1/examples/conditions}/worker.d.ts +0 -0
- /package/{v1/examples/dag_match_condition → src/v1/examples/conditions}/worker.js +0 -0
- /package/{v1/examples/dag_match_condition → src/v1/examples/conditions}/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/dag/interface-workflow.js +0 -0
- /package/{v1/examples/durable-event → src/v1/examples/dag}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/dag/run.js +0 -0
- /package/{v1/examples/durable-event → src/v1/examples/dag}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/dag/worker.js +0 -0
- /package/{v1 → src/v1}/examples/dag/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/dag/workflow.js +0 -0
- /package/{v1/examples/durable-sleep → src/v1/examples/dag_match_condition}/event.d.ts +0 -0
- /package/{v1/examples/durable-sleep → src/v1/examples/dag_match_condition}/event.js +0 -0
- /package/{v1/examples/durable-sleep → src/v1/examples/dag_match_condition}/run.d.ts +0 -0
- /package/{v1/examples/durable-sleep → src/v1/examples/dag_match_condition}/worker.d.ts +0 -0
- /package/{v1/examples/high-memory → src/v1/examples/deep}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/deep/run.js +0 -0
- /package/{v1/examples/inferred-typing → src/v1/examples/deep}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/deep/worker.js +0 -0
- /package/{v1 → src/v1}/examples/deep/workflow.d.ts +0 -0
- /package/{v1/examples/on_event → src/v1/examples/durable-event}/event.d.ts +0 -0
- /package/{v1 → src/v1}/examples/durable-event/event.js +0 -0
- /package/{v1/examples/inferred-typing → src/v1/examples/durable-event}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/durable-event/run.js +0 -0
- /package/{v1/examples/legacy → src/v1/examples/durable-event}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/durable-event/worker.js +0 -0
- /package/{v1 → src/v1}/examples/durable-event/workflow.d.ts +0 -0
- /package/{v1/examples/high-memory/child-worker.d.ts → src/v1/examples/durable-sleep/event.d.ts} +0 -0
- /package/{v1/examples/legacy → src/v1/examples/durable-sleep}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/durable-sleep/run.js +0 -0
- /package/{v1/examples/middleware → src/v1/examples/durable-sleep}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/durable-sleep/worker.js +0 -0
- /package/{v1 → src/v1}/examples/durable-sleep/workflow.d.ts +0 -0
- /package/{v1/examples/high-memory/parent-worker.d.ts → src/v1/examples/durable_event/event.d.ts} +0 -0
- /package/{v1/examples/middleware → src/v1/examples/durable_event}/run.d.ts +0 -0
- /package/{v1/examples/multiple_wf_concurrency → src/v1/examples/durable_event}/worker.d.ts +0 -0
- /package/{v1/examples/landing_page/scheduling.d.ts → src/v1/examples/durable_sleep/event.d.ts} +0 -0
- /package/{v1/examples/multiple_wf_concurrency → src/v1/examples/durable_sleep}/run.d.ts +0 -0
- /package/{v1/examples/non_retryable → src/v1/examples/durable_sleep}/worker.d.ts +0 -0
- /package/{v1/examples/logging/byo-logger.d.ts → src/v1/examples/e2e-worker.d.ts} +0 -0
- /package/{v1/examples/logging/logger.d.ts → src/v1/examples/events/event.d.ts} +0 -0
- /package/{v1/examples/on_event → src/v1/examples/events}/event.js +0 -0
- /package/{v1/examples/on_event → src/v1/examples/events}/filter.d.ts +0 -0
- /package/{v1/examples/on_cron → src/v1/examples/events}/worker.d.ts +0 -0
- /package/{v1/examples/on_event → src/v1/examples/events}/worker.js +0 -0
- /package/{v1/examples/on_event → src/v1/examples/events}/workflow.d.ts +0 -0
- /package/{v1/examples/on_event → src/v1/examples/events}/workflow.js +0 -0
- /package/{v1/examples/middleware/recipes.d.ts → src/v1/examples/high-memory/child-worker.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/high-memory/child-worker.js +0 -0
- /package/{v1/examples/non_retryable/run.d.ts → src/v1/examples/high-memory/parent-worker.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/high-memory/parent-worker.js +0 -0
- /package/{v1/examples/on_failure → src/v1/examples/high-memory}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/high-memory/run.js +0 -0
- /package/{v1 → src/v1}/examples/high-memory/workflow-with-child.d.ts +0 -0
- /package/{v1/examples/on_success → src/v1/examples/inferred-typing}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/inferred-typing/run.js +0 -0
- /package/{v1/examples/on_event → src/v1/examples/inferred-typing}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/inferred-typing/worker.js +0 -0
- /package/{v1 → src/v1}/examples/inferred-typing/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/inferred-typing/workflow.js +0 -0
- /package/{v1 → src/v1}/examples/landing_page/durable-excution.d.ts +0 -0
- /package/{v1 → src/v1}/examples/landing_page/event-signaling.d.ts +0 -0
- /package/{v1 → src/v1}/examples/landing_page/event-signaling.js +0 -0
- /package/{v1 → src/v1}/examples/landing_page/flow-control.d.ts +0 -0
- /package/{v1 → src/v1}/examples/landing_page/queues.d.ts +0 -0
- /package/{v1 → src/v1}/examples/landing_page/queues.js +0 -0
- /package/{v1/examples/on_failure/worker.d.ts → src/v1/examples/landing_page/scheduling.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/landing_page/scheduling.js +0 -0
- /package/{v1 → src/v1}/examples/landing_page/task-routing.d.ts +0 -0
- /package/{v1 → src/v1}/examples/landing_page/task-routing.js +0 -0
- /package/{v1/examples/priority → src/v1/examples/legacy}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/legacy/run.js +0 -0
- /package/{v1/examples/on_success → src/v1/examples/legacy}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/legacy/worker.js +0 -0
- /package/{v1 → src/v1}/examples/legacy/workflow.js +0 -0
- /package/{v1/examples/priority/worker.d.ts → src/v1/examples/logger/byo-logger.d.ts} +0 -0
- /package/{v1/examples/quickstart/run.d.ts → src/v1/examples/logger/logger.d.ts} +0 -0
- /package/{v1/examples/logging → src/v1/examples/logger}/logger.js +0 -0
- /package/{v1/examples/quickstart/worker.d.ts → src/v1/examples/logging/byo-logger.d.ts} +0 -0
- /package/{v1/examples/rate_limit/workflow.d.ts → src/v1/examples/logging/logger.d.ts} +0 -0
- /package/{v1/examples/retries/run.d.ts → src/v1/examples/middleware/recipes.d.ts} +0 -0
- /package/{v1/examples/sticky → src/v1/examples/middleware}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/middleware/run.js +0 -0
- /package/{v1/examples/retries → src/v1/examples/middleware}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/middleware/worker.js +0 -0
- /package/{v1 → src/v1}/examples/middleware/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/middleware/workflow.js +0 -0
- /package/{v1 → src/v1}/examples/migration-guides/mergent.d.ts +0 -0
- /package/{v1 → src/v1}/examples/migration-guides/mergent.js +0 -0
- /package/{v1/examples/streaming → src/v1/examples/multiple_wf_concurrency}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/multiple_wf_concurrency/run.js +0 -0
- /package/{v1/examples/simple → src/v1/examples/multiple_wf_concurrency}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/multiple_wf_concurrency/worker.js +0 -0
- /package/{v1/examples/timeouts → src/v1/examples/non_retryable}/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/non_retryable/run.js +0 -0
- /package/{v1/examples/sticky → src/v1/examples/non_retryable}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/non_retryable/worker.js +0 -0
- /package/{v1 → src/v1}/examples/non_retryable/workflow.d.ts +0 -0
- /package/{v1/examples/streaming → src/v1/examples/on_cron}/worker.d.ts +0 -0
- /package/{v1 → src/v1}/examples/on_cron/worker.js +0 -0
- /package/{v1 → src/v1}/examples/on_cron/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/on_cron/workflow.js +0 -0
- /package/{v1/examples/simple/bulk.d.ts → src/v1/examples/on_event/event.d.ts} +0 -0
- /package/{v1/examples/simple/client-run.d.ts → src/v1/examples/on_event/filter.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/on_event/filter.js +0 -0
- /package/{v1/examples/timeouts → src/v1/examples/on_event}/worker.d.ts +0 -0
- /package/{v1/examples/simple/cron.d.ts → src/v1/examples/on_failure/run.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/on_failure/run.js +0 -0
- /package/{v1/examples/simple/delay.d.ts → src/v1/examples/on_failure/worker.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/on_failure/worker.js +0 -0
- /package/{v1/examples/simple/enqueue.d.ts → src/v1/examples/on_success/run.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/on_success/run.js +0 -0
- /package/{v1/examples/simple/replay-cancel.d.ts → src/v1/examples/on_success/worker.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/on_success/worker.js +0 -0
- /package/{v1 → src/v1}/examples/on_success/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/on_success/workflow.js +0 -0
- /package/{v1/examples/simple/schedule.d.ts → src/v1/examples/priority/run.d.ts} +0 -0
- /package/{v1/examples/simple/typed-run-methods.d.ts → src/v1/examples/priority/worker.d.ts} +0 -0
- /package/{v1 → src/v1}/examples/priority/worker.js +0 -0
- /package/{v1 → src/v1}/examples/quickstart/run.js +0 -0
- /package/{v1 → src/v1}/examples/quickstart/worker.js +0 -0
- /package/{v1 → src/v1}/examples/quickstart/workflows/first-task.d.ts +0 -0
- /package/{v1 → src/v1}/examples/quickstart/workflows/first-task.js +0 -0
- /package/{v1 → src/v1}/examples/retries/run.js +0 -0
- /package/{v1 → src/v1}/examples/retries/worker.js +0 -0
- /package/{v1 → src/v1}/examples/retries/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/simple/bulk.js +0 -0
- /package/{v1 → src/v1}/examples/simple/client-run.js +0 -0
- /package/{v1 → src/v1}/examples/simple/cron.js +0 -0
- /package/{v1 → src/v1}/examples/simple/delay.js +0 -0
- /package/{v1 → src/v1}/examples/simple/run.d.ts +0 -0
- /package/{v1 → src/v1}/examples/simple/run.js +0 -0
- /package/{v1 → src/v1}/examples/simple/schedule.js +0 -0
- /package/{v1 → src/v1}/examples/simple/stub-workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/simple/stub-workflow.js +0 -0
- /package/{v1 → src/v1}/examples/simple/typed-run-methods.js +0 -0
- /package/{v1 → src/v1}/examples/simple/worker.js +0 -0
- /package/{v1 → src/v1}/examples/simple/workflow-with-child.d.ts +0 -0
- /package/{v1 → src/v1}/examples/simple/workflow-with-child.js +0 -0
- /package/{v1 → src/v1}/examples/simple/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/simple/workflow.js +0 -0
- /package/{v1 → src/v1}/examples/simple/zod.d.ts +0 -0
- /package/{v1 → src/v1}/examples/simple/zod.js +0 -0
- /package/{v1 → src/v1}/examples/sticky/run.js +0 -0
- /package/{v1 → src/v1}/examples/sticky/worker.js +0 -0
- /package/{v1 → src/v1}/examples/streaming/nextjs-proxy.d.ts +0 -0
- /package/{v1 → src/v1}/examples/streaming/nextjs-proxy.js +0 -0
- /package/{v1 → src/v1}/examples/streaming/run.js +0 -0
- /package/{v1 → src/v1}/examples/streaming/worker.js +0 -0
- /package/{v1 → src/v1}/examples/streaming/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/streaming/workflow.js +0 -0
- /package/{v1 → src/v1}/examples/timeouts/run.js +0 -0
- /package/{v1 → src/v1}/examples/timeouts/worker.js +0 -0
- /package/{v1 → src/v1}/examples/timeouts/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/examples/with_timeouts/workflow.d.ts +0 -0
- /package/{v1 → src/v1}/slot-types.d.ts +0 -0
- /package/{v1 → src/v1}/slot-types.js +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.dagWithConditions = void 0;
|
|
16
|
+
const sleep_1 = __importDefault(require("../../../../util/sleep"));
|
|
17
|
+
const conditions_1 = require("../../../../v1/conditions");
|
|
18
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
19
|
+
exports.dagWithConditions = hatchet_client_1.hatchet.workflow({
|
|
20
|
+
name: 'simple',
|
|
21
|
+
});
|
|
22
|
+
const firstTask = exports.dagWithConditions.task({
|
|
23
|
+
name: 'first-task',
|
|
24
|
+
fn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
yield (0, sleep_1.default)(2000);
|
|
26
|
+
return {
|
|
27
|
+
Completed: true,
|
|
28
|
+
};
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
exports.dagWithConditions.task({
|
|
32
|
+
name: 'second-task',
|
|
33
|
+
parents: [firstTask],
|
|
34
|
+
waitFor: (0, conditions_1.Or)({ eventKey: 'user:event' }, { sleepFor: '10s' }),
|
|
35
|
+
fn: (_, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
console.log('triggered by condition', ctx.triggers());
|
|
37
|
+
return {
|
|
38
|
+
Completed: true,
|
|
39
|
+
};
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.parent = exports.child5 = exports.child4 = exports.child3 = exports.child2 = exports.child1 = void 0;
|
|
16
|
-
const sleep_1 = __importDefault(require("
|
|
16
|
+
const sleep_1 = __importDefault(require("../../../../util/sleep"));
|
|
17
17
|
const hatchet_client_1 = require("../hatchet-client");
|
|
18
18
|
exports.child1 = hatchet_client_1.hatchet.workflow({
|
|
19
19
|
name: 'child1',
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const EVENT_KEY = "durable-example:event";
|
|
2
|
+
export declare const SLEEP_TIME_SECONDS = 2;
|
|
3
|
+
export declare const SLEEP_TIME: "2s";
|
|
4
|
+
export declare const durableWorkflow: import("../..").WorkflowDeclaration<import("../..").UnknownInputType, {}, {}>;
|
|
5
|
+
export declare const waitForSleepTwice: import("../..").TaskWorkflowDeclaration<import("../..").JsonObject, {
|
|
6
|
+
runtime: number;
|
|
7
|
+
}, {}, {}, {}, {}>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.waitForSleepTwice = exports.durableWorkflow = exports.SLEEP_TIME = exports.SLEEP_TIME_SECONDS = exports.EVENT_KEY = void 0;
|
|
13
|
+
/* eslint-disable no-console */
|
|
14
|
+
const conditions_1 = require("../../../../v1/conditions");
|
|
15
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
16
|
+
exports.EVENT_KEY = 'durable-example:event';
|
|
17
|
+
exports.SLEEP_TIME_SECONDS = 2;
|
|
18
|
+
exports.SLEEP_TIME = `${exports.SLEEP_TIME_SECONDS}s`;
|
|
19
|
+
// > Create a durable workflow
|
|
20
|
+
exports.durableWorkflow = hatchet_client_1.hatchet.workflow({
|
|
21
|
+
name: 'durable-workflow',
|
|
22
|
+
});
|
|
23
|
+
// !!
|
|
24
|
+
exports.durableWorkflow.task({
|
|
25
|
+
name: 'ephemeral_task',
|
|
26
|
+
fn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
console.log('Running non-durable task');
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
exports.durableWorkflow.durableTask({
|
|
31
|
+
name: 'durable_task',
|
|
32
|
+
executionTimeout: '10m',
|
|
33
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
console.log('Waiting for sleep');
|
|
35
|
+
yield ctx.sleepFor(exports.SLEEP_TIME);
|
|
36
|
+
console.log('Sleep finished');
|
|
37
|
+
console.log('Waiting for event');
|
|
38
|
+
yield ctx.waitFor({ eventKey: exports.EVENT_KEY });
|
|
39
|
+
console.log('Event received');
|
|
40
|
+
return { status: 'success' };
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
function extractKeyAndEventId(waitResult) {
|
|
44
|
+
// DurableContext.waitFor currently returns the CREATE payload directly.
|
|
45
|
+
// The shape is typically `{ [readableDataKey]: { [eventId]: ... } }`.
|
|
46
|
+
const obj = waitResult;
|
|
47
|
+
if (obj && typeof obj === 'object') {
|
|
48
|
+
const key = Object.keys(obj)[0];
|
|
49
|
+
const inner = obj[key];
|
|
50
|
+
if (inner && typeof inner === 'object') {
|
|
51
|
+
const eventId = Object.keys(inner)[0];
|
|
52
|
+
if (eventId) {
|
|
53
|
+
return { key: 'CREATE', eventId };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (key) {
|
|
57
|
+
return { key: 'CREATE', eventId: key };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return { key: 'CREATE', eventId: '' };
|
|
61
|
+
}
|
|
62
|
+
exports.durableWorkflow.durableTask({
|
|
63
|
+
name: 'wait_for_or_group_1',
|
|
64
|
+
executionTimeout: '10m',
|
|
65
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
+
const start = Date.now();
|
|
67
|
+
const waitResult = yield ctx.waitFor((0, conditions_1.Or)(new conditions_1.SleepCondition(exports.SLEEP_TIME, 'sleep'), new conditions_1.UserEventCondition(exports.EVENT_KEY, '', 'event')));
|
|
68
|
+
const { key, eventId } = extractKeyAndEventId(waitResult);
|
|
69
|
+
return {
|
|
70
|
+
runtime: Math.round((Date.now() - start) / 1000),
|
|
71
|
+
key,
|
|
72
|
+
eventId,
|
|
73
|
+
};
|
|
74
|
+
}),
|
|
75
|
+
});
|
|
76
|
+
exports.durableWorkflow.durableTask({
|
|
77
|
+
name: 'wait_for_or_group_2',
|
|
78
|
+
executionTimeout: '10m',
|
|
79
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
const start = Date.now();
|
|
81
|
+
const waitResult = yield ctx.waitFor((0, conditions_1.Or)(new conditions_1.SleepCondition(`${6 * exports.SLEEP_TIME_SECONDS}s`, 'sleep'), new conditions_1.UserEventCondition(exports.EVENT_KEY, '', 'event')));
|
|
82
|
+
const { key, eventId } = extractKeyAndEventId(waitResult);
|
|
83
|
+
return {
|
|
84
|
+
runtime: Math.round((Date.now() - start) / 1000),
|
|
85
|
+
key,
|
|
86
|
+
eventId,
|
|
87
|
+
};
|
|
88
|
+
}),
|
|
89
|
+
});
|
|
90
|
+
exports.durableWorkflow.durableTask({
|
|
91
|
+
name: 'wait_for_multi_sleep',
|
|
92
|
+
executionTimeout: '10m',
|
|
93
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
+
const start = Date.now();
|
|
95
|
+
// sleep 3 times
|
|
96
|
+
for (let i = 0; i < 3; i += 1) {
|
|
97
|
+
yield ctx.sleepFor(exports.SLEEP_TIME);
|
|
98
|
+
}
|
|
99
|
+
return { runtime: Math.round((Date.now() - start) / 1000) };
|
|
100
|
+
}),
|
|
101
|
+
});
|
|
102
|
+
exports.waitForSleepTwice = hatchet_client_1.hatchet.durableTask({
|
|
103
|
+
name: 'wait-for-sleep-twice',
|
|
104
|
+
executionTimeout: '10m',
|
|
105
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
106
|
+
try {
|
|
107
|
+
const start = Date.now();
|
|
108
|
+
yield ctx.sleepFor(exports.SLEEP_TIME);
|
|
109
|
+
return { runtime: Math.round((Date.now() - start) / 1000) };
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
// treat cancellation as a successful completion for parity with Python sample
|
|
113
|
+
return { runtime: -1 };
|
|
114
|
+
}
|
|
115
|
+
}),
|
|
116
|
+
});
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.durableEventWithFilter = exports.durableEvent = void 0;
|
|
13
|
-
// import sleep from '
|
|
13
|
+
// import sleep from '../../../../util/sleep.js';
|
|
14
14
|
const hatchet_client_1 = require("../hatchet-client");
|
|
15
15
|
// > Durable Event
|
|
16
16
|
exports.durableEvent = hatchet_client_1.hatchet.durableTask({
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
13
|
+
function main() {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const event = yield hatchet_client_1.hatchet.events.push('user:event', {
|
|
16
|
+
Data: { Hello: 'World' },
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (require.main === module) {
|
|
21
|
+
main()
|
|
22
|
+
.then(() => process.exit(0))
|
|
23
|
+
.catch((error) => {
|
|
24
|
+
// eslint-disable-next-line no-console
|
|
25
|
+
console.error('Error:', error);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.durableSleep = void 0;
|
|
13
|
-
// import sleep from '
|
|
13
|
+
// import sleep from '../../../../util/sleep.js';
|
|
14
14
|
const hatchet_client_1 = require("../hatchet-client");
|
|
15
15
|
exports.durableSleep = hatchet_client_1.hatchet.workflow({
|
|
16
16
|
name: 'durable-sleep',
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
13
|
+
function main() {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const event = yield hatchet_client_1.hatchet.events.push('user:update', {
|
|
16
|
+
userId: '1234',
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (require.main === module) {
|
|
21
|
+
main()
|
|
22
|
+
.then(() => process.exit(0))
|
|
23
|
+
.catch((error) => {
|
|
24
|
+
// eslint-disable-next-line no-console
|
|
25
|
+
console.error('Error:', error);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const workflow_1 = require("./workflow");
|
|
13
|
+
function main() {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const timeStart = Date.now();
|
|
16
|
+
const res = yield workflow_1.durableEvent.run({});
|
|
17
|
+
const timeEnd = Date.now();
|
|
18
|
+
// eslint-disable-next-line no-console
|
|
19
|
+
console.log(`Time taken: ${timeEnd - timeStart}ms`);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (require.main === module) {
|
|
23
|
+
main()
|
|
24
|
+
.then(() => process.exit(0))
|
|
25
|
+
.catch((error) => {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.error('Error:', error);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
13
|
+
const workflow_1 = require("./workflow");
|
|
14
|
+
function main() {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const worker = yield hatchet_client_1.hatchet.worker('durable-event-worker', {
|
|
17
|
+
workflows: [workflow_1.durableEvent],
|
|
18
|
+
});
|
|
19
|
+
yield worker.start();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (require.main === module) {
|
|
23
|
+
main();
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const durableEvent: import("../..").TaskWorkflowDeclaration<import("../..").JsonObject, {
|
|
2
|
+
Value: string;
|
|
3
|
+
}, {}, {}, {}, {}>;
|
|
4
|
+
export declare const durableEventWithFilter: import("../..").TaskWorkflowDeclaration<import("../..").JsonObject, {
|
|
5
|
+
Value: string;
|
|
6
|
+
}, {}, {}, {}, {}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.durableEventWithFilter = exports.durableEvent = void 0;
|
|
13
|
+
// import sleep from '../../../../util/sleep.js';
|
|
14
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
15
|
+
// > Durable Event
|
|
16
|
+
exports.durableEvent = hatchet_client_1.hatchet.durableTask({
|
|
17
|
+
name: 'durable-event',
|
|
18
|
+
executionTimeout: '10m',
|
|
19
|
+
fn: (_, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
const res = ctx.waitFor({
|
|
21
|
+
eventKey: 'user:update',
|
|
22
|
+
});
|
|
23
|
+
console.log('res', res);
|
|
24
|
+
return {
|
|
25
|
+
Value: 'done',
|
|
26
|
+
};
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
// !!
|
|
30
|
+
exports.durableEventWithFilter = hatchet_client_1.hatchet.durableTask({
|
|
31
|
+
name: 'durable-event-with-filter',
|
|
32
|
+
executionTimeout: '10m',
|
|
33
|
+
fn: (_, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
// > Durable Event With Filter
|
|
35
|
+
const res = ctx.waitFor({
|
|
36
|
+
eventKey: 'user:update',
|
|
37
|
+
expression: "input.userId == '1234'",
|
|
38
|
+
});
|
|
39
|
+
// !!
|
|
40
|
+
console.log('res', res);
|
|
41
|
+
return {
|
|
42
|
+
Value: 'done',
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
// !!
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
13
|
+
function main() {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const event = yield hatchet_client_1.hatchet.events.push('user:event', {
|
|
16
|
+
Data: { Hello: 'World' },
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (require.main === module) {
|
|
21
|
+
main()
|
|
22
|
+
.then(() => process.exit(0))
|
|
23
|
+
.catch((error) => {
|
|
24
|
+
// eslint-disable-next-line no-console
|
|
25
|
+
console.error('Error:', error);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const workflow_1 = require("./workflow");
|
|
13
|
+
function main() {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const timeStart = Date.now();
|
|
16
|
+
const res = yield workflow_1.durableSleep.run({});
|
|
17
|
+
const timeEnd = Date.now();
|
|
18
|
+
// eslint-disable-next-line no-console
|
|
19
|
+
console.log(`Time taken: ${timeEnd - timeStart}ms`);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (require.main === module) {
|
|
23
|
+
main()
|
|
24
|
+
.then(() => process.exit(0))
|
|
25
|
+
.catch((error) => {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.error('Error:', error);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
13
|
+
const workflow_1 = require("./workflow");
|
|
14
|
+
function main() {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const worker = yield hatchet_client_1.hatchet.worker('sleep-worker', {
|
|
17
|
+
workflows: [workflow_1.durableSleep],
|
|
18
|
+
});
|
|
19
|
+
yield worker.start();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (require.main === module) {
|
|
23
|
+
main();
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const durableSleep: import("../..").WorkflowDeclaration<import("../..").UnknownInputType, {}, {}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.durableSleep = void 0;
|
|
13
|
+
// import sleep from '../../../../util/sleep.js';
|
|
14
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
15
|
+
exports.durableSleep = hatchet_client_1.hatchet.workflow({
|
|
16
|
+
name: 'durable-sleep',
|
|
17
|
+
});
|
|
18
|
+
// > Durable Sleep
|
|
19
|
+
exports.durableSleep.durableTask({
|
|
20
|
+
name: 'durable-sleep',
|
|
21
|
+
executionTimeout: '10m',
|
|
22
|
+
fn: (_, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
console.log('sleeping for 5s');
|
|
24
|
+
const sleepRes = yield ctx.sleepFor('5s');
|
|
25
|
+
console.log('done sleeping for 5s', sleepRes);
|
|
26
|
+
return {
|
|
27
|
+
Value: 'done',
|
|
28
|
+
};
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
// !!
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/**
|
|
13
|
+
* Shared e2e worker - registers all v1 example workflows for e2e tests.
|
|
14
|
+
* Spawned by jest.e2e-global-setup and killed by jest.e2e-global-teardown.
|
|
15
|
+
* Set HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED=true and
|
|
16
|
+
* HATCHET_CLIENT_WORKER_HEALTHCHECK_PORT before running.
|
|
17
|
+
*/
|
|
18
|
+
const hatchet_client_1 = require("./hatchet-client");
|
|
19
|
+
const workflow_1 = require("./bulk_fanout/workflow");
|
|
20
|
+
const workflow_2 = require("./bulk_operations/workflow");
|
|
21
|
+
const cancellation_workflow_1 = require("./cancellation/cancellation-workflow");
|
|
22
|
+
const complex_workflow_1 = require("./conditions/complex-workflow");
|
|
23
|
+
const workflow_3 = require("./concurrency_cancel_in_progress/workflow");
|
|
24
|
+
const workflow_4 = require("./concurrency_cancel_newest/workflow");
|
|
25
|
+
const workflow_5 = require("./concurrency_multiple_keys/workflow");
|
|
26
|
+
const workflow_6 = require("./concurrency_workflow_level/workflow");
|
|
27
|
+
const workflow_7 = require("./dag/workflow");
|
|
28
|
+
const workflow_8 = require("./durable/workflow");
|
|
29
|
+
const workflow_9 = require("./logger/workflow");
|
|
30
|
+
const workflow_10 = require("./non_retryable/workflow");
|
|
31
|
+
const workflow_11 = require("./on_failure/workflow");
|
|
32
|
+
const workflow_12 = require("./on_event/workflow");
|
|
33
|
+
const workflow_13 = require("./return_exceptions/workflow");
|
|
34
|
+
const workflow_14 = require("./run_details/workflow");
|
|
35
|
+
const e2e_workflows_1 = require("./simple/e2e-workflows");
|
|
36
|
+
const workflow_15 = require("./streaming/workflow");
|
|
37
|
+
const workflow_16 = require("./timeout/workflow");
|
|
38
|
+
const workflow_17 = require("./webhooks/workflow");
|
|
39
|
+
const workflows = [
|
|
40
|
+
workflow_1.bulkChild,
|
|
41
|
+
workflow_1.bulkParentWorkflow,
|
|
42
|
+
workflow_2.bulkReplayTest1,
|
|
43
|
+
workflow_2.bulkReplayTest2,
|
|
44
|
+
workflow_2.bulkReplayTest3,
|
|
45
|
+
cancellation_workflow_1.cancellationWorkflow,
|
|
46
|
+
complex_workflow_1.taskConditionWorkflow,
|
|
47
|
+
workflow_3.concurrencyCancelInProgressWorkflow,
|
|
48
|
+
workflow_4.concurrencyCancelNewestWorkflow,
|
|
49
|
+
workflow_5.concurrencyMultipleKeysWorkflow,
|
|
50
|
+
workflow_6.concurrencyWorkflowLevelWorkflow,
|
|
51
|
+
workflow_7.dag,
|
|
52
|
+
workflow_8.durableWorkflow,
|
|
53
|
+
workflow_8.waitForSleepTwice,
|
|
54
|
+
(0, workflow_9.createLoggingWorkflow)(hatchet_client_1.hatchet),
|
|
55
|
+
workflow_10.nonRetryableWorkflow,
|
|
56
|
+
workflow_11.failureWorkflow,
|
|
57
|
+
workflow_12.lower,
|
|
58
|
+
workflow_13.returnExceptionsTask,
|
|
59
|
+
workflow_14.runDetailTestWorkflow,
|
|
60
|
+
e2e_workflows_1.helloWorld,
|
|
61
|
+
e2e_workflows_1.helloWorldDurable,
|
|
62
|
+
workflow_15.streamingTask,
|
|
63
|
+
workflow_16.timeoutTask,
|
|
64
|
+
workflow_16.refreshTimeoutTask,
|
|
65
|
+
workflow_17.webhookWorkflow,
|
|
66
|
+
];
|
|
67
|
+
function main() {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const worker = yield hatchet_client_1.hatchet.worker('e2e-test-worker', {
|
|
70
|
+
workflows,
|
|
71
|
+
slots: 100,
|
|
72
|
+
});
|
|
73
|
+
void worker.start();
|
|
74
|
+
yield worker.waitUntilReady(30000);
|
|
75
|
+
console.log('[e2e-worker] Worker registered and ready');
|
|
76
|
+
yield new Promise(() => { });
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
main().catch((err) => {
|
|
80
|
+
console.error('e2e-worker failed:', err);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
4
|
+
const workflow_1 = require("./workflow");
|
|
5
|
+
// > Create a filter
|
|
6
|
+
hatchet_client_1.hatchet.filters.create({
|
|
7
|
+
workflowId: workflow_1.lower.name,
|
|
8
|
+
expression: 'input.ShouldSkip == false',
|
|
9
|
+
scope: 'foobarbaz',
|
|
10
|
+
payload: {
|
|
11
|
+
main_character: 'Anna',
|
|
12
|
+
supporting_character: 'Stiva',
|
|
13
|
+
location: 'Moscow',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
// !!
|
|
17
|
+
// > Skip a run
|
|
18
|
+
hatchet_client_1.hatchet.events.push(workflow_1.SIMPLE_EVENT, {
|
|
19
|
+
Message: 'hello',
|
|
20
|
+
ShouldSkip: true,
|
|
21
|
+
}, {
|
|
22
|
+
scope: 'foobarbaz',
|
|
23
|
+
});
|
|
24
|
+
// !!
|
|
25
|
+
// > Trigger a run
|
|
26
|
+
hatchet_client_1.hatchet.events.push(workflow_1.SIMPLE_EVENT, {
|
|
27
|
+
Message: 'hello',
|
|
28
|
+
ShouldSkip: false,
|
|
29
|
+
}, {
|
|
30
|
+
scope: 'foobarbaz',
|
|
31
|
+
});
|
|
32
|
+
// !!
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HatchetClient } from '
|
|
1
|
+
import { HatchetClient } from '../../../v1';
|
|
2
2
|
export declare const hatchet: HatchetClient<{}, {}, {}, {}>;
|
|
@@ -23,7 +23,7 @@ exports.child = hatchet_client_1.hatchet.task({
|
|
|
23
23
|
});
|
|
24
24
|
exports.parent = hatchet_client_1.hatchet.task({
|
|
25
25
|
name: 'parent',
|
|
26
|
-
|
|
26
|
+
executionTimeout: '10m',
|
|
27
27
|
fn: (input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
28
|
// lets generate large payload 1 mb
|
|
29
29
|
const largePayload = new Array(1024 * 1024).fill('a').join('');
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
13
|
-
const conditions_1 = require("
|
|
13
|
+
const conditions_1 = require("../../../../v1/conditions");
|
|
14
14
|
const hatchet_client_1 = require("../hatchet-client");
|
|
15
15
|
function main() {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.simple = void 0;
|
|
4
|
-
const workflows_1 = require("
|
|
4
|
+
const workflows_1 = require("../../../../protoc/v1/workflows");
|
|
5
5
|
const hatchet_client_1 = require("../hatchet-client");
|
|
6
6
|
// > Process what you can handle
|
|
7
7
|
exports.simple = hatchet_client_1.hatchet.task({
|