@uipath/maestro-sdk 1.199.0 → 1.201.0-preview.115

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.
@@ -444,20 +444,24 @@ var bpmn_spec_default = {
444
444
  extensionTag: "uipath:activity",
445
445
  contextFields: [
446
446
  {
447
- name: "activity",
448
- displayName: "Activity",
447
+ name: "activityConfigurationVersion",
448
+ displayName: "Activity configuration version",
449
449
  type: "string",
450
- required: true,
451
- hidden: false,
452
- isPrimaryKey: true,
450
+ required: false,
451
+ hidden: true,
452
+ isPrimaryKey: false,
453
453
  binding: false,
454
- defaultValue: null
454
+ defaultValue: "v1",
455
+ enum: [
456
+ "v1"
457
+ ],
458
+ description: "Marks the Integration Service activity format used by this template"
455
459
  },
456
460
  {
457
461
  name: "connectorKey",
458
462
  displayName: "Connector key",
459
463
  type: "string",
460
- required: false,
464
+ required: true,
461
465
  hidden: true,
462
466
  isPrimaryKey: false,
463
467
  binding: false,
@@ -471,7 +475,12 @@ var bpmn_spec_default = {
471
475
  hidden: true,
472
476
  isPrimaryKey: false,
473
477
  binding: true,
474
- defaultValue: null
478
+ defaultValue: null,
479
+ bindingInfo: {
480
+ resource: "Connection",
481
+ resourceKeyPattern: "${resourceKey}",
482
+ propertyAttribute: "ConnectionId"
483
+ }
475
484
  },
476
485
  {
477
486
  name: "folderKey",
@@ -480,61 +489,105 @@ var bpmn_spec_default = {
480
489
  required: false,
481
490
  hidden: true,
482
491
  isPrimaryKey: false,
492
+ binding: true,
493
+ defaultValue: null,
494
+ bindingInfo: {
495
+ resource: "Connection",
496
+ resourceKeyPattern: "${resourceKey}",
497
+ propertyAttribute: "folderKey"
498
+ }
499
+ },
500
+ {
501
+ name: "operation",
502
+ displayName: "Operation",
503
+ type: "string",
504
+ required: true,
505
+ hidden: true,
506
+ isPrimaryKey: true,
483
507
  binding: false,
484
- defaultValue: null
508
+ defaultValue: null,
509
+ description: "Activity catalog Name used as the runtime operation"
510
+ },
511
+ {
512
+ name: "objectName",
513
+ displayName: "Object name",
514
+ type: "string",
515
+ required: true,
516
+ hidden: true,
517
+ isPrimaryKey: false,
518
+ binding: false,
519
+ defaultValue: null,
520
+ description: "Activity catalog ObjectName"
485
521
  },
486
522
  {
487
523
  name: "method",
488
524
  displayName: "Method",
489
525
  type: "string",
490
- required: false,
526
+ required: true,
491
527
  hidden: true,
492
528
  isPrimaryKey: false,
493
529
  binding: false,
494
- defaultValue: null
530
+ defaultValue: null,
531
+ description: "Activity catalog MethodName"
495
532
  },
496
533
  {
497
534
  name: "path",
498
535
  displayName: "Path",
499
536
  type: "string",
537
+ required: true,
538
+ hidden: true,
539
+ isPrimaryKey: false,
540
+ binding: false,
541
+ defaultValue: null,
542
+ description: "Request path returned by resource metadata"
543
+ },
544
+ {
545
+ name: "metadata",
546
+ displayName: "Metadata",
547
+ type: "json",
500
548
  required: false,
501
549
  hidden: true,
502
550
  isPrimaryKey: false,
503
551
  binding: false,
504
- defaultValue: null
552
+ defaultValue: {},
553
+ description: "Optional activity metadata"
505
554
  }
506
555
  ],
556
+ inputFields: [],
507
557
  inputPattern: "separateInputs",
508
558
  inputName: "body",
509
559
  inputTarget: "body",
510
- outputSource: ".",
511
- outputType: "custom",
512
- outputName: "result",
560
+ outputSource: "=response",
561
+ outputType: "jsonSchema",
562
+ outputName: "response",
513
563
  useRelativeSource: false,
514
564
  bindingPattern: "connection",
515
565
  requiresDiscovery: true,
516
566
  isDynamic: true,
517
- xmlTemplate: `<bpmn:SendTask id="{id}" name="{name}">
567
+ xmlTemplate: `<bpmn:sendTask id="{id}" name="{name}">
518
568
  <bpmn:extensionElements>
519
569
  <uipath:activity version="v1">
520
570
  <uipath:type value="Intsvc.ActivityExecution" version="v1" />
521
571
  <uipath:context>
522
- <uipath:input name="activity" value="{activity}" />
523
- <uipath:input name="connectorKey" value="{connectorKey}" />
524
- <uipath:input name="connection" value="=bindings.{bindingId}" />
525
- <uipath:input name="folderKey" value="{folderKey}" />
526
- <uipath:input name="method" value="{method}" />
527
- <uipath:input name="path" value="{path}" />
572
+ <uipath:input name="connectorKey" type="string" value="{connectorKey}" />
573
+ <uipath:input name="connection" type="string" value="=bindings.{connectionBindingId}" />
574
+ <uipath:input name="folderKey" type="string" value="=bindings.{folderBindingId}" />
575
+ <uipath:input name="operation" type="string" value="{operation}" />
576
+ <uipath:input name="objectName" type="string" value="{objectName}" />
577
+ <uipath:input name="method" type="string" value="{method}" />
578
+ <uipath:input name="path" type="string" value="{path}" />
579
+ <uipath:input name="activityConfigurationVersion" type="string" value="v1" />
580
+ <uipath:input name="metadata" type="json"><![CDATA[{}]]></uipath:input>
528
581
  </uipath:context>
529
- <uipath:input name="body" type="json" target="body"><![CDATA[{}]]></uipath:input>
530
- <uipath:output name="result" type="custom" source="." var="{varId}" />
582
+ <uipath:output name="response" type="jsonSchema" source="=response" var="{varId}" />
531
583
  </uipath:activity>
532
584
  </bpmn:extensionElements>
533
585
  <bpmn:incoming>{incomingEdge}</bpmn:incoming>
534
586
  <bpmn:outgoing>{outgoingEdge}</bpmn:outgoing>
535
- </bpmn:SendTask>`,
536
- discoveryNotes: "Uses getConnectorConnections(connectorKey) to list available connections. Activity/connector metadata comes from Integration Service catalog.",
537
- inputNotes: "isSplitInputs=false in design schema; inputs are sent as separate <uipath:input> elements, not merged into a single JSON body",
587
+ </bpmn:sendTask>`,
588
+ discoveryNotes: "Use `uip is activities list <connector-key> --output json` to select an activity. Set operation from Name, then describe ObjectName to get its current path, parameters, and fields.",
589
+ inputNotes: "Add each request field from the selected operation as its own uipath:input. Keep the field's type and target: path, query, body, or file.",
590
+ contextFieldNotes: "connection points to a root binding for a Connection resource. When folder scoping is required, folderKey points to a second binding for the same resourceKey. Use propertyAttribute ConnectionId for connection and folderKey for folderKey. Omit folderKey when the selected activity has no folder scoping, and omit both fields only when it does not use a connection.",
538
591
  extensionTagNotes: "In isExecution array, NOT in isEvents array, so uses uipath:activity"
539
592
  },
540
593
  "Intsvc.HttpExecution": {
@@ -2995,10 +3048,18 @@ var SUPPORTED_UIPATH_EXTENSION_TAG_NAMES = Object.freeze([
2995
3048
  ].sort());
2996
3049
  var SUPPORTED_UIPATH_EXTENSION_TAGS = Object.freeze(SUPPORTED_UIPATH_EXTENSION_TAG_NAMES.map((tag) => `uipath:${tag}`));
2997
3050
 
3051
+ // ../common/src/guid.ts
3052
+ var GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
3053
+ function isGuid(value) {
3054
+ return GUID_REGEX.test(value);
3055
+ }
3056
+
2998
3057
  // src/bpmn-validation/project-validator.ts
2999
3058
  var KNOWN_UIPATH_TAGS = new Set(SUPPORTED_UIPATH_EXTENSION_TAGS);
3000
3059
  var SEMANTIC_VALIDATION_ERROR = "BPMN_VALIDATION_ERROR";
3001
3060
  var BPMN_MODEL_NAMESPACE = "http://www.omg.org/spec/BPMN/20100524/MODEL";
3061
+ var ACTIVITY_CONFIGURATION_VERSION = "activityConfigurationVersion";
3062
+ var ACTIVITY_CONFIGURATION_V1 = "v1";
3002
3063
 
3003
3064
  class BpmnValidateService {
3004
3065
  fileSystem;
@@ -3102,11 +3163,30 @@ class BpmnValidateService {
3102
3163
  instruction: "Add a bpmn:StartEvent to each process."
3103
3164
  });
3104
3165
  }
3166
+ this.validateRootEntryPointIds(file, process, diagnostics);
3105
3167
  }
3106
3168
  const availableBindings = new Map(bindings);
3107
3169
  collectInlineBindings(definitions, availableBindings);
3108
3170
  this.validateUiPathTags(file, definitions, availableBindings, diagnostics);
3109
3171
  }
