@uipath/maestro-builder-sdk 6.67.0 → 6.68.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 +51 -49
- package/dist/api-members.md +222 -220
- package/dist/bpmn/bpmn-sdk.d.ts +36 -4
- package/dist/bpmn/bpmn-sdk.js +25 -0
- package/dist/bpmn/data-service.d.ts +46 -2
- package/dist/bpmn/data-service.js +90 -1
- package/dist/case/check.js +5 -7
- package/dist/case/format-profile.d.ts +8 -0
- package/dist/case/format-profile.js +14 -0
- package/dist/case/serialize.js +4 -1
- package/dist/core/refusals.d.ts +5 -1
- package/dist/core/refusals.js +5 -1
- package/package.json +2 -2
package/dist/bpmn/bpmn-sdk.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ import type { ConnectorDescriptor } from '../core/connectors.js';
|
|
|
25
25
|
import type { RegistryTypeSpec, TypedContextRow, TypedInputRow, TypedOutputRow } from './typed-node.js';
|
|
26
26
|
import { type HumanTaskForm } from './human-task-form.js';
|
|
27
27
|
export type { HumanTaskForm, HumanTaskFormField, HumanTaskShownField, HumanTaskAskedField, HumanTaskInOutField, HumanTaskOutcome, } from './human-task-form.js';
|
|
28
|
-
import { type DataServiceOperation } from './data-service.js';
|
|
29
|
-
export type { DataServiceOperation } from './data-service.js';
|
|
28
|
+
import { type DataServiceEntity, type DataServiceOperation } from './data-service.js';
|
|
29
|
+
export type { DataServiceEntity, DataServiceFolderEntity, DataServiceOperation } from './data-service.js';
|
|
30
30
|
export { BpmnBuildError } from './bpmn-expr-check.js';
|
|
31
31
|
export type { BpmnLocatedDiagnostic } from './bpmn-expr-check.js';
|
|
32
32
|
export { connectorOutputVars, nodeDeclaredVars, typedNodeDeclaredVars } from './declared-vars.js';
|
|
@@ -1121,8 +1121,15 @@ export interface BindingOpts {
|
|
|
1121
1121
|
export interface DataServiceOpts extends ActivityOpts {
|
|
1122
1122
|
/** Display name the designer shows. Defaults to one built from the operation, e.g. `Create ContractRegistry`. */
|
|
1123
1123
|
name?: string;
|
|
1124
|
-
/**
|
|
1125
|
-
|
|
1124
|
+
/**
|
|
1125
|
+
* The Data Service entity the operation addresses: a tenant-level entity by name, e.g.
|
|
1126
|
+
* `'ContractRegistry'`, or a FOLDER-scoped one as `{ name, folderKey }` — what Studio
|
|
1127
|
+
* Web's folder entity picker selects. A folder-scoped entity is written with the
|
|
1128
|
+
* connector's `_V3` operations (`entityScope=folder`, `folderEntityName`,
|
|
1129
|
+
* `folderEntityName_folderKey`); see {@link DataServiceFolderEntity}. Not to be confused
|
|
1130
|
+
* with `folder`, which is where the CONNECTION lives.
|
|
1131
|
+
*/
|
|
1132
|
+
entity: DataServiceEntity;
|
|
1126
1133
|
/**
|
|
1127
1134
|
* The Data Fabric connection: the id of a `.binding()` declared with
|
|
1128
1135
|
* `propertyAttribute: 'ConnectionId'` (with or without the `=bindings.` prefix), or
|
|
@@ -2522,6 +2529,31 @@ declare abstract class ScopeBuilder {
|
|
|
2522
2529
|
* The response lands in `outputVar` (default `<id>_response`) and the error payload in
|
|
2523
2530
|
* `<id>_Error`, both declared for you.
|
|
2524
2531
|
*
|
|
2532
|
+
* **A folder-scoped entity** — one Studio Web's entity picker lists under an
|
|
2533
|
+
* Orchestrator folder rather than at tenant level — is `entity: { name, folderKey }`.
|
|
2534
|
+
* The record operations (create, update, get, query, delete) then write the connector's
|
|
2535
|
+
* `_V3` operation, which selects the entity with `entityScope=folder`,
|
|
2536
|
+
* `folderEntityName` and `folderEntityName_folderKey` query rows. The file operations
|
|
2537
|
+
* refuse it. `folderKey` is the entity's folder; `folder` stays the connection's.
|
|
2538
|
+
*
|
|
2539
|
+
* @example
|
|
2540
|
+
* **Create a record in a folder-scoped entity**
|
|
2541
|
+
* ```ts
|
|
2542
|
+
* bpmn('picker')
|
|
2543
|
+
* .startEvent('start')
|
|
2544
|
+
* .dataService('create', {
|
|
2545
|
+
* entity: { name: 'SkillPickerEvalEntity', folderKey: 'c4359cde-55f0-4f0e-9322-c6cdce74ab4c' },
|
|
2546
|
+
* connection: '0f6156da-7a1c-4cd8-910e-d7fd338baef7',
|
|
2547
|
+
* folder: 'c4359cde-55f0-4f0e-9322-c6cdce74ab4c',
|
|
2548
|
+
* op: 'create',
|
|
2549
|
+
* record: { title: 'PickerTest' },
|
|
2550
|
+
* })
|
|
2551
|
+
* .endEvent('done')
|
|
2552
|
+
* .sequenceFlow('start', 'create')
|
|
2553
|
+
* .sequenceFlow('create', 'done')
|
|
2554
|
+
* .build();
|
|
2555
|
+
* ```
|
|
2556
|
+
*
|
|
2525
2557
|
* @param id - The element id, unique in the process and used by `sequenceFlow`.
|
|
2526
2558
|
* @param opts - The entity, connection and folder, plus the operation and its parameters — see {@link DataServiceOpts} and {@link DataServiceOperation}.
|
|
2527
2559
|
* @param body - Boundary events attached to this activity, declared on the {@link ActivityBuilder} it receives.
|
package/dist/bpmn/bpmn-sdk.js
CHANGED
|
@@ -1123,6 +1123,31 @@ class ScopeBuilder {
|
|
|
1123
1123
|
* The response lands in `outputVar` (default `<id>_response`) and the error payload in
|
|
1124
1124
|
* `<id>_Error`, both declared for you.
|
|
1125
1125
|
*
|
|
1126
|
+
* **A folder-scoped entity** — one Studio Web's entity picker lists under an
|
|
1127
|
+
* Orchestrator folder rather than at tenant level — is `entity: { name, folderKey }`.
|
|
1128
|
+
* The record operations (create, update, get, query, delete) then write the connector's
|
|
1129
|
+
* `_V3` operation, which selects the entity with `entityScope=folder`,
|
|
1130
|
+
* `folderEntityName` and `folderEntityName_folderKey` query rows. The file operations
|
|
1131
|
+
* refuse it. `folderKey` is the entity's folder; `folder` stays the connection's.
|
|
1132
|
+
*
|
|
1133
|
+
* @example
|
|
1134
|
+
* **Create a record in a folder-scoped entity**
|
|
1135
|
+
* ```ts
|
|
1136
|
+
* bpmn('picker')
|
|
1137
|
+
* .startEvent('start')
|
|
1138
|
+
* .dataService('create', {
|
|
1139
|
+
* entity: { name: 'SkillPickerEvalEntity', folderKey: 'c4359cde-55f0-4f0e-9322-c6cdce74ab4c' },
|
|
1140
|
+
* connection: '0f6156da-7a1c-4cd8-910e-d7fd338baef7',
|
|
1141
|
+
* folder: 'c4359cde-55f0-4f0e-9322-c6cdce74ab4c',
|
|
1142
|
+
* op: 'create',
|
|
1143
|
+
* record: { title: 'PickerTest' },
|
|
1144
|
+
* })
|
|
1145
|
+
* .endEvent('done')
|
|
1146
|
+
* .sequenceFlow('start', 'create')
|
|
1147
|
+
* .sequenceFlow('create', 'done')
|
|
1148
|
+
* .build();
|
|
1149
|
+
* ```
|
|
1150
|
+
*
|
|
1126
1151
|
* @param id - The element id, unique in the process and used by `sequenceFlow`.
|
|
1127
1152
|
* @param opts - The entity, connection and folder, plus the operation and its parameters — see {@link DataServiceOpts} and {@link DataServiceOperation}.
|
|
1128
1153
|
* @param body - Boundary events attached to this activity, declared on the {@link ActivityBuilder} it receives.
|
|
@@ -30,6 +30,29 @@
|
|
|
30
30
|
* `file`, and typed as the converter types it (`integer` for `start`, `limit`,
|
|
31
31
|
* `expansionLevel`); only the record itself is a json `body` row. Nothing here needs
|
|
32
32
|
* the connector library.
|
|
33
|
+
*
|
|
34
|
+
* A **folder-scoped** entity (`entity: { name, folderKey }`, #1392) has a third form: the
|
|
35
|
+
* connector's `_V3` operations (`CreateEntityRecord_V3`, …), which select the entity with
|
|
36
|
+
* query parameters instead of the path — `entityScope=folder`, the solution-resource
|
|
37
|
+
* picker `folderEntityName`, and its companion `folderEntityName_folderKey`, the
|
|
38
|
+
* Orchestrator folder the entity lives in. The parameter names, targets and paths are
|
|
39
|
+
* `uip is resources describe uipath-uipath-dataservice <Op>_V3`'s. The `_V3` file operations
|
|
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
|
+
* **No `Entity` binding rows, by design.** 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.
|
|
33
56
|
*/
|
|
34
57
|
import type { TypedInputRow } from './typed-node.js';
|
|
35
58
|
/** The connector key the tenant lists Data Fabric under. */
|
|
@@ -113,6 +136,23 @@ export type DataServiceOperation = {
|
|
|
113
136
|
/** The file field's name. */
|
|
114
137
|
field: string;
|
|
115
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* A Data Fabric entity in an Orchestrator folder — what Studio Web's folder-scoped entity
|
|
141
|
+
* picker selects, as opposed to a tenant-level entity named by a plain string.
|
|
142
|
+
*/
|
|
143
|
+
export interface DataServiceFolderEntity {
|
|
144
|
+
/** The entity's name, e.g. `'SkillPickerEvalEntity'`. */
|
|
145
|
+
name: string;
|
|
146
|
+
/**
|
|
147
|
+
* The key of the Orchestrator folder the entity lives in (a GUID: `uip or folders
|
|
148
|
+
* list --all --path <FolderPath> --output json` → `Key`; without `--all` the list holds
|
|
149
|
+
* only the caller's own folders), or a `=`-expression yielding it. Never the folder's
|
|
150
|
+
* PATH (`'Shared'`): that is refused, since it would compile, validate and fail at run time.
|
|
151
|
+
*/
|
|
152
|
+
folderKey: string;
|
|
153
|
+
}
|
|
154
|
+
/** A tenant-level entity by name, or a folder-scoped one — see {@link DataServiceFolderEntity}. */
|
|
155
|
+
export type DataServiceEntity = string | DataServiceFolderEntity;
|
|
116
156
|
/** What the wire needs for one operation, before bindings and outputs are added. */
|
|
117
157
|
export interface DataServiceWire {
|
|
118
158
|
/** A display name when the author gave none, e.g. `Create ContractRegistry`. */
|
|
@@ -125,8 +165,12 @@ export interface DataServiceWire {
|
|
|
125
165
|
/**
|
|
126
166
|
* The context and payload rows for one operation on one entity.
|
|
127
167
|
*
|
|
128
|
-
* @param entity - The Data Service entity, e.g. `'ContractRegistry'
|
|
168
|
+
* @param entity - The Data Service entity: a name, e.g. `'ContractRegistry'`, or a
|
|
169
|
+
* folder-scoped `{ name, folderKey }`.
|
|
129
170
|
* @param operation - Which operation, and its parameters.
|
|
130
171
|
* @returns The wire shape, without the connection/folder wiring the builder adds.
|
|
172
|
+
* @throws CompileRefusal for a folder-scoped entity on a file operation (`BPMN_DATA_SERVICE_FOLDER_FILE_OP`), or one with no name
|
|
173
|
+
* (`BPMN_DATA_SERVICE_ENTITY_NO_NAME`), no folder key (`BPMN_DATA_SERVICE_FOLDER_KEY_MISSING`) or a folder key that is not a
|
|
174
|
+
* key (`BPMN_DATA_SERVICE_FOLDER_KEY_NOT_GUID`).
|
|
131
175
|
*/
|
|
132
|
-
export declare function dataServiceWire(entity:
|
|
176
|
+
export declare function dataServiceWire(entity: DataServiceEntity, operation: DataServiceOperation): DataServiceWire;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CompileRefusal } from '../core/compile-refusal.js';
|
|
2
|
+
import { ownEntry } from '../core/own-entry.js';
|
|
1
3
|
/** The connector key the tenant lists Data Fabric under. */
|
|
2
4
|
export const DATA_SERVICE_CONNECTOR_KEY = 'uipath-uipath-dataservice';
|
|
3
5
|
/** The extension type every Integration Service activity dispatches through. */
|
|
@@ -5,11 +7,17 @@ export const DATA_SERVICE_ACTIVITY_TYPE = 'Intsvc.ActivityExecution';
|
|
|
5
7
|
/**
|
|
6
8
|
* The context and payload rows for one operation on one entity.
|
|
7
9
|
*
|
|
8
|
-
* @param entity - The Data Service entity, e.g. `'ContractRegistry'
|
|
10
|
+
* @param entity - The Data Service entity: a name, e.g. `'ContractRegistry'`, or a
|
|
11
|
+
* folder-scoped `{ name, folderKey }`.
|
|
9
12
|
* @param operation - Which operation, and its parameters.
|
|
10
13
|
* @returns The wire shape, without the connection/folder wiring the builder adds.
|
|
14
|
+
* @throws CompileRefusal for a folder-scoped entity on a file operation (`BPMN_DATA_SERVICE_FOLDER_FILE_OP`), or one with no name
|
|
15
|
+
* (`BPMN_DATA_SERVICE_ENTITY_NO_NAME`), no folder key (`BPMN_DATA_SERVICE_FOLDER_KEY_MISSING`) or a folder key that is not a
|
|
16
|
+
* key (`BPMN_DATA_SERVICE_FOLDER_KEY_NOT_GUID`).
|
|
11
17
|
*/
|
|
12
18
|
export function dataServiceWire(entity, operation) {
|
|
19
|
+
if (typeof entity !== 'string')
|
|
20
|
+
return folderEntityWire(entity, operation);
|
|
13
21
|
const attachment = '/Attachment/{entityName}/{recordId}/{fieldName}';
|
|
14
22
|
switch (operation.op) {
|
|
15
23
|
case 'create':
|
|
@@ -86,6 +94,87 @@ export function dataServiceWire(entity, operation) {
|
|
|
86
94
|
};
|
|
87
95
|
}
|
|
88
96
|
}
|
|
97
|
+
/** The `_V3` scope rows' wire names, as `describe` declares them and the canvas writes them. */
|
|
98
|
+
const FOLDER_SCOPE = {
|
|
99
|
+
scopeParameter: 'entityScope',
|
|
100
|
+
scopeValue: 'folder',
|
|
101
|
+
nameParameter: 'folderEntityName',
|
|
102
|
+
folderKeyParameter: 'folderEntityName_folderKey',
|
|
103
|
+
};
|
|
104
|
+
/** The five `_V3` record operations, from `uip is resources describe uipath-uipath-dataservice <Op>_V3`. */
|
|
105
|
+
const FOLDER_OPERATIONS = {
|
|
106
|
+
create: { operation: 'Create', objectName: 'CreateEntityRecord_V3', method: 'POST', path: '/v3/CreateEntityRecord/insert', label: (e) => `Create ${e}` },
|
|
107
|
+
update: { operation: 'Replace', objectName: 'UpdateEntityRecord_V3', method: 'PUT', path: '/v3/UpdateEntityRecord/update', label: (e) => `Update ${e}` },
|
|
108
|
+
get: { operation: 'List', objectName: 'GetEntityRecord_V3', method: 'GET', path: '/v3/GetEntityRecord/read', label: (e) => `Get ${e} record` },
|
|
109
|
+
query: { operation: 'Create', objectName: 'QueryEntityRecords_V3', method: 'POST', path: '/v3/QueryEntityRecords/query', label: (e) => `Query ${e}` },
|
|
110
|
+
delete: { operation: 'Create', objectName: 'DeleteEntityRecord_V3', method: 'POST', path: '/v3/DeleteEntityRecord/delete', label: (e) => `Delete ${e} record` },
|
|
111
|
+
};
|
|
112
|
+
/** A folder key: a GUID, as `uip or folders list` returns it. */
|
|
113
|
+
const GUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
114
|
+
/**
|
|
115
|
+
* Refuse a folder-scoped entity whose name or folder key cannot be right, at the
|
|
116
|
+
* call that wrote it. The folder key is the trap: the connector's `describe` labels
|
|
117
|
+
* the parameter "Orchestrator Folder Path", so a path (`'Shared'`) is the likely
|
|
118
|
+
* mistake, and it builds, checks and validates, then fails at run time.
|
|
119
|
+
*/
|
|
120
|
+
function validateFolderEntity(entity) {
|
|
121
|
+
if (typeof entity?.name !== 'string' || entity.name.trim() === '') {
|
|
122
|
+
throw new CompileRefusal('BPMN_DATA_SERVICE_ENTITY_NO_NAME', 'dataService: a folder-scoped entity needs its name: entity: { name, folderKey }.');
|
|
123
|
+
}
|
|
124
|
+
const key = entity.folderKey;
|
|
125
|
+
if (typeof key !== 'string' || key.trim() === '') {
|
|
126
|
+
throw new CompileRefusal('BPMN_DATA_SERVICE_FOLDER_KEY_MISSING', `dataService: the folder-scoped entity "${entity.name}" needs the key of the Orchestrator folder it lives in: entity: { name, folderKey }. ` +
|
|
127
|
+
'Find it with: uip or folders list --all --path <FolderPath> --output json (its Key).');
|
|
128
|
+
}
|
|
129
|
+
if (!key.startsWith('=') && !GUID.test(key)) {
|
|
130
|
+
throw new CompileRefusal('BPMN_DATA_SERVICE_FOLDER_KEY_NOT_GUID', `dataService: folderKey ${JSON.stringify(key)} for entity "${entity.name}" is not a folder key. It takes the folder's KEY (a GUID) or a =-expression, ` +
|
|
131
|
+
`not its path. Find it with: uip or folders list --all --path ${/\s/.test(key) ? `'${key}'` : key} --output json (its Key).`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The `_V3` form for a folder-scoped entity. The three scope rows come first, then the
|
|
136
|
+
* operation's own parameters, which `_V3` takes as query rows where the tenant forms
|
|
137
|
+
* use the path (`recordId`, never `id`).
|
|
138
|
+
*/
|
|
139
|
+
function folderEntityWire(entity, operation) {
|
|
140
|
+
validateFolderEntity(entity);
|
|
141
|
+
if (operation.op === 'downloadFile' || operation.op === 'uploadFile' || operation.op === 'deleteFile') {
|
|
142
|
+
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, ` +
|
|
143
|
+
`so where it takes "${operation.field}" is unknown here. Use a tenant-level entity (entity: '${entity.name}'), or write the task with .activity().`);
|
|
144
|
+
}
|
|
145
|
+
const scope = [
|
|
146
|
+
scalarRow(FOLDER_SCOPE.scopeParameter, 'query', FOLDER_SCOPE.scopeValue),
|
|
147
|
+
scalarRow(FOLDER_SCOPE.nameParameter, 'query', entity.name),
|
|
148
|
+
scalarRow(FOLDER_SCOPE.folderKeyParameter, 'query', entity.folderKey),
|
|
149
|
+
];
|
|
150
|
+
const op = ownEntry(FOLDER_OPERATIONS, operation.op);
|
|
151
|
+
const wire = (inputRows) => ({
|
|
152
|
+
label: op.label(entity.name),
|
|
153
|
+
context: { operation: op.operation, objectName: op.objectName, method: op.method, path: op.path },
|
|
154
|
+
inputRows: [...scope, ...inputRows],
|
|
155
|
+
});
|
|
156
|
+
switch (operation.op) {
|
|
157
|
+
case 'create':
|
|
158
|
+
return wire([bodyRow(operation.record)]);
|
|
159
|
+
case 'update':
|
|
160
|
+
return wire([scalarRow('recordId', 'query', operation.id), bodyRow(operation.record)]);
|
|
161
|
+
case 'get':
|
|
162
|
+
return wire([scalarRow('recordId', 'query', operation.recordId), ...optionalRow('expansionLevel', 'query', operation.expansionLevel)]);
|
|
163
|
+
case 'query':
|
|
164
|
+
return wire([
|
|
165
|
+
...optionalRow('queryExpression', 'query', operation.where),
|
|
166
|
+
scalarRow('start', 'query', operation.start ?? 0),
|
|
167
|
+
scalarRow('limit', 'query', operation.limit ?? 100),
|
|
168
|
+
...optionalRow('isAscending', 'query', operation.ascending),
|
|
169
|
+
...optionalRow('expansionLevel', 'query', operation.expansionLevel),
|
|
170
|
+
// The sort field is a body field here too: `_sortFieldName` is the one
|
|
171
|
+
// `RequestFields` entry `QueryEntityRecords_V3` declares.
|
|
172
|
+
...(operation.sortBy !== undefined ? [bodyRow({ _sortFieldName: operation.sortBy })] : []),
|
|
173
|
+
]);
|
|
174
|
+
case 'delete':
|
|
175
|
+
return wire([scalarRow('recordId', 'query', operation.recordId)]);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
89
178
|
function fileFieldRows(entity, recordId, field) {
|
|
90
179
|
return [scalarRow('entityName', 'path', entity), scalarRow('recordId', 'path', recordId), scalarRow('fieldName', 'path', field)];
|
|
91
180
|
}
|
package/dist/case/check.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { businessEventProblems } from './business-event-shape.js';
|
|
2
2
|
import { ruleShapeProblems } from './rule-options.js';
|
|
3
3
|
import { types } from '../core/expr.js';
|
|
4
|
-
import {
|
|
4
|
+
import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS, authoredCaseVersion, caseVersionMismatch } from './format-profile.js';
|
|
5
5
|
import { schemaVersionRefusal } from '../schema-version.js';
|
|
6
6
|
import { caseJsonPreservation, caseJsonPreservationErrors } from './preserve.js';
|
|
7
7
|
import { EQUALS_EXPR_DIALECT, checkBindingLabels, checkConnectorContract, checkConnectorLookups, checkConnectorSchema, } from '../core/connector-checks.js';
|
|
@@ -39,12 +39,10 @@ export function check(built, opts = {}) {
|
|
|
39
39
|
code: 'VERSION_DEPRECATED',
|
|
40
40
|
message: `.version(${JSON.stringify(requestedVersion)}) is deprecated: the Case JSON schema version is declared with .schemaVersion(), which accepts only versions this build can write. This SDK writes ${CASE_FORMAT_PROFILE.writeVersion}.`,
|
|
41
41
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
message: `.version(${JSON.stringify(requestedVersion)}) does not match the serializer's ${CASE_FORMAT_PROFILE.writeVersion} format profile. A document version is a grammar claim, not an author release value.`,
|
|
47
|
-
});
|
|
42
|
+
// `serialize` refuses it too (`caseVersionMismatch`, one rule, one message).
|
|
43
|
+
const mismatch = caseVersionMismatch(built);
|
|
44
|
+
if (mismatch)
|
|
45
|
+
diags.push({ level: 'error', code: 'VERSION_MISMATCH', message: mismatch });
|
|
48
46
|
}
|
|
49
47
|
// The DECLARED grammar version (`.schemaVersion()`), as opposed to the
|
|
50
48
|
// deprecated `.version()` above. It is already refused at the call, so this
|
|
@@ -40,3 +40,11 @@ export declare const CASE_FORMAT_PROFILE: Readonly<CaseFormatProfile>;
|
|
|
40
40
|
export declare const CASE_SCHEMA_VERSIONS: SchemaVersionPolicy;
|
|
41
41
|
export declare function recordAuthoredCaseVersion(built: object, version: string): void;
|
|
42
42
|
export declare function authoredCaseVersion(built: object): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* `VERSION_MISMATCH`'s message when a deprecated `.version()` asks for a
|
|
45
|
+
* document version other than {@link CASE_FORMAT_PROFILE}'s `writeVersion`,
|
|
46
|
+
* else `undefined`. The serializer writes only its own grammar, so it cannot
|
|
47
|
+
* honour the request: `serialize` refuses it rather than stamp another
|
|
48
|
+
* version, and `check` reports the same message (#1554).
|
|
49
|
+
*/
|
|
50
|
+
export declare function caseVersionMismatch(built: object): string | undefined;
|
|
@@ -127,3 +127,17 @@ export function recordAuthoredCaseVersion(built, version) {
|
|
|
127
127
|
export function authoredCaseVersion(built) {
|
|
128
128
|
return authoredVersions.get(built);
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* `VERSION_MISMATCH`'s message when a deprecated `.version()` asks for a
|
|
132
|
+
* document version other than {@link CASE_FORMAT_PROFILE}'s `writeVersion`,
|
|
133
|
+
* else `undefined`. The serializer writes only its own grammar, so it cannot
|
|
134
|
+
* honour the request: `serialize` refuses it rather than stamp another
|
|
135
|
+
* version, and `check` reports the same message (#1554).
|
|
136
|
+
*/
|
|
137
|
+
export function caseVersionMismatch(built) {
|
|
138
|
+
const requested = authoredCaseVersion(built);
|
|
139
|
+
if (requested === undefined || requested === CASE_FORMAT_PROFILE.writeVersion)
|
|
140
|
+
return undefined;
|
|
141
|
+
return `.version(${JSON.stringify(requested)}) does not match the serializer's ${CASE_FORMAT_PROFILE.writeVersion} format profile. `
|
|
142
|
+
+ 'A document version is a grammar claim, not an author release value.';
|
|
143
|
+
}
|
package/dist/case/serialize.js
CHANGED
|
@@ -20,7 +20,7 @@ import { resolveEventWhere } from '../core/lookups.js';
|
|
|
20
20
|
import { resolveCaseSubscription } from './subscription.js';
|
|
21
21
|
import { dedupeConditionNames } from './rule-names.js';
|
|
22
22
|
import { EXTERNAL_TASK_DESCRIPTOR_CONTRACT, EXTERNAL_TASK_HYBRID_UNSUPPORTED, externalDescriptorRefusal, externalHybridRefusal, externalServiceType, isExternalExecutionMode, } from './external.js';
|
|
23
|
-
import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS } from './format-profile.js';
|
|
23
|
+
import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS, caseVersionMismatch } from './format-profile.js';
|
|
24
24
|
import { isResourceLabelRefusal, resolveResourceRef, resourceIdentity } from './resource-identity.js';
|
|
25
25
|
import { ownEntry } from '../core/own-entry.js';
|
|
26
26
|
import { stableId } from '../core/stable-id.js';
|
|
@@ -90,6 +90,9 @@ function conditionNamer(built) {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
export function serialize(built, opts = {}) {
|
|
93
|
+
const versionMismatch = caseVersionMismatch(built);
|
|
94
|
+
if (versionMismatch)
|
|
95
|
+
throw new CompileRefusal('VERSION_MISMATCH', versionMismatch);
|
|
93
96
|
const ids = new IdGen();
|
|
94
97
|
const caseId = ids.caseId(built.id);
|
|
95
98
|
// ── First pass: allocate stage + task ids, build resolution maps ──
|
package/dist/core/refusals.d.ts
CHANGED
|
@@ -72,6 +72,10 @@ export declare const REFUSALS: {
|
|
|
72
72
|
readonly BPMN_CHOOSE_ARM_NO_WHEN: "lowering";
|
|
73
73
|
readonly BPMN_CHOOSE_MANY_OTHERWISE: "lowering";
|
|
74
74
|
readonly BPMN_CONTEXT_FIELD_UNKNOWN: "lowering";
|
|
75
|
+
readonly BPMN_DATA_SERVICE_ENTITY_NO_NAME: "lowering";
|
|
76
|
+
readonly BPMN_DATA_SERVICE_FOLDER_FILE_OP: "lowering";
|
|
77
|
+
readonly BPMN_DATA_SERVICE_FOLDER_KEY_MISSING: "lowering";
|
|
78
|
+
readonly BPMN_DATA_SERVICE_FOLDER_KEY_NOT_GUID: "lowering";
|
|
75
79
|
readonly BPMN_DUP_BOUNDARY_ID: "lowering";
|
|
76
80
|
readonly BPMN_DUP_ERROR_CATCH: "lowering";
|
|
77
81
|
readonly BPMN_ERROR_NAME_EMPTY: "lowering";
|
|
@@ -686,7 +690,7 @@ export declare const REFUSALS: {
|
|
|
686
690
|
readonly VARIABLE_ORDER_UNKNOWN_ID: "lint";
|
|
687
691
|
readonly VARS_BRACKET_READ: "lint";
|
|
688
692
|
readonly VERSION_DEPRECATED: "lint";
|
|
689
|
-
readonly VERSION_MISMATCH: "
|
|
693
|
+
readonly VERSION_MISMATCH: "lowering";
|
|
690
694
|
readonly VOICE_AGENT_ITERATIONS: "lint";
|
|
691
695
|
readonly VOICE_AGENT_NO_PROMPT: "lint";
|
|
692
696
|
readonly VOICE_CALL_CONTEXT_NOT_OBJECT: "lint";
|
package/dist/core/refusals.js
CHANGED
|
@@ -120,6 +120,10 @@ export const REFUSALS = {
|
|
|
120
120
|
BPMN_CHOOSE_ARM_NO_WHEN: 'lowering',
|
|
121
121
|
BPMN_CHOOSE_MANY_OTHERWISE: 'lowering',
|
|
122
122
|
BPMN_CONTEXT_FIELD_UNKNOWN: 'lowering',
|
|
123
|
+
BPMN_DATA_SERVICE_ENTITY_NO_NAME: 'lowering',
|
|
124
|
+
BPMN_DATA_SERVICE_FOLDER_FILE_OP: 'lowering',
|
|
125
|
+
BPMN_DATA_SERVICE_FOLDER_KEY_MISSING: 'lowering',
|
|
126
|
+
BPMN_DATA_SERVICE_FOLDER_KEY_NOT_GUID: 'lowering',
|
|
123
127
|
BPMN_DUP_BOUNDARY_ID: 'lowering',
|
|
124
128
|
BPMN_DUP_ERROR_CATCH: 'lowering',
|
|
125
129
|
BPMN_ERROR_NAME_EMPTY: 'lowering',
|
|
@@ -737,7 +741,7 @@ export const REFUSALS = {
|
|
|
737
741
|
VARIABLE_ORDER_UNKNOWN_ID: 'lint',
|
|
738
742
|
VARS_BRACKET_READ: 'lint',
|
|
739
743
|
VERSION_DEPRECATED: 'lint',
|
|
740
|
-
VERSION_MISMATCH: '
|
|
744
|
+
VERSION_MISMATCH: 'lowering',
|
|
741
745
|
VOICE_AGENT_ITERATIONS: 'lint',
|
|
742
746
|
VOICE_AGENT_NO_PROMPT: 'lint',
|
|
743
747
|
VOICE_CALL_CONTEXT_NOT_OBJECT: 'lint',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.68.0",
|
|
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",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"@types/node": "^22.7.0",
|
|
101
101
|
"esbuild": "^0.28.1"
|
|
102
102
|
},
|
|
103
|
-
"gitref": "
|
|
103
|
+
"gitref": "e00e90da685347c0a5b2f9ef0fafee9e0b980c4d"
|
|
104
104
|
}
|