@uipath/maestro-builder-sdk 6.82.0 → 6.82.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.
- package/dist/case/check.js +6 -3
- package/dist/case/http-request.d.ts +0 -26
- package/dist/case/http-request.js +58 -3
- package/dist/case/plan-check/rules/common.d.ts +6 -2
- package/dist/case/plan-check/rules/common.js +6 -2
- package/dist/case/plan-check/rules/tasks.js +51 -1
- package/dist/case/script.js +3 -2
- package/dist/core/refusals.d.ts +2 -0
- package/dist/core/refusals.js +2 -0
- package/package.json +2 -2
package/dist/case/check.js
CHANGED
|
@@ -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
|
|
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 (
|
|
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 :
|
|
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;
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
* What the rule families share: the CLI commit they were ported from, and the
|
|
3
3
|
* next step for a field compile writes itself.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The `UiPath/cli` commit the rules in this directory were last read against.
|
|
7
|
+
* The first 19 were ported at b37f32997c; TIMER_TASK_OUTPUTS_IGNORED, and the
|
|
8
|
+
* not-ported list in `tests/_case-plan-not-ported.ts`, were read at this one.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CLI_PORTED_FROM = "7dbaa6b9e";
|
|
7
11
|
/**
|
|
8
12
|
* The next step for a field `serialize` writes itself. From a source alone it
|
|
9
13
|
* is an SDK bug; from a decompiled source it can be the plan's preserved data,
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
* What the rule families share: the CLI commit they were ported from, and the
|
|
3
3
|
* next step for a field compile writes itself.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The `UiPath/cli` commit the rules in this directory were last read against.
|
|
7
|
+
* The first 19 were ported at b37f32997c; TIMER_TASK_OUTPUTS_IGNORED, and the
|
|
8
|
+
* not-ported list in `tests/_case-plan-not-ported.ts`, were read at this one.
|
|
9
|
+
*/
|
|
10
|
+
export const CLI_PORTED_FROM = '7dbaa6b9e';
|
|
7
11
|
/**
|
|
8
12
|
* The next step for a field `serialize` writes itself. From a source alone it
|
|
9
13
|
* is an SDK bug; from a decompiled source it can be the plan's preserved data,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { asRecord, planTasks } from '../walk.js';
|
|
2
|
+
import { WRITTEN_BY_COMPILE } from './common.js';
|
|
2
3
|
/** The CLI's `RECIPIENT_PREFIXES`: a value still carrying one is `STRICT_RECIPIENT_PREFIX_LEFT`'s, not ported. */
|
|
3
4
|
const RECIPIENT_PREFIXES = ['User:', 'UserGroup:', 'Role:', 'Email:', 'Expression:'];
|
|
4
5
|
const recipientExpressionType = {
|
|
@@ -57,4 +58,53 @@ const actionCatalogNamed = {
|
|
|
57
58
|
return found;
|
|
58
59
|
},
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
const timerOutputsIgnored = {
|
|
62
|
+
code: 'TIMER_TASK_OUTPUTS_IGNORED',
|
|
63
|
+
class: 'lint',
|
|
64
|
+
why: 'A timer task carries outputs only when the source gives it a custom `.outputs({ v: { assign } })`, written as authored.',
|
|
65
|
+
level: 'warning',
|
|
66
|
+
cli: 'case-validators/timer-validator.ts:77',
|
|
67
|
+
find(plan) {
|
|
68
|
+
const found = [];
|
|
69
|
+
for (const t of planTasks(plan)) {
|
|
70
|
+
if (t.task.type !== 'wait-for-timer')
|
|
71
|
+
continue;
|
|
72
|
+
if (!Array.isArray(t.data?.outputs) || t.data.outputs.length === 0)
|
|
73
|
+
continue;
|
|
74
|
+
found.push({
|
|
75
|
+
path: `nodes[${t.stageId}].data.tasks[${t.taskId}].data`,
|
|
76
|
+
message: `Timer task "${t.taskLabel}" declares "data.outputs", but pack drops them on a wait-for-timer task, so no variable is written.`,
|
|
77
|
+
fix: 'Drop `.outputs()` from the `.waitForTimer()` task and set the variable from a script task placed after the timer.',
|
|
78
|
+
where: t.taskLabel,
|
|
79
|
+
nodeId: t.taskId,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return found;
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
const taskMissingElementId = {
|
|
86
|
+
code: 'TASK_MISSING_ELEMENT_ID',
|
|
87
|
+
class: 'lint',
|
|
88
|
+
why: "Compile stamps every task's elementId, but a decompiled plan that omitted it records the omission and compile drops it again; until the contract decides the preserved case (D6), only check reports it.",
|
|
89
|
+
level: 'warning',
|
|
90
|
+
cli: 'case-validators/task-hygiene-validator.ts:18',
|
|
91
|
+
find(plan) {
|
|
92
|
+
const found = [];
|
|
93
|
+
for (const t of planTasks(plan)) {
|
|
94
|
+
if (t.task.elementId !== undefined)
|
|
95
|
+
continue;
|
|
96
|
+
const hasRows = (key) => Array.isArray(t.data?.[key]) && t.data[key].length > 0;
|
|
97
|
+
if (!hasRows('inputs') && !hasRows('outputs'))
|
|
98
|
+
continue;
|
|
99
|
+
found.push({
|
|
100
|
+
path: `nodes[${t.stageId}].data.tasks[${t.taskId}]`,
|
|
101
|
+
message: `Task "${t.taskLabel}" carries inputs or outputs but has no "elementId", so those variables do not resolve to it.`,
|
|
102
|
+
fix: `The elementId is "${t.stageId}-${t.taskId}"; ${WRITTEN_BY_COMPILE}`,
|
|
103
|
+
where: t.taskLabel,
|
|
104
|
+
nodeId: t.taskId,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return found;
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
export const TASK_RULES = [recipientExpressionType, actionCatalogNamed, timerOutputsIgnored, taskMissingElementId];
|
package/dist/case/script.js
CHANGED
|
@@ -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
|
|
15
|
-
//
|
|
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/dist/core/refusals.d.ts
CHANGED
|
@@ -204,6 +204,8 @@ export declare const REFUSALS: {
|
|
|
204
204
|
readonly STRICT_JS_EXPRESSION_INVALID: "lint";
|
|
205
205
|
readonly STRICT_RECIPIENT_EXPRESSION_TYPE: "lint";
|
|
206
206
|
readonly STRICT_ACTION_CATALOG_NAMED: "lint";
|
|
207
|
+
readonly TIMER_TASK_OUTPUTS_IGNORED: "lint";
|
|
208
|
+
readonly TASK_MISSING_ELEMENT_ID: "lint";
|
|
207
209
|
readonly CASE_NO_DEFAULT_EXPORT: "lowering";
|
|
208
210
|
readonly CASE_SOURCE_NOT_FOUND: "lowering";
|
|
209
211
|
readonly CASE_TRIGGER_OBJECT_AND_SUBSCRIPTION: "lowering";
|
package/dist/core/refusals.js
CHANGED
|
@@ -274,6 +274,8 @@ export const REFUSALS = {
|
|
|
274
274
|
STRICT_JS_EXPRESSION_INVALID: 'lint',
|
|
275
275
|
STRICT_RECIPIENT_EXPRESSION_TYPE: 'lint',
|
|
276
276
|
STRICT_ACTION_CATALOG_NAMED: 'lint',
|
|
277
|
+
TIMER_TASK_OUTPUTS_IGNORED: 'lint',
|
|
278
|
+
TASK_MISSING_ELEMENT_ID: 'lint',
|
|
277
279
|
CASE_NO_DEFAULT_EXPORT: 'lowering',
|
|
278
280
|
CASE_SOURCE_NOT_FOUND: 'lowering',
|
|
279
281
|
CASE_TRIGGER_OBJECT_AND_SUBSCRIPTION: 'lowering',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.82.
|
|
3
|
+
"version": "6.82.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": "
|
|
106
|
+
"gitref": "73a1011c5e63e206f2c92ec533af173c62af6d3f"
|
|
107
107
|
}
|