3172
+ validateRootEntryPointIds(file, process, diagnostics) {
3173
+ const rootStartEvents = findChildren(process, (node) => hasLocalName(node, "startEvent"));
3174
+ for (const startEvent of rootStartEvents) {
3175
+ const entryPointIds = findDescendants(startEvent, (node) => node.name === "uipath:entryPointId");
3176
+ for (const entryPointId of entryPointIds) {
3177
+ const value = entryPointId.attributes.value ?? "";
3178
+ if (isGuid(value)) {
3179
+ continue;
3180
+ }
3181
+ diagnostics.push({
3182
+ file,
3183
+ element: describeElement(startEvent),
3184
+ message: `Root start event uipath:entryPointId value "${value}" must be a GUID.`,
3185
+ instruction: "Set uipath:entryPointId value to a GUID and use the same value for the matching entry-points.json uniqueId."
3186
+ });
3187
+ }
3188
+ }
3189
+ }
3110
3190
  validateUiPathTags(file, root, bindings, diagnostics) {
3111
3191
  const uipathNodes = findDescendants(root, (node) => node.name.startsWith("uipath:"));
3112
3192
  for (const node of uipathNodes) {
@@ -3120,12 +3200,25 @@ class BpmnValidateService {
3120
3200
  });
3121
3201
  }
