@uipath/maestro-builder-sdk 6.11.4 → 6.11.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/api-index.md +132 -132
- package/dist/api-members.md +333 -333
- package/dist/check-cli.js +2 -1
- package/dist/check.d.ts +13 -0
- package/dist/check.js +201 -60
- package/dist/cli-library.d.ts +7 -0
- package/dist/cli-library.js +19 -0
- package/dist/compile-cli.js +8 -5
- package/dist/core/actions.d.ts +18 -0
- package/dist/core/byoa.d.ts +69 -0
- package/dist/core/byoa.js +98 -0
- package/dist/core/library.d.ts +23 -0
- package/dist/core/library.js +47 -1
- package/dist/core/lookup-store.d.ts +12 -0
- package/dist/core/lookup-store.js +25 -0
- package/dist/core/queue-record.d.ts +106 -0
- package/dist/core/queue-record.js +48 -0
- package/dist/flow-sdk.d.ts +1 -1
- package/dist/flow-sdk.js +1 -1
- package/dist/registry/generators/descriptors.d.ts +1 -1
- package/dist/registry/generators/descriptors.js +20 -2
- package/dist/registry/generators/markdown/page.js +3 -1
- package/dist/registry/generators/markdown/sections/event-facts.d.ts +2 -0
- package/dist/registry/generators/markdown/sections/event-facts.js +45 -0
- package/dist/registry/library-build/events.d.ts +32 -3
- package/dist/registry/library-build/events.js +48 -19
- package/dist/registry/prepare/byoa-ledger.d.ts +12 -0
- package/dist/registry/prepare/byoa-ledger.js +26 -0
- package/dist/registry/prepare/event.d.ts +5 -1
- package/dist/registry/prepare/event.js +22 -8
- package/dist/registry/prepare/messages.d.ts +2 -0
- package/dist/registry/prepare/messages.js +4 -0
- package/dist/serialize.js +25 -48
- package/package.json +2 -2
|
@@ -261,39 +261,69 @@ export function unionEventParameters(declared, objectParameters) {
|
|
|
261
261
|
}
|
|
262
262
|
return withCascade([...merged.values()]);
|
|
263
263
|
}
|
|
264
|
+
/** The three event facts: the API's (PascalCase) spelling and the stored (camelCase) one. */
|
|
264
265
|
const EVENT_FACTS = [
|
|
265
266
|
["EventMode", "eventMode"],
|
|
266
267
|
["ByoaConnection", "byoaConnection"],
|
|
267
268
|
["IsWebhookUrlVisible", "isWebhookUrlVisible"],
|
|
268
269
|
];
|
|
269
|
-
/**
|
|
270
|
-
|
|
270
|
+
/**
|
|
271
|
+
* THE precedence rule for the three event facts, used by every place that
|
|
272
|
+
* decides one: the `triggers objects` ROW wins, then `fallback`, and a fact
|
|
273
|
+
* neither states stays absent.
|
|
274
|
+
*
|
|
275
|
+
* `fallback` is whichever definition the caller holds — a `triggers describe`
|
|
276
|
+
* answer (PascalCase, generate time) or a registry node (camelCase, prepare
|
|
277
|
+
* time); both spellings are read. The row is the only one of the three sources
|
|
278
|
+
* that tells the truth about BYOA: Slack `message-received-in-slack` answers
|
|
279
|
+
* `ByoaConnection: true` in its objects row and `false` in both `describe` and
|
|
280
|
+
* the registry node. Generate time used to read `describe` alone while
|
|
281
|
+
* `prepare` read the row, so the library baked `false` for a BYOA-only event
|
|
282
|
+
* and nothing downstream could refuse a standard connection on it (#848).
|
|
283
|
+
* One function, so the two sides cannot drift again.
|
|
284
|
+
*/
|
|
285
|
+
export function resolveEventFacts(objectRow, fallback) {
|
|
286
|
+
const row = pyOr(objectRow, {});
|
|
287
|
+
const other = pyOr(fallback, {});
|
|
288
|
+
const out = {};
|
|
289
|
+
for (const [api, stored] of EVENT_FACTS) {
|
|
290
|
+
for (const [source, key] of [[row, api], [other, api], [other, stored]]) {
|
|
291
|
+
if (get(source, key) !== null) {
|
|
292
|
+
out[stored] = source[key];
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return out;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* `merge_describe_into_node`: fold a `triggers describe` answer into a registry
|
|
301
|
+
* trigger definition (a copy). The facts follow {@link resolveEventFacts}, so
|
|
302
|
+
* pass the event's `triggers objects` row when there is one: `prepare` stores
|
|
303
|
+
* this definition as the overlay, and `check` reads BYOA off the overlay.
|
|
304
|
+
*/
|
|
305
|
+
export function mergeDescribeIntoNode(node, describe, objectParameters = null, objectRow = null) {
|
|
271
306
|
const out = { ...node };
|
|
272
307
|
out.eventParameters = { fields: unionEventParameters(get(describe, "EventParameters"), objectParameters) };
|
|
273
308
|
out.filterFields = { fields: camelFields(get(describe, "FilterFields")) };
|
|
274
309
|
if (truthy(get(describe, "OutputFields"))) {
|
|
275
310
|
out.outputResponseDefinition = { fields: camelFields(get(describe, "OutputFields")) };
|
|
276
311
|
}
|
|
277
|
-
|
|
278
|
-
if (get(describe, src) !== null)
|
|
279
|
-
out[dst] = describe[src];
|
|
312
|
+
Object.assign(out, resolveEventFacts(objectRow, describe));
|
|
280
313
|
return out;
|
|
281
314
|
}
|
|
282
|
-
/**
|
|
315
|
+
/**
|
|
316
|
+
* `event_facts`: the three facts that change how a subscription is prepared or
|
|
317
|
+
* tested, by {@link resolveEventFacts} (the object row wins), with defaults.
|
|
318
|
+
*/
|
|
283
319
|
export function eventFacts(node, objectRow) {
|
|
284
320
|
const row = pyOr(objectRow, {});
|
|
285
|
-
const
|
|
286
|
-
if (get(row, rowKey) !== null)
|
|
287
|
-
return row[rowKey];
|
|
288
|
-
if (get(node, nodeKey) !== null)
|
|
289
|
-
return node[nodeKey];
|
|
290
|
-
return dflt;
|
|
291
|
-
};
|
|
321
|
+
const stated = resolveEventFacts(row, node);
|
|
292
322
|
const textBlocks = pyOr(get(pyOr(get(row, "Design"), {}), "TextBlocks"), get(pyOr(get(row, "design"), {}), "textBlocks"), []);
|
|
293
323
|
return {
|
|
294
|
-
eventMode: pyStr(pyOr(
|
|
295
|
-
byoaConnection: truthy(
|
|
296
|
-
isWebhookUrlVisible: truthy(
|
|
324
|
+
eventMode: pyStr(pyOr(stated.eventMode ?? null, "polling")),
|
|
325
|
+
byoaConnection: truthy(stated.byoaConnection ?? false),
|
|
326
|
+
isWebhookUrlVisible: truthy(stated.isWebhookUrlVisible ?? false),
|
|
297
327
|
textBlocks: pyIter(textBlocks).map(textBlockText),
|
|
298
328
|
};
|
|
299
329
|
}
|
|
@@ -388,9 +418,8 @@ export function applyEventSchema(entry, describe, obj) {
|
|
|
388
418
|
if (outputFields.length > 0)
|
|
389
419
|
e.outputSchema = { fields: outputFields };
|
|
390
420
|
const eventSchema = { eventParameters: fields, filterFields: camelFields(get(d, "FilterFields")) };
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
eventSchema[dst] = d[src];
|
|
421
|
+
// The objects row is the per-object fact sheet; describe is the fallback.
|
|
422
|
+
Object.assign(eventSchema, resolveEventFacts(o, d));
|
|
394
423
|
e.eventSchema = eventSchema;
|
|
395
424
|
return entry;
|
|
396
425
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ConnectionRow } from "./connections.js";
|
|
2
|
+
/**
|
|
3
|
+
* The ledger with `byoa[nodeType][connectionId]` set to a passing check. Pure:
|
|
4
|
+
* returns a new ledger. A re-run on the same connection rewrites the entry,
|
|
5
|
+
* `verifiedAt` included — the check was made again, so the snapshot is newer.
|
|
6
|
+
*/
|
|
7
|
+
export declare function recordByoa(ledger: Record<string, unknown>, nodeType: string, connectionId: string, row: ConnectionRow | undefined, verifiedAt: string): Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Record a passing BYOA check in `<outDir>/resolutions.json` and return that
|
|
10
|
+
* path: read (refusing a corrupt file before anything is written), record, write.
|
|
11
|
+
*/
|
|
12
|
+
export declare function recordByoaVerification(outDir: string, nodeType: string, connectionId: string, row: ConnectionRow | undefined, verifiedAt?: string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ledgerPath, readLedger, writeLedger } from "./objects.js";
|
|
2
|
+
import { isPlainObject, pyGet, pyStrAny } from "./support.js";
|
|
3
|
+
/**
|
|
4
|
+
* The ledger with `byoa[nodeType][connectionId]` set to a passing check. Pure:
|
|
5
|
+
* returns a new ledger. A re-run on the same connection rewrites the entry,
|
|
6
|
+
* `verifiedAt` included — the check was made again, so the snapshot is newer.
|
|
7
|
+
*/
|
|
8
|
+
export function recordByoa(ledger, nodeType, connectionId, row, verifiedAt) {
|
|
9
|
+
const sectionIn = ledger.byoa;
|
|
10
|
+
const section = isPlainObject(sectionIn) ? { ...sectionIn } : {};
|
|
11
|
+
const perEventIn = section[nodeType];
|
|
12
|
+
const perEvent = isPlainObject(perEventIn) ? { ...perEventIn } : {};
|
|
13
|
+
const name = pyStrAny(pyGet(row ?? {}, "Name", "") ?? "");
|
|
14
|
+
perEvent[connectionId] = { byoa: true, ...(name ? { connectionName: name } : {}), verifiedAt };
|
|
15
|
+
section[nodeType] = perEvent;
|
|
16
|
+
return { ...ledger, schemaVersion: "1", byoa: section };
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Record a passing BYOA check in `<outDir>/resolutions.json` and return that
|
|
20
|
+
* path: read (refusing a corrupt file before anything is written), record, write.
|
|
21
|
+
*/
|
|
22
|
+
export function recordByoaVerification(outDir, nodeType, connectionId, row, verifiedAt = new Date().toISOString().slice(0, 10)) {
|
|
23
|
+
const path = ledgerPath(outDir);
|
|
24
|
+
writeLedger(path, recordByoa(readLedger(path), nodeType, connectionId, row, verifiedAt));
|
|
25
|
+
return path;
|
|
26
|
+
}
|
|
@@ -3,6 +3,7 @@ import { type EventFacts } from "../library-build/events.js";
|
|
|
3
3
|
import { type Dict } from "../library-build/py.js";
|
|
4
4
|
import type { LibraryEntry } from "../model/library.js";
|
|
5
5
|
import type { UipClient } from "../uip/client.js";
|
|
6
|
+
import { type ConnectionRow } from "./connections.js";
|
|
6
7
|
/**
|
|
7
8
|
* `_event_operation`: the operation key every trigger API takes.
|
|
8
9
|
*
|
|
@@ -50,8 +51,11 @@ export interface BindingsRollback {
|
|
|
50
51
|
* connection into `bindings.json` by the time the event's own metadata says it
|
|
51
52
|
* is the wrong KIND, so the file is restored first. A listing that FAILED is
|
|
52
53
|
* not a tenant with no BYOA connections; the remedies are opposite.
|
|
54
|
+
*
|
|
55
|
+
* Returns the connection's BYOA listing row when it passes, for the record
|
|
56
|
+
* `prepare` then writes (see `byoa-ledger.ts`).
|
|
53
57
|
*/
|
|
54
|
-
export declare function refuseUnlessByoaConnection(client: UipClient, connectorKey: string, connectionId: string, rollback: BindingsRollback | undefined, warn: (line: string) => void): Promise<
|
|
58
|
+
export declare function refuseUnlessByoaConnection(client: UipClient, connectorKey: string, connectionId: string, rollback: BindingsRollback | undefined, warn: (line: string) => void): Promise<ConnectionRow>;
|
|
55
59
|
export interface EventPrepareOptions {
|
|
56
60
|
connectorKey: string;
|
|
57
61
|
action: string;
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { extractCanonical, nodeOf } from "../library-build/canonical.js";
|
|
23
23
|
import { registryProbe } from "../library-build/context.js";
|
|
24
|
-
import { EventDiscoveryError, eventFacts, mergeDescribeIntoNode, triggersDescribe, triggersObjects, unionEventParameters, } from "../library-build/events.js";
|
|
24
|
+
import { EventDiscoveryError, eventFacts, mergeDescribeIntoNode, resolveEventFacts, triggersDescribe, triggersObjects, unionEventParameters, } from "../library-build/events.js";
|
|
25
25
|
import { get, isRecord } from "../library-build/py.js";
|
|
26
26
|
import { planLibrary } from "../library-build/plan.js";
|
|
27
|
+
import { recordByoaVerification } from "./byoa-ledger.js";
|
|
27
28
|
import { ConnectionRefusal, byoaConnections, byoaListing, restoreBindings } from "./connections.js";
|
|
28
29
|
import { writeResolutions } from "./ledger.js";
|
|
29
|
-
import { PREPARE_COMMAND, PrepareRefusal, byoaListingFailedMessage, byoaRequiredMessage, describeFallbackWarning, generatedModulesLine, eventAllObjectsMessage, eventNextLine, eventParentFieldsMessage, eventSubscription, eventSummaryLine, filterableFieldsLine, genericEventNeedsObjectMessage, lookupVocabularyLines, objectNoteLine, objectOnCuratedEventMessage, objectRecordedLine, warnLine, webhookNoteLines, } from "./messages.js";
|
|
30
|
+
import { PREPARE_COMMAND, PrepareRefusal, byoaListingFailedMessage, byoaRecordedLine, byoaRequiredMessage, describeFallbackWarning, generatedModulesLine, eventAllObjectsMessage, eventNextLine, eventParentFieldsMessage, eventSubscription, eventSummaryLine, filterableFieldsLine, genericEventNeedsObjectMessage, lookupVocabularyLines, objectNoteLine, objectOnCuratedEventMessage, objectRecordedLine, warnLine, webhookNoteLines, } from "./messages.js";
|
|
30
31
|
import { RESOLUTIONS_FILENAME, matchObject, recordObjectResolution } from "./objects.js";
|
|
31
32
|
import { lookupSpecsFromOverlay, mergeFilesInto } from "./overlay.js";
|
|
32
33
|
import { regenerateDescriptors } from "./regenerate.js";
|
|
@@ -62,12 +63,15 @@ export function assembleEventDefinition(node, entry, describe, objectRow, eventN
|
|
|
62
63
|
const objectParameters = objectRow === undefined ? null : pyGet(objectRow, "Parameters", null);
|
|
63
64
|
let stored;
|
|
64
65
|
if (describe !== undefined) {
|
|
65
|
-
stored = mergeDescribeIntoNode(node, describe, objectParameters);
|
|
66
|
+
stored = mergeDescribeIntoNode(node, describe, objectParameters, objectRow ?? null);
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
68
69
|
stored = { ...node };
|
|
69
70
|
const declared = pyOr(get(stored, "eventParameters"), {});
|
|
70
71
|
stored.eventParameters = { fields: unionEventParameters(get(declared, "fields"), objectParameters) };
|
|
72
|
+
// The row's facts win here too: this definition IS the overlay, and a
|
|
73
|
+
// describe outage on a BYOA event must not store the registry's `false`.
|
|
74
|
+
Object.assign(stored, resolveEventFacts(objectRow ?? null, stored));
|
|
71
75
|
}
|
|
72
76
|
const out = { ...entry };
|
|
73
77
|
const outputDefinition = pyOr(get(stored, "outputResponseDefinition"), {});
|
|
@@ -88,6 +92,9 @@ export function assembleEventDefinition(node, entry, describe, objectRow, eventN
|
|
|
88
92
|
* connection into `bindings.json` by the time the event's own metadata says it
|
|
89
93
|
* is the wrong KIND, so the file is restored first. A listing that FAILED is
|
|
90
94
|
* not a tenant with no BYOA connections; the remedies are opposite.
|
|
95
|
+
*
|
|
96
|
+
* Returns the connection's BYOA listing row when it passes, for the record
|
|
97
|
+
* `prepare` then writes (see `byoa-ledger.ts`).
|
|
91
98
|
*/
|
|
92
99
|
export async function refuseUnlessByoaConnection(client, connectorKey, connectionId, rollback, warn) {
|
|
93
100
|
const restore = () => {
|
|
@@ -104,8 +111,9 @@ export async function refuseUnlessByoaConnection(client, connectorKey, connectio
|
|
|
104
111
|
restore();
|
|
105
112
|
throw new PrepareRefusal(byoaListingFailedMessage(connectionId, error), "BYOA_LISTING_FAILED");
|
|
106
113
|
}
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
const match = rows.find((row) => pyStrAny(pyGet(row, "Id", null)) === connectionId);
|
|
115
|
+
if (match)
|
|
116
|
+
return match;
|
|
109
117
|
restore();
|
|
110
118
|
throw new PrepareRefusal(byoaRequiredMessage(connectionId, connectorKey, byoaListing(rows, connectorKey)), "BYOA_REQUIRED");
|
|
111
119
|
}
|
|
@@ -212,14 +220,20 @@ export async function prepareEvent(ctx, options) {
|
|
|
212
220
|
}
|
|
213
221
|
}
|
|
214
222
|
const facts = eventFacts(node, objectRow ?? null);
|
|
215
|
-
|
|
216
|
-
await refuseUnlessByoaConnection(ctx.client, connectorKey, connectionId, options.bindings, warn)
|
|
217
|
-
|
|
223
|
+
const byoaRow = facts.byoaConnection
|
|
224
|
+
? await refuseUnlessByoaConnection(ctx.client, connectorKey, connectionId, options.bindings, warn)
|
|
225
|
+
: undefined;
|
|
218
226
|
const definition = assembleEventDefinition(node, entry, describe, objectRow, eventNodeType);
|
|
219
227
|
const plan = planLibrary([definition.entry], () => definition.node);
|
|
220
228
|
for (const line of plan.warnings)
|
|
221
229
|
warn(line);
|
|
222
230
|
mergeFilesInto(plan.files, out);
|
|
231
|
+
if (byoaRow !== undefined) {
|
|
232
|
+
// What `check` and `compile` look for before they accept this event on this
|
|
233
|
+
// connection: the proof that the live check above ran and passed.
|
|
234
|
+
recordByoaVerification(out, eventNodeType, connectionId, byoaRow);
|
|
235
|
+
info(byoaRecordedLine(connectionId, pyPathJoin(outShown, RESOLUTIONS_FILENAME)));
|
|
236
|
+
}
|
|
223
237
|
if (generic) {
|
|
224
238
|
recordObjectResolution(out, eventNodeType, requestedObject, objectRow, operation);
|
|
225
239
|
// Named as the author spelled `--out`, not as the file was resolved.
|
|
@@ -237,6 +237,8 @@ export declare function warnLine(error: unknown): string;
|
|
|
237
237
|
/** The describe could not answer for a curated event; the definition's own sections stand in. */
|
|
238
238
|
export declare function describeFallbackWarning(error: unknown, bakedObject: string): string;
|
|
239
239
|
export declare function byoaListingFailedMessage(connectionId: string, error: unknown): string;
|
|
240
|
+
/** The passing BYOA check, and where it was recorded for `check` / `compile`. */
|
|
241
|
+
export declare function byoaRecordedLine(connectionId: string, ledgerPath: string): string;
|
|
240
242
|
export declare function byoaRequiredMessage(connectionId: string, connectorKey: string, listing: string): string;
|
|
241
243
|
export declare function eventSummaryLine(eventNodeType: string, out: string, operation: string, mode: string, whereParameters: number, filterFields: number): string;
|
|
242
244
|
/** The first eight filterable field names, or nothing when the event has none. */
|
|
@@ -548,6 +548,10 @@ export function byoaListingFailedMessage(connectionId, error) {
|
|
|
548
548
|
"(bring-your-own-app) connection, and the BYOA listing needed to " +
|
|
549
549
|
`check ${connectionId} against it failed: ${messageOf(error)}`);
|
|
550
550
|
}
|
|
551
|
+
/** The passing BYOA check, and where it was recorded for `check` / `compile`. */
|
|
552
|
+
export function byoaRecordedLine(connectionId, ledgerPath) {
|
|
553
|
+
return ` byoa: ${connectionId} is a BYOA connection — recorded in ${ledgerPath}`;
|
|
554
|
+
}
|
|
551
555
|
export function byoaRequiredMessage(connectionId, connectorKey, listing) {
|
|
552
556
|
return (`${PREFIX}this event object requires a BYOA ` +
|
|
553
557
|
`(bring-your-own-app) connection, and ${connectionId} is not ` +
|
package/dist/serialize.js
CHANGED
|
@@ -16,6 +16,7 @@ import { connectorRawNodeRefusal } from './core/connector-raw-node.js';
|
|
|
16
16
|
import { dataFabricUnknownInputs } from './core/typed-raw-node.js';
|
|
17
17
|
import { isAnswerField } from './core/hitl-answers.js';
|
|
18
18
|
import { BindingRefusal, GUID_RE, bindingSelfNameMessage, bindingUndeclaredMessage, undeclaredBinding } from './core/binding-messages.js';
|
|
19
|
+
import { ByoaRefusal, byoaUnverified } from './core/byoa.js';
|
|
19
20
|
import { OUTCOME_HANDLE_NODE_TYPES, assertHitlExitInvariant, hitlExitModel, hitlExitViolation, outcomeSlug } from './core/hitl-routing.js';
|
|
20
21
|
import { declaredExits, hasExits, stopsAtEnd } from './core/step-ports.js';
|
|
21
22
|
import { buildConfiguration, transportHttpMethod } from './config.js';
|
|
@@ -27,6 +28,7 @@ import { migrateToSchemaVersion } from './migrate.js';
|
|
|
27
28
|
import { FLOW_SCHEMA_VERSIONS } from './format-profile.js';
|
|
28
29
|
import { resolveSchemaVersion } from './schema-version.js';
|
|
29
30
|
import { prepareCommand } from './core/cli-spelling.js';
|
|
31
|
+
import { QUEUE_ITEM_RECORD_SCHEMA } from './core/queue-record.js';
|
|
30
32
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
31
33
|
// core-definitions.json is an object keyed by "<nodeType>@<version>".
|
|
32
34
|
const DEFS = JSON.parse(readFileSync(join(HERE, 'core-definitions.json'), 'utf8'));
|
|
@@ -2329,53 +2331,6 @@ function connectionResourceBindings(spec, existing) {
|
|
|
2329
2331
|
});
|
|
2330
2332
|
return { entries };
|
|
2331
2333
|
}
|
|
2332
|
-
/**
|
|
2333
|
-
* The queue item's own Orchestrator record — the fields `core.action.queue.create`
|
|
2334
|
-
* publishes, declared so a downstream read is checkable.
|
|
2335
|
-
*
|
|
2336
|
-
* Unlike an rpa process's output arguments, this shape is NOT per-tenant: it is
|
|
2337
|
-
* Orchestrator's queue-item record, the same for every queue, so the author has
|
|
2338
|
-
* nothing to declare and `returns` is not needed for a fire-and-forget enqueue.
|
|
2339
|
-
* The dispatcher returns `env.Data` from `uip or queue-items add` verbatim, and
|
|
2340
|
-
* these are the fields a real add answered with (pinned 2026-07-28 against
|
|
2341
|
-
* `Shared/SupplierInvoices` on codereval; `gen-tests`' fixture for the node is the
|
|
2342
|
-
* same list). Declaring the EVIDENCED fields and no more is PR 10's payload-schema
|
|
2343
|
-
* pattern — an invented field would be #73's `firedAt` again.
|
|
2344
|
-
*/
|
|
2345
|
-
const QUEUE_ITEM_RECORD_SCHEMA = {
|
|
2346
|
-
type: 'object',
|
|
2347
|
-
properties: {
|
|
2348
|
-
Id: { type: 'number' },
|
|
2349
|
-
Key: { type: 'string' },
|
|
2350
|
-
UniqueKey: { type: 'string' },
|
|
2351
|
-
Reference: { type: 'string' },
|
|
2352
|
-
Status: { type: 'string' },
|
|
2353
|
-
Priority: { type: 'string' },
|
|
2354
|
-
QueueDefinitionName: { type: 'string' },
|
|
2355
|
-
QueueDefinitionKey: { type: 'string' },
|
|
2356
|
-
CreationTime: { type: 'string' },
|
|
2357
|
-
StartProcessing: { type: 'string' },
|
|
2358
|
-
EndProcessing: { type: 'string' },
|
|
2359
|
-
Progress: { type: 'string' },
|
|
2360
|
-
ReviewStatus: { type: 'string' },
|
|
2361
|
-
DueDate: { type: 'string' },
|
|
2362
|
-
RiskSlaDate: { type: 'string' },
|
|
2363
|
-
DeferDate: { type: 'string' },
|
|
2364
|
-
Encrypted: { type: 'boolean' },
|
|
2365
|
-
SpecificContent: { type: 'object' },
|
|
2366
|
-
Output: { type: 'object' },
|
|
2367
|
-
OutputData: { type: 'string' },
|
|
2368
|
-
Analytics: { type: 'object' },
|
|
2369
|
-
AnalyticsData: { type: 'string' },
|
|
2370
|
-
ProcessingExceptionType: { type: 'string' },
|
|
2371
|
-
ProcessingExceptionReason: { type: 'string' },
|
|
2372
|
-
SecondsInPreviousAttempts: { type: 'number' },
|
|
2373
|
-
RetryNumber: { type: 'number' },
|
|
2374
|
-
CreatorJobKey: { type: 'string' },
|
|
2375
|
-
ExecutorJobKey: { type: 'string' },
|
|
2376
|
-
RobotKey: { type: 'string' },
|
|
2377
|
-
},
|
|
2378
|
-
};
|
|
2379
2334
|
/**
|
|
2380
2335
|
* Build the definition for one queue-item node.
|
|
2381
2336
|
*
|
|
@@ -3258,6 +3213,24 @@ function eventTarget(sub) {
|
|
|
3258
3213
|
? { key: sub.connector, ...(typeof sub.event === 'string' && sub.event !== '' ? { action: sub.event } : {}) }
|
|
3259
3214
|
: undefined;
|
|
3260
3215
|
}
|
|
3216
|
+
/**
|
|
3217
|
+
* Throw `check`'s EVENT_BYOA_UNVERIFIED for a subscription whose event only
|
|
3218
|
+
* fires on a BYOA connection and whose bound connection `prepare` never checked
|
|
3219
|
+
* — the one condition in `core/byoa.ts`, fed from the same library and
|
|
3220
|
+
* bindings, so a flow check refuses never compiles.
|
|
3221
|
+
*
|
|
3222
|
+
* `where` is check's spelling of the site (`trigger` for `onEvent`, entry points
|
|
3223
|
+
* included; `waitForEvent "<step>"`), so the two print the same sentence.
|
|
3224
|
+
*/
|
|
3225
|
+
function refuseUnverifiedByoa(opts, where, sub) {
|
|
3226
|
+
const library = opts.library;
|
|
3227
|
+
if (!library || typeof library.eventFacts !== 'function')
|
|
3228
|
+
return;
|
|
3229
|
+
const object = typeof sub.object === 'string' && sub.object !== '' ? sub.object : undefined;
|
|
3230
|
+
const message = byoaUnverified(where, { connector: sub.connector, event: sub.event, ...(object ? { object } : {}), connection: sub.connection }, library.eventFacts(sub.connector, sub.event, object), library.byoaVerifications, opts.bindings);
|
|
3231
|
+
if (message)
|
|
3232
|
+
throw new ByoaRefusal(message);
|
|
3233
|
+
}
|
|
3261
3234
|
/**
|
|
3262
3235
|
* Resolve a symbolic connection/folder name to the resource key that is inlined
|
|
3263
3236
|
* as `connectionId` / `connectionFolderKey`.
|
|
@@ -4230,7 +4203,9 @@ export function serialize(built, opts = {}) {
|
|
|
4230
4203
|
if (!opts.library)
|
|
4231
4204
|
throw new Error(`onEvent() needs a library (pass --library / set $FLOW_SDK_LIBRARY_JSON).`);
|
|
4232
4205
|
const sub = built.trigger.subscription;
|
|
4233
|
-
|
|
4206
|
+
const rc = opts.library.resolveEvent('trigger', sub.connector, sub.event, sub.version, sub.object);
|
|
4207
|
+
refuseUnverifiedByoa(opts, 'trigger', sub);
|
|
4208
|
+
return rc;
|
|
4234
4209
|
})()
|
|
4235
4210
|
: undefined;
|
|
4236
4211
|
// The trigger node's id is `start` unless the flow renamed it. `input('x')`
|
|
@@ -5352,6 +5327,7 @@ export function serialize(built, opts = {}) {
|
|
|
5352
5327
|
throw new Error(`waitForEvent "${step.name}" needs a library (pass --library / set $FLOW_SDK_LIBRARY_JSON).`);
|
|
5353
5328
|
const sub = spec.subscription;
|
|
5354
5329
|
const rc = opts.library.resolveEvent('event', sub.connector, sub.event, sub.version, sub.object);
|
|
5330
|
+
refuseUnverifiedByoa(opts, `waitForEvent "${step.name}"`, sub);
|
|
5355
5331
|
const id = stepUid(scope, step.name);
|
|
5356
5332
|
const node = makeNode(rc.nodeType, id, step.name, { parentId, requestedVersion: step.options?.version, def: rc.v1def });
|
|
5357
5333
|
node.inputs = { detail: eventDetail(rc, sub, id, opts) };
|
|
@@ -6206,6 +6182,7 @@ export function serialize(built, opts = {}) {
|
|
|
6206
6182
|
throw new Error(`onEvent() needs a library (pass --library / set $FLOW_SDK_LIBRARY_JSON).`);
|
|
6207
6183
|
const sub = epSpec.subscription;
|
|
6208
6184
|
const rc = opts.library.resolveEvent('trigger', sub.connector, sub.event, sub.version, sub.object);
|
|
6185
|
+
refuseUnverifiedByoa(opts, 'trigger', sub);
|
|
6209
6186
|
node = makeNode(rc.nodeType, ep.id, 'Event trigger', { def: rc.v1def, requestedVersion });
|
|
6210
6187
|
node.inputs = {
|
|
6211
6188
|
entryPointId: stableId(`${built.id}:${ep.id}:entryPoint`),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.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",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"@types/node": "^22.7.0",
|
|
93
93
|
"esbuild": "^0.28.1"
|
|
94
94
|
},
|
|
95
|
-
"gitref": "
|
|
95
|
+
"gitref": "db117054e312c3c2aa7b7b208d3a92fc68de7fb9"
|
|
96
96
|
}
|