@uipath/maestro-builder-sdk 6.96.7 → 6.97.0
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/README.md +2 -1
- package/dist/bpmn/check-cli.js +8 -4
- package/dist/bpmn/compile-cli.js +4 -3
- package/dist/bpmn/decompile-cli.js +15 -1
- package/dist/bpmn/decompile-pipeline.d.ts +5 -0
- package/dist/bpmn/decompile-pipeline.js +3 -3
- package/dist/bpmn/decompile-stamp.d.ts +13 -0
- package/dist/bpmn/decompile-stamp.js +8 -0
- package/dist/bpmn/decompile.d.ts +17 -4
- package/dist/bpmn/decompile.js +9 -4
- package/dist/bpmn/merge-cli.js +32 -4
- package/dist/bpmn/merge-source.d.ts +2 -0
- package/dist/bpmn/merge-source.js +1 -0
- package/dist/case/check-cli.js +4 -2
- package/dist/case/compile-cli.js +14 -9
- package/dist/case/decompile-cli.d.ts +1 -1
- package/dist/case/decompile-cli.js +12 -2
- package/dist/check-cli.js +12 -6
- package/dist/cli/commands/registry.js +2 -0
- package/dist/compile-cli.js +16 -10
- package/dist/core/cli-library.d.ts +18 -2
- package/dist/core/cli-library.js +25 -5
- package/dist/core/library.d.ts +74 -2
- package/dist/core/library.js +88 -11
- package/dist/decompile-cli.js +17 -2
- package/dist/decompile-stamp.d.ts +13 -0
- package/dist/decompile-stamp.js +7 -1
- package/dist/emit.js +5 -8
- package/dist/merge-cli.js +51 -1
- package/dist/registry/curated-overlay.d.ts +11 -0
- package/dist/registry/curated-overlay.js +27 -0
- package/dist/registry/describe-cli.d.ts +3 -0
- package/dist/registry/describe-cli.js +38 -6
- package/dist/registry/fetch/fetch-connectors.d.ts +21 -0
- package/dist/registry/fetch/fetch-connectors.js +84 -0
- package/dist/registry/fetch/fetch-definitions.d.ts +61 -0
- package/dist/registry/fetch/fetch-definitions.js +447 -0
- package/dist/registry/fetch/flow-requests.d.ts +14 -0
- package/dist/registry/fetch/flow-requests.js +81 -0
- package/dist/registry/fetch/with-fetched-definitions.d.ts +46 -0
- package/dist/registry/fetch/with-fetched-definitions.js +211 -0
- package/dist/registry/library-build/events.d.ts +9 -2
- package/dist/registry/library-build/events.js +4 -10
- package/dist/registry/pull-cli.d.ts +9 -0
- package/dist/registry/pull-cli.js +150 -10
- package/dist/registry/search-cli.d.ts +25 -0
- package/dist/registry/search-cli.js +94 -10
- package/package.json +4 -3
|
@@ -4,6 +4,11 @@ import { PULL_COMMAND } from "../core/cli-spelling.js";
|
|
|
4
4
|
import { resolveLibraryDir } from "../core/library-cache.js";
|
|
5
5
|
import { defaultReadText } from "../core/read-text.js";
|
|
6
6
|
import { dirname, join } from "node:path";
|
|
7
|
+
import { catalogConnectorKey } from "./library-build/canonical.js";
|
|
8
|
+
import { fetchDefinitionsEnabled, uipUnavailableReason } from "./fetch/fetch-definitions.js";
|
|
9
|
+
import { defaultUipClient } from "./uip/client.js";
|
|
10
|
+
import { registrySearchConnectors } from "./uip/commands.js";
|
|
11
|
+
import { failureReason, getCI, isSuccess, parseEnvelope, tail } from "./uip/envelope.js";
|
|
7
12
|
export const DEFAULT_SEARCH_LIMIT = 20;
|
|
8
13
|
const USAGE = "Usage: flow-sdk registry search [query] [--library <dir>] [--library-md <dir>] [--connector <key>] [--limit <n>]";
|
|
9
14
|
function text(value) {
|
|
@@ -115,6 +120,70 @@ export async function searchRegistryOperations(options) {
|
|
|
115
120
|
});
|
|
116
121
|
return { total: matches.length, operations };
|
|
117
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* The search over the tenant's live catalog, for when no library was pulled
|
|
125
|
+
* (docs/CONNECTOR_LIBRARY_OPTIONAL_DESIGN.md §3.5): every connector node type
|
|
126
|
+
* `uip maestro flow registry search` lists, matched with the same tokens and
|
|
127
|
+
* `--connector` rule as the library search. On Automation Suite this is the
|
|
128
|
+
* curated catalog, which no published library describes.
|
|
129
|
+
*/
|
|
130
|
+
/** No library, and uip cannot be asked: a blocked mode (exit 2), as "no library cached" is with fetching off. */
|
|
131
|
+
export class TenantSearchBlocked extends Error {
|
|
132
|
+
name = "TenantSearchBlocked";
|
|
133
|
+
}
|
|
134
|
+
export async function searchTenantOperations(options, client = defaultUipClient()) {
|
|
135
|
+
const unavailable = await uipUnavailableReason(client);
|
|
136
|
+
if (unavailable !== undefined) {
|
|
137
|
+
throw new TenantSearchBlocked(`No connector library is cached, and the tenant's catalog could not be searched through uip instead: ${unavailable}.`);
|
|
138
|
+
}
|
|
139
|
+
const result = await client.run(registrySearchConnectors());
|
|
140
|
+
if (result.code !== 0)
|
|
141
|
+
throw new Error(`The tenant's catalog could not be searched: ${failureReason(result)}`);
|
|
142
|
+
// Read as every other registry reply is: in any key case, and a reply that is
|
|
143
|
+
// not a successful envelope with a list is a failed search, never "no match".
|
|
144
|
+
const envelope = parseEnvelope(result.stdout);
|
|
145
|
+
const data = getCI(envelope, "Data");
|
|
146
|
+
if (!isSuccess(envelope) || !Array.isArray(data)) {
|
|
147
|
+
throw new Error(`The tenant's catalog could not be searched: uip answered ${tail(result.stdout.trim()) || "nothing"}`);
|
|
148
|
+
}
|
|
149
|
+
const rows = data;
|
|
150
|
+
const tokens = queryTokens(options.query);
|
|
151
|
+
const connector = options.connector?.trim().toLowerCase();
|
|
152
|
+
const matches = [];
|
|
153
|
+
for (const row of rows) {
|
|
154
|
+
const nodeType = text(getCI(row, "NodeType"));
|
|
155
|
+
// Every form, start triggers included: a trigger-only operation is still found.
|
|
156
|
+
const key = catalogConnectorKey(nodeType);
|
|
157
|
+
if (key === null)
|
|
158
|
+
continue;
|
|
159
|
+
if (connector && key.toLowerCase() !== connector)
|
|
160
|
+
continue;
|
|
161
|
+
const label = text(getCI(row, "DisplayName"));
|
|
162
|
+
// The library search also matches the operation name run together
|
|
163
|
+
// (`getwidget`) and the description; the catalog row carries both.
|
|
164
|
+
const operation = nodeType.slice(nodeType.lastIndexOf(".") + 1);
|
|
165
|
+
const haystack = [label, nodeType, key, operation.replace(/-/g, ""), text(getCI(row, "Description"))].join(" ").toLowerCase();
|
|
166
|
+
if (!tokens.every((token) => haystack.includes(token)))
|
|
167
|
+
continue;
|
|
168
|
+
matches.push({
|
|
169
|
+
nodeType,
|
|
170
|
+
version: text(getCI(row, "Version")),
|
|
171
|
+
connectorKey: key,
|
|
172
|
+
label,
|
|
173
|
+
activityType: "",
|
|
174
|
+
objectName: "",
|
|
175
|
+
operationName: "",
|
|
176
|
+
definitionPath: "",
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
const warning = getCI(envelope, "Warning");
|
|
180
|
+
return {
|
|
181
|
+
total: matches.length,
|
|
182
|
+
operations: matches.slice(0, options.limit ?? DEFAULT_SEARCH_LIMIT),
|
|
183
|
+
source: "tenant",
|
|
184
|
+
...(typeof warning === "string" && warning.trim() !== "" ? { warning: warning.trim() } : {}),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
118
187
|
function value(args, name) {
|
|
119
188
|
const index = args.indexOf(name);
|
|
120
189
|
return index >= 0 ? args[index + 1] : undefined;
|
|
@@ -123,8 +192,16 @@ export async function run(argv) {
|
|
|
123
192
|
// Same resolution as compile and check: named, else the environment, else the
|
|
124
193
|
// shared cache `registry pull` filled. Requiring the flag here while the other
|
|
125
194
|
// verbs defaulted it was the inconsistency an author hit first.
|
|
126
|
-
const
|
|
127
|
-
|
|
195
|
+
const explicit = value(argv, "--library");
|
|
196
|
+
const resolved = resolveLibraryDir(explicit);
|
|
197
|
+
// No library pulled, and none named: the tenant's live catalog through uip.
|
|
198
|
+
// A named library, by `--library` or FLOW_SDK_LIBRARY_JSON, is searched (or
|
|
199
|
+
// refused) as it always was.
|
|
200
|
+
const named = explicit ?? (process.env.FLOW_SDK_LIBRARY_JSON || undefined);
|
|
201
|
+
const tenant = named === undefined && fetchDefinitionsEnabled()
|
|
202
|
+
&& (resolved === undefined || defaultReadText()(join(resolved, "index.json")) === undefined);
|
|
203
|
+
const libraryPath = tenant ? undefined : resolved;
|
|
204
|
+
if (!libraryPath && !tenant) {
|
|
128
205
|
// Say why. A bare usage line here read as "no match" to an agent deciding
|
|
129
206
|
// between a connector and http(): it took the failed search for a miss.
|
|
130
207
|
console.error(`No connector library is cached. Run \`${PULL_COMMAND}\`, or pass` +
|
|
@@ -152,19 +229,26 @@ export async function run(argv) {
|
|
|
152
229
|
.join(" ")
|
|
153
230
|
.trim();
|
|
154
231
|
try {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
232
|
+
// No library pulled: the tenant's live catalog instead, through uip.
|
|
233
|
+
const result = libraryPath === undefined
|
|
234
|
+
? await searchTenantOperations({ query: query || undefined, connector: value(argv, "--connector"), limit })
|
|
235
|
+
: await searchRegistryOperations({
|
|
236
|
+
libraryPath,
|
|
237
|
+
markdownPath: value(argv, "--library-md"),
|
|
238
|
+
query: query || undefined,
|
|
239
|
+
connector: value(argv, "--connector"),
|
|
240
|
+
limit,
|
|
241
|
+
});
|
|
242
|
+
// Said where a person reads it, not only in the JSON: an incomplete catalog
|
|
243
|
+
// answering "no match" would read as the connector not existing.
|
|
244
|
+
if (result.warning !== undefined)
|
|
245
|
+
console.error(`registry search: ${result.warning}`);
|
|
162
246
|
reportResult(result);
|
|
163
247
|
printResult(JSON.stringify(result, null, 2));
|
|
164
248
|
return 0;
|
|
165
249
|
}
|
|
166
250
|
catch (error) {
|
|
167
251
|
console.error(error instanceof Error ? error.message : String(error));
|
|
168
|
-
return 1;
|
|
252
|
+
return error instanceof TenantSearchBlocked ? 2 : 1;
|
|
169
253
|
}
|
|
170
254
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.97.0",
|
|
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",
|
|
@@ -76,7 +76,8 @@
|
|
|
76
76
|
"json-result",
|
|
77
77
|
"prepare-resource",
|
|
78
78
|
"bpmn-merge-source",
|
|
79
|
-
"flow-merge-source"
|
|
79
|
+
"flow-merge-source",
|
|
80
|
+
"fetch-definitions"
|
|
80
81
|
],
|
|
81
82
|
"files": [
|
|
82
83
|
"dist",
|
|
@@ -113,5 +114,5 @@
|
|
|
113
114
|
"@types/node": "^22.7.0",
|
|
114
115
|
"esbuild": "^0.28.1"
|
|
115
116
|
},
|
|
116
|
-
"gitref": "
|
|
117
|
+
"gitref": "8f71863a1ad2428e3b09bfcae0bcbe215bad1fdc"
|
|
117
118
|
}
|