@hatchet-dev/typescript-sdk 0.0.2 → 0.1.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 +2 -3
- package/dist/clients/admin/admin-client.d.ts +2 -4
- package/dist/clients/admin/admin-client.js +2 -5
- package/dist/clients/dispatcher/action-listener.d.ts +4 -2
- package/dist/clients/dispatcher/dispatcher-client.d.ts +6 -3
- package/dist/clients/dispatcher/dispatcher-client.js +16 -4
- package/dist/clients/event/event-client.d.ts +4 -2
- package/dist/clients/event/event-client.js +6 -2
- package/dist/clients/hatchet-client/hatchet-client.d.ts +2 -2
- package/dist/clients/hatchet-client/hatchet-client.js +2 -2
- package/dist/clients/worker/worker.d.ts +13 -10
- package/dist/clients/worker/worker.js +117 -28
- package/dist/package.json +73 -0
- package/dist/protoc/dispatcher/dispatcher.d.ts +82 -22
- package/dist/protoc/dispatcher/dispatcher.js +292 -58
- package/dist/protoc/workflows/workflows.d.ts +26 -0
- package/dist/protoc/workflows/workflows.js +138 -1
- package/dist/step.d.ts +3 -0
- package/dist/step.js +2 -0
- package/dist/workflow.d.ts +33 -0
- package/dist/workflow.js +11 -1
- package/package.json +8 -3
- package/dist/clients/admin/admin-client.test.d.ts +0 -1
- package/dist/clients/admin/admin-client.test.js +0 -101
- package/dist/clients/dispatcher/action-listener.test.d.ts +0 -4
- package/dist/clients/dispatcher/action-listener.test.js +0 -277
- package/dist/clients/dispatcher/dispatcher-client.test.d.ts +0 -1
- package/dist/clients/dispatcher/dispatcher-client.test.js +0 -99
- package/dist/clients/event/event-client.test.d.ts +0 -1
- package/dist/clients/event/event-client.test.js +0 -60
- package/dist/clients/hatchet-client/hatchet-client.test.d.ts +0 -2
- package/dist/clients/hatchet-client/hatchet-client.test.js +0 -135
- package/dist/clients/worker/worker.test.d.ts +0 -1
- package/dist/clients/worker/worker.test.js +0 -256
- package/dist/util/config-loader/config-loader.test.d.ts +0 -1
- package/dist/util/config-loader/config-loader.test.js +0 -72
- package/dist/util/hatchet-promise/hatchet-promise.test.d.ts +0 -1
- package/dist/util/hatchet-promise/hatchet-promise.test.js +0 -40
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.DispatcherDefinition = exports.ActionEventResponse = exports.
|
|
26
|
+
exports.DispatcherDefinition = exports.ActionEventResponse = exports.StepActionEvent = exports.GroupKeyActionEvent = exports.WorkerUnsubscribeResponse = exports.WorkerUnsubscribeRequest = exports.WorkerListenRequest = exports.AssignedAction = exports.WorkerRegisterResponse = exports.WorkerRegisterRequest = exports.stepActionEventTypeToJSON = exports.stepActionEventTypeFromJSON = exports.StepActionEventType = exports.groupKeyActionEventTypeToJSON = exports.groupKeyActionEventTypeFromJSON = exports.GroupKeyActionEventType = exports.actionTypeToJSON = exports.actionTypeFromJSON = exports.ActionType = exports.protobufPackage = void 0;
|
|
27
27
|
const _m0 = __importStar(require("protobufjs/minimal"));
|
|
28
28
|
const timestamp_1 = require("../google/protobuf/timestamp");
|
|
29
29
|
exports.protobufPackage = "";
|
|
@@ -31,6 +31,7 @@ var ActionType;
|
|
|
31
31
|
(function (ActionType) {
|
|
32
32
|
ActionType[ActionType["START_STEP_RUN"] = 0] = "START_STEP_RUN";
|
|
33
33
|
ActionType[ActionType["CANCEL_STEP_RUN"] = 1] = "CANCEL_STEP_RUN";
|
|
34
|
+
ActionType[ActionType["START_GET_GROUP_KEY"] = 2] = "START_GET_GROUP_KEY";
|
|
34
35
|
ActionType[ActionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
35
36
|
})(ActionType || (exports.ActionType = ActionType = {}));
|
|
36
37
|
function actionTypeFromJSON(object) {
|
|
@@ -41,6 +42,9 @@ function actionTypeFromJSON(object) {
|
|
|
41
42
|
case 1:
|
|
42
43
|
case "CANCEL_STEP_RUN":
|
|
43
44
|
return ActionType.CANCEL_STEP_RUN;
|
|
45
|
+
case 2:
|
|
46
|
+
case "START_GET_GROUP_KEY":
|
|
47
|
+
return ActionType.START_GET_GROUP_KEY;
|
|
44
48
|
case -1:
|
|
45
49
|
case "UNRECOGNIZED":
|
|
46
50
|
default:
|
|
@@ -54,57 +58,104 @@ function actionTypeToJSON(object) {
|
|
|
54
58
|
return "START_STEP_RUN";
|
|
55
59
|
case ActionType.CANCEL_STEP_RUN:
|
|
56
60
|
return "CANCEL_STEP_RUN";
|
|
61
|
+
case ActionType.START_GET_GROUP_KEY:
|
|
62
|
+
return "START_GET_GROUP_KEY";
|
|
57
63
|
case ActionType.UNRECOGNIZED:
|
|
58
64
|
default:
|
|
59
65
|
return "UNRECOGNIZED";
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
exports.actionTypeToJSON = actionTypeToJSON;
|
|
63
|
-
var
|
|
64
|
-
(function (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
})(
|
|
71
|
-
function
|
|
69
|
+
var GroupKeyActionEventType;
|
|
70
|
+
(function (GroupKeyActionEventType) {
|
|
71
|
+
GroupKeyActionEventType[GroupKeyActionEventType["GROUP_KEY_EVENT_TYPE_UNKNOWN"] = 0] = "GROUP_KEY_EVENT_TYPE_UNKNOWN";
|
|
72
|
+
GroupKeyActionEventType[GroupKeyActionEventType["GROUP_KEY_EVENT_TYPE_STARTED"] = 1] = "GROUP_KEY_EVENT_TYPE_STARTED";
|
|
73
|
+
GroupKeyActionEventType[GroupKeyActionEventType["GROUP_KEY_EVENT_TYPE_COMPLETED"] = 2] = "GROUP_KEY_EVENT_TYPE_COMPLETED";
|
|
74
|
+
GroupKeyActionEventType[GroupKeyActionEventType["GROUP_KEY_EVENT_TYPE_FAILED"] = 3] = "GROUP_KEY_EVENT_TYPE_FAILED";
|
|
75
|
+
GroupKeyActionEventType[GroupKeyActionEventType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
76
|
+
})(GroupKeyActionEventType || (exports.GroupKeyActionEventType = GroupKeyActionEventType = {}));
|
|
77
|
+
function groupKeyActionEventTypeFromJSON(object) {
|
|
78
|
+
switch (object) {
|
|
79
|
+
case 0:
|
|
80
|
+
case "GROUP_KEY_EVENT_TYPE_UNKNOWN":
|
|
81
|
+
return GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_UNKNOWN;
|
|
82
|
+
case 1:
|
|
83
|
+
case "GROUP_KEY_EVENT_TYPE_STARTED":
|
|
84
|
+
return GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_STARTED;
|
|
85
|
+
case 2:
|
|
86
|
+
case "GROUP_KEY_EVENT_TYPE_COMPLETED":
|
|
87
|
+
return GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_COMPLETED;
|
|
88
|
+
case 3:
|
|
89
|
+
case "GROUP_KEY_EVENT_TYPE_FAILED":
|
|
90
|
+
return GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_FAILED;
|
|
91
|
+
case -1:
|
|
92
|
+
case "UNRECOGNIZED":
|
|
93
|
+
default:
|
|
94
|
+
return GroupKeyActionEventType.UNRECOGNIZED;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.groupKeyActionEventTypeFromJSON = groupKeyActionEventTypeFromJSON;
|
|
98
|
+
function groupKeyActionEventTypeToJSON(object) {
|
|
99
|
+
switch (object) {
|
|
100
|
+
case GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_UNKNOWN:
|
|
101
|
+
return "GROUP_KEY_EVENT_TYPE_UNKNOWN";
|
|
102
|
+
case GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_STARTED:
|
|
103
|
+
return "GROUP_KEY_EVENT_TYPE_STARTED";
|
|
104
|
+
case GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_COMPLETED:
|
|
105
|
+
return "GROUP_KEY_EVENT_TYPE_COMPLETED";
|
|
106
|
+
case GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_FAILED:
|
|
107
|
+
return "GROUP_KEY_EVENT_TYPE_FAILED";
|
|
108
|
+
case GroupKeyActionEventType.UNRECOGNIZED:
|
|
109
|
+
default:
|
|
110
|
+
return "UNRECOGNIZED";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.groupKeyActionEventTypeToJSON = groupKeyActionEventTypeToJSON;
|
|
114
|
+
var StepActionEventType;
|
|
115
|
+
(function (StepActionEventType) {
|
|
116
|
+
StepActionEventType[StepActionEventType["STEP_EVENT_TYPE_UNKNOWN"] = 0] = "STEP_EVENT_TYPE_UNKNOWN";
|
|
117
|
+
StepActionEventType[StepActionEventType["STEP_EVENT_TYPE_STARTED"] = 1] = "STEP_EVENT_TYPE_STARTED";
|
|
118
|
+
StepActionEventType[StepActionEventType["STEP_EVENT_TYPE_COMPLETED"] = 2] = "STEP_EVENT_TYPE_COMPLETED";
|
|
119
|
+
StepActionEventType[StepActionEventType["STEP_EVENT_TYPE_FAILED"] = 3] = "STEP_EVENT_TYPE_FAILED";
|
|
120
|
+
StepActionEventType[StepActionEventType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
121
|
+
})(StepActionEventType || (exports.StepActionEventType = StepActionEventType = {}));
|
|
122
|
+
function stepActionEventTypeFromJSON(object) {
|
|
72
123
|
switch (object) {
|
|
73
124
|
case 0:
|
|
74
125
|
case "STEP_EVENT_TYPE_UNKNOWN":
|
|
75
|
-
return
|
|
126
|
+
return StepActionEventType.STEP_EVENT_TYPE_UNKNOWN;
|
|
76
127
|
case 1:
|
|
77
128
|
case "STEP_EVENT_TYPE_STARTED":
|
|
78
|
-
return
|
|
129
|
+
return StepActionEventType.STEP_EVENT_TYPE_STARTED;
|
|
79
130
|
case 2:
|
|
80
131
|
case "STEP_EVENT_TYPE_COMPLETED":
|
|
81
|
-
return
|
|
132
|
+
return StepActionEventType.STEP_EVENT_TYPE_COMPLETED;
|
|
82
133
|
case 3:
|
|
83
134
|
case "STEP_EVENT_TYPE_FAILED":
|
|
84
|
-
return
|
|
135
|
+
return StepActionEventType.STEP_EVENT_TYPE_FAILED;
|
|
85
136
|
case -1:
|
|
86
137
|
case "UNRECOGNIZED":
|
|
87
138
|
default:
|
|
88
|
-
return
|
|
139
|
+
return StepActionEventType.UNRECOGNIZED;
|
|
89
140
|
}
|
|
90
141
|
}
|
|
91
|
-
exports.
|
|
92
|
-
function
|
|
142
|
+
exports.stepActionEventTypeFromJSON = stepActionEventTypeFromJSON;
|
|
143
|
+
function stepActionEventTypeToJSON(object) {
|
|
93
144
|
switch (object) {
|
|
94
|
-
case
|
|
145
|
+
case StepActionEventType.STEP_EVENT_TYPE_UNKNOWN:
|
|
95
146
|
return "STEP_EVENT_TYPE_UNKNOWN";
|
|
96
|
-
case
|
|
147
|
+
case StepActionEventType.STEP_EVENT_TYPE_STARTED:
|
|
97
148
|
return "STEP_EVENT_TYPE_STARTED";
|
|
98
|
-
case
|
|
149
|
+
case StepActionEventType.STEP_EVENT_TYPE_COMPLETED:
|
|
99
150
|
return "STEP_EVENT_TYPE_COMPLETED";
|
|
100
|
-
case
|
|
151
|
+
case StepActionEventType.STEP_EVENT_TYPE_FAILED:
|
|
101
152
|
return "STEP_EVENT_TYPE_FAILED";
|
|
102
|
-
case
|
|
153
|
+
case StepActionEventType.UNRECOGNIZED:
|
|
103
154
|
default:
|
|
104
155
|
return "UNRECOGNIZED";
|
|
105
156
|
}
|
|
106
157
|
}
|
|
107
|
-
exports.
|
|
158
|
+
exports.stepActionEventTypeToJSON = stepActionEventTypeToJSON;
|
|
108
159
|
function createBaseWorkerRegisterRequest() {
|
|
109
160
|
return { workerName: "", actions: [], services: [] };
|
|
110
161
|
}
|
|
@@ -271,6 +322,8 @@ exports.WorkerRegisterResponse = {
|
|
|
271
322
|
function createBaseAssignedAction() {
|
|
272
323
|
return {
|
|
273
324
|
tenantId: "",
|
|
325
|
+
workflowRunId: "",
|
|
326
|
+
getGroupKeyRunId: "",
|
|
274
327
|
jobId: "",
|
|
275
328
|
jobName: "",
|
|
276
329
|
jobRunId: "",
|
|
@@ -286,29 +339,35 @@ exports.AssignedAction = {
|
|
|
286
339
|
if (message.tenantId !== "") {
|
|
287
340
|
writer.uint32(10).string(message.tenantId);
|
|
288
341
|
}
|
|
342
|
+
if (message.workflowRunId !== "") {
|
|
343
|
+
writer.uint32(18).string(message.workflowRunId);
|
|
344
|
+
}
|
|
345
|
+
if (message.getGroupKeyRunId !== "") {
|
|
346
|
+
writer.uint32(26).string(message.getGroupKeyRunId);
|
|
347
|
+
}
|
|
289
348
|
if (message.jobId !== "") {
|
|
290
|
-
writer.uint32(
|
|
349
|
+
writer.uint32(34).string(message.jobId);
|
|
291
350
|
}
|
|
292
351
|
if (message.jobName !== "") {
|
|
293
|
-
writer.uint32(
|
|
352
|
+
writer.uint32(42).string(message.jobName);
|
|
294
353
|
}
|
|
295
354
|
if (message.jobRunId !== "") {
|
|
296
|
-
writer.uint32(
|
|
355
|
+
writer.uint32(50).string(message.jobRunId);
|
|
297
356
|
}
|
|
298
357
|
if (message.stepId !== "") {
|
|
299
|
-
writer.uint32(
|
|
358
|
+
writer.uint32(58).string(message.stepId);
|
|
300
359
|
}
|
|
301
360
|
if (message.stepRunId !== "") {
|
|
302
|
-
writer.uint32(
|
|
361
|
+
writer.uint32(66).string(message.stepRunId);
|
|
303
362
|
}
|
|
304
363
|
if (message.actionId !== "") {
|
|
305
|
-
writer.uint32(
|
|
364
|
+
writer.uint32(74).string(message.actionId);
|
|
306
365
|
}
|
|
307
366
|
if (message.actionType !== 0) {
|
|
308
|
-
writer.uint32(
|
|
367
|
+
writer.uint32(80).int32(message.actionType);
|
|
309
368
|
}
|
|
310
369
|
if (message.actionPayload !== "") {
|
|
311
|
-
writer.uint32(
|
|
370
|
+
writer.uint32(90).string(message.actionPayload);
|
|
312
371
|
}
|
|
313
372
|
return writer;
|
|
314
373
|
},
|
|
@@ -329,48 +388,60 @@ exports.AssignedAction = {
|
|
|
329
388
|
if (tag !== 18) {
|
|
330
389
|
break;
|
|
331
390
|
}
|
|
332
|
-
message.
|
|
391
|
+
message.workflowRunId = reader.string();
|
|
333
392
|
continue;
|
|
334
393
|
case 3:
|
|
335
394
|
if (tag !== 26) {
|
|
336
395
|
break;
|
|
337
396
|
}
|
|
338
|
-
message.
|
|
397
|
+
message.getGroupKeyRunId = reader.string();
|
|
339
398
|
continue;
|
|
340
399
|
case 4:
|
|
341
400
|
if (tag !== 34) {
|
|
342
401
|
break;
|
|
343
402
|
}
|
|
344
|
-
message.
|
|
403
|
+
message.jobId = reader.string();
|
|
345
404
|
continue;
|
|
346
405
|
case 5:
|
|
347
406
|
if (tag !== 42) {
|
|
348
407
|
break;
|
|
349
408
|
}
|
|
350
|
-
message.
|
|
409
|
+
message.jobName = reader.string();
|
|
351
410
|
continue;
|
|
352
411
|
case 6:
|
|
353
412
|
if (tag !== 50) {
|
|
354
413
|
break;
|
|
355
414
|
}
|
|
356
|
-
message.
|
|
415
|
+
message.jobRunId = reader.string();
|
|
357
416
|
continue;
|
|
358
417
|
case 7:
|
|
359
418
|
if (tag !== 58) {
|
|
360
419
|
break;
|
|
361
420
|
}
|
|
362
|
-
message.
|
|
421
|
+
message.stepId = reader.string();
|
|
363
422
|
continue;
|
|
364
423
|
case 8:
|
|
365
|
-
if (tag !==
|
|
424
|
+
if (tag !== 66) {
|
|
366
425
|
break;
|
|
367
426
|
}
|
|
368
|
-
message.
|
|
427
|
+
message.stepRunId = reader.string();
|
|
369
428
|
continue;
|
|
370
429
|
case 9:
|
|
371
430
|
if (tag !== 74) {
|
|
372
431
|
break;
|
|
373
432
|
}
|
|
433
|
+
message.actionId = reader.string();
|
|
434
|
+
continue;
|
|
435
|
+
case 10:
|
|
436
|
+
if (tag !== 80) {
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
message.actionType = reader.int32();
|
|
440
|
+
continue;
|
|
441
|
+
case 11:
|
|
442
|
+
if (tag !== 90) {
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
374
445
|
message.actionPayload = reader.string();
|
|
375
446
|
continue;
|
|
376
447
|
}
|
|
@@ -384,6 +455,8 @@ exports.AssignedAction = {
|
|
|
384
455
|
fromJSON(object) {
|
|
385
456
|
return {
|
|
386
457
|
tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
|
|
458
|
+
workflowRunId: isSet(object.workflowRunId) ? globalThis.String(object.workflowRunId) : "",
|
|
459
|
+
getGroupKeyRunId: isSet(object.getGroupKeyRunId) ? globalThis.String(object.getGroupKeyRunId) : "",
|
|
387
460
|
jobId: isSet(object.jobId) ? globalThis.String(object.jobId) : "",
|
|
388
461
|
jobName: isSet(object.jobName) ? globalThis.String(object.jobName) : "",
|
|
389
462
|
jobRunId: isSet(object.jobRunId) ? globalThis.String(object.jobRunId) : "",
|
|
@@ -399,6 +472,12 @@ exports.AssignedAction = {
|
|
|
399
472
|
if (message.tenantId !== "") {
|
|
400
473
|
obj.tenantId = message.tenantId;
|
|
401
474
|
}
|
|
475
|
+
if (message.workflowRunId !== "") {
|
|
476
|
+
obj.workflowRunId = message.workflowRunId;
|
|
477
|
+
}
|
|
478
|
+
if (message.getGroupKeyRunId !== "") {
|
|
479
|
+
obj.getGroupKeyRunId = message.getGroupKeyRunId;
|
|
480
|
+
}
|
|
402
481
|
if (message.jobId !== "") {
|
|
403
482
|
obj.jobId = message.jobId;
|
|
404
483
|
}
|
|
@@ -429,17 +508,19 @@ exports.AssignedAction = {
|
|
|
429
508
|
return exports.AssignedAction.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
430
509
|
},
|
|
431
510
|
fromPartial(object) {
|
|
432
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
511
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
433
512
|
const message = createBaseAssignedAction();
|
|
434
513
|
message.tenantId = (_a = object.tenantId) !== null && _a !== void 0 ? _a : "";
|
|
435
|
-
message.
|
|
436
|
-
message.
|
|
437
|
-
message.
|
|
438
|
-
message.
|
|
439
|
-
message.
|
|
440
|
-
message.
|
|
441
|
-
message.
|
|
442
|
-
message.
|
|
514
|
+
message.workflowRunId = (_b = object.workflowRunId) !== null && _b !== void 0 ? _b : "";
|
|
515
|
+
message.getGroupKeyRunId = (_c = object.getGroupKeyRunId) !== null && _c !== void 0 ? _c : "";
|
|
516
|
+
message.jobId = (_d = object.jobId) !== null && _d !== void 0 ? _d : "";
|
|
517
|
+
message.jobName = (_e = object.jobName) !== null && _e !== void 0 ? _e : "";
|
|
518
|
+
message.jobRunId = (_f = object.jobRunId) !== null && _f !== void 0 ? _f : "";
|
|
519
|
+
message.stepId = (_g = object.stepId) !== null && _g !== void 0 ? _g : "";
|
|
520
|
+
message.stepRunId = (_h = object.stepRunId) !== null && _h !== void 0 ? _h : "";
|
|
521
|
+
message.actionId = (_j = object.actionId) !== null && _j !== void 0 ? _j : "";
|
|
522
|
+
message.actionType = (_k = object.actionType) !== null && _k !== void 0 ? _k : 0;
|
|
523
|
+
message.actionPayload = (_l = object.actionPayload) !== null && _l !== void 0 ? _l : "";
|
|
443
524
|
return message;
|
|
444
525
|
},
|
|
445
526
|
};
|
|
@@ -612,7 +693,152 @@ exports.WorkerUnsubscribeResponse = {
|
|
|
612
693
|
return message;
|
|
613
694
|
},
|
|
614
695
|
};
|
|
615
|
-
function
|
|
696
|
+
function createBaseGroupKeyActionEvent() {
|
|
697
|
+
return {
|
|
698
|
+
workerId: "",
|
|
699
|
+
workflowRunId: "",
|
|
700
|
+
getGroupKeyRunId: "",
|
|
701
|
+
actionId: "",
|
|
702
|
+
eventTimestamp: undefined,
|
|
703
|
+
eventType: 0,
|
|
704
|
+
eventPayload: "",
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
exports.GroupKeyActionEvent = {
|
|
708
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
709
|
+
if (message.workerId !== "") {
|
|
710
|
+
writer.uint32(10).string(message.workerId);
|
|
711
|
+
}
|
|
712
|
+
if (message.workflowRunId !== "") {
|
|
713
|
+
writer.uint32(18).string(message.workflowRunId);
|
|
714
|
+
}
|
|
715
|
+
if (message.getGroupKeyRunId !== "") {
|
|
716
|
+
writer.uint32(26).string(message.getGroupKeyRunId);
|
|
717
|
+
}
|
|
718
|
+
if (message.actionId !== "") {
|
|
719
|
+
writer.uint32(34).string(message.actionId);
|
|
720
|
+
}
|
|
721
|
+
if (message.eventTimestamp !== undefined) {
|
|
722
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.eventTimestamp), writer.uint32(42).fork()).ldelim();
|
|
723
|
+
}
|
|
724
|
+
if (message.eventType !== 0) {
|
|
725
|
+
writer.uint32(48).int32(message.eventType);
|
|
726
|
+
}
|
|
727
|
+
if (message.eventPayload !== "") {
|
|
728
|
+
writer.uint32(58).string(message.eventPayload);
|
|
729
|
+
}
|
|
730
|
+
return writer;
|
|
731
|
+
},
|
|
732
|
+
decode(input, length) {
|
|
733
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
734
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
735
|
+
const message = createBaseGroupKeyActionEvent();
|
|
736
|
+
while (reader.pos < end) {
|
|
737
|
+
const tag = reader.uint32();
|
|
738
|
+
switch (tag >>> 3) {
|
|
739
|
+
case 1:
|
|
740
|
+
if (tag !== 10) {
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
message.workerId = reader.string();
|
|
744
|
+
continue;
|
|
745
|
+
case 2:
|
|
746
|
+
if (tag !== 18) {
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
message.workflowRunId = reader.string();
|
|
750
|
+
continue;
|
|
751
|
+
case 3:
|
|
752
|
+
if (tag !== 26) {
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
message.getGroupKeyRunId = reader.string();
|
|
756
|
+
continue;
|
|
757
|
+
case 4:
|
|
758
|
+
if (tag !== 34) {
|
|
759
|
+
break;
|
|
760
|
+
}
|
|
761
|
+
message.actionId = reader.string();
|
|
762
|
+
continue;
|
|
763
|
+
case 5:
|
|
764
|
+
if (tag !== 42) {
|
|
765
|
+
break;
|
|
766
|
+
}
|
|
767
|
+
message.eventTimestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
768
|
+
continue;
|
|
769
|
+
case 6:
|
|
770
|
+
if (tag !== 48) {
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
message.eventType = reader.int32();
|
|
774
|
+
continue;
|
|
775
|
+
case 7:
|
|
776
|
+
if (tag !== 58) {
|
|
777
|
+
break;
|
|
778
|
+
}
|
|
779
|
+
message.eventPayload = reader.string();
|
|
780
|
+
continue;
|
|
781
|
+
}
|
|
782
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
783
|
+
break;
|
|
784
|
+
}
|
|
785
|
+
reader.skipType(tag & 7);
|
|
786
|
+
}
|
|
787
|
+
return message;
|
|
788
|
+
},
|
|
789
|
+
fromJSON(object) {
|
|
790
|
+
return {
|
|
791
|
+
workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "",
|
|
792
|
+
workflowRunId: isSet(object.workflowRunId) ? globalThis.String(object.workflowRunId) : "",
|
|
793
|
+
getGroupKeyRunId: isSet(object.getGroupKeyRunId) ? globalThis.String(object.getGroupKeyRunId) : "",
|
|
794
|
+
actionId: isSet(object.actionId) ? globalThis.String(object.actionId) : "",
|
|
795
|
+
eventTimestamp: isSet(object.eventTimestamp) ? fromJsonTimestamp(object.eventTimestamp) : undefined,
|
|
796
|
+
eventType: isSet(object.eventType) ? groupKeyActionEventTypeFromJSON(object.eventType) : 0,
|
|
797
|
+
eventPayload: isSet(object.eventPayload) ? globalThis.String(object.eventPayload) : "",
|
|
798
|
+
};
|
|
799
|
+
},
|
|
800
|
+
toJSON(message) {
|
|
801
|
+
const obj = {};
|
|
802
|
+
if (message.workerId !== "") {
|
|
803
|
+
obj.workerId = message.workerId;
|
|
804
|
+
}
|
|
805
|
+
if (message.workflowRunId !== "") {
|
|
806
|
+
obj.workflowRunId = message.workflowRunId;
|
|
807
|
+
}
|
|
808
|
+
if (message.getGroupKeyRunId !== "") {
|
|
809
|
+
obj.getGroupKeyRunId = message.getGroupKeyRunId;
|
|
810
|
+
}
|
|
811
|
+
if (message.actionId !== "") {
|
|
812
|
+
obj.actionId = message.actionId;
|
|
813
|
+
}
|
|
814
|
+
if (message.eventTimestamp !== undefined) {
|
|
815
|
+
obj.eventTimestamp = message.eventTimestamp.toISOString();
|
|
816
|
+
}
|
|
817
|
+
if (message.eventType !== 0) {
|
|
818
|
+
obj.eventType = groupKeyActionEventTypeToJSON(message.eventType);
|
|
819
|
+
}
|
|
820
|
+
if (message.eventPayload !== "") {
|
|
821
|
+
obj.eventPayload = message.eventPayload;
|
|
822
|
+
}
|
|
823
|
+
return obj;
|
|
824
|
+
},
|
|
825
|
+
create(base) {
|
|
826
|
+
return exports.GroupKeyActionEvent.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
827
|
+
},
|
|
828
|
+
fromPartial(object) {
|
|
829
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
830
|
+
const message = createBaseGroupKeyActionEvent();
|
|
831
|
+
message.workerId = (_a = object.workerId) !== null && _a !== void 0 ? _a : "";
|
|
832
|
+
message.workflowRunId = (_b = object.workflowRunId) !== null && _b !== void 0 ? _b : "";
|
|
833
|
+
message.getGroupKeyRunId = (_c = object.getGroupKeyRunId) !== null && _c !== void 0 ? _c : "";
|
|
834
|
+
message.actionId = (_d = object.actionId) !== null && _d !== void 0 ? _d : "";
|
|
835
|
+
message.eventTimestamp = (_e = object.eventTimestamp) !== null && _e !== void 0 ? _e : undefined;
|
|
836
|
+
message.eventType = (_f = object.eventType) !== null && _f !== void 0 ? _f : 0;
|
|
837
|
+
message.eventPayload = (_g = object.eventPayload) !== null && _g !== void 0 ? _g : "";
|
|
838
|
+
return message;
|
|
839
|
+
},
|
|
840
|
+
};
|
|
841
|
+
function createBaseStepActionEvent() {
|
|
616
842
|
return {
|
|
617
843
|
workerId: "",
|
|
618
844
|
jobId: "",
|
|
@@ -625,7 +851,7 @@ function createBaseActionEvent() {
|
|
|
625
851
|
eventPayload: "",
|
|
626
852
|
};
|
|
627
853
|
}
|
|
628
|
-
exports.
|
|
854
|
+
exports.StepActionEvent = {
|
|
629
855
|
encode(message, writer = _m0.Writer.create()) {
|
|
630
856
|
if (message.workerId !== "") {
|
|
631
857
|
writer.uint32(10).string(message.workerId);
|
|
@@ -659,7 +885,7 @@ exports.ActionEvent = {
|
|
|
659
885
|
decode(input, length) {
|
|
660
886
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
661
887
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
662
|
-
const message =
|
|
888
|
+
const message = createBaseStepActionEvent();
|
|
663
889
|
while (reader.pos < end) {
|
|
664
890
|
const tag = reader.uint32();
|
|
665
891
|
switch (tag >>> 3) {
|
|
@@ -734,7 +960,7 @@ exports.ActionEvent = {
|
|
|
734
960
|
stepRunId: isSet(object.stepRunId) ? globalThis.String(object.stepRunId) : "",
|
|
735
961
|
actionId: isSet(object.actionId) ? globalThis.String(object.actionId) : "",
|
|
736
962
|
eventTimestamp: isSet(object.eventTimestamp) ? fromJsonTimestamp(object.eventTimestamp) : undefined,
|
|
737
|
-
eventType: isSet(object.eventType) ?
|
|
963
|
+
eventType: isSet(object.eventType) ? stepActionEventTypeFromJSON(object.eventType) : 0,
|
|
738
964
|
eventPayload: isSet(object.eventPayload) ? globalThis.String(object.eventPayload) : "",
|
|
739
965
|
};
|
|
740
966
|
},
|
|
@@ -762,7 +988,7 @@ exports.ActionEvent = {
|
|
|
762
988
|
obj.eventTimestamp = message.eventTimestamp.toISOString();
|
|
763
989
|
}
|
|
764
990
|
if (message.eventType !== 0) {
|
|
765
|
-
obj.eventType =
|
|
991
|
+
obj.eventType = stepActionEventTypeToJSON(message.eventType);
|
|
766
992
|
}
|
|
767
993
|
if (message.eventPayload !== "") {
|
|
768
994
|
obj.eventPayload = message.eventPayload;
|
|
@@ -770,11 +996,11 @@ exports.ActionEvent = {
|
|
|
770
996
|
return obj;
|
|
771
997
|
},
|
|
772
998
|
create(base) {
|
|
773
|
-
return exports.
|
|
999
|
+
return exports.StepActionEvent.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
774
1000
|
},
|
|
775
1001
|
fromPartial(object) {
|
|
776
1002
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
777
|
-
const message =
|
|
1003
|
+
const message = createBaseStepActionEvent();
|
|
778
1004
|
message.workerId = (_a = object.workerId) !== null && _a !== void 0 ? _a : "";
|
|
779
1005
|
message.jobId = (_b = object.jobId) !== null && _b !== void 0 ? _b : "";
|
|
780
1006
|
message.jobRunId = (_c = object.jobRunId) !== null && _c !== void 0 ? _c : "";
|
|
@@ -874,9 +1100,17 @@ exports.DispatcherDefinition = {
|
|
|
874
1100
|
responseStream: true,
|
|
875
1101
|
options: {},
|
|
876
1102
|
},
|
|
877
|
-
|
|
878
|
-
name: "
|
|
879
|
-
requestType: exports.
|
|
1103
|
+
sendStepActionEvent: {
|
|
1104
|
+
name: "SendStepActionEvent",
|
|
1105
|
+
requestType: exports.StepActionEvent,
|
|
1106
|
+
requestStream: false,
|
|
1107
|
+
responseType: exports.ActionEventResponse,
|
|
1108
|
+
responseStream: false,
|
|
1109
|
+
options: {},
|
|
1110
|
+
},
|
|
1111
|
+
sendGroupKeyActionEvent: {
|
|
1112
|
+
name: "SendGroupKeyActionEvent",
|
|
1113
|
+
requestType: exports.GroupKeyActionEvent,
|
|
880
1114
|
requestStream: false,
|
|
881
1115
|
responseType: exports.ActionEventResponse,
|
|
882
1116
|
responseStream: false,
|
|
@@ -1,6 +1,14 @@
|
|
|
1
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 ConcurrencyLimitStrategy {
|
|
5
|
+
CANCEL_IN_PROGRESS = 0,
|
|
6
|
+
DROP_NEWEST = 1,
|
|
7
|
+
QUEUE_NEWEST = 2,
|
|
8
|
+
UNRECOGNIZED = -1
|
|
9
|
+
}
|
|
10
|
+
export declare function concurrencyLimitStrategyFromJSON(object: any): ConcurrencyLimitStrategy;
|
|
11
|
+
export declare function concurrencyLimitStrategyToJSON(object: ConcurrencyLimitStrategy): string;
|
|
4
12
|
export interface PutWorkflowRequest {
|
|
5
13
|
opts: CreateWorkflowVersionOpts | undefined;
|
|
6
14
|
}
|
|
@@ -20,6 +28,16 @@ export interface CreateWorkflowVersionOpts {
|
|
|
20
28
|
scheduledTriggers: Date[];
|
|
21
29
|
/** (required) the workflow jobs */
|
|
22
30
|
jobs: CreateWorkflowJobOpts[];
|
|
31
|
+
/** (optional) the workflow concurrency options */
|
|
32
|
+
concurrency: WorkflowConcurrencyOpts | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface WorkflowConcurrencyOpts {
|
|
35
|
+
/** (required) the action id for getting the concurrency group */
|
|
36
|
+
action: string;
|
|
37
|
+
/** (optional) the maximum number of concurrent workflow runs, default 1 */
|
|
38
|
+
maxRuns: number;
|
|
39
|
+
/** (optional) the strategy to use when the concurrency limit is reached, default CANCEL_IN_PROGRESS */
|
|
40
|
+
limitStrategy: ConcurrencyLimitStrategy;
|
|
23
41
|
}
|
|
24
42
|
/** CreateWorkflowJobOpts represents options to create a workflow job. */
|
|
25
43
|
export interface CreateWorkflowJobOpts {
|
|
@@ -155,6 +173,14 @@ export declare const CreateWorkflowVersionOpts: {
|
|
|
155
173
|
create(base?: DeepPartial<CreateWorkflowVersionOpts>): CreateWorkflowVersionOpts;
|
|
156
174
|
fromPartial(object: DeepPartial<CreateWorkflowVersionOpts>): CreateWorkflowVersionOpts;
|
|
157
175
|
};
|
|
176
|
+
export declare const WorkflowConcurrencyOpts: {
|
|
177
|
+
encode(message: WorkflowConcurrencyOpts, writer?: _m0.Writer): _m0.Writer;
|
|
178
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WorkflowConcurrencyOpts;
|
|
179
|
+
fromJSON(object: any): WorkflowConcurrencyOpts;
|
|
180
|
+
toJSON(message: WorkflowConcurrencyOpts): unknown;
|
|
181
|
+
create(base?: DeepPartial<WorkflowConcurrencyOpts>): WorkflowConcurrencyOpts;
|
|
182
|
+
fromPartial(object: DeepPartial<WorkflowConcurrencyOpts>): WorkflowConcurrencyOpts;
|
|
183
|
+
};
|
|
158
184
|
export declare const CreateWorkflowJobOpts: {
|
|
159
185
|
encode(message: CreateWorkflowJobOpts, writer?: _m0.Writer): _m0.Writer;
|
|
160
186
|
decode(input: _m0.Reader | Uint8Array, length?: number): CreateWorkflowJobOpts;
|