Lines 67-146javascript
67 const result = await packager.packAsync(localBuildFolder, options.package, nupkgPath);
68 this.logger.progress("Package created successfully");
69 return new ToolResult(ToolErrorCodes.Success, "done", [
73 const errorMessage = error instanceof Error ? error.toString() : String(error);
74 this.logger.error(errorMessage);
75 return ToolResult.error(ToolErrorCodes.InternalError, "An error occurred while packing Connector project");
79 this.logger.info("Disposing Connector Tool");
81 await this._temporaryStorage.cleanup();
84 async createOperateFile(options, localBuildFolder) {
85 const contentFolder = Path.join(localBuildFolder, NugetConstants.ContentFolderName);
86 const operateJsonFilePath = Path.join(contentFolder, NugetConstants.OperateFileName);
87 const projectId = options.projectStorageId ?? await this.resolveConnectorProjectId(options.projectPath);
88 await writeOrBackfillOperateProjectId(operateJsonFilePath, projectId, this.fileSystem, () => this.fileSystem.writeFile(operateJsonFilePath, JSON.stringify({
LowAi Review Evidence
Project ID and descriptor writes support connector packaging; the descriptor contains a UiPath schema URL, with no network request shown.
dist/index.jsView on unpkg · L87 89 $schema: "https://cloud.uipath.com/draft/2024-12/operate",
90 contentType: ProjectTypes.Connector,
93 targetFramework: "Portable",
96 requiresUserInteraction: false
100 async resolveConnectorProjectId(projectPath) {
101 const operatePath = Path.join(projectPath, "operate.json");
102 const projectFilePath = Path.join(projectPath, "project.json");
103 const hasAnchor = await this.fileSystem.exists(operatePath) || await this.fileSystem.exists(projectFilePath);
105 return ensureProjectId(projectPath, this.fileSystem);
107 const id = crypto.randomUUID();
108 await this.fileSystem.writeFile(projectFilePath, `${JSON.stringify({ projectId: id }, null, 2)}
112 async createPackageDescriptor(localBuildFolder) {
113 const packageDescriptorPath = Path.join(localBuildFolder, NugetConstants.ContentFolderName, NugetConstants.PackageDescriptorFileName);
114 const exists = await this.fileSystem.exists(packageDescriptorPath);
119 $schema: "https://cloud.uipath.com/draft/2024-12/package-descriptor",
121 [NugetConstants.OperateFileName]: Path.join(NugetConstants.ContentFolderName, NugetConstants.OperateFileName)
LowAi Review Evidence
Project ID and descriptor writes support connector packaging; the descriptor contains a UiPath schema URL, with no network request shown.
dist/index.jsView on unpkg · L118 124 await this.fileSystem.writeFile(packageDescriptorPath, JSON.stringify(descriptor, null, 2));
126 async copyDirectory(sourcePath, destinationPath) {
127 await this.fileSystem.mkdir(destinationPath);
128 const entries = await this.fileSystem.readdir(sourcePath);
129 for (const entry of entries) {
130 const sourceEntry = Path.join(sourcePath, entry);
LowAi Review Evidence
The exported tool copies a project app folder into temporary build storage and creates a NuGet package when its build or pack operation is invoked.
dist/index.jsView on unpkg · L126 131 const destinationEntry = Path.join(destinationPath, entry);
132 const stat = await this.fileSystem.stat(sourceEntry);
133 if (stat?.isDirectory()) {
134 await this.copyDirectory(sourceEntry, destinationEntry);
135 } else if (stat?.isFile()) {
136 const content = await this.fileSystem.readFile(sourceEntry);
138 await this.fileSystem.writeFile(destinationEntry, content);
145// src/connector-tool-factory.ts
146class ConnectorToolFactory {