@hatchet-dev/typescript-sdk 1.27.0 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clients/dispatcher/dispatcher-client.d.ts +6 -1
- package/clients/dispatcher/dispatcher-client.js +14 -0
- package/clients/rest/generated/Api.d.ts +2 -0
- package/clients/rest/generated/data-contracts.d.ts +2 -0
- package/clients/rest/generated/data-contracts.js +2 -0
- package/package.json +1 -1
- package/protoc/dispatcher/dispatcher.d.ts +67 -0
- package/protoc/dispatcher/dispatcher.js +495 -3
- package/protoc/events/events.js +1 -1
- package/protoc/google/protobuf/any.js +1 -1
- package/protoc/google/protobuf/timestamp.js +1 -1
- package/protoc/google/rpc/status.js +1 -1
- package/protoc/v1/dispatcher.js +1 -1
- package/protoc/v1/shared/condition.js +1 -1
- package/protoc/v1/shared/trigger.js +1 -1
- package/protoc/v1/workflows.d.ts +24 -7
- package/protoc/v1/workflows.js +218 -40
- package/protoc/workflows/workflows.js +1 -1
- package/util/workflow-run-ref.js +23 -9
- package/v1/client/client.d.ts +26 -1
- package/v1/client/client.js +6 -0
- package/v1/client/worker/context.js +23 -3
- package/v1/client/worker/worker-internal.d.ts +22 -1
- package/v1/client/worker/worker-internal.js +167 -2
- package/v1/declaration.d.ts +62 -2
- package/v1/declaration.js +56 -0
- package/v1/examples/batch_assign/workflow.d.ts +62 -0
- package/v1/examples/batch_assign/workflow.js +161 -0
- package/v1/examples/e2e-worker.js +35 -21
- package/v1/task.d.ts +50 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: dispatcher/dispatcher.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.DispatcherDefinition = exports.GetVersionResponse = exports.GetVersionRequest = exports.RestoreEvictedTaskResponse = exports.RestoreEvictedTaskRequest = exports.ReleaseSlotResponse = exports.ReleaseSlotRequest = exports.RefreshTimeoutResponse = exports.RefreshTimeoutRequest = exports.HeartbeatResponse = exports.HeartbeatRequest = exports.OverridesDataResponse = exports.OverridesData = exports.StepRunResult = exports.WorkflowRunEvent = exports.WorkflowEvent = exports.SubscribeToWorkflowRunsRequest = exports.SubscribeToWorkflowEventsRequest = exports.ActionEventResponse = exports.StepActionEvent = exports.GroupKeyActionEvent = exports.WorkerUnsubscribeResponse = exports.WorkerUnsubscribeRequest = exports.WorkerListenRequest = exports.AssignedAction = exports.UpsertWorkerLabelsResponse = exports.UpsertWorkerLabelsRequest_LabelsEntry = exports.UpsertWorkerLabelsRequest = exports.WorkerRegisterResponse = exports.WorkerRegisterRequest_SlotConfigEntry = exports.WorkerRegisterRequest_LabelsEntry = exports.WorkerRegisterRequest = exports.RuntimeInfo = exports.WorkerLabels = exports.WorkflowRunEventType = exports.ResourceEventType = exports.ResourceType = exports.StepActionEventType = exports.GroupKeyActionEventType = exports.ActionType = exports.SDKS = exports.protobufPackage = void 0;
|
|
8
|
+
exports.DispatcherDefinition = exports.GetVersionResponse = exports.GetVersionRequest = exports.RestoreEvictedTaskResponse = exports.RestoreEvictedTaskRequest = exports.ReleaseSlotResponse = exports.ReleaseSlotRequest = exports.RefreshTimeoutResponse = exports.RefreshTimeoutRequest = exports.HeartbeatResponse = exports.HeartbeatRequest = exports.OverridesDataResponse = exports.OverridesData = exports.StepRunResult = exports.WorkflowRunEvent = exports.WorkflowEvent = exports.SubscribeToWorkflowRunsRequest = exports.SubscribeToWorkflowEventsRequest = exports.ActionEventResponse = exports.BatchActionEvent = exports.BatchActionEventItem = exports.StepActionEvent = exports.GroupKeyActionEvent = exports.WorkerUnsubscribeResponse = exports.WorkerUnsubscribeRequest = exports.WorkerListenRequest = exports.BatchStartPayload = exports.AssignedAction = exports.UpsertWorkerLabelsResponse = exports.UpsertWorkerLabelsRequest_LabelsEntry = exports.UpsertWorkerLabelsRequest = exports.WorkerRegisterResponse = exports.WorkerRegisterRequest_SlotConfigEntry = exports.WorkerRegisterRequest_LabelsEntry = exports.WorkerRegisterRequest = exports.RuntimeInfo = exports.WorkerLabels = exports.WorkflowRunEventType = exports.ResourceEventType = exports.ResourceType = exports.StepActionEventType = exports.GroupKeyActionEventType = exports.ActionType = exports.SDKS = exports.protobufPackage = void 0;
|
|
9
9
|
exports.sDKSFromJSON = sDKSFromJSON;
|
|
10
10
|
exports.sDKSToJSON = sDKSToJSON;
|
|
11
11
|
exports.actionTypeFromJSON = actionTypeFromJSON;
|
|
@@ -78,6 +78,7 @@ var ActionType;
|
|
|
78
78
|
ActionType[ActionType["START_STEP_RUN"] = 0] = "START_STEP_RUN";
|
|
79
79
|
ActionType[ActionType["CANCEL_STEP_RUN"] = 1] = "CANCEL_STEP_RUN";
|
|
80
80
|
ActionType[ActionType["START_GET_GROUP_KEY"] = 2] = "START_GET_GROUP_KEY";
|
|
81
|
+
ActionType[ActionType["START_BATCH"] = 3] = "START_BATCH";
|
|
81
82
|
ActionType[ActionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
82
83
|
})(ActionType || (exports.ActionType = ActionType = {}));
|
|
83
84
|
function actionTypeFromJSON(object) {
|
|
@@ -91,6 +92,9 @@ function actionTypeFromJSON(object) {
|
|
|
91
92
|
case 2:
|
|
92
93
|
case 'START_GET_GROUP_KEY':
|
|
93
94
|
return ActionType.START_GET_GROUP_KEY;
|
|
95
|
+
case 3:
|
|
96
|
+
case 'START_BATCH':
|
|
97
|
+
return ActionType.START_BATCH;
|
|
94
98
|
case -1:
|
|
95
99
|
case 'UNRECOGNIZED':
|
|
96
100
|
default:
|
|
@@ -105,6 +109,8 @@ function actionTypeToJSON(object) {
|
|
|
105
109
|
return 'CANCEL_STEP_RUN';
|
|
106
110
|
case ActionType.START_GET_GROUP_KEY:
|
|
107
111
|
return 'START_GET_GROUP_KEY';
|
|
112
|
+
case ActionType.START_BATCH:
|
|
113
|
+
return 'START_BATCH';
|
|
108
114
|
case ActionType.UNRECOGNIZED:
|
|
109
115
|
default:
|
|
110
116
|
return 'UNRECOGNIZED';
|
|
@@ -160,6 +166,7 @@ var StepActionEventType;
|
|
|
160
166
|
StepActionEventType[StepActionEventType["STEP_EVENT_TYPE_COMPLETED"] = 2] = "STEP_EVENT_TYPE_COMPLETED";
|
|
161
167
|
StepActionEventType[StepActionEventType["STEP_EVENT_TYPE_FAILED"] = 3] = "STEP_EVENT_TYPE_FAILED";
|
|
162
168
|
StepActionEventType[StepActionEventType["STEP_EVENT_TYPE_ACKNOWLEDGED"] = 4] = "STEP_EVENT_TYPE_ACKNOWLEDGED";
|
|
169
|
+
StepActionEventType[StepActionEventType["STEP_EVENT_TYPE_CANCELLED"] = 5] = "STEP_EVENT_TYPE_CANCELLED";
|
|
163
170
|
StepActionEventType[StepActionEventType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
164
171
|
})(StepActionEventType || (exports.StepActionEventType = StepActionEventType = {}));
|
|
165
172
|
function stepActionEventTypeFromJSON(object) {
|
|
@@ -179,6 +186,9 @@ function stepActionEventTypeFromJSON(object) {
|
|
|
179
186
|
case 4:
|
|
180
187
|
case 'STEP_EVENT_TYPE_ACKNOWLEDGED':
|
|
181
188
|
return StepActionEventType.STEP_EVENT_TYPE_ACKNOWLEDGED;
|
|
189
|
+
case 5:
|
|
190
|
+
case 'STEP_EVENT_TYPE_CANCELLED':
|
|
191
|
+
return StepActionEventType.STEP_EVENT_TYPE_CANCELLED;
|
|
182
192
|
case -1:
|
|
183
193
|
case 'UNRECOGNIZED':
|
|
184
194
|
default:
|
|
@@ -197,6 +207,8 @@ function stepActionEventTypeToJSON(object) {
|
|
|
197
207
|
return 'STEP_EVENT_TYPE_FAILED';
|
|
198
208
|
case StepActionEventType.STEP_EVENT_TYPE_ACKNOWLEDGED:
|
|
199
209
|
return 'STEP_EVENT_TYPE_ACKNOWLEDGED';
|
|
210
|
+
case StepActionEventType.STEP_EVENT_TYPE_CANCELLED:
|
|
211
|
+
return 'STEP_EVENT_TYPE_CANCELLED';
|
|
200
212
|
case StepActionEventType.UNRECOGNIZED:
|
|
201
213
|
default:
|
|
202
214
|
return 'UNRECOGNIZED';
|
|
@@ -1264,6 +1276,11 @@ function createBaseAssignedAction() {
|
|
|
1264
1276
|
durableTaskInvocationCount: undefined,
|
|
1265
1277
|
triggeringEventExternalId: undefined,
|
|
1266
1278
|
triggeringEventKey: undefined,
|
|
1279
|
+
batchId: undefined,
|
|
1280
|
+
batchSize: undefined,
|
|
1281
|
+
batchIndex: undefined,
|
|
1282
|
+
batchStartPayload: undefined,
|
|
1283
|
+
batchKey: undefined,
|
|
1267
1284
|
};
|
|
1268
1285
|
}
|
|
1269
1286
|
exports.AssignedAction = {
|
|
@@ -1337,6 +1354,21 @@ exports.AssignedAction = {
|
|
|
1337
1354
|
if (message.triggeringEventKey !== undefined) {
|
|
1338
1355
|
writer.uint32(186).string(message.triggeringEventKey);
|
|
1339
1356
|
}
|
|
1357
|
+
if (message.batchId !== undefined) {
|
|
1358
|
+
writer.uint32(194).string(message.batchId);
|
|
1359
|
+
}
|
|
1360
|
+
if (message.batchSize !== undefined) {
|
|
1361
|
+
writer.uint32(200).int32(message.batchSize);
|
|
1362
|
+
}
|
|
1363
|
+
if (message.batchIndex !== undefined) {
|
|
1364
|
+
writer.uint32(208).int32(message.batchIndex);
|
|
1365
|
+
}
|
|
1366
|
+
if (message.batchStartPayload !== undefined) {
|
|
1367
|
+
exports.BatchStartPayload.encode(message.batchStartPayload, writer.uint32(218).fork()).join();
|
|
1368
|
+
}
|
|
1369
|
+
if (message.batchKey !== undefined) {
|
|
1370
|
+
writer.uint32(226).string(message.batchKey);
|
|
1371
|
+
}
|
|
1340
1372
|
return writer;
|
|
1341
1373
|
},
|
|
1342
1374
|
decode(input, length) {
|
|
@@ -1507,6 +1539,41 @@ exports.AssignedAction = {
|
|
|
1507
1539
|
message.triggeringEventKey = reader.string();
|
|
1508
1540
|
continue;
|
|
1509
1541
|
}
|
|
1542
|
+
case 24: {
|
|
1543
|
+
if (tag !== 194) {
|
|
1544
|
+
break;
|
|
1545
|
+
}
|
|
1546
|
+
message.batchId = reader.string();
|
|
1547
|
+
continue;
|
|
1548
|
+
}
|
|
1549
|
+
case 25: {
|
|
1550
|
+
if (tag !== 200) {
|
|
1551
|
+
break;
|
|
1552
|
+
}
|
|
1553
|
+
message.batchSize = reader.int32();
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
case 26: {
|
|
1557
|
+
if (tag !== 208) {
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
message.batchIndex = reader.int32();
|
|
1561
|
+
continue;
|
|
1562
|
+
}
|
|
1563
|
+
case 27: {
|
|
1564
|
+
if (tag !== 218) {
|
|
1565
|
+
break;
|
|
1566
|
+
}
|
|
1567
|
+
message.batchStartPayload = exports.BatchStartPayload.decode(reader, reader.uint32());
|
|
1568
|
+
continue;
|
|
1569
|
+
}
|
|
1570
|
+
case 28: {
|
|
1571
|
+
if (tag !== 226) {
|
|
1572
|
+
break;
|
|
1573
|
+
}
|
|
1574
|
+
message.batchKey = reader.string();
|
|
1575
|
+
continue;
|
|
1576
|
+
}
|
|
1510
1577
|
}
|
|
1511
1578
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1512
1579
|
break;
|
|
@@ -1628,6 +1695,13 @@ exports.AssignedAction = {
|
|
|
1628
1695
|
: isSet(object.triggering_event_key)
|
|
1629
1696
|
? globalThis.String(object.triggering_event_key)
|
|
1630
1697
|
: undefined,
|
|
1698
|
+
batchId: isSet(object.batchId) ? globalThis.String(object.batchId) : undefined,
|
|
1699
|
+
batchSize: isSet(object.batchSize) ? globalThis.Number(object.batchSize) : undefined,
|
|
1700
|
+
batchIndex: isSet(object.batchIndex) ? globalThis.Number(object.batchIndex) : undefined,
|
|
1701
|
+
batchStartPayload: isSet(object.batchStartPayload)
|
|
1702
|
+
? exports.BatchStartPayload.fromJSON(object.batchStartPayload)
|
|
1703
|
+
: undefined,
|
|
1704
|
+
batchKey: isSet(object.batchKey) ? globalThis.String(object.batchKey) : undefined,
|
|
1631
1705
|
};
|
|
1632
1706
|
},
|
|
1633
1707
|
toJSON(message) {
|
|
@@ -1701,13 +1775,28 @@ exports.AssignedAction = {
|
|
|
1701
1775
|
if (message.triggeringEventKey !== undefined) {
|
|
1702
1776
|
obj.triggeringEventKey = message.triggeringEventKey;
|
|
1703
1777
|
}
|
|
1778
|
+
if (message.batchId !== undefined) {
|
|
1779
|
+
obj.batchId = message.batchId;
|
|
1780
|
+
}
|
|
1781
|
+
if (message.batchSize !== undefined) {
|
|
1782
|
+
obj.batchSize = Math.round(message.batchSize);
|
|
1783
|
+
}
|
|
1784
|
+
if (message.batchIndex !== undefined) {
|
|
1785
|
+
obj.batchIndex = Math.round(message.batchIndex);
|
|
1786
|
+
}
|
|
1787
|
+
if (message.batchStartPayload !== undefined) {
|
|
1788
|
+
obj.batchStartPayload = exports.BatchStartPayload.toJSON(message.batchStartPayload);
|
|
1789
|
+
}
|
|
1790
|
+
if (message.batchKey !== undefined) {
|
|
1791
|
+
obj.batchKey = message.batchKey;
|
|
1792
|
+
}
|
|
1704
1793
|
return obj;
|
|
1705
1794
|
},
|
|
1706
1795
|
create(base) {
|
|
1707
1796
|
return exports.AssignedAction.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1708
1797
|
},
|
|
1709
1798
|
fromPartial(object) {
|
|
1710
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
1799
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
1711
1800
|
const message = createBaseAssignedAction();
|
|
1712
1801
|
message.tenantId = (_a = object.tenantId) !== null && _a !== void 0 ? _a : '';
|
|
1713
1802
|
message.workflowRunId = (_b = object.workflowRunId) !== null && _b !== void 0 ? _b : '';
|
|
@@ -1732,6 +1821,98 @@ exports.AssignedAction = {
|
|
|
1732
1821
|
message.durableTaskInvocationCount = (_w = object.durableTaskInvocationCount) !== null && _w !== void 0 ? _w : undefined;
|
|
1733
1822
|
message.triggeringEventExternalId = (_x = object.triggeringEventExternalId) !== null && _x !== void 0 ? _x : undefined;
|
|
1734
1823
|
message.triggeringEventKey = (_y = object.triggeringEventKey) !== null && _y !== void 0 ? _y : undefined;
|
|
1824
|
+
message.batchId = (_z = object.batchId) !== null && _z !== void 0 ? _z : undefined;
|
|
1825
|
+
message.batchSize = (_0 = object.batchSize) !== null && _0 !== void 0 ? _0 : undefined;
|
|
1826
|
+
message.batchIndex = (_1 = object.batchIndex) !== null && _1 !== void 0 ? _1 : undefined;
|
|
1827
|
+
message.batchStartPayload =
|
|
1828
|
+
object.batchStartPayload !== undefined && object.batchStartPayload !== null
|
|
1829
|
+
? exports.BatchStartPayload.fromPartial(object.batchStartPayload)
|
|
1830
|
+
: undefined;
|
|
1831
|
+
message.batchKey = (_2 = object.batchKey) !== null && _2 !== void 0 ? _2 : undefined;
|
|
1832
|
+
return message;
|
|
1833
|
+
},
|
|
1834
|
+
};
|
|
1835
|
+
function createBaseBatchStartPayload() {
|
|
1836
|
+
return { triggerReason: '', triggerTime: undefined, expectedSize: 0 };
|
|
1837
|
+
}
|
|
1838
|
+
exports.BatchStartPayload = {
|
|
1839
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1840
|
+
if (message.triggerReason !== '') {
|
|
1841
|
+
writer.uint32(10).string(message.triggerReason);
|
|
1842
|
+
}
|
|
1843
|
+
if (message.triggerTime !== undefined) {
|
|
1844
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.triggerTime), writer.uint32(18).fork()).join();
|
|
1845
|
+
}
|
|
1846
|
+
if (message.expectedSize !== 0) {
|
|
1847
|
+
writer.uint32(24).int32(message.expectedSize);
|
|
1848
|
+
}
|
|
1849
|
+
return writer;
|
|
1850
|
+
},
|
|
1851
|
+
decode(input, length) {
|
|
1852
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1853
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1854
|
+
const message = createBaseBatchStartPayload();
|
|
1855
|
+
while (reader.pos < end) {
|
|
1856
|
+
const tag = reader.uint32();
|
|
1857
|
+
switch (tag >>> 3) {
|
|
1858
|
+
case 1: {
|
|
1859
|
+
if (tag !== 10) {
|
|
1860
|
+
break;
|
|
1861
|
+
}
|
|
1862
|
+
message.triggerReason = reader.string();
|
|
1863
|
+
continue;
|
|
1864
|
+
}
|
|
1865
|
+
case 2: {
|
|
1866
|
+
if (tag !== 18) {
|
|
1867
|
+
break;
|
|
1868
|
+
}
|
|
1869
|
+
message.triggerTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1870
|
+
continue;
|
|
1871
|
+
}
|
|
1872
|
+
case 3: {
|
|
1873
|
+
if (tag !== 24) {
|
|
1874
|
+
break;
|
|
1875
|
+
}
|
|
1876
|
+
message.expectedSize = reader.int32();
|
|
1877
|
+
continue;
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1881
|
+
break;
|
|
1882
|
+
}
|
|
1883
|
+
reader.skip(tag & 7);
|
|
1884
|
+
}
|
|
1885
|
+
return message;
|
|
1886
|
+
},
|
|
1887
|
+
fromJSON(object) {
|
|
1888
|
+
return {
|
|
1889
|
+
triggerReason: isSet(object.triggerReason) ? globalThis.String(object.triggerReason) : '',
|
|
1890
|
+
triggerTime: isSet(object.triggerTime) ? fromJsonTimestamp(object.triggerTime) : undefined,
|
|
1891
|
+
expectedSize: isSet(object.expectedSize) ? globalThis.Number(object.expectedSize) : 0,
|
|
1892
|
+
};
|
|
1893
|
+
},
|
|
1894
|
+
toJSON(message) {
|
|
1895
|
+
const obj = {};
|
|
1896
|
+
if (message.triggerReason !== '') {
|
|
1897
|
+
obj.triggerReason = message.triggerReason;
|
|
1898
|
+
}
|
|
1899
|
+
if (message.triggerTime !== undefined) {
|
|
1900
|
+
obj.triggerTime = message.triggerTime.toISOString();
|
|
1901
|
+
}
|
|
1902
|
+
if (message.expectedSize !== 0) {
|
|
1903
|
+
obj.expectedSize = Math.round(message.expectedSize);
|
|
1904
|
+
}
|
|
1905
|
+
return obj;
|
|
1906
|
+
},
|
|
1907
|
+
create(base) {
|
|
1908
|
+
return exports.BatchStartPayload.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1909
|
+
},
|
|
1910
|
+
fromPartial(object) {
|
|
1911
|
+
var _a, _b, _c;
|
|
1912
|
+
const message = createBaseBatchStartPayload();
|
|
1913
|
+
message.triggerReason = (_a = object.triggerReason) !== null && _a !== void 0 ? _a : '';
|
|
1914
|
+
message.triggerTime = (_b = object.triggerTime) !== null && _b !== void 0 ? _b : undefined;
|
|
1915
|
+
message.expectedSize = (_c = object.expectedSize) !== null && _c !== void 0 ? _c : 0;
|
|
1735
1916
|
return message;
|
|
1736
1917
|
},
|
|
1737
1918
|
};
|
|
@@ -2368,6 +2549,305 @@ exports.StepActionEvent = {
|
|
|
2368
2549
|
return message;
|
|
2369
2550
|
},
|
|
2370
2551
|
};
|
|
2552
|
+
function createBaseBatchActionEventItem() {
|
|
2553
|
+
return {
|
|
2554
|
+
taskRunExternalId: '',
|
|
2555
|
+
eventPayload: '',
|
|
2556
|
+
retryCount: undefined,
|
|
2557
|
+
shouldNotRetry: undefined,
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
exports.BatchActionEventItem = {
|
|
2561
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
2562
|
+
if (message.taskRunExternalId !== '') {
|
|
2563
|
+
writer.uint32(10).string(message.taskRunExternalId);
|
|
2564
|
+
}
|
|
2565
|
+
if (message.eventPayload !== '') {
|
|
2566
|
+
writer.uint32(18).string(message.eventPayload);
|
|
2567
|
+
}
|
|
2568
|
+
if (message.retryCount !== undefined) {
|
|
2569
|
+
writer.uint32(24).int32(message.retryCount);
|
|
2570
|
+
}
|
|
2571
|
+
if (message.shouldNotRetry !== undefined) {
|
|
2572
|
+
writer.uint32(32).bool(message.shouldNotRetry);
|
|
2573
|
+
}
|
|
2574
|
+
return writer;
|
|
2575
|
+
},
|
|
2576
|
+
decode(input, length) {
|
|
2577
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
2578
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2579
|
+
const message = createBaseBatchActionEventItem();
|
|
2580
|
+
while (reader.pos < end) {
|
|
2581
|
+
const tag = reader.uint32();
|
|
2582
|
+
switch (tag >>> 3) {
|
|
2583
|
+
case 1: {
|
|
2584
|
+
if (tag !== 10) {
|
|
2585
|
+
break;
|
|
2586
|
+
}
|
|
2587
|
+
message.taskRunExternalId = reader.string();
|
|
2588
|
+
continue;
|
|
2589
|
+
}
|
|
2590
|
+
case 2: {
|
|
2591
|
+
if (tag !== 18) {
|
|
2592
|
+
break;
|
|
2593
|
+
}
|
|
2594
|
+
message.eventPayload = reader.string();
|
|
2595
|
+
continue;
|
|
2596
|
+
}
|
|
2597
|
+
case 3: {
|
|
2598
|
+
if (tag !== 24) {
|
|
2599
|
+
break;
|
|
2600
|
+
}
|
|
2601
|
+
message.retryCount = reader.int32();
|
|
2602
|
+
continue;
|
|
2603
|
+
}
|
|
2604
|
+
case 4: {
|
|
2605
|
+
if (tag !== 32) {
|
|
2606
|
+
break;
|
|
2607
|
+
}
|
|
2608
|
+
message.shouldNotRetry = reader.bool();
|
|
2609
|
+
continue;
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2613
|
+
break;
|
|
2614
|
+
}
|
|
2615
|
+
reader.skip(tag & 7);
|
|
2616
|
+
}
|
|
2617
|
+
return message;
|
|
2618
|
+
},
|
|
2619
|
+
fromJSON(object) {
|
|
2620
|
+
return {
|
|
2621
|
+
taskRunExternalId: isSet(object.taskRunExternalId)
|
|
2622
|
+
? globalThis.String(object.taskRunExternalId)
|
|
2623
|
+
: isSet(object.task_run_external_id)
|
|
2624
|
+
? globalThis.String(object.task_run_external_id)
|
|
2625
|
+
: '',
|
|
2626
|
+
eventPayload: isSet(object.eventPayload)
|
|
2627
|
+
? globalThis.String(object.eventPayload)
|
|
2628
|
+
: isSet(object.event_payload)
|
|
2629
|
+
? globalThis.String(object.event_payload)
|
|
2630
|
+
: '',
|
|
2631
|
+
retryCount: isSet(object.retryCount)
|
|
2632
|
+
? globalThis.Number(object.retryCount)
|
|
2633
|
+
: isSet(object.retry_count)
|
|
2634
|
+
? globalThis.Number(object.retry_count)
|
|
2635
|
+
: undefined,
|
|
2636
|
+
shouldNotRetry: isSet(object.shouldNotRetry)
|
|
2637
|
+
? globalThis.Boolean(object.shouldNotRetry)
|
|
2638
|
+
: isSet(object.should_not_retry)
|
|
2639
|
+
? globalThis.Boolean(object.should_not_retry)
|
|
2640
|
+
: undefined,
|
|
2641
|
+
};
|
|
2642
|
+
},
|
|
2643
|
+
toJSON(message) {
|
|
2644
|
+
const obj = {};
|
|
2645
|
+
if (message.taskRunExternalId !== '') {
|
|
2646
|
+
obj.taskRunExternalId = message.taskRunExternalId;
|
|
2647
|
+
}
|
|
2648
|
+
if (message.eventPayload !== '') {
|
|
2649
|
+
obj.eventPayload = message.eventPayload;
|
|
2650
|
+
}
|
|
2651
|
+
if (message.retryCount !== undefined) {
|
|
2652
|
+
obj.retryCount = Math.round(message.retryCount);
|
|
2653
|
+
}
|
|
2654
|
+
if (message.shouldNotRetry !== undefined) {
|
|
2655
|
+
obj.shouldNotRetry = message.shouldNotRetry;
|
|
2656
|
+
}
|
|
2657
|
+
return obj;
|
|
2658
|
+
},
|
|
2659
|
+
create(base) {
|
|
2660
|
+
return exports.BatchActionEventItem.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2661
|
+
},
|
|
2662
|
+
fromPartial(object) {
|
|
2663
|
+
var _a, _b, _c, _d;
|
|
2664
|
+
const message = createBaseBatchActionEventItem();
|
|
2665
|
+
message.taskRunExternalId = (_a = object.taskRunExternalId) !== null && _a !== void 0 ? _a : '';
|
|
2666
|
+
message.eventPayload = (_b = object.eventPayload) !== null && _b !== void 0 ? _b : '';
|
|
2667
|
+
message.retryCount = (_c = object.retryCount) !== null && _c !== void 0 ? _c : undefined;
|
|
2668
|
+
message.shouldNotRetry = (_d = object.shouldNotRetry) !== null && _d !== void 0 ? _d : undefined;
|
|
2669
|
+
return message;
|
|
2670
|
+
},
|
|
2671
|
+
};
|
|
2672
|
+
function createBaseBatchActionEvent() {
|
|
2673
|
+
return {
|
|
2674
|
+
workerId: '',
|
|
2675
|
+
jobId: '',
|
|
2676
|
+
actionId: '',
|
|
2677
|
+
batchId: undefined,
|
|
2678
|
+
eventTimestamp: undefined,
|
|
2679
|
+
eventType: 0,
|
|
2680
|
+
items: [],
|
|
2681
|
+
};
|
|
2682
|
+
}
|
|
2683
|
+
exports.BatchActionEvent = {
|
|
2684
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
2685
|
+
if (message.workerId !== '') {
|
|
2686
|
+
writer.uint32(10).string(message.workerId);
|
|
2687
|
+
}
|
|
2688
|
+
if (message.jobId !== '') {
|
|
2689
|
+
writer.uint32(18).string(message.jobId);
|
|
2690
|
+
}
|
|
2691
|
+
if (message.actionId !== '') {
|
|
2692
|
+
writer.uint32(26).string(message.actionId);
|
|
2693
|
+
}
|
|
2694
|
+
if (message.batchId !== undefined) {
|
|
2695
|
+
writer.uint32(34).string(message.batchId);
|
|
2696
|
+
}
|
|
2697
|
+
if (message.eventTimestamp !== undefined) {
|
|
2698
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.eventTimestamp), writer.uint32(42).fork()).join();
|
|
2699
|
+
}
|
|
2700
|
+
if (message.eventType !== 0) {
|
|
2701
|
+
writer.uint32(48).int32(message.eventType);
|
|
2702
|
+
}
|
|
2703
|
+
for (const v of message.items) {
|
|
2704
|
+
exports.BatchActionEventItem.encode(v, writer.uint32(58).fork()).join();
|
|
2705
|
+
}
|
|
2706
|
+
return writer;
|
|
2707
|
+
},
|
|
2708
|
+
decode(input, length) {
|
|
2709
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
2710
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2711
|
+
const message = createBaseBatchActionEvent();
|
|
2712
|
+
while (reader.pos < end) {
|
|
2713
|
+
const tag = reader.uint32();
|
|
2714
|
+
switch (tag >>> 3) {
|
|
2715
|
+
case 1: {
|
|
2716
|
+
if (tag !== 10) {
|
|
2717
|
+
break;
|
|
2718
|
+
}
|
|
2719
|
+
message.workerId = reader.string();
|
|
2720
|
+
continue;
|
|
2721
|
+
}
|
|
2722
|
+
case 2: {
|
|
2723
|
+
if (tag !== 18) {
|
|
2724
|
+
break;
|
|
2725
|
+
}
|
|
2726
|
+
message.jobId = reader.string();
|
|
2727
|
+
continue;
|
|
2728
|
+
}
|
|
2729
|
+
case 3: {
|
|
2730
|
+
if (tag !== 26) {
|
|
2731
|
+
break;
|
|
2732
|
+
}
|
|
2733
|
+
message.actionId = reader.string();
|
|
2734
|
+
continue;
|
|
2735
|
+
}
|
|
2736
|
+
case 4: {
|
|
2737
|
+
if (tag !== 34) {
|
|
2738
|
+
break;
|
|
2739
|
+
}
|
|
2740
|
+
message.batchId = reader.string();
|
|
2741
|
+
continue;
|
|
2742
|
+
}
|
|
2743
|
+
case 5: {
|
|
2744
|
+
if (tag !== 42) {
|
|
2745
|
+
break;
|
|
2746
|
+
}
|
|
2747
|
+
message.eventTimestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
2748
|
+
continue;
|
|
2749
|
+
}
|
|
2750
|
+
case 6: {
|
|
2751
|
+
if (tag !== 48) {
|
|
2752
|
+
break;
|
|
2753
|
+
}
|
|
2754
|
+
message.eventType = reader.int32();
|
|
2755
|
+
continue;
|
|
2756
|
+
}
|
|
2757
|
+
case 7: {
|
|
2758
|
+
if (tag !== 58) {
|
|
2759
|
+
break;
|
|
2760
|
+
}
|
|
2761
|
+
message.items.push(exports.BatchActionEventItem.decode(reader, reader.uint32()));
|
|
2762
|
+
continue;
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2766
|
+
break;
|
|
2767
|
+
}
|
|
2768
|
+
reader.skip(tag & 7);
|
|
2769
|
+
}
|
|
2770
|
+
return message;
|
|
2771
|
+
},
|
|
2772
|
+
fromJSON(object) {
|
|
2773
|
+
return {
|
|
2774
|
+
workerId: isSet(object.workerId)
|
|
2775
|
+
? globalThis.String(object.workerId)
|
|
2776
|
+
: isSet(object.worker_id)
|
|
2777
|
+
? globalThis.String(object.worker_id)
|
|
2778
|
+
: '',
|
|
2779
|
+
jobId: isSet(object.jobId)
|
|
2780
|
+
? globalThis.String(object.jobId)
|
|
2781
|
+
: isSet(object.job_id)
|
|
2782
|
+
? globalThis.String(object.job_id)
|
|
2783
|
+
: '',
|
|
2784
|
+
actionId: isSet(object.actionId)
|
|
2785
|
+
? globalThis.String(object.actionId)
|
|
2786
|
+
: isSet(object.action_id)
|
|
2787
|
+
? globalThis.String(object.action_id)
|
|
2788
|
+
: '',
|
|
2789
|
+
batchId: isSet(object.batchId)
|
|
2790
|
+
? globalThis.String(object.batchId)
|
|
2791
|
+
: isSet(object.batch_id)
|
|
2792
|
+
? globalThis.String(object.batch_id)
|
|
2793
|
+
: undefined,
|
|
2794
|
+
eventTimestamp: isSet(object.eventTimestamp)
|
|
2795
|
+
? fromJsonTimestamp(object.eventTimestamp)
|
|
2796
|
+
: isSet(object.event_timestamp)
|
|
2797
|
+
? fromJsonTimestamp(object.event_timestamp)
|
|
2798
|
+
: undefined,
|
|
2799
|
+
eventType: isSet(object.eventType)
|
|
2800
|
+
? stepActionEventTypeFromJSON(object.eventType)
|
|
2801
|
+
: isSet(object.event_type)
|
|
2802
|
+
? stepActionEventTypeFromJSON(object.event_type)
|
|
2803
|
+
: 0,
|
|
2804
|
+
items: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.items)
|
|
2805
|
+
? object.items.map((e) => exports.BatchActionEventItem.fromJSON(e))
|
|
2806
|
+
: [],
|
|
2807
|
+
};
|
|
2808
|
+
},
|
|
2809
|
+
toJSON(message) {
|
|
2810
|
+
var _a;
|
|
2811
|
+
const obj = {};
|
|
2812
|
+
if (message.workerId !== '') {
|
|
2813
|
+
obj.workerId = message.workerId;
|
|
2814
|
+
}
|
|
2815
|
+
if (message.jobId !== '') {
|
|
2816
|
+
obj.jobId = message.jobId;
|
|
2817
|
+
}
|
|
2818
|
+
if (message.actionId !== '') {
|
|
2819
|
+
obj.actionId = message.actionId;
|
|
2820
|
+
}
|
|
2821
|
+
if (message.batchId !== undefined) {
|
|
2822
|
+
obj.batchId = message.batchId;
|
|
2823
|
+
}
|
|
2824
|
+
if (message.eventTimestamp !== undefined) {
|
|
2825
|
+
obj.eventTimestamp = message.eventTimestamp.toISOString();
|
|
2826
|
+
}
|
|
2827
|
+
if (message.eventType !== 0) {
|
|
2828
|
+
obj.eventType = stepActionEventTypeToJSON(message.eventType);
|
|
2829
|
+
}
|
|
2830
|
+
if ((_a = message.items) === null || _a === void 0 ? void 0 : _a.length) {
|
|
2831
|
+
obj.items = message.items.map((e) => exports.BatchActionEventItem.toJSON(e));
|
|
2832
|
+
}
|
|
2833
|
+
return obj;
|
|
2834
|
+
},
|
|
2835
|
+
create(base) {
|
|
2836
|
+
return exports.BatchActionEvent.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2837
|
+
},
|
|
2838
|
+
fromPartial(object) {
|
|
2839
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2840
|
+
const message = createBaseBatchActionEvent();
|
|
2841
|
+
message.workerId = (_a = object.workerId) !== null && _a !== void 0 ? _a : '';
|
|
2842
|
+
message.jobId = (_b = object.jobId) !== null && _b !== void 0 ? _b : '';
|
|
2843
|
+
message.actionId = (_c = object.actionId) !== null && _c !== void 0 ? _c : '';
|
|
2844
|
+
message.batchId = (_d = object.batchId) !== null && _d !== void 0 ? _d : undefined;
|
|
2845
|
+
message.eventTimestamp = (_e = object.eventTimestamp) !== null && _e !== void 0 ? _e : undefined;
|
|
2846
|
+
message.eventType = (_f = object.eventType) !== null && _f !== void 0 ? _f : 0;
|
|
2847
|
+
message.items = ((_g = object.items) === null || _g === void 0 ? void 0 : _g.map((e) => exports.BatchActionEventItem.fromPartial(e))) || [];
|
|
2848
|
+
return message;
|
|
2849
|
+
},
|
|
2850
|
+
};
|
|
2371
2851
|
function createBaseActionEventResponse() {
|
|
2372
2852
|
return { tenantId: '', workerId: '' };
|
|
2373
2853
|
}
|
|
@@ -3827,6 +4307,18 @@ exports.DispatcherDefinition = {
|
|
|
3827
4307
|
responseStream: false,
|
|
3828
4308
|
options: {},
|
|
3829
4309
|
},
|
|
4310
|
+
/**
|
|
4311
|
+
* SendBatchActionEvent reports a single lifecycle event (STARTED, FAILED, or CANCELLED)
|
|
4312
|
+
* for every task in a batch in one call, instead of one SendStepActionEvent call per task.
|
|
4313
|
+
*/
|
|
4314
|
+
sendBatchActionEvent: {
|
|
4315
|
+
name: 'SendBatchActionEvent',
|
|
4316
|
+
requestType: exports.BatchActionEvent,
|
|
4317
|
+
requestStream: false,
|
|
4318
|
+
responseType: exports.ActionEventResponse,
|
|
4319
|
+
responseStream: false,
|
|
4320
|
+
options: {},
|
|
4321
|
+
},
|
|
3830
4322
|
sendGroupKeyActionEvent: {
|
|
3831
4323
|
name: 'SendGroupKeyActionEvent',
|
|
3832
4324
|
requestType: exports.GroupKeyActionEvent,
|
package/protoc/events/events.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: events/events.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: google/protobuf/any.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: google/protobuf/timestamp.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: google/rpc/status.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
package/protoc/v1/dispatcher.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: v1/dispatcher.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: v1/shared/condition.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: v1/shared/trigger.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|