@uipath/maestro-builder-sdk 6.17.2 → 6.17.4
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/core/cli-library.js +14 -5
- package/dist/core/library.d.ts +6 -1
- package/dist/core/library.js +35 -3
- package/dist/decompile.js +25 -0
- package/dist/serialize.js +8 -11
- package/package.json +2 -2
package/dist/core/cli-library.js
CHANGED
|
@@ -96,7 +96,8 @@ export function connectorCheckOpts(library, bindings, inputErrors = (rc, inputs,
|
|
|
96
96
|
},
|
|
97
97
|
// The refusal compile throws for an operation it cannot resolve, with its
|
|
98
98
|
// code and text: CONNECTOR_NOT_IN_LIBRARY, CONNECTOR_OBJECT_REQUIRED,
|
|
99
|
-
// CONNECTOR_OBJECT_NOT_GENERIC
|
|
99
|
+
// CONNECTOR_OBJECT_NOT_GENERIC, CONNECTOR_LIBRARY_ENTRY_UNREADABLE, or
|
|
100
|
+
// CONNECTOR_RESOLVE_FAILED for any other throw.
|
|
100
101
|
connectorResolveError: (spec) => {
|
|
101
102
|
const r = resolve(spec);
|
|
102
103
|
return 'error' in r ? r.error : undefined;
|
|
@@ -114,11 +115,19 @@ export function connectorCheckOpts(library, bindings, inputErrors = (rc, inputs,
|
|
|
114
115
|
...(bindings ? { bindings } : {}),
|
|
115
116
|
};
|
|
116
117
|
}
|
|
118
|
+
/** `check`'s code for an untyped throw from `library.resolve`; see {@link connectorResolver}. */
|
|
119
|
+
const CONNECTOR_RESOLVE_FAILED = 'CONNECTOR_RESOLVE_FAILED';
|
|
117
120
|
/**
|
|
118
121
|
* `library.resolve` for one connector step, memoized per step for the life of
|
|
119
|
-
* one check's options.
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
+
* one check's options.
|
|
123
|
+
*
|
|
124
|
+
* This is the exact call `serialize` makes, so ANY throw here is a throw compile
|
|
125
|
+
* makes too, and becomes `error`. A {@link ConnectorResolveError} keeps its own
|
|
126
|
+
* code (CONNECTOR_NOT_IN_LIBRARY, CONNECTOR_LIBRARY_ENTRY_UNREADABLE, …).
|
|
127
|
+
* Anything else, which `library.resolve` does not throw on purpose, is reported
|
|
128
|
+
* as CONNECTOR_RESOLVE_FAILED with its message. Treating an untyped throw as
|
|
129
|
+
* "unknown" used to let `check` pass a step `compile` then died on (#1015); the
|
|
130
|
+
* event twin, `eventResolveErrorFor`, already reported every throw.
|
|
122
131
|
*/
|
|
123
132
|
function connectorResolver(library) {
|
|
124
133
|
const memo = new Map();
|
|
@@ -132,7 +141,7 @@ function connectorResolver(library) {
|
|
|
132
141
|
catch (error) {
|
|
133
142
|
r = error instanceof ConnectorResolveError
|
|
134
143
|
? { error: { code: error.code, message: error.message } }
|
|
135
|
-
: {
|
|
144
|
+
: { error: { code: CONNECTOR_RESOLVE_FAILED, message: error instanceof Error ? error.message : String(error) } };
|
|
136
145
|
}
|
|
137
146
|
memo.set(id, r);
|
|
138
147
|
}
|
package/dist/core/library.d.ts
CHANGED
|
@@ -225,7 +225,12 @@ export type ConnectorResolveCode =
|
|
|
225
225
|
/** A GENERIC operation (one entry per object) named without an `object`. */
|
|
226
226
|
| 'CONNECTOR_OBJECT_REQUIRED'
|
|
227
227
|
/** An `object` on a single, non-generic operation. */
|
|
228
|
-
| 'CONNECTOR_OBJECT_NOT_GENERIC'
|
|
228
|
+
| 'CONNECTOR_OBJECT_NOT_GENERIC'
|
|
229
|
+
/**
|
|
230
|
+
* The index lists the operation, but its entry file or `.v1def.json` sidecar is
|
|
231
|
+
* missing or not valid JSON: the library on disk is incomplete (#1015).
|
|
232
|
+
*/
|
|
233
|
+
| 'CONNECTOR_LIBRARY_ENTRY_UNREADABLE';
|
|
229
234
|
/**
|
|
230
235
|
* The refusal {@link Library.resolve} throws, with a `code` for each reason.
|
|
231
236
|
*
|
package/dist/core/library.js
CHANGED
|
@@ -827,8 +827,13 @@ export class Library {
|
|
|
827
827
|
}
|
|
828
828
|
build(dir, e, nodeType, opts = {}) {
|
|
829
829
|
const entryPath = join(dir, e.path);
|
|
830
|
-
|
|
831
|
-
|
|
830
|
+
// The two files the index row promises. A missing or corrupt one is a fault in
|
|
831
|
+
// the library on disk, not in the author's source, but compile cannot go on
|
|
832
|
+
// without it, so it is a typed refusal like the others: `check` reports it with
|
|
833
|
+
// the same code and text instead of passing a step compile then dies on with a
|
|
834
|
+
// bare ENOENT (#1015).
|
|
835
|
+
const entry = readLibraryFile(nodeType, entryPath, () => JSON.parse(readFileSync(entryPath, 'utf8')));
|
|
836
|
+
const v1def = readLibraryFile(nodeType, v1defPathOf(entryPath), () => readV1def(entryPath));
|
|
832
837
|
// A stamped object (case 4) reaches here with the index entry's `objectName`
|
|
833
838
|
// replaced but the sibling's FILE on disk — so restate the object and derive
|
|
834
839
|
// the endpoint from the sibling's own template, rather than shipping a node
|
|
@@ -944,6 +949,33 @@ function deriveObjectPath(operation, objectName) {
|
|
|
944
949
|
}
|
|
945
950
|
return out;
|
|
946
951
|
}
|
|
952
|
+
/** The `.v1def.json` sidecar path beside a library entry file. */
|
|
953
|
+
function v1defPathOf(entryPath) {
|
|
954
|
+
return entryPath.replace(/\.json$/, '.v1def.json');
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Read one file an index row points at, turning a missing or unparsable file
|
|
958
|
+
* into {@link ConnectorResolveError} `CONNECTOR_LIBRARY_ENTRY_UNREADABLE`.
|
|
959
|
+
*
|
|
960
|
+
* The library build refuses to write an entry without its sidecar
|
|
961
|
+
* (`registry/library-build/plan.ts`), so this only fires for a library that was
|
|
962
|
+
* damaged after it was built: an interrupted pull, a hand-edited overlay. The
|
|
963
|
+
* remedy is the same either way: rebuild the layer the file belongs to.
|
|
964
|
+
*/
|
|
965
|
+
function readLibraryFile(nodeType, path, read) {
|
|
966
|
+
try {
|
|
967
|
+
return read();
|
|
968
|
+
}
|
|
969
|
+
catch (error) {
|
|
970
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
971
|
+
// ENOENT already names the path; a JSON SyntaxError does not.
|
|
972
|
+
const reason = message.includes(path) ? message : `${path}: ${message}`;
|
|
973
|
+
throw new ConnectorResolveError('CONNECTOR_LIBRARY_ENTRY_UNREADABLE', `connector library entry for ${nodeType} is unreadable: ${reason}. The library index lists `
|
|
974
|
+
+ `this operation, but the file is missing or not valid JSON, so the library on disk is incomplete. `
|
|
975
|
+
+ `Refresh it with \`${PULL_COMMAND}\`; if the file is in the \`connectors-local\` overlay, `
|
|
976
|
+
+ `re-run the \`${prepareCommand()}\` that wrote it.`);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
947
979
|
/**
|
|
948
980
|
* Read the `.v1def.json` sidecar beside a library entry file, with a connection
|
|
949
981
|
* definition's `model.bindings.resource` in the designer's canonical casing.
|
|
@@ -961,7 +993,7 @@ function deriveObjectPath(operation, objectName) {
|
|
|
961
993
|
* validate and debug — which fold the case — passed.
|
|
962
994
|
*/
|
|
963
995
|
function readV1def(entryPath) {
|
|
964
|
-
const raw = JSON.parse(readFileSync(entryPath
|
|
996
|
+
const raw = JSON.parse(readFileSync(v1defPathOf(entryPath), 'utf8'));
|
|
965
997
|
const v1def = Array.isArray(raw) ? raw[0] : raw;
|
|
966
998
|
const bindings = v1def?.model?.bindings;
|
|
967
999
|
if (typeof bindings?.resource === 'string' && bindings.resource.toLowerCase() === 'connection') {
|
package/dist/decompile.js
CHANGED
|
@@ -1710,6 +1710,27 @@ function emitEventSubscription(node, imp, inputNames) {
|
|
|
1710
1710
|
['folder', folder !== undefined ? str(folder) : undefined],
|
|
1711
1711
|
]) + unboundMarker(node, { connection: conn, folder }, connector, event);
|
|
1712
1712
|
}
|
|
1713
|
+
/**
|
|
1714
|
+
* Read back the expression template older SDK builds emitted on an in-solution
|
|
1715
|
+
* `agent()` input (#1013): `{ type: 'literal', expression: '{{ <js> }}' }`.
|
|
1716
|
+
* serialize now emits the platform's `{ type: 'jsExpression', expression }`
|
|
1717
|
+
* instead, but `.flow` files written between 2026-08-10 and the fix still carry
|
|
1718
|
+
* the template, and the runtime evaluates it (the agent receives the value, not
|
|
1719
|
+
* the braces). So on an in-solution agent node a literal that is exactly one
|
|
1720
|
+
* `{{ … }}` is that expression, and it decompiles to the reference it was
|
|
1721
|
+
* written from rather than to a string. Anything else is returned unchanged.
|
|
1722
|
+
*/
|
|
1723
|
+
function legacyAgentTemplateInput(v) {
|
|
1724
|
+
if (!v || typeof v !== 'object' || Array.isArray(v))
|
|
1725
|
+
return v;
|
|
1726
|
+
const o = v;
|
|
1727
|
+
if (o.type !== 'literal' || typeof o.expression !== 'string')
|
|
1728
|
+
return v;
|
|
1729
|
+
const m = /^\{\{\s*([\s\S]+?)\s*\}\}$/.exec(o.expression);
|
|
1730
|
+
if (!m || m[1].includes('}}') || m[1].includes('{{'))
|
|
1731
|
+
return v;
|
|
1732
|
+
return { ...o, type: 'jsExpression', expression: m[1] };
|
|
1733
|
+
}
|
|
1713
1734
|
function emitPublishedResource(node, imp, inputNames) {
|
|
1714
1735
|
const FAMILIES = [
|
|
1715
1736
|
{ prefix: 'uipath.core.rpa-workflow.', factory: 'rpaWorkflow' },
|
|
@@ -1751,6 +1772,10 @@ function emitPublishedResource(node, imp, inputNames) {
|
|
|
1751
1772
|
// author's map, so it comes back off here.
|
|
1752
1773
|
const fireAndForget = unwrapPlain(inputs.fireAndForget) === true;
|
|
1753
1774
|
delete inputs.fireAndForget;
|
|
1775
|
+
if (family.factory === 'agent' && (def?.model?.isInSolution === true || def?.model?.projectId !== undefined)) {
|
|
1776
|
+
for (const [k, v] of Object.entries(inputs))
|
|
1777
|
+
inputs[k] = legacyAgentTemplateInput(v);
|
|
1778
|
+
}
|
|
1754
1779
|
const inputRows = Object.entries(inputs)
|
|
1755
1780
|
.map(([k, v]) => [k, emitVal(v, imp, inputNames)]);
|
|
1756
1781
|
const schema = def?.outputDefinition?.output?.schema?.properties;
|
package/dist/serialize.js
CHANGED
|
@@ -5284,18 +5284,15 @@ export function serialize(built, opts = {}) {
|
|
|
5284
5284
|
// three published families — 58 of 61 deployed agent instances carry no
|
|
5285
5285
|
// node-level `model` at all.
|
|
5286
5286
|
delete node.model;
|
|
5287
|
+
// Expression inputs stay `=js:` strings here, published or in-solution, and
|
|
5288
|
+
// the format migration wraps them as `{ type: 'jsExpression', expression }`
|
|
5289
|
+
// — the shape flow-core writes for an in-solution agent (52 of 54 v1
|
|
5290
|
+
// expression inputs, 09-01 → 10-08; the other 2 are bare `=js:` strings,
|
|
5291
|
+
// none is a `{{ }}` template). A `{ type: 'literal',
|
|
5292
|
+
// expression: '{{ … }}' }` template used to be emitted instead (#1013): it
|
|
5293
|
+
// ran, but it is the same envelope as a literal string, so decompile read
|
|
5294
|
+
// it back as one.
|
|
5287
5295
|
node.inputs = renderMap(s.inputs, scope.rename);
|
|
5288
|
-
if (inSolution) {
|
|
5289
|
-
for (const [name, value] of Object.entries(node.inputs)) {
|
|
5290
|
-
if (typeof value === 'string' && value.startsWith('=js:')) {
|
|
5291
|
-
node.inputs[name] = {
|
|
5292
|
-
type: 'literal',
|
|
5293
|
-
expression: `{{ ${value.slice(4)} }}`,
|
|
5294
|
-
fieldType: def.inputDefinition?.properties?.[name]?.type ?? 'string',
|
|
5295
|
-
};
|
|
5296
|
-
}
|
|
5297
|
-
}
|
|
5298
|
-
}
|
|
5299
5296
|
scope.nodes.push(node);
|
|
5300
5297
|
for (const t of tails)
|
|
5301
5298
|
addEdge(scope, t, id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.17.
|
|
3
|
+
"version": "6.17.4",
|
|
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",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"@types/node": "^22.7.0",
|
|
93
93
|
"esbuild": "^0.28.1"
|
|
94
94
|
},
|
|
95
|
-
"gitref": "
|
|
95
|
+
"gitref": "6a0dfa03e18d92bd2452c96704c1c80fa122fc11"
|
|
96
96
|
}
|