3122
3202
  }
3203
+ for (const loopCharacteristics of uipathNodes.filter((node) => node.name === "uipath:loopCharacteristics")) {
3204
+ const extensionElements = loopCharacteristics.parent;
3205
+ const owner = extensionElements && hasLocalName(extensionElements, "extensionElements") ? extensionElements.parent : undefined;
3206
+ if (owner && hasLocalName(owner, "multiInstanceLoopCharacteristics")) {
3207
+ continue;
3208
+ }
3209
+ diagnostics.push({
3210
+ file,
3211
+ element: describeElement(loopCharacteristics),
3212
+ message: "uipath:loopCharacteristics must be nested under bpmn:multiInstanceLoopCharacteristics.",
3213
+ instruction: "Move it into bpmn:multiInstanceLoopCharacteristics/bpmn:extensionElements and remove any copy from the activity's extensionElements."
3214
+ });
3215
+ }
3123
3216
  const payloads = uipathNodes.filter((node) => ["uipath:activity", "uipath:event", "uipath:mapping"].includes(node.name));
3124
3217
  for (const payload of payloads) {
3125
- this.validatePayload(file, payload, bindings, diagnostics);
3218
+ this.validatePayload(file, payload, bindings, getOwningProcessActivityConfigurationVersion(payload), diagnostics);
3126
3219
  }
3127
3220
  }
