@uipath/maestro-builder-sdk 6.120.9 → 6.120.11
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.
|
@@ -58,6 +58,20 @@ export declare function caseConnectorRowOwners(plan: Record<string, any>): Array
|
|
|
58
58
|
* field. Else `undefined`.
|
|
59
59
|
*/
|
|
60
60
|
export declare function savedConnectorRows(owner: string, bag: Record<string, any>, elementIds?: readonly string[]): PreservedConnectorRows | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The own output rows compile built that {@link applyConnectorRows} drops: on an
|
|
63
|
+
* element saved without that row (`Error` only, say), while it calls the same
|
|
64
|
+
* operation, and while {@link outputsBack} writes the saved rows back (the
|
|
65
|
+
* same {@link outputsDiverge} check). Compile numbered them like any other row
|
|
66
|
+
* (`response11`), so until they are dropped they hold an id a saved row may
|
|
67
|
+
* carry. Called before those claims settle, once the element ids are the plan's
|
|
68
|
+
* own; a claim left to settle only moves a row to its saved id, so a counterpart
|
|
69
|
+
* that matches here still matches when the rows go back. Where the two checks
|
|
70
|
+
* could still disagree (a root companion added after this call), this one says
|
|
71
|
+
* the rows diverge, so the id stays held: a dropped row then keeps its id
|
|
72
|
+
* unused, but no two rows hold one.
|
|
73
|
+
*/
|
|
74
|
+
export declare function droppedConnectorOutputRows(result: Record<string, any>, entries: readonly PreservedConnectorRows[] | undefined): Array<Record<string, unknown>>;
|
|
61
75
|
/**
|
|
62
76
|
* Write each element's saved own rows back over the ones compile built, half
|
|
63
77
|
* by half, while they still describe the element. Runs after the ids are
|
|
@@ -307,14 +307,24 @@ function sameOperation(bag, entry) {
|
|
|
307
307
|
return OPERATION_ROWS.every((name) => !comparesContextRow(bag, name) || now[name] === entry.operation[name]);
|
|
308
308
|
}
|
|
309
309
|
/**
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
|
|
310
|
+
* A saved own row's counterpart among the built own rows: a built row that
|
|
311
|
+
* reads its source, one that also writes its variable when there is one, and
|
|
312
|
+
* of those the one with its id, else the last.
|
|
313
|
+
*/
|
|
314
|
+
function counterpartOf(builtOwn, row) {
|
|
315
|
+
const reading = builtOwn.filter((candidate) => candidate.source === row.source);
|
|
316
|
+
const writing = reading.filter((candidate) => row.var !== undefined && candidate.var === row.var);
|
|
317
|
+
const pool = writing.length ? writing : reading;
|
|
318
|
+
return pool.find((candidate) => candidate.id === row.id) ?? pool.at(-1);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Whether the saved outputs no longer describe the built ones: a saved row's
|
|
322
|
+
* counterpart has another id, or writes another variable (and is not the own
|
|
323
|
+
* row the Designer reassigned to a case variable, `reassignedToCaseVariable`).
|
|
324
|
+
* Then {@link outputsBack} writes nothing back and every built row stays, so
|
|
325
|
+
* {@link droppedConnectorOutputRows} frees none of their ids.
|
|
314
326
|
*
|
|
315
|
-
*
|
|
316
|
-
* also writes its variable when there is one, and of those the one with its
|
|
317
|
-
* id, else the last. An event trigger's `outputs`
|
|
327
|
+
* An event trigger's `outputs`
|
|
318
328
|
* (`outputs: { responseRow: { source: '=response' } }`) compile writes as
|
|
319
329
|
* extracts beside the trigger's own rows, with the same source and no id; the
|
|
320
330
|
* Designer saves the trigger's own row reassigned instead (`{ id:
|
|
@@ -323,24 +333,27 @@ function sameOperation(bag, entry) {
|
|
|
323
333
|
* counterpart, and having no id it says nothing about renumbering, so the
|
|
324
334
|
* ids are compared only when the counterpart has one.
|
|
325
335
|
*/
|
|
326
|
-
function
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
const reading = builtOwn.filter((candidate) => candidate.source === row.source);
|
|
330
|
-
const writing = reading.filter((candidate) => row.var !== undefined && candidate.var === row.var);
|
|
331
|
-
const pool = writing.length ? writing : reading;
|
|
332
|
-
return pool.find((candidate) => candidate.id === row.id) ?? pool.at(-1);
|
|
333
|
-
};
|
|
334
|
-
for (const row of set.rows) {
|
|
335
|
-
const counterpart = counterpartOf(row);
|
|
336
|
+
function outputsDiverge(builtOwn, set, caseVariables) {
|
|
337
|
+
return set.rows.some((row) => {
|
|
338
|
+
const counterpart = counterpartOf(builtOwn, row);
|
|
336
339
|
if (!counterpart)
|
|
337
|
-
|
|
340
|
+
return false;
|
|
338
341
|
if (counterpart.id !== undefined && counterpart.id !== row.id)
|
|
339
|
-
return
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
return true;
|
|
343
|
+
return row.var !== undefined && counterpart.var !== row.var && !reassignedToCaseVariable(row, counterpart, caseVariables);
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* The saved outputs over the built ones: the saved own rows in saved order,
|
|
348
|
+
* where compile put its first own row, around the rows compile writes for the
|
|
349
|
+
* author; a built own row the element was saved without is dropped. Nothing,
|
|
350
|
+
* when the saved rows no longer describe the built ones ({@link outputsDiverge}).
|
|
351
|
+
*/
|
|
352
|
+
function outputsBack(built, set, caseVariables) {
|
|
353
|
+
const builtOwn = built.filter(isOwnOutput);
|
|
354
|
+
if (outputsDiverge(builtOwn, set, caseVariables))
|
|
355
|
+
return undefined;
|
|
356
|
+
const own = set.rows.flatMap((row) => (counterpartOf(builtOwn, row) ? [structuredClone(row)] : []));
|
|
344
357
|
const firstOwn = built.findIndex(isOwnOutput);
|
|
345
358
|
const others = built.filter((row) => !isOwnOutput(row));
|
|
346
359
|
const at = firstOwn < 0 ? 0 : firstOwn;
|
|
@@ -390,6 +403,38 @@ function inputsBack(built, set) {
|
|
|
390
403
|
}
|
|
391
404
|
return structuredClone(set.rows);
|
|
392
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* The own output rows compile built that {@link applyConnectorRows} drops: on an
|
|
408
|
+
* element saved without that row (`Error` only, say), while it calls the same
|
|
409
|
+
* operation, and while {@link outputsBack} writes the saved rows back (the
|
|
410
|
+
* same {@link outputsDiverge} check). Compile numbered them like any other row
|
|
411
|
+
* (`response11`), so until they are dropped they hold an id a saved row may
|
|
412
|
+
* carry. Called before those claims settle, once the element ids are the plan's
|
|
413
|
+
* own; a claim left to settle only moves a row to its saved id, so a counterpart
|
|
414
|
+
* that matches here still matches when the rows go back. Where the two checks
|
|
415
|
+
* could still disagree (a root companion added after this call), this one says
|
|
416
|
+
* the rows diverge, so the id stays held: a dropped row then keeps its id
|
|
417
|
+
* unused, but no two rows hold one.
|
|
418
|
+
*/
|
|
419
|
+
export function droppedConnectorOutputRows(result, entries) {
|
|
420
|
+
if (!entries?.length)
|
|
421
|
+
return [];
|
|
422
|
+
const byOwner = new Map(entries.map((entry) => [entry.owner, entry]));
|
|
423
|
+
const caseVariables = caseVariableIds(result);
|
|
424
|
+
const out = [];
|
|
425
|
+
for (const { key, bag } of caseConnectorRowOwners(result)) {
|
|
426
|
+
const entry = byOwner.get(key);
|
|
427
|
+
if (!entry?.outputs || !sameOperation(bag, entry) || !Array.isArray(bag.outputs))
|
|
428
|
+
continue;
|
|
429
|
+
if (outputsDiverge(bag.outputs.filter(isOwnOutput), entry.outputs, caseVariables))
|
|
430
|
+
continue;
|
|
431
|
+
const saved = new Set(entry.outputs.rows.map((row) => row.source));
|
|
432
|
+
for (const row of bag.outputs)
|
|
433
|
+
if (isOwnOutput(row) && !saved.has(row.source))
|
|
434
|
+
out.push(row);
|
|
435
|
+
}
|
|
436
|
+
return out;
|
|
437
|
+
}
|
|
393
438
|
/**
|
|
394
439
|
* Write each element's saved own rows back over the ones compile built, half
|
|
395
440
|
* by half, while they still describe the element. Runs after the ids are
|
package/dist/case/decompile.js
CHANGED
|
@@ -3178,6 +3178,11 @@ export function collectPreservation(plan) {
|
|
|
3178
3178
|
Object.assign(fields, { default: row.default, inArgType: formalInput.type });
|
|
3179
3179
|
if (lane === 'outputs' && row.var !== undefined)
|
|
3180
3180
|
fields.var = row.var;
|
|
3181
|
+
// An In-arg's `var` (the companion it fills, `groupMap` on the In-arg
|
|
3182
|
+
// `groupMap`), which the platform's canvas-form read writes and compile
|
|
3183
|
+
// does not: carried as saved, and applied only while compile writes none.
|
|
3184
|
+
if (lane === 'inputs' && row.var !== undefined)
|
|
3185
|
+
fields.var = row.var;
|
|
3181
3186
|
// `body` is typed only on a structured (`jsonSchema`) variable. On any
|
|
3182
3187
|
// other row it is the schema the Designer generated for the type (for a
|
|
3183
3188
|
// `file`, the job attachment's `{ ID, FullName, MimeType, Metadata }`),
|
package/dist/case/preserve.js
CHANGED
|
@@ -326,12 +326,12 @@ export function caseJsonPreservationErrors(payload) {
|
|
|
326
326
|
errors.push(`variable "${name}" field "value" on inputOutputs is behavior (a process mapping's var) and cannot be preserved`);
|
|
327
327
|
else if (!PRESERVED_VARIABLE_KEYS.has(field)
|
|
328
328
|
&& !(lane === 'inputOutputs' && (field === 'default' || field === 'custom' || field === 'elementId' || field === 'writtenElementId' || field === 'elementIdUnresolved' || field === 'inArgType'))
|
|
329
|
-
&& !(lane === 'outputs' && field === 'var')
|
|
329
|
+
&& !((lane === 'outputs' || lane === 'inputs') && field === 'var')
|
|
330
330
|
&& field !== 'body' && field !== 'bodyType')
|
|
331
331
|
errors.push(`variable "${name}" field "${field}" is not an allowed preserved designer field`);
|
|
332
332
|
else if (VARIABLE_KEYS.has(field)
|
|
333
333
|
&& !(lane === 'inputOutputs' && (field === 'default' || field === 'elementId'))
|
|
334
|
-
&& !(lane === 'outputs' && field === 'var')
|
|
334
|
+
&& !((lane === 'outputs' || lane === 'inputs') && field === 'var')
|
|
335
335
|
&& field !== 'body')
|
|
336
336
|
errors.push(`variable "${name}" field "${field}" is owned by the typed Case serializer`);
|
|
337
337
|
}
|
package/dist/case/serialize.js
CHANGED
|
@@ -17,7 +17,7 @@ import { buildConnectorInputs, nestConnectorBody, transportHttpMethod } from '..
|
|
|
17
17
|
import { carriedConnectorFieldsRefusal, withCarriedFields } from '../core/carried-connector-fields.js';
|
|
18
18
|
import { connectorTaskIdentity, sameConnectorOperation, withCurrentCaches, writeOptionalConfiguration } from './connector-saved-config.js';
|
|
19
19
|
import { applyConnectorContexts } from './connector-saved-context.js';
|
|
20
|
-
import { applyConnectorRows } from './connector-saved-rows.js';
|
|
20
|
+
import { applyConnectorRows, droppedConnectorOutputRows } from './connector-saved-rows.js';
|
|
21
21
|
import { connectorActivityMetadata, connectorEventFilterTree, connectorEventMetadata } from '../core/connector-v2-metadata.js';
|
|
22
22
|
import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
|
|
23
23
|
import { bindingLabelRefusal, connectionStubMessage } from '../core/binding-messages.js';
|
|
@@ -626,6 +626,9 @@ export function applyPreservation(result, preservation, options = {}) {
|
|
|
626
626
|
continue;
|
|
627
627
|
if (row[field] === value)
|
|
628
628
|
continue;
|
|
629
|
+
// An In-arg's carried `var` gives way to one compile writes.
|
|
630
|
+
if (lane === 'inputs' && field === 'var' && row.var !== undefined)
|
|
631
|
+
continue;
|
|
629
632
|
// A saved `elementId` replaces the one compile writes only while compile
|
|
630
633
|
// writes the value it wrote at decompile; an edit that moved the row wins.
|
|
631
634
|
// It must also still name an element of the plan (or have named none when
|
|
@@ -1829,6 +1832,13 @@ function applyPreservedIdentities(result, preservation, warn) {
|
|
|
1829
1832
|
}
|
|
1830
1833
|
const metadata = result.metadata;
|
|
1831
1834
|
takeConditions(metadata.caseExitRules, identities.caseExitRules);
|
|
1835
|
+
// A built own row the element was saved without is dropped later
|
|
1836
|
+
// (`applyConnectorRows`), so its id is free for a saved row that carries it.
|
|
1837
|
+
// Example: a connector task saved with only its `Error` row compiles with a
|
|
1838
|
+
// `response11` row too; the task saved with `response11` takes it back.
|
|
1839
|
+
for (const row of droppedConnectorOutputRows(result, preservation.connectorRows))
|
|
1840
|
+
if (typeof row.id === 'string')
|
|
1841
|
+
heldOutputIds.delete(row.id);
|
|
1832
1842
|
settleDeferredClaims(deferredClaims, heldOutputIds, (target, row) => claimRowId(target, row, target.id));
|
|
1833
1843
|
takeSlas(metadata.slaRules, identities.slaRules);
|
|
1834
1844
|
restoreEmptyLists(metadata, identities.emptyLists, CASE_EMPTY_LISTS);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.120.
|
|
3
|
+
"version": "6.120.11",
|
|
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",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"@types/node": "^22.7.0",
|
|
125
125
|
"esbuild": "^0.28.1"
|
|
126
126
|
},
|
|
127
|
-
"gitref": "
|
|
127
|
+
"gitref": "96da82c8df0d018baf2826a2f6c1138eecee752e"
|
|
128
128
|
}
|