@uipath/maestro-builder-sdk 6.94.5 → 6.94.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.
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a saved custom (`{ assign }`) task output row differs from the row
|
|
3
|
+
* compile writes for it, so the round trip can put the saved row back.
|
|
4
|
+
*
|
|
5
|
+
* Compile writes one shape (`emitCustomOutput` in `serialize.ts`, the shape
|
|
6
|
+
* Studio Web writes for a new row):
|
|
7
|
+
*
|
|
8
|
+
* { name, type, custom: true, var, value: <source>, source, target: '', body: '', elementId: 'root' }
|
|
9
|
+
*
|
|
10
|
+
* Saved plans hold others. Examples from Studio Web plans:
|
|
11
|
+
*
|
|
12
|
+
* - `{ ..., id: 'currentTaskName', elementId: '<stage>-<task>', value: 'currentTaskName' }`:
|
|
13
|
+
* a row with its own id, which names its task as the element.
|
|
14
|
+
* - `{ ..., source: '=js:vars.a.b', value: '=vars.a' }`: a `value` that is a
|
|
15
|
+
* stale Designer copy, not the assigned `source`.
|
|
16
|
+
* - `{ ..., type: 'json', body: { ... } }`: a json row, whose expressions the
|
|
17
|
+
* platform reads from `body`, not `source` (`getCustomOutputExpressions` in
|
|
18
|
+
* `@uipath/case-schema`).
|
|
19
|
+
* - a row saved with no `source`, `target` or `body`.
|
|
20
|
+
*
|
|
21
|
+
* `customRowShape` records the difference (`set`: the saved value of each
|
|
22
|
+
* field that differs or that compile does not write; `omit`: each field
|
|
23
|
+
* compile writes that the row lacks), with the `source` and `type` the row
|
|
24
|
+
* had and how many custom rows of the task assign its variable. Compile puts
|
|
25
|
+
* it back only while the compiled row still has that `source` and `type` and
|
|
26
|
+
* the task still has that many rows on the variable, so an edited (or
|
|
27
|
+
* retyped) `{ assign }` keeps the row compile writes for it, and a shape is
|
|
28
|
+
* never put on another row of the same variable.
|
|
29
|
+
* That includes the row's `id`: the engine does not read a custom row's id,
|
|
30
|
+
* and a Designer id on compile's own row (`elementId: 'root'`, `value ===
|
|
31
|
+
* source`) is neither the Designer's shape nor compile's, which
|
|
32
|
+
* `uip maestro case validate --strict` rejects (`STRICT_CUSTOM_OUTPUT_SHAPE`).
|
|
33
|
+
*/
|
|
34
|
+
/** Fields a carried custom-row shape never sets: the label (`name`, carried apart) and what the `{ assign }` source types. */
|
|
35
|
+
export declare const CUSTOM_ROW_TYPED_FIELDS: ReadonlySet<string>;
|
|
36
|
+
/** Fields a carried custom-row shape may omit: the Designer copies compile writes. */
|
|
37
|
+
export declare const CUSTOM_ROW_OMITTABLE_FIELDS: ReadonlySet<string>;
|
|
38
|
+
export interface CustomRowShape {
|
|
39
|
+
/** The `source` the saved row assigned (`''` when it had none): the shape applies only while the compiled row assigns the same. */
|
|
40
|
+
source: string;
|
|
41
|
+
/** The `type` the saved row had (`'string'` when it had none): a retyped row gets compile's shape. */
|
|
42
|
+
type: string;
|
|
43
|
+
/** The variable the row assigns, which finds the compiled row. */
|
|
44
|
+
var: string;
|
|
45
|
+
/** How many custom rows of the task assign `var`, when more than one: the shape applies only while the compiled task has as many. */
|
|
46
|
+
varRows?: number;
|
|
47
|
+
/** Saved values of fields compile writes otherwise, or does not write. */
|
|
48
|
+
set?: Record<string, unknown>;
|
|
49
|
+
/** Fields compile writes that the saved row lacks. */
|
|
50
|
+
omit?: string[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The shape of saved custom row `row`, or undefined when compile writes it
|
|
54
|
+
* as saved. `ownFields` are fields another channel already carries for this
|
|
55
|
+
* row (an action custom row's `originalVar`), left out here.
|
|
56
|
+
*/
|
|
57
|
+
export declare function customRowShape(row: Record<string, unknown>, ownFields?: ReadonlySet<string>, varRows?: number): CustomRowShape | undefined;
|
|
58
|
+
/** Problems with a carried shape (`preserveCaseJson` payload validation), as messages. */
|
|
59
|
+
export declare function customRowShapeErrors(owner: string, shape: unknown): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Put carried `shape` back on compiled custom row `row`, only while `row`
|
|
62
|
+
* has the carried `source` and `type` and its task has `shape.varRows` custom
|
|
63
|
+
* rows on the variable (`varRows`, the compiled count): an edited or retyped
|
|
64
|
+
* row keeps compile's shape, id included, and a task that gained or lost a
|
|
65
|
+
* row on the variable puts no shape on the wrong row. `idFree(id)` says
|
|
66
|
+
* whether no other output row holds `id`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function applyCustomRowShape(row: Record<string, unknown>, shape: CustomRowShape, idFree: (id: string) => boolean, varRows?: number): void;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a saved custom (`{ assign }`) task output row differs from the row
|
|
3
|
+
* compile writes for it, so the round trip can put the saved row back.
|
|
4
|
+
*
|
|
5
|
+
* Compile writes one shape (`emitCustomOutput` in `serialize.ts`, the shape
|
|
6
|
+
* Studio Web writes for a new row):
|
|
7
|
+
*
|
|
8
|
+
* { name, type, custom: true, var, value: <source>, source, target: '', body: '', elementId: 'root' }
|
|
9
|
+
*
|
|
10
|
+
* Saved plans hold others. Examples from Studio Web plans:
|
|
11
|
+
*
|
|
12
|
+
* - `{ ..., id: 'currentTaskName', elementId: '<stage>-<task>', value: 'currentTaskName' }`:
|
|
13
|
+
* a row with its own id, which names its task as the element.
|
|
14
|
+
* - `{ ..., source: '=js:vars.a.b', value: '=vars.a' }`: a `value` that is a
|
|
15
|
+
* stale Designer copy, not the assigned `source`.
|
|
16
|
+
* - `{ ..., type: 'json', body: { ... } }`: a json row, whose expressions the
|
|
17
|
+
* platform reads from `body`, not `source` (`getCustomOutputExpressions` in
|
|
18
|
+
* `@uipath/case-schema`).
|
|
19
|
+
* - a row saved with no `source`, `target` or `body`.
|
|
20
|
+
*
|
|
21
|
+
* `customRowShape` records the difference (`set`: the saved value of each
|
|
22
|
+
* field that differs or that compile does not write; `omit`: each field
|
|
23
|
+
* compile writes that the row lacks), with the `source` and `type` the row
|
|
24
|
+
* had and how many custom rows of the task assign its variable. Compile puts
|
|
25
|
+
* it back only while the compiled row still has that `source` and `type` and
|
|
26
|
+
* the task still has that many rows on the variable, so an edited (or
|
|
27
|
+
* retyped) `{ assign }` keeps the row compile writes for it, and a shape is
|
|
28
|
+
* never put on another row of the same variable.
|
|
29
|
+
* That includes the row's `id`: the engine does not read a custom row's id,
|
|
30
|
+
* and a Designer id on compile's own row (`elementId: 'root'`, `value ===
|
|
31
|
+
* source`) is neither the Designer's shape nor compile's, which
|
|
32
|
+
* `uip maestro case validate --strict` rejects (`STRICT_CUSTOM_OUTPUT_SHAPE`).
|
|
33
|
+
*/
|
|
34
|
+
/** The fields compile writes on a custom row, with the value it writes, given the row's `source`, `type` and `var`. */
|
|
35
|
+
function writtenCustomRow(source, type, variable) {
|
|
36
|
+
return { type, custom: true, var: variable, value: source, source, target: '', body: '', elementId: 'root' };
|
|
37
|
+
}
|
|
38
|
+
/** Fields a carried custom-row shape never sets: the label (`name`, carried apart) and what the `{ assign }` source types. */
|
|
39
|
+
export const CUSTOM_ROW_TYPED_FIELDS = new Set(['name', 'type', 'custom', 'var', 'source']);
|
|
40
|
+
/** Fields a carried custom-row shape may omit: the Designer copies compile writes. */
|
|
41
|
+
export const CUSTOM_ROW_OMITTABLE_FIELDS = new Set(['value', 'source', 'target', 'body', 'elementId']);
|
|
42
|
+
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
43
|
+
/**
|
|
44
|
+
* The shape of saved custom row `row`, or undefined when compile writes it
|
|
45
|
+
* as saved. `ownFields` are fields another channel already carries for this
|
|
46
|
+
* row (an action custom row's `originalVar`), left out here.
|
|
47
|
+
*/
|
|
48
|
+
export function customRowShape(row, ownFields = new Set(), varRows = 1) {
|
|
49
|
+
if (row.custom !== true || typeof row.var !== 'string')
|
|
50
|
+
return undefined;
|
|
51
|
+
if (row.source !== undefined && typeof row.source !== 'string')
|
|
52
|
+
return undefined;
|
|
53
|
+
const source = row.source ?? '';
|
|
54
|
+
const type = typeof row.type === 'string' ? row.type : 'string';
|
|
55
|
+
const written = writtenCustomRow(source, type, row.var);
|
|
56
|
+
const set = {};
|
|
57
|
+
for (const [field, value] of Object.entries(row)) {
|
|
58
|
+
if (CUSTOM_ROW_TYPED_FIELDS.has(field) || ownFields.has(field))
|
|
59
|
+
continue;
|
|
60
|
+
if (!Object.prototype.hasOwnProperty.call(written, field) || !same(written[field], value))
|
|
61
|
+
set[field] = structuredClone(value);
|
|
62
|
+
}
|
|
63
|
+
// A field another channel carries (`ownFields`) is not this shape's to set or to omit.
|
|
64
|
+
const omit = Object.keys(written).filter((field) => CUSTOM_ROW_OMITTABLE_FIELDS.has(field) && !ownFields.has(field) && !Object.prototype.hasOwnProperty.call(row, field));
|
|
65
|
+
if (!Object.keys(set).length && !omit.length)
|
|
66
|
+
return undefined;
|
|
67
|
+
return { source, type, var: row.var, ...(varRows !== 1 ? { varRows } : {}), ...(Object.keys(set).length ? { set } : {}), ...(omit.length ? { omit } : {}) };
|
|
68
|
+
}
|
|
69
|
+
/** Problems with a carried shape (`preserveCaseJson` payload validation), as messages. */
|
|
70
|
+
export function customRowShapeErrors(owner, shape) {
|
|
71
|
+
if (!shape || typeof shape !== 'object' || Array.isArray(shape))
|
|
72
|
+
return [`${owner} custom-row shape must be an object`];
|
|
73
|
+
const s = shape;
|
|
74
|
+
const errors = [];
|
|
75
|
+
if (typeof s.source !== 'string')
|
|
76
|
+
errors.push(`${owner} custom-row shape needs its "source" string`);
|
|
77
|
+
if (typeof s.type !== 'string' || !s.type)
|
|
78
|
+
errors.push(`${owner} custom-row shape needs its "type" string`);
|
|
79
|
+
if (typeof s.var !== 'string' || !s.var)
|
|
80
|
+
errors.push(`${owner} custom-row shape needs its "var" string`);
|
|
81
|
+
if (s.varRows !== undefined && !(Number.isInteger(s.varRows) && s.varRows > 1))
|
|
82
|
+
errors.push(`${owner} custom-row shape "varRows" must be an integer above 1`);
|
|
83
|
+
if (s.set !== undefined) {
|
|
84
|
+
if (!s.set || typeof s.set !== 'object' || Array.isArray(s.set))
|
|
85
|
+
errors.push(`${owner} custom-row shape "set" must be an object`);
|
|
86
|
+
else {
|
|
87
|
+
for (const field of Object.keys(s.set))
|
|
88
|
+
if (CUSTOM_ROW_TYPED_FIELDS.has(field))
|
|
89
|
+
errors.push(`${owner} custom row field "${field}" is owned by the typed Case serializer`);
|
|
90
|
+
if (s.set.id !== undefined && typeof s.set.id !== 'string')
|
|
91
|
+
errors.push(`${owner} custom-row shape "set.id" must be a string`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (s.omit !== undefined) {
|
|
95
|
+
if (!Array.isArray(s.omit) || s.omit.some((field) => typeof field !== 'string'))
|
|
96
|
+
errors.push(`${owner} custom-row shape "omit" must be an array of field names`);
|
|
97
|
+
else
|
|
98
|
+
for (const field of s.omit)
|
|
99
|
+
if (!CUSTOM_ROW_OMITTABLE_FIELDS.has(field))
|
|
100
|
+
errors.push(`${owner} custom row omits "${field}", which is not an omittable field`);
|
|
101
|
+
}
|
|
102
|
+
return errors;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Put carried `shape` back on compiled custom row `row`, only while `row`
|
|
106
|
+
* has the carried `source` and `type` and its task has `shape.varRows` custom
|
|
107
|
+
* rows on the variable (`varRows`, the compiled count): an edited or retyped
|
|
108
|
+
* row keeps compile's shape, id included, and a task that gained or lost a
|
|
109
|
+
* row on the variable puts no shape on the wrong row. `idFree(id)` says
|
|
110
|
+
* whether no other output row holds `id`.
|
|
111
|
+
*/
|
|
112
|
+
export function applyCustomRowShape(row, shape, idFree, varRows = 1) {
|
|
113
|
+
if (row.source !== shape.source || row.type !== shape.type || varRows !== (shape.varRows ?? 1))
|
|
114
|
+
return;
|
|
115
|
+
const { id, ...rest } = shape.set ?? {};
|
|
116
|
+
if (typeof id === 'string' && row.id === undefined && idFree(id))
|
|
117
|
+
row.id = id;
|
|
118
|
+
for (const field of shape.omit ?? [])
|
|
119
|
+
delete row[field];
|
|
120
|
+
for (const [field, value] of Object.entries(rest))
|
|
121
|
+
row[field] = structuredClone(value);
|
|
122
|
+
}
|
package/dist/case/decompile.js
CHANGED
|
@@ -12,10 +12,11 @@ import { caseConnectorOwners, savedConnectorContext } from './connector-saved-co
|
|
|
12
12
|
import { caseConnectorRowOwners, savedConnectorRows } from './connector-saved-rows.js';
|
|
13
13
|
import { builtChainSource, chainStatements } from '../core/builder-chain.js';
|
|
14
14
|
import { literalSource } from './literal.js';
|
|
15
|
+
import { customRowShape } from './custom-output-shape.js';
|
|
15
16
|
import { ANY_ESCALATION_ID } from './rule-options.js';
|
|
16
17
|
import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS } from './format-profile.js';
|
|
17
18
|
import { EXTERNAL_TASK_CONTEXT, EXTERNAL_TASK_EVENT_CONTEXT, externalDescriptorRefusal, externalEventRefusal, externalServiceType, isExternalExecutionMode, libraryExecution } from './external.js';
|
|
18
|
-
import { preserveSchemaVersion } from '../schema-version.js';
|
|
19
|
+
import { compareSchemaVersions, preserveSchemaVersion } from '../schema-version.js';
|
|
19
20
|
import { ownEntry } from '../core/own-entry.js';
|
|
20
21
|
import { EVENT_FILTER_OPERATORS, eventFilterExpressionOf, eventFilterFromTreeLeaf, eventFilterProblem, EXPRESSION_FILTER_OPERATORS, filterExprFromLeaf } from '../core/event-filters.js';
|
|
21
22
|
import { CASE_FILTER_SPELLING, caseSubscriptionBody, caseSubscriptionOwners } from './subscription.js';
|
|
@@ -2465,6 +2466,30 @@ function unaliasedOwnNameRow(row, plan) {
|
|
|
2465
2466
|
const root = [...(plan.variables?.inputOutputs ?? []), ...(plan.variables?.inputs ?? []), ...(plan.variables?.outputs ?? [])];
|
|
2466
2467
|
return root.some((entry) => entry?.id === row.id) ? { noAlias: true } : {};
|
|
2467
2468
|
}
|
|
2469
|
+
/**
|
|
2470
|
+
* A custom (`{ assign }`) output row's saved fields that compile does not
|
|
2471
|
+
* write as saved (`customRowShape`): its own `id`, an `elementId` other than
|
|
2472
|
+
* `root`, a `value` that is not its `source`, a json row's `body`, Designer
|
|
2473
|
+
* copies such as `displayName`. An action custom row's `originalVar` is
|
|
2474
|
+
* carried apart (the identity's `originalVar`).
|
|
2475
|
+
*/
|
|
2476
|
+
function customRowIdentity(task, row, plan) {
|
|
2477
|
+
const carriedApart = new Set(task.type === 'action' ? ['originalVar'] : []);
|
|
2478
|
+
// Below V32.0.3 the platform re-derives a custom row's `elementId` on read
|
|
2479
|
+
// (the V32.0.2 -> V32.0.3 migration, from the variable the row assigns), so
|
|
2480
|
+
// the saved value is not what the reader sees, and compile writes a later
|
|
2481
|
+
// version, which the migration does not touch. Only a V32.0.3+ value is the
|
|
2482
|
+
// row's own.
|
|
2483
|
+
if (!customElementIdIsOwn(plan.version))
|
|
2484
|
+
carriedApart.add('elementId');
|
|
2485
|
+
const varRows = (task.data?.outputs ?? []).filter((other) => other?.custom === true && other.var === row.var).length;
|
|
2486
|
+
const shape = customRowShape(row, carriedApart, varRows);
|
|
2487
|
+
return shape ? { customRow: shape } : {};
|
|
2488
|
+
}
|
|
2489
|
+
/** Whether a plan declaring `version` keeps its custom rows' saved `elementId` on read (V32.0.3 and later). */
|
|
2490
|
+
function customElementIdIsOwn(version) {
|
|
2491
|
+
return typeof version === 'string' && /^\d+\.\d+\.\d+$/.test(version) && compareSchemaVersions(version, '32.0.3') >= 0;
|
|
2492
|
+
}
|
|
2468
2493
|
function identityPreservation(plan) {
|
|
2469
2494
|
const ambiguous = ambiguousSlaIds(plan);
|
|
2470
2495
|
const conditionIdentity = (condition, _index, list) => conditionIdentityOf(condition, ambiguous, list);
|
|
@@ -2496,6 +2521,7 @@ function identityPreservation(plan) {
|
|
|
2496
2521
|
...unaliasedOwnNameRow(row, plan),
|
|
2497
2522
|
...actionOutputShape(task, row),
|
|
2498
2523
|
...resourceRowShape(task, row, 'outputs'),
|
|
2524
|
+
...customRowIdentity(task, row, plan),
|
|
2499
2525
|
})),
|
|
2500
2526
|
...emptyIoLists(task),
|
|
2501
2527
|
...carriedResource(task, plan),
|
package/dist/case/preserve.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type PreservedConnectorContext } from './connector-saved-context.js';
|
|
|
2
2
|
import { type PreservedConnectorRows } from './connector-saved-rows.js';
|
|
3
3
|
import type { BuiltCase } from './case-sdk.js';
|
|
4
4
|
import type { ReadEventFilter } from '../core/event-filters.js';
|
|
5
|
+
import { type CustomRowShape } from './custom-output-shape.js';
|
|
5
6
|
import { Bindings } from '../core/bindings.js';
|
|
6
7
|
import type { BindingsView } from '../core/binding-messages.js';
|
|
7
8
|
import { type PreservedResourceWire } from './resource-wire.js';
|
|
@@ -220,7 +221,10 @@ interface StageIdentity {
|
|
|
220
221
|
}>;
|
|
221
222
|
/** `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. */
|
|
222
223
|
/** `var` and `custom: true`: a custom row whose label (`name`) is not the name of the variable it assigns. */
|
|
223
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* `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>`.
|
|
226
|
+
* `customRow`: a custom (`{ assign }`) row's saved fields compile does not write as saved (`customRowShape`).
|
|
227
|
+
*/
|
|
224
228
|
outputs?: PreservedOutputRow[];
|
|
225
229
|
/** The io lists a task saved empty (`inputs: []`), which compile writes only when it has a row there. */
|
|
226
230
|
emptyIo?: Array<'inputs' | 'outputs'>;
|
|
@@ -312,6 +316,7 @@ export interface PreservedOutputRow {
|
|
|
312
316
|
var?: string;
|
|
313
317
|
custom?: true;
|
|
314
318
|
noAlias?: true;
|
|
319
|
+
customRow?: CustomRowShape;
|
|
315
320
|
}
|
|
316
321
|
export interface CaseJsonPreservation {
|
|
317
322
|
/** Unknown document-root fields. */
|
package/dist/case/preserve.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { connectorContextErrors } from './connector-saved-context.js';
|
|
2
2
|
import { connectorRowErrors } from './connector-saved-rows.js';
|
|
3
3
|
import { stableId } from '../core/stable-id.js';
|
|
4
|
+
import { customRowShapeErrors } from './custom-output-shape.js';
|
|
4
5
|
import { Bindings } from '../core/bindings.js';
|
|
5
6
|
import { bindingIdCandidates, offlineBindingLabel } from './ids.js';
|
|
6
7
|
import { resourceBindingSeed, resourceWireError } from './resource-wire.js';
|
|
@@ -376,6 +377,11 @@ export function caseJsonPreservationErrors(payload) {
|
|
|
376
377
|
errors.push(`task "${task.name}" ${side} "${row.name}" omits "${String(field)}", which is not an omittable field`);
|
|
377
378
|
}
|
|
378
379
|
}
|
|
380
|
+
for (const stage of payload.identities?.stages ?? [])
|
|
381
|
+
for (const task of (stage.tasks ?? []).flat())
|
|
382
|
+
for (const row of task.outputs ?? [])
|
|
383
|
+
if (row.customRow !== undefined)
|
|
384
|
+
errors.push(...customRowShapeErrors(`task "${task.name}" output "${row.name}"`, row.customRow));
|
|
379
385
|
for (const id of payload.omitTaskDisplayNames ?? [])
|
|
380
386
|
if (typeof id !== 'string' || id === '')
|
|
381
387
|
errors.push('omitted task displayName ids must be non-empty strings');
|
package/dist/case/serialize.js
CHANGED
|
@@ -47,6 +47,7 @@ import { DOCUMENT_EXTRACTION_NAME, DOCUMENT_EXTRACTION_RESOURCE, DOCUMENT_EXTRAC
|
|
|
47
47
|
import { HTTP_REQUEST_CONNECTION_NAME, HTTP_REQUEST_IMPLICIT_BINDING_ID, HTTP_REQUEST_IMPLICIT_CONNECTION, HTTP_REQUEST_SERVICE_TYPE, httpRequestBody, httpRequestContext, httpRequestInputs, httpRequestOutputMappings, httpRequestOutputs, httpRequestRefusal, writeHttpRequestMetadata, } from './http-request.js';
|
|
48
48
|
import { connectorPlaceholderData, connectorPlaceholderKindOf, isConnectorPlaceholder } from './connector-placeholder.js';
|
|
49
49
|
import { lowerTaskOutputRefs, planTaskOutputs, resolveInPlan, unresolvedTaskOutputRef } from './task-output-ref.js';
|
|
50
|
+
import { applyCustomRowShape } from './custom-output-shape.js';
|
|
50
51
|
/** The ids a serialize pass hashed from element ids, by the document it returned. */
|
|
51
52
|
const ELEMENT_SEEDED_IDS = new WeakMap();
|
|
52
53
|
/** The subscriptions a serialize pass wrote, by the document it returned. */
|
|
@@ -1365,6 +1366,8 @@ function applyPreservedIdentities(result, preservation, warn) {
|
|
|
1365
1366
|
if (!carriedCompanions.has(row.var))
|
|
1366
1367
|
carriedCompanions.set(row.var, { id: row.var, name: row.var, type: row.type, elementId: 'root', custom: true });
|
|
1367
1368
|
};
|
|
1369
|
+
// Tasks whose custom rows carry a saved shape (`customRowShape`).
|
|
1370
|
+
const customRowShapes = [];
|
|
1368
1371
|
const nodes = result.nodes;
|
|
1369
1372
|
const stages = nodes.filter((node) => String(node.type).endsWith('Stage'));
|
|
1370
1373
|
const bagField = CASE_FORMAT_PROFILE.waitConnectorRuleBagField;
|
|
@@ -1693,6 +1696,10 @@ function applyPreservedIdentities(result, preservation, warn) {
|
|
|
1693
1696
|
// resource, even when the payload names none. An action task's `omit`
|
|
1694
1697
|
// is its form row's (#1636), which names no resource.
|
|
1695
1698
|
const isAction = task?.type === 'action';
|
|
1699
|
+
// A custom row's saved fields (`customRowShape`), put back once every id is final.
|
|
1700
|
+
const shapes = (taskIdentity.outputs ?? []).flatMap((row) => (row.customRow ? [row.customRow] : []));
|
|
1701
|
+
if (task && shapes.length)
|
|
1702
|
+
customRowShapes.push({ task, shapes });
|
|
1696
1703
|
takeOutputRows(task?.data?.outputs ?? [], (taskIdentity.outputs ?? [])
|
|
1697
1704
|
.map((row) => ({ ...row, ...(!isAction && !resourceKept ? { fields: undefined, omit: undefined } : {}) })), isAction);
|
|
1698
1705
|
// Only on the kind the lists were saved on (`emptyIoType`; a payload from
|
|
@@ -1825,6 +1832,26 @@ function applyPreservedIdentities(result, preservation, warn) {
|
|
|
1825
1832
|
settleOwnNameRows(result, stages, ownNameRestored, identities);
|
|
1826
1833
|
for (const spell of targetSpellings)
|
|
1827
1834
|
spell();
|
|
1835
|
+
// Each shape goes to the compiled custom row that assigns its variable, the
|
|
1836
|
+
// n-th shape of a variable to the n-th such row of the task.
|
|
1837
|
+
if (customRowShapes.length) {
|
|
1838
|
+
const held = new Set(planOutputRows(result, stages).map((row) => row?.id).filter((id) => typeof id === 'string'));
|
|
1839
|
+
for (const { task, shapes } of customRowShapes) {
|
|
1840
|
+
const rows = (task.data?.outputs ?? []).filter((row) => row?.custom === true);
|
|
1841
|
+
const seen = new Map();
|
|
1842
|
+
for (const shape of shapes) {
|
|
1843
|
+
const n = seen.get(shape.var) ?? 0;
|
|
1844
|
+
seen.set(shape.var, n + 1);
|
|
1845
|
+
const onVar = rows.filter((candidate) => candidate.var === shape.var);
|
|
1846
|
+
const row = onVar[n];
|
|
1847
|
+
if (!row)
|
|
1848
|
+
continue;
|
|
1849
|
+
applyCustomRowShape(row, shape, (id) => !held.has(id), onVar.length);
|
|
1850
|
+
if (typeof row.id === 'string')
|
|
1851
|
+
held.add(row.id);
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1828
1855
|
// An id hashed from a generated element id is re-minted from the preserved one,
|
|
1829
1856
|
// wherever it is spelled, including inside a `=jsonString:` configuration.
|
|
1830
1857
|
const reseeded = new Map();
|
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.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": "12cb23df83e2177d2b1ccc2c731e9b80298a12ba"
|
|
115
115
|
}
|