@hatchet-dev/typescript-sdk 0.1.1 → 0.1.2

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.
Files changed (57) hide show
  1. package/clients/admin/admin-client.d.ts +12 -0
  2. package/clients/admin/admin-client.js +47 -0
  3. package/clients/dispatcher/action-listener.d.ts +26 -0
  4. package/clients/dispatcher/action-listener.js +113 -0
  5. package/clients/dispatcher/dispatcher-client.d.ts +20 -0
  6. package/clients/dispatcher/dispatcher-client.js +58 -0
  7. package/clients/event/event-client.d.ts +11 -0
  8. package/clients/event/event-client.js +32 -0
  9. package/clients/hatchet-client/client-config.d.ts +72 -0
  10. package/clients/hatchet-client/client-config.js +17 -0
  11. package/clients/hatchet-client/hatchet-client.d.ts +26 -0
  12. package/clients/hatchet-client/hatchet-client.js +133 -0
  13. package/clients/hatchet-client/index.d.ts +2 -0
  14. package/clients/hatchet-client/index.js +18 -0
  15. package/clients/worker/index.d.ts +1 -0
  16. package/clients/worker/index.js +17 -0
  17. package/clients/worker/worker.d.ts +34 -0
  18. package/clients/worker/worker.js +317 -0
  19. package/index.d.ts +2 -0
  20. package/index.js +4 -0
  21. package/package.json +2 -2
  22. package/protoc/dispatcher/dispatcher.d.ts +333 -0
  23. package/protoc/dispatcher/dispatcher.js +1152 -0
  24. package/protoc/dispatcher/index.d.ts +1 -0
  25. package/protoc/dispatcher/index.js +17 -0
  26. package/protoc/events/events.d.ts +165 -0
  27. package/protoc/events/events.js +443 -0
  28. package/protoc/events/index.d.ts +1 -0
  29. package/protoc/events/index.js +17 -0
  30. package/protoc/google/protobuf/timestamp.d.ts +121 -0
  31. package/protoc/google/protobuf/timestamp.js +110 -0
  32. package/protoc/google/protobuf/wrappers.d.ts +160 -0
  33. package/protoc/google/protobuf/wrappers.js +527 -0
  34. package/protoc/workflows/index.d.ts +1 -0
  35. package/protoc/workflows/index.js +17 -0
  36. package/protoc/workflows/workflows.d.ts +464 -0
  37. package/protoc/workflows/workflows.js +1951 -0
  38. package/sdk.d.ts +2 -0
  39. package/sdk.js +4 -0
  40. package/step.d.ts +33 -0
  41. package/step.js +65 -0
  42. package/util/config-loader/config-loader.d.ts +13 -0
  43. package/util/config-loader/config-loader.js +85 -0
  44. package/util/config-loader/index.d.ts +1 -0
  45. package/util/config-loader/index.js +17 -0
  46. package/util/errors/hatchet-error.d.ts +4 -0
  47. package/util/errors/hatchet-error.js +9 -0
  48. package/util/hatchet-promise/hatchet-promise.d.ts +6 -0
  49. package/util/hatchet-promise/hatchet-promise.js +12 -0
  50. package/util/logger/index.d.ts +1 -0
  51. package/util/logger/index.js +17 -0
  52. package/util/logger/logger.d.ts +12 -0
  53. package/util/logger/logger.js +37 -0
  54. package/util/sleep.d.ts +2 -0
  55. package/util/sleep.js +6 -0
  56. package/workflow.d.ts +111 -0
  57. package/workflow.js +54 -0
