@hatchet-dev/typescript-sdk 0.10.1 → 0.12.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/admin/admin-client.d.ts +1 -0
- package/clients/dispatcher/dispatcher-client.d.ts +3 -0
- package/clients/dispatcher/dispatcher-client.js +20 -1
- package/clients/hatchet-client/hatchet-client.d.ts +2 -2
- package/clients/hatchet-client/hatchet-client.js +11 -4
- package/clients/listener/listener-client.d.ts +10 -4
- package/clients/listener/listener-client.js +45 -13
- package/clients/worker/worker.d.ts +12 -0
- package/clients/worker/worker.js +54 -2
- package/examples/affinity-workers.d.ts +1 -0
- package/examples/affinity-workers.js +93 -0
- package/examples/api.d.ts +1 -0
- package/examples/api.js +61 -0
- package/examples/concurrency/cancel-in-progress/concurrency-event.d.ts +1 -0
- package/examples/concurrency/cancel-in-progress/concurrency-event.js +37 -0
- package/examples/concurrency/cancel-in-progress/concurrency-worker.d.ts +1 -0
- package/examples/concurrency/cancel-in-progress/concurrency-worker.js +66 -0
- package/examples/concurrency/group-round-robin/concurrency-event.d.ts +1 -0
- package/examples/concurrency/group-round-robin/concurrency-event.js +35 -0
- package/examples/concurrency/group-round-robin/concurrency-worker.d.ts +1 -0
- package/examples/concurrency/group-round-robin/concurrency-worker.js +61 -0
- package/examples/dag-worker.d.ts +1 -0
- package/examples/dag-worker.js +76 -0
- package/examples/example-event-with-results.d.ts +1 -0
- package/examples/example-event-with-results.js +50 -0
- package/examples/example-event.d.ts +1 -0
- package/examples/example-event.js +10 -0
- package/examples/fanout-worker.d.ts +1 -0
- package/examples/fanout-worker.js +69 -0
- package/examples/logger.d.ts +1 -0
- package/examples/logger.js +50 -0
- package/examples/manual-trigger.d.ts +1 -0
- package/examples/manual-trigger.js +46 -0
- package/examples/multi-workflow.d.ts +1 -0
- package/examples/multi-workflow.js +55 -0
- package/examples/namespaced-worker.d.ts +1 -0
- package/examples/namespaced-worker.js +56 -0
- package/examples/on-failure.d.ts +1 -0
- package/examples/on-failure.js +53 -0
- package/examples/playground.d.ts +1 -0
- package/examples/playground.js +39 -0
- package/examples/rate-limit/events.d.ts +1 -0
- package/examples/rate-limit/events.js +16 -0
- package/examples/rate-limit/worker.d.ts +1 -0
- package/examples/rate-limit/worker.js +43 -0
- package/examples/retries-worker.d.ts +1 -0
- package/examples/retries-worker.js +60 -0
- package/examples/simple-worker.d.ts +1 -0
- package/examples/simple-worker.js +55 -0
- package/examples/sticky-worker.d.ts +1 -0
- package/examples/sticky-worker.js +73 -0
- package/examples/stream-by-additional-meta.d.ts +1 -0
- package/examples/stream-by-additional-meta.js +55 -0
- package/package.json +24 -21
- package/protoc/dispatcher/dispatcher.d.ts +109 -2
- package/protoc/dispatcher/dispatcher.js +518 -17
- package/protoc/events/events.d.ts +1 -1
- package/protoc/events/events.js +0 -5
- package/protoc/google/protobuf/timestamp.js +0 -8
- package/protoc/workflows/workflows.d.ts +82 -1
- package/protoc/workflows/workflows.js +404 -9
- package/step.d.ts +79 -2
- package/step.js +90 -3
- package/util/workflow-run-ref.d.ts +3 -0
- package/util/workflow-run-ref.js +21 -4
- package/workflow.d.ts +116 -1
- package/workflow.js +6 -1
package/protoc/events/events.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
-
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v1.180.0
|
|
5
|
-
// protoc v3.19.1
|
|
6
|
-
// source: events/events.proto
|
|
7
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
3
|
if (k2 === undefined) k2 = k;
|
|
9
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
-
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v1.180.0
|
|
5
|
-
// protoc v3.19.1
|
|
6
|
-
// source: google/protobuf/timestamp.proto
|
|
7
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
3
|
if (k2 === undefined) k2 = k;
|
|
9
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -104,9 +99,6 @@ function longToNumber(long) {
|
|
|
104
99
|
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
105
100
|
throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
|
|
106
101
|
}
|
|
107
|
-
if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
|
|
108
|
-
throw new globalThis.Error('Value is smaller than Number.MIN_SAFE_INTEGER');
|
|
109
|
-
}
|
|
110
102
|
return long.toNumber();
|
|
111
103
|
}
|
|
112
104
|
if (_m0.util.Long !== Long) {
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CallContext, CallOptions } from 'nice-grpc-common';
|
|
2
2
|
import * as _m0 from 'protobufjs/minimal';
|
|
3
3
|
export declare const protobufPackage = "";
|
|
4
|
+
export declare enum StickyStrategy {
|
|
5
|
+
SOFT = 0,
|
|
6
|
+
HARD = 1,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export declare function stickyStrategyFromJSON(object: any): StickyStrategy;
|
|
10
|
+
export declare function stickyStrategyToJSON(object: StickyStrategy): string;
|
|
11
|
+
export declare enum WorkflowKind {
|
|
12
|
+
FUNCTION = 0,
|
|
13
|
+
DURABLE = 1,
|
|
14
|
+
DAG = 2,
|
|
15
|
+
UNRECOGNIZED = -1
|
|
16
|
+
}
|
|
17
|
+
export declare function workflowKindFromJSON(object: any): WorkflowKind;
|
|
18
|
+
export declare function workflowKindToJSON(object: WorkflowKind): string;
|
|
4
19
|
export declare enum ConcurrencyLimitStrategy {
|
|
5
20
|
CANCEL_IN_PROGRESS = 0,
|
|
6
21
|
DROP_NEWEST = 1,
|
|
@@ -10,6 +25,17 @@ export declare enum ConcurrencyLimitStrategy {
|
|
|
10
25
|
}
|
|
11
26
|
export declare function concurrencyLimitStrategyFromJSON(object: any): ConcurrencyLimitStrategy;
|
|
12
27
|
export declare function concurrencyLimitStrategyToJSON(object: ConcurrencyLimitStrategy): string;
|
|
28
|
+
export declare enum WorkerLabelComparator {
|
|
29
|
+
EQUAL = 0,
|
|
30
|
+
NOT_EQUAL = 1,
|
|
31
|
+
GREATER_THAN = 2,
|
|
32
|
+
GREATER_THAN_OR_EQUAL = 3,
|
|
33
|
+
LESS_THAN = 4,
|
|
34
|
+
LESS_THAN_OR_EQUAL = 5,
|
|
35
|
+
UNRECOGNIZED = -1
|
|
36
|
+
}
|
|
37
|
+
export declare function workerLabelComparatorFromJSON(object: any): WorkerLabelComparator;
|
|
38
|
+
export declare function workerLabelComparatorToJSON(object: WorkerLabelComparator): string;
|
|
13
39
|
export declare enum RateLimitDuration {
|
|
14
40
|
SECOND = 0,
|
|
15
41
|
MINUTE = 1,
|
|
@@ -49,6 +75,10 @@ export interface CreateWorkflowVersionOpts {
|
|
|
49
75
|
cronInput?: string | undefined;
|
|
50
76
|
/** (optional) the job to run on failure */
|
|
51
77
|
onFailureJob?: CreateWorkflowJobOpts | undefined;
|
|
78
|
+
/** (optional) the sticky strategy for assigning steps to workers */
|
|
79
|
+
sticky?: StickyStrategy | undefined;
|
|
80
|
+
/** (optional) the kind of workflow */
|
|
81
|
+
kind?: WorkflowKind | undefined;
|
|
52
82
|
}
|
|
53
83
|
export interface WorkflowConcurrencyOpts {
|
|
54
84
|
/** (required) the action id for getting the concurrency group */
|
|
@@ -67,6 +97,28 @@ export interface CreateWorkflowJobOpts {
|
|
|
67
97
|
/** (required) the job steps */
|
|
68
98
|
steps: CreateWorkflowStepOpts[];
|
|
69
99
|
}
|
|
100
|
+
export interface DesiredWorkerLabels {
|
|
101
|
+
/** value of the affinity */
|
|
102
|
+
strValue?: string | undefined;
|
|
103
|
+
intValue?: number | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* (optional) Specifies whether the affinity setting is required.
|
|
106
|
+
* If required, the worker will not accept actions that do not have a truthy affinity setting.
|
|
107
|
+
*
|
|
108
|
+
* Defaults to false.
|
|
109
|
+
*/
|
|
110
|
+
required?: boolean | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* (optional) Specifies the comparator for the affinity setting.
|
|
113
|
+
* If not set, the default is EQUAL.
|
|
114
|
+
*/
|
|
115
|
+
comparator?: WorkerLabelComparator | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* (optional) Specifies the weight of the affinity setting.
|
|
118
|
+
* If not set, the default is 100.
|
|
119
|
+
*/
|
|
120
|
+
weight?: number | undefined;
|
|
121
|
+
}
|
|
70
122
|
/** CreateWorkflowStepOpts represents options to create a workflow step. */
|
|
71
123
|
export interface CreateWorkflowStepOpts {
|
|
72
124
|
/** (required) the step name */
|
|
@@ -85,6 +137,14 @@ export interface CreateWorkflowStepOpts {
|
|
|
85
137
|
retries: number;
|
|
86
138
|
/** (optional) the rate limits for the step */
|
|
87
139
|
rateLimits: CreateStepRateLimit[];
|
|
140
|
+
/** (optional) the desired worker affinity state for the step */
|
|
141
|
+
workerLabels: {
|
|
142
|
+
[key: string]: DesiredWorkerLabels;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export interface CreateWorkflowStepOpts_WorkerLabelsEntry {
|
|
146
|
+
key: string;
|
|
147
|
+
value: DesiredWorkerLabels | undefined;
|
|
88
148
|
}
|
|
89
149
|
export interface CreateStepRateLimit {
|
|
90
150
|
/** (required) the key for the rate limit */
|
|
@@ -156,6 +216,11 @@ export interface TriggerWorkflowRequest {
|
|
|
156
216
|
childKey?: string | undefined;
|
|
157
217
|
/** (optional) additional metadata for the workflow */
|
|
158
218
|
additionalMetadata?: string | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* (optional) desired worker id for the workflow run,
|
|
221
|
+
* requires the workflow definition to have a sticky strategy
|
|
222
|
+
*/
|
|
223
|
+
desiredWorkerId?: string | undefined;
|
|
159
224
|
}
|
|
160
225
|
export interface TriggerWorkflowResponse {
|
|
161
226
|
workflowRunId: string;
|
|
@@ -202,6 +267,14 @@ export declare const CreateWorkflowJobOpts: {
|
|
|
202
267
|
create(base?: DeepPartial<CreateWorkflowJobOpts>): CreateWorkflowJobOpts;
|
|
203
268
|
fromPartial(object: DeepPartial<CreateWorkflowJobOpts>): CreateWorkflowJobOpts;
|
|
204
269
|
};
|
|
270
|
+
export declare const DesiredWorkerLabels: {
|
|
271
|
+
encode(message: DesiredWorkerLabels, writer?: _m0.Writer): _m0.Writer;
|
|
272
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): DesiredWorkerLabels;
|
|
273
|
+
fromJSON(object: any): DesiredWorkerLabels;
|
|
274
|
+
toJSON(message: DesiredWorkerLabels): unknown;
|
|
275
|
+
create(base?: DeepPartial<DesiredWorkerLabels>): DesiredWorkerLabels;
|
|
276
|
+
fromPartial(object: DeepPartial<DesiredWorkerLabels>): DesiredWorkerLabels;
|
|
277
|
+
};
|
|
205
278
|
export declare const CreateWorkflowStepOpts: {
|
|
206
279
|
encode(message: CreateWorkflowStepOpts, writer?: _m0.Writer): _m0.Writer;
|
|
207
280
|
decode(input: _m0.Reader | Uint8Array, length?: number): CreateWorkflowStepOpts;
|
|
@@ -210,6 +283,14 @@ export declare const CreateWorkflowStepOpts: {
|
|
|
210
283
|
create(base?: DeepPartial<CreateWorkflowStepOpts>): CreateWorkflowStepOpts;
|
|
211
284
|
fromPartial(object: DeepPartial<CreateWorkflowStepOpts>): CreateWorkflowStepOpts;
|
|
212
285
|
};
|
|
286
|
+
export declare const CreateWorkflowStepOpts_WorkerLabelsEntry: {
|
|
287
|
+
encode(message: CreateWorkflowStepOpts_WorkerLabelsEntry, writer?: _m0.Writer): _m0.Writer;
|
|
288
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): CreateWorkflowStepOpts_WorkerLabelsEntry;
|
|
289
|
+
fromJSON(object: any): CreateWorkflowStepOpts_WorkerLabelsEntry;
|
|
290
|
+
toJSON(message: CreateWorkflowStepOpts_WorkerLabelsEntry): unknown;
|
|
291
|
+
create(base?: DeepPartial<CreateWorkflowStepOpts_WorkerLabelsEntry>): CreateWorkflowStepOpts_WorkerLabelsEntry;
|
|
292
|
+
fromPartial(object: DeepPartial<CreateWorkflowStepOpts_WorkerLabelsEntry>): CreateWorkflowStepOpts_WorkerLabelsEntry;
|
|
293
|
+
};
|
|
213
294
|
export declare const CreateStepRateLimit: {
|
|
214
295
|
encode(message: CreateStepRateLimit, writer?: _m0.Writer): _m0.Writer;
|
|
215
296
|
decode(input: _m0.Reader | Uint8Array, length?: number): CreateStepRateLimit;
|