@uipath/packager-tool-apiworkflow 0.0.18 → 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.
- package/dist/api-workflows-tool.d.ts +0 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -38
- package/package.json +29 -57
- package/src/api-workflows-tool.ts +5 -61
- package/src/index.ts +3 -5
|
@@ -19,10 +19,6 @@ export declare class ApiWorkflowsTool extends ProjectTool {
|
|
|
19
19
|
* Create operate.json file if it doesn't already exist
|
|
20
20
|
*/
|
|
21
21
|
private createOperateFile;
|
|
22
|
-
/**
|
|
23
|
-
* Create the operate.json file with project configuration
|
|
24
|
-
*/
|
|
25
|
-
private createOperateJsonFile;
|
|
26
22
|
/**
|
|
27
23
|
* Create package-descriptor.json file
|
|
28
24
|
*/
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -379,9 +379,6 @@ I18nManager.registerTranslations("zh-CN", zh_CN_default);
|
|
|
379
379
|
I18nManager.registerTranslations("zh-TW", zh_TW_default);
|
|
380
380
|
I18nManager.registerTranslations("zu", zu_default);
|
|
381
381
|
|
|
382
|
-
// src/index.ts
|
|
383
|
-
import { toolsFactoryRepository } from "@uipath/solutionpackager-tool-core";
|
|
384
|
-
|
|
385
382
|
// src/api-workflow-tool-factory.ts
|
|
386
383
|
import {
|
|
387
384
|
ProjectTypes as ProjectTypes2
|
|
@@ -389,6 +386,7 @@ import {
|
|
|
389
386
|
|
|
390
387
|
// src/api-workflows-tool.ts
|
|
391
388
|
import {
|
|
389
|
+
ensureContentOperateFile,
|
|
392
390
|
NugetConstants,
|
|
393
391
|
NugetPackager,
|
|
394
392
|
Path,
|
|
@@ -474,39 +472,12 @@ class ApiWorkflowsTool extends ProjectTool {
|
|
|
474
472
|
}
|
|
475
473
|
}
|
|
476
474
|
async createOperateFile(options, contentFolder) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
async createOperateJsonFile(projectPath, projectId, filePath) {
|
|
484
|
-
const entryPointsFilePath = Path.join(projectPath, NugetConstants.EntryPointsFileName);
|
|
485
|
-
let mainPath = "";
|
|
486
|
-
const entryPointsExists = await this.fileSystem.exists(entryPointsFilePath);
|
|
487
|
-
if (entryPointsExists) {
|
|
488
|
-
const entryPointsContent = await this.fileSystem.readFile(entryPointsFilePath);
|
|
489
|
-
if (entryPointsContent) {
|
|
490
|
-
try {
|
|
491
|
-
const entryPointsText = new TextDecoder().decode(entryPointsContent);
|
|
492
|
-
const entryPoints = JSON.parse(entryPointsText);
|
|
493
|
-
mainPath = entryPoints.entryPoints?.[0]?.filePath ?? "";
|
|
494
|
-
} catch {}
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
const operateFileModel = {
|
|
498
|
-
$schema: "https://cloud.uipath.com/draft/2024-12/operate",
|
|
499
|
-
contentType: ProjectTypes.Api,
|
|
500
|
-
projectId,
|
|
501
|
-
main: mainPath,
|
|
502
|
-
targetFramework: "Portable",
|
|
503
|
-
runtimeOptions: {
|
|
504
|
-
isAttended: false,
|
|
505
|
-
requiresUserInteraction: false
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
const operateJsonString = JSON.stringify(operateFileModel, null, 2);
|
|
509
|
-
await this.fileSystem.writeFile(filePath, operateJsonString);
|
|
475
|
+
await ensureContentOperateFile(this.fileSystem, {
|
|
476
|
+
contentFolder,
|
|
477
|
+
projectPath: options.projectPath,
|
|
478
|
+
projectStorageId: options.projectStorageId,
|
|
479
|
+
contentType: ProjectTypes.Api
|
|
480
|
+
});
|
|
510
481
|
}
|
|
511
482
|
async createPackageDescriptor(localBuildFolder) {
|
|
512
483
|
const packageDescriptor = {
|
|
@@ -535,6 +506,8 @@ class ApiWorkflowToolFactory {
|
|
|
535
506
|
return new ApiWorkflowsTool(fileSystem, logger);
|
|
536
507
|
}
|
|
537
508
|
}
|
|
509
|
+
export {
|
|
510
|
+
ApiWorkflowToolFactory
|
|
511
|
+
};
|
|
538
512
|
|
|
539
|
-
|
|
540
|
-
toolsFactoryRepository.registerProjectToolFactory(new ApiWorkflowToolFactory);
|
|
513
|
+
//# debugId=AA5FDABCE050FEB264756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,59 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"publish:dry": "bun publish --dry-run",
|
|
32
|
-
"publish:gh": "bun publish",
|
|
33
|
-
"version:patch": "bun version patch --no-git-tag-version",
|
|
34
|
-
"version:minor": "bun version minor --no-git-tag-version",
|
|
35
|
-
"version:major": "bun version major --no-git-tag-version",
|
|
36
|
-
"lint": "biome check ."
|
|
37
|
-
},
|
|
38
|
-
"files": [
|
|
39
|
-
"dist",
|
|
40
|
-
"!dist/**/*.map",
|
|
41
|
-
"src"
|
|
42
|
-
],
|
|
43
|
-
"author": "",
|
|
44
|
-
"license": "ISC",
|
|
45
|
-
"peerDependencies": {
|
|
46
|
-
"@uipath/solutionpackager-tool-core": "0.0.33"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@types/node": "^25.5.0",
|
|
50
|
-
"@uipath/solutionpackager-tool-core": "0.0.33",
|
|
51
|
-
"@vitest/browser": "^4.0.14",
|
|
52
|
-
"@vitest/browser-playwright": "^4.0.14",
|
|
53
|
-
"@vitest/coverage-v8": "^4.0.14",
|
|
54
|
-
"playwright": "^1.57.0",
|
|
55
|
-
"typescript": "^5.9.3",
|
|
56
|
-
"vitest": "^4.0.14"
|
|
57
|
-
},
|
|
58
|
-
"gitHead": "3f1b4d8e9f910be81e4cab956537f21dbd5d63ac"
|
|
2
|
+
"name": "@uipath/packager-tool-apiworkflow",
|
|
3
|
+
"version": "1.197.0-preview.64",
|
|
4
|
+
"description": "UiPath API Workflow 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-apiworkflow"
|
|
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"
|
|
59
31
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
EntryPointsFileModel,
|
|
3
2
|
IProjectBuildOptions,
|
|
4
3
|
IProjectPackOptions,
|
|
5
4
|
IProjectRestoreOptions,
|
|
@@ -7,6 +6,7 @@ import type {
|
|
|
7
6
|
PackageDescriptorFileModel,
|
|
8
7
|
} from "@uipath/solutionpackager-tool-core";
|
|
9
8
|
import {
|
|
9
|
+
ensureContentOperateFile,
|
|
10
10
|
type IFileSystem,
|
|
11
11
|
type IToolLogger,
|
|
12
12
|
NugetConstants,
|
|
@@ -189,68 +189,12 @@ export class ApiWorkflowsTool extends ProjectTool {
|
|
|
189
189
|
options: IProjectBuildOptions,
|
|
190
190
|
contentFolder: string,
|
|
191
191
|
): Promise<void> {
|
|
192
|
-
|
|
192
|
+
await ensureContentOperateFile(this.fileSystem, {
|
|
193
193
|
contentFolder,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const exists = await this.fileSystem.exists(operateJsonFilePath);
|
|
198
|
-
if (!exists) {
|
|
199
|
-
await this.createOperateJsonFile(
|
|
200
|
-
contentFolder,
|
|
201
|
-
options.projectStorageId ?? "",
|
|
202
|
-
operateJsonFilePath,
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Create the operate.json file with project configuration
|
|
209
|
-
*/
|
|
210
|
-
private async createOperateJsonFile(
|
|
211
|
-
projectPath: string,
|
|
212
|
-
projectId: string,
|
|
213
|
-
filePath: string,
|
|
214
|
-
): Promise<void> {
|
|
215
|
-
const entryPointsFilePath = Path.join(
|
|
216
|
-
projectPath,
|
|
217
|
-
NugetConstants.EntryPointsFileName,
|
|
218
|
-
);
|
|
219
|
-
let mainPath = "";
|
|
220
|
-
|
|
221
|
-
const entryPointsExists =
|
|
222
|
-
await this.fileSystem.exists(entryPointsFilePath);
|
|
223
|
-
if (entryPointsExists) {
|
|
224
|
-
const entryPointsContent =
|
|
225
|
-
await this.fileSystem.readFile(entryPointsFilePath);
|
|
226
|
-
if (entryPointsContent) {
|
|
227
|
-
try {
|
|
228
|
-
const entryPointsText = new TextDecoder().decode(
|
|
229
|
-
entryPointsContent,
|
|
230
|
-
);
|
|
231
|
-
const entryPoints: EntryPointsFileModel =
|
|
232
|
-
JSON.parse(entryPointsText);
|
|
233
|
-
mainPath = entryPoints.entryPoints?.[0]?.filePath ?? "";
|
|
234
|
-
} catch {
|
|
235
|
-
// Ignore parsing errors, use empty mainPath
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
const operateFileModel = {
|
|
241
|
-
$schema: "https://cloud.uipath.com/draft/2024-12/operate",
|
|
194
|
+
projectPath: options.projectPath,
|
|
195
|
+
projectStorageId: options.projectStorageId,
|
|
242
196
|
contentType: ProjectTypes.Api,
|
|
243
|
-
|
|
244
|
-
main: mainPath,
|
|
245
|
-
targetFramework: "Portable",
|
|
246
|
-
runtimeOptions: {
|
|
247
|
-
isAttended: false,
|
|
248
|
-
requiresUserInteraction: false,
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
const operateJsonString = JSON.stringify(operateFileModel, null, 2);
|
|
253
|
-
await this.fileSystem.writeFile(filePath, operateJsonString);
|
|
197
|
+
});
|
|
254
198
|
}
|
|
255
199
|
|
|
256
200
|
/**
|
package/src/index.ts
CHANGED
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
import "./i18n/index.js";
|
|
6
6
|
|
|
7
7
|
// ============================================================================
|
|
8
|
-
//
|
|
8
|
+
// Public API — consumers register this factory explicitly via
|
|
9
|
+
// `toolsFactoryRepository.registerProjectToolFactory(new ApiWorkflowToolFactory())`.
|
|
9
10
|
// ============================================================================
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
import { ApiWorkflowToolFactory } from "./api-workflow-tool-factory.js";
|
|
13
|
-
|
|
14
|
-
toolsFactoryRepository.registerProjectToolFactory(new ApiWorkflowToolFactory());
|
|
12
|
+
export { ApiWorkflowToolFactory } from "./api-workflow-tool-factory.js";
|