@hatchet-dev/typescript-sdk 1.15.1 → 1.15.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.
- package/legacy/step.js +1 -1
- package/package.json +1 -1
- package/v1/client/client.interface.d.ts +2 -0
- package/v1/client/worker/context.js +1 -1
- package/v1/client/worker/worker-internal.js +1 -1
- package/v1/conditions/transformer.d.ts +2 -2
- package/v1/conditions/transformer.js +5 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/legacy/step.js
CHANGED
|
@@ -569,7 +569,7 @@ class V0DurableContext extends V0Context {
|
|
|
569
569
|
*/
|
|
570
570
|
waitFor(conditions) {
|
|
571
571
|
return __awaiter(this, void 0, void 0, function* () {
|
|
572
|
-
const pbConditions = (0, transformer_1.conditionsToPb)((0, conditions_1.Render)(condition_1.Action.CREATE, conditions));
|
|
572
|
+
const pbConditions = (0, transformer_1.conditionsToPb)((0, conditions_1.Render)(condition_1.Action.CREATE, conditions), this.v0.config.namespace);
|
|
573
573
|
// eslint-disable-next-line no-plusplus
|
|
574
574
|
const key = `waitFor-${this.waitKey++}`;
|
|
575
575
|
yield this.v0.durableListener.registerDurableEvent({
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import { AdminClient } from './admin';
|
|
|
10
10
|
import { ScheduleClient } from './features/schedules';
|
|
11
11
|
import { CronClient } from './features/crons';
|
|
12
12
|
import { CELClient } from './features/cel';
|
|
13
|
+
import { WebhooksClient } from './features/webhooks';
|
|
13
14
|
export interface IHatchetClient {
|
|
14
15
|
/** @deprecated v0 client will be removed in a future release, please upgrade to v1 */
|
|
15
16
|
v0: LegacyHatchetClient;
|
|
@@ -21,6 +22,7 @@ export interface IHatchetClient {
|
|
|
21
22
|
runs: RunsClient;
|
|
22
23
|
workflows: WorkflowsClient;
|
|
23
24
|
workers: WorkersClient;
|
|
25
|
+
webhooks: WebhooksClient;
|
|
24
26
|
scheduled: ScheduleClient;
|
|
25
27
|
crons: CronClient;
|
|
26
28
|
admin: AdminClient;
|
|
@@ -670,7 +670,7 @@ class DurableContext extends Context {
|
|
|
670
670
|
waitFor(conditions) {
|
|
671
671
|
return __awaiter(this, void 0, void 0, function* () {
|
|
672
672
|
this.throwIfCancelled();
|
|
673
|
-
const pbConditions = (0, transformer_1.conditionsToPb)((0, conditions_1.Render)(condition_1.Action.CREATE, conditions));
|
|
673
|
+
const pbConditions = (0, transformer_1.conditionsToPb)((0, conditions_1.Render)(condition_1.Action.CREATE, conditions), this.v1.config.namespace);
|
|
674
674
|
// eslint-disable-next-line no-plusplus
|
|
675
675
|
const key = `waitFor-${this.waitKey++}`;
|
|
676
676
|
yield this.v1.durableListener.registerDurableEvent({
|
|
@@ -272,7 +272,7 @@ class InternalWorker {
|
|
|
272
272
|
workerLabels: mapWorkerLabelPb(task.desiredWorkerLabels || ((_g = workflow.taskDefaults) === null || _g === void 0 ? void 0 : _g.workerLabels)),
|
|
273
273
|
backoffFactor: ((_h = task.backoff) === null || _h === void 0 ? void 0 : _h.factor) || ((_k = (_j = workflow.taskDefaults) === null || _j === void 0 ? void 0 : _j.backoff) === null || _k === void 0 ? void 0 : _k.factor),
|
|
274
274
|
backoffMaxSeconds: ((_l = task.backoff) === null || _l === void 0 ? void 0 : _l.maxSeconds) || ((_o = (_m = workflow.taskDefaults) === null || _m === void 0 ? void 0 : _m.backoff) === null || _o === void 0 ? void 0 : _o.maxSeconds),
|
|
275
|
-
conditions: (0, transformer_1.taskConditionsToPb)(task),
|
|
275
|
+
conditions: (0, transformer_1.taskConditionsToPb)(task, this.client.config.namespace),
|
|
276
276
|
isDurable: durableTaskSet.has(task),
|
|
277
277
|
slotRequests: task.slotRequests || (durableTaskSet.has(task) ? { durable: 1 } : { default: 1 }),
|
|
278
278
|
concurrency: task.concurrency
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TaskConditions } from '../../protoc/v1/shared/condition';
|
|
2
2
|
import { CreateWorkflowTaskOpts } from '../task';
|
|
3
3
|
import { Condition } from './base';
|
|
4
|
-
export declare function taskConditionsToPb(task: Omit<CreateWorkflowTaskOpts<any, any>, 'fn'
|
|
5
|
-
export declare function conditionsToPb(conditions: Condition[]): TaskConditions;
|
|
4
|
+
export declare function taskConditionsToPb(task: Omit<CreateWorkflowTaskOpts<any, any>, 'fn'>, namespace?: string): TaskConditions;
|
|
5
|
+
export declare function conditionsToPb(conditions: Condition[], namespace?: string): TaskConditions;
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.taskConditionsToPb = taskConditionsToPb;
|
|
4
4
|
exports.conditionsToPb = conditionsToPb;
|
|
5
|
+
const apply_namespace_1 = require("../../util/apply-namespace");
|
|
5
6
|
const _1 = require(".");
|
|
6
7
|
const base_1 = require("./base");
|
|
7
8
|
const parent_condition_1 = require("./parent-condition");
|
|
8
|
-
function taskConditionsToPb(task) {
|
|
9
|
+
function taskConditionsToPb(task, namespace) {
|
|
9
10
|
const waitForConditions = (0, _1.Render)(base_1.Action.QUEUE, task.waitFor);
|
|
10
11
|
const cancelIfConditions = (0, _1.Render)(base_1.Action.CANCEL, task.cancelIf);
|
|
11
12
|
const skipIfConditions = (0, _1.Render)(base_1.Action.SKIP, task.skipIf);
|
|
12
13
|
const mergedConditions = [...waitForConditions, ...cancelIfConditions, ...skipIfConditions];
|
|
13
|
-
return conditionsToPb(mergedConditions);
|
|
14
|
+
return conditionsToPb(mergedConditions, namespace);
|
|
14
15
|
}
|
|
15
|
-
function conditionsToPb(conditions) {
|
|
16
|
+
function conditionsToPb(conditions, namespace) {
|
|
16
17
|
const parentOverrideConditions = [];
|
|
17
18
|
const sleepConditions = [];
|
|
18
19
|
const userEventConditions = [];
|
|
@@ -26,7 +27,7 @@ function conditionsToPb(conditions) {
|
|
|
26
27
|
else if (condition instanceof _1.UserEventCondition) {
|
|
27
28
|
userEventConditions.push({
|
|
28
29
|
base: Object.assign(Object.assign({}, baseToPb(condition.base)), { expression: condition.expression || '' }),
|
|
29
|
-
userEventKey: condition.eventKey,
|
|
30
|
+
userEventKey: (0, apply_namespace_1.applyNamespace)(condition.eventKey, namespace),
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
else if (condition instanceof parent_condition_1.ParentCondition) {
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.15.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.15.2";
|
package/version.js
CHANGED