@uipath/project-packager 1.1.10 → 1.196.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.
Files changed (44) hide show
  1. package/dist/browser.js +2380 -0
  2. package/dist/index.js +1331 -131
  3. package/dist/node.js +1225 -110
  4. package/dist/src/base-browser-packager-factory.d.ts +37 -0
  5. package/dist/src/base-node-packager-factory.d.ts +9 -2
  6. package/dist/src/browser-project-packager-factory.d.ts +26 -0
  7. package/dist/src/browser.d.ts +3 -0
  8. package/dist/src/i18n/locales/en.d.ts +30 -1
  9. package/dist/src/index.d.ts +6 -2
  10. package/dist/src/models/packager-config.d.ts +2 -2
  11. package/dist/src/models/packager-parameters.d.ts +8 -0
  12. package/dist/src/models/project-build-options.d.ts +4 -0
  13. package/dist/src/models/project-models.d.ts +0 -11
  14. package/dist/src/node.d.ts +18 -3
  15. package/dist/src/publish/models/publish-options.d.ts +158 -0
  16. package/dist/src/publish/node-project-publisher-factory.d.ts +6 -0
  17. package/dist/src/publish/services/local-folder-publisher.d.ts +19 -0
  18. package/dist/src/publish/services/nuget-feed-publisher.d.ts +29 -0
  19. package/dist/src/publish/services/orchestrator-feed-types.d.ts +98 -0
  20. package/dist/src/publish/services/orchestrator-feeds-service.d.ts +44 -0
  21. package/dist/src/publish/services/orchestrator-publisher.d.ts +78 -0
  22. package/dist/src/publish/services/project-publisher.d.ts +29 -0
  23. package/dist/src/services/dotnet-discovery-service.d.ts +18 -0
  24. package/dist/src/services/nupkg-resolver.d.ts +20 -0
  25. package/dist/src/services/package-sign-service.d.ts +3 -2
  26. package/dist/src/services/package-signer.d.ts +24 -0
  27. package/dist/src/services/project-loader.d.ts +0 -1
  28. package/dist/src/services/project-packager.d.ts +19 -13
  29. package/dist/src/services/project-tool-executor.d.ts +1 -1
  30. package/dist/tests/{project-packager-e2e.test.d.ts → project-packager.e2e.test.d.ts} +1 -0
  31. package/dist/tests/project-packager.spec.d.ts +1 -0
  32. package/dist/tests/publish/local-folder-publisher.spec.d.ts +1 -0
  33. package/dist/tests/publish/nuget-feed-publisher.spec.d.ts +1 -0
  34. package/dist/tests/publish/orchestrator-feeds-service.spec.d.ts +1 -0
  35. package/dist/tests/publish/orchestrator-publisher.spec.d.ts +1 -0
  36. package/dist/tests/publish/project-publisher.spec.d.ts +1 -0
  37. package/dist/tests/tools-factory-repository.spec.d.ts +1 -0
  38. package/package.json +23 -30
  39. /package/dist/tests/{governance-policy-service.test.d.ts → governance-policy-service.spec.d.ts} +0 -0
  40. /package/dist/tests/{pack-service.test.d.ts → pack-service.spec.d.ts} +0 -0
  41. /package/dist/tests/{project-loader.test.d.ts → project-loader.spec.d.ts} +0 -0
  42. /package/dist/tests/{project-packager.test.d.ts → project-pack-options-builder.spec.d.ts} +0 -0
  43. /package/dist/tests/{project-tool-executor.test.d.ts → project-tool-executor.spec.d.ts} +0 -0
  44. /package/dist/tests/{tools-factory-repository.test.d.ts → publish/node-project-publisher-factory.spec.d.ts} +0 -0
