@uipath/packager-tool-functions 1.201.0-preview.133 → 1.202.0-preview.134

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.
@@ -1,5 +1,6 @@
1
1
  import type { IProjectBuildOptions, IProjectPackOptions, IProjectRestoreOptions, IProjectValidateOptions } from "@uipath/solutionpackager-tool-core";
2
2
  import { type IFileSystem, type IToolLogger, ProjectTool, ToolResult } from "@uipath/solutionpackager-tool-core";
3
+ import { type Language } from "./types.js";
3
4
  export declare class FunctionsTool extends ProjectTool {
4
5
  private readonly _temporaryStorage;
5
6
  constructor(fileSystem: IFileSystem, logger: IToolLogger);
@@ -8,5 +9,5 @@ export declare class FunctionsTool extends ProjectTool {
8
9
  buildAsync(options: IProjectBuildOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
9
10
  packAsync(options: IProjectPackOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
10
11
  dispose(): Promise<void>;
11
- private detectLanguage;
12
+ protected detectLanguage(projectPath: string): Promise<Language>;
12
13
  }
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
+ export { FunctionsTool } from "./functions-tool.js";
1
2
  export { FunctionsToolFactory } from "./functions-tool-factory.js";
3
+ export { type Language, Languages } from "./types.js";
package/dist/index.js CHANGED
@@ -1,8 +1,3 @@
1
- // src/functions-tool-factory.ts
2
- import {
3
- ProjectTypes
4
- } from "@uipath/solutionpackager-tool-core";
5
-
6
1
  // src/functions-tool.ts
7
2
  import {
8
3
  ensureProjectId,
@@ -60,11 +55,10 @@ async function buildFunctionsPackage(fs, options) {
60
55
  }
61
56
  const entryPoints = JSON.parse(entryPointsRaw);
62
57
  const bindingsRaw = await fs.readFile(fs.path.join(projectPath, "bindings_v2.json"), "utf-8");
63
- const bindings = bindingsRaw ? JSON.parse(bindingsRaw) : {
64
- $schema: "https://cloud.uipath.com/draft/2024-12/bindings",
65
- version: "2.0",
66
- resources: []
67
- };
58
+ if (!bindingsRaw) {
59
+ throw new Error("bindings_v2.json not found. Run 'uipath-functions pack' to generate it.");
60
+ }
61
+ const bindings = JSON.parse(bindingsRaw);
68
62
  const packageJsonRaw = await fs.readFile(fs.path.join(projectPath, "package.json"), "utf-8");
69
63
  const packageDependencies = packageJsonRaw ? JSON.parse(packageJsonRaw).dependencies ?? {} : {};
70
64
  const targetRuntime = detectRuntime(uipathJson.functions);
@@ -439,8 +433,10 @@ class FunctionsTool extends ProjectTool {
439
433
  return Languages.JavaScript;
440
434
  }
441
435
  }
442
-
443
436
  // src/functions-tool-factory.ts
437
+ import {
438
+ ProjectTypes
439
+ } from "@uipath/solutionpackager-tool-core";
444
440
  class FunctionsToolFactory {
445
441
  supportedTypes = [ProjectTypes.Function];
446
442
  async createAsync(logger, fileSystem) {
@@ -448,7 +444,9 @@ class FunctionsToolFactory {
448
444
  }
449
445
  }
450
446
  export {
451
- FunctionsToolFactory
447
+ FunctionsTool,
448
+ FunctionsToolFactory,
449
+ Languages
452
450
  };
453
451
 
454
- //# debugId=24233E119AFECB3C64756E2164756E21
452
+ //# debugId=79823B003B2CADC564756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/packager-tool-functions",
3
- "version": "1.201.0-preview.133",
3
+ "version": "1.202.0-preview.134",
4
4
  "description": "UiPath Functions tool implementation",
5
5
  "type": "module",
6
6
  "exports": {
@@ -25,7 +25,7 @@
25
25
  "author": "",
26
26
  "license": "ISC",
27
27
  "peerDependencies": {
28
- "@uipath/solutionpackager-tool-core": "1.201.0"
28
+ "@uipath/solutionpackager-tool-core": "1.202.0"
29
29
  },
30
- "gitHead": "7933378ad5276ac369900293a1447474dcec6826"
30
+ "gitHead": "a335728adbdb02f28308e4f55d8936d0b150444b"
31
31
  }
@@ -149,7 +149,7 @@ export class FunctionsTool extends ProjectTool {
149
149
  // Mirrors detectProjectKind() in @uipath/tool-agent (Agents repo):
150
150
  // primary: uipath.json functions map extension (.ts/.js → javascript, .py → python)
151
151
  // fallback: pyproject.toml presence → python (same signal Agents uses)
152
- private async detectLanguage(projectPath: string): Promise<Language> {
152
+ protected async detectLanguage(projectPath: string): Promise<Language> {
153
153
  const uipathJsonContent = await this.fileSystem.readFile(
154
154
  Path.join(projectPath, "uipath.json"),
155
155
  "utf-8",
package/src/index.ts CHANGED
@@ -3,4 +3,8 @@
3
3
  // `toolsFactoryRepository.registerProjectToolFactory(new FunctionsToolFactory())`.
4
4
  // ============================================================================
5
5
 
6
+ // Base tool + language detection, subclassable by Node-only hosts that add
7
+ // manifest generation before packing (function-tool's packager entry).
8
+ export { FunctionsTool } from "./functions-tool.js";
6
9
  export { FunctionsToolFactory } from "./functions-tool-factory.js";
10
+ export { type Language, Languages } from "./types.js";