@uipath/maestro-builder-sdk 6.86.7 → 6.86.8

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.
@@ -2107,6 +2107,20 @@ function emptyLists(owner, fields) {
2107
2107
  function variableShape(row) {
2108
2108
  return row.type === 'jsonSchema' && row.body !== undefined && row._jsonSchema === undefined ? { omit: ['_jsonSchema'] } : {};
2109
2109
  }
2110
+ /**
2111
+ * A custom (`{ assign }`) output row's label, when it is not the name of the
2112
+ * variable it assigns. Compile labels the row with the variable
2113
+ * (`name: 'caseOutcome'`), as the Designer does by default; a Designer row can
2114
+ * carry another label (`{ name: 'caseOutcomeDenied', var: 'caseOutcome' }`).
2115
+ * The label is display only: the row writes `var`. Recorded as `{ name:
2116
+ * 'caseOutcomeDenied', var: 'caseOutcome', custom: true }`.
2117
+ */
2118
+ function customRowLabel(row, plan) {
2119
+ if (row.custom !== true || typeof row.var !== 'string' || typeof row.name !== 'string')
2120
+ return {};
2121
+ const variable = (plan.variables?.inputOutputs ?? []).find((entry) => entry.id === row.var);
2122
+ return row.name === (variable?.name ?? row.var) ? {} : { var: row.var, custom: true };
2123
+ }
2110
2124
  function identityPreservation(plan) {
2111
2125
  return {
2112
2126
  ...(plan.id ? { id: plan.id } : {}),
@@ -2126,6 +2140,7 @@ function identityPreservation(plan) {
2126
2140
  outputs: (task.data?.outputs ?? []).map((row) => ({
2127
2141
  name: row.name ?? '',
2128
2142
  ...(row.id ? { id: row.id } : {}),
2143
+ ...customRowLabel(row, plan),
2129
2144
  // A form output's `originalVar` when the Designer spelled it as the variable, not the slot id.
2130
2145
  ...(task.type === 'action' && typeof row.originalVar === 'string' && row.originalVar !== row.id
2131
2146
  ? { originalVar: row.originalVar } : {}),
@@ -189,6 +189,7 @@ interface StageIdentity {
189
189
  fields?: Record<string, unknown>;
190
190
  }>;
191
191
  /** `originalVar` only when it is not the row's `id` (the serializer's own spelling). `elementId` when an action form output names another element than its task. `fields` as on an input. `omit`: the fields an action form output (`target`, `_jsonSchema`, `elementId`) or a resource extract (`target`) was saved without that compile writes. */
192
+ /** `var` and `custom: true`: a custom row whose label (`name`) is not the name of the variable it assigns. */
192
193
  outputs?: Array<{
193
194
  name: string;
194
195
  id?: string;
@@ -196,6 +197,8 @@ interface StageIdentity {
196
197
  elementId?: string;
197
198
  fields?: Record<string, unknown>;
198
199
  omit?: string[];
200
+ var?: string;
201
+ custom?: true;
199
202
  }>;
200
203
  /** The io lists a resource task saved empty (`inputs: []`), which compile writes only when it binds a row. */
201
204
  emptyIo?: Array<'inputs' | 'outputs'>;
@@ -1298,6 +1298,18 @@ function applyPreservedIdentities(result, preservation) {
1298
1298
  // field compile writes: a resource extract without its task's `elementId`
1299
1299
  // is one the converter never reads (#1419).
1300
1300
  const takeOutputRows = (outputRows, wantedRows, actionRows = false) => {
1301
+ // A custom row's own label goes back on the one custom row that still
1302
+ // assigns its variable (matched once every id is final).
1303
+ for (const row of wantedRows)
1304
+ if (row.custom === true && typeof row.var === 'string') {
1305
+ const label = row.name;
1306
+ const variable = row.var;
1307
+ rowRenames.push(() => {
1308
+ const holders = outputRows.filter((candidate) => candidate?.custom === true && candidate.var === variable);
1309
+ if (holders.length === 1 && wantedRows.filter((other) => other.custom === true && other.var === variable).length === 1)
1310
+ holders[0].name = label;
1311
+ });
1312
+ }
1301
1313
  // Match by name when unique on both sides, else by position.
1302
1314
  const unique = (names, name) => names.filter((n) => n === name).length === 1;
1303
1315
  const currentNames = outputRows.map((r) => r?.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.86.7",
3
+ "version": "6.86.8",
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",
@@ -103,5 +103,5 @@
103
103
  "@types/node": "^22.7.0",
104
104
  "esbuild": "^0.28.1"
105
105
  },
106
- "gitref": "0a4dddd7aa5cb592cb1a9a15ef0c9a483859c6b2"
106
+ "gitref": "a0113ad6c8144e78d2bb8b9b33cb3c0e814fc51b"
107
107
  }