@uipath/maestro-builder-sdk 6.30.1 → 6.30.3

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/serialize.js CHANGED
@@ -4371,6 +4371,8 @@ export function serialize(built, opts = {}) {
4371
4371
  // anything else: the root trigger's id is fixed, so a step named `start` must
4372
4372
  // be renamed rather than silently collide with it.
4373
4373
  const takenIds = new Set([built.triggerId ?? 'start']);
4374
+ /** Per scope, each named `.return` End emitted so far and its content. */
4375
+ const namedEnds = new Map();
4374
4376
  let edgeSeq = 0;
4375
4377
  /** Claim a globally unique node id, honouring the scope's rename map. */
4376
4378
  function uid(scope, base) {
@@ -6474,7 +6476,7 @@ export function serialize(built, opts = {}) {
6474
6476
  // `name` is the End's identity — `layout` keys on it and a decompiled
6475
6477
  // source must be able to ask for the id the original file had, or the
6476
6478
  // round trip cannot reproduce its own layout block (ReturnOptions.name).
6477
- const id = uid(scope, step.options?.name ?? 'end');
6479
+ const name = step.options?.name;
6478
6480
  const explicit = {};
6479
6481
  const updates = [];
6480
6482
  for (const [name, expr] of Object.entries(step.values)) {
@@ -6489,7 +6491,6 @@ export function serialize(built, opts = {}) {
6489
6491
  if (!scope.outputType.has(name))
6490
6492
  updates.push({ variableId: name, expression: src });
6491
6493
  }
6492
- emitEnd(scope, id, tails, { label: step.options?.label, parentId, requestedVersion: step.options?.version, explicit });
6493
6494
  const extra = step.options?.updates ?? {};
6494
6495
  for (const name of Object.keys(extra)) {
6495
6496
  if (name in step.values) {
@@ -6497,8 +6498,24 @@ export function serialize(built, opts = {}) {
6497
6498
  }
6498
6499
  }
6499
6500
  updates.push(...renderUpdates(extra, scope.rename));
6500
- if (updates.length)
6501
- scope.variableUpdates[id] = updates;
6501
+ // Decompile writes one `.return` per path into an End that several paths
6502
+ // share, so a repeat of an earlier named End in this scope, with the same
6503
+ // content, is that End reached again rather than a second one.
6504
+ const sig = JSON.stringify([parentId ?? null, step.options?.label ?? null, step.options?.version ?? null, explicit, updates]);
6505
+ const prior = name === undefined ? undefined : namedEnds.get(scope)?.get(name);
6506
+ if (prior?.sig === sig) {
6507
+ for (const t of tails)
6508
+ addEdge(scope, t, prior.id);
6509
+ }
6510
+ else {
6511
+ const id = uid(scope, name ?? 'end');
6512
+ emitEnd(scope, id, tails, { label: step.options?.label, parentId, requestedVersion: step.options?.version, explicit });
6513
+ if (updates.length)
6514
+ scope.variableUpdates[id] = updates;
6515
+ if (name !== undefined && !prior) {
6516
+ (namedEnds.get(scope) ?? namedEnds.set(scope, new Map()).get(scope)).set(name, { id, sig });
6517
+ }
6518
+ }
6502
6519
  tails = [];
6503
6520
  }
6504
6521
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.30.1",
3
+ "version": "6.30.3",
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",
@@ -92,5 +92,5 @@
92
92
  "@types/node": "^22.7.0",
93
93
  "esbuild": "^0.28.1"
94
94
  },
95
- "gitref": "07dd8e31058cf19c3db3a504b6e2bbb56cf980d2"
95
+ "gitref": "cdac1f9944a11065ba6cc13061a0873f53683358"
96
96
  }