@hatchet-dev/typescript-sdk 1.15.2 → 1.17.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/README.md +14 -2
- package/clients/admin/admin-client.d.ts +2 -2
- package/clients/admin/admin-client.js +8 -9
- package/clients/dispatcher/action-listener.d.ts +3 -6
- package/clients/dispatcher/action-listener.js +54 -23
- package/clients/dispatcher/dispatcher-client.js +5 -8
- package/clients/dispatcher/heartbeat/heartbeat-worker.js +7 -4
- package/clients/event/event-client.d.ts +2 -2
- package/clients/event/event-client.js +5 -11
- package/clients/hatchet-client/hatchet-logger.js +8 -17
- package/clients/listeners/durable-listener/durable-listener-client.d.ts +115 -15
- package/clients/listeners/durable-listener/durable-listener-client.js +769 -19
- package/clients/listeners/durable-listener/pooled-durable-listener-client.js +11 -22
- package/clients/listeners/run-listener/child-listener-client.d.ts +1 -1
- package/clients/listeners/run-listener/child-listener-client.js +34 -30
- package/clients/listeners/run-listener/pooled-child-listener-client.js +9 -19
- package/clients/rest/generated/Api.d.ts +25 -1
- package/clients/rest/generated/Api.js +20 -0
- package/clients/rest/generated/data-contracts.d.ts +60 -1
- package/clients/rest/generated/data-contracts.js +9 -1
- package/legacy/examples/affinity-workers.js +2 -3
- package/legacy/examples/byo-logger.js +0 -2
- package/legacy/examples/concurrency/cancel-in-progress/concurrency-worker.js +4 -2
- package/legacy/examples/concurrency/group-round-robin/concurrency-event.js +0 -1
- package/legacy/examples/concurrency/group-round-robin/concurrency-worker-expression.js +4 -2
- package/legacy/examples/concurrency/group-round-robin/concurrency-worker-key-fn.js +4 -2
- package/legacy/examples/example-event.js +0 -3
- package/legacy/examples/logger.js +0 -1
- package/legacy/examples/sticky-worker-with-check.js +0 -1
- package/legacy/examples/sticky-worker.js +0 -1
- package/legacy/legacy-client.js +2 -2
- package/legacy/legacy-transformer.js +2 -4
- package/legacy/step.d.ts +16 -16
- package/legacy/step.js +8 -17
- package/legacy/workflow.d.ts +81 -81
- package/package.json +20 -29
- package/protoc/dispatcher/dispatcher.d.ts +20 -0
- package/protoc/dispatcher/dispatcher.js +136 -2
- package/protoc/v1/dispatcher.d.ts +168 -0
- package/protoc/v1/dispatcher.js +1920 -1
- package/protoc/v1/shared/trigger.d.ts +89 -0
- package/protoc/v1/shared/trigger.js +493 -0
- package/protoc/v1/workflows.d.ts +34 -34
- package/protoc/v1/workflows.js +252 -200
- package/protoc/workflows/workflows.d.ts +2 -75
- package/protoc/workflows/workflows.js +16 -491
- package/util/abort-error.d.ts +15 -1
- package/util/abort-error.js +30 -5
- package/util/config-loader/config-loader.js +4 -3
- package/util/config-loader/token.js +9 -2
- package/util/errors/eviction-not-supported-error.d.ts +5 -0
- package/util/errors/eviction-not-supported-error.js +18 -0
- package/util/errors/hatchet-error.d.ts +9 -1
- package/util/errors/hatchet-error.js +23 -2
- package/util/errors/non-determinism-error.d.ts +7 -0
- package/util/errors/non-determinism-error.js +21 -0
- package/util/errors/task-run-terminated-error.d.ts +6 -0
- package/util/errors/task-run-terminated-error.js +15 -0
- package/util/grpc-error.d.ts +9 -0
- package/util/grpc-error.js +25 -0
- package/util/hatchet-promise/hatchet-promise.d.ts +6 -1
- package/util/hatchet-promise/hatchet-promise.js +16 -2
- package/util/logger/logger.js +0 -1
- package/util/parse.d.ts +1 -1
- package/util/parse.js +4 -2
- package/util/retrier.js +2 -3
- package/util/sleep.d.ts +3 -2
- package/util/sleep.js +6 -4
- package/util/workflow-run-ref.js +5 -3
- package/v1/client/admin.d.ts +2 -2
- package/v1/client/admin.js +2 -6
- package/v1/client/client.d.ts +7 -11
- package/v1/client/client.interface.d.ts +5 -8
- package/v1/client/client.js +34 -40
- package/v1/client/duration.d.ts +11 -1
- package/v1/client/duration.js +44 -0
- package/v1/client/features/cel.js +1 -1
- package/v1/client/features/crons.js +2 -2
- package/v1/client/features/index.d.ts +5 -0
- package/v1/client/features/index.js +5 -0
- package/v1/client/features/logs.d.ts +37 -0
- package/v1/client/features/logs.js +46 -0
- package/v1/client/features/runs.d.ts +16 -3
- package/v1/client/features/runs.js +38 -4
- package/v1/client/features/schedules.js +4 -4
- package/v1/client/features/webhooks.js +4 -2
- package/v1/client/features/workflows.js +1 -1
- package/v1/client/worker/context.d.ts +101 -6
- package/v1/client/worker/context.js +257 -44
- package/v1/client/worker/deprecated/deprecation.js +8 -4
- package/v1/client/worker/deprecated/index.d.ts +1 -1
- package/v1/client/worker/deprecated/index.js +2 -1
- package/v1/client/worker/deprecated/legacy-worker.d.ts +5 -0
- package/v1/client/worker/deprecated/legacy-worker.js +33 -24
- package/v1/client/worker/deprecated/pre-eviction.d.ts +12 -0
- package/v1/client/worker/deprecated/pre-eviction.js +37 -0
- package/v1/client/worker/engine-version.d.ts +5 -0
- package/v1/client/worker/engine-version.js +14 -0
- package/v1/client/worker/eviction/eviction-cache.d.ts +33 -0
- package/v1/client/worker/eviction/eviction-cache.js +139 -0
- package/v1/client/worker/eviction/eviction-manager.d.ts +42 -0
- package/v1/client/worker/eviction/eviction-manager.js +132 -0
- package/v1/client/worker/eviction/eviction-policy.d.ts +19 -0
- package/v1/client/worker/eviction/eviction-policy.js +8 -0
- package/v1/client/worker/eviction/index.d.ts +3 -0
- package/v1/client/worker/eviction/index.js +11 -0
- package/v1/client/worker/health-server.js +3 -3
- package/v1/client/worker/slot-utils.js +0 -3
- package/v1/client/worker/worker-internal.d.ts +23 -4
- package/v1/client/worker/worker-internal.js +216 -148
- package/v1/client/worker/worker.d.ts +1 -0
- package/v1/client/worker/worker.js +34 -0
- package/v1/conditions/base.js +0 -1
- package/v1/conditions/index.js +2 -4
- package/v1/conditions/sleep-condition.js +2 -1
- package/v1/conditions/transformer.js +2 -1
- package/v1/declaration.d.ts +6 -4
- package/v1/declaration.js +20 -7
- package/v1/examples/__e2e__/harness.d.ts +5 -0
- package/v1/examples/__e2e__/harness.js +17 -3
- package/v1/examples/affinity/affinity-workers.js +0 -1
- package/v1/examples/bulk_operations/workflow.js +0 -1
- package/v1/examples/cancellation/run.js +0 -1
- package/v1/examples/cancellations/run.js +0 -1
- package/v1/examples/child_workflows/run.js +0 -2
- package/v1/examples/child_workflows/workflow.js +0 -1
- package/v1/examples/concurrency-rr/load.js +0 -1
- package/v1/examples/concurrency-rr/run.js +0 -3
- package/v1/examples/concurrency_limit_rr/load.js +0 -1
- package/v1/examples/concurrency_limit_rr/run.js +0 -3
- package/v1/examples/concurrency_workflow_level/workflow.d.ts +1 -1
- package/v1/examples/concurrency_workflow_level/workflow.js +1 -1
- package/v1/examples/conditions/event.js +0 -1
- package/v1/examples/conditions/run.js +0 -1
- package/v1/examples/dag/run.js +0 -1
- package/v1/examples/dag_match_condition/event.js +0 -1
- package/v1/examples/dag_match_condition/run.js +0 -1
- package/v1/examples/deep/run.js +0 -2
- package/v1/examples/durable/workflow.d.ts +57 -0
- package/v1/examples/durable/workflow.js +164 -10
- package/v1/examples/durable-event/event.js +0 -1
- package/v1/examples/durable-event/run.js +0 -2
- package/v1/examples/durable-event/workflow.js +2 -7
- package/v1/examples/durable-sleep/event.js +0 -1
- package/v1/examples/durable-sleep/run.js +0 -2
- package/v1/examples/durable_event/event.js +0 -1
- package/v1/examples/durable_event/run.js +0 -2
- package/v1/examples/durable_event/workflow.d.ts +1 -0
- package/v1/examples/durable_event/workflow.js +4 -9
- package/v1/examples/durable_eviction/capacity-worker.d.ts +1 -0
- package/v1/examples/durable_eviction/capacity-worker.js +31 -0
- package/v1/examples/durable_eviction/worker.d.ts +1 -0
- package/v1/examples/durable_eviction/worker.js +34 -0
- package/v1/examples/durable_eviction/workflow.d.ts +44 -0
- package/v1/examples/durable_eviction/workflow.js +129 -0
- package/v1/examples/durable_sleep/event.js +0 -1
- package/v1/examples/durable_sleep/run.js +0 -2
- package/v1/examples/e2e-worker.js +42 -19
- package/v1/examples/events/event.js +0 -1
- package/v1/examples/high-memory/run.js +0 -1
- package/v1/examples/inferred-typing/run.js +0 -1
- package/v1/examples/landing_page/durable-excution.js +0 -1
- package/v1/examples/landing_page/queues.js +0 -1
- package/v1/examples/legacy/run.js +0 -1
- package/v1/examples/logger/byo-logger.js +0 -2
- package/v1/examples/logger/logger.js +0 -1
- package/v1/examples/logging/byo-logger.js +0 -2
- package/v1/examples/logging/logger.js +0 -1
- package/v1/examples/middleware/recipes.js +3 -1
- package/v1/examples/migration-guides/mergent.js +2 -1
- package/v1/examples/multiple_wf_concurrency/run.js +0 -3
- package/v1/examples/non_retryable/run.js +0 -1
- package/v1/examples/on_event/event.js +0 -1
- package/v1/examples/on_failure/run.js +0 -1
- package/v1/examples/on_failure/workflow.js +0 -1
- package/v1/examples/on_success/run.js +0 -1
- package/v1/examples/on_success/workflow.js +0 -1
- package/v1/examples/priority/run.js +0 -1
- package/v1/examples/priority/workflow.js +0 -1
- package/v1/examples/retries/run.js +0 -1
- package/v1/examples/retries/workflow.js +0 -1
- package/v1/examples/simple/bulk.js +0 -1
- package/v1/examples/simple/cron.js +0 -2
- package/v1/examples/simple/delay.js +0 -1
- package/v1/examples/simple/enqueue.js +0 -2
- package/v1/examples/simple/run.js +0 -1
- package/v1/examples/simple/schedule.js +0 -1
- package/v1/examples/simple/workflow-with-child.js +10 -4
- package/v1/examples/sticky/run.js +0 -1
- package/v1/examples/sticky/workflow.js +0 -1
- package/v1/examples/streaming/nextjs-proxy.js +0 -1
- package/v1/examples/streaming/run.js +0 -1
- package/v1/examples/timeout/run.js +0 -1
- package/v1/examples/timeouts/run.js +0 -1
- package/v1/index.d.ts +5 -0
- package/v1/index.js +10 -0
- package/v1/parent-run-context-vars.d.ts +6 -0
- package/v1/slot-types.js +0 -1
- package/v1/task.d.ts +10 -2
- package/v1/task.js +2 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/legacy/workflow.d.ts
CHANGED
|
@@ -17,31 +17,31 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
|
|
|
17
17
|
units: string | number;
|
|
18
18
|
key?: string | undefined;
|
|
19
19
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
20
|
+
limit?: string | number | undefined;
|
|
20
21
|
staticKey?: string | undefined;
|
|
21
22
|
dynamicKey?: string | undefined;
|
|
22
|
-
limit?: string | number | undefined;
|
|
23
23
|
}, {
|
|
24
24
|
units: string | number;
|
|
25
25
|
key?: string | undefined;
|
|
26
26
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
27
|
+
limit?: string | number | undefined;
|
|
27
28
|
staticKey?: string | undefined;
|
|
28
29
|
dynamicKey?: string | undefined;
|
|
29
|
-
limit?: string | number | undefined;
|
|
30
30
|
}>, "many">>;
|
|
31
31
|
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
32
32
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
33
33
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
34
34
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
35
|
-
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("
|
|
35
|
+
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("..").WorkerLabelComparator>>;
|
|
36
36
|
}, "strip", z.ZodTypeAny, {
|
|
37
37
|
value: string | number;
|
|
38
38
|
required?: boolean | undefined;
|
|
39
|
-
comparator?: import("
|
|
39
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
40
40
|
weight?: number | undefined;
|
|
41
41
|
}, {
|
|
42
42
|
value: string | number;
|
|
43
43
|
required?: boolean | undefined;
|
|
44
|
-
comparator?: import("
|
|
44
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
45
45
|
weight?: number | undefined;
|
|
46
46
|
}>]>>>>>;
|
|
47
47
|
backoff: z.ZodOptional<z.ZodObject<{
|
|
@@ -59,47 +59,47 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
|
|
|
59
59
|
timeout?: string | undefined;
|
|
60
60
|
parents?: string[] | undefined;
|
|
61
61
|
retries?: number | undefined;
|
|
62
|
+
backoff?: {
|
|
63
|
+
factor?: number | undefined;
|
|
64
|
+
maxSeconds?: number | undefined;
|
|
65
|
+
} | undefined;
|
|
62
66
|
rate_limits?: {
|
|
63
67
|
units: string | number;
|
|
64
68
|
key?: string | undefined;
|
|
65
69
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
70
|
+
limit?: string | number | undefined;
|
|
66
71
|
staticKey?: string | undefined;
|
|
67
72
|
dynamicKey?: string | undefined;
|
|
68
|
-
limit?: string | number | undefined;
|
|
69
73
|
}[] | undefined;
|
|
70
74
|
worker_labels?: Record<string, string | number | {
|
|
71
75
|
value: string | number;
|
|
72
76
|
required?: boolean | undefined;
|
|
73
|
-
comparator?: import("
|
|
77
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
74
78
|
weight?: number | undefined;
|
|
75
79
|
} | undefined> | undefined;
|
|
76
|
-
backoff?: {
|
|
77
|
-
factor?: number | undefined;
|
|
78
|
-
maxSeconds?: number | undefined;
|
|
79
|
-
} | undefined;
|
|
80
80
|
}, {
|
|
81
81
|
name: string;
|
|
82
82
|
timeout?: string | undefined;
|
|
83
83
|
parents?: string[] | undefined;
|
|
84
84
|
retries?: number | undefined;
|
|
85
|
+
backoff?: {
|
|
86
|
+
factor?: number | undefined;
|
|
87
|
+
maxSeconds?: number | undefined;
|
|
88
|
+
} | undefined;
|
|
85
89
|
rate_limits?: {
|
|
86
90
|
units: string | number;
|
|
87
91
|
key?: string | undefined;
|
|
88
92
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
93
|
+
limit?: string | number | undefined;
|
|
89
94
|
staticKey?: string | undefined;
|
|
90
95
|
dynamicKey?: string | undefined;
|
|
91
|
-
limit?: string | number | undefined;
|
|
92
96
|
}[] | undefined;
|
|
93
97
|
worker_labels?: Record<string, string | number | {
|
|
94
98
|
value: string | number;
|
|
95
99
|
required?: boolean | undefined;
|
|
96
|
-
comparator?: import("
|
|
100
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
97
101
|
weight?: number | undefined;
|
|
98
102
|
} | undefined> | undefined;
|
|
99
|
-
backoff?: {
|
|
100
|
-
factor?: number | undefined;
|
|
101
|
-
maxSeconds?: number | undefined;
|
|
102
|
-
} | undefined;
|
|
103
103
|
}>, "many">;
|
|
104
104
|
export type Steps = z.infer<typeof StepsSchema>;
|
|
105
105
|
export declare const ConcurrencyLimitStrategy: typeof PbConcurrencyLimitStrategy;
|
|
@@ -110,14 +110,14 @@ export declare const WorkflowConcurrency: z.ZodObject<{
|
|
|
110
110
|
expression: z.ZodOptional<z.ZodString>;
|
|
111
111
|
}, "strip", z.ZodTypeAny, {
|
|
112
112
|
name: string;
|
|
113
|
-
expression?: string | undefined;
|
|
114
113
|
maxRuns?: number | undefined;
|
|
115
114
|
limitStrategy?: PbConcurrencyLimitStrategy | undefined;
|
|
115
|
+
expression?: string | undefined;
|
|
116
116
|
}, {
|
|
117
117
|
name: string;
|
|
118
|
-
expression?: string | undefined;
|
|
119
118
|
maxRuns?: number | undefined;
|
|
120
119
|
limitStrategy?: PbConcurrencyLimitStrategy | undefined;
|
|
120
|
+
expression?: string | undefined;
|
|
121
121
|
}>;
|
|
122
122
|
export declare const HatchetTimeoutSchema: z.ZodString;
|
|
123
123
|
export declare const StickyStrategy: typeof PbStickyStrategy;
|
|
@@ -166,31 +166,31 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
166
166
|
units: string | number;
|
|
167
167
|
key?: string | undefined;
|
|
168
168
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
169
|
+
limit?: string | number | undefined;
|
|
169
170
|
staticKey?: string | undefined;
|
|
170
171
|
dynamicKey?: string | undefined;
|
|
171
|
-
limit?: string | number | undefined;
|
|
172
172
|
}, {
|
|
173
173
|
units: string | number;
|
|
174
174
|
key?: string | undefined;
|
|
175
175
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
176
|
+
limit?: string | number | undefined;
|
|
176
177
|
staticKey?: string | undefined;
|
|
177
178
|
dynamicKey?: string | undefined;
|
|
178
|
-
limit?: string | number | undefined;
|
|
179
179
|
}>, "many">>;
|
|
180
180
|
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
181
181
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
182
182
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
183
183
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
184
|
-
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("
|
|
184
|
+
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("..").WorkerLabelComparator>>;
|
|
185
185
|
}, "strip", z.ZodTypeAny, {
|
|
186
186
|
value: string | number;
|
|
187
187
|
required?: boolean | undefined;
|
|
188
|
-
comparator?: import("
|
|
188
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
189
189
|
weight?: number | undefined;
|
|
190
190
|
}, {
|
|
191
191
|
value: string | number;
|
|
192
192
|
required?: boolean | undefined;
|
|
193
|
-
comparator?: import("
|
|
193
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
194
194
|
weight?: number | undefined;
|
|
195
195
|
}>]>>>>>;
|
|
196
196
|
backoff: z.ZodOptional<z.ZodObject<{
|
|
@@ -208,47 +208,47 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
208
208
|
timeout?: string | undefined;
|
|
209
209
|
parents?: string[] | undefined;
|
|
210
210
|
retries?: number | undefined;
|
|
211
|
+
backoff?: {
|
|
212
|
+
factor?: number | undefined;
|
|
213
|
+
maxSeconds?: number | undefined;
|
|
214
|
+
} | undefined;
|
|
211
215
|
rate_limits?: {
|
|
212
216
|
units: string | number;
|
|
213
217
|
key?: string | undefined;
|
|
214
218
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
219
|
+
limit?: string | number | undefined;
|
|
215
220
|
staticKey?: string | undefined;
|
|
216
221
|
dynamicKey?: string | undefined;
|
|
217
|
-
limit?: string | number | undefined;
|
|
218
222
|
}[] | undefined;
|
|
219
223
|
worker_labels?: Record<string, string | number | {
|
|
220
224
|
value: string | number;
|
|
221
225
|
required?: boolean | undefined;
|
|
222
|
-
comparator?: import("
|
|
226
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
223
227
|
weight?: number | undefined;
|
|
224
228
|
} | undefined> | undefined;
|
|
225
|
-
backoff?: {
|
|
226
|
-
factor?: number | undefined;
|
|
227
|
-
maxSeconds?: number | undefined;
|
|
228
|
-
} | undefined;
|
|
229
229
|
}, {
|
|
230
230
|
name: string;
|
|
231
231
|
timeout?: string | undefined;
|
|
232
232
|
parents?: string[] | undefined;
|
|
233
233
|
retries?: number | undefined;
|
|
234
|
+
backoff?: {
|
|
235
|
+
factor?: number | undefined;
|
|
236
|
+
maxSeconds?: number | undefined;
|
|
237
|
+
} | undefined;
|
|
234
238
|
rate_limits?: {
|
|
235
239
|
units: string | number;
|
|
236
240
|
key?: string | undefined;
|
|
237
241
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
242
|
+
limit?: string | number | undefined;
|
|
238
243
|
staticKey?: string | undefined;
|
|
239
244
|
dynamicKey?: string | undefined;
|
|
240
|
-
limit?: string | number | undefined;
|
|
241
245
|
}[] | undefined;
|
|
242
246
|
worker_labels?: Record<string, string | number | {
|
|
243
247
|
value: string | number;
|
|
244
248
|
required?: boolean | undefined;
|
|
245
|
-
comparator?: import("
|
|
249
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
246
250
|
weight?: number | undefined;
|
|
247
251
|
} | undefined> | undefined;
|
|
248
|
-
backoff?: {
|
|
249
|
-
factor?: number | undefined;
|
|
250
|
-
maxSeconds?: number | undefined;
|
|
251
|
-
} | undefined;
|
|
252
252
|
}>, "many">;
|
|
253
253
|
onFailure: z.ZodOptional<z.ZodObject<{
|
|
254
254
|
name: z.ZodString;
|
|
@@ -266,31 +266,31 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
266
266
|
units: string | number;
|
|
267
267
|
key?: string | undefined;
|
|
268
268
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
269
|
+
limit?: string | number | undefined;
|
|
269
270
|
staticKey?: string | undefined;
|
|
270
271
|
dynamicKey?: string | undefined;
|
|
271
|
-
limit?: string | number | undefined;
|
|
272
272
|
}, {
|
|
273
273
|
units: string | number;
|
|
274
274
|
key?: string | undefined;
|
|
275
275
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
276
|
+
limit?: string | number | undefined;
|
|
276
277
|
staticKey?: string | undefined;
|
|
277
278
|
dynamicKey?: string | undefined;
|
|
278
|
-
limit?: string | number | undefined;
|
|
279
279
|
}>, "many">>;
|
|
280
280
|
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
281
281
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
282
282
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
283
283
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
284
|
-
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("
|
|
284
|
+
comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("..").WorkerLabelComparator>>;
|
|
285
285
|
}, "strip", z.ZodTypeAny, {
|
|
286
286
|
value: string | number;
|
|
287
287
|
required?: boolean | undefined;
|
|
288
|
-
comparator?: import("
|
|
288
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
289
289
|
weight?: number | undefined;
|
|
290
290
|
}, {
|
|
291
291
|
value: string | number;
|
|
292
292
|
required?: boolean | undefined;
|
|
293
|
-
comparator?: import("
|
|
293
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
294
294
|
weight?: number | undefined;
|
|
295
295
|
}>]>>>>>;
|
|
296
296
|
backoff: z.ZodOptional<z.ZodObject<{
|
|
@@ -308,79 +308,79 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
308
308
|
timeout?: string | undefined;
|
|
309
309
|
parents?: string[] | undefined;
|
|
310
310
|
retries?: number | undefined;
|
|
311
|
+
backoff?: {
|
|
312
|
+
factor?: number | undefined;
|
|
313
|
+
maxSeconds?: number | undefined;
|
|
314
|
+
} | undefined;
|
|
311
315
|
rate_limits?: {
|
|
312
316
|
units: string | number;
|
|
313
317
|
key?: string | undefined;
|
|
314
318
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
319
|
+
limit?: string | number | undefined;
|
|
315
320
|
staticKey?: string | undefined;
|
|
316
321
|
dynamicKey?: string | undefined;
|
|
317
|
-
limit?: string | number | undefined;
|
|
318
322
|
}[] | undefined;
|
|
319
323
|
worker_labels?: Record<string, string | number | {
|
|
320
324
|
value: string | number;
|
|
321
325
|
required?: boolean | undefined;
|
|
322
|
-
comparator?: import("
|
|
326
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
323
327
|
weight?: number | undefined;
|
|
324
328
|
} | undefined> | undefined;
|
|
325
|
-
backoff?: {
|
|
326
|
-
factor?: number | undefined;
|
|
327
|
-
maxSeconds?: number | undefined;
|
|
328
|
-
} | undefined;
|
|
329
329
|
}, {
|
|
330
330
|
name: string;
|
|
331
331
|
timeout?: string | undefined;
|
|
332
332
|
parents?: string[] | undefined;
|
|
333
333
|
retries?: number | undefined;
|
|
334
|
+
backoff?: {
|
|
335
|
+
factor?: number | undefined;
|
|
336
|
+
maxSeconds?: number | undefined;
|
|
337
|
+
} | undefined;
|
|
334
338
|
rate_limits?: {
|
|
335
339
|
units: string | number;
|
|
336
340
|
key?: string | undefined;
|
|
337
341
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
342
|
+
limit?: string | number | undefined;
|
|
338
343
|
staticKey?: string | undefined;
|
|
339
344
|
dynamicKey?: string | undefined;
|
|
340
|
-
limit?: string | number | undefined;
|
|
341
345
|
}[] | undefined;
|
|
342
346
|
worker_labels?: Record<string, string | number | {
|
|
343
347
|
value: string | number;
|
|
344
348
|
required?: boolean | undefined;
|
|
345
|
-
comparator?: import("
|
|
349
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
346
350
|
weight?: number | undefined;
|
|
347
351
|
} | undefined> | undefined;
|
|
348
|
-
backoff?: {
|
|
349
|
-
factor?: number | undefined;
|
|
350
|
-
maxSeconds?: number | undefined;
|
|
351
|
-
} | undefined;
|
|
352
352
|
}>>;
|
|
353
353
|
}, "strip", z.ZodTypeAny, {
|
|
354
354
|
description: string;
|
|
355
|
-
id: string;
|
|
356
355
|
steps: {
|
|
357
356
|
name: string;
|
|
358
357
|
timeout?: string | undefined;
|
|
359
358
|
parents?: string[] | undefined;
|
|
360
359
|
retries?: number | undefined;
|
|
360
|
+
backoff?: {
|
|
361
|
+
factor?: number | undefined;
|
|
362
|
+
maxSeconds?: number | undefined;
|
|
363
|
+
} | undefined;
|
|
361
364
|
rate_limits?: {
|
|
362
365
|
units: string | number;
|
|
363
366
|
key?: string | undefined;
|
|
364
367
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
368
|
+
limit?: string | number | undefined;
|
|
365
369
|
staticKey?: string | undefined;
|
|
366
370
|
dynamicKey?: string | undefined;
|
|
367
|
-
limit?: string | number | undefined;
|
|
368
371
|
}[] | undefined;
|
|
369
372
|
worker_labels?: Record<string, string | number | {
|
|
370
373
|
value: string | number;
|
|
371
374
|
required?: boolean | undefined;
|
|
372
|
-
comparator?: import("
|
|
375
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
373
376
|
weight?: number | undefined;
|
|
374
377
|
} | undefined> | undefined;
|
|
375
|
-
backoff?: {
|
|
376
|
-
factor?: number | undefined;
|
|
377
|
-
maxSeconds?: number | undefined;
|
|
378
|
-
} | undefined;
|
|
379
378
|
}[];
|
|
379
|
+
id: string;
|
|
380
380
|
version?: string | undefined;
|
|
381
381
|
timeout?: string | undefined;
|
|
382
|
-
sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
|
|
383
382
|
scheduleTimeout?: string | undefined;
|
|
383
|
+
sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
|
|
384
384
|
on?: {
|
|
385
385
|
cron: string;
|
|
386
386
|
event?: undefined;
|
|
@@ -393,56 +393,56 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
393
393
|
timeout?: string | undefined;
|
|
394
394
|
parents?: string[] | undefined;
|
|
395
395
|
retries?: number | undefined;
|
|
396
|
+
backoff?: {
|
|
397
|
+
factor?: number | undefined;
|
|
398
|
+
maxSeconds?: number | undefined;
|
|
399
|
+
} | undefined;
|
|
396
400
|
rate_limits?: {
|
|
397
401
|
units: string | number;
|
|
398
402
|
key?: string | undefined;
|
|
399
403
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
404
|
+
limit?: string | number | undefined;
|
|
400
405
|
staticKey?: string | undefined;
|
|
401
406
|
dynamicKey?: string | undefined;
|
|
402
|
-
limit?: string | number | undefined;
|
|
403
407
|
}[] | undefined;
|
|
404
408
|
worker_labels?: Record<string, string | number | {
|
|
405
409
|
value: string | number;
|
|
406
410
|
required?: boolean | undefined;
|
|
407
|
-
comparator?: import("
|
|
411
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
408
412
|
weight?: number | undefined;
|
|
409
413
|
} | undefined> | undefined;
|
|
410
|
-
backoff?: {
|
|
411
|
-
factor?: number | undefined;
|
|
412
|
-
maxSeconds?: number | undefined;
|
|
413
|
-
} | undefined;
|
|
414
414
|
} | undefined;
|
|
415
415
|
}, {
|
|
416
416
|
description: string;
|
|
417
|
-
id: string;
|
|
418
417
|
steps: {
|
|
419
418
|
name: string;
|
|
420
419
|
timeout?: string | undefined;
|
|
421
420
|
parents?: string[] | undefined;
|
|
422
421
|
retries?: number | undefined;
|
|
422
|
+
backoff?: {
|
|
423
|
+
factor?: number | undefined;
|
|
424
|
+
maxSeconds?: number | undefined;
|
|
425
|
+
} | undefined;
|
|
423
426
|
rate_limits?: {
|
|
424
427
|
units: string | number;
|
|
425
428
|
key?: string | undefined;
|
|
426
429
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
430
|
+
limit?: string | number | undefined;
|
|
427
431
|
staticKey?: string | undefined;
|
|
428
432
|
dynamicKey?: string | undefined;
|
|
429
|
-
limit?: string | number | undefined;
|
|
430
433
|
}[] | undefined;
|
|
431
434
|
worker_labels?: Record<string, string | number | {
|
|
432
435
|
value: string | number;
|
|
433
436
|
required?: boolean | undefined;
|
|
434
|
-
comparator?: import("
|
|
437
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
435
438
|
weight?: number | undefined;
|
|
436
439
|
} | undefined> | undefined;
|
|
437
|
-
backoff?: {
|
|
438
|
-
factor?: number | undefined;
|
|
439
|
-
maxSeconds?: number | undefined;
|
|
440
|
-
} | undefined;
|
|
441
440
|
}[];
|
|
441
|
+
id: string;
|
|
442
442
|
version?: string | undefined;
|
|
443
443
|
timeout?: string | undefined;
|
|
444
|
-
sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
|
|
445
444
|
scheduleTimeout?: string | undefined;
|
|
445
|
+
sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
|
|
446
446
|
on?: {
|
|
447
447
|
cron: string;
|
|
448
448
|
event?: undefined;
|
|
@@ -455,24 +455,24 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
455
455
|
timeout?: string | undefined;
|
|
456
456
|
parents?: string[] | undefined;
|
|
457
457
|
retries?: number | undefined;
|
|
458
|
+
backoff?: {
|
|
459
|
+
factor?: number | undefined;
|
|
460
|
+
maxSeconds?: number | undefined;
|
|
461
|
+
} | undefined;
|
|
458
462
|
rate_limits?: {
|
|
459
463
|
units: string | number;
|
|
460
464
|
key?: string | undefined;
|
|
461
465
|
duration?: import("../protoc/workflows").RateLimitDuration | undefined;
|
|
466
|
+
limit?: string | number | undefined;
|
|
462
467
|
staticKey?: string | undefined;
|
|
463
468
|
dynamicKey?: string | undefined;
|
|
464
|
-
limit?: string | number | undefined;
|
|
465
469
|
}[] | undefined;
|
|
466
470
|
worker_labels?: Record<string, string | number | {
|
|
467
471
|
value: string | number;
|
|
468
472
|
required?: boolean | undefined;
|
|
469
|
-
comparator?: import("
|
|
473
|
+
comparator?: import("..").WorkerLabelComparator | undefined;
|
|
470
474
|
weight?: number | undefined;
|
|
471
475
|
} | undefined> | undefined;
|
|
472
|
-
backoff?: {
|
|
473
|
-
factor?: number | undefined;
|
|
474
|
-
maxSeconds?: number | undefined;
|
|
475
|
-
} | undefined;
|
|
476
476
|
} | undefined;
|
|
477
477
|
}>;
|
|
478
478
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -19,53 +19,44 @@
|
|
|
19
19
|
"author": "",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@
|
|
22
|
+
"@eslint/js": "^10.0.1",
|
|
23
|
+
"@tsd/typescript": "^5.9.3",
|
|
23
24
|
"@types/jest": "^29.5.14",
|
|
24
25
|
"@types/node": "^22.13.14",
|
|
25
|
-
"
|
|
26
|
-
"@typescript-eslint/parser": "^7.0.0",
|
|
27
|
-
"autoprefixer": "^10.4.21",
|
|
26
|
+
"autoprefixer": "^10.4.27",
|
|
28
27
|
"dotenv-cli": "^7.4.4",
|
|
29
|
-
"eslint": "^
|
|
30
|
-
"eslint-config-
|
|
31
|
-
"eslint-config-prettier": "^9.1.0",
|
|
32
|
-
"eslint-config-standard": "^17.1.0",
|
|
28
|
+
"eslint": "^10.0.3",
|
|
29
|
+
"eslint-config-prettier": "^10.1.8",
|
|
33
30
|
"eslint-import-resolver-typescript": "^3.10.0",
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"eslint-plugin-
|
|
36
|
-
"
|
|
37
|
-
"eslint-plugin-prettier": "^5.2.5",
|
|
38
|
-
"eslint-plugin-promise": "^6.6.0",
|
|
39
|
-
"eslint-plugin-react": "^7.37.4",
|
|
40
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
41
|
-
"eslint-plugin-react-refresh": "^0.4.19",
|
|
42
|
-
"eslint-plugin-unused-imports": "^4.1.4",
|
|
43
|
-
"grpc-tools": "^1.13.0",
|
|
31
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
32
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
33
|
+
"grpc-tools": "^1.13.1",
|
|
44
34
|
"jest": "^29.7.0",
|
|
45
35
|
"jest-tsd": "^0.2.2",
|
|
46
36
|
"pino": "^9.12.0",
|
|
47
|
-
"prettier": "^3.
|
|
37
|
+
"prettier": "^3.8.1",
|
|
48
38
|
"resolve-tspaths": "^0.8.23",
|
|
49
|
-
"ts-jest": "^29.
|
|
39
|
+
"ts-jest": "^29.4.6",
|
|
50
40
|
"ts-node": "^10.9.2",
|
|
51
|
-
"ts-proto": "^2.
|
|
41
|
+
"ts-proto": "^2.11.4",
|
|
52
42
|
"typedoc": "^0.28.17",
|
|
53
|
-
"typedoc-plugin-markdown": "^4.
|
|
43
|
+
"typedoc-plugin-markdown": "^4.10.0",
|
|
54
44
|
"typedoc-plugin-no-inherit": "^1.6.1",
|
|
55
|
-
"typescript": "^5.8.2"
|
|
45
|
+
"typescript": "^5.8.2",
|
|
46
|
+
"typescript-eslint": "^8.56.1"
|
|
56
47
|
},
|
|
57
48
|
"dependencies": {
|
|
58
|
-
"@bufbuild/protobuf": "^2.
|
|
59
|
-
"@types/qs": "^6.
|
|
49
|
+
"@bufbuild/protobuf": "^2.11.0",
|
|
50
|
+
"@types/qs": "^6.15.0",
|
|
60
51
|
"abort-controller-x": "^0.4.3",
|
|
61
52
|
"axios": "^1.13.5",
|
|
62
53
|
"long": "^5.3.1",
|
|
63
|
-
"nice-grpc": "^2.1.
|
|
54
|
+
"nice-grpc": "^2.1.14",
|
|
64
55
|
"nice-grpc-common": "^2.0.2",
|
|
65
56
|
"protobufjs": "^7.4.0",
|
|
66
57
|
"qs": "^6.14.2",
|
|
67
|
-
"semver": "^7.7.
|
|
68
|
-
"yaml": "^2.
|
|
58
|
+
"semver": "^7.7.4",
|
|
59
|
+
"yaml": "^2.8.2",
|
|
69
60
|
"zod": "^3.24.2",
|
|
70
61
|
"zod-to-json-schema": "^3.24.1"
|
|
71
62
|
},
|
|
@@ -176,6 +176,8 @@ export interface AssignedAction {
|
|
|
176
176
|
workflowId?: string | undefined;
|
|
177
177
|
/** (optional) the workflow version id */
|
|
178
178
|
workflowVersionId?: string | undefined;
|
|
179
|
+
/** (optional) the invocation count for durable task events (required for durable events, otherwise null) */
|
|
180
|
+
durableTaskInvocationCount?: number | undefined;
|
|
179
181
|
}
|
|
180
182
|
export interface WorkerListenRequest {
|
|
181
183
|
/** the id of the worker */
|
|
@@ -314,6 +316,12 @@ export interface ReleaseSlotRequest {
|
|
|
314
316
|
}
|
|
315
317
|
export interface ReleaseSlotResponse {
|
|
316
318
|
}
|
|
319
|
+
export interface RestoreEvictedTaskRequest {
|
|
320
|
+
taskRunExternalId: string;
|
|
321
|
+
}
|
|
322
|
+
export interface RestoreEvictedTaskResponse {
|
|
323
|
+
requeued: boolean;
|
|
324
|
+
}
|
|
317
325
|
export interface GetVersionRequest {
|
|
318
326
|
}
|
|
319
327
|
export interface GetVersionResponse {
|
|
@@ -348,6 +356,8 @@ export declare const RefreshTimeoutRequest: MessageFns<RefreshTimeoutRequest>;
|
|
|
348
356
|
export declare const RefreshTimeoutResponse: MessageFns<RefreshTimeoutResponse>;
|
|
349
357
|
export declare const ReleaseSlotRequest: MessageFns<ReleaseSlotRequest>;
|
|
350
358
|
export declare const ReleaseSlotResponse: MessageFns<ReleaseSlotResponse>;
|
|
359
|
+
export declare const RestoreEvictedTaskRequest: MessageFns<RestoreEvictedTaskRequest>;
|
|
360
|
+
export declare const RestoreEvictedTaskResponse: MessageFns<RestoreEvictedTaskResponse>;
|
|
351
361
|
export declare const GetVersionRequest: MessageFns<GetVersionRequest>;
|
|
352
362
|
export declare const GetVersionResponse: MessageFns<GetVersionResponse>;
|
|
353
363
|
export type DispatcherDefinition = typeof DispatcherDefinition;
|
|
@@ -456,6 +466,14 @@ export declare const DispatcherDefinition: {
|
|
|
456
466
|
readonly responseStream: false;
|
|
457
467
|
readonly options: {};
|
|
458
468
|
};
|
|
469
|
+
readonly restoreEvictedTask: {
|
|
470
|
+
readonly name: "RestoreEvictedTask";
|
|
471
|
+
readonly requestType: MessageFns<RestoreEvictedTaskRequest>;
|
|
472
|
+
readonly requestStream: false;
|
|
473
|
+
readonly responseType: MessageFns<RestoreEvictedTaskResponse>;
|
|
474
|
+
readonly responseStream: false;
|
|
475
|
+
readonly options: {};
|
|
476
|
+
};
|
|
459
477
|
readonly upsertWorkerLabels: {
|
|
460
478
|
readonly name: "UpsertWorkerLabels";
|
|
461
479
|
readonly requestType: MessageFns<UpsertWorkerLabelsRequest>;
|
|
@@ -497,6 +515,7 @@ export interface DispatcherServiceImplementation<CallContextExt = {}> {
|
|
|
497
515
|
unsubscribe(request: WorkerUnsubscribeRequest, context: CallContext & CallContextExt): Promise<DeepPartial<WorkerUnsubscribeResponse>>;
|
|
498
516
|
refreshTimeout(request: RefreshTimeoutRequest, context: CallContext & CallContextExt): Promise<DeepPartial<RefreshTimeoutResponse>>;
|
|
499
517
|
releaseSlot(request: ReleaseSlotRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ReleaseSlotResponse>>;
|
|
518
|
+
restoreEvictedTask(request: RestoreEvictedTaskRequest, context: CallContext & CallContextExt): Promise<DeepPartial<RestoreEvictedTaskResponse>>;
|
|
500
519
|
upsertWorkerLabels(request: UpsertWorkerLabelsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<UpsertWorkerLabelsResponse>>;
|
|
501
520
|
/**
|
|
502
521
|
* GetVersion returns the dispatcher protocol version as a simple integer.
|
|
@@ -523,6 +542,7 @@ export interface DispatcherClient<CallOptionsExt = {}> {
|
|
|
523
542
|
unsubscribe(request: DeepPartial<WorkerUnsubscribeRequest>, options?: CallOptions & CallOptionsExt): Promise<WorkerUnsubscribeResponse>;
|
|
524
543
|
refreshTimeout(request: DeepPartial<RefreshTimeoutRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimeoutResponse>;
|
|
525
544
|
releaseSlot(request: DeepPartial<ReleaseSlotRequest>, options?: CallOptions & CallOptionsExt): Promise<ReleaseSlotResponse>;
|
|
545
|
+
restoreEvictedTask(request: DeepPartial<RestoreEvictedTaskRequest>, options?: CallOptions & CallOptionsExt): Promise<RestoreEvictedTaskResponse>;
|
|
526
546
|
upsertWorkerLabels(request: DeepPartial<UpsertWorkerLabelsRequest>, options?: CallOptions & CallOptionsExt): Promise<UpsertWorkerLabelsResponse>;
|
|
527
547
|
/**
|
|
528
548
|
* GetVersion returns the dispatcher protocol version as a simple integer.
|