@uipath/maestro-builder-sdk 6.120.22 → 6.120.23

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.
@@ -70,8 +70,13 @@ export declare function savedConnectorRows(owner: string, bag: Record<string, an
70
70
  * could still disagree (a root companion added after this call), this one says
71
71
  * the rows diverge, so the id stays held: a dropped row then keeps its id
72
72
  * unused, but no two rows hold one.
73
+ *
74
+ * `finalVar` reads a built row's variable as it will be once the claims made so
75
+ * far are applied. A claim moves a row's id at once and its `var` later, so
76
+ * the built `Error` row `{ id: 'error15', var: 'Error11' }` that took its saved
77
+ * id still writes `error15`, the saved row's variable, and does not diverge.
73
78
  */
74
- export declare function droppedConnectorOutputRows(result: Record<string, any>, entries: readonly PreservedConnectorRows[] | undefined): Array<Record<string, unknown>>;
79
+ export declare function droppedConnectorOutputRows(result: Record<string, any>, entries: readonly PreservedConnectorRows[] | undefined, finalVar?: (row: Record<string, unknown>) => unknown): Array<Record<string, unknown>>;
75
80
  /**
76
81
  * Write each element's saved own rows back over the ones compile built, half
77
82
  * by half, while they still describe the element. Runs after the ids are
@@ -432,8 +432,13 @@ function inputsBack(built, set) {
432
432
  * could still disagree (a root companion added after this call), this one says
433
433
  * the rows diverge, so the id stays held: a dropped row then keeps its id
434
434
  * unused, but no two rows hold one.
435
+ *
436
+ * `finalVar` reads a built row's variable as it will be once the claims made so
437
+ * far are applied. A claim moves a row's id at once and its `var` later, so
438
+ * the built `Error` row `{ id: 'error15', var: 'Error11' }` that took its saved
439
+ * id still writes `error15`, the saved row's variable, and does not diverge.
435
440
  */
436
- export function droppedConnectorOutputRows(result, entries) {
441
+ export function droppedConnectorOutputRows(result, entries, finalVar = (row) => row.var) {
437
442
  if (!entries?.length)
438
443
  return [];
439
444
  const byOwner = new Map(entries.map((entry) => [entry.owner, entry]));
@@ -443,7 +448,9 @@ export function droppedConnectorOutputRows(result, entries) {
443
448
  const entry = byOwner.get(key);
444
449
  if (!entry?.outputs || !sameOperation(bag, entry) || !Array.isArray(bag.outputs))
445
450
  continue;
446
- if (outputsDiverge(bag.outputs.filter(isOwnOutput), entry.outputs, caseVariables))
451
+ // Each built own row as it will read once its queued renames run.
452
+ const builtOwn = bag.outputs.filter(isOwnOutput).map((row) => ({ ...row, var: finalVar(row) }));
453
+ if (outputsDiverge(builtOwn, entry.outputs, caseVariables))
447
454
  continue;
448
455
  const saved = new Set(entry.outputs.rows.map((row) => row.source));
449
456
  for (const row of bag.outputs)
@@ -1479,11 +1479,27 @@ function applyPreservedIdentities(result, preservation, warn) {
1479
1479
  const rowRenames = [];
1480
1480
  // Output `target` spellings (`carryRowShape`), applied once every row id is final.
1481
1481
  const targetSpellings = [];
1482
+ // The variable renames `takeRow` has queued per row, in order: the row's id
1483
+ // moves at once, its `var` only when `rowRenames` run. `finalVar` reads a
1484
+ // row's variable as it will be then, for checks made before.
1485
+ const pendingVarRenames = new WeakMap();
1486
+ const finalVar = (row) => {
1487
+ let variable = row.var;
1488
+ for (const [was, wanted] of pendingVarRenames.get(row) ?? [])
1489
+ if (variable === was)
1490
+ variable = wanted;
1491
+ return variable;
1492
+ };
1482
1493
  const takeRow = (row, wanted, output) => {
1483
1494
  if (!row || !wanted || typeof row.id !== 'string' || row.id === wanted)
1484
1495
  return;
1485
1496
  const was = row.id;
1486
1497
  row.id = wanted;
1498
+ const queued = pendingVarRenames.get(row);
1499
+ if (queued)
1500
+ queued.push([was, wanted]);
1501
+ else
1502
+ pendingVarRenames.set(row, [[was, wanted]]);
1487
1503
  rowRenames.push(() => {
1488
1504
  if (row.var === was)
1489
1505
  row.var = wanted;
@@ -1941,7 +1957,9 @@ function applyPreservedIdentities(result, preservation, warn) {
1941
1957
  // (`applyConnectorRows`), so its id is free for a saved row that carries it.
1942
1958
  // Example: a connector task saved with only its `Error` row compiles with a
1943
1959
  // `response11` row too; the task saved with `response11` takes it back.
1944
- for (const row of droppedConnectorOutputRows(result, preservation.connectorRows))
1960
+ // The rows' variables are read as `rowRenames` will leave them: a built
1961
+ // `Error11` row that took its saved id `error15` writes `error15`.
1962
+ for (const row of droppedConnectorOutputRows(result, preservation.connectorRows, finalVar))
1945
1963
  if (typeof row.id === 'string')
1946
1964
  heldOutputIds.delete(row.id);
1947
1965
  settleDeferredClaims(deferredClaims, heldOutputIds, (target, row) => claimRowId(target, row, target.id));
package/dist/decompile.js CHANGED
@@ -1047,8 +1047,13 @@ function resolveTemplateBindings(def, node) {
1047
1047
  }
1048
1048
  /** Best-effort placeholder for a node type the reverse-map does not yet cover. */
1049
1049
  function unsupportedSpec(node, imp, o) {
1050
- // The file's own definition for this node — the manifest the platform served.
1051
- const def = runDefs.get(`${node.type}@${node.typeVersion}`) ?? runDefs.get(node.type);
1050
+ // The file's own definition for this node — the manifest the platform served —
1051
+ // else the SDK's bundled core definition at the node's exact version, as
1052
+ // `definitionLabel` reads it. A file that carries no `definitions[]` (an older
1053
+ // save) still names a core type this SDK ships, so it stays a rawNode of
1054
+ // that type instead of becoming a mock.
1055
+ const key = `${node.type}@${node.typeVersion}`;
1056
+ const def = runDefs.get(key) ?? BUNDLED_DEFINITIONS[key] ?? runDefs.get(node.type);
1052
1057
  if (def !== undefined) {
1053
1058
  // A node type this SDK has no factory for is still expressible: `rawNode`
1054
1059
  // carries the definition verbatim, so the node keeps its TYPE, its VERSION
@@ -2192,15 +2197,16 @@ function region(cursor, stop, scope, ipdom, ctx, refInto) {
2192
2197
  cursor = fork.next.cursor;
2193
2198
  continue;
2194
2199
  }
2195
- // A merge node with one edge in and at most one out is a pass-through
2196
- // (or a dead end) the designer left in place (a join whose arms were
2197
- // later removed). The layout names it, so it is kept: it falls through
2198
- // to the regular step path below and comes back as the raw node of its
2199
- // own definition (#1310). Skipping it dropped the node, and compile then
2200
- // refused the `.layout()` key. A bare merge with several edges in (a
2201
- // join whose fork was not detected) is still skipped — best effort.
2202
- const ins = ctx.graph.inEdges(node.id).filter((e) => scope.has(e.sourceNodeId));
2203
- if (outs.length > 1 || ins.length !== 1) {
2200
+ // Any other merge node with at most one `output` edge is a step on the
2201
+ // path: a pass-through or a dead end the designer left in place (#1310),
2202
+ // or the join of a `.branch` / `.switch` whose arms the designer drew
2203
+ // back together through it. It falls through to the regular step path
2204
+ // below and comes back as the raw node of its own definition; serialize
2205
+ // wires every arm tail into it, so each in-edge comes back too. Skipping
2206
+ // it dropped the node and rewired its in-edges straight to its
2207
+ // successor. Only a merge with several outs that no `.parallel` spells
2208
+ // (no joinable ipdom) is still skipped — best effort.
2209
+ if (outs.length > 1) {
2204
2210
  const next = continueOn(node, 'output', ctx, refInto);
2205
2211
  if (next.brk || next.cont) {
2206
2212
  segs.push(next.brk ? '.break()' : '.continue()');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.120.22",
3
+ "version": "6.120.23",
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",
@@ -124,5 +124,5 @@
124
124
  "@types/node": "^22.7.0",
125
125
  "esbuild": "^0.28.1"
126
126
  },
127
- "gitref": "3631ba8b929fc9aa1c002841bb812003ee4c4d74"
127
+ "gitref": "e45eca9991259b8d4d10fede3a8c1c2e67ed6d0a"
128
128
  }