@uipath/flow-tool 1.0.1 → 1.0.4
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 +37 -37
- package/dist/index.js +1 -1
- package/dist/packager-tool.js +63928 -49263
- package/dist/services/flow-validate-service.d.ts +56 -0
- package/dist/services/node-validators/expression-prefix-validator.d.ts +45 -0
- package/dist/services/node-validators/index.d.ts +2 -0
- package/dist/services/node-validators/model-source-validator.d.ts +25 -0
- package/dist/services/node-validators/types.d.ts +1 -1
- package/dist/tool.js +197781 -200252
- package/dist/utils/handle-expansion.d.ts +50 -0
- package/dist/validation.d.ts +1 -1
- package/dist/validation.js +91183 -100055
- package/package.json +16 -16
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expand templated handle IDs declared on a node definition.
|
|
3
|
+
*
|
|
4
|
+
* A handle entry may set `repeat: "inputs.cases"` together with an `id` like
|
|
5
|
+
* `"case-{item.id}"`. The runtime, layout engine, and `node edge add` resolve
|
|
6
|
+
* these to one concrete handle per item in the referenced collection — so
|
|
7
|
+
* `flow validate` and any other consumer that checks handle IDs against edges
|
|
8
|
+
* must do the same expansion or it will reject every templated edge as an
|
|
9
|
+
* "undeclared source handle".
|
|
10
|
+
*
|
|
11
|
+
* The implementation matches the long-standing behavior in `tidy-service`'s
|
|
12
|
+
* port resolver — both call sites now share this helper.
|
|
13
|
+
*
|
|
14
|
+
* When the `repeat` path does not resolve to a literal array (e.g. the
|
|
15
|
+
* referenced field is itself an expression like `"=js:$vars.questions"`),
|
|
16
|
+
* expansion cannot enumerate concrete IDs at static-analysis time. In that
|
|
17
|
+
* case `expandHandleIds` returns the unexpanded template id as-is. Callers
|
|
18
|
+
* that need to match concrete edge ports against such templates should use
|
|
19
|
+
* `isTemplatedHandleId` + `portMatchesTemplate` to fall back to pattern
|
|
20
|
+
* matching, mirroring the regex-based approach used by `node edge add` and
|
|
21
|
+
* the canvas connection validator. Without this fallback `flow validate`
|
|
22
|
+
* would reject flows that the runtime accepts.
|
|
23
|
+
*/
|
|
24
|
+
export interface HandleEntry {
|
|
25
|
+
id: string;
|
|
26
|
+
repeat?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface HandleExpansionNode {
|
|
29
|
+
inputs?: Record<string, unknown>;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export declare function expandHandleIds(handle: HandleEntry, node: HandleExpansionNode): string[];
|
|
33
|
+
/**
|
|
34
|
+
* True when `id` still carries an unsubstituted `{...}` placeholder — i.e.
|
|
35
|
+
* `expandHandleIds` could not enumerate concrete instances and returned the
|
|
36
|
+
* raw template (e.g. `"case-{item.id}"`).
|
|
37
|
+
*/
|
|
38
|
+
export declare function isTemplatedHandleId(id: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Match a concrete edge port against a templated handle id by treating
|
|
41
|
+
* each `{...}` placeholder as a `.+` wildcard. Literal segments are escaped
|
|
42
|
+
* so regex metacharacters cannot leak through.
|
|
43
|
+
*
|
|
44
|
+
* Example: `portMatchesTemplate("case-q1", "case-{item.id}")` → `true`.
|
|
45
|
+
*
|
|
46
|
+
* Used by `flow validate` and `node edge add` to accept concrete edges
|
|
47
|
+
* pointing at templated handles when static expansion is not possible —
|
|
48
|
+
* e.g. when the `repeat` source is an expression evaluated at runtime.
|
|
49
|
+
*/
|
|
50
|
+
export declare function portMatchesTemplate(requestedPort: string, templateId: string): boolean;
|
package/dist/validation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Side-effect-free public entry for the `uip flow validate` contribution
|
|
2
|
+
* Side-effect-free public entry for the `uip maestro flow validate` contribution
|
|
3
3
|
* surface. Unlike the `tool.ts` entry (which registers CLI commands and
|
|
4
4
|
* pulls in the solution-packager plugin chain), this module imports only
|
|
5
5
|
* the validation service and its per-node-validator types, so downstream
|