@uipath/maestro-builder-sdk 6.115.0 → 6.116.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.
@@ -9,6 +9,8 @@
9
9
  */
10
10
  import type { ResolvedConnector } from '../core/library.js';
11
11
  import type { ExternalEventPair, ExternalExecutionMode } from './case-sdk.js';
12
+ import { isExternalEventMode, isExternalExecutionMode, libraryExecution } from '../core/external-execution.js';
13
+ export { isExternalEventMode, isExternalExecutionMode, libraryExecution };
12
14
  /**
13
15
  * The context rows `serialize` writes on an external task: the set the Case
14
16
  * Designer saves for a sync object (`uip`'s
@@ -27,8 +29,6 @@ export declare const EXTERNAL_TASK_CONTEXT: readonly string[];
27
29
  export declare const EXTERNAL_TASK_EVENT_CONTEXT: readonly string[];
28
30
  /** Check's and compile's code for {@link externalEventRefusal}. */
29
31
  export declare const EXTERNAL_TASK_EVENT = "EXTERNAL_TASK_EVENT";
30
- /** The event modes Integration Service reports for an object's events. */
31
- export declare function isExternalEventMode(value: unknown): value is ExternalEventPair['mode'];
32
32
  /**
33
33
  * Why this task's event pair cannot be written, or `undefined`.
34
34
  *
@@ -45,8 +45,6 @@ export declare function isExternalEventMode(value: unknown): value is ExternalEv
45
45
  * @returns The refusal, or `undefined`.
46
46
  */
47
47
  export declare function externalEventRefusal(owner: string, mode: ExternalExecutionMode, event: unknown): string | undefined;
48
- /** The execution types an external task accepts: the values Integration Service reports. */
49
- export declare function isExternalExecutionMode(value: unknown): value is ExternalExecutionMode;
50
48
  /**
51
49
  * The `data.serviceType` the Case Designer saves for an external task of this
52
50
  * execution type. Studio Web runs `hybrid` as `async` (`determineActualIntsvcType`),
@@ -69,16 +67,6 @@ export type ExternalExecution = {
69
67
  code: string;
70
68
  message: string;
71
69
  };
72
- /**
73
- * The execution facts the connector library records for the object
74
- * (`operation.executionType` and `operation.executionEvent`, from
75
- * `registry build-library` / `registry prepare`, #1369). A value the SDK does
76
- * not know is ignored, as if it were absent.
77
- */
78
- export declare function libraryExecution(operation: unknown): {
79
- mode?: ExternalExecutionMode;
80
- event?: ExternalEventPair;
81
- };
82
70
  /**
83
71
  * The mode and event an external task is written with: what the author passed,
84
72
  * else what the connector library records for the object. `check` and
@@ -1,4 +1,7 @@
1
1
  import { CASE_FORMAT_PROFILE } from './format-profile.js';
2
+ import { isExternalEventMode, isExternalExecutionMode, libraryExecution } from '../core/external-execution.js';
3
+ // Shared with Flow and BPMN, which read the same library record.
4
+ export { isExternalEventMode, isExternalExecutionMode, libraryExecution };
2
5
  /**
3
6
  * The context rows `serialize` writes on an external task: the set the Case
4
7
  * Designer saves for a sync object (`uip`'s
@@ -20,10 +23,6 @@ export const EXTERNAL_TASK_CONTEXT = [
20
23
  export const EXTERNAL_TASK_EVENT_CONTEXT = ['operation', 'eventMode'];
21
24
  /** Check's and compile's code for {@link externalEventRefusal}. */
22
25
  export const EXTERNAL_TASK_EVENT = 'EXTERNAL_TASK_EVENT';
