@uipath/maestro-builder-sdk 6.124.15 → 6.124.16
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/merge-roundtrip.d.ts +3 -3
- package/dist/merge.js +37 -1
- package/dist/nodes/document/flow/family.d.ts +2 -0
- package/dist/nodes/document/flow/family.js +2 -0
- package/dist/nodes/document/flow/merge-taxonomy.d.ts +25 -0
- package/dist/nodes/document/flow/merge-taxonomy.js +81 -0
- package/dist/nodes/document/flow/taxonomy.d.ts +5 -0
- package/dist/nodes/document/flow/taxonomy.js +5 -0
- package/package.json +2 -2
|
@@ -33,7 +33,7 @@ interface RtFlow {
|
|
|
33
33
|
/** One difference, or one inconsistency in the merged file. */
|
|
34
34
|
export interface MergeFinding {
|
|
35
35
|
/** Which comparison found it. */
|
|
36
|
-
kind: 'node-removed' | 'node-added' | 'node-type' | 'implicit-end' | 'edge-handle-renamed' | 'edge-rewired' | 'edge-removed' | 'edge-added' | 'handle-ids' | 'binding-removed' | 'binding-added' | 'variable-added' | 'variable-changed' | 'undeclared-handle' | 'duplicate-binding' | 'agent-sidecar' | 'agent-storage' | 'agent-prompt-input' | 'agent-embedded-edit' | 'outputs-superseded' | 'entry-point-repaired' | 'extract-draft' | 'processor-provisioned';
|
|
36
|
+
kind: 'node-removed' | 'node-added' | 'node-type' | 'implicit-end' | 'edge-handle-renamed' | 'edge-rewired' | 'edge-removed' | 'edge-added' | 'handle-ids' | 'binding-removed' | 'binding-added' | 'variable-added' | 'variable-changed' | 'undeclared-handle' | 'duplicate-binding' | 'agent-sidecar' | 'agent-storage' | 'agent-prompt-input' | 'agent-embedded-edit' | 'outputs-superseded' | 'entry-point-repaired' | 'extract-draft' | 'processor-provisioned' | 'taxonomy-ids-minted';
|
|
37
37
|
/** The finding, phrased for the author, naming the node, edge or row. */
|
|
38
38
|
message: string;
|
|
39
39
|
/**
|
|
@@ -41,8 +41,8 @@ export interface MergeFinding {
|
|
|
41
41
|
* `binding-removed`, which leave the merged file doing what the original does,
|
|
42
42
|
* for `agent-embedded-edit`, which reports what merge did not carry, for
|
|
43
43
|
* `outputs-superseded`, which reports a declaration merge corrected, and for
|
|
44
|
-
* `entry-point-repaired` and `
|
|
45
|
-
* merge made.
|
|
44
|
+
* `entry-point-repaired`, `processor-provisioned` and `taxonomy-ids-minted`,
|
|
45
|
+
* which report a fix merge made.
|
|
46
46
|
*/
|
|
47
47
|
refuses: boolean;
|
|
48
48
|
}
|
package/dist/merge.js
CHANGED
|
@@ -109,7 +109,7 @@ import { keepProcessInputReads } from './merge-process-inputs.js';
|
|
|
109
109
|
import { replaceSupersededOutputs } from './merge-superseded-outputs.js';
|
|
110
110
|
import { restoredConnectionMessage, withOriginalConnectionLabels } from './merge-baseline-connections.js';
|
|
111
111
|
import { extractDraftFindings } from './merge-extract-draft.js';
|
|
112
|
-
import { DYNAMIC_EXTRACT_TYPE, isIdpProcessorReadOnly, readIdpProcessorFolderPath, readIdpProcessorKey } from './nodes/document/flow/family.js';
|
|
112
|
+
import { DYNAMIC_EXTRACT_TYPE, fillMissingTaxonomyIds, isIdpProcessorReadOnly, readIdpProcessorFolderPath, readIdpProcessorKey } from './nodes/document/flow/family.js';
|
|
113
113
|
import { byId, isKept, nodeUnchanged, subflowsTakenFromEdited } from './edit-scope.js';
|
|
114
114
|
export { MergeRefusedError } from './merge-roundtrip.js';
|
|
115
115
|
/**
|
|
@@ -583,6 +583,10 @@ function mergeFlowFindings(original, edited, options) {
|
|
|
583
583
|
// none gets the key the edited compile minted for it, kept or edited
|
|
584
584
|
// (provisionKeylessExtractNodes). ──
|
|
585
585
|
const processorRepairs = provisionKeylessExtractNodes([...finalNodes, ...subflowScopes.flatMap((sf) => sf?.nodes ?? [])], byId([...(edited.nodes ?? []), ...Object.values(edited.subflows ?? {}).flatMap((sf) => sf?.nodes ?? [])]));
|
|
586
|
+
// ── Taxonomy ids: an Extract document group or field the merged node leaves
|
|
587
|
+
// without an id gets the one the edited compile minted for it, kept or
|
|
588
|
+
// edited (mintMissingTaxonomyIds). ──
|
|
589
|
+
const taxonomyRepairs = mintMissingTaxonomyIds([...finalNodes, ...subflowScopes.flatMap((sf) => sf?.nodes ?? [])], byId([...(edited.nodes ?? []), ...Object.values(edited.subflows ?? {}).flatMap((sf) => sf?.nodes ?? [])]), edited.id ?? original.id ?? '');
|
|
586
590
|
// ── Variables: the same delta as nodes, per entry — what the author did not
|
|
587
591
|
// change stays the original's, so compile's own spellings (an added
|
|
588
592
|
// `name`, a re-derived End output type) do not reach the file (#1261).
|
|
@@ -693,6 +697,7 @@ function mergeFlowFindings(original, edited, options) {
|
|
|
693
697
|
...(options.baseline ? roundTripFindings(original, options.baseline, result, superseded.rootVariables) : []),
|
|
694
698
|
...entryPointRepairs,
|
|
695
699
|
...processorRepairs,
|
|
700
|
+
...taxonomyRepairs,
|
|
696
701
|
...mergedFileFindings(result, original),
|
|
697
702
|
];
|
|
698
703
|
const agentFindings = (authored) => embeddedAgentFindings(!!options.baseline, [
|
|
@@ -771,6 +776,37 @@ function provisionKeylessExtractNodes(nodes, editedNodes) {
|
|
|
771
776
|
}
|
|
772
777
|
return out;
|
|
773
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* Give each Extract document group and field that has no taxonomy id the one
|
|
781
|
+
* the edited compile minted for it (`x-uipath-field-group-id`,
|
|
782
|
+
* `x-uipath-field-id`), the way `uip maestro flow nodes schema set` filled them.
|
|
783
|
+
*
|
|
784
|
+
* Compile mints an id for every entry that has none, the same one on every
|
|
785
|
+
* recompile, so the no-edit baseline carries the same id as the edit, and the
|
|
786
|
+
* delta merge read it as unchanged and kept the original's id-less entry:
|
|
787
|
+
* `flow validate` kept warning, with no CLI-free way to repair it (#2259). A
|
|
788
|
+
* node kept from the original gets the ids too, since that is the repair a
|
|
789
|
+
* decompile -> merge round trip exists to make. An id the node names is never
|
|
790
|
+
* replaced, and a node with every id is left as it is.
|
|
791
|
+
*/
|
|
792
|
+
function mintMissingTaxonomyIds(nodes, editedNodes, flowId) {
|
|
793
|
+
const out = [];
|
|
794
|
+
for (const node of nodes) {
|
|
795
|
+
const filled = fillMissingTaxonomyIds(node, editedNodes.get(node.id), flowId);
|
|
796
|
+
if (filled === undefined)
|
|
797
|
+
continue;
|
|
798
|
+
const parts = [
|
|
799
|
+
filled.groupIds > 0 ? `${filled.groupIds} field group id(s) (x-uipath-field-group-id)` : '',
|
|
800
|
+
filled.fieldIds > 0 ? `${filled.fieldIds} field id(s) (x-uipath-field-id)` : '',
|
|
801
|
+
filled.parentGroupIds > 0 ? `${filled.parentGroupIds} parent group reference(s)` : '',
|
|
802
|
+
].filter((p) => p.length > 0);
|
|
803
|
+
out.push({
|
|
804
|
+
kind: 'taxonomy-ids-minted', refuses: false,
|
|
805
|
+
message: `Extract document node "${node.id}" had taxonomy entries with no id; gave them ${parts.join(', ')}, the ones compile minted.`,
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
return out;
|
|
809
|
+
}
|
|
774
810
|
/**
|
|
775
811
|
* Whether the merged node for `orig` must be built from the original rather than
|
|
776
812
|
* taken from `edited`: the original is an embedded agent and the edited node is
|
|
@@ -7,3 +7,5 @@ export declare const documentFlowFamily: FlowNodeFamily;
|
|
|
7
7
|
* `merge.ts`) and `bindings_v2.json`: pure, and not part of the public surface.
|
|
8
8
|
*/
|
|
9
9
|
export { buildIdpProcessorSpec, collectWorkflowNodes, DEFAULT_IDP_PROCESSOR_NAME, deriveIdpProcessorName, DYNAMIC_EXTRACT_TYPE, idpProcessorBindingRows, idpProcessorResourcePath, isIdpProcessorReadOnly, isIdpProcessorResource, isPublishedIdpProcessorLink, readAuthoringProcessorKey, readIdpProcessorFolderPath, readIdpProcessorKey, readIdpProcessorName, readNodeLabel, updateIdpProcessorResource, withIdpProcessorRows, wrapIdpProcessorSpec, type IdpProcessorBindingRow, type WorkflowNodeLike, } from './idp-processor.js';
|
|
10
|
+
/** The taxonomy ids `merge` gives an Extract document node (#2259): pure, and not part of the public surface. */
|
|
11
|
+
export { fillMissingTaxonomyIds, type FilledTaxonomyIds } from './merge-taxonomy.js';
|
|
@@ -12,3 +12,5 @@ export const documentFlowFamily = {
|
|
|
12
12
|
* `merge.ts`) and `bindings_v2.json`: pure, and not part of the public surface.
|
|
13
13
|
*/
|
|
14
14
|
export { buildIdpProcessorSpec, collectWorkflowNodes, DEFAULT_IDP_PROCESSOR_NAME, deriveIdpProcessorName, DYNAMIC_EXTRACT_TYPE, idpProcessorBindingRows, idpProcessorResourcePath, isIdpProcessorReadOnly, isIdpProcessorResource, isPublishedIdpProcessorLink, readAuthoringProcessorKey, readIdpProcessorFolderPath, readIdpProcessorKey, readIdpProcessorName, readNodeLabel, updateIdpProcessorResource, withIdpProcessorRows, wrapIdpProcessorSpec, } from './idp-processor.js';
|
|
15
|
+
/** The taxonomy ids `merge` gives an Extract document node (#2259): pure, and not part of the public surface. */
|
|
16
|
+
export { fillMissingTaxonomyIds } from './merge-taxonomy.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** A flow node as merge holds it: only what this module reads. */
|
|
2
|
+
export interface TaxonomyNodeLike {
|
|
3
|
+
id: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
inputs?: unknown;
|
|
6
|
+
}
|
|
7
|
+
/** How many ids {@link fillMissingTaxonomyIds} wrote onto one node. */
|
|
8
|
+
export interface FilledTaxonomyIds {
|
|
9
|
+
groupIds: number;
|
|
10
|
+
fieldIds: number;
|
|
11
|
+
parentGroupIds: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Write onto `node` (MUTATED) each taxonomy id its schema document lacks: the
|
|
15
|
+
* id `edited` (the edited compile's node of the same id) has for the same
|
|
16
|
+
* entry, else the one compile mints for it from `flowId` and the node id.
|
|
17
|
+
* A nested group with no parent reference gets its parent's id. `undefined`
|
|
18
|
+
* when the node is not an Extract document node, carries an unsaved Schema
|
|
19
|
+
* Editor draft, or lacks no id.
|
|
20
|
+
*
|
|
21
|
+
* For instance, an original group `Invoice` with no `x-uipath-field-group-id`
|
|
22
|
+
* merges to `"x-uipath-field-group-id": "<the id compile minted for Invoice>"`,
|
|
23
|
+
* and its field `Total` gets the field id compile minted under that group.
|
|
24
|
+
*/
|
|
25
|
+
export declare function fillMissingTaxonomyIds(node: TaxonomyNodeLike, edited: TaxonomyNodeLike | undefined, flowId: string): FilledTaxonomyIds | undefined;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The taxonomy ids `merge` gives an Extract document node (builder-sdk#2259):
|
|
3
|
+
* every field group and field the merged node leaves without an id gets the
|
|
4
|
+
* one the edited compile minted for the same entry.
|
|
5
|
+
*
|
|
6
|
+
* Compile mints an id for each group and field that has none
|
|
7
|
+
* ({@link settleTaxonomyIds}, the same id on every recompile). So the no-edit
|
|
8
|
+
* baseline and the edit carry the same minted id, the delta merge reads it as
|
|
9
|
+
* unchanged, and the merged node keeps the original's entry, which has none.
|
|
10
|
+
* Merge is the only SDK-route writer of an existing flow, so without this an
|
|
11
|
+
* id-less taxonomy kept failing `flow validate`'s taxonomy-id warnings.
|
|
12
|
+
*
|
|
13
|
+
* Only missing ids are written, in place: an id the merged node names is never
|
|
14
|
+
* replaced, nothing else in the document moves (no business check is dropped,
|
|
15
|
+
* no object is closed), and a node with every id is not touched. A node that
|
|
16
|
+
* carries an unsaved Schema Editor draft (`x-uipath-schema-editor-draft`) is not
|
|
17
|
+
* touched either: `uip maestro flow nodes schema set` refused to write one, and
|
|
18
|
+
* minting ids there would turn a no-edit merge into a change of a document
|
|
19
|
+
* someone is still editing. Pure: the flow core is portable (FB015).
|
|
20
|
+
*/
|
|
21
|
+
import { DYNAMIC_EXTRACT_TYPE } from './idp-processor.js';
|
|
22
|
+
import { derivedTaxonomyMint, FIELD_GROUP_ID_EXTENSION, FIELD_ID_EXTENSION, isRecord, PARENT_FIELD_GROUP_ID_EXTENSION, readOutputSchema, SCHEMA_EDITOR_DRAFT_EXTENSION, settleTaxonomyIds, } from './taxonomy.js';
|
|
23
|
+
const present = (id) => id !== undefined && id.length > 0;
|
|
24
|
+
const isNested = (group) => group.segments.length > 1;
|
|
25
|
+
/** The node's `inputs.schemaDocument` when it is an Extract document node with an `outputSchema` object. */
|
|
26
|
+
function schemaDocumentOf(node) {
|
|
27
|
+
if (node?.type !== DYNAMIC_EXTRACT_TYPE || !isRecord(node.inputs))
|
|
28
|
+
return undefined;
|
|
29
|
+
const document = node.inputs.schemaDocument;
|
|
30
|
+
return isRecord(document) && isRecord(document.outputSchema) ? document : undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Write onto `node` (MUTATED) each taxonomy id its schema document lacks: the
|
|
34
|
+
* id `edited` (the edited compile's node of the same id) has for the same
|
|
35
|
+
* entry, else the one compile mints for it from `flowId` and the node id.
|
|
36
|
+
* A nested group with no parent reference gets its parent's id. `undefined`
|
|
37
|
+
* when the node is not an Extract document node, carries an unsaved Schema
|
|
38
|
+
* Editor draft, or lacks no id.
|
|
39
|
+
*
|
|
40
|
+
* For instance, an original group `Invoice` with no `x-uipath-field-group-id`
|
|
41
|
+
* merges to `"x-uipath-field-group-id": "<the id compile minted for Invoice>"`,
|
|
42
|
+
* and its field `Total` gets the field id compile minted under that group.
|
|
43
|
+
*/
|
|
44
|
+
export function fillMissingTaxonomyIds(node, edited, flowId) {
|
|
45
|
+
const document = schemaDocumentOf(node);
|
|
46
|
+
if (document === undefined || Object.hasOwn(document, SCHEMA_EDITOR_DRAFT_EXTENSION))
|
|
47
|
+
return undefined;
|
|
48
|
+
const groups = readOutputSchema(document.outputSchema).groups;
|
|
49
|
+
const lacks = groups.some((g) => !present(g.groupId) || (isNested(g) && !present(g.parentGroupId))
|
|
50
|
+
|| g.fields.some((f) => !present(f.fieldId)));
|
|
51
|
+
if (!lacks)
|
|
52
|
+
return undefined;
|
|
53
|
+
// The ids compile would settle on for this document: its own, else the edited
|
|
54
|
+
// compile's for the same entry, else a fresh mint. Read, never written back
|
|
55
|
+
// whole: only the missing ones are copied onto the node.
|
|
56
|
+
const settled = settleTaxonomyIds(document, schemaDocumentOf(edited), derivedTaxonomyMint(flowId, node.id)).document;
|
|
57
|
+
const settledGroups = new Map(readOutputSchema(settled.outputSchema).groups.map((g) => [g.pathKey, g]));
|
|
58
|
+
const filled = { groupIds: 0, fieldIds: 0, parentGroupIds: 0 };
|
|
59
|
+
for (const group of groups) {
|
|
60
|
+
const s = settledGroups.get(group.pathKey);
|
|
61
|
+
if (s === undefined)
|
|
62
|
+
continue;
|
|
63
|
+
if (!present(group.groupId) && present(s.groupId)) {
|
|
64
|
+
group.node[FIELD_GROUP_ID_EXTENSION] = s.groupId;
|
|
65
|
+
filled.groupIds++;
|
|
66
|
+
}
|
|
67
|
+
if (isNested(group) && !present(group.parentGroupId) && present(s.parentGroupId)) {
|
|
68
|
+
group.node[PARENT_FIELD_GROUP_ID_EXTENSION] = s.parentGroupId;
|
|
69
|
+
filled.parentGroupIds++;
|
|
70
|
+
}
|
|
71
|
+
const settledFields = new Map(s.fields.map((f) => [f.name, f]));
|
|
72
|
+
for (const field of group.fields) {
|
|
73
|
+
const sf = settledFields.get(field.name);
|
|
74
|
+
if (present(field.fieldId) || sf === undefined || !present(sf.fieldId))
|
|
75
|
+
continue;
|
|
76
|
+
field.node[FIELD_ID_EXTENSION] = sf.fieldId;
|
|
77
|
+
filled.fieldIds++;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return filled.groupIds + filled.fieldIds + filled.parentGroupIds > 0 ? filled : undefined;
|
|
81
|
+
}
|
|
@@ -5,6 +5,11 @@ export declare const FIELD_GROUP_ID_EXTENSION = "x-uipath-field-group-id";
|
|
|
5
5
|
export declare const FIELD_ID_EXTENSION = "x-uipath-field-id";
|
|
6
6
|
/** Vendor extension naming the group a nested group hangs under. */
|
|
7
7
|
export declare const PARENT_FIELD_GROUP_ID_EXTENSION = "x-uipath-parent-field-group-id";
|
|
8
|
+
/**
|
|
9
|
+
* Where the Studio Web Schema Editor parks an unsaved draft of the taxonomy,
|
|
10
|
+
* beside the saved one (flow-schema `IXP_SCHEMA_EDITOR_DRAFT_EXTENSION`).
|
|
11
|
+
*/
|
|
12
|
+
export declare const SCHEMA_EDITOR_DRAFT_EXTENSION = "x-uipath-schema-editor-draft";
|
|
8
13
|
/** Vendor extension holding business checks, which reference fields by id. */
|
|
9
14
|
export declare const BUSINESS_CHECKS_EXTENSION = "x-uipath-business-checks";
|
|
10
15
|
/** Joins the segments of a nested field group's flattened property key: `Invoice > Line items`. */
|
|
@@ -22,6 +22,11 @@ export const FIELD_GROUP_ID_EXTENSION = 'x-uipath-field-group-id';
|
|
|
22
22
|
export const FIELD_ID_EXTENSION = 'x-uipath-field-id';
|
|
23
23
|
/** Vendor extension naming the group a nested group hangs under. */
|
|
24
24
|
export const PARENT_FIELD_GROUP_ID_EXTENSION = 'x-uipath-parent-field-group-id';
|
|
25
|
+
/**
|
|
26
|
+
* Where the Studio Web Schema Editor parks an unsaved draft of the taxonomy,
|
|
27
|
+
* beside the saved one (flow-schema `IXP_SCHEMA_EDITOR_DRAFT_EXTENSION`).
|
|
28
|
+
*/
|
|
29
|
+
export const SCHEMA_EDITOR_DRAFT_EXTENSION = 'x-uipath-schema-editor-draft';
|
|
25
30
|
/** Vendor extension holding business checks, which reference fields by id. */
|
|
26
31
|
export const BUSINESS_CHECKS_EXTENSION = 'x-uipath-business-checks';
|
|
27
32
|
/** Joins the segments of a nested field group's flattened property key: `Invoice > Line items`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.124.
|
|
3
|
+
"version": "6.124.16",
|
|
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",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"@types/node": "^22.7.0",
|
|
129
129
|
"esbuild": "^0.28.1"
|
|
130
130
|
},
|
|
131
|
-
"gitref": "
|
|
131
|
+
"gitref": "69972fc73389bf91d26f06a02279ad810879b6bc"
|
|
132
132
|
}
|