@cadenza.io/core 1.11.1 → 1.11.3

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.mjs CHANGED
@@ -183,7 +183,7 @@ var SignalBroker = class _SignalBroker {
183
183
  executed = this.executeListener(signal, context);
184
184
  if (!isSubMeta) {
185
185
  const parts = signal.slice(0, Math.max(signal.lastIndexOf(":"), signal.lastIndexOf("."))).split(".");
186
- for (let i = parts.length; i > 0; i--) {
186
+ for (let i = parts.length; i > -1; i--) {
187
187
  const parent = parts.slice(0, i).join(".");
188
188
  executed = executed || this.executeListener(parent + ".*", context);
189
189
  }
@@ -2208,21 +2208,26 @@ var GraphRunner = class extends SignalEmitter {
2208
2208
  }
2209
2209
  return t;
2210
2210
  });
2211
+ const isSubMeta = allTasks.some((t) => t.isSubMeta) || !!context.__isSubMeta;
2212
+ context.__isSubMeta = isSubMeta;
2211
2213
  const ctx = new GraphContext(context || {});
2212
2214
  const routineExecId = (_a = context.__routineExecId) != null ? _a : uuid6();
2213
2215
  context.__routineExecId = routineExecId;
2214
- this.emit("meta.runner.added_tasks", {
2215
- data: {
2216
- uuid: routineExecId,
2217
- name: routineName,
2218
- isMeta,
2219
- contractId: (_d = (_c = (_b = context.__metaData) == null ? void 0 : _b.__contractId) != null ? _c : context.__contractId) != null ? _d : null,
2220
- context: ctx.export(),
2221
- previousRoutineExecution: (_f = (_e = context.__metaData) == null ? void 0 : _e.__routineExecId) != null ? _f : null,
2222
- // TODO: There is a chance this is not added to the database yet...
2223
- created: formatTimestamp(Date.now())
2224
- }
2225
- });
2216
+ if (!isSubMeta) {
2217
+ this.emit("meta.runner.added_tasks", {
2218
+ data: {
2219
+ uuid: routineExecId,
2220
+ name: routineName,
2221
+ isMeta,
2222
+ routineId,
2223
+ contractId: (_d = (_c = (_b = context.__metaData) == null ? void 0 : _b.__contractId) != null ? _c : context.__contractId) != null ? _d : null,
2224
+ context: ctx.export(),
2225
+ previousRoutineExecution: (_f = (_e = context.__metaData) == null ? void 0 : _e.__routineExecId) != null ? _f : null,
2226
+ // TODO: There is a chance this is not added to the database yet...
2227
+ created: formatTimestamp(Date.now())
2228
+ }
2229
+ });
2230
+ }
2226
2231
  allTasks.forEach(
2227
2232
  (task) => this.currentRun.addNode(
2228
2233
  new GraphNode(task, ctx, routineExecId, [], this.debug)