23
- /** The event modes Integration Service reports for an object's events. */
24
- export function isExternalEventMode(value) {
25
- return value === 'polling' || value === 'webhooks';
26
- }
27
26
  /**
28
27
  * Why this task's event pair cannot be written, or `undefined`.
29
28
  *
@@ -60,10 +59,6 @@ export function externalEventRefusal(owner, mode, event) {
60
59
  return `${owner} event.mode must be "polling" or "webhooks"; got ${JSON.stringify(pair.mode)}.`;
61
60
  return undefined;
62
61
  }
63
- /** The execution types an external task accepts: the values Integration Service reports. */
64
- export function isExternalExecutionMode(value) {
65
- return value === 'sync' || value === 'async' || value === 'hybrid';
66
- }
67
62
  /**
68
63
  * The `data.serviceType` the Case Designer saves for an external task of this
69
64
  * execution type. Studio Web runs `hybrid` as `async` (`determineActualIntsvcType`),
@@ -82,22 +77,6 @@ export function externalServiceType(kind, mode) {
82
77
  }
83
78
  /** Check's and compile's code when an authored `mode` disagrees with the library. */
84
79
  export const EXTERNAL_TASK_MODE_MISMATCH = 'EXTERNAL_TASK_MODE_MISMATCH';
85
- /**
86
- * The execution facts the connector library records for the object
87
- * (`operation.executionType` and `operation.executionEvent`, from
88
- * `registry build-library` / `registry prepare`, #1369). A value the SDK does
89
- * not know is ignored, as if it were absent.
90
- */
91
- export function libraryExecution(operation) {
92
- const op = (operation ?? {});
93
- const mode = isExternalExecutionMode(op.executionType) ? op.executionType : undefined;
94
- const raw = op.executionEvent;
95
- const event = mode !== undefined && mode !== 'sync' && typeof raw?.operation === 'string' && raw.operation
96
- && isExternalEventMode(raw.mode)
97
- ? { operation: raw.operation, mode: raw.mode }
98
- : undefined;
99
- return { ...(mode ? { mode } : {}), ...(event ? { event } : {}) };
100
- }
101
80
  /**
102
81
  * The mode and event an external task is written with: what the author passed,
103
82
  * else what the connector library records for the object. `check` and
@@ -0,0 +1,38 @@
1
+ /**
2
+ * core/external-execution — how an external agent or automation runs, as the
3
+ * connector library records it.
4
+ *
5
+ * Integration Service keeps it on the connector object, not on the registry
6
+ * node: `executionType` (`sync`, `async` or `hybrid`) and, for an `async` or
7
+ * `hybrid` object, the event it answers with. `registry build-library` and
8
+ * `registry prepare` copy both from `uip is resources describe` onto the
9
+ * entry's `operation` (`registry/library-build/enrich.ts`, #1369). Case and Flow
10
+ * read them through {@link libraryExecution}.
11
+ */
12
+ /** An external object's execution type, as Integration Service reports it. */
13
+ export type ExecutionMode = 'sync' | 'async' | 'hybrid';
14
+ /** The event an `async` or `hybrid` object answers with: its operation and how it is received. */
15
+ export interface ExecutionEvent {
16
+ operation: string;
17
+ mode: 'polling' | 'webhooks';
18
+ }
19
+ /** The event modes Integration Service reports for an object's events. */
20
+ export declare function isExternalEventMode(value: unknown): value is ExecutionEvent['mode'];
21
+ /** The execution types an external object can have: the values Integration Service reports. */
22
+ export declare function isExternalExecutionMode(value: unknown): value is ExecutionMode;
23
+ /**
24
+ * The execution facts the connector library records for the object
25
+ * (`operation.executionType` and `operation.executionEvent`, from
26
+ * `registry build-library` / `registry prepare`, #1369). A value the SDK does
27
+ * not know is ignored, as if it were absent. A `sync` object has no event.
28
+ *
29
+ * For example `{ executionType: 'hybrid', executionEvent: { operation: 'TRIGGER_CREATED', mode: 'polling' } }`
30
+ * reads as `{ mode: 'hybrid', event: { operation: 'TRIGGER_CREATED', mode: 'polling' } }`.
31
+ *
32
+ * @param operation - A library entry's `operation`.
33
+ * @returns The recorded mode and event; `{}` when the library records none.
34
+ */
35
+ export declare function libraryExecution(operation: unknown): {
36
+ mode?: ExecutionMode;
37
+ event?: ExecutionEvent;
38
+ };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * core/external-execution — how an external agent or automation runs, as the
3
+ * connector library records it.
4
+ *
5
+ * Integration Service keeps it on the connector object, not on the registry
6
+ * node: `executionType` (`sync`, `async` or `hybrid`) and, for an `async` or
7
+ * `hybrid` object, the event it answers with. `registry build-library` and
8
+ * `registry prepare` copy both from `uip is resources describe` onto the
9
+ * entry's `operation` (`registry/library-build/enrich.ts`, #1369). Case and Flow
10
+ * read them through {@link libraryExecution}.
11
+ */
12
+ /** The event modes Integration Service reports for an object's events. */
13
+ export function isExternalEventMode(value) {
14
+ return value === 'polling' || value === 'webhooks';
15
+ }
16
+ /** The execution types an external object can have: the values Integration Service reports. */
17
+ export function isExternalExecutionMode(value) {
18
+ return value === 'sync' || value === 'async' || value === 'hybrid';
19
+ }
20
+ /**
21
+ * The execution facts the connector library records for the object
22
+ * (`operation.executionType` and `operation.executionEvent`, from
23
+ * `registry build-library` / `registry prepare`, #1369). A value the SDK does
24
+ * not know is ignored, as if it were absent. A `sync` object has no event.
25
+ *
26
+ * For example `{ executionType: 'hybrid', executionEvent: { operation: 'TRIGGER_CREATED', mode: 'polling' } }`
27
+ * reads as `{ mode: 'hybrid', event: { operation: 'TRIGGER_CREATED', mode: 'polling' } }`.
28
+ *
29
+ * @param operation - A library entry's `operation`.
30
+ * @returns The recorded mode and event; `{}` when the library records none.
31
+ */
32
+ export function libraryExecution(operation) {
33
+ const op = (operation ?? {});
34
+ const mode = isExternalExecutionMode(op.executionType) ? op.executionType : undefined;
35
+ const raw = op.executionEvent;
36
+ const event = mode !== undefined && mode !== 'sync' && typeof raw?.operation === 'string' && raw.operation
37
+ && isExternalEventMode(raw.mode)
38
+ ? { operation: raw.operation, mode: raw.mode }
39
+ : undefined;
40
+ return { ...(mode ? { mode } : {}), ...(event ? { event } : {}) };
41
+ }
@@ -3,6 +3,7 @@ import { BindingRefusal, bindingMissingMessage, missingBindingLabels } from '../
3
3
  import { PULL_COMMAND, prepareCommand } from '../../../core/cli-spelling.js';
