@temelj/workflow 0.0.0-alpha.3 → 0.0.0-alpha.4
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/README.md +394 -2
- package/dist/attributes.d.mts +11 -9
- package/dist/attributes.mjs +23 -5
- package/dist/bundle.d.mts +5 -23
- package/dist/bundle.mjs +2 -18
- package/dist/client/create.d.mts +26 -23
- package/dist/client/create.mjs +26 -32
- package/dist/client/facades.d.mts +12 -18
- package/dist/client/facades.mjs +102 -93
- package/dist/client/mod.mjs +1 -2
- package/dist/client/run-handle.d.mts +17 -54
- package/dist/client/run-handle.mjs +35 -105
- package/dist/client/worker-options.d.mts +8 -8
- package/dist/client/worker-options.mjs +11 -11
- package/dist/cloudflare/cloudflare.d.mts +4 -5
- package/dist/cloudflare/codec.d.mts +28 -13
- package/dist/cloudflare/codec.mjs +40 -17
- package/dist/cloudflare/entrypoint.d.mts +3 -4
- package/dist/cloudflare/entrypoint.mjs +4 -3
- package/dist/cloudflare/execution.d.mts +3 -4
- package/dist/cloudflare/execution.mjs +20 -13
- package/dist/cloudflare/host.d.mts +6 -7
- package/dist/cloudflare/host.mjs +7 -6
- package/dist/cloudflare/mod.d.mts +4 -4
- package/dist/cloudflare/mod.mjs +2 -2
- package/dist/cloudflare/name.d.mts +3 -4
- package/dist/cloudflare/name.mjs +3 -3
- package/dist/cloudflare/registry.d.mts +3 -23
- package/dist/cloudflare/registry.mjs +2 -20
- package/dist/cloudflare/runtime.d.mts +11 -18
- package/dist/cloudflare/runtime.mjs +52 -73
- package/dist/cloudflare/step.d.mts +6 -6
- package/dist/cloudflare/step.mjs +69 -57
- package/dist/cloudflare/types.d.mts +17 -36
- package/dist/collection.d.mts +8 -11
- package/dist/collection.mjs +10 -14
- package/dist/compiled-function.d.mts +14 -19
- package/dist/compiled-function.mjs +12 -24
- package/dist/compiled.d.mts +4 -0
- package/dist/compiled.mjs +4 -0
- package/dist/compiler/ast.d.mts +26 -0
- package/dist/{vite → compiler}/ast.mjs +24 -16
- package/dist/{vite → compiler}/error.d.mts +4 -6
- package/dist/{vite → compiler}/error.mjs +14 -16
- package/dist/compiler/manifest.d.mts +6 -0
- package/dist/{vite → compiler}/manifest.mjs +9 -7
- package/dist/compiler/plugin.d.mts +7 -0
- package/dist/{vite → compiler}/plugin.mjs +45 -46
- package/dist/compiler/safety.d.mts +12 -0
- package/dist/{vite → compiler}/safety.mjs +5 -11
- package/dist/{vite → compiler}/source-edit.d.mts +3 -4
- package/dist/{vite → compiler}/source-edit.mjs +1 -1
- package/dist/{vite → compiler}/source-map.d.mts +4 -3
- package/dist/{vite → compiler}/source-map.mjs +3 -3
- package/dist/compiler/source.d.mts +7 -0
- package/dist/{vite → compiler}/source.mjs +1 -1
- package/dist/compiler/transform.d.mts +12 -0
- package/dist/{vite → compiler}/transform.mjs +37 -38
- package/dist/definition.d.mts +17 -25
- package/dist/definition.mjs +19 -35
- package/dist/engine/child-workflow.d.mts +5 -9
- package/dist/engine/child-workflow.mjs +46 -67
- package/dist/engine/command-identity.d.mts +5 -6
- package/dist/engine/command-identity.mjs +9 -5
- package/dist/engine/context.d.mts +17 -0
- package/dist/engine/create.d.mts +36 -94
- package/dist/engine/create.mjs +55 -260
- package/dist/engine/deterministic.d.mts +6 -11
- package/dist/engine/deterministic.mjs +47 -68
- package/dist/engine/durable-command.d.mts +5 -5
- package/dist/engine/durable-command.mjs +2 -2
- package/dist/engine/execution-service.d.mts +20 -24
- package/dist/engine/execution-service.mjs +54 -52
- package/dist/engine/hooks.d.mts +17 -39
- package/dist/engine/hooks.mjs +73 -94
- package/dist/engine/inspection.d.mts +23 -15
- package/dist/engine/inspection.mjs +55 -29
- package/dist/engine/lifecycle.d.mts +6 -12
- package/dist/engine/lifecycle.mjs +5 -5
- package/dist/engine/lock-replay.d.mts +8 -15
- package/dist/engine/lock-replay.mjs +12 -25
- package/dist/engine/lock.d.mts +10 -15
- package/dist/engine/lock.mjs +65 -51
- package/dist/engine/message.d.mts +14 -34
- package/dist/engine/message.mjs +94 -127
- package/dist/engine/observation.d.mts +9 -11
- package/dist/engine/observation.mjs +18 -27
- package/dist/engine/replay.d.mts +18 -19
- package/dist/engine/replay.mjs +32 -56
- package/dist/engine/resume.d.mts +16 -0
- package/dist/engine/resume.mjs +24 -0
- package/dist/engine/retry.d.mts +15 -19
- package/dist/engine/retry.mjs +17 -17
- package/dist/engine/run-data.d.mts +4 -8
- package/dist/engine/run-data.mjs +24 -22
- package/dist/engine/run-service.d.mts +24 -33
- package/dist/engine/run-service.mjs +125 -93
- package/dist/engine/run-utils.d.mts +11 -13
- package/dist/engine/run-utils.mjs +23 -46
- package/dist/engine/schedule.d.mts +8 -22
- package/dist/engine/schedule.mjs +37 -34
- package/dist/engine/serialization.d.mts +9 -6
- package/dist/engine/serialization.mjs +30 -21
- package/dist/engine/signals.d.mts +23 -0
- package/dist/engine/signals.mjs +41 -0
- package/dist/engine/start.d.mts +18 -0
- package/dist/engine/start.mjs +88 -0
- package/dist/engine/state.d.mts +37 -67
- package/dist/engine/state.mjs +119 -280
- package/dist/engine/step-api.d.mts +5 -8
- package/dist/engine/step-api.mjs +16 -16
- package/dist/engine/stream-reader.d.mts +12 -0
- package/dist/engine/stream-reader.mjs +154 -0
- package/dist/engine/stream.d.mts +9 -54
- package/dist/engine/stream.mjs +54 -196
- package/dist/engine/summary/recovery.d.mts +35 -0
- package/dist/engine/summary/recovery.mjs +363 -0
- package/dist/engine/summary/runs.d.mts +43 -0
- package/dist/engine/summary/runs.mjs +294 -0
- package/dist/engine/summary/step-attempts.d.mts +5 -10
- package/dist/engine/summary/step-attempts.mjs +157 -36
- package/dist/engine/summary/tally.d.mts +44 -0
- package/dist/engine/summary/tally.mjs +142 -0
- package/dist/engine/task.d.mts +4 -5
- package/dist/engine/task.mjs +40 -48
- package/dist/errors/base.d.mts +17 -77
- package/dist/errors/base.mjs +26 -327
- package/dist/errors/capability.d.mts +3 -6
- package/dist/errors/capability.mjs +4 -8
- package/dist/errors/codes.d.mts +116 -0
- package/dist/{types/error-code.mjs → errors/codes.mjs} +2 -17
- package/dist/errors/definition.d.mts +3 -17
- package/dist/errors/definition.mjs +5 -42
- package/dist/errors/failures.d.mts +17 -51
- package/dist/errors/failures.mjs +35 -102
- package/dist/errors/hook.d.mts +5 -9
- package/dist/errors/hook.mjs +4 -16
- package/dist/errors/implementation.d.mts +3 -6
- package/dist/errors/implementation.mjs +7 -12
- package/dist/errors/lock.d.mts +7 -20
- package/dist/errors/lock.mjs +8 -44
- package/dist/errors/message.d.mts +14 -59
- package/dist/errors/message.mjs +13 -39
- package/dist/errors/mod.d.mts +4 -5
- package/dist/errors/mod.mjs +5 -7
- package/dist/errors/records.d.mts +10 -4
- package/dist/errors/records.mjs +256 -256
- package/dist/errors/run.d.mts +27 -68
- package/dist/errors/run.mjs +31 -85
- package/dist/errors/schedule.d.mts +7 -18
- package/dist/errors/schedule.mjs +7 -39
- package/dist/errors/step.d.mts +12 -45
- package/dist/errors/step.mjs +13 -34
- package/dist/errors/stream.d.mts +8 -16
- package/dist/errors/stream.mjs +7 -41
- package/dist/esbuild.d.mts +6 -4
- package/dist/esbuild.mjs +2 -1
- package/dist/events/descriptors.d.mts +12 -241
- package/dist/events/descriptors.mjs +12 -5
- package/dist/history/projection.d.mts +4 -6
- package/dist/history/projection.mjs +22 -26
- package/dist/history/replay-projection.d.mts +44 -48
- package/dist/history/replay-projection.mjs +41 -50
- package/dist/history/{mod.d.mts → replay.d.mts} +16 -21
- package/dist/history/{mod.mjs → replay.mjs} +21 -25
- package/dist/history/sequencer.d.mts +10 -11
- package/dist/history/sequencer.mjs +11 -7
- package/dist/history/step-attempts.d.mts +4 -7
- package/dist/history/step-attempts.mjs +8 -9
- package/dist/history/timeline.d.mts +4 -13
- package/dist/history/timeline.mjs +46 -265
- package/dist/history/validator.d.mts +5 -7
- package/dist/history/validator.mjs +9 -24
- package/dist/hook-token.d.mts +7 -0
- package/dist/hook-token.mjs +32 -0
- package/dist/ids.d.mts +8 -0
- package/dist/ids.mjs +21 -0
- package/dist/message-options.d.mts +11 -5
- package/dist/message-options.mjs +9 -7
- package/dist/mod.d.mts +32 -36
- package/dist/mod.mjs +9 -13
- package/dist/otel/metrics.d.mts +31 -0
- package/dist/otel/metrics.mjs +60 -0
- package/dist/otel/mod.d.mts +3 -0
- package/dist/otel/mod.mjs +3 -0
- package/dist/otel/spans.d.mts +24 -0
- package/dist/otel/spans.mjs +218 -0
- package/dist/otel/support.d.mts +15 -8
- package/dist/otel/support.mjs +18 -40
- package/dist/{otel.d.mts → otel/telemetry.d.mts} +5 -6
- package/dist/otel/telemetry.mjs +305 -0
- package/dist/pagination.d.mts +6 -12
- package/dist/pagination.mjs +10 -14
- package/dist/registry.d.mts +8 -5
- package/dist/registry.mjs +19 -10
- package/dist/rolldown.d.mts +6 -4
- package/dist/rolldown.mjs +2 -1
- package/dist/rollup.d.mts +6 -4
- package/dist/rollup.mjs +2 -1
- package/dist/rspack.d.mts +6 -4
- package/dist/rspack.mjs +2 -1
- package/dist/run-status.d.mts +29 -0
- package/dist/run-status.mjs +42 -0
- package/dist/schema/common.d.mts +22 -0
- package/dist/schema/common.mjs +54 -0
- package/dist/schema/error.d.mts +17 -0
- package/dist/schema/error.mjs +39 -0
- package/dist/schema/events.d.mts +446 -0
- package/dist/schema/events.mjs +235 -0
- package/dist/schema/pagination.d.mts +5 -0
- package/dist/schema/pagination.mjs +11 -0
- package/dist/schema/persisted-value.d.mts +8 -0
- package/dist/schema/persisted-value.mjs +94 -0
- package/dist/schema/run.d.mts +51 -0
- package/dist/schema/run.mjs +88 -0
- package/dist/schema/store.d.mts +94 -0
- package/dist/schema/store.mjs +116 -0
- package/dist/step-definition.d.mts +4 -9
- package/dist/step-definition.mjs +2 -2
- package/dist/store/capabilities.d.mts +8 -9
- package/dist/store/capabilities.mjs +7 -7
- package/dist/store/cleanup.d.mts +9 -14
- package/dist/store/cleanup.mjs +86 -85
- package/dist/store/create.d.mts +28 -29
- package/dist/store/create.mjs +10 -11
- package/dist/store/events.d.mts +48 -0
- package/dist/store/events.mjs +263 -0
- package/dist/store/indexes.d.mts +25 -0
- package/dist/store/indexes.mjs +282 -0
- package/dist/store/instrumentation.d.mts +2 -3
- package/dist/store/instrumentation.mjs +30 -30
- package/dist/store/lock.d.mts +4 -5
- package/dist/store/lock.mjs +5 -7
- package/dist/store/materialization.d.mts +10 -17
- package/dist/store/materialization.mjs +39 -33
- package/dist/store/mod.d.mts +3 -3
- package/dist/store/mod.mjs +2 -2
- package/dist/store/query.d.mts +13 -17
- package/dist/store/query.mjs +13 -13
- package/dist/store/run.d.mts +25 -34
- package/dist/store/run.mjs +67 -108
- package/dist/store/schedule.d.mts +6 -8
- package/dist/store/schedule.mjs +11 -11
- package/dist/store/step-attempt.d.mts +9 -12
- package/dist/store/step-attempt.mjs +9 -9
- package/dist/store/storage-value.d.mts +3 -3
- package/dist/store/storage-value.mjs +17 -1
- package/dist/store/validation.d.mts +17 -20
- package/dist/store/validation.mjs +30 -33
- package/dist/store-keys.d.mts +35 -47
- package/dist/store-keys.mjs +9 -17
- package/dist/telemetry.d.mts +16 -16
- package/dist/telemetry.mjs +3 -3
- package/dist/temporal.d.mts +11 -16
- package/dist/temporal.mjs +8 -9
- package/dist/timer.d.mts +12 -10
- package/dist/timer.mjs +11 -3
- package/dist/types/cleanup.d.mts +13 -50
- package/dist/types/cleanup.mjs +1 -22
- package/dist/types/client.d.mts +101 -162
- package/dist/types/{vite.d.mts → compiler.d.mts} +17 -24
- package/dist/types/compiler.mjs +1 -0
- package/dist/types/definition.d.mts +22 -34
- package/dist/types/engine-options.d.mts +10 -17
- package/dist/types/engine.d.mts +15 -274
- package/dist/types/error.d.mts +15 -217
- package/dist/types/error.mjs +1 -48
- package/dist/types/events.d.mts +59 -2730
- package/dist/types/events.mjs +1 -283
- package/dist/types/hook.d.mts +27 -85
- package/dist/types/hook.mjs +1 -66
- package/dist/types/ids.d.mts +9 -0
- package/dist/types/ids.mjs +1 -0
- package/dist/types/lock.d.mts +8 -26
- package/dist/types/lock.mjs +1 -18
- package/dist/types/message.d.mts +29 -43
- package/dist/types/observation.d.mts +43 -58
- package/dist/types/pagination.d.mts +6 -22
- package/dist/types/pagination.mjs +1 -13
- package/dist/types/result.d.mts +11 -43
- package/dist/types/retry.d.mts +7 -14
- package/dist/types/run-list.d.mts +9 -11
- package/dist/types/run-options.d.mts +25 -32
- package/dist/types/run.d.mts +35 -315
- package/dist/types/run.mjs +1 -207
- package/dist/types/runtime.d.mts +33 -145
- package/dist/types/runtime.mjs +1 -21
- package/dist/types/schedule.d.mts +13 -72
- package/dist/types/schedule.mjs +1 -48
- package/dist/types/step-attempts.d.mts +65 -261
- package/dist/types/step-attempts.mjs +1 -43
- package/dist/types/step.d.mts +66 -77
- package/dist/types/step.mjs +1 -5
- package/dist/types/store.d.mts +50 -182
- package/dist/types/stream.d.mts +19 -40
- package/dist/types/summary.d.mts +174 -278
- package/dist/types/telemetry.d.mts +23 -28
- package/dist/types/telemetry.mjs +1 -9
- package/dist/types/timeline.d.mts +46 -233
- package/dist/types/worker.d.mts +22 -29
- package/dist/values.d.mts +15 -0
- package/dist/values.mjs +57 -0
- package/dist/vite.d.mts +5 -6
- package/dist/vite.mjs +3 -4
- package/dist/webpack.d.mts +6 -4
- package/dist/webpack.mjs +2 -1
- package/dist/worker/error.d.mts +2 -9
- package/dist/worker/error.mjs +20 -32
- package/dist/worker/missing-implementation.d.mts +19 -0
- package/dist/worker/missing-implementation.mjs +62 -0
- package/dist/worker/worker.d.mts +18 -0
- package/dist/{worker.mjs → worker/worker.mjs} +64 -118
- package/package.json +28 -47
- package/dist/engine/execution-api.d.mts +0 -29
- package/dist/engine/execution-api.mjs +0 -33
- package/dist/engine/inspection-api.d.mts +0 -34
- package/dist/engine/inspection-api.mjs +0 -78
- package/dist/engine/mod.d.mts +0 -4
- package/dist/engine/mod.mjs +0 -2
- package/dist/engine/recovery.d.mts +0 -26
- package/dist/engine/recovery.mjs +0 -92
- package/dist/engine/retry-policy.d.mts +0 -4
- package/dist/engine/retry-policy.mjs +0 -4
- package/dist/engine/start-api.d.mts +0 -30
- package/dist/engine/start-api.mjs +0 -99
- package/dist/engine/summary/active-events.d.mts +0 -34
- package/dist/engine/summary/active-events.mjs +0 -69
- package/dist/engine/summary/child-workflow-runs.d.mts +0 -24
- package/dist/engine/summary/child-workflow-runs.mjs +0 -138
- package/dist/engine/summary/child-workflow-waits.d.mts +0 -21
- package/dist/engine/summary/child-workflow-waits.mjs +0 -67
- package/dist/engine/summary/recovery-child-workflow-waits.d.mts +0 -11
- package/dist/engine/summary/recovery-child-workflow-waits.mjs +0 -89
- package/dist/engine/summary/recovery-due-runs.d.mts +0 -16
- package/dist/engine/summary/recovery-due-runs.mjs +0 -52
- package/dist/engine/summary/recovery-failed-runs.d.mts +0 -14
- package/dist/engine/summary/recovery-failed-runs.mjs +0 -33
- package/dist/engine/summary/recovery-lease-runs.d.mts +0 -16
- package/dist/engine/summary/recovery-lease-runs.mjs +0 -69
- package/dist/engine/summary/recovery-locks.d.mts +0 -18
- package/dist/engine/summary/recovery-locks.mjs +0 -100
- package/dist/engine/summary/recovery-message-waits.d.mts +0 -11
- package/dist/engine/summary/recovery-message-waits.mjs +0 -74
- package/dist/engine/summary/recovery-retry-runs.d.mts +0 -17
- package/dist/engine/summary/recovery-retry-runs.mjs +0 -65
- package/dist/engine/summary/recovery-run-timestamps.d.mts +0 -13
- package/dist/engine/summary/recovery-run-timestamps.mjs +0 -18
- package/dist/engine/summary/recovery-runs.d.mts +0 -23
- package/dist/engine/summary/recovery-runs.mjs +0 -54
- package/dist/engine/summary/recovery-schedules.d.mts +0 -10
- package/dist/engine/summary/recovery-schedules.mjs +0 -46
- package/dist/engine/summary/recovery-sleep-waits.d.mts +0 -10
- package/dist/engine/summary/recovery-sleep-waits.mjs +0 -53
- package/dist/engine/summary/recovery-waits.d.mts +0 -21
- package/dist/engine/summary/recovery-waits.mjs +0 -29
- package/dist/engine/summary/run-availability.d.mts +0 -13
- package/dist/engine/summary/run-availability.mjs +0 -37
- package/dist/engine/summary/run-cleanup.d.mts +0 -14
- package/dist/engine/summary/run-cleanup.mjs +0 -44
- package/dist/engine/summary/run-failure.d.mts +0 -14
- package/dist/engine/summary/run-failure.mjs +0 -62
- package/dist/engine/summary/run-hooks.d.mts +0 -14
- package/dist/engine/summary/run-hooks.mjs +0 -63
- package/dist/engine/summary/run-lease.d.mts +0 -11
- package/dist/engine/summary/run-lease.mjs +0 -64
- package/dist/engine/summary/run-message-waits.d.mts +0 -15
- package/dist/engine/summary/run-message-waits.mjs +0 -62
- package/dist/engine/summary/run-metrics.d.mts +0 -31
- package/dist/engine/summary/run-metrics.mjs +0 -93
- package/dist/engine/summary/run-retry.d.mts +0 -9
- package/dist/engine/summary/run-retry.mjs +0 -69
- package/dist/engine/summary/run-sleeps.d.mts +0 -15
- package/dist/engine/summary/run-sleeps.mjs +0 -61
- package/dist/engine/summary/run-state.d.mts +0 -26
- package/dist/engine/summary/run-state.mjs +0 -48
- package/dist/engine/summary/run-status.d.mts +0 -16
- package/dist/engine/summary/run-status.mjs +0 -35
- package/dist/engine/summary/run-streams.d.mts +0 -14
- package/dist/engine/summary/run-streams.mjs +0 -46
- package/dist/engine/summary/run-transition.d.mts +0 -9
- package/dist/engine/summary/run-transition.mjs +0 -39
- package/dist/engine/summary/run-workflow.d.mts +0 -9
- package/dist/engine/summary/run-workflow.mjs +0 -47
- package/dist/engine/summary/step-attempt-active-child-workflows.d.mts +0 -13
- package/dist/engine/summary/step-attempt-active-child-workflows.mjs +0 -55
- package/dist/engine/summary/step-attempt-active-fields.d.mts +0 -23
- package/dist/engine/summary/step-attempt-active-fields.mjs +0 -14
- package/dist/engine/summary/step-attempt-active-message-waits.d.mts +0 -12
- package/dist/engine/summary/step-attempt-active-message-waits.mjs +0 -47
- package/dist/engine/summary/step-attempt-active-sleeps.d.mts +0 -19
- package/dist/engine/summary/step-attempt-active-sleeps.mjs +0 -44
- package/dist/engine/summary/step-attempt-buckets.d.mts +0 -22
- package/dist/engine/summary/step-attempt-buckets.mjs +0 -152
- package/dist/engine/summary/step-attempt-failure.d.mts +0 -12
- package/dist/engine/summary/step-attempt-failure.mjs +0 -61
- package/dist/engine/summary/step-attempt-lifecycle.d.mts +0 -13
- package/dist/engine/summary/step-attempt-lifecycle.mjs +0 -19
- package/dist/engine/summary.d.mts +0 -32
- package/dist/engine/summary.mjs +0 -37
- package/dist/errors/details.d.mts +0 -13
- package/dist/errors/details.mjs +0 -66
- package/dist/errors/record-view.d.mts +0 -11
- package/dist/errors/record-view.mjs +0 -24
- package/dist/errors/runtime.d.mts +0 -12
- package/dist/errors/runtime.mjs +0 -24
- package/dist/events/mod.d.mts +0 -3
- package/dist/events/mod.mjs +0 -2
- package/dist/history/attempt-key.d.mts +0 -6
- package/dist/history/attempt-key.mjs +0 -7
- package/dist/inspection/mod.d.mts +0 -5
- package/dist/inspection/mod.mjs +0 -3
- package/dist/otel.mjs +0 -590
- package/dist/runtime.d.mts +0 -35
- package/dist/runtime.mjs +0 -198
- package/dist/store/append-projection.d.mts +0 -15
- package/dist/store/append-projection.mjs +0 -26
- package/dist/store/compaction.d.mts +0 -5
- package/dist/store/compaction.mjs +0 -8
- package/dist/store/event-append-project.d.mts +0 -15
- package/dist/store/event-append-project.mjs +0 -77
- package/dist/store/event-append.d.mts +0 -37
- package/dist/store/event-append.mjs +0 -80
- package/dist/store/event-history.d.mts +0 -22
- package/dist/store/event-history.mjs +0 -75
- package/dist/store/event.d.mts +0 -10
- package/dist/store/event.mjs +0 -28
- package/dist/store/idempotency.d.mts +0 -10
- package/dist/store/idempotency.mjs +0 -167
- package/dist/store/message-index.d.mts +0 -21
- package/dist/store/message-index.mjs +0 -122
- package/dist/store/revision.d.mts +0 -4
- package/dist/store/revision.mjs +0 -7
- package/dist/store/schema.d.mts +0 -14
- package/dist/store/schema.mjs +0 -17
- package/dist/types/common.d.mts +0 -20
- package/dist/types/common.mjs +0 -16
- package/dist/types/error-code.d.mts +0 -256
- package/dist/types/message-id.d.mts +0 -7
- package/dist/types/message-id.mjs +0 -5
- package/dist/types/run-id.d.mts +0 -7
- package/dist/types/run-id.mjs +0 -5
- package/dist/types/step-id.d.mts +0 -7
- package/dist/types/step-id.mjs +0 -5
- package/dist/types/stream-id.d.mts +0 -7
- package/dist/types/stream-id.mjs +0 -5
- package/dist/types/worker-id.d.mts +0 -7
- package/dist/types/worker-id.mjs +0 -5
- package/dist/utility.d.mts +0 -49
- package/dist/utility.mjs +0 -122
- package/dist/vite/ast.d.mts +0 -23
- package/dist/vite/generated-name.d.mts +0 -7
- package/dist/vite/generated-name.mjs +0 -9
- package/dist/vite/manifest.d.mts +0 -7
- package/dist/vite/plugin.d.mts +0 -7
- package/dist/vite/safety.d.mts +0 -12
- package/dist/vite/source.d.mts +0 -7
- package/dist/vite/transform.d.mts +0 -7
- package/dist/webhook.d.mts +0 -16
- package/dist/webhook.mjs +0 -17
- package/dist/worker.d.mts +0 -19
- /package/dist/{types/vite.mjs → engine/context.mjs} +0 -0
package/dist/errors/run.d.mts
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
import { RunId } from "../types/
|
|
2
|
-
import {
|
|
3
|
-
import "../types/step.mjs";
|
|
4
|
-
import { WorkflowRunStatus, WorkflowTerminalRunStatus } from "../types/run.mjs";
|
|
1
|
+
import { RunId, StepId } from "../types/ids.mjs";
|
|
2
|
+
import { RunStatus, TerminalRunStatus } from "../types/run.mjs";
|
|
5
3
|
import { WorkflowRunError } from "./base.mjs";
|
|
6
4
|
//#region src/errors/run.d.ts
|
|
7
|
-
|
|
8
|
-
declare class WorkflowRunNotFoundError extends WorkflowRunError {
|
|
5
|
+
export declare class WorkflowRunNotFoundError extends WorkflowRunError {
|
|
9
6
|
readonly runId: RunId;
|
|
10
|
-
constructor(runId: RunId
|
|
7
|
+
constructor(runId: RunId);
|
|
11
8
|
static notFound(this: void, runId: RunId): never;
|
|
12
|
-
static create(this: void, runId: RunId): WorkflowRunNotFoundError;
|
|
13
9
|
}
|
|
14
10
|
/** Error thrown for run not found failures. */
|
|
15
|
-
declare class WorkflowRunInvalidError extends WorkflowRunError {
|
|
11
|
+
export declare class WorkflowRunInvalidError extends WorkflowRunError {
|
|
16
12
|
readonly runId: RunId;
|
|
17
|
-
constructor(runId: RunId, message: string
|
|
18
|
-
static invalid(this: void, runId: RunId, message: string): never;
|
|
19
|
-
static create(this: void, runId: RunId, message: string): WorkflowRunInvalidError;
|
|
13
|
+
constructor(runId: RunId, message: string);
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
declare class WorkflowRunMismatchError extends WorkflowRunError {
|
|
15
|
+
export declare class WorkflowRunMismatchError extends WorkflowRunError {
|
|
23
16
|
readonly runId: RunId;
|
|
24
17
|
readonly expectedWorkflowName: string;
|
|
25
18
|
readonly actualWorkflowName: string;
|
|
@@ -27,68 +20,47 @@ declare class WorkflowRunMismatchError extends WorkflowRunError {
|
|
|
27
20
|
readonly runId: RunId;
|
|
28
21
|
readonly expectedWorkflowName: string;
|
|
29
22
|
readonly actualWorkflowName: string;
|
|
30
|
-
}
|
|
23
|
+
});
|
|
31
24
|
static mismatch(this: void, options: {
|
|
32
25
|
readonly runId: RunId;
|
|
33
26
|
readonly expectedWorkflowName: string;
|
|
34
27
|
readonly actualWorkflowName: string;
|
|
35
28
|
}): never;
|
|
36
|
-
static create(this: void, options: {
|
|
37
|
-
readonly runId: RunId;
|
|
38
|
-
readonly expectedWorkflowName: string;
|
|
39
|
-
readonly actualWorkflowName: string;
|
|
40
|
-
}): WorkflowRunMismatchError;
|
|
41
29
|
}
|
|
42
|
-
|
|
43
|
-
declare class WorkflowResultTimeoutError extends WorkflowRunError {
|
|
30
|
+
export declare class WorkflowResultTimeoutError extends WorkflowRunError {
|
|
44
31
|
readonly runId: RunId;
|
|
45
32
|
readonly timeout: Temporal.Duration;
|
|
46
|
-
constructor(runId: RunId, timeout: Temporal.Duration
|
|
33
|
+
constructor(runId: RunId, timeout: Temporal.Duration);
|
|
47
34
|
static timedOut(this: void, runId: RunId, timeout: Temporal.Duration): never;
|
|
48
|
-
static create(this: void, runId: RunId, timeout: Temporal.Duration): WorkflowResultTimeoutError;
|
|
49
35
|
}
|
|
50
|
-
|
|
51
|
-
declare class WorkflowRunCanceledError extends WorkflowRunError {
|
|
36
|
+
export declare class WorkflowRunCanceledError extends WorkflowRunError {
|
|
52
37
|
readonly runId: RunId;
|
|
53
|
-
constructor(runId: RunId
|
|
38
|
+
constructor(runId: RunId);
|
|
54
39
|
static canceled(this: void, runId: RunId): never;
|
|
55
|
-
static create(this: void, runId: RunId): WorkflowRunCanceledError;
|
|
56
40
|
}
|
|
57
|
-
|
|
58
|
-
declare class WorkflowRunCancellationError extends WorkflowRunError {
|
|
41
|
+
export declare class WorkflowRunCancellationError extends WorkflowRunError {
|
|
59
42
|
readonly runId: RunId;
|
|
60
|
-
readonly status:
|
|
61
|
-
constructor(runId: RunId, status:
|
|
62
|
-
static cannotCancel(this: void, runId: RunId, status:
|
|
63
|
-
static create(this: void, runId: RunId, status: WorkflowTerminalRunStatus): WorkflowRunCancellationError;
|
|
43
|
+
readonly status: TerminalRunStatus;
|
|
44
|
+
constructor(runId: RunId, status: TerminalRunStatus);
|
|
45
|
+
static cannotCancel(this: void, runId: RunId, status: TerminalRunStatus): never;
|
|
64
46
|
}
|
|
65
|
-
|
|
66
|
-
declare class WorkflowRunTransitionError extends WorkflowRunError {
|
|
47
|
+
export declare class WorkflowRunTransitionError extends WorkflowRunError {
|
|
67
48
|
readonly runId: RunId;
|
|
68
|
-
readonly from:
|
|
69
|
-
readonly to:
|
|
70
|
-
constructor(runId: RunId, from:
|
|
71
|
-
static invalidTransition(this: void, runId: RunId, from: WorkflowRunStatus, to: WorkflowRunStatus): never;
|
|
72
|
-
static create(this: void, runId: RunId, from: WorkflowRunStatus, to: WorkflowRunStatus): WorkflowRunTransitionError;
|
|
49
|
+
readonly from: RunStatus;
|
|
50
|
+
readonly to: RunStatus;
|
|
51
|
+
constructor(runId: RunId, from: RunStatus, to: RunStatus);
|
|
73
52
|
}
|
|
74
|
-
|
|
75
|
-
declare class WorkflowRunParentError extends WorkflowRunError {
|
|
53
|
+
export declare class WorkflowRunParentError extends WorkflowRunError {
|
|
76
54
|
readonly runId: RunId;
|
|
77
55
|
readonly reason: string;
|
|
78
|
-
constructor(runId: RunId, message: string
|
|
79
|
-
static invalidParent(this: void, runId: RunId, message: string): never;
|
|
80
|
-
static create(this: void, runId: RunId, message: string): WorkflowRunParentError;
|
|
56
|
+
constructor(runId: RunId, message: string);
|
|
81
57
|
}
|
|
82
|
-
|
|
83
|
-
declare class WorkflowRunDeadlineExceededError extends WorkflowRunError {
|
|
58
|
+
export declare class WorkflowRunDeadlineExceededError extends WorkflowRunError {
|
|
84
59
|
readonly runId: RunId;
|
|
85
60
|
readonly deadlineAt: Temporal.Instant;
|
|
86
|
-
constructor(runId: RunId, deadlineAt: Temporal.Instant
|
|
87
|
-
static deadlineExceeded(this: void, runId: RunId, deadlineAt: Temporal.Instant): never;
|
|
88
|
-
static create(this: void, runId: RunId, deadlineAt: Temporal.Instant): WorkflowRunDeadlineExceededError;
|
|
61
|
+
constructor(runId: RunId, deadlineAt: Temporal.Instant);
|
|
89
62
|
}
|
|
90
|
-
|
|
91
|
-
declare class WorkflowChildWorkflowTimeoutError extends WorkflowRunError {
|
|
63
|
+
export declare class WorkflowChildWorkflowTimeoutError extends WorkflowRunError {
|
|
92
64
|
readonly runId: RunId;
|
|
93
65
|
readonly childRunId: RunId;
|
|
94
66
|
readonly stepId: StepId;
|
|
@@ -98,19 +70,6 @@ declare class WorkflowChildWorkflowTimeoutError extends WorkflowRunError {
|
|
|
98
70
|
readonly childRunId: RunId;
|
|
99
71
|
readonly stepId: StepId;
|
|
100
72
|
readonly timeoutAt: Temporal.Instant;
|
|
101
|
-
}
|
|
102
|
-
static timedOut(this: void, options: {
|
|
103
|
-
readonly runId: RunId;
|
|
104
|
-
readonly childRunId: RunId;
|
|
105
|
-
readonly stepId: StepId;
|
|
106
|
-
readonly timeoutAt: Temporal.Instant;
|
|
107
|
-
}): never;
|
|
108
|
-
static create(this: void, options: {
|
|
109
|
-
readonly runId: RunId;
|
|
110
|
-
readonly childRunId: RunId;
|
|
111
|
-
readonly stepId: StepId;
|
|
112
|
-
readonly timeoutAt: Temporal.Instant;
|
|
113
|
-
}): WorkflowChildWorkflowTimeoutError;
|
|
73
|
+
});
|
|
114
74
|
}
|
|
115
|
-
//#endregion
|
|
116
|
-
export { WorkflowChildWorkflowTimeoutError, WorkflowResultTimeoutError, WorkflowRunCanceledError, WorkflowRunCancellationError, WorkflowRunDeadlineExceededError, WorkflowRunInvalidError, WorkflowRunMismatchError, WorkflowRunNotFoundError, WorkflowRunParentError, WorkflowRunTransitionError };
|
|
75
|
+
//#endregion
|
package/dist/errors/run.mjs
CHANGED
|
@@ -1,48 +1,37 @@
|
|
|
1
|
-
import { WorkflowErrorCode } from "
|
|
1
|
+
import { WorkflowErrorCode } from "./codes.mjs";
|
|
2
2
|
import { WorkflowRunError } from "./base.mjs";
|
|
3
3
|
//#region src/errors/run.ts
|
|
4
|
-
/** Error thrown for run not found failures. */
|
|
5
4
|
var WorkflowRunNotFoundError = class WorkflowRunNotFoundError extends WorkflowRunError {
|
|
6
5
|
runId;
|
|
7
|
-
constructor(runId
|
|
6
|
+
constructor(runId) {
|
|
8
7
|
super(`Workflow run not found: ${runId}`, {
|
|
9
8
|
code: WorkflowErrorCode.RUN_NOT_FOUND,
|
|
10
9
|
details: { runId }
|
|
11
|
-
}
|
|
10
|
+
});
|
|
12
11
|
this.name = "WorkflowRunNotFoundError";
|
|
13
12
|
this.runId = runId;
|
|
14
13
|
}
|
|
15
14
|
static notFound(runId) {
|
|
16
|
-
throw new WorkflowRunNotFoundError(runId
|
|
17
|
-
}
|
|
18
|
-
static create(runId) {
|
|
19
|
-
return new WorkflowRunNotFoundError(runId, WorkflowRunNotFoundError.create);
|
|
15
|
+
throw new WorkflowRunNotFoundError(runId);
|
|
20
16
|
}
|
|
21
17
|
};
|
|
22
18
|
/** Error thrown for run not found failures. */
|
|
23
|
-
var WorkflowRunInvalidError = class
|
|
19
|
+
var WorkflowRunInvalidError = class extends WorkflowRunError {
|
|
24
20
|
runId;
|
|
25
|
-
constructor(runId, message
|
|
21
|
+
constructor(runId, message) {
|
|
26
22
|
super(`Workflow run '${runId}' invalid: ${message}`, {
|
|
27
23
|
code: WorkflowErrorCode.RUN_INVALID,
|
|
28
24
|
details: { runId }
|
|
29
|
-
}
|
|
25
|
+
});
|
|
30
26
|
this.name = "WorkflowRunInvalidError";
|
|
31
27
|
this.runId = runId;
|
|
32
28
|
}
|
|
33
|
-
static invalid(runId, message) {
|
|
34
|
-
throw new WorkflowRunInvalidError(runId, message, WorkflowRunInvalidError.invalid);
|
|
35
|
-
}
|
|
36
|
-
static create(runId, message) {
|
|
37
|
-
return new WorkflowRunInvalidError(runId, message, WorkflowRunInvalidError.create);
|
|
38
|
-
}
|
|
39
29
|
};
|
|
40
|
-
/** Error thrown for run mismatch failures. */
|
|
41
30
|
var WorkflowRunMismatchError = class WorkflowRunMismatchError extends WorkflowRunError {
|
|
42
31
|
runId;
|
|
43
32
|
expectedWorkflowName;
|
|
44
33
|
actualWorkflowName;
|
|
45
|
-
constructor(options
|
|
34
|
+
constructor(options) {
|
|
46
35
|
super(`Workflow run ${options.runId} belongs to ${options.actualWorkflowName}, not ${options.expectedWorkflowName}`, {
|
|
47
36
|
code: WorkflowErrorCode.RUN_WORKFLOW_MISMATCH,
|
|
48
37
|
details: {
|
|
@@ -50,89 +39,73 @@ var WorkflowRunMismatchError = class WorkflowRunMismatchError extends WorkflowRu
|
|
|
50
39
|
expectedWorkflowName: options.expectedWorkflowName,
|
|
51
40
|
actualWorkflowName: options.actualWorkflowName
|
|
52
41
|
}
|
|
53
|
-
}
|
|
42
|
+
});
|
|
54
43
|
this.name = "WorkflowRunMismatchError";
|
|
55
44
|
this.runId = options.runId;
|
|
56
45
|
this.expectedWorkflowName = options.expectedWorkflowName;
|
|
57
46
|
this.actualWorkflowName = options.actualWorkflowName;
|
|
58
47
|
}
|
|
59
48
|
static mismatch(options) {
|
|
60
|
-
throw new WorkflowRunMismatchError(options
|
|
61
|
-
}
|
|
62
|
-
static create(options) {
|
|
63
|
-
return new WorkflowRunMismatchError(options, WorkflowRunMismatchError.create);
|
|
49
|
+
throw new WorkflowRunMismatchError(options);
|
|
64
50
|
}
|
|
65
51
|
};
|
|
66
|
-
/** Error thrown for result timeout failures. */
|
|
67
52
|
var WorkflowResultTimeoutError = class WorkflowResultTimeoutError extends WorkflowRunError {
|
|
68
53
|
runId;
|
|
69
54
|
timeout;
|
|
70
|
-
constructor(runId, timeout
|
|
55
|
+
constructor(runId, timeout) {
|
|
71
56
|
super(`Workflow result timed out after ${timeout.toString()}: ${runId}`, {
|
|
72
57
|
code: WorkflowErrorCode.RUN_RESULT_TIMEOUT,
|
|
73
58
|
details: {
|
|
74
59
|
runId,
|
|
75
60
|
timeout: timeout.toString()
|
|
76
61
|
}
|
|
77
|
-
}
|
|
62
|
+
});
|
|
78
63
|
this.name = "WorkflowResultTimeoutError";
|
|
79
64
|
this.runId = runId;
|
|
80
65
|
this.timeout = timeout;
|
|
81
66
|
}
|
|
82
67
|
static timedOut(runId, timeout) {
|
|
83
|
-
throw new WorkflowResultTimeoutError(runId, timeout
|
|
84
|
-
}
|
|
85
|
-
static create(runId, timeout) {
|
|
86
|
-
return new WorkflowResultTimeoutError(runId, timeout, WorkflowResultTimeoutError.create);
|
|
68
|
+
throw new WorkflowResultTimeoutError(runId, timeout);
|
|
87
69
|
}
|
|
88
70
|
};
|
|
89
|
-
/** Error thrown for run canceled failures. */
|
|
90
71
|
var WorkflowRunCanceledError = class WorkflowRunCanceledError extends WorkflowRunError {
|
|
91
72
|
runId;
|
|
92
|
-
constructor(runId
|
|
73
|
+
constructor(runId) {
|
|
93
74
|
super(`Workflow run was canceled: ${runId}`, {
|
|
94
75
|
code: WorkflowErrorCode.RUN_CANCELED,
|
|
95
76
|
details: { runId }
|
|
96
|
-
}
|
|
77
|
+
});
|
|
97
78
|
this.name = "WorkflowRunCanceledError";
|
|
98
79
|
this.runId = runId;
|
|
99
80
|
}
|
|
100
81
|
static canceled(runId) {
|
|
101
|
-
throw new WorkflowRunCanceledError(runId
|
|
102
|
-
}
|
|
103
|
-
static create(runId) {
|
|
104
|
-
return new WorkflowRunCanceledError(runId, WorkflowRunCanceledError.create);
|
|
82
|
+
throw new WorkflowRunCanceledError(runId);
|
|
105
83
|
}
|
|
106
84
|
};
|
|
107
|
-
/** Error thrown for run cancellation failures. */
|
|
108
85
|
var WorkflowRunCancellationError = class WorkflowRunCancellationError extends WorkflowRunError {
|
|
109
86
|
runId;
|
|
110
87
|
status;
|
|
111
|
-
constructor(runId, status
|
|
88
|
+
constructor(runId, status) {
|
|
112
89
|
super(`Cannot cancel ${status} workflow run: ${runId}`, {
|
|
113
90
|
code: WorkflowErrorCode.RUN_CANCELLATION_REJECTED,
|
|
114
91
|
details: {
|
|
115
92
|
runId,
|
|
116
93
|
status
|
|
117
94
|
}
|
|
118
|
-
}
|
|
95
|
+
});
|
|
119
96
|
this.name = "WorkflowRunCancellationError";
|
|
120
97
|
this.runId = runId;
|
|
121
98
|
this.status = status;
|
|
122
99
|
}
|
|
123
100
|
static cannotCancel(runId, status) {
|
|
124
|
-
throw new WorkflowRunCancellationError(runId, status
|
|
125
|
-
}
|
|
126
|
-
static create(runId, status) {
|
|
127
|
-
return new WorkflowRunCancellationError(runId, status, WorkflowRunCancellationError.create);
|
|
101
|
+
throw new WorkflowRunCancellationError(runId, status);
|
|
128
102
|
}
|
|
129
103
|
};
|
|
130
|
-
|
|
131
|
-
var WorkflowRunTransitionError = class WorkflowRunTransitionError extends WorkflowRunError {
|
|
104
|
+
var WorkflowRunTransitionError = class extends WorkflowRunError {
|
|
132
105
|
runId;
|
|
133
106
|
from;
|
|
134
107
|
to;
|
|
135
|
-
constructor(runId, from, to
|
|
108
|
+
constructor(runId, from, to) {
|
|
136
109
|
super(`Invalid workflow run status transition: ${runId} ${from} -> ${to}`, {
|
|
137
110
|
code: WorkflowErrorCode.RUN_TRANSITION_INVALID,
|
|
138
111
|
details: {
|
|
@@ -140,72 +113,51 @@ var WorkflowRunTransitionError = class WorkflowRunTransitionError extends Workfl
|
|
|
140
113
|
from,
|
|
141
114
|
to
|
|
142
115
|
}
|
|
143
|
-
}
|
|
116
|
+
});
|
|
144
117
|
this.name = "WorkflowRunTransitionError";
|
|
145
118
|
this.runId = runId;
|
|
146
119
|
this.from = from;
|
|
147
120
|
this.to = to;
|
|
148
121
|
}
|
|
149
|
-
static invalidTransition(runId, from, to) {
|
|
150
|
-
throw new WorkflowRunTransitionError(runId, from, to, WorkflowRunTransitionError.invalidTransition);
|
|
151
|
-
}
|
|
152
|
-
static create(runId, from, to) {
|
|
153
|
-
return new WorkflowRunTransitionError(runId, from, to, WorkflowRunTransitionError.create);
|
|
154
|
-
}
|
|
155
122
|
};
|
|
156
|
-
|
|
157
|
-
var WorkflowRunParentError = class WorkflowRunParentError extends WorkflowRunError {
|
|
123
|
+
var WorkflowRunParentError = class extends WorkflowRunError {
|
|
158
124
|
runId;
|
|
159
125
|
reason;
|
|
160
|
-
constructor(runId, message
|
|
126
|
+
constructor(runId, message) {
|
|
161
127
|
super(`Invalid workflow run parent metadata for ${runId}: ${message}`, {
|
|
162
128
|
code: WorkflowErrorCode.RUN_PARENT_INVALID,
|
|
163
129
|
details: {
|
|
164
130
|
runId,
|
|
165
131
|
reason: message
|
|
166
132
|
}
|
|
167
|
-
}
|
|
133
|
+
});
|
|
168
134
|
this.name = "WorkflowRunParentError";
|
|
169
135
|
this.runId = runId;
|
|
170
136
|
this.reason = message;
|
|
171
137
|
}
|
|
172
|
-
static invalidParent(runId, message) {
|
|
173
|
-
throw new WorkflowRunParentError(runId, message, WorkflowRunParentError.invalidParent);
|
|
174
|
-
}
|
|
175
|
-
static create(runId, message) {
|
|
176
|
-
return new WorkflowRunParentError(runId, message, WorkflowRunParentError.create);
|
|
177
|
-
}
|
|
178
138
|
};
|
|
179
|
-
|
|
180
|
-
var WorkflowRunDeadlineExceededError = class WorkflowRunDeadlineExceededError extends WorkflowRunError {
|
|
139
|
+
var WorkflowRunDeadlineExceededError = class extends WorkflowRunError {
|
|
181
140
|
runId;
|
|
182
141
|
deadlineAt;
|
|
183
|
-
constructor(runId, deadlineAt
|
|
142
|
+
constructor(runId, deadlineAt) {
|
|
184
143
|
super(`Workflow run deadline exceeded: ${runId} at ${deadlineAt.toString()}`, {
|
|
185
144
|
code: WorkflowErrorCode.RUN_DEADLINE_EXCEEDED,
|
|
186
145
|
details: {
|
|
187
146
|
runId,
|
|
188
147
|
deadlineAt: deadlineAt.toString()
|
|
189
148
|
}
|
|
190
|
-
}
|
|
149
|
+
});
|
|
191
150
|
this.name = "WorkflowRunDeadlineExceededError";
|
|
192
151
|
this.runId = runId;
|
|
193
152
|
this.deadlineAt = deadlineAt;
|
|
194
153
|
}
|
|
195
|
-
static deadlineExceeded(runId, deadlineAt) {
|
|
196
|
-
throw new WorkflowRunDeadlineExceededError(runId, deadlineAt, WorkflowRunDeadlineExceededError.deadlineExceeded);
|
|
197
|
-
}
|
|
198
|
-
static create(runId, deadlineAt) {
|
|
199
|
-
return new WorkflowRunDeadlineExceededError(runId, deadlineAt, WorkflowRunDeadlineExceededError.create);
|
|
200
|
-
}
|
|
201
154
|
};
|
|
202
|
-
|
|
203
|
-
var WorkflowChildWorkflowTimeoutError = class WorkflowChildWorkflowTimeoutError extends WorkflowRunError {
|
|
155
|
+
var WorkflowChildWorkflowTimeoutError = class extends WorkflowRunError {
|
|
204
156
|
runId;
|
|
205
157
|
childRunId;
|
|
206
158
|
stepId;
|
|
207
159
|
timeoutAt;
|
|
208
|
-
constructor(options
|
|
160
|
+
constructor(options) {
|
|
209
161
|
super(`Child workflow timed out: ${options.childRunId} for parent ${options.runId} step ${options.stepId} at ${options.timeoutAt.toString()}`, {
|
|
210
162
|
code: WorkflowErrorCode.CHILD_WORKFLOW_TIMEOUT,
|
|
211
163
|
details: {
|
|
@@ -214,19 +166,13 @@ var WorkflowChildWorkflowTimeoutError = class WorkflowChildWorkflowTimeoutError
|
|
|
214
166
|
stepId: options.stepId,
|
|
215
167
|
timeoutAt: options.timeoutAt.toString()
|
|
216
168
|
}
|
|
217
|
-
}
|
|
169
|
+
});
|
|
218
170
|
this.name = "WorkflowChildWorkflowTimeoutError";
|
|
219
171
|
this.runId = options.runId;
|
|
220
172
|
this.childRunId = options.childRunId;
|
|
221
173
|
this.stepId = options.stepId;
|
|
222
174
|
this.timeoutAt = options.timeoutAt;
|
|
223
175
|
}
|
|
224
|
-
static timedOut(options) {
|
|
225
|
-
throw new WorkflowChildWorkflowTimeoutError(options, WorkflowChildWorkflowTimeoutError.timedOut);
|
|
226
|
-
}
|
|
227
|
-
static create(options) {
|
|
228
|
-
return new WorkflowChildWorkflowTimeoutError(options, WorkflowChildWorkflowTimeoutError.create);
|
|
229
|
-
}
|
|
230
176
|
};
|
|
231
177
|
//#endregion
|
|
232
178
|
export { WorkflowChildWorkflowTimeoutError, WorkflowResultTimeoutError, WorkflowRunCanceledError, WorkflowRunCancellationError, WorkflowRunDeadlineExceededError, WorkflowRunInvalidError, WorkflowRunMismatchError, WorkflowRunNotFoundError, WorkflowRunParentError, WorkflowRunTransitionError };
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import { WorkflowErrorCode } from "
|
|
1
|
+
import { WorkflowErrorCode } from "./codes.mjs";
|
|
2
|
+
import { ErrorDetails } from "../types/error.mjs";
|
|
2
3
|
import { ScheduleId } from "../types/schedule.mjs";
|
|
3
|
-
import { WorkflowErrorDetails } from "../types/error.mjs";
|
|
4
4
|
import { WorkflowStateError } from "./base.mjs";
|
|
5
5
|
//#region src/errors/schedule.d.ts
|
|
6
6
|
/** Errors caused by invalid persisted schedule state or exhausted schedule updates. */
|
|
7
|
-
declare class WorkflowScheduleError extends WorkflowStateError {
|
|
8
|
-
constructor(message: string, code: WorkflowErrorCode, details?:
|
|
7
|
+
export declare class WorkflowScheduleError extends WorkflowStateError {
|
|
8
|
+
constructor(message: string, code: WorkflowErrorCode, details?: ErrorDetails);
|
|
9
9
|
static namespaceMismatch(this: void, actual: string, expected: string): never;
|
|
10
|
-
static recordInvalid(this: void): never;
|
|
11
|
-
static idChangeRejected(this: void): never;
|
|
12
|
-
static currentRecordInvalid(this: void): never;
|
|
13
|
-
static nextRecordInvalid(this: void): never;
|
|
14
|
-
static upsertConflictExhausted(this: void, scheduleId: ScheduleId): never;
|
|
15
|
-
static notFound(this: void, scheduleId: ScheduleId): never;
|
|
16
|
-
static updateConflictExhausted(this: void, scheduleId: ScheduleId): never;
|
|
17
10
|
}
|
|
18
11
|
/** Error thrown when creating a schedule whose id is already stored. */
|
|
19
|
-
declare class WorkflowScheduleAlreadyExistsError extends WorkflowStateError {
|
|
12
|
+
export declare class WorkflowScheduleAlreadyExistsError extends WorkflowStateError {
|
|
20
13
|
readonly scheduleId: ScheduleId;
|
|
21
|
-
constructor(scheduleId: ScheduleId
|
|
22
|
-
static alreadyExists(this: void, scheduleId: ScheduleId): never;
|
|
23
|
-
static create(this: void, scheduleId: ScheduleId): WorkflowScheduleAlreadyExistsError;
|
|
24
|
-
static isAlreadyExists(error: unknown, scheduleId?: ScheduleId): boolean;
|
|
14
|
+
constructor(scheduleId: ScheduleId);
|
|
25
15
|
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { WorkflowScheduleAlreadyExistsError, WorkflowScheduleError };
|
|
16
|
+
//#endregion
|
package/dist/errors/schedule.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { WorkflowErrorCode } from "
|
|
1
|
+
import { WorkflowErrorCode } from "./codes.mjs";
|
|
2
2
|
import { WorkflowStateError } from "./base.mjs";
|
|
3
|
-
import { workflowErrorRecordView } from "./record-view.mjs";
|
|
4
3
|
//#region src/errors/schedule.ts
|
|
5
4
|
/** Errors caused by invalid persisted schedule state or exhausted schedule updates. */
|
|
6
5
|
var WorkflowScheduleError = class WorkflowScheduleError extends WorkflowStateError {
|
|
7
|
-
constructor(message, code, details
|
|
8
|
-
super(message,
|
|
6
|
+
constructor(message, code, details) {
|
|
7
|
+
super(message, {
|
|
9
8
|
code,
|
|
10
9
|
details
|
|
11
10
|
});
|
|
@@ -15,51 +14,20 @@ var WorkflowScheduleError = class WorkflowScheduleError extends WorkflowStateErr
|
|
|
15
14
|
throw new WorkflowScheduleError(`Workflow schedule namespace mismatch: ${actual} !== ${expected}`, WorkflowErrorCode.SCHEDULE_NAMESPACE_MISMATCH, {
|
|
16
15
|
actual,
|
|
17
16
|
expected
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
static recordInvalid() {
|
|
21
|
-
throw new WorkflowScheduleError("Workflow schedule record is invalid", WorkflowErrorCode.SCHEDULE_RECORD_INVALID, void 0, WorkflowScheduleError.recordInvalid);
|
|
22
|
-
}
|
|
23
|
-
static idChangeRejected() {
|
|
24
|
-
throw new WorkflowScheduleError("Workflow schedule id cannot change", WorkflowErrorCode.SCHEDULE_ID_CHANGE_REJECTED, void 0, WorkflowScheduleError.idChangeRejected);
|
|
25
|
-
}
|
|
26
|
-
static currentRecordInvalid() {
|
|
27
|
-
throw new WorkflowScheduleError("Current workflow schedule record is invalid", WorkflowErrorCode.SCHEDULE_CURRENT_RECORD_INVALID, void 0, WorkflowScheduleError.currentRecordInvalid);
|
|
28
|
-
}
|
|
29
|
-
static nextRecordInvalid() {
|
|
30
|
-
throw new WorkflowScheduleError("Next workflow schedule record is invalid", WorkflowErrorCode.SCHEDULE_NEXT_RECORD_INVALID, void 0, WorkflowScheduleError.nextRecordInvalid);
|
|
31
|
-
}
|
|
32
|
-
static upsertConflictExhausted(scheduleId) {
|
|
33
|
-
throw new WorkflowScheduleError(`Failed to upsert workflow schedule ${scheduleId}`, WorkflowErrorCode.SCHEDULE_UPSERT_CONFLICT_EXHAUSTED, { scheduleId }, WorkflowScheduleError.upsertConflictExhausted);
|
|
34
|
-
}
|
|
35
|
-
static notFound(scheduleId) {
|
|
36
|
-
throw new WorkflowScheduleError(`Workflow schedule not found: ${scheduleId}`, WorkflowErrorCode.SCHEDULE_NOT_FOUND, { scheduleId }, WorkflowScheduleError.notFound);
|
|
37
|
-
}
|
|
38
|
-
static updateConflictExhausted(scheduleId) {
|
|
39
|
-
throw new WorkflowScheduleError(`Failed to update workflow schedule ${scheduleId}`, WorkflowErrorCode.SCHEDULE_UPDATE_CONFLICT_EXHAUSTED, { scheduleId }, WorkflowScheduleError.updateConflictExhausted);
|
|
17
|
+
});
|
|
40
18
|
}
|
|
41
19
|
};
|
|
42
20
|
/** Error thrown when creating a schedule whose id is already stored. */
|
|
43
|
-
var WorkflowScheduleAlreadyExistsError = class
|
|
21
|
+
var WorkflowScheduleAlreadyExistsError = class extends WorkflowStateError {
|
|
44
22
|
scheduleId;
|
|
45
|
-
constructor(scheduleId
|
|
46
|
-
super(`Workflow schedule already exists: ${scheduleId}`,
|
|
23
|
+
constructor(scheduleId) {
|
|
24
|
+
super(`Workflow schedule already exists: ${scheduleId}`, {
|
|
47
25
|
code: WorkflowErrorCode.SCHEDULE_ALREADY_EXISTS,
|
|
48
26
|
details: { scheduleId }
|
|
49
27
|
});
|
|
50
28
|
this.name = "WorkflowScheduleAlreadyExistsError";
|
|
51
29
|
this.scheduleId = scheduleId;
|
|
52
30
|
}
|
|
53
|
-
static alreadyExists(scheduleId) {
|
|
54
|
-
throw new WorkflowScheduleAlreadyExistsError(scheduleId, WorkflowScheduleAlreadyExistsError.alreadyExists);
|
|
55
|
-
}
|
|
56
|
-
static create(scheduleId) {
|
|
57
|
-
return new WorkflowScheduleAlreadyExistsError(scheduleId, WorkflowScheduleAlreadyExistsError.create);
|
|
58
|
-
}
|
|
59
|
-
static isAlreadyExists(error, scheduleId) {
|
|
60
|
-
const record = workflowErrorRecordView(error);
|
|
61
|
-
return record?.code === WorkflowErrorCode.SCHEDULE_ALREADY_EXISTS && (scheduleId === void 0 || record.details?.scheduleId === scheduleId);
|
|
62
|
-
}
|
|
63
31
|
};
|
|
64
32
|
//#endregion
|
|
65
33
|
export { WorkflowScheduleAlreadyExistsError, WorkflowScheduleError };
|
package/dist/errors/step.d.mts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { RunId } from "../types/
|
|
2
|
-
import {
|
|
3
|
-
import "../types/step.mjs";
|
|
4
|
-
import "../types/run.mjs";
|
|
5
|
-
import { WorkflowStepExecutionErrorOptions } from "../types/error.mjs";
|
|
1
|
+
import { RunId, StepId } from "../types/ids.mjs";
|
|
2
|
+
import { StepExecutionErrorOptions } from "../types/error.mjs";
|
|
6
3
|
import { WorkflowStepError } from "./base.mjs";
|
|
7
4
|
//#region src/errors/step.d.ts
|
|
8
|
-
|
|
9
|
-
declare class WorkflowStepTimeoutError extends WorkflowStepError {
|
|
5
|
+
export declare class WorkflowStepTimeoutError extends WorkflowStepError {
|
|
10
6
|
readonly runId: RunId;
|
|
11
7
|
readonly stepId: StepId;
|
|
12
8
|
readonly stepName: string;
|
|
@@ -18,33 +14,17 @@ declare class WorkflowStepTimeoutError extends WorkflowStepError {
|
|
|
18
14
|
readonly stepName: string;
|
|
19
15
|
readonly attempt: number;
|
|
20
16
|
readonly timeoutAt: Temporal.Instant;
|
|
21
|
-
}
|
|
22
|
-
static timedOut(this: void, options: {
|
|
23
|
-
readonly runId: RunId;
|
|
24
|
-
readonly stepId: StepId;
|
|
25
|
-
readonly stepName: string;
|
|
26
|
-
readonly attempt: number;
|
|
27
|
-
readonly timeoutAt: Temporal.Instant;
|
|
28
|
-
}): never;
|
|
29
|
-
static create(this: void, options: {
|
|
30
|
-
readonly runId: RunId;
|
|
31
|
-
readonly stepId: StepId;
|
|
32
|
-
readonly stepName: string;
|
|
33
|
-
readonly attempt: number;
|
|
34
|
-
readonly timeoutAt: Temporal.Instant;
|
|
35
|
-
}): WorkflowStepTimeoutError;
|
|
17
|
+
});
|
|
36
18
|
}
|
|
37
|
-
|
|
38
|
-
declare class WorkflowStepExecutionError extends WorkflowStepError {
|
|
19
|
+
export declare class WorkflowStepExecutionError extends WorkflowStepError {
|
|
39
20
|
readonly stepId: StepId;
|
|
40
21
|
readonly stepName: string;
|
|
41
22
|
readonly attempt: number;
|
|
42
|
-
constructor(options:
|
|
43
|
-
static failed(this: void, options:
|
|
44
|
-
static create(this: void, options: WorkflowStepExecutionErrorOptions): WorkflowStepExecutionError;
|
|
23
|
+
constructor(options: StepExecutionErrorOptions);
|
|
24
|
+
static failed(this: void, options: StepExecutionErrorOptions): never;
|
|
45
25
|
}
|
|
46
26
|
/** Error thrown when a step exhausts its retry policy. */
|
|
47
|
-
declare class WorkflowStepRetryLimitError extends WorkflowStepError {
|
|
27
|
+
export declare class WorkflowStepRetryLimitError extends WorkflowStepError {
|
|
48
28
|
readonly stepId: StepId;
|
|
49
29
|
readonly stepName: string;
|
|
50
30
|
readonly attempt: number;
|
|
@@ -52,25 +32,12 @@ declare class WorkflowStepRetryLimitError extends WorkflowStepError {
|
|
|
52
32
|
readonly stepId: StepId;
|
|
53
33
|
readonly stepName: string;
|
|
54
34
|
readonly attempt: number;
|
|
55
|
-
}
|
|
56
|
-
static exceeded(this: void, options: {
|
|
57
|
-
readonly stepId: StepId;
|
|
58
|
-
readonly stepName: string;
|
|
59
|
-
readonly attempt: number;
|
|
60
|
-
}): never;
|
|
61
|
-
static create(this: void, options: {
|
|
62
|
-
readonly stepId: StepId;
|
|
63
|
-
readonly stepName: string;
|
|
64
|
-
readonly attempt: number;
|
|
65
|
-
}): WorkflowStepRetryLimitError;
|
|
35
|
+
});
|
|
66
36
|
}
|
|
67
|
-
|
|
68
|
-
declare class WorkflowStepAttemptLimitError extends WorkflowStepError {
|
|
37
|
+
export declare class WorkflowStepAttemptLimitError extends WorkflowStepError {
|
|
69
38
|
readonly runId: RunId;
|
|
70
39
|
readonly maximumAttempts: number;
|
|
71
|
-
constructor(runId: RunId, maximumAttempts: number
|
|
40
|
+
constructor(runId: RunId, maximumAttempts: number);
|
|
72
41
|
static exceeded(this: void, runId: RunId, maximumAttempts: number): never;
|
|
73
|
-
static create(this: void, runId: RunId, maximumAttempts: number): WorkflowStepAttemptLimitError;
|
|
74
42
|
}
|
|
75
|
-
//#endregion
|
|
76
|
-
export { WorkflowStepAttemptLimitError, WorkflowStepExecutionError, WorkflowStepRetryLimitError, WorkflowStepTimeoutError };
|
|
43
|
+
//#endregion
|