@cadenza.io/core 1.11.13 → 1.11.14
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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ declare class GraphContext {
|
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly fullContext: AnyObject;
|
|
8
8
|
readonly userData: AnyObject;
|
|
9
|
-
readonly
|
|
9
|
+
readonly metadata: AnyObject;
|
|
10
10
|
constructor(context: AnyObject);
|
|
11
11
|
/**
|
|
12
12
|
* Gets frozen user data (read-only, no clone).
|
|
@@ -24,7 +24,7 @@ declare class GraphContext {
|
|
|
24
24
|
* Gets frozen metadata (read-only).
|
|
25
25
|
* @returns Frozen metadata object.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
getMetadata(): AnyObject;
|
|
28
28
|
/**
|
|
29
29
|
* Clones this context (new instance).
|
|
30
30
|
* @returns New GraphContext.
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare class GraphContext {
|
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly fullContext: AnyObject;
|
|
8
8
|
readonly userData: AnyObject;
|
|
9
|
-
readonly
|
|
9
|
+
readonly metadata: AnyObject;
|
|
10
10
|
constructor(context: AnyObject);
|
|
11
11
|
/**
|
|
12
12
|
* Gets frozen user data (read-only, no clone).
|
|
@@ -24,7 +24,7 @@ declare class GraphContext {
|
|
|
24
24
|
* Gets frozen metadata (read-only).
|
|
25
25
|
* @returns Frozen metadata object.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
getMetadata(): AnyObject;
|
|
28
28
|
/**
|
|
29
29
|
* Clones this context (new instance).
|
|
30
30
|
* @returns New GraphContext.
|
package/dist/index.js
CHANGED
|
@@ -549,7 +549,7 @@ var GraphContext = class _GraphContext {
|
|
|
549
549
|
this.userData = Object.fromEntries(
|
|
550
550
|
Object.entries(this.fullContext).filter(([key]) => !key.startsWith("__"))
|
|
551
551
|
);
|
|
552
|
-
this.
|
|
552
|
+
this.metadata = Object.fromEntries(
|
|
553
553
|
Object.entries(this.fullContext).filter(([key]) => key.startsWith("__"))
|
|
554
554
|
);
|
|
555
555
|
this.id = (0, import_uuid2.v4)();
|
|
@@ -578,8 +578,8 @@ var GraphContext = class _GraphContext {
|
|
|
578
578
|
* Gets frozen metadata (read-only).
|
|
579
579
|
* @returns Frozen metadata object.
|
|
580
580
|
*/
|
|
581
|
-
|
|
582
|
-
return this.
|
|
581
|
+
getMetadata() {
|
|
582
|
+
return this.metadata;
|
|
583
583
|
}
|
|
584
584
|
/**
|
|
585
585
|
* Clones this context (new instance).
|
|
@@ -699,7 +699,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
699
699
|
constructor(task, context, routineExecId, prevNodes = [], debug = false, verbose = false) {
|
|
700
700
|
var _a;
|
|
701
701
|
super(
|
|
702
|
-
task.isMeta && !debug || task.isSubMeta || ((_a = context == null ? void 0 : context.
|
|
702
|
+
task.isMeta && !debug || task.isSubMeta || ((_a = context == null ? void 0 : context.getMetadata()) == null ? void 0 : _a.__isSubMeta)
|
|
703
703
|
);
|
|
704
704
|
this.divided = false;
|
|
705
705
|
this.splitGroupId = "";
|
|
@@ -858,7 +858,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
858
858
|
filter: { uuid: this.routineExecId }
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
|
-
if (this.debug && !this.task.isSubMeta && !this.context.
|
|
861
|
+
if (this.debug && !this.task.isSubMeta && !this.context.getMetadata().__isSubMeta || this.verbose) {
|
|
862
862
|
this.log();
|
|
863
863
|
}
|
|
864
864
|
this.emitMetricsWithMetadata("meta.node.started", {
|
|
@@ -923,7 +923,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
923
923
|
if (!this.divided && !this.processing) {
|
|
924
924
|
this.processing = true;
|
|
925
925
|
const inputValidation = this.task.validateInput(
|
|
926
|
-
this.isMeta() ? this.context.
|
|
926
|
+
this.isMeta() ? this.context.getMetadata() : this.context.getContext()
|
|
927
927
|
);
|
|
928
928
|
if (inputValidation !== true) {
|
|
929
929
|
this.onError(inputValidation.__validationErrors);
|
|
@@ -1113,7 +1113,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
1113
1113
|
this.divided = true;
|
|
1114
1114
|
this.migrate({
|
|
1115
1115
|
...this.result,
|
|
1116
|
-
...this.context.
|
|
1116
|
+
...this.context.getMetadata(),
|
|
1117
1117
|
__nextNodes: newNodes.map((n) => n.id),
|
|
1118
1118
|
__retries: this.retries
|
|
1119
1119
|
});
|
|
@@ -1147,8 +1147,8 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
1147
1147
|
joinedContexts: [
|
|
1148
1148
|
{ ...result, taskName: this.task.name, __nodeId: this.id }
|
|
1149
1149
|
],
|
|
1150
|
-
...this.context.
|
|
1151
|
-
} : { ...result, ...this.context.
|
|
1150
|
+
...this.context.getMetadata()
|
|
1151
|
+
} : { ...result, ...this.context.getMetadata() };
|
|
1152
1152
|
return this.clone().split(groupId).differentiate(t).migrate(context);
|
|
1153
1153
|
}, failed)
|
|
1154
1154
|
);
|
|
@@ -1168,7 +1168,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
1168
1168
|
__nodeId: this.id
|
|
1169
1169
|
}
|
|
1170
1170
|
],
|
|
1171
|
-
...this.context.
|
|
1171
|
+
...this.context.getMetadata()
|
|
1172
1172
|
});
|
|
1173
1173
|
}
|
|
1174
1174
|
return newNode;
|
|
@@ -2309,9 +2309,9 @@ var GraphRunner = class extends SignalEmitter {
|
|
|
2309
2309
|
name: routineName,
|
|
2310
2310
|
isMeta,
|
|
2311
2311
|
routineId,
|
|
2312
|
-
contractId: (_d = (_c = (_b = context.
|
|
2312
|
+
contractId: (_d = (_c = (_b = context.__metadata) == null ? void 0 : _b.__contractId) != null ? _c : context.__contractId) != null ? _d : null,
|
|
2313
2313
|
context: ctx.export(),
|
|
2314
|
-
previousRoutineExecution: (_f = (_e = context.
|
|
2314
|
+
previousRoutineExecution: (_f = (_e = context.__metadata) == null ? void 0 : _e.__routineExecId) != null ? _f : null,
|
|
2315
2315
|
// TODO: There is a chance this is not added to the database yet...
|
|
2316
2316
|
created: formatTimestamp(Date.now())
|
|
2317
2317
|
}
|