@uipath/maestro-builder-sdk 6.35.0 → 6.35.1
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/decompile.js +16 -6
- package/dist/merge.js +18 -6
- package/package.json +2 -2
package/dist/decompile.js
CHANGED
|
@@ -185,9 +185,19 @@ function shippedVersions(type) {
|
|
|
185
185
|
const registered = FLOW_NODE_TYPES.byTypeName(type);
|
|
186
186
|
return registered ? Object.keys(registered.type.versions) : bundledVersions(type);
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
/**
|
|
189
|
+
* The options argument of `.branch()`, `.switch()` and `.parallel()`: the exact
|
|
190
|
+
* `version`, and a canvas `label` that differs from the node id (what compile
|
|
191
|
+
* writes when none is given). No `updates`: those constructs refuse them.
|
|
192
|
+
*/
|
|
193
|
+
function forkOptsArg(node) {
|
|
194
|
+
const parts = [];
|
|
195
|
+
const ver = verClause(node);
|
|
196
|
+
if (ver)
|
|
197
|
+
parts.push(ver);
|
|
198
|
+
if (hasRenamedLabel(node, node.id))
|
|
199
|
+
parts.push(`label: ${tsLiteral(node.display.label)}`);
|
|
200
|
+
return parts.length ? `, { ${parts.join(', ')} }` : '';
|
|
191
201
|
}
|
|
192
202
|
/**
|
|
193
203
|
* A trigger node's option clauses: its exact `version`, and its canvas `label`
|
|
@@ -2329,7 +2339,7 @@ function forkRegion(edges, stop, scope, ipdom, ctx, refInto) {
|
|
|
2329
2339
|
*/
|
|
2330
2340
|
function parallelSeg(join, joinNode, targets, scope, ipdom, ctx, refInto) {
|
|
2331
2341
|
const arms = targets.map((t, i) => armCb(`a${i}`, region(t, join, scope, ipdom, ctx, refInto)));
|
|
2332
|
-
const seg = `.parallel(${tsLiteral(join)}, [\n${arms.map((a) => reindent(a, ' ')).join(',\n')},\n]${
|
|
2342
|
+
const seg = `.parallel(${tsLiteral(join)}, [\n${arms.map((a) => reindent(a, ' ')).join(',\n')},\n]${forkOptsArg(joinNode)})`;
|
|
2333
2343
|
return { seg, next: continueOn(joinNode, 'output', ctx, refInto) };
|
|
2334
2344
|
}
|
|
2335
2345
|
/** Re-indent every non-empty line of a (possibly multi-line) segment by `pad`. */
|
|
@@ -2519,7 +2529,7 @@ function region(cursor, stop, scope, ipdom, ctx, refInto) {
|
|
|
2519
2529
|
thenSegs.unshift(`.label(${tsLiteral(labels.trueLabel)})`);
|
|
2520
2530
|
if (labels.falseLabel)
|
|
2521
2531
|
elseSegs.unshift(`.label(${tsLiteral(labels.falseLabel)})`);
|
|
2522
|
-
segs.push(`.branch(${tsLiteral(node.id)}, ${cond},\n${reindent(armCb('t', thenSegs), ' ')},\n${reindent(armCb('e', elseSegs), ' ')}${
|
|
2532
|
+
segs.push(`.branch(${tsLiteral(node.id)}, ${cond},\n${reindent(armCb('t', thenSegs), ' ')},\n${reindent(armCb('e', elseSegs), ' ')}${forkOptsArg(node)})`);
|
|
2523
2533
|
flagDropped(node, ctx, segs);
|
|
2524
2534
|
cursor = r === EXIT ? undefined : r;
|
|
2525
2535
|
continue;
|
|
@@ -2998,7 +3008,7 @@ function emitSwitch(node, ipdom, scope, ctx, stop, refInto) {
|
|
|
2998
3008
|
? `, ${armCb('d', forkRegion(portEdges(ctx.graph, node.id, 'default'), r, scope, ipdom, ctx, refInto))}`
|
|
2999
3009
|
: '';
|
|
3000
3010
|
const caseList = `[\n${caseSrcs.map((c) => reindent(c, ' ')).join(',\n')},\n]`;
|
|
3001
|
-
const ver =
|
|
3011
|
+
const ver = forkOptsArg(node);
|
|
3002
3012
|
return `.switch(${tsLiteral(node.id)}, ${on}, ${caseList}${defArm}${ver && !defArm ? ', undefined' : ''}${ver})`;
|
|
3003
3013
|
}
|
|
3004
3014
|
/**
|
package/dist/merge.js
CHANGED
|
@@ -96,18 +96,30 @@ function byId(nodes) {
|
|
|
96
96
|
return new Map((nodes ?? []).map((n) => [n.id, n]));
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
* Whether two nodes are the SAME as far as the author is concerned — same type
|
|
100
|
-
* and same
|
|
101
|
-
* `outputs`
|
|
102
|
-
*
|
|
103
|
-
*
|
|
99
|
+
* Whether two nodes are the SAME as far as the author is concerned — same type,
|
|
100
|
+
* same inputs and same output mappings. Layout (`ui`), `display`, `typeVersion`,
|
|
101
|
+
* and the derived parts of `outputs` (type, schema, description) are ignored,
|
|
102
|
+
* because those are exactly the parts decompile does not carry through. An
|
|
103
|
+
* output's `source` is authored, not derived: it is what an End returns, so an
|
|
104
|
+
* edit to `.return({ ... })` changes nothing else on the node. Used only to
|
|
105
|
+
* decide "did the user edit this node?" against the baseline.
|
|
104
106
|
*/
|
|
105
107
|
function nodeUnchanged(a, b) {
|
|
106
108
|
if (!a || !b)
|
|
107
109
|
return false;
|
|
108
110
|
if (a.type !== b.type)
|
|
109
111
|
return false;
|
|
110
|
-
return JSON.stringify(a.inputs ?? {}) === JSON.stringify(b.inputs ?? {})
|
|
112
|
+
return JSON.stringify(a.inputs ?? {}) === JSON.stringify(b.inputs ?? {})
|
|
113
|
+
&& JSON.stringify(outputSources(a)) === JSON.stringify(outputSources(b));
|
|
114
|
+
}
|
|
115
|
+
/** Each output's `source` by output name; outputs without one are left out. */
|
|
116
|
+
function outputSources(n) {
|
|
117
|
+
const sources = {};
|
|
118
|
+
for (const [name, output] of Object.entries(n.outputs ?? {})) {
|
|
119
|
+
if (output && typeof output === 'object' && 'source' in output)
|
|
120
|
+
sources[name] = output.source;
|
|
121
|
+
}
|
|
122
|
+
return sources;
|
|
111
123
|
}
|
|
112
124
|
/**
|
|
113
125
|
* The ids of the root nodes {@link mergeFlow} takes from `edited` rather than
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.35.
|
|
3
|
+
"version": "6.35.1",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"@types/node": "^22.7.0",
|
|
94
94
|
"esbuild": "^0.28.1"
|
|
95
95
|
},
|
|
96
|
-
"gitref": "
|
|
96
|
+
"gitref": "cd7797fa2a6443158edfc8920b2e764e34ac6e71"
|
|
97
97
|
}
|