@protobase/workflows 0.95.2 → 0.95.4
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.
|
@@ -6,15 +6,20 @@ const within = (path, outer) => outer.every((key, index) => path[index] === key)
|
|
|
6
6
|
/**
|
|
7
7
|
* What the steps of a block's processor read of what it is given, from their expressions: each read of
|
|
8
8
|
* `$states.context.Execution.Input` as the path of names after it, cut where the path stops being plain names, and
|
|
9
|
-
* each secret by name. A path inside another one read is left out, as its value is part of that one's.
|
|
9
|
+
* each secret by name. A path inside another one read is left out, as its value is part of that one's. A Block inside
|
|
10
|
+
* it reads its input from its own Arguments, which are read here, but the secrets its steps read are the block's too,
|
|
11
|
+
* whose result holds what the inner one made with them.
|
|
10
12
|
*/
|
|
11
13
|
const blockReads = (processor) => {
|
|
12
14
|
const input = [];
|
|
13
15
|
const secrets = /* @__PURE__ */ new Set();
|
|
14
|
-
for (const state of ownStates(processor))
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
for (const state of ownStates(processor)) {
|
|
17
|
+
if (state.Type === "Block") for (const name of blockReads(state.Processor).secrets) secrets.add(name);
|
|
18
|
+
for (const { source } of stateExpressions(state)) for (const read of expressionParsed(source)?.states ?? []) {
|
|
19
|
+
if (read[0] !== "context") continue;
|
|
20
|
+
if (read[1] === "Execution" && read[2] === "Input") input.push(read.slice(3));
|
|
21
|
+
if (read[1] === "Secrets" && read[2] !== void 0) secrets.add(read[2]);
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
24
|
const sorted = input.sort((a, b) => a.length - b.length);
|
|
20
25
|
const kept = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/workflows",
|
|
3
|
-
"version": "0.95.
|
|
3
|
+
"version": "0.95.4",
|
|
4
4
|
"description": "Workflows as state machines with JSONata expressions: their check, a runner that saves only what a run needs to go on and traces every step, and the plugin interface for trigger and step types.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|