@uipath/maestro-builder-sdk 6.121.1 → 6.122.0
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 +55 -55
- package/dist/api-members.md +235 -233
- package/dist/bpmn/bpmn-sdk.d.ts +12 -10
- package/dist/bpmn/bpmn-sdk.js +17 -12
- package/dist/bpmn/connector-lift-verify.js +49 -1
- package/dist/bpmn/data-service.d.ts +75 -31
- package/dist/bpmn/data-service.js +187 -33
- package/dist/bpmn/decompile.js +10 -3
- package/dist/bpmn/serialize.js +18 -8
- package/dist/bpmn-api.md +2 -1
- package/dist/cli/commands/registry.js +3 -1
- package/dist/core/connector-configuration.d.ts +3 -1
- package/dist/core/connector-configuration.js +5 -1
- package/dist/core/connector-v2-metadata.d.ts +5 -1
- package/dist/core/connector-v2-metadata.js +7 -2
- package/dist/core/resource-picker.d.ts +23 -0
- package/dist/core/resource-picker.js +56 -0
- package/dist/core/resource-resolution.d.ts +13 -3
- package/dist/core/resource-resolution.js +19 -4
- package/dist/registry/prepare/resources.d.ts +1 -1
- package/dist/registry/prepare/resources.js +17 -9
- package/dist/registry/prepare-cli.d.ts +2 -0
- package/dist/registry/prepare-cli.js +15 -5
- package/package.json +4 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CompileRefusal } from '../core/compile-refusal.js';
|
|
2
|
-
import { entityPrepareCommand, isEntityRef,
|
|
2
|
+
import { ENTITY_KIND, entityPrepareCommand, isEntityRef, resolveRecordedResource, } from '../core/resource-resolution.js';
|
|
3
|
+
import { PICKER_ENTITY_RESOURCE } from '../core/resource-picker.js';
|
|
3
4
|
import { ownEntry } from '../core/own-entry.js';
|
|
4
5
|
import { connectorActivityMetadata } from '../core/connector-v2-metadata.js';
|
|
5
6
|
import { ACTIVITY_CONFIGURATION_V2 } from './connector.js';
|
|
@@ -21,6 +22,8 @@ export function isFolderEntity(entity) {
|
|
|
21
22
|
* @param entity - The Data Service entity: a name, e.g. `'ContractRegistry'`, or a
|
|
22
23
|
* folder-scoped `{ name, folderKey }`.
|
|
23
24
|
* @param operation - Which operation, and its parameters.
|
|
25
|
+
* @param picker - For a folder-scoped entity, its recorded resource key and binding
|
|
26
|
+
* ids: a record operation other than delete is then the V2 `_V3` wire.
|
|
24
27
|
* @returns The wire shape, without the connection/folder wiring the builder adds.
|
|
25
28
|
* @throws CompileRefusal for a folder-scoped entity on a file operation (`BPMN_DATA_SERVICE_FOLDER_FILE_OP`), or one with no name
|
|
26
29
|
* (`BPMN_DATA_SERVICE_ENTITY_NO_NAME`), no folder key (`BPMN_DATA_SERVICE_FOLDER_KEY_MISSING`) or a folder key that is not a
|
|
@@ -28,9 +31,9 @@ export function isFolderEntity(entity) {
|
|
|
28
31
|
* (`BPMN_DATA_SERVICE_QUERY_START_INVALID`) or whose literal `limit` is not one from 1 to 1000
|
|
29
32
|
* (`BPMN_DATA_SERVICE_QUERY_LIMIT_INVALID`).
|
|
30
33
|
*/
|
|
31
|
-
export function dataServiceWire(entity, operation) {
|
|
34
|
+
export function dataServiceWire(entity, operation, picker) {
|
|
32
35
|
if (typeof entity !== 'string')
|
|
33
|
-
return folderEntityWire(entity, operation);
|
|
36
|
+
return folderEntityWire(entity, operation, picker);
|
|
34
37
|
const attachment = '/Attachment/{entityName}/{recordId}/{fieldName}';
|
|
35
38
|
switch (operation.op) {
|
|
36
39
|
case 'create':
|
|
@@ -88,47 +91,92 @@ export function isPendingEntity(entity) {
|
|
|
88
91
|
return isEntityRef(entity) && !isFolderEntity(entity);
|
|
89
92
|
}
|
|
90
93
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
94
|
+
* True when a `{ name, folderKey }` entity's wire waits for the recorded row too: a
|
|
95
|
+
* record operation that has a V2 `_V3` form ({@link FOLDER_RECORD_OPERATIONS}), on a
|
|
96
|
+
* folder KEY rather than an `=`-expression. The V2 wire saves the entity's resource
|
|
97
|
+
* key, which the folder key alone does not give, so `prepare --entity <name>
|
|
98
|
+
* --folder-key <key>` records it. Delete, the file operations and an expression
|
|
99
|
+
* folder stay the V1 form, which needs no row.
|
|
100
|
+
*/
|
|
101
|
+
export function pendsOnFolderKeyRow(entity, operation) {
|
|
102
|
+
return isFolderEntity(entity)
|
|
103
|
+
&& typeof entity.folderKey === 'string'
|
|
104
|
+
&& GUID.test(entity.folderKey)
|
|
105
|
+
&& typeof entity.name === 'string'
|
|
106
|
+
&& entity.name.trim() !== ''
|
|
107
|
+
&& ownEntry(FOLDER_RECORD_OPERATIONS, operation.op) !== undefined;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The wire for a pending entity from the row `registry prepare --entity` recorded.
|
|
111
|
+
*
|
|
112
|
+
* A folder-scoped row gives the entity's binding pair, and a wire that takes the pair's
|
|
113
|
+
* final ids: the serializer settles them first (two entities cannot share one). A record
|
|
114
|
+
* operation other than delete is then the V2 `_V3` form, which references the pair as
|
|
115
|
+
* Studio Web's picker does; delete and the file operations are the V1 form, beside which
|
|
116
|
+
* the pair is unreferenced and carries the resource key `bpmn refresh` declares the
|
|
117
|
+
* entity from. A tenant row gives the tenant form and no bindings. `check` runs the
|
|
118
|
+
* serializer, so the two cannot disagree.
|
|
95
119
|
*
|
|
96
120
|
* @throws CompileRefusal `RESOURCE_UNRESOLVED` or `RESOURCE_ROW_INCOMPLETE` from
|
|
97
|
-
* `
|
|
98
|
-
* file operation on an entity that resolved to a folder.
|
|
121
|
+
* `resolveRecordedResource`, prefixed with the node; `BPMN_DATA_SERVICE_FOLDER_FILE_OP`
|
|
122
|
+
* (from the wire) for a file operation on an entity that resolved to a folder.
|
|
99
123
|
*/
|
|
100
124
|
export function lowerDataServiceEntity(id, pending, resources) {
|
|
101
|
-
|
|
125
|
+
const { name, folder, folderKey } = pending.ref;
|
|
126
|
+
const ref = {
|
|
127
|
+
kind: ENTITY_KIND, name, ...(folder !== undefined ? { folder } : {}), ...(folderKey !== undefined ? { folderKey } : {}),
|
|
128
|
+
};
|
|
129
|
+
let row;
|
|
102
130
|
try {
|
|
103
|
-
|
|
131
|
+
row = resolveRecordedResource(ref, resources);
|
|
104
132
|
}
|
|
105
133
|
catch (error) {
|
|
106
134
|
if (error instanceof CompileRefusal)
|
|
107
135
|
throw new CompileRefusal(error.code, `dataService "${id}": ${error.message}`, error.suggestion);
|
|
108
136
|
throw error;
|
|
109
137
|
}
|
|
110
|
-
if (
|
|
111
|
-
return { wire: dataServiceWire(
|
|
112
|
-
}
|
|
138
|
+
if (row.scope === 'tenant')
|
|
139
|
+
return { bindings: [], wire: () => dataServiceWire(row.name, pending.operation) };
|
|
140
|
+
const entity = { name: row.name, folderKey: row.folderKey };
|
|
141
|
+
const bindings = entityBindings(row.name, row.folderKey, row.key, pending.operation.op === 'delete' ? EntityBindingForm.V1 : EntityBindingForm.Picker);
|
|
113
142
|
return {
|
|
114
|
-
|
|
115
|
-
bindings:
|
|
143
|
+
bindings,
|
|
144
|
+
wire: (ids = { name: bindings[0].id, folder: bindings[1].id }) => dataServiceWire(entity, pending.operation, { resourceKey: row.key, nameBinding: ids.name, folderBinding: ids.folder }),
|
|
116
145
|
};
|
|
117
146
|
}
|
|
118
147
|
/**
|
|
119
|
-
* The
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
148
|
+
* The binding pair of a folder-scoped entity, `name` / `folderKey` attributes and one
|
|
149
|
+
* resource key, in one of two forms:
|
|
150
|
+
*
|
|
151
|
+
* - for a V2 task, as Studio Web's picker writes it: `resource="entity"`, names
|
|
152
|
+
* `Entity` and `Entity folder`;
|
|
153
|
+
* - for a V1 task (delete), as Flow writes it (`entityBindings` in
|
|
154
|
+
* `nodes/data-fabric/flow/shared.ts`): `resource="Entity"`, names `<name>` and
|
|
155
|
+
* `<name>Folder`. A V1 task has no picker metadata, so `bpmn refresh` declares its
|
|
156
|
+
* entity from this capital-`E` pair alone.
|
|
157
|
+
*
|
|
158
|
+
* The ids are `b<Entity>EntityName` / `b<Entity>EntityFolder` either way, so two tasks
|
|
159
|
+
* on one entity share one pair, and the serializer keeps the picker form when any of
|
|
160
|
+
* them is V2, whose metadata then declares the entity.
|
|
124
161
|
*/
|
|
125
|
-
function entityBindings(name, folderKey, resourceKey) {
|
|
162
|
+
function entityBindings(name, folderKey, resourceKey, form) {
|
|
126
163
|
const base = `b${name.replace(/[^A-Za-z0-9]/g, '')}Entity`;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
164
|
+
const resource = form === EntityBindingForm.Picker ? PICKER_ENTITY_RESOURCE : V1_ENTITY_RESOURCE;
|
|
165
|
+
const row = (suffix, label, value, propertyAttribute) => ({ id: `${base}${suffix}`, name: label, type: 'string', resource, resourceKey, default: value, propertyAttribute });
|
|
166
|
+
return form === EntityBindingForm.Picker
|
|
167
|
+
? [row('Name', 'Entity', name, 'name'), row('Folder', 'Entity folder', folderKey, 'folderKey')]
|
|
168
|
+
: [row('Name', name, name, 'name'), row('Folder', `${name}Folder`, folderKey, 'folderKey')];
|
|
131
169
|
}
|
|
170
|
+
/** Which wire contract a folder entity's binding pair follows; see {@link entityBindings}. */
|
|
171
|
+
var EntityBindingForm;
|
|
172
|
+
(function (EntityBindingForm) {
|
|
173
|
+
/** Studio Web's picker pair, for a V2 task. */
|
|
174
|
+
EntityBindingForm[EntityBindingForm["Picker"] = 0] = "Picker";
|
|
175
|
+
/** Flow's pair, for a V1 task. */
|
|
176
|
+
EntityBindingForm[EntityBindingForm["V1"] = 1] = "V1";
|
|
177
|
+
})(EntityBindingForm || (EntityBindingForm = {}));
|
|
178
|
+
/** The binding `resource` of a V1 task's entity pair, capital `E` as Flow writes it. */
|
|
179
|
+
const V1_ENTITY_RESOURCE = 'Entity';
|
|
132
180
|
/**
|
|
133
181
|
* The `uipath:context` values of a `.dataService()` task, in the order the canvas writes
|
|
134
182
|
* them: the connection wiring, the operation's identity, and for a V2 operation the
|
|
@@ -150,13 +198,14 @@ export function dataServiceContext(wire, wiring) {
|
|
|
150
198
|
metadata: {},
|
|
151
199
|
};
|
|
152
200
|
}
|
|
201
|
+
const pickers = wire.picker !== undefined ? [{ ...wire.picker, elementId: wiring.elementId ?? '' }] : [];
|
|
153
202
|
return {
|
|
154
203
|
connectorKey: DATA_SERVICE_CONNECTOR_KEY,
|
|
155
204
|
connection,
|
|
156
205
|
resourceKey,
|
|
157
206
|
...(folderKey !== undefined ? { folderKey } : {}),
|
|
158
207
|
...wire.context,
|
|
159
|
-
metadata: dataServiceMetadata(wire.catalog, wire.slots),
|
|
208
|
+
metadata: dataServiceMetadata(wire.catalog, wire.slots, pickers),
|
|
160
209
|
activityConfigurationVersion: ACTIVITY_CONFIGURATION_V2,
|
|
161
210
|
};
|
|
162
211
|
}
|
|
@@ -166,8 +215,15 @@ const DATA_SERVICE_CONNECTOR_NAME = 'UiPath Data Fabric';
|
|
|
166
215
|
* The design-time `metadata` of a V2 record operation, from the shared builder: the
|
|
167
216
|
* operation is described here rather than resolved from the library, which ships
|
|
168
217
|
* only `query-entity-records`.
|
|
218
|
+
*
|
|
219
|
+
* A folder-scoped entity's picker adds what the panel saves for one: the schema
|
|
220
|
+
* replay of the folder entity (`FetchObjectMetadataFolder` on the picker field, the
|
|
221
|
+
* `_V3` operations' `design.actions`), the saved selection, and the `bindings` entry.
|
|
169
222
|
*/
|
|
170
|
-
function dataServiceMetadata(catalog, slots) {
|
|
223
|
+
function dataServiceMetadata(catalog, slots, pickers) {
|
|
224
|
+
const replay = pickers.length > 0
|
|
225
|
+
? { customFieldsRequestDetails: { objectActionName: 'FetchObjectMetadataFolder', parameterValues: pickers.map((p) => [p.field, p.name]) } }
|
|
226
|
+
: {};
|
|
171
227
|
const operation = {
|
|
172
228
|
name: catalog.verb,
|
|
173
229
|
objectName: catalog.objectName,
|
|
@@ -177,6 +233,7 @@ function dataServiceMetadata(catalog, slots) {
|
|
|
177
233
|
activityType: 'Curated',
|
|
178
234
|
supportsStreaming: false,
|
|
179
235
|
subType: 'standard',
|
|
236
|
+
...replay,
|
|
180
237
|
};
|
|
181
238
|
const metadata = connectorActivityMetadata({
|
|
182
239
|
entry: { connector: { key: DATA_SERVICE_CONNECTOR_KEY }, operation, display: { label: catalog.displayName, description: catalog.description } },
|
|
@@ -185,7 +242,7 @@ function dataServiceMetadata(catalog, slots) {
|
|
|
185
242
|
nodeType: `uipath.connector.${DATA_SERVICE_CONNECTOR_KEY}.${catalog.objectName}`,
|
|
186
243
|
connectorKey: DATA_SERVICE_CONNECTOR_KEY,
|
|
187
244
|
connectorName: DATA_SERVICE_CONNECTOR_NAME,
|
|
188
|
-
}, operation, slots, catalog.objectName);
|
|
245
|
+
}, operation, slots, catalog.objectName, undefined, undefined, pickers);
|
|
189
246
|
// A list operation's paging, as Studio Web saves the query (`maxPageSize` is the connector's).
|
|
190
247
|
return catalog.verb === 'list' ? { ...metadata, inputMetadata: { operation: 'list', pagination: { maxPageSize: QUERY_PAGE_CAP } } } : metadata;
|
|
191
248
|
}
|
|
@@ -222,6 +279,37 @@ const RECORD_OPERATIONS = {
|
|
|
222
279
|
description: 'Deletes an existing record for the selected entity from Data Fabric', label: (e) => `Delete ${e} record`,
|
|
223
280
|
},
|
|
224
281
|
};
|
|
282
|
+
/**
|
|
283
|
+
* The four `_V3` record operations Studio Web's V2 panel saves for a folder-scoped
|
|
284
|
+
* entity, from `uip maestro bpmn registry get Intsvc.ActivityExecution --object-name
|
|
285
|
+
* <Op>_V3 --input-details … --solution-folder …` (uip 1.207, alpha, 2026-11-13;
|
|
286
|
+
* `tests/fixtures/bpmn/dataservice-folder-v2/`). Delete has no entry: the design-time
|
|
287
|
+
* client fails to build `DeleteEntityRecord_V3` with a picker ("Cannot convert undefined
|
|
288
|
+
* or null to object"), so there is no V2 save to match, and it stays the V1 form.
|
|
289
|
+
*/
|
|
290
|
+
const FOLDER_RECORD_OPERATIONS = {
|
|
291
|
+
create: {
|
|
292
|
+
objectName: 'CreateEntityRecord_V3', verb: 'create', method: 'POST', path: '/v3/CreateEntityRecord/insert',
|
|
293
|
+
activityTypeId: '11a59287-5a7a-3a74-b000-91d2c2b6428d', displayName: 'Create Entity Record (Preview)',
|
|
294
|
+
description: 'Creates a new record for the selected entity in Data Fabric.', label: (e) => `Create ${e}`,
|
|
295
|
+
},
|
|
296
|
+
update: {
|
|
297
|
+
objectName: 'UpdateEntityRecord_V3', verb: 'replace', method: 'PUT', path: '/v3/UpdateEntityRecord/update',
|
|
298
|
+
activityTypeId: 'fa2a1fb6-c297-3e7b-8ced-99521f9d60d8', displayName: 'Update Entity Record (Preview)',
|
|
299
|
+
description: 'Updates an existing record for the selected entity in Data Fabric.', label: (e) => `Update ${e}`,
|
|
300
|
+
},
|
|
301
|
+
get: {
|
|
302
|
+
objectName: 'GetEntityRecord_V3', verb: 'retrieve', method: 'GET', path: '/v3/GetEntityRecord/read',
|
|
303
|
+
activityTypeId: 'd94d7374-fcc3-3212-83f6-1dac43c4e109', displayName: 'Get Entity Record by ID (Preview)',
|
|
304
|
+
description: 'Reads an existing record for the selected entity from Data Fabric.', label: (e) => `Get ${e} record`,
|
|
305
|
+
},
|
|
306
|
+
query: {
|
|
307
|
+
objectName: 'QueryEntityRecords_V3', verb: 'list', method: 'POST', path: '/v3/QueryEntityRecords/query',
|
|
308
|
+
activityTypeId: 'deababb7-2da5-3651-a5ca-2e6bb4bbd957', displayName: 'Query Entity Records (Preview)',
|
|
309
|
+
description: 'Retrieves a list of records for the selected entity from Data Fabric, according to specified filters.',
|
|
310
|
+
label: (e) => `Query ${e}`,
|
|
311
|
+
},
|
|
312
|
+
};
|
|
225
313
|
/** The `_V3` scope rows' wire names, as `describe` declares them and the canvas writes them. */
|
|
226
314
|
const FOLDER_SCOPE = {
|
|
227
315
|
scopeParameter: 'entityScope',
|
|
@@ -278,17 +366,21 @@ function validateFolderEntity(entity) {
|
|
|
278
366
|
}
|
|
279
367
|
}
|
|
280
368
|
/**
|
|
281
|
-
* The
|
|
282
|
-
*
|
|
283
|
-
*
|
|
369
|
+
* The `_V3` form for a folder-scoped entity: V2 ({@link folderEntityV2Wire}) for a record
|
|
370
|
+
* operation that has one when the entity's keys are recorded (`picker`), V1 otherwise.
|
|
371
|
+
* In the V1 form the three scope rows come first, then the operation's own parameters,
|
|
372
|
+
* which `_V3` takes as query rows where the tenant forms use the path (`recordId`, never
|
|
373
|
+
* `id`).
|
|
284
374
|
*/
|
|
285
|
-
function folderEntityWire(entity, operation) {
|
|
375
|
+
function folderEntityWire(entity, operation, picker) {
|
|
286
376
|
validateFolderEntity(entity);
|
|
287
377
|
if (operation.op === 'downloadFile' || operation.op === 'uploadFile' || operation.op === 'deleteFile') {
|
|
288
378
|
throw new CompileRefusal('BPMN_DATA_SERVICE_FOLDER_FILE_OP', `dataService: ${operation.op} does not support a folder-scoped entity yet. Its _V3 operation declares no field-name parameter, ` +
|
|
289
379
|
`so where it takes "${operation.field}" is unknown here, and there is no SDK form for it. Tell the user; a plain entity name would address a tenant-level entity instead, ` +
|
|
290
380
|
'and a hand-filled .activity() would have to guess the same parameter.');
|
|
291
381
|
}
|
|
382
|
+
if (picker !== undefined && operation.op !== 'delete')
|
|
383
|
+
return folderEntityV2Wire(entity, operation, picker);
|
|
292
384
|
const scope = [
|
|
293
385
|
scalarRow(FOLDER_SCOPE.scopeParameter, 'query', FOLDER_SCOPE.scopeValue),
|
|
294
386
|
scalarRow(FOLDER_SCOPE.nameParameter, 'query', entity.name),
|
|
@@ -323,6 +415,68 @@ function folderEntityWire(entity, operation) {
|
|
|
323
415
|
return wire([scalarRow('recordId', 'query', operation.recordId)]);
|
|
324
416
|
}
|
|
325
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* The V2 `_V3` wire for a folder-scoped entity, as Studio Web's V2 panel saves it: an
|
|
420
|
+
* empty `pathParameters` row; the `queryParameters` row with the scope, the picker and
|
|
421
|
+
* its folder as `=bindings.<id>` references to the entity's pair, the operation's own
|
|
422
|
+
* parameters between them; and the `body` row, which a query always has (`{}`, or the
|
|
423
|
+
* sort field). The picker rides on the wire for the metadata to save.
|
|
424
|
+
*/
|
|
425
|
+
function folderEntityV2Wire(entity, operation, picker) {
|
|
426
|
+
const catalog = ownEntry(FOLDER_RECORD_OPERATIONS, operation.op);
|
|
427
|
+
const defined = (params) => Object.fromEntries(Object.entries(params).filter(([, v]) => v !== undefined));
|
|
428
|
+
let params;
|
|
429
|
+
let body;
|
|
430
|
+
switch (operation.op) {
|
|
431
|
+
case 'create':
|
|
432
|
+
params = {};
|
|
433
|
+
body = operation.record;
|
|
434
|
+
break;
|
|
435
|
+
case 'update':
|
|
436
|
+
params = { recordId: operation.id };
|
|
437
|
+
body = operation.record;
|
|
438
|
+
break;
|
|
439
|
+
case 'get':
|
|
440
|
+
params = defined({ recordId: operation.recordId, expansionLevel: operation.expansionLevel });
|
|
441
|
+
break;
|
|
442
|
+
case 'query':
|
|
443
|
+
params = defined({
|
|
444
|
+
queryExpression: operation.where,
|
|
445
|
+
start: operation.start ?? 0,
|
|
446
|
+
limit: operation.limit ?? 100,
|
|
447
|
+
isAscending: operation.ascending,
|
|
448
|
+
expansionLevel: operation.expansionLevel,
|
|
449
|
+
});
|
|
450
|
+
// The sort field is a body field, as in the tenant form (`recordWire`).
|
|
451
|
+
body = operation.sortBy !== undefined ? { _sortFieldName: operation.sortBy } : {};
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
const query = {
|
|
455
|
+
[FOLDER_SCOPE.scopeParameter]: FOLDER_SCOPE.scopeValue,
|
|
456
|
+
[FOLDER_SCOPE.nameParameter]: `=bindings.${picker.nameBinding}`,
|
|
457
|
+
...params,
|
|
458
|
+
[FOLDER_SCOPE.folderKeyParameter]: `=bindings.${picker.folderBinding}`,
|
|
459
|
+
};
|
|
460
|
+
const pathParameters = {};
|
|
461
|
+
return {
|
|
462
|
+
label: catalog.label(entity.name),
|
|
463
|
+
context: { objectName: catalog.objectName, method: catalog.method, path: catalog.path },
|
|
464
|
+
inputRows: [
|
|
465
|
+
{ name: 'pathParameters', type: 'json', target: 'pathParameters', body: pathParameters },
|
|
466
|
+
{ name: 'queryParameters', type: 'json', target: 'queryParameters', body: query },
|
|
467
|
+
...(body !== undefined ? [bodyRow(body)] : []),
|
|
468
|
+
],
|
|
469
|
+
catalog,
|
|
470
|
+
slots: { pathParameters, queryParameters: query, bodyParameters: body ?? {} },
|
|
471
|
+
picker: {
|
|
472
|
+
field: FOLDER_SCOPE.nameParameter,
|
|
473
|
+
bucket: 'queryParameters',
|
|
474
|
+
name: entity.name,
|
|
475
|
+
folderKey: entity.folderKey,
|
|
476
|
+
resourceKey: picker.resourceKey,
|
|
477
|
+
},
|
|
478
|
+
};
|
|
479
|
+
}
|
|
326
480
|
/**
|
|
327
481
|
* The V2 curated wire for a tenant-level entity's record operation: the entity as the
|
|
328
482
|
* `entityName` path parameter, the record id (`recordId`, never `id`) and the query's
|
package/dist/bpmn/decompile.js
CHANGED
|
@@ -2498,7 +2498,14 @@ function bindingIsReferenced(xml, id) {
|
|
|
2498
2498
|
return new RegExp(String.raw `bindings\.${id.replace(/[.*+?^${}()|[\]\\]/g, String.raw `\$&`)}\b`).test(xml);
|
|
2499
2499
|
}
|
|
2500
2500
|
/**
|
|
2501
|
-
*
|
|
2501
|
+
* An entity binding row: `resource="entity"` as Studio Web's V2 picker and the SDK
|
|
2502
|
+
* write it, or `Entity` as the Flow→BPMN converter and earlier SDK builds write it.
|
|
2503
|
+
*/
|
|
2504
|
+
function isEntityBinding(b) {
|
|
2505
|
+
return typeof b.resource === 'string' && b.resource.toLowerCase() === 'entity';
|
|
2506
|
+
}
|
|
2507
|
+
/**
|
|
2508
|
+
* The resource keys of the entity binding pairs a Data Service task uses.
|
|
2502
2509
|
*
|
|
2503
2510
|
* A folder-scoped `.dataService()` writes its entity's `name` / `folderKey` pair beside
|
|
2504
2511
|
* the task rather than referencing it (`bpmn/data-service.ts`): the pair is how
|
|
@@ -2526,7 +2533,7 @@ function usedEntityKeys(bindings, container) {
|
|
|
2526
2533
|
const folderKey = row('folderEntityName_folderKey');
|
|
2527
2534
|
if (typeof name !== 'string' || typeof folderKey !== 'string')
|
|
2528
2535
|
continue;
|
|
2529
|
-
const has = (attr, value, key) => bindings.some((b) => b
|
|
2536
|
+
const has = (attr, value, key) => bindings.some((b) => isEntityBinding(b) && b.propertyAttribute === attr && b.default === value && b.resourceKey === key);
|
|
2530
2537
|
for (const b of bindings) {
|
|
2531
2538
|
const key = b.resourceKey;
|
|
2532
2539
|
if (key !== undefined && has('name', name, key) && has('folderKey', folderKey, key))
|
|
@@ -2700,7 +2707,7 @@ export async function decompile(xml, options = {}) {
|
|
|
2700
2707
|
const bindingEntries = [];
|
|
2701
2708
|
const entityKeys = usedEntityKeys(bindings?.binding ?? [], process);
|
|
2702
2709
|
for (const b of bindings?.binding ?? []) {
|
|
2703
|
-
if (!options.keepUnusedBindings && !bindingIsReferenced(xml, b.id) && !(b
|
|
2710
|
+
if (!options.keepUnusedBindings && !bindingIsReferenced(xml, b.id) && !(isEntityBinding(b) && entityKeys.has(b.resourceKey))) {
|
|
2704
2711
|
droppedBindings.push(b.id);
|
|
2705
2712
|
continue;
|
|
2706
2713
|
}
|
package/dist/bpmn/serialize.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import BpmnModdle from 'bpmn-moddle';
|
|
18
18
|
import { createRequire } from 'node:module';
|
|
19
|
+
import { PICKER_ENTITY_RESOURCE } from '../core/resource-picker.js';
|
|
19
20
|
import { createConnectorTask } from './connector.js';
|
|
20
21
|
import { createConnectorEvent, createExternalTask } from './intsvc.js';
|
|
21
22
|
import { connectorEventErrorVar, intsvcOutputVar } from './intsvc-vars.js';
|
|
@@ -806,8 +807,9 @@ function createNode(ctx, n) {
|
|
|
806
807
|
}
|
|
807
808
|
}
|
|
808
809
|
/**
|
|
809
|
-
* A `.dataService()`
|
|
810
|
-
*
|
|
810
|
+
* A pending `.dataService()` (`{ name, folder }`, or `{ name, folderKey }` on a record
|
|
811
|
+
* operation with a V2 form) as it compiles: the entity's binding pair into the sink, and
|
|
812
|
+
* the wire from the recorded row, built on the pair's settled ids (`lowerDataServiceEntity`).
|
|
811
813
|
*
|
|
812
814
|
* A pair's id is taken only when nothing else holds it, or what holds it is the same
|
|
813
815
|
* entity (the same resource key): another task's pair, or the pair a decompiled
|
|
@@ -822,7 +824,7 @@ function createNode(ctx, n) {
|
|
|
822
824
|
* id is a label only; a tool that keys on it must not assume it is stable.
|
|
823
825
|
*/
|
|
824
826
|
function lowerPendingDataService(ctx, n) {
|
|
825
|
-
const {
|
|
827
|
+
const { bindings, wire: wireFor } = lowerDataServiceEntity(n.id, n.dataServiceEntity, ctx.resources);
|
|
826
828
|
const free = (suffix) => bindings.every((b) => {
|
|
827
829
|
const id = withSuffix(b.id, suffix);
|
|
828
830
|
const held = ctx.bindingSink.get(id);
|
|
@@ -839,14 +841,22 @@ function lowerPendingDataService(ctx, n) {
|
|
|
839
841
|
for (const b of bindings) {
|
|
840
842
|
const id = withSuffix(b.id, suffix);
|
|
841
843
|
// A declared pair for this entity is written from the declaration (it wins on
|
|
842
|
-
// an id); only a pair nothing declares goes into the sink.
|
|
843
|
-
|
|
844
|
+
// an id); only a pair nothing declares goes into the sink. Tasks on one entity
|
|
845
|
+
// share the pair: the picker form, once any of them is V2, whatever their order.
|
|
846
|
+
if (ctx.declaredBindings?.has(id))
|
|
847
|
+
continue;
|
|
848
|
+
const held = ctx.bindingSink.get(id);
|
|
849
|
+
if (held === undefined || b.resource === PICKER_ENTITY_RESOURCE)
|
|
844
850
|
ctx.bindingSink.set(id, { ...b, id });
|
|
845
851
|
}
|
|
852
|
+
const wire = bindings.length === 2
|
|
853
|
+
? wireFor({ name: withSuffix(bindings[0].id, suffix), folder: withSuffix(bindings[1].id, suffix) })
|
|
854
|
+
: wireFor();
|
|
846
855
|
const context = n.context;
|
|
847
|
-
//
|
|
848
|
-
//
|
|
849
|
-
const
|
|
856
|
+
// The connection's key, which a V2 wire carries as `resourceKey`: the builder recorded it
|
|
857
|
+
// with the pending entity, since the wire it wrote first may be V1.
|
|
858
|
+
const resourceKey = n.dataServiceEntity.connectionKey ?? context.resourceKey ?? '';
|
|
859
|
+
const wiring = { connection: context.connection, resourceKey, folderKey: context.folderKey, elementId: n.id };
|
|
850
860
|
return { ...n, context: dataServiceContext(wire, wiring), inputRows: wire.inputRows };
|
|
851
861
|
}
|
|
852
862
|
/** `bOrdersEntityName` with suffix `2` → `bOrdersEntity2Name`: the pair keeps its shared stem. */
|
package/dist/bpmn-api.md
CHANGED
|
@@ -906,8 +906,9 @@ One `uipath:context` input row, spelled out.
|
|
|
906
906
|
|
|
907
907
|
A `.dataService()` whose entity is `{ name, folder }`: which wire it gets, the `_V3` folder form or the tenant form, is…
|
|
908
908
|
|
|
909
|
-
- `PendingDataServiceEntity.ref: EntityRef` — The entity as authored: its name, and the folder path it lives in.
|
|
909
|
+
- `PendingDataServiceEntity.ref: EntityRef & { folderKey?: string }` — The entity as authored: its name, and the folder path or folder key it lives in.
|
|
910
910
|
- `PendingDataServiceEntity.operation: DataServiceOperation` — The operation and its parameters, for the wire the recorded row selects.
|
|
911
|
+
- `PendingDataServiceEntity.connectionKey?: string` — The connection's key, which a V2 wire carries as `resourceKey`.
|
|
911
912
|
|
|
912
913
|
### `RegistryTypeSpec`
|
|
913
914
|
|
|
@@ -167,6 +167,7 @@ export function registerRegistryCommands(program) {
|
|
|
167
167
|
.option('--kind <kind>', 'a solution resource kind to resolve and record, with --name, e.g. Asset or Queue')
|
|
168
168
|
.option('--name <name>', 'with --kind: the resource name')
|
|
169
169
|
.option('--folder-path <path>', "with --entity or --kind: the Orchestrator folder path the resource lives in, e.g. Shared")
|
|
170
|
+
.option('--folder-key <key>', "with --entity or --kind: the key of the Orchestrator folder the resource lives in, instead of --folder-path")
|
|
170
171
|
.option('--resource-source <source>', 'with --entity or --kind: auto (default), local (this solution) or remote (the tenant)')
|
|
171
172
|
.option('--resources <file>', 'resource ledger to update (default: ./.flow-sdk/resources.json)')
|
|
172
173
|
.option('--refresh-resources', 're-resolve every resource already recorded (a named one is always resolved afresh)')
|
|
@@ -180,7 +181,7 @@ export function registerRegistryCommands(program) {
|
|
|
180
181
|
// Resource-only: nothing to pair with --action.
|
|
181
182
|
if (!resourceMode || options.action !== undefined) {
|
|
182
183
|
refuse('flow-sdk registry prepare: give a <connector-key> with --action, or --entity <name>, or --kind <kind> --name <name> '
|
|
183
|
-
+ '(usage: registry prepare <connector-key> --action <name> | registry prepare --entity <name> [--folder-path <path>] '
|
|
184
|
+
+ '(usage: registry prepare <connector-key> --action <name> | registry prepare --entity <name> [--folder-path <path> | --folder-key <key>] '
|
|
184
185
|
+ '| registry prepare --kind <kind> --name <name> [--folder-path <path>])');
|
|
185
186
|
return;
|
|
186
187
|
}
|
|
@@ -199,6 +200,7 @@ export function registerRegistryCommands(program) {
|
|
|
199
200
|
addValue(argv, '--kind', options.kind);
|
|
200
201
|
addValue(argv, '--name', options.name);
|
|
201
202
|
addValue(argv, '--folder-path', options.folderPath);
|
|
203
|
+
addValue(argv, '--folder-key', options.folderKey);
|
|
202
204
|
addValue(argv, '--resource-source', options.resourceSource);
|
|
203
205
|
addValue(argv, '--resources', options.resources);
|
|
204
206
|
if (options.refreshResources)
|
|
@@ -158,9 +158,11 @@ export declare function wireActivityTypeMatches(libraryActivityType: unknown, wi
|
|
|
158
158
|
* @param inputValues - The authored inputs to replay, keyed by the library's names.
|
|
159
159
|
* @param seed - Seed for the saved filter tree ids.
|
|
160
160
|
* @param executionType - An External Agent / Workflow object's run mode, or `null`.
|
|
161
|
+
* @param resourceSelections - Each solution-resource picker field's resource key
|
|
162
|
+
* (`core/resource-picker.ts`), saved last as `savedResourceSelections`; omitted when none.
|
|
161
163
|
* @returns The essential configuration, with only Studio Web's essential keys.
|
|
162
164
|
*/
|
|
163
|
-
export declare function buildEssentialConfiguration(entry: any, version: string, inputValues?: Record<string, unknown>, seed?: string, executionType?: string | null): Record<string, unknown>;
|
|
165
|
+
export declare function buildEssentialConfiguration(entry: any, version: string, inputValues?: Record<string, unknown>, seed?: string, executionType?: string | null, resourceSelections?: Record<string, string>): Record<string, unknown>;
|
|
164
166
|
/** The operation identity a connector node's configuration envelope records. */
|
|
165
167
|
export interface ConfigurationIdentity {
|
|
166
168
|
/** `instanceParameters.objectName`: the object the operation addresses. */
|
|
@@ -88,6 +88,7 @@ const ESSENTIAL_KEYS = new Set([
|
|
|
88
88
|
'packageVersion',
|
|
89
89
|
'path',
|
|
90
90
|
'unifiedTypesCompatible',
|
|
91
|
+
'savedResourceSelections',
|
|
91
92
|
]);
|
|
92
93
|
/**
|
|
93
94
|
* An input's value by the library's name for it: the flat key (`project`,
|
|
@@ -349,9 +350,11 @@ export function wireActivityTypeMatches(libraryActivityType, wire) {
|
|
|
349
350
|
* @param inputValues - The authored inputs to replay, keyed by the library's names.
|
|
350
351
|
* @param seed - Seed for the saved filter tree ids.
|
|
351
352
|
* @param executionType - An External Agent / Workflow object's run mode, or `null`.
|
|
353
|
+
* @param resourceSelections - Each solution-resource picker field's resource key
|
|
354
|
+
* (`core/resource-picker.ts`), saved last as `savedResourceSelections`; omitted when none.
|
|
352
355
|
* @returns The essential configuration, with only Studio Web's essential keys.
|
|
353
356
|
*/
|
|
354
|
-
export function buildEssentialConfiguration(entry, version, inputValues, seed = 'node', executionType = null) {
|
|
357
|
+
export function buildEssentialConfiguration(entry, version, inputValues, seed = 'node', executionType = null, resourceSelections) {
|
|
355
358
|
const op = entry.operation ?? {};
|
|
356
359
|
const conn = entry.connector ?? {};
|
|
357
360
|
const v1ActivityType = wireActivityType(op.activityType);
|
|
@@ -391,6 +394,7 @@ export function buildEssentialConfiguration(entry, version, inputValues, seed =
|
|
|
391
394
|
subType: op.subType,
|
|
392
395
|
},
|
|
393
396
|
...(op.pathTemplate || op.path ? { path: op.pathTemplate || op.path } : {}),
|
|
397
|
+
...(resourceSelections && Object.keys(resourceSelections).length > 0 ? { savedResourceSelections: resourceSelections } : {}),
|
|
394
398
|
};
|
|
395
399
|
return envelope(composed).essentialConfiguration;
|
|
396
400
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import type { Library, ResolvedConnector } from './library.js';
|
|
17
17
|
import type { buildConnectorInputs } from './connector-inputs.js';
|
|
18
18
|
import { type ReadEventFilter } from './event-filters.js';
|
|
19
|
+
import { type ResourcePickerSelection } from './resource-picker.js';
|
|
19
20
|
/**
|
|
20
21
|
* What the activity metadata reads of a resolved operation. A library entry
|
|
21
22
|
* (`Library.resolve`) is one; an operation the SDK describes itself, such as a
|
|
@@ -43,8 +44,11 @@ export interface ConnectorEventPair {
|
|
|
43
44
|
* `packageVersion: "1.0.0"` (#1420).
|
|
44
45
|
*
|
|
45
46
|
* @param seed - The element id, which seeds the ids inside the configuration.
|
|
47
|
+
* @param pickers - The operation's solution-resource picker selections
|
|
48
|
+
* (`core/resource-picker.ts`): saved in the configuration, and a `bindings` entry
|
|
49
|
+
* each, which `bpmn refresh` reads. The pickers' bindings themselves are the caller's.
|
|
46
50
|
*/
|
|
47
|
-
export declare function connectorActivityMetadata(rc: ConnectorMetadataSource, op: any, slots: ConnectorMetadataSlots, seed: string, executionType?: ConnectorExecutionType, event?: ConnectorEventPair): Record<string, unknown>;
|
|
51
|
+
export declare function connectorActivityMetadata(rc: ConnectorMetadataSource, op: any, slots: ConnectorMetadataSlots, seed: string, executionType?: ConnectorExecutionType, event?: ConnectorEventPair, pickers?: readonly ResourcePickerSelection[]): Record<string, unknown>;
|
|
48
52
|
/**
|
|
49
53
|
* The designer's filter tree for a connector event's filter conditions, or `null`
|
|
50
54
|
* for none: the `essentialConfiguration.filter` the event metadata carries.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { replayInputsOf } from './connector-inputs.js';
|
|
2
2
|
import { buildEssentialConfiguration } from './connector-configuration.js';
|
|
3
3
|
import { eventFilterTreeLeaf } from './event-filters.js';
|
|
4
|
+
import { pickerMetadataBindings, savedResourceSelections } from './resource-picker.js';
|
|
4
5
|
/**
|
|
5
6
|
* The `metadata` of a connector activity: the FUNCTIONAL essentialConfiguration +
|
|
6
7
|
* activityTypeId, and the multipart wire of a multipart operation.
|
|
@@ -13,13 +14,16 @@ import { eventFilterTreeLeaf } from './event-filters.js';
|
|
|
13
14
|
* `packageVersion: "1.0.0"` (#1420).
|
|
14
15
|
*
|
|
15
16
|
* @param seed - The element id, which seeds the ids inside the configuration.
|
|
17
|
+
* @param pickers - The operation's solution-resource picker selections
|
|
18
|
+
* (`core/resource-picker.ts`): saved in the configuration, and a `bindings` entry
|
|
19
|
+
* each, which `bpmn refresh` reads. The pickers' bindings themselves are the caller's.
|
|
16
20
|
*/
|
|
17
|
-
export function connectorActivityMetadata(rc, op, slots, seed, executionType, event) {
|
|
21
|
+
export function connectorActivityMetadata(rc, op, slots, seed, executionType, event, pickers = []) {
|
|
18
22
|
// The part DECLARATIONS only: a file part's value rides on its `file` input.
|
|
19
23
|
const multipartParameters = (slots.multipartParameters ?? []).map(({ name, dataType }) => ({ name, dataType }));
|
|
20
24
|
// The configuration replays the authored values (a schema action's parent
|
|
21
25
|
// fields, a CEQL filter's tree), keyed by the library's own names, as Flow's.
|
|
22
|
-
const essential = buildEssentialConfiguration(rc.entry, rc.version, replayInputsOf(slots), seed, executionType ?? null);
|
|
26
|
+
const essential = buildEssentialConfiguration(rc.entry, rc.version, replayInputsOf(slots), seed, executionType ?? null, savedResourceSelections(pickers));
|
|
23
27
|
const configuration = `=jsonString:${JSON.stringify({ essentialConfiguration: essential })}`;
|
|
24
28
|
const instanceParameters = essential.instanceParameters;
|
|
25
29
|
const objectName = String(op.objectName ?? rc.nodeType.split('.').pop());
|
|
@@ -53,6 +57,7 @@ export function connectorActivityMetadata(rc, op, slots, seed, executionType, ev
|
|
|
53
57
|
objectName,
|
|
54
58
|
objectDisplayName: op.objectDisplayName ?? rc.entry.display?.operationLabel ?? '',
|
|
55
59
|
},
|
|
60
|
+
...(pickers.length > 0 ? { bindings: pickerMetadataBindings(pickers) } : {}),
|
|
56
61
|
};
|
|
57
62
|
}
|
|
58
63
|
/**
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** One picker field's selection: the resource it holds, and where the field sits. */
|
|
2
|
+
export interface ResourcePickerSelection {
|
|
3
|
+
/** The id of the element the picker is on, which seeds its `activityIdRef`. */
|
|
4
|
+
elementId: string;
|
|
5
|
+
/** The picker field, e.g. `folderEntityName`. */
|
|
6
|
+
field: string;
|
|
7
|
+
/** The request bucket the field and its companion sit in, as the metadata names it. */
|
|
8
|
+
bucket: 'queryParameters' | 'pathParameters' | 'bodyParameters';
|
|
9
|
+
/** The resource's name, e.g. `SkillPickerEvalEntity`. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** The key of the Orchestrator folder the resource lives in. */
|
|
12
|
+
folderKey: string;
|
|
13
|
+
/** The solution resource key. */
|
|
14
|
+
resourceKey: string;
|
|
15
|
+
}
|
|
16
|
+
/** The binding `resource` an entity picker writes, lower case as the V2 panel writes it. */
|
|
17
|
+
export declare const PICKER_ENTITY_RESOURCE = "entity";
|
|
18
|
+
/** The hidden parameter that carries a picker's folder: `folderEntityName` → `folderEntityName_folderKey`. */
|
|
19
|
+
export declare function pickerFolderField(field: string): string;
|
|
20
|
+
/** `essentialConfiguration.savedResourceSelections`: each picker field's resource key. */
|
|
21
|
+
export declare function savedResourceSelections(selections: readonly ResourcePickerSelection[]): Record<string, string>;
|
|
22
|
+
/** The `metadata.bindings` entries of a node's pickers, one per field. */
|
|
23
|
+
export declare function pickerMetadataBindings(selections: readonly ResourcePickerSelection[]): Record<string, unknown>[];
|