@uipath/maestro-builder-sdk 6.94.0 → 6.94.1
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 +15 -0
- package/dist/case/preserve.d.ts +19 -12
- package/dist/case/serialize.js +8 -1
- package/package.json +2 -2
package/dist/case/decompile.js
CHANGED
|
@@ -2410,6 +2410,20 @@ function customRowLabel(row, plan) {
|
|
|
2410
2410
|
const variable = (plan.variables?.inputOutputs ?? []).find((entry) => entry.id === row.var);
|
|
2411
2411
|
return row.name === (variable?.name ?? row.var) ? {} : { var: row.var, custom: true };
|
|
2412
2412
|
}
|
|
2413
|
+
/**
|
|
2414
|
+
* An own-name output (`id == var`) saved with no `originalVar` while a root
|
|
2415
|
+
* variable has its id. Compile writes such a row as the controlled alias of
|
|
2416
|
+
* that variable (`originalVar: <id>`); the Designer reads the row the same way
|
|
2417
|
+
* with or without it, and saves it without. Recorded as `noAlias: true`, so
|
|
2418
|
+
* compile writes it back without. For example an agent output
|
|
2419
|
+
* `{ id: 'error', var: 'error' }` beside the trigger's root `error` row.
|
|
2420
|
+
*/
|
|
2421
|
+
function unaliasedOwnNameRow(row, plan) {
|
|
2422
|
+
if (row.custom === true || row.originalVar !== undefined || typeof row.id !== 'string' || row.id !== row.var)
|
|
2423
|
+
return {};
|
|
2424
|
+
const root = [...(plan.variables?.inputOutputs ?? []), ...(plan.variables?.inputs ?? []), ...(plan.variables?.outputs ?? [])];
|
|
2425
|
+
return root.some((entry) => entry?.id === row.id) ? { noAlias: true } : {};
|
|
2426
|
+
}
|
|
2413
2427
|
function identityPreservation(plan) {
|
|
2414
2428
|
return {
|
|
2415
2429
|
...(plan.id ? { id: plan.id } : {}),
|
|
@@ -2436,6 +2450,7 @@ function identityPreservation(plan) {
|
|
|
2436
2450
|
// or the variable an own-name extract wrote first (`firstResults`).
|
|
2437
2451
|
...(typeof row.originalVar === 'string' && row.originalVar !== row.id && (row.custom !== true || task.type === 'action')
|
|
2438
2452
|
? { originalVar: row.originalVar } : {}),
|
|
2453
|
+
...unaliasedOwnNameRow(row, plan),
|
|
2439
2454
|
...actionOutputShape(task, row),
|
|
2440
2455
|
...resourceRowShape(task, row, 'outputs'),
|
|
2441
2456
|
})),
|
package/dist/case/preserve.d.ts
CHANGED
|
@@ -200,18 +200,8 @@ interface StageIdentity {
|
|
|
200
200
|
}>;
|
|
201
201
|
/** `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. */
|
|
202
202
|
/** `var` and `custom: true`: a custom row whose label (`name`) is not the name of the variable it assigns. */
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
id?: string;
|
|
206
|
-
originalVar?: string;
|
|
207
|
-
elementId?: string;
|
|
208
|
-
fields?: Record<string, unknown>;
|
|
209
|
-
omit?: string[];
|
|
210
|
-
target?: 'var' | 'originalVar';
|
|
211
|
-
bodyCopies?: string[];
|
|
212
|
-
var?: string;
|
|
213
|
-
custom?: true;
|
|
214
|
-
}>;
|
|
203
|
+
/** `noAlias: true`: an own-name row saved with no `originalVar` beside a root variable of its id, which compile writes as the alias `originalVar: <id>`. */
|
|
204
|
+
outputs?: PreservedOutputRow[];
|
|
215
205
|
/** The io lists a resource task saved empty (`inputs: []`), which compile writes only when it binds a row. */
|
|
216
206
|
emptyIo?: Array<'inputs' | 'outputs'>;
|
|
217
207
|
/** `taskFingerprint`, for a task a sibling shares its row names with. */
|
|
@@ -284,6 +274,23 @@ interface CaseIdentityPreservation {
|
|
|
284
274
|
* variable fields. Those constructs must use the typed builder or fail with a
|
|
285
275
|
* named refusal.
|
|
286
276
|
*/
|
|
277
|
+
/**
|
|
278
|
+
* One output row of a task in the payload's `identities` (see `outputs` there):
|
|
279
|
+
* the row's name and id, and the Designer-saved spellings compile puts back.
|
|
280
|
+
*/
|
|
281
|
+
export interface PreservedOutputRow {
|
|
282
|
+
name: string;
|
|
283
|
+
id?: string;
|
|
284
|
+
originalVar?: string;
|
|
285
|
+
elementId?: string;
|
|
286
|
+
fields?: Record<string, unknown>;
|
|
287
|
+
omit?: string[];
|
|
288
|
+
target?: 'var' | 'originalVar';
|
|
289
|
+
bodyCopies?: string[];
|
|
290
|
+
var?: string;
|
|
291
|
+
custom?: true;
|
|
292
|
+
noAlias?: true;
|
|
293
|
+
}
|
|
287
294
|
export interface CaseJsonPreservation {
|
|
288
295
|
/** Unknown document-root fields. */
|
|
289
296
|
topLevel?: Record<string, unknown>;
|
package/dist/case/serialize.js
CHANGED
|
@@ -1387,8 +1387,15 @@ function applyPreservedIdentities(result, preservation) {
|
|
|
1387
1387
|
// the id renames. Example: `{ name: 'echoIn', fields: { displayName: 'echoIn',
|
|
1388
1388
|
// title: 'echoIn' } }` gives the compiled `echoIn` row both back.
|
|
1389
1389
|
const carryRowShape = (row, wanted) => {
|
|
1390
|
-
if (!row || row.name !== wanted.name || (!wanted.fields && !wanted.omit && !wanted.target && wanted.originalVar === undefined))
|
|
1390
|
+
if (!row || row.name !== wanted.name || (!wanted.fields && !wanted.omit && !wanted.target && wanted.originalVar === undefined && wanted.noAlias !== true))
|
|
1391
1391
|
return;
|
|
1392
|
+
// An own-name row the Designer saved without the controlled alias compile
|
|
1393
|
+
// writes (`originalVar: <id>`) loses it again, once every id is final, while
|
|
1394
|
+
// it is still own-name and still spelled as the alias.
|
|
1395
|
+
// Only the literal `true` decompile writes: a hand-edited `"yes"` is no marker.
|
|
1396
|
+
if (wanted.noAlias === true)
|
|
1397
|
+
targetSpellings.push(() => { if (row.id === row.var && row.originalVar === row.id)
|
|
1398
|
+
delete row.originalVar; });
|
|
1392
1399
|
rowRenames.push(() => {
|
|
1393
1400
|
// A key the compiled row already has is typed (an input `required` /
|
|
1394
1401
|
// `default` the source now gives), so the author's value wins.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.94.
|
|
3
|
+
"version": "6.94.1",
|
|
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": "9470c0c912af156a1735e881030f7b666909237a"
|
|
115
115
|
}
|