@activepieces/shared 0.3.36 → 0.3.37
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/package.json
CHANGED
|
@@ -4,9 +4,12 @@ declare type GetStepOutputParams = {
|
|
|
4
4
|
ancestors: [string, number][];
|
|
5
5
|
};
|
|
6
6
|
export declare class ExecutionState {
|
|
7
|
+
private _taskCount;
|
|
7
8
|
steps: Record<string, StepOutput>;
|
|
8
9
|
lastStepState: Record<string, unknown>;
|
|
9
10
|
constructor(executionState?: ExecutionState);
|
|
11
|
+
get taskCount(): number;
|
|
12
|
+
private adjustTaskCount;
|
|
10
13
|
insertStep(stepOutput: StepOutput, stepName: string, ancestors: [string, number][]): void;
|
|
11
14
|
updateLastStep(outputOnly: unknown, stepName: string): void;
|
|
12
15
|
getStepOutput<T extends StepOutput>(params: GetStepOutputParams): T | undefined;
|
|
@@ -4,15 +4,33 @@ exports.ExecutionState = void 0;
|
|
|
4
4
|
const action_1 = require("../../flows/actions/action");
|
|
5
5
|
class ExecutionState {
|
|
6
6
|
constructor(executionState) {
|
|
7
|
+
this._taskCount = 0;
|
|
7
8
|
this.steps = {};
|
|
8
9
|
this.lastStepState = {};
|
|
9
10
|
if (executionState) {
|
|
11
|
+
this._taskCount = executionState.taskCount;
|
|
10
12
|
this.steps = executionState.steps;
|
|
11
13
|
this.lastStepState = executionState.lastStepState;
|
|
12
14
|
}
|
|
13
15
|
}
|
|
16
|
+
get taskCount() {
|
|
17
|
+
return this._taskCount;
|
|
18
|
+
}
|
|
19
|
+
adjustTaskCount({ stepOutput }) {
|
|
20
|
+
const nonCountableSteps = [
|
|
21
|
+
action_1.ActionType.BRANCH,
|
|
22
|
+
action_1.ActionType.LOOP_ON_ITEMS,
|
|
23
|
+
];
|
|
24
|
+
const stepIsCountable = !nonCountableSteps.includes(stepOutput.type);
|
|
25
|
+
if (stepIsCountable) {
|
|
26
|
+
this._taskCount += 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
14
29
|
insertStep(stepOutput, stepName, ancestors) {
|
|
15
30
|
const targetMap = this.getTargetMap(ancestors);
|
|
31
|
+
this.adjustTaskCount({
|
|
32
|
+
stepOutput,
|
|
33
|
+
});
|
|
16
34
|
targetMap[stepName] = stepOutput;
|
|
17
35
|
this.updateLastStep(stepOutput.output, stepName);
|
|
18
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-state.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flow-run/execution/execution-state.ts"],"names":[],"mappings":";;;AAAA,uDAAwD;
|
|
1
|
+
{"version":3,"file":"execution-state.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flow-run/execution/execution-state.ts"],"names":[],"mappings":";;;AAAA,uDAAwD;AAYxD,MAAa,cAAc;IAKzB,YAAY,cAA+B;QAJnC,eAAU,GAAG,CAAC,CAAA;QACtB,UAAK,GAA+B,EAAE,CAAC;QACvC,kBAAa,GAA4B,EAAE,CAAC;QAG1C,IAAI,cAAc,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,SAAS,CAAA;YAC1C,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAA;YACjC,IAAI,CAAC,aAAa,GAAG,cAAc,CAAC,aAAa,CAAA;SAClD;IACH,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAA;IACxB,CAAC;IAEO,eAAe,CAAC,EAAE,UAAU,EAAyB;QAC3D,MAAM,iBAAiB,GAAG;YACxB,mBAAU,CAAC,MAAM;YACjB,mBAAU,CAAC,aAAa;SACzB,CAAA;QAED,MAAM,eAAe,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QAEpE,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,UAAU,IAAI,CAAC,CAAA;SACrB;IACH,CAAC;IAED,UAAU,CACR,UAAsB,EACtB,QAAgB,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