@uipath/maestro-builder-sdk 6.93.7 → 6.93.9

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.
@@ -1,8 +1,18 @@
1
1
  /**
2
- * bpmn/managed-http — the wire shape behind connector-mode `.http()`: a V2
3
- * `Intsvc.UnifiedHttpRequest` through an Integration Service connection, as
4
- * `uip maestro bpmn registry get Intsvc.UnifiedHttpRequest --connection-id <id>` builds it
5
- * (UiPath/cli `buildManagedHttpSpec` rendered by `renderBpmnV2Element`).
2
+ * bpmn/managed-http — the wire shape behind `.http()`: a V2 `Intsvc.UnifiedHttpRequest`,
3
+ * as `uip maestro bpmn registry get Intsvc.UnifiedHttpRequest --input-details <request>`
4
+ * builds it (UiPath/cli `buildManagedHttpSpec` rendered by `renderBpmnV2Element`). Two modes,
5
+ * one element:
6
+ * - connector (`--connection-id <id>`): the request goes through an Integration Service
7
+ * connection, which the node binds with its folder;
8
+ * - manual: the request authenticates itself, and the node names Studio Web's implicit
9
+ * connection (`ImplicitConnection`), which no tenant resource backs.
10
+ *
11
+ * The V1 manual node (`mode="manual"` and the request as context rows), which `.http()`
12
+ * wrote without a connection until #1873, faults at runtime: incident 102018 "Invalid value
13
+ * in Unified HttpRequest input", "Body cannot be null", with `body` as `null` and as `{}`
14
+ * alike (flow-v2-run-12, flow-v2-run-14). The V2 manual node ran live end to end
15
+ * (flow-v2-run-14 v1 `skill-bpmn-slack-weather-pipeline`, an Open-Meteo GET).
6
16
  */
7
17
  import { MANAGED_HTTP_CONNECTOR_KEY } from '../core/managed-http.js';
8
18
  import type { TypedContextRow, TypedInputRow, TypedOutputRow } from './typed-node.js';
@@ -11,6 +21,19 @@ export declare const MANAGED_HTTP_TYPE = "Intsvc.UnifiedHttpRequest";
11
21
  /** The connection binding's name, after the node's `connectorKey`, as the CLI names it. */
12
22
  export declare const MANAGED_HTTP_CONNECTION_NAME = "uipath-uipath-http connection";
13
23
  export declare const MANAGED_HTTP_FOLDER_NAME = "FolderKey";
