@uipath/maestro-builder-sdk 6.86.2 → 6.86.3
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/README.md +7 -5
- package/dist/api-index.md +3 -3
- package/dist/api-members.md +1 -1
- package/dist/check.js +20 -1
- package/dist/flow-expr-check.d.ts +28 -5
- package/dist/flow-expr-check.js +57 -30
- package/dist/flow-sdk.d.ts +3 -1
- package/dist/flow-sdk.js +8 -9
- package/dist/serialize.js +20 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -169,11 +169,13 @@ uip maestro flow validate HelloWorld.flow # the product validator
|
|
|
169
169
|
uip maestro flow debug HelloWorld.flow # run it
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
`
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
`uip maestro flow check --source` runs the authored-source checks without
|
|
173
|
+
emitting. Run it before `compile`: `compile` only serializes. For example, an
|
|
174
|
+
undeclared `$vars` reference (a mistyped variable or step name in a `` js`…` ``
|
|
175
|
+
expression) is `check`'s `EXPR_UNDECLARED_REF`, and `compile` writes the read as
|
|
176
|
+
authored, so a `.flow` that already has one still decompiles and compiles. An
|
|
177
|
+
expression that is not valid JavaScript is `EXPR_SYNTAX`: `compile` refuses it
|
|
178
|
+
with a `FlowBuildError`, and `check` reports it too. For a COMPILED `.flow`, `uip maestro flow validate` is the authoritative
|
|
177
179
|
product validator, and `uip maestro flow debug` (or `flow-debug`) runs it. Case and BPMN use the same family-first shape:
|
|
178
180
|
`uip maestro case compile|check|decompile` and
|
|
179
181
|
`uip maestro bpmn compile|check|format`.
|
package/dist/api-index.md
CHANGED
|
@@ -139,11 +139,11 @@ could hand you spans for a version you do not have.
|
|
|
139
139
|
| `FilterCondition` | type | `dist/nodes/transform/flow/spec.d.ts:10-11` | Supporting types | Comparison a filter rule applies to a field. |
|
|
140
140
|
| `FilterMatch` | type | `dist/nodes/transform/flow/spec.d.ts:8-9` | Supporting types | How a filter combines its rules: every rule must match, or any one. |
|
|
141
141
|
| `FilterRule` | interface | `dist/nodes/transform/flow/spec.d.ts:12-24` | Supporting types | 3 field(s) |
|
|
142
|
-
| `flow` | function | `dist/flow-sdk.d.ts:
|
|
142
|
+
| `flow` | function | `dist/flow-sdk.d.ts:1643-1658` | Flow construction | Start building a flow with the given id. |
|
|
143
143
|
| `FlowAction` | class | `dist/core/node-classes.d.ts:162-168` | Supporting types | A node placed as a step — pass an instance to `.step(name, …)`. |
|
|
144
144
|
| `FlowActionSpec` | type | `dist/flow-sdk.d.ts:60-61` | Supporting types | What `.step()` accepts here: the shared actions plus this SDK's subflow. |
|
|
145
145
|
| `FlowActionSpecs` | interface | `dist/core/actions.d.ts:815-848` | Supporting types | Every action kind, keyed by kind, to the body of its spec — the arm's fields other than `kind`. |
|
|
146
|
-
| `FlowBuilder` | class | `dist/flow-sdk.d.ts:1259-
|
|
146
|
+
| `FlowBuilder` | class | `dist/flow-sdk.d.ts:1259-1642` | Builders | 15 member(s) |
|
|
147
147
|
| `FlowLayout` | interface | `dist/flow-sdk.d.ts:678-691` | Supporting types | Designer layout for a flow, keyed by AUTHOR-level ids: node entries by step name (plus the trigger id and `end`), edge… |
|
|
148
148
|
| `FlowMetadata` | interface | `dist/nodes/script/flow/spec.d.ts:63-95` | Actions | The instance metadata, as a script function's second parameter sees it. |
|
|
149
149
|
| `FlowNode` | class | `dist/core/node-classes.d.ts:126-161` | Supporting types | The abstract root of every definition-backed node the builder can place. |
|
|
@@ -259,7 +259,7 @@ could hand you spans for a version you do not have.
|
|
|
259
259
|
| `STICKY_NOTE_COLORS` | const | `dist/flow-sdk.d.ts:631-636` | Flow construction | The designer's sticky-note palette. |
|
|
260
260
|
| `StickyNote` | interface | `dist/flow-sdk.d.ts:643-677` | Supporting types | A canvas sticky note — free text pinned to the diagram, for the humans reading it. |
|
|
261
261
|
| `StickyNoteColor` | type | `dist/flow-sdk.d.ts:637-642` | Supporting types | A sticky note's swatch. |
|
|
262
|
-
| `subflow` | function | `dist/flow-sdk.d.ts:
|
|
262
|
+
| `subflow` | function | `dist/flow-sdk.d.ts:1659-1698` | Flow construction | Run another flow as one step, and read back what it returns. |
|
|
263
263
|
| `SubflowSpec` | interface | `dist/flow-sdk.d.ts:52-59` | Supporting types | A step that runs a child flow. |
|
|
264
264
|
| `summarize` | function | `dist/nodes/ai-patterns/flow/factories.d.ts:8-48` | Actions | Summarize a document with citations — the platform's **Summarize** node. |
|
|
265
265
|
| `SummarizeInputs` | interface | `dist/nodes/ai-patterns/flow/spec.d.ts:8-40` | Option shapes | 3 field(s) |
|
package/dist/api-members.md
CHANGED
|
@@ -116,7 +116,7 @@ not find it either.
|
|
|
116
116
|
| `breakEnabled` | property | `LoopOptions` | `dist/flow-sdk.d.ts:412-416` |
|
|
117
117
|
| `build` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3732-3741` |
|
|
118
118
|
| `build` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2066-2071` |
|
|
119
|
-
| `build` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1633-
|
|
119
|
+
| `build` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1633-1641` |
|
|
120
120
|
| `businessEvent` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2055-2065` |
|
|
121
121
|
| `businessEvent` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:72-79` |
|
|
122
122
|
| `businessEvents` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1136-1137` |
|
package/dist/check.js
CHANGED
|
@@ -3,7 +3,7 @@ import { FlowNode } from './core/node-classes.js';
|
|
|
3
3
|
import { definitionHasErrorPort } from './core/error-port.js';
|
|
4
4
|
import { bundledDefinition, resolveContributionDefinition, serialize } from './serialize.js';
|
|
5
5
|
import { checkEventResolution, checkEventSubscription, eventParamsFor, } from './core/event-checks.js';
|
|
6
|
-
import { checkCookedEscapes } from './flow-expr-check.js';
|
|
6
|
+
import { checkCookedEscapes, checkFlowExpressions } from './flow-expr-check.js';
|
|
7
7
|
import { FLOW_EXPR_DIALECT, checkBindingLabels, checkConnectorLookups as coreCheckConnectorLookups, checkConnectorResources as coreCheckConnectorResources, checkConnectorSchema as coreCheckConnectorSchema, } from './core/connector-checks.js';
|
|
8
8
|
import { nearestName } from './core/edit-distance.js';
|
|
9
9
|
import { escapeRegExp } from './core/escape-regexp.js';
|
|
@@ -983,6 +983,22 @@ function checkFlow(built, ancestors, opts = {}) {
|
|
|
983
983
|
flag(m[1], m[0], m[3]);
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
|
+
// An expression reading a name nothing declares (EXPR_UNDECLARED_REF). It is
|
|
987
|
+
// `lint`: `compile` writes the read as authored, so `check` is where it is
|
|
988
|
+
// found. The `lowering` expression codes (EXPR_SYNTAX) come from the
|
|
989
|
+
// serializer's collect mode instead, so they are not repeated here.
|
|
990
|
+
const exprReported = new Set();
|
|
991
|
+
for (const d of checkFlowExpressions(built)) {
|
|
992
|
+
if (d.level !== 'error' || refusalClass(d.code) !== 'lint')
|
|
993
|
+
continue;
|
|
994
|
+
diags.push({
|
|
995
|
+
level: 'error', code: d.code, message: `In ${d.where}: ${d.message}`,
|
|
996
|
+
...(d.step !== undefined ? { step: d.step } : {}),
|
|
997
|
+
...(d.suggestion ? { suggestion: d.suggestion } : {}),
|
|
998
|
+
});
|
|
999
|
+
if (d.step !== undefined && d.root !== undefined)
|
|
1000
|
+
exprReported.add(`${d.step}\n${d.root}`);
|
|
1001
|
+
}
|
|
986
1002
|
// Check $vars.<name>[.<field>] references resolve to a declared name or step.
|
|
987
1003
|
const inputNames = new Set(built.inputs.map((x) => x.name));
|
|
988
1004
|
for (const { js, step, errorSource } of exprs) {
|
|
@@ -999,6 +1015,9 @@ function checkFlow(built, ancestors, opts = {}) {
|
|
|
999
1015
|
// `?.` reads the same path as `.`, and the rules below parse the tail as `.a.b`.
|
|
1000
1016
|
const rest = m[3].replace(/\?\./g, '.');
|
|
1001
1017
|
if (!declared.has(name)) {
|
|
1018
|
+
// The same read EXPR_UNDECLARED_REF reported above: one finding, not two.
|
|
1019
|
+
if (exprReported.has(`${step}\n${name}`))
|
|
1020
|
+
continue;
|
|
1002
1021
|
const near = [...declared].find((d) => d.toLowerCase() === name.toLowerCase());
|
|
1003
1022
|
diags.push({
|
|
1004
1023
|
level: 'error',
|
|
@@ -4,8 +4,20 @@ import { CompileRefusal } from './core/compile-refusal.js';
|
|
|
4
4
|
/** A diagnostic plus the node / field it was found in. */
|
|
5
5
|
export interface LocatedDiagnostic extends ExprDiagnostic {
|
|
6
6
|
where: string;
|
|
7
|
+
/**
|
|
8
|
+
* The step the expression sits on, as `check` names it (a `.return()` is
|
|
9
|
+
* `return`, or its `{ name }`). `where` words it for a message:
|
|
10
|
+
* `step "notify"`, or `return "total"` for one `.return()` value.
|
|
11
|
+
*/
|
|
12
|
+
step?: string;
|
|
13
|
+
/** EXPR_UNDECLARED_REF: the root nothing declares (`x` in `$vars.x.y`). */
|
|
14
|
+
root?: string;
|
|
7
15
|
}
|
|
8
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Every first-level expression problem in a built flow's own scope, each
|
|
18
|
+
* stamped with its location. A subflow's child flow is not visited: it is a
|
|
19
|
+
* scope of its own, which `check` and the serializer visit separately.
|
|
20
|
+
*/
|
|
9
21
|
export declare function checkFlowExpressions(built: BuiltFlow): LocatedDiagnostic[];
|
|
10
22
|
/**
|
|
11
23
|
* Every `js` template escape that changed what its expression means
|
|
@@ -19,15 +31,26 @@ export declare function checkFlowExpressions(built: BuiltFlow): LocatedDiagnosti
|
|
|
19
31
|
* from the built flow, child flows included: a new position cannot be missed.
|
|
20
32
|
*
|
|
21
33
|
* Only `meaning` effects are reported here. An escape that breaks the parse is
|
|
22
|
-
* named by EXPR_SYNTAX, which
|
|
34
|
+
* named by EXPR_SYNTAX, which the serializer refuses.
|
|
23
35
|
*/
|
|
24
36
|
export declare function checkCookedEscapes(built: BuiltFlow): (LocatedDiagnostic & {
|
|
25
37
|
step?: string;
|
|
26
38
|
})[];
|
|
27
39
|
/**
|
|
28
|
-
*
|
|
29
|
-
* `
|
|
30
|
-
*
|
|
40
|
+
* The expression problems `compile` refuses: every error whose code is
|
|
41
|
+
* `lowering` (`EXPR_SYNTAX`). The serializer throws a {@link FlowBuildError} on
|
|
42
|
+
* them, or reports each one in collect mode.
|
|
43
|
+
*/
|
|
44
|
+
export declare function loweringExpressionErrors(built: BuiltFlow): LocatedDiagnostic[];
|
|
45
|
+
/**
|
|
46
|
+
* Thrown by `serialize()` (so by `compile`) when an expression in the flow
|
|
47
|
+
* cannot be written: today only `EXPR_SYNTAX`, an expression that is not valid
|
|
48
|
+
* JavaScript. Its `message` lists every such problem (so a runner that prints
|
|
49
|
+
* `err.message` shows them all at once); `diagnostics` carries them structured
|
|
50
|
+
* for a caller that wants them.
|
|
51
|
+
*
|
|
52
|
+
* `build()` no longer throws it: an undeclared reference (`EXPR_UNDECLARED_REF`)
|
|
53
|
+
* is `lint`, which `check` reports and `compile` writes as authored.
|
|
31
54
|
*/
|
|
32
55
|
export declare class FlowBuildError extends CompileRefusal {
|
|
33
56
|
readonly diagnostics: LocatedDiagnostic[];
|
package/dist/flow-expr-check.js
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* flow-expr-check — the FLOW adapter over the shared, format-agnostic
|
|
3
|
-
* `core/expr-check
|
|
4
|
-
*
|
|
5
|
-
* every
|
|
6
|
-
* will provide.
|
|
3
|
+
* `core/expr-check`: a cheap first-level check that every `$vars.*` reference
|
|
4
|
+
* in an expression resolves to something the runtime will provide, and that
|
|
5
|
+
* every expression parses.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
7
|
+
* WHERE EACH FINDING IS ENFORCED. The two codes have different classes
|
|
8
|
+
* (`core/refusals.ts`, docs/CHECK_COMPILE_CONTRACT_DESIGN.md §3.1):
|
|
9
|
+
*
|
|
10
|
+
* - `EXPR_UNDECLARED_REF` is `lint`. The serializer can write the read
|
|
11
|
+
* exactly as authored, so `compile` writes it and `check` reports it
|
|
12
|
+
* (`check.ts`). A brownfield `.flow` that already reads a name nothing
|
|
13
|
+
* declares (the designer allows it) still decompiles, compiles and merges.
|
|
14
|
+
* For example `$vars.manualTrigger1` in a flow whose trigger is `start`
|
|
15
|
+
* compiles to the same `$vars.manualTrigger1`; `check` names it.
|
|
16
|
+
* - `EXPR_SYNTAX` is `lowering`: an expression that does not parse has no
|
|
17
|
+
* correct `.flow`, so the serializer refuses it (`FlowBuildError`) and
|
|
18
|
+
* `check` reports it through collect mode.
|
|
19
|
+
*
|
|
20
|
+
* `build()` runs neither: it only assembles the graph, so every path that loads
|
|
21
|
+
* a flow (`check`, `merge`, decompile's lift) can still read one that has these
|
|
22
|
+
* problems.
|
|
18
23
|
*
|
|
19
24
|
* WHY IT ONLY CHECKS REFERENCE ROOTS. The rule is conservative on purpose: it
|
|
20
25
|
* flags only what it can be CERTAIN is wrong — a root that names no declared
|
|
@@ -23,12 +28,12 @@
|
|
|
23
28
|
* wrong offline, so they stay with the `validate` CLI. A first-level check that
|
|
24
29
|
* cried wolf would be worse than none.
|
|
25
30
|
*
|
|
26
|
-
* SCRIPT BODIES ARE NOT CHECKED
|
|
27
|
-
* body
|
|
28
|
-
* the same mechanism and a natural next step, deliberately out of this first cut.
|
|
31
|
+
* SCRIPT BODIES ARE NOT CHECKED HERE — only expressions (`Expr` values). A
|
|
32
|
+
* script body's `$vars.*` reads are `check.ts`'s UNKNOWN_REF.
|
|
29
33
|
*/
|
|
30
34
|
import { Expr, cookedEscapesOf } from './core/expr.js';
|
|
31
|
-
import { checkExpression, cookedEscapeDiagnostics } from './core/expr-check.js';
|
|
35
|
+
import { checkExpression, cookedEscapeDiagnostics, extractRefs } from './core/expr-check.js';
|
|
36
|
+
import { refusalClass } from './core/refusals.js';
|
|
32
37
|
import { stepDeclaredVariables } from './flow-step-variables.js';
|
|
33
38
|
import { CompileRefusal } from './core/compile-refusal.js';
|
|
34
39
|
const NOUN = 'input, variable, or step';
|
|
@@ -114,26 +119,31 @@ function addStepNames(steps, roots) {
|
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
|
-
function pushExpr(e,
|
|
122
|
+
function pushExpr(e, step, roots, out, where = `step "${step}"`) {
|
|
118
123
|
if (e.literal)
|
|
119
124
|
return; // a literal carries no reference to resolve
|
|
125
|
+
// `checkExpression` reports one EXPR_UNDECLARED_REF per undeclared root, in
|
|
126
|
+
// the order `extractRefs` finds them: that order names each finding's root.
|
|
127
|
+
const undeclared = [...new Set(extractRefs(e.js).map((r) => r.root).filter((r) => !roots.has(r)))];
|
|
128
|
+
let i = 0;
|
|
120
129
|
// The cooked escapes ride along so an EXPR_SYNTAX error can name the one that broke the parse.
|
|
121
130
|
for (const d of checkExpression(e.js, { roots, noun: NOUN, syntax: 'javascript' }, cookedEscapesOf(e))) {
|
|
122
|
-
|
|
131
|
+
const root = d.code === 'EXPR_UNDECLARED_REF' ? undeclared[i++] : undefined;
|
|
132
|
+
out.push({ ...d, where, step, ...(root !== undefined ? { root } : {}) });
|
|
123
133
|
}
|
|
124
134
|
}
|
|
125
135
|
/** Reach `Expr`s nested anywhere in an action's inputs (connector/http/… inputs can be structured). */
|
|
126
|
-
function deepExprs(val,
|
|
136
|
+
function deepExprs(val, step, roots, out) {
|
|
127
137
|
if (val instanceof Expr)
|
|
128
|
-
return pushExpr(val,
|
|
138
|
+
return pushExpr(val, step, roots, out);
|
|
129
139
|
if (Array.isArray(val)) {
|
|
130
140
|
for (const v of val)
|
|
131
|
-
deepExprs(v,
|
|
141
|
+
deepExprs(v, step, roots, out);
|
|
132
142
|
return;
|
|
133
143
|
}
|
|
134
144
|
if (val && typeof val === 'object') {
|
|
135
145
|
for (const v of Object.values(val))
|
|
136
|
-
deepExprs(v,
|
|
146
|
+
deepExprs(v, step, roots, out);
|
|
137
147
|
}
|
|
138
148
|
}
|
|
139
149
|
function walk(steps, roots, out) {
|
|
@@ -192,12 +202,16 @@ function walk(steps, roots, out) {
|
|
|
192
202
|
break;
|
|
193
203
|
case 'return':
|
|
194
204
|
for (const [k, v] of Object.entries(s.values))
|
|
195
|
-
pushExpr(v, `return "${k}"
|
|
205
|
+
pushExpr(v, s.options?.name ?? 'return', roots, out, `return "${k}"`);
|
|
196
206
|
break;
|
|
197
207
|
}
|
|
198
208
|
}
|
|
199
209
|
}
|
|
200
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* Every first-level expression problem in a built flow's own scope, each
|
|
212
|
+
* stamped with its location. A subflow's child flow is not visited: it is a
|
|
213
|
+
* scope of its own, which `check` and the serializer visit separately.
|
|
214
|
+
*/
|
|
201
215
|
export function checkFlowExpressions(built) {
|
|
202
216
|
const out = [];
|
|
203
217
|
const roots = globalRoots(built);
|
|
@@ -218,7 +232,7 @@ export function checkFlowExpressions(built) {
|
|
|
218
232
|
* from the built flow, child flows included: a new position cannot be missed.
|
|
219
233
|
*
|
|
220
234
|
* Only `meaning` effects are reported here. An escape that breaks the parse is
|
|
221
|
-
* named by EXPR_SYNTAX, which
|
|
235
|
+
* named by EXPR_SYNTAX, which the serializer refuses.
|
|
222
236
|
*/
|
|
223
237
|
export function checkCookedEscapes(built) {
|
|
224
238
|
const out = [];
|
|
@@ -266,9 +280,22 @@ export function checkCookedEscapes(built) {
|
|
|
266
280
|
return out;
|
|
267
281
|
}
|
|
268
282
|
/**
|
|
269
|
-
*
|
|
270
|
-
* `
|
|
271
|
-
*
|
|
283
|
+
* The expression problems `compile` refuses: every error whose code is
|
|
284
|
+
* `lowering` (`EXPR_SYNTAX`). The serializer throws a {@link FlowBuildError} on
|
|
285
|
+
* them, or reports each one in collect mode.
|
|
286
|
+
*/
|
|
287
|
+
export function loweringExpressionErrors(built) {
|
|
288
|
+
return checkFlowExpressions(built).filter((d) => d.level === 'error' && refusalClass(d.code) === 'lowering');
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Thrown by `serialize()` (so by `compile`) when an expression in the flow
|
|
292
|
+
* cannot be written: today only `EXPR_SYNTAX`, an expression that is not valid
|
|
293
|
+
* JavaScript. Its `message` lists every such problem (so a runner that prints
|
|
294
|
+
* `err.message` shows them all at once); `diagnostics` carries them structured
|
|
295
|
+
* for a caller that wants them.
|
|
296
|
+
*
|
|
297
|
+
* `build()` no longer throws it: an undeclared reference (`EXPR_UNDECLARED_REF`)
|
|
298
|
+
* is `lint`, which `check` reports and `compile` writes as authored.
|
|
272
299
|
*/
|
|
273
300
|
export class FlowBuildError extends CompileRefusal {
|
|
274
301
|
diagnostics;
|
package/dist/flow-sdk.d.ts
CHANGED
|
@@ -1634,7 +1634,9 @@ declare class FlowBuilder extends StepList {
|
|
|
1634
1634
|
* Finish the flow and return the graph the compiler serializes.
|
|
1635
1635
|
*
|
|
1636
1636
|
* @returns The built description — inputs, outputs, variables, trigger and steps.
|
|
1637
|
-
*
|
|
1637
|
+
* It is not checked: `check()` reports what is wrong with it (an expression
|
|
1638
|
+
* reading a name nothing declares, `EXPR_UNDECLARED_REF`), and `serialize()`
|
|
1639
|
+
* refuses what cannot be written (`EXPR_SYNTAX`, as a `FlowBuildError`).
|
|
1638
1640
|
*/
|
|
1639
1641
|
build(): BuiltFlow;
|
|
1640
1642
|
}
|
package/dist/flow-sdk.js
CHANGED
|
@@ -49,7 +49,6 @@ export * from './raw-node.js';
|
|
|
49
49
|
import { err as errRef, toExpr } from './core/expr.js';
|
|
50
50
|
import { FLOW_TYPE_NAMES, nonFlowTypeReplacement } from './flow-types.js';
|
|
51
51
|
import { builtinActionSpec, builtinTriggerSpec, subscriptionFrom } from './core/actions.js';
|
|
52
|
-
import { checkFlowExpressions, FlowBuildError } from './flow-expr-check.js';
|
|
53
52
|
import { FLOW_SCHEMA_VERSIONS } from './format-profile.js';
|
|
54
53
|
import { schemaVersionRefusal } from './schema-version.js';
|
|
55
54
|
import { indexCarriedDefinitions } from './core/carried-definitions.js';
|
|
@@ -1309,7 +1308,9 @@ class FlowBuilder extends StepList {
|
|
|
1309
1308
|
* Finish the flow and return the graph the compiler serializes.
|
|
1310
1309
|
*
|
|
1311
1310
|
* @returns The built description — inputs, outputs, variables, trigger and steps.
|
|
1312
|
-
*
|
|
1311
|
+
* It is not checked: `check()` reports what is wrong with it (an expression
|
|
1312
|
+
* reading a name nothing declares, `EXPR_UNDECLARED_REF`), and `serialize()`
|
|
1313
|
+
* refuses what cannot be written (`EXPR_SYNTAX`, as a `FlowBuildError`).
|
|
1313
1314
|
*/
|
|
1314
1315
|
build() {
|
|
1315
1316
|
const built = {
|
|
@@ -1331,13 +1332,11 @@ class FlowBuilder extends StepList {
|
|
|
1331
1332
|
...(this._triggerId !== undefined ? { triggerId: this._triggerId } : {}),
|
|
1332
1333
|
...(this._openTails ? { openTails: true } : {}),
|
|
1333
1334
|
};
|
|
1334
|
-
//
|
|
1335
|
-
//
|
|
1336
|
-
//
|
|
1337
|
-
//
|
|
1338
|
-
|
|
1339
|
-
if (errors.length)
|
|
1340
|
-
throw new FlowBuildError(built, errors);
|
|
1335
|
+
// No expression check here: every path that loads a flow (`check`, `merge`,
|
|
1336
|
+
// decompile's lift) builds it first, so a throw here hid the file's other
|
|
1337
|
+
// findings and kept a brownfield `.flow` from round-tripping. `check()`
|
|
1338
|
+
// reports EXPR_UNDECLARED_REF (lint); the serializer refuses EXPR_SYNTAX
|
|
1339
|
+
// (lowering). See flow-expr-check.
|
|
1341
1340
|
return built;
|
|
1342
1341
|
}
|
|
1343
1342
|
}
|
package/dist/serialize.js
CHANGED
|
@@ -23,6 +23,7 @@ import { endOutcomeRefusal, fanInRefusal, hitlEndHazards, hitlFanInto } from './
|
|
|
23
23
|
import { resolveVersionCarried } from './core/nodes/versioned.js';
|
|
24
24
|
import { indexCarriedDefinitions } from './core/carried-definitions.js';
|
|
25
25
|
import { sharedDefinition } from './core/shared-definition.js';
|
|
26
|
+
import { FlowBuildError, loweringExpressionErrors } from './flow-expr-check.js';
|
|
26
27
|
import { connectionConnectors } from './bindings-v2.js';
|
|
27
28
|
import { BindingRefusal, bindingLabelRefusal, connectionStubMessage } from './core/binding-messages.js';
|
|
28
29
|
import { OUTCOME_HANDLE_NODE_TYPES, assertHitlExitInvariant, hitlExitViolation } from './core/hitl-routing.js';
|
|
@@ -1940,6 +1941,7 @@ function serializeFlow(built, opts) {
|
|
|
1940
1941
|
const childForks = new Map();
|
|
1941
1942
|
const prefix = claimStepIds(scope, stepNamesOf(child.steps, [], childTerminates, childForks), `subflow "${nodeId}"`, `${nodeId}_`, childNodes.ends.map(safeNodeId), childTerminates, childForks);
|
|
1942
1943
|
claimEndIds(scope, childNodes, `subflow "${nodeId}"`, [], prefix);
|
|
1944
|
+
refuseExpressions(child, scope);
|
|
1943
1945
|
const startId = uid(scope, `${nodeId}Start`);
|
|
1944
1946
|
// A CHILD's inputs are published as the child's own start node, whose id is
|
|
1945
1947
|
// `<caller>Start` — not `start`. `input('x')` lowers eagerly to
|
|
@@ -2510,6 +2512,23 @@ function serializeFlow(built, opts) {
|
|
|
2510
2512
|
...(step !== undefined && subflowPath.length ? { subflows: [...subflowPath] } : {}),
|
|
2511
2513
|
});
|
|
2512
2514
|
}
|
|
2515
|
+
/**
|
|
2516
|
+
* Refuse every expression in `flow`'s own scope that cannot be written
|
|
2517
|
+
* (`loweringExpressionErrors`: `EXPR_SYNTAX`). Compile throws them all as one
|
|
2518
|
+
* `FlowBuildError`; collect mode reports each on its step and goes on, so
|
|
2519
|
+
* `check` lists them beside the file's other findings. An undeclared
|
|
2520
|
+
* reference is `lint` and is written as authored (`check` reports it).
|
|
2521
|
+
*/
|
|
2522
|
+
function refuseExpressions(flow, scope) {
|
|
2523
|
+
const errors = loweringExpressionErrors(flow);
|
|
2524
|
+
if (!errors.length)
|
|
2525
|
+
return;
|
|
2526
|
+
if (!opts.collect)
|
|
2527
|
+
throw new FlowBuildError(flow, errors);
|
|
2528
|
+
for (const d of errors) {
|
|
2529
|
+
record(new CompileRefusal(d.code, `In ${d.where}: ${d.message}`, d.suggestion), d.step, d.step !== undefined ? scope.stepNodeId.get(d.step) : undefined);
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2513
2532
|
/**
|
|
2514
2533
|
* Refuse at a site past a step's own emission (an edge out of it, a port list
|
|
2515
2534
|
* on it, a join it feeds), on the step the refusal is about. Collect mode
|
|
@@ -3427,6 +3446,7 @@ function serializeFlow(built, opts) {
|
|
|
3427
3446
|
namedNodesOf(ep.steps, rootNodes, seenEnds);
|
|
3428
3447
|
claimEndIds(root, rootNodes, `flow "${built.id}"`, [built.triggerId ?? 'start', ...(built.entryPoints ?? []).map((ep) => ep.id)]);
|
|
3429
3448
|
}
|
|
3449
|
+
refuseExpressions(built, root);
|
|
3430
3450
|
const finalTails = emit(built.steps, [{ node: built.triggerId ?? 'start', port: 'output' }], root);
|
|
3431
3451
|
// The implicit End a flow falls off the bottom into still terminates the
|
|
3432
3452
|
// flow, so it maps the flow's outputs — each to itself, since no `.return`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.86.
|
|
3
|
+
"version": "6.86.3",
|
|
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": "10ab9a305a9e66a2bd0b4ca2c5d477d90b8376f6"
|
|
107
107
|
}
|