@hatchet-dev/typescript-sdk 1.16.0 → 1.17.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/README.md +14 -2
- package/clients/admin/admin-client.d.ts +2 -2
- package/clients/dispatcher/action-listener.d.ts +3 -6
- package/clients/dispatcher/action-listener.js +12 -17
- package/clients/listeners/durable-listener/durable-listener-client.d.ts +116 -15
- package/clients/listeners/durable-listener/durable-listener-client.js +770 -19
- package/clients/listeners/durable-listener/pooled-durable-listener-client.js +1 -14
- package/clients/listeners/run-listener/pooled-child-listener-client.js +1 -14
- package/clients/rest/generated/Api.d.ts +5 -1
- package/clients/rest/generated/data-contracts.d.ts +16 -2
- package/clients/rest/generated/data-contracts.js +7 -3
- package/legacy/examples/affinity-workers.js +2 -2
- package/legacy/legacy-client.js +1 -1
- package/legacy/step.d.ts +2 -2
- package/legacy/step.js +3 -2
- package/legacy/workflow.d.ts +25 -25
- package/package.json +1 -1
- package/protoc/dispatcher/dispatcher.d.ts +20 -0
- package/protoc/dispatcher/dispatcher.js +535 -100
- package/protoc/events/events.js +54 -14
- package/protoc/google/protobuf/timestamp.js +1 -1
- package/protoc/v1/dispatcher.d.ts +169 -0
- package/protoc/v1/dispatcher.js +2096 -8
- package/protoc/v1/shared/condition.js +37 -11
- package/protoc/v1/shared/trigger.d.ts +89 -0
- package/protoc/v1/shared/trigger.js +524 -0
- package/protoc/v1/workflows.d.ts +34 -34
- package/protoc/v1/workflows.js +452 -254
- package/protoc/workflows/workflows.d.ts +2 -75
- package/protoc/workflows/workflows.js +157 -529
- package/util/abort-error.d.ts +10 -0
- package/util/abort-error.js +15 -0
- package/util/errors/eviction-not-supported-error.d.ts +5 -0
- package/util/errors/eviction-not-supported-error.js +18 -0
- package/util/errors/non-determinism-error.d.ts +7 -0
- package/util/errors/non-determinism-error.js +21 -0
- package/util/errors/task-run-terminated-error.d.ts +6 -0
- package/util/errors/task-run-terminated-error.js +15 -0
- package/util/hatchet-promise/hatchet-promise.d.ts +2 -1
- package/util/hatchet-promise/hatchet-promise.js +10 -1
- package/util/sleep.d.ts +3 -2
- package/util/sleep.js +6 -4
- package/v1/client/admin.d.ts +2 -2
- package/v1/client/client.js +1 -1
- package/v1/client/duration.d.ts +11 -1
- package/v1/client/duration.js +44 -0
- package/v1/client/features/runs.d.ts +16 -3
- package/v1/client/features/runs.js +38 -3
- package/v1/client/worker/context.d.ts +101 -6
- package/v1/client/worker/context.js +247 -21
- package/v1/client/worker/deprecated/index.d.ts +1 -1
- package/v1/client/worker/deprecated/index.js +2 -1
- package/v1/client/worker/deprecated/legacy-worker.d.ts +5 -0
- package/v1/client/worker/deprecated/legacy-worker.js +32 -23
- package/v1/client/worker/deprecated/pre-eviction.d.ts +12 -0
- package/v1/client/worker/deprecated/pre-eviction.js +37 -0
- package/v1/client/worker/engine-version.d.ts +5 -0
- package/v1/client/worker/engine-version.js +14 -0
- package/v1/client/worker/eviction/eviction-cache.d.ts +33 -0
- package/v1/client/worker/eviction/eviction-cache.js +139 -0
- package/v1/client/worker/eviction/eviction-manager.d.ts +42 -0
- package/v1/client/worker/eviction/eviction-manager.js +132 -0
- package/v1/client/worker/eviction/eviction-policy.d.ts +19 -0
- package/v1/client/worker/eviction/eviction-policy.js +8 -0
- package/v1/client/worker/eviction/index.d.ts +3 -0
- package/v1/client/worker/eviction/index.js +11 -0
- package/v1/client/worker/worker-internal.d.ts +23 -4
- package/v1/client/worker/worker-internal.js +177 -138
- package/v1/client/worker/worker.d.ts +1 -0
- package/v1/client/worker/worker.js +34 -1
- package/v1/conditions/sleep-condition.js +2 -1
- package/v1/conditions/transformer.js +2 -1
- package/v1/declaration.d.ts +5 -3
- package/v1/declaration.js +8 -0
- package/v1/examples/__e2e__/harness.d.ts +5 -0
- package/v1/examples/__e2e__/harness.js +13 -0
- package/v1/examples/concurrency_workflow_level/workflow.d.ts +1 -1
- package/v1/examples/concurrency_workflow_level/workflow.js +1 -1
- package/v1/examples/durable/workflow.d.ts +57 -0
- package/v1/examples/durable/workflow.js +162 -7
- package/v1/examples/durable-event/workflow.js +2 -7
- package/v1/examples/durable_event/workflow.d.ts +1 -0
- package/v1/examples/durable_event/workflow.js +4 -9
- package/v1/examples/durable_eviction/capacity-worker.d.ts +1 -0
- package/v1/examples/durable_eviction/capacity-worker.js +31 -0
- package/v1/examples/durable_eviction/worker.d.ts +1 -0
- package/v1/examples/durable_eviction/worker.js +34 -0
- package/v1/examples/durable_eviction/workflow.d.ts +44 -0
- package/v1/examples/durable_eviction/workflow.js +129 -0
- package/v1/examples/e2e-worker.js +42 -19
- package/v1/index.d.ts +5 -0
- package/v1/index.js +10 -0
- package/v1/parent-run-context-vars.d.ts +6 -0
- package/v1/task.d.ts +10 -2
- package/v1/task.js +2 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.nonEvictableSleep = exports.capacityEvictableSleep = exports.CAPACITY_SLEEP_SECONDS = exports.evictableChildBulkSpawn = exports.bulkChildTask = exports.multipleEviction = exports.evictableChildSpawn = exports.evictableWaitForEvent = exports.evictableSleepForGracefulTermination = exports.evictableSleep = exports.childTask = exports.EVENT_KEY = exports.LONG_SLEEP_SECONDS = exports.EVICTION_TTL_SECONDS = void 0;
|
|
16
|
+
const sleep_1 = __importDefault(require("../../../util/sleep"));
|
|
17
|
+
const hatchet_client_1 = require("../hatchet-client");
|
|
18
|
+
exports.EVICTION_TTL_SECONDS = 5;
|
|
19
|
+
exports.LONG_SLEEP_SECONDS = 15;
|
|
20
|
+
exports.EVENT_KEY = 'durable-eviction:event';
|
|
21
|
+
const EVICTION_POLICY = {
|
|
22
|
+
ttl: `${exports.EVICTION_TTL_SECONDS}s`,
|
|
23
|
+
allowCapacityEviction: true,
|
|
24
|
+
priority: 0,
|
|
25
|
+
};
|
|
26
|
+
exports.childTask = hatchet_client_1.hatchet.task({
|
|
27
|
+
name: 'eviction-child-task',
|
|
28
|
+
fn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
yield (0, sleep_1.default)(exports.LONG_SLEEP_SECONDS * 1000);
|
|
30
|
+
return { child_status: 'completed' };
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
exports.evictableSleep = hatchet_client_1.hatchet.durableTask({
|
|
34
|
+
name: 'evictable-sleep',
|
|
35
|
+
executionTimeout: '5m',
|
|
36
|
+
evictionPolicy: EVICTION_POLICY,
|
|
37
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
yield ctx.sleepFor(`${exports.LONG_SLEEP_SECONDS}s`);
|
|
39
|
+
return { status: 'completed' };
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
// NOTE: DO NOT REGISTER ON E2E TEST WORKER
|
|
43
|
+
exports.evictableSleepForGracefulTermination = hatchet_client_1.hatchet.durableTask({
|
|
44
|
+
name: 'evictable-sleep-for-graceful-termination',
|
|
45
|
+
executionTimeout: '5m',
|
|
46
|
+
evictionPolicy: {
|
|
47
|
+
ttl: `30m`,
|
|
48
|
+
allowCapacityEviction: true,
|
|
49
|
+
priority: 0,
|
|
50
|
+
},
|
|
51
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
+
yield ctx.sleepFor(`5m`);
|
|
53
|
+
return { status: 'completed' };
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
exports.evictableWaitForEvent = hatchet_client_1.hatchet.durableTask({
|
|
57
|
+
name: 'evictable-wait-for-event',
|
|
58
|
+
executionTimeout: '5m',
|
|
59
|
+
evictionPolicy: EVICTION_POLICY,
|
|
60
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
+
yield ctx.waitForEvent(exports.EVENT_KEY, 'true');
|
|
62
|
+
return { status: 'completed' };
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
exports.evictableChildSpawn = hatchet_client_1.hatchet.durableTask({
|
|
66
|
+
name: 'evictable-child-spawn',
|
|
67
|
+
executionTimeout: '5m',
|
|
68
|
+
evictionPolicy: EVICTION_POLICY,
|
|
69
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
70
|
+
const childResult = yield exports.childTask.run({});
|
|
71
|
+
return { child: childResult, status: 'completed' };
|
|
72
|
+
}),
|
|
73
|
+
});
|
|
74
|
+
exports.multipleEviction = hatchet_client_1.hatchet.durableTask({
|
|
75
|
+
name: 'multiple-eviction',
|
|
76
|
+
executionTimeout: '5m',
|
|
77
|
+
evictionPolicy: EVICTION_POLICY,
|
|
78
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
79
|
+
yield ctx.sleepFor(`${exports.LONG_SLEEP_SECONDS}s`);
|
|
80
|
+
yield ctx.sleepFor(`${exports.LONG_SLEEP_SECONDS}s`);
|
|
81
|
+
return { status: 'completed' };
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
exports.bulkChildTask = hatchet_client_1.hatchet.task({
|
|
85
|
+
name: 'eviction-bulk-child-task',
|
|
86
|
+
fn: (input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
|
+
yield (0, sleep_1.default)(input.sleepSeconds * 1000);
|
|
88
|
+
return { sleepSeconds: input.sleepSeconds, status: 'completed' };
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
exports.evictableChildBulkSpawn = hatchet_client_1.hatchet.durableTask({
|
|
92
|
+
name: 'evictable-child-bulk-spawn',
|
|
93
|
+
executionTimeout: '5m',
|
|
94
|
+
evictionPolicy: EVICTION_POLICY,
|
|
95
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
96
|
+
const inputs = Array.from({ length: 3 }, (_, i) => ({
|
|
97
|
+
sleepSeconds: (exports.EVICTION_TTL_SECONDS + 5) * (i + 1),
|
|
98
|
+
}));
|
|
99
|
+
const childResults = yield exports.bulkChildTask.run(inputs);
|
|
100
|
+
return { child_results: childResults, status: 'completed' };
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
exports.CAPACITY_SLEEP_SECONDS = 20;
|
|
104
|
+
exports.capacityEvictableSleep = hatchet_client_1.hatchet.durableTask({
|
|
105
|
+
name: 'capacity-evictable-sleep',
|
|
106
|
+
executionTimeout: '5m',
|
|
107
|
+
evictionPolicy: {
|
|
108
|
+
ttl: undefined,
|
|
109
|
+
allowCapacityEviction: true,
|
|
110
|
+
priority: 0,
|
|
111
|
+
},
|
|
112
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
113
|
+
yield ctx.sleepFor(`${exports.CAPACITY_SLEEP_SECONDS}s`);
|
|
114
|
+
return { status: 'completed' };
|
|
115
|
+
}),
|
|
116
|
+
});
|
|
117
|
+
exports.nonEvictableSleep = hatchet_client_1.hatchet.durableTask({
|
|
118
|
+
name: 'non-evictable-sleep',
|
|
119
|
+
executionTimeout: '5m',
|
|
120
|
+
evictionPolicy: {
|
|
121
|
+
ttl: undefined,
|
|
122
|
+
allowCapacityEviction: false,
|
|
123
|
+
priority: 0,
|
|
124
|
+
},
|
|
125
|
+
fn: (_input, ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
+
yield ctx.sleepFor('10s');
|
|
127
|
+
return { status: 'completed' };
|
|
128
|
+
}),
|
|
129
|
+
});
|
|
@@ -26,16 +26,19 @@ const workflow_5 = require("./concurrency_multiple_keys/workflow");
|
|
|
26
26
|
const workflow_6 = require("./concurrency_workflow_level/workflow");
|
|
27
27
|
const workflow_7 = require("./dag/workflow");
|
|
28
28
|
const workflow_8 = require("./durable/workflow");
|
|
29
|
-
const workflow_9 = require("./
|
|
30
|
-
const workflow_10 = require("./
|
|
31
|
-
const workflow_11 = require("./
|
|
32
|
-
const workflow_12 = require("./
|
|
33
|
-
const workflow_13 = require("./
|
|
34
|
-
const workflow_14 = require("./
|
|
29
|
+
const workflow_9 = require("./durable_event/workflow");
|
|
30
|
+
const workflow_10 = require("./durable_eviction/workflow");
|
|
31
|
+
const workflow_11 = require("./durable_sleep/workflow");
|
|
32
|
+
const workflow_12 = require("./logger/workflow");
|
|
33
|
+
const workflow_13 = require("./non_retryable/workflow");
|
|
34
|
+
const workflow_14 = require("./on_failure/workflow");
|
|
35
|
+
const workflow_15 = require("./on_event/workflow");
|
|
36
|
+
const workflow_16 = require("./return_exceptions/workflow");
|
|
37
|
+
const workflow_17 = require("./run_details/workflow");
|
|
35
38
|
const e2e_workflows_1 = require("./simple/e2e-workflows");
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
+
const workflow_18 = require("./streaming/workflow");
|
|
40
|
+
const workflow_19 = require("./timeout/workflow");
|
|
41
|
+
const workflow_20 = require("./webhooks/workflow");
|
|
39
42
|
const workflows = [
|
|
40
43
|
workflow_1.bulkChild,
|
|
41
44
|
workflow_1.bulkParentWorkflow,
|
|
@@ -51,18 +54,38 @@ const workflows = [
|
|
|
51
54
|
workflow_7.dag,
|
|
52
55
|
workflow_8.durableWorkflow,
|
|
53
56
|
workflow_8.waitForSleepTwice,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
workflow_8.spawnChildTask,
|
|
58
|
+
workflow_8.durableWithSpawn,
|
|
59
|
+
workflow_8.durableWithBulkSpawn,
|
|
60
|
+
workflow_8.durableSleepEventSpawn,
|
|
61
|
+
workflow_8.durableWithExplicitSpawn,
|
|
62
|
+
workflow_8.durableNonDeterminism,
|
|
63
|
+
workflow_8.durableReplayReset,
|
|
64
|
+
workflow_8.dagChildWorkflow,
|
|
65
|
+
workflow_8.durableSpawnDag,
|
|
66
|
+
workflow_9.durableEvent,
|
|
67
|
+
workflow_9.durableEventWithFilter,
|
|
68
|
+
workflow_11.durableSleep,
|
|
69
|
+
workflow_10.evictableSleep,
|
|
70
|
+
workflow_10.evictableWaitForEvent,
|
|
71
|
+
workflow_10.evictableChildSpawn,
|
|
72
|
+
workflow_10.multipleEviction,
|
|
73
|
+
workflow_10.nonEvictableSleep,
|
|
74
|
+
workflow_10.childTask,
|
|
75
|
+
workflow_10.bulkChildTask,
|
|
76
|
+
workflow_10.evictableChildBulkSpawn,
|
|
77
|
+
(0, workflow_12.createLoggingWorkflow)(hatchet_client_1.hatchet),
|
|
78
|
+
workflow_13.nonRetryableWorkflow,
|
|
79
|
+
workflow_14.failureWorkflow,
|
|
80
|
+
workflow_15.lower,
|
|
81
|
+
workflow_16.returnExceptionsTask,
|
|
82
|
+
workflow_17.runDetailTestWorkflow,
|
|
60
83
|
e2e_workflows_1.helloWorld,
|
|
61
84
|
e2e_workflows_1.helloWorldDurable,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
85
|
+
workflow_18.streamingTask,
|
|
86
|
+
workflow_19.timeoutTask,
|
|
87
|
+
workflow_19.refreshTimeoutTask,
|
|
88
|
+
workflow_20.webhookWorkflow,
|
|
66
89
|
];
|
|
67
90
|
function main() {
|
|
68
91
|
return __awaiter(this, void 0, void 0, function* () {
|
package/v1/index.d.ts
CHANGED
|
@@ -9,3 +9,8 @@ export * from './task';
|
|
|
9
9
|
export * from './client/worker/context';
|
|
10
10
|
export * from './slot-types';
|
|
11
11
|
export * from '../legacy/legacy-transformer';
|
|
12
|
+
export { NonDeterminismError } from '../util/errors/non-determinism-error';
|
|
13
|
+
export { EvictionNotSupportedError } from '../util/errors/eviction-not-supported-error';
|
|
14
|
+
export { EvictionPolicy, DEFAULT_DURABLE_TASK_EVICTION_POLICY, } from './client/worker/eviction/eviction-policy';
|
|
15
|
+
export { DurableEvictionConfig } from './client/worker/eviction/eviction-manager';
|
|
16
|
+
export { MinEngineVersion, supportsEviction } from './client/worker/engine-version';
|
package/v1/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.supportsEviction = exports.MinEngineVersion = exports.DEFAULT_DURABLE_TASK_EVICTION_POLICY = exports.EvictionNotSupportedError = exports.NonDeterminismError = void 0;
|
|
17
18
|
__exportStar(require("./client/client"), exports);
|
|
18
19
|
__exportStar(require("./client/features"), exports);
|
|
19
20
|
__exportStar(require("./client/worker/worker"), exports);
|
|
@@ -25,3 +26,12 @@ __exportStar(require("./task"), exports);
|
|
|
25
26
|
__exportStar(require("./client/worker/context"), exports);
|
|
26
27
|
__exportStar(require("./slot-types"), exports);
|
|
27
28
|
__exportStar(require("../legacy/legacy-transformer"), exports);
|
|
29
|
+
var non_determinism_error_1 = require("../util/errors/non-determinism-error");
|
|
30
|
+
Object.defineProperty(exports, "NonDeterminismError", { enumerable: true, get: function () { return non_determinism_error_1.NonDeterminismError; } });
|
|
31
|
+
var eviction_not_supported_error_1 = require("../util/errors/eviction-not-supported-error");
|
|
32
|
+
Object.defineProperty(exports, "EvictionNotSupportedError", { enumerable: true, get: function () { return eviction_not_supported_error_1.EvictionNotSupportedError; } });
|
|
33
|
+
var eviction_policy_1 = require("./client/worker/eviction/eviction-policy");
|
|
34
|
+
Object.defineProperty(exports, "DEFAULT_DURABLE_TASK_EVICTION_POLICY", { enumerable: true, get: function () { return eviction_policy_1.DEFAULT_DURABLE_TASK_EVICTION_POLICY; } });
|
|
35
|
+
var engine_version_1 = require("./client/worker/engine-version");
|
|
36
|
+
Object.defineProperty(exports, "MinEngineVersion", { enumerable: true, get: function () { return engine_version_1.MinEngineVersion; } });
|
|
37
|
+
Object.defineProperty(exports, "supportsEviction", { enumerable: true, get: function () { return engine_version_1.supportsEviction; } });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DurableContext } from './client/worker/context';
|
|
1
2
|
export interface ParentRunContext {
|
|
2
3
|
parentId: string;
|
|
3
4
|
/**
|
|
@@ -11,6 +12,11 @@ export interface ParentRunContext {
|
|
|
11
12
|
* Used to cancel local "wait for result" subscriptions when the parent task is cancelled.
|
|
12
13
|
*/
|
|
13
14
|
signal?: AbortSignal;
|
|
15
|
+
/**
|
|
16
|
+
* Present when the current task is running in durable mode.
|
|
17
|
+
* Used by child `run()` calls to route through `spawnChild` instead of a fresh trigger.
|
|
18
|
+
*/
|
|
19
|
+
durableContext?: DurableContext<unknown, unknown>;
|
|
14
20
|
}
|
|
15
21
|
export declare class ParentRunContextManager {
|
|
16
22
|
private storage;
|
package/v1/task.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { ConcurrencyLimitStrategy, RateLimitDuration
|
|
1
|
+
import { ConcurrencyLimitStrategy, RateLimitDuration } from '../protoc/v1/workflows';
|
|
2
2
|
import { Conditions } from './conditions';
|
|
3
3
|
import { Duration } from './client/duration';
|
|
4
4
|
import { InputType, OutputType, UnknownInputType } from './types';
|
|
5
5
|
import { Context, DurableContext } from './client/worker/context';
|
|
6
|
+
import { EvictionPolicy } from './client/worker/eviction/eviction-policy';
|
|
7
|
+
import { WorkerLabelComparator } from '../protoc/v1/shared/trigger';
|
|
6
8
|
export { ConcurrencyLimitStrategy, WorkerLabelComparator };
|
|
7
9
|
/**
|
|
8
10
|
* Options for configuring the concurrency for a task.
|
|
@@ -185,7 +187,13 @@ export type CreateWorkflowTaskOpts<I extends InputType = UnknownInputType, O ext
|
|
|
185
187
|
* @template I The input type for the task function.
|
|
186
188
|
* @template O The return type of the task function (can be inferred from the return value of fn).
|
|
187
189
|
*/
|
|
188
|
-
export type CreateWorkflowDurableTaskOpts<I extends InputType = UnknownInputType, O extends OutputType = void, C extends DurableTaskFn<I, O> = DurableTaskFn<I, O>> = CreateWorkflowTaskOpts<I, O, C
|
|
190
|
+
export type CreateWorkflowDurableTaskOpts<I extends InputType = UnknownInputType, O extends OutputType = void, C extends DurableTaskFn<I, O> = DurableTaskFn<I, O>> = CreateWorkflowTaskOpts<I, O, C> & {
|
|
191
|
+
/**
|
|
192
|
+
* Eviction policy for the durable task. Controls TTL-based eviction and capacity-based eviction.
|
|
193
|
+
* Defaults to the built-in eviction policy when omitted or `undefined`.
|
|
194
|
+
*/
|
|
195
|
+
evictionPolicy?: EvictionPolicy;
|
|
196
|
+
};
|
|
189
197
|
/**
|
|
190
198
|
* Options for configuring the onSuccess task that is invoked when a task succeeds.
|
|
191
199
|
* @template I The input type for the task function.
|
package/v1/task.js
CHANGED
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NonRetryableError = exports.WorkerLabelComparator = exports.ConcurrencyLimitStrategy = void 0;
|
|
4
4
|
const workflows_1 = require("../protoc/v1/workflows");
|
|
5
5
|
Object.defineProperty(exports, "ConcurrencyLimitStrategy", { enumerable: true, get: function () { return workflows_1.ConcurrencyLimitStrategy; } });
|
|
6
|
-
|
|
6
|
+
const trigger_1 = require("../protoc/v1/shared/trigger");
|
|
7
|
+
Object.defineProperty(exports, "WorkerLabelComparator", { enumerable: true, get: function () { return trigger_1.WorkerLabelComparator; } });
|
|
7
8
|
class NonRetryableError extends Error {
|
|
8
9
|
constructor(message) {
|
|
9
10
|
super(message);
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.17.1";
|
package/version.js
CHANGED