@hatchet-dev/typescript-sdk 1.33.1 → 1.34.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clients/admin/admin-client.d.ts +6 -1
- package/clients/admin/admin-client.js +13 -4
- package/clients/admin/rpc.d.ts +13 -0
- package/clients/admin/rpc.js +23 -0
- package/clients/event/event-client.d.ts +2 -1
- package/clients/event/event-client.js +6 -3
- package/clients/event/rpc.d.ts +7 -0
- package/clients/event/rpc.js +13 -0
- package/clients/rest/generated/data-contracts.d.ts +2 -0
- package/clients/transport/grpc-target.d.ts +19 -0
- package/clients/transport/grpc-target.js +85 -0
- package/clients/transport/index.d.ts +4 -0
- package/clients/transport/index.js +15 -0
- package/clients/transport/message-bridge.d.ts +32 -0
- package/clients/transport/message-bridge.js +20 -0
- package/clients/transport/node-transport.d.ts +50 -0
- package/clients/transport/node-transport.js +123 -0
- package/clients/transport/transport.d.ts +14 -0
- package/clients/transport/transport.js +24 -0
- package/clients/transport/ts-proto-client.d.ts +41 -0
- package/clients/transport/ts-proto-client.js +143 -0
- package/core/index.d.ts +9 -0
- package/core/index.js +12 -0
- package/dist/check-exports.mjs +171 -0
- package/legacy/legacy-client.d.ts +4 -0
- package/legacy/legacy-client.js +5 -3
- package/legacy/legacy-transformer.d.ts +2 -1
- package/legacy/legacy-transformer.js +11 -0
- package/legacy/workflow.d.ts +1 -1
- package/legacy/workflow.js +1 -1
- package/package.json +95 -2
- package/protoc/dispatcher/dispatcher.d.ts +2 -0
- package/protoc/dispatcher/dispatcher.js +21 -1
- package/protoc-es/dispatcher/dispatcher_pb.d.ts +1357 -0
- package/protoc-es/dispatcher/dispatcher_pb.js +371 -0
- package/protoc-es/events/events_pb.d.ts +294 -0
- package/protoc-es/events/events_pb.js +61 -0
- package/protoc-es/google/rpc/status_pb.d.ts +48 -0
- package/protoc-es/google/rpc/status_pb.js +27 -0
- package/protoc-es/v1/dispatcher_pb.d.ts +676 -0
- package/protoc-es/v1/dispatcher_pb.js +155 -0
- package/protoc-es/v1/shared/condition_pb.d.ts +166 -0
- package/protoc-es/v1/shared/condition_pb.js +68 -0
- package/protoc-es/v1/shared/trigger_pb.d.ts +160 -0
- package/protoc-es/v1/shared/trigger_pb.js +55 -0
- package/protoc-es/v1/workflows_pb.d.ts +995 -0
- package/protoc-es/v1/workflows_pb.js +280 -0
- package/protoc-es/workflows/workflows_pb.d.ts +715 -0
- package/protoc-es/workflows/workflows_pb.js +216 -0
- package/scripts/check-exports.mjs +171 -0
- package/step.js +0 -2
- package/util/grpc-error.d.ts +3 -1
- package/util/grpc-error.js +13 -4
- package/util/v0-deprecation-warning.d.ts +6 -13
- package/util/v0-deprecation-warning.js +6 -13
- package/v1/client/admin.d.ts +2 -1
- package/v1/client/admin.js +34 -114
- package/v1/client/client.d.ts +1 -0
- package/v1/client/client.js +8 -5
- package/v1/client/features/schedules.d.ts +1 -1
- package/v1/examples/concurrency-rr/workflow.js +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/workflow.js +0 -2
package/v1/client/admin.js
CHANGED
|
@@ -28,95 +28,36 @@ const hatchet_error_1 = __importDefault(require("../../util/errors/hatchet-error
|
|
|
28
28
|
const idempotency_collision_error_1 = require("../../util/errors/idempotency-collision-error");
|
|
29
29
|
const bulk_trigger_idempotency_collision_error_1 = require("../../util/errors/bulk-trigger-idempotency-collision-error");
|
|
30
30
|
const workflow_run_ref_1 = __importDefault(require("../../util/workflow-run-ref"));
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const nice_grpc_common_1 = require("nice-grpc-common");
|
|
31
|
+
const connect_1 = require("@connectrpc/connect");
|
|
32
|
+
const workflows_pb_1 = require("../../protoc-es/v1/workflows_pb");
|
|
33
|
+
const nice_grpc_1 = require("nice-grpc");
|
|
35
34
|
const grpc_helpers_1 = require("../../util/grpc-helpers");
|
|
35
|
+
const config_loader_1 = require("../../util/config-loader");
|
|
36
36
|
const child_listener_client_1 = require("../../clients/listeners/run-listener/child-listener-client");
|
|
37
|
-
const
|
|
38
|
-
const
|
|
37
|
+
const workflows_1 = require("../../protoc/workflows");
|
|
38
|
+
const rpc_1 = require("../../clients/admin/rpc");
|
|
39
|
+
const transport_1 = require("../../clients/transport");
|
|
39
40
|
const retrier_1 = require("../../util/retrier");
|
|
40
41
|
const batch_1 = require("../../util/batch");
|
|
41
42
|
const apply_namespace_1 = require("../../util/apply-namespace");
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* The engine answers a trigger whose idempotency key is already taken with `ALREADY_EXISTS`
|
|
45
|
+
* and attaches the collision details to the status. The Connect client decodes those details
|
|
46
|
+
* from the trailer, so the error carries everything needed to build the SDK's collision errors.
|
|
47
|
+
*/
|
|
48
|
+
function isAlreadyExists(e) {
|
|
49
|
+
return e instanceof connect_1.ConnectError && e.code === connect_1.Code.AlreadyExists;
|
|
44
50
|
}
|
|
45
|
-
function
|
|
51
|
+
function extractExistingRunId(e) {
|
|
46
52
|
var _a;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!binData)
|
|
50
|
-
return '';
|
|
51
|
-
const status = status_1.Status.decode(binData instanceof Buffer ? binData : Buffer.from(binData));
|
|
52
|
-
for (const detail of status.details) {
|
|
53
|
-
if (detail.typeUrl.includes('IdempotencyCollisionError')) {
|
|
54
|
-
return (_a = workflows_1.IdempotencyCollisionError.decode(detail.value).existingRunExternalId) !== null && _a !== void 0 ? _a : '';
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
catch (_b) {
|
|
59
|
-
// ignore decoding errors
|
|
60
|
-
}
|
|
61
|
-
return '';
|
|
53
|
+
const [detail] = e.findDetails(workflows_pb_1.IdempotencyCollisionErrorSchema);
|
|
54
|
+
return (_a = detail === null || detail === void 0 ? void 0 : detail.existingRunExternalId) !== null && _a !== void 0 ? _a : '';
|
|
62
55
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
function decodeBulkTriggerCollision(status) {
|
|
67
|
-
for (const detail of status.details) {
|
|
68
|
-
if (detail.typeUrl.includes('BulkTriggerIdempotencyCollisionError')) {
|
|
69
|
-
const proto = workflows_1.BulkTriggerIdempotencyCollisionError.decode(detail.value);
|
|
70
|
-
return new bulk_trigger_idempotency_collision_error_1.BulkTriggerIdempotencyCollisionError(proto.successfulWorkflowRunExternalIds, proto.collisions.map((c) => new idempotency_collision_error_1.IdempotencyCollisionError(c.existingRunExternalId)));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
function extractBulkTriggerCollisionFromGrpcError(e) {
|
|
76
|
-
try {
|
|
77
|
-
const [binData] = e.metadata.get('grpc-status-details-bin');
|
|
78
|
-
if (!binData)
|
|
79
|
-
return null;
|
|
80
|
-
const status = status_1.Status.decode(binData instanceof Buffer ? binData : Buffer.from(binData));
|
|
81
|
-
return decodeBulkTriggerCollision(status);
|
|
82
|
-
}
|
|
83
|
-
catch (_a) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function extractBulkTriggerCollisionFromNiceGrpcMetadata(metadata) {
|
|
88
|
-
if (!metadata)
|
|
89
|
-
return null;
|
|
90
|
-
try {
|
|
91
|
-
const binData = metadata.get('grpc-status-details-bin');
|
|
92
|
-
if (!binData)
|
|
93
|
-
return null;
|
|
94
|
-
const status = status_1.Status.decode(binData);
|
|
95
|
-
return decodeBulkTriggerCollision(status);
|
|
96
|
-
}
|
|
97
|
-
catch (_a) {
|
|
56
|
+
function extractBulkTriggerCollision(e) {
|
|
57
|
+
const [detail] = e.findDetails(workflows_pb_1.BulkTriggerIdempotencyCollisionErrorSchema);
|
|
58
|
+
if (!detail)
|
|
98
59
|
return null;
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
function extractRunIdFromNiceGrpcMetadata(metadata) {
|
|
102
|
-
var _a;
|
|
103
|
-
if (!metadata)
|
|
104
|
-
return '';
|
|
105
|
-
try {
|
|
106
|
-
const binData = metadata.get('grpc-status-details-bin');
|
|
107
|
-
if (!binData)
|
|
108
|
-
return '';
|
|
109
|
-
const status = status_1.Status.decode(binData);
|
|
110
|
-
for (const detail of status.details) {
|
|
111
|
-
if (detail.typeUrl.includes('IdempotencyCollisionError')) {
|
|
112
|
-
return (_a = workflows_1.IdempotencyCollisionError.decode(detail.value).existingRunExternalId) !== null && _a !== void 0 ? _a : '';
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch (_b) {
|
|
117
|
-
// ignore decoding errors
|
|
118
|
-
}
|
|
119
|
-
return '';
|
|
60
|
+
return new bulk_trigger_idempotency_collision_error_1.BulkTriggerIdempotencyCollisionError(detail.successfulWorkflowRunExternalIds, detail.collisions.map((c) => new idempotency_collision_error_1.IdempotencyCollisionError(c.existingRunExternalId)));
|
|
120
61
|
}
|
|
121
62
|
function convertDesiredWorkerLabels(labels) {
|
|
122
63
|
return Object.fromEntries(Object.entries(labels).map(([key, label]) => [
|
|
@@ -131,12 +72,14 @@ function convertDesiredWorkerLabels(labels) {
|
|
|
131
72
|
]));
|
|
132
73
|
}
|
|
133
74
|
class AdminClient {
|
|
134
|
-
constructor(config, api, runs) {
|
|
75
|
+
constructor(config, api, runs, transport = (0, transport_1.createNodeTransport)(config)) {
|
|
135
76
|
this.config = config;
|
|
136
77
|
this.logger = config.logger(`Admin`, config.log_level);
|
|
137
|
-
|
|
138
|
-
this.
|
|
139
|
-
|
|
78
|
+
this.workflowsGrpc = (0, rpc_1.createWorkflowsRpc)(transport);
|
|
79
|
+
this.adminGrpc = (0, rpc_1.createV1AdminRpc)(transport);
|
|
80
|
+
// The run listener streams, which stay on the nice-grpc channel.
|
|
81
|
+
const channel = (0, grpc_helpers_1.channelFactory)(config, config_loader_1.ConfigLoader.createCredentials(config.tls_config));
|
|
82
|
+
const factory = (0, nice_grpc_1.createClientFactory)().use((0, grpc_helpers_1.addTokenMiddleware)(config.token));
|
|
140
83
|
this.listenerClient = new child_listener_client_1.RunListenerClient(config, channel, factory, api);
|
|
141
84
|
this.runs = runs;
|
|
142
85
|
}
|
|
@@ -167,7 +110,6 @@ class AdminClient {
|
|
|
167
110
|
*/
|
|
168
111
|
runWorkflow(workflowName, input, options) {
|
|
169
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
let trailerMetadata;
|
|
171
113
|
try {
|
|
172
114
|
const computedName = (0, apply_namespace_1.applyNamespace)(workflowName, this.config.namespace).toLowerCase();
|
|
173
115
|
const inputStr = JSON.stringify(input);
|
|
@@ -178,24 +120,15 @@ class AdminClient {
|
|
|
178
120
|
parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined, priority: opts.priority, desiredWorkerLabels: desiredWorkerLabels
|
|
179
121
|
? convertDesiredWorkerLabels(desiredWorkerLabels)
|
|
180
122
|
: {} });
|
|
181
|
-
const resp = yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () {
|
|
182
|
-
return this.workflowsGrpc.triggerWorkflow(request, {
|
|
183
|
-
onTrailer: (trailer) => {
|
|
184
|
-
trailerMetadata = trailer;
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
}), this.logger, Object.assign(Object.assign({}, this.config.retrier), { shouldRetry: (e) => !isNiceGrpcAlreadyExists(e) }));
|
|
123
|
+
const resp = yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () { return this.workflowsGrpc.triggerWorkflow(request); }), this.logger, Object.assign(Object.assign({}, this.config.retrier), { shouldRetry: (e) => !isAlreadyExists(e) }));
|
|
188
124
|
const id = resp.workflowRunId;
|
|
189
125
|
const ref = new workflow_run_ref_1.default(id, this.listenerClient, this.runs, options === null || options === void 0 ? void 0 : options.parentId, options === null || options === void 0 ? void 0 : options._standaloneTaskName);
|
|
190
126
|
yield ref.getWorkflowRunId();
|
|
191
127
|
return ref;
|
|
192
128
|
}
|
|
193
129
|
catch (e) {
|
|
194
|
-
if (
|
|
195
|
-
throw new idempotency_collision_error_1.IdempotencyCollisionError(
|
|
196
|
-
}
|
|
197
|
-
if (isNiceGrpcAlreadyExists(e)) {
|
|
198
|
-
throw new idempotency_collision_error_1.IdempotencyCollisionError(extractRunIdFromNiceGrpcMetadata(trailerMetadata));
|
|
130
|
+
if (isAlreadyExists(e)) {
|
|
131
|
+
throw new idempotency_collision_error_1.IdempotencyCollisionError(extractExistingRunId(e));
|
|
199
132
|
}
|
|
200
133
|
throw new hatchet_error_1.default(e instanceof Error ? e.message : String(e));
|
|
201
134
|
}
|
|
@@ -227,23 +160,15 @@ class AdminClient {
|
|
|
227
160
|
});
|
|
228
161
|
const batches = (0, batch_1.batch)(workflowRequests, batchSize, (_a = this.config.grpc_max_send_message_length) !== null && _a !== void 0 ? _a : 4 * 1024 * 1024);
|
|
229
162
|
this.logger.debug(`batching ${batches.length} batches`);
|
|
230
|
-
let bulkTrailerMetadata;
|
|
231
163
|
try {
|
|
232
164
|
const results = [];
|
|
233
165
|
// for loop to ensure serial execution of batches
|
|
234
166
|
for (const { payloads, originalIndices, batchIndex } of batches) {
|
|
235
|
-
const request =
|
|
167
|
+
const request = workflows_1.BulkTriggerWorkflowRequest.create({
|
|
236
168
|
workflows: payloads,
|
|
237
169
|
});
|
|
238
170
|
// Call the bulk trigger workflow method for this batch
|
|
239
|
-
const bulkTriggerWorkflowResponse = yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () {
|
|
240
|
-
return this.workflowsGrpc.bulkTriggerWorkflow(request, {
|
|
241
|
-
onTrailer: (trailer) => {
|
|
242
|
-
bulkTrailerMetadata = trailer;
|
|
243
|
-
},
|
|
244
|
-
});
|
|
245
|
-
}), this.logger, Object.assign(Object.assign({}, this.config.retrier), { shouldRetry: (e) => !isNiceGrpcAlreadyExists(e) &&
|
|
246
|
-
!(isGrpcServiceError(e) && e.code === grpc_js_1.status.ALREADY_EXISTS) }));
|
|
171
|
+
const bulkTriggerWorkflowResponse = yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () { return this.workflowsGrpc.bulkTriggerWorkflow(request); }), this.logger, Object.assign(Object.assign({}, this.config.retrier), { shouldRetry: (e) => !isAlreadyExists(e) }));
|
|
247
172
|
this.logger.debug(`batch ${batchIndex + 1} of ${batches.length}`);
|
|
248
173
|
// Map the results back to their original indices
|
|
249
174
|
const batchResults = bulkTriggerWorkflowResponse.workflowRunIds.map((resp, index) => {
|
|
@@ -256,13 +181,8 @@ class AdminClient {
|
|
|
256
181
|
return results;
|
|
257
182
|
}
|
|
258
183
|
catch (e) {
|
|
259
|
-
if (
|
|
260
|
-
const collision =
|
|
261
|
-
if (collision)
|
|
262
|
-
throw collision;
|
|
263
|
-
}
|
|
264
|
-
if (isNiceGrpcAlreadyExists(e)) {
|
|
265
|
-
const collision = extractBulkTriggerCollisionFromNiceGrpcMetadata(bulkTrailerMetadata);
|
|
184
|
+
if (isAlreadyExists(e)) {
|
|
185
|
+
const collision = extractBulkTriggerCollision(e);
|
|
266
186
|
if (collision)
|
|
267
187
|
throw collision;
|
|
268
188
|
}
|
package/v1/client/client.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
39
39
|
private _axiosConfig;
|
|
40
40
|
private _clientFactory;
|
|
41
41
|
private _credentials;
|
|
42
|
+
private _transport;
|
|
42
43
|
/**
|
|
43
44
|
* @deprecated v0 client will be removed in a future release, please upgrade to v1
|
|
44
45
|
* @hidden
|
package/v1/client/client.js
CHANGED
|
@@ -29,6 +29,7 @@ const dispatcher_client_1 = require("../../clients/dispatcher/dispatcher-client"
|
|
|
29
29
|
const child_listener_client_1 = require("../../clients/listeners/run-listener/child-listener-client");
|
|
30
30
|
const durable_listener_client_1 = require("../../clients/listeners/durable-listener/durable-listener-client");
|
|
31
31
|
const grpc_helpers_1 = require("../../util/grpc-helpers");
|
|
32
|
+
const transport_1 = require("../../clients/transport");
|
|
32
33
|
const nice_grpc_1 = require("nice-grpc");
|
|
33
34
|
const declaration_1 = require("../declaration");
|
|
34
35
|
const legacy_transformer_1 = require("../../legacy/legacy-transformer");
|
|
@@ -50,7 +51,8 @@ class HatchetClient {
|
|
|
50
51
|
*/
|
|
51
52
|
get v0() {
|
|
52
53
|
if (!this._v0) {
|
|
53
|
-
|
|
54
|
+
// The legacy facade shares this client's unary transport rather than building its own.
|
|
55
|
+
this._v0 = new hatchet_client_1.LegacyHatchetClient(this._config, Object.assign(Object.assign({}, this._options), { transport: this._transport }), this._axiosConfig, this.runs, this._listener, this.events, this.dispatcher, this.logger, this.durableListener);
|
|
54
56
|
}
|
|
55
57
|
return this._v0;
|
|
56
58
|
}
|
|
@@ -62,7 +64,7 @@ class HatchetClient {
|
|
|
62
64
|
* @internal
|
|
63
65
|
*/
|
|
64
66
|
constructor(config, options, axiosConfig) {
|
|
65
|
-
var _a;
|
|
67
|
+
var _a, _b;
|
|
66
68
|
try {
|
|
67
69
|
const loaded = config_loader_1.ConfigLoader.loadClientConfig(config, {
|
|
68
70
|
path: options === null || options === void 0 ? void 0 : options.config_path,
|
|
@@ -80,6 +82,7 @@ class HatchetClient {
|
|
|
80
82
|
this._clientFactory = (0, nice_grpc_1.createClientFactory)().use((0, grpc_helpers_1.addTokenMiddleware)(this.config.token));
|
|
81
83
|
this._credentials =
|
|
82
84
|
(_a = options === null || options === void 0 ? void 0 : options.credentials) !== null && _a !== void 0 ? _a : config_loader_1.ConfigLoader.createCredentials(this.config.tls_config);
|
|
85
|
+
this._transport = (_b = options === null || options === void 0 ? void 0 : options.transport) !== null && _b !== void 0 ? _b : (0, transport_1.createNodeTransport)(this.config);
|
|
83
86
|
this._listener = new child_listener_client_1.RunListenerClient(this.config, (0, grpc_helpers_1.channelFactory)(this.config, this._credentials), this._clientFactory, this.api);
|
|
84
87
|
this._options = options;
|
|
85
88
|
this._axiosConfig = axiosConfig;
|
|
@@ -104,7 +107,7 @@ class HatchetClient {
|
|
|
104
107
|
// Do nothing here
|
|
105
108
|
});
|
|
106
109
|
}
|
|
107
|
-
catch (
|
|
110
|
+
catch (_c) {
|
|
108
111
|
// Do nothing here
|
|
109
112
|
}
|
|
110
113
|
}
|
|
@@ -295,7 +298,7 @@ class HatchetClient {
|
|
|
295
298
|
*/
|
|
296
299
|
get events() {
|
|
297
300
|
if (!this._event) {
|
|
298
|
-
this._event = new event_client_1.EventClient(this._config, (0, grpc_helpers_1.channelFactory)(this._config, this._credentials), this._clientFactory, this.api);
|
|
301
|
+
this._event = new event_client_1.EventClient(this._config, (0, grpc_helpers_1.channelFactory)(this._config, this._credentials), this._clientFactory, this.api, this._transport);
|
|
299
302
|
}
|
|
300
303
|
return this._event;
|
|
301
304
|
}
|
|
@@ -437,7 +440,7 @@ class HatchetClient {
|
|
|
437
440
|
*/
|
|
438
441
|
get admin() {
|
|
439
442
|
if (!this._admin) {
|
|
440
|
-
this._admin = new admin_1.AdminClient(this._config, this.api, this.runs);
|
|
443
|
+
this._admin = new admin_1.AdminClient(this._config, this.api, this.runs, this._transport);
|
|
441
444
|
}
|
|
442
445
|
return this._admin;
|
|
443
446
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScheduledWorkflows, ScheduledWorkflowsBulkDeleteFilter, ScheduledWorkflowsBulkDeleteResponse, ScheduledWorkflowsBulkUpdateResponse, ScheduledWorkflowsList } from '../../../clients/rest/generated/data-contracts';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
|
-
import { Workflow } from '../../../workflow';
|
|
3
|
+
import type { Workflow } from '../../../legacy/workflow';
|
|
4
4
|
import { BaseWorkflowDeclaration, WorkflowDefinition } from '../..';
|
|
5
5
|
import { HatchetClient } from '../client';
|
|
6
6
|
import { WorkflowsClient } from './workflows';
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.multipleConcurrencyKeys = exports.simpleConcurrency = void 0;
|
|
13
|
-
const
|
|
13
|
+
const v1_1 = require("../..");
|
|
14
14
|
const hatchet_client_1 = require("../hatchet-client");
|
|
15
15
|
const sleep = (ms) => new Promise((resolve) => {
|
|
16
16
|
setTimeout(resolve, ms);
|
|
@@ -20,7 +20,7 @@ exports.simpleConcurrency = hatchet_client_1.hatchet.workflow({
|
|
|
20
20
|
name: 'simple-concurrency',
|
|
21
21
|
concurrency: {
|
|
22
22
|
maxRuns: 1,
|
|
23
|
-
limitStrategy:
|
|
23
|
+
limitStrategy: v1_1.ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,
|
|
24
24
|
expression: 'input.GroupKey',
|
|
25
25
|
},
|
|
26
26
|
});
|
|
@@ -40,12 +40,12 @@ exports.multipleConcurrencyKeys = hatchet_client_1.hatchet.workflow({
|
|
|
40
40
|
concurrency: [
|
|
41
41
|
{
|
|
42
42
|
maxRuns: 1,
|
|
43
|
-
limitStrategy:
|
|
43
|
+
limitStrategy: v1_1.ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,
|
|
44
44
|
expression: 'input.Tier',
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
maxRuns: 1,
|
|
48
|
-
limitStrategy:
|
|
48
|
+
limitStrategy: v1_1.ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,
|
|
49
49
|
expression: 'input.Account',
|
|
50
50
|
},
|
|
51
51
|
],
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.34.0-alpha.0";
|
package/version.js
CHANGED
package/workflow.js
CHANGED
|
@@ -18,6 +18,4 @@ exports.StickyStrategy = exports.ConcurrencyLimitStrategy = void 0;
|
|
|
18
18
|
const v1_1 = require("./v1");
|
|
19
19
|
Object.defineProperty(exports, "ConcurrencyLimitStrategy", { enumerable: true, get: function () { return v1_1.ConcurrencyLimitStrategy; } });
|
|
20
20
|
Object.defineProperty(exports, "StickyStrategy", { enumerable: true, get: function () { return v1_1.StickyStrategy; } });
|
|
21
|
-
const v0_deprecation_warning_1 = require("./util/v0-deprecation-warning");
|
|
22
21
|
__exportStar(require("./legacy/workflow"), exports);
|
|
23
|
-
(0, v0_deprecation_warning_1.emitV0RemovedWarning)('workflow', 'ConcurrencyLimitStrategy and StickyStrategy have been moved to @hatchet-dev/typescript-sdk/v1.');
|