chartmind 1.0.6 → 1.0.7
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.
@@ -23,8 +23,9 @@ class DecisionAction extends base_action_1.BaseAction {
|
|
23
23
|
this.evaluateCondition(connection.condition, chartContext));
|
24
24
|
}
|
25
25
|
evaluateCondition(condition, chartContext) {
|
26
|
-
|
27
|
-
|
26
|
+
const keys = Array.from(chartContext.context.keys());
|
27
|
+
const values = Array.from(chartContext.context.values());
|
28
|
+
return new Function(...keys, `return ${condition}`)(...values);
|
28
29
|
}
|
29
30
|
getDefaultConnection(connections) {
|
30
31
|
return connections.find(connections => connections.default === '1');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decision-action.js","sourceRoot":"","sources":["../../../../src/engine/actions/decision-action.ts"],"names":[],"mappings":";;;AAGA,+CAAyC;AAEzC,MAAa,cAAe,SAAQ,wBAAU;IACrC,KAAK,CAAC,OAAO;QAClB,2DAA2D;IAC7D,CAAC;IAEM,OAAO,CAAC,YAA0B;QACvC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAExE,MAAM,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,CACrD,WAAW,EACX,YAAY,CACb,CAAC;QACF,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;QACjE,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACzD,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,sBAAsB,CAC5B,WAA+B,EAC/B,YAA0B;QAE1B,OAAO,WAAW,CAAC,IAAI,CACrB,UAAU,CAAC,EAAE,CACX,UAAU,CAAC,OAAO,KAAK,GAAG;YAC1B,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAC7D,CAAC;IACJ,CAAC;IAEO,iBAAiB,CACvB,SAAiB,EACjB,YAA0B;QAE1B,
|
1
|
+
{"version":3,"file":"decision-action.js","sourceRoot":"","sources":["../../../../src/engine/actions/decision-action.ts"],"names":[],"mappings":";;;AAGA,+CAAyC;AAEzC,MAAa,cAAe,SAAQ,wBAAU;IACrC,KAAK,CAAC,OAAO;QAClB,2DAA2D;IAC7D,CAAC;IAEM,OAAO,CAAC,YAA0B;QACvC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAExE,MAAM,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,CACrD,WAAW,EACX,YAAY,CACb,CAAC;QACF,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;QACjE,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACzD,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,sBAAsB,CAC5B,WAA+B,EAC/B,YAA0B;QAE1B,OAAO,WAAW,CAAC,IAAI,CACrB,UAAU,CAAC,EAAE,CACX,UAAU,CAAC,OAAO,KAAK,GAAG;YAC1B,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAC7D,CAAC;IACJ,CAAC;IAEO,iBAAiB,CACvB,SAAiB,EACjB,YAA0B;QAE1B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAEzD,OAAO,IAAI,QAAQ,CAAC,GAAG,IAAI,EAAE,UAAU,SAAS,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IACjE,CAAC;IAEO,oBAAoB,CAC1B,WAA+B;QAE/B,OAAO,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC;IACtE,CAAC;CACF;AAlDD,wCAkDC"}
|
@@ -7,13 +7,13 @@
|
|
7
7
|
*/
|
8
8
|
export declare class ChartContext {
|
9
9
|
private _context;
|
10
|
-
constructor(context: Map<
|
10
|
+
constructor(context: Map<string, unknown>);
|
11
11
|
/**
|
12
12
|
* Gets the underlying context map containing all variables.
|
13
13
|
*
|
14
14
|
* @returns The map of variable names to their corresponding values.
|
15
15
|
*/
|
16
|
-
get context(): Map<
|
16
|
+
get context(): Map<string, unknown>;
|
17
17
|
/**
|
18
18
|
* Sets a variable in the context.
|
19
19
|
*
|
@@ -57,7 +57,7 @@ export declare class ChartManager {
|
|
57
57
|
* @returns A promise that resolves when the chart instance has been started.
|
58
58
|
* @throws {Error} If the chart with the specified name does not exist.
|
59
59
|
*/
|
60
|
-
startChartInstanceByName(name: string, context: Map<
|
60
|
+
startChartInstanceByName(name: string, context: Map<string, unknown>): Promise<void>;
|
61
61
|
/**
|
62
62
|
* Starts a chart instance by its unique identifier.
|
63
63
|
*
|
@@ -70,6 +70,6 @@ export declare class ChartManager {
|
|
70
70
|
* @returns A promise that resolves when the chart has been started, or rejects if the chart ID is unknown.
|
71
71
|
* @throws {Error} If no chart with the specified `id` is found.
|
72
72
|
*/
|
73
|
-
startChartInstanceById(id: string, context: Map<
|
73
|
+
startChartInstanceById(id: string, context: Map<string, unknown>): Promise<void>;
|
74
74
|
private startChart;
|
75
75
|
}
|