@uipath/maestro-builder-sdk 6.86.20 → 6.86.21

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.
@@ -16,6 +16,8 @@ interface IoRow {
16
16
  _jsonSchema?: unknown;
17
17
  /** A third copy of an action form output's `body` the Designer can save. */
18
18
  jsonSchema?: unknown;
19
+ /** The readable alias `@uipath/case-schema`'s id migration stamps on a row. */
20
+ canonicalId?: string;
19
21
  custom?: boolean;
20
22
  elementId?: string;
21
23
  var?: string;
@@ -731,8 +731,10 @@ const ACTION_DATA_KEYS = new Set([
731
731
  */
732
732
  const ACTION_INPUT_ROW_KEYS = new Set([
733
733
  'name', 'type', 'subType', 'displayName', 'value', 'required', 'options', 'body', 'source', 'id', 'var', 'elementId',
734
+ 'canonicalId',
734
735
  ]);
735
- const ACTION_OUTPUT_ROW_KEYS = new Set([...ACTION_INPUT_ROW_KEYS, 'target', 'originalVar', '_jsonSchema', 'jsonSchema']);
736
+ const ACTION_OUTPUT_ROW_KEYS = new Set([...ACTION_INPUT_ROW_KEYS, 'target', 'originalVar', '_jsonSchema', 'jsonSchema']
737
+ .filter((key) => key !== 'canonicalId'));
736
738
  function actionFields(rows, side, owner) {
737
739
  if (!rows?.length)
738
740
  return undefined;
@@ -743,6 +745,12 @@ function actionFields(rows, side, owner) {
743
745
  throw new Error(`${owner} form ${side} "${row.name ?? '?'}" has unsupported field "${unknown}".`);
744
746
  // The key names alone are not enough: compile rewrites these from the
745
747
  // row's id and value, so a row whose values differ would change silently.
748
+ // `canonicalId` is the readable alias `@uipath/case-schema`'s id migration
749
+ // stamps on a row (and then skips it on); it is carried only as a copy of
750
+ // the id (`actionInputShape`), since any other value renames how the
751
+ // Designer spells references to the row.
752
+ if (side === 'input' && row.canonicalId !== undefined && (row.id === undefined || row.canonicalId !== row.id))
753
+ throw new Error(`${owner} form input "${row.name ?? '?'}" has canonicalId "${String(row.canonicalId)}", which is not its id.`);
746
754
  if (row.var !== undefined && side === 'input' && row.var !== row.id)
747
755
  throw new Error(`${owner} form input "${row.name ?? '?'}" has var "${String(row.var)}", which is not its id; compile writes var as the id.`);
748
756
  if (side === 'output' && row.var !== undefined && row.var !== row.value)
@@ -2206,9 +2214,13 @@ function prunePreservation(preservation, plan) {
2206
2214
  * `elementId` that is not the task's is carried.
2207
2215
  */
2208
2216
  function actionInputShape(task, row) {
2209
- if (task.type !== 'action' || !row.id || row.elementId === undefined || row.elementId === task.elementId)
2217
+ if (task.type !== 'action' || !row.id)
2210
2218
  return {};
2211
- return { elementId: row.elementId };
2219
+ return {
2220
+ ...(row.elementId !== undefined && row.elementId !== task.elementId ? { elementId: row.elementId } : {}),
2221
+ // `actionFields` has checked it is a copy of the id.
2222
+ ...(row.canonicalId !== undefined ? { canonicalId: true } : {}),
2223
+ };
2212
2224
  }
2213
2225
  /**
2214
2226
  * What an action form output row has that compile would not write the same
@@ -181,11 +181,12 @@ interface StageIdentity {
181
181
  entryConditions?: ConditionIdentity[];
182
182
  /** The resource the rows' `fields` / `omit` describe; they are applied only while the task still names it. */
183
183
  resource?: ResourceTaskIdentity;
184
- /** `elementId` only for an action form input whose row names another element than its task. `fields`: a resource task row's Designer fields compile does not write (`displayName`, `title`, `body`, ...). */
184
+ /** `elementId` only for an action form input whose row names another element than its task. `canonicalId: true`: an action form input saved with the schema migration's `canonicalId`, a copy of its id. `fields`: a resource task row's Designer fields compile does not write (`displayName`, `title`, `body`, ...). */
185
185
  inputs?: Array<{
186
186
  name: string;
187
187
  id?: string;
188
188
  elementId?: string;
189
+ canonicalId?: true;
189
190
  fields?: Record<string, unknown>;
190
191
  }>;
191
192
  /** `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. `target`: which of the row's variables its saved `target` names when that is not its id (`=<var>` or `=<originalVar>`; compile writes `=<id>`). `bodyCopies`: the extra copies of its `body` an action form output was saved with (`jsonSchema`), which compile writes back from the body. */
@@ -1538,6 +1538,10 @@ function applyPreservedIdentities(result, preservation) {
1538
1538
  Object.assign(input, { id: row.id, var: row.id, elementId: row.elementId ?? task.elementId });
1539
1539
  if (input.elementId === undefined)
1540
1540
  delete input.elementId;
1541
+ // The schema migration's readable alias of the id, which it stamps
1542
+ // once and then skips the row on: the same id again.
1543
+ if (row.canonicalId === true)
1544
+ input.canonicalId = row.id;
1541
1545
  return;
1542
1546
  }
1543
1547
  takeRow(input, row.id, false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.86.20",
3
+ "version": "6.86.21",
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": "e802da118b3c4f36c932a0e15950c80cf88b7c14"
106
+ "gitref": "e0ee81ffb8c846fe651e90f1d0e2d879ccde3306"
107
107
  }