@uipath/maestro-sdk 1.207.0-preview.328 → 1.207.0-preview.330

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.
@@ -10802,6 +10802,16 @@ var SCRIPT_RUNTIME_GLOBALS = new Set([
10802
10802
  "arguments",
10803
10803
  ...JINT_GLOBALS
10804
10804
  ]);
10805
+ var SCRIPT_ENVELOPE_NAMES = new Set(["vars", "metadata"]);
10806
+ var NON_BODY_INPUT_TARGETS = new Set([
10807
+ "bodyField",
10808
+ "header",
10809
+ "path",
10810
+ "query",
10811
+ "file",
10812
+ "pathParameters",
10813
+ "queryParameters"
10814
+ ]);
10805
10815
  var KNOWN_UIPATH_TAGS = new Set(SUPPORTED_UIPATH_EXTENSION_TAGS);
10806
10816
  var SCRIPT_TASK_INPUT_CONTRACT = {
10807
10817
  ...BPMN_SPEC.extensionTypes["BPMN.ScriptTask"],
@@ -17433,4 +17443,4 @@ export {
17433
17443
  required
17434
17444
  };
17435
17445
 
17436
- //# debugId=1959DC5612DC06EF64756E2164756E21
17446
+ //# debugId=13A94A9AF7D79B9564756E2164756E21
@@ -11251,6 +11251,20 @@ var SCRIPT_RUNTIME_GLOBALS = new Set([
11251
11251
  "arguments",
11252
11252
  ...JINT_GLOBALS
11253
11253
  ]);
11254
+ var SCRIPT_ENVELOPE_NAMES = new Set(["vars", "metadata"]);
11255
+ var SCRIPT_TASK_EXTENSION_TYPE = "BPMN.ScriptTask";
11256
+ var SCRIPT_TYPE_SKIPS_SCRIPT = "SCRIPT_TYPE_SKIPS_SCRIPT";
11257
+ var SCRIPT_ARGS_ENVELOPE_MISSING = "SCRIPT_ARGS_ENVELOPE_MISSING";
11258
+ var MULTIPLE_BODY_INPUTS = "MULTIPLE_BODY_INPUTS";
11259
+ var NON_BODY_INPUT_TARGETS = new Set([
11260
+ "bodyField",
11261
+ "header",
11262
+ "path",
11263
+ "query",
11264
+ "file",
11265
+ "pathParameters",
11266
+ "queryParameters"
11267
+ ]);
11254
11268
  function parseScriptBody(body) {
11255
11269
  const [error, program] = catchError(() => parse(body, {
11256
11270
  ecmaVersion: "latest",
@@ -11261,7 +11275,7 @@ function parseScriptBody(body) {
11261
11275
  }
11262
11276
  function scriptArgsKeys(scriptTask) {
11263
11277
  const argsInput = findDescendants(scriptTask, (node) => node.name === "uipath:input" && node.attributes.name === "args")[0];
11264
- const body = argsInput?.text.trim();
11278
+ const body = engineInputValue(argsInput)?.trim();
11265
11279
  if (!body) {
11266
11280
  return new Set;
11267
11281
  }
@@ -11274,6 +11288,41 @@ function scriptArgsKeys(scriptTask) {
11274
11288
  }
11275
11289
  return new Set(Object.keys(parsed));
11276
11290
  }
11291
+ function engineInputValue(input) {
11292
+ return input?.cdata ?? input?.attributes.value;
11293
+ }
11294
+ function hasPlainTextArgs(scriptTask) {
11295
+ const argsInput = findDescendants(scriptTask, (node) => node.name === "uipath:input" && node.attributes.name === "args")[0];
11296
+ return argsInput !== undefined && engineInputValue(argsInput) === undefined && argsInput.text.trim() !== "";
11297
+ }
11298
+ function scriptVersionNumber(scriptTask) {
11299
+ const value = findDescendants(scriptTask, (node) => node.name === "uipath:scriptVersion")[0]?.attributes.value;
11300
+ const versionMatch = /^v(\d+)$/i.exec(value ?? "");
11301
+ return versionMatch ? Number(versionMatch[1]) : 1;
11302
+ }
11303
+ function scriptBody(scriptTask) {
11304
+ return findDescendants(scriptTask, (node) => hasLocalName(node, "script"))[0]?.text?.trim();
11305
+ }
11306
+ function typeofGuardedNames(program) {
11307
+ const guarded = new Set;
11308
+ const visit = (node) => {
11309
+ if (!node || typeof node !== "object") {
11310
+ return;
11311
+ }
11312
+ if (Array.isArray(node)) {
11313
+ node.forEach(visit);
11314
+ return;
11315
+ }
11316
+ const estree = node;
11317
+ const argument = estree.argument;
11318
+ if (estree.type === "UnaryExpression" && estree.operator === "typeof" && argument?.type === "Identifier") {
11319
+ guarded.add(argument.name);
11320
+ }
11321
+ Object.values(estree).forEach(visit);
11322
+ };
11323
+ visit(program);
11324
+ return guarded;
11325
+ }
11277
11326
  function isBindingTarget(node) {
11278
11327
  return node?.type === "Identifier" || node?.type === "ObjectPattern" || node?.type === "ArrayPattern";
11279
11328
  }
@@ -11623,8 +11672,27 @@ class BpmnValidateService {
11623
11672
  this.validateBareServiceTasks(file, definitions, diagnostics);
11624
11673
  this.validateScriptResponseWrapper(file, definitions, diagnostics);
11625
11674
  this.validateScriptTaskMigrationMarker(file, definitions, diagnostics);
11675
+ this.validateScriptTaskType(file, definitions, diagnostics);
11626
11676
  this.validateScriptBareVariables(file, definitions, diagnostics);
11627
11677
  }
11678
+ validateScriptTaskType(file, definitions, diagnostics) {
11679
+ for (const scriptTask of findDescendants(definitions, (node) => hasLocalName(node, "scriptTask"))) {
11680
+ if (!scriptBody(scriptTask)) {
11681
+ continue;
11682
+ }
11683
+ const skipsScript = findDescendants(scriptTask, (node) => node.name === "uipath:type").some((node) => node.attributes.value?.toLowerCase() === SCRIPT_TASK_EXTENSION_TYPE.toLowerCase());
11684
+ if (!skipsScript) {
11685
+ continue;
11686
+ }
11687
+ diagnostics.push({
11688
+ file,
11689
+ element: describeElement(scriptTask),
11690
+ ruleCode: SCRIPT_TYPE_SKIPS_SCRIPT,
11691
+ message: `Script task "${scriptTask.attributes.id ?? ""}" has uipath:type ${SCRIPT_TASK_EXTENSION_TYPE}, so the runtime skips its script: the task completes and every output reads back null.`,
11692
+ instruction: "Set the uipath:type value to BPMN.Variables and keep the args input and outputs."
11693
+ });
11694
+ }
11695
+ }
11628
11696
  validateScriptTaskMigrationMarker(file, definitions, diagnostics) {
11629
11697
  for (const processNode of findChildren(definitions, (node) => hasLocalName(node, "process"))) {
11630
11698
  const marker = findChildren(processNode, (node) => hasLocalName(node, "extensionElements")).flatMap((extensions) => childElements(extensions, "uipath:migrationVersion"))[0]?.attributes.version?.trim();
@@ -11634,8 +11702,7 @@ class BpmnValidateService {
11634
11702
  }
11635
11703
  for (const scriptTask of findDescendants(processNode, (node) => hasLocalName(node, "scriptTask"))) {
11636
11704
  const scriptVersion = findDescendants(scriptTask, (node) => node.name === "uipath:scriptVersion")[0]?.attributes.value;
11637
- const versionMatch = /^v(\d+)$/i.exec(scriptVersion ?? "");
11638
- if (!versionMatch || Number(versionMatch[1]) < 3) {
11705
+ if (scriptVersionNumber(scriptTask) < 3) {
11639
11706
  continue;
11640
11707
  }
11641
11708
  const hasScriptResponse = findDescendants(scriptTask, (node) => node.name === "uipath:output" && node.attributes.name === "scriptResponse").length > 0;
@@ -11893,14 +11960,11 @@ class BpmnValidateService {
11893
11960
  validateScriptResponseWrapper(file, root, diagnostics) {
11894
11961
  const scriptTasks = findDescendants(root, (node) => hasLocalName(node, "scriptTask"));
11895
11962
  for (const scriptTask of scriptTasks) {
11896
- const script = findDescendants(scriptTask, (node) => hasLocalName(node, "script"))[0];
11897
- const body = script?.text?.trim();
11963
+ const body = scriptBody(scriptTask);
11898
11964
  if (!body) {
11899
11965
  continue;
11900
11966
  }
11901
- const scriptVersion = findDescendants(scriptTask, (node) => node.name === "uipath:scriptVersion")[0]?.attributes.value ?? "v1";
11902
- const versionMatch = /^v(\d+)$/i.exec(scriptVersion);
11903
- if (!versionMatch || Number(versionMatch[1]) < 2) {
11967
+ if (scriptVersionNumber(scriptTask) < 2) {
11904
11968
  continue;
11905
11969
  }
11906
11970
  const program = parseScriptBody(body);
@@ -11953,8 +12017,7 @@ class BpmnValidateService {
11953
12017
  }
11954
12018
  validateScriptBareVariables(file, root, diagnostics) {
11955
12019
  for (const scriptTask of findDescendants(root, (node) => hasLocalName(node, "scriptTask"))) {
11956
- const scriptNode = findDescendants(scriptTask, (node) => hasLocalName(node, "script"))[0];
11957
- const body = scriptNode?.text?.trim();
12020
+ const body = scriptBody(scriptTask);
11958
12021
  if (!body) {
11959
12022
  continue;
11960
12023
  }
@@ -11963,7 +12026,19 @@ class BpmnValidateService {
11963
12026
  if (!provided || !program) {
11964
12027
  continue;
11965
12028
  }
11966
- const unresolved = [...collectFreeIdentifiers(program)].filter((name) => !SCRIPT_RUNTIME_GLOBALS.has(name) && !provided.has(name)).sort((a, b) => a.localeCompare(b));
12029
+ const allUnresolved = [...collectFreeIdentifiers(program)].filter((name) => !SCRIPT_RUNTIME_GLOBALS.has(name) && !provided.has(name)).sort((a, b) => a.localeCompare(b));
12030
+ const guarded = typeofGuardedNames(program);
12031
+ const unboundEnvelope = scriptVersionNumber(scriptTask) >= 2 ? allUnresolved.filter((name) => SCRIPT_ENVELOPE_NAMES.has(name) && !guarded.has(name)) : [];
12032
+ if (unboundEnvelope.length > 0) {
12033
+ diagnostics.push({
12034
+ file,
12035
+ element: describeElement(scriptTask),
12036
+ ruleCode: SCRIPT_ARGS_ENVELOPE_MISSING,
12037
+ message: `Script references ${unboundEnvelope.map((n) => `"${n}"`).join(", ")}, not provided by the script args envelope, so the run faults with a "not defined" error.`,
12038
+ instruction: hasPlainTextArgs(scriptTask) ? "The args input is a plain text node, and the engine reads only CDATA or the value attribute. Upgrade @uipath/maestro-builder-sdk to 6.47.3 or later and compile again, or wrap the args JSON in <![CDATA[...]]>." : 'Give the script task a BPMN.Variables uipath:mapping with <uipath:input name="args" type="json" target="bodyField"> holding {"vars":"=vars","metadata":"=metadata"}.'
12039
+ });
12040
+ }
12041
+ const unresolved = allUnresolved.filter((name) => !unboundEnvelope.includes(name));
11967
12042
  if (unresolved.length === 0) {
11968
12043
  continue;
11969
12044
  }
@@ -12343,6 +12418,9 @@ class BpmnValidateService {
12343
12418
  const directInputs = childElements(payload, "uipath:input");
12344
12419
  const actual = new Map(directInputs.map((input) => [input.attributes.name, input]));
12345
12420
  if (usesCanvasOwnedDynamicPayload(contract)) {
12421
+ if (payload.name === "uipath:activity") {
12422
+ this.validateSingleBodyInput(file, directInputs, owner, contract, diagnostics);
12423
+ }
12346
12424
  this.validateDynamicDirectInputs(file, directInputs, diagnostics);
12347
12425
  return;
12348
12426
  }
@@ -12497,6 +12575,24 @@ class BpmnValidateService {
12497
12575
  }
12498
12576
  validateTypedValue(file, actual, input.type, actual.text || actual.attributes.value, `input payload "${input.name}"`, diagnostics);
12499
12577
  }
12578
+ validateSingleBodyInput(file, directInputs, owner, contract, diagnostics) {
12579
+ const bodyInputs = directInputs.filter((input) => {
12580
+ const { name, type, target } = input.attributes;
12581
+ const hasValue = engineInputValue(input) !== undefined;
12582
+ return name !== undefined && type !== undefined && target !== undefined && hasValue && !NON_BODY_INPUT_TARGETS.has(target);
12583
+ });
12584
+ if (bodyInputs.length < 2) {
12585
+ return;
12586
+ }
12587
+ const names = bodyInputs.map((input) => `"${input.attributes.name ?? ""}"`).join(", ");
12588
+ diagnostics.push({
12589
+ file,
12590
+ element: describeElement(owner),
12591
+ ruleCode: MULTIPLE_BODY_INPUTS,
12592
+ message: `${contract.extensionType} has ${bodyInputs.length} inputs the runtime sends as the body (${names}). It keeps one body value, so only the last one is sent.`,
12593
+ instruction: 'Put every body field in one <uipath:input name="body" type="json" target="body"> holding the whole request object.'
12594
+ });
12595
+ }
12500
12596
  validateDynamicDirectInputs(file, directInputs, diagnostics) {
12501
12597
  for (const input of directInputs) {
12502
12598
  if (!hasAttributeValue(input, "name")) {
@@ -12921,7 +13017,9 @@ function parseXml(xml) {
12921
13017
  }
12922
13018
  const token = xml.slice(match.start, match.end);
12923
13019
  if (token.startsWith(CDATA_OPEN)) {
12924
- stack[stack.length - 1].text += match.cdata ?? "";
13020
+ const current = stack[stack.length - 1];
13021
+ current.text += match.cdata ?? "";
13022
+ current.cdata = (current.cdata ?? "") + (match.cdata ?? "");
12925
13023
  } else if (token.startsWith("</")) {
12926
13024
  const closeName = token.slice(2, -1).trim();
12927
13025
  if (stack.length <= 1) {
@@ -13529,4 +13627,4 @@ export {
13529
13627
  isIntsvcActivityExecutionV1
13530
13628
  };
13531
13629
 
13532
- //# debugId=9B199A072D7AD5BD64756E2164756E21
13630
+ //# debugId=D388432C4860B6DB64756E2164756E21
@@ -1121,7 +1121,7 @@ var init_package = __esm(() => {
1121
1121
  name: "@uipath/integrationservice-sdk",
1122
1122
  author: "UiPath",
1123
1123
  license: "SEE LICENSE IN LICENSE.txt",
1124
- version: "1.207.0-preview.328",
1124
+ version: "1.207.0-preview.330",
1125
1125
  repository: {
1126
1126
  type: "git",
1127
1127
  url: "https://github.com/UiPath/cli.git",
@@ -265184,4 +265184,4 @@ export {
265184
265184
  studioCatalogTypeCache
265185
265185
  };
265186
265186
 
265187
- //# debugId=FB2957E5ACAB3F3964756E2164756E21
265187
+ //# debugId=E3DE8ABBE19B92F464756E2164756E21
package/dist/index.js CHANGED
@@ -144975,7 +144975,7 @@ var init_package = __esm(() => {
144975
144975
  name: "@uipath/integrationservice-sdk",
144976
144976
  author: "UiPath",
144977
144977
  license: "SEE LICENSE IN LICENSE.txt",
144978
- version: "1.207.0-preview.328",
144978
+ version: "1.207.0-preview.330",
144979
144979
  repository: {
144980
144980
  type: "git",
144981
144981
  url: "https://github.com/UiPath/cli.git",
@@ -280975,6 +280975,20 @@ var SCRIPT_RUNTIME_GLOBALS = new Set([
280975
280975
  "arguments",
280976
280976
  ...JINT_GLOBALS
280977
280977
  ]);
280978
+ var SCRIPT_ENVELOPE_NAMES = new Set(["vars", "metadata"]);
280979
+ var SCRIPT_TASK_EXTENSION_TYPE = "BPMN.ScriptTask";
280980
+ var SCRIPT_TYPE_SKIPS_SCRIPT = "SCRIPT_TYPE_SKIPS_SCRIPT";
280981
+ var SCRIPT_ARGS_ENVELOPE_MISSING = "SCRIPT_ARGS_ENVELOPE_MISSING";
280982
+ var MULTIPLE_BODY_INPUTS = "MULTIPLE_BODY_INPUTS";
280983
+ var NON_BODY_INPUT_TARGETS = new Set([
280984
+ "bodyField",
280985
+ "header",
280986
+ "path",
280987
+ "query",
280988
+ "file",
280989
+ "pathParameters",
280990
+ "queryParameters"
280991
+ ]);
280978
280992
  function parseScriptBody(body) {
280979
280993
  const [error, program] = catchError(() => parse(body, {
280980
280994
  ecmaVersion: "latest",
@@ -280985,7 +280999,7 @@ function parseScriptBody(body) {
280985
280999
  }
280986
281000
  function scriptArgsKeys(scriptTask) {
280987
281001
  const argsInput = findDescendants(scriptTask, (node) => node.name === "uipath:input" && node.attributes.name === "args")[0];
280988
- const body = argsInput?.text.trim();
281002
+ const body = engineInputValue(argsInput)?.trim();
280989
281003
  if (!body) {
280990
281004
  return new Set;
280991
281005
  }
@@ -280998,6 +281012,41 @@ function scriptArgsKeys(scriptTask) {
280998
281012
  }
280999
281013
  return new Set(Object.keys(parsed));
281000
281014
  }
281015
+ function engineInputValue(input) {
281016
+ return input?.cdata ?? input?.attributes.value;
281017
+ }
281018
+ function hasPlainTextArgs(scriptTask) {
281019
+ const argsInput = findDescendants(scriptTask, (node) => node.name === "uipath:input" && node.attributes.name === "args")[0];
281020
+ return argsInput !== undefined && engineInputValue(argsInput) === undefined && argsInput.text.trim() !== "";
281021
+ }
281022
+ function scriptVersionNumber(scriptTask) {
281023
+ const value = findDescendants(scriptTask, (node) => node.name === "uipath:scriptVersion")[0]?.attributes.value;
281024
+ const versionMatch = /^v(\d+)$/i.exec(value ?? "");
281025
+ return versionMatch ? Number(versionMatch[1]) : 1;
281026
+ }
281027
+ function scriptBody(scriptTask) {
281028
+ return findDescendants(scriptTask, (node) => hasLocalName(node, "script"))[0]?.text?.trim();
281029
+ }
281030
+ function typeofGuardedNames(program) {
281031
+ const guarded = new Set;
281032
+ const visit = (node) => {
281033
+ if (!node || typeof node !== "object") {
281034
+ return;
281035
+ }
281036
+ if (Array.isArray(node)) {
281037
+ node.forEach(visit);
281038
+ return;
281039
+ }
281040
+ const estree = node;
281041
+ const argument = estree.argument;
281042
+ if (estree.type === "UnaryExpression" && estree.operator === "typeof" && argument?.type === "Identifier") {
281043
+ guarded.add(argument.name);
281044
+ }
281045
+ Object.values(estree).forEach(visit);
281046
+ };
281047
+ visit(program);
281048
+ return guarded;
281049
+ }
281001
281050
  function isBindingTarget(node) {
281002
281051
  return node?.type === "Identifier" || node?.type === "ObjectPattern" || node?.type === "ArrayPattern";
281003
281052
  }
@@ -281347,8 +281396,27 @@ class BpmnValidateService {
281347
281396
  this.validateBareServiceTasks(file, definitions, diagnostics);
281348
281397
  this.validateScriptResponseWrapper(file, definitions, diagnostics);
281349
281398
  this.validateScriptTaskMigrationMarker(file, definitions, diagnostics);
281399
+ this.validateScriptTaskType(file, definitions, diagnostics);
281350
281400
  this.validateScriptBareVariables(file, definitions, diagnostics);
281351
281401
  }
281402
+ validateScriptTaskType(file, definitions, diagnostics) {
281403
+ for (const scriptTask of findDescendants(definitions, (node) => hasLocalName(node, "scriptTask"))) {
281404
+ if (!scriptBody(scriptTask)) {
281405
+ continue;
281406
+ }
281407
+ const skipsScript = findDescendants(scriptTask, (node) => node.name === "uipath:type").some((node) => node.attributes.value?.toLowerCase() === SCRIPT_TASK_EXTENSION_TYPE.toLowerCase());
281408
+ if (!skipsScript) {
281409
+ continue;
281410
+ }
281411
+ diagnostics.push({
281412
+ file,
281413
+ element: describeElement(scriptTask),
281414
+ ruleCode: SCRIPT_TYPE_SKIPS_SCRIPT,
281415
+ message: `Script task "${scriptTask.attributes.id ?? ""}" has uipath:type ${SCRIPT_TASK_EXTENSION_TYPE}, so the runtime skips its script: the task completes and every output reads back null.`,
281416
+ instruction: "Set the uipath:type value to BPMN.Variables and keep the args input and outputs."
281417
+ });
281418
+ }
281419
+ }
281352
281420
  validateScriptTaskMigrationMarker(file, definitions, diagnostics) {
281353
281421
  for (const processNode of findChildren(definitions, (node) => hasLocalName(node, "process"))) {
281354
281422
  const marker = findChildren(processNode, (node) => hasLocalName(node, "extensionElements")).flatMap((extensions) => childElements(extensions, "uipath:migrationVersion"))[0]?.attributes.version?.trim();
@@ -281358,8 +281426,7 @@ class BpmnValidateService {
281358
281426
  }
281359
281427
  for (const scriptTask of findDescendants(processNode, (node) => hasLocalName(node, "scriptTask"))) {
281360
281428
  const scriptVersion = findDescendants(scriptTask, (node) => node.name === "uipath:scriptVersion")[0]?.attributes.value;
281361
- const versionMatch = /^v(\d+)$/i.exec(scriptVersion ?? "");
281362
- if (!versionMatch || Number(versionMatch[1]) < 3) {
281429
+ if (scriptVersionNumber(scriptTask) < 3) {
281363
281430
  continue;
281364
281431
  }
281365
281432
  const hasScriptResponse = findDescendants(scriptTask, (node) => node.name === "uipath:output" && node.attributes.name === "scriptResponse").length > 0;
@@ -281617,14 +281684,11 @@ class BpmnValidateService {
281617
281684
  validateScriptResponseWrapper(file, root, diagnostics) {
281618
281685
  const scriptTasks = findDescendants(root, (node) => hasLocalName(node, "scriptTask"));
281619
281686
  for (const scriptTask of scriptTasks) {
281620
- const script = findDescendants(scriptTask, (node) => hasLocalName(node, "script"))[0];
281621
- const body = script?.text?.trim();
281687
+ const body = scriptBody(scriptTask);
281622
281688
  if (!body) {
281623
281689
  continue;
281624
281690
  }
281625
- const scriptVersion = findDescendants(scriptTask, (node) => node.name === "uipath:scriptVersion")[0]?.attributes.value ?? "v1";
281626
- const versionMatch = /^v(\d+)$/i.exec(scriptVersion);
281627
- if (!versionMatch || Number(versionMatch[1]) < 2) {
281691
+ if (scriptVersionNumber(scriptTask) < 2) {
281628
281692
  continue;
281629
281693
  }
281630
281694
  const program = parseScriptBody(body);
@@ -281677,8 +281741,7 @@ class BpmnValidateService {
281677
281741
  }
281678
281742
  validateScriptBareVariables(file, root, diagnostics) {
281679
281743
  for (const scriptTask of findDescendants(root, (node) => hasLocalName(node, "scriptTask"))) {
281680
- const scriptNode = findDescendants(scriptTask, (node) => hasLocalName(node, "script"))[0];
281681
- const body = scriptNode?.text?.trim();
281744
+ const body = scriptBody(scriptTask);
281682
281745
  if (!body) {
281683
281746
  continue;
281684
281747
  }
@@ -281687,7 +281750,19 @@ class BpmnValidateService {
281687
281750
  if (!provided || !program) {
281688
281751
  continue;
281689
281752
  }
281690
- const unresolved = [...collectFreeIdentifiers(program)].filter((name) => !SCRIPT_RUNTIME_GLOBALS.has(name) && !provided.has(name)).sort((a, b) => a.localeCompare(b));
281753
+ const allUnresolved = [...collectFreeIdentifiers(program)].filter((name) => !SCRIPT_RUNTIME_GLOBALS.has(name) && !provided.has(name)).sort((a, b) => a.localeCompare(b));
281754
+ const guarded = typeofGuardedNames(program);
281755
+ const unboundEnvelope = scriptVersionNumber(scriptTask) >= 2 ? allUnresolved.filter((name) => SCRIPT_ENVELOPE_NAMES.has(name) && !guarded.has(name)) : [];
281756
+ if (unboundEnvelope.length > 0) {
281757
+ diagnostics.push({
281758
+ file,
281759
+ element: describeElement(scriptTask),
281760
+ ruleCode: SCRIPT_ARGS_ENVELOPE_MISSING,
281761
+ message: `Script references ${unboundEnvelope.map((n) => `"${n}"`).join(", ")}, not provided by the script args envelope, so the run faults with a "not defined" error.`,
281762
+ instruction: hasPlainTextArgs(scriptTask) ? "The args input is a plain text node, and the engine reads only CDATA or the value attribute. Upgrade @uipath/maestro-builder-sdk to 6.47.3 or later and compile again, or wrap the args JSON in <![CDATA[...]]>." : 'Give the script task a BPMN.Variables uipath:mapping with <uipath:input name="args" type="json" target="bodyField"> holding {"vars":"=vars","metadata":"=metadata"}.'
281763
+ });
281764
+ }
281765
+ const unresolved = allUnresolved.filter((name) => !unboundEnvelope.includes(name));
281691
281766
  if (unresolved.length === 0) {
281692
281767
  continue;
281693
281768
  }
@@ -282067,6 +282142,9 @@ class BpmnValidateService {
282067
282142
  const directInputs = childElements(payload, "uipath:input");
282068
282143
  const actual = new Map(directInputs.map((input) => [input.attributes.name, input]));
282069
282144
  if (usesCanvasOwnedDynamicPayload(contract)) {
282145
+ if (payload.name === "uipath:activity") {
282146
+ this.validateSingleBodyInput(file, directInputs, owner, contract, diagnostics);
282147
+ }
282070
282148
  this.validateDynamicDirectInputs(file, directInputs, diagnostics);
282071
282149
  return;
282072
282150
  }
@@ -282221,6 +282299,24 @@ class BpmnValidateService {
282221
282299
  }
282222
282300
  validateTypedValue(file, actual, input.type, actual.text || actual.attributes.value, `input payload "${input.name}"`, diagnostics);
282223
282301
  }
282302
+ validateSingleBodyInput(file, directInputs, owner, contract, diagnostics) {
282303
+ const bodyInputs = directInputs.filter((input) => {
282304
+ const { name, type, target } = input.attributes;
282305
+ const hasValue = engineInputValue(input) !== undefined;
282306
+ return name !== undefined && type !== undefined && target !== undefined && hasValue && !NON_BODY_INPUT_TARGETS.has(target);
282307
+ });
282308
+ if (bodyInputs.length < 2) {
282309
+ return;
282310
+ }
282311
+ const names = bodyInputs.map((input) => `"${input.attributes.name ?? ""}"`).join(", ");
282312
+ diagnostics.push({
282313
+ file,
282314
+ element: describeElement(owner),
282315
+ ruleCode: MULTIPLE_BODY_INPUTS,
282316
+ message: `${contract.extensionType} has ${bodyInputs.length} inputs the runtime sends as the body (${names}). It keeps one body value, so only the last one is sent.`,
282317
+ instruction: 'Put every body field in one <uipath:input name="body" type="json" target="body"> holding the whole request object.'
282318
+ });
282319
+ }
282224
282320
  validateDynamicDirectInputs(file, directInputs, diagnostics) {
282225
282321
  for (const input of directInputs) {
282226
282322
  if (!hasAttributeValue(input, "name")) {
@@ -282645,7 +282741,9 @@ function parseXml(xml) {
282645
282741
  }
282646
282742
  const token = xml.slice(match.start, match.end);
282647
282743
  if (token.startsWith(CDATA_OPEN)) {
282648
- stack[stack.length - 1].text += match.cdata ?? "";
282744
+ const current = stack[stack.length - 1];
282745
+ current.text += match.cdata ?? "";
282746
+ current.cdata = (current.cdata ?? "") + (match.cdata ?? "");
282649
282747
  } else if (token.startsWith("</")) {
282650
282748
  const closeName = token.slice(2, -1).trim();
282651
282749
  if (stack.length <= 1) {
@@ -288653,4 +288751,4 @@ export {
288653
288751
  withPimsCall
288654
288752
  };
288655
288753
 
288656
- //# debugId=59DFB2525E8EE8EC64756E2164756E21
288754
+ //# debugId=26D894D63096A17C64756E2164756E21
@@ -144811,7 +144811,7 @@ var init_package = __esm(() => {
144811
144811
  name: "@uipath/integrationservice-sdk",
144812
144812
  author: "UiPath",
144813
144813
  license: "SEE LICENSE IN LICENSE.txt",
144814
- version: "1.207.0-preview.328",
144814
+ version: "1.207.0-preview.330",
144815
144815
  repository: {
144816
144816
  type: "git",
144817
144817
  url: "https://github.com/UiPath/cli.git",
@@ -264760,4 +264760,4 @@ export {
264760
264760
  shownRows
264761
264761
  };
264762
264762
 
264763
- //# debugId=B763021A4ABD841F64756E2164756E21
264763
+ //# debugId=670FA37462D1266664756E2164756E21
@@ -57,6 +57,7 @@ export declare class BpmnValidateService {
57
57
  validateProject(projectPath: string): Promise<BpmnValidationResult>;
58
58
  validateProjectBindings(projectPath: string): Promise<BpmnValidationResult>;
59
59
  private validateBpmnFile;
60
+ private validateScriptTaskType;
60
61
  private validateScriptTaskMigrationMarker;
61
62
  private recordJsonBindings;
62
63
  private recordInlineBindings;
@@ -91,6 +92,7 @@ export declare class BpmnValidateService {
91
92
  private validateInputs;
92
93
  private validateMergedInputs;
93
94
  private validateAdditionalInput;
95
+ private validateSingleBodyInput;
94
96
  private validateDynamicDirectInputs;
95
97
  private validateVariableMappingInputs;
96
98
  private validateOutput;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/maestro-sdk",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.207.0-preview.328",
5
+ "version": "1.207.0-preview.330",
6
6
  "description": "SDK for the UiPath Maestro (PIMS) API — process instance management.",
7
7
  "repository": {
8
8
  "type": "git",
@@ -113,5 +113,5 @@
113
113
  "files": [
114
114
  "dist"
115
115
  ],
116
- "gitHead": "c647aa45035d66e167006b621a5115ed05d95d65"
116
+ "gitHead": "13a2380b511a98ff2c510396db899b7ddabdc36a"
117
117
  }