@uipath/maestro-builder-sdk 6.124.5 → 6.124.6
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/registry/library-build/context.d.ts +7 -6
- package/dist/registry/library-build/context.js +15 -11
- package/dist/registry/library-build/enrich.js +2 -0
- package/dist/registry/prepare/failed-describe.d.ts +3 -0
- package/dist/registry/prepare/failed-describe.js +26 -0
- package/dist/registry/prepare/messages.d.ts +11 -0
- package/dist/registry/prepare/messages.js +29 -0
- package/dist/registry/prepare/pipeline.js +3 -0
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@ export interface BuildPorts {
|
|
|
18
18
|
/** Kill a `uip` call after this long. Unset means no limit, as the Python had none. */
|
|
19
19
|
timeoutMs?: number;
|
|
20
20
|
}
|
|
21
|
-
/** One describe that failed
|
|
21
|
+
/** One describe that failed: `(connector, object, operation, message)`. */
|
|
22
22
|
export type FailedFieldDescribe = readonly [
|
|
23
23
|
connectorKey: string,
|
|
24
24
|
objectName: string,
|
|
@@ -32,13 +32,15 @@ export type FailedFieldDescribe = readonly [
|
|
|
32
32
|
* `--connection-id`; `parentFields` are forwarded as `-f name=value` on
|
|
33
33
|
* describes and discriminate their cache key; `failedFieldDescribes` collects
|
|
34
34
|
* the CLI's own rejection message for each describe that failed under `-f`,
|
|
35
|
-
* because the pipeline otherwise swallows it (see `isDescribeOperation`)
|
|
35
|
+
* because the pipeline otherwise swallows it (see `isDescribeOperation`);
|
|
36
|
+
* `failedDescribes` collects every failed describe, with or without parent fields.
|
|
36
37
|
*/
|
|
37
38
|
export interface BuildContext extends BuildPorts {
|
|
38
39
|
connectionId?: string;
|
|
39
40
|
/** Insertion order is the `-f` order on the command line. */
|
|
40
41
|
parentFields: Map<string, string>;
|
|
41
42
|
failedFieldDescribes: FailedFieldDescribe[];
|
|
43
|
+
failedDescribes: FailedFieldDescribe[];
|
|
42
44
|
}
|
|
43
45
|
export interface BuildScope {
|
|
44
46
|
connectionId?: string;
|
|
@@ -100,10 +102,9 @@ export declare function registryGet(ctx: BuildContext, nodeType: string, quiet?:
|
|
|
100
102
|
* <object> --operation <op>` (plus `--connection-id` and `-f` when set).
|
|
101
103
|
*
|
|
102
104
|
* Returns the payload's `Data` on success, or `undefined` on any failure. A
|
|
103
|
-
* failure is cached too, with a sentinel that keeps the CLI's `Message
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* set — from a fresh call and from a cached failure alike.
|
|
105
|
+
* failure is cached too, with a sentinel that keeps the CLI's `Message`, and
|
|
106
|
+
* recorded on the context from a fresh call and a cached failure alike; a call
|
|
107
|
+
* with no parseable answer is recorded in `failedDescribes` only, and not cached.
|
|
107
108
|
*/
|
|
108
109
|
export declare function isDescribeOperation(ctx: BuildContext, connectorKey: string, objectName: string, operation: string): Promise<unknown>;
|
|
109
110
|
/**
|
|
@@ -29,6 +29,7 @@ export function createBuildContext(ports, scope = {}) {
|
|
|
29
29
|
...(scope.connectionId ? { connectionId: scope.connectionId } : {}),
|
|
30
30
|
parentFields,
|
|
31
31
|
failedFieldDescribes: [],
|
|
32
|
+
failedDescribes: [],
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
/** `_schema_cache_scope()`: static and per-connection responses never share a cache. */
|
|
@@ -149,20 +150,23 @@ export async function registryGet(ctx, nodeType, quiet = false) {
|
|
|
149
150
|
ctx.reporter.warn(` WARN: registry get failed for ${nodeType}: ${probe.miss.reason}`);
|
|
150
151
|
return undefined;
|
|
151
152
|
}
|
|
153
|
+
function describeFailure(connectorKey, objectName, operation, message) {
|
|
154
|
+
return [connectorKey, objectName, operation, typeof message === "string" && message ? message : ""];
|
|
155
|
+
}
|
|
152
156
|
function noteFailedFieldDescribe(ctx, connectorKey, objectName, operation, message) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
const failure = describeFailure(connectorKey, objectName, operation, message);
|
|
158
|
+
ctx.failedDescribes.push(failure);
|
|
159
|
+
if (ctx.parentFields.size > 0)
|
|
160
|
+
ctx.failedFieldDescribes.push(failure);
|
|
156
161
|
}
|
|
157
162
|
/**
|
|
158
163
|
* `is_describe_operation`: cached `uip is resources describe <connector>
|
|
159
164
|
* <object> --operation <op>` (plus `--connection-id` and `-f` when set).
|
|
160
165
|
*
|
|
161
166
|
* Returns the payload's `Data` on success, or `undefined` on any failure. A
|
|
162
|
-
* failure is cached too, with a sentinel that keeps the CLI's `Message
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* set — from a fresh call and from a cached failure alike.
|
|
167
|
+
* failure is cached too, with a sentinel that keeps the CLI's `Message`, and
|
|
168
|
+
* recorded on the context from a fresh call and a cached failure alike; a call
|
|
169
|
+
* with no parseable answer is recorded in `failedDescribes` only, and not cached.
|
|
166
170
|
*/
|
|
167
171
|
export async function isDescribeOperation(ctx, connectorKey, objectName, operation) {
|
|
168
172
|
const parts = [schemaCacheScope(ctx), connectorKey, objectName, operation];
|
|
@@ -177,11 +181,11 @@ export async function isDescribeOperation(ctx, connectorKey, objectName, operati
|
|
|
177
181
|
return isPyDict(cached) && cached.Data !== undefined ? cached.Data : undefined;
|
|
178
182
|
}
|
|
179
183
|
const result = await runUip(ctx, isResourcesDescribeOperation(connectorKey, objectName, operation, ctx.connectionId, ctx.parentFields));
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (parsed === undefined)
|
|
184
|
+
const parsed = refused(result) ? undefined : parseStdout(result.stdout);
|
|
185
|
+
if (parsed === undefined) {
|
|
186
|
+
ctx.failedDescribes.push(describeFailure(connectorKey, objectName, operation, failureReason(result)));
|
|
184
187
|
return undefined;
|
|
188
|
+
}
|
|
185
189
|
const payload = envelope(parsed);
|
|
186
190
|
if (get(payload, "Result") !== "Success") {
|
|
187
191
|
noteFailedFieldDescribe(ctx, connectorKey, objectName, operation, get(payload, "Message"));
|
|
@@ -161,6 +161,7 @@ export async function enrichEntry(ctx, entry) {
|
|
|
161
161
|
if (!pyTruthy(opName))
|
|
162
162
|
return entry; // nothing to do
|
|
163
163
|
const failuresBefore = ctx.failedFieldDescribes.length;
|
|
164
|
+
const describeFailuresBefore = ctx.failedDescribes.length;
|
|
164
165
|
let data = await isDescribeOperation(ctx, connectorKey, objectName, opName);
|
|
165
166
|
if (!pyTruthy(data)) {
|
|
166
167
|
const alt = await discoverOperationName(ctx, entry);
|
|
@@ -175,6 +176,7 @@ export async function enrichEntry(ctx, entry) {
|
|
|
175
176
|
// query-entity-records and get-entity-record-by-id). Only the describe
|
|
176
177
|
// whose answer is used may speak for the parent set.
|
|
177
178
|
ctx.failedFieldDescribes.length = failuresBefore;
|
|
179
|
+
ctx.failedDescribes.length = describeFailuresBefore;
|
|
178
180
|
data = await isDescribeOperation(ctx, connectorKey, objectName, alt);
|
|
179
181
|
}
|
|
180
182
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type BuildContext, type FailedFieldDescribe } from "../library-build/context.js";
|
|
2
|
+
import type { LibraryEntry } from "../model/library.js";
|
|
3
|
+
export declare function recoverFailedDescribe(ctx: BuildContext, entry: LibraryEntry, failures: readonly FailedFieldDescribe[], warn: (line: string) => void): Promise<LibraryEntry>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { inputSchemaFromConnection } from "../../core/library.js";
|
|
2
|
+
import { enrichEntry } from "../library-build/enrich.js";
|
|
3
|
+
import { DescribeFallback, PrepareRefusal, describeFailedLine, describeFailedMessage } from "./messages.js";
|
|
4
|
+
const DESCRIBE_FAILED = "DESCRIBE_FAILED";
|
|
5
|
+
export async function recoverFailedDescribe(ctx, entry, failures, warn) {
|
|
6
|
+
const failure = failures.at(-1);
|
|
7
|
+
if (failure === undefined)
|
|
8
|
+
return entry;
|
|
9
|
+
if (ctx.parentFields.size > 0)
|
|
10
|
+
return entry;
|
|
11
|
+
if (inputSchemaFromConnection(entry)) {
|
|
12
|
+
warn(describeFailedLine(failure, DescribeFallback.RegistryEntry));
|
|
13
|
+
return entry;
|
|
14
|
+
}
|
|
15
|
+
// Shares `caches`; the describe without a connection caches under its own scope.
|
|
16
|
+
const withoutConnection = { ...ctx, connectionId: undefined, failedFieldDescribes: [], failedDescribes: [] };
|
|
17
|
+
const filled = await enrichEntry(withoutConnection, entry);
|
|
18
|
+
if (withoutConnection.failedDescribes.length === 0) {
|
|
19
|
+
warn(describeFailedLine(failure, DescribeFallback.WithoutConnection));
|
|
20
|
+
return filled;
|
|
21
|
+
}
|
|
22
|
+
if (entry.inputSchema.fields.length === 0)
|
|
23
|
+
throw new PrepareRefusal(describeFailedMessage(failure), DESCRIBE_FAILED);
|
|
24
|
+
warn(describeFailedLine(failure, DescribeFallback.RegistryEntry));
|
|
25
|
+
return entry;
|
|
26
|
+
}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* `core/cli-spelling.ts`) without this module reading the environment.
|
|
22
22
|
*/
|
|
23
23
|
import { Refusal } from "../errors.js";
|
|
24
|
+
import type { FailedFieldDescribe } from "../library-build/context.js";
|
|
24
25
|
import { type RegistryCatalog, type RegistryRefresh } from "./actions.js";
|
|
25
26
|
import type { IntegrationServiceMiss } from "./integration-service.js";
|
|
26
27
|
export declare const PREFIX = "prepare-connector: ";
|
|
@@ -139,6 +140,16 @@ export declare function fieldFlagMessage(pair: string): string;
|
|
|
139
140
|
* non-empty message is the one quoted.
|
|
140
141
|
*/
|
|
141
142
|
export declare function rejectedParentFieldsMessage(pairs: readonly string[], failures?: ReadonlyArray<readonly unknown[]>): string;
|
|
143
|
+
/** What `prepare` did about a failed connection-scoped describe. */
|
|
144
|
+
export declare enum DescribeFallback {
|
|
145
|
+
/** The registry's entry was kept as it is. */
|
|
146
|
+
RegistryEntry = 0,
|
|
147
|
+
/** The input schema was read from the describe without the connection. */
|
|
148
|
+
WithoutConnection = 1
|
|
149
|
+
}
|
|
150
|
+
/** The warning when `is resources describe --connection-id` failed for the action. */
|
|
151
|
+
export declare function describeFailedLine(failure: FailedFieldDescribe, fallback: DescribeFallback): string;
|
|
152
|
+
export declare function describeFailedMessage(failure: FailedFieldDescribe): string;
|
|
142
153
|
/** ` object: <note>` — the ladder's normalization sentence. */
|
|
143
154
|
export declare function objectNoteLine(note: string): string;
|
|
144
155
|
/** ` object: <requested> -> <matched> recorded in <ledger>`. */
|
|
@@ -313,6 +313,35 @@ export function rejectedParentFieldsMessage(pairs, failures = []) {
|
|
|
313
313
|
"only inside its project), so they cannot be copied from another " +
|
|
314
314
|
"project, connection, or task.");
|
|
315
315
|
}
|
|
316
|
+
/** What `prepare` did about a failed connection-scoped describe. */
|
|
317
|
+
export var DescribeFallback;
|
|
318
|
+
(function (DescribeFallback) {
|
|
319
|
+
/** The registry's entry was kept as it is. */
|
|
320
|
+
DescribeFallback[DescribeFallback["RegistryEntry"] = 0] = "RegistryEntry";
|
|
321
|
+
/** The input schema was read from the describe without the connection. */
|
|
322
|
+
DescribeFallback[DescribeFallback["WithoutConnection"] = 1] = "WithoutConnection";
|
|
323
|
+
})(DescribeFallback || (DescribeFallback = {}));
|
|
324
|
+
function describeSubject(connectorKey, objectName, operation) {
|
|
325
|
+
return `${connectorKey} ${objectName} ${operation}`;
|
|
326
|
+
}
|
|
327
|
+
function serviceSaid(message) {
|
|
328
|
+
return (message || "no message").replace(/\.$/, "");
|
|
329
|
+
}
|
|
330
|
+
/** The warning when `is resources describe --connection-id` failed for the action. */
|
|
331
|
+
export function describeFailedLine(failure, fallback) {
|
|
332
|
+
const [connectorKey, objectName, operation, message] = failure;
|
|
333
|
+
const outcome = fallback === DescribeFallback.WithoutConnection
|
|
334
|
+
? "The input schema was read from the describe without the connection instead, so fields only this connection adds are missing."
|
|
335
|
+
: "The registry's entry was used as it is, so fields it does not list are missing.";
|
|
336
|
+
return (`${PREFIX}WARN: Integration Service could not describe ${describeSubject(connectorKey, objectName, operation)} ` +
|
|
337
|
+
`with this connection: ${serviceSaid(message)}. ${outcome}`);
|
|
338
|
+
}
|
|
339
|
+
export function describeFailedMessage(failure) {
|
|
340
|
+
const [connectorKey, objectName, operation, message] = failure;
|
|
341
|
+
return (`${PREFIX}Integration Service failed to describe ${describeSubject(connectorKey, objectName, operation)} ` +
|
|
342
|
+
`with this connection and without it, so no input field is known for it. Integration Service said: ${serviceSaid(message)}. ` +
|
|
343
|
+
"Editing the flow cannot fix this. Check the connection works and retry; if it still fails, report it with this output.");
|
|
344
|
+
}
|
|
316
345
|
// ---------------------------------------------------------------------------
|
|
317
346
|
// The object decision
|
|
318
347
|
/** ` object: <note>` — the ladder's normalization sentence. */
|
|
@@ -38,6 +38,7 @@ import { planLibrary } from "../library-build/plan.js";
|
|
|
38
38
|
import { MemoryResponseCache } from "../uip/response-cache.js";
|
|
39
39
|
import { catalogServesNothing, refreshRegistryCatalog, registryCatalog } from "./actions.js";
|
|
40
40
|
import { loginScope } from "./catalog-absence.js";
|
|
41
|
+
import { recoverFailedDescribe } from "./failed-describe.js";
|
|
41
42
|
import { loginStatusData } from "../uip/login-status.js";
|
|
42
43
|
import { chooseConnection, listConnections, lookupConnection, mergeBindings, restoreBindings, snapshotBindings, solutionConnectionIds, } from "./connections.js";
|
|
43
44
|
import { prepareEvent } from "./event.js";
|
|
@@ -536,7 +537,9 @@ async function prepareOnConnection(options, ports, connected, registryRefresh) {
|
|
|
536
537
|
throw new PrepareRefusal(objectFlagsOnlyForGenericMessage(), "OBJECT_NOT_GENERIC");
|
|
537
538
|
// An Integration Service entry IS the describe; there is nothing to enrich it with.
|
|
538
539
|
if (fromIntegrationService === undefined) {
|
|
540
|
+
const failuresBefore = ctx.failedDescribes.length;
|
|
539
541
|
entry = await enrichEntry(ctx, entry); // full schema via --connection-id
|
|
542
|
+
entry = await recoverFailedDescribe(ctx, entry, ctx.failedDescribes.slice(failuresBefore), warn);
|
|
540
543
|
if (isExternalOperation(entry.operation)) {
|
|
541
544
|
const { mode, event } = libraryExecution(entry.operation);
|
|
542
545
|
if (mode === undefined)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.124.
|
|
3
|
+
"version": "6.124.6",
|
|
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",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"@types/node": "^22.7.0",
|
|
128
128
|
"esbuild": "^0.28.1"
|
|
129
129
|
},
|
|
130
|
-
"gitref": "
|
|
130
|
+
"gitref": "beb2ac8e1725ce8e73b2391c96fda0c99d2d9bc4"
|
|
131
131
|
}
|