@uipath/packager-tool-case 1.196.0 → 1.197.0-preview.64

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.
@@ -24,11 +24,6 @@ export declare class CaseTool extends ProjectTool {
24
24
  * Create operate.json file if it doesn't already exist
25
25
  */
26
26
  private createOperateFile;
27
- /**
28
- * Create the operate.json file with project configuration.
29
- * Uses contentType "CaseManagement".
30
- */
31
- private createOperateJsonFile;
32
27
  /**
33
28
  * Create package-descriptor.json file.
34
29
  * Lists standard packaging files and .bpmn files from content/.
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ import { CaseToolFactory } from "./case-tool-factory.js";
2
+ export { CaseToolFactory };
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import {
8
8
 
9
9
  // src/case-tool.ts
10
10
  import {
11
+ ensureContentOperateFile,
11
12
  NugetConstants,
12
13
  NugetPackager,
13
14
  Path,
@@ -100,39 +101,12 @@ class CaseTool extends ProjectTool {
100
101
  }
101
102
  }
102
103
  async createOperateFile(options, contentFolder) {
103
- const operateJsonFilePath = Path.join(contentFolder, NugetConstants.OperateFileName);
104
- const exists = await this.fileSystem.exists(operateJsonFilePath);
105
- if (!exists) {
106
- await this.createOperateJsonFile(contentFolder, options.projectStorageId ?? "", operateJsonFilePath);
107
- }
108
- }
109
- async createOperateJsonFile(projectPath, projectId, filePath) {
110
- const entryPointsFilePath = Path.join(projectPath, CaseConstants.EntryPointsFileName);
111
- let mainPath = "";
112
- const entryPointsExists = await this.fileSystem.exists(entryPointsFilePath);
113
- if (entryPointsExists) {
114
- const entryPointsContent = await this.fileSystem.readFile(entryPointsFilePath);
115
- if (entryPointsContent) {
116
- try {
117
- const entryPointsText = new TextDecoder().decode(entryPointsContent);
118
- const entryPoints = JSON.parse(entryPointsText);
119
- mainPath = entryPoints.entryPoints?.[0]?.filePath ?? "";
120
- } catch {}
121
- }
122
- }
123
- const operateFileModel = {
124
- $schema: "https://cloud.uipath.com/draft/2024-12/operate",
125
- contentType: ProjectTypes.CaseManagement,
126
- projectId,
127
- main: mainPath,
128
- targetFramework: "Portable",
129
- runtimeOptions: {
130
- isAttended: false,
131
- requiresUserInteraction: false
132
- }
133
- };
134
- const operateJsonString = JSON.stringify(operateFileModel, null, 2);
135
- await this.fileSystem.writeFile(filePath, operateJsonString);
104
+ await ensureContentOperateFile(this.fileSystem, {
105
+ contentFolder,
106
+ projectPath: options.projectPath,
107
+ projectStorageId: options.projectStorageId,
108
+ contentType: ProjectTypes.CaseManagement
109
+ });
136
110
  }
137
111
  async createPackageDescriptor(localBuildFolder, contentFolder) {
138
112
  const descriptorFiles = {};
@@ -166,3 +140,8 @@ class CaseToolFactory {
166
140
 
167
141
  // src/index.ts
168
142
  toolsFactoryRepository.registerProjectToolFactory(new CaseToolFactory);
143
+ export {
144
+ CaseToolFactory
145
+ };
146
+
147
+ //# debugId=C4347E7455C1904D64756E2164756E21
package/package.json CHANGED
@@ -1,42 +1,31 @@
1
1
  {
2
- "name": "@uipath/packager-tool-case",
3
- "version": "1.196.0",
4
- "description": "UiPath Case Management tool implementation",
5
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "source": "./src/index.ts",
9
- "default": "./dist/index.js"
10
- }
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/UiPath/cli.git",
15
- "directory": "packages/packager/packager-tool-case"
16
- },
17
- "publishConfig": {
18
- "registry": "https://registry.npmjs.org/"
19
- },
20
- "types": "./dist/index.d.ts",
21
- "files": [
22
- "dist",
23
- "!dist/**/*.map",
24
- "src"
25
- ],
26
- "author": "",
27
- "license": "ISC",
28
- "peerDependencies": {
29
- "@uipath/solutionpackager-tool-core": "1.196.0"
30
- },
31
- "devDependencies": {
32
- "@types/node": "^25.5.2",
33
- "@uipath/solutionpackager-tool-core": "1.196.0",
34
- "@vitest/browser": "^4.1.6",
35
- "@vitest/browser-playwright": "^4.1.6",
36
- "@vitest/coverage-v8": "^4.1.6",
37
- "playwright": "^1.57.0",
38
- "typescript": "^6.0.2",
39
- "vitest": "^4.1.6"
40
- },
41
- "gitHead": "bed2b46f1ec33a47a7dcae2e6d4b7ab99bd06981"
2
+ "name": "@uipath/packager-tool-case",
3
+ "version": "1.197.0-preview.64",
4
+ "description": "UiPath Case Management tool implementation",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "source": "./src/index.ts",
9
+ "default": "./dist/index.js"
10
+ }
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/UiPath/cli.git",
15
+ "directory": "packages/packager/packager-tool-case"
16
+ },
17
+ "publishConfig": {
18
+ "registry": "https://registry.npmjs.org/"
19
+ },
20
+ "types": "./dist/index.d.ts",
21
+ "files": [
22
+ "dist",
23
+ "src"
24
+ ],
25
+ "author": "",
26
+ "license": "ISC",
27
+ "peerDependencies": {
28
+ "@uipath/solutionpackager-tool-core": "1.197.0"
29
+ },
30
+ "gitHead": "3977b977945bf519336258da69fd271433eaaef4"
42
31
  }
