@uipath/maestro-builder-sdk 6.47.1 → 6.47.3

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.
@@ -16,7 +16,7 @@ import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
16
16
  import { bindingLabelRefusal } from '../core/binding-messages.js';
17
17
  import { resolveEventWhere } from '../core/lookups.js';
18
18
  import { resolveCaseSubscription } from './subscription.js';
19
- import { externalDescriptorRefusal } from './external.js';
19
+ import { externalDescriptorRefusal, externalHybridRefusal, externalServiceType, isExternalExecutionMode } from './external.js';
20
20
  import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS } from './format-profile.js';
21
21
  import { isResourceLabelRefusal, resolveResourceRef, resourceIdentity } from './resource-identity.js';
22
22
  import { ownEntry } from '../core/own-entry.js';
@@ -971,7 +971,7 @@ function taskData(task, resolver, taskId, stageId, ids) {
971
971
  return connectorTaskData(task.connector, resolver, taskId, `Connector task "${task.name}"`);
972
972
  case 'external-agent':
973
973
  case 'external-workflow':
974
- return externalTaskData(task.kind, task.external, resolver, `${task.kind === 'external-agent' ? 'External Agent' : 'External Workflow'} task "${task.name}"`);
974
+ return externalTaskData(task.kind, task.external, resolver, taskId, `${task.kind === 'external-agent' ? 'External Agent' : 'External Workflow'} task "${task.name}"`);
975
975
  case 'wait-for-timer': {
976
976
  if (task.timer?.duration)
977
977
  return { timerType: 'timeDuration', timeDuration: task.timer.duration };
@@ -1360,7 +1360,7 @@ function businessRuleTaskData(task, resolver, elementId, ids) {
1360
1360
  * the op's output schema. Connection/folder resolve through `bindings` and are
1361
1361
  * referenced as `=bindings.<id>`, with the binding entry collected at case root.
1362
1362
  */
1363
- function connectorTaskData(spec, resolver, elementId, where) {
1363
+ function connectorTaskData(spec, resolver, elementId, where, executionType) {
1364
1364
  if (!resolver.library)
1365
1365
  throw new Error(`connector task needs the connector library — pass { library } to serialize or use uip maestro case compile --library.`);
1366
1366
  const rc = resolver.library.resolve(spec.key, spec.action, spec.version, spec.object);
@@ -1378,7 +1378,7 @@ function connectorTaskData(spec, resolver, elementId, where) {
1378
1378
  const folderRef = folderBindingRef(resolver, spec.folder, connRef, { attribute: 'folder', where, target });
1379
1379
  if (folderRef)
1380
1380
  context.push(io('folderKey', 'string', { value: `=bindings.${folderRef.id}` }));
1381
- context.push(io('objectName', 'string', { value: op.objectName ?? spec.action }), io('method', 'string', { value: transportHttpMethod(rc.httpMethod) }), io('path', 'string', { value: rc.endpoint }), io('metadata', 'json', { body: connectorMetadata(rc, op) }));
1381
+ context.push(io('objectName', 'string', { value: op.objectName ?? spec.action }), io('method', 'string', { value: transportHttpMethod(rc.httpMethod) }), io('path', 'string', { value: rc.endpoint }), io('metadata', 'json', { body: connectorMetadata(rc, op, executionType) }));
1382
1382
  // inputs: the shared validator (`core/connector-inputs.ts`), the one Flow's and
1383
1383
  // BPMN's serializers and every family's `check` run. It refuses a missing
1384
1384
  // required field, an unknown or mistyped input, and swaps a `lookup()` token for
@@ -1412,66 +1412,35 @@ function connectorTaskData(spec, resolver, elementId, where) {
1412
1412
  const outputs = connectorOutputs(rc, elementId, resolver);
1413
1413
  return { serviceType: CASE_FORMAT_PROFILE.connectorActivityServiceType, context, inputs, outputs, bindings: [] };
1414
1414
  }
1415
- function externalTaskData(kind, spec, resolver, where) {
1415
+ /**
1416
+ * An External Agent / External Workflow task, in the shape the Case Designer
1417
+ * saves one (`uip`'s `tests/fixtures/external-tasks/designer-saved.json`, alpha
1418
+ * 2026-10-16): a connector activity's `data` — `connectorKey`, `connection`,
1419
+ * `resourceKey`, `folderKey`, `objectName`, `method`, `path`, `metadata`
1420
+ * context; `pathParameters` / `queryParameters` / `body` input containers;
1421
+ * `response` + `Error` outputs — plus the object's `executionType` (in the
1422
+ * context and in the metadata's configuration), `activityConfigurationVersion:
1423
+ * "v2"`, and the sync or async service type that execution type gives.
1424
+ */
1425
+ function externalTaskData(kind, spec, resolver, elementId, where) {
1416
1426
  if (!resolver.library)
1417
1427
  throw new Error(`${kind} task needs the connector library — pass { library } to serialize or use uip maestro case compile --library.`);
1418
1428
  const rc = resolver.library.resolve(spec.connector.key, spec.connector.action, spec.connector.version, spec.connector.object);
1419
1429
  const refused = externalDescriptorRefusal(kind, rc);
1420
1430
  if (refused)
1421
1431
  throw new Error(refused);
1422
- if (spec.mode !== 'sync' && spec.mode !== 'async')
1423
- throw new Error(`${kind} task mode must be "sync" or "async".`);
1424
- const target = { key: spec.connector.key, action: spec.connector.action };
1425
- const connection = bindingRef(resolver, spec.connector.connection, 'Connection', 'ConnectionId', `${rc.connectorKey} connection`, { attribute: 'connection', where, target });
1426
- const folder = folderBindingRef(resolver, spec.connector.folder, connection, { attribute: 'folder', where, target });
1427
- if (!connection || !folder)
1432
+ if (!isExternalExecutionMode(spec.mode))
1433
+ throw new Error(`${kind} task mode must be the connector object's executionType: "sync", "async" or "hybrid".`);
1434
+ if (spec.mode === 'hybrid')
1435
+ throw new Error(externalHybridRefusal(where));
1436
+ if (!spec.connector.connection || !spec.connector.folder)
1428
1437
  throw new Error(`${kind} task requires non-empty connection and folder binding names.`);
1429
- const serviceType = kind === 'external-agent'
1430
- ? (spec.mode === 'sync'
1431
- ? CASE_FORMAT_PROFILE.externalAgentSyncServiceType
1432
- : CASE_FORMAT_PROFILE.externalAgentAsyncServiceType)
1433
- : (spec.mode === 'sync'
1434
- ? CASE_FORMAT_PROFILE.externalWorkflowSyncServiceType
1435
- : CASE_FORMAT_PROFILE.externalWorkflowAsyncServiceType);
1436
- // The inputs: the shared validator every connector activity runs (unknown,
1437
- // missing required or mistyped input; a `lookup()` swapped for its recorded id,
1438
- // or refused). Case `check` reports the same through `connectorInputs`.
1439
- const fields = new Map(rc.fields.map((field) => [field.name, field]));
1440
- const slots = buildConnectorInputs(rc, spec.connector.inputs, {
1441
- dialect: EQUALS_EXPR_DIALECT,
1442
- resolutions: resolver.library.lookupResolutions,
1443
- lookups: resolver.library.lookupSpecs(spec.connector.key, spec.connector.action, spec.connector.version, spec.connector.object),
1444
- });
1445
- const resolved = {
1446
- ...slots.bodyParameters, ...slots.pathParameters, ...slots.queryParameters,
1447
- };
1448
- const responseVar = connectorOutputVar(resolver, 'response');
1449
- return {
1450
- serviceType,
1451
- context: [
1452
- io('activity', 'string', { value: rc.activityTypeId }),
1453
- io('connectorKey', 'string', { value: rc.connectorKey }),
1454
- io('connection', 'string', { value: `=bindings.${connection.id}` }),
1455
- io('folderKey', 'string', { value: `=bindings.${folder.id}` }),
1456
- io('method', 'string', { value: transportHttpMethod(rc.httpMethod) }),
1457
- io('path', 'string', { value: rc.endpoint }),
1458
- ],
1459
- inputs: Object.entries(spec.connector.inputs).map(([name, value]) => ({
1460
- id: name,
1461
- name,
1462
- type: jsonType(fields.get(name)?.type),
1463
- value: name in resolved ? resolved[name] : value,
1464
- target: name,
1465
- })),
1466
- outputs: [{
1467
- id: responseVar,
1468
- name: 'response',
1469
- type: 'json',
1470
- source: '.',
1471
- var: responseVar,
1472
- }],
1473
- bindings: [],
1474
- };
1438
+ const data = connectorTaskData(spec.connector, resolver, elementId, where, spec.mode);
1439
+ const context = data.context;
1440
+ const metadataAt = context.findIndex((row) => row.name === 'metadata');
1441
+ context.splice(metadataAt, 0, io('executionType', 'string', { value: spec.mode }));
1442
+ context.push(io('activityConfigurationVersion', 'string', { value: 'v2' }));
1443
+ return { ...data, serviceType: externalServiceType(kind, spec.mode) };
1475
1444
  }
1476
1445
  /** A context/output name/value entry (the caseplan `InputOutput` shape). */
1477
1446
  function io(name, type, extra) {
@@ -1579,7 +1548,7 @@ function folderBindingRef(resolver, name, connection, site) {
1579
1548
  /** The connector `metadata` json blob: the FUNCTIONAL essentialConfiguration +
1580
1549
  * activityTypeId. Designer cosmetics (packageId/activityColor/…) are omitted —
1581
1550
  * the caseplan schema-validates without them (see design §C). */
1582
- function connectorMetadata(rc, op) {
1551
+ function connectorMetadata(rc, op, executionType) {
1583
1552
  const instanceParameters = {
1584
1553
  connectorKey: rc.connectorKey,
1585
1554
  objectName: op.objectName ?? rc.nodeType.split('.').pop(),
@@ -1596,6 +1565,9 @@ function connectorMetadata(rc, op) {
1596
1565
  httpMethod: transportHttpMethod(rc.httpMethod),
1597
1566
  path: rc.endpoint,
1598
1567
  packageVersion: rc.version,
1568
+ // An external task's object states how it runs; the Designer saves it here
1569
+ // and beside the configuration. A plain connector activity has none.
1570
+ ...(executionType ? { executionType } : {}),
1599
1571
  },
1600
1572
  };
1601
1573
  return {
@@ -1603,6 +1575,7 @@ function connectorMetadata(rc, op) {
1603
1575
  configuration: `=jsonString:${JSON.stringify(configuration)}`,
1604
1576
  uiPathActivityTypeId: rc.activityTypeId ?? '',
1605
1577
  errorState: { issues: [] },
1578
+ ...(executionType ? { executionType } : {}),
1606
1579
  },
1607
1580
  activityMetadata: {
1608
1581
  activity: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.47.1",
3
+ "version": "6.47.3",
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",
@@ -93,5 +93,5 @@
93
93
  "@types/node": "^22.7.0",
94
94
  "esbuild": "^0.28.1"
95
95
  },
96
- "gitref": "05cde3ec95db903ec81d2df24fd4e60bade77a97"
96
+ "gitref": "fc36fa72238f803ed2de5a02dc8a42f6c5d3305d"
97
97
  }