@uipath/maestro-builder-sdk 6.16.5 → 6.16.6

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.
@@ -16,8 +16,8 @@ import { resolveBpmnFile, loadBuiltBpmn } from './load.js';
16
16
  import { check } from './check.js';
17
17
  import { graphModel, renderGraph } from './graph.js';
18
18
  import { Bindings } from '../core/bindings.js';
19
- import { connectorCheckOpts, flagValue, openCliLibrary } from '../core/cli-library.js';
20
- import { runWhenInvokedDirectly } from '../cli-run.js';
19
+ import { connectorCheckOpts, openCliLibrary } from '../core/cli-library.js';
20
+ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
21
21
  import { ensureTypeScriptRuntime } from '../node-runtime.js';
22
22
  /** Flags that take a value — their argument is never the source positional. */
23
23
  const VALUE_FLAGS = new Set(['--library', '--connectors-local', '--bindings']);
@@ -23,13 +23,9 @@ import { serialize } from './serialize.js';
23
23
  import { check } from './check.js';
24
24
  import { Bindings } from '../core/bindings.js';
25
25
  import { connectorCheckOpts, openCliLibrary } from '../core/cli-library.js';
26
- import { runWhenInvokedDirectly } from '../cli-run.js';
26
+ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
27
27
  import { ensureTypeScriptRuntime } from '../node-runtime.js';
28
28
  import { defaultBindingsFile } from '../workdir.js';
