@uipath/project-packager 1.1.4

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 (37) hide show
  1. package/dist/index.js +781 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/node.js +915 -0
  4. package/dist/node.js.map +1 -0
  5. package/dist/src/base-node-packager-factory.d.ts +35 -0
  6. package/dist/src/i18n/index.d.ts +7 -0
  7. package/dist/src/i18n/locales/en.d.ts +39 -0
  8. package/dist/src/index.d.ts +29 -0
  9. package/dist/src/models/packager-config.d.ts +16 -0
  10. package/dist/src/models/packager-parameters.d.ts +113 -0
  11. package/dist/src/models/project-build-options.d.ts +6 -0
  12. package/dist/src/models/project-models.d.ts +26 -0
  13. package/dist/src/models/project-pack-options.d.ts +21 -0
  14. package/dist/src/models/project-restore-options.d.ts +6 -0
  15. package/dist/src/models/project-validate-options.d.ts +11 -0
  16. package/dist/src/node-project-packager-factory.d.ts +22 -0
  17. package/dist/src/node.d.ts +32 -0
  18. package/dist/src/services/pack-service.d.ts +26 -0
  19. package/dist/src/services/package-sign-service.d.ts +22 -0
  20. package/dist/src/services/packager-parameters-validator.d.ts +26 -0
  21. package/dist/src/services/project-build-options-validator.d.ts +14 -0
  22. package/dist/src/services/project-loader.d.ts +24 -0
  23. package/dist/src/services/project-pack-options-builder.d.ts +19 -0
  24. package/dist/src/services/project-pack-options-validator.d.ts +15 -0
  25. package/dist/src/services/project-packager.d.ts +146 -0
  26. package/dist/src/services/project-tool-executor.d.ts +36 -0
  27. package/dist/src/services/project-validate-options-validator.d.ts +14 -0
  28. package/dist/src/services/tool-logger.d.ts +26 -0
  29. package/dist/src/services/tools-factory.d.ts +29 -0
  30. package/dist/src/telemetry-names.d.ts +11 -0
  31. package/dist/tests/pack-service.test.d.ts +1 -0
  32. package/dist/tests/project-loader.test.d.ts +1 -0
  33. package/dist/tests/project-packager-e2e.test.d.ts +7 -0
  34. package/dist/tests/project-packager.test.d.ts +1 -0
  35. package/dist/tests/project-tool-executor.test.d.ts +1 -0
  36. package/dist/tests/tools-factory-repository.test.d.ts +1 -0
  37. package/package.json +66 -0
