@uipath/maestro-builder-sdk 6.52.0 → 6.52.2
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 +25 -25
- package/dist/api-members.md +138 -138
- package/dist/case/action-output-var.d.ts +19 -0
- package/dist/case/action-output-var.js +24 -0
- package/dist/case/case-expr-check.js +6 -5
- package/dist/case/case-sdk.d.ts +8 -1
- package/dist/case/decompile.js +5 -1
- package/dist/case/serialize.js +58 -59
- 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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The case variable a human task's form output writes when the author gives no
|
|
3
|
+
* `value`. Shared by the serializer, which writes the row, and the build-time
|
|
4
|
+
* expression check, which must count that variable as declared.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The case variable an action output writes when the author gives no `value`:
|
|
10
|
+
* the Designer's camelCase of the field name (`Comment` → `comment`), or the
|
|
11
|
+
* name itself when that leaves nothing (a name of only punctuation).
|
|
12
|
+
*/
|
|
13
|
+
export declare function defaultActionOutputVar(name: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* The Designer's `camelizeDisplayName`: drop non-identifier characters, split on
|
|
16
|
+
* spaces/underscores, lower the first letter of the first word and upper the
|
|
17
|
+
* first letter of the rest (`APIOutput1` → `aPIOutput1`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function camelizeName(name: string): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The case variable a human task's form output writes when the author gives no
|
|
3
|
+
* `value`. Shared by the serializer, which writes the row, and the build-time
|
|
4
|
+
* expression check, which must count that variable as declared.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The case variable an action output writes when the author gives no `value`:
|
|
10
|
+
* the Designer's camelCase of the field name (`Comment` → `comment`), or the
|
|
11
|
+
* name itself when that leaves nothing (a name of only punctuation).
|
|
12
|
+
*/
|
|
13
|
+
export function defaultActionOutputVar(name) {
|
|
14
|
+
return camelizeName(name) || name;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The Designer's `camelizeDisplayName`: drop non-identifier characters, split on
|
|
18
|
+
* spaces/underscores, lower the first letter of the first word and upper the
|
|
19
|
+
* first letter of the rest (`APIOutput1` → `aPIOutput1`).
|
|
20
|
+
*/
|
|
21
|
+
export function camelizeName(name) {
|
|
22
|
+
const words = name.replace(/[^a-zA-Z0-9_ ]/g, '').split(/[\s_]+/).filter(Boolean);
|
|
23
|
+
return words.map((w, i) => (i === 0 ? w.charAt(0).toLowerCase() : w.charAt(0).toUpperCase()) + w.slice(1)).join('');
|
|
24
|
+
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* `case/check.ts`, not here.
|
|
17
17
|
*/
|
|
18
18
|
import { checkExpression } from '../core/expr-check.js';
|
|
19
|
+
import { defaultActionOutputVar } from './action-output-var.js';
|
|
19
20
|
const NOUN = 'case variable';
|
|
20
21
|
const NAMESPACE = 'vars';
|
|
21
22
|
function checkExpr(expr, where, roots, out) {
|
|
@@ -44,12 +45,12 @@ export function checkCaseExpressions(built) {
|
|
|
44
45
|
roots.add(o.var);
|
|
45
46
|
// A human task's form outputs declare one too: the field's `value` is the
|
|
46
47
|
// variable the assignee's answer lands in (`.action({ outputs: [{ name:
|
|
47
|
-
// 'Action', value: 'decision' }] })` → `vars.decision`).
|
|
48
|
-
//
|
|
49
|
-
//
|
|
48
|
+
// 'Action', value: 'decision' }] })` → `vars.decision`). With no `value`
|
|
49
|
+
// the serializer writes the field's camelCased name (`approved` →
|
|
50
|
+
// `vars.approved`, builder-sdk#1422). Either way `emitActionField` writes
|
|
51
|
+
// that variable, so a gate on it is a declared read, not a typo.
|
|
50
52
|
for (const f of task.action?.outputs ?? [])
|
|
51
|
-
|
|
52
|
-
roots.add(f.value);
|
|
53
|
+
roots.add(f.value ?? defaultActionOutputVar(f.name));
|
|
53
54
|
}
|
|
54
55
|
// Event-trigger payload extractions declare readable case variables too.
|
|
55
56
|
for (const t of built.triggers)
|
package/dist/case/case-sdk.d.ts
CHANGED
|
@@ -514,7 +514,14 @@ export interface ActionField {
|
|
|
514
514
|
subType?: string;
|
|
515
515
|
/** Human-facing label (defaults to `name` in the UI when omitted). */
|
|
516
516
|
displayName?: string;
|
|
517
|
-
/**
|
|
517
|
+
/**
|
|
518
|
+
* Input literal/expression, or the case variable an output field writes. An
|
|
519
|
+
* output without `value` writes the camelCased field name, made unique across
|
|
520
|
+
* the plan (`Comment` → `comment`, a second `Comment` → `comment2`), as the
|
|
521
|
+
* Case Designer does. Set `value` on any output another step reads: the
|
|
522
|
+
* default suffix depends on task order, so adding an earlier task with the
|
|
523
|
+
* same output name would move the unsuffixed variable to that task.
|
|
524
|
+
*/
|
|
518
525
|
value?: string;
|
|
519
526
|
/** Require `value` to be non-empty at validation time. */
|
|
520
527
|
required?: boolean;
|
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,9 @@
|
|
|
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 {
|
|
14
|
+
import { camelizeName, defaultActionOutputVar } from './action-output-var.js';
|
|
15
|
+
import { buildConnectorInputs, nestConnectorBody, replayInputsOf, transportHttpMethod } from '../core/connector-inputs.js';
|
|
16
|
+
import { buildEssentialConfiguration } from '../core/connector-configuration.js';
|
|
15
17
|
import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
|
|
16
18
|
import { bindingLabelRefusal } from '../core/binding-messages.js';
|
|
17
19
|
import { resolveEventWhere } from '../core/lookups.js';
|
|
@@ -1166,10 +1168,17 @@ function stableUuid(seed) {
|
|
|
1166
1168
|
// extracts a result field (`source`) into a case variable (`var`), registering a
|
|
1167
1169
|
// root `inputOutputs` companion (`id === var`) so `=vars.<var>` resolves.
|
|
1168
1170
|
/**
|
|
1169
|
-
* One action-task form field → a schema `InputOutput` row.
|
|
1170
|
-
*
|
|
1171
|
-
*
|
|
1172
|
-
*
|
|
1171
|
+
* One action-task form field → a schema `InputOutput` row. Inputs carry only a
|
|
1172
|
+
* name + type plus optional Action Center metadata. Every OUTPUT also carries
|
|
1173
|
+
* the standard output identity fields (`id`, `var`, `source`, `target`,
|
|
1174
|
+
* `elementId`): the Designer writes them on every output it saves, and
|
|
1175
|
+
* `uip maestro case validate` refuses an output without an id
|
|
1176
|
+
* (`CASE_MGMT_OUTPUT_ID_MISSING`).
|
|
1177
|
+
*
|
|
1178
|
+
* An output's `value` names the case variable it writes. With no `value`, the
|
|
1179
|
+
* variable is the Designer's default: the camelCased field name, made unique
|
|
1180
|
+
* across the plan (`Comment` → `comment`, a second `Comment` → `comment2`), as
|
|
1181
|
+
* its own variable — never a reassignment of the first one.
|
|
1173
1182
|
*/
|
|
1174
1183
|
function emitActionField(f, outputElementId, resolver) {
|
|
1175
1184
|
const row = { name: f.name, type: f.type ?? 'string' };
|
|
@@ -1177,27 +1186,33 @@ function emitActionField(f, outputElementId, resolver) {
|
|
|
1177
1186
|
row.subType = f.subType;
|
|
1178
1187
|
if (f.displayName !== undefined)
|
|
1179
1188
|
row.displayName = f.displayName;
|
|
1180
|
-
if (
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1189
|
+
if (outputElementId === undefined) {
|
|
1190
|
+
if (f.value !== undefined)
|
|
1191
|
+
row.value = f.value;
|
|
1192
|
+
}
|
|
1193
|
+
else {
|
|
1194
|
+
// An explicit `value` keeps its variable: `id == var` like the Designer, and
|
|
1195
|
+
// a second form output into the same case variable takes a suffixed id and
|
|
1196
|
+
// becomes a reassigned row (`originalVar`). A defaulted one claims its own.
|
|
1197
|
+
const base = f.value ?? defaultActionOutputVar(f.name);
|
|
1198
|
+
const id = resolver ? claimOutputId(resolver, base) : base;
|
|
1199
|
+
const variable = f.value ?? id;
|
|
1200
|
+
row.value = variable;
|
|
1186
1201
|
row.id = id;
|
|
1187
|
-
row.var =
|
|
1188
|
-
if (id !==
|
|
1202
|
+
row.var = variable;
|
|
1203
|
+
if (id !== variable)
|
|
1189
1204
|
row.originalVar = id;
|
|
1190
1205
|
row.source = `=${f.name}`;
|
|
1191
1206
|
row.target = `=${id}`;
|
|
1192
1207
|
row.elementId = outputElementId;
|
|
1193
|
-
// `id ==
|
|
1208
|
+
// `id == var`: the row is the variable (the Designer writes no root entry
|
|
1194
1209
|
// for it). Only a suffixed, reassigned row needs the readable companion.
|
|
1195
|
-
if (resolver && id ===
|
|
1196
|
-
addOwnNameRow(resolver,
|
|
1197
|
-
else if (resolver && !resolver.varCompanions.has(
|
|
1198
|
-
resolver.varCompanions.set(
|
|
1199
|
-
id:
|
|
1200
|
-
name:
|
|
1210
|
+
if (resolver && id === variable)
|
|
1211
|
+
addOwnNameRow(resolver, variable, row);
|
|
1212
|
+
else if (resolver && !resolver.varCompanions.has(variable)) {
|
|
1213
|
+
resolver.varCompanions.set(variable, {
|
|
1214
|
+
id: variable,
|
|
1215
|
+
name: variable,
|
|
1201
1216
|
type: f.type ?? 'string',
|
|
1202
1217
|
elementId: 'root',
|
|
1203
1218
|
custom: true,
|
|
@@ -1444,7 +1459,7 @@ function connectorTaskData(spec, resolver, elementId, where, executionType) {
|
|
|
1444
1459
|
// from the `body` slot. This used to drop the whole wire and push a filled
|
|
1445
1460
|
// file part into the body, where the runtime does not look for it (#1420).
|
|
1446
1461
|
const fileParts = (slots.multipartParameters ?? []).filter((part) => part.dataType.toLowerCase() === 'file');
|
|
1447
|
-
context.push(io('metadata', 'json', { body: connectorMetadata(rc, op, slots, executionType) }));
|
|
1462
|
+
context.push(io('metadata', 'json', { body: connectorMetadata(rc, op, slots, elementId, executionType) }));
|
|
1448
1463
|
const inputs = [
|
|
1449
1464
|
ioSlot('pathParameters', pathParameters, `${elementId}`),
|
|
1450
1465
|
ioSlot('queryParameters', queryParameters, `${elementId}`),
|
|
@@ -1601,45 +1616,39 @@ function folderBindingRef(resolver, name, connection, site) {
|
|
|
1601
1616
|
}
|
|
1602
1617
|
return { id };
|
|
1603
1618
|
}
|
|
1604
|
-
/**
|
|
1619
|
+
/**
|
|
1620
|
+
* The connector `metadata` json blob: the FUNCTIONAL essentialConfiguration +
|
|
1605
1621
|
* activityTypeId, and the multipart wire of a multipart operation. Designer
|
|
1606
1622
|
* cosmetics (packageId/activityColor/…) are omitted — the caseplan
|
|
1607
|
-
* schema-validates without them (see design §C).
|
|
1608
|
-
|
|
1623
|
+
* schema-validates without them (see design §C).
|
|
1624
|
+
*
|
|
1625
|
+
* The configuration is the one Flow writes, from the shared
|
|
1626
|
+
* {@link buildEssentialConfiguration}. Case used to build its own, thinner copy:
|
|
1627
|
+
* no `operation` verb, `customFieldsRequestDetails`, `connectorVersion` or
|
|
1628
|
+
* `unifiedTypesCompatible`, a curated-only `instanceParameters` even for a
|
|
1629
|
+
* Generic activity, and the library version where the platform writes
|
|
1630
|
+
* `packageVersion: "1.0.0"` (#1420).
|
|
1631
|
+
*/
|
|
1632
|
+
function connectorMetadata(rc, op, slots, seed, executionType) {
|
|
1609
1633
|
// The part DECLARATIONS only: a file part's value rides on its `file` input.
|
|
1610
1634
|
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
|
-
};
|
|
1635
|
+
// The configuration replays the authored values (a schema action's parent
|
|
1636
|
+
// fields, a CEQL filter's tree), keyed by the library's own names, as Flow's.
|
|
1637
|
+
const essential = buildEssentialConfiguration(rc.entry, rc.version, replayInputsOf(slots), seed, executionType ?? null);
|
|
1638
|
+
const configuration = `=jsonString:${JSON.stringify({ essentialConfiguration: essential })}`;
|
|
1639
|
+
const instanceParameters = essential.instanceParameters;
|
|
1640
|
+
const objectName = String(op.objectName ?? rc.nodeType.split('.').pop());
|
|
1632
1641
|
return {
|
|
1633
1642
|
activityPropertyConfiguration: {
|
|
1634
1643
|
...(multipartParameters.length ? { multipartParameters } : {}),
|
|
1635
|
-
configuration
|
|
1644
|
+
configuration,
|
|
1636
1645
|
uiPathActivityTypeId: rc.activityTypeId ?? '',
|
|
1637
1646
|
errorState: { issues: [] },
|
|
1638
1647
|
...(executionType ? { executionType } : {}),
|
|
1639
1648
|
},
|
|
1640
1649
|
activityMetadata: {
|
|
1641
1650
|
activity: {
|
|
1642
|
-
displayName: rc.entry.display?.label ??
|
|
1651
|
+
displayName: rc.entry.display?.label ?? objectName,
|
|
1643
1652
|
description: rc.entry.display?.description ?? '',
|
|
1644
1653
|
category: rc.connectorName,
|
|
1645
1654
|
configuration: JSON.stringify(instanceParameters),
|
|
@@ -1653,7 +1662,7 @@ function connectorMetadata(rc, op, slots, executionType) {
|
|
|
1653
1662
|
telemetryData: {
|
|
1654
1663
|
connectorKey: rc.connectorKey,
|
|
1655
1664
|
connectorName: rc.connectorName,
|
|
1656
|
-
objectName
|
|
1665
|
+
objectName,
|
|
1657
1666
|
objectDisplayName: op.objectDisplayName ?? rc.entry.display?.operationLabel ?? '',
|
|
1658
1667
|
},
|
|
1659
1668
|
};
|
|
@@ -1709,8 +1718,7 @@ function ownOutputVars(built) {
|
|
|
1709
1718
|
if (isOwnNameOutput(o))
|
|
1710
1719
|
vars.add(o.var);
|
|
1711
1720
|
for (const f of task.action?.outputs ?? [])
|
|
1712
|
-
|
|
1713
|
-
vars.add(f.value);
|
|
1721
|
+
vars.add(f.value ?? defaultActionOutputVar(f.name));
|
|
1714
1722
|
}
|
|
1715
1723
|
return vars;
|
|
1716
1724
|
}
|
|
@@ -1731,15 +1739,6 @@ function keepsOwnName(name, field) {
|
|
|
1731
1739
|
return false;
|
|
1732
1740
|
return [field, camelizeName(field)].some((base) => name === base || (name.startsWith(base) && /^(?:[2-9]|[1-9]\d+)$/.test(name.slice(base.length))));
|
|
1733
1741
|
}
|
|
1734
|
-
/**
|
|
1735
|
-
* The Designer's `camelizeDisplayName`: drop non-identifier characters, split on
|
|
1736
|
-
* spaces/underscores, lower the first letter of the first word and upper the
|
|
1737
|
-
* first letter of the rest (`APIOutput1` → `aPIOutput1`).
|
|
1738
|
-
*/
|
|
1739
|
-
function camelizeName(name) {
|
|
1740
|
-
const words = name.replace(/[^a-zA-Z0-9_ ]/g, '').split(/[\s_]+/).filter(Boolean);
|
|
1741
|
-
return words.map((w, i) => (i === 0 ? w.charAt(0).toLowerCase() : w.charAt(0).toUpperCase()) + w.slice(1)).join('');
|
|
1742
|
-
}
|
|
1743
1742
|
/** The `Error` output's schema: the designer's (and the CLI's) `ERROR_OUTPUT_SCHEMA`. */
|
|
1744
1743
|
const ERROR_OUTPUT_SCHEMA = {
|
|
1745
1744
|
type: 'object',
|
|
@@ -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.2",
|
|
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": "410164517bc2552666c867e9107b2cbb57acd083"
|
|
100
100
|
}
|