package/src/case-tool.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import type {
2
- EntryPointsFileModel,
3
2
  IProjectBuildOptions,
4
3
  IProjectPackOptions,
5
4
  IProjectRestoreOptions,
6
5
  IProjectValidateOptions,
7
6
  } from "@uipath/solutionpackager-tool-core";
8
7
  import {
8
+ ensureContentOperateFile,
9
9
  type IFileSystem,
10
10
  type IToolLogger,
11
11
  NugetConstants,
@@ -182,69 +182,12 @@ export class CaseTool extends ProjectTool {
182
182
  options: IProjectBuildOptions,
183
183
  contentFolder: string,
184
184
  ): Promise<void> {
185
- const operateJsonFilePath = Path.join(
185
+ await ensureContentOperateFile(this.fileSystem, {
186
186
  contentFolder,
187
- NugetConstants.OperateFileName,
188
- );
189
-
190
- const exists = await this.fileSystem.exists(operateJsonFilePath);
191
- if (!exists) {
192
- await this.createOperateJsonFile(
193
- contentFolder,
194
- options.projectStorageId ?? "",
195
- operateJsonFilePath,
196
- );
197
- }
198
- }
199
-
200
- /**
201
- * Create the operate.json file with project configuration.
202
- * Uses contentType "CaseManagement".
203
- */
204
- private async createOperateJsonFile(
205
- projectPath: string,
206
- projectId: string,
207
- filePath: string,
208
- ): Promise<void> {
209
- const entryPointsFilePath = Path.join(
210
- projectPath,
211
- CaseConstants.EntryPointsFileName,
212
- );
213
- let mainPath = "";
214
-
215
- const entryPointsExists =
216
- await this.fileSystem.exists(entryPointsFilePath);
217
- if (entryPointsExists) {
218
- const entryPointsContent =
219
- await this.fileSystem.readFile(entryPointsFilePath);
220
- if (entryPointsContent) {
221
- try {
222
- const entryPointsText = new TextDecoder().decode(
223
- entryPointsContent,
224
- );
225
- const entryPoints: EntryPointsFileModel =
226
- JSON.parse(entryPointsText);
227
- mainPath = entryPoints.entryPoints?.[0]?.filePath ?? "";
228
- } catch {
229
- // Ignore parsing errors, use empty mainPath
230
- }
231
- }
232
- }
233
-
234
- const operateFileModel = {
235
- $schema: "https://cloud.uipath.com/draft/2024-12/operate",
187
+ projectPath: options.projectPath,
188
+ projectStorageId: options.projectStorageId,
236
189
  contentType: ProjectTypes.CaseManagement,
237
- projectId: projectId,
238
- main: mainPath,
239
- targetFramework: "Portable",
240
- runtimeOptions: {
241
- isAttended: false,
242
- requiresUserInteraction: false,
243
- },
244
- };
245
-
246
- const operateJsonString = JSON.stringify(operateFileModel, null, 2);
247
- await this.fileSystem.writeFile(filePath, operateJsonString);
190
+ });
248
191
  }
249
192
 
250
193
  /**
package/src/index.ts CHANGED
@@ -1,5 +1,13 @@
1
- // Self-register Case Management tool factory with the singleton repository
1
+ // Case Management tool factory.
2
+ //
3
+ // Self-registers on import so micro-frontend consumers (whose MFEs UiPath does
4
+ // not control) that load this package via a side-effect import get the factory
5
+ // registered automatically — StudioWeb does not reference this package, so it
6
+ // relies on self-registration. Also exported for consumers that register
7
+ // explicitly; re-registering the same factory class is an idempotent no-op.
2
8
  import { toolsFactoryRepository } from "@uipath/solutionpackager-tool-core";
3
9
  import { CaseToolFactory } from "./case-tool-factory.js";
4
10
 
5
11
  toolsFactoryRepository.registerProjectToolFactory(new CaseToolFactory());
12
+
13
+ export { CaseToolFactory };