@uipath/maestro-builder-sdk 6.86.1 → 6.86.2

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.
@@ -55,10 +55,22 @@ function checkExpr(expr, where, roots, out) {
55
55
  });
56
56
  }
57
57
  }
58
- /** Check every `=`-expression VALUE of a `field → expression` map (keys are targets). */
58
+ /**
59
+ * Check every `=`-expression VALUE of a `field → expression` map (keys are targets).
60
+ *
61
+ * A value need not be a string. A script task's `inputs` are the keys of its `args`
62
+ * JSON body, and the designer nests objects there (`{"args":{"name":"=vars.x"}}`), so
63
+ * a nested value is walked for the `=`-strings inside it, as a connector's inputs are.
64
+ * Handing it to `checkExpr` as if it were a string is what crashed `build()` with
65
+ * `expr.replace is not a function` on six deployed processes.
66
+ */
59
67
  function checkExprValues(rec, where, roots, out) {
60
- for (const v of Object.values(rec ?? {}))
61
- checkExpr(v, where, roots, out);
68
+ for (const v of Object.values(rec ?? {})) {
69
+ if (typeof v === 'string')
70
+ checkExpr(v, where, roots, out);
71
+ else
72
+ deepExprStrings(v, where, roots, out);
73
+ }
62
74
  }
63
75
  /** Reach `=`-expression strings anywhere in a connector's (possibly nested) inputs. */
64
76
  function deepExprStrings(val, where, roots, out) {
@@ -138,7 +138,8 @@ export type BpmnNode = {
138
138
  scriptFormat: string;
139
139
  /** The `uipath:scriptVersion` value — see {@link ScriptTaskOpts.scriptVersion}. */
140
140
  scriptVersion: string;
141
- inputs: Record<string, string>;
141
+ /** The `args` keys after the envelope — see {@link ScriptTaskOpts.inputs}. */
142
+ inputs: Record<string, unknown>;
142
143
  outputs: Record<string, string>;
143
144
  /** The mapping's extension type — see {@link ScriptTaskOpts.type}. */
144
145
  type: string;
@@ -929,8 +930,13 @@ export interface ScriptTaskOpts extends ActivityOpts {
929
930
  * `"iterator[0]":"=iterator[0]"` to scope a loop body — and for a key the author
930
931
  * knows the runtime reads. `vars` and `metadata` given here override the envelope's
931
932
  * values, which is never useful but keeps a round trip byte-faithful.
933
+ *
934
+ * A value is any JSON value, not only a string: `args` is a JSON body, and the
935
+ * designer writes nested objects into it (`{"args":{"name":"=vars.Var_Name"}}`).
936
+ * Every `=`-string inside a nested value is an expression and is checked like a
937
+ * top-level one.
932
938
  */
933
- inputs?: Record<string, string>;
939
+ inputs?: Record<string, unknown>;
934
940
  /**
935
941
  * `uipath:output` rows: variable id → `=`-expression.
936
942
  *
@@ -992,6 +992,14 @@ function isRuntimeDuration(v) {
992
992
  }
993
993
  /** The `args` keys the platform itself writes and injects — not an author's inputs. */
994
994
  const SCRIPT_ENVELOPE_KEYS = new Set(['vars', 'metadata', 'iterator']);
995
+ /**
996
+ * What the SCRIPT_BARE_INPUT_REF message suggests reading instead of a bare `inputs`
997
+ * key: the key's expression without its `=`. An `args` value can be any JSON value
998
+ * (the designer nests objects there), so a non-string one is shown as JSON.
999
+ */
1000
+ function bareInputHint(value) {
1001
+ return typeof value === 'string' ? value.replace(/^=/, '') : JSON.stringify(value);
1002
+ }
995
1003
  /**
996
1004
  * Whether a script body mentions `name` as a bare identifier — not after `.` (a property
997
1005
  * read such as `vars.amount`), not inside a string or comment. The body is otherwise not
@@ -1045,7 +1053,7 @@ function checkActivityFields(n, diags) {
1045
1053
  message: `Script task "${n.id}" reads ${bare.map((k) => `\`${k}\``).join(', ')} as a bare identifier, but the platform ` +
1046
1054
  `injects only \`vars\`, \`metadata\` and \`iterator\` into a script's scope — on the cloud this faults with ` +
1047
1055
  `\`${bare[0]} is not defined\` after check, compile and validate have all passed. ` +
1048
- `Read the variable as \`vars.<id>\` (${bare.map((k) => `\`${n.inputs[k].replace(/^=/, '')}\``).join(', ')}) and drop the \`inputs\` entry.`,
1056
+ `Read the variable as \`vars.<id>\` (${bare.map((k) => `\`${bareInputHint(n.inputs[k])}\``).join(', ')}) and drop the \`inputs\` entry.`,
1049
1057
  where: n.id,
1050
1058
  });
1051
1059
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.86.1",
3
+ "version": "6.86.2",
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": "4cbce76722e41362c4cf5aa885c74d1564d0201b"
106
+ "gitref": "cc066edcd1025c03c024ae3ffe2115cee3e87fc6"
107
107
  }