29
- function opt(argv, name) {
30
- const i = argv.indexOf(name);
31
- return i >= 0 ? argv[i + 1] : undefined;
32
- }
33
29
  export async function run(argv) {
34
30
  if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
35
31
  console.error('usage: compile <bpmn.ts | BaseName> [-o out.bpmn] [--library <dir>] [--connectors-local <dir>] [--bindings <file>]');
@@ -50,7 +46,7 @@ export async function run(argv) {
50
46
  // without it, so a prepare resolved an operation against the live connection,
51
47
  // wrote the overlay, and compile ignored it.
52
48
  const library = openCliLibrary(argv);
53
- const bindFile = opt(argv, '--bindings') ?? defaultBindingsFile();
49
+ const bindFile = flagValue(argv, '--bindings') ?? defaultBindingsFile();
54
50
  const bindings = new Bindings(bindFile);
55
51
  // The same facts `check-cli` runs on, from the instance about to serialize:
56
52
  // the inner loop and the emit rung must not disagree about a field or a
@@ -64,7 +60,7 @@ export async function run(argv) {
64
60
  }
65
61
  const xml = await serialize(built, { library, bindings });
66
62
  const base = basename(file).replace(/\.bpmn\.ts$|\.ts$/, '');
67
- const out = opt(argv, '-o') ?? `${base}.bpmn`;
63
+ const out = flagValue(argv, '-o') ?? `${base}.bpmn`;
68
64
  writeFileSync(out, xml);
69
65
  console.log(`compile: wrote ${out} (${built.nodes.length} element(s))`);
70
66
  reportResult({ path: resolve(out), elements: built.nodes.length });
@@ -1,7 +1,6 @@
1
1
  import { connectorOutputVars } from './bpmn-sdk.js';
2
- import { transportHttpMethod } from '../config.js';
3
2
  import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
4
- import { buildConnectorInputs, nestConnectorBody } from '../core/connector-inputs.js';
3
+ import { buildConnectorInputs, nestConnectorBody, transportHttpMethod } from '../core/connector-inputs.js';
5
4
  export function createConnectorTask(ctx, n) {
6
5
  const { m } = ctx;
7
6
  if (!ctx.library)
@@ -26,15 +26,11 @@ import { typeStripDecision } from '../node-runtime.js';
26
26
  import { readFileSync } from 'node:fs';
27
27
  import { basename, resolve } from 'node:path';
28
28
  import { defaultSourceOut, writeSource } from '../workdir.js';
29
- import { runWhenInvokedDirectly } from '../cli-run.js';
29
+ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
30
30
  import { decompile } from './decompile.js';
31
31
  import { sameGraph } from './lift-verify.js';
32
32
  import { BPMN_IMPORT } from '../package-name.js';
33
33
  import { fileURLToPath } from 'node:url';
34
- function opt(argv, name) {
35
- const i = argv.indexOf(name);
36
- return i >= 0 ? argv[i + 1] : undefined;
37
- }
38
34
  /**
39
35
  * `run(argv)` is the tool contract the family-first `flow-sdk` CLI loads. It must
40
36
  * NOT read `process.argv`: under the unified CLI that still holds
@@ -45,7 +41,7 @@ export async function run(argv) {
45
41
  console.error('usage: decompile <Name.bpmn> [-o Name.bpmn.ts] [--import <specifier>] [--style explicit|nested] [--keep-flow-ids] [--keep-unused-bindings]');
46
42
  return 2;
47
43
  }
48
- const style = opt(argv, '--style') ?? 'explicit';
44
+ const style = flagValue(argv, '--style') ?? 'explicit';
49
45
  if (style !== 'explicit' && style !== 'nested') {
50
46
  console.error(`decompile: --style must be explicit or nested, not "${style}"`);
51
47
  return 2;
@@ -76,7 +72,7 @@ export async function run(argv) {
76
72
  return 2;
77
73
  }
78
74
  const xml = readFileSync(input, 'utf8');
79
- const importSpecifier = opt(argv, '--import') ?? BPMN_IMPORT;
75
+ const importSpecifier = flagValue(argv, '--import') ?? BPMN_IMPORT;
80
76
  let pruned = [];
81
77
  const base0 = { importSpecifier, keepUnusedBindings, onPrune: (ids) => (pruned = ids) };
82
78
  let source = await decompile(xml, base0);
@@ -103,7 +99,7 @@ export async function run(argv) {
103
99
  }
104
100
  }
105
101
  const base = basename(input).replace(/\.bpmn$/, '');
106
- const out = opt(argv, '-o') ?? defaultSourceOut(`${base}.bpmn.ts`);
102
+ const out = flagValue(argv, '-o') ?? defaultSourceOut(`${base}.bpmn.ts`);
107
103
  writeSource(out, source);
108
104
  console.log(`decompile: wrote ${out}`);
109
105
  if (pruned.length) {
@@ -14,11 +14,7 @@ import { reportResult } from '../cli-result.js';
14
14
  import { readFileSync, writeFileSync } from 'node:fs';
15
15
  import { basename, resolve } from 'node:path';
16
16
  import { mergeBpmn } from './merge.js';
17
- import { runWhenInvokedDirectly } from '../cli-run.js';
18
- function opt(argv, name) {
19
- const i = argv.indexOf(name);
20
- return i >= 0 ? argv[i + 1] : undefined;
21
- }
17
+ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
22
18
  export function run(argv) {
23
19
  if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
24
20
  console.error('usage: bpmn-merge <original.bpmn> <edited.bpmn> [-o merged.bpmn] [--baseline <baseline.bpmn>]');
@@ -31,11 +27,11 @@ export function run(argv) {
31
27
  console.error('bpmn-merge: need <original.bpmn> and <edited.bpmn>');
32
28
  return 2;
33
29
  }
34
- const baselinePath = opt(argv, '--baseline');
30
+ const baselinePath = flagValue(argv, '--baseline');
35
31
  const result = mergeBpmn(readFileSync(originalPath, 'utf8'), readFileSync(editedPath, 'utf8'), {
36
32
  ...(baselinePath ? { baseline: readFileSync(baselinePath, 'utf8') } : {}),
37
33
  });
38
- const out = opt(argv, '-o') ?? 'merged.bpmn';
34
+ const out = flagValue(argv, '-o') ?? 'merged.bpmn';
39
35
  writeFileSync(out, result.xml);
40
36
  reportResult({ path: resolve(out), preserved: result.preserved.length, authored: result.authored.length, removed: result.removed.length });
41
37
  // Say what was kept and what was rewritten: on a surgical edit the preserved count
@@ -15,11 +15,7 @@ import { reportResult } from '../cli-result.js';
15
15
  import { readFileSync, writeFileSync } from 'node:fs';
16
16
  import { layoutProcess } from 'bpmn-auto-layout';
17
17
  import { finalizeBpmnXml } from './serialize.js';
18
- import { runWhenInvokedDirectly } from '../cli-run.js';
19
- function opt(argv, name) {
20
- const i = argv.indexOf(name);
21
- return i >= 0 ? argv[i + 1] : undefined;
22
- }
18
+ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
23
19
  export async function run(argv) {
24
20
  if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
25
21
  console.error('usage: tidy <file.bpmn> [-o out.bpmn]');
@@ -32,7 +28,7 @@ export async function run(argv) {
32
28
  return 2;
33
29
  }
34
30
  const laidOut = finalizeBpmnXml(await layoutProcess(readFileSync(input, 'utf8')));
35
- const out = opt(argv, '-o') ?? input;
31
+ const out = flagValue(argv, '-o') ?? input;
36
32
  writeFileSync(out, laidOut.endsWith('\n') ? laidOut : laidOut + '\n');
37
33
  const shapes = (laidOut.match(/BPMNShape/g) ?? []).length;
38
34
  console.log(`tidy: laid out ${out} (${shapes} shape(s))`);
@@ -20,13 +20,9 @@ import { entryPointIO } from './entry-points.js';
20
20
  import { Bindings } from '../core/bindings.js';
21
21
  import { openCliLibrary } from '../core/cli-library.js';
22
22
  import { defaultBindingsFile } from '../workdir.js';
23
- import { runWhenInvokedDirectly } from '../cli-run.js';
23
+ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
24
24
  import { ensureTypeScriptRuntime } from '../node-runtime.js';
25
25
  import { CASE_FORMAT_PROFILE } from './format-profile.js';
26
- function opt(argv, name) {
27
- const i = argv.indexOf(name);
28
- return i >= 0 ? argv[i + 1] : undefined;
29
- }
30
26
  export async function run(argv) {
31
27
  if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
32
28
  console.error('usage: compile <case.ts | BaseName> [-o caseplan.json]');
@@ -57,10 +53,10 @@ export async function run(argv) {
57
53
  // also auto-detects the `connectors-local/` overlay `registry prepare` writes,
58
54
  // which is what the three copies of these lines used to each decide for itself.
59
55
  const library = openCliLibrary(argv);
60
- const bindFile = opt(argv, '--bindings') ?? defaultBindingsFile();
56
+ const bindFile = flagValue(argv, '--bindings') ?? defaultBindingsFile();
61
57
  const bindings = new Bindings(bindFile);
62
58
  const caseplan = serialize(built, { library, bindings });
63
- const out = opt(argv, '-o') ?? 'caseplan.json';
59
+ const out = flagValue(argv, '-o') ?? 'caseplan.json';
64
60
  writeFileSync(out, JSON.stringify(caseplan, null, 2) + '\n');
65
61
  const stages = caseplan.nodes.filter((n) => String(n.type).endsWith('Stage')).length;
66
62
  const triggers = syncEntryPoints(caseplan, out);
@@ -20,14 +20,10 @@ 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
22
  import { defaultSourceOut, workDirBeside, writeSource } from '../workdir.js';
23
- import { runWhenInvokedDirectly } from '../cli-run.js';
23
+ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
24
24
  import { Library } from '../core/library.js';
25
25
  import { decompileWithDiagnostics } from './decompile.js';
26
26
  import { CASE_IMPORT } from '../package-name.js';
27
- function opt(argv, name) {
28
- const i = argv.indexOf(name);
29
- return i >= 0 ? argv[i + 1] : undefined;
30
- }
31
27
  /** Derive a PascalCase base name from the case name for the default output file. */
32
28
  function baseName(plan) {
33
29
  const src = plan.name ?? plan.id ?? 'Case';
@@ -56,16 +52,16 @@ export function run(argv) {
56
52
  return 2;
57
53
  }
58
54
  const plan = JSON.parse(readFileSync(pos, 'utf8'));
59
- const libraryDir = resolveLibraryDir(opt(argv, '--library'));
55
+ const libraryDir = resolveLibraryDir(flagValue(argv, '--library'));
60
56
  const library = libraryDir && existsSync(`${libraryDir}/index.json`) ? new Library(libraryDir) : undefined;
61
- const importSpecifier = opt(argv, '--import') ?? CASE_IMPORT;
57
+ const importSpecifier = flagValue(argv, '--import') ?? CASE_IMPORT;
62
58
  const bestEffort = argv.includes('--best-effort');
63
59
  const result = decompileWithDiagnostics(plan, {
64
60
  importSpecifier,
65
61
  library,
66
62
  bestEffort,
67
63
  });
68
- const out = opt(argv, '-o') ?? defaultSourceOut(`${baseName(plan)}.case.ts`);
64
+ const out = flagValue(argv, '-o') ?? defaultSourceOut(`${baseName(plan)}.case.ts`);
69
65
  writeSource(out, result.source);
70
66
  console.log(`decompile: wrote ${basename(out)}`);
71
67
  reportResult({ path: resolve(out), diagnostics: result.diagnostics.map((d) => ({ code: d.code, location: d.location, message: d.message })) });
@@ -13,11 +13,7 @@ import { reportResult } from '../cli-result.js';
13
13
  import { readFileSync, writeFileSync } from 'node:fs';
14
14
  import { basename, resolve } from 'node:path';
15
15
  import { mergeCase } from './merge.js';
16
- import { runWhenInvokedDirectly } from '../cli-run.js';
17
- function opt(argv, name) {
18
- const i = argv.indexOf(name);
19
- return i >= 0 ? argv[i + 1] : undefined;
20
- }
16
+ import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
21
17
  export function run(argv) {
22
18
  if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
23
19
  console.error('usage: case-merge <original.json> <edited.json> [-o merged.json]');
@@ -35,7 +31,7 @@ export function run(argv) {
35
31
  const merged = mergeCase(original, edited, {
36
32
  warn: (message) => console.error(`case-merge: warning: ${message}`),
37
33
  });
38
- const out = opt(argv, '-o') ?? 'merged.caseplan.json';
34
+ const out = flagValue(argv, '-o') ?? 'merged.caseplan.json';
39
35
  writeFileSync(out, JSON.stringify(merged, null, 2) + '\n');
40
36
  const stages = (merged.nodes ?? [])
41
37
  .filter((node) => String(node.type ?? '').endsWith('Stage')).length;
@@ -9,7 +9,7 @@
9
9
  * name) are resolved here to the generated ids.
10
10
  */
11
11
  import { IdGen } from './ids.js';
12
- import { transportHttpMethod } from '../config.js';
12
+ import { transportHttpMethod } from '../core/connector-inputs.js';
13
13
  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';
package/dist/check.js CHANGED
@@ -11,6 +11,7 @@ import { QUEUE_ITEM_RECORD_SCHEMA } from './core/queue-record.js';
11
11
  import { checkEventResolution, checkEventSubscription, eventParamsFor, } from './core/event-checks.js';
12
12
  import { FLOW_EXPR_DIALECT, checkBindingLabels, checkBindingPresence, checkConnectorContract as coreCheckConnectorContract, checkConnectorLookups as coreCheckConnectorLookups, checkConnectorSchema as coreCheckConnectorSchema, collectConnectionUses, connectionConnectorConflicts, } from './core/connector-checks.js';
13
13
  import { prepareCommand } from './core/cli-spelling.js';
14
+ import { editDistance } from './core/edit-distance.js';
14
15
  import { isAnswerField } from './core/hitl-answers.js';
15
16
  import { hitlDerivesOutcomeHandles, hitlExitModel, hitlRoutesPerOutcome } from './core/hitl-routing.js';
16
17
  import { childStepLists, declaredExits, hasExits, stopsAtEnd } from './core/step-ports.js';
@@ -1394,20 +1395,6 @@ function nearestName(name, candidates) {
1394
1395
  }
1395
1396
  return best;
1396
1397
  }
1397
- /** Levenshtein distance, capped by the caller's threshold (names are short). */
1398
- function editDistance(a, b) {
1399
- const prev = new Array(b.length + 1).fill(0).map((_, j) => j);
1400
- for (let i = 1; i <= a.length; i++) {
1401
- let diag = prev[0];
1402
- prev[0] = i;
1403
- for (let j = 1; j <= b.length; j++) {
1404
- const tmp = prev[j];
1405
- prev[j] = Math.min(prev[j] + 1, prev[j - 1] + 1, diag + (a[i - 1] === b[j - 1] ? 0 : 1));
1406
- diag = tmp;
1407
- }
1408
- }
1409
- return prev[b.length];
1410
- }
1411
1398
  /**
1412
1399
  * Diagnose a `subflow` step: the child flow itself, and the parent→child
1413
1400
  * binding.
@@ -6,4 +6,4 @@
6
6
  * `core/cli-library.ts` when BPMN's `compile` and `check` needed the same things.
7
7
  * This shim preserves the historical `./cli-library.js` import path.
8
8
  */
9
- export { openCliLibrary, flagValue, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
9
+ export { openCliLibrary, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
@@ -6,4 +6,4 @@
6
6
  * `core/cli-library.ts` when BPMN's `compile` and `check` needed the same things.
7
7
  * This shim preserves the historical `./cli-library.js` import path.
8
8
  */
9
- export { openCliLibrary, flagValue, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
9
+ export { openCliLibrary, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
package/dist/cli-run.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export type CliExitCode = 0 | 1 | 2;
2
2
  export declare function runWhenInvokedDirectly(moduleUrl: string, label: string, run: (argv: string[]) => Promise<CliExitCode> | CliExitCode): void;
3
+ /** The value after `name` in `argv`, or `undefined`. */
4
+ export declare function flagValue(argv: readonly string[], name: string): string | undefined;
package/dist/cli-run.js CHANGED
@@ -40,3 +40,8 @@ export function runWhenInvokedDirectly(moduleUrl, label, run) {
40
40
  process.exitCode = 1;
41
41
  });
42
42
  }
43
+ /** The value after `name` in `argv`, or `undefined`. */
44
+ export function flagValue(argv, name) {
45
+ const i = argv.indexOf(name);
46
+ return i >= 0 ? argv[i + 1] : undefined;
47
+ }
@@ -25,16 +25,12 @@ import { serializeWithSidecars, connectorInputErrors } from './serialize.js';
25
25
  import { check } from './check.js';
26
26
  import { byoaCheckOpts, eventResolveErrorFor, openCliLibrary } from './cli-library.js';
27
27
  import { Bindings } from './bindings.js';
28
- import { runWhenInvokedDirectly } from './cli-run.js';
28
+ import { flagValue, runWhenInvokedDirectly } from './cli-run.js';
29
29
  import { connectionResources, mergeBindingsV2, readBindingsV2 } from './bindings-v2.js';
30
30
  import { ensureTypeScriptRuntime } from './node-runtime.js';
31
31
  import { defaultBindingsFile } from './workdir.js';
32
32
  import { BindingRefusal } from './core/binding-messages.js';
33
33
  import { ByoaRefusal } from './core/byoa.js';
34
- function opt(argv, name) {
35
- const i = argv.indexOf(name);
36
- return i >= 0 ? argv[i + 1] : undefined;
37
- }
38
34
  /**
39
35
  * The tool `type` values `compile` writes. NOT every `$resourceType: 'tool'`:
40
36
  * the designer writes kinds the SDK cannot derive into the same directory, so
@@ -93,7 +89,7 @@ export async function run(argv) {
93
89
  // library, and answering it from an assumption instead is what made
94
90
  // EVENT_NO_SCOPE an error for HTTP Webhook, whose only correct `where` is empty.
95
91
  const library = openCliLibrary(argv);
96
- const bindFile = opt(argv, '--bindings') ?? defaultBindingsFile();
92
+ const bindFile = flagValue(argv, '--bindings') ?? defaultBindingsFile();
97
93
  const bindings = new Bindings(bindFile);
98
94
  if (!noCheck) {
99
95
  const diags = check(built, library
@@ -166,7 +162,7 @@ export async function run(argv) {
166
162
  const { flow: flowJson, sidecars } = emitted;
167
163
  for (const w of warnings)
168
164
  console.error(` ⚠ [${w.code}] ${w.message}`);
169
- const out = opt(argv, '-o') ?? `${built.name || basename(file).replace(/\.flow\.ts$|\.ts$/, '')}.flow`;
165
+ const out = flagValue(argv, '-o') ?? `${built.name || basename(file).replace(/\.flow\.ts$|\.ts$/, '')}.flow`;
170
166
  writeFileSync(out, JSON.stringify(flowJson, null, 2) + '\n');
171
167
  console.log(`compile: wrote ${out} (${flowJson.nodes.length} nodes, ${flowJson.edges.length} edges)`);
172
168
  const written = [];
package/dist/config.d.ts CHANGED
@@ -6,14 +6,6 @@
6
6
  * envelope. This mirrors the platform's own rehydrateConfiguration (Tier-A defaults
7
7
  * + library-derived per-connector statics), minus the fieldsContainer sidecar.
8
8
  */
9
- /**
10
- * Convert an Integration Service operation discriminator into an HTTP transport
11
- * verb. `GETBYID` identifies a curated Retrieve operation in the connector
12
- * library, but the runtime's transport fields accept real HTTP methods only.
13
- * Keep the discriminator in `instanceParameters`; normalize only fields that
14
- * drive the request transport.
15
- */
16
- export declare function transportHttpMethod(method: string): string;
17
9
  /**
18
10
  * Compose the `=jsonString:`-wrapped configuration for a connector library entry.
19
11
  *
package/dist/config.js CHANGED
@@ -7,6 +7,7 @@
7
7
  * + library-derived per-connector statics), minus the fieldsContainer sidecar.
8
8
  */
9
9
  import { parseCeql } from './core/ceql.js';
10
+ import { transportHttpMethod } from './core/connector-inputs.js';
10
11
  const TIER_A_DEFAULTS = {
11
12
  additionalHeaders: null,
12
13
  baseObject: null,
@@ -86,16 +87,6 @@ const ESSENTIAL_KEYS = new Set([
86
87
  'path',
87
88
  'unifiedTypesCompatible',
88
89
  ]);
89
- /**
90
- * Convert an Integration Service operation discriminator into an HTTP transport
91
- * verb. `GETBYID` identifies a curated Retrieve operation in the connector
92
- * library, but the runtime's transport fields accept real HTTP methods only.
93
- * Keep the discriminator in `instanceParameters`; normalize only fields that
94
- * drive the request transport.
95
- */
96
- export function transportHttpMethod(method) {
97
- return method === 'GETBYID' ? 'GET' : method;
98
- }
99
90
  function schemaReplayDetails(operation, inputValues) {
100
91
  if (operation.customFieldsRequestDetails)
101
92
  return operation.customFieldsRequestDetails;
@@ -2,8 +2,6 @@ import { Library } from './library.js';
2
2
  import type { BindingsView } from './binding-messages.js';
3
3
  import { type ConnectorCheckOpts } from './connector-checks.js';
4
4
  import type { EventCheckOpts } from './event-checks.js';
5
- /** The value after `name` in `argv`, or `undefined`. */
6
- export declare function flagValue(argv: readonly string[], name: string): string | undefined;
7
5
  /**
8
6
  * The library for this invocation, or `undefined` when there is none.
9
7
  *
@@ -18,14 +18,10 @@ import { existsSync } from 'node:fs';
18
18
  import { join } from 'node:path';
19
19
  import { Library } from './library.js';
20
20
  import { resolveLibraryDir } from '../registry/cache.js';
21
+ import { flagValue } from '../cli-run.js';
21
22
  import { defaultOverlayDir } from '../workdir.js';
22
23
  import { EQUALS_EXPR_DIALECT } from './connector-checks.js';
23
24
  import { connectorInputErrors } from './connector-inputs.js';
24
- /** The value after `name` in `argv`, or `undefined`. */
25
- export function flagValue(argv, name) {
26
- const i = argv.indexOf(name);
27
- return i >= 0 ? argv[i + 1] : undefined;
28
- }
29
25
  /**
30
26
  * The library for this invocation, or `undefined` when there is none.
31
27
  *
@@ -98,3 +98,11 @@ interface ConnectorSlots {
98
98
  * author already wrote under a plain key is merged into, not replaced.
99
99
  */
100
100
  export declare function nestConnectorBody(flat: Record<string, unknown>): Record<string, unknown>;
101
+ /**
102
+ * Convert an Integration Service operation discriminator into an HTTP transport
103
+ * verb. `GETBYID` identifies a curated Retrieve operation in the connector
104
+ * library, but the runtime's transport fields accept real HTTP methods only.
105
+ * Keep the discriminator in `instanceParameters`; normalize only fields that
106
+ * drive the request transport.
107
+ */
108
+ export declare function transportHttpMethod(method: string): string;
@@ -24,6 +24,7 @@
24
24
  */
25
25
  import { isLookupToken, resolvedValue, unresolvedLookupMessage, } from './lookups.js';
26
26
  import { prepareCommand } from './cli-spelling.js';
27
+ import { editDistance } from './edit-distance.js';
27
28
  /** Flow's dialect, re-exported so `serialize.ts` need not reach past this module. */
28
29
  export { FLOW_EXPR_DIALECT } from './connector-checks.js';
29
30
  import { FLOW_EXPR_DIALECT as FLOW_DIALECT } from './connector-checks.js';
@@ -286,6 +287,16 @@ export function nestConnectorBody(flat) {
286
287
  }
287
288
  return out;
288
289
  }
290
+ /**
291
+ * Convert an Integration Service operation discriminator into an HTTP transport
292
+ * verb. `GETBYID` identifies a curated Retrieve operation in the connector
293
+ * library, but the runtime's transport fields accept real HTTP methods only.
294
+ * Keep the discriminator in `instanceParameters`; normalize only fields that
295
+ * drive the request transport.
296
+ */
297
+ export function transportHttpMethod(method) {
298
+ return method === 'GETBYID' ? 'GET' : method;
299
+ }
289
300
  function place(target, parts, index, value) {
290
301
  const part = parts[index];
291
302
  const last = index === parts.length - 1;
@@ -486,19 +497,3 @@ function nearestField(key, names) {
486
497
  }
487
498
  return bestD <= budget ? best : undefined;
488
499
  }
489
- /** Levenshtein distance, two rows — enough for field-name suggestions. */
490
- function editDistance(a, b) {
491
- if (a === b)
492
- return 0;
493
- if (Math.abs(a.length - b.length) > 3)
494
- return 99; // cheap bail: beyond any budget
495
- let prev = Array.from({ length: b.length + 1 }, (_, j) => j);
496
- for (let i = 1; i <= a.length; i++) {
497
- const row = [i];
498
- for (let j = 1; j <= b.length; j++) {
499
- row[j] = Math.min(prev[j] + 1, row[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
500
- }
501
- prev = row;
502
- }
503
- return prev[b.length];
504
- }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * core/edit-distance — Levenshtein distance for "did you mean …?" suggestions.
3
+ *
4
+ * Shared by the library's object lookup, Flow's `check`, connector-input routing
5
+ * and `registry prepare`. It returns the EXACT distance: callers compare it to a
6
+ * budget, and `registry/prepare/actions.ts` sorts by it, so a sentinel cutoff
7
+ * would reorder suggestions.
8
+ */
9
+ /** Levenshtein distance, two rows. Short strings only (names and ids). */
10
+ export declare function editDistance(a: string, b: string): number;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * core/edit-distance — Levenshtein distance for "did you mean …?" suggestions.
3
+ *
4
+ * Shared by the library's object lookup, Flow's `check`, connector-input routing
5
+ * and `registry prepare`. It returns the EXACT distance: callers compare it to a
6
+ * budget, and `registry/prepare/actions.ts` sorts by it, so a sentinel cutoff
7
+ * would reorder suggestions.
8
+ */
9
+ /** Levenshtein distance, two rows. Short strings only (names and ids). */
10
+ export function editDistance(a, b) {
11
+ let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
12
+ for (let i = 1; i <= a.length; i++) {
13
+ const cur = [i];
14
+ for (let j = 1; j <= b.length; j++) {
15
+ cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
16
+ }
17
+ prev = cur;
18
+ }
19
+ return prev[b.length];
20
+ }
@@ -9,6 +9,7 @@
9
9
  import { readFileSync, existsSync } from 'node:fs';
10
10
  import { join } from 'node:path';
11
11
  import { prepareCommand } from './cli-spelling.js';
12
+ import { editDistance } from './edit-distance.js';
12
13
  import { loadListEnvelopes, lookupListEnvelope } from './list-envelope.js';
13
14
  import { lookupSpecOf } from './lookups.js';
14
15
  import { loadByoaLedger, loadInvariantCollections, loadLookupResolutions } from './lookup-store.js';
@@ -1126,18 +1127,6 @@ function nearest(want, objects) {
1126
1127
  }
1127
1128
  return best;
1128
1129
  }
1129
- /** Levenshtein distance, two rows. Short strings only (object names). */
1130
- function editDistance(a, b) {
1131
- let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
1132
- for (let i = 1; i <= a.length; i++) {
1133
- const cur = [i];
1134
- for (let j = 1; j <= b.length; j++) {
1135
- cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
1136
- }
1137
- prev = cur;
1138
- }
1139
- return prev[b.length];
1140
- }
1141
1130
  /**
1142
1131
  * The accepted input vocabulary for one connector operation, with each input's
1143
1132
  * wire LOCATION.
@@ -23,12 +23,8 @@ import { basename, dirname, join, resolve } from 'node:path';
23
23
  import { defaultSourceOut, workDirBeside, writeSource } from './workdir.js';
24
24
  import { decompile } from './decompile.js';
25
25
  import { resolveFlowRefs } from './ref-resolve.js';
26
- import { runWhenInvokedDirectly } from './cli-run.js';
26
+ import { flagValue, runWhenInvokedDirectly } from './cli-run.js';
27
27
  import { PACKAGE_NAME } from './package-name.js';
28
- function opt(argv, name) {
29
- const i = argv.indexOf(name);
30
- return i >= 0 ? argv[i + 1] : undefined;
31
- }
32
28
  /** Derive a PascalCase base name from the flow name/id for the default output file. */
33
29
  function baseName(flow) {
34
30
  const src = flow.name ?? flow.id ?? 'Flow';
@@ -58,7 +54,7 @@ export function run(argv) {
58
54
  read: (path) => readFileSync(path, 'utf8'),
59
55
  });
60
56
  const ts = decompile(flow, {
61
- importSpecifier: opt(argv, '--import') ?? PACKAGE_NAME,
57
+ importSpecifier: flagValue(argv, '--import') ?? PACKAGE_NAME,
62
58
  bestEffort: !argv.includes('--strict'),
63
59
  // Findings the source cannot carry on its own (a node no trigger reaches, a
64
60
  // pinned core version this SDK lacks, a file-format version outside the
@@ -75,7 +71,7 @@ export function run(argv) {
75
71
  }
76
72
  },
77
73
  });
78
- const out = opt(argv, '-o') ?? defaultSourceOut(`${baseName(flow)}.flow.ts`);
74
+ const out = flagValue(argv, '-o') ?? defaultSourceOut(`${baseName(flow)}.flow.ts`);
79
75
  writeSource(out, ts);
80
76
  console.log(`flow-decompile: wrote ${basename(out)}`);
81
77
  reportResult({ path: resolve(out) });
package/dist/merge-cli.js CHANGED
@@ -15,11 +15,7 @@ import { reportResult } from './cli-result.js';
15
15
  import { readFileSync, writeFileSync } from 'node:fs';
16
16
  import { basename, resolve } from 'node:path';
17
17
  import { mergeFlow } from './merge.js';
18
- import { runWhenInvokedDirectly } from './cli-run.js';
19
- function opt(argv, name) {
20
- const i = argv.indexOf(name);
21
- return i >= 0 ? argv[i + 1] : undefined;
22
- }
18
+ import { flagValue, runWhenInvokedDirectly } from './cli-run.js';
23
19
  export function run(argv) {
24
20
  if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
25
21
  console.error('usage: flow-merge <original.flow> <edited.flow> [-o merged.flow] [--baseline <baseline.flow>]');
@@ -34,13 +30,13 @@ export function run(argv) {
34
30
  }
35
31
  const original = JSON.parse(readFileSync(originalPath, 'utf8'));
36
32
  const edited = JSON.parse(readFileSync(editedPath, 'utf8'));
37
- const baselinePath = opt(argv, '--baseline');
33
+ const baselinePath = flagValue(argv, '--baseline');
38
34
  const baseline = baselinePath ? JSON.parse(readFileSync(baselinePath, 'utf8')) : undefined;
39
35
  const merged = mergeFlow(original, edited, {
40
36
  baseline,
41
37
  warn: (m) => console.error(`flow-merge: warning: ${m}`),
42
38
  });
43
- const out = opt(argv, '-o') ?? 'merged.flow';
39
+ const out = flagValue(argv, '-o') ?? 'merged.flow';
44
40
  writeFileSync(out, JSON.stringify(merged, null, 2) + '\n');
45
41
  console.log(`flow-merge: wrote ${basename(out)} (${(merged.nodes ?? []).length} nodes, ${(merged.edges ?? []).length} edges)`);
46
42
  reportResult({ path: resolve(out), nodes: (merged.nodes ?? []).length, edges: (merged.edges ?? []).length });
@@ -17,6 +17,7 @@
17
17
  * everything else is pure over the parsed reply.
18
18
  */
19
19
  import { compareCodePoints, sortedStrings } from "../compat/compare.js";
20
+ import { editDistance } from "../../core/edit-distance.js";
20
21
  import { registrySearch } from "../uip/commands.js";
21
22
  import { failureReason, findJsonDocument, tail } from "../uip/envelope.js";
22
23
  import { isPlainObject, pyOr } from "./support.js";
@@ -81,18 +82,6 @@ export function closestActions(action, candidates) {
81
82
  });
82
83
  return scored.map(({ candidate }) => candidate);
83
84
  }
84
- /** Levenshtein distance, two rows. Short strings only (operation ids). */
85
- function editDistance(a, b) {
86
- let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
87
- for (let i = 1; i <= a.length; i++) {
88
- const cur = [i];
89
- for (let j = 1; j <= b.length; j++) {
90
- cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
91
- }
92
- prev = cur;
93
- }
94
- return prev[b.length];
95
- }
96
85
  /**
97
86
  * {@link closestActions}, kept only where the candidate is plausibly what was
98
87
  * meant: it shares MOST of the wanted id's words (`list-all-records` →
package/dist/serialize.js CHANGED
@@ -21,11 +21,11 @@ import { ByoaRefusal, byoaUnverified } from './core/byoa.js';
21
21
  import { OUTCOME_HANDLE_NODE_TYPES, assertHitlExitInvariant, hitlExitModel, hitlExitViolation, outcomeSlug } from './core/hitl-routing.js';
22
22
  import { declaredExits, hasExits, stopsAtEnd } from './core/step-ports.js';
23
23
  import { assertNodeEnvelope } from './core/node-envelope.js';
24
- import { buildConfiguration, transportHttpMethod } from './config.js';
24
+ import { buildConfiguration } from './config.js';
25
25
  import { stableId } from './core/stable-id.js';
26
26
  import { readEventFilter, eventFilterProblem, eventFilterJmes, eventFilterTreeLeaf } from './core/event-filters.js';
27
27
  import { FLOW_EXPR_DIALECT } from './core/connector-checks.js';
28
- import { buildConnectorInputs, connectorInputErrors as coreConnectorInputErrors, multipartBodyFieldName } from './core/connector-inputs.js';
28
+ import { buildConnectorInputs, connectorInputErrors as coreConnectorInputErrors, multipartBodyFieldName, transportHttpMethod } from './core/connector-inputs.js';
29
29
  /**
30
30
  * What `compile` would refuse these connector inputs with, or `undefined` when it
31
31
  * would accept them — Flow's binding of the shared validator.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.16.5",
3
+ "version": "6.16.6",
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",
@@ -92,5 +92,5 @@
92
92
  "@types/node": "^22.7.0",
93
93
  "esbuild": "^0.28.1"
94
94
  },
95
- "gitref": "b6731e22dc81fb2ca34f4463bc1785aaae16d174"
95
+ "gitref": "36462ef66bdae191ba107334d402dddaed067b2e"
96
96
  }