@uipath/maestro-builder-sdk 6.86.17 → 6.86.19

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.
@@ -1354,12 +1354,6 @@ function outputTargetOf(row) {
1354
1354
  return 'originalVar';
1355
1355
  return undefined;
1356
1356
  }
1357
- /**
1358
- * Fields of a resource io row that change what the plan does and that no
1359
- * builder call writes, so decompile refuses them by name rather than carry
1360
- * them. `renamed` makes the platform name the output after its `displayName`.
1361
- */
1362
- const RESOURCE_ROW_REFUSED = new Set(['renamed']);
1363
1357
  /**
1364
1358
  * What a resource task's (process, agent, rpa, API workflow, ...) io row needs
1365
1359
  * beyond what compile writes, recorded in its identity:
@@ -1367,7 +1361,10 @@ const RESOURCE_ROW_REFUSED = new Set(['renamed']);
1367
1361
  * - `fields`: the Case Designer's copy of the resource parameter's definition,
1368
1362
  * which no builder call writes and nothing reads to run the case:
1369
1363
  * `displayName`, `title`, `description`, `body` and its `_jsonSchema` copy,
1370
- * `subType`, `items`, schema keywords (`format`, `minimum`, `enum`, ...).
1364
+ * `subType`, `items`, schema keywords (`format`, `minimum`, `enum`, ...),
1365
+ * and `renamed: true`, the Designer's mark that the author renamed the
1366
+ * output's variable label (its variable picker then lists the output under
1367
+ * its `displayName`; the row's `var` still names what it writes).
1371
1368
  * For example `{ displayName: 'echoIn', title: 'echoIn' }`.
1372
1369
  * - `omit: ['target']`: an extract the Designer saved with no `target`
1373
1370
  * (compile writes `target: "=<id>"` on every extract).
@@ -1382,8 +1379,11 @@ function resourceRowShape(task, row, side) {
1382
1379
  const written = side === 'inputs' ? RESOURCE_INPUT_WRITTEN : RESOURCE_OUTPUT_WRITTEN;
1383
1380
  const fields = {};
1384
1381
  for (const [key, value] of Object.entries(row)) {
1385
- if (RESOURCE_ROW_REFUSED.has(key))
1386
- throw new Error(`${task.type} task "${task.displayName ?? task.id ?? '?'}" ${side === 'inputs' ? 'input' : 'output'} "${row.name ?? '?'}" has unsupported field "${key}".`);
1382
+ // `renamed` marks an output whose variable label the author renamed. An
1383
+ // input has no variable to rename, so the flag means nothing the Designer
1384
+ // writes there, and it is refused by name rather than carried.
1385
+ if (key === 'renamed' && side === 'inputs')
1386
+ throw new Error(`${task.type} task "${task.displayName ?? task.id ?? '?'}" input "${row.name ?? '?'}" has unsupported field "renamed".`);
1387
1387
  // An input `required` / `default` `.inputs()` cannot type (`required: "true"`, an object default) is carried.
1388
1388
  if ((key === 'default' || key === 'required') && side === 'inputs' && !isTypedInputField(key, value))
1389
1389
  fields[key] = value;
@@ -2739,6 +2739,13 @@ export function collectPreservation(plan) {
2739
2739
  fields.default = row.default;
2740
2740
  if (lane === 'outputs' && row.var !== undefined)
2741
2741
  fields.var = row.var;
2742
+ // `body` is typed only on a structured (`jsonSchema`) variable. On any
2743
+ // other row it is the schema the Designer generated for the type (for a
2744
+ // `file`, the job attachment's `{ ID, FullName, MimeType, Metadata }`),
2745
+ // which compile does not write, so it is carried verbatim, with the type
2746
+ // it describes (`bodyType`): compile drops it once the type changes.
2747
+ if (row.type !== 'jsonSchema' && row.body !== undefined)
2748
+ Object.assign(fields, { body: row.body, bodyType: row.type });
2742
2749
  if (Object.keys(fields).length)
2743
2750
  byName[row.name] = fields;
2744
2751
  if (row.default !== undefined && typeof row.default !== 'string')
@@ -276,17 +276,23 @@ export function caseJsonPreservationErrors(payload) {
276
276
  errors.push(`variable lane "${lane}" is not recognized`);
277
277
  continue;
278
278
  }
279
+ // A carried `body` names the non-structured type it was saved for.
280
+ for (const [name, fields] of Object.entries(rows ?? {}))
281
+ if (fields.body !== undefined && (typeof fields.bodyType !== 'string' || fields.bodyType === 'jsonSchema'))
282
+ errors.push(`variable "${name}" carried body needs the non-jsonSchema type it was saved for (bodyType)`);
279
283
  for (const [name, fields] of Object.entries(rows ?? {}))
280
284
  for (const field of Object.keys(fields))
281
285
  if (lane === 'inputOutputs' && field === 'value')
282
286
  errors.push(`variable "${name}" field "value" on inputOutputs is behavior (a process mapping's var) and cannot be preserved`);
283
287
  else if (!PRESERVED_VARIABLE_KEYS.has(field)
284
288
  && !(lane === 'inputOutputs' && (field === 'default' || field === 'custom'))
285
- && !(lane === 'outputs' && field === 'var'))
289
+ && !(lane === 'outputs' && field === 'var')
290
+ && field !== 'body' && field !== 'bodyType')
286
291
  errors.push(`variable "${name}" field "${field}" is not an allowed preserved designer field`);
287
292
  else if (VARIABLE_KEYS.has(field)
288
293
  && !(lane === 'inputOutputs' && field === 'default')
289
- && !(lane === 'outputs' && field === 'var'))
294
+ && !(lane === 'outputs' && field === 'var')
295
+ && field !== 'body')
290
296
  errors.push(`variable "${name}" field "${field}" is owned by the typed Case serializer`);
291
297
  }
292
298
  for (const lane of payload.variableLanes ?? [])
@@ -629,8 +629,16 @@ export function applyPreservation(result, preservation, options = {}) {
629
629
  if (!row)
630
630
  throw new CompileRefusal('PRESERVATION_TARGET_MISSING', `preserved variable "${name}" was not regenerated in variables.${lane}.`);
631
631
  for (const [field, value] of Object.entries(fields)) {
632
+ // `bodyType` is the type a carried `body` was saved for, not a field.
633
+ if (field === 'bodyType')
634
+ continue;
632
635
  if (row[field] === value)
633
636
  continue;
637
+ // A carried `body` describes the type it was saved with. A variable the
638
+ // edit gave another type (a `string`, or a `jsonSchema` with the schema
639
+ // the author typed) does not get it.
640
+ if (field === 'body' && row.type !== fields.bodyType)
641
+ continue;
634
642
  if (!options.overwrite && Object.prototype.hasOwnProperty.call(row, field))
635
643
  throw new CompileRefusal('PRESERVATION_FIELD_COLLISION', `preserved variable "${name}" field "${field}" collides with serializer-owned output.`);
636
644
  row[field] = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.86.17",
3
+ "version": "6.86.19",
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": "21bd42bbb7051e1a78361d7669405d25d2294dbe"
106
+ "gitref": "b5c4c83fdc2104407f0c15ecdfb279a0a567b063"
107
107
  }