@uipath/maestro-builder-sdk 6.44.4 → 6.45.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/dist/core/cli-library.js +3 -2
- package/dist/core/library.js +2 -2
- package/dist/core/list-envelope.js +2 -2
- package/dist/core/lookup-store.js +4 -4
- package/dist/core/read-text.d.ts +12 -3
- package/dist/core/read-text.js +17 -4
- package/dist/registry/library-reader.js +2 -2
- package/dist/registry/lookup-specs.js +2 -2
- package/dist/registry/search-cli.js +6 -2
- package/package.json +2 -2
package/dist/core/cli-library.js
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* beside it (`eventResolveErrorFor`, `byoaCheckOpts`) stay in `../cli-library.ts`
|
|
15
15
|
* until the BPMN check rung needs them too.
|
|
16
16
|
*/
|
|
17
|
-
import { existsSync } from 'node:fs';
|
|
18
17
|
import { join } from 'node:path';
|
|
19
18
|
import { ConnectorResolveError, Library } from './library.js';
|
|
19
|
+
import { defaultReadText } from './read-text.js';
|
|
20
20
|
import { resolveLibraryDir } from './library-cache.js';
|
|
21
21
|
import { flagValue } from '../cli-run.js';
|
|
22
22
|
import { defaultOverlayDir } from '../workdir.js';
|
|
@@ -32,7 +32,8 @@ import { connectorInputErrors } from './connector-inputs.js';
|
|
|
32
32
|
*/
|
|
33
33
|
export function openCliLibrary(argv) {
|
|
34
34
|
const libDir = resolveLibraryDir(flagValue(argv, '--library'));
|
|
35
|
-
|
|
35
|
+
// Through the reader, not `existsSync`: a host's reader serves a library that is on no disk.
|
|
36
|
+
if (!libDir || defaultReadText()(join(libDir, 'index.json')) === undefined)
|
|
36
37
|
return undefined;
|
|
37
38
|
const overlayDir = flagValue(argv, '--connectors-local') ?? defaultOverlayDir();
|
|
38
39
|
return new Library(libDir, { overlayDir });
|
package/dist/core/library.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* <key>/<action>@<ver>.json the entry (connector key, HTTP method, endpoint)
|
|
7
7
|
* <key>/<action>@<ver>.v1def.json the Flow `definitions[]` shape (model, ports, …)
|
|
8
8
|
*/
|
|
9
|
-
import { cacheFor, libraryPath, readJson, readTextFromDisk } from './read-text.js';
|
|
9
|
+
import { cacheFor, defaultReadText, libraryPath, readJson, readTextFromDisk } from './read-text.js';
|
|
10
10
|
import { PULL_COMMAND, prepareCommand } from './cli-spelling.js';
|
|
11
11
|
import { editDistance } from './edit-distance.js';
|
|
12
12
|
import { loadListEnvelopes, lookupListEnvelope } from './list-envelope.js';
|
|
@@ -38,7 +38,7 @@ export class Library {
|
|
|
38
38
|
read;
|
|
39
39
|
warn;
|
|
40
40
|
constructor(dir, opts = {}) {
|
|
41
|
-
const read = (this.read = opts.readText ??
|
|
41
|
+
const read = (this.read = opts.readText ?? defaultReadText());
|
|
42
42
|
this.warn = opts.warn ?? ((message) => { globalThis.process?.stderr?.write(message); });
|
|
43
43
|
// A new identity per Library, so the per-reader caches never keep an overlay file: `prepare` rewrites them.
|
|
44
44
|
const readOverlay = (path) => read(path);
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
* cheaper half. The LEDGER is the single source of truth — the readers are
|
|
33
33
|
* interchangeable.
|
|
34
34
|
*/
|
|
35
|
-
import { cacheFor,
|
|
35
|
+
import { cacheFor, defaultReadText, libraryPath } from './read-text.js';
|
|
36
36
|
const CACHE = new WeakMap();
|
|
37
37
|
/**
|
|
38
38
|
* Every declared row, from `<libraryDir>/list-envelopes.json`. An absent file is
|
|
39
39
|
* an empty ledger — every operation undeclared — which is what a library built
|
|
40
40
|
* before this card, or a bare fixture library, looks like.
|
|
41
41
|
*/
|
|
42
|
-
export function loadListEnvelopes(libraryDir, read =
|
|
42
|
+
export function loadListEnvelopes(libraryDir, read = defaultReadText()) {
|
|
43
43
|
if (!libraryDir)
|
|
44
44
|
return [];
|
|
45
45
|
const cache = cacheFor(CACHE, read);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cacheFor,
|
|
1
|
+
import { cacheFor, defaultReadText, libraryPath } from './read-text.js';
|
|
2
2
|
/**
|
|
3
3
|
* core/lookup-store — the two on-disk side-tables the lookup surface reads.
|
|
4
4
|
*
|
|
@@ -22,7 +22,7 @@ const RESOLUTION_CACHE = new WeakMap();
|
|
|
22
22
|
* — it is a compile error naming the `prepare` command to run, which is the
|
|
23
23
|
* behaviour an author wants from a missing resolution anyway.
|
|
24
24
|
*/
|
|
25
|
-
export function loadLookupResolutions(overlayDir, read =
|
|
25
|
+
export function loadLookupResolutions(overlayDir, read = defaultReadText()) {
|
|
26
26
|
if (!overlayDir)
|
|
27
27
|
return {};
|
|
28
28
|
const cache = cacheFor(RESOLUTION_CACHE, read);
|
|
@@ -60,7 +60,7 @@ export function loadLookupResolutions(overlayDir, read = readTextFromDisk) {
|
|
|
60
60
|
* call rather than cached: `prepare` rewrites this file, and a stale "never
|
|
61
61
|
* checked" answer would refuse a flow that was just verified.
|
|
62
62
|
*/
|
|
63
|
-
export function loadByoaLedger(overlayDir, read =
|
|
63
|
+
export function loadByoaLedger(overlayDir, read = defaultReadText()) {
|
|
64
64
|
if (!overlayDir)
|
|
65
65
|
return {};
|
|
66
66
|
try {
|
|
@@ -83,7 +83,7 @@ export function loadByoaLedger(overlayDir, read = readTextFromDisk) {
|
|
|
83
83
|
* @param libraryDir - A `library-json` directory, or the local overlay.
|
|
84
84
|
* @returns Every `objectName` declared connector-invariant.
|
|
85
85
|
*/
|
|
86
|
-
export function loadInvariantCollections(libraryDir, read =
|
|
86
|
+
export function loadInvariantCollections(libraryDir, read = defaultReadText()) {
|
|
87
87
|
if (!libraryDir)
|
|
88
88
|
return new Set();
|
|
89
89
|
const cache = cacheFor(INVARIANT_CACHE, read);
|
package/dist/core/read-text.d.ts
CHANGED
|
@@ -11,12 +11,21 @@
|
|
|
11
11
|
* pass a new reader for a new build. Overlay files are read afresh each time, because
|
|
12
12
|
* `prepare` rewrites them.
|
|
13
13
|
*
|
|
14
|
-
* The default reads the disk.
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
14
|
+
* The default reads the disk. A host without one, which runs the SDK's CLI and so
|
|
15
|
+
* cannot pass a reader in, hands one over before the run:
|
|
16
|
+
* `globalThis[Symbol.for('uipath.maestro-builder-sdk.readText')] = read`, with
|
|
17
|
+
* `$FLOW_SDK_LIBRARY_JSON` naming the folder it serves. That reader then answers every
|
|
18
|
+
* default read, library and overlay alike, and its index is kept like any host reader's.
|
|
19
|
+
* The default overlay folder is still looked up on the host's `fs`; pass
|
|
20
|
+
* `--connectors-local` for an overlay only the reader serves. `node:fs` comes from
|
|
21
|
+
* `process.getBuiltinModule`, not an `import`, so the library loads no `node:` builtin
|
|
22
|
+
* (FB015 exempts this fallback), and `process` is read through `globalThis`, as in
|
|
23
|
+
* `core/typescript-module.ts`.
|
|
17
24
|
*/
|
|
18
25
|
/** The file's text, or `undefined` when there is none. */
|
|
19
26
|
export type ReadText = (path: string) => string | undefined;
|
|
27
|
+
/** The reader a default read uses: the host's, when one is in the slot, else the disk. */
|
|
28
|
+
export declare function defaultReadText(): ReadText;
|
|
20
29
|
export declare function readTextFromDisk(path: string): string | undefined;
|
|
21
30
|
/** `dir/rel`. Index paths are relative and `/`-separated. */
|
|
22
31
|
export declare function libraryPath(dir: string, rel: string): string;
|
package/dist/core/read-text.js
CHANGED
|
@@ -11,14 +11,27 @@
|
|
|
11
11
|
* pass a new reader for a new build. Overlay files are read afresh each time, because
|
|
12
12
|
* `prepare` rewrites them.
|
|
13
13
|
*
|
|
14
|
-
* The default reads the disk.
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
14
|
+
* The default reads the disk. A host without one, which runs the SDK's CLI and so
|
|
15
|
+
* cannot pass a reader in, hands one over before the run:
|
|
16
|
+
* `globalThis[Symbol.for('uipath.maestro-builder-sdk.readText')] = read`, with
|
|
17
|
+
* `$FLOW_SDK_LIBRARY_JSON` naming the folder it serves. That reader then answers every
|
|
18
|
+
* default read, library and overlay alike, and its index is kept like any host reader's.
|
|
19
|
+
* The default overlay folder is still looked up on the host's `fs`; pass
|
|
20
|
+
* `--connectors-local` for an overlay only the reader serves. `node:fs` comes from
|
|
21
|
+
* `process.getBuiltinModule`, not an `import`, so the library loads no `node:` builtin
|
|
22
|
+
* (FB015 exempts this fallback), and `process` is read through `globalThis`, as in
|
|
23
|
+
* `core/typescript-module.ts`.
|
|
17
24
|
*/
|
|
25
|
+
const HOST_READ_TEXT = Symbol.for('uipath.maestro-builder-sdk.readText');
|
|
26
|
+
/** The reader a default read uses: the host's, when one is in the slot, else the disk. */
|
|
27
|
+
export function defaultReadText() {
|
|
28
|
+
return globalThis[HOST_READ_TEXT] ?? readTextFromDisk;
|
|
29
|
+
}
|
|
18
30
|
export function readTextFromDisk(path) {
|
|
19
31
|
const getBuiltinModule = globalThis.process?.getBuiltinModule;
|
|
20
32
|
if (getBuiltinModule === undefined) {
|
|
21
|
-
throw new Error(`cannot read ${path}: outside Node, pass a readText function to the connector library`
|
|
33
|
+
throw new Error(`cannot read ${path}: outside Node, pass a readText function to the connector library`
|
|
34
|
+
+ ` or set globalThis[Symbol.for('uipath.maestro-builder-sdk.readText')]`);
|
|
22
35
|
}
|
|
23
36
|
const fs = getBuiltinModule('node:fs');
|
|
24
37
|
return fs.existsSync(path) ? fs.readFileSync(path, 'utf8') : undefined;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* with `.json` swapped for `.v1def.json`, and a sidecar that is a one-element
|
|
8
8
|
* list is unwrapped.
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { defaultReadText, libraryPath } from "../core/read-text.js";
|
|
11
11
|
import { loadInvariantCollections } from "./lookup-specs.js";
|
|
12
12
|
/** `<path minus .json>.v1def.json`, the sidecar beside an entry. */
|
|
13
13
|
export function sidecarPath(entryRelativePath) {
|
|
@@ -22,7 +22,7 @@ export function unwrapV1Def(raw) {
|
|
|
22
22
|
return undefined;
|
|
23
23
|
}
|
|
24
24
|
/** `read` defaults to the disk; a host without one passes its own (`core/read-text.ts`). */
|
|
25
|
-
export function loadLibrary(dir, read =
|
|
25
|
+
export function loadLibrary(dir, read = defaultReadText()) {
|
|
26
26
|
const indexPath = libraryPath(dir, "index.json");
|
|
27
27
|
const indexText = read(indexPath);
|
|
28
28
|
if (indexText === undefined) {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* `generate_connectors_ts.py`. `core/lookups.ts` keeps `check` and `compile`
|
|
14
14
|
* agreeing with this by importing it.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { defaultReadText, libraryPath } from "../core/read-text.js";
|
|
17
17
|
import { pyTruthy } from "./generators/type-tree.js";
|
|
18
18
|
import { byAliases } from "./naming.js";
|
|
19
19
|
export const LEDGER_FILENAME = "invariant-collections.json";
|
|
@@ -22,7 +22,7 @@ export const LEDGER_FILENAME = "invariant-collections.json";
|
|
|
22
22
|
* ledger reads as empty rather than raising: the permissive path is the
|
|
23
23
|
* pre-ledger behaviour, so a bad edit loses exactness, never a build.
|
|
24
24
|
*/
|
|
25
|
-
export function loadInvariantCollections(libraryDir, read =
|
|
25
|
+
export function loadInvariantCollections(libraryDir, read = defaultReadText()) {
|
|
26
26
|
if (!libraryDir)
|
|
27
27
|
return new Set();
|
|
28
28
|
let parsed;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { printResult, reportResult } from '../cli-result.js';
|
|
2
|
-
import {
|
|
2
|
+
import { stat } from "node:fs/promises";
|
|
3
3
|
import { PULL_COMMAND } from "../core/cli-spelling.js";
|
|
4
4
|
import { resolveLibraryDir } from "../core/library-cache.js";
|
|
5
|
+
import { defaultReadText } from "../core/read-text.js";
|
|
5
6
|
import { dirname, join } from "node:path";
|
|
6
7
|
export const DEFAULT_SEARCH_LIMIT = 20;
|
|
7
8
|
const USAGE = "Usage: flow-sdk registry search [query] [--library <dir>] [--library-md <dir>] [--connector <key>] [--limit <n>]";
|
|
@@ -50,9 +51,12 @@ export async function searchRegistryOperations(options) {
|
|
|
50
51
|
const indexPath = join(options.libraryPath, "index.json");
|
|
51
52
|
let content;
|
|
52
53
|
try {
|
|
53
|
-
content =
|
|
54
|
+
content = defaultReadText()(indexPath);
|
|
54
55
|
}
|
|
55
56
|
catch {
|
|
57
|
+
content = undefined;
|
|
58
|
+
}
|
|
59
|
+
if (content === undefined) {
|
|
56
60
|
throw new Error(`Could not read ${indexPath}. Run \`${PULL_COMMAND}\`, or point` +
|
|
57
61
|
" --library at an extracted connector library.");
|
|
58
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.45.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",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"@types/node": "^22.7.0",
|
|
94
94
|
"esbuild": "^0.28.1"
|
|
95
95
|
},
|
|
96
|
-
"gitref": "
|
|
96
|
+
"gitref": "618bc7abd8705bcc85c85d6414dd29be5e9c3ec0"
|
|
97
97
|
}
|