@uipath/maestro-builder-sdk 6.86.11 → 6.86.12

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.
@@ -878,9 +878,18 @@ function legacyCamelWireName(value) {
878
878
  *
879
879
  * With `owner`, the lift is strict (the external task shape): a row that is not
880
880
  * one of the three containers, or a container whose body is not an object, is
881
- * refused. Without it, such rows are skipped, as the connector lift always did.
881
+ * refused. Without it, a row that holds no authored value is skipped, as the
882
+ * connector lift always did: a container with no body, a valueless `file`
883
+ * row. A row that holds one and is not in the shape compile writes is refused
884
+ * by name (`connectorTask`), never dropped: compile would write the task
885
+ * without that value. Two such shapes are saved by older Designers:
886
+ *
887
+ * - one row per parameter, `{ name: 'saveAsDraft', target: 'query', value: 'false' }`,
888
+ * instead of the `queryParameters` container;
889
+ * - a container that carries its fields in `value`, `{ name: 'body', value: { … } }`,
890
+ * instead of `body`.
882
891
  */
883
- function connectorInputs(slots, resolved, owner) {
892
+ function connectorInputs(slots, resolved, owner, task) {
884
893
  // A carried query or path field is a parameter too, which the library's
885
894
  // `operation.parameters` does not list.
886
895
  const parameterNames = [
@@ -910,6 +919,16 @@ function connectorInputs(slots, resolved, owner) {
910
919
  }
911
920
  if (owner && !CONNECTOR_INPUT_CONTAINERS.has(name))
912
921
  throw new Error(`${owner} has unsupported input row "${name}".`);
922
+ const who = owner ?? task ?? 'connector task';
923
+ if (!CONNECTOR_INPUT_CONTAINERS.has(name)) {
924
+ if (hasAuthoredValue(slot?.value))
925
+ throw new Error(`${who} has input row "${name}" (target ${JSON.stringify(slot?.target ?? null)}), an input saved as its own row; ` +
926
+ `decompile lifts only the pathParameters / queryParameters / body containers, so the value would be lost. ` + CONNECTOR_INPUT_REMEDY);
927
+ continue;
928
+ }
929
+ if (hasAuthoredValue(slot?.value))
930
+ throw new Error(`${who} input container "${name}" carries its fields in "value", not "body"; ` +
931
+ `decompile does not lift that shape, so the fields would be lost. ` + CONNECTOR_INPUT_REMEDY);
913
932
  const body = slot?.body;
914
933
  if (owner && body === undefined)
915
934
  continue;
@@ -926,6 +945,22 @@ function connectorInputs(slots, resolved, owner) {
926
945
  return inputs;
927
946
  }
928
947
  const CONNECTOR_INPUT_CONTAINERS = new Set(['pathParameters', 'queryParameters', 'body']);
948
+ /**
949
+ * The way out of an input shape `connectorInputs` refuses. Opening and saving
950
+ * the plan does not help: the platform's disk -> canvas -> disk pipeline and its
951
+ * migration to the latest schema keep both shapes as saved. The current
952
+ * Designer writes the containers when it adds a connector activity.
953
+ */
954
+ const CONNECTOR_INPUT_REMEDY = 'Opening and saving the plan keeps this shape. In Studio Web, delete the task and add the connector activity again, ' +
955
+ 'then decompile the saved plan.';
956
+ /** A saved row value that says something: not absent, `null`, `""` or `{}`. */
957
+ function hasAuthoredValue(value) {
958
+ if (value === undefined || value === null || value === '')
959
+ return false;
960
+ if (typeof value === 'object' && !Array.isArray(value))
961
+ return Object.keys(value).length > 0;
962
+ return true;
963
+ }
929
964
  function connectorCall(task, refs, library) {
930
965
  if (!library)
931
966
  throw new Error(`connector task "${task.displayName ?? task.id ?? '?'}" needs the connector library; pass DecompileOptions.library or --library.`);
@@ -951,7 +986,7 @@ function connectorCall(task, refs, library) {
951
986
  // values instead of refusing them as unknown inputs (#1362).
952
987
  const carried = savedFieldsMissingFromLibrary(savedConfiguration(context), fromLibrary);
953
988
  const resolved = withCarriedFields(fromLibrary, carried);
954
- const inputs = connectorInputs(Array.isArray(data.inputs) ? data.inputs : [], resolved);
989
+ const inputs = connectorInputs(Array.isArray(data.inputs) ? data.inputs : [], resolved, undefined, `connector task "${task.displayName ?? task.id ?? '?'}"`);
955
990
  const connection = bindingName(context.get('connection')?.value, refs);
956
991
  const folder = bindingName(context.get('folderKey')?.value, refs);
957
992
  const options = opts([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.86.11",
3
+ "version": "6.86.12",
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",
@@ -103,5 +103,5 @@
103
103
  "@types/node": "^22.7.0",
104
104
  "esbuild": "^0.28.1"
105
105
  },
106
- "gitref": "3bc7b01f506acd560cfde69c2ecaa2bc9e4b82c6"
106
+ "gitref": "2361f169d9927e30c2cb4c54aaf576ecc25f4468"
107
107
  }