@uipath/maestro-builder-sdk 6.83.0 → 6.84.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/api-index.md +41 -41
- package/dist/api-members.md +160 -160
- package/dist/bpmn/bpmn-sdk.d.ts +33 -22
- package/dist/bpmn/bpmn-sdk.js +12 -9
- package/dist/bpmn/check.js +32 -2
- package/dist/bpmn/connector-lift-verify.js +3 -3
- package/dist/bpmn/connector.d.ts +17 -5
- package/dist/bpmn/connector.js +63 -119
- package/dist/bpmn/data-service.d.ts +70 -49
- package/dist/bpmn/data-service.js +149 -58
- package/dist/bpmn/declared-vars.js +8 -0
- package/dist/bpmn/decompile.d.ts +2 -0
- package/dist/bpmn/decompile.js +78 -31
- package/dist/bpmn/intsvc-vars.d.ts +38 -0
- package/dist/bpmn/intsvc-vars.js +44 -0
- package/dist/bpmn/intsvc.d.ts +6 -23
- package/dist/bpmn/intsvc.js +66 -77
- package/dist/bpmn/serialize.js +11 -3
- package/dist/case/serialize.js +6 -125
- package/dist/core/connector-configuration.js +3 -2
- package/dist/core/connector-inputs.d.ts +44 -0
- package/dist/core/connector-inputs.js +106 -0
- package/dist/core/connector-v2-metadata.d.ts +67 -0
- package/dist/core/connector-v2-metadata.js +145 -0
- package/dist/core/refusals.d.ts +1 -0
- package/dist/core/refusals.js +1 -0
- package/package.json +2 -2
|
@@ -12,47 +12,37 @@
|
|
|
12
12
|
* a bare UUID JSON-quoted, and no folder binding at all — every one a reason a task
|
|
13
13
|
* that the Flow arm passed failed here.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* A tenant-level entity's five RECORD operations are V2 nodes
|
|
16
|
+
* (`activityConfigurationVersion: v2`, #1298), in the shape `uip maestro bpmn registry
|
|
17
|
+
* get Intsvc.ActivityExecution --object-name <Op> --input-details …` builds, which is the
|
|
18
|
+
* one Studio Web's V2 connector panel saves. They are the curated operations Studio
|
|
19
|
+
* Web's V2 catalog lists (`CreateEntityRecordCurated`, `UpdateEntityRecordV2`,
|
|
20
|
+
* `GetEntityRecordByIdCurated`, `QueryEntityRecordsCurated`,
|
|
21
|
+
* `DeleteEntityRecordCurated`): the entity is the `entityName` path parameter, in the
|
|
22
|
+
* `pathParameters` json row, the record id and the query's options are the
|
|
23
|
+
* `queryParameters` row, the record is the `body` row, and the context carries the
|
|
24
|
+
* design-time `metadata` (`core/connector-v2-metadata.ts`). The parameter names,
|
|
25
|
+
* targets, paths and catalog ids are `registry get`'s for those operations.
|
|
20
26
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* as the `entityName` PATH parameter, and `operation` is the CRUD verb of the
|
|
27
|
-
* underlying HTTP method (`List` for GET, `Create` for POST, `Delete` for DELETE).
|
|
27
|
+
* A FOLDER-scoped entity (`entity: { name, folderKey }`, #1392) stays V1. Only the
|
|
28
|
+
* connector's `_V3` operations (`CreateEntityRecord_V3`, …) take a folder, selecting the
|
|
29
|
+
* entity with query parameters (`entityScope`, `folderEntityName` and
|
|
30
|
+
* `folderEntityName_folderKey`), and Studio Web's V2 catalog does not list them: they
|
|
31
|
+
* are "(Preview)" in the connector, and `registry get` finds no V2 element for them.
|
|
28
32
|
*
|
|
29
|
-
*
|
|
30
|
-
* `
|
|
31
|
-
*
|
|
32
|
-
* the
|
|
33
|
+
* The three FILE operations stay V1 too, in the curated form the Flow→BPMN converter
|
|
34
|
+
* writes: `objectName` is the curated operation (`DownloadFileFromRecordField`, …), the
|
|
35
|
+
* entity, record and field travel as PATH rows, and `operation` is the CRUD verb. Their
|
|
36
|
+
* `_V3` operations declare no field-name parameter (the file field is a dynamic field
|
|
37
|
+
* from the entity's schema), so where they take it is not known here, and they refuse a
|
|
38
|
+
* folder-scoped entity rather than guess. Nothing here needs the connector library.
|
|
33
39
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* declare no field-name parameter (the file field is a dynamic field from the entity's
|
|
41
|
-
* schema), so where they take it is not known here, and they refuse a folder-scoped
|
|
42
|
-
* entity rather than guess.
|
|
43
|
-
*
|
|
44
|
-
* **The task references no binding for the entity.** The Maestro designer (PO.Frontend
|
|
45
|
-
* `IntsvcActivityProperties.tsx`) has two paths. Its V1 path, which writes this per-row
|
|
46
|
-
* shape, renders the connector with `enableResourceFields: false`: there is no resource
|
|
47
|
-
* picker, so the entity and folder are literal rows. Only its V2 path — a solution, an
|
|
48
|
-
* `activityConfigurationVersion` of `v2`, the parameters as one `queryParameters` json
|
|
49
|
-
* input and Studio Web's serialized configuration in `metadata` — mints the
|
|
50
|
-
* `resource="entity"` `name` / `folderKey` binding pair (`createActivityBindingMinter`),
|
|
51
|
-
* records `savedResourceSelections`, and packages a `Scope: "Folder"` entry into
|
|
52
|
-
* `bindings_v2.json`. That configuration blob is the design-time client's output, which
|
|
53
|
-
* nothing in the SDK can build offline — the same gap as Flow's #849. Until a V2 connector
|
|
54
|
-
* emitter exists, a folder-scoped entity is fixed at compile time, not re-pointable per
|
|
55
|
-
* environment at deploy.
|
|
40
|
+
* **The task references no binding for the entity.** The Maestro designer's V2 path
|
|
41
|
+
* mints a `resource="entity"` `name` / `folderKey` binding pair for the picker
|
|
42
|
+
* (`createActivityBindingMinter`), records `savedResourceSelections`, and packages a
|
|
43
|
+
* `Scope: "Folder"` entry into `bindings_v2.json`. This writes the picker's value as a
|
|
44
|
+
* literal query parameter instead (#849), so a folder-scoped entity is fixed at compile
|
|
45
|
+
* time, not re-pointable per environment at deploy.
|
|
56
46
|
*
|
|
57
47
|
* An entity named as `{ name, folder }` and resolved through `registry prepare --entity`
|
|
58
48
|
* (docs/ENTITY_RESOLUTION_DESIGN.md §4.4) still writes the two `Entity` binding rows Flow
|
|
@@ -73,26 +63,26 @@ export declare const DATA_SERVICE_ACTIVITY_TYPE = "Intsvc.ActivityExecution";
|
|
|
73
63
|
* `'=js:`dueDate < \'${vars.cutoff}\'`'`) exactly as any other input does.
|
|
74
64
|
*/
|
|
75
65
|
export type DataServiceOperation = {
|
|
76
|
-
/** Create one record — `
|
|
66
|
+
/** Create one record — `CreateEntityRecordCurated`. The response is the created record, `Id` included. */
|
|
77
67
|
op: 'create';
|
|
78
68
|
/** The record's fields, by the entity's field names. */
|
|
79
69
|
record: Record<string, unknown>;
|
|
80
70
|
} | {
|
|
81
|
-
/** Replace one record — `
|
|
71
|
+
/** Replace one record — `UpdateEntityRecordV2`. */
|
|
82
72
|
op: 'update';
|
|
83
73
|
/** The record's `Id`. */
|
|
84
74
|
id: string;
|
|
85
75
|
/** The record's fields, by the entity's field names. */
|
|
86
76
|
record: Record<string, unknown>;
|
|
87
77
|
} | {
|
|
88
|
-
/** Read one record by id —
|
|
78
|
+
/** Read one record by id — `GetEntityRecordByIdCurated`. */
|
|
89
79
|
op: 'get';
|
|
90
80
|
/** The record's `Id`. */
|
|
91
81
|
recordId: string;
|
|
92
82
|
/** How many levels of related records to expand into the response. */
|
|
93
83
|
expansionLevel?: number;
|
|
94
84
|
} | {
|
|
95
|
-
/** Query records with a filter —
|
|
85
|
+
/** Query records with a filter — `QueryEntityRecordsCurated`. */
|
|
96
86
|
op: 'query';
|
|
97
87
|
/** The filter, in the Data Service query language, e.g. `"status = 'Open'"` or `"contractTitle IS NULL"`. Omit for every record. */
|
|
98
88
|
where?: string;
|
|
@@ -115,7 +105,7 @@ export type DataServiceOperation = {
|
|
|
115
105
|
/** How many levels of related records to expand into each result. */
|
|
116
106
|
expansionLevel?: number;
|
|
117
107
|
} | {
|
|
118
|
-
/** Delete one record —
|
|
108
|
+
/** Delete one record — `DeleteEntityRecordCurated`. */
|
|
119
109
|
op: 'delete';
|
|
120
110
|
/** The record's `Id`. */
|
|
121
111
|
recordId: string;
|
|
@@ -196,10 +186,18 @@ export interface EntityBindingRow {
|
|
|
196
186
|
export interface DataServiceWire {
|
|
197
187
|
/** A display name when the author gave none, e.g. `Create ContractRegistry`. */
|
|
198
188
|
label: string;
|
|
199
|
-
/** The `uipath:context` rows that identify the operation — `
|
|
189
|
+
/** The `uipath:context` rows that identify the operation — `objectName`, `method`, `path`, and a V1 one's `operation`. */
|
|
200
190
|
context: Record<string, string>;
|
|
201
|
-
/** The payload rows, one per parameter plus the body. */
|
|
191
|
+
/** The payload rows: a V2 operation's json `queryParameters` / `body` rows, a V1 one's row per parameter plus the body. */
|
|
202
192
|
inputRows: TypedInputRow[];
|
|
193
|
+
/** The catalog operation of a V2 wire; absent on a V1 (file or folder-entity) one. */
|
|
194
|
+
catalog?: CatalogOperation;
|
|
195
|
+
/** The routed parameters a V2 wire's metadata replays. */
|
|
196
|
+
slots?: {
|
|
197
|
+
pathParameters: Record<string, unknown>;
|
|
198
|
+
queryParameters: Record<string, unknown>;
|
|
199
|
+
bodyParameters: Record<string, unknown>;
|
|
200
|
+
};
|
|
203
201
|
}
|
|
204
202
|
/**
|
|
205
203
|
* The context and payload rows for one operation on one entity.
|
|
@@ -225,7 +223,7 @@ export declare function refuseEntityShape(id: string, entity: DataServiceEntity)
|
|
|
225
223
|
export declare function isPendingEntity(entity: DataServiceEntity): entity is EntityRef;
|
|
226
224
|
/**
|
|
227
225
|
* The wire for a `{ name, folder }` entity from the row `registry prepare --entity`
|
|
228
|
-
* recorded: the `_V3` folder form and the two `Entity` binding rows for a folder-scoped
|
|
226
|
+
* recorded: the V1 `_V3` folder form and the two `Entity` binding rows for a folder-scoped
|
|
229
227
|
* entity, exactly as `{ name, folderKey }` writes the task; the tenant form and no
|
|
230
228
|
* bindings for a tenant-level one. `check` calls this too, so the two cannot disagree.
|
|
231
229
|
*
|
|
@@ -237,9 +235,32 @@ export declare function lowerDataServiceEntity(id: string, pending: PendingDataS
|
|
|
237
235
|
wire: DataServiceWire;
|
|
238
236
|
bindings: EntityBindingRow[];
|
|
239
237
|
};
|
|
238
|
+
/** The connection wiring of a `.dataService()` task: `=bindings.<id>` references, and the connection's key. */
|
|
239
|
+
export interface DataServiceWiring {
|
|
240
|
+
connection: string;
|
|
241
|
+
/** The connection's key, which a V2 node also carries as `resourceKey`. */
|
|
242
|
+
resourceKey: string;
|
|
243
|
+
folderKey?: string;
|
|
244
|
+
}
|
|
240
245
|
/**
|
|
241
246
|
* The `uipath:context` values of a `.dataService()` task, in the order the canvas writes
|
|
242
|
-
* them
|
|
243
|
-
*
|
|
247
|
+
* them: the connection wiring, the operation's identity, and for a V2 operation the
|
|
248
|
+
* design-time `metadata` and the version.
|
|
244
249
|
*/
|
|
245
|
-
export declare function dataServiceContext(wire: DataServiceWire,
|
|
250
|
+
export declare function dataServiceContext(wire: DataServiceWire, wiring: DataServiceWiring): Record<string, unknown>;
|
|
251
|
+
/**
|
|
252
|
+
* One curated record operation as Studio Web's V2 catalog lists it: the context rows
|
|
253
|
+
* that name it, the configuration's verb, and the catalog entry.
|
|
254
|
+
*/
|
|
255
|
+
export interface CatalogOperation {
|
|
256
|
+
objectName: string;
|
|
257
|
+
/** The operation's verb, as the configuration and telemetry spell it. */
|
|
258
|
+
verb: string;
|
|
259
|
+
method: string;
|
|
260
|
+
path: string;
|
|
261
|
+
/** Studio Web's catalog type id. */
|
|
262
|
+
activityTypeId: string;
|
|
263
|
+
displayName: string;
|
|
264
|
+
description: string;
|
|
265
|
+
label: (entity: string) => string;
|
|
266
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CompileRefusal } from '../core/compile-refusal.js';
|
|
2
2
|
import { entityPrepareCommand, isEntityRef, resolveEntityRef } from '../core/resource-resolution.js';
|
|
3
3
|
import { ownEntry } from '../core/own-entry.js';
|
|
4
|
+
import { connectorActivityMetadata } from '../core/connector-v2-metadata.js';
|
|
5
|
+
import { ACTIVITY_CONFIGURATION_V2 } from './connector.js';
|
|
4
6
|
/** The connector key the tenant lists Data Fabric under. */
|
|
5
7
|
export const DATA_SERVICE_CONNECTOR_KEY = 'uipath-uipath-dataservice';
|
|
6
8
|
/** The extension type every Integration Service activity dispatches through. */
|
|
@@ -30,56 +32,11 @@ export function dataServiceWire(entity, operation) {
|
|
|
30
32
|
const attachment = '/Attachment/{entityName}/{recordId}/{fieldName}';
|
|
31
33
|
switch (operation.op) {
|
|
32
34
|
case 'create':
|
|
33
|
-
return {
|
|
34
|
-
label: `Create ${entity}`,
|
|
35
|
-
context: { operation: 'Create', objectName: entity, method: 'POST', path: `/${entity}` },
|
|
36
|
-
inputRows: [bodyRow(operation.record)],
|
|
37
|
-
};
|
|
38
35
|
case 'update':
|
|
39
|
-
return {
|
|
40
|
-
label: `Update ${entity}`,
|
|
41
|
-
context: { operation: 'Replace', objectName: entity, method: 'PUT', path: `/${entity}/{id}` },
|
|
42
|
-
inputRows: [scalarRow('id', 'path', operation.id), bodyRow(operation.record)],
|
|
43
|
-
};
|
|
44
36
|
case 'get':
|
|
45
|
-
return {
|
|
46
|
-
label: `Get ${entity} record`,
|
|
47
|
-
context: { operation: 'List', objectName: 'GetEntityRecordByIdCurated', method: 'GET', path: '/v2/{entityName}/GetEntityRecord' },
|
|
48
|
-
inputRows: [
|
|
49
|
-
scalarRow('entityName', 'path', entity),
|
|
50
|
-
scalarRow('recordId', 'query', operation.recordId),
|
|
51
|
-
...optionalRow('expansionLevel', 'query', operation.expansionLevel),
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
37
|
case 'query':
|
|
55
|
-
return {
|
|
56
|
-
label: `Query ${entity}`,
|
|
57
|
-
context: { operation: 'Create', objectName: 'QueryEntityRecordsCurated', method: 'POST', path: '/v2/{entityName}/qer' },
|
|
58
|
-
inputRows: [
|
|
59
|
-
scalarRow('entityName', 'path', entity),
|
|
60
|
-
...optionalRow('queryExpression', 'query', operation.where),
|
|
61
|
-
scalarRow('start', 'query', operation.start ?? 0),
|
|
62
|
-
scalarRow('limit', 'query', operation.limit ?? 100),
|
|
63
|
-
...optionalRow('isAscending', 'query', operation.ascending),
|
|
64
|
-
...optionalRow('expansionLevel', 'query', operation.expansionLevel),
|
|
65
|
-
// The sort FIELD rides in the body as `_sortFieldName` — the name the curated
|
|
66
|
-
// operation's `RequestFields` declare (`uip is resources describe
|
|
67
|
-
// uipath-uipath-dataservice QueryEntityRecordsCurated --operation Create`), and
|
|
68
|
-
// the only place the connector reads it: as a query parameter it is ignored and
|
|
69
|
-
// the query comes back in default order. This used to write `sortBy` as a query
|
|
70
|
-
// row; on flow-v2-run-12 the Query node so built validated and failed
|
|
71
|
-
// `no Query node sorted by priority DESC` (datafabric-e2e-contract-intake-pipeline
|
|
72
|
-
// 1.00 → 0.45) while the v1 arm wrote `{"_sortFieldName":"priority"}` by hand.
|
|
73
|
-
// `isAscending` stays a query parameter, which is where the connector reads it.
|
|
74
|
-
...(operation.sortBy !== undefined ? [bodyRow({ _sortFieldName: operation.sortBy })] : []),
|
|
75
|
-
],
|
|
76
|
-
};
|
|
77
38
|
case 'delete':
|
|
78
|
-
return
|
|
79
|
-
label: `Delete ${entity} record`,
|
|
80
|
-
context: { operation: 'Create', objectName: 'DeleteEntityRecordCurated', method: 'POST', path: '/v2/{entityName}/DeleteEntityRecord' },
|
|
81
|
-
inputRows: [scalarRow('entityName', 'path', entity), scalarRow('recordId', 'query', operation.recordId)],
|
|
82
|
-
};
|
|
39
|
+
return recordWire(entity, operation);
|
|
83
40
|
case 'downloadFile':
|
|
84
41
|
return {
|
|
85
42
|
label: `Download ${entity}.${operation.field}`,
|
|
@@ -130,7 +87,7 @@ export function isPendingEntity(entity) {
|
|
|
130
87
|
}
|
|
131
88
|
/**
|
|
132
89
|
* The wire for a `{ name, folder }` entity from the row `registry prepare --entity`
|
|
133
|
-
* recorded: the `_V3` folder form and the two `Entity` binding rows for a folder-scoped
|
|
90
|
+
* recorded: the V1 `_V3` folder form and the two `Entity` binding rows for a folder-scoped
|
|
134
91
|
* entity, exactly as `{ name, folderKey }` writes the task; the tenant form and no
|
|
135
92
|
* bindings for a tenant-level one. `check` calls this too, so the two cannot disagree.
|
|
136
93
|
*
|
|
@@ -172,23 +129,97 @@ function entityBindings(name, folderKey, resourceKey) {
|
|
|
172
129
|
}
|
|
173
130
|
/**
|
|
174
131
|
* The `uipath:context` values of a `.dataService()` task, in the order the canvas writes
|
|
175
|
-
* them
|
|
176
|
-
*
|
|
132
|
+
* them: the connection wiring, the operation's identity, and for a V2 operation the
|
|
133
|
+
* design-time `metadata` and the version.
|
|
177
134
|
*/
|
|
178
|
-
export function dataServiceContext(wire,
|
|
135
|
+
export function dataServiceContext(wire, wiring) {
|
|
136
|
+
const { connection, resourceKey, folderKey } = wiring;
|
|
137
|
+
if (wire.catalog === undefined) {
|
|
138
|
+
return {
|
|
139
|
+
// `activity` is the selected-operation key the canvas validator requires of a
|
|
140
|
+
// V1 node (EMPTY_REQUIRED_FIELD without it); the converter omits it and the CLI
|
|
141
|
+
// accepts both, so it carries the same verb `operation` does.
|
|
142
|
+
activity: wire.context.operation,
|
|
143
|
+
connectorKey: DATA_SERVICE_CONNECTOR_KEY,
|
|
144
|
+
connection,
|
|
145
|
+
...(folderKey !== undefined ? { folderKey } : {}),
|
|
146
|
+
...wire.context,
|
|
147
|
+
activityConfigurationVersion: 'v1',
|
|
148
|
+
metadata: {},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
179
151
|
return {
|
|
180
|
-
// `activity` is the selected-operation key the canvas validator requires
|
|
181
|
-
// (EMPTY_REQUIRED_FIELD without it); the converter omits it and the CLI accepts
|
|
182
|
-
// both, so it carries the same verb `operation` does — as `.connector()` writes it.
|
|
183
|
-
activity: wire.context.operation,
|
|
184
152
|
connectorKey: DATA_SERVICE_CONNECTOR_KEY,
|
|
185
153
|
connection,
|
|
154
|
+
resourceKey,
|
|
186
155
|
...(folderKey !== undefined ? { folderKey } : {}),
|
|
187
156
|
...wire.context,
|
|
188
|
-
|
|
189
|
-
|
|
157
|
+
metadata: dataServiceMetadata(wire.catalog, wire.slots),
|
|
158
|
+
activityConfigurationVersion: ACTIVITY_CONFIGURATION_V2,
|
|
190
159
|
};
|
|
191
160
|
}
|
|
161
|
+
/** The connector as Studio Web's catalog names it, for the metadata's catalog entry. */
|
|
162
|
+
const DATA_SERVICE_CONNECTOR_NAME = 'UiPath Data Fabric';
|
|
163
|
+
/**
|
|
164
|
+
* The design-time `metadata` of a V2 record operation, from the shared builder: the
|
|
165
|
+
* operation is described here rather than resolved from the library, which ships
|
|
166
|
+
* only `query-entity-records`.
|
|
167
|
+
*/
|
|
168
|
+
function dataServiceMetadata(catalog, slots) {
|
|
169
|
+
const operation = {
|
|
170
|
+
name: catalog.verb,
|
|
171
|
+
objectName: catalog.objectName,
|
|
172
|
+
objectDisplayName: catalog.displayName,
|
|
173
|
+
httpMethod: catalog.method,
|
|
174
|
+
path: catalog.path,
|
|
175
|
+
activityType: 'Curated',
|
|
176
|
+
supportsStreaming: false,
|
|
177
|
+
subType: 'standard',
|
|
178
|
+
};
|
|
179
|
+
const metadata = connectorActivityMetadata({
|
|
180
|
+
entry: { connector: { key: DATA_SERVICE_CONNECTOR_KEY }, operation, display: { label: catalog.displayName, description: catalog.description } },
|
|
181
|
+
version: '1.0.0',
|
|
182
|
+
activityTypeId: catalog.activityTypeId,
|
|
183
|
+
nodeType: `uipath.connector.${DATA_SERVICE_CONNECTOR_KEY}.${catalog.objectName}`,
|
|
184
|
+
connectorKey: DATA_SERVICE_CONNECTOR_KEY,
|
|
185
|
+
connectorName: DATA_SERVICE_CONNECTOR_NAME,
|
|
186
|
+
}, operation, slots, catalog.objectName);
|
|
187
|
+
// A list operation's paging, as Studio Web saves the query (`maxPageSize` is the connector's).
|
|
188
|
+
return catalog.verb === 'list' ? { ...metadata, inputMetadata: { operation: 'list', pagination: { maxPageSize: 1000 } } } : metadata;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The five curated record operations, from `uip maestro bpmn registry get
|
|
192
|
+
* Intsvc.ActivityExecution --object-name <Op> --input-details '{}'` after a forced
|
|
193
|
+
* `registry pull` (uip 1.206, alpha, 2026-11-05).
|
|
194
|
+
*/
|
|
195
|
+
const RECORD_OPERATIONS = {
|
|
196
|
+
create: {
|
|
197
|
+
objectName: 'CreateEntityRecordCurated', verb: 'create', method: 'POST', path: '/v2/{entityName}/CreateEntityRecord',
|
|
198
|
+
activityTypeId: 'dfd2bc7a-ca4b-3316-8a1f-57c9e106dfbf', displayName: 'Create Entity Record',
|
|
199
|
+
description: 'Creates a new record for the selected Entity in Data Fabric', label: (e) => `Create ${e}`,
|
|
200
|
+
},
|
|
201
|
+
update: {
|
|
202
|
+
objectName: 'UpdateEntityRecordV2', verb: 'replace', method: 'PUT', path: '/v2/{entityName}/UpdateEntityRecord',
|
|
203
|
+
activityTypeId: '718fdc36-73a8-3607-8604-ddef95bb9967', displayName: 'Update Entity Record',
|
|
204
|
+
description: 'Updates an existing record in a Data Fabric entity', label: (e) => `Update ${e}`,
|
|
205
|
+
},
|
|
206
|
+
get: {
|
|
207
|
+
objectName: 'GetEntityRecordByIdCurated', verb: 'retrieve', method: 'GET', path: '/v2/{entityName}/GetEntityRecord',
|
|
208
|
+
activityTypeId: '81291b95-ff0c-3822-bdaa-3065391c1997', displayName: 'Get Entity Record by ID',
|
|
209
|
+
description: 'Reads an existing record for the selected entity from Data Fabric', label: (e) => `Get ${e} record`,
|
|
210
|
+
},
|
|
211
|
+
query: {
|
|
212
|
+
objectName: 'QueryEntityRecordsCurated', verb: 'list', method: 'POST', path: '/v2/{entityName}/qer',
|
|
213
|
+
activityTypeId: '703065b9-a310-33b8-9d4d-12df0a6f520b', displayName: 'Query Entity Records',
|
|
214
|
+
description: 'Retrieves a list of records for the selected Entity from Data Fabric, according to specified filters.',
|
|
215
|
+
label: (e) => `Query ${e}`,
|
|
216
|
+
},
|
|
217
|
+
delete: {
|
|
218
|
+
objectName: 'DeleteEntityRecordCurated', verb: 'delete', method: 'POST', path: '/v2/{entityName}/DeleteEntityRecord',
|
|
219
|
+
activityTypeId: '9c8029ee-ff5f-3b82-92cc-34cee15e9f1d', displayName: 'Delete Entity Record',
|
|
220
|
+
description: 'Deletes an existing record for the selected entity from Data Fabric', label: (e) => `Delete ${e} record`,
|
|
221
|
+
},
|
|
222
|
+
};
|
|
192
223
|
/** The `_V3` scope rows' wire names, as `describe` declares them and the canvas writes them. */
|
|
193
224
|
const FOLDER_SCOPE = {
|
|
194
225
|
scopeParameter: 'entityScope',
|
|
@@ -227,8 +258,8 @@ function validateFolderEntity(entity) {
|
|
|
227
258
|
}
|
|
228
259
|
}
|
|
229
260
|
/**
|
|
230
|
-
* The `_V3` form for a folder-scoped entity. The three scope rows come first, then
|
|
231
|
-
* operation's own parameters, which `_V3` takes as query rows where the tenant forms
|
|
261
|
+
* The V1 `_V3` form for a folder-scoped entity. The three scope rows come first, then
|
|
262
|
+
* the operation's own parameters, which `_V3` takes as query rows where the tenant forms
|
|
232
263
|
* use the path (`recordId`, never `id`).
|
|
233
264
|
*/
|
|
234
265
|
function folderEntityWire(entity, operation) {
|
|
@@ -271,6 +302,66 @@ function folderEntityWire(entity, operation) {
|
|
|
271
302
|
return wire([scalarRow('recordId', 'query', operation.recordId)]);
|
|
272
303
|
}
|
|
273
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* The V2 curated wire for a tenant-level entity's record operation: the entity as the
|
|
307
|
+
* `entityName` path parameter, the record id (`recordId`, never `id`) and the query's
|
|
308
|
+
* options as the `queryParameters` row, and the record, or a query's sort field, as
|
|
309
|
+
* the `body` row.
|
|
310
|
+
*/
|
|
311
|
+
function recordWire(entity, operation) {
|
|
312
|
+
const catalog = ownEntry(RECORD_OPERATIONS, operation.op);
|
|
313
|
+
const defined = (params) => Object.fromEntries(Object.entries(params).filter(([, v]) => v !== undefined));
|
|
314
|
+
let query;
|
|
315
|
+
let body;
|
|
316
|
+
switch (operation.op) {
|
|
317
|
+
case 'create':
|
|
318
|
+
query = {};
|
|
319
|
+
body = operation.record;
|
|
320
|
+
break;
|
|
321
|
+
case 'update':
|
|
322
|
+
query = { recordId: operation.id };
|
|
323
|
+
body = operation.record;
|
|
324
|
+
break;
|
|
325
|
+
case 'get':
|
|
326
|
+
query = defined({ recordId: operation.recordId, expansionLevel: operation.expansionLevel });
|
|
327
|
+
break;
|
|
328
|
+
case 'query':
|
|
329
|
+
query = defined({
|
|
330
|
+
queryExpression: operation.where,
|
|
331
|
+
start: operation.start ?? 0,
|
|
332
|
+
limit: operation.limit ?? 100,
|
|
333
|
+
isAscending: operation.ascending,
|
|
334
|
+
expansionLevel: operation.expansionLevel,
|
|
335
|
+
});
|
|
336
|
+
// The sort FIELD rides in the body as `_sortFieldName` — the name the curated
|
|
337
|
+
// operation's `RequestFields` declare (`uip is resources describe
|
|
338
|
+
// uipath-uipath-dataservice QueryEntityRecordsCurated --operation Create`), and
|
|
339
|
+
// the only place the connector reads it: as a query parameter it is ignored and
|
|
340
|
+
// the query comes back in default order. This used to write `sortBy` as a query
|
|
341
|
+
// row; on flow-v2-run-12 the Query node so built validated and failed
|
|
342
|
+
// `no Query node sorted by priority DESC` (datafabric-e2e-contract-intake-pipeline
|
|
343
|
+
// 1.00 → 0.45). `isAscending` stays a query parameter, which is where the
|
|
344
|
+
// connector reads it.
|
|
345
|
+
if (operation.sortBy !== undefined)
|
|
346
|
+
body = { _sortFieldName: operation.sortBy };
|
|
347
|
+
break;
|
|
348
|
+
case 'delete':
|
|
349
|
+
query = { recordId: operation.recordId };
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
const pathParameters = { entityName: entity };
|
|
353
|
+
return {
|
|
354
|
+
label: catalog.label(entity),
|
|
355
|
+
context: { objectName: catalog.objectName, method: catalog.method, path: catalog.path },
|
|
356
|
+
inputRows: [
|
|
357
|
+
{ name: 'pathParameters', type: 'json', target: 'pathParameters', body: pathParameters },
|
|
358
|
+
{ name: 'queryParameters', type: 'json', target: 'queryParameters', body: query },
|
|
359
|
+
...(body !== undefined ? [bodyRow(body)] : []),
|
|
360
|
+
],
|
|
361
|
+
catalog,
|
|
362
|
+
slots: { pathParameters, queryParameters: query, bodyParameters: body ?? {} },
|
|
363
|
+
};
|
|
364
|
+
}
|
|
274
365
|
function fileFieldRows(entity, recordId, field) {
|
|
275
366
|
return [scalarRow('entityName', 'path', entity), scalarRow('recordId', 'path', recordId), scalarRow('fieldName', 'path', field)];
|
|
276
367
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { typedNodeAdditionalOutputVars, typedNodeOutputVar } from './typed-node.js';
|
|
2
|
+
import { connectorEventErrorVar, intsvcOutputVar } from './intsvc-vars.js';
|
|
2
3
|
/**
|
|
3
4
|
* The variables a connector task's output rows land in.
|
|
4
5
|
*
|
|
@@ -59,6 +60,13 @@ export function nodeDeclaredVars(n) {
|
|
|
59
60
|
}
|
|
60
61
|
if (n.kind === 'typed')
|
|
61
62
|
return typedNodeDeclaredVars(n);
|
|
63
|
+
// A connector event or external task writes its own `response` row, and a
|
|
64
|
+
// connector event its `Error` row too; the serializer declares the same names.
|
|
65
|
+
if (n.kind === 'connectorEvent' || n.kind === 'externalTask') {
|
|
66
|
+
const response = intsvcOutputVar(n);
|
|
67
|
+
const error = n.kind === 'connectorEvent' ? [connectorEventErrorVar(n)] : [];
|
|
68
|
+
return [...(response ? [response] : []), ...error, ...Object.keys(n.outputs ?? {})];
|
|
69
|
+
}
|
|
62
70
|
// Spelled-out rows REPLACE the derived ones, so they are the whole answer — the
|
|
63
71
|
// same rule as `typedNodeDeclaredVars`. Reading only `outputs` here left a script
|
|
64
72
|
// task authored with `outputRows` (the form decompile writes) declaring nothing,
|
package/dist/bpmn/decompile.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export interface BpmnDecompileOptions {
|
|
|
20
20
|
* it. A lift is best effort by construction and safe only with the check
|
|
21
21
|
* `decompile-cli` runs (`verifyConnectorLifts`): the lifted call must compile to the
|
|
22
22
|
* same task, those regenerated fields aside, or the element is written verbatim.
|
|
23
|
+
* Only a V2 task is lifted: `.connector()` writes V2, so a lifted V1 task would
|
|
24
|
+
* come back rewritten, and a V1 task stays verbatim whatever this says.
|
|
23
25
|
*/
|
|
24
26
|
connectors?: 'lift' | 'verbatim';
|
|
25
27
|
/** Connector tasks to write verbatim whatever `connectors` says — the ones a verify refused. */
|
package/dist/bpmn/decompile.js
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
* path/query split.
|
|
54
54
|
*/
|
|
55
55
|
import BpmnModdle from 'bpmn-moddle';
|
|
56
|
+
import { flattenConnectorBody } from '../core/connector-inputs.js';
|
|
56
57
|
import { createRequire } from 'node:module';
|
|
57
58
|
import { registryType, rowDeclaration } from './typed-node.js';
|
|
58
59
|
import { errorSchema, errorSchemaWithResponse } from './bpmn-sdk.js';
|
|
@@ -270,8 +271,8 @@ const CONNECTOR_CONTEXT_ROWS = new Set([
|
|
|
270
271
|
'connectorKey', 'operation', 'objectName', 'method', 'path', 'connection', 'folderKey', 'resourceKey',
|
|
271
272
|
'metadata', 'activityConfigurationVersion', 'activity',
|
|
272
273
|
]);
|
|
273
|
-
/**
|
|
274
|
-
const
|
|
274
|
+
/** The json payload rows of a V2 connector task that carry the parameters, by location. */
|
|
275
|
+
const CONNECTOR_PARAMETER_ROWS = new Set(['pathParameters', 'queryParameters']);
|
|
275
276
|
/**
|
|
276
277
|
* Plan every connector task's lift in `container` (sub-processes included): the id →
|
|
277
278
|
* plan for the ones `.connector()` can express, and a reason for each one it cannot.
|
|
@@ -300,11 +301,10 @@ function bindingIdOf(value) {
|
|
|
300
301
|
return m ? m[1] : undefined;
|
|
301
302
|
}
|
|
302
303
|
/**
|
|
303
|
-
* A
|
|
304
|
-
* otherwise the literal, coerced to the type the library declares for the
|
|
305
|
-
* because the
|
|
306
|
-
*
|
|
307
|
-
* or an integer.
|
|
304
|
+
* A parameter's text as `.connector()` takes it: an `=`-expression as the string it
|
|
305
|
+
* is; otherwise the literal, coerced to the type the library declares for the
|
|
306
|
+
* parameter, because the shared validator refuses a string where it declares a
|
|
307
|
+
* boolean or an integer.
|
|
308
308
|
*/
|
|
309
309
|
function liftedInputValue(raw, dataType) {
|
|
310
310
|
if (raw.startsWith('='))
|
|
@@ -336,6 +336,11 @@ function planConnectorLift(el, payload) {
|
|
|
336
336
|
if (rows.some((r) => r.required !== undefined || r.target !== undefined))
|
|
337
337
|
return 'a context row carries attributes the record form cannot';
|
|
338
338
|
const ctxString = (k) => (typeof ctx[k] === 'string' ? ctx[k] : undefined);
|
|
339
|
+
// `.connector()` writes a V2 node (#1298). A V1 one lifted would come back V2, and
|
|
340
|
+
// an edit of an existing workflow has to leave its V1 nodes as they are, so it
|
|
341
|
+
// stays verbatim.
|
|
342
|
+
if (ctxString('activityConfigurationVersion') !== 'v2')
|
|
343
|
+
return 'a V1 connector task, kept verbatim so it stays V1';
|
|
339
344
|
const connectorKey = ctxString('connectorKey');
|
|
340
345
|
if (!connectorKey)
|
|
341
346
|
return 'no connectorKey';
|
|
@@ -368,35 +373,72 @@ function planConnectorLift(el, payload) {
|
|
|
368
373
|
return `the library cannot resolve ${identity.key}/${identity.action}: ${e.message}`;
|
|
369
374
|
}
|
|
370
375
|
const inputs = {};
|
|
376
|
+
// `.connector()` validates every input against the library, and a field the static
|
|
377
|
+
// library does not declare — an entity's own columns on a Data Fabric update, a Jira
|
|
378
|
+
// project's custom fields — is refused until `registry prepare` loads it. The hint is
|
|
379
|
+
// given for every operation: the registry's own schema flags are not evidence that
|
|
380
|
+
// prepare cannot help (it marks Jira `create-issue` `requiresConnectionForSchema:
|
|
381
|
+
// false`, and `prepare -f` takes that operation from 5 fields to about 20).
|
|
382
|
+
const notInLibrary = (where, k) => `${where} field "${k}" is not in the library for ${identity.key}/${identity.action} ` +
|
|
383
|
+
'(if it is connection-specific, `registry prepare` loads it; `prepare -f <parent>=<value>` adds the fields a parent value unlocks)';
|
|
384
|
+
const put = (k, v, where) => {
|
|
385
|
+
if (k in inputs)
|
|
386
|
+
return `"${k}" appears both in ${where} and in another row`;
|
|
387
|
+
inputs[k] = v;
|
|
388
|
+
return undefined;
|
|
389
|
+
};
|
|
390
|
+
/** A parameter or file row's input: its name is flat, so it is checked as it is. */
|
|
391
|
+
const take = (k, v, where) => {
|
|
392
|
+
if (!declared.has(k) && !declared.has(k.split('.')[0]))
|
|
393
|
+
return notInLibrary(where, k);
|
|
394
|
+
return put(k, v, where);
|
|
395
|
+
};
|
|
371
396
|
for (const row of payload.input ?? []) {
|
|
372
397
|
const target = row.target;
|
|
373
|
-
if (target ===
|
|
398
|
+
if (target === 'file') {
|
|
399
|
+
if (row.type !== 'file')
|
|
400
|
+
return `file row "${row.name}" is not type="file"`;
|
|
401
|
+
// An unfilled file part is written with no value; there is nothing to lift.
|
|
402
|
+
if (row.value === undefined)
|
|
403
|
+
continue;
|
|
404
|
+
const refused = take(row.name, String(row.value), 'a file row');
|
|
405
|
+
if (refused)
|
|
406
|
+
return refused;
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const json = target === 'body' || CONNECTOR_PARAMETER_ROWS.has(target ?? '');
|
|
410
|
+
if (!json || row.name !== target) {
|
|
374
411
|
return `payload row "${row.name}" has ${target === undefined ? 'no target' : `target "${target}"`}`;
|
|
375
412
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
413
|
+
const value = safeJson(row.body ?? '{}');
|
|
414
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
415
|
+
return `the ${row.name} row is not a JSON object`;
|
|
416
|
+
if (row.name === 'body') {
|
|
417
|
+
// The file writes the body nested and the library declares its fields dotted
|
|
418
|
+
// (`fields.project.key`), so the body is read back into the dotted inputs it
|
|
419
|
+
// compiles from.
|
|
420
|
+
const flat = flattenConnectorBody(value, declared);
|
|
421
|
+
if ('refusal' in flat) {
|
|
422
|
+
const { refusal } = flat;
|
|
423
|
+
return refusal.kind === 'undeclared'
|
|
424
|
+
? notInLibrary('the body row', refusal.field)
|
|
425
|
+
: `${refusal.message} (${identity.key}/${identity.action})`;
|
|
426
|
+
}
|
|
427
|
+
for (const [k, v] of Object.entries(flat.inputs)) {
|
|
428
|
+
const refused = put(k, v, 'the body row');
|
|
429
|
+
if (refused)
|
|
430
|
+
return refused;
|
|
392
431
|
}
|
|
393
432
|
continue;
|
|
394
433
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
434
|
+
for (const [k, v] of Object.entries(value)) {
|
|
435
|
+
// A parameter Studio Web saved as text (`"start": "0"`) is coerced to the type
|
|
436
|
+
// the library declares, which the shared validator checks.
|
|
437
|
+
const lifted = typeof v === 'string' ? liftedInputValue(v, params.get(k)) : v;
|
|
438
|
+
const refused = take(k, lifted, `the ${row.name} row`);
|
|
439
|
+
if (refused)
|
|
440
|
+
return refused;
|
|
441
|
+
}
|
|
400
442
|
}
|
|
401
443
|
let outputVar;
|
|
402
444
|
let errorVar;
|
|
@@ -2130,7 +2172,7 @@ function bindingIsReferenced(xml, id) {
|
|
|
2130
2172
|
* `bpmn refresh` learns the entity's resource key. Nothing names the pair by id, so
|
|
2131
2173
|
* {@link bindingIsReferenced} would prune it; a pair is in use when some
|
|
2132
2174
|
* `Intsvc.ActivityExecution` task's `folderEntityName` and `folderEntityName_folderKey`
|
|
2133
|
-
*
|
|
2175
|
+
* parameters hold its name and folder key.
|
|
2134
2176
|
*/
|
|
2135
2177
|
function usedEntityKeys(bindings, container) {
|
|
2136
2178
|
const used = new Set();
|
|
@@ -2141,7 +2183,12 @@ function usedEntityKeys(bindings, container) {
|
|
|
2141
2183
|
const payload = payloadOf(el);
|
|
2142
2184
|
if (!payload || extensionTypeOf(payload) !== 'Intsvc.ActivityExecution')
|
|
2143
2185
|
continue;
|
|
2144
|
-
|
|
2186
|
+
// A V2 task carries the parameters in its `queryParameters` json row, a V1 one
|
|
2187
|
+
// as a row each.
|
|
2188
|
+
const rows = payload.input ?? [];
|
|
2189
|
+
const query = safeJson(rows.find((r) => r.name === 'queryParameters' && r.target === 'queryParameters')?.body ?? '{}');
|
|
2190
|
+
const row = (name) => (query && typeof query === 'object' && !Array.isArray(query) ? query[name] : undefined)
|
|
2191
|
+
?? rows.find((r) => r.name === name)?.value;
|
|
2145
2192
|
const name = row('folderEntityName');
|
|
2146
2193
|
const folderKey = row('folderEntityName_folderKey');
|
|
2147
2194
|
if (typeof name !== 'string' || typeof folderKey !== 'string')
|