@hatchet-dev/typescript-sdk 0.10.1 → 0.12.1
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/handler.d.ts +4 -12
- package/clients/worker/handler.js +21 -12
- 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 +25 -22
- 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
|
@@ -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: workflows/workflows.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);
|
|
@@ -28,14 +23,88 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
28
23
|
return result;
|
|
29
24
|
};
|
|
30
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.WorkflowServiceDefinition = exports.PutRateLimitResponse = exports.PutRateLimitRequest = exports.TriggerWorkflowResponse = exports.TriggerWorkflowRequest = exports.WorkflowTriggerCronRef = exports.WorkflowTriggerEventRef = exports.WorkflowVersion = exports.ScheduleWorkflowRequest = exports.ListWorkflowsRequest = exports.CreateStepRateLimit = exports.CreateWorkflowStepOpts = exports.CreateWorkflowJobOpts = exports.WorkflowConcurrencyOpts = exports.CreateWorkflowVersionOpts = exports.PutWorkflowRequest = exports.RateLimitDuration = exports.ConcurrencyLimitStrategy = exports.protobufPackage = void 0;
|
|
26
|
+
exports.WorkflowServiceDefinition = exports.PutRateLimitResponse = exports.PutRateLimitRequest = exports.TriggerWorkflowResponse = exports.TriggerWorkflowRequest = exports.WorkflowTriggerCronRef = exports.WorkflowTriggerEventRef = exports.WorkflowVersion = exports.ScheduleWorkflowRequest = exports.ListWorkflowsRequest = exports.CreateStepRateLimit = exports.CreateWorkflowStepOpts_WorkerLabelsEntry = exports.CreateWorkflowStepOpts = exports.DesiredWorkerLabels = exports.CreateWorkflowJobOpts = exports.WorkflowConcurrencyOpts = exports.CreateWorkflowVersionOpts = exports.PutWorkflowRequest = exports.RateLimitDuration = exports.WorkerLabelComparator = exports.ConcurrencyLimitStrategy = exports.WorkflowKind = exports.StickyStrategy = exports.protobufPackage = void 0;
|
|
27
|
+
exports.stickyStrategyFromJSON = stickyStrategyFromJSON;
|
|
28
|
+
exports.stickyStrategyToJSON = stickyStrategyToJSON;
|
|
29
|
+
exports.workflowKindFromJSON = workflowKindFromJSON;
|
|
30
|
+
exports.workflowKindToJSON = workflowKindToJSON;
|
|
32
31
|
exports.concurrencyLimitStrategyFromJSON = concurrencyLimitStrategyFromJSON;
|
|
33
32
|
exports.concurrencyLimitStrategyToJSON = concurrencyLimitStrategyToJSON;
|
|
33
|
+
exports.workerLabelComparatorFromJSON = workerLabelComparatorFromJSON;
|
|
34
|
+
exports.workerLabelComparatorToJSON = workerLabelComparatorToJSON;
|
|
34
35
|
exports.rateLimitDurationFromJSON = rateLimitDurationFromJSON;
|
|
35
36
|
exports.rateLimitDurationToJSON = rateLimitDurationToJSON;
|
|
36
37
|
const _m0 = __importStar(require("protobufjs/minimal"));
|
|
37
38
|
const timestamp_1 = require("../google/protobuf/timestamp");
|
|
38
39
|
exports.protobufPackage = '';
|
|
40
|
+
var StickyStrategy;
|
|
41
|
+
(function (StickyStrategy) {
|
|
42
|
+
StickyStrategy[StickyStrategy["SOFT"] = 0] = "SOFT";
|
|
43
|
+
StickyStrategy[StickyStrategy["HARD"] = 1] = "HARD";
|
|
44
|
+
StickyStrategy[StickyStrategy["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
45
|
+
})(StickyStrategy || (exports.StickyStrategy = StickyStrategy = {}));
|
|
46
|
+
function stickyStrategyFromJSON(object) {
|
|
47
|
+
switch (object) {
|
|
48
|
+
case 0:
|
|
49
|
+
case 'SOFT':
|
|
50
|
+
return StickyStrategy.SOFT;
|
|
51
|
+
case 1:
|
|
52
|
+
case 'HARD':
|
|
53
|
+
return StickyStrategy.HARD;
|
|
54
|
+
case -1:
|
|
55
|
+
case 'UNRECOGNIZED':
|
|
56
|
+
default:
|
|
57
|
+
return StickyStrategy.UNRECOGNIZED;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function stickyStrategyToJSON(object) {
|
|
61
|
+
switch (object) {
|
|
62
|
+
case StickyStrategy.SOFT:
|
|
63
|
+
return 'SOFT';
|
|
64
|
+
case StickyStrategy.HARD:
|
|
65
|
+
return 'HARD';
|
|
66
|
+
case StickyStrategy.UNRECOGNIZED:
|
|
67
|
+
default:
|
|
68
|
+
return 'UNRECOGNIZED';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
var WorkflowKind;
|
|
72
|
+
(function (WorkflowKind) {
|
|
73
|
+
WorkflowKind[WorkflowKind["FUNCTION"] = 0] = "FUNCTION";
|
|
74
|
+
WorkflowKind[WorkflowKind["DURABLE"] = 1] = "DURABLE";
|
|
75
|
+
WorkflowKind[WorkflowKind["DAG"] = 2] = "DAG";
|
|
76
|
+
WorkflowKind[WorkflowKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
77
|
+
})(WorkflowKind || (exports.WorkflowKind = WorkflowKind = {}));
|
|
78
|
+
function workflowKindFromJSON(object) {
|
|
79
|
+
switch (object) {
|
|
80
|
+
case 0:
|
|
81
|
+
case 'FUNCTION':
|
|
82
|
+
return WorkflowKind.FUNCTION;
|
|
83
|
+
case 1:
|
|
84
|
+
case 'DURABLE':
|
|
85
|
+
return WorkflowKind.DURABLE;
|
|
86
|
+
case 2:
|
|
87
|
+
case 'DAG':
|
|
88
|
+
return WorkflowKind.DAG;
|
|
89
|
+
case -1:
|
|
90
|
+
case 'UNRECOGNIZED':
|
|
91
|
+
default:
|
|
92
|
+
return WorkflowKind.UNRECOGNIZED;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function workflowKindToJSON(object) {
|
|
96
|
+
switch (object) {
|
|
97
|
+
case WorkflowKind.FUNCTION:
|
|
98
|
+
return 'FUNCTION';
|
|
99
|
+
case WorkflowKind.DURABLE:
|
|
100
|
+
return 'DURABLE';
|
|
101
|
+
case WorkflowKind.DAG:
|
|
102
|
+
return 'DAG';
|
|
103
|
+
case WorkflowKind.UNRECOGNIZED:
|
|
104
|
+
default:
|
|
105
|
+
return 'UNRECOGNIZED';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
39
108
|
var ConcurrencyLimitStrategy;
|
|
40
109
|
(function (ConcurrencyLimitStrategy) {
|
|
41
110
|
ConcurrencyLimitStrategy[ConcurrencyLimitStrategy["CANCEL_IN_PROGRESS"] = 0] = "CANCEL_IN_PROGRESS";
|
|
@@ -79,6 +148,61 @@ function concurrencyLimitStrategyToJSON(object) {
|
|
|
79
148
|
return 'UNRECOGNIZED';
|
|
80
149
|
}
|
|
81
150
|
}
|
|
151
|
+
var WorkerLabelComparator;
|
|
152
|
+
(function (WorkerLabelComparator) {
|
|
153
|
+
WorkerLabelComparator[WorkerLabelComparator["EQUAL"] = 0] = "EQUAL";
|
|
154
|
+
WorkerLabelComparator[WorkerLabelComparator["NOT_EQUAL"] = 1] = "NOT_EQUAL";
|
|
155
|
+
WorkerLabelComparator[WorkerLabelComparator["GREATER_THAN"] = 2] = "GREATER_THAN";
|
|
156
|
+
WorkerLabelComparator[WorkerLabelComparator["GREATER_THAN_OR_EQUAL"] = 3] = "GREATER_THAN_OR_EQUAL";
|
|
157
|
+
WorkerLabelComparator[WorkerLabelComparator["LESS_THAN"] = 4] = "LESS_THAN";
|
|
158
|
+
WorkerLabelComparator[WorkerLabelComparator["LESS_THAN_OR_EQUAL"] = 5] = "LESS_THAN_OR_EQUAL";
|
|
159
|
+
WorkerLabelComparator[WorkerLabelComparator["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
160
|
+
})(WorkerLabelComparator || (exports.WorkerLabelComparator = WorkerLabelComparator = {}));
|
|
161
|
+
function workerLabelComparatorFromJSON(object) {
|
|
162
|
+
switch (object) {
|
|
163
|
+
case 0:
|
|
164
|
+
case 'EQUAL':
|
|
165
|
+
return WorkerLabelComparator.EQUAL;
|
|
166
|
+
case 1:
|
|
167
|
+
case 'NOT_EQUAL':
|
|
168
|
+
return WorkerLabelComparator.NOT_EQUAL;
|
|
169
|
+
case 2:
|
|
170
|
+
case 'GREATER_THAN':
|
|
171
|
+
return WorkerLabelComparator.GREATER_THAN;
|
|
172
|
+
case 3:
|
|
173
|
+
case 'GREATER_THAN_OR_EQUAL':
|
|
174
|
+
return WorkerLabelComparator.GREATER_THAN_OR_EQUAL;
|
|
175
|
+
case 4:
|
|
176
|
+
case 'LESS_THAN':
|
|
177
|
+
return WorkerLabelComparator.LESS_THAN;
|
|
178
|
+
case 5:
|
|
179
|
+
case 'LESS_THAN_OR_EQUAL':
|
|
180
|
+
return WorkerLabelComparator.LESS_THAN_OR_EQUAL;
|
|
181
|
+
case -1:
|
|
182
|
+
case 'UNRECOGNIZED':
|
|
183
|
+
default:
|
|
184
|
+
return WorkerLabelComparator.UNRECOGNIZED;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function workerLabelComparatorToJSON(object) {
|
|
188
|
+
switch (object) {
|
|
189
|
+
case WorkerLabelComparator.EQUAL:
|
|
190
|
+
return 'EQUAL';
|
|
191
|
+
case WorkerLabelComparator.NOT_EQUAL:
|
|
192
|
+
return 'NOT_EQUAL';
|
|
193
|
+
case WorkerLabelComparator.GREATER_THAN:
|
|
194
|
+
return 'GREATER_THAN';
|
|
195
|
+
case WorkerLabelComparator.GREATER_THAN_OR_EQUAL:
|
|
196
|
+
return 'GREATER_THAN_OR_EQUAL';
|
|
197
|
+
case WorkerLabelComparator.LESS_THAN:
|
|
198
|
+
return 'LESS_THAN';
|
|
199
|
+
case WorkerLabelComparator.LESS_THAN_OR_EQUAL:
|
|
200
|
+
return 'LESS_THAN_OR_EQUAL';
|
|
201
|
+
case WorkerLabelComparator.UNRECOGNIZED:
|
|
202
|
+
default:
|
|
203
|
+
return 'UNRECOGNIZED';
|
|
204
|
+
}
|
|
205
|
+
}
|
|
82
206
|
var RateLimitDuration;
|
|
83
207
|
(function (RateLimitDuration) {
|
|
84
208
|
RateLimitDuration[RateLimitDuration["SECOND"] = 0] = "SECOND";
|
|
@@ -208,6 +332,8 @@ function createBaseCreateWorkflowVersionOpts() {
|
|
|
208
332
|
scheduleTimeout: undefined,
|
|
209
333
|
cronInput: undefined,
|
|
210
334
|
onFailureJob: undefined,
|
|
335
|
+
sticky: undefined,
|
|
336
|
+
kind: undefined,
|
|
211
337
|
};
|
|
212
338
|
}
|
|
213
339
|
exports.CreateWorkflowVersionOpts = {
|
|
@@ -245,6 +371,12 @@ exports.CreateWorkflowVersionOpts = {
|
|
|
245
371
|
if (message.onFailureJob !== undefined) {
|
|
246
372
|
exports.CreateWorkflowJobOpts.encode(message.onFailureJob, writer.uint32(90).fork()).ldelim();
|
|
247
373
|
}
|
|
374
|
+
if (message.sticky !== undefined) {
|
|
375
|
+
writer.uint32(96).int32(message.sticky);
|
|
376
|
+
}
|
|
377
|
+
if (message.kind !== undefined) {
|
|
378
|
+
writer.uint32(104).int32(message.kind);
|
|
379
|
+
}
|
|
248
380
|
return writer;
|
|
249
381
|
},
|
|
250
382
|
decode(input, length) {
|
|
@@ -320,6 +452,18 @@ exports.CreateWorkflowVersionOpts = {
|
|
|
320
452
|
}
|
|
321
453
|
message.onFailureJob = exports.CreateWorkflowJobOpts.decode(reader, reader.uint32());
|
|
322
454
|
continue;
|
|
455
|
+
case 12:
|
|
456
|
+
if (tag !== 96) {
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
message.sticky = reader.int32();
|
|
460
|
+
continue;
|
|
461
|
+
case 13:
|
|
462
|
+
if (tag !== 104) {
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
message.kind = reader.int32();
|
|
466
|
+
continue;
|
|
323
467
|
}
|
|
324
468
|
if ((tag & 7) === 4 || tag === 0) {
|
|
325
469
|
break;
|
|
@@ -355,6 +499,8 @@ exports.CreateWorkflowVersionOpts = {
|
|
|
355
499
|
onFailureJob: isSet(object.onFailureJob)
|
|
356
500
|
? exports.CreateWorkflowJobOpts.fromJSON(object.onFailureJob)
|
|
357
501
|
: undefined,
|
|
502
|
+
sticky: isSet(object.sticky) ? stickyStrategyFromJSON(object.sticky) : undefined,
|
|
503
|
+
kind: isSet(object.kind) ? workflowKindFromJSON(object.kind) : undefined,
|
|
358
504
|
};
|
|
359
505
|
},
|
|
360
506
|
toJSON(message) {
|
|
@@ -393,13 +539,19 @@ exports.CreateWorkflowVersionOpts = {
|
|
|
393
539
|
if (message.onFailureJob !== undefined) {
|
|
394
540
|
obj.onFailureJob = exports.CreateWorkflowJobOpts.toJSON(message.onFailureJob);
|
|
395
541
|
}
|
|
542
|
+
if (message.sticky !== undefined) {
|
|
543
|
+
obj.sticky = stickyStrategyToJSON(message.sticky);
|
|
544
|
+
}
|
|
545
|
+
if (message.kind !== undefined) {
|
|
546
|
+
obj.kind = workflowKindToJSON(message.kind);
|
|
547
|
+
}
|
|
396
548
|
return obj;
|
|
397
549
|
},
|
|
398
550
|
create(base) {
|
|
399
551
|
return exports.CreateWorkflowVersionOpts.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
400
552
|
},
|
|
401
553
|
fromPartial(object) {
|
|
402
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
554
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
403
555
|
const message = createBaseCreateWorkflowVersionOpts();
|
|
404
556
|
message.name = (_a = object.name) !== null && _a !== void 0 ? _a : '';
|
|
405
557
|
message.description = (_b = object.description) !== null && _b !== void 0 ? _b : '';
|
|
@@ -418,6 +570,8 @@ exports.CreateWorkflowVersionOpts = {
|
|
|
418
570
|
object.onFailureJob !== undefined && object.onFailureJob !== null
|
|
419
571
|
? exports.CreateWorkflowJobOpts.fromPartial(object.onFailureJob)
|
|
420
572
|
: undefined;
|
|
573
|
+
message.sticky = (_k = object.sticky) !== null && _k !== void 0 ? _k : undefined;
|
|
574
|
+
message.kind = (_l = object.kind) !== null && _l !== void 0 ? _l : undefined;
|
|
421
575
|
return message;
|
|
422
576
|
},
|
|
423
577
|
};
|
|
@@ -588,6 +742,123 @@ exports.CreateWorkflowJobOpts = {
|
|
|
588
742
|
return message;
|
|
589
743
|
},
|
|
590
744
|
};
|
|
745
|
+
function createBaseDesiredWorkerLabels() {
|
|
746
|
+
return {
|
|
747
|
+
strValue: undefined,
|
|
748
|
+
intValue: undefined,
|
|
749
|
+
required: undefined,
|
|
750
|
+
comparator: undefined,
|
|
751
|
+
weight: undefined,
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
exports.DesiredWorkerLabels = {
|
|
755
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
756
|
+
if (message.strValue !== undefined) {
|
|
757
|
+
writer.uint32(10).string(message.strValue);
|
|
758
|
+
}
|
|
759
|
+
if (message.intValue !== undefined) {
|
|
760
|
+
writer.uint32(16).int32(message.intValue);
|
|
761
|
+
}
|
|
762
|
+
if (message.required !== undefined) {
|
|
763
|
+
writer.uint32(24).bool(message.required);
|
|
764
|
+
}
|
|
765
|
+
if (message.comparator !== undefined) {
|
|
766
|
+
writer.uint32(32).int32(message.comparator);
|
|
767
|
+
}
|
|
768
|
+
if (message.weight !== undefined) {
|
|
769
|
+
writer.uint32(40).int32(message.weight);
|
|
770
|
+
}
|
|
771
|
+
return writer;
|
|
772
|
+
},
|
|
773
|
+
decode(input, length) {
|
|
774
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
775
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
776
|
+
const message = createBaseDesiredWorkerLabels();
|
|
777
|
+
while (reader.pos < end) {
|
|
778
|
+
const tag = reader.uint32();
|
|
779
|
+
switch (tag >>> 3) {
|
|
780
|
+
case 1:
|
|
781
|
+
if (tag !== 10) {
|
|
782
|
+
break;
|
|
783
|
+
}
|
|
784
|
+
message.strValue = reader.string();
|
|
785
|
+
continue;
|
|
786
|
+
case 2:
|
|
787
|
+
if (tag !== 16) {
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
message.intValue = reader.int32();
|
|
791
|
+
continue;
|
|
792
|
+
case 3:
|
|
793
|
+
if (tag !== 24) {
|
|
794
|
+
break;
|
|
795
|
+
}
|
|
796
|
+
message.required = reader.bool();
|
|
797
|
+
continue;
|
|
798
|
+
case 4:
|
|
799
|
+
if (tag !== 32) {
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
802
|
+
message.comparator = reader.int32();
|
|
803
|
+
continue;
|
|
804
|
+
case 5:
|
|
805
|
+
if (tag !== 40) {
|
|
806
|
+
break;
|
|
807
|
+
}
|
|
808
|
+
message.weight = reader.int32();
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
812
|
+
break;
|
|
813
|
+
}
|
|
814
|
+
reader.skipType(tag & 7);
|
|
815
|
+
}
|
|
816
|
+
return message;
|
|
817
|
+
},
|
|
818
|
+
fromJSON(object) {
|
|
819
|
+
return {
|
|
820
|
+
strValue: isSet(object.strValue) ? globalThis.String(object.strValue) : undefined,
|
|
821
|
+
intValue: isSet(object.intValue) ? globalThis.Number(object.intValue) : undefined,
|
|
822
|
+
required: isSet(object.required) ? globalThis.Boolean(object.required) : undefined,
|
|
823
|
+
comparator: isSet(object.comparator)
|
|
824
|
+
? workerLabelComparatorFromJSON(object.comparator)
|
|
825
|
+
: undefined,
|
|
826
|
+
weight: isSet(object.weight) ? globalThis.Number(object.weight) : undefined,
|
|
827
|
+
};
|
|
828
|
+
},
|
|
829
|
+
toJSON(message) {
|
|
830
|
+
const obj = {};
|
|
831
|
+
if (message.strValue !== undefined) {
|
|
832
|
+
obj.strValue = message.strValue;
|
|
833
|
+
}
|
|
834
|
+
if (message.intValue !== undefined) {
|
|
835
|
+
obj.intValue = Math.round(message.intValue);
|
|
836
|
+
}
|
|
837
|
+
if (message.required !== undefined) {
|
|
838
|
+
obj.required = message.required;
|
|
839
|
+
}
|
|
840
|
+
if (message.comparator !== undefined) {
|
|
841
|
+
obj.comparator = workerLabelComparatorToJSON(message.comparator);
|
|
842
|
+
}
|
|
843
|
+
if (message.weight !== undefined) {
|
|
844
|
+
obj.weight = Math.round(message.weight);
|
|
845
|
+
}
|
|
846
|
+
return obj;
|
|
847
|
+
},
|
|
848
|
+
create(base) {
|
|
849
|
+
return exports.DesiredWorkerLabels.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
850
|
+
},
|
|
851
|
+
fromPartial(object) {
|
|
852
|
+
var _a, _b, _c, _d, _e;
|
|
853
|
+
const message = createBaseDesiredWorkerLabels();
|
|
854
|
+
message.strValue = (_a = object.strValue) !== null && _a !== void 0 ? _a : undefined;
|
|
855
|
+
message.intValue = (_b = object.intValue) !== null && _b !== void 0 ? _b : undefined;
|
|
856
|
+
message.required = (_c = object.required) !== null && _c !== void 0 ? _c : undefined;
|
|
857
|
+
message.comparator = (_d = object.comparator) !== null && _d !== void 0 ? _d : undefined;
|
|
858
|
+
message.weight = (_e = object.weight) !== null && _e !== void 0 ? _e : undefined;
|
|
859
|
+
return message;
|
|
860
|
+
},
|
|
861
|
+
};
|
|
591
862
|
function createBaseCreateWorkflowStepOpts() {
|
|
592
863
|
return {
|
|
593
864
|
readableId: '',
|
|
@@ -598,6 +869,7 @@ function createBaseCreateWorkflowStepOpts() {
|
|
|
598
869
|
userData: '',
|
|
599
870
|
retries: 0,
|
|
600
871
|
rateLimits: [],
|
|
872
|
+
workerLabels: {},
|
|
601
873
|
};
|
|
602
874
|
}
|
|
603
875
|
exports.CreateWorkflowStepOpts = {
|
|
@@ -626,6 +898,9 @@ exports.CreateWorkflowStepOpts = {
|
|
|
626
898
|
for (const v of message.rateLimits) {
|
|
627
899
|
exports.CreateStepRateLimit.encode(v, writer.uint32(66).fork()).ldelim();
|
|
628
900
|
}
|
|
901
|
+
Object.entries(message.workerLabels).forEach(([key, value]) => {
|
|
902
|
+
exports.CreateWorkflowStepOpts_WorkerLabelsEntry.encode({ key: key, value }, writer.uint32(74).fork()).ldelim();
|
|
903
|
+
});
|
|
629
904
|
return writer;
|
|
630
905
|
},
|
|
631
906
|
decode(input, length) {
|
|
@@ -683,6 +958,15 @@ exports.CreateWorkflowStepOpts = {
|
|
|
683
958
|
}
|
|
684
959
|
message.rateLimits.push(exports.CreateStepRateLimit.decode(reader, reader.uint32()));
|
|
685
960
|
continue;
|
|
961
|
+
case 9:
|
|
962
|
+
if (tag !== 74) {
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
const entry9 = exports.CreateWorkflowStepOpts_WorkerLabelsEntry.decode(reader, reader.uint32());
|
|
966
|
+
if (entry9.value !== undefined) {
|
|
967
|
+
message.workerLabels[entry9.key] = entry9.value;
|
|
968
|
+
}
|
|
969
|
+
continue;
|
|
686
970
|
}
|
|
687
971
|
if ((tag & 7) === 4 || tag === 0) {
|
|
688
972
|
break;
|
|
@@ -705,6 +989,12 @@ exports.CreateWorkflowStepOpts = {
|
|
|
705
989
|
rateLimits: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.rateLimits)
|
|
706
990
|
? object.rateLimits.map((e) => exports.CreateStepRateLimit.fromJSON(e))
|
|
707
991
|
: [],
|
|
992
|
+
workerLabels: isObject(object.workerLabels)
|
|
993
|
+
? Object.entries(object.workerLabels).reduce((acc, [key, value]) => {
|
|
994
|
+
acc[key] = exports.DesiredWorkerLabels.fromJSON(value);
|
|
995
|
+
return acc;
|
|
996
|
+
}, {})
|
|
997
|
+
: {},
|
|
708
998
|
};
|
|
709
999
|
},
|
|
710
1000
|
toJSON(message) {
|
|
@@ -734,13 +1024,22 @@ exports.CreateWorkflowStepOpts = {
|
|
|
734
1024
|
if ((_b = message.rateLimits) === null || _b === void 0 ? void 0 : _b.length) {
|
|
735
1025
|
obj.rateLimits = message.rateLimits.map((e) => exports.CreateStepRateLimit.toJSON(e));
|
|
736
1026
|
}
|
|
1027
|
+
if (message.workerLabels) {
|
|
1028
|
+
const entries = Object.entries(message.workerLabels);
|
|
1029
|
+
if (entries.length > 0) {
|
|
1030
|
+
obj.workerLabels = {};
|
|
1031
|
+
entries.forEach(([k, v]) => {
|
|
1032
|
+
obj.workerLabels[k] = exports.DesiredWorkerLabels.toJSON(v);
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
737
1036
|
return obj;
|
|
738
1037
|
},
|
|
739
1038
|
create(base) {
|
|
740
1039
|
return exports.CreateWorkflowStepOpts.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
741
1040
|
},
|
|
742
1041
|
fromPartial(object) {
|
|
743
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1042
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
744
1043
|
const message = createBaseCreateWorkflowStepOpts();
|
|
745
1044
|
message.readableId = (_a = object.readableId) !== null && _a !== void 0 ? _a : '';
|
|
746
1045
|
message.action = (_b = object.action) !== null && _b !== void 0 ? _b : '';
|
|
@@ -750,6 +1049,82 @@ exports.CreateWorkflowStepOpts = {
|
|
|
750
1049
|
message.userData = (_f = object.userData) !== null && _f !== void 0 ? _f : '';
|
|
751
1050
|
message.retries = (_g = object.retries) !== null && _g !== void 0 ? _g : 0;
|
|
752
1051
|
message.rateLimits = ((_h = object.rateLimits) === null || _h === void 0 ? void 0 : _h.map((e) => exports.CreateStepRateLimit.fromPartial(e))) || [];
|
|
1052
|
+
message.workerLabels = Object.entries((_j = object.workerLabels) !== null && _j !== void 0 ? _j : {}).reduce((acc, [key, value]) => {
|
|
1053
|
+
if (value !== undefined) {
|
|
1054
|
+
acc[key] = exports.DesiredWorkerLabels.fromPartial(value);
|
|
1055
|
+
}
|
|
1056
|
+
return acc;
|
|
1057
|
+
}, {});
|
|
1058
|
+
return message;
|
|
1059
|
+
},
|
|
1060
|
+
};
|
|
1061
|
+
function createBaseCreateWorkflowStepOpts_WorkerLabelsEntry() {
|
|
1062
|
+
return { key: '', value: undefined };
|
|
1063
|
+
}
|
|
1064
|
+
exports.CreateWorkflowStepOpts_WorkerLabelsEntry = {
|
|
1065
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1066
|
+
if (message.key !== '') {
|
|
1067
|
+
writer.uint32(10).string(message.key);
|
|
1068
|
+
}
|
|
1069
|
+
if (message.value !== undefined) {
|
|
1070
|
+
exports.DesiredWorkerLabels.encode(message.value, writer.uint32(18).fork()).ldelim();
|
|
1071
|
+
}
|
|
1072
|
+
return writer;
|
|
1073
|
+
},
|
|
1074
|
+
decode(input, length) {
|
|
1075
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1076
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1077
|
+
const message = createBaseCreateWorkflowStepOpts_WorkerLabelsEntry();
|
|
1078
|
+
while (reader.pos < end) {
|
|
1079
|
+
const tag = reader.uint32();
|
|
1080
|
+
switch (tag >>> 3) {
|
|
1081
|
+
case 1:
|
|
1082
|
+
if (tag !== 10) {
|
|
1083
|
+
break;
|
|
1084
|
+
}
|
|
1085
|
+
message.key = reader.string();
|
|
1086
|
+
continue;
|
|
1087
|
+
case 2:
|
|
1088
|
+
if (tag !== 18) {
|
|
1089
|
+
break;
|
|
1090
|
+
}
|
|
1091
|
+
message.value = exports.DesiredWorkerLabels.decode(reader, reader.uint32());
|
|
1092
|
+
continue;
|
|
1093
|
+
}
|
|
1094
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1095
|
+
break;
|
|
1096
|
+
}
|
|
1097
|
+
reader.skipType(tag & 7);
|
|
1098
|
+
}
|
|
1099
|
+
return message;
|
|
1100
|
+
},
|
|
1101
|
+
fromJSON(object) {
|
|
1102
|
+
return {
|
|
1103
|
+
key: isSet(object.key) ? globalThis.String(object.key) : '',
|
|
1104
|
+
value: isSet(object.value) ? exports.DesiredWorkerLabels.fromJSON(object.value) : undefined,
|
|
1105
|
+
};
|
|
1106
|
+
},
|
|
1107
|
+
toJSON(message) {
|
|
1108
|
+
const obj = {};
|
|
1109
|
+
if (message.key !== '') {
|
|
1110
|
+
obj.key = message.key;
|
|
1111
|
+
}
|
|
1112
|
+
if (message.value !== undefined) {
|
|
1113
|
+
obj.value = exports.DesiredWorkerLabels.toJSON(message.value);
|
|
1114
|
+
}
|
|
1115
|
+
return obj;
|
|
1116
|
+
},
|
|
1117
|
+
create(base) {
|
|
1118
|
+
return exports.CreateWorkflowStepOpts_WorkerLabelsEntry.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1119
|
+
},
|
|
1120
|
+
fromPartial(object) {
|
|
1121
|
+
var _a;
|
|
1122
|
+
const message = createBaseCreateWorkflowStepOpts_WorkerLabelsEntry();
|
|
1123
|
+
message.key = (_a = object.key) !== null && _a !== void 0 ? _a : '';
|
|
1124
|
+
message.value =
|
|
1125
|
+
object.value !== undefined && object.value !== null
|
|
1126
|
+
? exports.DesiredWorkerLabels.fromPartial(object.value)
|
|
1127
|
+
: undefined;
|
|
753
1128
|
return message;
|
|
754
1129
|
},
|
|
755
1130
|
};
|
|
@@ -1280,6 +1655,7 @@ function createBaseTriggerWorkflowRequest() {
|
|
|
1280
1655
|
childIndex: undefined,
|
|
1281
1656
|
childKey: undefined,
|
|
1282
1657
|
additionalMetadata: undefined,
|
|
1658
|
+
desiredWorkerId: undefined,
|
|
1283
1659
|
};
|
|
1284
1660
|
}
|
|
1285
1661
|
exports.TriggerWorkflowRequest = {
|
|
@@ -1305,6 +1681,9 @@ exports.TriggerWorkflowRequest = {
|
|
|
1305
1681
|
if (message.additionalMetadata !== undefined) {
|
|
1306
1682
|
writer.uint32(58).string(message.additionalMetadata);
|
|
1307
1683
|
}
|
|
1684
|
+
if (message.desiredWorkerId !== undefined) {
|
|
1685
|
+
writer.uint32(66).string(message.desiredWorkerId);
|
|
1686
|
+
}
|
|
1308
1687
|
return writer;
|
|
1309
1688
|
},
|
|
1310
1689
|
decode(input, length) {
|
|
@@ -1356,6 +1735,12 @@ exports.TriggerWorkflowRequest = {
|
|
|
1356
1735
|
}
|
|
1357
1736
|
message.additionalMetadata = reader.string();
|
|
1358
1737
|
continue;
|
|
1738
|
+
case 8:
|
|
1739
|
+
if (tag !== 66) {
|
|
1740
|
+
break;
|
|
1741
|
+
}
|
|
1742
|
+
message.desiredWorkerId = reader.string();
|
|
1743
|
+
continue;
|
|
1359
1744
|
}
|
|
1360
1745
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1361
1746
|
break;
|
|
@@ -1377,6 +1762,9 @@ exports.TriggerWorkflowRequest = {
|
|
|
1377
1762
|
additionalMetadata: isSet(object.additionalMetadata)
|
|
1378
1763
|
? globalThis.String(object.additionalMetadata)
|
|
1379
1764
|
: undefined,
|
|
1765
|
+
desiredWorkerId: isSet(object.desiredWorkerId)
|
|
1766
|
+
? globalThis.String(object.desiredWorkerId)
|
|
1767
|
+
: undefined,
|
|
1380
1768
|
};
|
|
1381
1769
|
},
|
|
1382
1770
|
toJSON(message) {
|
|
@@ -1402,13 +1790,16 @@ exports.TriggerWorkflowRequest = {
|
|
|
1402
1790
|
if (message.additionalMetadata !== undefined) {
|
|
1403
1791
|
obj.additionalMetadata = message.additionalMetadata;
|
|
1404
1792
|
}
|
|
1793
|
+
if (message.desiredWorkerId !== undefined) {
|
|
1794
|
+
obj.desiredWorkerId = message.desiredWorkerId;
|
|
1795
|
+
}
|
|
1405
1796
|
return obj;
|
|
1406
1797
|
},
|
|
1407
1798
|
create(base) {
|
|
1408
1799
|
return exports.TriggerWorkflowRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1409
1800
|
},
|
|
1410
1801
|
fromPartial(object) {
|
|
1411
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1802
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1412
1803
|
const message = createBaseTriggerWorkflowRequest();
|
|
1413
1804
|
message.name = (_a = object.name) !== null && _a !== void 0 ? _a : '';
|
|
1414
1805
|
message.input = (_b = object.input) !== null && _b !== void 0 ? _b : '';
|
|
@@ -1417,6 +1808,7 @@ exports.TriggerWorkflowRequest = {
|
|
|
1417
1808
|
message.childIndex = (_e = object.childIndex) !== null && _e !== void 0 ? _e : undefined;
|
|
1418
1809
|
message.childKey = (_f = object.childKey) !== null && _f !== void 0 ? _f : undefined;
|
|
1419
1810
|
message.additionalMetadata = (_g = object.additionalMetadata) !== null && _g !== void 0 ? _g : undefined;
|
|
1811
|
+
message.desiredWorkerId = (_h = object.desiredWorkerId) !== null && _h !== void 0 ? _h : undefined;
|
|
1420
1812
|
return message;
|
|
1421
1813
|
},
|
|
1422
1814
|
};
|
|
@@ -1650,6 +2042,9 @@ function fromJsonTimestamp(o) {
|
|
|
1650
2042
|
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
1651
2043
|
}
|
|
1652
2044
|
}
|
|
2045
|
+
function isObject(value) {
|
|
2046
|
+
return typeof value === 'object' && value !== null;
|
|
2047
|
+
}
|
|
1653
2048
|
function isSet(value) {
|
|
1654
2049
|
return value !== null && value !== undefined;
|
|
1655
2050
|
}
|