@uipath/maestro-builder-sdk 6.17.6 → 6.18.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/bindings-v2.js +15 -17
- package/dist/bpmn/bpmn-sdk.js +3 -2
- package/dist/bpmn/check.js +3 -2
- package/dist/bpmn/decompile.js +123 -137
- package/dist/bpmn/intsvc.js +7 -2
- package/dist/bpmn/serialize.js +1 -1
- package/dist/bpmn/typed-node.js +5 -4
- package/dist/case/check-cli.js +18 -4
- package/dist/case/check.d.ts +26 -1
- package/dist/case/check.js +80 -2
- package/dist/case/cli-library.d.ts +14 -0
- package/dist/case/cli-library.js +31 -0
- package/dist/case/compile-cli.js +12 -12
- package/dist/case/decompile.js +103 -109
- package/dist/case/entry-points.js +2 -1
- package/dist/case/merge.js +3 -5
- package/dist/case/serialize.js +1 -1
- package/dist/check.js +26 -10
- package/dist/cli/commands/case.js +10 -1
- package/dist/core/ceql.js +5 -2
- package/dist/core/connector-inputs.js +4 -4
- package/dist/core/event-checks.js +17 -2
- package/dist/core/event-filters.d.ts +38 -4
- package/dist/core/event-filters.js +63 -7
- package/dist/core/expr.d.ts +1 -1
- package/dist/core/expr.js +3 -3
- package/dist/core/json-file.d.ts +2 -0
- package/dist/core/json-file.js +4 -0
- package/dist/core/library.js +2 -1
- package/dist/core/node-envelope.d.ts +1 -0
- package/dist/core/node-envelope.js +1 -1
- package/dist/core/own-entry.d.ts +9 -0
- package/dist/core/own-entry.js +11 -0
- package/dist/core/ts-literal.d.ts +22 -0
- package/dist/core/ts-literal.js +37 -0
- package/dist/core/typed-raw-node.js +4 -3
- package/dist/decompile.js +238 -255
- package/dist/merge.js +10 -12
- package/dist/registry/compat/pystr.d.ts +2 -0
- package/dist/registry/compat/pystr.js +35 -0
- package/dist/registry/compat/pyvalue.d.ts +16 -0
- package/dist/registry/compat/pyvalue.js +35 -0
- package/dist/registry/generators/markdown/pyvalue.d.ts +1 -4
- package/dist/registry/generators/markdown/pyvalue.js +2 -30
- package/dist/registry/generators/markdown/sections/inputs.js +3 -2
- package/dist/registry/generators/type-tree.d.ts +1 -7
- package/dist/registry/generators/type-tree.js +5 -22
- package/dist/registry/library-build/build.js +6 -6
- package/dist/registry/library-build/canonical.js +25 -25
- package/dist/registry/library-build/context.js +5 -5
- package/dist/registry/library-build/enrich.js +18 -18
- package/dist/registry/library-build/events.js +25 -24
- package/dist/registry/library-build/generic-expand.js +21 -20
- package/dist/registry/library-build/plan.js +8 -8
- package/dist/registry/library-build/py.d.ts +3 -10
- package/dist/registry/library-build/py.js +9 -52
- package/dist/registry/library-build/schema-action.js +6 -6
- package/dist/registry/prepare/event.js +2 -2
- package/dist/registry/prepare/source-import.js +2 -9
- package/dist/registry/prepare/source-labels.js +2 -9
- package/dist/registry/prepare/support.d.ts +2 -6
- package/dist/registry/prepare/support.js +3 -58
- package/dist/registry/pull-cli.js +6 -14
- package/dist/registry/search-cli.js +2 -2
- package/dist/schema-version.js +0 -1
- package/dist/serialize.js +86 -76
- package/package.json +2 -2
package/dist/bpmn/intsvc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTypedNode, typedNodeOutputVar } from './typed-node.js';
|
|
2
2
|
import { connectorBindingRef } from './connector.js';
|
|
3
|
-
import { eventFilterJmes, eventFilterProblem, readEventFilter } from '../core/event-filters.js';
|
|
3
|
+
import { eventFilterJmes, eventFilterProblem, jmesString, jmesStringProblem, readEventFilter } from '../core/event-filters.js';
|
|
4
4
|
/**
|
|
5
5
|
* Which extension type an external invocation lowers to.
|
|
6
6
|
*
|
|
@@ -128,7 +128,12 @@ export function createConnectorEvent(ctx, n) {
|
|
|
128
128
|
*/
|
|
129
129
|
export function eventFilterBody(nodeId, scope, filters) {
|
|
130
130
|
const scopeEntries = Object.entries(scope ?? {}).filter(([, v]) => v !== undefined && v !== null && String(v) !== '');
|
|
131
|
-
const scopeClauses = scopeEntries.map(([k, v]) =>
|
|
131
|
+
const scopeClauses = scopeEntries.map(([k, v]) => {
|
|
132
|
+
const problem = jmesStringProblem(String(v));
|
|
133
|
+
if (problem)
|
|
134
|
+
throw new Error(`connector event "${nodeId}": \`filter.${k}\`: ${problem}`);
|
|
135
|
+
return `(${k} == ${jmesString(String(v))})`;
|
|
136
|
+
});
|
|
132
137
|
const conditions = (filters ?? []).map((leaf, i) => {
|
|
133
138
|
const { read } = readEventFilter(leaf);
|
|
134
139
|
if (!read) {
|
package/dist/bpmn/serialize.js
CHANGED
|
@@ -456,7 +456,7 @@ export const SCRIPT_ARGS_ENVELOPE = { vars: '=vars', metadata: '=metadata' };
|
|
|
456
456
|
export function defaultScriptInputSchema(args) {
|
|
457
457
|
const properties = {};
|
|
458
458
|
for (const k of Object.keys(args))
|
|
459
|
-
properties[k] = k
|
|
459
|
+
properties[k] = Object.hasOwn(SCRIPT_ARGS_ENVELOPE, k) ? { type: 'object' } : {};
|
|
460
460
|
return { type: 'object', properties };
|
|
461
461
|
}
|
|
462
462
|
function createScriptTask(ctx, n) {
|
package/dist/bpmn/typed-node.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createRequire } from 'node:module';
|
|
|
2
2
|
import { resolveFromRegistry } from './registry-fallback.js';
|
|
3
3
|
import { nestConnectorBody } from '../core/connector-inputs.js';
|
|
4
4
|
import { types } from '../core/expr.js';
|
|
5
|
+
import { ownEntry } from '../core/own-entry.js';
|
|
5
6
|
const require = createRequire(import.meta.url);
|
|
6
7
|
const REGISTRY = require('./registry-types.json');
|
|
7
8
|
/** Every extension type in the snapshot, sorted. */
|
|
@@ -270,10 +271,10 @@ function contextRows(m, type, spec, supplied, verbatim = false) {
|
|
|
270
271
|
// platform is known to accept fields the registry omits.
|
|
271
272
|
const known = new Set([
|
|
272
273
|
...spec.context.map((f) => f.name),
|
|
273
|
-
...(REGISTRY_GAPS
|
|
274
|
+
...(ownEntry(REGISTRY_GAPS, type)?.extraContext ?? []),
|
|
274
275
|
// A field the platform REQUIRES is necessarily one it permits, so recording it as
|
|
275
276
|
// required is enough — an `extraContext` twin is not also needed.
|
|
276
|
-
...(REGISTRY_GAPS
|
|
277
|
+
...(ownEntry(REGISTRY_GAPS, type)?.requiredContext ?? []),
|
|
277
278
|
]);
|
|
278
279
|
const unknown = Object.keys(supplied).filter((k) => !known.has(k));
|
|
279
280
|
if (unknown.length) {
|
|
@@ -669,7 +670,7 @@ export function missingRequiredContext(type, context = {}, inline) {
|
|
|
669
670
|
.context.filter((f) => f.required && unset(f.name) && (f.default ?? '') === '')
|
|
670
671
|
.map((f) => f.name);
|
|
671
672
|
// Fields the platform requires that the snapshot does not — see `REGISTRY_GAPS`.
|
|
672
|
-
const gaps = (REGISTRY_GAPS
|
|
673
|
+
const gaps = (ownEntry(REGISTRY_GAPS, type)?.requiredContext ?? []).filter((name) => !declared.includes(name) && unset(name));
|
|
673
674
|
return [...declared, ...gaps];
|
|
674
675
|
}
|
|
675
676
|
/**
|
|
@@ -697,7 +698,7 @@ export function missingRequiredInputs(type, inputs = {},
|
|
|
697
698
|
* agree with the CLI instead of guessing on either side of it.
|
|
698
699
|
*/
|
|
699
700
|
context = {}, inline) {
|
|
700
|
-
const notEnforced = new Set(REGISTRY_GAPS
|
|
701
|
+
const notEnforced = new Set(ownEntry(REGISTRY_GAPS, type)?.notEnforcedInputs ?? []);
|
|
701
702
|
return registryType(type, inline)
|
|
702
703
|
.inputs.filter((f) => f.required &&
|
|
703
704
|
!notEnforced.has(f.name) &&
|
package/dist/case/check-cli.js
CHANGED
|
@@ -2,23 +2,37 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* check-cli — fast static validation of <Name>.case.ts (no output file).
|
|
4
4
|
*
|
|
5
|
-
* Usage: node --experimental-strip-types check-cli.js <case.ts | BaseName>
|
|
5
|
+
* Usage: node --experimental-strip-types check-cli.js <case.ts | BaseName> \
|
|
6
|
+
* [--library <library-json dir>] [--connectors-local <overlay dir>]
|
|
6
7
|
* Exits 0 when clean (warnings allowed), 1 on any error.
|
|
8
|
+
*
|
|
9
|
+
* The library is opened exactly as `compile-cli` opens it (`openCliLibrary`), so
|
|
10
|
+
* a connector task `compile` cannot resolve fails here first (#1014).
|
|
7
11
|
*/
|
|
8
12
|
import { reportDiagnostics } from '../cli-result.js';
|
|
9
13
|
import { resolveCaseFile, loadBuiltCase } from './load.js';
|
|
10
14
|
import { check } from './check.js';
|
|
15
|
+
import { caseCheckOpts } from './cli-library.js';
|
|
16
|
+
import { openCliLibrary } from '../core/cli-library.js';
|
|
11
17
|
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
12
18
|
import { ensureTypeScriptRuntime } from '../node-runtime.js';
|
|
19
|
+
/** Flags that take a value: their argument is never the source positional. */
|
|
20
|
+
const VALUE_FLAGS = new Set(['--library', '--connectors-local']);
|
|
21
|
+
const USAGE = 'usage: check <case.ts | BaseName> [--library <dir>] [--connectors-local <dir>]';
|
|
13
22
|
export async function run(argv) {
|
|
14
23
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
15
|
-
console.error(
|
|
24
|
+
console.error(USAGE);
|
|
25
|
+
return 2;
|
|
26
|
+
}
|
|
27
|
+
const input = argv.find((a, i) => !a.startsWith('--') && !VALUE_FLAGS.has(argv[i - 1]));
|
|
28
|
+
if (input === undefined) {
|
|
29
|
+
console.error(USAGE);
|
|
16
30
|
return 2;
|
|
17
31
|
}
|
|
18
|
-
const file = resolveCaseFile(
|
|
32
|
+
const file = resolveCaseFile(input);
|
|
19
33
|
ensureTypeScriptRuntime();
|
|
20
34
|
const built = await loadBuiltCase(file);
|
|
21
|
-
const diags = check(built);
|
|
35
|
+
const diags = check(built, caseCheckOpts(openCliLibrary(argv)));
|
|
22
36
|
reportDiagnostics(diags);
|
|
23
37
|
for (const d of diags)
|
|
24
38
|
console.error(` ${d.level === 'error' ? '✗' : '⚠'} [${d.code}] ${d.message}`);
|
package/dist/case/check.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* `uip maestro case validate` / `@uipath/case-schema` on the emitted file.
|
|
9
9
|
*/
|
|
10
10
|
import type { BuiltCase } from './case-sdk.js';
|
|
11
|
+
import { type ConnectorCheckOpts } from '../core/connector-checks.js';
|
|
12
|
+
import type { EventCheckOpts } from '../core/event-checks.js';
|
|
11
13
|
export interface Diagnostic {
|
|
12
14
|
level: 'error' | 'warning';
|
|
13
15
|
code: string;
|
|
@@ -15,4 +17,27 @@ export interface Diagnostic {
|
|
|
15
17
|
where?: string;
|
|
16
18
|
suggestion?: string;
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The connector-library facts Case `check` reads, from the same `Library`
|
|
22
|
+
* instance `compile` serializes against (`caseCheckOpts` in `./cli-library.ts`).
|
|
23
|
+
*
|
|
24
|
+
* Deliberately NARROWER than Flow's and BPMN's bag. An error here must be a
|
|
25
|
+
* refusal Case `compile` actually makes, and Case `serialize` resolves the
|
|
26
|
+
* connector operation and the event (`library.resolve` / `resolveEvent`) but does
|
|
27
|
+
* not validate connector inputs, binding labels or BYOA. Those rules stay off
|
|
28
|
+
* until Case compile enforces them; passing them here would refuse sources that
|
|
29
|
+
* compile accepts.
|
|
30
|
+
*
|
|
31
|
+
* Every hook fails open: without a library, `check` stays a pure function of the
|
|
32
|
+
* built model.
|
|
33
|
+
*/
|
|
34
|
+
export type CaseCheckOpts = Pick<ConnectorCheckOpts, 'connectorResolveError' | 'schemaReadiness'> & Pick<EventCheckOpts, 'eventResolveError'>;
|
|
35
|
+
/**
|
|
36
|
+
* Validate a built case.
|
|
37
|
+
*
|
|
38
|
+
* @param built - The case `casePlan(...).build()` returned.
|
|
39
|
+
* @param opts - Connector-library facts (see {@link CaseCheckOpts}); omit them to
|
|
40
|
+
* check only the model itself.
|
|
41
|
+
* @returns Every diagnostic found; any `error` means `compile` refuses the case.
|
|
42
|
+
*/
|
|
43
|
+
export declare function check(built: BuiltCase, opts?: CaseCheckOpts): Diagnostic[];
|
package/dist/case/check.js
CHANGED
|
@@ -2,13 +2,21 @@ import { types } from '../core/expr.js';
|
|
|
2
2
|
import { authoredCaseVersion, CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS } from './format-profile.js';
|
|
3
3
|
import { schemaVersionRefusal } from '../schema-version.js';
|
|
4
4
|
import { caseJsonPreservation, caseJsonPreservationErrors } from './preserve.js';
|
|
5
|
+
import { EQUALS_EXPR_DIALECT, checkConnectorContract, checkConnectorSchema, } from '../core/connector-checks.js';
|
|
5
6
|
const TYPE_NAMES = new Set(Object.values(types));
|
|
6
7
|
// audit-case-coverage: rule-slot table start
|
|
7
8
|
// This runtime table must equal the committed matrix's rejected cells. The audit
|
|
8
9
|
// parses these object literals; the product-pin matrix currently rejects none.
|
|
9
10
|
const ILLEGAL = [];
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Validate a built case.
|
|
13
|
+
*
|
|
14
|
+
* @param built - The case `casePlan(...).build()` returned.
|
|
15
|
+
* @param opts - Connector-library facts (see {@link CaseCheckOpts}); omit them to
|
|
16
|
+
* check only the model itself.
|
|
17
|
+
* @returns Every diagnostic found; any `error` means `compile` refuses the case.
|
|
18
|
+
*/
|
|
19
|
+
export function check(built, opts = {}) {
|
|
12
20
|
const diags = [];
|
|
13
21
|
for (const message of caseJsonPreservationErrors(caseJsonPreservation(built)))
|
|
14
22
|
diags.push({
|
|
@@ -252,8 +260,78 @@ export function check(built) {
|
|
|
252
260
|
refStage(r, 'case-exit');
|
|
253
261
|
refPlacement(r, 'case-exit', 'case-exit');
|
|
254
262
|
}
|
|
263
|
+
checkLibraryConnectors(built, opts, diags);
|
|
255
264
|
return diags;
|
|
256
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* The connector-library rules (#1014): every place Case `serialize` resolves a
|
|
268
|
+
* connector against the library, checked with the same call and the same text.
|
|
269
|
+
*
|
|
270
|
+
* - a connector task and an External Agent / External Workflow task resolve
|
|
271
|
+
* their operation (`library.resolve`): CONNECTOR_NOT_IN_LIBRARY,
|
|
272
|
+
* CONNECTOR_OBJECT_REQUIRED, CONNECTOR_OBJECT_NOT_GENERIC;
|
|
273
|
+
* - an event trigger, a wait-for-connector task and a wait-for-connector rule
|
|
274
|
+
* resolve their subscription (`library.resolveEvent`): EVENT_UNKNOWN.
|
|
275
|
+
*
|
|
276
|
+
* A connector task also gets the schema-readiness warnings, because the
|
|
277
|
+
* `connectors-local` overlay `registry prepare` writes is what Case compile
|
|
278
|
+
* resolves against too.
|
|
279
|
+
*/
|
|
280
|
+
function checkLibraryConnectors(built, opts, diags) {
|
|
281
|
+
const reporter = (_where, at) => (d) => {
|
|
282
|
+
diags.push({ level: d.level, code: d.code, message: d.message, where: at, ...(d.suggestion ? { suggestion: d.suggestion } : {}) });
|
|
283
|
+
};
|
|
284
|
+
const subscription = (kind, sub, where, at) => {
|
|
285
|
+
// Exactly the arguments `resolvedSubscriptionBag` passes to `resolveEvent`.
|
|
286
|
+
// It passes no `object` (a Case compile gap, tracked separately), so neither
|
|
287
|
+
// does this: check must refuse what compile refuses, no more.
|
|
288
|
+
const unresolved = opts.eventResolveError?.(kind, {
|
|
289
|
+
connector: sub.connector,
|
|
290
|
+
event: sub.event,
|
|
291
|
+
...(sub.version !== undefined ? { version: sub.version } : {}),
|
|
292
|
+
});
|
|
293
|
+
if (unresolved !== undefined)
|
|
294
|
+
diags.push({ level: 'error', code: 'EVENT_UNKNOWN', message: `${where}: ${unresolved}`, where: at });
|
|
295
|
+
};
|
|
296
|
+
const rules = (conditions, where) => {
|
|
297
|
+
for (const c of conditions)
|
|
298
|
+
for (const g of c.rules)
|
|
299
|
+
for (const r of g)
|
|
300
|
+
if (r.rule === 'wait-for-connector' && isSubscription(r.connector))
|
|
301
|
+
subscription('event', r.connector, `wait-for-connector rule in ${where}`, where);
|
|
302
|
+
};
|
|
303
|
+
built.triggers.forEach((t, i) => {
|
|
304
|
+
if (t.kind !== 'event' || !t.eventSubscription)
|
|
305
|
+
return;
|
|
306
|
+
const name = t.name ?? `Trigger ${i + 1}`;
|
|
307
|
+
subscription('trigger', t.eventSubscription, `Event trigger "${name}"`, name);
|
|
308
|
+
});
|
|
309
|
+
for (const stage of built.stages) {
|
|
310
|
+
rules(stage.entry, `stage "${stage.label}" entry`);
|
|
311
|
+
rules(stage.exit, `stage "${stage.label}" exit`);
|
|
312
|
+
for (const t of stage.lanes.flat()) {
|
|
313
|
+
rules(t.entry, `task "${t.name}" entry`);
|
|
314
|
+
if (t.kind === 'connector' && t.connector) {
|
|
315
|
+
const where = `Connector task "${t.name}"`;
|
|
316
|
+
const spec = t.connector;
|
|
317
|
+
checkConnectorSchema(where, spec, opts, EQUALS_EXPR_DIALECT, reporter(where, t.name));
|
|
318
|
+
checkConnectorContract(where, spec, opts, reporter(where, t.name));
|
|
319
|
+
}
|
|
320
|
+
if ((t.kind === 'external-agent' || t.kind === 'external-workflow')
|
|
321
|
+
&& t.external?.connector?.key?.trim() && t.external.connector.action?.trim()) {
|
|
322
|
+
const where = `${t.kind === 'external-agent' ? 'External Agent' : 'External Workflow'} task "${t.name}"`;
|
|
323
|
+
checkConnectorContract(where, t.external.connector, opts, reporter(where, t.name));
|
|
324
|
+
}
|
|
325
|
+
if (t.kind === 'wait-for-connector' && isSubscription(t.waitConnector))
|
|
326
|
+
subscription('event', t.waitConnector, `Wait-for-connector task "${t.name}"`, t.name);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
rules(built.caseExit, 'case exit');
|
|
330
|
+
}
|
|
331
|
+
/** A resolved subscription, not a placeholder; the test `serialize`'s `isResolvedSubscription` makes. */
|
|
332
|
+
function isSubscription(spec) {
|
|
333
|
+
return !!spec && typeof spec === 'object' && 'connector' in spec && 'event' in spec;
|
|
334
|
+
}
|
|
257
335
|
/**
|
|
258
336
|
* SLA guardrails surfaced early: zero at-risk percentages that the engine
|
|
259
337
|
* coerces to 100, empty recipient lists, and deadlines with no escalations.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Library } from '../core/library.js';
|
|
2
|
+
import type { CaseCheckOpts } from './check.js';
|
|
3
|
+
/**
|
|
4
|
+
* Case's check options from a library the CLI already opened, or `{}` without one.
|
|
5
|
+
*
|
|
6
|
+
* Only the hooks for refusals Case `compile` makes (see {@link CaseCheckOpts}):
|
|
7
|
+
* the operation and event resolution, and the schema-readiness warnings. The
|
|
8
|
+
* field-contract, binding-label and BYOA hooks of the shared bag are left out,
|
|
9
|
+
* because Case `serialize` does not enforce them.
|
|
10
|
+
*
|
|
11
|
+
* @param library - The library `openCliLibrary` returned, or `undefined`.
|
|
12
|
+
* @returns The options for Case `check`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function caseCheckOpts(library: Library | undefined): CaseCheckOpts;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* case/cli-library — Case's check options, built from the shared connector hooks.
|
|
3
|
+
*
|
|
4
|
+
* `case check` took no options at all, so a connector task naming an operation
|
|
5
|
+
* the library does not carry passed `check` and failed at `compile` (#1014).
|
|
6
|
+
* Flow and BPMN read their connector facts from `connectorCheckOpts`
|
|
7
|
+
* (`core/cli-library.ts`); Case now does too, through this one builder, which
|
|
8
|
+
* both `case check` and `case compile`'s check pass call.
|
|
9
|
+
*/
|
|
10
|
+
import { connectorCheckOpts } from '../core/cli-library.js';
|
|
11
|
+
/**
|
|
12
|
+
* Case's check options from a library the CLI already opened, or `{}` without one.
|
|
13
|
+
*
|
|
14
|
+
* Only the hooks for refusals Case `compile` makes (see {@link CaseCheckOpts}):
|
|
15
|
+
* the operation and event resolution, and the schema-readiness warnings. The
|
|
16
|
+
* field-contract, binding-label and BYOA hooks of the shared bag are left out,
|
|
17
|
+
* because Case `serialize` does not enforce them.
|
|
18
|
+
*
|
|
19
|
+
* @param library - The library `openCliLibrary` returned, or `undefined`.
|
|
20
|
+
* @returns The options for Case `check`.
|
|
21
|
+
*/
|
|
22
|
+
export function caseCheckOpts(library) {
|
|
23
|
+
if (!library)
|
|
24
|
+
return {};
|
|
25
|
+
const shared = connectorCheckOpts(library);
|
|
26
|
+
return {
|
|
27
|
+
connectorResolveError: shared.connectorResolveError,
|
|
28
|
+
schemaReadiness: shared.schemaReadiness,
|
|
29
|
+
eventResolveError: shared.eventResolveError,
|
|
30
|
+
};
|
|
31
|
+
}
|
package/dist/case/compile-cli.js
CHANGED
|
@@ -16,6 +16,7 @@ import { join, dirname, basename, resolve } from 'node:path';
|
|
|
16
16
|
import { resolveCaseFile, loadBuiltCase } from './load.js';
|
|
17
17
|
import { serialize } from './serialize.js';
|
|
18
18
|
import { check } from './check.js';
|
|
19
|
+
import { caseCheckOpts } from './cli-library.js';
|
|
19
20
|
import { entryPointIO } from './entry-points.js';
|
|
20
21
|
import { Bindings } from '../core/bindings.js';
|
|
21
22
|
import { openCliLibrary } from '../core/cli-library.js';
|
|
@@ -24,6 +25,7 @@ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
|
24
25
|
import { ensureTypeScriptRuntime } from '../node-runtime.js';
|
|
25
26
|
import { CASE_FORMAT_PROFILE } from './format-profile.js';
|
|
26
27
|
import { sha256Uuid } from '../core/stable-id.js';
|
|
28
|
+
import { isRecord } from '../core/node-envelope.js';
|
|
27
29
|
export async function run(argv) {
|
|
28
30
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
29
31
|
console.error('usage: compile <case.ts | BaseName> [-o caseplan.json]');
|
|
@@ -38,7 +40,16 @@ export async function run(argv) {
|
|
|
38
40
|
const file = resolveCaseFile(pos);
|
|
39
41
|
ensureTypeScriptRuntime();
|
|
40
42
|
const built = await loadBuiltCase(file);
|
|
41
|
-
|
|
43
|
+
// Connector tasks resolve against the library; load it only when present, and
|
|
44
|
+
// bindings.json from alongside the case when present. Resolved through the same
|
|
45
|
+
// helper Flow and BPMN use, so `registry pull` serves all three families —
|
|
46
|
+
// reading the env directly skipped the shared cache, and a Case that compiled
|
|
47
|
+
// fine right after a pull on Flow failed here for no visible reason. The helper
|
|
48
|
+
// also auto-detects the `connectors-local/` overlay `registry prepare` writes,
|
|
49
|
+
// which is what the three copies of these lines used to each decide for itself.
|
|
50
|
+
// Opened BEFORE the check pass, which reads the same library (#1014).
|
|
51
|
+
const library = openCliLibrary(argv);
|
|
52
|
+
const diags = check(built, caseCheckOpts(library));
|
|
42
53
|
for (const d of diags)
|
|
43
54
|
console.error(` ${d.level === 'error' ? '✗' : '⚠'} [${d.code}] ${d.message}`);
|
|
44
55
|
// Reported before serialize, so every exit path carries what stderr printed.
|
|
@@ -48,14 +59,6 @@ export async function run(argv) {
|
|
|
48
59
|
console.error(`compile: ${errors.length} error(s); not emitting.`);
|
|
49
60
|
return 1;
|
|
50
61
|
}
|
|
51
|
-
// Connector tasks resolve against the library; load it only when present, and
|
|
52
|
-
// bindings.json from alongside the case when present. Resolved through the same
|
|
53
|
-
// helper Flow and BPMN use, so `registry pull` serves all three families —
|
|
54
|
-
// reading the env directly skipped the shared cache, and a Case that compiled
|
|
55
|
-
// fine right after a pull on Flow failed here for no visible reason. The helper
|
|
56
|
-
// also auto-detects the `connectors-local/` overlay `registry prepare` writes,
|
|
57
|
-
// which is what the three copies of these lines used to each decide for itself.
|
|
58
|
-
const library = openCliLibrary(argv);
|
|
59
62
|
const bindFile = flagValue(argv, '--bindings') ?? defaultBindingsFile();
|
|
60
63
|
const bindings = new Bindings(bindFile);
|
|
61
64
|
let caseplan;
|
|
@@ -283,9 +286,6 @@ function visitRecords(value, visit) {
|
|
|
283
286
|
for (const child of Object.values(value))
|
|
284
287
|
visitRecords(child, visit);
|
|
285
288
|
}
|
|
286
|
-
function isRecord(value) {
|
|
287
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
288
|
-
}
|
|
289
289
|
function stringValue(value) {
|
|
290
290
|
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
291
291
|
}
|