@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
|
@@ -23,11 +23,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.CronClient = exports.CreateCronTriggerSchema = void 0;
|
|
24
24
|
const zod_1 = require("zod");
|
|
25
25
|
const axios_1 = require("axios");
|
|
26
|
-
const uuid_1 = require("
|
|
27
|
-
const apply_namespace_1 = require("
|
|
26
|
+
const uuid_1 = require("../../../../util/uuid");
|
|
27
|
+
const apply_namespace_1 = require("../../../../util/apply-namespace");
|
|
28
28
|
const workflows_1 = require("./workflows");
|
|
29
29
|
/**
|
|
30
30
|
* Schema for creating a Cron Trigger.
|
|
31
|
+
* @internal
|
|
31
32
|
*/
|
|
32
33
|
exports.CreateCronTriggerSchema = zod_1.z.object({
|
|
33
34
|
name: zod_1.z.string(),
|
|
@@ -37,7 +38,7 @@ exports.CreateCronTriggerSchema = zod_1.z.object({
|
|
|
37
38
|
priority: zod_1.z.number().optional(),
|
|
38
39
|
});
|
|
39
40
|
/**
|
|
40
|
-
*
|
|
41
|
+
* The cron client is a client for managing cron workflows within Hatchet.
|
|
41
42
|
*/
|
|
42
43
|
class CronClient {
|
|
43
44
|
constructor(client) {
|
|
@@ -68,7 +69,7 @@ class CronClient {
|
|
|
68
69
|
create(workflow, cron) {
|
|
69
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
71
|
var _a, _b, _c;
|
|
71
|
-
const workflowId = (0, apply_namespace_1.applyNamespace)((0, workflows_1.workflowNameString)(workflow), this.namespace);
|
|
72
|
+
const workflowId = (0, apply_namespace_1.applyNamespace)((0, workflows_1.workflowNameString)(workflow), this.namespace).toLowerCase();
|
|
72
73
|
// Validate cron input with zod schema
|
|
73
74
|
try {
|
|
74
75
|
const parsedCron = exports.CreateCronTriggerSchema.parse(cron);
|
|
@@ -112,7 +113,7 @@ class CronClient {
|
|
|
112
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
114
|
const { workflow } = query, rest = __rest(query, ["workflow"]);
|
|
114
115
|
if (workflow) {
|
|
115
|
-
const workflowId = yield this.workflows.getWorkflowIdFromName((0, apply_namespace_1.applyNamespace)((0, workflows_1.workflowNameString)(workflow), this.namespace));
|
|
116
|
+
const workflowId = yield this.workflows.getWorkflowIdFromName((0, apply_namespace_1.applyNamespace)((0, workflows_1.workflowNameString)(workflow), this.namespace).toLowerCase());
|
|
116
117
|
rest.workflowId = workflowId;
|
|
117
118
|
}
|
|
118
119
|
const response = yield this.api.cronWorkflowList(this.tenantId, rest);
|
|
@@ -10,14 +10,44 @@ export declare class FiltersClient {
|
|
|
10
10
|
tenantId: string;
|
|
11
11
|
api: HatchetClient['api'];
|
|
12
12
|
constructor(client: HatchetClient);
|
|
13
|
+
/**
|
|
14
|
+
* Lists all filters.
|
|
15
|
+
* @param opts - The options for the list operation.
|
|
16
|
+
* @param opts.limit - The number of filters to return.
|
|
17
|
+
* @param opts.offset - The number of filters to skip before returning the result set.
|
|
18
|
+
* @param opts.workflowIds - A list of workflow IDs to filter by.
|
|
19
|
+
* @param opts.scopes - A list of scopes to filter by.
|
|
20
|
+
* @returns A promise that resolves to the list of filters.
|
|
21
|
+
*/
|
|
13
22
|
list(opts?: {
|
|
14
23
|
limit?: number;
|
|
15
24
|
offset?: number;
|
|
16
25
|
workflowIds?: string[];
|
|
17
26
|
scopes?: string[];
|
|
18
27
|
}): Promise<import("../../../clients/rest/generated/data-contracts").V1FilterList>;
|
|
28
|
+
/**
|
|
29
|
+
* Gets a filter by its ID.
|
|
30
|
+
* @param filterId - The ID of the filter to get.
|
|
31
|
+
* @returns A promise that resolves to the filter.
|
|
32
|
+
*/
|
|
19
33
|
get(filterId: Parameters<typeof this.api.v1FilterGet>[1]): Promise<import("../../../clients/rest/generated/data-contracts").V1Filter>;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new filter.
|
|
36
|
+
* @param opts - The options for the create operation.
|
|
37
|
+
* @returns A promise that resolves to the created filter.
|
|
38
|
+
*/
|
|
20
39
|
create(opts: Parameters<typeof this.api.v1FilterCreate>[1]): Promise<import("../../../clients/rest/generated/data-contracts").V1Filter>;
|
|
40
|
+
/**
|
|
41
|
+
* Deletes a filter by its ID.
|
|
42
|
+
* @param filterId - The ID of the filter to delete.
|
|
43
|
+
* @returns A promise that resolves to the deleted filter.
|
|
44
|
+
*/
|
|
21
45
|
delete(filterId: Parameters<typeof this.api.v1FilterDelete>[1]): Promise<import("../../../clients/rest/generated/data-contracts").V1Filter>;
|
|
46
|
+
/**
|
|
47
|
+
* Updates a filter by its ID.
|
|
48
|
+
* @param filterId - The ID of the filter to update.
|
|
49
|
+
* @param updates - The updates to apply to the filter.
|
|
50
|
+
* @returns A promise that resolves to the updated filter.
|
|
51
|
+
*/
|
|
22
52
|
update(filterId: Parameters<typeof this.api.v1FilterDelete>[1], updates: Parameters<typeof this.api.v1FilterUpdate>[2]): Promise<import("../../../clients/rest/generated/data-contracts").V1Filter>;
|
|
23
53
|
}
|
|
@@ -18,6 +18,15 @@ class FiltersClient {
|
|
|
18
18
|
this.tenantId = client.tenantId;
|
|
19
19
|
this.api = client.api;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Lists all filters.
|
|
23
|
+
* @param opts - The options for the list operation.
|
|
24
|
+
* @param opts.limit - The number of filters to return.
|
|
25
|
+
* @param opts.offset - The number of filters to skip before returning the result set.
|
|
26
|
+
* @param opts.workflowIds - A list of workflow IDs to filter by.
|
|
27
|
+
* @param opts.scopes - A list of scopes to filter by.
|
|
28
|
+
* @returns A promise that resolves to the list of filters.
|
|
29
|
+
*/
|
|
21
30
|
list(opts) {
|
|
22
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
32
|
const { data } = yield this.api.v1FilterList(this.tenantId, {
|
|
@@ -29,24 +38,45 @@ class FiltersClient {
|
|
|
29
38
|
return data;
|
|
30
39
|
});
|
|
31
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets a filter by its ID.
|
|
43
|
+
* @param filterId - The ID of the filter to get.
|
|
44
|
+
* @returns A promise that resolves to the filter.
|
|
45
|
+
*/
|
|
32
46
|
get(filterId) {
|
|
33
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
48
|
const { data } = yield this.api.v1FilterGet(this.tenantId, filterId);
|
|
35
49
|
return data;
|
|
36
50
|
});
|
|
37
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates a new filter.
|
|
54
|
+
* @param opts - The options for the create operation.
|
|
55
|
+
* @returns A promise that resolves to the created filter.
|
|
56
|
+
*/
|
|
38
57
|
create(opts) {
|
|
39
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
59
|
const { data } = yield this.api.v1FilterCreate(this.tenantId, opts);
|
|
41
60
|
return data;
|
|
42
61
|
});
|
|
43
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Deletes a filter by its ID.
|
|
65
|
+
* @param filterId - The ID of the filter to delete.
|
|
66
|
+
* @returns A promise that resolves to the deleted filter.
|
|
67
|
+
*/
|
|
44
68
|
delete(filterId) {
|
|
45
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
70
|
const { data } = yield this.api.v1FilterDelete(this.tenantId, filterId);
|
|
47
71
|
return data;
|
|
48
72
|
});
|
|
49
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Updates a filter by its ID.
|
|
76
|
+
* @param filterId - The ID of the filter to update.
|
|
77
|
+
* @param updates - The updates to apply to the filter.
|
|
78
|
+
* @returns A promise that resolves to the updated filter.
|
|
79
|
+
*/
|
|
50
80
|
update(filterId, updates) {
|
|
51
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
82
|
const { data } = yield this.api.v1FilterUpdate(this.tenantId, filterId, updates);
|
|
@@ -7,19 +7,23 @@ export type TaskStatusMetrics = {
|
|
|
7
7
|
running: number;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The metrics client is a client for reading metrics out of Hatchet’s metrics API.
|
|
11
11
|
*/
|
|
12
12
|
export declare class MetricsClient {
|
|
13
13
|
tenantId: string;
|
|
14
14
|
api: HatchetClient['api'];
|
|
15
15
|
constructor(client: HatchetClient);
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Endpoint: GET /api/v1/stable/tenants/{tenant}/task-metrics
|
|
17
|
+
* Returns aggregate task run counts grouped by status (queued, running, completed, failed, cancelled)
|
|
18
|
+
* @param query - Filters for the metrics query (e.g. `since`, `until`, `workflow_ids`).
|
|
19
|
+
* @param requestParams - Optional request-level overrides (headers, signal, etc.).
|
|
20
|
+
* @returns Counts per status for the matched task runs.
|
|
22
21
|
*/
|
|
23
22
|
getTaskStatusMetrics(query: Parameters<typeof this.api.v1TaskListStatusMetrics>[1], requestParams?: Parameters<typeof this.api.v1TaskListStatusMetrics>[2]): Promise<TaskStatusMetrics>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the queue metrics for the current tenant.
|
|
25
|
+
* @param opts - The options for the request.
|
|
26
|
+
* @returns The queue metrics for the current tenant.
|
|
27
|
+
*/
|
|
24
28
|
getQueueMetrics(opts?: Parameters<typeof this.api.tenantGetStepRunQueueMetrics>[1]): Promise<import("../../../clients/rest/generated/data-contracts").TenantStepRunQueueMetrics>;
|
|
25
29
|
}
|
|
@@ -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.MetricsClient = void 0;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* The metrics client is a client for reading metrics out of Hatchet’s metrics API.
|
|
15
15
|
*/
|
|
16
16
|
class MetricsClient {
|
|
17
17
|
constructor(client) {
|
|
@@ -19,11 +19,10 @@ class MetricsClient {
|
|
|
19
19
|
this.api = client.api;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* Endpoint: GET /api/v1/stable/tenants/{tenant}/task-metrics
|
|
22
|
+
* Returns aggregate task run counts grouped by status (queued, running, completed, failed, cancelled)
|
|
23
|
+
* @param query - Filters for the metrics query (e.g. `since`, `until`, `workflow_ids`).
|
|
24
|
+
* @param requestParams - Optional request-level overrides (headers, signal, etc.).
|
|
25
|
+
* @returns Counts per status for the matched task runs.
|
|
27
26
|
*/
|
|
28
27
|
getTaskStatusMetrics(query, requestParams) {
|
|
29
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -34,6 +33,11 @@ class MetricsClient {
|
|
|
34
33
|
}, {});
|
|
35
34
|
});
|
|
36
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns the queue metrics for the current tenant.
|
|
38
|
+
* @param opts - The options for the request.
|
|
39
|
+
* @returns The queue metrics for the current tenant.
|
|
40
|
+
*/
|
|
37
41
|
getQueueMetrics(opts) {
|
|
38
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
43
|
const { data } = yield this.api.tenantGetStepRunQueueMetrics(this.tenantId, opts);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RateLimitDuration } from '../../../../protoc/workflows';
|
|
2
|
+
import { RateLimitOrderByField, RateLimitOrderByDirection } from '../../../../clients/rest/generated/data-contracts';
|
|
3
|
+
import { HatchetClient } from '../client';
|
|
4
|
+
export { RateLimitDuration, RateLimitOrderByField, RateLimitOrderByDirection };
|
|
5
|
+
export type CreateRateLimitOpts = {
|
|
6
|
+
key: string;
|
|
7
|
+
limit: number;
|
|
8
|
+
duration?: RateLimitDuration;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The rate limits client is a wrapper for Hatchet’s gRPC API that makes it easier to work with rate limits in Hatchet.
|
|
12
|
+
*/
|
|
13
|
+
export declare class RatelimitsClient {
|
|
14
|
+
api: HatchetClient['api'];
|
|
15
|
+
admin: HatchetClient['admin'];
|
|
16
|
+
tenantId: string;
|
|
17
|
+
constructor(client: HatchetClient);
|
|
18
|
+
/**
|
|
19
|
+
* Upserts a rate limit for the current tenant.
|
|
20
|
+
* @param opts - The options for the upsert operation.
|
|
21
|
+
* @returns A promise that resolves to the key of the upserted rate limit.
|
|
22
|
+
*/
|
|
23
|
+
upsert(opts: CreateRateLimitOpts): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Lists all rate limits for the current tenant.
|
|
26
|
+
* @param opts - The options for the list operation.
|
|
27
|
+
* @returns A promise that resolves to the list of rate limits.
|
|
28
|
+
*/
|
|
29
|
+
list(opts: Parameters<typeof this.api.rateLimitList>[1]): Promise<import("../../../../clients/rest/generated/data-contracts").RateLimitList>;
|
|
30
|
+
}
|
|
@@ -10,13 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RatelimitsClient = exports.RateLimitOrderByDirection = exports.RateLimitOrderByField = exports.RateLimitDuration = void 0;
|
|
13
|
-
const workflows_1 = require("
|
|
13
|
+
const workflows_1 = require("../../../../protoc/workflows");
|
|
14
14
|
Object.defineProperty(exports, "RateLimitDuration", { enumerable: true, get: function () { return workflows_1.RateLimitDuration; } });
|
|
15
|
-
const data_contracts_1 = require("
|
|
15
|
+
const data_contracts_1 = require("../../../../clients/rest/generated/data-contracts");
|
|
16
16
|
Object.defineProperty(exports, "RateLimitOrderByField", { enumerable: true, get: function () { return data_contracts_1.RateLimitOrderByField; } });
|
|
17
17
|
Object.defineProperty(exports, "RateLimitOrderByDirection", { enumerable: true, get: function () { return data_contracts_1.RateLimitOrderByDirection; } });
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The rate limits client is a wrapper for Hatchet’s gRPC API that makes it easier to work with rate limits in Hatchet.
|
|
20
20
|
*/
|
|
21
21
|
class RatelimitsClient {
|
|
22
22
|
constructor(client) {
|
|
@@ -24,12 +24,22 @@ class RatelimitsClient {
|
|
|
24
24
|
this.admin = client.admin;
|
|
25
25
|
this.tenantId = client.tenantId;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Upserts a rate limit for the current tenant.
|
|
29
|
+
* @param opts - The options for the upsert operation.
|
|
30
|
+
* @returns A promise that resolves to the key of the upserted rate limit.
|
|
31
|
+
*/
|
|
27
32
|
upsert(opts) {
|
|
28
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
34
|
yield this.admin.putRateLimit(opts.key, opts.limit, opts.duration);
|
|
30
35
|
return opts.key;
|
|
31
36
|
});
|
|
32
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Lists all rate limits for the current tenant.
|
|
40
|
+
* @param opts - The options for the list operation.
|
|
41
|
+
* @returns A promise that resolves to the list of rate limits.
|
|
42
|
+
*/
|
|
33
43
|
list(opts) {
|
|
34
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
45
|
const { data } = yield this.api.rateLimitList(this.tenantId, opts);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import WorkflowRunRef from '
|
|
2
|
-
import { V1TaskStatus } from '
|
|
3
|
-
import { RunListenerClient } from '
|
|
1
|
+
import WorkflowRunRef from '../../../../util/workflow-run-ref';
|
|
2
|
+
import { V1TaskStatus } from '../../../../clients/rest/generated/data-contracts';
|
|
3
|
+
import { RunListenerClient } from '../../../../clients/listeners/run-listener/child-listener-client';
|
|
4
4
|
import { WorkflowsClient } from './workflows';
|
|
5
5
|
import { HatchetClient } from '../client';
|
|
6
6
|
export type RunFilter = {
|
|
@@ -65,7 +65,7 @@ export interface ListRunsOpts extends RunFilter {
|
|
|
65
65
|
includePayloads?: boolean;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* The runs client is a client for interacting with task and workflow runs within Hatchet.
|
|
69
69
|
*/
|
|
70
70
|
export declare class RunsClient {
|
|
71
71
|
api: HatchetClient['api'];
|
|
@@ -73,13 +73,48 @@ export declare class RunsClient {
|
|
|
73
73
|
workflows: WorkflowsClient;
|
|
74
74
|
listener: RunListenerClient;
|
|
75
75
|
constructor(client: HatchetClient);
|
|
76
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Gets a task or workflow run by its ID.
|
|
78
|
+
* @param run - The ID of the run to get.
|
|
79
|
+
* @returns A promise that resolves to the run.
|
|
80
|
+
*/
|
|
81
|
+
get<T = any>(run: string | WorkflowRunRef<T>): Promise<import("../../../../clients/rest/generated/data-contracts").V1WorkflowRunDetails>;
|
|
82
|
+
/**
|
|
83
|
+
* Gets the status of a task or workflow run by its ID.
|
|
84
|
+
* @param run - The ID of the run to get the status of.
|
|
85
|
+
* @returns A promise that resolves to the status of the run.
|
|
86
|
+
*/
|
|
77
87
|
get_status<T = any>(run: string | WorkflowRunRef<T>): Promise<V1TaskStatus>;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Lists all task and workflow runs for the current tenant.
|
|
90
|
+
* @param opts - The options for the list operation.
|
|
91
|
+
* @returns A promise that resolves to the list of runs.
|
|
92
|
+
*/
|
|
93
|
+
list(opts?: Partial<ListRunsOpts>): Promise<import("../../../../clients/rest/generated/data-contracts").V1TaskSummaryList>;
|
|
94
|
+
/**
|
|
95
|
+
* Cancels a task or workflow run by its ID.
|
|
96
|
+
* @param opts - The options for the cancel operation.
|
|
97
|
+
* @returns A promise that resolves to the cancelled run.
|
|
98
|
+
*/
|
|
99
|
+
cancel(opts: CancelRunOpts): Promise<import("axios").AxiosResponse<import("../../../../clients/rest/generated/data-contracts").V1CancelledTasks, any, {}>>;
|
|
100
|
+
/**
|
|
101
|
+
* Replays a task or workflow run by its ID.
|
|
102
|
+
* @param opts - The options for the replay operation.
|
|
103
|
+
* @returns A promise that resolves to the replayed run.
|
|
104
|
+
*/
|
|
105
|
+
replay(opts: ReplayRunOpts): Promise<import("axios").AxiosResponse<import("../../../../clients/rest/generated/data-contracts").V1ReplayedTasks, any, {}>>;
|
|
81
106
|
private prepareFilter;
|
|
82
107
|
private prepareListFilter;
|
|
108
|
+
/**
|
|
109
|
+
* Creates a run reference for a task or workflow run by its ID.
|
|
110
|
+
* @param id - The ID of the run to create a reference for.
|
|
111
|
+
* @returns A promise that resolves to the run reference.
|
|
112
|
+
*/
|
|
83
113
|
runRef<T extends Record<string, any> = any>(id: string): WorkflowRunRef<T>;
|
|
114
|
+
/**
|
|
115
|
+
* Subscribes to a stream of events for a task or workflow run by its ID.
|
|
116
|
+
* @param workflowRunId - The ID of the run to subscribe to.
|
|
117
|
+
* @returns A promise that resolves to the stream of events.
|
|
118
|
+
*/
|
|
84
119
|
subscribeToStream(workflowRunId: string): AsyncIterableIterator<string>;
|
|
85
120
|
}
|
|
@@ -33,10 +33,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.RunsClient = void 0;
|
|
36
|
-
const workflow_run_ref_1 = __importDefault(require("
|
|
37
|
-
const child_listener_client_1 = require("
|
|
36
|
+
const workflow_run_ref_1 = __importDefault(require("../../../../util/workflow-run-ref"));
|
|
37
|
+
const child_listener_client_1 = require("../../../../clients/listeners/run-listener/child-listener-client");
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* The runs client is a client for interacting with task and workflow runs within Hatchet.
|
|
40
40
|
*/
|
|
41
41
|
class RunsClient {
|
|
42
42
|
constructor(client) {
|
|
@@ -46,6 +46,11 @@ class RunsClient {
|
|
|
46
46
|
// eslint-disable-next-line no-underscore-dangle
|
|
47
47
|
this.listener = client._listener;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets a task or workflow run by its ID.
|
|
51
|
+
* @param run - The ID of the run to get.
|
|
52
|
+
* @returns A promise that resolves to the run.
|
|
53
|
+
*/
|
|
49
54
|
get(run) {
|
|
50
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
56
|
const runId = typeof run === 'string' ? run : yield run.getWorkflowRunId();
|
|
@@ -53,6 +58,11 @@ class RunsClient {
|
|
|
53
58
|
return data;
|
|
54
59
|
});
|
|
55
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Gets the status of a task or workflow run by its ID.
|
|
63
|
+
* @param run - The ID of the run to get the status of.
|
|
64
|
+
* @returns A promise that resolves to the status of the run.
|
|
65
|
+
*/
|
|
56
66
|
get_status(run) {
|
|
57
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
68
|
const runId = typeof run === 'string' ? run : yield run.getWorkflowRunId();
|
|
@@ -60,6 +70,11 @@ class RunsClient {
|
|
|
60
70
|
return data;
|
|
61
71
|
});
|
|
62
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Lists all task and workflow runs for the current tenant.
|
|
75
|
+
* @param opts - The options for the list operation.
|
|
76
|
+
* @returns A promise that resolves to the list of runs.
|
|
77
|
+
*/
|
|
63
78
|
list(opts) {
|
|
64
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
80
|
const normalizedOpts = (opts === null || opts === void 0 ? void 0 : opts.parentTaskExternalId) && !(opts === null || opts === void 0 ? void 0 : opts.parentTaskRunExternalId)
|
|
@@ -68,6 +83,11 @@ class RunsClient {
|
|
|
68
83
|
return data;
|
|
69
84
|
});
|
|
70
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Cancels a task or workflow run by its ID.
|
|
88
|
+
* @param opts - The options for the cancel operation.
|
|
89
|
+
* @returns A promise that resolves to the cancelled run.
|
|
90
|
+
*/
|
|
71
91
|
cancel(opts) {
|
|
72
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
93
|
const filter = yield this.prepareFilter(opts.filters || {});
|
|
@@ -77,6 +97,11 @@ class RunsClient {
|
|
|
77
97
|
});
|
|
78
98
|
});
|
|
79
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Replays a task or workflow run by its ID.
|
|
102
|
+
* @param opts - The options for the replay operation.
|
|
103
|
+
* @returns A promise that resolves to the replayed run.
|
|
104
|
+
*/
|
|
80
105
|
replay(opts) {
|
|
81
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
107
|
const filter = yield this.prepareFilter(opts.filters || {});
|
|
@@ -122,9 +147,19 @@ class RunsClient {
|
|
|
122
147
|
};
|
|
123
148
|
});
|
|
124
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Creates a run reference for a task or workflow run by its ID.
|
|
152
|
+
* @param id - The ID of the run to create a reference for.
|
|
153
|
+
* @returns A promise that resolves to the run reference.
|
|
154
|
+
*/
|
|
125
155
|
runRef(id) {
|
|
126
156
|
return new workflow_run_ref_1.default(id, this.listener, this);
|
|
127
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Subscribes to a stream of events for a task or workflow run by its ID.
|
|
160
|
+
* @param workflowRunId - The ID of the run to subscribe to.
|
|
161
|
+
* @returns A promise that resolves to the stream of events.
|
|
162
|
+
*/
|
|
128
163
|
subscribeToStream(workflowRunId) {
|
|
129
164
|
return __asyncGenerator(this, arguments, function* subscribeToStream_1() {
|
|
130
165
|
var _a, e_1, _b, _c;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ScheduledWorkflows, ScheduledWorkflowsBulkDeleteFilter, ScheduledWorkflowsBulkDeleteResponse, ScheduledWorkflowsBulkUpdateResponse, ScheduledWorkflowsList } from '
|
|
1
|
+
import { ScheduledWorkflows, ScheduledWorkflowsBulkDeleteFilter, ScheduledWorkflowsBulkDeleteResponse, ScheduledWorkflowsBulkUpdateResponse, ScheduledWorkflowsList } from '../../../../clients/rest/generated/data-contracts';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { Workflow } from '
|
|
4
|
-
import { BaseWorkflowDeclaration, WorkflowDefinition } from '
|
|
3
|
+
import { Workflow } from '../../../../workflow';
|
|
4
|
+
import { BaseWorkflowDeclaration, WorkflowDefinition } from '../../../../v1';
|
|
5
5
|
import { HatchetClient } from '../client';
|
|
6
6
|
import { WorkflowsClient } from './workflows';
|
|
7
7
|
/**
|
|
8
8
|
* Schema for creating a Scheduled Run Trigger.
|
|
9
|
+
* @internal
|
|
9
10
|
*/
|
|
10
11
|
export declare const CreateScheduledRunTriggerSchema: z.ZodObject<{
|
|
11
12
|
triggerAt: z.ZodDate;
|
|
@@ -25,10 +26,12 @@ export declare const CreateScheduledRunTriggerSchema: z.ZodObject<{
|
|
|
25
26
|
}>;
|
|
26
27
|
/**
|
|
27
28
|
* Type representing the input for creating a Cron.
|
|
29
|
+
* @internal
|
|
28
30
|
*/
|
|
29
31
|
export type CreateScheduledRunInput = z.infer<typeof CreateScheduledRunTriggerSchema>;
|
|
30
32
|
/**
|
|
31
33
|
* Schema for updating (rescheduling) a Scheduled Run Trigger.
|
|
34
|
+
* @internal
|
|
32
35
|
*/
|
|
33
36
|
export declare const UpdateScheduledRunTriggerSchema: z.ZodObject<{
|
|
34
37
|
triggerAt: z.ZodDate;
|
|
@@ -39,7 +42,7 @@ export declare const UpdateScheduledRunTriggerSchema: z.ZodObject<{
|
|
|
39
42
|
}>;
|
|
40
43
|
export type UpdateScheduledRunInput = z.infer<typeof UpdateScheduledRunTriggerSchema>;
|
|
41
44
|
/**
|
|
42
|
-
*
|
|
45
|
+
* The scheduled client is a client for managing scheduled workflows within Hatchet
|
|
43
46
|
*/
|
|
44
47
|
export declare class ScheduleClient {
|
|
45
48
|
api: HatchetClient['api'];
|
|
@@ -23,11 +23,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.ScheduleClient = exports.UpdateScheduledRunTriggerSchema = exports.CreateScheduledRunTriggerSchema = void 0;
|
|
24
24
|
const zod_1 = require("zod");
|
|
25
25
|
const axios_1 = require("axios");
|
|
26
|
-
const uuid_1 = require("
|
|
27
|
-
const apply_namespace_1 = require("
|
|
26
|
+
const uuid_1 = require("../../../../util/uuid");
|
|
27
|
+
const apply_namespace_1 = require("../../../../util/apply-namespace");
|
|
28
28
|
const workflows_1 = require("./workflows");
|
|
29
29
|
/**
|
|
30
30
|
* Schema for creating a Scheduled Run Trigger.
|
|
31
|
+
* @internal
|
|
31
32
|
*/
|
|
32
33
|
exports.CreateScheduledRunTriggerSchema = zod_1.z.object({
|
|
33
34
|
triggerAt: zod_1.z.coerce.date(),
|
|
@@ -37,12 +38,13 @@ exports.CreateScheduledRunTriggerSchema = zod_1.z.object({
|
|
|
37
38
|
});
|
|
38
39
|
/**
|
|
39
40
|
* Schema for updating (rescheduling) a Scheduled Run Trigger.
|
|
41
|
+
* @internal
|
|
40
42
|
*/
|
|
41
43
|
exports.UpdateScheduledRunTriggerSchema = zod_1.z.object({
|
|
42
44
|
triggerAt: zod_1.z.coerce.date(),
|
|
43
45
|
});
|
|
44
46
|
/**
|
|
45
|
-
*
|
|
47
|
+
* The scheduled client is a client for managing scheduled workflows within Hatchet
|
|
46
48
|
*/
|
|
47
49
|
class ScheduleClient {
|
|
48
50
|
constructor(client) {
|
|
@@ -73,7 +75,7 @@ class ScheduleClient {
|
|
|
73
75
|
create(workflow, cron) {
|
|
74
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
77
|
var _a, _b, _c;
|
|
76
|
-
const workflowId = (0, apply_namespace_1.applyNamespace)((0, workflows_1.workflowNameString)(workflow), this.namespace);
|
|
78
|
+
const workflowId = (0, apply_namespace_1.applyNamespace)((0, workflows_1.workflowNameString)(workflow), this.namespace).toLowerCase();
|
|
77
79
|
// Validate cron input with zod schema
|
|
78
80
|
try {
|
|
79
81
|
const parsedCron = exports.CreateScheduledRunTriggerSchema.parse(cron);
|
|
@@ -144,7 +146,7 @@ class ScheduleClient {
|
|
|
144
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
147
|
const { workflow } = query, rest = __rest(query, ["workflow"]);
|
|
146
148
|
if (workflow) {
|
|
147
|
-
const workflowId = yield this.workflows.getWorkflowIdFromName((0, apply_namespace_1.applyNamespace)((0, workflows_1.workflowNameString)(workflow), this.namespace));
|
|
149
|
+
const workflowId = yield this.workflows.getWorkflowIdFromName((0, apply_namespace_1.applyNamespace)((0, workflows_1.workflowNameString)(workflow), this.namespace).toLowerCase());
|
|
148
150
|
rest.workflowId = workflowId;
|
|
149
151
|
}
|
|
150
152
|
const response = yield this.api.workflowScheduledList(this.tenantId, rest);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @module Tenant Client
|
|
3
|
+
*/
|
|
4
|
+
import { Tenant } from '../../../../clients/rest/generated/data-contracts';
|
|
2
5
|
import { HatchetClient } from '../client';
|
|
3
6
|
/**
|
|
4
7
|
* Client for managing Tenants
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { V1CreateWebhookRequestBase, V1UpdateWebhookRequest, V1Webhook, V1WebhookList, V1WebhookSourceName, V1WebhookAPIKeyAuth, V1WebhookBasicAuth, V1WebhookHMACAuth } from '../../../../clients/rest/generated/data-contracts';
|
|
2
|
+
import { HatchetClient } from '../client';
|
|
3
|
+
export type CreateWebhookOptions = V1CreateWebhookRequestBase & {
|
|
4
|
+
auth: V1WebhookBasicAuth | V1WebhookAPIKeyAuth | V1WebhookHMACAuth;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Client for managing incoming webhooks in Hatchet.
|
|
8
|
+
*
|
|
9
|
+
* Webhooks allow external systems to trigger Hatchet workflows by sending
|
|
10
|
+
* HTTP requests to dedicated endpoints. This enables real-time integration
|
|
11
|
+
* with third-party services like GitHub, Stripe, Slack, or any system that
|
|
12
|
+
* can send webhook events.
|
|
13
|
+
*/
|
|
14
|
+
export declare class WebhooksClient {
|
|
15
|
+
api: HatchetClient['api'];
|
|
16
|
+
tenantId: string;
|
|
17
|
+
constructor(client: HatchetClient);
|
|
18
|
+
/**
|
|
19
|
+
* Lists all webhooks for the current tenant.
|
|
20
|
+
* @param options - The options for the list operation.
|
|
21
|
+
* @returns A promise that resolves to the list of webhooks.
|
|
22
|
+
*/
|
|
23
|
+
list(options?: {
|
|
24
|
+
limit?: number;
|
|
25
|
+
offset?: number;
|
|
26
|
+
webhookNames?: string[];
|
|
27
|
+
sourceNames?: V1WebhookSourceName[];
|
|
28
|
+
}): Promise<V1WebhookList>;
|
|
29
|
+
/**
|
|
30
|
+
* Gets a webhook by its name.
|
|
31
|
+
* @param webhookName - The name of the webhook to get.
|
|
32
|
+
* @returns A promise that resolves to the webhook.
|
|
33
|
+
*/
|
|
34
|
+
get(webhookName: string): Promise<V1Webhook>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new webhook.
|
|
37
|
+
* @param request - The request options for the create operation.
|
|
38
|
+
* @returns A promise that resolves to the created webhook.
|
|
39
|
+
*/
|
|
40
|
+
create(request: CreateWebhookOptions): Promise<V1Webhook>;
|
|
41
|
+
/**
|
|
42
|
+
* Updates a webhook by its name.
|
|
43
|
+
* @param webhookName - The name of the webhook to update.
|
|
44
|
+
* @param options - The options for the update operation.
|
|
45
|
+
* @returns A promise that resolves to the updated webhook.
|
|
46
|
+
*/
|
|
47
|
+
update(webhookName: string, options?: Partial<V1UpdateWebhookRequest>): Promise<V1Webhook>;
|
|
48
|
+
/**
|
|
49
|
+
* Deletes a webhook by its name.
|
|
50
|
+
* @param webhookName - The name of the webhook to delete.
|
|
51
|
+
* @returns A promise that resolves to the deleted webhook.
|
|
52
|
+
*/
|
|
53
|
+
delete(webhookName: string): Promise<V1Webhook>;
|
|
54
|
+
}
|