@uipath/maestro-builder-sdk 6.13.0 → 6.14.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/README.md +8 -2
- package/dist/api-index.md +74 -70
- package/dist/api-members.md +350 -331
- package/dist/bpmn/bpmn-sdk.d.ts +218 -7
- package/dist/bpmn/bpmn-sdk.js +90 -2
- package/dist/bpmn/check.js +86 -0
- package/dist/bpmn/decompile-cli.js +14 -5
- package/dist/bpmn/decompile.d.ts +29 -0
- package/dist/bpmn/decompile.js +193 -39
- package/dist/bpmn/load.js +2 -0
- package/dist/bpmn/serialize.js +52 -9
- package/dist/bpmn/typed-node.d.ts +52 -0
- package/dist/bpmn/typed-node.js +43 -0
- package/dist/case/load.js +2 -0
- package/dist/load.js +2 -0
- package/dist/sdk-resolve-hook.d.ts +9 -0
- package/dist/sdk-resolve-hook.js +29 -0
- package/dist/sdk-resolve.d.ts +11 -0
- package/dist/sdk-resolve.js +24 -0
- package/package.json +2 -2
package/dist/load.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
3
3
|
import { basename, dirname, join, resolve } from 'node:path';
|
|
4
4
|
import { statSync } from 'node:fs';
|
|
5
|
+
import { useThisSdkForAuthoredSource } from './sdk-resolve.js';
|
|
5
6
|
/** Resolve a user argument (a `.ts` path or a BaseName) to a flow source file. */
|
|
6
7
|
export function resolveFlowFile(arg) {
|
|
7
8
|
const candidates = [arg, `${arg}.flow.ts`, `${arg}.ts`];
|
|
@@ -19,6 +20,7 @@ export function resolveFlowFile(arg) {
|
|
|
19
20
|
throw new Error(`flow source not found: tried ${candidates.join(', ')}`);
|
|
20
21
|
}
|
|
21
22
|
export async function loadBuiltFlow(file) {
|
|
23
|
+
useThisSdkForAuthoredSource();
|
|
22
24
|
let mod;
|
|
23
25
|
try {
|
|
24
26
|
mod = await import(pathToFileURL(file).href);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ResolveContext {
|
|
2
|
+
parentURL?: string;
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
type NextResolve = (specifier: string, context?: ResolveContext) => unknown;
|
|
6
|
+
/** True for the package name and its subpath exports (`/case`, `/bpmn`, …). */
|
|
7
|
+
export declare function isSdkSpecifier(specifier: string): boolean;
|
|
8
|
+
export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<unknown>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node resolve hook: authored source always imports THIS copy of the SDK.
|
|
3
|
+
*
|
|
4
|
+
* Authored `.flow.ts` / `.case.ts` / `.bpmn.ts` files, and the `connectors/*.ts`
|
|
5
|
+
* modules the registry generates, import the package by name. Node resolves a
|
|
6
|
+
* bare specifier by walking `node_modules` up from the importing file, so the
|
|
7
|
+
* name only resolved when the workspace had its own install. A global install
|
|
8
|
+
* (`npm install -g`) is never on that path, and ESM ignores `NODE_PATH`.
|
|
9
|
+
*
|
|
10
|
+
* The hook re-resolves those specifiers from inside this package instead.
|
|
11
|
+
* Node's package self-reference (a package may import its own name when it
|
|
12
|
+
* declares `exports`) then maps them to the files beside this one. The same
|
|
13
|
+
* mapping also guarantees one copy: the serializer checks builders with
|
|
14
|
+
* `instanceof`, and a second copy of the package in the workspace would fail
|
|
15
|
+
* those checks with errors that do not name the cause.
|
|
16
|
+
*
|
|
17
|
+
* Registered by `sdk-resolve.ts` before any authored module is imported.
|
|
18
|
+
*/
|
|
19
|
+
import { PACKAGE_NAME } from './package-name.js';
|
|
20
|
+
/** True for the package name and its subpath exports (`/case`, `/bpmn`, …). */
|
|
21
|
+
export function isSdkSpecifier(specifier) {
|
|
22
|
+
return specifier === PACKAGE_NAME || specifier.startsWith(`${PACKAGE_NAME}/`);
|
|
23
|
+
}
|
|
24
|
+
export async function resolve(specifier, context, nextResolve) {
|
|
25
|
+
if (isSdkSpecifier(specifier)) {
|
|
26
|
+
return nextResolve(specifier, { ...context, parentURL: import.meta.url });
|
|
27
|
+
}
|
|
28
|
+
return nextResolve(specifier, context);
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make `import … from '@uipath/maestro-builder-sdk'` in authored source resolve
|
|
3
|
+
* to the running package, installed locally or globally. See
|
|
4
|
+
* `sdk-resolve-hook.ts` for why. Idempotent; call it before importing authored
|
|
5
|
+
* source.
|
|
6
|
+
*
|
|
7
|
+
* Does nothing when the compiled hook is absent, which is the case only when
|
|
8
|
+
* the SDK runs from its TypeScript source under the test runner. The runner
|
|
9
|
+
* resolves imports itself, so no hook is needed there.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useThisSdkForAuthoredSource(): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Register the resolve hook that points authored source at this SDK copy. */
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { register } from 'node:module';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
let registered = false;
|
|
6
|
+
/**
|
|
7
|
+
* Make `import … from '@uipath/maestro-builder-sdk'` in authored source resolve
|
|
8
|
+
* to the running package, installed locally or globally. See
|
|
9
|
+
* `sdk-resolve-hook.ts` for why. Idempotent; call it before importing authored
|
|
10
|
+
* source.
|
|
11
|
+
*
|
|
12
|
+
* Does nothing when the compiled hook is absent, which is the case only when
|
|
13
|
+
* the SDK runs from its TypeScript source under the test runner. The runner
|
|
14
|
+
* resolves imports itself, so no hook is needed there.
|
|
15
|
+
*/
|
|
16
|
+
export function useThisSdkForAuthoredSource() {
|
|
17
|
+
if (registered)
|
|
18
|
+
return;
|
|
19
|
+
registered = true;
|
|
20
|
+
const hook = new URL('./sdk-resolve-hook.js', import.meta.url);
|
|
21
|
+
if (!existsSync(fileURLToPath(hook)))
|
|
22
|
+
return;
|
|
23
|
+
register(hook);
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.14.1",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"@types/node": "^22.7.0",
|
|
93
93
|
"esbuild": "^0.28.1"
|
|
94
94
|
},
|
|
95
|
-
"gitref": "
|
|
95
|
+
"gitref": "00178a53b6c63ad810cda275b16ac8170422f9ae"
|
|
96
96
|
}
|