@uipath/maestro-builder-sdk 6.82.0 → 6.82.1

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.
@@ -379,10 +379,13 @@ function checkSla(sla, where, diags) {
379
379
  });
380
380
  if (e.notify.length === 0)
381
381
  diags.push({ level: 'warning', code: 'ESCALATION_NO_RECIPIENTS', message: `${where}: an escalation notifies no one (empty notify).`, where });
382
- // An `<UNRESOLVED: …>` target passes `validate` but names no one, so the
383
- // escalation notifies nobody until the id is filled in.
382
+ // An `<UNRESOLVED…>` target passes `validate` but names no one, so the
383
+ // escalation notifies nobody until the id is filled in. The test is the one
384
+ // CASE_MGMT_ESCALATION_RECIPIENT_LITERAL skips on (plan-check/rules/sla.ts),
385
+ // so the two split every non-GUID target with no gap: `<UNRESOLVED>`,
386
+ // `<UNRESOLVED: …>` and a marker mid-string all land here.
384
387
  for (const r of e.notify)
385
- if (/^<UNRESOLVED:/.test(r.target.trim()))
388
+ if (r.target.includes('<UNRESOLVED'))
386
389
  diags.push({
387
390
  level: 'warning',
388
391
  code: 'ESCALATION_RECIPIENT_UNRESOLVED',
@@ -1,29 +1,3 @@
1
- /**
2
- * case/http-request — the Case `http-request` task: a call through Integration
3
- * Service's generic HTTP connector, in the shape the Case Designer saves.
4
- *
5
- * Read from three alpha Designer saves (2026-10-13, UiPath/cli
6
- * `packages/case-tool/tests/fixtures/http-request/designer-saved.json`) and the
7
- * CLI's writer for them, `sdd convert` (`services/sdd-convert/http-request.ts`
8
- * at UiPath/cli b37f32997c), which was read from PO.Frontend 35d579f94.
9
- *
10
- * The task is always the HTTP connector's own activity (`uipath-uipath-http`,
11
- * `POST /http-request`, the fixed identity in `core/managed-http.ts` that Flow
12
- * and BPMN share). What a person configures is the request, which rides in the
13
- * `body` input's `body`: `authentication`, `method`, `url` (manual) or `path`
14
- * (connector), `headers`, `query`, `body`. Two modes:
15
- * - manual: the request goes to `url` as written, with no connection; the task
16
- * names the plan's one `ImplicitConnection` binding;
17
- * - connector: the request reuses a connection's authentication
18
- * (`targetConnector`), and `path` is relative to that connector's base URL.
19
- * The task carries the connection's `ConnectionId` and `folderKey`
20
- * bindings, which are also at the root.
21
- *
22
- * Its refusals follow the check/compile contract: {@link httpRequestRefusal} is
23
- * what compile cannot write as authored (`lowering`), and `serialize` throws
24
- * it; {@link httpRequestLint} is what compile writes as authored and only
25
- * `check` reports (`lint`).
26
- */
27
1
  import type { CaseHttpRequestSpec, HttpRequestMethod, TaskOutputBinding } from './case-sdk.js';
28
2
  /**
29
3
  * The Designer's `metadata` context entry body, copied byte for byte from
@@ -1,3 +1,30 @@
1
+ /**
2
+ * case/http-request — the Case `http-request` task: a call through Integration
3
+ * Service's generic HTTP connector, in the shape the Case Designer saves.
4
+ *
5
+ * Read from three alpha Designer saves (2026-10-13, UiPath/cli
6
+ * `packages/case-tool/tests/fixtures/http-request/designer-saved.json`) and the
7
+ * CLI's writer for them, `sdd convert` (`services/sdd-convert/http-request.ts`
8
+ * at UiPath/cli b37f32997c), which was read from PO.Frontend 35d579f94.
9
+ *
10
+ * The task is always the HTTP connector's own activity (`uipath-uipath-http`,
11
+ * `POST /http-request`, the fixed identity in `core/managed-http.ts` that Flow
12
+ * and BPMN share). What a person configures is the request, which rides in the
13
+ * `body` input's `body`: `authentication`, `method`, `url` (manual) or `path`
14
+ * (connector), `headers`, `query`, `body`. Two modes:
15
+ * - manual: the request goes to `url` as written, with no connection; the task
16
+ * names the plan's one `ImplicitConnection` binding;
17
+ * - connector: the request reuses a connection's authentication
18
+ * (`targetConnector`), and `path` is relative to that connector's base URL.
19
+ * The task carries the connection's `ConnectionId` and `folderKey`
20
+ * bindings, which are also at the root.
21
+ *
22
+ * Its refusals follow the check/compile contract: {@link httpRequestRefusal} is
23
+ * what compile cannot write as authored (`lowering`), and `serialize` throws
24
+ * it; {@link httpRequestLint} is what compile writes as authored and only
25
+ * `check` reports (`lint`).
26
+ */
27
+ import { parse } from 'acorn';
1
28
  import { MANAGED_HTTP_CONNECTOR_KEY, MANAGED_HTTP_ENDPOINT, MANAGED_HTTP_ENDPOINT_METHOD, MANAGED_HTTP_OBJECT_NAME, } from '../core/managed-http.js';
2
29
  import { taskOutputRefs } from './task-output-ref.js';
3
30
  import metadata from './http-request-metadata.json' with { type: 'json' };
@@ -107,7 +134,8 @@ export function httpRequestRefusal(owner, spec) {
107
134
  if (leaf !== undefined)
108
135
  return {
109
136
  code: 'HTTP_REQUEST_BODY_EXPRESSION',
110
- message: `${owner} body has the value ${JSON.stringify(leaf)}, an \`=\` expression compile cannot write as a JavaScript value inside the body.`,
137
+ message: `${owner} body has the value ${JSON.stringify(leaf)}, an \`=\` expression compile cannot write as a JavaScript value inside the body: `
138
+ + 'a body value must be a reference, or `=js:` followed by exactly one JavaScript expression (not a statement, nor code that does not parse).',
111
139
  suggestion: "Write the value as `=js:<expression>` (for example '=js:vars.amount * 2'), as a reference (`=vars.amount`), "
112
140
  + "or as another task's output (`=${taskOutput('Stage', 'Task', 'body')}`).",
113
141
  };
@@ -138,16 +166,43 @@ function isTaskOutputReference(text) {
138
166
  const refs = taskOutputRefs(text);
139
167
  return refs.length === 1 && refs[0].index === 0 && DOTTED_TAIL.test(text.slice(refs[0].whole.length));
140
168
  }
169
+ /**
170
+ * `code` parenthesized as one JavaScript expression, `(<code>\n)`, or
171
+ * `undefined` when it is not exactly one. The parentheses close on a new line,
172
+ * so a trailing `// comment` ends before them instead of swallowing the rest of
173
+ * the body. acorn reads the result as the CLI's strict check does (`ecmaVersion:
174
+ * 'latest'`, `sourceType: 'script'`), and it must be a single parenthesized
175
+ * expression spanning the whole text: a statement (`vars.a; vars.b`), code that
176
+ * closes the parentheses early (`a), (b`), or an unterminated comment does not
177
+ * parse as one and is refused (`HTTP_REQUEST_BODY_EXPRESSION`).
178
+ */
179
+ function oneExpression(code) {
180
+ const text = `(${code}\n)`;
181
+ let program;
182
+ try {
183
+ program = parse(text, { ecmaVersion: 'latest', sourceType: 'script', preserveParens: true });
184
+ }
185
+ catch {
186
+ return undefined;
187
+ }
188
+ const [statement] = program.body;
189
+ if (program.body.length !== 1 || statement.type !== 'ExpressionStatement')
190
+ return undefined;
191
+ const { expression } = statement;
192
+ return expression.type === 'ParenthesizedExpression' && expression.start === 0 && expression.end === text.length
193
+ ? text
194
+ : undefined;
195
+ }
141
196
  /**
142
197
  * The JavaScript an `=` leaf of an object body stands for: `=js:<code>` is the
143
- * code, parenthesized; `=<reference>` is the reference, a `taskOutput()`
198
+ * code, parenthesized as one expression ({@link oneExpression}); `=<reference>` is the reference, a `taskOutput()`
144
199
  * marker included. `undefined` for any other `=` text, which compile refuses
145
200
  * (`HTTP_REQUEST_BODY_EXPRESSION`).
146
201
  */
147
202
  function leafCode(value) {
148
203
  if (value.startsWith('=js:')) {
149
204
  const code = value.slice('=js:'.length).trim();
150
- return code === '' ? undefined : `(${code})`;
205
+ return code === '' ? undefined : oneExpression(code);
151
206
  }
152
207
  const reference = value.slice(1).trim();
153
208
  return REFERENCE.test(reference) || isTaskOutputReference(reference) ? reference : undefined;
@@ -11,8 +11,9 @@ export const CASE_SCRIPT_RUNTIME = {
11
11
  global: 'vars', param: 'vars', holds: 'the case variables', reads: 'variable', example: 'amount',
12
12
  // `validate` reports a `vars.<name>` that names nothing (CASE_MGMT_REFERENCE_UNBOUND,
13
13
  // an error on the default profile, measured at uip 1.206.0), and it reads a script
14
- // body like any other plan text. `check` runs the same rule once the validate rules
15
- // move into `case/plan-check/`; this task adds no second copy of it.
14
+ // body like any other plan text. `check` runs the same rule through its port in
15
+ // `case/plan-check/` and reports CASE_MGMT_REFERENCE_UNBOUND on a script body too
16
+ // (pinned in `case-script.test.ts`); this task adds no second copy of it.
16
17
  checkedBy: "`uip maestro case validate`'s variable reference check (CASE_MGMT_REFERENCE_UNBOUND)",
17
18
  },
18
19
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.82.0",
3
+ "version": "6.82.1",
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": "5cd8813ad867cef849279dd05ad8b216a618d147"
106
+ "gitref": "cd9e43c9e5505bd7691f83cf7cce2283a190ec7b"
107
107
  }