@uipath/maestro-builder-sdk 6.108.0 → 6.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-index.md +10 -10
- package/dist/api-members.md +47 -47
- package/dist/check.js +2 -2
- package/dist/core/nodes/node-type.d.ts +12 -2
- package/dist/core/refusals.d.ts +8 -0
- package/dist/core/refusals.js +8 -0
- package/dist/core/resource-resolution.d.ts +32 -0
- package/dist/core/resource-resolution.js +2 -0
- package/dist/nodes/process/flow/check.js +19 -10
- package/dist/nodes/process/flow/contract.d.ts +81 -0
- package/dist/nodes/process/flow/contract.js +253 -0
- package/dist/nodes/process/flow/node-type.js +25 -7
- package/dist/nodes/process/flow/refusals.d.ts +4 -1
- package/dist/nodes/process/flow/refusals.js +13 -1
- package/dist/nodes/process/flow/spec.d.ts +55 -0
- package/dist/registry/prepare/process-schema.d.ts +39 -0
- package/dist/registry/prepare/process-schema.js +90 -0
- package/dist/registry/prepare/resources.d.ts +2 -1
- package/dist/registry/prepare/resources.js +24 -3
- package/dist/registry/uip/commands.d.ts +8 -0
- package/dist/registry/uip/commands.js +10 -0
- package/package.json +2 -2
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync } from "node:fs";
|
|
27
27
|
import { dirname, resolve } from "node:path";
|
|
28
|
-
import { ENTITY_KIND, canonicalKind, parseResourceLedger, resourceLedgerKey, resourceNoun, resourcePlural, resourcePrepareCommand, } from "../../core/resource-resolution.js";
|
|
28
|
+
import { ENTITY_KIND, PROCESS_KIND, canonicalKind, parseResourceLedger, resourceLedgerKey, resourceNoun, resourcePlural, resourcePrepareCommand, } from "../../core/resource-resolution.js";
|
|
29
29
|
import { editDistance } from "../../core/edit-distance.js";
|
|
30
30
|
import { writeJsonFile } from "../../core/json-file.js";
|
|
31
31
|
import { workPath } from "../../workdir.js";
|
|
32
32
|
import { Refusal } from "../errors.js";
|
|
33
33
|
import { dfEntitiesList, solutionResourceList } from "../uip/commands.js";
|
|
34
|
+
import { processSchemaLines, withProcessSchema } from "./process-schema.js";
|
|
34
35
|
import { dataItems, failureReason, getCI, parseEnvelope, isSuccess } from "../uip/envelope.js";
|
|
35
36
|
/** The ledger's file name, under the SDK's work directory. */
|
|
36
37
|
export const RESOURCE_LEDGER_FILENAME = "resources.json";
|
|
@@ -329,6 +330,15 @@ function nearMisses(name, pool) {
|
|
|
329
330
|
.slice(0, NEAR_MISS_LIMIT)
|
|
330
331
|
.map(({ c }) => c);
|
|
331
332
|
}
|
|
333
|
+
/** How the source pins a candidate found without a folder: an entity's `{ name, folder }`, a process step's `folderPath`, else the token. */
|
|
334
|
+
function pinnedSpelling(c) {
|
|
335
|
+
const folder = c.folderPath ?? "";
|
|
336
|
+
if (c.kind === ENTITY_KIND)
|
|
337
|
+
return `entity: { name: '${c.name}', folder: '${folder}' }`;
|
|
338
|
+
if (c.kind === PROCESS_KIND)
|
|
339
|
+
return `name: '${c.name}', folderPath: '${folder}'`;
|
|
340
|
+
return `resource('${c.kind}', '${c.name}', { folder: '${folder}' })`;
|
|
341
|
+
}
|
|
332
342
|
function asRow(c) {
|
|
333
343
|
return { kind: c.kind, name: c.name, scope: c.scope, folderPath: c.folderPath, folderKey: c.folderKey, key: c.key, source: c.source };
|
|
334
344
|
}
|
|
@@ -362,9 +372,19 @@ function localCandidates(local, remote) {
|
|
|
362
372
|
* @param client - The `uip` client every call goes through.
|
|
363
373
|
* @param request - The kind, the name, its folder path when the author gave one, and which listings to consult.
|
|
364
374
|
* @returns The row to record, a note for the author when it was found without a folder, and how to read an entity's columns.
|
|
365
|
-
* @throws Refusal `RESOURCE_AMBIGUOUS`, `RESOURCE_NOT_IN_FOLDER`, `RESOURCE_NOT_FOUND` or `RESOURCE_LISTING_FAILED
|
|
375
|
+
* @throws Refusal `RESOURCE_AMBIGUOUS`, `RESOURCE_NOT_IN_FOLDER`, `RESOURCE_NOT_FOUND` or `RESOURCE_LISTING_FAILED`; for a
|
|
376
|
+
* published process, `PROCESS_SCHEMA_READ_FAILED` when its arguments cannot be read.
|
|
366
377
|
*/
|
|
367
378
|
export async function resolveResource(client, request) {
|
|
379
|
+
const found = await findResource(client, request);
|
|
380
|
+
// A published process also records its type and argument contract, which
|
|
381
|
+
// `check` validates a step's inputs and returns against (#1979).
|
|
382
|
+
if (canonicalKind(request.kind) !== PROCESS_KIND)
|
|
383
|
+
return found;
|
|
384
|
+
return { ...found, row: await withProcessSchema(client, found.row, request.cwd ?? process.cwd()) };
|
|
385
|
+
}
|
|
386
|
+
/** {@link resolveResource}'s catalogue half: the one candidate, or the refusal. */
|
|
387
|
+
async function findResource(client, request) {
|
|
368
388
|
const kind = canonicalKind(request.kind);
|
|
369
389
|
const isEntity = kind === ENTITY_KIND;
|
|
370
390
|
const cwd = request.cwd ?? process.cwd();
|
|
@@ -445,7 +465,7 @@ export async function resolveResource(client, request) {
|
|
|
445
465
|
const note = only.scope === "tenant"
|
|
446
466
|
? `Found at tenant level. A tenant-level entity needs no prepare; write it as entity: '${only.name}'`
|
|
447
467
|
: `Found in folder ${JSON.stringify(only.folderPath)}${only.source === "local" ? " (authored in this solution)" : ""} with no folder given. `
|
|
448
|
-
+ `Pin it in the source: ${
|
|
468
|
+
+ `Pin it in the source: ${pinnedSpelling(only)}`;
|
|
449
469
|
return resolved(only, note);
|
|
450
470
|
}
|
|
451
471
|
if (all.length > 1) {
|
|
@@ -491,6 +511,7 @@ export function recordedLines(row, ledger) {
|
|
|
491
511
|
...(row.key !== null ? [`Key ${row.key}`] : []),
|
|
492
512
|
...(row.folderKey !== null ? [`Folder ${row.folderKey}`] : []),
|
|
493
513
|
...(row.fields !== undefined ? [`Columns ${columnSummary(row.fields)}`] : []),
|
|
514
|
+
...processSchemaLines(row),
|
|
494
515
|
`Recorded ${ledger}`,
|
|
495
516
|
];
|
|
496
517
|
}
|
|
@@ -89,3 +89,11 @@ export declare function dfChoiceSetValues(id: string, opts?: {
|
|
|
89
89
|
limit?: number;
|
|
90
90
|
offset?: number;
|
|
91
91
|
}): string[];
|
|
92
|
+
/**
|
|
93
|
+
* `uip or processes get <key> --all-fields`: one published process by its
|
|
94
|
+
* release key. `--all-fields` is what exposes `ProcessType` and `ArgumentsV2`,
|
|
95
|
+
* the process's argument contract: `Input` and `Output` are JSON Schemas,
|
|
96
|
+
* each carried as an escaped JSON string (#1979). The key is tenant-unique, so
|
|
97
|
+
* no folder is needed.
|
|
98
|
+
*/
|
|
99
|
+
export declare function orProcessGet(key: string): string[];
|
|
@@ -147,3 +147,13 @@ export function dfChoiceSetValues(id, opts = {}) {
|
|
|
147
147
|
"--output", "json",
|
|
148
148
|
];
|
|
149
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* `uip or processes get <key> --all-fields`: one published process by its
|
|
152
|
+
* release key. `--all-fields` is what exposes `ProcessType` and `ArgumentsV2`,
|
|
153
|
+
* the process's argument contract: `Input` and `Output` are JSON Schemas,
|
|
154
|
+
* each carried as an escaped JSON string (#1979). The key is tenant-unique, so
|
|
155
|
+
* no folder is needed.
|
|
156
|
+
*/
|
|
157
|
+
export function orProcessGet(key) {
|
|
158
|
+
return [UIP, "or", "processes", "get", key, "--all-fields", "--output", "json"];
|
|
159
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.109.0",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"@types/node": "^22.7.0",
|
|
124
124
|
"esbuild": "^0.28.1"
|
|
125
125
|
},
|
|
126
|
-
"gitref": "
|
|
126
|
+
"gitref": "5b4742b27753c744b24c39aa70538961b642b18c"
|
|
127
127
|
}
|