@uipath/maestro-builder-sdk 6.68.6 → 6.69.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.
@@ -22,16 +22,18 @@ export declare class GenericEventNoObjectError extends CompileRefusal {
22
22
  /**
23
23
  * Resolve a Case event subscription: `library.resolveEvent` with the
24
24
  * subscription's own `version` and `object`, then refuse a GENERIC event the
25
- * author named no object for.
25
+ * author named no object for. Whatever `resolveEvent` throws (a connector or
26
+ * event the library does not carry, a version or object it does not resolve)
27
+ * is one condition, an event compile cannot place: EVENT_UNKNOWN, as Flow's
28
+ * compile says.
26
29
  *
27
30
  * @param library - The connector library.
28
31
  * @param kind - `trigger` for an event trigger, `event` for a wait-for-connector task or rule.
29
32
  * @param sub - The authored subscription.
30
33
  * @param byoa - Where the subscription is and the bindings, to refuse an
31
- * unverified BYOA connection; compile passes it, `check` does not (it reports
32
- * that rule from the shared event rules).
34
+ * unverified BYOA connection.
33
35
  * @returns The resolved event.
34
- * @throws What `resolveEvent` throws, {@link GenericEventNoObjectError}, or a `ByoaRefusal`.
36
+ * @throws EVENT_UNKNOWN, {@link GenericEventNoObjectError}, or a `ByoaRefusal`.
35
37
  */
36
38
  export declare function resolveCaseSubscription(library: Library, kind: 'trigger' | 'event', sub: EventSubscription, byoa?: {
37
39
  where: string;
@@ -16,19 +16,29 @@ function caseObjectOption(object) {
16
16
  /**
17
17
  * Resolve a Case event subscription: `library.resolveEvent` with the
18
18
  * subscription's own `version` and `object`, then refuse a GENERIC event the
19
- * author named no object for.
19
+ * author named no object for. Whatever `resolveEvent` throws (a connector or
20
+ * event the library does not carry, a version or object it does not resolve)
21
+ * is one condition, an event compile cannot place: EVENT_UNKNOWN, as Flow's
22
+ * compile says.
20
23
  *
21
24
  * @param library - The connector library.
22
25
  * @param kind - `trigger` for an event trigger, `event` for a wait-for-connector task or rule.
23
26
  * @param sub - The authored subscription.
24
27
  * @param byoa - Where the subscription is and the bindings, to refuse an
25
- * unverified BYOA connection; compile passes it, `check` does not (it reports
26
- * that rule from the shared event rules).
28
+ * unverified BYOA connection.
27
29
  * @returns The resolved event.
28
- * @throws What `resolveEvent` throws, {@link GenericEventNoObjectError}, or a `ByoaRefusal`.
30
+ * @throws EVENT_UNKNOWN, {@link GenericEventNoObjectError}, or a `ByoaRefusal`.
29
31
  */
30
32
  export function resolveCaseSubscription(library, kind, sub, byoa) {
31
- const rc = library.resolveEvent(kind, sub.connector, sub.event, sub.version, sub.object);
33
+ let rc;
34
+ try {
35
+ rc = library.resolveEvent(kind, sub.connector, sub.event, sub.version, sub.object);
36
+ }
37
+ catch (error) {
38
+ if (error instanceof Error && error.message.startsWith('internal SDK error:'))
39
+ throw error;
40
+ throw new CompileRefusal('EVENT_UNKNOWN', error instanceof Error ? error.message : String(error));
41
+ }
32
42
  const noObject = genericEventObjectRefusal(rc, sub, caseObjectOption);
33
43
  if (noObject)
34
44
  throw new GenericEventNoObjectError(noObject);
@@ -278,6 +278,7 @@ export declare const REFUSALS: {
278
278
  readonly EXTERNAL_TASK_EVENT: "lowering";
279
279
  readonly EXTERNAL_TASK_FOLDER: "lowering";
280
280
  readonly EXTERNAL_TASK_MODE: "lowering";
281
+ readonly EXTERNAL_TASK_MODE_MISMATCH: "lowering";
281
282
  readonly EXTRACT_SCHEMA_SHAPE: "lint";
282
283
  readonly FAKE_JOIN: "lint";
283
284
  readonly FILE_NOT_FOUND: "lowering";
@@ -6,8 +6,9 @@
6
6
  * stops `compile` from writing. A serializer warning (`CONNECTION_STUB`) is
7
7
  * `lint` too: it never blocks.
8
8
  * - `lowering`: `compile` cannot write a correct `.flow` (or caseplan, or `.bpmn`). It always
9
- * stops `compile`; for a Flow, `check` reports it too, from the serializer it runs in
10
- * collect mode (`SerializeOpts.collect`), so the rule lives in one place.
9
+ * stops `compile`; for a Flow or a Case, `check` reports it too, from the serializer it
10
+ * runs in collect mode (`SerializeOpts.collect`, `CaseSerializeOpts.collect`), so the rule
11
+ * lives in one place.
11
12
  * - `draft`: an unfinished canvas node (no connection yet, a required input
12
13
  * left empty, a generic operation with no object). These are the codes a
13
14
  * draft-tolerant compile collects instead of throwing (`DraftCode` in
@@ -329,6 +330,7 @@ export const REFUSALS = {
329
330
  EXTERNAL_TASK_EVENT: 'lowering',
330
331
  EXTERNAL_TASK_FOLDER: 'lowering',
331
332
  EXTERNAL_TASK_MODE: 'lowering',
333
+ EXTERNAL_TASK_MODE_MISMATCH: 'lowering',
332
334
  EXTRACT_SCHEMA_SHAPE: 'lint',
333
335
  FAKE_JOIN: 'lint',
334
336
  FILE_NOT_FOUND: 'lowering',
@@ -1,5 +1,6 @@
1
1
  import type { LibraryEntry } from "../model/library.js";
2
2
  import { type BuildContext } from "./context.js";
3
+ import { type Dict } from "./py.js";
3
4
  /**
4
5
  * Registry `httpMethod` (e.g. `GETBYID`) → a guess at the `is resources`
5
6
  * operation name, for an entry whose canonical `operation.name` is empty.
@@ -18,6 +19,25 @@ export declare function discoverOperationName(ctx: BuildContext, entry: LibraryE
18
19
  * payload; `objectDisplayName` and `display.operationLabel` fill gaps only.
19
20
  */
20
21
  export declare function applyDescribe(entry: LibraryEntry, data: unknown): LibraryEntry;
22
+ /**
23
+ * Record an external agent's or automation's execution facts on its operation,
24
+ * from the describe payload (#1369, #1387).
25
+ *
26
+ * Integration Service keeps them on the object's metadata, not in the registry
27
+ * node: `executionType` (`sync`, `async` or `hybrid`) and, for an `async` or
28
+ * `hybrid` object, the event it answers with. `uip is resources describe`
29
+ * reports them as `ExecutionType`, `EventType` and `EventMode` (uip#5702,
30
+ * read with the same `externalExecutionOf` as `case spec`). They become
31
+ * `operation.executionType` and `operation.executionEvent` (`{ operation, mode }`),
32
+ * which Case and BPMN derive the task's `mode` and `event` from. The event is
33
+ * kept apart from `eventOperation` / `eventMode`, which mark a connector EVENT
34
+ * entry (a trigger) and which `identifyEvent` matches on.
35
+ *
36
+ * Only an `AgentExecution` / `ProcessExecution` operation gets them, and only
37
+ * what the payload states (an execution type outside the three is not stored): a describe from a CLI that does not report them
38
+ * leaves the entry as it was, so an older build stays byte-identical.
39
+ */
40
+ export declare function applyExternalExecution(operation: Dict, data: unknown): void;
21
41
  /**
22
42
  * `enrich_entry`: augment a canonical entry with `is resources describe` data.
23
43
  * On any failure the entry is returned as it was, so the pipeline degrades
@@ -78,6 +78,7 @@ export function applyDescribe(entry, data) {
78
78
  const opCurated = pick(opData, "Curated", "curated");
79
79
  if (pyTruthy(opCurated) && !pyTruthy(get(display, "operationLabel")))
80
80
  display.operationLabel = opCurated;
81
+ applyExternalExecution(operation, data);
81
82
  // Parameters (path / query) — raw shape, camelCase keys.
82
83
  const params = pyOr(pick(data, "Parameters", "parameters"), []);
83
84
  if (pyTruthy(params))
@@ -92,6 +93,45 @@ export function applyDescribe(entry, data) {
92
93
  e.outputSchema = { fields: normalizeFieldKeys(responseFields) };
93
94
  return entry;
94
95
  }
96
+ /** The operation subtypes Case's and BPMN's external agent / workflow tasks run. */
97
+ const EXTERNAL_SUBTYPES = new Set(["AgentExecution", "ProcessExecution"]);
98
+ /** The execution types Integration Service reports, as Case and BPMN read them. */
99
+ const EXECUTION_TYPES = new Set(["sync", "async", "hybrid"]);
100
+ /**
101
+ * Record an external agent's or automation's execution facts on its operation,
102
+ * from the describe payload (#1369, #1387).
103
+ *
104
+ * Integration Service keeps them on the object's metadata, not in the registry
105
+ * node: `executionType` (`sync`, `async` or `hybrid`) and, for an `async` or
106
+ * `hybrid` object, the event it answers with. `uip is resources describe`
107
+ * reports them as `ExecutionType`, `EventType` and `EventMode` (uip#5702,
108
+ * read with the same `externalExecutionOf` as `case spec`). They become
109
+ * `operation.executionType` and `operation.executionEvent` (`{ operation, mode }`),
110
+ * which Case and BPMN derive the task's `mode` and `event` from. The event is
111
+ * kept apart from `eventOperation` / `eventMode`, which mark a connector EVENT
112
+ * entry (a trigger) and which `identifyEvent` matches on.
113
+ *
114
+ * Only an `AgentExecution` / `ProcessExecution` operation gets them, and only
115
+ * what the payload states (an execution type outside the three is not stored): a describe from a CLI that does not report them
116
+ * leaves the entry as it was, so an older build stays byte-identical.
117
+ */
118
+ export function applyExternalExecution(operation, data) {
119
+ if (!EXTERNAL_SUBTYPES.has(String(get(operation, "subType") ?? "")))
120
+ return;
121
+ // Stored only as one of the three values Case and BPMN read, lowercased: a
122
+ // `Hybrid` kept verbatim would be ignored downstream and read as "no record".
123
+ const reported = pick(data, "ExecutionType", "executionType");
124
+ const executionType = typeof reported === "string" ? reported.trim().toLowerCase() : "";
125
+ if (!EXECUTION_TYPES.has(executionType))
126
+ return;
127
+ operation.executionType = executionType;
128
+ if (executionType === "sync")
129
+ return;
130
+ const eventType = pick(data, "EventType", "eventType");
131
+ const eventMode = pick(data, "EventMode", "eventMode");
132
+ if (typeof eventType === "string" && eventType && typeof eventMode === "string" && eventMode)
133
+ operation.executionEvent = { operation: eventType, mode: eventMode };
134
+ }
95
135
  /**
96
136
  * `enrich_entry`: augment a canonical entry with `is resources describe` data.
97
137
  * On any failure the entry is returned as it was, so the pipeline degrades
@@ -85,6 +85,16 @@ export interface EntryOperation {
85
85
  objectFromDiscovery?: boolean;
86
86
  eventOperation?: string;
87
87
  eventMode?: string;
88
+ /**
89
+ * An external agent's or automation's `executionType` (`sync`, `async`,
90
+ * `hybrid`), on an `AgentExecution` / `ProcessExecution` operation only.
91
+ */
92
+ executionType?: string;
93
+ /** The event an `async` / `hybrid` external object answers with. */
94
+ executionEvent?: {
95
+ operation: string;
96
+ mode: string;
97
+ };
88
98
  schemaAction?: SchemaAction | null;
89
99
  dispatchStyle?: string;
90
100
  paramGrammars?: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.68.6",
3
+ "version": "6.69.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",
@@ -100,5 +100,5 @@
100
100
  "@types/node": "^22.7.0",
101
101
  "esbuild": "^0.28.1"
102
102
  },
103
- "gitref": "7e50034dc8a8317fe205d355859bc80f047174b3"
103
+ "gitref": "f1c4fc99c993d7cc8defcda32496be344f018a23"
104
104
  }