@uipath/maestro-builder-sdk 6.39.0 → 6.40.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 +76 -76
- package/dist/api-members.md +360 -354
- package/dist/bpmn/bpmn-sdk.d.ts +40 -4
- package/dist/bpmn/bpmn-sdk.js +17 -3
- package/dist/bpmn/check.js +31 -21
- package/dist/bpmn/decompile.js +68 -2
- package/dist/bpmn/entry-point-id.d.ts +9 -0
- package/dist/bpmn/entry-point-id.js +35 -0
- package/dist/bpmn/registry-fallback.js +4 -0
- package/dist/bpmn/registry-types.json +1716 -206
- package/dist/bpmn/serialize.js +53 -10
- package/dist/bpmn/typed-node.d.ts +33 -32
- package/dist/bpmn/typed-node.js +19 -37
- package/package.json +2 -2
package/dist/bpmn/serialize.js
CHANGED
|
@@ -19,6 +19,7 @@ import { createConnectorTask } from './connector.js';
|
|
|
19
19
|
import { createConnectorEvent, createExternalTask, intsvcOutputVar } from './intsvc.js';
|
|
20
20
|
import { createExtensionPayload, createTypedNode, rowDeclaration, typedNodeOutputVar, verbatimOutputRows } from './typed-node.js';
|
|
21
21
|
import { connectorOutputVars, typedNodeDeclaredVars } from './declared-vars.js';
|
|
22
|
+
import { defaultEntryPointId } from './entry-point-id.js';
|
|
22
23
|
const require = createRequire(import.meta.url);
|
|
23
24
|
const uipathDescriptor = require('./uipath-moddle.v1.json');
|
|
24
25
|
const NS = {
|
|
@@ -138,16 +139,7 @@ export async function serialize(built, opts = {}) {
|
|
|
138
139
|
const meta = built.metadata;
|
|
139
140
|
if (meta?.migrationVersion !== undefined)
|
|
140
141
|
processExt.push(m.create('uipath:MigrationVersion', { version: meta.migrationVersion }));
|
|
141
|
-
|
|
142
|
-
// The package metadata generator discovers entry points by reading the root start
|
|
143
|
-
// event. A process-level `uipath:entryPointId` looks plausible and validates as XML,
|
|
144
|
-
// but is invisible to `update-metadata`, which then writes an empty entry-points.json.
|
|
145
|
-
const start = flowElements.find((element) => element.$type === 'bpmn:StartEvent');
|
|
146
|
-
if (start) {
|
|
147
|
-
const extensions = (start.extensionElements ??= m.create('bpmn:ExtensionElements', { values: [] }));
|
|
148
|
-
(extensions.values ??= []).unshift(m.create('uipath:EntryPointId', { value: meta.entryPointId }));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
142
|
+
stampEntryPointIds(ctx, built, flowElements, meta?.entryPointId);
|
|
151
143
|
if (meta?.tags !== undefined && meta.tags.length > 0)
|
|
152
144
|
processExt.push(m.create('uipath:Tags', { tags: meta.tags.map((t) => m.create('uipath:Tag', { value: t })) }));
|
|
153
145
|
if (meta?.caseManagement !== undefined)
|
|
@@ -218,6 +210,57 @@ export function processId(id) {
|
|
|
218
210
|
return /^[A-Za-z_][\w.-]*$/.test(id) ? id : 'Process_1';
|
|
219
211
|
}
|
|
220
212
|
// ─── Scope (process root or a sub-process body) ───────────────────────────────
|
|
213
|
+
/**
|
|
214
|
+
* `uipath:entryPointId` on the process's root start events, triggered or manual.
|
|
215
|
+
*
|
|
216
|
+
* The package metadata generator discovers entry points by reading the root start
|
|
217
|
+
* events — a process-level `uipath:entryPointId` looks plausible and validates as XML,
|
|
218
|
+
* but is invisible to `update-metadata`, which then writes an empty entry-points.json
|
|
219
|
+
* — and `uip maestro bpmn refresh` requires exactly one, a GUID, on each root manual
|
|
220
|
+
* start. The canvas writes one on every ROOT start and strips any inside a
|
|
221
|
+
* `bpmn:SubProcess` on save, so a nested start gets no derived id here, only one the
|
|
222
|
+
* author set. A root start takes, in order: the event's own option, else
|
|
223
|
+
* `.metadata({ entryPointId })` for the first root start in chain order, else the
|
|
224
|
+
* stable derived id (`entry-point-id.ts`, seeded from the builder's own process id, so
|
|
225
|
+
* two processes with the same start id derive different ids); `false` writes none.
|
|
226
|
+
*/
|
|
227
|
+
function stampEntryPointIds(ctx, built, flowElements, rootDefault) {
|
|
228
|
+
const { m } = ctx;
|
|
229
|
+
const own = new Map();
|
|
230
|
+
for (const n of allNodes(built.nodes)) {
|
|
231
|
+
if (n.kind === 'startEvent' || n.kind === 'connectorEvent' || n.kind === 'typed')
|
|
232
|
+
own.set(n.id, n.entryPointId);
|
|
233
|
+
}
|
|
234
|
+
let first = true;
|
|
235
|
+
const stamp = (el, value) => {
|
|
236
|
+
if (value === undefined || value === false)
|
|
237
|
+
return;
|
|
238
|
+
const extensions = (el.extensionElements ??= m.create('bpmn:ExtensionElements', { values: [] }));
|
|
239
|
+
const values = (extensions.values ??= []);
|
|
240
|
+
if (values.some((x) => x.$type === 'uipath:EntryPointId'))
|
|
241
|
+
return;
|
|
242
|
+
values.unshift(m.create('uipath:EntryPointId', { value }));
|
|
243
|
+
};
|
|
244
|
+
const visit = (elements, root) => {
|
|
245
|
+
for (const el of elements) {
|
|
246
|
+
if (el.$type === 'bpmn:SubProcess') {
|
|
247
|
+
visit(el.flowElements ?? [], false);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (el.$type !== 'bpmn:StartEvent')
|
|
251
|
+
continue;
|
|
252
|
+
const explicit = own.get(el.id);
|
|
253
|
+
if (!root) {
|
|
254
|
+
stamp(el, explicit);
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
const value = explicit !== undefined ? explicit : first && rootDefault !== undefined ? rootDefault : defaultEntryPointId(built.id, el.id);
|
|
258
|
+
first = false;
|
|
259
|
+
stamp(el, value);
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
visit(flowElements, true);
|
|
263
|
+
}
|
|
221
264
|
/** Build the flowElements array for one scope, wiring all references within it. */
|
|
222
265
|
function buildScope(ctx, nodes, flows) {
|
|
223
266
|
const { m } = ctx;
|
|
@@ -104,7 +104,29 @@ export interface RegistryTypeSpec {
|
|
|
104
104
|
eventDefinition: string | null;
|
|
105
105
|
/** True when authoring needs a tenant read (a connection, a process, a queue). */
|
|
106
106
|
requiresDiscovery: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* The registry's `IsDynamic`: a type whose fields the canvas discovers at design time.
|
|
109
|
+
* The CLI's merged-body required-field check (`validateMergedBodyFields`) skips exactly
|
|
110
|
+
* these, so for a dynamic type `check`'s EMPTY_REQUIRED_FIELD is the only gate on a
|
|
111
|
+
* missing required input (measured on uip 1.205: `A2A.AgentExecution` validates with
|
|
112
|
+
* one absent); every other merged-body type has its fields read inside the payload.
|
|
113
|
+
*/
|
|
114
|
+
isDynamic?: boolean;
|
|
107
115
|
bindingPattern: string;
|
|
116
|
+
/**
|
|
117
|
+
* The registry's `Placements`: where the canvas offers the type, by placement name
|
|
118
|
+
* (`Activity`, `StartEvent`, `IntermediateEvent`, `EndEvent`, …), with the BPMN
|
|
119
|
+
* element and, for an event, its definition. Kept as data; it is NOT an
|
|
120
|
+
* authorability signal — `{}` is what the case manager's internal nodes carry, but
|
|
121
|
+
* also `BPMN.ScriptTask`, `Intsvc.TimerTrigger`, `Maestro.AcquireLock` and
|
|
122
|
+
* `Maestro.NotificationService` (measured on uip 1.205), all of them authored. The
|
|
123
|
+
* internal set is `CASE_RUNTIME_INTERNAL_TYPES` (typed-node.ts). Absent on a spec that
|
|
124
|
+
* predates the field.
|
|
125
|
+
*/
|
|
126
|
+
placements?: Record<string, {
|
|
127
|
+
element: string | null;
|
|
128
|
+
eventDefinition: string | null;
|
|
129
|
+
}>;
|
|
108
130
|
}
|
|
109
131
|
/** Every extension type in the snapshot, sorted. */
|
|
110
132
|
export declare function registryTypeNames(): string[];
|
|
@@ -127,6 +149,17 @@ export declare function registryTypeNames(): string[];
|
|
|
127
149
|
* typo, or no `uip` to ask.
|
|
128
150
|
*/
|
|
129
151
|
export declare function registryType(type: string, inline?: RegistryTypeSpec): RegistryTypeSpec;
|
|
152
|
+
/**
|
|
153
|
+
* The types the case-management runtime writes for itself when it materializes a
|
|
154
|
+
* case plan into an executable process: scheduler state (`decisions`, the current
|
|
155
|
+
* execution state, lock and cycle bookkeeping) that only the platform produces. The
|
|
156
|
+
* canvas offers none of them, and `check` warns on an authored one
|
|
157
|
+
* (TYPE_RUNTIME_INTERNAL). The ledger (`bpmn-coverage.json`) records each as
|
|
158
|
+
* `out-of-scope` under `docs/BPMN_BUSINESS_RULES_PLAN.md`; a test pins the two lists
|
|
159
|
+
* to each other. Not derivable from the spec: `placements: {}` is shared with
|
|
160
|
+
* authored types (see {@link RegistryTypeSpec.placements}).
|
|
161
|
+
*/
|
|
162
|
+
export declare const CASE_RUNTIME_INTERNAL_TYPES: ReadonlySet<string>;
|
|
130
163
|
/** True when the snapshot itself carries the type — no tenant needed to emit it. */
|
|
131
164
|
export declare function isSnapshotType(type: string): boolean;
|
|
132
165
|
/**
|
|
@@ -458,36 +491,4 @@ export declare function missingRequiredInputs(type: string, inputs?: Record<stri
|
|
|
458
491
|
* agree with the CLI instead of guessing on either side of it.
|
|
459
492
|
*/
|
|
460
493
|
context?: Record<string, unknown>, inline?: RegistryTypeSpec): string[];
|
|
461
|
-
/**
|
|
462
|
-
* Whether this type's required payload fields are UNSATISFIABLE on the wire.
|
|
463
|
-
*
|
|
464
|
-
* A platform defect, recorded here because the SDK cannot emit its way around it.
|
|
465
|
-
* `RequiredFieldsRule` builds its required-name set from `InputFields` and then
|
|
466
|
-
* fires when a name is absent from the serialized rows **by name**. Under
|
|
467
|
-
* `mergedBody` and `splitInputsItemData` every payload field collapses into ONE row
|
|
468
|
-
* — named `body` or `ItemData` — so a required input field is never present by
|
|
469
|
-
* name and the rule fires however the node is filled in:
|
|
470
|
-
*
|
|
471
|
-
* [error] [call] EMPTY_REQUIRED_FIELD: The field 'agentUrl' in node 'call' is
|
|
472
|
-
* required but has no value.
|
|
473
|
-
*
|
|
474
|
-
* Note the registry's own `XmlTemplate` for `A2A.AgentExecution` emits exactly the
|
|
475
|
-
* body-only shape that fails, which is the clearest statement that the two halves
|
|
476
|
-
* of the platform disagree rather than that the SDK is writing the wrong thing.
|
|
477
|
-
*
|
|
478
|
-
* Whether a workaround exists is per-type and not derivable from the spec, so it is
|
|
479
|
-
* not encoded here. Measured: `A2A.AgentExecution` accepts redundant sibling rows
|
|
480
|
-
* alongside the merged body (`Valid`); `Maestro.SendMessageEvent` refuses them
|
|
481
|
-
* outright — `does not support input payload "Reference"` as a row, `does not
|
|
482
|
-
* support context input "Reference"` in context, and `ItemData`'s `target="body"`
|
|
483
|
-
* is enforced — so for that type NO artifact satisfies both gates.
|
|
484
|
-
*
|
|
485
|
-
* Selects exactly `A2A.AgentExecution` and `Maestro.SendMessageEvent` today. The
|
|
486
|
-
* three other types with required payload fields are `separateInputs`, whose rows
|
|
487
|
-
* DO carry their own names, and are unaffected.
|
|
488
|
-
*
|
|
489
|
-
* @param type - The extension type.
|
|
490
|
-
* @returns The required payload field names that cannot be expressed, or `[]`.
|
|
491
|
-
*/
|
|
492
|
-
export declare function unsatisfiableRequiredInputs(type: string, inline?: RegistryTypeSpec): string[];
|
|
493
494
|
export {};
|
package/dist/bpmn/typed-node.js
CHANGED
|
@@ -41,6 +41,25 @@ export function registryType(type, inline) {
|
|
|
41
41
|
}
|
|
42
42
|
return spec;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* The types the case-management runtime writes for itself when it materializes a
|
|
46
|
+
* case plan into an executable process: scheduler state (`decisions`, the current
|
|
47
|
+
* execution state, lock and cycle bookkeeping) that only the platform produces. The
|
|
48
|
+
* canvas offers none of them, and `check` warns on an authored one
|
|
49
|
+
* (TYPE_RUNTIME_INTERNAL). The ledger (`bpmn-coverage.json`) records each as
|
|
50
|
+
* `out-of-scope` under `docs/BPMN_BUSINESS_RULES_PLAN.md`; a test pins the two lists
|
|
51
|
+
* to each other. Not derivable from the spec: `placements: {}` is shared with
|
|
52
|
+
* authored types (see {@link RegistryTypeSpec.placements}).
|
|
53
|
+
*/
|
|
54
|
+
export const CASE_RUNTIME_INTERNAL_TYPES = new Set([
|
|
55
|
+
'Maestro.CaseCycleCommit',
|
|
56
|
+
'Maestro.CaseCyclePrepare',
|
|
57
|
+
'Maestro.CaseManagerGuardrails',
|
|
58
|
+
'Maestro.CaseManagerPlaceholder',
|
|
59
|
+
'Maestro.CaseRulesEvaluator',
|
|
60
|
+
'Maestro.RetrieveCaseState',
|
|
61
|
+
'Maestro.UpdateCaseState',
|
|
62
|
+
]);
|
|
44
63
|
/** True when the snapshot itself carries the type — no tenant needed to emit it. */
|
|
45
64
|
export function isSnapshotType(type) {
|
|
46
65
|
return Object.hasOwn(REGISTRY.types, type);
|
|
@@ -726,40 +745,3 @@ context = {}, inline) {
|
|
|
726
745
|
(f.default ?? '') === '')
|
|
727
746
|
.map((f) => f.name);
|
|
728
747
|
}
|
|
729
|
-
/**
|
|
730
|
-
* Whether this type's required payload fields are UNSATISFIABLE on the wire.
|
|
731
|
-
*
|
|
732
|
-
* A platform defect, recorded here because the SDK cannot emit its way around it.
|
|
733
|
-
* `RequiredFieldsRule` builds its required-name set from `InputFields` and then
|
|
734
|
-
* fires when a name is absent from the serialized rows **by name**. Under
|
|
735
|
-
* `mergedBody` and `splitInputsItemData` every payload field collapses into ONE row
|
|
736
|
-
* — named `body` or `ItemData` — so a required input field is never present by
|
|
737
|
-
* name and the rule fires however the node is filled in:
|
|
738
|
-
*
|
|
739
|
-
* [error] [call] EMPTY_REQUIRED_FIELD: The field 'agentUrl' in node 'call' is
|
|
740
|
-
* required but has no value.
|
|
741
|
-
*
|
|
742
|
-
* Note the registry's own `XmlTemplate` for `A2A.AgentExecution` emits exactly the
|
|
743
|
-
* body-only shape that fails, which is the clearest statement that the two halves
|
|
744
|
-
* of the platform disagree rather than that the SDK is writing the wrong thing.
|
|
745
|
-
*
|
|
746
|
-
* Whether a workaround exists is per-type and not derivable from the spec, so it is
|
|
747
|
-
* not encoded here. Measured: `A2A.AgentExecution` accepts redundant sibling rows
|
|
748
|
-
* alongside the merged body (`Valid`); `Maestro.SendMessageEvent` refuses them
|
|
749
|
-
* outright — `does not support input payload "Reference"` as a row, `does not
|
|
750
|
-
* support context input "Reference"` in context, and `ItemData`'s `target="body"`
|
|
751
|
-
* is enforced — so for that type NO artifact satisfies both gates.
|
|
752
|
-
*
|
|
753
|
-
* Selects exactly `A2A.AgentExecution` and `Maestro.SendMessageEvent` today. The
|
|
754
|
-
* three other types with required payload fields are `separateInputs`, whose rows
|
|
755
|
-
* DO carry their own names, and are unaffected.
|
|
756
|
-
*
|
|
757
|
-
* @param type - The extension type.
|
|
758
|
-
* @returns The required payload field names that cannot be expressed, or `[]`.
|
|
759
|
-
*/
|
|
760
|
-
export function unsatisfiableRequiredInputs(type, inline) {
|
|
761
|
-
const spec = registryType(type, inline);
|
|
762
|
-
if (spec.inputPattern !== 'mergedBody' && spec.inputPattern !== 'splitInputsItemData')
|
|
763
|
-
return [];
|
|
764
|
-
return spec.inputs.filter((f) => f.required).map((f) => f.name);
|
|
765
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.40.1",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"@types/node": "^22.7.0",
|
|
94
94
|
"esbuild": "^0.28.1"
|
|
95
95
|
},
|
|
96
|
-
"gitref": "
|
|
96
|
+
"gitref": "416f96b5db0e4bbfd59f19f8bd548f138a4a6918"
|
|
97
97
|
}
|