24
+ /**
25
+ * The connection a manual request names: Studio Web's implicit one, which no tenant
26
+ * resource backs, so `bpmn refresh` and packaging leave it out of `bindings_v2.json`.
27
+ */
28
+ export declare const IMPLICIT_CONNECTION = "ImplicitConnection";
29
+ /**
30
+ * The id the CLI gives the implicit connection's binding: it derives a root binding's id
31
+ * from what it binds (UiPath/cli `bindingId` in `connector-spec/bpmn-element.ts`,
32
+ * `b` + the first 8 base64url characters, less `-` and `_`, of
33
+ * sha256(`Connection|ImplicitConnection|ConnectionId`)), so every manual request in a
34
+ * process shares this one binding, and a node the CLI adds finds it already there.
35
+ */
36
+ export declare const IMPLICIT_CONNECTION_BINDING_ID = "bodyYna9C";
14
37
  /**
15
38
  * True for a V2 HTTP request. `registry-types.json` holds the V1 manual node, whose
16
39
  * required `url` and `mode` a V2 one does not carry.
@@ -26,7 +49,9 @@ export declare function managedHttpAbsoluteUrl(body: unknown): {
26
49
  url: string;
27
50
  targetConnector: string;
28
51
  } | undefined;
29
- export interface ManagedHttpRequest {
52
+ /** A request through a connection; its auth is the connection's. */
53
+ export interface ManagedHttpConnectorRequest {
54
+ authentication: 'connector';
30
55
  /** `ref` is the `=bindings.<id>` reference; `key` the connection id it resolves to. */
31
56
  connection: {
32
57
  ref: string;
@@ -44,6 +69,21 @@ export interface ManagedHttpRequest {
44
69
  query?: Record<string, unknown>;
45
70
  body?: unknown;
46
71
  }
72
+ /** A request that authenticates itself, through the implicit connection. */
73
+ export interface ManagedHttpManualRequest {
74
+ authentication: 'manual';
75
+ /** `ref` is the `=bindings.<id>` reference to the implicit connection's binding. */
76
+ connection: {
77
+ ref: string;
78
+ };
79
+ method: string;
80
+ /** The URL the request goes to, as written. */
81
+ url: string;
82
+ headers?: Record<string, unknown>;
83
+ query?: Record<string, unknown>;
84
+ body?: unknown;
85
+ }
86
+ export type ManagedHttpRequest = ManagedHttpConnectorRequest | ManagedHttpManualRequest;
47
87
  export interface ManagedHttpVars {
48
88
  code: string;
49
89
  headers: string;
@@ -51,6 +91,7 @@ export interface ManagedHttpVars {
51
91
  error: string;
52
92
  }
53
93
  export declare function managedHttpContext(req: ManagedHttpRequest): TypedContextRow[];
94
+ /** The request, in the `body` row: UiPath/cli `buildManagedHttpBodyParameters`, in its key order. */
54
95
  export declare function managedHttpInputs(req: ManagedHttpRequest): TypedInputRow[];
55
96
  /** Studio Web's curated HTTP outputs, then `Error`. */
56
97
  export declare function managedHttpOutputs(vars: ManagedHttpVars): TypedOutputRow[];
@@ -1,8 +1,18 @@
1
1
  /**
2
- * bpmn/managed-http — the wire shape behind connector-mode `.http()`: a V2
3
- * `Intsvc.UnifiedHttpRequest` through an Integration Service connection, as
4
- * `uip maestro bpmn registry get Intsvc.UnifiedHttpRequest --connection-id <id>` builds it
5
- * (UiPath/cli `buildManagedHttpSpec` rendered by `renderBpmnV2Element`).
2
+ * bpmn/managed-http — the wire shape behind `.http()`: a V2 `Intsvc.UnifiedHttpRequest`,
3
+ * as `uip maestro bpmn registry get Intsvc.UnifiedHttpRequest --input-details <request>`
4
+ * builds it (UiPath/cli `buildManagedHttpSpec` rendered by `renderBpmnV2Element`). Two modes,
5
+ * one element:
6
+ * - connector (`--connection-id <id>`): the request goes through an Integration Service
7
+ * connection, which the node binds with its folder;
8
+ * - manual: the request authenticates itself, and the node names Studio Web's implicit
9
+ * connection (`ImplicitConnection`), which no tenant resource backs.
10
+ *
11
+ * The V1 manual node (`mode="manual"` and the request as context rows), which `.http()`
12
+ * wrote without a connection until #1873, faults at runtime: incident 102018 "Invalid value
13
+ * in Unified HttpRequest input", "Body cannot be null", with `body` as `null` and as `{}`
14
+ * alike (flow-v2-run-12, flow-v2-run-14). The V2 manual node ran live end to end
15
+ * (flow-v2-run-14 v1 `skill-bpmn-slack-weather-pipeline`, an Open-Meteo GET).
6
16
  */
7
17
  import { MANAGED_HTTP_ACTIVITY_TYPE_ID, MANAGED_HTTP_CONNECTOR_KEY, MANAGED_HTTP_ENDPOINT, MANAGED_HTTP_ENDPOINT_METHOD, MANAGED_HTTP_ESSENTIAL_CONFIGURATION, MANAGED_HTTP_INSTANCE_PARAMETERS, MANAGED_HTTP_OBJECT_NAME, MANAGED_HTTP_TELEMETRY, } from '../core/managed-http.js';
8
18
  import { isRecord } from '../core/node-envelope.js';
@@ -14,6 +24,20 @@ export const MANAGED_HTTP_FOLDER_NAME = 'FolderKey';
14
24
  const CONNECTOR_VERSION = '1.4.50';
15
25
  const CONFIGURATION_VERSION = 'v2';
16
26
  const CONNECTOR_AUTHENTICATION = 'connector';
27
+ const MANUAL_AUTHENTICATION = 'manual';
28
+ /**
29
+ * The connection a manual request names: Studio Web's implicit one, which no tenant
30
+ * resource backs, so `bpmn refresh` and packaging leave it out of `bindings_v2.json`.
31
+ */
32
+ export const IMPLICIT_CONNECTION = 'ImplicitConnection';
33
+ /**
34
+ * The id the CLI gives the implicit connection's binding: it derives a root binding's id
35
+ * from what it binds (UiPath/cli `bindingId` in `connector-spec/bpmn-element.ts`,
36
+ * `b` + the first 8 base64url characters, less `-` and `_`, of
37
+ * sha256(`Connection|ImplicitConnection|ConnectionId`)), so every manual request in a
38
+ * process shares this one binding, and a node the CLI adds finds it already there.
39
+ */
40
+ export const IMPLICIT_CONNECTION_BINDING_ID = 'bodyYna9C';
17
41
  /** Studio Web's guard on a JSON string it stores in node metadata. */
18
42
  const JSON_STRING_PREFIX = '=jsonString:';
19
43
  /** The CLI's `EXPRESSION_SHAPED`: a value Studio Web's V2 component reads as an expression only as `=js:`. */
@@ -25,6 +49,8 @@ const EXPRESSION_SHAPED = /^=(vars|metadata|response|Error)\b/;
25
49
  const REQUIRED_CONTEXT = ['connectorKey'];
26
50
  const CONNECTOR_REQUIRED_CONTEXT = ['folderKey'];
27
51
  const CONNECTOR_REQUIRED_BODY = ['targetConnector', 'connection'];
52
+ /** UiPath/cli `managedHttpDetailErrors`: "url is required for manual mode". */
53
+ const MANUAL_REQUIRED_BODY = ['url'];
28
54
  const ABSOLUTE_URL = /^[a-z][a-z\d+.-]*:\/\//i;
29
55
  const ESSENTIAL_CONFIGURATION = {
30
56
  essentialConfiguration: {
@@ -54,6 +80,9 @@ export function isManagedHttpV2(type, context) {
54
80
  export function managedHttpMissing(context, body) {
55
81
  const unset = (v) => v === undefined || v === null || (typeof v === 'string' && v.trim() === '');
56
82
  const missingContext = REQUIRED_CONTEXT.filter((name) => unset(context[name]));
83
+ const manual = manualRequest(body);
84
+ if (manual !== undefined)
85
+ return [...missingContext, ...MANUAL_REQUIRED_BODY.filter((name) => typeof manual[name] !== 'string' || unset(manual[name])).map((name) => `body.${name}`)];
57
86
  const request = connectorRequest(body);
58
87
  if (request === undefined)
59
88
  return missingContext;
@@ -79,8 +108,14 @@ export function managedHttpAbsoluteUrl(body) {
79
108
  return { url, targetConnector };
80
109
  }
81
110
  function connectorRequest(body) {
111
+ return requestOf(body, CONNECTOR_AUTHENTICATION);
112
+ }
113
+ function manualRequest(body) {
114
+ return requestOf(body, MANUAL_AUTHENTICATION);
115
+ }
116
+ function requestOf(body, authentication) {
82
117
  const request = typeof body === 'string' ? parseObject(body) : body;
83
- return isRecord(request) && request.authentication === CONNECTOR_AUTHENTICATION ? request : undefined;
118
+ return isRecord(request) && request.authentication === authentication ? request : undefined;
84
119
  }
85
120
  function parseObject(text) {
86
121
  try {
@@ -101,11 +136,13 @@ function designTimeExpressions(value) {
101
136
  return value;
102
137
  }
103
138
  export function managedHttpContext(req) {
139
+ const connector = req.authentication === CONNECTOR_AUTHENTICATION;
104
140
  return [
105
141
  { name: 'connectorKey', value: MANAGED_HTTP_CONNECTOR_KEY },
106
142
  { name: 'connection', value: req.connection.ref },
107
- { name: 'resourceKey', value: req.connection.key },
108
- ...(req.folder ? [{ name: 'folderKey', value: req.folder.ref }] : []),
143
+ // A manual request has no connection id: the CLI writes the row with no value.
144
+ connector ? { name: 'resourceKey', value: req.connection.key } : { name: 'resourceKey' },
145
+ ...(connector && req.folder ? [{ name: 'folderKey', value: req.folder.ref }] : []),
109
146
  { name: 'method', value: MANAGED_HTTP_ENDPOINT_METHOD },
110
147
  { name: 'path', value: MANAGED_HTTP_ENDPOINT },
111
148
  { name: 'objectName', value: MANAGED_HTTP_OBJECT_NAME },
@@ -126,16 +163,19 @@ export function managedHttpContext(req) {
126
163
  { name: 'activityConfigurationVersion', value: CONFIGURATION_VERSION },
127
164
  ];
128
165
  }
166
+ /** The request, in the `body` row: UiPath/cli `buildManagedHttpBodyParameters`, in its key order. */
129
167
  export function managedHttpInputs(req) {
130
168
  const url = designTimeExpressions(req.url);
131
- const body = {
132
- authentication: CONNECTOR_AUTHENTICATION,
133
- method: req.method,
134
- targetConnector: req.targetConnector,
135
- connection: req.connection.key,
136
- path: url,
137
- url,
138
- };
169
+ const body = req.authentication === CONNECTOR_AUTHENTICATION
170
+ ? {
171
+ authentication: CONNECTOR_AUTHENTICATION,
172
+ method: req.method,
173
+ targetConnector: req.targetConnector,
174
+ connection: req.connection.key,
175
+ path: url,
176
+ url,
177
+ }
178
+ : { authentication: MANUAL_AUTHENTICATION, method: req.method, url };
139
179
  if (req.headers !== undefined)
140
180
  body.headers = designTimeExpressions(req.headers);
141
181
  if (req.query !== undefined)
@@ -19,6 +19,7 @@ import { createRequire } from 'node:module';
19
19
  import { createConnectorTask } from './connector.js';
20
20
  import { createConnectorEvent, createExternalTask } from './intsvc.js';
21
21
  import { connectorEventErrorVar, intsvcOutputVar } from './intsvc-vars.js';
22
+ import { IMPLICIT_CONNECTION } from './managed-http.js';
22
23
  import { createExtensionPayload, createTypedNode, rowDeclaration, typedNodeOutputVar, verbatimOutputRows } from './typed-node.js';
23
24
  import { connectorOutputVars, nodeDeclaredVars, typedNodeDeclaredVars } from './declared-vars.js';
24
25
  import { defaultEntryPointId } from './entry-point-id.js';
@@ -1271,7 +1272,8 @@ export function folderCompanionKeys(built, sink) {
1271
1272
  const key = b.resourceKey ?? b.default;
1272
1273
  if (key !== undefined)
1273
1274
  keyOf.set(b.id, key);
1274
- if (isConnectionId(b.propertyAttribute))
1275
+ // The implicit connection a manual HTTP request names is no connection a folder belongs to.
1276
+ if (isConnectionId(b.propertyAttribute) && key !== IMPLICIT_CONNECTION)
1275
1277
  connectionIds.push(b.id);
1276
1278
  }
1277
1279
  for (const b of sink.values()) {
@@ -401,8 +401,8 @@ export interface TypedNodeInput {
401
401
  * the registry's defaults.
402
402
  *
403
403
  * For importers, not authors. Default injection is an authoring convenience:
404
- * `.http()` relies on it for `mode`, which is required, hidden, and so never
405
- * passed by hand. An importer has the opposite need — the artifact already
404
+ * `.activity('…', 'Intsvc.UnifiedHttpRequest')` relies on it for the V1 manual
405
+ * node's `mode`, which is required, hidden, and so never passed by hand. An importer has the opposite need — the artifact already
406
406
  * carries the fields it should, and adding a default it lacked, or reordering
407
407
  * what it had, breaks a byte-exact round-trip. `bpmn-decompile` sets this.
408
408
  */
@@ -250,9 +250,9 @@ export function typedNodeOutputVar(id, type, outputVar, inline) {
250
250
  * that the registry gives a default.
251
251
  *
252
252
  * A field is emitted when the author set it OR the registry declares a default.
253
- * The registry's defaults are not cosmetic: `Intsvc.UnifiedHttpRequest` declares
254
- * `mode: "manual"` as REQUIRED and HIDDEN, so an author never passes it and the
255
- * artifact fails validation without it.
253
+ * The registry's defaults are not cosmetic: the V1 `Intsvc.UnifiedHttpRequest`
254
+ * snapshot declares `mode: "manual"` as REQUIRED and HIDDEN, so an author never passes
255
+ * it and the artifact fails validation without it.
256
256
  */
257
257
  /**
258
258
  * A `json` context field's CDATA body.
package/dist/bpmn-api.md CHANGED
@@ -223,7 +223,7 @@ Extends `ActivityOpts` — its fields and methods apply here too.
223
223
  - `ScriptTaskOpts.outputs?: Record<string, string>` — `uipath:output` rows: variable id → `=`-expression.
224
224
  - `ScriptTaskOpts.outputRows?: TypedOutputRow[]` — Output rows spelled out, replacing the ones `outputs` derives — see TypedOutputRow.
225
225
  - `ScriptTaskOpts.inputSchema?: unknown` — The `uipath:inputSchema` body inside the mapping's `uipath:context` — a JSON Schema for the `args` the script receives.
226
- - `ScriptTaskOpts.type?: string` — The mapping's extension type.
226
+ - `ScriptTaskOpts.type?: 'BPMN.Variables'` — The mapping's extension type.
227
227
 
228
228
  ### `TaskOpts`
229
229
 
@@ -257,21 +257,21 @@ Also takes every field of `ConnectorOpts`, `ActivityOpts`.
257
257
 
258
258
  ### `HttpOpts`
259
259
 
260
- Options for `.http()` — an `Intsvc.UnifiedHttpRequest` node.
260
+ Options for `.http()` — a V2 `Intsvc.UnifiedHttpRequest` node.
261
261
 
262
262
  Extends `ActivityOpts` — its fields and methods apply here too.
263
263
 
264
264
  - `HttpOpts.name?: string` — Display name the designer shows on the task.
265
265
  - `HttpOpts.url: string` — Request URL.
266
266
  - `HttpOpts.method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS'` — HTTP method.
267
- - `HttpOpts.headers?: Record<string, unknown>` — Request headers — serialized to the node's json context field.
268
- - `HttpOpts.parameters?: Record<string, unknown>` — Query parameters — serialized to the node's json context field, or to the request's `query` in connector mode (see…
269
- - `HttpOpts.body?: unknown` — Request body — serialized to the node's json context field.
267
+ - `HttpOpts.headers?: Record<string, unknown>` — Request headers — the request's `headers`.
268
+ - `HttpOpts.parameters?: Record<string, unknown>` — Query parameters — the request's `query`.
269
+ - `HttpOpts.body?: unknown` — Request body — the request's `body`.
270
270
  - `HttpOpts.connection?: string` — Symbolic binding name of an Integration Service **connection** to send the request through — which switches the node to…
271
271
  - `HttpOpts.folder?: string` — Symbolic binding name of the connection's folder — connector mode only, where the CLI requires it.
272
272
  - `HttpOpts.connectorKey?: string` — The connector the connection belongs to, connector mode only.
273
273
  - `HttpOpts.outputs?: Record<string, string>` — EXTRA output rows: variable id → `=`-expression read against the node's own result, e.g. `{ runStatus: '=Status' }`.
274
- - `HttpOpts.outputVar?: string` — Variable the response lands in.
274
+ - `HttpOpts.outputVar?: string` — Variable the response body lands in.
275
275
  - `HttpOpts.skipCondition?: string` — `=`-expression that skips the request when truthy.
276
276
 
277
277
  ### `DataServiceOpts`
@@ -65,6 +65,7 @@ export declare const REFUSALS: {
65
65
  readonly BINDING_UNDECLARED: "draft";
66
66
  readonly BOUNDARY_NOT_ACTIVITY: "lint";
67
67
  readonly BOUNDARY_UNATTACHED: "lowering";
68
+ readonly BPMN_ACTIVITY_SCRIPT_TASK_TYPE: "lowering";
68
69
  readonly BPMN_BINDING_READ_BEFORE_DECLARED: "lowering";
69
70
  readonly BPMN_BINDING_RESOURCE_KEY_CONFLICT: "lowering";
70
71
  readonly BPMN_BOUNDARY_NO_EVENT: "lint";
@@ -123,6 +124,7 @@ export declare const REFUSALS: {
123
124
  readonly BPMN_PATH_NOT_CONTINUED: "lowering";
124
125
  readonly BPMN_PLAIN_TASK_ELEMENT_INVALID: "lowering";
125
126
  readonly BPMN_RACE_ARM_NOT_WAIT: "lowering";
127
+ readonly BPMN_SCRIPT_TASK_TYPE_INVALID: "lowering";
126
128
  readonly BPMN_SEQUENCE_NO_INCOMING: "lowering";
127
129
  readonly BPMN_SOURCE_NOT_FOUND: "lowering";
128
130
  readonly BPMN_START_ALREADY_SYNTHESIZED: "lowering";
@@ -443,6 +445,7 @@ export declare const REFUSALS: {
443
445
  readonly HTTP_BRANCH_UNKNOWN: "lint";
444
446
  readonly HTTP_MANAGED_BINDING_INCOMPLETE: "lowering";
445
447
  readonly HTTP_MANAGED_REQUIRED: "lowering";
448
+ readonly HTTP_MANUAL_V1: "lint";
446
449
  readonly HTTP_ONERROR_V1: "lint";
447
450
  readonly HTTP_READ_NOT_OUTPUT: "lint";
448
451
  readonly HTTP_READ_UNKNOWN_FIELD: "lint";
@@ -114,6 +114,7 @@ export const REFUSALS = {
114
114
  BINDING_UNDECLARED: 'draft',
115
115
  BOUNDARY_NOT_ACTIVITY: 'lint',
116
116
  BOUNDARY_UNATTACHED: 'lowering',
117
+ BPMN_ACTIVITY_SCRIPT_TASK_TYPE: 'lowering',
117
118
  BPMN_BINDING_READ_BEFORE_DECLARED: 'lowering',
118
119
  BPMN_BINDING_RESOURCE_KEY_CONFLICT: 'lowering',
119
120
  BPMN_BOUNDARY_NO_EVENT: 'lint',
@@ -172,6 +173,7 @@ export const REFUSALS = {
172
173
  BPMN_PATH_NOT_CONTINUED: 'lowering',
173
174
  BPMN_PLAIN_TASK_ELEMENT_INVALID: 'lowering',
174
175
  BPMN_RACE_ARM_NOT_WAIT: 'lowering',
176
+ BPMN_SCRIPT_TASK_TYPE_INVALID: 'lowering',
175
177
  BPMN_SEQUENCE_NO_INCOMING: 'lowering',
176
178
  BPMN_SOURCE_NOT_FOUND: 'lowering',
177
179
  BPMN_START_ALREADY_SYNTHESIZED: 'lowering',
@@ -517,6 +519,7 @@ export const REFUSALS = {
517
519
  HTTP_BRANCH_UNKNOWN: 'lint',
518
520
  HTTP_MANAGED_BINDING_INCOMPLETE: 'lowering',
519
521
  HTTP_MANAGED_REQUIRED: 'lowering',
522
+ HTTP_MANUAL_V1: 'lint',
520
523
  HTTP_ONERROR_V1: 'lint',
521
524
  HTTP_READ_NOT_OUTPUT: 'lint',
522
525
  HTTP_READ_UNKNOWN_FIELD: 'lint',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.93.7",
3
+ "version": "6.93.9",
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",
@@ -111,5 +111,5 @@
111
111
  "@types/node": "^22.7.0",
112
112
  "esbuild": "^0.28.1"
113
113
  },
114
- "gitref": "9049e7872b34bee80a23919e5a9b3bcf9000fca2"
114
+ "gitref": "848160dfefe78ef27757eebc6130d49048a0943a"
115
115
  }