@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
|
@@ -24,23 +24,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.AdminClient = void 0;
|
|
27
|
-
const hatchet_error_1 = __importDefault(require("
|
|
28
|
-
const workflow_run_ref_1 = __importDefault(require("
|
|
29
|
-
const grpc_helpers_1 = require("
|
|
30
|
-
const child_listener_client_1 = require("
|
|
31
|
-
const workflows_1 = require("
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
27
|
+
const hatchet_error_1 = __importDefault(require("../../../util/errors/hatchet-error"));
|
|
28
|
+
const workflow_run_ref_1 = __importDefault(require("../../../util/workflow-run-ref"));
|
|
29
|
+
const grpc_helpers_1 = require("../../../util/grpc-helpers");
|
|
30
|
+
const child_listener_client_1 = require("../../../clients/listeners/run-listener/child-listener-client");
|
|
31
|
+
const workflows_1 = require("../../../protoc/workflows");
|
|
32
|
+
const workflows_2 = require("../../../protoc/v1/workflows");
|
|
33
|
+
const retrier_1 = require("../../../util/retrier");
|
|
34
|
+
const batch_1 = require("../../../util/batch");
|
|
35
|
+
const apply_namespace_1 = require("../../../util/apply-namespace");
|
|
36
|
+
function convertDesiredWorkerLabels(labels) {
|
|
37
|
+
return Object.fromEntries(Object.entries(labels).map(([key, label]) => [
|
|
38
|
+
key,
|
|
39
|
+
{
|
|
40
|
+
strValue: typeof label.value === 'string' ? label.value : undefined,
|
|
41
|
+
intValue: typeof label.value === 'number' ? label.value : undefined,
|
|
42
|
+
required: label.required,
|
|
43
|
+
weight: label.weight,
|
|
44
|
+
comparator: label.comparator,
|
|
45
|
+
},
|
|
46
|
+
]));
|
|
47
|
+
}
|
|
35
48
|
class AdminClient {
|
|
36
49
|
constructor(config, api, runs) {
|
|
37
50
|
this.config = config;
|
|
38
51
|
this.logger = config.logger(`Admin`, config.log_level);
|
|
39
52
|
const { client, channel, factory } = (0, grpc_helpers_1.createGrpcClient)(config, workflows_1.WorkflowServiceDefinition);
|
|
40
|
-
this.
|
|
53
|
+
this.workflowsGrpc = client;
|
|
54
|
+
this.adminGrpc = factory.create(workflows_2.AdminServiceDefinition, channel);
|
|
41
55
|
this.listenerClient = new child_listener_client_1.RunListenerClient(config, channel, factory, api);
|
|
42
56
|
this.runs = runs;
|
|
43
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new workflow or updates an existing workflow via the v1 admin service.
|
|
60
|
+
* @param workflow a workflow definition to create
|
|
61
|
+
*/
|
|
62
|
+
putWorkflow(workflow) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
try {
|
|
65
|
+
return yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () { return this.adminGrpc.putWorkflow(workflow); }), this.logger);
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
throw new hatchet_error_1.default(e.message);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
44
72
|
/**
|
|
45
73
|
* Run a new instance of a workflow with the given input. This will create a new workflow run and return the ID of the
|
|
46
74
|
* new run.
|
|
@@ -52,14 +80,16 @@ class AdminClient {
|
|
|
52
80
|
runWorkflow(workflowName, input, options) {
|
|
53
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
82
|
try {
|
|
55
|
-
const computedName = (0, apply_namespace_1.applyNamespace)(workflowName, this.config.namespace);
|
|
83
|
+
const computedName = (0, apply_namespace_1.applyNamespace)(workflowName, this.config.namespace).toLowerCase();
|
|
56
84
|
const inputStr = JSON.stringify(input);
|
|
57
85
|
const opts = options !== null && options !== void 0 ? options : {};
|
|
58
|
-
const { additionalMetadata, parentStepRunId, parentTaskRunExternalId } = opts, rest = __rest(opts, ["additionalMetadata", "parentStepRunId", "parentTaskRunExternalId"]);
|
|
86
|
+
const { additionalMetadata, parentStepRunId, parentTaskRunExternalId, desiredWorkerLabels } = opts, rest = __rest(opts, ["additionalMetadata", "parentStepRunId", "parentTaskRunExternalId", "desiredWorkerLabels"]);
|
|
59
87
|
const request = Object.assign(Object.assign({ name: computedName, input: inputStr }, rest), {
|
|
60
88
|
// API expects `parentTaskRunExternalId`; accept old names as aliases.
|
|
61
|
-
parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined, priority: opts.priority
|
|
62
|
-
|
|
89
|
+
parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined, priority: opts.priority, desiredWorkerLabels: desiredWorkerLabels
|
|
90
|
+
? convertDesiredWorkerLabels(desiredWorkerLabels)
|
|
91
|
+
: {} });
|
|
92
|
+
const resp = yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () { return this.workflowsGrpc.triggerWorkflow(request); }), this.logger);
|
|
63
93
|
const id = resp.workflowRunId;
|
|
64
94
|
const ref = new workflow_run_ref_1.default(id, this.listenerClient, this.runs, options === null || options === void 0 ? void 0 : options.parentId,
|
|
65
95
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -82,13 +112,15 @@ class AdminClient {
|
|
|
82
112
|
return __awaiter(this, arguments, void 0, function* (workflowRuns, batchSize = 500) {
|
|
83
113
|
// Prepare workflows to be triggered in bulk
|
|
84
114
|
const workflowRequests = workflowRuns.map(({ workflowName, input, options }) => {
|
|
85
|
-
const computedName = (0, apply_namespace_1.applyNamespace)(workflowName, this.config.namespace);
|
|
115
|
+
const computedName = (0, apply_namespace_1.applyNamespace)(workflowName, this.config.namespace).toLowerCase();
|
|
86
116
|
const inputStr = JSON.stringify(input);
|
|
87
117
|
const opts = options !== null && options !== void 0 ? options : {};
|
|
88
|
-
const { additionalMetadata, parentStepRunId, parentTaskRunExternalId } = opts, rest = __rest(opts, ["additionalMetadata", "parentStepRunId", "parentTaskRunExternalId"]);
|
|
118
|
+
const { additionalMetadata, parentStepRunId, parentTaskRunExternalId, desiredWorkerLabels } = opts, rest = __rest(opts, ["additionalMetadata", "parentStepRunId", "parentTaskRunExternalId", "desiredWorkerLabels"]);
|
|
89
119
|
return Object.assign(Object.assign({ name: computedName, input: inputStr }, rest), {
|
|
90
120
|
// API expects `parentTaskRunExternalId`; accept old names as aliases.
|
|
91
|
-
parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined
|
|
121
|
+
parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined, desiredWorkerLabels: desiredWorkerLabels
|
|
122
|
+
? convertDesiredWorkerLabels(desiredWorkerLabels)
|
|
123
|
+
: {} });
|
|
92
124
|
});
|
|
93
125
|
const limit = 4 * 1024 * 1024; // FIXME configurable GRPC limit
|
|
94
126
|
const batches = (0, batch_1.batch)(workflowRequests, batchSize, limit);
|
|
@@ -101,7 +133,7 @@ class AdminClient {
|
|
|
101
133
|
workflows: payloads,
|
|
102
134
|
});
|
|
103
135
|
// Call the bulk trigger workflow method for this batch
|
|
104
|
-
const bulkTriggerWorkflowResponse = yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () { return this.
|
|
136
|
+
const bulkTriggerWorkflowResponse = yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () { return this.workflowsGrpc.bulkTriggerWorkflow(request); }), this.logger);
|
|
105
137
|
this.logger.debug(`batch ${batchIndex + 1} of ${batches.length}`);
|
|
106
138
|
// Map the results back to their original indices
|
|
107
139
|
const batchResults = bulkTriggerWorkflowResponse.workflowRunIds.map((resp, index) => {
|
|
@@ -127,7 +159,7 @@ class AdminClient {
|
|
|
127
159
|
limit,
|
|
128
160
|
duration,
|
|
129
161
|
};
|
|
130
|
-
yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () { return this.
|
|
162
|
+
yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () { return this.workflowsGrpc.putRateLimit(request); }), this.logger);
|
|
131
163
|
});
|
|
132
164
|
}
|
|
133
165
|
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This is the TypeScript SDK reference, documenting methods available for interacting with Hatchet resources.
|
|
3
|
+
* Check out the [user guide](https://docs.hatchet.run/home/) for an introduction to getting your first tasks running.
|
|
4
|
+
*
|
|
5
|
+
* @module Hatchet TypeScript SDK Reference
|
|
6
|
+
*/
|
|
7
|
+
import { ClientConfig, HatchetClientOptions, LegacyHatchetClient, TaskMiddleware, InferMiddlewareBefore, InferMiddlewareAfter } from '../../../clients/hatchet-client';
|
|
2
8
|
import { AxiosRequestConfig } from 'axios';
|
|
3
|
-
import WorkflowRunRef from '
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
9
|
+
import WorkflowRunRef from '../../../util/workflow-run-ref';
|
|
10
|
+
import { Api } from '../../../clients/rest';
|
|
11
|
+
import { EventClient } from '../../../clients/event/event-client';
|
|
12
|
+
import { DispatcherClient } from '../../../clients/dispatcher/dispatcher-client';
|
|
13
|
+
import { Logger } from '../../../util/logger';
|
|
14
|
+
import { RunListenerClient } from '../../../clients/listeners/run-listener/child-listener-client';
|
|
15
|
+
import { DurableListenerClient } from '../../../clients/listeners/durable-listener/durable-listener-client';
|
|
8
16
|
import { CreateTaskWorkflowOpts, CreateWorkflowOpts, RunOpts, BaseWorkflowDeclaration, WorkflowDeclaration, TaskWorkflowDeclaration, CreateDurableTaskWorkflowOpts } from '../declaration';
|
|
17
|
+
import type { LegacyWorkflow } from '../../legacy/legacy-transformer';
|
|
9
18
|
import { IHatchetClient } from './client.interface';
|
|
10
19
|
import { CreateWorkerOpts, Worker } from './worker/worker';
|
|
11
20
|
import { MetricsClient } from './features/metrics';
|
|
@@ -21,6 +30,7 @@ import { CronClient } from './features/crons';
|
|
|
21
30
|
import { CELClient } from './features/cel';
|
|
22
31
|
import { TenantClient } from './features/tenant';
|
|
23
32
|
import { WebhooksClient } from './features/webhooks';
|
|
33
|
+
import { DurableContext } from './worker/context';
|
|
24
34
|
type MergeIfNonEmpty<Base, Extra extends Record<string, any>> = keyof Extra extends never ? Base : Base & Extra;
|
|
25
35
|
/**
|
|
26
36
|
* HatchetV1 implements the main client interface for interacting with the Hatchet workflow engine.
|
|
@@ -31,16 +41,21 @@ type MergeIfNonEmpty<Base, Extra extends Record<string, any>> = keyof Extra exte
|
|
|
31
41
|
* @template MiddlewareAfter - Extra fields merged into task output by post-middleware hooks. Inferred from middleware config.
|
|
32
42
|
*/
|
|
33
43
|
export declare class HatchetClient<GlobalInput extends Record<string, any> = {}, GlobalOutput extends Record<string, any> = {}, MiddlewareBefore extends Record<string, any> = {}, MiddlewareAfter extends Record<string, any> = {}> implements IHatchetClient {
|
|
34
|
-
|
|
35
|
-
_v0: LegacyHatchetClient;
|
|
44
|
+
private _v0;
|
|
36
45
|
_api: Api;
|
|
37
46
|
_listener: RunListenerClient;
|
|
47
|
+
private _options;
|
|
48
|
+
private _axiosConfig;
|
|
49
|
+
private _clientFactory;
|
|
50
|
+
private _credentials;
|
|
38
51
|
/**
|
|
39
52
|
* @deprecated v0 client will be removed in a future release, please upgrade to v1
|
|
53
|
+
* @hidden
|
|
40
54
|
*/
|
|
41
55
|
get v0(): LegacyHatchetClient;
|
|
42
56
|
/** The tenant ID for the Hatchet client */
|
|
43
57
|
tenantId: string;
|
|
58
|
+
logger: Logger;
|
|
44
59
|
_isV1: boolean | undefined;
|
|
45
60
|
get isV1(): boolean;
|
|
46
61
|
/**
|
|
@@ -48,6 +63,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
48
63
|
* @param config - Optional configuration for the client
|
|
49
64
|
* @param options - Optional client options
|
|
50
65
|
* @param axiosConfig - Optional Axios configuration for HTTP requests
|
|
66
|
+
* @internal
|
|
51
67
|
*/
|
|
52
68
|
constructor(config?: Partial<ClientConfig>, options?: HatchetClientOptions, axiosConfig?: AxiosRequestConfig);
|
|
53
69
|
/**
|
|
@@ -58,6 +74,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
58
74
|
* @param options - Optional client options.
|
|
59
75
|
* @param axiosConfig - Optional Axios configuration for HTTP requests.
|
|
60
76
|
* @returns A new Hatchet client instance. Chain `.withMiddleware()` to attach typed middleware.
|
|
77
|
+
* @internal
|
|
61
78
|
*/
|
|
62
79
|
static init<T extends Record<string, any> = {}, U extends Record<string, any> = {}>(config?: Omit<Partial<ClientConfig>, 'middleware'>, options?: HatchetClientOptions, axiosConfig?: AxiosRequestConfig): HatchetClient<T, U>;
|
|
63
80
|
/**
|
|
@@ -66,6 +83,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
66
83
|
*
|
|
67
84
|
* Use this after `init<T, U>()` to get full middleware return-type inference
|
|
68
85
|
* that TypeScript can't provide when global types are explicitly set on `init`.
|
|
86
|
+
* @internal
|
|
69
87
|
*/
|
|
70
88
|
withMiddleware<const M extends TaskMiddleware<Resolved<GlobalInput, MiddlewareBefore>, Resolved<GlobalOutput, MiddlewareAfter>>>(middleware: M): HatchetClient<GlobalInput, GlobalOutput, MiddlewareBefore & InferMiddlewareBefore<M>, MiddlewareAfter & InferMiddlewareAfter<M>>;
|
|
71
89
|
private _config;
|
|
@@ -112,7 +130,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
112
130
|
* @param options Durable task configuration options with function that defines types
|
|
113
131
|
* @returns A TaskWorkflowDeclaration instance with inferred types
|
|
114
132
|
*/
|
|
115
|
-
durableTask<Fn extends (input: I, ctx:
|
|
133
|
+
durableTask<Fn extends (input: I, ctx: DurableContext<I>) => O | Promise<O>, I extends InputType = Parameters<Fn>[0], O extends OutputType = ReturnType<Fn> extends Promise<infer P> ? P extends OutputType ? P : void : ReturnType<Fn> extends OutputType ? ReturnType<Fn> : void>(options: {
|
|
116
134
|
fn: Fn;
|
|
117
135
|
} & Omit<CreateDurableTaskWorkflowOpts<I, O>, 'fn'>): TaskWorkflowDeclaration<I, O, GlobalInput, GlobalOutput, MiddlewareBefore, MiddlewareAfter>;
|
|
118
136
|
/**
|
|
@@ -124,18 +142,18 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
124
142
|
* @param options - Configuration options for the workflow run
|
|
125
143
|
* @returns A WorkflowRunRef containing the run ID and methods to interact with the run
|
|
126
144
|
*/
|
|
127
|
-
runNoWait<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> |
|
|
145
|
+
runNoWait<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> | LegacyWorkflow | string, input: I, options: RunOpts): Promise<WorkflowRunRef<O>>;
|
|
128
146
|
/**
|
|
129
|
-
* @alias run
|
|
130
147
|
* Triggers a workflow run and waits for the result.
|
|
131
148
|
* @template I - The input type for the workflow
|
|
132
149
|
* @template O - The return type of the workflow
|
|
133
150
|
* @param workflow - The workflow to run, either as a Workflow instance or workflow name
|
|
134
151
|
* @param input - The input data for the workflow
|
|
152
|
+
* @alias run
|
|
135
153
|
* @param options - Configuration options for the workflow run
|
|
136
154
|
* @returns A promise that resolves with the workflow result
|
|
137
155
|
*/
|
|
138
|
-
runAndWait<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> |
|
|
156
|
+
runAndWait<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> | LegacyWorkflow | string, input: I, options?: RunOpts): Promise<O>;
|
|
139
157
|
/**
|
|
140
158
|
* Triggers a workflow run and waits for the result.
|
|
141
159
|
* @template I - The input type for the workflow
|
|
@@ -145,11 +163,12 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
145
163
|
* @param options - Configuration options for the workflow run
|
|
146
164
|
* @returns A promise that resolves with the workflow result
|
|
147
165
|
*/
|
|
148
|
-
run<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> |
|
|
166
|
+
run<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> | LegacyWorkflow | string, input: I, options?: RunOpts): Promise<O>;
|
|
149
167
|
private _cel;
|
|
150
168
|
/**
|
|
151
169
|
* Get the CEL client for debugging CEL expressions
|
|
152
170
|
* @returns A CEL client instance
|
|
171
|
+
* @internal
|
|
153
172
|
*/
|
|
154
173
|
get cel(): CELClient;
|
|
155
174
|
private _crons;
|
|
@@ -162,6 +181,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
162
181
|
* Get the cron client for creating and managing cron workflow runs
|
|
163
182
|
* @returns A cron client instance
|
|
164
183
|
* @deprecated use client.crons instead
|
|
184
|
+
* @hidden
|
|
165
185
|
*/
|
|
166
186
|
get cron(): CronClient;
|
|
167
187
|
private _scheduled;
|
|
@@ -174,23 +194,44 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
174
194
|
* Get the schedule client for creating and managing scheduled workflow runs
|
|
175
195
|
* @returns A schedule client instance
|
|
176
196
|
* @deprecated use client.scheduled instead
|
|
197
|
+
* @hidden
|
|
177
198
|
*/
|
|
178
199
|
get schedule(): ScheduleClient;
|
|
179
200
|
/**
|
|
180
201
|
* @alias scheduled
|
|
181
202
|
*/
|
|
182
203
|
get schedules(): ScheduleClient;
|
|
204
|
+
private _dispatcher;
|
|
183
205
|
/**
|
|
184
|
-
* Get the
|
|
185
|
-
* @returns A
|
|
206
|
+
* Get the dispatcher client for sending action events and managing worker registration
|
|
207
|
+
* @returns A dispatcher client instance
|
|
208
|
+
* @internal
|
|
186
209
|
*/
|
|
187
|
-
get
|
|
210
|
+
get dispatcher(): DispatcherClient;
|
|
211
|
+
private _event;
|
|
188
212
|
/**
|
|
189
213
|
* Get the event client for creating and managing event workflow runs
|
|
190
214
|
* @returns A event client instance
|
|
215
|
+
*/
|
|
216
|
+
get events(): EventClient;
|
|
217
|
+
private _durableListener;
|
|
218
|
+
/**
|
|
219
|
+
* Get the durable listener client for managing durable event subscriptions
|
|
220
|
+
* @returns A durable listener client instance
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
get durableListener(): DurableListenerClient;
|
|
224
|
+
/**
|
|
225
|
+
* Get the run listener client for streaming workflow run results
|
|
226
|
+
* @returns A run listener client instance
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
get listener(): RunListenerClient;
|
|
230
|
+
/**
|
|
191
231
|
* @deprecated use client.events instead
|
|
232
|
+
* @hidden
|
|
192
233
|
*/
|
|
193
|
-
get event():
|
|
234
|
+
get event(): EventClient;
|
|
194
235
|
private _metrics;
|
|
195
236
|
/**
|
|
196
237
|
* Get the metrics client for creating and managing metrics
|
|
@@ -254,6 +295,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
254
295
|
/**
|
|
255
296
|
* Get the admin client for creating and managing workflows
|
|
256
297
|
* @returns A admin client instance
|
|
298
|
+
* @internal
|
|
257
299
|
*/
|
|
258
300
|
get admin(): AdminClient;
|
|
259
301
|
/**
|
|
@@ -262,12 +304,6 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
262
304
|
* @returns A promise that resolves with a new HatchetWorker instance
|
|
263
305
|
*/
|
|
264
306
|
worker(name: string, options?: CreateWorkerOpts | number): Promise<Worker>;
|
|
265
|
-
/**
|
|
266
|
-
* Register a webhook with the worker
|
|
267
|
-
* @param workflows - The workflows to register on the webhooks
|
|
268
|
-
* @returns A promise that resolves when the webhook is registered
|
|
269
|
-
*/
|
|
270
|
-
v0webhooks(workflows: V0Workflow[]): import("../../clients/worker/handler").WebhookHandler;
|
|
271
307
|
runRef<T extends Record<string, any> = any>(id: string): WorkflowRunRef<T>;
|
|
272
308
|
}
|
|
273
309
|
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventClient } from '../../../clients/event/event-client';
|
|
2
|
+
import { DispatcherClient } from '../../../clients/dispatcher/dispatcher-client';
|
|
3
|
+
import { Logger } from '../../../util/logger';
|
|
4
|
+
import { LegacyHatchetClient } from '../../legacy/legacy-client';
|
|
2
5
|
import { MetricsClient } from './features/metrics';
|
|
3
6
|
import { RunsClient } from './features/runs';
|
|
4
7
|
import { WorkersClient } from './features/workers';
|
|
@@ -8,8 +11,12 @@ import { ScheduleClient } from './features/schedules';
|
|
|
8
11
|
import { CronClient } from './features/crons';
|
|
9
12
|
import { CELClient } from './features/cel';
|
|
10
13
|
export interface IHatchetClient {
|
|
11
|
-
|
|
14
|
+
/** @deprecated v0 client will be removed in a future release, please upgrade to v1 */
|
|
15
|
+
v0: LegacyHatchetClient;
|
|
12
16
|
cel: CELClient;
|
|
17
|
+
dispatcher: DispatcherClient;
|
|
18
|
+
events: EventClient;
|
|
19
|
+
logger: Logger;
|
|
13
20
|
metrics: MetricsClient;
|
|
14
21
|
runs: RunsClient;
|
|
15
22
|
workflows: WorkflowsClient;
|
|
@@ -13,18 +13,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.HatchetClient = void 0;
|
|
16
|
+
/**
|
|
17
|
+
* This is the TypeScript SDK reference, documenting methods available for interacting with Hatchet resources.
|
|
18
|
+
* Check out the [user guide](https://docs.hatchet.run/home/) for an introduction to getting your first tasks running.
|
|
19
|
+
*
|
|
20
|
+
* @module Hatchet TypeScript SDK Reference
|
|
21
|
+
*/
|
|
16
22
|
/* eslint-disable no-dupe-class-members */
|
|
17
23
|
/* eslint-disable no-underscore-dangle */
|
|
18
|
-
const hatchet_client_1 = require("
|
|
19
|
-
const rest_1 = __importDefault(require("
|
|
20
|
-
const config_loader_1 = require("
|
|
21
|
-
const hatchet_logger_1 = require("
|
|
24
|
+
const hatchet_client_1 = require("../../../clients/hatchet-client");
|
|
25
|
+
const rest_1 = __importDefault(require("../../../clients/rest"));
|
|
26
|
+
const config_loader_1 = require("../../../util/config-loader");
|
|
27
|
+
const hatchet_logger_1 = require("../../../clients/hatchet-client/hatchet-logger");
|
|
22
28
|
const zod_1 = require("zod");
|
|
23
|
-
const event_client_1 = require("
|
|
24
|
-
const
|
|
25
|
-
const
|
|
29
|
+
const event_client_1 = require("../../../clients/event/event-client");
|
|
30
|
+
const dispatcher_client_1 = require("../../../clients/dispatcher/dispatcher-client");
|
|
31
|
+
const child_listener_client_1 = require("../../../clients/listeners/run-listener/child-listener-client");
|
|
32
|
+
const durable_listener_client_1 = require("../../../clients/listeners/durable-listener/durable-listener-client");
|
|
33
|
+
const grpc_helpers_1 = require("../../../util/grpc-helpers");
|
|
26
34
|
const nice_grpc_1 = require("nice-grpc");
|
|
27
35
|
const declaration_1 = require("../declaration");
|
|
36
|
+
const legacy_transformer_1 = require("../../legacy/legacy-transformer");
|
|
28
37
|
const worker_1 = require("./worker/worker");
|
|
29
38
|
const metrics_1 = require("./features/metrics");
|
|
30
39
|
const workers_1 = require("./features/workers");
|
|
@@ -49,8 +58,12 @@ const webhooks_1 = require("./features/webhooks");
|
|
|
49
58
|
class HatchetClient {
|
|
50
59
|
/**
|
|
51
60
|
* @deprecated v0 client will be removed in a future release, please upgrade to v1
|
|
61
|
+
* @hidden
|
|
52
62
|
*/
|
|
53
63
|
get v0() {
|
|
64
|
+
if (!this._v0) {
|
|
65
|
+
this._v0 = new hatchet_client_1.LegacyHatchetClient(this._config, this._options, this._axiosConfig, this.runs, this._listener, this.events, this.dispatcher, this.logger, this.durableListener);
|
|
66
|
+
}
|
|
54
67
|
return this._v0;
|
|
55
68
|
}
|
|
56
69
|
get isV1() {
|
|
@@ -61,6 +74,7 @@ class HatchetClient {
|
|
|
61
74
|
* @param config - Optional configuration for the client
|
|
62
75
|
* @param options - Optional client options
|
|
63
76
|
* @param axiosConfig - Optional Axios configuration for HTTP requests
|
|
77
|
+
* @internal
|
|
64
78
|
*/
|
|
65
79
|
constructor(config, options, axiosConfig) {
|
|
66
80
|
var _a;
|
|
@@ -77,11 +91,14 @@ class HatchetClient {
|
|
|
77
91
|
const clientConfig = Object.assign(Object.assign({}, valid), { logger: logConstructor });
|
|
78
92
|
this._config = clientConfig;
|
|
79
93
|
this.tenantId = clientConfig.tenant_id;
|
|
94
|
+
this.logger = clientConfig.logger('HatchetClient', clientConfig.log_level);
|
|
80
95
|
this._api = (0, rest_1.default)(clientConfig.api_url, clientConfig.token, axiosConfig);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.
|
|
96
|
+
this._clientFactory = (0, nice_grpc_1.createClientFactory)().use((0, grpc_helpers_1.addTokenMiddleware)(this.config.token));
|
|
97
|
+
this._credentials =
|
|
98
|
+
(_a = options === null || options === void 0 ? void 0 : options.credentials) !== null && _a !== void 0 ? _a : config_loader_1.ConfigLoader.createCredentials(this.config.tls_config);
|
|
99
|
+
this._listener = new child_listener_client_1.RunListenerClient(this.config, (0, grpc_helpers_1.channelFactory)(this.config, this._credentials), this._clientFactory, this.api);
|
|
100
|
+
this._options = options;
|
|
101
|
+
this._axiosConfig = axiosConfig;
|
|
85
102
|
}
|
|
86
103
|
catch (e) {
|
|
87
104
|
if (e instanceof zod_1.z.ZodError) {
|
|
@@ -115,6 +132,7 @@ class HatchetClient {
|
|
|
115
132
|
* @param options - Optional client options.
|
|
116
133
|
* @param axiosConfig - Optional Axios configuration for HTTP requests.
|
|
117
134
|
* @returns A new Hatchet client instance. Chain `.withMiddleware()` to attach typed middleware.
|
|
135
|
+
* @internal
|
|
118
136
|
*/
|
|
119
137
|
static init(config, options, axiosConfig) {
|
|
120
138
|
return new HatchetClient(config, options, axiosConfig);
|
|
@@ -125,6 +143,7 @@ class HatchetClient {
|
|
|
125
143
|
*
|
|
126
144
|
* Use this after `init<T, U>()` to get full middleware return-type inference
|
|
127
145
|
* that TypeScript can't provide when global types are explicitly set on `init`.
|
|
146
|
+
* @internal
|
|
128
147
|
*/
|
|
129
148
|
withMiddleware(middleware) {
|
|
130
149
|
const existing = this._config.middleware || {};
|
|
@@ -178,26 +197,17 @@ class HatchetClient {
|
|
|
178
197
|
*/
|
|
179
198
|
runNoWait(workflow, input, options) {
|
|
180
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
-
|
|
182
|
-
if (typeof workflow === 'string') {
|
|
183
|
-
name = workflow;
|
|
184
|
-
}
|
|
185
|
-
else if ('id' in workflow) {
|
|
186
|
-
name = workflow.id;
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
throw new Error('unable to identify workflow');
|
|
190
|
-
}
|
|
200
|
+
const name = (0, legacy_transformer_1.getWorkflowName)(workflow);
|
|
191
201
|
return this.admin.runWorkflow(name, input, options);
|
|
192
202
|
});
|
|
193
203
|
}
|
|
194
204
|
/**
|
|
195
|
-
* @alias run
|
|
196
205
|
* Triggers a workflow run and waits for the result.
|
|
197
206
|
* @template I - The input type for the workflow
|
|
198
207
|
* @template O - The return type of the workflow
|
|
199
208
|
* @param workflow - The workflow to run, either as a Workflow instance or workflow name
|
|
200
209
|
* @param input - The input data for the workflow
|
|
210
|
+
* @alias run
|
|
201
211
|
* @param options - Configuration options for the workflow run
|
|
202
212
|
* @returns A promise that resolves with the workflow result
|
|
203
213
|
*/
|
|
@@ -224,6 +234,7 @@ class HatchetClient {
|
|
|
224
234
|
/**
|
|
225
235
|
* Get the CEL client for debugging CEL expressions
|
|
226
236
|
* @returns A CEL client instance
|
|
237
|
+
* @internal
|
|
227
238
|
*/
|
|
228
239
|
get cel() {
|
|
229
240
|
if (!this._cel) {
|
|
@@ -245,6 +256,7 @@ class HatchetClient {
|
|
|
245
256
|
* Get the cron client for creating and managing cron workflow runs
|
|
246
257
|
* @returns A cron client instance
|
|
247
258
|
* @deprecated use client.crons instead
|
|
259
|
+
* @hidden
|
|
248
260
|
*/
|
|
249
261
|
get cron() {
|
|
250
262
|
return this.crons;
|
|
@@ -263,6 +275,7 @@ class HatchetClient {
|
|
|
263
275
|
* Get the schedule client for creating and managing scheduled workflow runs
|
|
264
276
|
* @returns A schedule client instance
|
|
265
277
|
* @deprecated use client.scheduled instead
|
|
278
|
+
* @hidden
|
|
266
279
|
*/
|
|
267
280
|
get schedule() {
|
|
268
281
|
return this.scheduled;
|
|
@@ -273,17 +286,49 @@ class HatchetClient {
|
|
|
273
286
|
get schedules() {
|
|
274
287
|
return this.scheduled;
|
|
275
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Get the dispatcher client for sending action events and managing worker registration
|
|
291
|
+
* @returns A dispatcher client instance
|
|
292
|
+
* @internal
|
|
293
|
+
*/
|
|
294
|
+
get dispatcher() {
|
|
295
|
+
if (!this._dispatcher) {
|
|
296
|
+
this._dispatcher = new dispatcher_client_1.DispatcherClient(this._config, (0, grpc_helpers_1.channelFactory)(this._config, this._credentials), this._clientFactory);
|
|
297
|
+
}
|
|
298
|
+
return this._dispatcher;
|
|
299
|
+
}
|
|
276
300
|
/**
|
|
277
301
|
* Get the event client for creating and managing event workflow runs
|
|
278
302
|
* @returns A event client instance
|
|
279
303
|
*/
|
|
280
304
|
get events() {
|
|
281
|
-
|
|
305
|
+
if (!this._event) {
|
|
306
|
+
this._event = new event_client_1.EventClient(this._config, (0, grpc_helpers_1.channelFactory)(this._config, this._credentials), this._clientFactory, this.api);
|
|
307
|
+
}
|
|
308
|
+
return this._event;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Get the durable listener client for managing durable event subscriptions
|
|
312
|
+
* @returns A durable listener client instance
|
|
313
|
+
* @internal
|
|
314
|
+
*/
|
|
315
|
+
get durableListener() {
|
|
316
|
+
if (!this._durableListener) {
|
|
317
|
+
this._durableListener = new durable_listener_client_1.DurableListenerClient(this._config, (0, grpc_helpers_1.channelFactory)(this._config, this._credentials), this._clientFactory, this.api);
|
|
318
|
+
}
|
|
319
|
+
return this._durableListener;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Get the run listener client for streaming workflow run results
|
|
323
|
+
* @returns A run listener client instance
|
|
324
|
+
* @internal
|
|
325
|
+
*/
|
|
326
|
+
get listener() {
|
|
327
|
+
return this._listener;
|
|
282
328
|
}
|
|
283
329
|
/**
|
|
284
|
-
* Get the event client for creating and managing event workflow runs
|
|
285
|
-
* @returns A event client instance
|
|
286
330
|
* @deprecated use client.events instead
|
|
331
|
+
* @hidden
|
|
287
332
|
*/
|
|
288
333
|
get event() {
|
|
289
334
|
return this.events;
|
|
@@ -386,10 +431,11 @@ class HatchetClient {
|
|
|
386
431
|
/**
|
|
387
432
|
* Get the admin client for creating and managing workflows
|
|
388
433
|
* @returns A admin client instance
|
|
434
|
+
* @internal
|
|
389
435
|
*/
|
|
390
436
|
get admin() {
|
|
391
437
|
if (!this._admin) {
|
|
392
|
-
this._admin = new admin_1.AdminClient(this.
|
|
438
|
+
this._admin = new admin_1.AdminClient(this._config, this.api, this.runs);
|
|
393
439
|
}
|
|
394
440
|
return this._admin;
|
|
395
441
|
}
|
|
@@ -406,15 +452,7 @@ class HatchetClient {
|
|
|
406
452
|
else {
|
|
407
453
|
opts = options || {};
|
|
408
454
|
}
|
|
409
|
-
return worker_1.Worker.create(this,
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Register a webhook with the worker
|
|
413
|
-
* @param workflows - The workflows to register on the webhooks
|
|
414
|
-
* @returns A promise that resolves when the webhook is registered
|
|
415
|
-
*/
|
|
416
|
-
v0webhooks(workflows) {
|
|
417
|
-
return this._v0.webhooks(workflows);
|
|
455
|
+
return worker_1.Worker.create(this, name, opts);
|
|
418
456
|
}
|
|
419
457
|
runRef(id) {
|
|
420
458
|
return this.runs.runRef(id);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V1CELDebugResponseStatus } from '
|
|
1
|
+
import { V1CELDebugResponseStatus } from '../../../../clients/rest/generated/data-contracts';
|
|
2
2
|
import { HatchetClient } from '../client';
|
|
3
3
|
export type DebugCELInput = {
|
|
4
4
|
expression: string;
|
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CELClient = void 0;
|
|
13
13
|
const axios_1 = require("axios");
|
|
14
|
-
const data_contracts_1 = require("
|
|
14
|
+
const data_contracts_1 = require("../../../../clients/rest/generated/data-contracts");
|
|
15
15
|
/**
|
|
16
16
|
* Client for debugging CEL expressions.
|
|
17
17
|
*/
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { CronWorkflows, CronWorkflowsList } from '
|
|
1
|
+
import { CronWorkflows, CronWorkflowsList } from '../../../../clients/rest/generated/data-contracts';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { BaseWorkflowDeclaration } from '../../../../v1';
|
|
4
|
+
import type { LegacyWorkflow } from '../../../../legacy/legacy-transformer';
|
|
5
5
|
import { HatchetClient } from '../client';
|
|
6
6
|
import { WorkflowsClient } from './workflows';
|
|
7
7
|
/**
|
|
8
8
|
* Schema for creating a Cron Trigger.
|
|
9
|
+
* @internal
|
|
9
10
|
*/
|
|
10
11
|
export declare const CreateCronTriggerSchema: z.ZodObject<{
|
|
11
12
|
name: z.ZodString;
|
|
@@ -28,10 +29,11 @@ export declare const CreateCronTriggerSchema: z.ZodObject<{
|
|
|
28
29
|
}>;
|
|
29
30
|
/**
|
|
30
31
|
* Type representing the input for creating a Cron.
|
|
32
|
+
* @internal
|
|
31
33
|
*/
|
|
32
34
|
export type CreateCronInput = z.infer<typeof CreateCronTriggerSchema>;
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
36
|
+
* The cron client is a client for managing cron workflows within Hatchet.
|
|
35
37
|
*/
|
|
36
38
|
export declare class CronClient {
|
|
37
39
|
api: HatchetClient['api'];
|
|
@@ -52,7 +54,7 @@ export declare class CronClient {
|
|
|
52
54
|
* @returns A promise that resolves to the created CronWorkflows object.
|
|
53
55
|
* @throws Will throw an error if the input is invalid or the API call fails.
|
|
54
56
|
*/
|
|
55
|
-
create(workflow: string |
|
|
57
|
+
create(workflow: string | BaseWorkflowDeclaration<any, any> | LegacyWorkflow, cron: CreateCronInput): Promise<CronWorkflows>;
|
|
56
58
|
/**
|
|
57
59
|
* Deletes an existing Cron Trigger.
|
|
58
60
|
* @param cron - The Cron Trigger ID as a string or CronWorkflows object.
|
|
@@ -65,7 +67,7 @@ export declare class CronClient {
|
|
|
65
67
|
* @returns A promise that resolves to a CronWorkflowsList object.
|
|
66
68
|
*/
|
|
67
69
|
list(query: Parameters<typeof this.api.cronWorkflowList>[1] & {
|
|
68
|
-
workflow?: string |
|
|
70
|
+
workflow?: string | BaseWorkflowDeclaration<any, any> | LegacyWorkflow;
|
|
69
71
|
}): Promise<CronWorkflowsList>;
|
|
70
72
|
/**
|
|
71
73
|
* Retrieves a specific Cron Trigger by its ID.
|