@@ -0,0 +1,22 @@
1
+ import type { PackagerConfig } from "./models/packager-config.js";
2
+ import { type IProjectPackager } from "./services/project-packager.js";
3
+ /**
4
+ * Creates a ProjectPackager instance configured for Node.js usage.
5
+ *
6
+ * This is a convenience function that creates a NodeProjectPackagerFactory and calls createAsync.
7
+ *
8
+ * @param options - Configuration options for the ProjectPackager
9
+ * @returns Promise<IProjectPackager> - A fully configured ProjectPackager instance ready for use in Node.js.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // Simple usage with default tools
14
+ * const packager = await createNodeProjectPackager();
15
+ *
16
+ * // With custom log handler
17
+ * const packager = await createNodeProjectPackager({
18
+ * logHandler: (message) => console.log(message)
19
+ * });
20
+ * ```
21
+ */
22
+ export declare function createNodeProjectPackager(options?: PackagerConfig): Promise<IProjectPackager>;
@@ -0,0 +1,32 @@
1
+ import "./i18n/index.js";
2
+ export type { IContextStorage, ITelemetryProvider, ITelemetryService, TelemetryContext, TelemetryProperties, } from "@uipath/telemetry/node";
3
+ export { ConsoleTelemetryProvider, NodeContextStorage, TelemetryService, } from "@uipath/telemetry/node";
4
+ export { BaseNodePackagerFactory } from "./base-node-packager-factory.js";
5
+ export type { PackagerConfig } from "./models/packager-config.js";
6
+ export type { PackageSigningInfo, ValidateOptions, } from "./models/packager-parameters.js";
7
+ export { PackagerParameters, RulesConfigFileType, } from "./models/packager-parameters.js";
8
+ export { ProjectBuildOptions } from "./models/project-build-options.js";
9
+ export type { UiPathProject } from "./models/project-models.js";
10
+ export { ProjectPackOptions } from "./models/project-pack-options.js";
11
+ export { ProjectRestoreOptions } from "./models/project-restore-options.js";
12
+ export { ProjectValidateOptions } from "./models/project-validate-options.js";
13
+ export { createNodeProjectPackager } from "./node-project-packager-factory.js";
14
+ export type { IPackService } from "./services/pack-service.js";
15
+ export { PackService } from "./services/pack-service.js";
16
+ export type { IPackageSignService } from "./services/package-sign-service.js";
17
+ export { NodePackageSignService } from "./services/package-sign-service.js";
18
+ export type { IPackagerParametersValidator } from "./services/packager-parameters-validator.js";
19
+ export { PackagerParametersValidator } from "./services/packager-parameters-validator.js";
20
+ export type { IProjectBuildOptionsValidator } from "./services/project-build-options-validator.js";
21
+ export { ProjectBuildOptionsValidator } from "./services/project-build-options-validator.js";
22
+ export type { IProjectLoader } from "./services/project-loader.js";
23
+ export { ProjectLoader } from "./services/project-loader.js";
24
+ export type { IProjectPackager, PackageStream, } from "./services/project-packager.js";
25
+ export { ProjectPackager } from "./services/project-packager.js";
26
+ export { type IProjectToolExecutor, ProjectToolExecutor, } from "./services/project-tool-executor.js";
27
+ export type { IProjectValidateOptionsValidator } from "./services/project-validate-options-validator.js";
28
+ export { ProjectValidateOptionsValidator } from "./services/project-validate-options-validator.js";
29
+ export type { LogHandler } from "./services/tool-logger.js";
30
+ export { setGlobalLogHandler, ToolLogger } from "./services/tool-logger.js";
31
+ export { type IToolsFactory, ToolsFactory } from "./services/tools-factory.js";
32
+ export { TelemetryNames } from "./telemetry-names.js";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Interface for NuGet package operations
3
+ */
4
+ export interface IPackService {
5
+ /**
6
+ * Sanitize a package ID to conform to NuGet standards
7
+ * @param packageId - The package ID to sanitize
8
+ * @returns The sanitized package ID
9
+ */
10
+ sanitizePackageId(packageId: string): string;
11
+ }
12
+ /**
13
+ * Service for NuGet package operations
14
+ */
15
+ export declare class PackService implements IPackService {
16
+ private readonly disallowedCharsRegex;
17
+ private readonly spacesDotRegex;
18
+ private readonly dotDashRegex;
19
+ private readonly MaxPackageIdLength;
20
+ /**
21
+ * Sanitize a package ID to conform to NuGet standards
22
+ * @param packageId - The package ID to sanitize
23
+ * @returns The sanitized package ID
24
+ */
25
+ sanitizePackageId(packageId: string): string;
26
+ }
@@ -0,0 +1,22 @@
1
+ import type { IToolLogger } from "@uipath/solutionpackager-tool-core";
2
+ import { ToolResult } from "@uipath/solutionpackager-tool-core";
3
+ /**
4
+ * Provides package signing operations with availability checks.
5
+ */
6
+ export interface IPackageSignService {
7
+ /**
8
+ * Sign a NuGet package using dotnet nuget sign.
9
+ * @param packagePath - Path to the .nupkg file to sign
10
+ * @param certificatePath - Path to the PFX certificate file
11
+ * @param certificatePassword - Optional password for the certificate
12
+ * @param timestampServer - Optional RFC 3161 timestamp server URL
13
+ * @returns ToolResult indicating success or failure
14
+ */
15
+ signPackageAsync(packagePath: string, certificatePath: string, certificatePassword?: string, timestampServer?: string): Promise<ToolResult>;
16
+ }
17
+ export declare class NodePackageSignService implements IPackageSignService {
18
+ private readonly logger;
19
+ constructor(logger: IToolLogger);
20
+ signPackageAsync(packagePath: string, certificatePath: string, certificatePassword?: string, timestampServer?: string): Promise<ToolResult>;
21
+ private checkAvailable;
22
+ }
@@ -0,0 +1,26 @@
1
+ import { type IFileSystem, type IToolLogger, ToolResult } from "@uipath/solutionpackager-tool-core";
2
+ import { type PackagerParameters, type ValidateOptions } from "../models/packager-parameters.js";
3
+ /**
4
+ * Interface for a pack options validator
5
+ */
6
+ export interface IPackagerParametersValidator<TOptions extends PackagerParameters> {
7
+ /**
8
+ * Validate pack options
9
+ * @param options Pack options to validate
10
+ * @param cancellationToken Optional cancellation token
11
+ * @returns ToolResult indicating validation success or failure
12
+ */
13
+ validateAsync(options: TOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
14
+ }
15
+ /**
16
+ * Base validator for packager parameters.
17
+ * Contains common validation logic shared by solution and project validators.
18
+ */
19
+ export declare class PackagerParametersValidator<TOptions extends PackagerParameters> implements IPackagerParametersValidator<TOptions> {
20
+ protected readonly logger: IToolLogger;
21
+ protected readonly fileSystem: IFileSystem;
22
+ constructor(logger: IToolLogger, fileSystem: IFileSystem);
23
+ validateAsync(_options: TOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
24
+ protected validateDestinationPath(destinationPath: string): ToolResult;
25
+ protected validateGovernanceOptions(validateOptions: ValidateOptions): Promise<ToolResult>;
26
+ }
@@ -0,0 +1,14 @@
1
+ import type { ToolResult } from "@uipath/solutionpackager-tool-core";
2
+ import type { ProjectBuildOptions } from "../models/project-build-options.js";
3
+ import { type IPackagerParametersValidator, PackagerParametersValidator } from "./packager-parameters-validator.js";
4
+ /**
5
+ * Interface for the project build options validator
6
+ */
7
+ export type IProjectBuildOptionsValidator = IPackagerParametersValidator<ProjectBuildOptions>;
8
+ /**
9
+ * Validator for project build options.
10
+ * Validates governance options required for build operations.
11
+ */
12
+ export declare class ProjectBuildOptionsValidator extends PackagerParametersValidator<ProjectBuildOptions> implements IProjectBuildOptionsValidator {
13
+ validateAsync(options: ProjectBuildOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
14
+ }
@@ -0,0 +1,24 @@
1
+ import { type IFileSystem } from "@uipath/solutionpackager-tool-core";
2
+ import type { LoadedUiProject } from "../models/project-models.js";
3
+ /**
4
+ * Interface for loading project information from the file system
5
+ */
6
+ export interface IProjectLoader {
7
+ /**
8
+ * Load project information from a directory path.
9
+ * Searches for project.uiproj first, falls back to webAppManifest.json.
10
+ * @param projectPath Path to the project directory
11
+ * @returns Loaded project information
12
+ * @throws Error if neither project.uiproj nor webAppManifest.json is found
13
+ */
14
+ loadProject(projectPath: string): Promise<LoadedUiProject>;
15
+ }
16
+ export declare class ProjectLoader implements IProjectLoader {
17
+ private readonly fileSystem;
18
+ static readonly ProjectFileName = "project.uiproj";
19
+ static readonly WebAppManifestFileName = "webAppManifest.json";
20
+ constructor(fileSystem: IFileSystem);
21
+ loadProject(projectPath: string): Promise<LoadedUiProject>;
22
+ private loadFromProjectFile;
23
+ private loadFromWebAppManifest;
24
+ }
@@ -0,0 +1,19 @@
1
+ import type { IFileSystem, IProjectPackOptions } from "@uipath/solutionpackager-tool-core";
2
+ import type { LoadedUiProject } from "../models/project-models.js";
3
+ import type { ProjectPackOptions } from "../models/project-pack-options.js";
4
+ import type { IPackService } from "./pack-service.js";
5
+ /**
6
+ * Interface for building project pack options
7
+ */
8
+ export interface IProjectPackOptionsBuilder {
9
+ /**
10
+ * Build project pack options from project parameters and loaded project info
11
+ */
12
+ buildProjectPackOptions(parameters: ProjectPackOptions, project: LoadedUiProject): Promise<IProjectPackOptions>;
13
+ }
14
+ export declare class ProjectPackOptionsBuilder implements IProjectPackOptionsBuilder {
15
+ private readonly packService;
16
+ private readonly fileSystem;
17
+ constructor(packService: IPackService, fileSystem: IFileSystem);
18
+ buildProjectPackOptions(parameters: ProjectPackOptions, project: LoadedUiProject): Promise<IProjectPackOptions>;
19
+ }
@@ -0,0 +1,15 @@
1
+ import type { ToolResult } from "@uipath/solutionpackager-tool-core";
2
+ import type { ProjectPackOptions } from "../models/project-pack-options.js";
3
+ import type { IPackagerParametersValidator } from "./packager-parameters-validator.js";
4
+ import { ProjectBuildOptionsValidator } from "./project-build-options-validator.js";
5
+ /**
6
+ * Interface for the project pack options validator
7
+ */
8
+ export type IProjectPackOptionsValidator = IPackagerParametersValidator<ProjectPackOptions>;
9
+ /**
10
+ * Validator for project pack options.
11
+ * Validates destination path and governance options required for pack operations.
12
+ */
13
+ export declare class ProjectPackOptionsValidator extends ProjectBuildOptionsValidator implements IProjectPackOptionsValidator {
14
+ validateAsync(options: ProjectPackOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
15
+ }
@@ -0,0 +1,146 @@
1
+ import { type IFileSystem, ToolResult } from "@uipath/solutionpackager-tool-core";
2
+ import type { ITelemetryService } from "@uipath/telemetry";
3
+ import type { ProjectBuildOptions } from "../models/project-build-options.js";
4
+ import type { ProjectPackOptions } from "../models/project-pack-options.js";
5
+ import type { ProjectRestoreOptions } from "../models/project-restore-options.js";
6
+ import type { ProjectValidateOptions } from "../models/project-validate-options.js";
7
+ import type { IPackageSignService } from "./package-sign-service.js";
8
+ /**
9
+ * Package stream containing package data
10
+ */
11
+ export interface PackageStream {
12
+ /** Name of the package file */
13
+ name: string;
14
+ /** Package file data */
15
+ data: Uint8Array;
16
+ }
17
+ /**
18
+ * Interface for the ProjectPackager component.
19
+ * Provides methods to setup and pack individual UiPath projects.
20
+ */
21
+ export interface IProjectPackager {
22
+ /**
23
+ * File system instance
24
+ */
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
+ /**
33
+ * Setup the temporary storage.
34
+ * @param input The project folder as a zip Uint8Array (extracts to temp folder) or a path string (uses as-is)
35
+ * @param operationId Optional operation ID for telemetry correlation
36
+ * @returns The path to the project folder
37
+ */
38
+ setupAsync(input: Uint8Array | string, operationId?: string): Promise<string>;
39
+ /**
40
+ * Restore project dependencies.
41
+ * @param options Project options containing input path and configuration
42
+ * @param cancellationToken Optional cancellation token
43
+ * @returns ToolResult indicating success or failure
44
+ */
45
+ restoreProjectAsync(options: ProjectRestoreOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
46
+ /**
47
+ * Analyze (validate) a project.
48
+ * @param options Project options containing input path and configuration
49
+ * @param cancellationToken Optional cancellation token
50
+ * @returns ToolResult indicating success or failure
51
+ */
52
+ validateProjectAsync(options: ProjectValidateOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
53
+ /**
54
+ * Build a project.
55
+ * @param options Project options containing input path, output path, and configuration
56
+ * @param cancellationToken Optional cancellation token
57
+ * @returns ToolResult indicating success or failure
58
+ */
59
+ buildProjectAsync(options: ProjectBuildOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
60
+ /**
61
+ * Pack a project using the provided options.
62
+ * @param options Project pack options containing all parameters
63
+ * @param cancellationToken Optional cancellation token
64
+ * @returns ToolResult with the paths to the created packages
65
+ */
66
+ packProjectAsync(options: ProjectPackOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
67
+ /**
68
+ * Convert a successful ToolResult to a list of package streams.
69
+ * @param result The ToolResult to convert
70
+ * @returns A promise that resolves to an array of PackageStream objects
71
+ * @throws Error if the result is not successful or if any package file cannot be read
72
+ */
73
+ getPackageStreamsAsync(result: ToolResult): Promise<PackageStream[]>;
74
+ }
75
+ export declare class ProjectPackager implements IProjectPackager {
76
+ readonly fileSystem: IFileSystem;
77
+ private readonly telemetryService;
78
+ private readonly packageSignService?;
79
+ private readonly repository;
80
+ private readonly temporaryStorage;
81
+ private readonly zipService;
82
+ private readonly logger;
83
+ private readonly optionsBuilder;
84
+ private readonly toolsFactory;
85
+ private readonly projectExecutor;
86
+ private readonly projectLoader;
87
+ private readonly validateOptionsValidator;
88
+ private readonly buildOptionsValidator;
89
+ private readonly packOptionsValidator;
90
+ private readonly nugetPackager;
91
+ constructor(fileSystem: IFileSystem, telemetryService: ITelemetryService, packageSignService?: IPackageSignService | undefined);
92
+ /**
93
+ * Check if the project can be packed by verifying the project type has a registered tool.
94
+ * @param projectPath Path to the project folder
95
+ * @returns True if the project type has a registered tool factory
96
+ */
97
+ canPackProjectAsync(projectPath: string): Promise<boolean>;
98
+ /**
99
+ * Setup the temporary storage.
100
+ * @param input The project folder as a zip Uint8Array (extracts to temp folder) or a path string (uses as-is)
101
+ * @param operationId Optional operation ID for telemetry correlation
102
+ * @returns The path to the project folder
103
+ */
104
+ setupAsync(input: Uint8Array | string, operationId?: string): Promise<string>;
105
+ /**
106
+ * Restore project dependencies.
107
+ */
108
+ restoreProjectAsync(options: ProjectRestoreOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
109
+ /**
110
+ * Validate a project.
111
+ */
112
+ validateProjectAsync(options: ProjectValidateOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
113
+ /**
114
+ * Build a project.
115
+ */
116
+ buildProjectAsync(options: ProjectBuildOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
117
+ /**
118
+ * Pack a project using the provided options.
119
+ * @param options Project pack options containing all parameters
120
+ * @param cancellationToken Optional cancellation token
121
+ * @returns ToolResult with the paths to the created packages
122
+ */
123
+ packProjectAsync(options: ProjectPackOptions, cancellationToken?: AbortSignal): Promise<ToolResult>;
124
+ /**
125
+ * Convert a successful ToolResult to a list of package streams.
126
+ * @param result The ToolResult to convert
127
+ * @returns A promise that resolves to an array of PackageStream objects
128
+ * @throws Error if the result is not successful or if any package file cannot be read
129
+ */
130
+ getPackageStreamsAsync(result: ToolResult): Promise<PackageStream[]>;
131
+ /**
132
+ * Common logic for restore, analyze, and build operations:
133
+ * validates options, loads the project, executes the operation, and handles errors.
134
+ */
135
+ private executeProjectOperationAsync;
136
+ /**
137
+ * Copy packages from the output path to the destination path.
138
+ * Handles file paths, directories with .nupkg files, and directories with
139
+ * unpacked NuGet content (e.g., content/, lib/ folders from WorkflowCompiler).
140
+ * @param packagePaths Paths to the package files or directories
141
+ * @param destinationPath Destination directory
142
+ * @param packageInfo NuGet package info for creating .nupkg from unpacked content
143
+ * @returns Paths to the copied package files
144
+ */
145
+ private copyPackagesToDestination;
146
+ }
@@ -0,0 +1,36 @@
1
+ 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
+ import type { PackageSigningInfo } from "../models/packager-parameters.js";
4
+ import type { UiPathProject } from "../models/project-models.js";
5
+ import type { IPackageSignService } from "./package-sign-service.js";
6
+ import type { IToolsFactory } from "./tools-factory.js";
7
+ /**
8
+ * Interface for executing project tool operations
9
+ */
10
+ export interface IProjectToolExecutor {
11
+ restoreAsync(options: IProjectRestoreOptions, project: UiPathProject, context?: ProjectOperationContext, cancellationToken?: AbortSignal): Promise<ToolResult>;
12
+ validateAsync(options: IProjectValidateOptions, project: UiPathProject, context?: ProjectOperationContext, cancellationToken?: AbortSignal): Promise<ToolResult>;
13
+ buildAsync(options: IProjectBuildOptions, project: UiPathProject, context?: ProjectOperationContext, cancellationToken?: AbortSignal): Promise<ToolResult>;
14
+ packAsync(options: IProjectPackOptions, project: UiPathProject, context?: ProjectOperationContext, signingInfo?: PackageSigningInfo, cancellationToken?: AbortSignal): Promise<ToolResult>;
15
+ }
16
+ export declare class ProjectToolExecutor implements IProjectToolExecutor {
17
+ private readonly toolsFactory;
18
+ private readonly telemetry;
19
+ private readonly packageSignService?;
20
+ constructor(toolsFactory: IToolsFactory, telemetry: ITelemetryService, packageSignService?: IPackageSignService | undefined);
21
+ restoreAsync(options: IProjectRestoreOptions, project: UiPathProject, context?: ProjectOperationContext, cancellationToken?: AbortSignal): Promise<ToolResult>;
22
+ validateAsync(options: IProjectValidateOptions, project: UiPathProject, context?: ProjectOperationContext, cancellationToken?: AbortSignal): Promise<ToolResult>;
23
+ buildAsync(options: IProjectBuildOptions, project: UiPathProject, context?: ProjectOperationContext, cancellationToken?: AbortSignal): Promise<ToolResult>;
24
+ packAsync(options: IProjectPackOptions, project: UiPathProject, context?: ProjectOperationContext, signingInfo?: PackageSigningInfo, cancellationToken?: AbortSignal): Promise<ToolResult>;
25
+ /**
26
+ * Execute an operation on a project tool with proper creation and disposal.
27
+ */
28
+ private executeToolOperationAsync;
29
+ /**
30
+ * Sign all packages using the package sign service.
31
+ * @param packages - Array of package paths to sign
32
+ * @param signingInfo - Signing configuration
33
+ * @returns ToolResult indicating success or failure
34
+ */
35
+ private signPackagesAsync;
36
+ }
@@ -0,0 +1,14 @@
1
+ import type { ToolResult } from "@uipath/solutionpackager-tool-core";
2
+ import type { ProjectValidateOptions } from "../models/project-validate-options.js";
3
+ import { type IPackagerParametersValidator, PackagerParametersValidator } from "./packager-parameters-validator.js";
4
+ /**
5
+ * Interface for the project validate options validator
6
+ */
7
+ export type IProjectValidateOptionsValidator = IPackagerParametersValidator<ProjectValidateOptions>;
8
+ /**
9
+ * Validator for project validate options.
10
+ * Validates governance options required for validate/analyze operations.
11
+ */
12
+ export declare class ProjectValidateOptionsValidator extends PackagerParametersValidator<ProjectValidateOptions> implements IProjectValidateOptionsValidator {
13
+ validateAsync(options: ProjectValidateOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
14
+ }
@@ -0,0 +1,26 @@
1
+ import { type IToolLogger, LogLevel, LogMessage, type LogOptions } from "@uipath/solutionpackager-tool-core";
2
+ /**
3
+ * Callback type for handling log messages
4
+ * This is an implementation detail of ToolLogger
5
+ */
6
+ export type LogHandler = (logMessage: LogMessage) => void;
7
+ /**
8
+ * Set the global log handler for all ToolLogger instances that don't specify one
9
+ */
10
+ export declare function setGlobalLogHandler(handler: LogHandler): void;
11
+ /**
12
+ * Logger implementation for creating and outputting LogMessage instances
13
+ * with consistent source and sourceTarget
14
+ */
15
+ export declare class ToolLogger implements IToolLogger {
16
+ private readonly source;
17
+ private readonly sourceTarget;
18
+ constructor(source: string, sourceTarget: string);
19
+ debug(message: string, options?: LogOptions): void;
20
+ info(message: string, options?: LogOptions): void;
21
+ warn(message: string, options?: LogOptions): void;
22
+ error(message: string, options?: LogOptions): void;
23
+ progress(message: string, options?: LogOptions): void;
24
+ log(message: string, logLevel: LogLevel, options?: LogOptions): void;
25
+ logMessage(message: LogMessage): void;
26
+ }
@@ -0,0 +1,29 @@
1
+ import type { IFileSystem, IToolsFactoryRepository, ProjectOperationContext, ProjectTool, SolutionTool } from "@uipath/solutionpackager-tool-core";
2
+ import type { UiPathProject } from "../models/project-models.js";
3
+ /**
4
+ * Factory interface for creating solution and project tools
5
+ */
6
+ export interface IToolsFactory {
7
+ /**
8
+ * Create a solution tool for the specified solution
9
+ * @throws Error if no factory is registered
10
+ */
11
+ createSolutionToolAsync(solutionName: string): Promise<SolutionTool>;
12
+ /**
13
+ * Create a project tool for the specified project
14
+ * @param project - The project to create a tool for
15
+ * @param context - Optional operation context with id and sibling project info
16
+ * @throws Error if no factory is found for the project type
17
+ */
18
+ createProjectToolAsync(project: UiPathProject, context?: ProjectOperationContext): Promise<ProjectTool>;
19
+ }
20
+ /**
21
+ * Factory for creating solution and project tools
22
+ */
23
+ export declare class ToolsFactory implements IToolsFactory {
24
+ private readonly repository;
25
+ private readonly fileSystem;
26
+ constructor(repository: IToolsFactoryRepository, fileSystem: IFileSystem);
27
+ createSolutionToolAsync(solutionName: string): Promise<SolutionTool>;
28
+ createProjectToolAsync(project: UiPathProject, context?: ProjectOperationContext): Promise<ProjectTool>;
29
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum TelemetryNames {
2
+ ProjectToolPack = "ProjectPackager.Tool.Pack",
3
+ ProjectToolRestore = "ProjectPackager.Tool.Restore",
4
+ ProjectToolValidate = "ProjectPackager.Tool.Validate",
5
+ ProjectToolBuild = "ProjectPackager.Tool.Build",
6
+ ProjectPackagerPack = "ProjectPackager.Pack",
7
+ ProjectPackagerRestore = "ProjectPackager.Restore",
8
+ ProjectPackagerValidate = "ProjectPackager.Validate",
9
+ ProjectPackagerBuild = "ProjectPackager.Build",
10
+ ProjectPackagerProjectLoaded = "ProjectPackager.ProjectLoaded"
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import "../src/i18n/index.js";
@@ -0,0 +1,7 @@
1
+ import "@uipath/tool-connector";
2
+ import "@uipath/tool-workflowcompiler";
3
+ import "@uipath/tool-apiworkflow";
4
+ import "@uipath/tool-flow";
5
+ import "@uipath/tool-agent";
6
+ import "@uipath/tool-webapp";
7
+ import "@uipath/resource-builder-tool";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@uipath/project-packager",
3
+ "version": "1.1.4",
4
+ "description": "UiPath Project Packager - core library for packing individual UiPath projects",
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/Studio.Common.git",
21
+ "directory": "packager/uipath-projectpackager"
22
+ },
23
+ "publishConfig": {
24
+ "registry": "https://registry.npmjs.org/"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "scripts": {
30
+ "build": "rslib build",
31
+ "clean": "rimraf dist",
32
+ "test": "vitest run",
33
+ "test:coverage": "vitest run --coverage",
34
+ "prepack": "bun run build",
35
+ "publish:dry": "bun publish --dry-run",
36
+ "publish:gh": "bun publish",
37
+ "version:patch": "bun version patch --no-git-tag-version",
38
+ "version:minor": "bun version minor --no-git-tag-version",
39
+ "version:major": "bun version major --no-git-tag-version",
40
+ "lint": "biome check ."
41
+ },
42
+ "dependencies": {
43
+ "@uipath/filesystem": "^0.0.5",
44
+ "@uipath/solutionpackager-tool-core": "^0.0.26",
45
+ "@uipath/telemetry": "^0.0.4"
46
+ },
47
+ "peerDependencies": {
48
+ "fflate": "^0.8.2"
49
+ },
50
+ "devDependencies": {
51
+ "@rslib/core": "^0.20.0",
52
+ "@types/node": "^25.5.0",
53
+ "@uipath/resource-builder-tool": "^2025.11.0-alpha2430-2948",
54
+ "@uipath/tool-agent": "1.0.0",
55
+ "@uipath/tool-apiworkflow": "*",
56
+ "@uipath/tool-connector": "*",
57
+ "@uipath/tool-flow": "*",
58
+ "@uipath/tool-webapp": "1.0.0",
59
+ "@uipath/tool-workflowcompiler": "*",
60
+ "@vitest/coverage-v8": "^4.0.14",
61
+ "jsdom": "^29.0.0",
62
+ "typescript": "^5.9.3",
63
+ "vite-tsconfig-paths": "^6.1.1",
64
+ "vitest": "^4.0.14"
65
+ }
66
+ }