@uipath/packager-tool-functions-browser 0.0.0-stage → 1.204.0-preview.256
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/LICENSE.txt +3 -0
- package/README.md +27 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32 -0
- package/dist/remote-functions-tool-factory.d.ts +26 -0
- package/dist/remote-functions-tool.d.ts +20 -0
- package/package.json +34 -5
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
© 2026 UiPath
|
|
2
|
+
Use of this product is subject (a) to the applicable licensing agreement available: https://www.uipath.com/legal/trust-and-security/legal-terms#content-1 and, (b) for paid products listed here https://licensing.uipath.com/: the licensing agreement agreed between you and UiPath.
|
|
3
|
+
(UiPath means UiPath SRL with headquarters at 4 Vasile Alecsandri Str. and 11 Constantin Daniel Str., Building A, floors 5 and 6, District 1, Bucharest 010639, Romania and UiPath Inc. with principal place of business: One Vanderbilt Avenue, 60th Floor, New York, NY 10017)
|
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @uipath/packager-tool-functions-browser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Browser packager tool for `ProjectType.Function`. It packs Functions projects through the UiPath Remote Agent, in the same Orchestrator job as the solution's RPA projects.
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
The local `FunctionsTool` (`@uipath/packager-tool-functions`) runs in the browser, but it can only ship the `entry-points.json` and `bindings_v2.json` already in the snapshot. Generating them from the sources, as `uip function pack` does, needs Node, TypeScript and a real disk. When those files are stale, the pack still succeeds, but the deployed function has the wrong HTTP triggers. The Remote Agent can run the generator.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Register it **instead of** `FunctionsToolFactory`. Both claim `Function`, and the first registration of a type wins:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { RemoteFunctionsToolFactory } from "@uipath/packager-tool-functions-browser";
|
|
15
|
+
import { WorkflowCompilerToolFactory } from "@uipath/packager-tool-workflowcompiler-browser";
|
|
16
|
+
|
|
17
|
+
toolsFactoryRepository.registerProjectToolFactory(new RemoteFunctionsToolFactory());
|
|
18
|
+
toolsFactoryRepository.registerProjectToolFactory(new WorkflowCompilerToolFactory());
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Both factories use the shared executor from `@uipath/packager-remote-agent-browser`, so Function and RPA projects pack in one agent job. Set `functionsPackagerVersion` on the pack options to pin the packager the agent restores.
|
|
22
|
+
|
|
23
|
+
Only pack goes to the agent. A Functions project has nothing to validate or clean up, so validate and cleanup succeed locally and tell the shared executor to skip the project (`skipAsync`): the RPA projects' job does not wait for it and carries no `FunctionProjects`, and a Function-only solution starts no job. Restore and build are local no-ops.
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- A Remote Agent that packs `FunctionProjects`. An older one ignores the list and packs only the RPA projects; each Function project then fails with "The remote agent returned no package for …" when the result arrives.
|
|
28
|
+
- The same pack options remote RPA packing needs: `connection` (`cloudUrl`, `accessToken`, `folderId`) and `downloadUrl`.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RemoteFunctionsToolFactory } from "./remote-functions-tool-factory.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/remote-functions-tool-factory.ts
|
|
2
|
+
import {
|
|
3
|
+
RemoteAgentProjectToolFactory
|
|
4
|
+
} from "@uipath/packager-remote-agent-browser";
|
|
5
|
+
import {
|
|
6
|
+
ProjectTypes
|
|
7
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
8
|
+
|
|
9
|
+
// src/remote-functions-tool.ts
|
|
10
|
+
import { RemoteAgentProjectTool } from "@uipath/packager-remote-agent-browser";
|
|
11
|
+
import {
|
|
12
|
+
ensureProjectId
|
|
13
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
14
|
+
|
|
15
|
+
class RemoteFunctionsTool extends RemoteAgentProjectTool {
|
|
16
|
+
async resolveProjectIdAsync(options) {
|
|
17
|
+
return options.projectStorageId || await ensureProjectId(options.projectPath, this.fileSystem);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/remote-functions-tool-factory.ts
|
|
22
|
+
class RemoteFunctionsToolFactory extends RemoteAgentProjectToolFactory {
|
|
23
|
+
supportedTypes = [ProjectTypes.Function];
|
|
24
|
+
createTool(fileSystem, logger, bundleExecutor, context) {
|
|
25
|
+
return new RemoteFunctionsTool(fileSystem, logger, bundleExecutor, context);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
RemoteFunctionsToolFactory
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# debugId=57F0E44E9DE9F84A64756E2164756E21
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type IRemoteAgentBundleExecutor, RemoteAgentProjectToolFactory } from "@uipath/packager-remote-agent-browser";
|
|
2
|
+
import { type IFileSystem, type IToolLogger, type ProjectOperationContext, type ProjectTool, type ProjectType } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
/**
|
|
4
|
+
* Factory for the browser Functions tool that packs through the Remote Agent.
|
|
5
|
+
* Handles projects with projectType "Function".
|
|
6
|
+
*
|
|
7
|
+
* It claims the same type as `FunctionsToolFactory` from
|
|
8
|
+
* `@uipath/packager-tool-functions`, and the first registration of a type
|
|
9
|
+
* wins, so a consumer registers one or the other. Its tools share the remote
|
|
10
|
+
* agent bundle executor with `WorkflowCompilerToolFactory` from
|
|
11
|
+
* `@uipath/packager-tool-workflowcompiler-browser`, so a solution's Function
|
|
12
|
+
* and RPA projects pack in one agent job.
|
|
13
|
+
*
|
|
14
|
+
* Opt-in: a consumer that registers the local `FunctionsToolFactory` instead
|
|
15
|
+
* keeps packing Function projects in the browser. No robot is needed: the
|
|
16
|
+
* agent runs as a serverless job unless the pack targets a local robot, the
|
|
17
|
+
* same as for RPA projects.
|
|
18
|
+
*
|
|
19
|
+
* Needs a Remote Agent that packs `FunctionProjects`. An older one ignores
|
|
20
|
+
* that list; each Function project then fails when the result arrives without
|
|
21
|
+
* its package.
|
|
22
|
+
*/
|
|
23
|
+
export declare class RemoteFunctionsToolFactory extends RemoteAgentProjectToolFactory {
|
|
24
|
+
readonly supportedTypes: readonly ProjectType[];
|
|
25
|
+
protected createTool(fileSystem: IFileSystem, logger: IToolLogger, bundleExecutor: IRemoteAgentBundleExecutor, context?: ProjectOperationContext): ProjectTool;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RemoteAgentProjectTool } from "@uipath/packager-remote-agent-browser";
|
|
2
|
+
import { type IProjectPackOptions } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
/**
|
|
4
|
+
* Browser Functions tool that packs through the Remote Agent.
|
|
5
|
+
*
|
|
6
|
+
* The browser cannot generate a Functions project's `entry-points.json` and
|
|
7
|
+
* `bindings_v2.json` from its sources (that needs Node, TypeScript and a real
|
|
8
|
+
* disk), so the local `FunctionsTool` ships whatever manifests are in the
|
|
9
|
+
* snapshot. This tool hands the project to the shared remote-agent bundle
|
|
10
|
+
* executor instead: it is packed by the agent in the same Orchestrator job as
|
|
11
|
+
* the solution's RPA projects, and the package comes back through the same
|
|
12
|
+
* bucket.
|
|
13
|
+
*
|
|
14
|
+
* Only pack goes to the agent. A Functions project has nothing to validate or
|
|
15
|
+
* clean up (the local `FunctionsTool` does neither), so validate and cleanup
|
|
16
|
+
* succeed here and tell the bundle to skip the project.
|
|
17
|
+
*/
|
|
18
|
+
export declare class RemoteFunctionsTool extends RemoteAgentProjectTool {
|
|
19
|
+
protected resolveProjectIdAsync(options: IProjectPackOptions): Promise<string>;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@uipath/packager-tool-functions-browser",
|
|
3
|
+
"version": "1.204.0-preview.256",
|
|
4
|
+
"description": "UiPath Functions tool - browser implementation that packs through the Remote Agent",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/UiPath/cli.git",
|
|
12
|
+
"directory": "packages/packager/packager-tool-functions-browser"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"registry": "https://registry.npmjs.org/"
|
|
16
|
+
},
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"author": "UiPath",
|
|
22
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@uipath/packager-remote-agent-browser": "1.204.0",
|
|
25
|
+
"@uipath/solutionpackager-tool-core": "1.205.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@uipath/packager-remote-agent-browser": "1.204.0",
|
|
29
|
+
"@uipath/solutionpackager-tool-core": "1.205.0",
|
|
30
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
31
|
+
"typescript": "^7.0.2",
|
|
32
|
+
"vitest": "^4.1.11"
|
|
33
|
+
},
|
|
34
|
+
"gitHead": "63740c6cbb7ff282fa9118cc16a148eb030b245f"
|
|
35
|
+
}
|