@@ -0,0 +1,1152 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
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
+ const _m0 = __importStar(require("protobufjs/minimal"));
28
+ const timestamp_1 = require("../google/protobuf/timestamp");
29
+ exports.protobufPackage = "";
30
+ var ActionType;
31
+ (function (ActionType) {
32
+ ActionType[ActionType["START_STEP_RUN"] = 0] = "START_STEP_RUN";
33
+ ActionType[ActionType["CANCEL_STEP_RUN"] = 1] = "CANCEL_STEP_RUN";
34
+ ActionType[ActionType["START_GET_GROUP_KEY"] = 2] = "START_GET_GROUP_KEY";
35
+ ActionType[ActionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
36
+ })(ActionType || (exports.ActionType = ActionType = {}));
37
+ function actionTypeFromJSON(object) {
38
+ switch (object) {
39
+ case 0:
40
+ case "START_STEP_RUN":
41
+ return ActionType.START_STEP_RUN;
42
+ case 1:
43
+ case "CANCEL_STEP_RUN":
44
+ return ActionType.CANCEL_STEP_RUN;
45
+ case 2:
46
+ case "START_GET_GROUP_KEY":
47
+ return ActionType.START_GET_GROUP_KEY;
48
+ case -1:
49
+ case "UNRECOGNIZED":
50
+ default:
51
+ return ActionType.UNRECOGNIZED;
52
+ }
53
+ }
54
+ exports.actionTypeFromJSON = actionTypeFromJSON;
55
+ function actionTypeToJSON(object) {
56
+ switch (object) {
57
+ case ActionType.START_STEP_RUN:
58
+ return "START_STEP_RUN";
59
+ case ActionType.CANCEL_STEP_RUN:
60
+ return "CANCEL_STEP_RUN";
61
+ case ActionType.START_GET_GROUP_KEY:
62
+ return "START_GET_GROUP_KEY";
63
+ case ActionType.UNRECOGNIZED:
64
+ default:
65
+ return "UNRECOGNIZED";
66
+ }
67
+ }
68
+ exports.actionTypeToJSON = actionTypeToJSON;
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) {
123
+ switch (object) {
124
+ case 0:
125
+ case "STEP_EVENT_TYPE_UNKNOWN":
126
+ return StepActionEventType.STEP_EVENT_TYPE_UNKNOWN;
127
+ case 1:
128
+ case "STEP_EVENT_TYPE_STARTED":
129
+ return StepActionEventType.STEP_EVENT_TYPE_STARTED;
130
+ case 2:
131
+ case "STEP_EVENT_TYPE_COMPLETED":
132
+ return StepActionEventType.STEP_EVENT_TYPE_COMPLETED;
133
+ case 3:
134
+ case "STEP_EVENT_TYPE_FAILED":
135
+ return StepActionEventType.STEP_EVENT_TYPE_FAILED;
136
+ case -1:
137
+ case "UNRECOGNIZED":
138
+ default:
139
+ return StepActionEventType.UNRECOGNIZED;
140
+ }
141
+ }
142
+ exports.stepActionEventTypeFromJSON = stepActionEventTypeFromJSON;
143
+ function stepActionEventTypeToJSON(object) {
144
+ switch (object) {
145
+ case StepActionEventType.STEP_EVENT_TYPE_UNKNOWN:
146
+ return "STEP_EVENT_TYPE_UNKNOWN";
147
+ case StepActionEventType.STEP_EVENT_TYPE_STARTED:
148
+ return "STEP_EVENT_TYPE_STARTED";
149
+ case StepActionEventType.STEP_EVENT_TYPE_COMPLETED:
150
+ return "STEP_EVENT_TYPE_COMPLETED";
151
+ case StepActionEventType.STEP_EVENT_TYPE_FAILED:
152
+ return "STEP_EVENT_TYPE_FAILED";
153
+ case StepActionEventType.UNRECOGNIZED:
154
+ default:
155
+ return "UNRECOGNIZED";
156
+ }
157
+ }
158
+ exports.stepActionEventTypeToJSON = stepActionEventTypeToJSON;
159
+ function createBaseWorkerRegisterRequest() {
160
+ return { workerName: "", actions: [], services: [] };
161
+ }
162
+ exports.WorkerRegisterRequest = {
163
+ encode(message, writer = _m0.Writer.create()) {
164
+ if (message.workerName !== "") {
165
+ writer.uint32(10).string(message.workerName);
166
+ }
167
+ for (const v of message.actions) {
168
+ writer.uint32(18).string(v);
169
+ }
170
+ for (const v of message.services) {
171
+ writer.uint32(26).string(v);
172
+ }
173
+ return writer;
174
+ },
175
+ decode(input, length) {
176
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
177
+ let end = length === undefined ? reader.len : reader.pos + length;
178
+ const message = createBaseWorkerRegisterRequest();
179
+ while (reader.pos < end) {
180
+ const tag = reader.uint32();
181
+ switch (tag >>> 3) {
182
+ case 1:
183
+ if (tag !== 10) {
184
+ break;
185
+ }
186
+ message.workerName = reader.string();
187
+ continue;
188
+ case 2:
189
+ if (tag !== 18) {
190
+ break;
191
+ }
192
+ message.actions.push(reader.string());
193
+ continue;
194
+ case 3:
195
+ if (tag !== 26) {
196
+ break;
197
+ }
198
+ message.services.push(reader.string());
199
+ continue;
200
+ }
201
+ if ((tag & 7) === 4 || tag === 0) {
202
+ break;
203
+ }
204
+ reader.skipType(tag & 7);
205
+ }
206
+ return message;
207
+ },
208
+ fromJSON(object) {
209
+ return {
210
+ workerName: isSet(object.workerName) ? globalThis.String(object.workerName) : "",
211
+ actions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.actions) ? object.actions.map((e) => globalThis.String(e)) : [],
212
+ services: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.services) ? object.services.map((e) => globalThis.String(e)) : [],
213
+ };
214
+ },
215
+ toJSON(message) {
216
+ var _a, _b;
217
+ const obj = {};
218
+ if (message.workerName !== "") {
219
+ obj.workerName = message.workerName;
220
+ }
221
+ if ((_a = message.actions) === null || _a === void 0 ? void 0 : _a.length) {
222
+ obj.actions = message.actions;
223
+ }
224
+ if ((_b = message.services) === null || _b === void 0 ? void 0 : _b.length) {
225
+ obj.services = message.services;
226
+ }
227
+ return obj;
228
+ },
229
+ create(base) {
230
+ return exports.WorkerRegisterRequest.fromPartial(base !== null && base !== void 0 ? base : {});
231
+ },
232
+ fromPartial(object) {
233
+ var _a, _b, _c;
234
+ const message = createBaseWorkerRegisterRequest();
235
+ message.workerName = (_a = object.workerName) !== null && _a !== void 0 ? _a : "";
236
+ message.actions = ((_b = object.actions) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
237
+ message.services = ((_c = object.services) === null || _c === void 0 ? void 0 : _c.map((e) => e)) || [];
238
+ return message;
239
+ },
240
+ };
241
+ function createBaseWorkerRegisterResponse() {
242
+ return { tenantId: "", workerId: "", workerName: "" };
243
+ }
244
+ exports.WorkerRegisterResponse = {
245
+ encode(message, writer = _m0.Writer.create()) {
246
+ if (message.tenantId !== "") {
247
+ writer.uint32(10).string(message.tenantId);
248
+ }
249
+ if (message.workerId !== "") {
250
+ writer.uint32(18).string(message.workerId);
251
+ }
252
+ if (message.workerName !== "") {
253
+ writer.uint32(26).string(message.workerName);
254
+ }
255
+ return writer;
256
+ },
257
+ decode(input, length) {
258
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
259
+ let end = length === undefined ? reader.len : reader.pos + length;
260
+ const message = createBaseWorkerRegisterResponse();
261
+ while (reader.pos < end) {
262
+ const tag = reader.uint32();
263
+ switch (tag >>> 3) {
264
+ case 1:
265
+ if (tag !== 10) {
266
+ break;
267
+ }
268
+ message.tenantId = reader.string();
269
+ continue;
270
+ case 2:
271
+ if (tag !== 18) {
272
+ break;
273
+ }
274
+ message.workerId = reader.string();
275
+ continue;
276
+ case 3:
277
+ if (tag !== 26) {
278
+ break;
279
+ }
280
+ message.workerName = reader.string();
281
+ continue;
282
+ }
283
+ if ((tag & 7) === 4 || tag === 0) {
284
+ break;
285
+ }
286
+ reader.skipType(tag & 7);
287
+ }
288
+ return message;
289
+ },
290
+ fromJSON(object) {
291
+ return {
292
+ tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
293
+ workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "",
294
+ workerName: isSet(object.workerName) ? globalThis.String(object.workerName) : "",
295
+ };
296
+ },
297
+ toJSON(message) {
298
+ const obj = {};
299
+ if (message.tenantId !== "") {
300
+ obj.tenantId = message.tenantId;
301
+ }
302
+ if (message.workerId !== "") {
303
+ obj.workerId = message.workerId;
304
+ }
305
+ if (message.workerName !== "") {
306
+ obj.workerName = message.workerName;
307
+ }
308
+ return obj;
309
+ },
310
+ create(base) {
311
+ return exports.WorkerRegisterResponse.fromPartial(base !== null && base !== void 0 ? base : {});
312
+ },
313
+ fromPartial(object) {
314
+ var _a, _b, _c;
315
+ const message = createBaseWorkerRegisterResponse();
316
+ message.tenantId = (_a = object.tenantId) !== null && _a !== void 0 ? _a : "";
317
+ message.workerId = (_b = object.workerId) !== null && _b !== void 0 ? _b : "";
318
+ message.workerName = (_c = object.workerName) !== null && _c !== void 0 ? _c : "";
319
+ return message;
320
+ },
321
+ };
322
+ function createBaseAssignedAction() {
323
+ return {
324
+ tenantId: "",
325
+ workflowRunId: "",
326
+ getGroupKeyRunId: "",
327
+ jobId: "",
328
+ jobName: "",
329
+ jobRunId: "",
330
+ stepId: "",
331
+ stepRunId: "",
332
+ actionId: "",
333
+ actionType: 0,
334
+ actionPayload: "",
335
+ };
336
+ }
337
+ exports.AssignedAction = {
338
+ encode(message, writer = _m0.Writer.create()) {
339
+ if (message.tenantId !== "") {
340
+ writer.uint32(10).string(message.tenantId);
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
+ }
348
+ if (message.jobId !== "") {
349
+ writer.uint32(34).string(message.jobId);
350
+ }
351
+ if (message.jobName !== "") {
352
+ writer.uint32(42).string(message.jobName);
353
+ }
354
+ if (message.jobRunId !== "") {
355
+ writer.uint32(50).string(message.jobRunId);
356
+ }
357
+ if (message.stepId !== "") {
358
+ writer.uint32(58).string(message.stepId);
359
+ }
360
+ if (message.stepRunId !== "") {
361
+ writer.uint32(66).string(message.stepRunId);
362
+ }
363
+ if (message.actionId !== "") {
364
+ writer.uint32(74).string(message.actionId);
365
+ }
366
+ if (message.actionType !== 0) {
367
+ writer.uint32(80).int32(message.actionType);
368
+ }
369
+ if (message.actionPayload !== "") {
370
+ writer.uint32(90).string(message.actionPayload);
371
+ }
372
+ return writer;
373
+ },
374
+ decode(input, length) {
375
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
376
+ let end = length === undefined ? reader.len : reader.pos + length;
377
+ const message = createBaseAssignedAction();
378
+ while (reader.pos < end) {
379
+ const tag = reader.uint32();
380
+ switch (tag >>> 3) {
381
+ case 1:
382
+ if (tag !== 10) {
383
+ break;
384
+ }
385
+ message.tenantId = reader.string();
386
+ continue;
387
+ case 2:
388
+ if (tag !== 18) {
389
+ break;
390
+ }
391
+ message.workflowRunId = reader.string();
392
+ continue;
393
+ case 3:
394
+ if (tag !== 26) {
395
+ break;
396
+ }
397
+ message.getGroupKeyRunId = reader.string();
398
+ continue;
399
+ case 4:
400
+ if (tag !== 34) {
401
+ break;
402
+ }
403
+ message.jobId = reader.string();
404
+ continue;
405
+ case 5:
406
+ if (tag !== 42) {
407
+ break;
408
+ }
409
+ message.jobName = reader.string();
410
+ continue;
411
+ case 6:
412
+ if (tag !== 50) {
413
+ break;
414
+ }
415
+ message.jobRunId = reader.string();
416
+ continue;
417
+ case 7:
418
+ if (tag !== 58) {
419
+ break;
420
+ }
421
+ message.stepId = reader.string();
422
+ continue;
423
+ case 8:
424
+ if (tag !== 66) {
425
+ break;
426
+ }
427
+ message.stepRunId = reader.string();
428
+ continue;
429
+ case 9:
430
+ if (tag !== 74) {
431
+ break;
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
+ }
445
+ message.actionPayload = reader.string();
446
+ continue;
447
+ }
448
+ if ((tag & 7) === 4 || tag === 0) {
449
+ break;
450
+ }
451
+ reader.skipType(tag & 7);
452
+ }
453
+ return message;
454
+ },
455
+ fromJSON(object) {
456
+ return {
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) : "",
460
+ jobId: isSet(object.jobId) ? globalThis.String(object.jobId) : "",
461
+ jobName: isSet(object.jobName) ? globalThis.String(object.jobName) : "",
462
+ jobRunId: isSet(object.jobRunId) ? globalThis.String(object.jobRunId) : "",
463
+ stepId: isSet(object.stepId) ? globalThis.String(object.stepId) : "",
464
+ stepRunId: isSet(object.stepRunId) ? globalThis.String(object.stepRunId) : "",
465
+ actionId: isSet(object.actionId) ? globalThis.String(object.actionId) : "",
466
+ actionType: isSet(object.actionType) ? actionTypeFromJSON(object.actionType) : 0,
467
+ actionPayload: isSet(object.actionPayload) ? globalThis.String(object.actionPayload) : "",
468
+ };
469
+ },
470
+ toJSON(message) {
471
+ const obj = {};
472
+ if (message.tenantId !== "") {
473
+ obj.tenantId = message.tenantId;
474
+ }
475
+ if (message.workflowRunId !== "") {
476
+ obj.workflowRunId = message.workflowRunId;
477
+ }
478
+ if (message.getGroupKeyRunId !== "") {
479
+ obj.getGroupKeyRunId = message.getGroupKeyRunId;
480
+ }
481
+ if (message.jobId !== "") {
482
+ obj.jobId = message.jobId;
483
+ }
484
+ if (message.jobName !== "") {
485
+ obj.jobName = message.jobName;
486
+ }
487
+ if (message.jobRunId !== "") {
488
+ obj.jobRunId = message.jobRunId;
489
+ }
490
+ if (message.stepId !== "") {
491
+ obj.stepId = message.stepId;
492
+ }
493
+ if (message.stepRunId !== "") {
494
+ obj.stepRunId = message.stepRunId;
495
+ }
496
+ if (message.actionId !== "") {
497
+ obj.actionId = message.actionId;
498
+ }
499
+ if (message.actionType !== 0) {
500
+ obj.actionType = actionTypeToJSON(message.actionType);
501
+ }
502
+ if (message.actionPayload !== "") {
503
+ obj.actionPayload = message.actionPayload;
504
+ }
505
+ return obj;
506
+ },
507
+ create(base) {
508
+ return exports.AssignedAction.fromPartial(base !== null && base !== void 0 ? base : {});
509
+ },
510
+ fromPartial(object) {
511
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
512
+ const message = createBaseAssignedAction();
513
+ message.tenantId = (_a = object.tenantId) !== null && _a !== void 0 ? _a : "";
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 : "";
524
+ return message;
525
+ },
526
+ };
527
+ function createBaseWorkerListenRequest() {
528
+ return { workerId: "" };
529
+ }
530
+ exports.WorkerListenRequest = {
531
+ encode(message, writer = _m0.Writer.create()) {
532
+ if (message.workerId !== "") {
533
+ writer.uint32(10).string(message.workerId);
534
+ }
535
+ return writer;
536
+ },
537
+ decode(input, length) {
538
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
539
+ let end = length === undefined ? reader.len : reader.pos + length;
540
+ const message = createBaseWorkerListenRequest();
541
+ while (reader.pos < end) {
542
+ const tag = reader.uint32();
543
+ switch (tag >>> 3) {
544
+ case 1:
545
+ if (tag !== 10) {
546
+ break;
547
+ }
548
+ message.workerId = reader.string();
549
+ continue;
550
+ }
551
+ if ((tag & 7) === 4 || tag === 0) {
552
+ break;
553
+ }
554
+ reader.skipType(tag & 7);
555
+ }
556
+ return message;
557
+ },
558
+ fromJSON(object) {
559
+ return { workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "" };
560
+ },
561
+ toJSON(message) {
562
+ const obj = {};
563
+ if (message.workerId !== "") {
564
+ obj.workerId = message.workerId;
565
+ }
566
+ return obj;
567
+ },
568
+ create(base) {
569
+ return exports.WorkerListenRequest.fromPartial(base !== null && base !== void 0 ? base : {});
570
+ },
571
+ fromPartial(object) {
572
+ var _a;
573
+ const message = createBaseWorkerListenRequest();
574
+ message.workerId = (_a = object.workerId) !== null && _a !== void 0 ? _a : "";
575
+ return message;
576
+ },
577
+ };
578
+ function createBaseWorkerUnsubscribeRequest() {
579
+ return { workerId: "" };
580
+ }
581
+ exports.WorkerUnsubscribeRequest = {
582
+ encode(message, writer = _m0.Writer.create()) {
583
+ if (message.workerId !== "") {
584
+ writer.uint32(10).string(message.workerId);
585
+ }
586
+ return writer;
587
+ },
588
+ decode(input, length) {
589
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
590
+ let end = length === undefined ? reader.len : reader.pos + length;
591
+ const message = createBaseWorkerUnsubscribeRequest();
592
+ while (reader.pos < end) {
593
+ const tag = reader.uint32();
594
+ switch (tag >>> 3) {
595
+ case 1:
596
+ if (tag !== 10) {
597
+ break;
598
+ }
599
+ message.workerId = reader.string();
600
+ continue;
601
+ }
602
+ if ((tag & 7) === 4 || tag === 0) {
603
+ break;
604
+ }
605
+ reader.skipType(tag & 7);
606
+ }
607
+ return message;
608
+ },
609
+ fromJSON(object) {
610
+ return { workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "" };
611
+ },
612
+ toJSON(message) {
613
+ const obj = {};
614
+ if (message.workerId !== "") {
615
+ obj.workerId = message.workerId;
616
+ }
617
+ return obj;
618
+ },
619
+ create(base) {
620
+ return exports.WorkerUnsubscribeRequest.fromPartial(base !== null && base !== void 0 ? base : {});
621
+ },
622
+ fromPartial(object) {
623
+ var _a;
624
+ const message = createBaseWorkerUnsubscribeRequest();
625
+ message.workerId = (_a = object.workerId) !== null && _a !== void 0 ? _a : "";
626
+ return message;
627
+ },
628
+ };
629
+ function createBaseWorkerUnsubscribeResponse() {
630
+ return { tenantId: "", workerId: "" };
631
+ }
632
+ exports.WorkerUnsubscribeResponse = {
633
+ encode(message, writer = _m0.Writer.create()) {
634
+ if (message.tenantId !== "") {
635
+ writer.uint32(10).string(message.tenantId);
636
+ }
637
+ if (message.workerId !== "") {
638
+ writer.uint32(18).string(message.workerId);
639
+ }
640
+ return writer;
641
+ },
642
+ decode(input, length) {
643
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
644
+ let end = length === undefined ? reader.len : reader.pos + length;
645
+ const message = createBaseWorkerUnsubscribeResponse();
646
+ while (reader.pos < end) {
647
+ const tag = reader.uint32();
648
+ switch (tag >>> 3) {
649
+ case 1:
650
+ if (tag !== 10) {
651
+ break;
652
+ }
653
+ message.tenantId = reader.string();
654
+ continue;
655
+ case 2:
656
+ if (tag !== 18) {
657
+ break;
658
+ }
659
+ message.workerId = reader.string();
660
+ continue;
661
+ }
662
+ if ((tag & 7) === 4 || tag === 0) {
663
+ break;
664
+ }
665
+ reader.skipType(tag & 7);
666
+ }
667
+ return message;
668
+ },
669
+ fromJSON(object) {
670
+ return {
671
+ tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
672
+ workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "",
673
+ };
674
+ },
675
+ toJSON(message) {
676
+ const obj = {};
677
+ if (message.tenantId !== "") {
678
+ obj.tenantId = message.tenantId;
679
+ }
680
+ if (message.workerId !== "") {
681
+ obj.workerId = message.workerId;
682
+ }
683
+ return obj;
684
+ },
685
+ create(base) {
686
+ return exports.WorkerUnsubscribeResponse.fromPartial(base !== null && base !== void 0 ? base : {});
687
+ },
688
+ fromPartial(object) {
689
+ var _a, _b;
690
+ const message = createBaseWorkerUnsubscribeResponse();
691
+ message.tenantId = (_a = object.tenantId) !== null && _a !== void 0 ? _a : "";
692
+ message.workerId = (_b = object.workerId) !== null && _b !== void 0 ? _b : "";
693
+ return message;
694
+ },
695
+ };
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() {
842
+ return {
843
+ workerId: "",
844
+ jobId: "",
845
+ jobRunId: "",
846
+ stepId: "",
847
+ stepRunId: "",
848
+ actionId: "",
849
+ eventTimestamp: undefined,
850
+ eventType: 0,
851
+ eventPayload: "",
852
+ };
853
+ }
854
+ exports.StepActionEvent = {
855
+ encode(message, writer = _m0.Writer.create()) {
856
+ if (message.workerId !== "") {
857
+ writer.uint32(10).string(message.workerId);
858
+ }
859
+ if (message.jobId !== "") {
860
+ writer.uint32(18).string(message.jobId);
861
+ }
862
+ if (message.jobRunId !== "") {
863
+ writer.uint32(26).string(message.jobRunId);
864
+ }
865
+ if (message.stepId !== "") {
866
+ writer.uint32(34).string(message.stepId);
867
+ }
868
+ if (message.stepRunId !== "") {
869
+ writer.uint32(42).string(message.stepRunId);
870
+ }
871
+ if (message.actionId !== "") {
872
+ writer.uint32(50).string(message.actionId);
873
+ }
874
+ if (message.eventTimestamp !== undefined) {
875
+ timestamp_1.Timestamp.encode(toTimestamp(message.eventTimestamp), writer.uint32(58).fork()).ldelim();
876
+ }
877
+ if (message.eventType !== 0) {
878
+ writer.uint32(64).int32(message.eventType);
879
+ }
880
+ if (message.eventPayload !== "") {
881
+ writer.uint32(74).string(message.eventPayload);
882
+ }
883
+ return writer;
884
+ },
885
+ decode(input, length) {
886
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
887
+ let end = length === undefined ? reader.len : reader.pos + length;
888
+ const message = createBaseStepActionEvent();
889
+ while (reader.pos < end) {
890
+ const tag = reader.uint32();
891
+ switch (tag >>> 3) {
892
+ case 1:
893
+ if (tag !== 10) {
894
+ break;
895
+ }
896
+ message.workerId = reader.string();
897
+ continue;
898
+ case 2:
899
+ if (tag !== 18) {
900
+ break;
901
+ }
902
+ message.jobId = reader.string();
903
+ continue;
904
+ case 3:
905
+ if (tag !== 26) {
906
+ break;
907
+ }
908
+ message.jobRunId = reader.string();
909
+ continue;
910
+ case 4:
911
+ if (tag !== 34) {
912
+ break;
913
+ }
914
+ message.stepId = reader.string();
915
+ continue;
916
+ case 5:
917
+ if (tag !== 42) {
918
+ break;
919
+ }
920
+ message.stepRunId = reader.string();
921
+ continue;
922
+ case 6:
923
+ if (tag !== 50) {
924
+ break;
925
+ }
926
+ message.actionId = reader.string();
927
+ continue;
928
+ case 7:
929
+ if (tag !== 58) {
930
+ break;
931
+ }
932
+ message.eventTimestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
933
+ continue;
934
+ case 8:
935
+ if (tag !== 64) {
936
+ break;
937
+ }
938
+ message.eventType = reader.int32();
939
+ continue;
940
+ case 9:
941
+ if (tag !== 74) {
942
+ break;
943
+ }
944
+ message.eventPayload = reader.string();
945
+ continue;
946
+ }
947
+ if ((tag & 7) === 4 || tag === 0) {
948
+ break;
949
+ }
950
+ reader.skipType(tag & 7);
951
+ }
952
+ return message;
953
+ },
954
+ fromJSON(object) {
955
+ return {
956
+ workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "",
957
+ jobId: isSet(object.jobId) ? globalThis.String(object.jobId) : "",
958
+ jobRunId: isSet(object.jobRunId) ? globalThis.String(object.jobRunId) : "",
959
+ stepId: isSet(object.stepId) ? globalThis.String(object.stepId) : "",
960
+ stepRunId: isSet(object.stepRunId) ? globalThis.String(object.stepRunId) : "",
961
+ actionId: isSet(object.actionId) ? globalThis.String(object.actionId) : "",
962
+ eventTimestamp: isSet(object.eventTimestamp) ? fromJsonTimestamp(object.eventTimestamp) : undefined,
963
+ eventType: isSet(object.eventType) ? stepActionEventTypeFromJSON(object.eventType) : 0,
964
+ eventPayload: isSet(object.eventPayload) ? globalThis.String(object.eventPayload) : "",
965
+ };
966
+ },
967
+ toJSON(message) {
968
+ const obj = {};
969
+ if (message.workerId !== "") {
970
+ obj.workerId = message.workerId;
971
+ }
972
+ if (message.jobId !== "") {
973
+ obj.jobId = message.jobId;
974
+ }
975
+ if (message.jobRunId !== "") {
976
+ obj.jobRunId = message.jobRunId;
977
+ }
978
+ if (message.stepId !== "") {
979
+ obj.stepId = message.stepId;
980
+ }
981
+ if (message.stepRunId !== "") {
982
+ obj.stepRunId = message.stepRunId;
983
+ }
984
+ if (message.actionId !== "") {
985
+ obj.actionId = message.actionId;
986
+ }
987
+ if (message.eventTimestamp !== undefined) {
988
+ obj.eventTimestamp = message.eventTimestamp.toISOString();
989
+ }
990
+ if (message.eventType !== 0) {
991
+ obj.eventType = stepActionEventTypeToJSON(message.eventType);
992
+ }
993
+ if (message.eventPayload !== "") {
994
+ obj.eventPayload = message.eventPayload;
995
+ }
996
+ return obj;
997
+ },
998
+ create(base) {
999
+ return exports.StepActionEvent.fromPartial(base !== null && base !== void 0 ? base : {});
1000
+ },
1001
+ fromPartial(object) {
1002
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1003
+ const message = createBaseStepActionEvent();
1004
+ message.workerId = (_a = object.workerId) !== null && _a !== void 0 ? _a : "";
1005
+ message.jobId = (_b = object.jobId) !== null && _b !== void 0 ? _b : "";
1006
+ message.jobRunId = (_c = object.jobRunId) !== null && _c !== void 0 ? _c : "";
1007
+ message.stepId = (_d = object.stepId) !== null && _d !== void 0 ? _d : "";
1008
+ message.stepRunId = (_e = object.stepRunId) !== null && _e !== void 0 ? _e : "";
1009
+ message.actionId = (_f = object.actionId) !== null && _f !== void 0 ? _f : "";
1010
+ message.eventTimestamp = (_g = object.eventTimestamp) !== null && _g !== void 0 ? _g : undefined;
1011
+ message.eventType = (_h = object.eventType) !== null && _h !== void 0 ? _h : 0;
1012
+ message.eventPayload = (_j = object.eventPayload) !== null && _j !== void 0 ? _j : "";
1013
+ return message;
1014
+ },
1015
+ };
1016
+ function createBaseActionEventResponse() {
1017
+ return { tenantId: "", workerId: "" };
1018
+ }
1019
+ exports.ActionEventResponse = {
1020
+ encode(message, writer = _m0.Writer.create()) {
1021
+ if (message.tenantId !== "") {
1022
+ writer.uint32(10).string(message.tenantId);
1023
+ }
1024
+ if (message.workerId !== "") {
1025
+ writer.uint32(18).string(message.workerId);
1026
+ }
1027
+ return writer;
1028
+ },
1029
+ decode(input, length) {
1030
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1031
+ let end = length === undefined ? reader.len : reader.pos + length;
1032
+ const message = createBaseActionEventResponse();
1033
+ while (reader.pos < end) {
1034
+ const tag = reader.uint32();
1035
+ switch (tag >>> 3) {
1036
+ case 1:
1037
+ if (tag !== 10) {
1038
+ break;
1039
+ }
1040
+ message.tenantId = reader.string();
1041
+ continue;
1042
+ case 2:
1043
+ if (tag !== 18) {
1044
+ break;
1045
+ }
1046
+ message.workerId = reader.string();
1047
+ continue;
1048
+ }
1049
+ if ((tag & 7) === 4 || tag === 0) {
1050
+ break;
1051
+ }
1052
+ reader.skipType(tag & 7);
1053
+ }
1054
+ return message;
1055
+ },
1056
+ fromJSON(object) {
1057
+ return {
1058
+ tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
1059
+ workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "",
1060
+ };
1061
+ },
1062
+ toJSON(message) {
1063
+ const obj = {};
1064
+ if (message.tenantId !== "") {
1065
+ obj.tenantId = message.tenantId;
1066
+ }
1067
+ if (message.workerId !== "") {
1068
+ obj.workerId = message.workerId;
1069
+ }
1070
+ return obj;
1071
+ },
1072
+ create(base) {
1073
+ return exports.ActionEventResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1074
+ },
1075
+ fromPartial(object) {
1076
+ var _a, _b;
1077
+ const message = createBaseActionEventResponse();
1078
+ message.tenantId = (_a = object.tenantId) !== null && _a !== void 0 ? _a : "";
1079
+ message.workerId = (_b = object.workerId) !== null && _b !== void 0 ? _b : "";
1080
+ return message;
1081
+ },
1082
+ };
1083
+ exports.DispatcherDefinition = {
1084
+ name: "Dispatcher",
1085
+ fullName: "Dispatcher",
1086
+ methods: {
1087
+ register: {
1088
+ name: "Register",
1089
+ requestType: exports.WorkerRegisterRequest,
1090
+ requestStream: false,
1091
+ responseType: exports.WorkerRegisterResponse,
1092
+ responseStream: false,
1093
+ options: {},
1094
+ },
1095
+ listen: {
1096
+ name: "Listen",
1097
+ requestType: exports.WorkerListenRequest,
1098
+ requestStream: false,
1099
+ responseType: exports.AssignedAction,
1100
+ responseStream: true,
1101
+ options: {},
1102
+ },
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,
1114
+ requestStream: false,
1115
+ responseType: exports.ActionEventResponse,
1116
+ responseStream: false,
1117
+ options: {},
1118
+ },
1119
+ unsubscribe: {
1120
+ name: "Unsubscribe",
1121
+ requestType: exports.WorkerUnsubscribeRequest,
1122
+ requestStream: false,
1123
+ responseType: exports.WorkerUnsubscribeResponse,
1124
+ responseStream: false,
1125
+ options: {},
1126
+ },
1127
+ },
1128
+ };
1129
+ function toTimestamp(date) {
1130
+ const seconds = Math.trunc(date.getTime() / 1000);
1131
+ const nanos = (date.getTime() % 1000) * 1000000;
1132
+ return { seconds, nanos };
1133
+ }
1134
+ function fromTimestamp(t) {
1135
+ let millis = (t.seconds || 0) * 1000;
1136
+ millis += (t.nanos || 0) / 1000000;
1137
+ return new globalThis.Date(millis);
1138
+ }
1139
+ function fromJsonTimestamp(o) {
1140
+ if (o instanceof globalThis.Date) {
1141
+ return o;
1142
+ }
1143
+ else if (typeof o === "string") {
1144
+ return new globalThis.Date(o);
1145
+ }
1146
+ else {
1147
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
1148
+ }
1149
+ }
1150
+ function isSet(value) {
1151
+ return value !== null && value !== undefined;
1152
+ }