@cadenza.io/core 3.0.17 → 3.0.19

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 CHANGED
@@ -816,8 +816,8 @@ var GraphNode = class _GraphNode extends SignalEmitter {
816
816
  filter: {
817
817
  taskName: this.task.name,
818
818
  taskVersion: this.task.version,
819
- previousTaskName: node.task.name,
820
- previousTaskVersion: node.task.version
819
+ predecessorTaskName: node.task.name,
820
+ predecessorTaskVersion: node.task.version
821
821
  }
822
822
  });
823
823
  });
@@ -862,7 +862,6 @@ var GraphNode = class _GraphNode extends SignalEmitter {
862
862
  return this.executionStart;
863
863
  }
864
864
  end() {
865
- var _a;
866
865
  if (this.executionStart === 0) {
867
866
  return 0;
868
867
  }
@@ -897,24 +896,21 @@ var GraphNode = class _GraphNode extends SignalEmitter {
897
896
  });
898
897
  if (this.graphDone()) {
899
898
  const context2 = this.context.export();
900
- if ((_a = context2.context.__metadata) == null ? void 0 : _a.__deputyExecId)
899
+ if (context2.context.__isDeputy)
901
900
  this.emitWithMetadata(
902
- `meta.node.graph_completed:${context2.context.__metadata.__deputyExecId}`,
903
- context2
901
+ `meta.node.graph_completed:${this.routineExecId}`,
902
+ context2.context
904
903
  );
905
- this.emitMetricsWithMetadata(
906
- `meta.node.ended_routine_execution:${this.routineExecId}`,
907
- {
908
- data: {
909
- isRunning: false,
910
- isComplete: true,
911
- resultContext: this.context.export(),
912
- progress: 1,
913
- ended: formatTimestamp(end)
914
- },
915
- filter: { uuid: this.routineExecId }
916
- }
917
- );
904
+ this.emitMetricsWithMetadata("meta.node.ended_routine_execution", {
905
+ data: {
906
+ isRunning: false,
907
+ isComplete: true,
908
+ resultContext: context2,
909
+ progress: 1,
910
+ ended: formatTimestamp(end)
911
+ },
912
+ filter: { uuid: this.routineExecId }
913
+ });
918
914
  }
919
915
  return end;
920
916
  }
@@ -999,6 +995,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
999
995
  };
1000
996
  const context = this.context.getMetadata();
1001
997
  data.__metadata = {
998
+ ...data.__metadata,
1002
999
  __routineExecId: this.routineExecId,
1003
1000
  __executionTraceId: (_b = (_a = context.__metadata) == null ? void 0 : _a.__executionTraceId) != null ? _b : context.__executionTraceId
1004
1001
  };
@@ -1017,6 +1014,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
1017
1014
  };
1018
1015
  const context = this.context.getMetadata();
1019
1016
  data.__metadata = {
1017
+ ...data.__metadata,
1020
1018
  __routineExecId: this.routineExecId,
1021
1019
  __executionTraceId: (_b = (_a = context.__metadata) == null ? void 0 : _a.__executionTraceId) != null ? _b : context.__executionTraceId
1022
1020
  };
@@ -2478,9 +2476,13 @@ var GraphRunner = class extends SignalEmitter {
2478
2476
  }
2479
2477
  }
2480
2478
  startRun(context) {
2481
- var _a;
2479
+ var _a, _b, _c;
2482
2480
  if (context.__task || context.__routine) {
2483
2481
  const routine = (_a = context.__task) != null ? _a : context.__routine;
2482
+ delete context.__task;
2483
+ delete context.__routine;
2484
+ context.__routineExecId = (_c = (_b = context.__metadata) == null ? void 0 : _b.__deputyExecId) != null ? _c : null;
2485
+ context.__isDeputy = true;
2484
2486
  this.run(routine, context);
2485
2487
  return true;
2486
2488
  } else {