@uipath/maestro-builder-sdk 6.85.7 → 6.86.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.
- package/dist/api-index.md +5 -5
- package/dist/api-members.md +5 -5
- package/dist/bpmn/bpmn-expr-check.d.ts +13 -5
- package/dist/bpmn/bpmn-expr-check.js +32 -9
- package/dist/bpmn/bpmn-sdk.d.ts +4 -0
- package/dist/bpmn/bpmn-sdk.js +8 -7
- package/dist/bpmn/check.js +26 -0
- package/dist/core/contribution-bindings.d.ts +13 -1
- package/dist/core/contribution-bindings.js +21 -2
- package/dist/core/refusals.d.ts +3 -3
- package/dist/core/refusals.js +3 -3
- package/dist/decompile.js +9 -4
- package/dist/nodes/process/flow/node-type.js +3 -4
- package/dist/nodes/transform/flow/node-type.js +34 -10
- package/dist/nodes/transform/flow/spec.d.ts +6 -1
- package/dist/serialize.d.ts +1 -1
- package/dist/serialize.js +4 -1
- package/package.json +2 -2
package/dist/api-index.md
CHANGED
|
@@ -269,7 +269,7 @@ could hand you spans for a version you do not have.
|
|
|
269
269
|
| `ToolRef` | type | `dist/core/actions.d.ts:398-407` | Supporting types | One tool on an inline agent — a discriminated union over the kinds the tenant's registry actually serves… |
|
|
270
270
|
| `transform` | function | `dist/nodes/transform/flow/factories.d.ts:7-52` | Actions | Declare a Transform action — a chain of declarative operations over a collection. |
|
|
271
271
|
| `Transformation` | type | `dist/nodes/transform/flow/spec.d.ts:25-26` | Supporting types | What a map does to a field's value. |
|
|
272
|
-
| `TransformInputs` | interface | `dist/nodes/transform/flow/spec.d.ts:84-
|
|
272
|
+
| `TransformInputs` | interface | `dist/nodes/transform/flow/spec.d.ts:84-113` | Option shapes | 3 field(s) |
|
|
273
273
|
| `TransformOperation` | type | `dist/nodes/transform/flow/spec.d.ts:43-60` | Supporting types | One link in the chain. |
|
|
274
274
|
| `TransformVariant` | type | `dist/nodes/transform/flow/spec.d.ts:61-77` | Supporting types | Which Transform node type to emit. |
|
|
275
275
|
| `triggerDescriptor` | function | `dist/core/connectors.d.ts:152-164` | Generated descriptors | Brand a trigger descriptor literal with its where/output types. |
|
|
@@ -418,8 +418,8 @@ could hand you spans for a version you do not have.
|
|
|
418
418
|
| `BindingOpts` | interface | `dist/bpmn/bpmn-sdk.d.ts:1046-1113` | Option shapes | Options for `.binding()`. |
|
|
419
419
|
| `BindingsRegistry` | class | `dist/bpmn/bpmn-sdk.d.ts:2101-2125` | Supporting types | Collects `uipath:binding` declarations, de-duped by id. |
|
|
420
420
|
| `BoundaryOpts` | interface | `dist/bpmn/bpmn-sdk.d.ts:773-797` | Option shapes | Options for `.boundaryEvent()`: the activity it attaches to, whether it interrupts that activity, and the event… |
|
|
421
|
-
| `bpmn` | function | `dist/bpmn/bpmn-sdk.d.ts:
|
|
422
|
-
| `BpmnBuilder` | class | `dist/bpmn/bpmn-sdk.d.ts:3564-
|
|
421
|
+
| `bpmn` | function | `dist/bpmn/bpmn-sdk.d.ts:3812-3831` | BPMN authoring | Start building a BPMN process with the given id. |
|
|
422
|
+
| `BpmnBuilder` | class | `dist/bpmn/bpmn-sdk.d.ts:3564-3736` | Builders | The top-level process builder `bpmn()` returns — every graph method of the shared scope (events, gateways, tasks,… |
|
|
423
423
|
| `BpmnConnectorOpts` | type | `dist/bpmn/bpmn-sdk.d.ts:3342-3381` | Option shapes | `.connector()` options: the shared connector options, plus the BPMN-only display `name` and output-variable override. |
|
|
424
424
|
| `BpmnFlow` | interface | `dist/bpmn/bpmn-sdk.d.ts:364-384` | Supporting types | One sequence flow in the built graph — the edge from `source` to `target` (`bpmn:sequenceFlow`). |
|
|
425
425
|
| `BpmnNode` | type | `dist/bpmn/bpmn-sdk.d.ts:90-298` | Supporting types | One node in the built graph — a discriminated union with one arm per BPMN element kind, which the serializer walks into… |
|
|
@@ -447,8 +447,8 @@ could hand you spans for a version you do not have.
|
|
|
447
447
|
| `ErrorHandlerOpts` | interface | `dist/bpmn/bpmn-sdk.d.ts:1852-1864` | Option shapes | Options for ActivityBuilder.onError. |
|
|
448
448
|
| `ErrorLike` | type | `dist/bpmn/bpmn-sdk.d.ts:44-55` | Supporting types | What an author passes for an error definition. |
|
|
449
449
|
| `ErrorMappingRow` | interface | `dist/bpmn/bpmn-sdk.d.ts:299-347` | Supporting types | One row of `uipath:errorMapping` — how an activity classifies one kind of failure. |
|
|
450
|
-
| `errorSchema` | const | `dist/bpmn/bpmn-sdk.d.ts:
|
|
451
|
-
| `errorSchemaWithResponse` | const | `dist/bpmn/bpmn-sdk.d.ts:
|
|
450
|
+
| `errorSchema` | const | `dist/bpmn/bpmn-sdk.d.ts:3737-3778` | BPMN authoring | The `Error` variable's shape — the platform's own error envelope. |
|
|
451
|
+
| `errorSchemaWithResponse` | const | `dist/bpmn/bpmn-sdk.d.ts:3779-3811` | BPMN authoring | The same envelope plus `response` — what a node whose failure carries a payload writes, and what the same source calls… |
|
|
452
452
|
| `EventDef` | type | `dist/bpmn/bpmn-sdk.d.ts:56-74` | Supporting types | The resolved event definition attached to an event node. |
|
|
453
453
|
| `EventFilter` | type | `dist/core/actions.d.ts:927-978` | Supporting types | One filter condition on the event payload. |
|
|
454
454
|
| `EventKind` | type | `dist/bpmn/bpmn-sdk.d.ts:77-78` | Supporting types | The four non-boundary event element kinds a BpmnNode can be. |
|
package/dist/api-members.md
CHANGED
|
@@ -114,7 +114,7 @@ not find it either.
|
|
|
114
114
|
| `break` | method | `StepList` | `dist/flow-sdk.d.ts:1094-1103` |
|
|
115
115
|
| `breakEnabled` | property | `DoWhileOptions` | `dist/flow-sdk.d.ts:425-426` |
|
|
116
116
|
| `breakEnabled` | property | `LoopOptions` | `dist/flow-sdk.d.ts:412-416` |
|
|
117
|
-
| `build` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3726-
|
|
117
|
+
| `build` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3726-3735` |
|
|
118
118
|
| `build` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2066-2071` |
|
|
119
119
|
| `build` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1633-1639` |
|
|
120
120
|
| `businessEvent` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2055-2065` |
|
|
@@ -146,7 +146,7 @@ not find it either.
|
|
|
146
146
|
| `code` | property | `ScriptInputs` | `dist/nodes/script/flow/spec.d.ts:8-9` |
|
|
147
147
|
| `collapsed` | property | `NodeLayout` | `dist/flow-sdk.d.ts:561-562` |
|
|
148
148
|
| `collection` | property | `LoopSpec` | `dist/bpmn/bpmn-sdk.d.ts:81-82` |
|
|
149
|
-
| `collection` | property | `TransformInputs` | `dist/nodes/transform/flow/spec.d.ts:85-
|
|
149
|
+
| `collection` | property | `TransformInputs` | `dist/nodes/transform/flow/spec.d.ts:85-100` |
|
|
150
150
|
| `color` | property | `StickyNote` | `dist/flow-sdk.d.ts:667-668` |
|
|
151
151
|
| `colSpan` | property | `FormFieldSettings` | `dist/core/actions.d.ts:187-188` |
|
|
152
152
|
| `completeWhen` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2035-2045` |
|
|
@@ -842,7 +842,7 @@ not find it either.
|
|
|
842
842
|
| `operation` | property | `ExternalEventPair` | `dist/case/case-sdk.d.ts:695-696` |
|
|
843
843
|
| `operation` | property | `PendingDataServiceEntity` | `dist/bpmn/data-service.d.ts:172-173` |
|
|
844
844
|
| `operation` | property | `WaitConnectorPlaceholderSpec` | `dist/case/case-sdk.d.ts:471-472` |
|
|
845
|
-
| `operations` | property | `TransformInputs` | `dist/nodes/transform/flow/spec.d.ts:
|
|
845
|
+
| `operations` | property | `TransformInputs` | `dist/nodes/transform/flow/spec.d.ts:111-112` |
|
|
846
846
|
| `operator` | property | `DataFabricFilter` | `dist/nodes/data-fabric/flow/spec.d.ts:30-31` |
|
|
847
847
|
| `operator` | property | `FormFieldRule` | `dist/core/actions.d.ts:159-160` |
|
|
848
848
|
| `options` | property | `ActionField` | `dist/case/case-sdk.d.ts:801-805` |
|
|
@@ -1208,7 +1208,7 @@ not find it either.
|
|
|
1208
1208
|
| `to` | property | `CreateOutgoingCallInputs` | `dist/nodes/agent/flow/spec.d.ts:93-94` |
|
|
1209
1209
|
| `tool` | property | `BuiltinToolRef` | `dist/core/actions.d.ts:571-572` |
|
|
1210
1210
|
| `tools` | property | `InlineAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:374-396` |
|
|
1211
|
-
| `transform` | property | `FlowActionSpecs` | `dist/nodes/transform/flow/spec.d.ts:
|
|
1211
|
+
| `transform` | property | `FlowActionSpecs` | `dist/nodes/transform/flow/spec.d.ts:116-119` |
|
|
1212
1212
|
| `transformation` | property | `FieldMapping` | `dist/nodes/transform/flow/spec.d.ts:30-31` |
|
|
1213
1213
|
| `trigger` | property | `BuiltEntryPoint` | `dist/flow-sdk.d.ts:696-697` |
|
|
1214
1214
|
| `trigger` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:722-724` |
|
|
@@ -1298,7 +1298,7 @@ not find it either.
|
|
|
1298
1298
|
| `variables` | property | `BuiltBpmn` | `dist/bpmn/bpmn-sdk.d.ts:519-520` |
|
|
1299
1299
|
| `variant` | property | `EscalationRef` | `dist/core/actions.d.ts:717-725` |
|
|
1300
1300
|
| `variant` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:321-325` |
|
|
1301
|
-
| `variant` | property | `TransformInputs` | `dist/nodes/transform/flow/spec.d.ts:
|
|
1301
|
+
| `variant` | property | `TransformInputs` | `dist/nodes/transform/flow/spec.d.ts:101-110` |
|
|
1302
1302
|
| `vars` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1132` |
|
|
1303
1303
|
| `vars` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:720` |
|
|
1304
1304
|
| `vars` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3300-3325` |
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* bpmn-expr-check — the BPMN adapter over the shared `core/expr-check`, run by
|
|
3
|
-
* `
|
|
3
|
+
* `check()` (`checkExpressions` in check.ts). Its codes are `lint` (decided on #1712):
|
|
4
|
+
* the serializer writes the read as authored and `bpmn compile` does not refuse it.
|
|
5
|
+
* Not by `BpmnBuilder.build()`: a throw there stopped every path that builds first,
|
|
6
|
+
* so such a process could not be checked, merged or round-tripped (#1676).
|
|
4
7
|
*
|
|
5
8
|
* A BPMN `=`-expression reads a declared variable as `=vars.<name>` (a gateway
|
|
6
9
|
* flow `condition`, a script `input`, a multi-instance `collection`/`completion`,
|
|
@@ -27,14 +30,19 @@ import { CompileRefusal } from '../core/compile-refusal.js';
|
|
|
27
30
|
/** A diagnostic plus the element it was found in. */
|
|
28
31
|
export interface BpmnLocatedDiagnostic extends ExprDiagnostic {
|
|
29
32
|
where: string;
|
|
33
|
+
/** The id of the flow or element the expression is on. */
|
|
34
|
+
elementId?: string;
|
|
30
35
|
}
|
|
31
36
|
/** Every first-level expression problem in a built BPMN process, stamped with its location. */
|
|
32
37
|
export declare function checkBpmnExpressions(built: BuiltBpmn): BpmnLocatedDiagnostic[];
|
|
33
38
|
/**
|
|
34
|
-
*
|
|
35
|
-
* undeclared `vars.<name>` reference.
|
|
36
|
-
*
|
|
37
|
-
*
|
|
39
|
+
* Was thrown by `BpmnBuilder.build()` when the first-level expression check found an
|
|
40
|
+
* undeclared `vars.<name>` reference. `message` lists every problem; `diagnostics`
|
|
41
|
+
* carries them structured.
|
|
42
|
+
*
|
|
43
|
+
* @deprecated Nothing throws it since #1676: `check()` reports the same diagnostics,
|
|
44
|
+
* and `compile` writes the read as authored (the codes are `lint`). Kept so code
|
|
45
|
+
* that names the class still compiles.
|
|
38
46
|
*/
|
|
39
47
|
export declare class BpmnBuildError extends CompileRefusal {
|
|
40
48
|
readonly diagnostics: BpmnLocatedDiagnostic[];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* bpmn-expr-check — the BPMN adapter over the shared `core/expr-check`, run by
|
|
3
|
-
* `
|
|
3
|
+
* `check()` (`checkExpressions` in check.ts). Its codes are `lint` (decided on #1712):
|
|
4
|
+
* the serializer writes the read as authored and `bpmn compile` does not refuse it.
|
|
5
|
+
* Not by `BpmnBuilder.build()`: a throw there stopped every path that builds first,
|
|
6
|
+
* so such a process could not be checked, merged or round-tripped (#1676).
|
|
4
7
|
*
|
|
5
8
|
* A BPMN `=`-expression reads a declared variable as `=vars.<name>` (a gateway
|
|
6
9
|
* flow `condition`, a script `input`, a multi-instance `collection`/`completion`,
|
|
@@ -85,10 +88,25 @@ function walk(nodes, flows, rootsIn, out) {
|
|
|
85
88
|
for (const n of nodes)
|
|
86
89
|
for (const name of nodeDeclaredVars(n))
|
|
87
90
|
roots.vars.add(name);
|
|
88
|
-
for (const f of flows)
|
|
89
|
-
|
|
91
|
+
for (const f of flows) {
|
|
92
|
+
const found = [];
|
|
93
|
+
checkExpr(f.condition, `flow "${f.id}" condition`, roots, found);
|
|
94
|
+
for (const d of found)
|
|
95
|
+
out.push({ ...d, elementId: f.id });
|
|
96
|
+
}
|
|
90
97
|
for (const n of nodes) {
|
|
91
|
-
|
|
98
|
+
walkNode(n, roots, out);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** The expressions on one node, each finding stamped with its id; a sub-process recurses into its own scope. */
|
|
102
|
+
function walkNode(n, roots, located) {
|
|
103
|
+
const at = `${n.kind} "${n.id}"`;
|
|
104
|
+
const out = [];
|
|
105
|
+
const flush = () => {
|
|
106
|
+
for (const d of out.splice(0))
|
|
107
|
+
located.push({ ...d, elementId: n.id });
|
|
108
|
+
};
|
|
109
|
+
{
|
|
92
110
|
// An errorMapping row's `condition` is an expression on EVERY activity kind, so
|
|
93
111
|
// it is checked before the per-kind arms rather than inside them. Worth checking
|
|
94
112
|
// here specifically because the CANVAS treats an undeclared reference in it as a
|
|
@@ -159,9 +177,11 @@ function walk(nodes, flows, rootsIn, out) {
|
|
|
159
177
|
subRoots.varIds.add(v.id);
|
|
160
178
|
}
|
|
161
179
|
checkExpr(n.loop?.completion, `${at} loop completion`, subRoots, out);
|
|
162
|
-
|
|
180
|
+
flush();
|
|
181
|
+
walk(n.nodes, n.flows, subRoots, located);
|
|
163
182
|
}
|
|
164
183
|
}
|
|
184
|
+
flush();
|
|
165
185
|
}
|
|
166
186
|
/** Every first-level expression problem in a built BPMN process, stamped with its location. */
|
|
167
187
|
export function checkBpmnExpressions(built) {
|
|
@@ -209,10 +229,13 @@ function connectorBindingNames(nodes) {
|
|
|
209
229
|
return out;
|
|
210
230
|
}
|
|
211
231
|
/**
|
|
212
|
-
*
|
|
213
|
-
* undeclared `vars.<name>` reference.
|
|
214
|
-
*
|
|
215
|
-
*
|
|
232
|
+
* Was thrown by `BpmnBuilder.build()` when the first-level expression check found an
|
|
233
|
+
* undeclared `vars.<name>` reference. `message` lists every problem; `diagnostics`
|
|
234
|
+
* carries them structured.
|
|
235
|
+
*
|
|
236
|
+
* @deprecated Nothing throws it since #1676: `check()` reports the same diagnostics,
|
|
237
|
+
* and `compile` writes the read as authored (the codes are `lint`). Kept so code
|
|
238
|
+
* that names the class still compiles.
|
|
216
239
|
*/
|
|
217
240
|
export class BpmnBuildError extends CompileRefusal {
|
|
218
241
|
diagnostics;
|
package/dist/bpmn/bpmn-sdk.d.ts
CHANGED
|
@@ -3726,6 +3726,10 @@ export declare class BpmnBuilder extends ScopeBuilder {
|
|
|
3726
3726
|
/**
|
|
3727
3727
|
* Finish the process and return the graph the serializer turns into XML.
|
|
3728
3728
|
*
|
|
3729
|
+
* It does not check expressions: `check()` reports an undeclared `vars.<name>` read
|
|
3730
|
+
* and `compile` writes it as authored, so a process that already reads one can be
|
|
3731
|
+
* checked, merged and round-tripped.
|
|
3732
|
+
*
|
|
3729
3733
|
* @returns The built process — its elements, flows and variables.
|
|
3730
3734
|
*/
|
|
3731
3735
|
build(): BuiltBpmn;
|
package/dist/bpmn/bpmn-sdk.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { connector as makeConnector } from '../core/actions.js';
|
|
2
|
-
import { checkBpmnExpressions, BpmnBuildError } from './bpmn-expr-check.js';
|
|
3
2
|
import { BPMN_SCHEMA_VERSIONS } from './format-profile.js';
|
|
4
3
|
import { schemaVersionRefusal } from '../schema-version.js';
|
|
5
4
|
import { bindingRequiredFields, REGISTRY_GAPS, registryType } from './typed-node.js';
|
|
@@ -2899,6 +2898,10 @@ export class BpmnBuilder extends ScopeBuilder {
|
|
|
2899
2898
|
/**
|
|
2900
2899
|
* Finish the process and return the graph the serializer turns into XML.
|
|
2901
2900
|
*
|
|
2901
|
+
* It does not check expressions: `check()` reports an undeclared `vars.<name>` read
|
|
2902
|
+
* and `compile` writes it as authored, so a process that already reads one can be
|
|
2903
|
+
* checked, merged and round-tripped.
|
|
2904
|
+
*
|
|
2902
2905
|
* @returns The built process — its elements, flows and variables.
|
|
2903
2906
|
*/
|
|
2904
2907
|
build() {
|
|
@@ -2966,12 +2969,10 @@ export class BpmnBuilder extends ScopeBuilder {
|
|
|
2966
2969
|
schemas: this._schemas,
|
|
2967
2970
|
preservation: this._preservation,
|
|
2968
2971
|
};
|
|
2969
|
-
//
|
|
2970
|
-
//
|
|
2971
|
-
//
|
|
2972
|
-
|
|
2973
|
-
if (errors.length)
|
|
2974
|
-
throw new BpmnBuildError(built, errors);
|
|
2972
|
+
// No expression check here: `check()` reports an undeclared `vars.<name>` read,
|
|
2973
|
+
// and `compile` writes it as authored (both codes are `lint`, decided on #1712).
|
|
2974
|
+
// It threw here, and every path builds first, so a process that already read one
|
|
2975
|
+
// could not be checked, merged or round-tripped (#1676).
|
|
2975
2976
|
return built;
|
|
2976
2977
|
}
|
|
2977
2978
|
}
|
package/dist/bpmn/check.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { checkBpmnExpressions } from './bpmn-expr-check.js';
|
|
1
2
|
import { allNodes, collectSerializerRefusals, folderCompanionKeys, implicitNodeVars, processId } from './serialize.js';
|
|
2
3
|
import { KNOWN_METHOD_SET } from './known-methods.js';
|
|
3
4
|
import { EQUALS_EXPR_DIALECT, checkConnectorLookups, checkConnectorResources, checkConnectorSchema, } from '../core/connector-checks.js';
|
|
@@ -87,6 +88,7 @@ export function check(built, opts = {}) {
|
|
|
87
88
|
const diags = [];
|
|
88
89
|
// Duplicate and missing ids (`documentIdProblems`) are the serializer's.
|
|
89
90
|
checkScope(built.nodes, built.flows, 'process', diags, true);
|
|
91
|
+
checkExpressions(built, diags);
|
|
90
92
|
checkScopedVars(built, diags);
|
|
91
93
|
checkVariableOrder(built, diags);
|
|
92
94
|
checkFolderBindings(built, diags);
|
|
@@ -100,6 +102,30 @@ export function check(built, opts = {}) {
|
|
|
100
102
|
diags.push(...serializerRefusals(built, opts, diags));
|
|
101
103
|
return diags;
|
|
102
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* The first-level expression check (bpmn-expr-check): an undeclared `vars.<name>` or
|
|
107
|
+
* `bindings.<name>` read, or a declared variable read without `vars.`.
|
|
108
|
+
*
|
|
109
|
+
* Both codes are `lint` (decided on #1712): the serializer writes the read exactly as
|
|
110
|
+
* authored, so `compile` writes it and `check` is where it is reported. It ran in
|
|
111
|
+
* `BpmnBuilder.build()` and threw, which stopped every path that builds first, so a
|
|
112
|
+
* process that already read an undeclared variable could not be checked, merged or
|
|
113
|
+
* round-tripped (#1676).
|
|
114
|
+
*/
|
|
115
|
+
function checkExpressions(built, diags) {
|
|
116
|
+
const nodeIds = new Set(allNodes(built.nodes).map((n) => n.id));
|
|
117
|
+
for (const d of checkBpmnExpressions(built)) {
|
|
118
|
+
diags.push({
|
|
119
|
+
level: d.level,
|
|
120
|
+
code: d.code,
|
|
121
|
+
// The suggestion goes in the message too: the CLI prints `[code] message` only.
|
|
122
|
+
message: `in ${d.where}: ${d.message}${d.suggestion ? ` (did you mean "${d.suggestion}"?)` : ''}`,
|
|
123
|
+
where: d.elementId ?? d.where,
|
|
124
|
+
...(d.suggestion ? { suggestion: d.suggestion } : {}),
|
|
125
|
+
...(d.elementId !== undefined && nodeIds.has(d.elementId) ? { nodeId: d.elementId } : {}),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
103
129
|
/**
|
|
104
130
|
* Every refusal `compile` would raise for `built`: the serializer's model step,
|
|
105
131
|
* run in collect mode (`collectSerializerRefusals`), each placed on its element.
|
|
@@ -49,12 +49,24 @@ export interface ContributionBindingPlan {
|
|
|
49
49
|
}
|
|
50
50
|
/** The `<bindings.NAME>` names a definition's `model.context` references, in order, once each. */
|
|
51
51
|
export declare function referencedBindingNames(model: any): string[];
|
|
52
|
+
/**
|
|
53
|
+
* A definition's `model.bindings.values` as descriptor rows (`{ name, default }`).
|
|
54
|
+
* Two shapes are in the field. The current one is rows,
|
|
55
|
+
* `[{ name: 'name', default: 'Notifier' }]`. Older Studio Web files carry an
|
|
56
|
+
* object keyed by name, `{ name: 'API Workflow', folderPath: '' }`, whose values
|
|
57
|
+
* are the defaults: for instance a `uipath.core.api.<key>` node the designer
|
|
58
|
+
* wrote before the type was renamed `uipath.core.api-workflow.<key>`. Reading
|
|
59
|
+
* only rows made compile refuse such a canvas node as
|
|
60
|
+
* CONTRIBUTION_BINDING_UNRESOLVED ("declares no "name" row"), so it could not
|
|
61
|
+
* round-trip (#1674). The process lift reads both shapes the same way.
|
|
62
|
+
*/
|
|
63
|
+
export declare function bindingValueRows(values: unknown): any[];
|
|
52
64
|
/**
|
|
53
65
|
* Plan the entries a contribution-lowered node needs: for each `<bindings.NAME>`
|
|
54
66
|
* its definition's `model.context` references and `supplied` does not cover, one
|
|
55
67
|
* entry built from the definition — `resource`, `resourceKey`, `resourceSubType`
|
|
56
68
|
* from `model.bindings`, and `name`, `default`, `propertyAttribute` from the
|
|
57
|
-
* matching `model.bindings.values` row.
|
|
69
|
+
* matching `model.bindings.values` row (either shape, {@link bindingValueRows}).
|
|
58
70
|
*
|
|
59
71
|
* A supplied entry covers a name when it has the same `resource` and `name`: the
|
|
60
72
|
* contributor's own bindings win, as they always did.
|
|
@@ -36,12 +36,31 @@ export function referencedBindingNames(model) {
|
|
|
36
36
|
}
|
|
37
37
|
return names;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* A definition's `model.bindings.values` as descriptor rows (`{ name, default }`).
|
|
41
|
+
* Two shapes are in the field. The current one is rows,
|
|
42
|
+
* `[{ name: 'name', default: 'Notifier' }]`. Older Studio Web files carry an
|
|
43
|
+
* object keyed by name, `{ name: 'API Workflow', folderPath: '' }`, whose values
|
|
44
|
+
* are the defaults: for instance a `uipath.core.api.<key>` node the designer
|
|
45
|
+
* wrote before the type was renamed `uipath.core.api-workflow.<key>`. Reading
|
|
46
|
+
* only rows made compile refuse such a canvas node as
|
|
47
|
+
* CONTRIBUTION_BINDING_UNRESOLVED ("declares no "name" row"), so it could not
|
|
48
|
+
* round-trip (#1674). The process lift reads both shapes the same way.
|
|
49
|
+
*/
|
|
50
|
+
export function bindingValueRows(values) {
|
|
51
|
+
if (Array.isArray(values))
|
|
52
|
+
return values;
|
|
53
|
+
if (values === null || typeof values !== 'object')
|
|
54
|
+
return [];
|
|
55
|
+
return Object.entries(values)
|
|
56
|
+
.map(([name, value]) => (typeof value === 'string' ? { name, default: value } : { name }));
|
|
57
|
+
}
|
|
39
58
|
/**
|
|
40
59
|
* Plan the entries a contribution-lowered node needs: for each `<bindings.NAME>`
|
|
41
60
|
* its definition's `model.context` references and `supplied` does not cover, one
|
|
42
61
|
* entry built from the definition — `resource`, `resourceKey`, `resourceSubType`
|
|
43
62
|
* from `model.bindings`, and `name`, `default`, `propertyAttribute` from the
|
|
44
|
-
* matching `model.bindings.values` row.
|
|
63
|
+
* matching `model.bindings.values` row (either shape, {@link bindingValueRows}).
|
|
45
64
|
*
|
|
46
65
|
* A supplied entry covers a name when it has the same `resource` and `name`: the
|
|
47
66
|
* contributor's own bindings win, as they always did.
|
|
@@ -78,7 +97,7 @@ export function planContributionBindings(def, supplied = []) {
|
|
|
78
97
|
+ `${def?.nodeType}\` returns for a real resource, or return the bindings from contribute().`),
|
|
79
98
|
};
|
|
80
99
|
}
|
|
81
|
-
const values =
|
|
100
|
+
const values = bindingValueRows(model.bindings.values);
|
|
82
101
|
const subType = model.bindings.resourceSubType;
|
|
83
102
|
const entries = [];
|
|
84
103
|
const problems = [];
|
package/dist/core/refusals.d.ts
CHANGED
|
@@ -328,9 +328,9 @@ export declare const REFUSALS: {
|
|
|
328
328
|
readonly EVENT_UNPREPARED: "lint";
|
|
329
329
|
readonly EVENT_WHERE_NOT_SCALAR: "lowering";
|
|
330
330
|
readonly EXCEPTION_STAGE_REQUIRED: "lint";
|
|
331
|
-
readonly EXPR_BARE_VAR_REF: "
|
|
331
|
+
readonly EXPR_BARE_VAR_REF: "lint";
|
|
332
332
|
readonly EXPR_SYNTAX: "lowering";
|
|
333
|
-
readonly EXPR_UNDECLARED_REF: "
|
|
333
|
+
readonly EXPR_UNDECLARED_REF: "lint";
|
|
334
334
|
readonly EXTERNAL_TASK_CONNECTION: "lowering";
|
|
335
335
|
readonly EXTERNAL_TASK_DESCRIPTOR: "lint";
|
|
336
336
|
readonly EXTERNAL_TASK_DESCRIPTOR_CONTRACT: "lowering";
|
|
@@ -735,7 +735,7 @@ export declare const REFUSALS: {
|
|
|
735
735
|
readonly TRANSFORM_FILTER_NO_FIELD: "lint";
|
|
736
736
|
readonly TRANSFORM_FILTER_VALUE_EXPR: "lint";
|
|
737
737
|
readonly TRANSFORM_MAP_NO_FIELD: "lint";
|
|
738
|
-
readonly TRANSFORM_NO_COLLECTION: "
|
|
738
|
+
readonly TRANSFORM_NO_COLLECTION: "draft";
|
|
739
739
|
readonly TRANSFORM_NO_GROUP_FIELD: "lint";
|
|
740
740
|
readonly TRANSFORM_NO_OPERATIONS: "lint";
|
|
741
741
|
readonly TRANSFORM_UNKNOWN_OP: "lowering";
|
package/dist/core/refusals.js
CHANGED
|
@@ -401,9 +401,9 @@ export const REFUSALS = {
|
|
|
401
401
|
EVENT_UNPREPARED: 'lint',
|
|
402
402
|
EVENT_WHERE_NOT_SCALAR: 'lowering',
|
|
403
403
|
EXCEPTION_STAGE_REQUIRED: 'lint',
|
|
404
|
-
EXPR_BARE_VAR_REF: '
|
|
404
|
+
EXPR_BARE_VAR_REF: 'lint',
|
|
405
405
|
EXPR_SYNTAX: 'lowering',
|
|
406
|
-
EXPR_UNDECLARED_REF: '
|
|
406
|
+
EXPR_UNDECLARED_REF: 'lint',
|
|
407
407
|
EXTERNAL_TASK_CONNECTION: 'lowering',
|
|
408
408
|
EXTERNAL_TASK_DESCRIPTOR: 'lint',
|
|
409
409
|
EXTERNAL_TASK_DESCRIPTOR_CONTRACT: 'lowering',
|
|
@@ -808,7 +808,7 @@ export const REFUSALS = {
|
|
|
808
808
|
TRANSFORM_FILTER_NO_FIELD: 'lint',
|
|
809
809
|
TRANSFORM_FILTER_VALUE_EXPR: 'lint',
|
|
810
810
|
TRANSFORM_MAP_NO_FIELD: 'lint',
|
|
811
|
-
TRANSFORM_NO_COLLECTION: '
|
|
811
|
+
TRANSFORM_NO_COLLECTION: 'draft',
|
|
812
812
|
TRANSFORM_NO_GROUP_FIELD: 'lint',
|
|
813
813
|
TRANSFORM_NO_OPERATIONS: 'lint',
|
|
814
814
|
TRANSFORM_UNKNOWN_OP: 'lowering',
|
package/dist/decompile.js
CHANGED
|
@@ -50,7 +50,7 @@ import { OUTCOME_HANDLE_NODE_TYPES } from './core/hitl-routing.js';
|
|
|
50
50
|
import { contributionPort, forwardFanOut } from './core/definition-handles.js';
|
|
51
51
|
import { STICKY_NOTE_TYPE } from './core/definitionless-node-types.js';
|
|
52
52
|
import { eventFilterFromTreeLeaf } from './core/event-filters.js';
|
|
53
|
-
import { referencedBindingNames } from './core/contribution-bindings.js';
|
|
53
|
+
import { bindingValueRows, referencedBindingNames } from './core/contribution-bindings.js';
|
|
54
54
|
import { builtChainSource, chainStatements } from './core/builder-chain.js';
|
|
55
55
|
/**
|
|
56
56
|
* The trigger id of the flow currently being decompiled, so a reference through a
|
|
@@ -1068,7 +1068,7 @@ function resolveTemplateBindings(def, node) {
|
|
|
1068
1068
|
const bound = typeof model.bindings.resourceKey === 'string' && model.bindings.resourceKey !== '';
|
|
1069
1069
|
const nodeModel = node.model;
|
|
1070
1070
|
const nodeContext = Array.isArray(nodeModel?.context) ? nodeModel.context : [];
|
|
1071
|
-
const nodeValues =
|
|
1071
|
+
const nodeValues = bindingValueRows(nodeModel?.bindings?.values);
|
|
1072
1072
|
const keys = new Map();
|
|
1073
1073
|
const defaults = new Map();
|
|
1074
1074
|
const missing = [];
|
|
@@ -1107,7 +1107,8 @@ function resolveTemplateBindings(def, node) {
|
|
|
1107
1107
|
const each = [...keys].map(([n, k]) => `"${n}" → ${k}`).join(', ');
|
|
1108
1108
|
return { def, reason: `${label} names more than one ${resource} (${each}), so its definition stays the template.` };
|
|
1109
1109
|
}
|
|
1110
|
-
|
|
1110
|
+
// Rows, or the older object keyed by name (`bindingValueRows`), each kept in its own shape.
|
|
1111
|
+
const values = model.bindings.values;
|
|
1111
1112
|
return {
|
|
1112
1113
|
def: {
|
|
1113
1114
|
...def,
|
|
@@ -1116,7 +1117,11 @@ function resolveTemplateBindings(def, node) {
|
|
|
1116
1117
|
bindings: {
|
|
1117
1118
|
...model.bindings,
|
|
1118
1119
|
resourceKey: distinct[0],
|
|
1119
|
-
values:
|
|
1120
|
+
values: Array.isArray(values)
|
|
1121
|
+
? values.map((v) => (defaults.has(v?.name) ? { ...v, default: defaults.get(v.name) } : v))
|
|
1122
|
+
: values !== null && typeof values === 'object'
|
|
1123
|
+
? Object.fromEntries(Object.entries(values).map(([n, v]) => [n, defaults.has(n) ? defaults.get(n) : v]))
|
|
1124
|
+
: values,
|
|
1120
1125
|
},
|
|
1121
1126
|
},
|
|
1122
1127
|
},
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* and 4l entries list.
|
|
12
12
|
*/
|
|
13
13
|
import { AGENTIC_PROCESS_FORMS } from '../../../core/agentic-process-forms.js';
|
|
14
|
+
import { bindingValueRows } from '../../../core/contribution-bindings.js';
|
|
14
15
|
import { definitionHasErrorPort } from '../../../core/error-port.js';
|
|
15
16
|
import { Expr } from '../../../core/expr.js';
|
|
16
17
|
import { ownEntry } from '../../../core/own-entry.js';
|
|
@@ -719,11 +720,9 @@ function liftProcess(node, ctx, prefix, kind, form) {
|
|
|
719
720
|
const key = n.type.slice(prefix.length);
|
|
720
721
|
const def = ctx.definition();
|
|
721
722
|
// Descriptor rows (`[{ name, default }]`), or the early `{ name, folderPath }` object.
|
|
722
|
-
const values = def?.model?.bindings?.values;
|
|
723
|
+
const values = bindingValueRows(def?.model?.bindings?.values);
|
|
723
724
|
const binding = (name) => {
|
|
724
|
-
const v =
|
|
725
|
-
? values.find((r) => r?.name === name)?.default
|
|
726
|
-
: values !== null && typeof values === 'object' ? values[name] : undefined;
|
|
725
|
+
const v = values.find((r) => r?.name === name)?.default;
|
|
727
726
|
return typeof v === 'string' ? v : undefined;
|
|
728
727
|
};
|
|
729
728
|
const name = binding('name');
|
|
@@ -80,22 +80,32 @@ function transformInputs(inputs, ctx) {
|
|
|
80
80
|
},
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
|
-
|
|
83
|
+
const collection = collectionPath(inputs.collection, ctx);
|
|
84
|
+
return { ...(collection !== undefined ? { collection: ctx.renameRefs(collection) } : {}), operations };
|
|
84
85
|
}
|
|
85
86
|
/**
|
|
86
87
|
* The `collection` string. A bare reference (`v('x')` / `out('s','p')`) is
|
|
87
88
|
* already the path the runtime wants, so it is emitted verbatim. Anything else
|
|
88
89
|
* has no faithful path form, so it is refused here rather than written (#1518):
|
|
89
|
-
* a missing one would be the string "undefined",
|
|
90
|
+
* a missing one would be the string "undefined" (undefined, so no key at all,
|
|
91
|
+
* for a canvas draft in a draft compile, #1674), a raw array "[object Object]",
|
|
90
92
|
* a raw string `items` reads back as the expression js`items`, and `lit([1,2])`
|
|
91
93
|
* would be "[1,2]", the same text as js`[1,2]`. `compile` does not run `check`
|
|
92
94
|
* (#1497), so this is the only place that stops them. A computed expression
|
|
93
95
|
* (TRANSFORM_COLLECTION_NOT_PATH) is written as its own text, so it stays
|
|
94
96
|
* `check`'s.
|
|
95
97
|
*/
|
|
96
|
-
function collectionPath(collection,
|
|
98
|
+
function collectionPath(collection, ctx) {
|
|
99
|
+
const step = ctx.step;
|
|
97
100
|
if (collection === undefined || collection === null) {
|
|
98
|
-
|
|
101
|
+
const message = `Transform "${step}" has no collection. Point it at the variable or step output holding the array.`;
|
|
102
|
+
// A Transform the canvas saved before its collection was picked (a draft
|
|
103
|
+
// compile, `{ draft: true }`) is written as the file has it: no collection.
|
|
104
|
+
if (ctx.drafting) {
|
|
105
|
+
ctx.draft('TRANSFORM_NO_COLLECTION', message);
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
throw new CompileRefusal('TRANSFORM_NO_COLLECTION', message, `collection: v('catalog')`);
|
|
99
109
|
}
|
|
100
110
|
if (!(collection instanceof Expr)) {
|
|
101
111
|
// Types are stripped at run time, so `collection: [{…}]` or
|
|
@@ -104,12 +114,9 @@ function collectionPath(collection, step) {
|
|
|
104
114
|
+ `collection. That field is a variable PATH — the runtime turns the string into a lookup, so a value there `
|
|
105
115
|
+ `resolves to nothing and the transform silently sees an empty collection.`, typeof collection === 'string' ? `collection: v('${collection}')` : `collection: v('<varName>')`);
|
|
106
116
|
}
|
|
107
|
-
// A decompiled canvas Transform with no collection prints as `lit([])`
|
|
108
|
-
// (`printTransform`), so recompiling it stops here too: this message names
|
|
109
|
-
// the fix for that file as well as for authored inline data.
|
|
110
117
|
if (collection.literal) {
|
|
111
118
|
throw new CompileRefusal('TRANSFORM_COLLECTION_LITERAL', `Transform "${step}" has a literal collection, and that field is a variable PATH, so inline data has no `
|
|
112
|
-
+ `form there.
|
|
119
|
+
+ `form there. Bind `
|
|
113
120
|
+ `\`collection\` to a variable or step output, e.g. \`v('<var>')\`; for inline data, keep the array in a `
|
|
114
121
|
+ `variable default (\`.var('items', types.array, [...])\`) and reference it.`, `collection: v('<var>')`);
|
|
115
122
|
}
|
|
@@ -151,7 +158,10 @@ function transformOutputs(base) {
|
|
|
151
158
|
*/
|
|
152
159
|
function liftTransform(node, variant, ctx) {
|
|
153
160
|
const inputs = node.inputs ?? {};
|
|
154
|
-
|
|
161
|
+
// A blank collection is no collection, as `flow validate` reads it (DATA_TRANSFORM_INCOMPLETE trims it):
|
|
162
|
+
// it lifts as none, so a draft prints with no `collection` instead of js`` (EXPR_SYNTAX).
|
|
163
|
+
const text = ctx.sourceText(inputs.collection);
|
|
164
|
+
const raw = text !== undefined && wireExprBody(text).trim() !== '' ? text : undefined;
|
|
155
165
|
const ops = Array.isArray(inputs.operations) ? inputs.operations : [];
|
|
156
166
|
const operations = ops.map((op) => {
|
|
157
167
|
const cfg = op?.config ?? {};
|
|
@@ -173,6 +183,18 @@ function liftTransform(node, variant, ctx) {
|
|
|
173
183
|
},
|
|
174
184
|
};
|
|
175
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Whether a saved Transform is a draft: the canvas saved it before a collection
|
|
188
|
+
* was picked (no `inputs.collection`). Decompile then marks its step
|
|
189
|
+
* `{ draft: true }` and carries its definition, and compile writes it back with
|
|
190
|
+
* no collection (#1674).
|
|
191
|
+
*/
|
|
192
|
+
function isTransformDraft(node) {
|
|
193
|
+
const c = node.inputs?.collection;
|
|
194
|
+
if (c === undefined || c === null)
|
|
195
|
+
return true;
|
|
196
|
+
return typeof c === 'string' && wireExprBody(c).trim() === '';
|
|
197
|
+
}
|
|
176
198
|
/** `{ k: v, … }` from entries (the decompiler's `objLit`): `''` when there are none. */
|
|
177
199
|
function obj(entries, ctx) {
|
|
178
200
|
return entries.length === 0 ? '' : `{ ${entries.map(([k, v]) => `${ctx.key(k)}: ${v}`).join(', ')} }`;
|
|
@@ -216,7 +238,8 @@ function printTransform({ inputs }, ctx) {
|
|
|
216
238
|
['aggregations', `[${aggs.join(', ')}]`],
|
|
217
239
|
], ctx);
|
|
218
240
|
});
|
|
219
|
-
|
|
241
|
+
// No collection (a canvas draft, #1674) prints as none: the step is marked `{ draft: true }`.
|
|
242
|
+
const collection = inputs.collection !== undefined ? ctx.value(inputs.collection) : undefined;
|
|
220
243
|
return {
|
|
221
244
|
factory: 'transform',
|
|
222
245
|
options: [
|
|
@@ -245,6 +268,7 @@ function transformAt(typeName, variant, version, factory) {
|
|
|
245
268
|
return { inputs: transformInputs(inputs, ctx), ...(typed !== base ? { outputs: typed } : {}) };
|
|
246
269
|
},
|
|
247
270
|
deserialize: (node, ctx) => liftTransform(node, variant, ctx),
|
|
271
|
+
isDraft: (node) => isTransformDraft(node),
|
|
248
272
|
print: printTransform,
|
|
249
273
|
check: ({ inputs }, ctx) => checkTransform(inputs, ctx),
|
|
250
274
|
// The only expression a transform carries is its collection; everything else
|
|
@@ -91,8 +91,13 @@ export interface TransformInputs {
|
|
|
91
91
|
* resolves to nothing, which is why the type is `Expr` and `check` rejects
|
|
92
92
|
* anything that is not a bare `$vars.…` path. Keep static data in a
|
|
93
93
|
* `.var(name, types.array, [...])` default and point here.
|
|
94
|
+
*
|
|
95
|
+
* Optional only so a Transform the canvas saved before its collection was
|
|
96
|
+
* picked can be carried through a round trip: decompile omits it and marks
|
|
97
|
+
* the step `{ draft: true }`. Compile refuses a Transform without one
|
|
98
|
+
* (TRANSFORM_NO_COLLECTION) unless it is such a draft.
|
|
94
99
|
*/
|
|
95
|
-
collection
|
|
100
|
+
collection?: Expr;
|
|
96
101
|
/**
|
|
97
102
|
* Emit a single-purpose variant node instead of the generic Transform.
|
|
98
103
|
* Omit it for the generic (the default).
|
package/dist/serialize.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface SerializeWarning {
|
|
|
33
33
|
}
|
|
34
34
|
export { CONNECTOR_INPUT_MISSING } from './core/connector-inputs.js';
|
|
35
35
|
/** The refusals a draft-tolerant compile reports instead of throwing. */
|
|
36
|
-
export type DraftCode = BindingRefusalCode | typeof CONNECTOR_INPUT_MISSING | 'CONNECTOR_OBJECT_REQUIRED';
|
|
36
|
+
export type DraftCode = BindingRefusalCode | typeof CONNECTOR_INPUT_MISSING | 'CONNECTOR_OBJECT_REQUIRED' | 'TRANSFORM_NO_COLLECTION';
|
|
37
37
|
/** A refusal a draft-tolerant compile reported instead of throwing (see {@link SerializeOpts.draft}). */
|
|
38
38
|
export interface DraftFinding {
|
|
39
39
|
/** The emitted node's id. */
|
package/dist/serialize.js
CHANGED
|
@@ -2419,9 +2419,12 @@ function serializeFlow(built, opts) {
|
|
|
2419
2419
|
// emits (decompile's copy of the canvas file's entry), else refused as the
|
|
2420
2420
|
// ordinary emission refused it (SerializeOpts.carriedDrafts).
|
|
2421
2421
|
if (strict !== undefined) {
|
|
2422
|
+
// A bundled type supplies no definition, so its draft is held to the one the
|
|
2423
|
+
// flow carries for the type at the emitted version (a canvas Transform with
|
|
2424
|
+
// no collection, #1674).
|
|
2422
2425
|
const carried = typeof def?.nodeType === 'string' && typeof def?.version === 'string'
|
|
2423
2426
|
? carriedFor(def.nodeType, def.version)
|
|
2424
|
-
: undefined;
|
|
2427
|
+
: impl.definition === 'bundled' && def === undefined ? carriedFor(impl.typeName, version) : undefined;
|
|
2425
2428
|
if (carried === undefined)
|
|
2426
2429
|
refuse();
|
|
2427
2430
|
def = carried;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.86.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": "
|
|
106
|
+
"gitref": "4cbce76722e41362c4cf5aa885c74d1564d0201b"
|
|
107
107
|
}
|