@uipath/maestro-builder-sdk 6.93.5 → 6.93.6
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/case/decompile.js +10 -1
- package/dist/case/preserve.d.ts +3 -0
- package/dist/case/preserve.js +5 -1
- package/dist/case/serialize.js +10 -3
- package/package.json +2 -2
package/dist/case/decompile.js
CHANGED
|
@@ -2923,6 +2923,14 @@ export function collectPreservation(plan) {
|
|
|
2923
2923
|
...(row.elementId === 'root' || (elementIds ??= planElementIds(plan)).has(row.elementId) ? {} : { elementIdUnresolved: true }),
|
|
2924
2924
|
});
|
|
2925
2925
|
}
|
|
2926
|
+
// An In-arg's companion is written with no default (the arg's own default
|
|
2927
|
+
// is on its formal slot), so a default the plan saved on the companion,
|
|
2928
|
+
// `0` beside an In-arg defaulting to `1` say, is carried as it is, with the
|
|
2929
|
+
// In-arg's type (`inArgType`): compile applies it only while the row is
|
|
2930
|
+
// still the companion of an In-arg of that type.
|
|
2931
|
+
const formalInput = (plan.variables?.inputs ?? []).find((candidate) => candidate.name === row.name);
|
|
2932
|
+
if (lane === 'inputOutputs' && formalInput && typeof formalInput.type === 'string' && row.default !== undefined && !('default' in fields))
|
|
2933
|
+
Object.assign(fields, { default: row.default, inArgType: formalInput.type });
|
|
2926
2934
|
if (lane === 'outputs' && row.var !== undefined)
|
|
2927
2935
|
fields.var = row.var;
|
|
2928
2936
|
// `body` is typed only on a structured (`jsonSchema`) variable. On any
|
|
@@ -2934,7 +2942,8 @@ export function collectPreservation(plan) {
|
|
|
2934
2942
|
Object.assign(fields, { body: row.body, bodyType: row.type });
|
|
2935
2943
|
if (Object.keys(fields).length)
|
|
2936
2944
|
byName[row.name] = fields;
|
|
2937
|
-
|
|
2945
|
+
// A default carried verbatim above needs no legacy (non-string) spelling.
|
|
2946
|
+
if (row.default !== undefined && typeof row.default !== 'string' && !('default' in fields))
|
|
2938
2947
|
defaultsByName[row.name] = row.default;
|
|
2939
2948
|
}
|
|
2940
2949
|
if (Object.keys(byName).length)
|
package/dist/case/preserve.d.ts
CHANGED
|
@@ -374,6 +374,9 @@ export interface CaseJsonPreservation {
|
|
|
374
374
|
* also put back only while it is `root` or names an element of the plan
|
|
375
375
|
* (`planElementIds`), unless it named none when saved
|
|
376
376
|
* (`elementIdUnresolved`): an edit that deletes that element gets `root`.
|
|
377
|
+
* On an `inputOutputs` row, a `default` with `inArgType` is an In-arg companion's
|
|
378
|
+
* saved default: compile applies it only while `variables.inputs` still has
|
|
379
|
+
* an In-arg of that name and type, and skips it otherwise.
|
|
377
380
|
*/
|
|
378
381
|
variableFields?: Partial<Record<PreservedVariableLane, Record<string, Record<string, unknown>>>>;
|
|
379
382
|
/**
|
package/dist/case/preserve.js
CHANGED
|
@@ -307,12 +307,16 @@ export function caseJsonPreservationErrors(payload) {
|
|
|
307
307
|
for (const [name, fields] of Object.entries(rows ?? {}))
|
|
308
308
|
if (fields.body !== undefined && (typeof fields.bodyType !== 'string' || fields.bodyType === 'jsonSchema'))
|
|
309
309
|
errors.push(`variable "${name}" carried body needs the non-jsonSchema type it was saved for (bodyType)`);
|
|
310
|
+
// A carried In-arg companion default names the In-arg type it was saved beside.
|
|
311
|
+
for (const [name, fields] of Object.entries(rows ?? {}))
|
|
312
|
+
if (fields.inArgType !== undefined && (lane !== 'inputOutputs' || typeof fields.inArgType !== 'string' || fields.inArgType === '' || fields.default === undefined))
|
|
313
|
+
errors.push(`variable "${name}" carried inArgType must be a non-empty string beside a default on inputOutputs`);
|
|
310
314
|
for (const [name, fields] of Object.entries(rows ?? {}))
|
|
311
315
|
for (const field of Object.keys(fields))
|
|
312
316
|
if (lane === 'inputOutputs' && field === 'value')
|
|
313
317
|
errors.push(`variable "${name}" field "value" on inputOutputs is behavior (a process mapping's var) and cannot be preserved`);
|
|
314
318
|
else if (!PRESERVED_VARIABLE_KEYS.has(field)
|
|
315
|
-
&& !(lane === 'inputOutputs' && (field === 'default' || field === 'custom' || field === 'elementId' || field === 'writtenElementId' || field === 'elementIdUnresolved'))
|
|
319
|
+
&& !(lane === 'inputOutputs' && (field === 'default' || field === 'custom' || field === 'elementId' || field === 'writtenElementId' || field === 'elementIdUnresolved' || field === 'inArgType'))
|
|
316
320
|
&& !(lane === 'outputs' && field === 'var')
|
|
317
321
|
&& field !== 'body' && field !== 'bodyType')
|
|
318
322
|
errors.push(`variable "${name}" field "${field}" is not an allowed preserved designer field`);
|
package/dist/case/serialize.js
CHANGED
|
@@ -627,7 +627,13 @@ export function applyPreservation(result, preservation, options = {}) {
|
|
|
627
627
|
let elementIds;
|
|
628
628
|
for (const [lane, byName] of Object.entries(preservation.variableFields ?? {})) {
|
|
629
629
|
const rows = variables[lane] ?? [];
|
|
630
|
-
for (const [name,
|
|
630
|
+
for (const [name, saved] of Object.entries(byName ?? {})) {
|
|
631
|
+
// An In-arg companion's saved default (`inArgType`) applies only while
|
|
632
|
+
// the plan still has an In-arg of that name and type: renamed, deleted,
|
|
633
|
+
// made a `.var()` or retyped, the row keeps what compile wrote.
|
|
634
|
+
const staleInArgDefault = saved.inArgType !== undefined
|
|
635
|
+
&& !(variables.inputs ?? []).some((input) => input.name === name && input.type === saved.inArgType);
|
|
636
|
+
const fields = staleInArgDefault ? Object.fromEntries(Object.entries(saved).filter(([field]) => field !== 'default' && field !== 'inArgType')) : saved;
|
|
631
637
|
const row = rows.find((candidate) => candidate.name === name);
|
|
632
638
|
if (!row && options.overwrite)
|
|
633
639
|
continue;
|
|
@@ -639,8 +645,9 @@ export function applyPreservation(result, preservation, options = {}) {
|
|
|
639
645
|
if (!row)
|
|
640
646
|
throw new CompileRefusal('PRESERVATION_TARGET_MISSING', `preserved variable "${name}" was not regenerated in variables.${lane}.`);
|
|
641
647
|
for (const [field, value] of Object.entries(fields)) {
|
|
642
|
-
// `bodyType` is the type a carried `body` was saved for,
|
|
643
|
-
|
|
648
|
+
// `bodyType` is the type a carried `body` was saved for, `inArgType` the
|
|
649
|
+
// In-arg type a carried default was saved beside; neither is a field.
|
|
650
|
+
if (field === 'bodyType' || field === 'inArgType' || field === 'writtenElementId' || field === 'elementIdUnresolved')
|
|
644
651
|
continue;
|
|
645
652
|
if (row[field] === value)
|
|
646
653
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.93.
|
|
3
|
+
"version": "6.93.6",
|
|
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",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"@types/node": "^22.7.0",
|
|
112
112
|
"esbuild": "^0.28.1"
|
|
113
113
|
},
|
|
114
|
-
"gitref": "
|
|
114
|
+
"gitref": "8d5d725341a2885abea7c13d6e0657d809d4b801"
|
|
115
115
|
}
|