@uipath/maestro-builder-sdk 6.120.16 → 6.120.17
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/core/connector-inputs.js +29 -2
- package/dist/core/library.d.ts +35 -0
- package/dist/core/library.js +39 -4
- package/package.json +2 -2
|
@@ -101,7 +101,26 @@ export function buildConnectorInputs(rc, inputs, opts) {
|
|
|
101
101
|
const policy = { unresolvedLookups };
|
|
102
102
|
const fields = (rc.fields ?? []);
|
|
103
103
|
const byName = new Map(fields.map((f) => [f.name, f]));
|
|
104
|
-
|
|
104
|
+
// An operation whose input schema the connection resolves, with no `prepare`
|
|
105
|
+
// recorded (`inputFieldsOpen`): the field list is the tenant-agnostic subset,
|
|
106
|
+
// so an input outside it is not a mistake this side can see. It is passed
|
|
107
|
+
// through to the body, the slot an undeclared input has always meant, and
|
|
108
|
+
// `check` warns about it as CUSTOM_FIELDS_UNPREPARED with the `prepare` that
|
|
109
|
+
// records the real schema. A Data Fabric `create-entity-record` step saved by
|
|
110
|
+
// Studio Web carries the entity's columns (`Name: "Ada"`) this way.
|
|
111
|
+
//
|
|
112
|
+
// Not passed through: an input inside an array element (no flat wire name
|
|
113
|
+
// to give it), and a `lookup()` / `resource()` token (nothing records its id).
|
|
114
|
+
const passThrough = [];
|
|
115
|
+
const onUnknown = rc.inputFieldsOpen === true
|
|
116
|
+
? (path, value) => {
|
|
117
|
+
if (path.includes('[*]') || isLookupToken(value) || isResourceToken(value))
|
|
118
|
+
return false;
|
|
119
|
+
passThrough.push({ path, value });
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
: undefined;
|
|
123
|
+
const errs = validateNestedConnectorKeys(fields, inputs, byName, dialect, onUnknown);
|
|
105
124
|
/** The unresolved lookups among `errs`: when they are all of them, the refusal is LOOKUP_UNRESOLVED. */
|
|
106
125
|
const owed = [];
|
|
107
126
|
/** The unresolved resources among `errs`, each with the refusal `resolveRecordedResource` raised. */
|
|
@@ -185,6 +204,8 @@ export function buildConnectorInputs(rc, inputs, opts) {
|
|
|
185
204
|
const slot = ownEntry(SLOT_FOR_LOCATION, location) ?? 'bodyParameters';
|
|
186
205
|
routed[slot][f.name] = render(nested.value);
|
|
187
206
|
}
|
|
207
|
+
for (const { path, value } of passThrough)
|
|
208
|
+
routed.bodyParameters[path] = render(value);
|
|
188
209
|
// Inputs that are fine but for lookups `prepare` has not recorded are that one
|
|
189
210
|
// condition, LOOKUP_UNRESOLVED, with the one command that records them all.
|
|
190
211
|
if (errs.length && owed.length === errs.length) {
|
|
@@ -618,7 +639,9 @@ function buildConnectorInputTrie(fields) {
|
|
|
618
639
|
return root;
|
|
619
640
|
}
|
|
620
641
|
/** Reject nested typos with the same unknown-key message as flat keys. */
|
|
621
|
-
function validateNestedConnectorKeys(fields, inputs, exact, dialect
|
|
642
|
+
function validateNestedConnectorKeys(fields, inputs, exact, dialect,
|
|
643
|
+
/** Takes an unknown input instead of reporting it, when it returns true. */
|
|
644
|
+
onUnknown) {
|
|
622
645
|
const root = buildConnectorInputTrie(fields);
|
|
623
646
|
const errs = [];
|
|
624
647
|
const bare = new Set(bareArraySpellings(fields, exact).values());
|
|
@@ -647,6 +670,8 @@ function validateNestedConnectorKeys(fields, inputs, exact, dialect) {
|
|
|
647
670
|
const child = node.children.get(key);
|
|
648
671
|
const childPath = path ? `${path}.${key}` : key;
|
|
649
672
|
if (!child) {
|
|
673
|
+
if (onUnknown?.(childPath, childValue))
|
|
674
|
+
continue;
|
|
650
675
|
const near = nearestField(childPath, fields.map((f) => f.name));
|
|
651
676
|
errs.push(`unknown input "${childPath}"${near ? ` — did you mean "${near}"?` : ''}`);
|
|
652
677
|
}
|
|
@@ -667,6 +692,8 @@ function validateNestedConnectorKeys(fields, inputs, exact, dialect) {
|
|
|
667
692
|
continue;
|
|
668
693
|
}
|
|
669
694
|
if (!node) {
|
|
695
|
+
if (onUnknown?.(key, value))
|
|
696
|
+
continue;
|
|
670
697
|
const near = nearestField(key, [...exact.keys()]);
|
|
671
698
|
errs.push(`unknown input "${key}"${near ? ` — did you mean "${near}"?` : ''}`);
|
|
672
699
|
}
|
package/dist/core/library.d.ts
CHANGED
|
@@ -74,7 +74,36 @@ export interface ResolvedConnector {
|
|
|
74
74
|
source: string;
|
|
75
75
|
tier: string;
|
|
76
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* True when `fields` is not the operation's whole input set: the operation
|
|
79
|
+
* resolves its real input schema from the connection, and no `registry
|
|
80
|
+
* prepare` has recorded it here. See {@link inputSchemaFromConnection}.
|
|
81
|
+
*
|
|
82
|
+
* Data Fabric `create-entity-record` is the case: the library lists
|
|
83
|
+
* `entityName` and `expansionLevel`, and the entity's own columns (`Name`,
|
|
84
|
+
* `Email`, …) exist only on the tenant. Studio Web saves those columns as body
|
|
85
|
+
* parameters, so a saved step carries inputs the library has never heard of.
|
|
86
|
+
* `buildConnectorInputs` passes such an input through to the body instead of
|
|
87
|
+
* refusing it as `unknown input`; `check` warns about it as
|
|
88
|
+
* CUSTOM_FIELDS_UNPREPARED, with the `prepare` that records the real schema.
|
|
89
|
+
* A prepared operation leaves this unset, so its inputs are checked strictly.
|
|
90
|
+
*/
|
|
91
|
+
inputFieldsOpen?: true;
|
|
77
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether a library entry's INPUT field list is resolved from the connection at
|
|
95
|
+
* design time: the operation needs a connection for its schema
|
|
96
|
+
* (`runtime.requiresConnectionForSchema`) and its schema action replaces the
|
|
97
|
+
* input half (`operation.schemaAction.replaces` is `input` or `both`).
|
|
98
|
+
*
|
|
99
|
+
* Both halves matter. `requiresConnectionForSchema` alone is set on every
|
|
100
|
+
* operation of a connector with field discovery (Slack's `send-message`
|
|
101
|
+
* included), whose static field list is complete; and an action that replaces
|
|
102
|
+
* only the `output` leaves the input list authoritative. In the library of
|
|
103
|
+
* #2053, 41 of 1,739 operations pass this test, all of them `Curated`
|
|
104
|
+
* (Data Fabric's record operations, Jira `create-issue`, Smartsheet `add-row`, …).
|
|
105
|
+
*/
|
|
106
|
+
export declare function inputSchemaFromConnection(entry: unknown): boolean;
|
|
78
107
|
/**
|
|
79
108
|
* Where a connector input rides on the wire.
|
|
80
109
|
*
|
|
@@ -552,6 +581,12 @@ export declare class Library {
|
|
|
552
581
|
* of the entries each layer resolves are UNIONED: the overlay can ADD fields
|
|
553
582
|
* but never drop ones the baked library already exposed (C4).
|
|
554
583
|
*/
|
|
584
|
+
/**
|
|
585
|
+
* Whether the connection-scoped overlay carries a `prepare` row for this
|
|
586
|
+
* operation. A row fetched through `uip` has no connection behind it, so it
|
|
587
|
+
* does not count (the same rule as {@link schemaReadiness}).
|
|
588
|
+
*/
|
|
589
|
+
private preparedInOverlay;
|
|
555
590
|
private resolveType;
|
|
556
591
|
/**
|
|
557
592
|
* Turn a lookup miss into something actionable: which operations this connector
|
package/dist/core/library.js
CHANGED
|
@@ -17,6 +17,26 @@ import { ConnectorResolveError } from './connector-resolve-error.js';
|
|
|
17
17
|
import { CompileRefusal } from './compile-refusal.js';
|
|
18
18
|
import { transportHttpMethod } from './connector-inputs.js';
|
|
19
19
|
import { wireActivityTypeMatches } from './connector-configuration.js';
|
|
20
|
+
/**
|
|
21
|
+
* Whether a library entry's INPUT field list is resolved from the connection at
|
|
22
|
+
* design time: the operation needs a connection for its schema
|
|
23
|
+
* (`runtime.requiresConnectionForSchema`) and its schema action replaces the
|
|
24
|
+
* input half (`operation.schemaAction.replaces` is `input` or `both`).
|
|
25
|
+
*
|
|
26
|
+
* Both halves matter. `requiresConnectionForSchema` alone is set on every
|
|
27
|
+
* operation of a connector with field discovery (Slack's `send-message`
|
|
28
|
+
* included), whose static field list is complete; and an action that replaces
|
|
29
|
+
* only the `output` leaves the input list authoritative. In the library of
|
|
30
|
+
* #2053, 41 of 1,739 operations pass this test, all of them `Curated`
|
|
31
|
+
* (Data Fabric's record operations, Jira `create-issue`, Smartsheet `add-row`, …).
|
|
32
|
+
*/
|
|
33
|
+
export function inputSchemaFromConnection(entry) {
|
|
34
|
+
if (!entry || typeof entry !== 'object')
|
|
35
|
+
return false;
|
|
36
|
+
const e = entry;
|
|
37
|
+
const replaces = e.operation?.schemaAction?.replaces;
|
|
38
|
+
return e.runtime?.requiresConnectionForSchema === true && (replaces === 'input' || replaces === 'both');
|
|
39
|
+
}
|
|
20
40
|
export { ConnectorResolveError } from './connector-resolve-error.js';
|
|
21
41
|
/**
|
|
22
42
|
* The `provenance` a definition fetched through `uip` carries, on its entry and
|
|
@@ -297,8 +317,7 @@ export class Library {
|
|
|
297
317
|
|| entry?.connector?.discovery?.hasCustomFieldDiscovery === true;
|
|
298
318
|
if (!connectionResolved)
|
|
299
319
|
return { kind: 'static', prepared: true };
|
|
300
|
-
|
|
301
|
-
if (rows.some(({ overlay, row }) => overlay && row.provenance !== FETCHED_PROVENANCE))
|
|
320
|
+
if (this.preparedInOverlay(nodeType, version))
|
|
302
321
|
return { kind: 'customFields', prepared: true };
|
|
303
322
|
let bakedFields = [];
|
|
304
323
|
try {
|
|
@@ -740,6 +759,16 @@ export class Library {
|
|
|
740
759
|
* of the entries each layer resolves are UNIONED: the overlay can ADD fields
|
|
741
760
|
* but never drop ones the baked library already exposed (C4).
|
|
742
761
|
*/
|
|
762
|
+
/**
|
|
763
|
+
* Whether the connection-scoped overlay carries a `prepare` row for this
|
|
764
|
+
* operation. A row fetched through `uip` has no connection behind it, so it
|
|
765
|
+
* does not count (the same rule as {@link schemaReadiness}).
|
|
766
|
+
*/
|
|
767
|
+
preparedInOverlay(nodeType, version) {
|
|
768
|
+
return this.layers.some((layer) => layer.overlay === true && layer.entries.some((row) => row?.nodeType === nodeType
|
|
769
|
+
&& (!version || String(row.version) === version)
|
|
770
|
+
&& row.provenance !== FETCHED_PROVENANCE));
|
|
771
|
+
}
|
|
743
772
|
resolveType(nodeType, version, objectName, report = true) {
|
|
744
773
|
// A generic operation that carries other objects but not this one is a miss
|
|
745
774
|
// too: a fetch writes only the objects asked for, so a second object is
|
|
@@ -757,11 +786,17 @@ export class Library {
|
|
|
757
786
|
resolved.push(r);
|
|
758
787
|
}
|
|
759
788
|
if (resolved.length) {
|
|
789
|
+
// An input schema the connection resolves is open until a `prepare` row
|
|
790
|
+
// records it. Read from any layer's entry: a prepared overlay copy may not
|
|
791
|
+
// carry the schema action, which is the case where it does not matter.
|
|
792
|
+
const open = resolved.some((r) => inputSchemaFromConnection(r.entry))
|
|
793
|
+
&& !this.preparedInOverlay(nodeType, version);
|
|
794
|
+
const withOpen = (rc) => (open ? { ...rc, inputFieldsOpen: true } : rc);
|
|
760
795
|
// Metadata comes from the highest-priority layer (the overlay when
|
|
761
796
|
// present); fields are the UNION across all layers.
|
|
762
797
|
const primary = resolved[0];
|
|
763
798
|
if (resolved.length === 1)
|
|
764
|
-
return primary;
|
|
799
|
+
return withOpen(primary);
|
|
765
800
|
const byName = new Map();
|
|
766
801
|
// Insert lowest-priority (baked) first so a shared field keeps the baked
|
|
767
802
|
// position but takes the overlay's (higher-priority) definition.
|
|
@@ -769,7 +804,7 @@ export class Library {
|
|
|
769
804
|
for (const f of resolved[i].fields)
|
|
770
805
|
byName.set(f.name, f);
|
|
771
806
|
}
|
|
772
|
-
return { ...primary, fields: [...byName.values()] };
|
|
807
|
+
return withOpen({ ...primary, fields: [...byName.values()] });
|
|
773
808
|
}
|
|
774
809
|
const missing = !this.carries(nodeType);
|
|
775
810
|
if (missing && report)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.120.
|
|
3
|
+
"version": "6.120.17",
|
|
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",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"@types/node": "^22.7.0",
|
|
125
125
|
"esbuild": "^0.28.1"
|
|
126
126
|
},
|
|
127
|
-
"gitref": "
|
|
127
|
+
"gitref": "9f8380b59b3b445b01bf0b09b0a4a964ae9c19d7"
|
|
128
128
|
}
|