@uipath/maestro-builder-sdk 6.52.0 → 6.52.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/case/decompile.js +5 -1
- package/dist/case/serialize.js +24 -29
- package/dist/core/connector-configuration.d.ts +29 -2
- package/dist/core/connector-configuration.js +45 -3
- package/dist/core/connector-inputs.d.ts +10 -0
- package/dist/core/connector-inputs.js +16 -0
- package/dist/nodes/connector/flow/node-type.js +2 -6
- package/package.json +2 -2
package/dist/case/decompile.js
CHANGED
|
@@ -506,7 +506,11 @@ function connectorVersion(context) {
|
|
|
506
506
|
const encoded = metadata?.activityPropertyConfiguration?.configuration;
|
|
507
507
|
if (typeof encoded === 'string' && encoded.startsWith('=jsonString:')) {
|
|
508
508
|
try {
|
|
509
|
-
|
|
509
|
+
// The activity's version is `instanceParameters.version`. `packageVersion`
|
|
510
|
+
// is what the platform writes as "1.0.0" on every activity; an SDK plan
|
|
511
|
+
// once wrote the library version there, so it stays the fallback.
|
|
512
|
+
const essential = JSON.parse(encoded.slice('=jsonString:'.length))?.essentialConfiguration;
|
|
513
|
+
return essential?.instanceParameters?.version ?? essential?.packageVersion;
|
|
510
514
|
}
|
|
511
515
|
catch {
|
|
512
516
|
throw new Error('connector task has malformed activity metadata configuration JSON.');
|
package/dist/case/serialize.js
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
import { IdGen, offlineBindingSeed } from './ids.js';
|
|
12
12
|
import { isUnrestorableSlotId } from './preserve.js';
|
|
13
13
|
import { v31TaskSets } from './task-sets.js';
|
|
14
|
-
import { buildConnectorInputs, nestConnectorBody, transportHttpMethod } from '../core/connector-inputs.js';
|
|
14
|
+
import { buildConnectorInputs, nestConnectorBody, replayInputsOf, transportHttpMethod } from '../core/connector-inputs.js';
|
|
15
|
+
import { buildEssentialConfiguration } from '../core/connector-configuration.js';
|
|
15
16
|
import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
|
|
16
17
|
import { bindingLabelRefusal } from '../core/binding-messages.js';
|
|
17
18
|
import { resolveEventWhere } from '../core/lookups.js';
|
|
@@ -1444,7 +1445,7 @@ function connectorTaskData(spec, resolver, elementId, where, executionType) {
|
|
|
1444
1445
|
// from the `body` slot. This used to drop the whole wire and push a filled
|
|
1445
1446
|
// file part into the body, where the runtime does not look for it (#1420).
|
|
1446
1447
|
const fileParts = (slots.multipartParameters ?? []).filter((part) => part.dataType.toLowerCase() === 'file');
|
|
1447
|
-
context.push(io('metadata', 'json', { body: connectorMetadata(rc, op, slots, executionType) }));
|
|
1448
|
+
context.push(io('metadata', 'json', { body: connectorMetadata(rc, op, slots, elementId, executionType) }));
|
|
1448
1449
|
const inputs = [
|
|
1449
1450
|
ioSlot('pathParameters', pathParameters, `${elementId}`),
|
|
1450
1451
|
ioSlot('queryParameters', queryParameters, `${elementId}`),
|
|
@@ -1601,45 +1602,39 @@ function folderBindingRef(resolver, name, connection, site) {
|
|
|
1601
1602
|
}
|
|
1602
1603
|
return { id };
|
|
1603
1604
|
}
|
|
1604
|
-
/**
|
|
1605
|
+
/**
|
|
1606
|
+
* The connector `metadata` json blob: the FUNCTIONAL essentialConfiguration +
|
|
1605
1607
|
* activityTypeId, and the multipart wire of a multipart operation. Designer
|
|
1606
1608
|
* cosmetics (packageId/activityColor/…) are omitted — the caseplan
|
|
1607
|
-
* schema-validates without them (see design §C).
|
|
1608
|
-
|
|
1609
|
+
* schema-validates without them (see design §C).
|
|
1610
|
+
*
|
|
1611
|
+
* The configuration is the one Flow writes, from the shared
|
|
1612
|
+
* {@link buildEssentialConfiguration}. Case used to build its own, thinner copy:
|
|
1613
|
+
* no `operation` verb, `customFieldsRequestDetails`, `connectorVersion` or
|
|
1614
|
+
* `unifiedTypesCompatible`, a curated-only `instanceParameters` even for a
|
|
1615
|
+
* Generic activity, and the library version where the platform writes
|
|
1616
|
+
* `packageVersion: "1.0.0"` (#1420).
|
|
1617
|
+
*/
|
|
1618
|
+
function connectorMetadata(rc, op, slots, seed, executionType) {
|
|
1609
1619
|
// The part DECLARATIONS only: a file part's value rides on its `file` input.
|
|
1610
1620
|
const multipartParameters = (slots.multipartParameters ?? []).map(({ name, dataType }) => ({ name, dataType }));
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
supportsStreaming: op.supportsStreaming ?? false,
|
|
1618
|
-
subType: op.subType ?? 'standard',
|
|
1619
|
-
};
|
|
1620
|
-
const configuration = {
|
|
1621
|
-
essentialConfiguration: {
|
|
1622
|
-
instanceParameters,
|
|
1623
|
-
objectName: instanceParameters.objectName,
|
|
1624
|
-
httpMethod: transportHttpMethod(rc.httpMethod),
|
|
1625
|
-
path: rc.endpoint,
|
|
1626
|
-
packageVersion: rc.version,
|
|
1627
|
-
// An external task's object states how it runs; the Designer saves it here
|
|
1628
|
-
// and beside the configuration. A plain connector activity has none.
|
|
1629
|
-
...(executionType ? { executionType } : {}),
|
|
1630
|
-
},
|
|
1631
|
-
};
|
|
1621
|
+
// The configuration replays the authored values (a schema action's parent
|
|
1622
|
+
// fields, a CEQL filter's tree), keyed by the library's own names, as Flow's.
|
|
1623
|
+
const essential = buildEssentialConfiguration(rc.entry, rc.version, replayInputsOf(slots), seed, executionType ?? null);
|
|
1624
|
+
const configuration = `=jsonString:${JSON.stringify({ essentialConfiguration: essential })}`;
|
|
1625
|
+
const instanceParameters = essential.instanceParameters;
|
|
1626
|
+
const objectName = String(op.objectName ?? rc.nodeType.split('.').pop());
|
|
1632
1627
|
return {
|
|
1633
1628
|
activityPropertyConfiguration: {
|
|
1634
1629
|
...(multipartParameters.length ? { multipartParameters } : {}),
|
|
1635
|
-
configuration
|
|
1630
|
+
configuration,
|
|
1636
1631
|
uiPathActivityTypeId: rc.activityTypeId ?? '',
|
|
1637
1632
|
errorState: { issues: [] },
|
|
1638
1633
|
...(executionType ? { executionType } : {}),
|
|
1639
1634
|
},
|
|
1640
1635
|
activityMetadata: {
|
|
1641
1636
|
activity: {
|
|
1642
|
-
displayName: rc.entry.display?.label ??
|
|
1637
|
+
displayName: rc.entry.display?.label ?? objectName,
|
|
1643
1638
|
description: rc.entry.display?.description ?? '',
|
|
1644
1639
|
category: rc.connectorName,
|
|
1645
1640
|
configuration: JSON.stringify(instanceParameters),
|
|
@@ -1653,7 +1648,7 @@ function connectorMetadata(rc, op, slots, executionType) {
|
|
|
1653
1648
|
telemetryData: {
|
|
1654
1649
|
connectorKey: rc.connectorKey,
|
|
1655
1650
|
connectorName: rc.connectorName,
|
|
1656
|
-
objectName
|
|
1651
|
+
objectName,
|
|
1657
1652
|
objectDisplayName: op.objectDisplayName ?? rc.entry.display?.operationLabel ?? '',
|
|
1658
1653
|
},
|
|
1659
1654
|
};
|
|
@@ -63,6 +63,33 @@
|
|
|
63
63
|
*
|
|
64
64
|
* Neither is cosmetic for a generic node: v1's own `check_generic_dynamic_node.py`
|
|
65
65
|
* identifies the activity semantically, by `activityType == 'generic'` **and
|
|
66
|
-
* `operation == 'list'`**, read from these very keys.
|
|
66
|
+
* `operation == 'list'`**, read from these very keys. *
|
|
67
|
+
* ## `savedJitInputFieldId` is not written, because the library cannot say when
|
|
68
|
+
*
|
|
69
|
+
* The CLI writes `savedJitInputFieldId: "in_<objectName>"` for a create /
|
|
70
|
+
* update / replace whose IS metadata declares a `body` PARAMETER (a
|
|
71
|
+
* just-in-time body). The offline library does not carry that parameter: its
|
|
72
|
+
* `operation.parameters` hold only `query` · `path` · `multipart`. Its body
|
|
73
|
+
* FIELDS do not stand in for it. Measured over the Designer- and CLI-saved
|
|
74
|
+
* create/update/replace nodes in the eval corpus: Slack `create-channel` (2
|
|
75
|
+
* body fields) carries the key, while `join-channel` (1 body field, 0/2) and
|
|
76
|
+
* `create-group-direct-message` (1 body field, 0/89) do not, and Data Service
|
|
77
|
+
* `create-entity-record` (no body fields) does (336/405). Writing it on a
|
|
78
|
+
* guess would be wrong on hundreds of nodes, so it stays out until the library
|
|
79
|
+
* records the body parameter.
|
|
80
|
+
*/
|
|
81
|
+
export declare function buildConfiguration(entry: any, version: string, inputValues?: Record<string, unknown>, seed?: string, executionType?: string | null): string;
|
|
82
|
+
/**
|
|
83
|
+
* The `essentialConfiguration` object that {@link buildConfiguration} wraps in
|
|
84
|
+
* its `=jsonString:` envelope. For a caller that also needs a field of it (Case
|
|
85
|
+
* copies its `instanceParameters` into the activity metadata), so it does not
|
|
86
|
+
* parse the string back.
|
|
87
|
+
*
|
|
88
|
+
* @param entry - The connector library entry.
|
|
89
|
+
* @param version - The connector version.
|
|
90
|
+
* @param inputValues - The authored inputs to replay, keyed by the library's names.
|
|
91
|
+
* @param seed - Seed for the saved filter tree ids.
|
|
92
|
+
* @param executionType - An External Agent / Workflow object's run mode, or `null`.
|
|
93
|
+
* @returns The essential configuration, with only Studio Web's essential keys.
|
|
67
94
|
*/
|
|
68
|
-
export declare function
|
|
95
|
+
export declare function buildEssentialConfiguration(entry: any, version: string, inputValues?: Record<string, unknown>, seed?: string, executionType?: string | null): Record<string, unknown>;
|
|
@@ -20,6 +20,14 @@ const ESSENTIAL_DEFAULTS = {
|
|
|
20
20
|
executionType: null,
|
|
21
21
|
operation: 'create',
|
|
22
22
|
packageVersion: '1.0.0',
|
|
23
|
+
// The CLI's offline builder writes these two on every activity
|
|
24
|
+
// (`buildActivityEssentialConfiguration`, uipath-cli
|
|
25
|
+
// `integrationservice-sdk/src/dap/essential-config.ts`), and so does every
|
|
26
|
+
// Designer save in the eval corpus. `connectorVersion` is a request header
|
|
27
|
+
// the library does not carry; Studio Web fills it from its type cache on
|
|
28
|
+
// open, so offline it is `null`, as the CLI and the Case fixture write it.
|
|
29
|
+
connectorVersion: null,
|
|
30
|
+
unifiedTypesCompatible: true,
|
|
23
31
|
};
|
|
24
32
|
/**
|
|
25
33
|
* Which of an operation's parameters carries a CEQL filter.
|
|
@@ -161,9 +169,40 @@ function envelope(flat) {
|
|
|
161
169
|
*
|
|
162
170
|
* Neither is cosmetic for a generic node: v1's own `check_generic_dynamic_node.py`
|
|
163
171
|
* identifies the activity semantically, by `activityType == 'generic'` **and
|
|
164
|
-
* `operation == 'list'`**, read from these very keys.
|
|
172
|
+
* `operation == 'list'`**, read from these very keys. *
|
|
173
|
+
* ## `savedJitInputFieldId` is not written, because the library cannot say when
|
|
174
|
+
*
|
|
175
|
+
* The CLI writes `savedJitInputFieldId: "in_<objectName>"` for a create /
|
|
176
|
+
* update / replace whose IS metadata declares a `body` PARAMETER (a
|
|
177
|
+
* just-in-time body). The offline library does not carry that parameter: its
|
|
178
|
+
* `operation.parameters` hold only `query` · `path` · `multipart`. Its body
|
|
179
|
+
* FIELDS do not stand in for it. Measured over the Designer- and CLI-saved
|
|
180
|
+
* create/update/replace nodes in the eval corpus: Slack `create-channel` (2
|
|
181
|
+
* body fields) carries the key, while `join-channel` (1 body field, 0/2) and
|
|
182
|
+
* `create-group-direct-message` (1 body field, 0/89) do not, and Data Service
|
|
183
|
+
* `create-entity-record` (no body fields) does (336/405). Writing it on a
|
|
184
|
+
* guess would be wrong on hundreds of nodes, so it stays out until the library
|
|
185
|
+
* records the body parameter.
|
|
186
|
+
*/
|
|
187
|
+
export function buildConfiguration(entry, version, inputValues, seed = 'node', executionType = null) {
|
|
188
|
+
return '=jsonString:' + JSON.stringify({
|
|
189
|
+
essentialConfiguration: buildEssentialConfiguration(entry, version, inputValues, seed, executionType),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The `essentialConfiguration` object that {@link buildConfiguration} wraps in
|
|
194
|
+
* its `=jsonString:` envelope. For a caller that also needs a field of it (Case
|
|
195
|
+
* copies its `instanceParameters` into the activity metadata), so it does not
|
|
196
|
+
* parse the string back.
|
|
197
|
+
*
|
|
198
|
+
* @param entry - The connector library entry.
|
|
199
|
+
* @param version - The connector version.
|
|
200
|
+
* @param inputValues - The authored inputs to replay, keyed by the library's names.
|
|
201
|
+
* @param seed - Seed for the saved filter tree ids.
|
|
202
|
+
* @param executionType - An External Agent / Workflow object's run mode, or `null`.
|
|
203
|
+
* @returns The essential configuration, with only Studio Web's essential keys.
|
|
165
204
|
*/
|
|
166
|
-
export function
|
|
205
|
+
export function buildEssentialConfiguration(entry, version, inputValues, seed = 'node', executionType = null) {
|
|
167
206
|
const op = entry.operation ?? {};
|
|
168
207
|
const conn = entry.connector ?? {};
|
|
169
208
|
const at = op.activityType;
|
|
@@ -177,6 +216,9 @@ export function buildConfiguration(entry, version, inputValues, seed = 'node') {
|
|
|
177
216
|
: ESSENTIAL_DEFAULTS.operation;
|
|
178
217
|
const composed = {
|
|
179
218
|
...ESSENTIAL_DEFAULTS,
|
|
219
|
+
// An External Agent / Workflow object states how it runs; a connector
|
|
220
|
+
// activity has none (`null`, the default).
|
|
221
|
+
executionType,
|
|
180
222
|
operation: verb,
|
|
181
223
|
customFieldsRequestDetails: schemaReplayDetails(op, inputValues),
|
|
182
224
|
savedFilterTrees: savedFilterTrees(op, inputValues, seed),
|
|
@@ -202,5 +244,5 @@ export function buildConfiguration(entry, version, inputValues, seed = 'node') {
|
|
|
202
244
|
},
|
|
203
245
|
...(op.pathTemplate || op.path ? { path: op.pathTemplate || op.path } : {}),
|
|
204
246
|
};
|
|
205
|
-
return
|
|
247
|
+
return envelope(composed).essentialConfiguration;
|
|
206
248
|
}
|
|
@@ -58,6 +58,16 @@ export declare const CONNECTOR_INPUT_MISSING = "CONNECTOR_INPUT_MISSING";
|
|
|
58
58
|
*/
|
|
59
59
|
export declare function connectorInputErrors(rc: ResolvedConnector, inputs: Record<string, unknown>, resolutions?: LookupResolutions, lookups?: Readonly<Record<string, LookupSpec>>, wire?: Pick<ConnectorInputOpts, 'dialect' | 'render'>): string | undefined;
|
|
60
60
|
export declare function buildConnectorInputs(rc: any, inputs: Record<string, unknown>, opts: ConnectorInputOpts): ConnectorSlots;
|
|
61
|
+
/**
|
|
62
|
+
* The authored values a connector's `configuration` replays (a schema action's
|
|
63
|
+
* parent fields, a CEQL filter's tree), keyed by the library's own names: the
|
|
64
|
+
* body, path and query slots, merged. Flow and Case both write the
|
|
65
|
+
* configuration from this, so the two cannot drift.
|
|
66
|
+
*
|
|
67
|
+
* @param slots - The slots {@link buildConnectorInputs} returned.
|
|
68
|
+
* @returns The merged body, path and query values.
|
|
69
|
+
*/
|
|
70
|
+
export declare function replayInputsOf(slots: ConnectorSlots): Record<string, unknown>;
|
|
61
71
|
/**
|
|
62
72
|
* `inputMetadata.multipart.bodyFieldName` names the CONTAINER part — the one the
|
|
63
73
|
* runtime composes from `bodyParameters`. Measured on the designer's own nodes in
|
|
@@ -253,6 +253,22 @@ function swapLookupTokens(value, resolutions, unresolved) {
|
|
|
253
253
|
return value.map((item) => swapLookupTokens(item, resolutions, unresolved));
|
|
254
254
|
return value;
|
|
255
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* The authored values a connector's `configuration` replays (a schema action's
|
|
258
|
+
* parent fields, a CEQL filter's tree), keyed by the library's own names: the
|
|
259
|
+
* body, path and query slots, merged. Flow and Case both write the
|
|
260
|
+
* configuration from this, so the two cannot drift.
|
|
261
|
+
*
|
|
262
|
+
* @param slots - The slots {@link buildConnectorInputs} returned.
|
|
263
|
+
* @returns The merged body, path and query values.
|
|
264
|
+
*/
|
|
265
|
+
export function replayInputsOf(slots) {
|
|
266
|
+
return {
|
|
267
|
+
...(slots.bodyParameters ?? {}),
|
|
268
|
+
...(slots.pathParameters ?? {}),
|
|
269
|
+
...(slots.queryParameters ?? {}),
|
|
270
|
+
};
|
|
271
|
+
}
|
|
256
272
|
/**
|
|
257
273
|
* `inputMetadata.multipart.bodyFieldName` names the CONTAINER part — the one the
|
|
258
274
|
* runtime composes from `bodyParameters`. Measured on the designer's own nodes in
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BindingRefusal, bindingMissingMessage, missingBindingLabels } from '../../../core/binding-messages.js';
|
|
2
2
|
import { prepareCommand } from '../../../core/cli-spelling.js';
|
|
3
3
|
import { buildConfiguration } from '../../../core/connector-configuration.js';
|
|
4
|
-
import { CONNECTOR_INPUT_MISSING, FLOW_EXPR_DIALECT, buildConnectorInputs, transportHttpMethod } from '../../../core/connector-inputs.js';
|
|
4
|
+
import { CONNECTOR_INPUT_MISSING, FLOW_EXPR_DIALECT, buildConnectorInputs, replayInputsOf, transportHttpMethod } from '../../../core/connector-inputs.js';
|
|
5
5
|
import { ConnectorResolveError } from '../../../core/connector-resolve-error.js';
|
|
6
6
|
import { definitionHasErrorPort } from '../../../core/error-port.js';
|
|
7
7
|
import { Expr } from '../../../core/expr.js';
|
|
@@ -141,11 +141,7 @@ function serializeConnector(spec, ctx) {
|
|
|
141
141
|
? library.lookupSpecs(spec.key, spec.action, spec.version, spec.object)
|
|
142
142
|
: {},
|
|
143
143
|
});
|
|
144
|
-
const replayInputs =
|
|
145
|
-
...(connectorInputs.bodyParameters ?? {}),
|
|
146
|
-
...(connectorInputs.pathParameters ?? {}),
|
|
147
|
-
...(connectorInputs.queryParameters ?? {}),
|
|
148
|
-
};
|
|
144
|
+
const replayInputs = replayInputsOf(connectorInputs);
|
|
149
145
|
const detail = {
|
|
150
146
|
connector: rc.connectorKey,
|
|
151
147
|
method: transportHttpMethod(rc.httpMethod),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.52.
|
|
3
|
+
"version": "6.52.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",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"@types/node": "^22.7.0",
|
|
97
97
|
"esbuild": "^0.28.1"
|
|
98
98
|
},
|
|
99
|
-
"gitref": "
|
|
99
|
+
"gitref": "d3566b616cb3addce005fe0b6962aa504adb79a3"
|
|
100
100
|
}
|