3128
- validatePayload(file, payload, bindings, diagnostics) {
3221
+ validatePayload(file, payload, bindings, workflowActivityConfigurationVersion, diagnostics) {
3129
3222
  const owner = findBpmnOwner(payload);
3130
3223
  if (!owner) {
3131
3224
  diagnostics.push({
@@ -3187,7 +3280,11 @@ class BpmnValidateService {
3187
3280
  return;
3188
3281
  }
3189
3282
  this.validateContractPlacement(file, payload, owner, contract, diagnostics);
3190
- this.validateContext(file, payload, owner, contract, diagnostics);
3283
+ const isActivityExecutionV1 = extensionType === "Intsvc.ActivityExecution" && isIntsvcActivityExecutionV1(getContextInputs(payload).find((input) => input.attributes.name === ACTIVITY_CONFIGURATION_VERSION)?.attributes.value, workflowActivityConfigurationVersion);
3284
+ this.validateContext(file, payload, owner, contract, isActivityExecutionV1, diagnostics);
3285
+ if (isActivityExecutionV1) {
3286
+ this.validateActivityExecutionV1Bindings(file, payload, owner, bindings, diagnostics);
3287
+ }
3191
3288
  if (contract.extensionType === "Orchestrator.StartAgentJob") {
3192
3289
  this.validateStartAgentJobBindings(file, payload, owner, bindings, diagnostics);
3193
3290
  }
@@ -3214,24 +3311,33 @@ class BpmnValidateService {
3214
3311
  });
3215
3312
  }
3216
3313
  }
3217
- validateContext(file, payload, owner, contract, diagnostics) {
3218
- const contexts = childElements(payload, "uipath:context");
3219
- const contextInputs = contexts.flatMap((context) => childElements(context, "uipath:input"));
3314
+ validateContext(file, payload, owner, contract, isActivityExecutionV1, diagnostics) {
3315
+ const contextInputs = getContextInputs(payload);
3220
3316
  const actual = new Map(contextInputs.map((input) => [input.attributes.name, input]));
3221
3317
  const fields = contract.contextFields ?? [];
3222
3318
  const allowDynamicPayloadShape = usesCanvasOwnedDynamicPayload(contract);
3223
3319
  const allowed = new Set(fields.map((field) => field.name));
3320
+ const requireDeclaredFields = !allowDynamicPayloadShape || isActivityExecutionV1;
3321
+ const contractLabel = isActivityExecutionV1 ? "Integration Service activity" : contract.extensionType;
3224
3322
  for (const field of fields) {
3225
3323
  const input = actual.get(field.name);
3226
- if (!allowDynamicPayloadShape && field.required && !hasAttributeValue(input, "value")) {
3324
+ if (requireDeclaredFields && field.required && !hasAttributeValue(input, "value")) {
3227
3325
  diagnostics.push({
3228
3326
  file,
3229
3327
  element: describeElement(owner),
3230
- message: `${contract.extensionType} is missing required context input "${field.name}".`,
3328
+ message: `${contractLabel} is missing required context input "${field.name}".`,
3231
3329
  instruction: `Add <uipath:input name="${field.name}" value="..." /> inside uipath:context.`
3232
3330
  });
3233
3331
  }
3234
3332
  if (input) {
3333
+ if (isActivityExecutionV1 && field.type === "string" && input.attributes.type !== "string") {
3334
+ diagnostics.push({
3335
+ file,
3336
+ element: describeElement(input),
3337
+ message: `${contractLabel} context input "${field.name}" must use type="string".`,
3338
+ instruction: 'Add type="string" to this context input.'
3339
+ });
3340
+ }
3235
3341
  validateTypedValue(file, input, field.type, input.attributes.value, `context input "${field.name}"`, diagnostics);
3236
3342
  }
3237
3343
  }
@@ -3254,6 +3360,77 @@ class BpmnValidateService {
3254
3360
  }
3255
3361
  }
3256
3362
  }
3363
+ validateActivityExecutionV1Bindings(file, payload, owner, bindings, diagnostics) {
3364
+ const contextByName = new Map(getContextInputs(payload).map((input) => [
3365
+ input.attributes.name,
3366
+ input
3367
+ ]));
3368
+ const bindingFields = [
3369
+ {
3370
+ contextName: "connection",
3371
+ propertyAttribute: "ConnectionId"
3372
+ },
3373
+ {
3374
+ contextName: "folderKey",
3375
+ propertyAttribute: "folderKey"
3376
+ }
3377
+ ];
3378
+ const resourceKeys = new Map;
3379
+ for (const field of bindingFields) {
3380
+ const contextInput = contextByName.get(field.contextName);
3381
+ if (!contextInput) {
3382
+ continue;
3383
+ }
3384
+ const value = contextInput.attributes.value?.trim() ?? "";
3385
+ if (!value) {
3386
+ continue;
3387
+ }
3388
+ if (!value.startsWith("=bindings.")) {
3389
+ diagnostics.push({
3390
+ file,
3391
+ element: describeElement(owner),
3392
+ message: `Integration Service activity context input "${field.contextName}" must reference a root binding.`,
3393
+ instruction: `Set ${field.contextName} to =bindings.<bindingId> and declare that binding with resource="Connection" and propertyAttribute="${field.propertyAttribute}".`
3394
+ });
3395
+ continue;
3396
+ }
3397
+ const bindingId = value.slice("=bindings.".length);
3398
+ const binding = bindings.get(bindingId);
3399
+ if (!binding) {
3400
+ continue;
3401
+ }
3402
+ const hasInvalidBindingShape = binding.resource !== "Connection" || binding.propertyAttribute !== field.propertyAttribute;
3403
+ if (hasInvalidBindingShape) {
3404
+ diagnostics.push({
3405
+ file,
3406
+ element: describeElement(owner),
3407
+ message: `Integration Service activity ${field.contextName} binding "${bindingId}" must use resource="Connection" and propertyAttribute="${field.propertyAttribute}".`,
3408
+ instruction: `Set resource="Connection" and propertyAttribute="${field.propertyAttribute}" on that binding.`
3409
+ });
3410
+ }
3411
+ const resourceKey = binding.resourceKey?.trim();
3412
+ if (!resourceKey) {
3413
+ diagnostics.push({
3414
+ file,
3415
+ element: describeElement(owner),
3416
+ message: `Integration Service activity ${field.contextName} binding "${bindingId}" is missing resourceKey.`,
3417
+ instruction: "Set resourceKey on that root binding."
3418
+ });
3419
+ } else if (!hasInvalidBindingShape) {
3420
+ resourceKeys.set(field.contextName, resourceKey);
3421
+ }
3422
+ }
3423
+ const connectionResourceKey = resourceKeys.get("connection");
3424
+ const folderResourceKey = resourceKeys.get("folderKey");
3425
+ if (connectionResourceKey && folderResourceKey && connectionResourceKey !== folderResourceKey) {
3426
+ diagnostics.push({
3427
+ file,
3428
+ element: describeElement(owner),
3429
+ message: "Integration Service activity connection and folder bindings refer to different connection resources.",
3430
+ instruction: "Set the same resourceKey on both root bindings."
3431
+ });
3432
+ }
3433
+ }
3257
3434
  validateInputs(file, payload, owner, contract, diagnostics) {
3258
3435
  const directInputs = childElements(payload, "uipath:input");
3259
3436
  const actual = new Map(directInputs.map((input) => [input.attributes.name, input]));
@@ -3702,6 +3879,24 @@ function findBpmnOwner(payload) {
3702
3879
  }
3703
3880
  return;
3704
3881
  }
3882
+ function getContextInputs(payload) {
3883
+ return childElements(payload, "uipath:context").flatMap((context) => childElements(context, "uipath:input"));
3884
+ }
3885
+ function isIntsvcActivityExecutionV1(nodeVersion, workflowVersion) {
3886
+ const version = nodeVersion ?? workflowVersion;
3887
+ return version === undefined || version === ACTIVITY_CONFIGURATION_V1;
3888
+ }
3889
+ function getOwningProcessActivityConfigurationVersion(payload) {
3890
+ let current = payload.parent;
3891
+ while (current && !hasLocalName(current, "process")) {
3892
+ current = current.parent;
3893
+ }
3894
+ if (!current) {
3895
+ return;
3896
+ }
3897
+ const extensionElements = findChildren(current, (node) => hasLocalName(node, "extensionElements"));
3898
+ return extensionElements.flatMap((node) => childElements(node, "uipath:intsvcActivityConfig")).at(0)?.attributes.version;
3899
+ }
3705
3900
  function describeElement(node) {
3706
3901
  const id = node.attributes.id ? `#${node.attributes.id}` : "";
3707
3902
  const name = node.attributes.name ? ` "${node.attributes.name}"` : "";
@@ -3823,6 +4018,7 @@ function collectInlineBindings(root, bindings) {
3823
4018
  bindings.set(id, {
3824
4019
  id,
3825
4020
  resource: binding.attributes.resource,
4021
+ resourceKey: binding.attributes.resourceKey,
3826
4022
  resourceSubType: binding.attributes.resourceSubType,
3827
4023
  propertyAttribute: binding.attributes.propertyAttribute
3828
4024
  });
@@ -3848,6 +4044,7 @@ function collectBindingRecords(value, bindings) {
3848
4044
  bindings.set(id, {
3849
4045
  id,
3850
4046
  resource: getStringField(value, "resource"),
4047
+ resourceKey: getStringField(value, "resourceKey"),
3851
4048
  resourceSubType: getStringField(value, "resourceSubType"),
3852
4049
  propertyAttribute: getStringField(value, "propertyAttribute")
3853
4050
  });
@@ -3877,7 +4074,8 @@ function decodeXmlEntities(value) {
3877
4074
  return value.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
3878
4075
  }
3879
4076
  export {
4077
+ isIntsvcActivityExecutionV1,
3880
4078
  BpmnValidateService
3881
4079
  };
3882
4080
 
3883
- //# debugId=DE15716967BCD42764756E2164756E21
4081
+ //# debugId=13E65BAAC441571B64756E2164756E21