4
4
  import { carriedConnector, carriedDefinitionMismatch, carriedOperationOf, carriedOperationRefusal, } from '../../../core/carried-connector-operation.js';
5
5
  import { buildConfiguration, readConfigurationIdentity } from '../../../core/connector-configuration.js';
6
+ import { libraryExecution } from '../../../core/external-execution.js';
6
7
  import { CONNECTOR_INPUT_MISSING, FLOW_EXPR_DIALECT, buildConnectorInputs, replayInputsOf, transportHttpMethod } from '../../../core/connector-inputs.js';
7
8
  import { ConnectorResolveError } from '../../../core/connector-resolve-error.js';
8
9
  import { definitionHasErrorPort } from '../../../core/error-port.js';
@@ -240,6 +241,13 @@ function serializeConnector(spec, ctx) {
240
241
  }
241
242
  })();
242
243
  const replayInputs = replayInputsOf(connectorInputs);
244
+ // An external agent or automation runs the way its connector object says
245
+ // (#1988). The Flow runtime reads it off the detail: `executionType` picks
246
+ // the sync or async service type, and an async / hybrid object's event is
247
+ // what the node waits on. `uip maestro flow nodes configure` writes the same
248
+ // three keys. Without them a sync agent runs as the registry's
249
+ // `Intsvc.AsyncAgentExecution` and waits for an event that never comes.
250
+ const execution = libraryExecution(rc.entry?.operation);
243
251
  const detail = {
244
252
  connector: rc.connectorKey,
245
253
  method: transportHttpMethod(rc.httpMethod),
@@ -252,7 +260,9 @@ function serializeConnector(spec, ctx) {
252
260
  inputMetadata: {},
253
261
  errorState: { hasError: false },
254
262
  telemetryData: { connectorKey: rc.connectorKey, connectorName: rc.connectorName },
255
- configuration: buildConfiguration(rc.entry, rc.version, replayInputs, ctx.nodeId),
263
+ configuration: buildConfiguration(rc.entry, rc.version, replayInputs, ctx.nodeId, execution.mode ?? null),
264
+ ...(execution.mode ? { executionType: execution.mode } : {}),
265
+ ...(execution.event ? { eventMode: execution.event.mode, eventType: execution.event.operation } : {}),
256
266
  ...(rc.activityTypeId ? { uiPathActivityTypeId: rc.activityTypeId } : {}),
257
267
  ...(conn ? { connectionId: conn, connectionResourceId: conn } : {}),
258
268
  ...(folder ? { connectionFolderKey: folder } : {}),
@@ -19,6 +19,8 @@ export declare function discoverOperationName(ctx: BuildContext, entry: LibraryE
19
19
  * payload; `objectDisplayName` and `display.operationLabel` fill gaps only.
20
20
  */
21
21
  export declare function applyDescribe(entry: LibraryEntry, data: unknown): LibraryEntry;
22
+ /** Whether `operation` is an external agent's or automation's: an `AgentExecution` / `ProcessExecution` subtype. */
23
+ export declare function isExternalOperation(operation: unknown): boolean;
22
24
  /**
23
25
  * Record an external agent's or automation's execution facts on its operation,
24
26
  * from the describe payload (#1369, #1387).
@@ -95,6 +95,10 @@ export function applyDescribe(entry, data) {
95
95
  }
96
96
  /** The operation subtypes Case's and BPMN's external agent / workflow tasks run. */
97
97
  const EXTERNAL_SUBTYPES = new Set(["AgentExecution", "ProcessExecution"]);
98
+ /** Whether `operation` is an external agent's or automation's: an `AgentExecution` / `ProcessExecution` subtype. */
99
+ export function isExternalOperation(operation) {
100
+ return EXTERNAL_SUBTYPES.has(String(get(operation, "subType") ?? ""));
101
+ }
98
102
  /** The execution types Integration Service reports, as Case and BPMN read them. */
99
103
  const EXECUTION_TYPES = new Set(["sync", "async", "hybrid"]);
100
104
  /**
@@ -116,7 +120,7 @@ const EXECUTION_TYPES = new Set(["sync", "async", "hybrid"]);
116
120
  * leaves the entry as it was, so an older build stays byte-identical.
117
121
  */
118
122
  export function applyExternalExecution(operation, data) {
119
- if (!EXTERNAL_SUBTYPES.has(String(get(operation, "subType") ?? "")))
123
+ if (!isExternalOperation(operation))
120
124
  return;
121
125
  // Stored only as one of the three values Case and BPMN read, lowercased: a
122
126
  // `Hybrid` kept verbatim would be ignored downstream and read as "no record".
@@ -169,6 +169,19 @@ export declare function probeSkippedReason(key: string): string;
169
169
  export declare function catalogRefreshPartialLine(reason: string): string;
170
170
  /** The warning when that pull failed; the fallback continues against the local copy. */
171
171
  export declare function catalogRefreshFailedLine(reason: string): string;
172
+ /**
173
+ * The warning when an external agent's or automation's describe reported no
174
+ * execution type (#1988). A `uip` older than uip#5702 does not report it, and
175
+ * without it the compiled Flow node keeps the registry's service type, so a
176
+ * sync agent runs as async and waits for an event that never comes.
177
+ */
178
+ export declare function unrecordedExecutionLine(nodeType: string): string;
179
+ /**
180
+ * The warning when an `async` or `hybrid` external object's describe names no
181
+ * event it answers with: the compiled node has nothing to wait on. The CLI's
182
+ * `nodes configure` warns the same (`externalExecutionWarning`).
183
+ */
184
+ export declare function missingExecutionEventLine(nodeType: string, mode: string): string;
172
185
  /** The note when the author's `--action` spelling was not the entry's id. */
173
186
  export declare function actionCanonicalizedLine(given: string, actionId: string): string;
174
187
  /**
@@ -377,6 +377,27 @@ export function catalogRefreshPartialLine(reason) {
377
377
  export function catalogRefreshFailedLine(reason) {
378
378
  return `${PREFIX}registry pull --force failed (${reason}); continuing with the local catalog copy, which may be stale.`;
379
379
  }
380
+ /**
381
+ * The warning when an external agent's or automation's describe reported no
382
+ * execution type (#1988). A `uip` older than uip#5702 does not report it, and
383
+ * without it the compiled Flow node keeps the registry's service type, so a
384
+ * sync agent runs as async and waits for an event that never comes.
385
+ */
386
+ export function unrecordedExecutionLine(nodeType) {
387
+ return (`${PREFIX}WARN: Integration Service reported no execution type (sync, async or hybrid) for the external ` +
388
+ `operation ${nodeType}, so the compiled node keeps the registry's service type and may wait on an event that ` +
389
+ "never comes. A `uip` older than the release with ExecutionType in `uip is resources describe` does not " +
390
+ "report it: run `uip update` and prepare again.");
391
+ }
392
+ /**
393
+ * The warning when an `async` or `hybrid` external object's describe names no
394
+ * event it answers with: the compiled node has nothing to wait on. The CLI's
395
+ * `nodes configure` warns the same (`externalExecutionWarning`).
396
+ */
397
+ export function missingExecutionEventLine(nodeType, mode) {
398
+ return (`${PREFIX}WARN: the external operation ${nodeType} runs ${mode}, but Integration Service names no event it ` +
399
+ "answers with, so the compiled node has nothing to wait on and may never finish.");
400
+ }
380
401
  /** The note when the author's `--action` spelling was not the entry's id. */
381
402
  export function actionCanonicalizedLine(given, actionId) {
382
403
  return ` action: "${given}" is Integration Service activity ${actionId}; the entry is written under that id.`;
@@ -31,7 +31,8 @@ import { PACKAGE_NAME } from "../../package-name.js";
31
31
  import { afterLast } from "../compat/pystr.js";
32
32
  import { extractCanonical, isHttpPassthrough, nodeOf } from "../library-build/canonical.js";
33
33
  import { createBuildContext, isResourcesList, registryProbe } from "../library-build/context.js";
34
- import { enrichEntry } from "../library-build/enrich.js";
34
+ import { enrichEntry, isExternalOperation } from "../library-build/enrich.js";
35
+ import { libraryExecution } from "../../core/external-execution.js";
35
36
  import { expandGenericForConnector, genericTemplatesByOp } from "../library-build/generic-expand.js";
36
37
  import { planLibrary } from "../library-build/plan.js";
37
38
  import { MemoryResponseCache } from "../uip/response-cache.js";
@@ -43,7 +44,7 @@ import { prepareEvent } from "./event.js";
43
44
  import { integrationServiceEntry } from "./integration-service.js";
44
45
  import { descriptorUsage } from "./handoff.js";
45
46
  import { ResolutionsExhausted, allParentsResolved, resolvedParentValues, writeResolutions } from "./ledger.js";
46
- import { PrepareRefusal, ambiguousLabelsMessage, connectionChoiceLine, bindingsLine, bpmnConnectorUsageLines, candidateLabel, connectionLine, describeNextLine, generatedModulesLine, genericActionNeedsObjectMessage, inputFieldNote, flagDiffersFromSourceLine, keptSchemaMessage, labelTakenMessage, lookupVocabularyLines, missingGenericSchemaMessage, missingParentsNote, nextLine, noCanonicalEntryMessage, objectFlagsOnlyForGenericMessage, objectNoteLine, objectRecordedLine, parentFieldNamesMismatchMessage, parentOnlyMessage, prefixed, preparedFromIntegrationServiceLine, actionCanonicalizedLine, catalogRefreshFailedLine, catalogRefreshPartialLine, probeSkippedReason, refreshingCatalogLine, rememberedAbsenceLine, preparedSummaryLine, rejectedParentFieldsMessage, rerunAgainstLine, resolvedParentsNote, registryGetFailedMessage, sharedLabelMessage, sourceLabelSuffix, tsNote, partlyUnreadableLabelLine, unreadableLabelLine, unresolvedOperationMessage, planRowReplacedLine, } from "./messages.js";
47
+ import { PrepareRefusal, ambiguousLabelsMessage, connectionChoiceLine, bindingsLine, bpmnConnectorUsageLines, candidateLabel, connectionLine, describeNextLine, generatedModulesLine, genericActionNeedsObjectMessage, inputFieldNote, flagDiffersFromSourceLine, keptSchemaMessage, labelTakenMessage, lookupVocabularyLines, missingGenericSchemaMessage, missingParentsNote, nextLine, noCanonicalEntryMessage, objectFlagsOnlyForGenericMessage, objectNoteLine, objectRecordedLine, parentFieldNamesMismatchMessage, parentOnlyMessage, prefixed, preparedFromIntegrationServiceLine, actionCanonicalizedLine, catalogRefreshFailedLine, catalogRefreshPartialLine, probeSkippedReason, refreshingCatalogLine, rememberedAbsenceLine, preparedSummaryLine, rejectedParentFieldsMessage, rerunAgainstLine, resolvedParentsNote, registryGetFailedMessage, sharedLabelMessage, sourceLabelSuffix, tsNote, partlyUnreadableLabelLine, unreadableLabelLine, missingExecutionEventLine, unrecordedExecutionLine, unresolvedOperationMessage, planRowReplacedLine, } from "./messages.js";
47
48
  import { ObjectMatchRefusal, RESOLUTIONS_FILENAME, matchObject, recordObjectResolution } from "./objects.js";
48
49
  import { countInputFields, keepPreparedSchema, lookupSpecsFromOverlay, mergeFilesInto, parentFields as overlayParentFields, schemaActionParents, } from "./overlay.js";
49
50
  import { declaredParents, objectActionRequest, objectActionSpecs, parseFields } from "./parents.js";
@@ -519,8 +520,16 @@ async function prepareOnConnection(options, ports, connected, registryRefresh) {
519
520
  if (objectName || options.allObjects)
520
521
  throw new PrepareRefusal(objectFlagsOnlyForGenericMessage(), "OBJECT_NOT_GENERIC");
521
522
  // An Integration Service entry IS the describe; there is nothing to enrich it with.
522
- if (fromIntegrationService === undefined)
523
+ if (fromIntegrationService === undefined) {
523
524
  entry = await enrichEntry(ctx, entry); // full schema via --connection-id
525
+ if (isExternalOperation(entry.operation)) {
526
+ const { mode, event } = libraryExecution(entry.operation);
527
+ if (mode === undefined)
528
+ warn(unrecordedExecutionLine(entry.nodeType));
529
+ else if (mode !== "sync" && event === undefined)
530
+ warn(missingExecutionEventLine(entry.nodeType, mode));
531
+ }
532
+ }
524
533
  preparedEntries = [entry];
525
534
  }
526
535
  const entryNodeType = entry.nodeType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.115.0",
3
+ "version": "6.116.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",
@@ -124,5 +124,5 @@
124
124
  "@types/node": "^22.7.0",
125
125
  "esbuild": "^0.28.1"
126
126
  },
127
- "gitref": "9178cf04304e2d61325944652c1d11cea6868668"
127
+ "gitref": "af42df6616e52079ecf678c69fdb763518cc61bf"
128
128
  }