@uipath/maestro-builder-sdk 6.14.5 → 6.15.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 +71 -71
- package/dist/api-members.md +324 -323
- package/dist/bpmn/bpmn-sdk.d.ts +16 -0
- package/dist/bpmn/bpmn-sdk.js +2 -0
- package/dist/bpmn/check-cli.js +22 -5
- package/dist/bpmn/check.d.ts +15 -1
- package/dist/bpmn/check.js +69 -2
- package/dist/bpmn/compile-cli.js +24 -14
- package/dist/bpmn/connector.js +29 -14
- package/dist/bpmn/decompile-cli.js +3 -3
- package/dist/bpmn/intsvc.js +5 -2
- package/dist/bpmn/serialize.d.ts +2 -0
- package/dist/bpmn/serialize.js +1 -1
- package/dist/case/compile-cli.js +6 -9
- package/dist/case/decompile-cli.js +2 -2
- package/dist/case/serialize.js +1 -1
- package/dist/check-cli.js +6 -35
- package/dist/check.d.ts +16 -148
- package/dist/check.js +33 -709
- package/dist/cli/commands/bpmn.js +15 -0
- package/dist/cli-library.d.ts +6 -25
- package/dist/cli-library.js +6 -73
- package/dist/core/cli-library.d.ts +47 -0
- package/dist/core/cli-library.js +150 -0
- package/dist/core/connector-checks.d.ts +226 -0
- package/dist/core/connector-checks.js +518 -0
- package/dist/core/connector-inputs.d.ts +80 -0
- package/dist/core/connector-inputs.js +453 -0
- package/dist/core/event-checks.d.ts +137 -0
- package/dist/core/event-checks.js +321 -0
- package/dist/decompile-cli.js +2 -2
- package/dist/decompile.js +1 -1
- package/dist/registry/generators/markdown/sections/example.d.ts +7 -1
- package/dist/registry/generators/markdown/sections/example.js +70 -5
- package/dist/registry/generators/markdown/sections/lookups.js +29 -8
- package/dist/registry/prepare/messages.js +6 -1
- package/dist/registry/prepare/source-import.d.ts +3 -3
- package/dist/registry/prepare/source-import.js +15 -4
- package/dist/registry/prepare/source-labels.js +31 -4
- package/dist/serialize.d.ts +11 -11
- package/dist/serialize.js +27 -420
- package/dist/workdir.d.ts +10 -0
- package/dist/workdir.js +14 -1
- package/package.json +2 -2
- /package/dist/{event-filters.d.ts → core/event-filters.d.ts} +0 -0
- /package/dist/{event-filters.js → core/event-filters.js} +0 -0
package/dist/bpmn/bpmn-sdk.d.ts
CHANGED
|
@@ -216,6 +216,12 @@ export type BpmnNode = {
|
|
|
216
216
|
key: string;
|
|
217
217
|
eventName: string;
|
|
218
218
|
version?: string;
|
|
219
|
+
/**
|
|
220
|
+
* The OBJECT a GENERIC event watches — a Data Fabric entity, a Salesforce or
|
|
221
|
+
* ServiceNow object, a Jira record type. Required for such an event and
|
|
222
|
+
* refused for a curated one, exactly as it is on the Flow subscription.
|
|
223
|
+
*/
|
|
224
|
+
object?: string;
|
|
219
225
|
/** Symbolic binding names, as `.connector()` takes them. */
|
|
220
226
|
connection?: string;
|
|
221
227
|
folder?: string;
|
|
@@ -1313,6 +1319,16 @@ export interface ConnectorEventOpts extends ActivityOpts {
|
|
|
1313
1319
|
folderPath?: string;
|
|
1314
1320
|
/** Pin the descriptor version, as `.connector()` does. */
|
|
1315
1321
|
version?: string;
|
|
1322
|
+
/**
|
|
1323
|
+
* The OBJECT a GENERIC event watches (`record-created` and its kin on Data
|
|
1324
|
+
* Fabric, Salesforce, ServiceNow, Jira). Such an event's library entry carries
|
|
1325
|
+
* no default, so without this the node emits `objectName: ""`, validates, and
|
|
1326
|
+
* watches nothing. A CURATED event has its object built in and refuses one here.
|
|
1327
|
+
* `uip is triggers objects <connector> <EVENT> --connection-id <id>` lists what
|
|
1328
|
+
* the bound connection exposes; `check` reports EVENT_GENERIC_NO_OBJECT and
|
|
1329
|
+
* EVENT_OBJECT_NOT_GENERIC for the two ways to get it wrong.
|
|
1330
|
+
*/
|
|
1331
|
+
object?: string;
|
|
1316
1332
|
/**
|
|
1317
1333
|
* The `where` scope narrowing the subscription, when the operation declares
|
|
1318
1334
|
* parameters. `Library.eventParameterFields()` is the authority on which names an
|
package/dist/bpmn/bpmn-sdk.js
CHANGED
|
@@ -1513,6 +1513,7 @@ class ScopeBuilder {
|
|
|
1513
1513
|
key: connector,
|
|
1514
1514
|
eventName: event,
|
|
1515
1515
|
version: opts.version,
|
|
1516
|
+
object: opts.object,
|
|
1516
1517
|
connection: opts.connection,
|
|
1517
1518
|
folder: opts.folder,
|
|
1518
1519
|
folderPath: opts.folderPath,
|
|
@@ -1558,6 +1559,7 @@ class ScopeBuilder {
|
|
|
1558
1559
|
key: connector,
|
|
1559
1560
|
eventName: event,
|
|
1560
1561
|
version: opts.version,
|
|
1562
|
+
object: opts.object,
|
|
1561
1563
|
connection: opts.connection,
|
|
1562
1564
|
folder: opts.folder,
|
|
1563
1565
|
folderPath: opts.folderPath,
|
package/dist/bpmn/check-cli.js
CHANGED
|
@@ -3,32 +3,49 @@
|
|
|
3
3
|
* check-cli — fast static validation of a <Name>.bpmn.ts (no output file).
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
|
-
* node --experimental-strip-types check-cli.js <bpmn.ts | BaseName> [--graph]
|
|
6
|
+
* node --experimental-strip-types check-cli.js <bpmn.ts | BaseName> [--graph] \
|
|
7
|
+
* [--library <library-json dir>] [--connectors-local <overlay dir>] [--bindings <bindings.json>]
|
|
7
8
|
*
|
|
8
9
|
* Exit 0 = clean; exit 1 = at least one error. Warnings print but do not fail.
|
|
9
10
|
* `--graph` also prints the resolved wiring to stdout — every element with the flows
|
|
10
11
|
* leaving it, implied edges marked — see graph.ts.
|
|
11
12
|
*/
|
|
13
|
+
import { existsSync } from 'node:fs';
|
|
12
14
|
import { reportDiagnostics, reportResult } from '../cli-result.js';
|
|
13
15
|
import { resolveBpmnFile, loadBuiltBpmn } from './load.js';
|
|
14
16
|
import { check } from './check.js';
|
|
15
17
|
import { graphModel, renderGraph } from './graph.js';
|
|
18
|
+
import { Bindings } from '../core/bindings.js';
|
|
19
|
+
import { connectorCheckOpts, flagValue, openCliLibrary } from '../core/cli-library.js';
|
|
16
20
|
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
17
21
|
import { ensureTypeScriptRuntime } from '../node-runtime.js';
|
|
22
|
+
/** Flags that take a value — their argument is never the source positional. */
|
|
23
|
+
const VALUE_FLAGS = new Set(['--library', '--connectors-local', '--bindings']);
|
|
24
|
+
/**
|
|
25
|
+
* The connector facts, resolved exactly as `compile-cli` resolves them, so the
|
|
26
|
+
* inner loop and the emit rung cannot disagree about a field, a lookup or a
|
|
27
|
+
* binding name. Silent when there is no library and no bindings.json — `check`
|
|
28
|
+
* stays a pure function of the built model then, as it always was.
|
|
29
|
+
*/
|
|
30
|
+
function bpmnCheckOpts(argv) {
|
|
31
|
+
const bindFile = flagValue(argv, '--bindings')
|
|
32
|
+
?? (existsSync('bindings.json') ? 'bindings.json' : undefined);
|
|
33
|
+
return connectorCheckOpts(openCliLibrary(argv), bindFile ? new Bindings(bindFile) : undefined);
|
|
34
|
+
}
|
|
18
35
|
export async function run(argv) {
|
|
19
36
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
20
|
-
console.error('usage: check <bpmn.ts | BaseName> [--graph]');
|
|
37
|
+
console.error('usage: check <bpmn.ts | BaseName> [--graph] [--library <dir>] [--connectors-local <dir>] [--bindings <file>]');
|
|
21
38
|
return 2;
|
|
22
39
|
}
|
|
23
40
|
ensureTypeScriptRuntime();
|
|
24
41
|
const graph = argv.includes('--graph');
|
|
25
|
-
const input = argv.find((a) => !a.startsWith('--'));
|
|
42
|
+
const input = argv.find((a, i) => !a.startsWith('--') && !VALUE_FLAGS.has(argv[i - 1]));
|
|
26
43
|
if (input === undefined) {
|
|
27
|
-
console.error('usage: check <bpmn.ts | BaseName> [--graph]');
|
|
44
|
+
console.error('usage: check <bpmn.ts | BaseName> [--graph] [--library <dir>] [--connectors-local <dir>] [--bindings <file>]');
|
|
28
45
|
return 2;
|
|
29
46
|
}
|
|
30
47
|
const built = await loadBuiltBpmn(resolveBpmnFile(input));
|
|
31
|
-
const diags = check(built);
|
|
48
|
+
const diags = check(built, bpmnCheckOpts(argv));
|
|
32
49
|
reportDiagnostics(diags);
|
|
33
50
|
if (graph) {
|
|
34
51
|
// The graph goes to stdout and the diagnostics to stderr, so a reviewer can
|
package/dist/bpmn/check.d.ts
CHANGED
|
@@ -16,10 +16,24 @@
|
|
|
16
16
|
* platform rule it corresponds to and how the two differ.
|
|
17
17
|
*/
|
|
18
18
|
import { type BuiltBpmn } from './bpmn-sdk.js';
|
|
19
|
+
import { type ConnectorCheckOpts } from '../core/connector-checks.js';
|
|
20
|
+
import { type EventCheckOpts } from '../core/event-checks.js';
|
|
19
21
|
export interface Diagnostic {
|
|
20
22
|
level: 'error' | 'warning';
|
|
21
23
|
code: string;
|
|
22
24
|
message: string;
|
|
23
25
|
where?: string;
|
|
24
26
|
}
|
|
25
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The facts this check cannot derive from the built model.
|
|
29
|
+
*
|
|
30
|
+
* Everything here comes from the connector library and the project's
|
|
31
|
+
* `bindings.json`, and every rule that reads one fails OPEN without it: `check`
|
|
32
|
+
* stays the fast inner-loop rung and a BPMN process with no connectors needs no
|
|
33
|
+
* library at all. The CLIs supply the bag (`bpmn/check-cli.ts`), from the same
|
|
34
|
+
* `Library` instance `compile` serializes against, so the two rungs cannot
|
|
35
|
+
* disagree about a field or a binding name.
|
|
36
|
+
*/
|
|
37
|
+
export interface BpmnCheckOpts extends ConnectorCheckOpts, EventCheckOpts {
|
|
38
|
+
}
|
|
39
|
+
export declare function check(built: BuiltBpmn, opts?: BpmnCheckOpts): Diagnostic[];
|
package/dist/bpmn/check.js
CHANGED
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
* platform rule it corresponds to and how the two differ.
|
|
17
17
|
*/
|
|
18
18
|
import { nodeDeclaredVars } from './bpmn-sdk.js';
|
|
19
|
-
import { folderCompanionKeys, implicitNodeVars, processId } from './serialize.js';
|
|
19
|
+
import { allNodes, folderCompanionKeys, implicitNodeVars, processId } from './serialize.js';
|
|
20
20
|
import { KNOWN_METHOD_SET } from './known-methods.js';
|
|
21
|
+
import { EQUALS_EXPR_DIALECT, checkConnectorContract, checkConnectorLookups, checkConnectorSchema, checkBindingLabels, } from '../core/connector-checks.js';
|
|
22
|
+
import { checkEventResolution, checkEventSubscription, eventParamsFor, } from '../core/event-checks.js';
|
|
21
23
|
import { bindingRequiredFields, missingRequiredContext, missingRequiredInputs, registryType, REGISTRY_GAPS, unsatisfiableRequiredInputs, } from './typed-node.js';
|
|
22
24
|
/**
|
|
23
25
|
* Service types the platform expects to name a concrete Orchestrator resource.
|
|
@@ -57,7 +59,7 @@ const GATEWAY_KINDS = new Set(['exclusiveGateway', 'parallelGateway', 'inclusive
|
|
|
57
59
|
* connector's failure is the commonest error-handling shape there is.
|
|
58
60
|
*/
|
|
59
61
|
const ACTIVITY_KINDS = new Set(['task', 'scriptTask', 'subProcess', 'connector', 'typed', 'connectorEvent', 'externalTask']);
|
|
60
|
-
export function check(built) {
|
|
62
|
+
export function check(built, opts = {}) {
|
|
61
63
|
const diags = [];
|
|
62
64
|
if (!built.id)
|
|
63
65
|
diags.push({ level: 'error', code: 'NO_ID', message: 'bpmn() requires an id.' });
|
|
@@ -69,8 +71,73 @@ export function check(built) {
|
|
|
69
71
|
checkFolderBindings(built, diags);
|
|
70
72
|
checkEntryPointId(built, diags);
|
|
71
73
|
checkMethodParentheses(built, diags);
|
|
74
|
+
checkConnectors(built, opts, diags);
|
|
75
|
+
checkConnectorEvents(built, opts, diags);
|
|
72
76
|
return diags;
|
|
73
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The library-backed connector rules, shared with Flow (`core/connector-checks.ts`).
|
|
80
|
+
*
|
|
81
|
+
* BPMN had none of these: a `.connector()` node carrying an unresolved `lookup()`,
|
|
82
|
+
* an object with no materialized schema, or a connection label that answers with
|
|
83
|
+
* its own name reached `compile` unremarked, and the author found out from `uip
|
|
84
|
+
* maestro bpmn validate`, a tenant, or a faulted run. The `skill-bpmn-e2e-
|
|
85
|
+
* customer-escalation-triage` card in `flow-v2-run-8` packed a `bindings_v2.json`
|
|
86
|
+
* carrying the literal strings `jiraConnection` and `slackConnection` where
|
|
87
|
+
* connection ids belong — BINDING_SELF_NAME, had anything been asking.
|
|
88
|
+
*
|
|
89
|
+
* Sub-processes are walked too: a connector inside one resolves against the same
|
|
90
|
+
* library and binds through the same file.
|
|
91
|
+
*/
|
|
92
|
+
function checkConnectors(built, opts, diags) {
|
|
93
|
+
for (const n of allNodes(built.nodes)) {
|
|
94
|
+
if (n.kind !== 'connector')
|
|
95
|
+
continue;
|
|
96
|
+
const where = `Connector task "${n.id}"`;
|
|
97
|
+
const report = (d) => {
|
|
98
|
+
diags.push({ level: d.level, code: d.code, message: d.message, where });
|
|
99
|
+
};
|
|
100
|
+
checkConnectorLookups(where, n, opts, EQUALS_EXPR_DIALECT, report);
|
|
101
|
+
checkConnectorSchema(where, n, opts, EQUALS_EXPR_DIALECT, report);
|
|
102
|
+
checkConnectorContract(where, n, opts, report);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The connector-EVENT rules, shared with Flow (`core/event-checks.ts`).
|
|
107
|
+
*
|
|
108
|
+
* Those functions duck-type the subscription — `{ connector, event, where,
|
|
109
|
+
* object, version, connection }` — so the adapter is naming: BPMN calls the
|
|
110
|
+
* connector `key`, the event `eventName`, and the subscription scope `filter`.
|
|
111
|
+
*
|
|
112
|
+
* `filters` is deliberately absent. Payload filtering is a Flow surface; a BPMN
|
|
113
|
+
* connector event carries none, so the `EVENT_FILTER_*` family never fires here.
|
|
114
|
+
* The rules that do are the ones about the SUBSCRIPTION — whether it resolves at
|
|
115
|
+
* all, whether a generic event named its object, and whether its scope names
|
|
116
|
+
* parameters the operation actually declares. `skill-bpmn-outlook-waitfor-email`
|
|
117
|
+
* in `flow-v2-run-8` failed on that last one.
|
|
118
|
+
*/
|
|
119
|
+
function checkConnectorEvents(built, opts, diags) {
|
|
120
|
+
for (const n of allNodes(built.nodes)) {
|
|
121
|
+
if (n.kind !== 'connectorEvent')
|
|
122
|
+
continue;
|
|
123
|
+
const where = `${n.subscribe === 'trigger' ? 'Event trigger' : 'waitForEvent'} "${n.id}"`;
|
|
124
|
+
const subscription = {
|
|
125
|
+
connector: n.key,
|
|
126
|
+
event: n.eventName,
|
|
127
|
+
...(n.version !== undefined ? { version: n.version } : {}),
|
|
128
|
+
...(n.object !== undefined ? { object: n.object } : {}),
|
|
129
|
+
...(n.filter !== undefined ? { where: n.filter } : {}),
|
|
130
|
+
...(n.connection !== undefined ? { connection: n.connection } : {}),
|
|
131
|
+
};
|
|
132
|
+
const at = (level) => (code, message) => {
|
|
133
|
+
diags.push({ level, code, message, where });
|
|
134
|
+
};
|
|
135
|
+
const params = eventParamsFor(subscription, opts);
|
|
136
|
+
checkEventSubscription(subscription, where, at('error'), at('warning'), params);
|
|
137
|
+
checkEventResolution(subscription, where, n.subscribe, opts, at('error'), at('warning'), params);
|
|
138
|
+
checkBindingLabels(where, n, opts, (code, message) => diags.push({ level: 'error', code, message, where }), { key: n.key, action: n.eventName });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
74
141
|
/**
|
|
75
142
|
* A known method NAMED but not CALLED — `=vars.s.ToUpper` where `ToUpper()` was meant.
|
|
76
143
|
*
|
package/dist/bpmn/compile-cli.js
CHANGED
|
@@ -3,23 +3,28 @@
|
|
|
3
3
|
* compile-cli — <Name>.bpmn.ts → <Name>.bpmn
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
|
-
* node --experimental-strip-types compile-cli.js <bpmn.ts | BaseName> [-o out.bpmn]
|
|
6
|
+
* node --experimental-strip-types compile-cli.js <bpmn.ts | BaseName> [-o out.bpmn] \
|
|
7
|
+
* [--library <library-json dir>] [--connectors-local <overlay dir>] [--bindings <bindings.json>]
|
|
8
|
+
*
|
|
9
|
+
* --library defaults to $FLOW_SDK_LIBRARY_JSON, else the shared cache `registry
|
|
10
|
+
* pull` fills; --connectors-local defaults to ./connectors-local when it has an
|
|
11
|
+
* index.json, the directory `registry prepare` writes; --bindings to
|
|
12
|
+
* ./bindings.json when present.
|
|
7
13
|
*
|
|
8
14
|
* Runs the fast static check first; if it passes, serializes to Maestro `.bpmn`
|
|
9
15
|
* XML (semantic-only — no diagram). The authoritative deploy gate is
|
|
10
16
|
* `uip maestro bpmn validate`; a separate "tidy" step lays the diagram out.
|
|
11
17
|
*/
|
|
12
18
|
import { reportResult } from '../cli-result.js';
|
|
13
|
-
import { writeFileSync
|
|
14
|
-
import { basename,
|
|
19
|
+
import { writeFileSync } from 'node:fs';
|
|
20
|
+
import { basename, resolve } from 'node:path';
|
|
15
21
|
import { resolveBpmnFile, loadBuiltBpmn } from './load.js';
|
|
16
22
|
import { serialize } from './serialize.js';
|
|
17
23
|
import { check } from './check.js';
|
|
18
|
-
import { Library } from '../core/library.js';
|
|
19
24
|
import { Bindings } from '../core/bindings.js';
|
|
25
|
+
import { connectorCheckOpts, openCliLibrary } from '../core/cli-library.js';
|
|
20
26
|
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
21
27
|
import { ensureTypeScriptRuntime } from '../node-runtime.js';
|
|
22
|
-
import { resolveLibraryDir } from '../registry/cache.js';
|
|
23
28
|
import { defaultBindingsFile } from '../workdir.js';
|
|
24
29
|
function opt(argv, name) {
|
|
25
30
|
const i = argv.indexOf(name);
|
|
@@ -27,10 +32,10 @@ function opt(argv, name) {
|
|
|
27
32
|
}
|
|
28
33
|
export async function run(argv) {
|
|
29
34
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
30
|
-
console.error('usage: compile <bpmn.ts | BaseName> [-o out.bpmn]');
|
|
35
|
+
console.error('usage: compile <bpmn.ts | BaseName> [-o out.bpmn] [--library <dir>] [--connectors-local <dir>] [--bindings <file>]');
|
|
31
36
|
return 2;
|
|
32
37
|
}
|
|
33
|
-
const flags = new Set(['-o', '--library', '--bindings']);
|
|
38
|
+
const flags = new Set(['-o', '--library', '--connectors-local', '--bindings']);
|
|
34
39
|
const pos = argv.find((a, i) => !flags.has(a) && !flags.has(argv[i - 1]));
|
|
35
40
|
if (!pos) {
|
|
36
41
|
console.error('compile: missing <bpmn.ts | BaseName>');
|
|
@@ -39,19 +44,24 @@ export async function run(argv) {
|
|
|
39
44
|
const file = resolveBpmnFile(pos);
|
|
40
45
|
ensureTypeScriptRuntime();
|
|
41
46
|
const built = await loadBuiltBpmn(file);
|
|
42
|
-
|
|
47
|
+
// Connector service tasks resolve against the library, through the same helper
|
|
48
|
+
// Flow and Case use — which also picks up the `connectors-local/` overlay that
|
|
49
|
+
// `uip maestro registry prepare` writes. BPMN used to construct the library
|
|
50
|
+
// without it, so a prepare resolved an operation against the live connection,
|
|
51
|
+
// wrote the overlay, and compile ignored it.
|
|
52
|
+
const library = openCliLibrary(argv);
|
|
53
|
+
const bindFile = opt(argv, '--bindings') ?? defaultBindingsFile();
|
|
54
|
+
const bindings = new Bindings(bindFile);
|
|
55
|
+
// The same facts `check-cli` runs on, from the instance about to serialize:
|
|
56
|
+
// the inner loop and the emit rung must not disagree about a field or a
|
|
57
|
+
// binding name, which is only guaranteed if they ask the same library.
|
|
58
|
+
const diags = check(built, connectorCheckOpts(library, bindFile ? bindings : undefined));
|
|
43
59
|
for (const d of diags)
|
|
44
60
|
console.error(` ${d.level === 'error' ? '✗' : '⚠'} [${d.code}] ${d.message}`);
|
|
45
61
|
if (diags.some((d) => d.level === 'error')) {
|
|
46
62
|
console.error(`compile: ${diags.filter((d) => d.level === 'error').length} error(s); not emitting.`);
|
|
47
63
|
return 1;
|
|
48
64
|
}
|
|
49
|
-
// Connector service tasks resolve against the library (like Flow's/Case's
|
|
50
|
-
// compile-cli); load it only when present, and bindings.json alongside the .ts.
|
|
51
|
-
const libDir = resolveLibraryDir(opt(argv, '--library'));
|
|
52
|
-
const library = libDir && existsSync(join(libDir, 'index.json')) ? new Library(libDir) : undefined;
|
|
53
|
-
const bindFile = opt(argv, '--bindings') ?? defaultBindingsFile();
|
|
54
|
-
const bindings = new Bindings(bindFile);
|
|
55
65
|
const xml = await serialize(built, { library, bindings });
|
|
56
66
|
const base = basename(file).replace(/\.bpmn\.ts$|\.ts$/, '');
|
|
57
67
|
const out = opt(argv, '-o') ?? `${base}.bpmn`;
|
package/dist/bpmn/connector.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { connectorOutputVars } from './bpmn-sdk.js';
|
|
2
2
|
import { transportHttpMethod } from '../config.js';
|
|
3
|
-
import {
|
|
3
|
+
import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
|
|
4
|
+
import { buildConnectorInputs } from '../core/connector-inputs.js';
|
|
4
5
|
export function createConnectorTask(ctx, n) {
|
|
5
6
|
const { m } = ctx;
|
|
6
7
|
if (!ctx.library)
|
|
@@ -54,21 +55,35 @@ export function createConnectorTask(ctx, n) {
|
|
|
54
55
|
// resolved field (`operation.parameters` for path/query, the multipart `file` part),
|
|
55
56
|
// and an input the library does not declare goes to the body, where an untagged
|
|
56
57
|
// input has always gone.
|
|
57
|
-
|
|
58
|
+
// The ROUTING is the shared validator's (`core/connector-inputs.ts`), the one
|
|
59
|
+
// Flow's serializer and both families' `check` already run: it reports a missing
|
|
60
|
+
// required field, an unknown or mistyped input, and — the reason BPMN could not
|
|
61
|
+
// keep its own fourteen-line version — swaps a `lookup()` token for the id
|
|
62
|
+
// `registry prepare --resolve` recorded. BPMN used to refuse a token outright,
|
|
63
|
+
// so `skill-bpmn-paginated-reference-lookup` could resolve a Slack channel id
|
|
64
|
+
// and then emit a process that did not carry it. The values need no lowering:
|
|
65
|
+
// a BPMN input is already a plain value or an `=`-expression string.
|
|
66
|
+
const slots = buildConnectorInputs(rc, n.inputs ?? {}, {
|
|
67
|
+
dialect: EQUALS_EXPR_DIALECT,
|
|
68
|
+
resolutions: ctx.library.lookupResolutions,
|
|
69
|
+
lookups: typeof ctx.library.lookupSpecs === 'function'
|
|
70
|
+
? ctx.library.lookupSpecs(n.key, n.action, n.version, n.object)
|
|
71
|
+
: {},
|
|
72
|
+
});
|
|
58
73
|
const paramRows = [];
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
paramRows.push(paramInput(m, name, location, value));
|
|
74
|
+
for (const [name, value] of Object.entries(slots.pathParameters ?? {})) {
|
|
75
|
+
paramRows.push(paramInput(m, name, 'path', value));
|
|
76
|
+
}
|
|
77
|
+
for (const [name, value] of Object.entries(slots.queryParameters ?? {})) {
|
|
78
|
+
paramRows.push(paramInput(m, name, 'query', value));
|
|
79
|
+
}
|
|
80
|
+
// A multipart CONTAINER part is valueless by design — the runtime composes it
|
|
81
|
+
// from the body — so only the parts the author filled become rows.
|
|
82
|
+
for (const part of slots.multipartParameters ?? []) {
|
|
83
|
+
if (part.value !== undefined)
|
|
84
|
+
paramRows.push(paramInput(m, part.name, 'multipart', part.value));
|
|
71
85
|
}
|
|
86
|
+
const body = slots.bodyParameters ?? {};
|
|
72
87
|
// ── outputs — response schema + standard Error ──
|
|
73
88
|
const responseSchema = rc.entry.outputSchema
|
|
74
89
|
? schemaFromFields(rc.entry.outputSchema.fields ?? [])
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { reportResult } from '../cli-result.js';
|
|
25
25
|
import { typeStripDecision } from '../node-runtime.js';
|
|
26
|
-
import { readFileSync
|
|
26
|
+
import { readFileSync } from 'node:fs';
|
|
27
27
|
import { basename, resolve } from 'node:path';
|
|
28
|
-
import { defaultSourceOut } from '../workdir.js';
|
|
28
|
+
import { defaultSourceOut, writeSource } from '../workdir.js';
|
|
29
29
|
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
30
30
|
import { decompile } from './decompile.js';
|
|
31
31
|
import { sameGraph } from './lift-verify.js';
|
|
@@ -104,7 +104,7 @@ export async function run(argv) {
|
|
|
104
104
|
}
|
|
105
105
|
const base = basename(input).replace(/\.bpmn$/, '');
|
|
106
106
|
const out = opt(argv, '-o') ?? defaultSourceOut(`${base}.bpmn.ts`);
|
|
107
|
-
|
|
107
|
+
writeSource(out, source);
|
|
108
108
|
console.log(`decompile: wrote ${out}`);
|
|
109
109
|
if (pruned.length) {
|
|
110
110
|
// Never silent: these are declarations the source had and the output does not.
|
package/dist/bpmn/intsvc.js
CHANGED
|
@@ -58,7 +58,7 @@ export function createConnectorEvent(ctx, n) {
|
|
|
58
58
|
if (!ctx.library)
|
|
59
59
|
throw new Error(`connector event "${n.id}" needs the connector library — pass { library } to serialize ` +
|
|
60
60
|
`or use uip maestro bpmn compile --library.`);
|
|
61
|
-
const rc = ctx.library.resolveEvent(n.subscribe, n.key, n.eventName, n.version);
|
|
61
|
+
const rc = ctx.library.resolveEvent(n.subscribe, n.key, n.eventName, n.version, n.object);
|
|
62
62
|
const op = (rc.entry.operation ?? {});
|
|
63
63
|
const runtime = rc.entry.runtime ?? {};
|
|
64
64
|
const type = runtime.serviceType;
|
|
@@ -91,7 +91,10 @@ export function createConnectorEvent(ctx, n) {
|
|
|
91
91
|
folderPath: n.folderPath ?? '/Shared',
|
|
92
92
|
folderKey: `=bindings.${folder.id}`,
|
|
93
93
|
operation: op.eventOperation ?? '',
|
|
94
|
-
|
|
94
|
+
// A GENERIC event's library entry names no object — the author's is the only
|
|
95
|
+
// one there is, and without it the node emits `objectName: ""`, validates,
|
|
96
|
+
// and watches nothing. A curated entry carries its own and the author passes none.
|
|
97
|
+
objectName: n.object ?? op.objectName ?? '',
|
|
95
98
|
};
|
|
96
99
|
if (n.filter !== undefined)
|
|
97
100
|
inputs.filter = n.filter;
|
package/dist/bpmn/serialize.d.ts
CHANGED
|
@@ -90,3 +90,5 @@ export declare function folderCompanionKeys(built: BuiltBpmn, sink: Map<string,
|
|
|
90
90
|
* An explicit `elementId` always wins, and `null` still means "write none".
|
|
91
91
|
*/
|
|
92
92
|
export declare function publicDeclarationScope(nodes: BpmnNode[], processId: string): (v: BpmnVarDecl) => string;
|
|
93
|
+
/** Flatten a scope's nodes (recursing sub-processes) for global scans. */
|
|
94
|
+
export declare function allNodes(nodes: BpmnNode[]): BpmnNode[];
|
package/dist/bpmn/serialize.js
CHANGED
|
@@ -932,7 +932,7 @@ function isIntsvcConnectorNode(n) {
|
|
|
932
932
|
return n.kind === 'typed' && (n.type === 'Intsvc.ActivityExecution' || n.type === 'Intsvc.AsyncExecution');
|
|
933
933
|
}
|
|
934
934
|
/** Flatten a scope's nodes (recursing sub-processes) for global scans. */
|
|
935
|
-
function allNodes(nodes) {
|
|
935
|
+
export function allNodes(nodes) {
|
|
936
936
|
const out = [];
|
|
937
937
|
for (const n of nodes) {
|
|
938
938
|
out.push(n);
|
package/dist/case/compile-cli.js
CHANGED
|
@@ -17,10 +17,9 @@ import { resolveCaseFile, loadBuiltCase } from './load.js';
|
|
|
17
17
|
import { serialize } from './serialize.js';
|
|
18
18
|
import { check } from './check.js';
|
|
19
19
|
import { entryPointIO } from './entry-points.js';
|
|
20
|
-
import { Library } from '../core/library.js';
|
|
21
20
|
import { Bindings } from '../core/bindings.js';
|
|
22
|
-
import {
|
|
23
|
-
import { defaultBindingsFile
|
|
21
|
+
import { openCliLibrary } from '../core/cli-library.js';
|
|
22
|
+
import { defaultBindingsFile } from '../workdir.js';
|
|
24
23
|
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
25
24
|
import { ensureTypeScriptRuntime } from '../node-runtime.js';
|
|
26
25
|
import { CASE_FORMAT_PROFILE } from './format-profile.js';
|
|
@@ -54,12 +53,10 @@ export async function run(argv) {
|
|
|
54
53
|
// bindings.json from alongside the case when present. Resolved through the same
|
|
55
54
|
// helper Flow and BPMN use, so `registry pull` serves all three families —
|
|
56
55
|
// reading the env directly skipped the shared cache, and a Case that compiled
|
|
57
|
-
// fine right after a pull on Flow failed here for no visible reason.
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
const
|
|
61
|
-
?? defaultOverlayDir();
|
|
62
|
-
const library = libDir && existsSync(join(libDir, 'index.json')) ? new Library(libDir, { overlayDir }) : undefined;
|
|
56
|
+
// fine right after a pull on Flow failed here for no visible reason. The helper
|
|
57
|
+
// also auto-detects the `connectors-local/` overlay `registry prepare` writes,
|
|
58
|
+
// which is what the three copies of these lines used to each decide for itself.
|
|
59
|
+
const library = openCliLibrary(argv);
|
|
63
60
|
const bindFile = opt(argv, '--bindings') ?? defaultBindingsFile();
|
|
64
61
|
const bindings = new Bindings(bindFile);
|
|
65
62
|
const caseplan = serialize(built, { library, bindings });
|
|
@@ -19,7 +19,7 @@ import { reportResult } from '../cli-result.js';
|
|
|
19
19
|
import { mkdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
20
20
|
import { resolveLibraryDir } from '../registry/cache.js';
|
|
21
21
|
import { basename, join, resolve } from 'node:path';
|
|
22
|
-
import { defaultSourceOut, workDirBeside } from '../workdir.js';
|
|
22
|
+
import { defaultSourceOut, workDirBeside, writeSource } from '../workdir.js';
|
|
23
23
|
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
24
24
|
import { Library } from '../core/library.js';
|
|
25
25
|
import { decompileWithDiagnostics } from './decompile.js';
|
|
@@ -66,7 +66,7 @@ export function run(argv) {
|
|
|
66
66
|
bestEffort,
|
|
67
67
|
});
|
|
68
68
|
const out = opt(argv, '-o') ?? defaultSourceOut(`${baseName(plan)}.case.ts`);
|
|
69
|
-
|
|
69
|
+
writeSource(out, result.source);
|
|
70
70
|
console.log(`decompile: wrote ${basename(out)}`);
|
|
71
71
|
reportResult({ path: resolve(out), diagnostics: result.diagnostics.map((d) => ({ code: d.code, location: d.location, message: d.message })) });
|
|
72
72
|
for (const diagnostic of result.diagnostics) {
|
package/dist/case/serialize.js
CHANGED
|
@@ -14,7 +14,7 @@ import { refuseLookupToken } from '../core/lookups.js';
|
|
|
14
14
|
import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS } from './format-profile.js';
|
|
15
15
|
import { resolveSchemaVersion } from '../schema-version.js';
|
|
16
16
|
import { caseJsonPreservation, caseJsonPreservationErrors, } from './preserve.js';
|
|
17
|
-
import { readEventFilter, eventFilterProblem, eventFilterTreeLeaf } from '../event-filters.js';
|
|
17
|
+
import { readEventFilter, eventFilterProblem, eventFilterTreeLeaf } from '../core/event-filters.js';
|
|
18
18
|
/**
|
|
19
19
|
* Condition `displayName` allocator.
|
|
20
20
|
*
|
package/dist/check-cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import { reportDiagnostics } from './cli-result.js';
|
|
|
9
9
|
import { defaultBindingsFile } from './workdir.js';
|
|
10
10
|
import { resolveFlowFile, loadBuiltFlow } from './load.js';
|
|
11
11
|
import { check } from './check.js';
|
|
12
|
-
import {
|
|
12
|
+
import { connectorCheckOpts, openCliLibrary } from './core/cli-library.js';
|
|
13
13
|
import { Bindings } from './bindings.js';
|
|
14
14
|
import { connectorInputErrors } from './serialize.js';
|
|
15
15
|
import { runWhenInvokedDirectly } from './cli-run.js';
|
|
@@ -37,41 +37,13 @@ function checkOpts(argv) {
|
|
|
37
37
|
// lives in it, and without it every already-resolved lookup would be reported
|
|
38
38
|
// as still owed — telling the author to re-run a `prepare` they already ran.
|
|
39
39
|
const library = openCliLibrary(argv);
|
|
40
|
+
// The connector and event hooks are the shared bag every family fills
|
|
41
|
+
// (`core/cli-library.ts`); what Flow adds is the one hook only it has a site for.
|
|
42
|
+
const shared = connectorCheckOpts(library, bindings);
|
|
40
43
|
if (!library)
|
|
41
|
-
return
|
|
44
|
+
return shared;
|
|
42
45
|
return {
|
|
43
|
-
|
|
44
|
-
...byoaCheckOpts(library),
|
|
45
|
-
eventParams: (connector, event, object) => {
|
|
46
|
-
try {
|
|
47
|
-
return library.eventParameterFields(connector, event, object);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
// An unresolvable operation is EVENT_UNKNOWN's business, reported from
|
|
51
|
-
// `eventResolveError` above; here it just means "unknown".
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
eventFilterFields: (connector, event, object) => {
|
|
56
|
-
try {
|
|
57
|
-
return library.eventFilterFields(connector, event, object);
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
return undefined; // unknown fails open, same as every callback here
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
lookups: (connector, action, version, object) => library.lookupSpecs(connector, action, version, object),
|
|
64
|
-
resolutions: library.lookupResolutions,
|
|
65
|
-
schemaReadiness: (connector, action, version, object) => {
|
|
66
|
-
try {
|
|
67
|
-
return library.schemaReadiness(connector, action, version, object);
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
// An unreadable entry means "unknown", and unknown fails open — the
|
|
71
|
-
// same rule as every other callback here.
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
|
-
},
|
|
46
|
+
...shared,
|
|
75
47
|
listEnvelope: (connector, operation, version, object) => {
|
|
76
48
|
try {
|
|
77
49
|
return library.resolve(connector, operation, version, object).listEnvelope;
|
|
@@ -91,7 +63,6 @@ function checkOpts(argv) {
|
|
|
91
63
|
return undefined;
|
|
92
64
|
}
|
|
93
65
|
},
|
|
94
|
-
...(bindings ? { bindings } : {}),
|
|
95
66
|
};
|
|
96
67
|
}
|
|
97
68
|
export async function run(argv) {
|