@cadenza.io/core 1.11.2 → 1.11.4
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/dist/index.js +24 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -204,6 +204,8 @@ var SignalBroker = class _SignalBroker {
|
|
|
204
204
|
...context.__signalEmission,
|
|
205
205
|
signalName: signal,
|
|
206
206
|
emittedAt: formatTimestamp(emittedAt),
|
|
207
|
+
consumed: false,
|
|
208
|
+
consumedBy: null,
|
|
207
209
|
isMeta
|
|
208
210
|
};
|
|
209
211
|
} else if (isSubMeta) {
|
|
@@ -821,7 +823,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
821
823
|
});
|
|
822
824
|
}
|
|
823
825
|
});
|
|
824
|
-
if (((_a = context.__signalEmission) == null ? void 0 : _a.
|
|
826
|
+
if (((_a = context.__signalEmission) == null ? void 0 : _a.consumed) === false && (!this.isMeta() || this.debug)) {
|
|
825
827
|
this.emitWithMetadata("meta.node.consumed_signal", {
|
|
826
828
|
data: {
|
|
827
829
|
signalName: context.__signalEmission.signalName,
|
|
@@ -830,7 +832,8 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
830
832
|
consumedAt: formatTimestamp(scheduledAt)
|
|
831
833
|
}
|
|
832
834
|
});
|
|
833
|
-
|
|
835
|
+
context.__signalEmission.consumed = true;
|
|
836
|
+
context.__signalEmission.consumedBy = this.id;
|
|
834
837
|
}
|
|
835
838
|
}
|
|
836
839
|
}
|
|
@@ -847,7 +850,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
847
850
|
filter: { uuid: this.routineExecId }
|
|
848
851
|
});
|
|
849
852
|
}
|
|
850
|
-
if (this.debug) {
|
|
853
|
+
if (this.debug && !this.context.getMetaData().__isSubMeta) {
|
|
851
854
|
this.log();
|
|
852
855
|
}
|
|
853
856
|
this.emitWithMetadata("meta.node.started", {
|
|
@@ -1270,7 +1273,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
1270
1273
|
console.log(
|
|
1271
1274
|
"Node execution:",
|
|
1272
1275
|
this.task.name,
|
|
1273
|
-
this.context.getFullContext(),
|
|
1276
|
+
JSON.stringify(this.context.getFullContext()),
|
|
1274
1277
|
this.routineExecId
|
|
1275
1278
|
);
|
|
1276
1279
|
}
|
|
@@ -2246,21 +2249,26 @@ var GraphRunner = class extends SignalEmitter {
|
|
|
2246
2249
|
}
|
|
2247
2250
|
return t;
|
|
2248
2251
|
});
|
|
2252
|
+
const isSubMeta = allTasks.some((t) => t.isSubMeta) || !!context.__isSubMeta;
|
|
2253
|
+
context.__isSubMeta = isSubMeta;
|
|
2249
2254
|
const ctx = new GraphContext(context || {});
|
|
2250
2255
|
const routineExecId = (_a = context.__routineExecId) != null ? _a : (0, import_uuid6.v4)();
|
|
2251
2256
|
context.__routineExecId = routineExecId;
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2257
|
+
if (!isSubMeta) {
|
|
2258
|
+
this.emit("meta.runner.added_tasks", {
|
|
2259
|
+
data: {
|
|
2260
|
+
uuid: routineExecId,
|
|
2261
|
+
name: routineName,
|
|
2262
|
+
isMeta,
|
|
2263
|
+
routineId,
|
|
2264
|
+
contractId: (_d = (_c = (_b = context.__metaData) == null ? void 0 : _b.__contractId) != null ? _c : context.__contractId) != null ? _d : null,
|
|
2265
|
+
context: ctx.export(),
|
|
2266
|
+
previousRoutineExecution: (_f = (_e = context.__metaData) == null ? void 0 : _e.__routineExecId) != null ? _f : null,
|
|
2267
|
+
// TODO: There is a chance this is not added to the database yet...
|
|
2268
|
+
created: formatTimestamp(Date.now())
|
|
2269
|
+
}
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2264
2272
|
allTasks.forEach(
|
|
2265
2273
|
(task) => this.currentRun.addNode(
|
|
2266
2274
|
new GraphNode(task, ctx, routineExecId, [], this.debug)
|