@@ -0,0 +1,78 @@
1
+ import type { IFileSystem } from "@uipath/solutionpackager-tool-core";
2
+ import { ToolResult } from "@uipath/solutionpackager-tool-core";
3
+ import { type OrchestratorDestination } from "../models/publish-options.js";
4
+ import { type IOrchestratorFeedsService } from "./orchestrator-feeds-service.js";
5
+ export declare const ORCHESTRATOR_RELATIVE_URL = "/orchestrator_";
6
+ export declare const PROCESSES_UPLOAD_PATH = "/odata/Processes/UiPath.Server.Configuration.OData.UploadPackage";
7
+ export declare const LIBRARIES_UPLOAD_PATH = "/odata/Libraries/UiPath.Server.Configuration.OData.UploadPackage";
8
+ /**
9
+ * Publishes .nupkg files to UiPath Orchestrator.
10
+ *
11
+ * For the PersonalWorkspace, TenantProcesses, and SharedLibraries kinds
12
+ * the publisher resolves the matching feed via
13
+ * `/api/PackageFeeds/GetFeeds`. Files are POSTed as
14
+ * `multipart/form-data` under the `file` field; the upload path
15
+ * (`Processes` vs `Libraries`) and `?feedId=` come from the resolved
16
+ * feed. The folder header (`X-UIPATH-OrganizationUnitId`) comes from
17
+ * the resolved feed for PersonalWorkspace and from the caller-supplied
18
+ * `folderId` for SharedLibraries.
19
+ *
20
+ * For the `OrchestratorCustom` kind the caller supplies the full upload
21
+ * URL — no feed resolution is performed and the URL is POSTed to
22
+ * verbatim. `connectionInfo` still drives the auth headers and the
23
+ * caller-supplied `folderId` (if any) is sent as
24
+ * `X-UIPATH-OrganizationUnitId`.
25
+ */
26
+ export interface IOrchestratorPublisher {
27
+ publishAsync(packagePaths: string[], destination: OrchestratorDestination): Promise<ToolResult>;
28
+ }
29
+ export declare class OrchestratorPublisher implements IOrchestratorPublisher {
30
+ private readonly fileSystem;
31
+ private readonly logger;
32
+ private readonly feedsService;
33
+ constructor(fileSystem: IFileSystem, feedsService?: IOrchestratorFeedsService);
34
+ publishAsync(packagePaths: string[], destination: OrchestratorDestination): Promise<ToolResult>;
35
+ private postPackages;
36
+ /**
37
+ * Resolve the target feed for the destination kind.
38
+ *
39
+ * - Tenant Processes / Shared Libraries: tenant-scoped feed —
40
+ * pick the feed with the matching `purpose` and no `folderId`.
41
+ * - Personal Workspace: every folder feed comes back with
42
+ * `purpose: "Processes"`, so we can't tell PW from a regular
43
+ * folder feed by the feeds list alone. Studio resolves this via
44
+ * `/api/FoldersNavigation/GetAllFoldersForCurrentUser`, where the
45
+ * PW folder has `feedType: "PersonalWorkspace"`. We do the same:
46
+ * look up that folder, then match the feed by `folderId`.
47
+ */
48
+ private resolveFeed;
49
+ private throwFeedNotFound;
50
+ /**
51
+ * Pick the publish URL for a resolved feed.
52
+ *
53
+ * The orchestrator's feed response carries a `publishUrl` — for OData
54
+ * feeds it points at the same `UploadPackage` endpoint we'd construct
55
+ * ourselves, for ApiKey-authed feeds it points at the NuGet v3 push
56
+ * endpoint that bypasses `CanPublishLibrariesAsync`. Prefer it when
57
+ * set; fall back to the constructed OData URL otherwise. `feedId` is
58
+ * always pinned via the query string (matches Studio Web's
59
+ * `PublishApiService.publishProjectFromSolution`).
60
+ *
61
+ * URLs are kept absolute so `fetch` works in Node — relative URLs
62
+ * throw `TypeError: Failed to parse URL` outside a browser. Same-origin
63
+ * absolute URLs are fine in browser callers (no CORS preflight).
64
+ */
65
+ private buildPublishUrl;
66
+ /**
67
+ * Derive the orchestrator base URL from `connectionInfo.cloudUrl`.
68
+ *
69
+ * Keeps the URL absolute — Node's `fetch` rejects relative URLs with
70
+ * `TypeError: Failed to parse URL`, and absolute same-origin URLs
71
+ * still work fine in browser callers (no CORS preflight added).
72
+ */
73
+ private deriveOrchestratorUrl;
74
+ private buildHeaders;
75
+ private buildCustomHeaders;
76
+ private buildAuthHeaders;
77
+ private safeReadBody;
78
+ }
@@ -0,0 +1,29 @@
1
+ import type { IFileSystem } from "@uipath/solutionpackager-tool-core";
2
+ import { ToolResult } from "@uipath/solutionpackager-tool-core";
3
+ import { type ProjectPublishOptions } from "../models/publish-options.js";
4
+ import { type ILocalFolderPublisher } from "./local-folder-publisher.js";
5
+ import { type INugetFeedPublisher } from "./nuget-feed-publisher.js";
6
+ import { type IOrchestratorPublisher } from "./orchestrator-publisher.js";
7
+ /**
8
+ * Public API of the ProjectPublisher component.
9
+ */
10
+ export interface IProjectPublisher {
11
+ /**
12
+ * Publish one or more .nupkg files to the destination configured in
13
+ * `options.destination`.
14
+ */
15
+ publishAsync(options: ProjectPublishOptions): Promise<ToolResult>;
16
+ }
17
+ export declare class ProjectPublisher implements IProjectPublisher {
18
+ private readonly fileSystem;
19
+ private readonly logger;
20
+ private readonly localFolderPublisher;
21
+ private readonly nugetFeedPublisher;
22
+ private readonly orchestratorPublisher;
23
+ constructor(fileSystem: IFileSystem, publishers?: {
24
+ localFolder?: ILocalFolderPublisher;
25
+ nugetFeed?: INugetFeedPublisher;
26
+ orchestrator?: IOrchestratorPublisher;
27
+ });
28
+ publishAsync(options: ProjectPublishOptions): Promise<ToolResult>;
29
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Service for discovering the installed `dotnet` CLI on the host.
3
+ */
4
+ export interface IDotnetDiscoveryService {
5
+ /** True when `dotnet --version` succeeds on the host. */
6
+ isDotnetAvailable(): boolean;
7
+ /** Trimmed `dotnet --version` output, or undefined if dotnet is not on PATH. */
8
+ getDotnetVersion(): string | undefined;
9
+ }
10
+ export declare class DotnetDiscoveryService implements IDotnetDiscoveryService {
11
+ /**
12
+ * Per-instance cache of a successful `dotnet --version` lookup. Negative
13
+ * results are not cached so a one-off failure does not pin the service.
14
+ */
15
+ private cachedVersion;
16
+ isDotnetAvailable(): boolean;
17
+ getDotnetVersion(): string | undefined;
18
+ }
@@ -0,0 +1,20 @@
1
+ import type { IFileSystem } from "@uipath/solutionpackager-tool-core";
2
+ /**
3
+ * Resolve a package path produced by a project tool to the actual `.nupkg`
4
+ * file(s) it represents.
5
+ *
6
+ * Most tools return a `.nupkg` path directly, but the workflow compiler (both
7
+ * the in-repo tool and the bundled copy shipped inside `@uipath/rpa-tool`)
8
+ * reports the package *content folder* instead — the produced `.nupkg` sits
9
+ * inside that folder or beside it in the build output dir. The copy path uses
10
+ * this to turn that folder into the real `.nupkg` before copying it to the
11
+ * destination (where signing later runs on the finalized file).
12
+ *
13
+ * Resolution:
14
+ * - a path already ending in `.nupkg` is returned as-is;
15
+ * - a directory is searched for `.nupkg` files, first inside it, then in its
16
+ * parent (the build output dir);
17
+ * - anything else (including a directory with no `.nupkg` anywhere) yields an
18
+ * empty array, leaving the caller to decide how to handle a missing package.
19
+ */
20
+ export declare function resolveProducedNupkgsAsync(fileSystem: IFileSystem, packagePath: string): Promise<string[]>;
@@ -1,5 +1,6 @@
1
1
  import type { IToolLogger } from "@uipath/solutionpackager-tool-core";
2
2
  import { ToolResult } from "@uipath/solutionpackager-tool-core";
3
+ import type { IDotnetDiscoveryService } from "./dotnet-discovery-service.js";
3
4
  /**
4
5
  * Provides package signing operations with availability checks.
5
6
  */
@@ -15,8 +16,8 @@ export interface IPackageSignService {
15
16
  signPackageAsync(packagePath: string, certificatePath: string, certificatePassword?: string, timestampServer?: string): Promise<ToolResult>;
16
17
  }
17
18
  export declare class NodePackageSignService implements IPackageSignService {
19
+ private readonly dotnetDiscovery;
18
20
  private readonly logger;
19
- constructor(logger: IToolLogger);
21
+ constructor(dotnetDiscovery: IDotnetDiscoveryService, logger: IToolLogger);
20
22
  signPackageAsync(packagePath: string, certificatePath: string, certificatePassword?: string, timestampServer?: string): Promise<ToolResult>;
21
- private checkAvailable;
22
23
  }
@@ -0,0 +1,24 @@
1
+ import { ToolResult } from "@uipath/solutionpackager-tool-core";
2
+ import type { PackageSigningInfo } from "../models/packager-parameters.js";
3
+ import type { IPackageSignService } from "./package-sign-service.js";
4
+ /**
5
+ * Sign a set of finalized `.nupkg` files.
6
+ *
7
+ * This is the one place the signing loop lives, shared by the project and
8
+ * solution packagers. It signs files only — callers resolve their own paths to
9
+ * real `.nupkg`s first (the project packager signs files it already copied to
10
+ * the destination; the solution packager resolves the workflow-compiler content
11
+ * folders via `resolveProducedNupkgsAsync` before calling here).
12
+ *
13
+ * - A no-op returning success when signing isn't requested (no signing info or
14
+ * no certificate path).
15
+ * - An error when signing is requested but no sign service is wired (the host
16
+ * couldn't provide one, e.g. dotnet CLI missing).
17
+ * - Otherwise signs each distinct path in parallel and returns the first
18
+ * failure, or success if all signed.
19
+ *
20
+ * @param signService The sign service, or undefined if none is available.
21
+ * @param nupkgPaths Finalized `.nupkg` file paths to sign.
22
+ * @param signingInfo Signing configuration, if signing was requested.
23
+ */
24
+ export declare function signNupkgsAsync(signService: IPackageSignService | undefined, nupkgPaths: string[], signingInfo?: PackageSigningInfo): Promise<ToolResult>;
@@ -15,7 +15,6 @@ export interface IProjectLoader {
15
15
  }
16
16
  export declare class ProjectLoader implements IProjectLoader {
17
17
  private readonly fileSystem;
18
- static readonly ProjectFileName = "project.uiproj";
19
18
  static readonly WebAppManifestFileName = "webAppManifest.json";
20
19
  constructor(fileSystem: IFileSystem);
21
20
  loadProject(projectPath: string): Promise<LoadedUiProject>;
@@ -1,5 +1,5 @@
1
+ import type { ITelemetryService } from "@uipath/common/telemetry";
1
2
  import { type IFileSystem, ToolResult } from "@uipath/solutionpackager-tool-core";
2
- import type { ITelemetryService } from "@uipath/telemetry";
3
3
  import type { ProjectBuildOptions } from "../models/project-build-options.js";
4
4
  import type { ProjectPackOptions } from "../models/project-pack-options.js";
5
5
  import type { ProjectRestoreOptions } from "../models/project-restore-options.js";
@@ -23,12 +23,6 @@ export interface IProjectPackager {
23
23
  * File system instance
24
24
  */
25
25
  readonly fileSystem: IFileSystem;
26
- /**
27
- * Check if the project can be packed by verifying the project type has a registered tool.
28
- * @param projectPath Path to the project folder
29
- * @returns True if the project type has a registered tool factory
30
- */
31
- canPackProjectAsync(projectPath: string): Promise<boolean>;
32
26
  /**
33
27
  * Setup the temporary storage.
34
28
  * @param input The project folder as a zip Uint8Array (extracts to temp folder) or a path string (uses as-is)
@@ -90,12 +84,6 @@ export declare class ProjectPackager implements IProjectPackager {
90
84
  private readonly nugetPackager;
91
85
  private readonly governancePolicyService;
92
86
  constructor(fileSystem: IFileSystem, telemetryService: ITelemetryService, packageSignService?: IPackageSignService | undefined);
93
- /**
94
- * Check if the project can be packed by verifying the project type has a registered tool.
95
- * @param projectPath Path to the project folder
96
- * @returns True if the project type has a registered tool factory
97
- */
98
- canPackProjectAsync(projectPath: string): Promise<boolean>;
99
87
  /**
100
88
  * Setup the temporary storage.
101
89
  * @param input The project folder as a zip Uint8Array (extracts to temp folder) or a path string (uses as-is)
@@ -134,6 +122,24 @@ export declare class ProjectPackager implements IProjectPackager {
134
122
  * validates options, loads the project, executes the operation, and handles errors.
135
123
  */
136
124
  private executeProjectOperationAsync;
125
+ /**
126
+ * Build a single-project ProjectOperationContext so tools that coordinate
127
+ * a remote-agent run (e.g. workflow-compiler-browser) receive the same
128
+ * shape they get from SolutionPackager — just with one project.
129
+ */
130
+ private createOperationContext;
131
+ /**
132
+ * Find .nupkg files produced by the tool in the parent directory.
133
+ * Tools like WorkflowCompiler create the .nupkg in the output root
134
+ * while reporting the content subdirectory in OutputPackages[].Path.
135
+ * Only returns .nupkg files whose name starts with the subdirectory
136
+ * name (the package id) to avoid picking up unrelated packages.
137
+ */
138
+ private findNupkgInParentDir;
139
+ /**
140
+ * Copy a single file to the destination, throwing if the read fails.
141
+ */
142
+ private copyFileToDestination;
137
143
  /**
138
144
  * Copy packages from the output path to the destination path.
139
145
  * Handles file paths, directories with .nupkg files, and directories with
@@ -1,5 +1,5 @@
1
+ import type { ITelemetryService } from "@uipath/common/telemetry";
1
2
  import { type IProjectBuildOptions, type IProjectPackOptions, type IProjectRestoreOptions, type IProjectValidateOptions, type ProjectOperationContext, ToolResult } from "@uipath/solutionpackager-tool-core";
2
- import type { ITelemetryService } from "@uipath/telemetry";
3
3
  import type { PackageSigningInfo } from "../models/packager-parameters.js";
4
4
  import type { UiPathProject } from "../models/project-models.js";
5
5
  import type { IPackageSignService } from "./package-sign-service.js";
@@ -3,5 +3,6 @@ import "@uipath/packager-tool-workflowcompiler";
3
3
  import "@uipath/packager-tool-apiworkflow";
4
4
  import "@uipath/packager-tool-flow";
5
5
  import "@uipath/tool-agent";
6
+ import "@uipath/packager-tool-functions";
6
7
  import "@uipath/packager-tool-webapp";
7
8
  import "@uipath/resource-builder-tool";
@@ -0,0 +1 @@
1
+ import "../src/i18n/index.js";
@@ -0,0 +1 @@
1
+ import "../../src/i18n/index.js";
@@ -0,0 +1 @@
1
+ import "../../src/i18n/index.js";
@@ -0,0 +1 @@
1
+ import "../../src/i18n/index.js";
@@ -0,0 +1 @@
1
+ import "../../src/i18n/index.js";
@@ -0,0 +1 @@
1
+ import "../../src/i18n/index.js";
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/project-packager",
3
- "version": "1.1.10",
3
+ "license": "MIT",
4
+ "version": "1.196.0",
4
5
  "description": "UiPath Project Packager - core library for packing individual UiPath projects",
5
6
  "type": "module",
6
7
  "main": "./dist/index.js",
@@ -12,6 +13,10 @@
12
13
  "./node": {
13
14
  "types": "./dist/src/node.d.ts",
14
15
  "default": "./dist/node.js"
16
+ },
17
+ "./browser": {
18
+ "types": "./dist/src/browser.d.ts",
19
+ "default": "./dist/browser.js"
15
20
  }
16
21
  },
17
22
  "types": "./dist/src/index.d.ts",
@@ -27,41 +32,29 @@
27
32
  "dist",
28
33
  "!dist/**/*.map"
29
34
  ],
30
- "scripts": {
31
- "build": "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core && bun build ./src/node.ts --outdir dist --format esm --target node --external @uipath/solutionpackager-tool-core --external '@uipath/telemetry/*' --external @uipath/telemetry --external @uipath/filesystem && tsc --emitDeclarationOnly --outDir dist",
32
- "clean": "rimraf dist",
33
- "test": "vitest run",
34
- "e2e": "vitest run --config vitest.e2e.config.ts",
35
- "test:coverage": "vitest run --coverage",
36
- "prepack": "bun run build",
37
- "publish:dry": "bun publish --dry-run",
38
- "publish:gh": "bun publish",
39
- "version:patch": "bun version patch --no-git-tag-version",
40
- "version:minor": "bun version minor --no-git-tag-version",
41
- "version:major": "bun version major --no-git-tag-version",
42
- "lint": "biome check ."
43
- },
44
35
  "dependencies": {
45
- "@uipath/filesystem": "0.1.7",
46
- "@uipath/solutionpackager-tool-core": "0.0.31",
47
- "@uipath/telemetry": "0.0.6"
36
+ "@uipath/filesystem": "1.196.0",
37
+ "@uipath/solutionpackager-tool-core": "1.196.0",
38
+ "@uipath/common": "1.196.0"
48
39
  },
49
40
  "peerDependencies": {
50
41
  "fflate": "^0.8.2"
51
42
  },
52
43
  "devDependencies": {
53
- "@types/node": "^25.5.0",
54
- "@uipath/resource-builder-tool": "^2025.11.0-alpha2430-2948",
55
- "@uipath/tool-agent": "^1.0.1",
56
- "@uipath/packager-tool-apiworkflow": "0.0.17",
57
- "@uipath/packager-tool-connector": "0.0.17",
58
- "@uipath/packager-tool-flow": "0.0.17",
59
- "@uipath/packager-tool-webapp": "1.0.4",
60
- "@uipath/packager-tool-workflowcompiler": "0.0.14",
61
- "@vitest/coverage-v8": "^4.0.14",
44
+ "@types/node": "^25.5.2",
45
+ "@uipath/resource-builder-tool": "2025.11.0-alpha2928-3101",
46
+ "@uipath/tool-agent": "^1.2.6",
47
+ "@uipath/packager-tool-apiworkflow": "1.196.0",
48
+ "@uipath/packager-tool-connector": "1.196.0",
49
+ "@uipath/packager-tool-flow": "1.196.0",
50
+ "@uipath/packager-tool-functions": "1.196.0",
51
+ "@uipath/packager-tool-webapp": "1.196.0",
52
+ "@uipath/packager-tool-workflowcompiler": "1.196.0",
53
+ "@vitest/coverage-v8": "^4.1.6",
62
54
  "jsdom": "^29.0.0",
63
- "typescript": "^5.9.3",
55
+ "typescript": "^6.0.2",
64
56
  "vite-tsconfig-paths": "^6.1.1",
65
- "vitest": "^4.0.14"
66
- }
57
+ "vitest": "^4.1.6"
58
+ },
59
+ "gitHead": "bed2b46f1ec33a47a7dcae2e6d4b7ab99bd06981"
67
60
  }