@uipath/maestro-builder-sdk 6.70.1 → 6.70.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.
@@ -2071,7 +2071,7 @@ defaultScope = () => ownerId) {
2071
2071
  if (skip.has(v.id))
2072
2072
  continue;
2073
2073
  const type = varType(v.type);
2074
- const def = v.default === undefined ? undefined : decodeDefault(v.default, v.type);
2074
+ const def = v.default === undefined ? undefined : decodeDefault(v.default, v.type, v.id);
2075
2075
  entries.push(`{ id: ${tsText(v.id)}, type: ${tsText(type)}${inner([
2076
2076
  ['direction', direction === 'inputOutput' ? undefined : tsText(direction)],
2077
2077
  ['name', v.name !== undefined && v.name !== v.id ? tsText(v.name) : undefined],
@@ -2118,11 +2118,19 @@ function bindingIsReferenced(xml, id) {
2118
2118
  * anything non-finite, so it was right by accident; this makes the rule explicit for
2119
2119
  * every type.
2120
2120
  */
2121
- function decodeDefault(raw, wire) {
2121
+ function decodeDefault(raw, wire, id) {
2122
2122
  if (raw.startsWith('='))
2123
2123
  return tsText(raw); // an expression, not a value of `wire`
2124
- if (wire === 'json')
2125
- return raw; // already JSON — emit it verbatim
2124
+ if (wire === 'json') {
2125
+ // emitted unquoted, so it must be JSON
2126
+ try {
2127
+ JSON.parse(raw);
2128
+ }
2129
+ catch {
2130
+ throw new Error(`decompile: variable ${JSON.stringify(id)} has type "json" but its default ${JSON.stringify(raw)} is not JSON.`);
2131
+ }
2132
+ return raw;
2133
+ }
2126
2134
  if (wire === 'number')
2127
2135
  return Number.isFinite(Number(raw)) ? String(Number(raw)) : tsText(raw);
2128
2136
  // Only the two literals are booleans. Anything else — an empty `default=""`, which
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.70.1",
3
+ "version": "6.70.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",
@@ -100,5 +100,5 @@
100
100
  "@types/node": "^22.7.0",
101
101
  "esbuild": "^0.28.1"
102
102
  },
103
- "gitref": "d1531fbce30cd3d2a88997dd8c65be6ef046e5ed"
103
+ "gitref": "f3203eee21b892b6b70e41a5bf791aa30fdc0fc2"
104
104
  }