@hatchet-dev/typescript-sdk 1.11.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clients/admin/admin-client.d.ts +38 -0
- package/clients/admin/admin-client.js +19 -6
- package/clients/dispatcher/action-listener.d.ts +6 -2
- package/clients/dispatcher/action-listener.js +2 -2
- package/clients/dispatcher/dispatcher-client.d.ts +22 -3
- package/clients/dispatcher/dispatcher-client.js +41 -4
- package/clients/event/event-client.d.ts +2 -2
- package/clients/event/event-client.js +4 -4
- package/clients/hatchet-client/hatchet-logger.js +2 -2
- package/clients/rest/generated/Api.d.ts +9 -1
- package/clients/rest/generated/data-contracts.d.ts +44 -8
- package/clients/rest/generated/data-contracts.js +13 -2
- package/clients/worker/worker.js +11 -11
- package/examples/webhooks.d.ts +1 -0
- package/examples/webhooks.js +45 -0
- package/package.json +1 -1
- package/protoc/dispatcher/dispatcher.d.ts +70 -25
- package/protoc/dispatcher/dispatcher.js +323 -97
- package/protoc/events/events.d.ts +4 -4
- package/protoc/events/events.js +20 -16
- package/protoc/v1/workflows.d.ts +18 -7
- package/protoc/v1/workflows.js +122 -2
- package/protoc/workflows/workflows.d.ts +22 -22
- package/protoc/workflows/workflows.js +18 -18
- package/step.d.ts +6 -0
- package/step.js +27 -19
- package/util/workflow-run-ref.js +1 -1
- package/v1/client/admin.d.ts +30 -0
- package/v1/client/admin.js +21 -6
- package/v1/client/client.d.ts +8 -1
- package/v1/client/client.js +13 -2
- package/v1/client/features/runs.d.ts +9 -1
- package/v1/client/features/runs.js +4 -2
- package/v1/client/features/webhooks.d.ts +28 -0
- package/v1/client/features/webhooks.js +97 -0
- package/v1/client/worker/context.d.ts +6 -0
- package/v1/client/worker/context.js +30 -22
- package/v1/client/worker/deprecated/deprecation.d.ts +44 -0
- package/v1/client/worker/deprecated/deprecation.js +95 -0
- package/v1/client/worker/deprecated/index.d.ts +4 -0
- package/v1/client/worker/deprecated/index.js +15 -0
- package/v1/client/worker/deprecated/legacy-registration.d.ts +18 -0
- package/v1/client/worker/deprecated/legacy-registration.js +35 -0
- package/v1/client/worker/deprecated/legacy-v1-worker.d.ts +15 -0
- package/v1/client/worker/deprecated/legacy-v1-worker.js +39 -0
- package/v1/client/worker/deprecated/legacy-worker.d.ts +41 -0
- package/v1/client/worker/deprecated/legacy-worker.js +148 -0
- package/v1/client/worker/slot-utils.d.ts +21 -0
- package/v1/client/worker/slot-utils.js +73 -0
- package/v1/client/worker/worker-internal.d.ts +16 -5
- package/v1/client/worker/worker-internal.js +54 -37
- package/v1/client/worker/worker.d.ts +12 -15
- package/v1/client/worker/worker.js +45 -49
- package/v1/declaration.js +1 -1
- package/v1/index.d.ts +1 -0
- package/v1/index.js +1 -0
- package/v1/parent-run-context-vars.d.ts +4 -1
- package/v1/parent-run-context-vars.js +1 -0
- package/v1/slot-types.d.ts +5 -0
- package/v1/slot-types.js +9 -0
- package/v1/task.d.ts +2 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/workflow.d.ts +2 -2
|
@@ -21,8 +21,8 @@ export interface Events {
|
|
|
21
21
|
events: Event[];
|
|
22
22
|
}
|
|
23
23
|
export interface PutLogRequest {
|
|
24
|
-
/** the
|
|
25
|
-
|
|
24
|
+
/** the task external run id for the request */
|
|
25
|
+
taskRunExternalId: string;
|
|
26
26
|
/** when the log line was created */
|
|
27
27
|
createdAt: Date | undefined;
|
|
28
28
|
/** the log line message */
|
|
@@ -37,8 +37,8 @@ export interface PutLogRequest {
|
|
|
37
37
|
export interface PutLogResponse {
|
|
38
38
|
}
|
|
39
39
|
export interface PutStreamEventRequest {
|
|
40
|
-
/** the
|
|
41
|
-
|
|
40
|
+
/** the task external run id for the request */
|
|
41
|
+
taskRunExternalId: string;
|
|
42
42
|
/** when the stream event was created */
|
|
43
43
|
createdAt: Date | undefined;
|
|
44
44
|
/** the stream event message */
|
package/protoc/events/events.js
CHANGED
|
@@ -225,7 +225,7 @@ exports.Events = {
|
|
|
225
225
|
};
|
|
226
226
|
function createBasePutLogRequest() {
|
|
227
227
|
return {
|
|
228
|
-
|
|
228
|
+
taskRunExternalId: '',
|
|
229
229
|
createdAt: undefined,
|
|
230
230
|
message: '',
|
|
231
231
|
level: undefined,
|
|
@@ -235,8 +235,8 @@ function createBasePutLogRequest() {
|
|
|
235
235
|
}
|
|
236
236
|
exports.PutLogRequest = {
|
|
237
237
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
238
|
-
if (message.
|
|
239
|
-
writer.uint32(10).string(message.
|
|
238
|
+
if (message.taskRunExternalId !== '') {
|
|
239
|
+
writer.uint32(10).string(message.taskRunExternalId);
|
|
240
240
|
}
|
|
241
241
|
if (message.createdAt !== undefined) {
|
|
242
242
|
timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(18).fork()).join();
|
|
@@ -266,7 +266,7 @@ exports.PutLogRequest = {
|
|
|
266
266
|
if (tag !== 10) {
|
|
267
267
|
break;
|
|
268
268
|
}
|
|
269
|
-
message.
|
|
269
|
+
message.taskRunExternalId = reader.string();
|
|
270
270
|
continue;
|
|
271
271
|
}
|
|
272
272
|
case 2: {
|
|
@@ -314,7 +314,9 @@ exports.PutLogRequest = {
|
|
|
314
314
|
},
|
|
315
315
|
fromJSON(object) {
|
|
316
316
|
return {
|
|
317
|
-
|
|
317
|
+
taskRunExternalId: isSet(object.taskRunExternalId)
|
|
318
|
+
? globalThis.String(object.taskRunExternalId)
|
|
319
|
+
: '',
|
|
318
320
|
createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined,
|
|
319
321
|
message: isSet(object.message) ? globalThis.String(object.message) : '',
|
|
320
322
|
level: isSet(object.level) ? globalThis.String(object.level) : undefined,
|
|
@@ -326,8 +328,8 @@ exports.PutLogRequest = {
|
|
|
326
328
|
},
|
|
327
329
|
toJSON(message) {
|
|
328
330
|
const obj = {};
|
|
329
|
-
if (message.
|
|
330
|
-
obj.
|
|
331
|
+
if (message.taskRunExternalId !== '') {
|
|
332
|
+
obj.taskRunExternalId = message.taskRunExternalId;
|
|
331
333
|
}
|
|
332
334
|
if (message.createdAt !== undefined) {
|
|
333
335
|
obj.createdAt = message.createdAt.toISOString();
|
|
@@ -352,7 +354,7 @@ exports.PutLogRequest = {
|
|
|
352
354
|
fromPartial(object) {
|
|
353
355
|
var _a, _b, _c, _d, _e, _f;
|
|
354
356
|
const message = createBasePutLogRequest();
|
|
355
|
-
message.
|
|
357
|
+
message.taskRunExternalId = (_a = object.taskRunExternalId) !== null && _a !== void 0 ? _a : '';
|
|
356
358
|
message.createdAt = (_b = object.createdAt) !== null && _b !== void 0 ? _b : undefined;
|
|
357
359
|
message.message = (_c = object.message) !== null && _c !== void 0 ? _c : '';
|
|
358
360
|
message.level = (_d = object.level) !== null && _d !== void 0 ? _d : undefined;
|
|
@@ -400,7 +402,7 @@ exports.PutLogResponse = {
|
|
|
400
402
|
};
|
|
401
403
|
function createBasePutStreamEventRequest() {
|
|
402
404
|
return {
|
|
403
|
-
|
|
405
|
+
taskRunExternalId: '',
|
|
404
406
|
createdAt: undefined,
|
|
405
407
|
message: new Uint8Array(0),
|
|
406
408
|
metadata: '',
|
|
@@ -409,8 +411,8 @@ function createBasePutStreamEventRequest() {
|
|
|
409
411
|
}
|
|
410
412
|
exports.PutStreamEventRequest = {
|
|
411
413
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
412
|
-
if (message.
|
|
413
|
-
writer.uint32(10).string(message.
|
|
414
|
+
if (message.taskRunExternalId !== '') {
|
|
415
|
+
writer.uint32(10).string(message.taskRunExternalId);
|
|
414
416
|
}
|
|
415
417
|
if (message.createdAt !== undefined) {
|
|
416
418
|
timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(18).fork()).join();
|
|
@@ -437,7 +439,7 @@ exports.PutStreamEventRequest = {
|
|
|
437
439
|
if (tag !== 10) {
|
|
438
440
|
break;
|
|
439
441
|
}
|
|
440
|
-
message.
|
|
442
|
+
message.taskRunExternalId = reader.string();
|
|
441
443
|
continue;
|
|
442
444
|
}
|
|
443
445
|
case 2: {
|
|
@@ -478,7 +480,9 @@ exports.PutStreamEventRequest = {
|
|
|
478
480
|
},
|
|
479
481
|
fromJSON(object) {
|
|
480
482
|
return {
|
|
481
|
-
|
|
483
|
+
taskRunExternalId: isSet(object.taskRunExternalId)
|
|
484
|
+
? globalThis.String(object.taskRunExternalId)
|
|
485
|
+
: '',
|
|
482
486
|
createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined,
|
|
483
487
|
message: isSet(object.message) ? bytesFromBase64(object.message) : new Uint8Array(0),
|
|
484
488
|
metadata: isSet(object.metadata) ? globalThis.String(object.metadata) : '',
|
|
@@ -487,8 +491,8 @@ exports.PutStreamEventRequest = {
|
|
|
487
491
|
},
|
|
488
492
|
toJSON(message) {
|
|
489
493
|
const obj = {};
|
|
490
|
-
if (message.
|
|
491
|
-
obj.
|
|
494
|
+
if (message.taskRunExternalId !== '') {
|
|
495
|
+
obj.taskRunExternalId = message.taskRunExternalId;
|
|
492
496
|
}
|
|
493
497
|
if (message.createdAt !== undefined) {
|
|
494
498
|
obj.createdAt = message.createdAt.toISOString();
|
|
@@ -510,7 +514,7 @@ exports.PutStreamEventRequest = {
|
|
|
510
514
|
fromPartial(object) {
|
|
511
515
|
var _a, _b, _c, _d, _e;
|
|
512
516
|
const message = createBasePutStreamEventRequest();
|
|
513
|
-
message.
|
|
517
|
+
message.taskRunExternalId = (_a = object.taskRunExternalId) !== null && _a !== void 0 ? _a : '';
|
|
514
518
|
message.createdAt = (_b = object.createdAt) !== null && _b !== void 0 ? _b : undefined;
|
|
515
519
|
message.message = (_c = object.message) !== null && _c !== void 0 ? _c : new Uint8Array(0);
|
|
516
520
|
message.metadata = (_d = object.metadata) !== null && _d !== void 0 ? _d : '';
|
package/protoc/v1/workflows.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ export interface CreateWorkflowVersionRequest {
|
|
|
106
106
|
cronInput?: string | undefined;
|
|
107
107
|
/** (optional) the job to run on failure */
|
|
108
108
|
onFailureTask?: CreateTaskOpts | undefined;
|
|
109
|
-
/** (optional) the sticky strategy for assigning
|
|
109
|
+
/** (optional) the sticky strategy for assigning tasks to workers */
|
|
110
110
|
sticky?: StickyStrategy | undefined;
|
|
111
111
|
/** (optional) the default priority for the workflow */
|
|
112
112
|
defaultPriority?: number | undefined;
|
|
@@ -167,17 +167,17 @@ export interface CreateTaskOpts {
|
|
|
167
167
|
inputs: string;
|
|
168
168
|
/** (optional) the task parents. if none are passed in, this is a root task */
|
|
169
169
|
parents: string[];
|
|
170
|
-
/** (optional) the number of retries for the
|
|
170
|
+
/** (optional) the number of retries for the task, default 0 */
|
|
171
171
|
retries: number;
|
|
172
|
-
/** (optional) the rate limits for the
|
|
172
|
+
/** (optional) the rate limits for the task */
|
|
173
173
|
rateLimits: CreateTaskRateLimit[];
|
|
174
|
-
/** (optional) the desired worker affinity state for the
|
|
174
|
+
/** (optional) the desired worker affinity state for the task */
|
|
175
175
|
workerLabels: {
|
|
176
176
|
[key: string]: DesiredWorkerLabels;
|
|
177
177
|
};
|
|
178
|
-
/** (optional) the retry backoff factor for the
|
|
178
|
+
/** (optional) the retry backoff factor for the task */
|
|
179
179
|
backoffFactor?: number | undefined;
|
|
180
|
-
/** (optional) the maximum backoff time for the
|
|
180
|
+
/** (optional) the maximum backoff time for the task */
|
|
181
181
|
backoffMaxSeconds?: number | undefined;
|
|
182
182
|
/** (optional) the task concurrency options */
|
|
183
183
|
concurrency: Concurrency[];
|
|
@@ -185,15 +185,25 @@ export interface CreateTaskOpts {
|
|
|
185
185
|
conditions?: TaskConditions | undefined;
|
|
186
186
|
/** (optional) the timeout for the schedule */
|
|
187
187
|
scheduleTimeout?: string | undefined;
|
|
188
|
+
/** (optional) whether the task is durable */
|
|
189
|
+
isDurable: boolean;
|
|
190
|
+
/** (optional) slot requests (slot_type -> units) */
|
|
191
|
+
slotRequests: {
|
|
192
|
+
[key: string]: number;
|
|
193
|
+
};
|
|
188
194
|
}
|
|
189
195
|
export interface CreateTaskOpts_WorkerLabelsEntry {
|
|
190
196
|
key: string;
|
|
191
197
|
value: DesiredWorkerLabels | undefined;
|
|
192
198
|
}
|
|
199
|
+
export interface CreateTaskOpts_SlotRequestsEntry {
|
|
200
|
+
key: string;
|
|
201
|
+
value: number;
|
|
202
|
+
}
|
|
193
203
|
export interface CreateTaskRateLimit {
|
|
194
204
|
/** (required) the key for the rate limit */
|
|
195
205
|
key: string;
|
|
196
|
-
/** (optional) the number of units this
|
|
206
|
+
/** (optional) the number of units this task consumes */
|
|
197
207
|
units?: number | undefined;
|
|
198
208
|
/** (optional) a CEL expression for determining the rate limit key */
|
|
199
209
|
keyExpr?: string | undefined;
|
|
@@ -256,6 +266,7 @@ export declare const Concurrency: MessageFns<Concurrency>;
|
|
|
256
266
|
export declare const DesiredWorkerLabels: MessageFns<DesiredWorkerLabels>;
|
|
257
267
|
export declare const CreateTaskOpts: MessageFns<CreateTaskOpts>;
|
|
258
268
|
export declare const CreateTaskOpts_WorkerLabelsEntry: MessageFns<CreateTaskOpts_WorkerLabelsEntry>;
|
|
269
|
+
export declare const CreateTaskOpts_SlotRequestsEntry: MessageFns<CreateTaskOpts_SlotRequestsEntry>;
|
|
259
270
|
export declare const CreateTaskRateLimit: MessageFns<CreateTaskRateLimit>;
|
|
260
271
|
export declare const CreateWorkflowVersionResponse: MessageFns<CreateWorkflowVersionResponse>;
|
|
261
272
|
export declare const GetRunDetailsRequest: MessageFns<GetRunDetailsRequest>;
|
package/protoc/v1/workflows.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: v1/workflows.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.AdminServiceDefinition = exports.GetRunDetailsResponse_TaskRunsEntry = exports.GetRunDetailsResponse = exports.TaskRunDetail = exports.GetRunDetailsRequest = exports.CreateWorkflowVersionResponse = exports.CreateTaskRateLimit = exports.CreateTaskOpts_WorkerLabelsEntry = exports.CreateTaskOpts = exports.DesiredWorkerLabels = exports.Concurrency = exports.DefaultFilter = exports.CreateWorkflowVersionRequest = exports.TriggerWorkflowRunResponse = exports.TriggerWorkflowRunRequest = exports.ReplayTasksResponse = exports.CancelTasksResponse = exports.TasksFilter = exports.ReplayTasksRequest = exports.CancelTasksRequest = exports.WorkerLabelComparator = exports.ConcurrencyLimitStrategy = exports.RunStatus = exports.RateLimitDuration = exports.StickyStrategy = exports.protobufPackage = void 0;
|
|
8
|
+
exports.AdminServiceDefinition = exports.GetRunDetailsResponse_TaskRunsEntry = exports.GetRunDetailsResponse = exports.TaskRunDetail = exports.GetRunDetailsRequest = exports.CreateWorkflowVersionResponse = exports.CreateTaskRateLimit = exports.CreateTaskOpts_SlotRequestsEntry = exports.CreateTaskOpts_WorkerLabelsEntry = exports.CreateTaskOpts = exports.DesiredWorkerLabels = exports.Concurrency = exports.DefaultFilter = exports.CreateWorkflowVersionRequest = exports.TriggerWorkflowRunResponse = exports.TriggerWorkflowRunRequest = exports.ReplayTasksResponse = exports.CancelTasksResponse = exports.TasksFilter = exports.ReplayTasksRequest = exports.CancelTasksRequest = exports.WorkerLabelComparator = exports.ConcurrencyLimitStrategy = exports.RunStatus = exports.RateLimitDuration = exports.StickyStrategy = exports.protobufPackage = void 0;
|
|
9
9
|
exports.stickyStrategyFromJSON = stickyStrategyFromJSON;
|
|
10
10
|
exports.stickyStrategyToJSON = stickyStrategyToJSON;
|
|
11
11
|
exports.rateLimitDurationFromJSON = rateLimitDurationFromJSON;
|
|
@@ -1411,6 +1411,8 @@ function createBaseCreateTaskOpts() {
|
|
|
1411
1411
|
concurrency: [],
|
|
1412
1412
|
conditions: undefined,
|
|
1413
1413
|
scheduleTimeout: undefined,
|
|
1414
|
+
isDurable: false,
|
|
1415
|
+
slotRequests: {},
|
|
1414
1416
|
};
|
|
1415
1417
|
}
|
|
1416
1418
|
exports.CreateTaskOpts = {
|
|
@@ -1454,6 +1456,12 @@ exports.CreateTaskOpts = {
|
|
|
1454
1456
|
if (message.scheduleTimeout !== undefined) {
|
|
1455
1457
|
writer.uint32(106).string(message.scheduleTimeout);
|
|
1456
1458
|
}
|
|
1459
|
+
if (message.isDurable !== false) {
|
|
1460
|
+
writer.uint32(112).bool(message.isDurable);
|
|
1461
|
+
}
|
|
1462
|
+
Object.entries(message.slotRequests).forEach(([key, value]) => {
|
|
1463
|
+
exports.CreateTaskOpts_SlotRequestsEntry.encode({ key: key, value }, writer.uint32(122).fork()).join();
|
|
1464
|
+
});
|
|
1457
1465
|
return writer;
|
|
1458
1466
|
},
|
|
1459
1467
|
decode(input, length) {
|
|
@@ -1557,6 +1565,23 @@ exports.CreateTaskOpts = {
|
|
|
1557
1565
|
message.scheduleTimeout = reader.string();
|
|
1558
1566
|
continue;
|
|
1559
1567
|
}
|
|
1568
|
+
case 14: {
|
|
1569
|
+
if (tag !== 112) {
|
|
1570
|
+
break;
|
|
1571
|
+
}
|
|
1572
|
+
message.isDurable = reader.bool();
|
|
1573
|
+
continue;
|
|
1574
|
+
}
|
|
1575
|
+
case 15: {
|
|
1576
|
+
if (tag !== 122) {
|
|
1577
|
+
break;
|
|
1578
|
+
}
|
|
1579
|
+
const entry15 = exports.CreateTaskOpts_SlotRequestsEntry.decode(reader, reader.uint32());
|
|
1580
|
+
if (entry15.value !== undefined) {
|
|
1581
|
+
message.slotRequests[entry15.key] = entry15.value;
|
|
1582
|
+
}
|
|
1583
|
+
continue;
|
|
1584
|
+
}
|
|
1560
1585
|
}
|
|
1561
1586
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1562
1587
|
break;
|
|
@@ -1597,6 +1622,13 @@ exports.CreateTaskOpts = {
|
|
|
1597
1622
|
scheduleTimeout: isSet(object.scheduleTimeout)
|
|
1598
1623
|
? globalThis.String(object.scheduleTimeout)
|
|
1599
1624
|
: undefined,
|
|
1625
|
+
isDurable: isSet(object.isDurable) ? globalThis.Boolean(object.isDurable) : false,
|
|
1626
|
+
slotRequests: isObject(object.slotRequests)
|
|
1627
|
+
? Object.entries(object.slotRequests).reduce((acc, [key, value]) => {
|
|
1628
|
+
acc[key] = Number(value);
|
|
1629
|
+
return acc;
|
|
1630
|
+
}, {})
|
|
1631
|
+
: {},
|
|
1600
1632
|
};
|
|
1601
1633
|
},
|
|
1602
1634
|
toJSON(message) {
|
|
@@ -1647,13 +1679,25 @@ exports.CreateTaskOpts = {
|
|
|
1647
1679
|
if (message.scheduleTimeout !== undefined) {
|
|
1648
1680
|
obj.scheduleTimeout = message.scheduleTimeout;
|
|
1649
1681
|
}
|
|
1682
|
+
if (message.isDurable !== false) {
|
|
1683
|
+
obj.isDurable = message.isDurable;
|
|
1684
|
+
}
|
|
1685
|
+
if (message.slotRequests) {
|
|
1686
|
+
const entries = Object.entries(message.slotRequests);
|
|
1687
|
+
if (entries.length > 0) {
|
|
1688
|
+
obj.slotRequests = {};
|
|
1689
|
+
entries.forEach(([k, v]) => {
|
|
1690
|
+
obj.slotRequests[k] = Math.round(v);
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1650
1694
|
return obj;
|
|
1651
1695
|
},
|
|
1652
1696
|
create(base) {
|
|
1653
1697
|
return exports.CreateTaskOpts.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1654
1698
|
},
|
|
1655
1699
|
fromPartial(object) {
|
|
1656
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1700
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1657
1701
|
const message = createBaseCreateTaskOpts();
|
|
1658
1702
|
message.readableId = (_a = object.readableId) !== null && _a !== void 0 ? _a : '';
|
|
1659
1703
|
message.action = (_b = object.action) !== null && _b !== void 0 ? _b : '';
|
|
@@ -1676,6 +1720,13 @@ exports.CreateTaskOpts = {
|
|
|
1676
1720
|
? condition_1.TaskConditions.fromPartial(object.conditions)
|
|
1677
1721
|
: undefined;
|
|
1678
1722
|
message.scheduleTimeout = (_m = object.scheduleTimeout) !== null && _m !== void 0 ? _m : undefined;
|
|
1723
|
+
message.isDurable = (_o = object.isDurable) !== null && _o !== void 0 ? _o : false;
|
|
1724
|
+
message.slotRequests = Object.entries((_p = object.slotRequests) !== null && _p !== void 0 ? _p : {}).reduce((acc, [key, value]) => {
|
|
1725
|
+
if (value !== undefined) {
|
|
1726
|
+
acc[key] = globalThis.Number(value);
|
|
1727
|
+
}
|
|
1728
|
+
return acc;
|
|
1729
|
+
}, {});
|
|
1679
1730
|
return message;
|
|
1680
1731
|
},
|
|
1681
1732
|
};
|
|
@@ -1751,6 +1802,75 @@ exports.CreateTaskOpts_WorkerLabelsEntry = {
|
|
|
1751
1802
|
return message;
|
|
1752
1803
|
},
|
|
1753
1804
|
};
|
|
1805
|
+
function createBaseCreateTaskOpts_SlotRequestsEntry() {
|
|
1806
|
+
return { key: '', value: 0 };
|
|
1807
|
+
}
|
|
1808
|
+
exports.CreateTaskOpts_SlotRequestsEntry = {
|
|
1809
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1810
|
+
if (message.key !== '') {
|
|
1811
|
+
writer.uint32(10).string(message.key);
|
|
1812
|
+
}
|
|
1813
|
+
if (message.value !== 0) {
|
|
1814
|
+
writer.uint32(16).int32(message.value);
|
|
1815
|
+
}
|
|
1816
|
+
return writer;
|
|
1817
|
+
},
|
|
1818
|
+
decode(input, length) {
|
|
1819
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1820
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1821
|
+
const message = createBaseCreateTaskOpts_SlotRequestsEntry();
|
|
1822
|
+
while (reader.pos < end) {
|
|
1823
|
+
const tag = reader.uint32();
|
|
1824
|
+
switch (tag >>> 3) {
|
|
1825
|
+
case 1: {
|
|
1826
|
+
if (tag !== 10) {
|
|
1827
|
+
break;
|
|
1828
|
+
}
|
|
1829
|
+
message.key = reader.string();
|
|
1830
|
+
continue;
|
|
1831
|
+
}
|
|
1832
|
+
case 2: {
|
|
1833
|
+
if (tag !== 16) {
|
|
1834
|
+
break;
|
|
1835
|
+
}
|
|
1836
|
+
message.value = reader.int32();
|
|
1837
|
+
continue;
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1841
|
+
break;
|
|
1842
|
+
}
|
|
1843
|
+
reader.skip(tag & 7);
|
|
1844
|
+
}
|
|
1845
|
+
return message;
|
|
1846
|
+
},
|
|
1847
|
+
fromJSON(object) {
|
|
1848
|
+
return {
|
|
1849
|
+
key: isSet(object.key) ? globalThis.String(object.key) : '',
|
|
1850
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
|
1851
|
+
};
|
|
1852
|
+
},
|
|
1853
|
+
toJSON(message) {
|
|
1854
|
+
const obj = {};
|
|
1855
|
+
if (message.key !== '') {
|
|
1856
|
+
obj.key = message.key;
|
|
1857
|
+
}
|
|
1858
|
+
if (message.value !== 0) {
|
|
1859
|
+
obj.value = Math.round(message.value);
|
|
1860
|
+
}
|
|
1861
|
+
return obj;
|
|
1862
|
+
},
|
|
1863
|
+
create(base) {
|
|
1864
|
+
return exports.CreateTaskOpts_SlotRequestsEntry.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1865
|
+
},
|
|
1866
|
+
fromPartial(object) {
|
|
1867
|
+
var _a, _b;
|
|
1868
|
+
const message = createBaseCreateTaskOpts_SlotRequestsEntry();
|
|
1869
|
+
message.key = (_a = object.key) !== null && _a !== void 0 ? _a : '';
|
|
1870
|
+
message.value = (_b = object.value) !== null && _b !== void 0 ? _b : 0;
|
|
1871
|
+
return message;
|
|
1872
|
+
},
|
|
1873
|
+
};
|
|
1754
1874
|
function createBaseCreateTaskRateLimit() {
|
|
1755
1875
|
return {
|
|
1756
1876
|
key: '',
|
|
@@ -78,7 +78,7 @@ export interface CreateWorkflowVersionOpts {
|
|
|
78
78
|
cronInput?: string | undefined;
|
|
79
79
|
/** (optional) the job to run on failure */
|
|
80
80
|
onFailureJob?: CreateWorkflowJobOpts | undefined;
|
|
81
|
-
/** (optional) the sticky strategy for assigning
|
|
81
|
+
/** (optional) the sticky strategy for assigning tasks to workers */
|
|
82
82
|
sticky?: StickyStrategy | undefined;
|
|
83
83
|
/** (optional) the kind of workflow */
|
|
84
84
|
kind?: WorkflowKind | undefined;
|
|
@@ -101,7 +101,7 @@ export interface CreateWorkflowJobOpts {
|
|
|
101
101
|
name: string;
|
|
102
102
|
/** (optional) the job description */
|
|
103
103
|
description: string;
|
|
104
|
-
/** (required) the job
|
|
104
|
+
/** (required) the job tasks */
|
|
105
105
|
steps: CreateWorkflowStepOpts[];
|
|
106
106
|
}
|
|
107
107
|
export interface DesiredWorkerLabels {
|
|
@@ -126,31 +126,31 @@ export interface DesiredWorkerLabels {
|
|
|
126
126
|
*/
|
|
127
127
|
weight?: number | undefined;
|
|
128
128
|
}
|
|
129
|
-
/** CreateWorkflowStepOpts represents options to create a workflow
|
|
129
|
+
/** CreateWorkflowStepOpts represents options to create a workflow task. */
|
|
130
130
|
export interface CreateWorkflowStepOpts {
|
|
131
|
-
/** (required) the
|
|
131
|
+
/** (required) the task name */
|
|
132
132
|
readableId: string;
|
|
133
|
-
/** (required) the
|
|
133
|
+
/** (required) the task action id */
|
|
134
134
|
action: string;
|
|
135
|
-
/** (optional) the
|
|
135
|
+
/** (optional) the task timeout */
|
|
136
136
|
timeout: string;
|
|
137
|
-
/** (optional) the
|
|
137
|
+
/** (optional) the task inputs, assuming string representation of JSON */
|
|
138
138
|
inputs: string;
|
|
139
|
-
/** (optional) the
|
|
139
|
+
/** (optional) the task parents. if none are passed in, this is a root task */
|
|
140
140
|
parents: string[];
|
|
141
|
-
/** (optional) the custom
|
|
141
|
+
/** (optional) the custom task user data, assuming string representation of JSON */
|
|
142
142
|
userData: string;
|
|
143
|
-
/** (optional) the number of retries for the
|
|
143
|
+
/** (optional) the number of retries for the task, default 0 */
|
|
144
144
|
retries: number;
|
|
145
|
-
/** (optional) the rate limits for the
|
|
145
|
+
/** (optional) the rate limits for the task */
|
|
146
146
|
rateLimits: CreateStepRateLimit[];
|
|
147
|
-
/** (optional) the desired worker affinity state for the
|
|
147
|
+
/** (optional) the desired worker affinity state for the task */
|
|
148
148
|
workerLabels: {
|
|
149
149
|
[key: string]: DesiredWorkerLabels;
|
|
150
150
|
};
|
|
151
|
-
/** (optional) the retry backoff factor for the
|
|
151
|
+
/** (optional) the retry backoff factor for the task */
|
|
152
152
|
backoffFactor?: number | undefined;
|
|
153
|
-
/** (optional) the maximum backoff time for the
|
|
153
|
+
/** (optional) the maximum backoff time for the task */
|
|
154
154
|
backoffMaxSeconds?: number | undefined;
|
|
155
155
|
}
|
|
156
156
|
export interface CreateWorkflowStepOpts_WorkerLabelsEntry {
|
|
@@ -160,7 +160,7 @@ export interface CreateWorkflowStepOpts_WorkerLabelsEntry {
|
|
|
160
160
|
export interface CreateStepRateLimit {
|
|
161
161
|
/** (required) the key for the rate limit */
|
|
162
162
|
key: string;
|
|
163
|
-
/** (optional) the number of units this
|
|
163
|
+
/** (optional) the number of units this task consumes */
|
|
164
164
|
units?: number | undefined;
|
|
165
165
|
/** (optional) a CEL expression for determining the rate limit key */
|
|
166
166
|
keyExpr?: string | undefined;
|
|
@@ -181,8 +181,8 @@ export interface ScheduleWorkflowRequest {
|
|
|
181
181
|
input: string;
|
|
182
182
|
/** (optional) the parent workflow run id */
|
|
183
183
|
parentId?: string | undefined;
|
|
184
|
-
/** (optional) the parent
|
|
185
|
-
|
|
184
|
+
/** (optional) the parent task external run id */
|
|
185
|
+
parentTaskRunExternalId?: string | undefined;
|
|
186
186
|
/**
|
|
187
187
|
* (optional) the index of the child workflow. if this is set, matches on the index or the
|
|
188
188
|
* child key will be a no-op, even if the schedule has changed.
|
|
@@ -235,17 +235,17 @@ export interface TriggerWorkflowRequest {
|
|
|
235
235
|
input: string;
|
|
236
236
|
/** (optional) the parent workflow run id */
|
|
237
237
|
parentId?: string | undefined;
|
|
238
|
-
/** (optional) the parent
|
|
239
|
-
|
|
238
|
+
/** (optional) the parent task external run id */
|
|
239
|
+
parentTaskRunExternalId?: string | undefined;
|
|
240
240
|
/**
|
|
241
241
|
* (optional) the index of the child workflow. if this is set, matches on the index or the
|
|
242
|
-
* child key will return an existing workflow run if the parent id, parent
|
|
242
|
+
* child key will return an existing workflow run if the parent id, parent task run id, and
|
|
243
243
|
* child index/key match an existing workflow run.
|
|
244
244
|
*/
|
|
245
245
|
childIndex?: number | undefined;
|
|
246
246
|
/**
|
|
247
247
|
* (optional) the key for the child. if this is set, matches on the index or the
|
|
248
|
-
* child key will return an existing workflow run if the parent id, parent
|
|
248
|
+
* child key will return an existing workflow run if the parent id, parent task run id, and
|
|
249
249
|
* child index/key match an existing workflow run.
|
|
250
250
|
*/
|
|
251
251
|
childKey?: string | undefined;
|
|
@@ -256,7 +256,7 @@ export interface TriggerWorkflowRequest {
|
|
|
256
256
|
* requires the workflow definition to have a sticky strategy
|
|
257
257
|
*/
|
|
258
258
|
desiredWorkerId?: string | undefined;
|
|
259
|
-
/** (optional) override for the priority of the workflow
|
|
259
|
+
/** (optional) override for the priority of the workflow tasks, will set all tasks to this priority */
|
|
260
260
|
priority?: number | undefined;
|
|
261
261
|
}
|
|
262
262
|
export interface TriggerWorkflowResponse {
|
|
@@ -1405,7 +1405,7 @@ function createBaseScheduleWorkflowRequest() {
|
|
|
1405
1405
|
schedules: [],
|
|
1406
1406
|
input: '',
|
|
1407
1407
|
parentId: undefined,
|
|
1408
|
-
|
|
1408
|
+
parentTaskRunExternalId: undefined,
|
|
1409
1409
|
childIndex: undefined,
|
|
1410
1410
|
childKey: undefined,
|
|
1411
1411
|
additionalMetadata: undefined,
|
|
@@ -1426,8 +1426,8 @@ exports.ScheduleWorkflowRequest = {
|
|
|
1426
1426
|
if (message.parentId !== undefined) {
|
|
1427
1427
|
writer.uint32(34).string(message.parentId);
|
|
1428
1428
|
}
|
|
1429
|
-
if (message.
|
|
1430
|
-
writer.uint32(42).string(message.
|
|
1429
|
+
if (message.parentTaskRunExternalId !== undefined) {
|
|
1430
|
+
writer.uint32(42).string(message.parentTaskRunExternalId);
|
|
1431
1431
|
}
|
|
1432
1432
|
if (message.childIndex !== undefined) {
|
|
1433
1433
|
writer.uint32(48).int32(message.childIndex);
|
|
@@ -1482,7 +1482,7 @@ exports.ScheduleWorkflowRequest = {
|
|
|
1482
1482
|
if (tag !== 42) {
|
|
1483
1483
|
break;
|
|
1484
1484
|
}
|
|
1485
|
-
message.
|
|
1485
|
+
message.parentTaskRunExternalId = reader.string();
|
|
1486
1486
|
continue;
|
|
1487
1487
|
}
|
|
1488
1488
|
case 6: {
|
|
@@ -1529,8 +1529,8 @@ exports.ScheduleWorkflowRequest = {
|
|
|
1529
1529
|
: [],
|
|
1530
1530
|
input: isSet(object.input) ? globalThis.String(object.input) : '',
|
|
1531
1531
|
parentId: isSet(object.parentId) ? globalThis.String(object.parentId) : undefined,
|
|
1532
|
-
|
|
1533
|
-
? globalThis.String(object.
|
|
1532
|
+
parentTaskRunExternalId: isSet(object.parentTaskRunExternalId)
|
|
1533
|
+
? globalThis.String(object.parentTaskRunExternalId)
|
|
1534
1534
|
: undefined,
|
|
1535
1535
|
childIndex: isSet(object.childIndex) ? globalThis.Number(object.childIndex) : undefined,
|
|
1536
1536
|
childKey: isSet(object.childKey) ? globalThis.String(object.childKey) : undefined,
|
|
@@ -1555,8 +1555,8 @@ exports.ScheduleWorkflowRequest = {
|
|
|
1555
1555
|
if (message.parentId !== undefined) {
|
|
1556
1556
|
obj.parentId = message.parentId;
|
|
1557
1557
|
}
|
|
1558
|
-
if (message.
|
|
1559
|
-
obj.
|
|
1558
|
+
if (message.parentTaskRunExternalId !== undefined) {
|
|
1559
|
+
obj.parentTaskRunExternalId = message.parentTaskRunExternalId;
|
|
1560
1560
|
}
|
|
1561
1561
|
if (message.childIndex !== undefined) {
|
|
1562
1562
|
obj.childIndex = Math.round(message.childIndex);
|
|
@@ -1582,7 +1582,7 @@ exports.ScheduleWorkflowRequest = {
|
|
|
1582
1582
|
message.schedules = ((_b = object.schedules) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
|
|
1583
1583
|
message.input = (_c = object.input) !== null && _c !== void 0 ? _c : '';
|
|
1584
1584
|
message.parentId = (_d = object.parentId) !== null && _d !== void 0 ? _d : undefined;
|
|
1585
|
-
message.
|
|
1585
|
+
message.parentTaskRunExternalId = (_e = object.parentTaskRunExternalId) !== null && _e !== void 0 ? _e : undefined;
|
|
1586
1586
|
message.childIndex = (_f = object.childIndex) !== null && _f !== void 0 ? _f : undefined;
|
|
1587
1587
|
message.childKey = (_g = object.childKey) !== null && _g !== void 0 ? _g : undefined;
|
|
1588
1588
|
message.additionalMetadata = (_h = object.additionalMetadata) !== null && _h !== void 0 ? _h : undefined;
|
|
@@ -2072,7 +2072,7 @@ function createBaseTriggerWorkflowRequest() {
|
|
|
2072
2072
|
name: '',
|
|
2073
2073
|
input: '',
|
|
2074
2074
|
parentId: undefined,
|
|
2075
|
-
|
|
2075
|
+
parentTaskRunExternalId: undefined,
|
|
2076
2076
|
childIndex: undefined,
|
|
2077
2077
|
childKey: undefined,
|
|
2078
2078
|
additionalMetadata: undefined,
|
|
@@ -2091,8 +2091,8 @@ exports.TriggerWorkflowRequest = {
|
|
|
2091
2091
|
if (message.parentId !== undefined) {
|
|
2092
2092
|
writer.uint32(26).string(message.parentId);
|
|
2093
2093
|
}
|
|
2094
|
-
if (message.
|
|
2095
|
-
writer.uint32(34).string(message.
|
|
2094
|
+
if (message.parentTaskRunExternalId !== undefined) {
|
|
2095
|
+
writer.uint32(34).string(message.parentTaskRunExternalId);
|
|
2096
2096
|
}
|
|
2097
2097
|
if (message.childIndex !== undefined) {
|
|
2098
2098
|
writer.uint32(40).int32(message.childIndex);
|
|
@@ -2143,7 +2143,7 @@ exports.TriggerWorkflowRequest = {
|
|
|
2143
2143
|
if (tag !== 34) {
|
|
2144
2144
|
break;
|
|
2145
2145
|
}
|
|
2146
|
-
message.
|
|
2146
|
+
message.parentTaskRunExternalId = reader.string();
|
|
2147
2147
|
continue;
|
|
2148
2148
|
}
|
|
2149
2149
|
case 5: {
|
|
@@ -2194,8 +2194,8 @@ exports.TriggerWorkflowRequest = {
|
|
|
2194
2194
|
name: isSet(object.name) ? globalThis.String(object.name) : '',
|
|
2195
2195
|
input: isSet(object.input) ? globalThis.String(object.input) : '',
|
|
2196
2196
|
parentId: isSet(object.parentId) ? globalThis.String(object.parentId) : undefined,
|
|
2197
|
-
|
|
2198
|
-
? globalThis.String(object.
|
|
2197
|
+
parentTaskRunExternalId: isSet(object.parentTaskRunExternalId)
|
|
2198
|
+
? globalThis.String(object.parentTaskRunExternalId)
|
|
2199
2199
|
: undefined,
|
|
2200
2200
|
childIndex: isSet(object.childIndex) ? globalThis.Number(object.childIndex) : undefined,
|
|
2201
2201
|
childKey: isSet(object.childKey) ? globalThis.String(object.childKey) : undefined,
|
|
@@ -2219,8 +2219,8 @@ exports.TriggerWorkflowRequest = {
|
|
|
2219
2219
|
if (message.parentId !== undefined) {
|
|
2220
2220
|
obj.parentId = message.parentId;
|
|
2221
2221
|
}
|
|
2222
|
-
if (message.
|
|
2223
|
-
obj.
|
|
2222
|
+
if (message.parentTaskRunExternalId !== undefined) {
|
|
2223
|
+
obj.parentTaskRunExternalId = message.parentTaskRunExternalId;
|
|
2224
2224
|
}
|
|
2225
2225
|
if (message.childIndex !== undefined) {
|
|
2226
2226
|
obj.childIndex = Math.round(message.childIndex);
|
|
@@ -2248,7 +2248,7 @@ exports.TriggerWorkflowRequest = {
|
|
|
2248
2248
|
message.name = (_a = object.name) !== null && _a !== void 0 ? _a : '';
|
|
2249
2249
|
message.input = (_b = object.input) !== null && _b !== void 0 ? _b : '';
|
|
2250
2250
|
message.parentId = (_c = object.parentId) !== null && _c !== void 0 ? _c : undefined;
|
|
2251
|
-
message.
|
|
2251
|
+
message.parentTaskRunExternalId = (_d = object.parentTaskRunExternalId) !== null && _d !== void 0 ? _d : undefined;
|
|
2252
2252
|
message.childIndex = (_e = object.childIndex) !== null && _e !== void 0 ? _e : undefined;
|
|
2253
2253
|
message.childKey = (_f = object.childKey) !== null && _f !== void 0 ? _f : undefined;
|
|
2254
2254
|
message.additionalMetadata = (_g = object.additionalMetadata) !== null && _g !== void 0 ? _g : undefined;
|
package/step.d.ts
CHANGED
|
@@ -282,6 +282,12 @@ export declare class V0Context<T, K = {}> {
|
|
|
282
282
|
* Gets the ID of the current task run.
|
|
283
283
|
* @returns The task run ID.
|
|
284
284
|
*/
|
|
285
|
+
taskRunExternalId(): string;
|
|
286
|
+
/**
|
|
287
|
+
* Gets the ID of the current task run.
|
|
288
|
+
* @returns The task run ID.
|
|
289
|
+
* @deprecated use taskRunExternalId() instead
|
|
290
|
+
*/
|
|
285
291
|
taskRunId(): string;
|
|
286
292
|
/**
|
|
287
293
|
* Gets the number of times the current task has been retried.
|