@uipath/maestro-builder-sdk 6.3.0 → 6.5.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.
Files changed (161) hide show
  1. package/dist/api-index.md +6 -6
  2. package/dist/cli/commands/registry.js +68 -12
  3. package/dist/registry/archive/entry-policy.d.ts +36 -0
  4. package/dist/registry/archive/entry-policy.js +60 -0
  5. package/dist/registry/archive/extract.d.ts +31 -0
  6. package/dist/registry/archive/extract.js +92 -0
  7. package/dist/registry/archive/zip-reader.d.ts +38 -0
  8. package/dist/registry/archive/zip-reader.js +256 -0
  9. package/dist/registry/codecs/pyjson.d.ts +62 -0
  10. package/dist/registry/codecs/pyjson.js +208 -0
  11. package/dist/registry/compat/compare.d.ts +18 -0
  12. package/dist/registry/compat/compare.js +32 -0
  13. package/dist/registry/compat/paths.d.ts +4 -0
  14. package/dist/registry/compat/paths.js +17 -0
  15. package/dist/registry/compat/pystr.d.ts +50 -0
  16. package/dist/registry/compat/pystr.js +221 -0
  17. package/dist/registry/concurrency.d.ts +10 -0
  18. package/dist/registry/concurrency.js +34 -0
  19. package/dist/registry/curated-overlay.d.ts +36 -4
  20. package/dist/registry/curated-overlay.js +87 -14
  21. package/dist/registry/errors.d.ts +26 -0
  22. package/dist/registry/errors.js +38 -0
  23. package/dist/registry/extractor.d.ts +9 -10
  24. package/dist/registry/extractor.js +5 -15
  25. package/dist/registry/files.d.ts +26 -0
  26. package/dist/registry/files.js +160 -0
  27. package/dist/registry/generators/descriptors.d.ts +81 -0
  28. package/dist/registry/generators/descriptors.js +405 -0
  29. package/dist/registry/generators/fields.d.ts +46 -0
  30. package/dist/registry/generators/fields.js +111 -0
  31. package/dist/registry/generators/markdown/common.d.ts +21 -0
  32. package/dist/registry/generators/markdown/common.js +55 -0
  33. package/dist/registry/generators/markdown/index.d.ts +33 -0
  34. package/dist/registry/generators/markdown/index.js +37 -0
  35. package/dist/registry/generators/markdown/page.d.ts +8 -0
  36. package/dist/registry/generators/markdown/page.js +52 -0
  37. package/dist/registry/generators/markdown/pyvalue.d.ts +34 -0
  38. package/dist/registry/generators/markdown/pyvalue.js +106 -0
  39. package/dist/registry/generators/markdown/sections/choosing-object.d.ts +2 -0
  40. package/dist/registry/generators/markdown/sections/choosing-object.js +52 -0
  41. package/dist/registry/generators/markdown/sections/example.d.ts +22 -0
  42. package/dist/registry/generators/markdown/sections/example.js +295 -0
  43. package/dist/registry/generators/markdown/sections/filtering.d.ts +2 -0
  44. package/dist/registry/generators/markdown/sections/filtering.js +76 -0
  45. package/dist/registry/generators/markdown/sections/header.d.ts +2 -0
  46. package/dist/registry/generators/markdown/sections/header.js +37 -0
  47. package/dist/registry/generators/markdown/sections/inputs.d.ts +30 -0
  48. package/dist/registry/generators/markdown/sections/inputs.js +151 -0
  49. package/dist/registry/generators/markdown/sections/lookups.d.ts +12 -0
  50. package/dist/registry/generators/markdown/sections/lookups.js +150 -0
  51. package/dist/registry/generators/markdown/sections/outputs.d.ts +3 -0
  52. package/dist/registry/generators/markdown/sections/outputs.js +9 -0
  53. package/dist/registry/generators/markdown/sections/resolving-fields.d.ts +2 -0
  54. package/dist/registry/generators/markdown/sections/resolving-fields.js +139 -0
  55. package/dist/registry/generators/markdown/sections/schema-dynamic.d.ts +2 -0
  56. package/dist/registry/generators/markdown/sections/schema-dynamic.js +86 -0
  57. package/dist/registry/generators/materialize.d.ts +30 -0
  58. package/dist/registry/generators/materialize.js +132 -0
  59. package/dist/registry/generators/md-symbols.d.ts +22 -0
  60. package/dist/registry/generators/md-symbols.js +58 -0
  61. package/dist/registry/generators/triggers.d.ts +15 -0
  62. package/dist/registry/generators/triggers.js +85 -0
  63. package/dist/registry/generators/type-registry.d.ts +50 -0
  64. package/dist/registry/generators/type-registry.js +154 -0
  65. package/dist/registry/generators/type-tree.d.ts +65 -0
  66. package/dist/registry/generators/type-tree.js +179 -0
  67. package/dist/registry/library-build/build.d.ts +57 -0
  68. package/dist/registry/library-build/build.js +286 -0
  69. package/dist/registry/library-build/canonical.d.ts +119 -0
  70. package/dist/registry/library-build/canonical.js +512 -0
  71. package/dist/registry/library-build/cli.d.ts +45 -0
  72. package/dist/registry/library-build/cli.js +182 -0
  73. package/dist/registry/library-build/context.d.ts +107 -0
  74. package/dist/registry/library-build/context.js +267 -0
  75. package/dist/registry/library-build/enrich.d.ts +36 -0
  76. package/dist/registry/library-build/enrich.js +158 -0
  77. package/dist/registry/library-build/events.d.ts +108 -0
  78. package/dist/registry/library-build/events.js +476 -0
  79. package/dist/registry/library-build/generic-expand.d.ts +77 -0
  80. package/dist/registry/library-build/generic-expand.js +363 -0
  81. package/dist/registry/library-build/plan.d.ts +71 -0
  82. package/dist/registry/library-build/plan.js +270 -0
  83. package/dist/registry/library-build/py.d.ts +45 -0
  84. package/dist/registry/library-build/py.js +167 -0
  85. package/dist/registry/library-build/schema-action.d.ts +38 -0
  86. package/dist/registry/library-build/schema-action.js +107 -0
  87. package/dist/registry/library-build/write.d.ts +6 -0
  88. package/dist/registry/library-build/write.js +26 -0
  89. package/dist/registry/library-reader.d.ts +20 -0
  90. package/dist/registry/library-reader.js +50 -0
  91. package/dist/registry/lookup-specs.d.ts +55 -0
  92. package/dist/registry/lookup-specs.js +140 -0
  93. package/dist/registry/materialize-cli.js +28 -14
  94. package/dist/registry/materializer.d.ts +25 -3
  95. package/dist/registry/materializer.js +45 -29
  96. package/dist/registry/model/library.d.ts +254 -0
  97. package/dist/registry/model/library.js +23 -0
  98. package/dist/registry/naming.d.ts +54 -0
  99. package/dist/registry/naming.js +142 -0
  100. package/dist/registry/orphans.d.ts +4 -0
  101. package/dist/registry/orphans.js +86 -0
  102. package/dist/registry/prepare/actions.d.ts +26 -0
  103. package/dist/registry/prepare/actions.js +94 -0
  104. package/dist/registry/prepare/connections.d.ts +181 -0
  105. package/dist/registry/prepare/connections.js +399 -0
  106. package/dist/registry/prepare/event.d.ts +96 -0
  107. package/dist/registry/prepare/event.js +268 -0
  108. package/dist/registry/prepare/handoff.d.ts +21 -0
  109. package/dist/registry/prepare/handoff.js +91 -0
  110. package/dist/registry/prepare/ledger.d.ts +104 -0
  111. package/dist/registry/prepare/ledger.js +216 -0
  112. package/dist/registry/prepare/messages.d.ts +190 -0
  113. package/dist/registry/prepare/messages.js +472 -0
  114. package/dist/registry/prepare/objects.d.ts +130 -0
  115. package/dist/registry/prepare/objects.js +318 -0
  116. package/dist/registry/prepare/overlay.d.ts +149 -0
  117. package/dist/registry/prepare/overlay.js +487 -0
  118. package/dist/registry/prepare/parents.d.ts +41 -0
  119. package/dist/registry/prepare/parents.js +122 -0
  120. package/dist/registry/prepare/pipeline.d.ts +91 -0
  121. package/dist/registry/prepare/pipeline.js +376 -0
  122. package/dist/registry/prepare/regenerate.d.ts +9 -0
  123. package/dist/registry/prepare/regenerate.js +50 -0
  124. package/dist/registry/prepare/resolve.d.ts +199 -0
  125. package/dist/registry/prepare/resolve.js +470 -0
  126. package/dist/registry/prepare/retry.d.ts +83 -0
  127. package/dist/registry/prepare/retry.js +109 -0
  128. package/dist/registry/prepare/source-import.d.ts +54 -0
  129. package/dist/registry/prepare/source-import.js +192 -0
  130. package/dist/registry/prepare/support.d.ts +41 -0
  131. package/dist/registry/prepare/support.js +178 -0
  132. package/dist/registry/prepare-cli.d.ts +16 -5
  133. package/dist/registry/prepare-cli.js +60 -53
  134. package/dist/registry/pull-cli.js +8 -7
  135. package/dist/registry/reporter.d.ts +26 -0
  136. package/dist/registry/reporter.js +41 -0
  137. package/dist/registry/uip/client.d.ts +99 -0
  138. package/dist/registry/uip/client.js +226 -0
  139. package/dist/registry/uip/commands.d.ts +40 -0
  140. package/dist/registry/uip/commands.js +80 -0
  141. package/dist/registry/uip/envelope.d.ts +37 -0
  142. package/dist/registry/uip/envelope.js +84 -0
  143. package/dist/registry/uip/response-cache.d.ts +28 -0
  144. package/dist/registry/uip/response-cache.js +57 -0
  145. package/lib/README.md +10 -8
  146. package/package.json +3 -3
  147. package/dist/generators/_connections.py +0 -331
  148. package/dist/generators/_events.py +0 -355
  149. package/dist/generators/_lookups.py +0 -114
  150. package/dist/generators/_naming.py +0 -185
  151. package/dist/generators/_objects.py +0 -299
  152. package/dist/generators/_resolve.py +0 -319
  153. package/dist/generators/convert_library_to_md.py +0 -1441
  154. package/dist/generators/extract_library.py +0 -125
  155. package/dist/generators/generate_connectors_ts.py +0 -936
  156. package/dist/generators/generate_library_json.py +0 -2527
  157. package/dist/generators/generate_triggers_ts.py +0 -110
  158. package/dist/generators/materialize_registry.py +0 -155
  159. package/dist/generators/prepare_connector.py +0 -1860
  160. package/dist/registry/python.d.ts +0 -26
  161. package/dist/registry/python.js +0 -46
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The `uip` invocations the registry makes, as argv.
3
+ *
4
+ * Argument ORDER is part of each command's identity: recordings and the
5
+ * response cache are keyed by it, so a reordered flag is a cache miss and a
6
+ * fresh tenant call. The harness that compared this order against what the
7
+ * Python generators issued went with the Python; these builders still
8
+ * reproduce that order exactly, including the one odd case — `connections
9
+ * list` inserts its flags at a fixed position rather than appending them —
10
+ * because the committed fixtures under `tests/fixtures/library-build/cache`
11
+ * are keyed by the names the Python's order produced.
12
+ */
13
+ export declare const UIP = "uip";
14
+ /** `--connection-id <id>` when a connection is in scope, else nothing. */
15
+ export declare function connectionArgs(connectionId?: string): string[];
16
+ /** `-f name=value` per parent field, in the order given. */
17
+ export declare function fieldArgs(parentFields: ReadonlyMap<string, string> | Readonly<Record<string, string>> | undefined): string[];
18
+ export declare function registrySearchConnectors(): string[];
19
+ export declare function registrySearch(query: string): string[];
20
+ export declare function registryGet(nodeType: string, connectionId?: string): string[];
21
+ export declare function isConnectorsMetadata(connectorKey: string): string[];
22
+ export declare function isResourcesDescribeOperation(connectorKey: string, objectName: string, operation: string, connectionId?: string, parentFields?: ReadonlyMap<string, string> | Readonly<Record<string, string>>): string[];
23
+ export declare function isResourcesDescribeObject(connectorKey: string, objectName: string, connectionId?: string): string[];
24
+ export declare function isResourcesList(connectorKey: string, options?: {
25
+ operation?: string;
26
+ refresh?: boolean;
27
+ connectionId?: string;
28
+ }): string[];
29
+ export declare function isResourcesRunList(connectorKey: string, collection: string, connectionId: string, query?: string): string[];
30
+ export declare function isTriggersObjects(connectorKey: string, operation: string, connectionId?: string): string[];
31
+ export declare function isTriggersDescribe(connectorKey: string, operation: string, objectName: string, connectionId?: string): string[];
32
+ /**
33
+ * `uip is connections list --output json`, with `--all-folders` and `--byoa`
34
+ * inserted at position 4 — `--byoa` last, so it lands first — exactly as the
35
+ * Python did.
36
+ */
37
+ export declare function isConnectionsList(options?: {
38
+ allFolders?: boolean;
39
+ byoa?: boolean;
40
+ }): string[];
@@ -0,0 +1,80 @@
1
+ /**
2
+ * The `uip` invocations the registry makes, as argv.
3
+ *
4
+ * Argument ORDER is part of each command's identity: recordings and the
5
+ * response cache are keyed by it, so a reordered flag is a cache miss and a
6
+ * fresh tenant call. The harness that compared this order against what the
7
+ * Python generators issued went with the Python; these builders still
8
+ * reproduce that order exactly, including the one odd case — `connections
9
+ * list` inserts its flags at a fixed position rather than appending them —
10
+ * because the committed fixtures under `tests/fixtures/library-build/cache`
11
+ * are keyed by the names the Python's order produced.
12
+ */
13
+ export const UIP = "uip";
14
+ /** `--connection-id <id>` when a connection is in scope, else nothing. */
15
+ export function connectionArgs(connectionId) {
16
+ return connectionId ? ["--connection-id", connectionId] : [];
17
+ }
18
+ /** `-f name=value` per parent field, in the order given. */
19
+ export function fieldArgs(parentFields) {
20
+ if (!parentFields)
21
+ return [];
22
+ const entries = parentFields instanceof Map ? [...parentFields.entries()] : Object.entries(parentFields);
23
+ return entries.flatMap(([name, value]) => ["-f", `${name}=${value}`]);
24
+ }
25
+ export function registrySearchConnectors() {
26
+ return [UIP, "maestro", "flow", "registry", "search", "--filter", "tags:in=connector", "--output", "json"];
27
+ }
28
+ export function registrySearch(query) {
29
+ return [UIP, "maestro", "flow", "registry", "search", query, "--output", "json"];
30
+ }
31
+ export function registryGet(nodeType, connectionId) {
32
+ return [UIP, "maestro", "flow", "registry", "get", nodeType, "--output", "json", ...connectionArgs(connectionId)];
33
+ }
34
+ export function isConnectorsMetadata(connectorKey) {
35
+ return [UIP, "is", "connectors", "metadata", connectorKey, "--output", "json"];
36
+ }
37
+ export function isResourcesDescribeOperation(connectorKey, objectName, operation, connectionId, parentFields) {
38
+ return [
39
+ UIP, "is", "resources", "describe", connectorKey, objectName, "--operation", operation, "--output", "json",
40
+ ...connectionArgs(connectionId),
41
+ ...fieldArgs(parentFields),
42
+ ];
43
+ }
44
+ export function isResourcesDescribeObject(connectorKey, objectName, connectionId) {
45
+ return [UIP, "is", "resources", "describe", connectorKey, objectName, "--output", "json", ...connectionArgs(connectionId)];
46
+ }
47
+ export function isResourcesList(connectorKey, options = {}) {
48
+ return [
49
+ UIP, "is", "resources", "list", connectorKey,
50
+ ...(options.operation ? ["--operation", options.operation] : []),
51
+ ...(options.refresh ? ["--refresh"] : []),
52
+ "--output", "json",
53
+ ...connectionArgs(options.connectionId),
54
+ ];
55
+ }
56
+ export function isResourcesRunList(connectorKey, collection, connectionId, query) {
57
+ return [
58
+ UIP, "is", "resources", "run", "list", connectorKey, collection, "--connection-id", connectionId, "--output", "json",
59
+ ...(query ? ["--query", query] : []),
60
+ ];
61
+ }
62
+ export function isTriggersObjects(connectorKey, operation, connectionId) {
63
+ return [UIP, "is", "triggers", "objects", connectorKey, operation, ...connectionArgs(connectionId), "--output", "json"];
64
+ }
65
+ export function isTriggersDescribe(connectorKey, operation, objectName, connectionId) {
66
+ return [UIP, "is", "triggers", "describe", connectorKey, operation, objectName, ...connectionArgs(connectionId), "--output", "json"];
67
+ }
68
+ /**
69
+ * `uip is connections list --output json`, with `--all-folders` and `--byoa`
70
+ * inserted at position 4 — `--byoa` last, so it lands first — exactly as the
71
+ * Python did.
72
+ */
73
+ export function isConnectionsList(options = {}) {
74
+ const argv = [UIP, "is", "connections", "list", "--output", "json"];
75
+ if (options.allFolders)
76
+ argv.splice(4, 0, "--all-folders");
77
+ if (options.byoa)
78
+ argv.splice(4, 0, "--byoa");
79
+ return argv;
80
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Reading what `uip … --output json` prints.
3
+ *
4
+ * The CLI is chatty: an update banner, a tool-version warning and a
5
+ * `ManifestClient` diagnostic can precede the JSON document, and the document
6
+ * itself is a `{ Result, Data, Message, … }` envelope whose key casing has
7
+ * varied between tools. Three Python callers each had their own loop for
8
+ * finding the document; this is the one loop, and the one accessor.
9
+ */
10
+ /** The shape every `uip` JSON response shares, read case-insensitively. */
11
+ export interface UipEnvelope {
12
+ Result?: unknown;
13
+ Data?: unknown;
14
+ Message?: unknown;
15
+ [key: string]: unknown;
16
+ }
17
+ /**
18
+ * The first JSON document in `text`, or `undefined`.
19
+ *
20
+ * Tries the whole text first (the common case), then every line that begins
21
+ * with `{` or `[`, parsing from that line to the end. The banner the CLI
22
+ * prints ahead of its payload never starts a line with a bracket.
23
+ */
24
+ export declare function findJsonDocument(text: string): unknown;
25
+ /** `mapping[name]` for the first `name` that matches a key case-insensitively. */
26
+ export declare function getCI(mapping: unknown, ...names: string[]): unknown;
27
+ /** The envelope in `text`, or `undefined` when no object with a `Result` is there. */
28
+ export declare function parseEnvelope(text: string): UipEnvelope | undefined;
29
+ /** True when the envelope says the call worked. */
30
+ export declare function isSuccess(envelope: UipEnvelope | undefined): boolean;
31
+ /**
32
+ * `Data` as a list of records, accepting both the bare-array and the
33
+ * `{ items: [...] }` spellings the Integration Service tool has used.
34
+ */
35
+ export declare function dataItems(envelope: UipEnvelope | undefined): unknown[];
36
+ /** The last `limit` characters of a stream, for a message. */
37
+ export declare function tail(text: string, limit?: number): string;
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Reading what `uip … --output json` prints.
3
+ *
4
+ * The CLI is chatty: an update banner, a tool-version warning and a
5
+ * `ManifestClient` diagnostic can precede the JSON document, and the document
6
+ * itself is a `{ Result, Data, Message, … }` envelope whose key casing has
7
+ * varied between tools. Three Python callers each had their own loop for
8
+ * finding the document; this is the one loop, and the one accessor.
9
+ */
10
+ /**
11
+ * The first JSON document in `text`, or `undefined`.
12
+ *
13
+ * Tries the whole text first (the common case), then every line that begins
14
+ * with `{` or `[`, parsing from that line to the end. The banner the CLI
15
+ * prints ahead of its payload never starts a line with a bracket.
16
+ */
17
+ export function findJsonDocument(text) {
18
+ const trimmed = text.trim();
19
+ if (trimmed === "")
20
+ return undefined;
21
+ try {
22
+ return JSON.parse(trimmed);
23
+ }
24
+ catch {
25
+ // fall through to the line scan
26
+ }
27
+ const lines = text.split(/\r?\n/);
28
+ for (let i = 0; i < lines.length; i++) {
29
+ const head = lines[i].trimStart();
30
+ if (!head.startsWith("{") && !head.startsWith("["))
31
+ continue;
32
+ try {
33
+ return JSON.parse(lines.slice(i).join("\n"));
34
+ }
35
+ catch {
36
+ continue;
37
+ }
38
+ }
39
+ return undefined;
40
+ }
41
+ /** `mapping[name]` for the first `name` that matches a key case-insensitively. */
42
+ export function getCI(mapping, ...names) {
43
+ if (typeof mapping !== "object" || mapping === null || Array.isArray(mapping))
44
+ return undefined;
45
+ const keys = new Map();
46
+ for (const key of Object.keys(mapping))
47
+ keys.set(key.toLowerCase(), key);
48
+ for (const name of names) {
49
+ const key = keys.get(name.toLowerCase());
50
+ if (key !== undefined)
51
+ return mapping[key];
52
+ }
53
+ return undefined;
54
+ }
55
+ /** The envelope in `text`, or `undefined` when no object with a `Result` is there. */
56
+ export function parseEnvelope(text) {
57
+ const document = findJsonDocument(text);
58
+ if (typeof document !== "object" || document === null || Array.isArray(document))
59
+ return undefined;
60
+ return document;
61
+ }
62
+ /** True when the envelope says the call worked. */
63
+ export function isSuccess(envelope) {
64
+ return getCI(envelope, "Result") === "Success";
65
+ }
66
+ /**
67
+ * `Data` as a list of records, accepting both the bare-array and the
68
+ * `{ items: [...] }` spellings the Integration Service tool has used.
69
+ */
70
+ export function dataItems(envelope) {
71
+ const data = getCI(envelope, "Data");
72
+ if (Array.isArray(data))
73
+ return data;
74
+ if (typeof data === "object" && data !== null) {
75
+ const items = getCI(data, "items");
76
+ if (Array.isArray(items))
77
+ return items;
78
+ }
79
+ return [];
80
+ }
81
+ /** The last `limit` characters of a stream, for a message. */
82
+ export function tail(text, limit = 300) {
83
+ return text.length <= limit ? text : text.slice(text.length - limit);
84
+ }
@@ -0,0 +1,28 @@
1
+ export interface ResponseCache {
2
+ /** The parsed payload, or `undefined` when nothing is cached under `name`. */
3
+ read(name: string): unknown;
4
+ /** Store a payload; `raw` stores the text verbatim instead of re-serializing. */
5
+ write(name: string, payload: unknown, raw?: string): void;
6
+ has(name: string): boolean;
7
+ }
8
+ /** The marker the Python left for a call that answered `Result: Failure`. */
9
+ export declare const CACHED_FAILURE = "_cached_failure";
10
+ /** True for a payload the cache stored to remember a failure. */
11
+ export declare function isCachedFailure(payload: unknown): boolean;
12
+ /** `_safe_filename(*parts)`: `"__".join(parts)` with anything unusual squashed to `_`. */
13
+ export declare function safeCacheName(...parts: string[]): string;
14
+ export declare class FsResponseCache implements ResponseCache {
15
+ readonly directory: string;
16
+ constructor(directory: string);
17
+ private path;
18
+ has(name: string): boolean;
19
+ read(name: string): unknown;
20
+ write(name: string, payload: unknown, raw?: string): void;
21
+ }
22
+ /** An in-memory cache for tests and for callers that want no disk. */
23
+ export declare class MemoryResponseCache implements ResponseCache {
24
+ private readonly entries;
25
+ has(name: string): boolean;
26
+ read(name: string): unknown;
27
+ write(name: string, payload: unknown, raw?: string): void;
28
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * A cache of `uip` payloads on disk, keyed by a name the caller derives from the
3
+ * call. The library builder used one per command family so a re-run after a
4
+ * failure re-issues only the calls that never answered; `prepare` uses the same
5
+ * shape for its one-run temp directory.
6
+ *
7
+ * File names follow the Python generator's exactly, so a `--keep-temp` cache
8
+ * written by the Python and read by this code compares the pure transform and
9
+ * nothing else.
10
+ */
11
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
12
+ import { join } from "node:path";
13
+ /** The marker the Python left for a call that answered `Result: Failure`. */
14
+ export const CACHED_FAILURE = "_cached_failure";
15
+ /** True for a payload the cache stored to remember a failure. */
16
+ export function isCachedFailure(payload) {
17
+ return typeof payload === "object" && payload !== null && payload[CACHED_FAILURE] === true;
18
+ }
19
+ /** `_safe_filename(*parts)`: `"__".join(parts)` with anything unusual squashed to `_`. */
20
+ export function safeCacheName(...parts) {
21
+ return parts.join("__").replace(/[^a-zA-Z0-9_.@-]+/g, "_");
22
+ }
23
+ export class FsResponseCache {
24
+ directory;
25
+ constructor(directory) {
26
+ this.directory = directory;
27
+ mkdirSync(directory, { recursive: true });
28
+ }
29
+ path(name) {
30
+ return join(this.directory, name);
31
+ }
32
+ has(name) {
33
+ return existsSync(this.path(name));
34
+ }
35
+ read(name) {
36
+ const path = this.path(name);
37
+ if (!existsSync(path))
38
+ return undefined;
39
+ return JSON.parse(readFileSync(path, "utf8"));
40
+ }
41
+ write(name, payload, raw) {
42
+ writeFileSync(this.path(name), raw ?? JSON.stringify(payload));
43
+ }
44
+ }
45
+ /** An in-memory cache for tests and for callers that want no disk. */
46
+ export class MemoryResponseCache {
47
+ entries = new Map();
48
+ has(name) {
49
+ return this.entries.has(name);
50
+ }
51
+ read(name) {
52
+ return this.entries.get(name);
53
+ }
54
+ write(name, payload, raw) {
55
+ this.entries.set(name, raw !== undefined ? JSON.parse(raw) : payload);
56
+ }
57
+ }
package/lib/README.md CHANGED
@@ -39,8 +39,9 @@ And the two materialized trees:
39
39
  two can't drift.
40
40
 
41
41
  The markdown cites the TypeScript by name (`connector(SendMessageToUser, …)`),
42
- and those names exist in neither tree — both generators derive them through
43
- `integrations/scripts/_naming.py`. `unpack-library.sh` cross-checks every cited
42
+ and those names exist in neither tree — both generators derive them through the
43
+ one `symbolIndex` in `src/registry/naming.ts`. `registry materialize
44
+ --check-symbols` (which `unpack-library.mjs` passes) cross-checks every cited
44
45
  symbol against the emitted modules and fails if one is missing, because a wrong
45
46
  symbol is an import that throws, printed by documentation.
46
47
 
@@ -63,8 +64,8 @@ lib/
63
64
  ├── library-md/ discovery docs the agent reads — GITIGNORED, derived from library-json/
64
65
  │ └── <connector>/<action>@<ver>.md (+ a root index.json and SKILL.md)
65
66
  └── scripts/
66
- ├── unpack-library.sh integrations/artifacts/library-json.zip → library-json/, then derive library-md/
67
- └── generate-library-json.sh (re)generate library-json/ from the live registry (needs a logged-in uip)
67
+ ├── unpack-library.mjs integrations/artifacts/library-json.zip → library-json/, then derive library-md/ + descriptors
68
+ └── generate-library-json.mjs (re)generate library-json/ from the live registry (needs a logged-in uip)
68
69
  ```
69
70
 
70
71
  The generator and the shipped **`library-json.zip`** live in the top-level
@@ -74,11 +75,12 @@ The generator and the shipped **`library-json.zip`** live in the top-level
74
75
 
75
76
  ```bash
76
77
  cd typescript/sdk/lib
77
- scripts/unpack-library.sh # library-json.zip → library-json/ (~214 MB), then derive library-md/ (~2 s)
78
+ node scripts/unpack-library.mjs # library-json.zip → library-json/ (~214 MB), then derive library-md/ + dist/connectors/ (~40 s)
78
79
  ```
79
80
 
80
- Unzips the canonical JSON (the source of truth), then regenerates the markdown
81
- from it via `integrations/scripts/convert_library_to_md.py`. Both trees are
81
+ Extracts the canonical JSON (the source of truth), then regenerates the markdown
82
+ and the typed descriptors from it through the SDK's own `registry pull` and
83
+ `registry materialize`. Both trees are
82
84
  gitignored (~21k files). The e2e Docker image runs this at build; `$FLOW_SDK_LIBRARY_JSON`
83
85
  points at the materialized `library-json/`. Until you unpack, only
84
86
  `library-json.samples/` (the 3 examples) exists locally.
@@ -95,7 +97,7 @@ The zip is a snapshot. To refresh it against the live registry:
95
97
 
96
98
  ```bash
97
99
  uip login -t <tenant> # verify: uip is connectors list
98
- scripts/generate-library-json.sh all # registry → library-json/ (~7k ops, slow)
100
+ node scripts/generate-library-json.mjs all # registry → library-json/ (~7k ops, slow)
99
101
  # then re-bundle, from the repo root:
100
102
  rm -rf integrations/library-json && cp -R typescript/sdk/lib/library-json integrations/library-json
101
103
  find integrations/library-json -print | LC_ALL=C sort | zip -q -X integrations/artifacts/library-json.zip -@
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.3.0",
3
+ "version": "6.5.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",
@@ -64,7 +64,7 @@
64
64
  "node": ">=22.6"
65
65
  },
66
66
  "scripts": {
67
- "build": "tsc && tsc -p cli/tsconfig.json && cp skill/references/api-index.md dist/api-index.md && cp skill/references/api-members.md dist/api-members.md && cp src/core-definitions.json dist/core-definitions.json && cp src/ixp-definition.json dist/ixp-definition.json && cp src/bpmn/uipath-moddle.v1.json dist/bpmn/uipath-moddle.v1.json && cp src/bpmn/registry-types.json dist/bpmn/registry-types.json && node scripts/copy-registry-generators.mjs && node scripts/extract-api-model.mjs --check && node scripts/gen-api-index.mjs --check && node scripts/api-doc-coverage.mjs --check && node scripts/check-api-docs.mjs",
67
+ "build": "tsc && tsc -p cli/tsconfig.json && cp src/core-definitions.json dist/core-definitions.json && cp src/ixp-definition.json dist/ixp-definition.json && cp src/bpmn/uipath-moddle.v1.json dist/bpmn/uipath-moddle.v1.json && cp src/bpmn/registry-types.json dist/bpmn/registry-types.json && node scripts/extract-api-model.mjs --check && node scripts/gen-api-index.mjs && node scripts/api-doc-coverage.mjs --check && node scripts/check-api-docs.mjs",
68
68
  "check:package": "node scripts/check-package-contents.mjs",
69
69
  "generate:api": "node scripts/extract-api-model.mjs && node scripts/gen-api-index.mjs",
70
70
  "docs:check": "node scripts/check-api-docs.mjs",
@@ -87,5 +87,5 @@
87
87
  "@types/node": "^22.7.0",
88
88
  "esbuild": "^0.28.1"
89
89
  },
90
- "gitref": "a836c088fd55c8f0dc3f5650a89168f0c934d685"
90
+ "gitref": "7fb29d6f777b5b983815fbef279ffbcff204c5e2"
91
91
  }