@uipath/solution-packager 0.0.30
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/index.js +1038 -0
- package/dist/node.js +981 -0
- package/dist/src/browser-solution-packager-factory.d.ts +27 -0
- package/dist/src/i18n/index.d.ts +7 -0
- package/dist/src/i18n/locales/en.d.ts +26 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/models/loaded-uipath-solution.d.ts +15 -0
- package/dist/src/models/solution-pack-options.d.ts +44 -0
- package/dist/src/node-solution-packager-factory.d.ts +23 -0
- package/dist/src/node.d.ts +5 -0
- package/dist/src/services/options-builder.d.ts +42 -0
- package/dist/src/services/package-id-reader.d.ts +61 -0
- package/dist/src/services/solution-loader.d.ts +19 -0
- package/dist/src/services/solution-pack-options-validator.d.ts +14 -0
- package/dist/src/services/solution-pack-service.d.ts +60 -0
- package/dist/src/services/solution-packager.d.ts +101 -0
- package/dist/src/telemetry-names.d.ts +5 -0
- package/dist/tests/browser.test.d.ts +1 -0
- package/dist/tests/common.test.d.ts +1 -0
- package/dist/tests/node.test.d.ts +1 -0
- package/dist/tests/shared-browser-fs.d.ts +8 -0
- package/dist/tests/solution-loader.test.d.ts +1 -0
- package/dist/tests/solution-pack-service.test.d.ts +1 -0
- package/dist/tests/solution-packager-e2e.test.d.ts +9 -0
- package/dist/tests/solution-packager.test.d.ts +1 -0
- package/dist/tests/zip-temp-storage-integration.test.d.ts +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type PackagerConfig } from "@uipath/project-packager";
|
|
2
|
+
import { type ISolutionPackager } from "./services/solution-packager.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a SolutionPackager instance configured for browser usage.
|
|
5
|
+
*
|
|
6
|
+
* This is a convenience function that creates a BrowserSolutionPackagerFactory and calls createAsync.
|
|
7
|
+
* For more control, use the BrowserSolutionPackagerFactory class directly.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Configuration options for the SolutionPackager
|
|
10
|
+
* @returns Promise<ISolutionPackager> - A fully configured SolutionPackager instance ready for use in the browser.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Import tools (triggers self-registration)
|
|
15
|
+
* import '@uipath/packager-tool-connector';
|
|
16
|
+
* import '@uipath/packager-tool-flow';
|
|
17
|
+
*
|
|
18
|
+
* // Create SolutionPackager
|
|
19
|
+
* const packager = await createBrowserSolutionPackager({
|
|
20
|
+
* logHandler: (message) => console.log(message)
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // Tools are already registered and ready to use
|
|
24
|
+
* await packager.packSolutionAsync(options);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function createBrowserSolutionPackager(options?: PackagerConfig): Promise<ISolutionPackager>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* English translations for solutionpackager package.
|
|
3
|
+
* These translations are registered alongside core translations via I18nManager.
|
|
4
|
+
*/
|
|
5
|
+
export declare const en: {
|
|
6
|
+
readonly solutionpackager: {
|
|
7
|
+
readonly solutionLoader: {
|
|
8
|
+
readonly errors: {
|
|
9
|
+
readonly pathRequired: "Solution directory path is required";
|
|
10
|
+
readonly fileNotFound: "Solution file not found: {path}";
|
|
11
|
+
readonly invalidSolution: "Invalid solution file: {path}";
|
|
12
|
+
readonly noSolutionFile: "No .uipx solution file found in directory: {path}";
|
|
13
|
+
readonly invalidStorageFile: "Invalid {fileName} file";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly optionsBuilder: {
|
|
17
|
+
readonly errors: {
|
|
18
|
+
readonly packageInfoRequired: "Package information is required for Pack command";
|
|
19
|
+
readonly outputPathRequired: "Output path is required for Pack command";
|
|
20
|
+
readonly invalidProjectIds: "The following project ids do not exist in the solution: {ids}";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** @public */
|
|
26
|
+
export type TranslationKeys = typeof en;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./i18n/index.js";
|
|
2
|
+
export type { PackagerConfig } from "@uipath/project-packager";
|
|
3
|
+
export { RulesConfigFileType } from "@uipath/project-packager";
|
|
4
|
+
export { BuildConfiguration, LogLevel, } from "@uipath/solutionpackager-tool-core";
|
|
5
|
+
export { createBrowserSolutionPackager } from "./browser-solution-packager-factory.js";
|
|
6
|
+
export { SolutionPackOptions } from "./models/solution-pack-options.js";
|
|
7
|
+
export type { ISolutionPackager } from "./services/solution-packager.js";
|
|
8
|
+
export { SolutionPackager } from "./services/solution-packager.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { UiPathSolution } from "@uipath/solutionpackager-tool-core";
|
|
2
|
+
export type { UiPathSolution } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a loaded UiPath solution with its file path and name
|
|
5
|
+
*/
|
|
6
|
+
export interface LoadedUiPathSolution extends UiPathSolution {
|
|
7
|
+
/**
|
|
8
|
+
* Solution file name without extension
|
|
9
|
+
*/
|
|
10
|
+
Name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Path to the solution file (.uipx)
|
|
13
|
+
*/
|
|
14
|
+
filePath: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PackageSigningInfo, PackOptions, PublishInfo, ValidateOptions } from "@uipath/project-packager";
|
|
2
|
+
import { PackagerParameters } from "@uipath/project-packager";
|
|
3
|
+
import { BuildConfiguration, type NugetPackageInfo } from "@uipath/solutionpackager-tool-core";
|
|
4
|
+
/**
|
|
5
|
+
* Solution-specific parameters extending base packager parameters
|
|
6
|
+
*/
|
|
7
|
+
export declare class SolutionPackOptions extends PackagerParameters {
|
|
8
|
+
/**
|
|
9
|
+
* URL to download the solution snapshot for remote packing
|
|
10
|
+
*/
|
|
11
|
+
downloadUrl?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Path to the folder where the packed output will be stored.
|
|
14
|
+
*/
|
|
15
|
+
destinationPath: string;
|
|
16
|
+
/**
|
|
17
|
+
* Array of project names/paths to build
|
|
18
|
+
*/
|
|
19
|
+
projectsToBuild?: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Validate options
|
|
22
|
+
*/
|
|
23
|
+
validateOptions: ValidateOptions;
|
|
24
|
+
/**
|
|
25
|
+
* NuGet package information
|
|
26
|
+
*/
|
|
27
|
+
package: NugetPackageInfo;
|
|
28
|
+
/**
|
|
29
|
+
* Build configuration (Debug or Release)
|
|
30
|
+
*/
|
|
31
|
+
configuration: BuildConfiguration;
|
|
32
|
+
/**
|
|
33
|
+
* Package signing information
|
|
34
|
+
*/
|
|
35
|
+
signingInfo?: PackageSigningInfo;
|
|
36
|
+
/**
|
|
37
|
+
* Pack options
|
|
38
|
+
*/
|
|
39
|
+
packOptions?: PackOptions;
|
|
40
|
+
/**
|
|
41
|
+
* Publish information
|
|
42
|
+
*/
|
|
43
|
+
publishInfo?: PublishInfo;
|
|
44
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type PackagerConfig } from "@uipath/project-packager/node";
|
|
2
|
+
import { type ISolutionPackager } from "./services/solution-packager.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a SolutionPackager instance configured for Node.js usage.
|
|
5
|
+
*
|
|
6
|
+
* This is a convenience function that creates a NodeSolutionPackagerFactory and calls createAsync.
|
|
7
|
+
* For more control, use the NodeSolutionPackagerFactory class directly.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Configuration options for the SolutionPackager
|
|
10
|
+
* @returns Promise<ISolutionPackager> - A fully configured SolutionPackager instance ready for use in Node.js.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Simple usage with default tools
|
|
15
|
+
* const packager = await createNodeSolutionPackager();
|
|
16
|
+
*
|
|
17
|
+
* // With custom log handler
|
|
18
|
+
* const packager = await createNodeSolutionPackager({
|
|
19
|
+
* logHandler: (message) => console.log(message)
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function createNodeSolutionPackager(options?: PackagerConfig): Promise<ISolutionPackager>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./i18n/index.js";
|
|
2
|
+
export { SolutionPackOptions } from "./models/solution-pack-options.js";
|
|
3
|
+
export { createNodeSolutionPackager } from "./node-solution-packager-factory.js";
|
|
4
|
+
export type { ISolutionPackager } from "./services/solution-packager.js";
|
|
5
|
+
export { SolutionPackager } from "./services/solution-packager.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IPackService, UiPathProject } from "@uipath/project-packager";
|
|
2
|
+
import { type IFileSystem, type IProjectPackOptions, type ISolutionPackOptions } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
import type { LoadedUiPathSolution } from "../models/loaded-uipath-solution.js";
|
|
4
|
+
import type { SolutionPackOptions } from "../models/solution-pack-options.js";
|
|
5
|
+
import type { IPackageIdReader } from "./package-id-reader.js";
|
|
6
|
+
/**
|
|
7
|
+
* Interface for building pack options from solution parameters
|
|
8
|
+
*/
|
|
9
|
+
export interface IOptionsBuilder {
|
|
10
|
+
/**
|
|
11
|
+
* Build solution pack options from solution parameters
|
|
12
|
+
*/
|
|
13
|
+
buildSolutionPackOptions(parameters: SolutionPackOptions, solution: LoadedUiPathSolution): Promise<ISolutionPackOptions>;
|
|
14
|
+
/**
|
|
15
|
+
* Build project pack options from solution parameters, for a specific project
|
|
16
|
+
*/
|
|
17
|
+
buildProjectPackOptions(options: SolutionPackOptions, project: UiPathProject): Promise<IProjectPackOptions>;
|
|
18
|
+
}
|
|
19
|
+
export declare class OptionsBuilder implements IOptionsBuilder {
|
|
20
|
+
private readonly packageIdReader;
|
|
21
|
+
private readonly packService;
|
|
22
|
+
private readonly fileSystem;
|
|
23
|
+
constructor(packageIdReader: IPackageIdReader, packService: IPackService, fileSystem: IFileSystem);
|
|
24
|
+
private static readonly FILES_DIRECTORY_NAME;
|
|
25
|
+
buildSolutionPackOptions(parameters: SolutionPackOptions, solution: LoadedUiPathSolution): Promise<ISolutionPackOptions>;
|
|
26
|
+
private createOutputFilesDirectoryAsync;
|
|
27
|
+
/**
|
|
28
|
+
* Build project pack options from solution parameters for a specific project
|
|
29
|
+
*/
|
|
30
|
+
buildProjectPackOptions(solutionOptions: SolutionPackOptions, project: UiPathProject): Promise<IProjectPackOptions>;
|
|
31
|
+
/**
|
|
32
|
+
* Build the output path for a project
|
|
33
|
+
* Path structure: {solutionOutputFolder}/files/{projectId}
|
|
34
|
+
* @param project The project to build output path for
|
|
35
|
+
* @returns The output path for the project
|
|
36
|
+
*/
|
|
37
|
+
private buildProjectOutputPath;
|
|
38
|
+
/**
|
|
39
|
+
* Get the list of project IDs to build based on parameters and solution
|
|
40
|
+
*/
|
|
41
|
+
private getProjectIdsToBuild;
|
|
42
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IPackService, UiPathProject } from "@uipath/project-packager";
|
|
2
|
+
import { type IFileSystem } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
/**
|
|
4
|
+
* Interface for reading package IDs from projects
|
|
5
|
+
*/
|
|
6
|
+
export interface IPackageIdReader {
|
|
7
|
+
/**
|
|
8
|
+
* Read the package ID from a project
|
|
9
|
+
*/
|
|
10
|
+
read(project: UiPathProject, solutionPath?: string | null, solutionName?: string | null): Promise<string | null>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Reader for package IDs from project and solution metadata
|
|
14
|
+
*/
|
|
15
|
+
export declare class PackageIdReader implements IPackageIdReader {
|
|
16
|
+
private readonly fileSystem;
|
|
17
|
+
private readonly packService;
|
|
18
|
+
private readonly projectTypesToFolderNameMapping;
|
|
19
|
+
private static readonly projectTypeMap;
|
|
20
|
+
constructor(fileSystem: IFileSystem, packService: IPackService);
|
|
21
|
+
/**
|
|
22
|
+
* Read the package ID for a project
|
|
23
|
+
*/
|
|
24
|
+
read(project: UiPathProject, solutionPath?: string | null, solutionName?: string | null): Promise<string | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Default to using the project folder name as package ID
|
|
27
|
+
*/
|
|
28
|
+
private defaultToProjectFolder;
|
|
29
|
+
/**
|
|
30
|
+
* Get the full package ID with solution prefix
|
|
31
|
+
*/
|
|
32
|
+
private getPackageId;
|
|
33
|
+
/**
|
|
34
|
+
* Compose the package ID from solution name, project type, and root ID
|
|
35
|
+
*/
|
|
36
|
+
private composePackageId;
|
|
37
|
+
/**
|
|
38
|
+
* Normalize project type to short form
|
|
39
|
+
*/
|
|
40
|
+
private static normalizeProjectType;
|
|
41
|
+
/**
|
|
42
|
+
* Derive solution name from a file or directory path
|
|
43
|
+
*/
|
|
44
|
+
private deriveSolutionName;
|
|
45
|
+
/**
|
|
46
|
+
* Read package ID from legacy resources.json file
|
|
47
|
+
*/
|
|
48
|
+
private readFromLegacyResourcesJson;
|
|
49
|
+
/**
|
|
50
|
+
* Extract project ID from legacy resources JSON
|
|
51
|
+
*/
|
|
52
|
+
private getProjectIdFromJson;
|
|
53
|
+
/**
|
|
54
|
+
* Read package ID from resources directory structure
|
|
55
|
+
*/
|
|
56
|
+
private readFromResourcesDirectory;
|
|
57
|
+
/**
|
|
58
|
+
* Get property from object with case-insensitive key matching
|
|
59
|
+
*/
|
|
60
|
+
private getProperty;
|
|
61
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IFileSystem } from "@uipath/solutionpackager-tool-core";
|
|
2
|
+
import type { LoadedUiPathSolution } from "../models/loaded-uipath-solution.js";
|
|
3
|
+
/**
|
|
4
|
+
* Interface for loading solutions from the file system
|
|
5
|
+
*/
|
|
6
|
+
export interface ISolutionLoader {
|
|
7
|
+
/**
|
|
8
|
+
* Load a solution from a directory path (searches for .uipx file)
|
|
9
|
+
*/
|
|
10
|
+
loadSolution(solutionPath: string): Promise<LoadedUiPathSolution>;
|
|
11
|
+
}
|
|
12
|
+
export declare class SolutionLoader implements ISolutionLoader {
|
|
13
|
+
private readonly fileSystem;
|
|
14
|
+
static readonly SolutionStorageFileName = ".storage";
|
|
15
|
+
constructor(fileSystem: IFileSystem);
|
|
16
|
+
loadSolution(solutionPath: string): Promise<LoadedUiPathSolution>;
|
|
17
|
+
private getSolutionFilePathAsync;
|
|
18
|
+
private populateStorageIds;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type IPackagerParametersValidator, PackagerParametersValidator } from "@uipath/project-packager";
|
|
2
|
+
import type { ToolResult } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
import type { SolutionPackOptions } from "../models/solution-pack-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Interface for the solution pack options validator
|
|
6
|
+
*/
|
|
7
|
+
export type ISolutionPackOptionsValidator = IPackagerParametersValidator<SolutionPackOptions>;
|
|
8
|
+
/**
|
|
9
|
+
* Validator for solution pack options.
|
|
10
|
+
* Validates destination path and governance options required for pack operations.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SolutionPackOptionsValidator extends PackagerParametersValidator<SolutionPackOptions> implements ISolutionPackOptionsValidator {
|
|
13
|
+
validateAsync(options: SolutionPackOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { IProjectToolExecutor, ITelemetryService, IToolsFactory } from "@uipath/project-packager";
|
|
2
|
+
import { type IFileSystem, type IZipService, type ProjectOperationContext, ToolResult } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
import type { LoadedUiPathSolution } from "../models/loaded-uipath-solution.js";
|
|
4
|
+
import type { SolutionPackOptions } from "../models/solution-pack-options.js";
|
|
5
|
+
import type { IOptionsBuilder } from "./options-builder.js";
|
|
6
|
+
/**
|
|
7
|
+
* Interface for the service responsible for packing a solutions
|
|
8
|
+
*/
|
|
9
|
+
export interface ISolutionPackService {
|
|
10
|
+
/**
|
|
11
|
+
* Pack a solution with all its projects
|
|
12
|
+
*/
|
|
13
|
+
packAsync(parameters: SolutionPackOptions, solution: LoadedUiPathSolution, context: ProjectOperationContext, cancellationToken?: AbortSignal): Promise<ToolResult>;
|
|
14
|
+
}
|
|
15
|
+
export declare class SolutionPackService implements ISolutionPackService {
|
|
16
|
+
private readonly optionsBuilder;
|
|
17
|
+
private readonly toolsFactory;
|
|
18
|
+
private readonly projectExecutor;
|
|
19
|
+
private readonly zipService;
|
|
20
|
+
private readonly fileSystem;
|
|
21
|
+
private readonly telemetry;
|
|
22
|
+
constructor(optionsBuilder: IOptionsBuilder, toolsFactory: IToolsFactory, projectExecutor: IProjectToolExecutor, zipService: IZipService, fileSystem: IFileSystem, telemetry: ITelemetryService);
|
|
23
|
+
packAsync(parameters: SolutionPackOptions, solution: LoadedUiPathSolution, context: ProjectOperationContext, cancellationToken?: AbortSignal): Promise<ToolResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Pack all projects in parallel
|
|
26
|
+
* @param parameters Solution pack parameters
|
|
27
|
+
* @param projects Array of projects to pack
|
|
28
|
+
* @param cancellationToken Optional cancellation token
|
|
29
|
+
* @returns Array of promises for packing each project
|
|
30
|
+
*/
|
|
31
|
+
private packAllProjectsAsync;
|
|
32
|
+
/**
|
|
33
|
+
* Pack a single project
|
|
34
|
+
* @param parameters Solution pack parameters
|
|
35
|
+
* @param project Project to pack
|
|
36
|
+
* @param cancellationToken Optional cancellation token
|
|
37
|
+
* @param context Optional operation context
|
|
38
|
+
* @returns Result of the pack operation
|
|
39
|
+
*/
|
|
40
|
+
private packSingleProjectAsync;
|
|
41
|
+
/**
|
|
42
|
+
* Check if any results in the array have failed
|
|
43
|
+
* @param results Array of tool results
|
|
44
|
+
* @returns True if any result has failed, false otherwise
|
|
45
|
+
*/
|
|
46
|
+
private hasFailedResults;
|
|
47
|
+
/**
|
|
48
|
+
* Get a combined error message from all failed results
|
|
49
|
+
* @param results Array of tool results
|
|
50
|
+
* @returns Combined error message
|
|
51
|
+
*/
|
|
52
|
+
private getFailedResultsMessage;
|
|
53
|
+
/**
|
|
54
|
+
* Compress the solution output folder into a zip archive
|
|
55
|
+
* @param parameters Solution pack parameters
|
|
56
|
+
* @param outputPath Path to the solution output folder
|
|
57
|
+
* @returns Path to the created archive file
|
|
58
|
+
*/
|
|
59
|
+
private compressSolutionAsync;
|
|
60
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type IPackageSignService, type ITelemetryService, type PackageStream } from "@uipath/project-packager";
|
|
2
|
+
import { type IFileSystem, ToolResult } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
import type { SolutionPackOptions } from "../models/solution-pack-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Interface for the SolutionPackager component.
|
|
6
|
+
* Provides methods to setup and pack UiPath solutions.
|
|
7
|
+
*/
|
|
8
|
+
export interface ISolutionPackager {
|
|
9
|
+
/**
|
|
10
|
+
* File system instance
|
|
11
|
+
*/
|
|
12
|
+
readonly fileSystem: IFileSystem;
|
|
13
|
+
/**
|
|
14
|
+
* Check if the solution can be packed by verifying all project types have registered tools.
|
|
15
|
+
* @param solutionPath Path to the solution folder
|
|
16
|
+
* @returns True if all project types in the solution have registered tool factories
|
|
17
|
+
*/
|
|
18
|
+
canPackSolutionAsync(solutionPath: string): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Setup the temporary storage.
|
|
21
|
+
* @param input The solution folder as a zip Uint8Array (extracts to temp folder) or a path string (uses as-is)
|
|
22
|
+
* @param operationId Optional operation ID for telemetry correlation
|
|
23
|
+
* @returns The path to the solution folder
|
|
24
|
+
*/
|
|
25
|
+
setupAsync(input: Uint8Array | string, operationId?: string): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Setup the temporary storage by downloading the solution from a URL.
|
|
28
|
+
* @param downloadUrl The URL to download the solution zip from
|
|
29
|
+
* @param accessToken Optional bearer token for authentication
|
|
30
|
+
* @param operationId Optional operation ID for telemetry correlation
|
|
31
|
+
* @returns The path to the solution folder
|
|
32
|
+
*/
|
|
33
|
+
setupWithUrlAsync(downloadUrl: string, accessToken?: string, operationId?: string): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Pack a solution using the provided options.
|
|
36
|
+
* @param options Solution pack options containing all parameters
|
|
37
|
+
* @param cancellationToken Optional cancellation token
|
|
38
|
+
* @returns ToolResult with the path to the created solution package
|
|
39
|
+
*/
|
|
40
|
+
packSolutionAsync(options: SolutionPackOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Convert a successful ToolResult to a list of package streams.
|
|
43
|
+
* @param result The ToolResult to convert
|
|
44
|
+
* @returns A promise that resolves to an array of PackageStream objects
|
|
45
|
+
* @throws Error if the result is not successful or if any package file cannot be read
|
|
46
|
+
*/
|
|
47
|
+
getPackageStreamsAsync(result: ToolResult): Promise<PackageStream[]>;
|
|
48
|
+
}
|
|
49
|
+
export declare class SolutionPackager implements ISolutionPackager {
|
|
50
|
+
readonly fileSystem: IFileSystem;
|
|
51
|
+
private readonly telemetryService;
|
|
52
|
+
private readonly packageSignService?;
|
|
53
|
+
private readonly repository;
|
|
54
|
+
private readonly temporaryStorage;
|
|
55
|
+
private readonly zipService;
|
|
56
|
+
private readonly logger;
|
|
57
|
+
private readonly optionsBuilder;
|
|
58
|
+
private readonly toolsFactory;
|
|
59
|
+
private readonly projectExecutor;
|
|
60
|
+
private readonly solutionLoader;
|
|
61
|
+
private readonly solutionPackService;
|
|
62
|
+
private readonly optionsValidator;
|
|
63
|
+
private readonly governancePolicyService;
|
|
64
|
+
constructor(fileSystem: IFileSystem, telemetryService: ITelemetryService, packageSignService?: IPackageSignService | undefined);
|
|
65
|
+
/**
|
|
66
|
+
* Check if the solution can be packed by verifying all project types have registered tools.
|
|
67
|
+
* @param solutionPath Path to the solution folder
|
|
68
|
+
* @returns True if all project types in the solution have registered tool factories
|
|
69
|
+
*/
|
|
70
|
+
canPackSolutionAsync(solutionPath: string): Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Setup the temporary storage.
|
|
73
|
+
* @param input The solution folder as a zip Uint8Array (extracts to temp folder) or a path string (uses as-is)
|
|
74
|
+
* @param operationId Optional operation ID for telemetry correlation
|
|
75
|
+
* @returns The path to the solution folder
|
|
76
|
+
*/
|
|
77
|
+
setupAsync(input: Uint8Array | string, operationId?: string): Promise<string>;
|
|
78
|
+
/**
|
|
79
|
+
* Setup the temporary storage by downloading the solution from a URL.
|
|
80
|
+
* @param downloadUrl The URL to download the solution zip from
|
|
81
|
+
* @param accessToken Optional bearer token for authentication
|
|
82
|
+
* @param operationId Optional operation ID for telemetry correlation
|
|
83
|
+
* @returns The path to the solution folder
|
|
84
|
+
*/
|
|
85
|
+
setupWithUrlAsync(downloadUrl: string, accessToken?: string, operationId?: string): Promise<string>;
|
|
86
|
+
/**
|
|
87
|
+
* Pack a solution using the provided options.
|
|
88
|
+
* @param options Solution pack options containing all parameters
|
|
89
|
+
* @param cancellationToken Optional cancellation token
|
|
90
|
+
* @returns ToolResult with the path to the created solution package
|
|
91
|
+
*/
|
|
92
|
+
packSolutionAsync(options: SolutionPackOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
|
|
93
|
+
private createOperationContext;
|
|
94
|
+
/**
|
|
95
|
+
* Convert a successful ToolResult to a list of package streams.
|
|
96
|
+
* @param result The ToolResult to convert
|
|
97
|
+
* @returns A promise that resolves to an array of PackageStream objects
|
|
98
|
+
* @throws Error if the result is not successful or if any package file cannot be read
|
|
99
|
+
*/
|
|
100
|
+
getPackageStreamsAsync(result: ToolResult): Promise<PackageStream[]>;
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BrowserFileSystem } from "@uipath/filesystem/browser";
|
|
2
|
+
/**
|
|
3
|
+
* Creates and initializes a BrowserFileSystem instance.
|
|
4
|
+
* Handles the case where ZenFS is already configured from another test file
|
|
5
|
+
* running in the same browser context (ZenFS module state is shared across
|
|
6
|
+
* Vitest browser test files, but each file gets its own module scope).
|
|
7
|
+
*/
|
|
8
|
+
export declare function createInitializedBrowserFileSystem(): Promise<BrowserFileSystem>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../src/i18n/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "@uipath/packager-tool-connector";
|
|
2
|
+
import "@uipath/packager-tool-workflowcompiler";
|
|
3
|
+
import "@uipath/packager-tool-apiworkflow";
|
|
4
|
+
import "@uipath/packager-tool-bpmn";
|
|
5
|
+
import "@uipath/packager-tool-case";
|
|
6
|
+
import "@uipath/packager-tool-flow";
|
|
7
|
+
import "@uipath/tool-agent";
|
|
8
|
+
import "@uipath/packager-tool-webapp";
|
|
9
|
+
import "@uipath/resource-builder-tool";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uipath/solution-packager",
|
|
3
|
+
"version": "0.0.30",
|
|
4
|
+
"description": "UiPath Solution Packager - core library for packing UiPath solutions",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/src/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./node": {
|
|
13
|
+
"types": "./dist/src/node.d.ts",
|
|
14
|
+
"default": "./dist/node.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"types": "./dist/src/index.d.ts",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/UiPath/cli.git",
|
|
21
|
+
"directory": "packages/packager/solution-packager"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"registry": "https://registry.npmjs.org/"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"!dist/**/*.map"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/project-packager/*' --external @uipath/project-packager --external '@uipath/filesystem/*' --external @uipath/filesystem --external '@uipath/telemetry/*' --external @uipath/telemetry && bun build ./src/node.ts --outdir dist --format esm --target node --external @uipath/solutionpackager-tool-core --external '@uipath/project-packager/*' --external @uipath/project-packager --external '@uipath/telemetry/*' --external @uipath/telemetry --external '@uipath/filesystem/*' --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:browser": "vitest run --config=vitest.browser.config.ts",
|
|
36
|
+
"test:coverage": "vitest run --coverage",
|
|
37
|
+
"test:browser:coverage": "vitest run --config=vitest.browser.config.ts --coverage",
|
|
38
|
+
"test:all": "bun run test && bun run test:browser",
|
|
39
|
+
"test:all:coverage": "bun run test:coverage && bun run test:browser:coverage",
|
|
40
|
+
"prepack": "bun run build",
|
|
41
|
+
"publish:dry": "bun publish --dry-run",
|
|
42
|
+
"publish:gh": "bun publish",
|
|
43
|
+
"version:patch": "bun version patch --no-git-tag-version",
|
|
44
|
+
"version:minor": "bun version minor --no-git-tag-version",
|
|
45
|
+
"version:major": "bun version major --no-git-tag-version",
|
|
46
|
+
"lint": "biome check ."
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@uipath/project-packager": "1.1.10",
|
|
50
|
+
"@uipath/telemetry": "0.0.6",
|
|
51
|
+
"@uipath/filesystem": "0.1.7",
|
|
52
|
+
"@uipath/solutionpackager-tool-core": "0.0.31"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"fflate": "^0.8.2"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "^25.5.0",
|
|
59
|
+
"@uipath/resource-builder-tool": "^2025.11.0-alpha2430-2948",
|
|
60
|
+
"@uipath/tool-agent": "^1.0.1",
|
|
61
|
+
"@uipath/packager-tool-apiworkflow": "0.0.17",
|
|
62
|
+
"@uipath/packager-tool-bpmn": "0.0.7",
|
|
63
|
+
"@uipath/packager-tool-case": "0.0.7",
|
|
64
|
+
"@uipath/packager-tool-connector": "0.0.17",
|
|
65
|
+
"@uipath/packager-tool-flow": "0.0.17",
|
|
66
|
+
"@uipath/packager-tool-webapp": "1.0.4",
|
|
67
|
+
"@uipath/packager-tool-workflowcompiler": "0.0.14",
|
|
68
|
+
"@vitest/browser": "^4.0.14",
|
|
69
|
+
"@vitest/browser-playwright": "^4.0.14",
|
|
70
|
+
"@vitest/coverage-v8": "^4.0.14",
|
|
71
|
+
"playwright": "^1.57.0",
|
|
72
|
+
"typescript": "^5.9.3",
|
|
73
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
74
|
+
"vitest": "^4.0.14"
|
|
75
|
+
}
|
|
76
|
+
}
|