@hatchet-dev/typescript-sdk 1.13.1 → 1.14.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/clients/dispatcher/dispatcher-client.d.ts +1 -1
- package/clients/dispatcher/heartbeat/heartbeat-controller.js +13 -1
- package/clients/dispatcher/heartbeat/heartbeat-worker.js +4 -3
- package/clients/event/event-client.d.ts +1 -2
- package/clients/event/event-client.js +2 -2
- package/clients/hatchet-client/client-config.d.ts +15 -5
- package/clients/hatchet-client/client-config.js +3 -0
- package/clients/hatchet-client/hatchet-logger.js +1 -0
- package/clients/hatchet-client/index.d.ts +1 -1
- package/clients/hatchet-client/index.js +1 -1
- package/clients/listeners/durable-listener/durable-listener-client.d.ts +6 -0
- package/clients/listeners/durable-listener/durable-listener-client.js +8 -0
- package/clients/listeners/durable-listener/pooled-durable-listener-client.d.ts +9 -2
- package/clients/listeners/durable-listener/pooled-durable-listener-client.js +67 -15
- package/clients/listeners/run-listener/child-listener-client.js +1 -0
- package/clients/listeners/run-listener/pooled-child-listener-client.d.ts +10 -2
- package/clients/listeners/run-listener/pooled-child-listener-client.js +63 -7
- package/clients/rest/api.js +10 -2
- package/clients/rest/generated/Api.d.ts +2 -2
- package/clients/rest/generated/data-contracts.d.ts +6 -0
- package/index.d.ts +2 -3
- package/index.js +2 -3
- package/{examples → legacy/examples}/affinity-workers.js +2 -2
- package/{examples → legacy/examples}/bulk-fanout-trigger.js +1 -1
- package/{examples → legacy/examples}/bulk-fanout-worker.js +1 -1
- package/{examples → legacy/examples}/bulk-trigger.js +1 -1
- package/{examples → legacy/examples}/byo-logger.js +1 -1
- package/{examples → legacy/examples}/concurrency/cancel-in-progress/concurrency-event.js +1 -1
- package/{examples → legacy/examples}/concurrency/cancel-in-progress/concurrency-worker.js +1 -1
- package/{examples → legacy/examples}/concurrency/group-round-robin/concurrency-event.js +1 -1
- package/{examples → legacy/examples}/concurrency/group-round-robin/concurrency-worker-expression.js +2 -2
- package/{examples → legacy/examples}/concurrency/group-round-robin/concurrency-worker-key-fn.js +2 -2
- package/{examples → legacy/examples}/crons/cron-worker.d.ts +1 -1
- package/{examples → legacy/examples}/crons/cron-worker.js +1 -1
- package/{examples → legacy/examples}/crons/programatic-crons.js +1 -1
- package/{examples → legacy/examples}/dag-worker.js +1 -1
- package/{examples → legacy/examples}/example-event-with-results.js +2 -2
- package/{examples → legacy/examples}/example-event.js +1 -1
- package/{examples → legacy/examples}/fanout-worker.js +1 -1
- package/{examples → legacy/examples}/logger.js +1 -1
- package/{examples → legacy/examples}/manual-trigger.js +1 -1
- package/{examples → legacy/examples}/multi-workflow.js +1 -1
- package/{examples → legacy/examples}/namespaced-worker.js +1 -1
- package/{examples → legacy/examples}/on-failure.js +1 -1
- package/{examples → legacy/examples}/rate-limit/events.js +1 -1
- package/{examples → legacy/examples}/rate-limit/worker.js +2 -2
- package/{examples → legacy/examples}/retries-with-backoff.js +1 -1
- package/{examples → legacy/examples}/retries-worker.js +1 -1
- package/{examples → legacy/examples}/scheduled-runs/programatic-schedules.js +1 -1
- package/{examples → legacy/examples}/simple-worker.d.ts +1 -1
- package/{examples → legacy/examples}/simple-worker.js +1 -1
- package/{examples → legacy/examples}/sticky-trigger.js +1 -1
- package/{examples → legacy/examples}/sticky-worker-with-check.js +2 -2
- package/{examples → legacy/examples}/sticky-worker.js +2 -2
- package/{examples → legacy/examples}/stream-by-additional-meta.js +2 -2
- package/legacy/legacy-client.d.ts +30 -0
- package/legacy/legacy-client.js +67 -0
- package/legacy/legacy-transformer.d.ts +38 -0
- package/legacy/legacy-transformer.js +181 -0
- package/legacy/step.d.ts +429 -0
- package/legacy/step.js +662 -0
- package/legacy/workflow.d.ts +488 -0
- package/legacy/workflow.js +72 -0
- package/package.json +2 -2
- package/step.d.ts +1 -430
- package/step.js +6 -647
- package/util/abort-error.d.ts +38 -0
- package/util/abort-error.js +58 -0
- package/util/hatchet-promise/hatchet-promise.d.ts +8 -1
- package/util/hatchet-promise/hatchet-promise.js +3 -2
- package/util/logger/index.d.ts +1 -0
- package/util/logger/index.js +1 -0
- package/util/logger/task-run-log.d.ts +3 -0
- package/util/logger/task-run-log.js +20 -0
- package/util/sleep.d.ts +5 -2
- package/util/sleep.js +27 -4
- package/util/workflow-run-ref.d.ts +7 -1
- package/util/workflow-run-ref.js +5 -3
- package/v1/client/admin.d.ts +8 -1
- package/v1/client/admin.js +22 -6
- package/v1/client/client.d.ts +36 -18
- package/v1/client/client.interface.d.ts +9 -2
- package/v1/client/client.js +47 -27
- package/v1/client/features/crons.d.ts +3 -3
- package/v1/client/features/crons.js +2 -2
- package/v1/client/features/schedules.js +2 -2
- package/v1/client/features/workflows.d.ts +5 -5
- package/v1/client/features/workflows.js +7 -8
- package/v1/client/worker/context.d.ts +49 -10
- package/v1/client/worker/context.js +92 -20
- package/v1/client/worker/deprecated/legacy-v1-worker.d.ts +3 -3
- package/v1/client/worker/deprecated/legacy-v1-worker.js +2 -2
- package/v1/client/worker/deprecated/legacy-worker.js +9 -7
- package/v1/client/worker/slot-utils.d.ts +3 -3
- package/v1/client/worker/worker-internal.d.ts +7 -16
- package/v1/client/worker/worker-internal.js +225 -209
- package/v1/client/worker/worker.d.ts +18 -18
- package/v1/client/worker/worker.js +45 -30
- package/v1/declaration.d.ts +28 -7
- package/v1/declaration.js +56 -6
- package/v1/examples/__e2e__/harness.d.ts +19 -0
- package/v1/examples/__e2e__/harness.js +70 -0
- package/v1/examples/affinity/affinity-workers.js +4 -4
- package/v1/examples/bulk_fanout/workflow.d.ts +9 -0
- package/v1/examples/bulk_fanout/workflow.js +34 -0
- package/v1/examples/bulk_operations/workflow.d.ts +3 -0
- package/v1/examples/bulk_operations/workflow.js +44 -0
- package/v1/examples/cancellation/cancellation-workflow.d.ts +2 -0
- package/v1/examples/cancellation/cancellation-workflow.js +69 -0
- package/v1/examples/cancellation/run.js +53 -0
- package/v1/examples/cancellation/worker.d.ts +1 -0
- package/v1/examples/cancellation/worker.js +29 -0
- package/v1/examples/concurrency-types.d.ts +5 -0
- package/v1/examples/concurrency-types.js +2 -0
- package/v1/examples/concurrency_cancel_in_progress/workflow.d.ts +9 -0
- package/v1/examples/concurrency_cancel_in_progress/workflow.js +45 -0
- package/v1/examples/concurrency_cancel_newest/workflow.d.ts +9 -0
- package/v1/examples/concurrency_cancel_newest/workflow.js +45 -0
- package/v1/examples/concurrency_limit_rr/load.d.ts +1 -0
- package/v1/examples/concurrency_limit_rr/load.js +54 -0
- package/v1/examples/concurrency_limit_rr/run.d.ts +1 -0
- package/v1/examples/concurrency_limit_rr/run.js +39 -0
- package/v1/examples/concurrency_limit_rr/worker.d.ts +1 -0
- package/v1/examples/concurrency_limit_rr/worker.js +24 -0
- package/v1/examples/concurrency_limit_rr/workflow.d.ts +12 -0
- package/v1/examples/concurrency_limit_rr/workflow.js +62 -0
- package/v1/examples/concurrency_multiple_keys/workflow.d.ts +12 -0
- package/v1/examples/concurrency_multiple_keys/workflow.js +42 -0
- package/v1/examples/concurrency_workflow_level/workflow.d.ts +13 -0
- package/v1/examples/concurrency_workflow_level/workflow.js +49 -0
- package/v1/examples/conditions/complex-workflow.d.ts +1 -0
- package/v1/examples/conditions/complex-workflow.js +107 -0
- package/v1/examples/conditions/event.d.ts +1 -0
- package/v1/examples/conditions/event.js +28 -0
- package/v1/examples/conditions/run.d.ts +1 -0
- package/v1/examples/conditions/run.js +25 -0
- package/v1/examples/conditions/worker.d.ts +1 -0
- package/v1/examples/conditions/worker.js +24 -0
- package/v1/examples/conditions/workflow.d.ts +11 -0
- package/v1/examples/conditions/workflow.js +41 -0
- package/v1/examples/durable/workflow.d.ts +7 -0
- package/v1/examples/durable/workflow.js +116 -0
- package/v1/examples/durable_event/event.d.ts +1 -0
- package/v1/examples/durable_event/event.js +28 -0
- package/v1/examples/durable_event/run.d.ts +1 -0
- package/v1/examples/durable_event/run.js +30 -0
- package/v1/examples/durable_event/worker.d.ts +1 -0
- package/v1/examples/durable_event/worker.js +24 -0
- package/v1/examples/durable_event/workflow.d.ts +6 -0
- package/v1/examples/durable_event/workflow.js +46 -0
- package/v1/examples/durable_sleep/event.d.ts +1 -0
- package/v1/examples/durable_sleep/event.js +28 -0
- package/v1/examples/durable_sleep/run.d.ts +1 -0
- package/v1/examples/durable_sleep/run.js +30 -0
- package/v1/examples/durable_sleep/worker.d.ts +1 -0
- package/v1/examples/durable_sleep/worker.js +24 -0
- package/v1/examples/durable_sleep/workflow.d.ts +1 -0
- package/v1/examples/durable_sleep/workflow.js +31 -0
- package/v1/examples/e2e-worker.d.ts +1 -0
- package/v1/examples/e2e-worker.js +82 -0
- package/v1/examples/events/event.d.ts +1 -0
- package/v1/examples/events/event.js +53 -0
- package/v1/examples/events/filter.d.ts +1 -0
- package/v1/examples/events/filter.js +32 -0
- package/v1/examples/events/worker.d.ts +1 -0
- package/v1/examples/events/worker.js +24 -0
- package/v1/examples/events/workflow.d.ts +19 -0
- package/v1/examples/events/workflow.js +60 -0
- package/v1/examples/high-memory/workflow-with-child.js +1 -1
- package/v1/examples/logger/byo-logger.d.ts +1 -0
- package/v1/examples/logger/byo-logger.js +73 -0
- package/v1/examples/logger/logger.d.ts +1 -0
- package/v1/examples/logger/logger.js +46 -0
- package/v1/examples/logger/workflow.d.ts +2 -0
- package/v1/examples/logger/workflow.js +38 -0
- package/v1/examples/multiple_wf_concurrency/workflow.js +3 -3
- package/v1/examples/on_failure/workflow.d.ts +1 -0
- package/v1/examples/on_failure/workflow.js +12 -7
- package/v1/examples/priority/workflow.js +1 -1
- package/v1/examples/retries/workflow.js +2 -2
- package/v1/examples/return_exceptions/workflow.d.ts +6 -0
- package/v1/examples/return_exceptions/workflow.js +22 -0
- package/v1/examples/run_details/workflow.d.ts +4 -0
- package/v1/examples/run_details/workflow.js +65 -0
- package/v1/examples/simple/e2e-workflows.d.ts +14 -0
- package/v1/examples/simple/e2e-workflows.js +27 -0
- package/v1/examples/simple/enqueue.js +2 -2
- package/v1/examples/sticky/workflow.js +2 -2
- package/v1/examples/timeout/run.d.ts +1 -0
- package/v1/examples/timeout/run.js +30 -0
- package/v1/examples/timeout/worker.d.ts +1 -0
- package/v1/examples/timeout/worker.js +25 -0
- package/v1/examples/timeout/workflow.d.ts +10 -0
- package/v1/examples/timeout/workflow.js +56 -0
- package/v1/examples/webhooks/workflow.d.ts +5 -0
- package/v1/examples/webhooks/workflow.js +23 -0
- package/v1/index.d.ts +1 -0
- package/v1/index.js +1 -0
- package/v1/parent-run-context-vars.d.ts +6 -0
- package/v1/parent-run-context-vars.js +3 -0
- package/v1/task.d.ts +22 -7
- package/v1/task.js +4 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/workflow.d.ts +3 -491
- package/workflow.js +12 -62
- package/clients/hatchet-client/hatchet-client.d.ts +0 -35
- package/clients/hatchet-client/hatchet-client.js +0 -108
- 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/index.js +0 -17
- package/clients/worker/worker.d.ts +0 -59
- package/clients/worker/worker.js +0 -568
- package/examples/webhooks.js +0 -45
- /package/{examples → legacy/examples}/affinity-workers.d.ts +0 -0
- /package/{examples → legacy/examples}/bulk-fanout-trigger.d.ts +0 -0
- /package/{examples → legacy/examples}/bulk-fanout-worker.d.ts +0 -0
- /package/{examples → legacy/examples}/bulk-trigger.d.ts +0 -0
- /package/{examples → legacy/examples}/byo-logger.d.ts +0 -0
- /package/{examples → legacy/examples}/concurrency/cancel-in-progress/concurrency-event.d.ts +0 -0
- /package/{examples → legacy/examples}/concurrency/cancel-in-progress/concurrency-worker.d.ts +0 -0
- /package/{examples → legacy/examples}/concurrency/group-round-robin/concurrency-event.d.ts +0 -0
- /package/{examples → legacy/examples}/concurrency/group-round-robin/concurrency-worker-expression.d.ts +0 -0
- /package/{examples → legacy/examples}/concurrency/group-round-robin/concurrency-worker-key-fn.d.ts +0 -0
- /package/{examples → legacy/examples}/crons/programatic-crons.d.ts +0 -0
- /package/{examples → legacy/examples}/dag-worker.d.ts +0 -0
- /package/{examples → legacy/examples}/example-event-with-results.d.ts +0 -0
- /package/{examples → legacy/examples}/example-event.d.ts +0 -0
- /package/{examples → legacy/examples}/fanout-worker.d.ts +0 -0
- /package/{examples → legacy/examples}/logger.d.ts +0 -0
- /package/{examples → legacy/examples}/manual-trigger.d.ts +0 -0
- /package/{examples → legacy/examples}/multi-workflow.d.ts +0 -0
- /package/{examples → legacy/examples}/namespaced-worker.d.ts +0 -0
- /package/{examples → legacy/examples}/on-failure.d.ts +0 -0
- /package/{examples → legacy/examples}/rate-limit/events.d.ts +0 -0
- /package/{examples → legacy/examples}/rate-limit/worker.d.ts +0 -0
- /package/{examples → legacy/examples}/retries-with-backoff.d.ts +0 -0
- /package/{examples → legacy/examples}/retries-worker.d.ts +0 -0
- /package/{examples → legacy/examples}/scheduled-runs/programatic-schedules.d.ts +0 -0
- /package/{examples → legacy/examples}/sticky-trigger.d.ts +0 -0
- /package/{examples → legacy/examples}/sticky-worker-with-check.d.ts +0 -0
- /package/{examples → legacy/examples}/sticky-worker.d.ts +0 -0
- /package/{examples → legacy/examples}/stream-by-additional-meta.d.ts +0 -0
- /package/{examples/webhooks.d.ts → v1/examples/cancellation/run.d.ts} +0 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { CreateStep } from '../step';
|
|
3
|
+
import { ConcurrencyLimitStrategy as PbConcurrencyLimitStrategy, StickyStrategy as PbStickyStrategy } from '../protoc/workflows';
|
|
4
|
+
declare const StepsSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
parents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
timeout: z.ZodOptional<z.ZodString>;
|
|
8
|
+
retries: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
rate_limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
+
key: z.ZodOptional<z.ZodString>;
|
|
11
|
+
staticKey: z.ZodOptional<z.ZodString>;
|
|
12
|
+
dynamicKey: z.ZodOptional<z.ZodString>;
|
|
13
|
+
units: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
14
|
+
limit: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
15
|
+
duration: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").RateLimitDuration>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
units: string | number;
|
|
18
|
+
key?: string | undefined;
|
|
19
|
+
staticKey?: string | undefined;
|
|
20
|
+
dynamicKey?: string | undefined;
|
|
21
|
+
limit?: string | number | undefined;
|
|
22
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
units: string | number;
|
|
25
|
+
key?: string | undefined;
|
|
26
|
+
staticKey?: string | undefined;
|
|
27
|
+
dynamicKey?: string | undefined;
|
|
28
|
+
limit?: string | number | undefined;
|
|
29
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
30
|
+
}>, "many">>;
|
|
31
|
+
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
32
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
33
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").WorkerLabelComparator>>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
value: string | number;
|
|
38
|
+
required?: boolean | undefined;
|
|
39
|
+
weight?: number | undefined;
|
|
40
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
value: string | number;
|
|
43
|
+
required?: boolean | undefined;
|
|
44
|
+
weight?: number | undefined;
|
|
45
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
46
|
+
}>]>>>>>;
|
|
47
|
+
backoff: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
maxSeconds: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
factor?: number | undefined;
|
|
52
|
+
maxSeconds?: number | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
factor?: number | undefined;
|
|
55
|
+
maxSeconds?: number | undefined;
|
|
56
|
+
}>>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
name: string;
|
|
59
|
+
timeout?: string | undefined;
|
|
60
|
+
parents?: string[] | undefined;
|
|
61
|
+
retries?: number | undefined;
|
|
62
|
+
rate_limits?: {
|
|
63
|
+
units: string | number;
|
|
64
|
+
key?: string | undefined;
|
|
65
|
+
staticKey?: string | undefined;
|
|
66
|
+
dynamicKey?: string | undefined;
|
|
67
|
+
limit?: string | number | undefined;
|
|
68
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
69
|
+
}[] | undefined;
|
|
70
|
+
worker_labels?: Record<string, string | number | {
|
|
71
|
+
value: string | number;
|
|
72
|
+
required?: boolean | undefined;
|
|
73
|
+
weight?: number | undefined;
|
|
74
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
75
|
+
} | undefined> | undefined;
|
|
76
|
+
backoff?: {
|
|
77
|
+
factor?: number | undefined;
|
|
78
|
+
maxSeconds?: number | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
name: string;
|
|
82
|
+
timeout?: string | undefined;
|
|
83
|
+
parents?: string[] | undefined;
|
|
84
|
+
retries?: number | undefined;
|
|
85
|
+
rate_limits?: {
|
|
86
|
+
units: string | number;
|
|
87
|
+
key?: string | undefined;
|
|
88
|
+
staticKey?: string | undefined;
|
|
89
|
+
dynamicKey?: string | undefined;
|
|
90
|
+
limit?: string | number | undefined;
|
|
91
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
92
|
+
}[] | undefined;
|
|
93
|
+
worker_labels?: Record<string, string | number | {
|
|
94
|
+
value: string | number;
|
|
95
|
+
required?: boolean | undefined;
|
|
96
|
+
weight?: number | undefined;
|
|
97
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
98
|
+
} | undefined> | undefined;
|
|
99
|
+
backoff?: {
|
|
100
|
+
factor?: number | undefined;
|
|
101
|
+
maxSeconds?: number | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
}>, "many">;
|
|
104
|
+
export type Steps = z.infer<typeof StepsSchema>;
|
|
105
|
+
export declare const ConcurrencyLimitStrategy: typeof PbConcurrencyLimitStrategy;
|
|
106
|
+
export declare const WorkflowConcurrency: z.ZodObject<{
|
|
107
|
+
name: z.ZodString;
|
|
108
|
+
maxRuns: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
limitStrategy: z.ZodOptional<z.ZodNativeEnum<typeof PbConcurrencyLimitStrategy>>;
|
|
110
|
+
expression: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
name: string;
|
|
113
|
+
maxRuns?: number | undefined;
|
|
114
|
+
limitStrategy?: PbConcurrencyLimitStrategy | undefined;
|
|
115
|
+
expression?: string | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
name: string;
|
|
118
|
+
maxRuns?: number | undefined;
|
|
119
|
+
limitStrategy?: PbConcurrencyLimitStrategy | undefined;
|
|
120
|
+
expression?: string | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const HatchetTimeoutSchema: z.ZodString;
|
|
123
|
+
export declare const StickyStrategy: typeof PbStickyStrategy;
|
|
124
|
+
export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
description: z.ZodString;
|
|
127
|
+
version: z.ZodOptional<z.ZodString>;
|
|
128
|
+
sticky: z.ZodOptional<z.ZodUnion<[z.ZodNativeEnum<typeof PbStickyStrategy>, z.ZodEnum<["soft", "hard"]>]>>;
|
|
129
|
+
scheduleTimeout: z.ZodOptional<z.ZodString>;
|
|
130
|
+
/**
|
|
131
|
+
* @deprecated Workflow timeout is deprecated. Use step timeouts instead.
|
|
132
|
+
*/
|
|
133
|
+
timeout: z.ZodOptional<z.ZodString>;
|
|
134
|
+
on: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
135
|
+
cron: z.ZodString;
|
|
136
|
+
event: z.ZodUndefined;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
cron: string;
|
|
139
|
+
event?: undefined;
|
|
140
|
+
}, {
|
|
141
|
+
cron: string;
|
|
142
|
+
event?: undefined;
|
|
143
|
+
}>, z.ZodObject<{
|
|
144
|
+
cron: z.ZodUndefined;
|
|
145
|
+
event: z.ZodString;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
event: string;
|
|
148
|
+
cron?: undefined;
|
|
149
|
+
}, {
|
|
150
|
+
event: string;
|
|
151
|
+
cron?: undefined;
|
|
152
|
+
}>]>>;
|
|
153
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
parents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
156
|
+
timeout: z.ZodOptional<z.ZodString>;
|
|
157
|
+
retries: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
rate_limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
159
|
+
key: z.ZodOptional<z.ZodString>;
|
|
160
|
+
staticKey: z.ZodOptional<z.ZodString>;
|
|
161
|
+
dynamicKey: z.ZodOptional<z.ZodString>;
|
|
162
|
+
units: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
163
|
+
limit: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
164
|
+
duration: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").RateLimitDuration>>;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
units: string | number;
|
|
167
|
+
key?: string | undefined;
|
|
168
|
+
staticKey?: string | undefined;
|
|
169
|
+
dynamicKey?: string | undefined;
|
|
170
|
+
limit?: string | number | undefined;
|
|
171
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
172
|
+
}, {
|
|
173
|
+
units: string | number;
|
|
174
|
+
key?: string | undefined;
|
|
175
|
+
staticKey?: string | undefined;
|
|
176
|
+
dynamicKey?: string | undefined;
|
|
177
|
+
limit?: string | number | undefined;
|
|
178
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
179
|
+
}>, "many">>;
|
|
180
|
+
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
181
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
182
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").WorkerLabelComparator>>;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
value: string | number;
|
|
187
|
+
required?: boolean | undefined;
|
|
188
|
+
weight?: number | undefined;
|
|
189
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
190
|
+
}, {
|
|
191
|
+
value: string | number;
|
|
192
|
+
required?: boolean | undefined;
|
|
193
|
+
weight?: number | undefined;
|
|
194
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
195
|
+
}>]>>>>>;
|
|
196
|
+
backoff: z.ZodOptional<z.ZodObject<{
|
|
197
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
maxSeconds: z.ZodOptional<z.ZodNumber>;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
factor?: number | undefined;
|
|
201
|
+
maxSeconds?: number | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
factor?: number | undefined;
|
|
204
|
+
maxSeconds?: number | undefined;
|
|
205
|
+
}>>;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
name: string;
|
|
208
|
+
timeout?: string | undefined;
|
|
209
|
+
parents?: string[] | undefined;
|
|
210
|
+
retries?: number | undefined;
|
|
211
|
+
rate_limits?: {
|
|
212
|
+
units: string | number;
|
|
213
|
+
key?: string | undefined;
|
|
214
|
+
staticKey?: string | undefined;
|
|
215
|
+
dynamicKey?: string | undefined;
|
|
216
|
+
limit?: string | number | undefined;
|
|
217
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
218
|
+
}[] | undefined;
|
|
219
|
+
worker_labels?: Record<string, string | number | {
|
|
220
|
+
value: string | number;
|
|
221
|
+
required?: boolean | undefined;
|
|
222
|
+
weight?: number | undefined;
|
|
223
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
224
|
+
} | undefined> | undefined;
|
|
225
|
+
backoff?: {
|
|
226
|
+
factor?: number | undefined;
|
|
227
|
+
maxSeconds?: number | undefined;
|
|
228
|
+
} | undefined;
|
|
229
|
+
}, {
|
|
230
|
+
name: string;
|
|
231
|
+
timeout?: string | undefined;
|
|
232
|
+
parents?: string[] | undefined;
|
|
233
|
+
retries?: number | undefined;
|
|
234
|
+
rate_limits?: {
|
|
235
|
+
units: string | number;
|
|
236
|
+
key?: string | undefined;
|
|
237
|
+
staticKey?: string | undefined;
|
|
238
|
+
dynamicKey?: string | undefined;
|
|
239
|
+
limit?: string | number | undefined;
|
|
240
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
241
|
+
}[] | undefined;
|
|
242
|
+
worker_labels?: Record<string, string | number | {
|
|
243
|
+
value: string | number;
|
|
244
|
+
required?: boolean | undefined;
|
|
245
|
+
weight?: number | undefined;
|
|
246
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
247
|
+
} | undefined> | undefined;
|
|
248
|
+
backoff?: {
|
|
249
|
+
factor?: number | undefined;
|
|
250
|
+
maxSeconds?: number | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
}>, "many">;
|
|
253
|
+
onFailure: z.ZodOptional<z.ZodObject<{
|
|
254
|
+
name: z.ZodString;
|
|
255
|
+
parents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
256
|
+
timeout: z.ZodOptional<z.ZodString>;
|
|
257
|
+
retries: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
rate_limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
259
|
+
key: z.ZodOptional<z.ZodString>;
|
|
260
|
+
staticKey: z.ZodOptional<z.ZodString>;
|
|
261
|
+
dynamicKey: z.ZodOptional<z.ZodString>;
|
|
262
|
+
units: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
263
|
+
limit: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
264
|
+
duration: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").RateLimitDuration>>;
|
|
265
|
+
}, "strip", z.ZodTypeAny, {
|
|
266
|
+
units: string | number;
|
|
267
|
+
key?: string | undefined;
|
|
268
|
+
staticKey?: string | undefined;
|
|
269
|
+
dynamicKey?: string | undefined;
|
|
270
|
+
limit?: string | number | undefined;
|
|
271
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
272
|
+
}, {
|
|
273
|
+
units: string | number;
|
|
274
|
+
key?: string | undefined;
|
|
275
|
+
staticKey?: string | undefined;
|
|
276
|
+
dynamicKey?: string | undefined;
|
|
277
|
+
limit?: string | number | undefined;
|
|
278
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
279
|
+
}>, "many">>;
|
|
280
|
+
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
281
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
282
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
283
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").WorkerLabelComparator>>;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
value: string | number;
|
|
287
|
+
required?: boolean | undefined;
|
|
288
|
+
weight?: number | undefined;
|
|
289
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
value: string | number;
|
|
292
|
+
required?: boolean | undefined;
|
|
293
|
+
weight?: number | undefined;
|
|
294
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
295
|
+
}>]>>>>>;
|
|
296
|
+
backoff: z.ZodOptional<z.ZodObject<{
|
|
297
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
maxSeconds: z.ZodOptional<z.ZodNumber>;
|
|
299
|
+
}, "strip", z.ZodTypeAny, {
|
|
300
|
+
factor?: number | undefined;
|
|
301
|
+
maxSeconds?: number | undefined;
|
|
302
|
+
}, {
|
|
303
|
+
factor?: number | undefined;
|
|
304
|
+
maxSeconds?: number | undefined;
|
|
305
|
+
}>>;
|
|
306
|
+
}, "strip", z.ZodTypeAny, {
|
|
307
|
+
name: string;
|
|
308
|
+
timeout?: string | undefined;
|
|
309
|
+
parents?: string[] | undefined;
|
|
310
|
+
retries?: number | undefined;
|
|
311
|
+
rate_limits?: {
|
|
312
|
+
units: string | number;
|
|
313
|
+
key?: string | undefined;
|
|
314
|
+
staticKey?: string | undefined;
|
|
315
|
+
dynamicKey?: string | undefined;
|
|
316
|
+
limit?: string | number | undefined;
|
|
317
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
318
|
+
}[] | undefined;
|
|
319
|
+
worker_labels?: Record<string, string | number | {
|
|
320
|
+
value: string | number;
|
|
321
|
+
required?: boolean | undefined;
|
|
322
|
+
weight?: number | undefined;
|
|
323
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
324
|
+
} | undefined> | undefined;
|
|
325
|
+
backoff?: {
|
|
326
|
+
factor?: number | undefined;
|
|
327
|
+
maxSeconds?: number | undefined;
|
|
328
|
+
} | undefined;
|
|
329
|
+
}, {
|
|
330
|
+
name: string;
|
|
331
|
+
timeout?: string | undefined;
|
|
332
|
+
parents?: string[] | undefined;
|
|
333
|
+
retries?: number | undefined;
|
|
334
|
+
rate_limits?: {
|
|
335
|
+
units: string | number;
|
|
336
|
+
key?: string | undefined;
|
|
337
|
+
staticKey?: string | undefined;
|
|
338
|
+
dynamicKey?: string | undefined;
|
|
339
|
+
limit?: string | number | undefined;
|
|
340
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
341
|
+
}[] | undefined;
|
|
342
|
+
worker_labels?: Record<string, string | number | {
|
|
343
|
+
value: string | number;
|
|
344
|
+
required?: boolean | undefined;
|
|
345
|
+
weight?: number | undefined;
|
|
346
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
347
|
+
} | undefined> | undefined;
|
|
348
|
+
backoff?: {
|
|
349
|
+
factor?: number | undefined;
|
|
350
|
+
maxSeconds?: number | undefined;
|
|
351
|
+
} | undefined;
|
|
352
|
+
}>>;
|
|
353
|
+
}, "strip", z.ZodTypeAny, {
|
|
354
|
+
id: string;
|
|
355
|
+
description: string;
|
|
356
|
+
steps: {
|
|
357
|
+
name: string;
|
|
358
|
+
timeout?: string | undefined;
|
|
359
|
+
parents?: string[] | undefined;
|
|
360
|
+
retries?: number | undefined;
|
|
361
|
+
rate_limits?: {
|
|
362
|
+
units: string | number;
|
|
363
|
+
key?: string | undefined;
|
|
364
|
+
staticKey?: string | undefined;
|
|
365
|
+
dynamicKey?: string | undefined;
|
|
366
|
+
limit?: string | number | undefined;
|
|
367
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
368
|
+
}[] | undefined;
|
|
369
|
+
worker_labels?: Record<string, string | number | {
|
|
370
|
+
value: string | number;
|
|
371
|
+
required?: boolean | undefined;
|
|
372
|
+
weight?: number | undefined;
|
|
373
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
374
|
+
} | undefined> | undefined;
|
|
375
|
+
backoff?: {
|
|
376
|
+
factor?: number | undefined;
|
|
377
|
+
maxSeconds?: number | undefined;
|
|
378
|
+
} | undefined;
|
|
379
|
+
}[];
|
|
380
|
+
version?: string | undefined;
|
|
381
|
+
timeout?: string | undefined;
|
|
382
|
+
sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
|
|
383
|
+
scheduleTimeout?: string | undefined;
|
|
384
|
+
on?: {
|
|
385
|
+
cron: string;
|
|
386
|
+
event?: undefined;
|
|
387
|
+
} | {
|
|
388
|
+
event: string;
|
|
389
|
+
cron?: undefined;
|
|
390
|
+
} | undefined;
|
|
391
|
+
onFailure?: {
|
|
392
|
+
name: string;
|
|
393
|
+
timeout?: string | undefined;
|
|
394
|
+
parents?: string[] | undefined;
|
|
395
|
+
retries?: number | undefined;
|
|
396
|
+
rate_limits?: {
|
|
397
|
+
units: string | number;
|
|
398
|
+
key?: string | undefined;
|
|
399
|
+
staticKey?: string | undefined;
|
|
400
|
+
dynamicKey?: string | undefined;
|
|
401
|
+
limit?: string | number | undefined;
|
|
402
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
403
|
+
}[] | undefined;
|
|
404
|
+
worker_labels?: Record<string, string | number | {
|
|
405
|
+
value: string | number;
|
|
406
|
+
required?: boolean | undefined;
|
|
407
|
+
weight?: number | undefined;
|
|
408
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
409
|
+
} | undefined> | undefined;
|
|
410
|
+
backoff?: {
|
|
411
|
+
factor?: number | undefined;
|
|
412
|
+
maxSeconds?: number | undefined;
|
|
413
|
+
} | undefined;
|
|
414
|
+
} | undefined;
|
|
415
|
+
}, {
|
|
416
|
+
id: string;
|
|
417
|
+
description: string;
|
|
418
|
+
steps: {
|
|
419
|
+
name: string;
|
|
420
|
+
timeout?: string | undefined;
|
|
421
|
+
parents?: string[] | undefined;
|
|
422
|
+
retries?: number | undefined;
|
|
423
|
+
rate_limits?: {
|
|
424
|
+
units: string | number;
|
|
425
|
+
key?: string | undefined;
|
|
426
|
+
staticKey?: string | undefined;
|
|
427
|
+
dynamicKey?: string | undefined;
|
|
428
|
+
limit?: string | number | undefined;
|
|
429
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
430
|
+
}[] | undefined;
|
|
431
|
+
worker_labels?: Record<string, string | number | {
|
|
432
|
+
value: string | number;
|
|
433
|
+
required?: boolean | undefined;
|
|
434
|
+
weight?: number | undefined;
|
|
435
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
436
|
+
} | undefined> | undefined;
|
|
437
|
+
backoff?: {
|
|
438
|
+
factor?: number | undefined;
|
|
439
|
+
maxSeconds?: number | undefined;
|
|
440
|
+
} | undefined;
|
|
441
|
+
}[];
|
|
442
|
+
version?: string | undefined;
|
|
443
|
+
timeout?: string | undefined;
|
|
444
|
+
sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
|
|
445
|
+
scheduleTimeout?: string | undefined;
|
|
446
|
+
on?: {
|
|
447
|
+
cron: string;
|
|
448
|
+
event?: undefined;
|
|
449
|
+
} | {
|
|
450
|
+
event: string;
|
|
451
|
+
cron?: undefined;
|
|
452
|
+
} | undefined;
|
|
453
|
+
onFailure?: {
|
|
454
|
+
name: string;
|
|
455
|
+
timeout?: string | undefined;
|
|
456
|
+
parents?: string[] | undefined;
|
|
457
|
+
retries?: number | undefined;
|
|
458
|
+
rate_limits?: {
|
|
459
|
+
units: string | number;
|
|
460
|
+
key?: string | undefined;
|
|
461
|
+
staticKey?: string | undefined;
|
|
462
|
+
dynamicKey?: string | undefined;
|
|
463
|
+
limit?: string | number | undefined;
|
|
464
|
+
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
465
|
+
}[] | undefined;
|
|
466
|
+
worker_labels?: Record<string, string | number | {
|
|
467
|
+
value: string | number;
|
|
468
|
+
required?: boolean | undefined;
|
|
469
|
+
weight?: number | undefined;
|
|
470
|
+
comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
|
|
471
|
+
} | undefined> | undefined;
|
|
472
|
+
backoff?: {
|
|
473
|
+
factor?: number | undefined;
|
|
474
|
+
maxSeconds?: number | undefined;
|
|
475
|
+
} | undefined;
|
|
476
|
+
} | undefined;
|
|
477
|
+
}>;
|
|
478
|
+
/**
|
|
479
|
+
* @deprecated Use client.workflow instead (TODO link to migration doc)
|
|
480
|
+
*/
|
|
481
|
+
export interface Workflow extends z.infer<typeof CreateWorkflowSchema> {
|
|
482
|
+
concurrency?: z.infer<typeof WorkflowConcurrency> & {
|
|
483
|
+
key?: (ctx: any) => string;
|
|
484
|
+
};
|
|
485
|
+
steps: CreateStep<any, any>[];
|
|
486
|
+
onFailure?: CreateStep<any, any>;
|
|
487
|
+
}
|
|
488
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CreateWorkflowSchema = exports.StickyStrategy = exports.HatchetTimeoutSchema = exports.WorkflowConcurrency = exports.ConcurrencyLimitStrategy = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const step_1 = require("../step");
|
|
39
|
+
const workflows_1 = require("../protoc/workflows");
|
|
40
|
+
const CronConfigSchema = z.object({
|
|
41
|
+
cron: z.string(),
|
|
42
|
+
event: z.undefined(),
|
|
43
|
+
});
|
|
44
|
+
const EventConfigSchema = z.object({
|
|
45
|
+
cron: z.undefined(),
|
|
46
|
+
event: z.string(),
|
|
47
|
+
});
|
|
48
|
+
const OnConfigSchema = z.union([CronConfigSchema, EventConfigSchema]).optional();
|
|
49
|
+
const StepsSchema = z.array(step_1.CreateStepSchema);
|
|
50
|
+
exports.ConcurrencyLimitStrategy = workflows_1.ConcurrencyLimitStrategy;
|
|
51
|
+
exports.WorkflowConcurrency = z.object({
|
|
52
|
+
name: z.string(),
|
|
53
|
+
maxRuns: z.number().optional(),
|
|
54
|
+
limitStrategy: z.nativeEnum(exports.ConcurrencyLimitStrategy).optional(),
|
|
55
|
+
expression: z.string().optional(),
|
|
56
|
+
});
|
|
57
|
+
exports.HatchetTimeoutSchema = z.string();
|
|
58
|
+
exports.StickyStrategy = workflows_1.StickyStrategy;
|
|
59
|
+
exports.CreateWorkflowSchema = z.object({
|
|
60
|
+
id: z.string(),
|
|
61
|
+
description: z.string(),
|
|
62
|
+
version: z.string().optional(),
|
|
63
|
+
sticky: z.union([z.nativeEnum(workflows_1.StickyStrategy), z.enum(['soft', 'hard'])]).optional(),
|
|
64
|
+
scheduleTimeout: z.string().optional(),
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Workflow timeout is deprecated. Use step timeouts instead.
|
|
67
|
+
*/
|
|
68
|
+
timeout: exports.HatchetTimeoutSchema.optional(),
|
|
69
|
+
on: OnConfigSchema,
|
|
70
|
+
steps: StepsSchema,
|
|
71
|
+
onFailure: step_1.CreateStepSchema === null || step_1.CreateStepSchema === void 0 ? void 0 : step_1.CreateStepSchema.optional(),
|
|
72
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dump-version": "node -e \"console.log('export const HATCHET_VERSION = \\'' + require('./package.json').version + '\\';');\" > src/version.ts",
|
|
78
78
|
"tsc:build": "pnpm run dump-version && tsc && resolve-tspaths",
|
|
79
79
|
"test:unit": "jest --testMatch='**/*.test.ts'",
|
|
80
|
-
"test:e2e": "jest --
|
|
80
|
+
"test:e2e": "jest --config jest.e2e.config.ts --silent --forceExit --runInBand",
|
|
81
81
|
"test:unit:watch": "jest --testMatch='**/*.test.ts' --watch",
|
|
82
82
|
"generate": "pnpm run '/generate-.*/'",
|
|
83
83
|
"generate-api": "npx swagger-typescript-api@13.2.7 generate -p ../../bin/oas/openapi.yaml -o ./src/clients/rest/generated -n hatchet.ts --modular --axios",
|