@uipath/maestro-builder-sdk 6.96.1 → 6.96.3
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/api-index.md +77 -70
- package/dist/api-members.md +187 -182
- package/dist/bpmn-api.md +24 -0
- package/dist/case/decompile-cli.js +28 -9
- package/dist/case/plan-connectors.d.ts +105 -0
- package/dist/case/plan-connectors.js +545 -0
- package/dist/check-cli.js +1 -1
- package/dist/cli/commands/flow.js +2 -0
- package/dist/core/actions.d.ts +17 -0
- package/dist/core/actions.js +2 -0
- package/dist/core/carried-connector-operation.d.ts +120 -0
- package/dist/core/carried-connector-operation.js +297 -0
- package/dist/core/library.d.ts +12 -0
- package/dist/core/library.js +14 -0
- package/dist/decompile-cli.js +21 -2
- package/dist/decompile.d.ts +13 -0
- package/dist/decompile.js +23 -1
- package/dist/flow-node-type.d.ts +19 -0
- package/dist/merge-cli.js +2 -1
- package/dist/merge-compile.d.ts +9 -0
- package/dist/merge-compile.js +5 -1
- package/dist/nodes/connector/flow/node-type.js +86 -5
- package/dist/registry/prepare/event.js +3 -2
- package/dist/registry/prepare/messages.d.ts +9 -0
- package/dist/registry/prepare/messages.js +15 -0
- package/dist/registry/prepare/overlay.d.ts +22 -2
- package/dist/registry/prepare/overlay.js +80 -2
- package/dist/registry/prepare/pipeline.js +3 -2
- package/package.json +2 -2
package/dist/merge-compile.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type CollectedRefusal, type DraftFinding, type SerializeOpts } from './
|
|
|
2
2
|
import { type CheckOpts } from './check.js';
|
|
3
3
|
import { type PlacedDiagnostic } from './edit-scope.js';
|
|
4
4
|
import type { BuiltFlow } from './flow-sdk.js';
|
|
5
|
+
import type { Library } from './core/library.js';
|
|
5
6
|
/**
|
|
6
7
|
* A compile's flow, the draft refusals it reported instead of throwing, the
|
|
7
8
|
* lowering refusals collect mode reported on the steps it stood in for (or on
|
|
@@ -41,6 +42,14 @@ export interface OriginalDecompileOptions {
|
|
|
41
42
|
scripts?: 'function' | 'string';
|
|
42
43
|
/** As `flow decompile --strict`. */
|
|
43
44
|
strict?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The connector library the source will compile against, as `flow decompile`
|
|
47
|
+
* opens it: an operation it lacks is carried from the file
|
|
48
|
+
* (`core/carried-connector-operation.ts`). Not stamped: `flow decompile` and
|
|
49
|
+
* `flow merge` open the same one (`--library`, else `$FLOW_SDK_LIBRARY_JSON`,
|
|
50
|
+
* else the pulled cache).
|
|
51
|
+
*/
|
|
52
|
+
library?: Library;
|
|
44
53
|
}
|
|
45
54
|
/**
|
|
46
55
|
* The baseline of `originalPath`: decompile it (reading agent sidecars beside
|
package/dist/merge-compile.js
CHANGED
|
@@ -60,7 +60,10 @@ export async function baselineFromOriginal(originalPath, opts = {}, warn, decomp
|
|
|
60
60
|
// as written: resolving it through the project's bindings.json would make a
|
|
61
61
|
// label-to-id edit identical to the baseline and merge would drop it.
|
|
62
62
|
const asSaved = { ...opts, bindings: new Bindings() };
|
|
63
|
-
|
|
63
|
+
// Decompiled against the library the baseline compiles with, so an operation
|
|
64
|
+
// it lacks is carried, as `flow decompile` carried it.
|
|
65
|
+
const withLibrary = { ...(opts.library ? { library: opts.library } : {}), ...decompileOpts };
|
|
66
|
+
return withDecompiledOriginal(originalPath, (built, source) => ({ ...compileDraftTolerant(built, asSaved), built, source }), warn, withLibrary);
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
66
69
|
* The source `flow decompile` makes of the `.flow` at `path` with `opts`, the SDK
|
|
@@ -72,6 +75,7 @@ export function decompileOriginal(path, opts = {}, warn) {
|
|
|
72
75
|
bestEffort: opts.strict !== true,
|
|
73
76
|
scripts: opts.scripts ?? 'function',
|
|
74
77
|
warn,
|
|
78
|
+
...(opts.library ? { library: opts.library } : {}),
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BindingRefusal, bindingMissingMessage, missingBindingLabels } from '../../../core/binding-messages.js';
|
|
2
|
-
import { prepareCommand } from '../../../core/cli-spelling.js';
|
|
2
|
+
import { PULL_COMMAND, prepareCommand } from '../../../core/cli-spelling.js';
|
|
3
|
+
import { carriedConnector, carriedDefinitionMismatch, carriedOperationOf, carriedOperationRefusal, } from '../../../core/carried-connector-operation.js';
|
|
3
4
|
import { buildConfiguration, readConfigurationIdentity } from '../../../core/connector-configuration.js';
|
|
4
5
|
import { CONNECTOR_INPUT_MISSING, FLOW_EXPR_DIALECT, buildConnectorInputs, replayInputsOf, transportHttpMethod } from '../../../core/connector-inputs.js';
|
|
5
6
|
import { ConnectorResolveError } from '../../../core/connector-resolve-error.js';
|
|
@@ -63,6 +64,50 @@ function listOutputs(rc, nodeId) {
|
|
|
63
64
|
return undefined;
|
|
64
65
|
return { output: { ...subNodeId(jsonClone(out), nodeId), type: 'array' } };
|
|
65
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* The operation a step carries for a node type the library has no entry for,
|
|
69
|
+
* or `undefined` when it carries none: the step's `carried` transport and fields
|
|
70
|
+
* with the definition the flow carries for `<nodeType>@<version>` in
|
|
71
|
+
* `.definitions([...])`. Both halves, or nothing: either alone does not describe
|
|
72
|
+
* an operation, and the step stays CONNECTOR_NOT_IN_LIBRARY.
|
|
73
|
+
*/
|
|
74
|
+
function carriedResolution(spec, ctx) {
|
|
75
|
+
const version = spec.version ?? ctx.pinnedVersion;
|
|
76
|
+
if (spec.carried === undefined || version === undefined)
|
|
77
|
+
return undefined;
|
|
78
|
+
const nodeType = `${CONNECTOR_PREFIX}${spec.key}.${spec.action}`;
|
|
79
|
+
const definition = ctx.definition(nodeType, version);
|
|
80
|
+
if (!definition || typeof definition !== 'object')
|
|
81
|
+
return undefined;
|
|
82
|
+
const mismatch = carriedDefinitionMismatch(definition, spec.key, spec.carried, `Connector step "${ctx.step}"`);
|
|
83
|
+
if (mismatch)
|
|
84
|
+
throw new CompileRefusal('CARRIED_DEFINITION_INVALID', mismatch);
|
|
85
|
+
return carriedConnector(nodeType, spec.key, version, definition, spec.carried);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The library's answer for the step's operation: the entry, or what
|
|
89
|
+
* `library.resolve` threw. Only the library call is caught here, so a refusal of
|
|
90
|
+
* the step's carried operation ({@link carriedResolution}), which runs after a
|
|
91
|
+
* CONNECTOR_NOT_IN_LIBRARY answer, reaches the author with its own code.
|
|
92
|
+
*/
|
|
93
|
+
function libraryResolution(spec, library) {
|
|
94
|
+
try {
|
|
95
|
+
return { rc: library.resolve(spec.key, spec.action, spec.version, spec.object) };
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
return { error };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* What to do about an input a carried operation does not name: the file
|
|
103
|
+
* describes only the inputs its node sets, so another one needs the operation
|
|
104
|
+
* in the library.
|
|
105
|
+
*/
|
|
106
|
+
function carriedInputHint(spec) {
|
|
107
|
+
return ' This operation is not in the connector library: the step compiles from the .flow file\'s own description '
|
|
108
|
+
+ '(its `carried` option and carried definition), which names only the inputs the saved node sets. To use another input, '
|
|
109
|
+
+ `refresh the library (\`${PULL_COMMAND}\`) or prepare the operation (\`${prepareCommand(spec.key, spec.action)}\`).`;
|
|
110
|
+
}
|
|
66
111
|
function serializeConnector(spec, ctx) {
|
|
67
112
|
const step = ctx.step;
|
|
68
113
|
if (!ctx.library) {
|
|
@@ -83,11 +128,29 @@ function serializeConnector(spec, ctx) {
|
|
|
83
128
|
// The library's refusals (the operation, its fields) name the connector, not
|
|
84
129
|
// the step: they say which step as `check` always has.
|
|
85
130
|
const onStep = (refusal) => new CompileRefusal(refusal.code, `Connector step "${step}": ${refusal.message}`, refusal.suggestion);
|
|
131
|
+
const carriedRefusal = carriedOperationRefusal(spec.carried, `Connector step "${step}"`);
|
|
132
|
+
if (carriedRefusal)
|
|
133
|
+
throw new CompileRefusal('CARRIED_DEFINITION_INVALID', carriedRefusal);
|
|
134
|
+
// The library's entry, else, when the library has no entry for the node type,
|
|
135
|
+
// the operation the step carries from the file (carriedResolution). Only on
|
|
136
|
+
// that refusal: an operation the library knows is the library's, whatever the
|
|
137
|
+
// source carries, so a carried copy cannot relax it. A refusal of the carried
|
|
138
|
+
// operation itself (CARRIED_DEFINITION_INVALID) is thrown as it is.
|
|
139
|
+
const resolved = libraryResolution(spec, ctx.library);
|
|
140
|
+
const fallback = 'error' in resolved && resolved.error instanceof ConnectorResolveError
|
|
141
|
+
&& resolved.error.code === 'CONNECTOR_NOT_IN_LIBRARY'
|
|
142
|
+
? carriedResolution(spec, ctx)
|
|
143
|
+
: undefined;
|
|
144
|
+
const carried = fallback !== undefined;
|
|
86
145
|
let rc;
|
|
87
|
-
|
|
88
|
-
rc =
|
|
146
|
+
if ('rc' in resolved) {
|
|
147
|
+
rc = resolved.rc;
|
|
89
148
|
}
|
|
90
|
-
|
|
149
|
+
else if (fallback !== undefined) {
|
|
150
|
+
rc = fallback;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
const { error } = resolved;
|
|
91
154
|
if (error instanceof Error && error.message.startsWith('internal SDK error:'))
|
|
92
155
|
throw error;
|
|
93
156
|
// A throw `library.resolve` makes on no purpose is still this step's refusal,
|
|
@@ -169,7 +232,12 @@ function serializeConnector(spec, ctx) {
|
|
|
169
232
|
});
|
|
170
233
|
}
|
|
171
234
|
catch (error) {
|
|
172
|
-
|
|
235
|
+
if (!(error instanceof CompileRefusal))
|
|
236
|
+
throw error;
|
|
237
|
+
const refusal = carried && error.code === 'CONNECTOR_INPUT'
|
|
238
|
+
? new CompileRefusal(error.code, error.message + carriedInputHint(spec), error.suggestion)
|
|
239
|
+
: error;
|
|
240
|
+
throw onStep(refusal);
|
|
173
241
|
}
|
|
174
242
|
})();
|
|
175
243
|
const replayInputs = replayInputsOf(connectorInputs);
|
|
@@ -279,6 +347,9 @@ function liftConnector(node, ctx) {
|
|
|
279
347
|
kind: 'connector', ...split, inputs, connection, folder,
|
|
280
348
|
object: liftedObject(detail),
|
|
281
349
|
missing,
|
|
350
|
+
// Only for an operation the decompile's library lacks, beside the
|
|
351
|
+
// definition decompile carries for it: the two together describe it.
|
|
352
|
+
carried: ctx.carriesOperation() ? carriedOperationOf(detail) : undefined,
|
|
282
353
|
};
|
|
283
354
|
}
|
|
284
355
|
/**
|
|
@@ -328,6 +399,7 @@ function printConnector(l, ctx) {
|
|
|
328
399
|
connection: optional(l.connection),
|
|
329
400
|
folder: optional(l.folder),
|
|
330
401
|
object: optional(l.object),
|
|
402
|
+
carried: l.carried === undefined ? undefined : ctx.value(l.carried),
|
|
331
403
|
};
|
|
332
404
|
return {
|
|
333
405
|
factory: 'connector',
|
|
@@ -353,6 +425,15 @@ const connector10 = {
|
|
|
353
425
|
serialize: (spec, ctx) => serializeConnector(spec, ctx),
|
|
354
426
|
deserialize: (node, ctx) => liftConnector(node, ctx),
|
|
355
427
|
isDraft: (node, definition) => isConnectorDraft(node, definition),
|
|
428
|
+
// An operation the decompile's library has no entry for is carried from the
|
|
429
|
+
// file, when its saved detail describes one compile can rebuild.
|
|
430
|
+
carriesFromFile: (node, library) => {
|
|
431
|
+
const n = node;
|
|
432
|
+
if (typeof n.type !== 'string' || splitOperation(n.type) === undefined || library.indexes(n.type))
|
|
433
|
+
return false;
|
|
434
|
+
const detail = n.inputs?.detail;
|
|
435
|
+
return !!detail && typeof detail === 'object' && carriedOperationOf(detail) !== undefined;
|
|
436
|
+
},
|
|
356
437
|
print: (spec, ctx) => printConnector(spec, ctx),
|
|
357
438
|
check: (spec, ctx) => ctx.connector(spec),
|
|
358
439
|
// Every Expr in the inputs, nested ones included, resolves against the flow's names.
|
|
@@ -27,7 +27,7 @@ import { planLibrary } from "../library-build/plan.js";
|
|
|
27
27
|
import { recordByoaVerification } from "./byoa-ledger.js";
|
|
28
28
|
import { ConnectionRefusal, byoaConnections, byoaListing, restoreBindings } from "./connections.js";
|
|
29
29
|
import { writeResolutions } from "./ledger.js";
|
|
30
|
-
import { PREPARE_COMMAND, PrepareRefusal, byoaListingFailedMessage, byoaRecordedLine, byoaRequiredMessage, describeFallbackWarning, generatedModulesLine, eventAllObjectsMessage, eventNextLine, eventParentFieldsMessage, eventSubscription, eventSummaryLine, filterableFieldsLine, genericEventNeedsObjectMessage, lookupVocabularyLines, objectNoteLine, objectOnCuratedEventMessage, objectRecordedLine, warnLine, webhookNoteLines, } from "./messages.js";
|
|
30
|
+
import { PREPARE_COMMAND, PrepareRefusal, byoaListingFailedMessage, byoaRecordedLine, byoaRequiredMessage, describeFallbackWarning, generatedModulesLine, eventAllObjectsMessage, eventNextLine, eventParentFieldsMessage, eventSubscription, eventSummaryLine, filterableFieldsLine, genericEventNeedsObjectMessage, lookupVocabularyLines, objectNoteLine, objectOnCuratedEventMessage, objectRecordedLine, warnLine, webhookNoteLines, planRowReplacedLine, } from "./messages.js";
|
|
31
31
|
import { RESOLUTIONS_FILENAME, matchObject, recordObjectResolution } from "./objects.js";
|
|
32
32
|
import { lookupSpecsFromOverlay, mergeFilesInto } from "./overlay.js";
|
|
33
33
|
import { regenerateDescriptors } from "./regenerate.js";
|
|
@@ -227,7 +227,8 @@ export async function prepareEvent(ctx, options) {
|
|
|
227
227
|
const plan = planLibrary([definition.entry], () => definition.node);
|
|
228
228
|
for (const line of plan.warnings)
|
|
229
229
|
warn(line);
|
|
230
|
-
mergeFilesInto(plan.files, out)
|
|
230
|
+
for (const nodeType of mergeFilesInto(plan.files, out).replacedPlanRows)
|
|
231
|
+
info(planRowReplacedLine(nodeType, eventNodeType));
|
|
231
232
|
if (byoaRow !== undefined) {
|
|
232
233
|
// What `check` and `compile` look for before they accept this event on this
|
|
233
234
|
// connection: the proof that the live check above ran and passed.
|
|
@@ -322,4 +322,13 @@ export declare function descriptorUsageFallbackLines(sourcePosix: string): strin
|
|
|
322
322
|
export declare function descriptorUsageUnparsedLines(sourcePosix: string, descriptorName: string): string[];
|
|
323
323
|
/** The ready-to-paste handoff for a module with exactly one descriptor. */
|
|
324
324
|
export declare function descriptorUsageLines(descriptorName: string, importPath: string, requiredFields: ReadonlyArray<readonly [name: string, type: string]>, boundConnection: string, boundFolder: string): string[];
|
|
325
|
+
/**
|
|
326
|
+
* A plan-described entry (written by `case decompile` from the plan's own saved
|
|
327
|
+
* configuration) that this prepare's tenant description of the same operation
|
|
328
|
+
* replaced. A source decompiled against it still names the plan's operation id,
|
|
329
|
+
* which no layer has now; renaming it to the tenant's is all it needs, and
|
|
330
|
+
* keeps the edits made to that source. For instance
|
|
331
|
+
* `rename "curated-create-issue-post" to "create-issue" in a source decompiled earlier, or decompile the plan again`.
|
|
332
|
+
*/
|
|
333
|
+
export declare function planRowReplacedLine(replaced: string, preparedNodeType: string): string;
|
|
325
334
|
export {};
|
|
@@ -772,3 +772,18 @@ export function descriptorUsageLines(descriptorName, importPath, requiredFields,
|
|
|
772
772
|
"operation and object identity even when the baked action id differs",
|
|
773
773
|
];
|
|
774
774
|
}
|
|
775
|
+
/**
|
|
776
|
+
* A plan-described entry (written by `case decompile` from the plan's own saved
|
|
777
|
+
* configuration) that this prepare's tenant description of the same operation
|
|
778
|
+
* replaced. A source decompiled against it still names the plan's operation id,
|
|
779
|
+
* which no layer has now; renaming it to the tenant's is all it needs, and
|
|
780
|
+
* keeps the edits made to that source. For instance
|
|
781
|
+
* `rename "curated-create-issue-post" to "create-issue" in a source decompiled earlier, or decompile the plan again`.
|
|
782
|
+
*/
|
|
783
|
+
export function planRowReplacedLine(replaced, preparedNodeType) {
|
|
784
|
+
if (replaced === preparedNodeType)
|
|
785
|
+
return ` replaced the plan's own description of ${replaced} with the tenant's`;
|
|
786
|
+
const op = (nodeType) => nodeType.split('.').at(-1) ?? nodeType;
|
|
787
|
+
return ` replaced the plan's own description of this operation (${replaced}) with the tenant's ${preparedNodeType}: `
|
|
788
|
+
+ `rename "${op(replaced)}" to "${op(preparedNodeType)}" in a source decompiled earlier, or decompile the plan again`;
|
|
789
|
+
}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { type LookupStrategy } from "../lookup-specs.js";
|
|
2
2
|
export declare const INDEX_FILENAME = "index.json";
|
|
3
3
|
export declare const DESCRIPTORS_ROOT = "descriptors";
|
|
4
|
+
/**
|
|
5
|
+
* `provenance.source` of an overlay entry described from a saved plan, not from
|
|
6
|
+
* the tenant (`case/plan-connectors.ts`). A tenant-described entry for the same
|
|
7
|
+
* operation replaces it on merge ({@link mergeFilesInto}).
|
|
8
|
+
*/
|
|
9
|
+
export declare const PLAN_DESCRIBED_SOURCE = "case-plan";
|
|
10
|
+
/**
|
|
11
|
+
* The operation an entry describes, whatever node type it was written under:
|
|
12
|
+
* an action by connector, verb, path and object, an event by connector, object
|
|
13
|
+
* and event operation. A plan-described entry gets an id of its own making
|
|
14
|
+
* (`curated-create-issue-post`) where `prepare` writes the tenant's
|
|
15
|
+
* (`create-issue`), so the node type cannot tell that the two describe one
|
|
16
|
+
* operation; this can. `undefined` for an entry that names no operation.
|
|
17
|
+
*/
|
|
18
|
+
export declare function describedOperation(entry: unknown, row?: Record<string, unknown>): string | undefined;
|
|
4
19
|
/**
|
|
5
20
|
* `_variant_key`: identity for one resolvable activity schema variant. Keying
|
|
6
21
|
* only by nodeType made the last prepared object overwrite every earlier one.
|
|
@@ -46,9 +61,14 @@ export type LibraryFiles = ReadonlyMap<string, string | Uint8Array>;
|
|
|
46
61
|
* `files` must carry `index.json`; every other file is copied under
|
|
47
62
|
* `descriptors/` (a nested `index.json` is skipped, as the Python's walk did).
|
|
48
63
|
*/
|
|
49
|
-
export declare function mergeFilesInto(files: LibraryFiles, dst: string):
|
|
64
|
+
export declare function mergeFilesInto(files: LibraryFiles, dst: string): MergeResult;
|
|
65
|
+
/** What {@link mergeFilesInto} did beyond adding the new rows. */
|
|
66
|
+
export interface MergeResult {
|
|
67
|
+
/** Node types of plan-described rows a tenant description of the same operation replaced. */
|
|
68
|
+
replacedPlanRows: string[];
|
|
69
|
+
}
|
|
50
70
|
/** `merge_into(src, dst)`: merge a freshly written single-op library directory into the overlay. */
|
|
51
|
-
export declare function mergeInto(src: string, dst: string):
|
|
71
|
+
export declare function mergeInto(src: string, dst: string): MergeResult;
|
|
52
72
|
/** `_overlay_has_generic_expanded`: does the overlay hold ANY `GenericExpanded` entry, from any prepare? */
|
|
53
73
|
export declare function overlayHasGenericExpanded(out: string): boolean;
|
|
54
74
|
/**
|
|
@@ -35,6 +35,52 @@ import { afterWrites, existsSync, mkdirSync, readFileSync, stagedReadText, write
|
|
|
35
35
|
import { isPlainObject, pyGet, pyOr, pyStrAny, pyTruthy, pyTypeName } from "./support.js";
|
|
36
36
|
export const INDEX_FILENAME = "index.json";
|
|
37
37
|
export const DESCRIPTORS_ROOT = "descriptors";
|
|
38
|
+
/**
|
|
39
|
+
* `provenance.source` of an overlay entry described from a saved plan, not from
|
|
40
|
+
* the tenant (`case/plan-connectors.ts`). A tenant-described entry for the same
|
|
41
|
+
* operation replaces it on merge ({@link mergeFilesInto}).
|
|
42
|
+
*/
|
|
43
|
+
export const PLAN_DESCRIBED_SOURCE = "case-plan";
|
|
44
|
+
/**
|
|
45
|
+
* The operation an entry describes, whatever node type it was written under:
|
|
46
|
+
* an action by connector, verb, path and object, an event by connector, object
|
|
47
|
+
* and event operation. A plan-described entry gets an id of its own making
|
|
48
|
+
* (`curated-create-issue-post`) where `prepare` writes the tenant's
|
|
49
|
+
* (`create-issue`), so the node type cannot tell that the two describe one
|
|
50
|
+
* operation; this can. `undefined` for an entry that names no operation.
|
|
51
|
+
*/
|
|
52
|
+
export function describedOperation(entry, row = {}) {
|
|
53
|
+
if (!isPlainObject(entry))
|
|
54
|
+
return undefined;
|
|
55
|
+
const operation = isPlainObject(entry.operation) ? entry.operation : {};
|
|
56
|
+
const connector = isPlainObject(entry.connector) ? entry.connector : {};
|
|
57
|
+
const key = pyStrAny(pyOr(pyGet(connector, "key", null), pyGet(row, "connectorKey", "")));
|
|
58
|
+
const nodeType = pyStrAny(pyOr(pyGet(entry, "nodeType", null), pyGet(row, "nodeType", "")));
|
|
59
|
+
const objectName = pyStrAny(pyOr(pyGet(operation, "objectName", null), pyGet(row, "objectName", "")));
|
|
60
|
+
if (!key)
|
|
61
|
+
return undefined;
|
|
62
|
+
const upper = (v) => pyStrAny(v ?? "").toUpperCase();
|
|
63
|
+
if (isEventNodeType(nodeType)) {
|
|
64
|
+
const event = upper(pyOr(pyGet(operation, "eventOperation", null), pyOr(pyGet(operation, "name", null), pyGet(row, "operationName", ""))));
|
|
65
|
+
return event ? JSON.stringify([key, "event", objectName, event]) : undefined;
|
|
66
|
+
}
|
|
67
|
+
// A prepared entry may carry the route as `pathTemplate` alone (`path: ""`).
|
|
68
|
+
const path = pyStrAny(pyOr(pyGet(operation, "path", null), pyGet(operation, "pathTemplate", "")));
|
|
69
|
+
return path ? JSON.stringify([key, "action", upper(pyGet(operation, "httpMethod", "")), path, objectName]) : undefined;
|
|
70
|
+
}
|
|
71
|
+
/** The entry file a row names, parsed, or `undefined` when it cannot be read. */
|
|
72
|
+
function rowEntry(dst, row) {
|
|
73
|
+
if (!isPlainObject(row) || typeof row.path !== "string")
|
|
74
|
+
return undefined;
|
|
75
|
+
try {
|
|
76
|
+
const parsed = JSON.parse(readFileSync(join(dst, ...descriptorOverlayPath(row.path).split("/")), "utf8"));
|
|
77
|
+
return isPlainObject(parsed) ? parsed : undefined;
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const planDescribed = (entry) => isPlainObject(entry?.provenance) && entry.provenance.source === PLAN_DESCRIBED_SOURCE;
|
|
38
84
|
/**
|
|
39
85
|
* `_variant_key`: identity for one resolvable activity schema variant. Keying
|
|
40
86
|
* only by nodeType made the last prepared object overwrite every earlier one.
|
|
@@ -221,7 +267,38 @@ export function mergeFilesInto(files, dst) {
|
|
|
221
267
|
throw new TypeError("index.json: \"entries\" is not a list");
|
|
222
268
|
migrateLegacyDescriptorRoots(dst, dstEntries);
|
|
223
269
|
const srcEntries = isPlainObject(srcIdx) ? pyGet(srcIdx, "entries", []) : [];
|
|
224
|
-
|
|
270
|
+
const srcRows = Array.isArray(srcEntries) ? srcEntries : [];
|
|
271
|
+
// A tenant description replaces the plan's description of the same operation,
|
|
272
|
+
// whatever node type each was written under: one operation, one row.
|
|
273
|
+
const text = (rel) => {
|
|
274
|
+
const content = typeof rel === "string" ? files.get(rel) : undefined;
|
|
275
|
+
return content === undefined ? undefined : typeof content === "string" ? content : Buffer.from(content).toString("utf8");
|
|
276
|
+
};
|
|
277
|
+
const described = new Set(srcRows.flatMap((row) => {
|
|
278
|
+
let entry;
|
|
279
|
+
try {
|
|
280
|
+
entry = JSON.parse(text(isPlainObject(row) ? row.path : undefined) ?? "null");
|
|
281
|
+
}
|
|
282
|
+
catch {
|
|
283
|
+
return [];
|
|
284
|
+
}
|
|
285
|
+
if (!isPlainObject(entry) || planDescribed(entry))
|
|
286
|
+
return [];
|
|
287
|
+
const op = describedOperation(entry, row);
|
|
288
|
+
return op === undefined ? [] : [op];
|
|
289
|
+
}));
|
|
290
|
+
const replaced = [];
|
|
291
|
+
const kept = described.size === 0 ? dstEntries : dstEntries.filter((row) => {
|
|
292
|
+
const entry = rowEntry(dst, row);
|
|
293
|
+
if (!planDescribed(entry))
|
|
294
|
+
return true;
|
|
295
|
+
const op = describedOperation(entry, row);
|
|
296
|
+
if (op === undefined || !described.has(op))
|
|
297
|
+
return true;
|
|
298
|
+
replaced.push(pyStrAny(pyGet(row, "nodeType", "")));
|
|
299
|
+
return false;
|
|
300
|
+
});
|
|
301
|
+
dstIdx.entries = mergeIndexEntries(kept, srcRows);
|
|
225
302
|
writeInsideSync(dst, join(dst, INDEX_FILENAME), formatOverlayIndex(dstIdx));
|
|
226
303
|
for (const [rel, content] of files) {
|
|
227
304
|
if (basename(rel) === INDEX_FILENAME)
|
|
@@ -230,6 +307,7 @@ export function mergeFilesInto(files, dst) {
|
|
|
230
307
|
mkdirSync(dirname(out), { recursive: true });
|
|
231
308
|
writeInsideSync(dst, out, content);
|
|
232
309
|
}
|
|
310
|
+
return { replacedPlanRows: replaced };
|
|
233
311
|
}
|
|
234
312
|
/** Every file under `root`, as `POSIX-relative path → bytes`. */
|
|
235
313
|
function readTree(root) {
|
|
@@ -248,7 +326,7 @@ function readTree(root) {
|
|
|
248
326
|
}
|
|
249
327
|
/** `merge_into(src, dst)`: merge a freshly written single-op library directory into the overlay. */
|
|
250
328
|
export function mergeInto(src, dst) {
|
|
251
|
-
mergeFilesInto(readTree(src), dst);
|
|
329
|
+
return mergeFilesInto(readTree(src), dst);
|
|
252
330
|
}
|
|
253
331
|
/** `_overlay_has_generic_expanded`: does the overlay hold ANY `GenericExpanded` entry, from any prepare? */
|
|
254
332
|
export function overlayHasGenericExpanded(out) {
|
|
@@ -43,7 +43,7 @@ import { prepareEvent } from "./event.js";
|
|
|
43
43
|
import { integrationServiceEntry } from "./integration-service.js";
|
|
44
44
|
import { descriptorUsage } from "./handoff.js";
|
|
45
45
|
import { ResolutionsExhausted, allParentsResolved, resolvedParentValues, writeResolutions } from "./ledger.js";
|
|
46
|
-
import { PrepareRefusal, ambiguousLabelsMessage, connectionChoiceLine, bindingsLine, bpmnConnectorUsageLines, candidateLabel, connectionLine, describeNextLine, generatedModulesLine, genericActionNeedsObjectMessage, inputFieldNote, flagDiffersFromSourceLine, keptSchemaMessage, labelTakenMessage, lookupVocabularyLines, missingGenericSchemaMessage, missingParentsNote, nextLine, noCanonicalEntryMessage, objectFlagsOnlyForGenericMessage, objectNoteLine, objectRecordedLine, parentFieldNamesMismatchMessage, parentOnlyMessage, prefixed, preparedFromIntegrationServiceLine, actionCanonicalizedLine, catalogRefreshFailedLine, catalogRefreshPartialLine, probeSkippedReason, refreshingCatalogLine, rememberedAbsenceLine, preparedSummaryLine, rejectedParentFieldsMessage, rerunAgainstLine, resolvedParentsNote, registryGetFailedMessage, sharedLabelMessage, sourceLabelSuffix, tsNote, partlyUnreadableLabelLine, unreadableLabelLine, unresolvedOperationMessage, } from "./messages.js";
|
|
46
|
+
import { PrepareRefusal, ambiguousLabelsMessage, connectionChoiceLine, bindingsLine, bpmnConnectorUsageLines, candidateLabel, connectionLine, describeNextLine, generatedModulesLine, genericActionNeedsObjectMessage, inputFieldNote, flagDiffersFromSourceLine, keptSchemaMessage, labelTakenMessage, lookupVocabularyLines, missingGenericSchemaMessage, missingParentsNote, nextLine, noCanonicalEntryMessage, objectFlagsOnlyForGenericMessage, objectNoteLine, objectRecordedLine, parentFieldNamesMismatchMessage, parentOnlyMessage, prefixed, preparedFromIntegrationServiceLine, actionCanonicalizedLine, catalogRefreshFailedLine, catalogRefreshPartialLine, probeSkippedReason, refreshingCatalogLine, rememberedAbsenceLine, preparedSummaryLine, rejectedParentFieldsMessage, rerunAgainstLine, resolvedParentsNote, registryGetFailedMessage, sharedLabelMessage, sourceLabelSuffix, tsNote, partlyUnreadableLabelLine, unreadableLabelLine, unresolvedOperationMessage, planRowReplacedLine, } from "./messages.js";
|
|
47
47
|
import { ObjectMatchRefusal, RESOLUTIONS_FILENAME, matchObject, recordObjectResolution } from "./objects.js";
|
|
48
48
|
import { countInputFields, keepPreparedSchema, lookupSpecsFromOverlay, mergeFilesInto, parentFields as overlayParentFields, schemaActionParents, } from "./overlay.js";
|
|
49
49
|
import { declaredParents, objectActionRequest, objectActionSpecs, parseFields } from "./parents.js";
|
|
@@ -530,7 +530,8 @@ async function prepareOnConnection(options, ports, connected, registryRefresh) {
|
|
|
530
530
|
warn(line);
|
|
531
531
|
const kept = keepPreparedSchema(out, entryNodeType, plan.files, parentFields, objectName);
|
|
532
532
|
if (kept === undefined)
|
|
533
|
-
mergeFilesInto(plan.files, out)
|
|
533
|
+
for (const replaced of mergeFilesInto(plan.files, out).replacedPlanRows)
|
|
534
|
+
info(planRowReplacedLine(replaced, entryNodeType));
|
|
534
535
|
// The object decision is the FIRST resolution — recorded before any lookup
|
|
535
536
|
// rows, because it is their prerequisite.
|
|
536
537
|
if (objectDecision !== undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.96.
|
|
3
|
+
"version": "6.96.3",
|
|
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",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"@types/node": "^22.7.0",
|
|
114
114
|
"esbuild": "^0.28.1"
|
|
115
115
|
},
|
|
116
|
-
"gitref": "
|
|
116
|
+
"gitref": "d97600fbb95a5ab3e1a4332daee538e99ae6aed9"
|
|
117
117
|
}
|