@uipath/maestro-sdk 1.200.0-preview.109 → 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.
@@ -6391,20 +6391,24 @@ var bpmn_spec_default = {
6391
6391
  extensionTag: "uipath:activity",
6392
6392
  contextFields: [
6393
6393
  {
6394
- name: "activity",
6395
- displayName: "Activity",
6394
+ name: "activityConfigurationVersion",
6395
+ displayName: "Activity configuration version",
6396
6396
  type: "string",
6397
- required: true,
6398
- hidden: false,
6399
- isPrimaryKey: true,
6397
+ required: false,
6398
+ hidden: true,
6399
+ isPrimaryKey: false,
6400
6400
  binding: false,
6401
- defaultValue: null
6401
+ defaultValue: "v1",
6402
+ enum: [
6403
+ "v1"
6404
+ ],
6405
+ description: "Marks the Integration Service activity format used by this template"
6402
6406
  },
6403
6407
  {
6404
6408
  name: "connectorKey",
6405
6409
  displayName: "Connector key",
6406
6410
  type: "string",
6407
- required: false,
6411
+ required: true,
6408
6412
  hidden: true,
6409
6413
  isPrimaryKey: false,
6410
6414
  binding: false,
@@ -6418,7 +6422,12 @@ var bpmn_spec_default = {
6418
6422
  hidden: true,
6419
6423
  isPrimaryKey: false,
6420
6424
  binding: true,
6421
- defaultValue: null
6425
+ defaultValue: null,
6426
+ bindingInfo: {
6427
+ resource: "Connection",
6428
+ resourceKeyPattern: "${resourceKey}",
6429
+ propertyAttribute: "ConnectionId"
6430
+ }
6422
6431
  },
6423
6432
  {
6424
6433
  name: "folderKey",
@@ -6427,61 +6436,105 @@ var bpmn_spec_default = {
6427
6436
  required: false,
6428
6437
  hidden: true,
6429
6438
  isPrimaryKey: false,
6439
+ binding: true,
6440
+ defaultValue: null,
6441
+ bindingInfo: {
6442
+ resource: "Connection",
6443
+ resourceKeyPattern: "${resourceKey}",
6444
+ propertyAttribute: "folderKey"
6445
+ }
6446
+ },
6447
+ {
6448
+ name: "operation",
6449
+ displayName: "Operation",
6450
+ type: "string",
6451
+ required: true,
6452
+ hidden: true,
6453
+ isPrimaryKey: true,
6430
6454
  binding: false,
6431
- defaultValue: null
6455
+ defaultValue: null,
6456
+ description: "Activity catalog Name used as the runtime operation"
6457
+ },
6458
+ {
6459
+ name: "objectName",
6460
+ displayName: "Object name",
6461
+ type: "string",
6462
+ required: true,
6463
+ hidden: true,
6464
+ isPrimaryKey: false,
6465
+ binding: false,
6466
+ defaultValue: null,
6467
+ description: "Activity catalog ObjectName"
6432
6468
  },
6433
6469
  {
6434
6470
  name: "method",
6435
6471
  displayName: "Method",
6436
6472
  type: "string",
6437
- required: false,
6473
+ required: true,
6438
6474
  hidden: true,
6439
6475
  isPrimaryKey: false,
6440
6476
  binding: false,
6441
- defaultValue: null
6477
+ defaultValue: null,
6478
+ description: "Activity catalog MethodName"
6442
6479
  },
6443
6480
  {
6444
6481
  name: "path",
6445
6482
  displayName: "Path",
6446
6483
  type: "string",
6484
+ required: true,
6485
+ hidden: true,
6486
+ isPrimaryKey: false,
6487
+ binding: false,
6488
+ defaultValue: null,
6489
+ description: "Request path returned by resource metadata"
6490
+ },
6491
+ {
6492
+ name: "metadata",
6493
+ displayName: "Metadata",
6494
+ type: "json",
6447
6495
  required: false,
6448
6496
  hidden: true,
6449
6497
  isPrimaryKey: false,
6450
6498
  binding: false,
6451
- defaultValue: null
6499
+ defaultValue: {},
6500
+ description: "Optional activity metadata"
6452
6501
  }
6453
6502
  ],
6503
+ inputFields: [],
6454
6504
  inputPattern: "separateInputs",
6455
6505
  inputName: "body",
6456
6506
  inputTarget: "body",
6457
- outputSource: ".",
6458
- outputType: "custom",
6459
- outputName: "result",
6507
+ outputSource: "=response",
6508
+ outputType: "jsonSchema",
6509
+ outputName: "response",
6460
6510
  useRelativeSource: false,
6461
6511
  bindingPattern: "connection",
6462
6512
  requiresDiscovery: true,
6463
6513
  isDynamic: true,
6464
- xmlTemplate: `<bpmn:SendTask id="{id}" name="{name}">
6514
+ xmlTemplate: `<bpmn:sendTask id="{id}" name="{name}">
6465
6515
  <bpmn:extensionElements>
6466
6516
  <uipath:activity version="v1">
6467
6517
  <uipath:type value="Intsvc.ActivityExecution" version="v1" />
6468
6518
  <uipath:context>
6469
- <uipath:input name="activity" value="{activity}" />
6470
- <uipath:input name="connectorKey" value="{connectorKey}" />
6471
- <uipath:input name="connection" value="=bindings.{bindingId}" />
6472
- <uipath:input name="folderKey" value="{folderKey}" />
6473
- <uipath:input name="method" value="{method}" />
6474
- <uipath:input name="path" value="{path}" />
6519
+ <uipath:input name="connectorKey" type="string" value="{connectorKey}" />
6520
+ <uipath:input name="connection" type="string" value="=bindings.{connectionBindingId}" />
6521
+ <uipath:input name="folderKey" type="string" value="=bindings.{folderBindingId}" />
6522
+ <uipath:input name="operation" type="string" value="{operation}" />
6523
+ <uipath:input name="objectName" type="string" value="{objectName}" />
6524
+ <uipath:input name="method" type="string" value="{method}" />
6525
+ <uipath:input name="path" type="string" value="{path}" />
6526
+ <uipath:input name="activityConfigurationVersion" type="string" value="v1" />
6527
+ <uipath:input name="metadata" type="json"><![CDATA[{}]]></uipath:input>
6475
6528
  </uipath:context>
6476
- <uipath:input name="body" type="json" target="body"><![CDATA[{}]]></uipath:input>
6477
- <uipath:output name="result" type="custom" source="." var="{varId}" />
6529
+ <uipath:output name="response" type="jsonSchema" source="=response" var="{varId}" />
6478
6530
  </uipath:activity>
6479
6531
  </bpmn:extensionElements>
6480
6532
  <bpmn:incoming>{incomingEdge}</bpmn:incoming>
6481
6533
  <bpmn:outgoing>{outgoingEdge}</bpmn:outgoing>
6482
- </bpmn:SendTask>`,
6483
- discoveryNotes: "Uses getConnectorConnections(connectorKey) to list available connections. Activity/connector metadata comes from Integration Service catalog.",
6484
- inputNotes: "isSplitInputs=false in design schema; inputs are sent as separate <uipath:input> elements, not merged into a single JSON body",
6534
+ </bpmn:sendTask>`,
6535
+ 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.",
6536
+ 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.",
6537
+ 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.",
6485
6538
  extensionTagNotes: "In isExecution array, NOT in isEvents array, so uses uipath:activity"
6486
6539
  },
6487
6540
  "Intsvc.HttpExecution": {
@@ -14970,13 +15023,14 @@ function mapUiPathActivity(actEl) {
14970
15023
  const uipath = {};
14971
15024
  uipath.serviceType = typeof actEl.type === "string" ? actEl.type : actEl.type?.value;
14972
15025
  uipath.version = (typeof actEl.type === "string" ? undefined : actEl.type?.version) ?? actEl.version ?? "v1";
15026
+ uipath.skipCondition = actEl.skipCondition;
14973
15027
  const mapRequired = (f) => f.required === "true" || f.required === true ? true : undefined;
14974
15028
  const mapInput = (i) => ({
14975
15029
  name: i.name,
14976
15030
  displayName: i.displayName,
14977
15031
  type: i.type,
14978
15032
  subType: i.subType,
14979
- value: i.value,
15033
+ value: i.value ?? i.body,
14980
15034
  target: i.target,
14981
15035
  body: i.body,
14982
15036
  required: mapRequired(i)
@@ -15019,7 +15073,8 @@ function mapVariables(varsEl) {
15019
15073
  subType: v.subType,
15020
15074
  canonicalId: v.canonicalId,
15021
15075
  elementId: v.elementId,
15022
- default: v.default
15076
+ default: v.default,
15077
+ body: v.body
15023
15078
  });
15024
15079
  return {
15025
15080
  inputs: (varsEl.input ?? []).map(map),
@@ -16683,6 +16738,140 @@ function validateMethodParentheses(allNodesList, allEdgesList) {
16683
16738
  }
16684
16739
  return errors;
16685
16740
  }
16741
+ function expressionStrings(value) {
16742
+ const trimmed = value.trim();
16743
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) {
16744
+ return [value];
16745
+ }
16746
+ try {
16747
+ return collectExpressionsFromObject(JSON.parse(trimmed));
16748
+ } catch {
16749
+ return [value];
16750
+ }
16751
+ }
16752
+ function isInsideQuotedText(value, index) {
16753
+ let quote;
16754
+ for (let i = 0;i < index; i++) {
16755
+ const char = value[i];
16756
+ if (char === "\\") {
16757
+ if (quote)
16758
+ i++;
16759
+ continue;
16760
+ }
16761
+ if (quote) {
16762
+ if (char === quote)
16763
+ quote = undefined;
16764
+ continue;
16765
+ }
16766
+ if (char === '"' || char === "'" || char === "`")
16767
+ quote = char;
16768
+ }
16769
+ return quote !== undefined;
16770
+ }
16771
+ function directCollectionLengthAlias(expression, collectionAliases) {
16772
+ const trimmed = expression.trimStart();
16773
+ if (!trimmed.startsWith("=") || trimmed.startsWith("=js:")) {
16774
+ return;
16775
+ }
16776
+ for (const match2 of trimmed.matchAll(VAR_REFS_REGEX)) {
16777
+ if (match2[2] !== "vars")
16778
+ continue;
16779
+ const start = (match2.index ?? 0) + (match2[1]?.length ?? 0);
16780
+ if (isInsideQuotedText(trimmed, start))
16781
+ continue;
16782
+ const end = (match2.index ?? 0) + match2[0].length;
16783
+ if (!/^\.length\b/.test(trimmed.slice(end)))
16784
+ continue;
16785
+ const alias = match2[3] ?? match2[4];
16786
+ if (alias && collectionAliases.has(alias))
16787
+ return alias;
16788
+ }
16789
+ return;
16790
+ }
16791
+ function unambiguousCollectionAliases(allNodesList, canvasState) {
16792
+ const declarations = new Map;
16793
+ const owners = [
16794
+ canvasState.root,
16795
+ ...allNodesList.filter((node) => node.id !== canvasState.root.id)
16796
+ ];
16797
+ for (const owner of owners) {
16798
+ const groups = owner.data?.uipath?.variables;
16799
+ const variables = [
16800
+ ...groups?.inputs ?? [],
16801
+ ...groups?.inputOutputs ?? [],
16802
+ ...groups?.outputs ?? []
16803
+ ];
16804
+ for (const variable of variables) {
16805
+ const aliases = new Set([variable.id, variable.name, variable.canonicalId].filter((alias) => Boolean(alias)));
16806
+ for (const alias of aliases) {
16807
+ declarations.set(alias, [
16808
+ ...declarations.get(alias) ?? [],
16809
+ variable
16810
+ ]);
16811
+ }
16812
+ }
16813
+ }
16814
+ return new Set([...declarations.entries()].filter(([, variables]) => variables.length === 1 && variables[0] !== undefined && isCollectionVariable(variables[0])).map(([alias]) => alias));
16815
+ }
16816
+ function isCollectionVariable(variable) {
16817
+ const type = variable.type?.trim().toLowerCase();
16818
+ if (type === "array")
16819
+ return true;
16820
+ if (type !== "jsonschema" && type !== "json")
16821
+ return false;
16822
+ let schema = variable.body;
16823
+ if (typeof schema === "string" && schema.trim()) {
16824
+ try {
16825
+ schema = JSON.parse(schema);
16826
+ } catch {
16827
+ return false;
16828
+ }
16829
+ }
16830
+ if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
16831
+ return false;
16832
+ }
16833
+ const schemaType = schema.type;
16834
+ if (schemaType === "array")
16835
+ return true;
16836
+ return Array.isArray(schemaType) && schemaType.includes("array") && schemaType.every((member) => member === "array" || member === "null");
16837
+ }
16838
+ function collectionLengthFinding(expression, elementId, aliases, extra = {}) {
16839
+ const alias = directCollectionLengthAlias(expression, aliases);
16840
+ if (!alias)
16841
+ return;
16842
+ return {
16843
+ code: "COLLECTION_LENGTH_NOT_SUPPORTED",
16844
+ message: `Collection variable '${alias}' uses JavaScript '.length' with the standard '=' expression prefix. Use '.Count' or '.Length', or use '=js:' with '.length'.`,
16845
+ severity: SEVERITY.ERROR,
16846
+ elementId,
16847
+ ...extra
16848
+ };
16849
+ }
16850
+ function validateCollectionLengthExpressions(allNodesList, allEdgesList, canvasState) {
16851
+ const findings = [];
16852
+ const aliases = unambiguousCollectionAliases(allNodesList, canvasState);
16853
+ for (const edge of allEdgesList) {
16854
+ const finding = collectionLengthFinding(edge.data?.conditionExpression ?? "", edge.id, aliases, { sourceId: edge.source, targetId: edge.target });
16855
+ if (finding)
16856
+ findings.push(finding);
16857
+ }
16858
+ for (const node of allNodesList) {
16859
+ const uipath = node.data?.uipath;
16860
+ if (!uipath)
16861
+ continue;
16862
+ const expressions = new Set([
16863
+ ...varExpressionsForNode(uipath),
16864
+ ...uipath.skipCondition ? [uipath.skipCondition] : [],
16865
+ ...(uipath.errorMapping ?? []).flatMap((mapping) => mapping.condition ? [mapping.condition] : [])
16866
+ ].flatMap(expressionStrings));
16867
+ for (const expression of expressions) {
16868
+ const finding = collectionLengthFinding(expression, node.id, aliases);
16869
+ if (finding)
16870
+ findings.push(finding);
16871
+ }
16872
+ }
16873
+ return findings;
16874
+ }
16686
16875
  var SERVICE_TYPES_WITH_INPUT_TYPE_VALIDATION = new Set([
16687
16876
  "Orchestrator.StartAgentJob"
16688
16877
  ]);
@@ -17069,7 +17258,7 @@ function fieldExpressions(fields) {
17069
17258
  const exprs = [];
17070
17259
  if (typeof field.value === "string")
17071
17260
  exprs.push(field.value);
17072
- if (field.body != null) {
17261
+ if (field.body != null && field.body !== field.value) {
17073
17262
  exprs.push(...collectExpressionsFromObject(field.body));
17074
17263
  }
17075
17264
  return exprs;
@@ -17203,6 +17392,7 @@ var RULE_CODES = [
17203
17392
  "EVENT_OBJECT_EMPTY_REQUIRED_FIELD",
17204
17393
  "EVENT_OBJECT_DUPLICATE_FIELD",
17205
17394
  "METHOD_MISSING_PARENTHESES",
17395
+ "COLLECTION_LENGTH_NOT_SUPPORTED",
17206
17396
  "INPUT_TYPE_MISMATCH"
17207
17397
  ];
17208
17398
  // src/bpmn-validation/canvas/uipath-moddle.v1.json
@@ -18108,6 +18298,7 @@ async function validateBpmnCanvas(xml2) {
18108
18298
  findings.push(...validateVariableExistence(allNodes(canvasState), allEdges(canvasState), knownIds));
18109
18299
  findings.push(...validateVariableNotSet(allNodes(canvasState), allEdges(canvasState), knownIds, canvasState));
18110
18300
  findings.push(...validateMethodParentheses(allNodes(canvasState), allEdges(canvasState)));
18301
+ findings.push(...validateCollectionLengthExpressions(allNodes(canvasState), allEdges(canvasState), canvasState));
18111
18302
  findings.push(...validateInputTypeMismatch(allNodes(canvasState)));
18112
18303
  findings.push(...validateEventObjectFields(canvasState));
18113
18304
  return { findings, parseWarnings };
@@ -18120,4 +18311,4 @@ export {
18120
18311
  BPMN_PARSE_ERROR
18121
18312
  };
18122
18313
 
18123
- //# debugId=E0AAB5D8A220564764756E2164756E21
18314
+ //# debugId=EF38BCF3F1B19DE264756E2164756E21