@uipath/maestro-builder-sdk 6.124.14 → 6.124.15
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-cli.js
CHANGED
|
@@ -89,6 +89,9 @@ import { existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, realpathSy
|
|
|
89
89
|
import { inlineAgentResources, mergeBindingsV2, projectBindingRows, refreshInlineAgentRows } from './bindings-v2.js';
|
|
90
90
|
import { readBindingsV2, readInlineAgentFiles } from './bindings-v2-files.js';
|
|
91
91
|
import { readSolutionProjects } from './solution-projects-files.js';
|
|
92
|
+
import { provisionIdpProcessors } from './idp-processor-files.js';
|
|
93
|
+
import { collectWorkflowNodes, DYNAMIC_EXTRACT_TYPE, idpProcessorBindingRows, withIdpProcessorRows } from './nodes/document/flow/family.js';
|
|
94
|
+
import { stableJson } from './merge-variables.js';
|
|
92
95
|
import { basename, dirname, join, relative, resolve } from 'node:path';
|
|
93
96
|
import { MergeRefusedError, mergeFlowWithSidecars } from './merge.js';
|
|
94
97
|
import { sidecarSetFromList } from './merge-sidecars.js';
|
|
@@ -156,7 +159,7 @@ export function sidecarsBeside(flowPath) {
|
|
|
156
159
|
* as it will stand once the candidate is installed: the original's files, with
|
|
157
160
|
* merge's writes over them and its removals taken out.
|
|
158
161
|
*/
|
|
159
|
-
function projectBindings(projectDir, originalPath, mergedFlow, writes, removals) {
|
|
162
|
+
function projectBindings(projectDir, originalPath, mergedFlow, writes, removals, processorNames) {
|
|
160
163
|
if (!existsSync(join(projectDir, 'project.uiproj')))
|
|
161
164
|
return undefined;
|
|
162
165
|
const self = resolve(originalPath);
|
|
@@ -220,14 +223,20 @@ function projectBindings(projectDir, originalPath, mergedFlow, writes, removals)
|
|
|
220
223
|
const existing = readBindingsV2(join(projectDir, 'bindings_v2.json'));
|
|
221
224
|
const current = existing?.resources ?? [];
|
|
222
225
|
const derived = mainElsewhere ? undefined : projectBindingRows(rowFlows);
|
|
226
|
+
// The `idpProcessor` row of each processor the flows' Extract document nodes
|
|
227
|
+
// name, as compile and pack derive them (#1984).
|
|
228
|
+
const processorRows = derived
|
|
229
|
+
? rowFlows.flatMap((f) => idpProcessorBindingRows(f.flow && typeof f.flow === 'object' ? f.flow : {}, processorNames))
|
|
230
|
+
: [];
|
|
223
231
|
const declares = (derived?.connections.length ?? 0) > 0 || (derived?.entities.length ?? 0) > 0
|
|
224
|
-
|| agents.some((a) => inlineAgentResources(a).length > 0);
|
|
232
|
+
|| processorRows.length > 0 || agents.some((a) => inlineAgentResources(a).length > 0);
|
|
225
233
|
if (existing === undefined && !declares)
|
|
226
234
|
return undefined;
|
|
227
235
|
const base = derived
|
|
228
236
|
? mergeBindingsV2(existing, derived.connections, derived.entities, { keepUnderived: derived.unreadable.length > 0 }).resources
|
|
229
237
|
: current;
|
|
230
|
-
const
|
|
238
|
+
const refreshed = refreshInlineAgentRows(base, agents, removedBodies);
|
|
239
|
+
const after = derived ? withIdpProcessorRows(refreshed, processorRows, { keepUnderived: derived.unreadable.length > 0 }) : refreshed;
|
|
231
240
|
const settled = (rows) => JSON.stringify(rows.map((r) => JSON.stringify(r)).sort());
|
|
232
241
|
if (settled(after) === settled(current))
|
|
233
242
|
return undefined;
|
|
@@ -629,6 +638,19 @@ export async function run(argv) {
|
|
|
629
638
|
return 1;
|
|
630
639
|
}
|
|
631
640
|
const flow = merged.flow;
|
|
641
|
+
// Each Extract document node the merge took from the edit, or gave the key
|
|
642
|
+
// compile minted (merge.ts `provisionKeylessExtractNodes`): its IDP processor's
|
|
643
|
+
// resource file in the solution and its name on the node, as compile leaves
|
|
644
|
+
// them (#1984), so validate and pack pass with no CLI step after merge. Only
|
|
645
|
+
// for the flow the project packs, by compile's rule; a candidate written
|
|
646
|
+
// elsewhere must not rewrite the solution's processors. A node kept from the
|
|
647
|
+
// original whole is left as it is, name and resource file included.
|
|
648
|
+
const outProject = flowProjectOf(resolve(out));
|
|
649
|
+
const outMain = outProject !== undefined ? projectMainFlow(outProject).file : undefined;
|
|
650
|
+
const packsThisFlow = outProject !== undefined
|
|
651
|
+
&& (outMain !== undefined ? resolve(outMain) === resolve(out) : outProject === resolve(outDir));
|
|
652
|
+
const touched = packsThisFlow ? touchedExtractNodes(original, flow) : [];
|
|
653
|
+
const processors = touched.length > 0 ? provisionIdpProcessors({ nodes: touched }, outProject) : undefined;
|
|
632
654
|
mkdirSync(outDir, { recursive: true });
|
|
633
655
|
writeJsonFile(out, flow);
|
|
634
656
|
console.log(`flow-merge: wrote ${basename(out)} (${(flow.nodes ?? []).length} nodes, ${(flow.edges ?? []).length} edges)`);
|
|
@@ -645,6 +667,12 @@ export async function run(argv) {
|
|
|
645
667
|
writeJsonFile(target, sidecar.json);
|
|
646
668
|
console.log(`flow-merge: wrote ${sidecar.path} (carries ${sidecar.carried.join(', ')})`);
|
|
647
669
|
}
|
|
670
|
+
for (const path of processors?.written ?? [])
|
|
671
|
+
console.log(`flow-merge: wrote ${path} (IDP processor)`);
|
|
672
|
+
for (const why of processors?.skipped ?? [])
|
|
673
|
+
console.error(`flow-merge: did not write the IDP processor ${why}`);
|
|
674
|
+
if (processors?.pending !== undefined)
|
|
675
|
+
console.log(`flow-merge: ${processors.pending}`);
|
|
648
676
|
for (const { nodeId, inputs } of merged.onNodes) {
|
|
649
677
|
console.log(`flow-merge: carried the agent.json edit onto embedded agent "${nodeId}" (${inputs.map((k) => `inputs.${k}`).join(', ')})`);
|
|
650
678
|
}
|
|
@@ -661,7 +689,7 @@ export async function run(argv) {
|
|
|
661
689
|
});
|
|
662
690
|
// Derived before anything is deleted: a removed resource's row is matched by
|
|
663
691
|
// the body read from its file.
|
|
664
|
-
const bindingsV2 = projectBindings(originalDir, originalPath, flow, merged.sidecars, removals);
|
|
692
|
+
const bindingsV2 = projectBindings(originalDir, originalPath, flow, merged.sidecars, removals, processors?.namesByKey);
|
|
665
693
|
// Written over the original, merge deletes what it has just made unreferenced
|
|
666
694
|
// itself (#1995): each agent resource directory the edit removed, and, for a
|
|
667
695
|
// split original now written as one file, its part files. Only paths it can
|
|
@@ -741,7 +769,7 @@ export async function run(argv) {
|
|
|
741
769
|
}
|
|
742
770
|
if (bindingsV2 !== undefined) {
|
|
743
771
|
writeJsonFile(join(outDir, 'bindings_v2.json'), bindingsV2);
|
|
744
|
-
console.log('flow-merge: wrote bindings_v2.json (connection and agent resource rows, re-derived as compile does)');
|
|
772
|
+
console.log('flow-merge: wrote bindings_v2.json (connection, IDP processor and agent resource rows, re-derived as compile does)');
|
|
745
773
|
}
|
|
746
774
|
// Written over the original: point the source's stamp at the merged file, so the
|
|
747
775
|
// next edit-and-merge round on the same source passes the check. Its digest is
|
|
@@ -788,6 +816,21 @@ export async function run(argv) {
|
|
|
788
816
|
});
|
|
789
817
|
return 0;
|
|
790
818
|
}
|
|
819
|
+
/**
|
|
820
|
+
* The merged flow's Extract document nodes that differ from the original's node
|
|
821
|
+
* of the same id, or that the original lacks: the ones merge took from the edit
|
|
822
|
+
* or gave a processor key. Root and subflows; the objects are `merged`'s own,
|
|
823
|
+
* so provisioning them writes into the merged flow.
|
|
824
|
+
*/
|
|
825
|
+
function touchedExtractNodes(original, merged) {
|
|
826
|
+
const before = new Map(collectWorkflowNodes(original).map((n) => [n.id, n]));
|
|
827
|
+
return collectWorkflowNodes(merged).filter((n) => {
|
|
828
|
+
if (n.type !== DYNAMIC_EXTRACT_TYPE)
|
|
829
|
+
return false;
|
|
830
|
+
const was = before.get(n.id);
|
|
831
|
+
return was === undefined || stableJson(was) !== stableJson(n);
|
|
832
|
+
});
|
|
833
|
+
}
|
|
791
834
|
/**
|
|
792
835
|
* The error for a refusal on an untouched node that restoring it from the
|
|
793
836
|
* original would not undo, with the step to take: a crash is an SDK defect;
|
|
@@ -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';
|
|
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';
|
|
37
37
|
/** The finding, phrased for the author, naming the node, edge or row. */
|
|
38
38
|
message: string;
|
|
39
39
|
/**
|
|
@@ -41,7 +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`, which
|
|
44
|
+
* `entry-point-repaired` and `processor-provisioned`, which report a fix
|
|
45
|
+
* merge made.
|
|
45
46
|
*/
|
|
46
47
|
refuses: boolean;
|
|
47
48
|
}
|
package/dist/merge.js
CHANGED
|
@@ -109,6 +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
113
|
import { byId, isKept, nodeUnchanged, subflowsTakenFromEdited } from './edit-scope.js';
|
|
113
114
|
export { MergeRefusedError } from './merge-roundtrip.js';
|
|
114
115
|
/**
|
|
@@ -578,6 +579,10 @@ function mergeFlowFindings(original, edited, options) {
|
|
|
578
579
|
if (options.baseline)
|
|
579
580
|
keepOriginalSourcesInSubflows(original, takenEntries, options.baseline);
|
|
580
581
|
const subflowScopes = Object.values(result.subflows);
|
|
582
|
+
// ── Processors: an Extract document node that authors a processor but names
|
|
583
|
+
// none gets the key the edited compile minted for it, kept or edited
|
|
584
|
+
// (provisionKeylessExtractNodes). ──
|
|
585
|
+
const processorRepairs = provisionKeylessExtractNodes([...finalNodes, ...subflowScopes.flatMap((sf) => sf?.nodes ?? [])], byId([...(edited.nodes ?? []), ...Object.values(edited.subflows ?? {}).flatMap((sf) => sf?.nodes ?? [])]));
|
|
581
586
|
// ── Variables: the same delta as nodes, per entry — what the author did not
|
|
582
587
|
// change stays the original's, so compile's own spellings (an added
|
|
583
588
|
// `name`, a re-derived End output type) do not reach the file (#1261).
|
|
@@ -687,6 +692,7 @@ function mergeFlowFindings(original, edited, options) {
|
|
|
687
692
|
...superseded.findings,
|
|
688
693
|
...(options.baseline ? roundTripFindings(original, options.baseline, result, superseded.rootVariables) : []),
|
|
689
694
|
...entryPointRepairs,
|
|
695
|
+
...processorRepairs,
|
|
690
696
|
...mergedFileFindings(result, original),
|
|
691
697
|
];
|
|
692
698
|
const agentFindings = (authored) => embeddedAgentFindings(!!options.baseline, [
|
|
@@ -722,6 +728,49 @@ function repairEntryPointIds(nodes, editedNodes) {
|
|
|
722
728
|
}
|
|
723
729
|
return out;
|
|
724
730
|
}
|
|
731
|
+
/**
|
|
732
|
+
* Give each Extract document node that authors a processor but names none the
|
|
733
|
+
* `inputs.processorKey` the edited compile minted for it, the repair an older
|
|
734
|
+
* `uip`'s `nodes provision` made.
|
|
735
|
+
*
|
|
736
|
+
* Compile mints a key for every such step (one per node, the same on every
|
|
737
|
+
* recompile), so the no-edit baseline carries the same key as the edit, and
|
|
738
|
+
* the delta merge read the key as unchanged and kept the original's keyless
|
|
739
|
+
* node: `flow validate` then refused the merged file and a deployed run
|
|
740
|
+
* extracted nothing. A node kept from the original gets the key too, since
|
|
741
|
+
* that is the repair a decompile -> merge round trip exists to make. A
|
|
742
|
+
* read-only mirror (`processorReadOnly`) and a link to a tenant processor
|
|
743
|
+
* (`processorFolderPath`) author nothing, so they get no key, as compile mints
|
|
744
|
+
* them none. A key the node already names is never replaced.
|
|
745
|
+
*
|
|
746
|
+
* For instance, an original `extractInvoice1` with no key merges to
|
|
747
|
+
* `"processorKey": "<the key compile minted for extractInvoice1>"`; `merge-cli`
|
|
748
|
+
* then writes its resource file when the flow is the solution's.
|
|
749
|
+
*/
|
|
750
|
+
function provisionKeylessExtractNodes(nodes, editedNodes) {
|
|
751
|
+
const out = [];
|
|
752
|
+
for (const node of nodes) {
|
|
753
|
+
if (node.type !== DYNAMIC_EXTRACT_TYPE || !isRecord(node.inputs))
|
|
754
|
+
continue;
|
|
755
|
+
const inputs = node.inputs;
|
|
756
|
+
if (readIdpProcessorKey(inputs) !== undefined)
|
|
757
|
+
continue;
|
|
758
|
+
if (isIdpProcessorReadOnly(inputs) || readIdpProcessorFolderPath(inputs) !== undefined)
|
|
759
|
+
continue;
|
|
760
|
+
const e = editedNodes.get(node.id);
|
|
761
|
+
if (e?.type !== DYNAMIC_EXTRACT_TYPE)
|
|
762
|
+
continue;
|
|
763
|
+
const minted = readIdpProcessorKey(e.inputs);
|
|
764
|
+
if (minted === undefined)
|
|
765
|
+
continue;
|
|
766
|
+
inputs.processorKey = minted;
|
|
767
|
+
out.push({
|
|
768
|
+
kind: 'processor-provisioned', refuses: false,
|
|
769
|
+
message: `Extract document node "${node.id}" named no IDP processor (inputs.processorKey); gave it ${minted}, the key compile minted for it.`,
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
return out;
|
|
773
|
+
}
|
|
725
774
|
/**
|
|
726
775
|
* Whether the merged node for `orig` must be built from the original rather than
|
|
727
776
|
* taken from `edited`: the original is an embedded agent and the edited node is
|
|
@@ -3,7 +3,7 @@ import type { FlowNodeFamily } from '../../../flow-node-type.js';
|
|
|
3
3
|
export { isIxpNodeType } from './ixp.js';
|
|
4
4
|
export declare const documentFlowFamily: FlowNodeFamily;
|
|
5
5
|
/**
|
|
6
|
-
* The IDP processor rules, for `compile` (`idp-processor-files.ts
|
|
7
|
-
* `bindings_v2.json`: pure, and not part of the public surface.
|
|
6
|
+
* The IDP processor rules, for `compile` and `merge` (`idp-processor-files.ts`,
|
|
7
|
+
* `merge.ts`) and `bindings_v2.json`: pure, and not part of the public surface.
|
|
8
8
|
*/
|
|
9
|
-
export { buildIdpProcessorSpec, collectWorkflowNodes, DEFAULT_IDP_PROCESSOR_NAME, deriveIdpProcessorName, DYNAMIC_EXTRACT_TYPE, idpProcessorBindingRows, idpProcessorResourcePath, isIdpProcessorResource, isPublishedIdpProcessorLink, readAuthoringProcessorKey, readIdpProcessorName, readNodeLabel, updateIdpProcessorResource, withIdpProcessorRows, wrapIdpProcessorSpec, type IdpProcessorBindingRow, type WorkflowNodeLike, } from './idp-processor.js';
|
|
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';
|
|
@@ -8,7 +8,7 @@ export const documentFlowFamily = {
|
|
|
8
8
|
diagnostics: { ...DOCUMENT_DIAGNOSTICS, ...IXP_DIAGNOSTICS },
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
* The IDP processor rules, for `compile` (`idp-processor-files.ts
|
|
12
|
-
* `bindings_v2.json`: pure, and not part of the public surface.
|
|
11
|
+
* The IDP processor rules, for `compile` and `merge` (`idp-processor-files.ts`,
|
|
12
|
+
* `merge.ts`) and `bindings_v2.json`: pure, and not part of the public surface.
|
|
13
13
|
*/
|
|
14
|
-
export { buildIdpProcessorSpec, collectWorkflowNodes, DEFAULT_IDP_PROCESSOR_NAME, deriveIdpProcessorName, DYNAMIC_EXTRACT_TYPE, idpProcessorBindingRows, idpProcessorResourcePath, isIdpProcessorResource, isPublishedIdpProcessorLink, readAuthoringProcessorKey, readIdpProcessorName, readNodeLabel, updateIdpProcessorResource, withIdpProcessorRows, wrapIdpProcessorSpec, } from './idp-processor.js';
|
|
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';
|
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.15",
|
|
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": "32dac4a9b497fb2affda9c8629aad6a4117637e9"
|
|
132
132
|
}
|