@uipath/packager-tool-flow 1.196.0 → 1.197.0-preview.59
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/flow-tool.d.ts +0 -4
- package/dist/index.js +22 -46
- package/package.json +9 -10
- package/src/flow-tool.ts +12 -68
- package/src/index.ts +7 -1
package/dist/flow-tool.d.ts
CHANGED
|
@@ -47,10 +47,6 @@ export declare class FlowTool extends ProjectTool {
|
|
|
47
47
|
* Create operate.json file if it doesn't already exist
|
|
48
48
|
*/
|
|
49
49
|
private createOperateFile;
|
|
50
|
-
/**
|
|
51
|
-
* Create the operate.json file with project configuration
|
|
52
|
-
*/
|
|
53
|
-
private createOperateJsonFile;
|
|
54
50
|
/**
|
|
55
51
|
* Create package-descriptor.json file.
|
|
56
52
|
* Lists standard packaging files plus .bpmn and .flow files from content/.
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
ProjectType
|
|
19
19
|
} from "@uipath/flow-schema";
|
|
20
20
|
import {
|
|
21
|
+
ensureProjectId,
|
|
21
22
|
NugetConstants,
|
|
22
23
|
NugetPackager,
|
|
23
24
|
Path as Path3,
|
|
@@ -25,12 +26,13 @@ import {
|
|
|
25
26
|
ProjectTypes,
|
|
26
27
|
TemporaryStorageService,
|
|
27
28
|
ToolErrorCodes,
|
|
28
|
-
ToolResult
|
|
29
|
+
ToolResult,
|
|
30
|
+
writeContentOperateFile
|
|
29
31
|
} from "@uipath/solutionpackager-tool-core";
|
|
30
32
|
// package.json
|
|
31
33
|
var package_default = {
|
|
32
34
|
name: "@uipath/packager-tool-flow",
|
|
33
|
-
version: "1.
|
|
35
|
+
version: "1.197.0-preview.59",
|
|
34
36
|
description: "UiPath Flow tool implementation",
|
|
35
37
|
type: "module",
|
|
36
38
|
exports: {
|
|
@@ -49,7 +51,7 @@ var package_default = {
|
|
|
49
51
|
},
|
|
50
52
|
types: "./dist/index.d.ts",
|
|
51
53
|
scripts: {
|
|
52
|
-
build: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --external @uipath/tool-agent --external @uipath/flow-core --external @uipath/flow-converter --external @uipath/flow-migrations --external @uipath/flow-schema && tsc --emitDeclarationOnly --outDir dist",
|
|
54
|
+
build: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --external @uipath/tool-agent --external @uipath/flow-core --external @uipath/flow-converter --external @uipath/flow-migrations --external @uipath/flow-schema --sourcemap=linked && tsc --emitDeclarationOnly --outDir dist",
|
|
53
55
|
dev: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --external @uipath/tool-agent --external @uipath/flow-core --external @uipath/flow-converter --external @uipath/flow-migrations --external @uipath/flow-schema --watch",
|
|
54
56
|
test: "vitest run",
|
|
55
57
|
"test:browser": "vitest run --config=vitest.browser.config.ts",
|
|
@@ -67,26 +69,25 @@ var package_default = {
|
|
|
67
69
|
},
|
|
68
70
|
files: [
|
|
69
71
|
"dist",
|
|
70
|
-
"!dist/**/*.map",
|
|
71
72
|
"src"
|
|
72
73
|
],
|
|
73
74
|
author: "",
|
|
74
75
|
license: "ISC",
|
|
75
76
|
peerDependencies: {
|
|
76
77
|
"@uipath/filesystem": "workspace:*",
|
|
77
|
-
"@uipath/flow-converter": "^0.
|
|
78
|
-
"@uipath/flow-core": "^0.
|
|
79
|
-
"@uipath/flow-migrations": "^0.
|
|
80
|
-
"@uipath/flow-schema": "^0.
|
|
78
|
+
"@uipath/flow-converter": "^0.8.2",
|
|
79
|
+
"@uipath/flow-core": "^0.10.3",
|
|
80
|
+
"@uipath/flow-migrations": "^0.8.0",
|
|
81
|
+
"@uipath/flow-schema": "^0.10.3",
|
|
81
82
|
"@uipath/solutionpackager-tool-core": "workspace:*",
|
|
82
|
-
"@uipath/tool-agent": "^
|
|
83
|
+
"@uipath/tool-agent": "^2.0.0"
|
|
83
84
|
},
|
|
84
85
|
devDependencies: {
|
|
85
86
|
"@types/node": "^25.5.2",
|
|
86
87
|
"@uipath/filesystem": "workspace:*",
|
|
87
|
-
"@uipath/flow-core": "^0.
|
|
88
|
+
"@uipath/flow-core": "^0.10.3",
|
|
88
89
|
"@uipath/solutionpackager-tool-core": "workspace:*",
|
|
89
|
-
"@uipath/tool-agent": "^
|
|
90
|
+
"@uipath/tool-agent": "^2.0.0",
|
|
90
91
|
"@vitest/browser": "^4.1.6",
|
|
91
92
|
"@vitest/browser-playwright": "^4.1.6",
|
|
92
93
|
"@vitest/coverage-v8": "^4.1.6",
|
|
@@ -375,10 +376,11 @@ class FlowTool extends ProjectTool {
|
|
|
375
376
|
await processAgents(this.fileSystem, this.logger, options.projectPath, contentFolder);
|
|
376
377
|
this.logger.progress("Resolving process bindings...");
|
|
377
378
|
await this.resolveProcessBindings(contentFolder);
|
|
379
|
+
const projectId = options.projectStorageId ?? await ensureProjectId(options.projectPath, this.fileSystem);
|
|
378
380
|
this.logger.progress("Generating packaging artifacts from .flow...");
|
|
379
|
-
await this.generateFlowPackagingArtifacts(contentFolder,
|
|
381
|
+
await this.generateFlowPackagingArtifacts(contentFolder, projectId);
|
|
380
382
|
this.logger.progress("Creating operate.json file...");
|
|
381
|
-
await this.createOperateFile(
|
|
383
|
+
await this.createOperateFile(contentFolder, projectId);
|
|
382
384
|
this.logger.progress("Creating package-descriptor.json file...");
|
|
383
385
|
await this.createPackageDescriptor(localBuildFolder, contentFolder);
|
|
384
386
|
return new ToolResult(ToolErrorCodes.Success, "done", [
|
|
@@ -592,40 +594,12 @@ class FlowTool extends ProjectTool {
|
|
|
592
594
|
}
|
|
593
595
|
}
|
|
594
596
|
}
|
|
595
|
-
async createOperateFile(
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
if (!exists) {
|
|
599
|
-
await this.createOperateJsonFile(contentFolder, options.projectStorageId ?? "", operateJsonFilePath);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
async createOperateJsonFile(projectPath, projectId, filePath) {
|
|
603
|
-
const entryPointsFilePath = Path3.join(projectPath, FlowConstants.EntryPointsFileName);
|
|
604
|
-
let mainPath = "";
|
|
605
|
-
const entryPointsExists = await this.fileSystem.exists(entryPointsFilePath);
|
|
606
|
-
if (entryPointsExists) {
|
|
607
|
-
const entryPointsContent = await this.fileSystem.readFile(entryPointsFilePath);
|
|
608
|
-
if (entryPointsContent) {
|
|
609
|
-
try {
|
|
610
|
-
const entryPointsText = new TextDecoder().decode(entryPointsContent);
|
|
611
|
-
const entryPoints = JSON.parse(entryPointsText);
|
|
612
|
-
mainPath = entryPoints.entryPoints?.[0]?.filePath ?? "";
|
|
613
|
-
} catch {}
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
const operateFileModel = {
|
|
617
|
-
$schema: "https://cloud.uipath.com/draft/2024-12/operate",
|
|
618
|
-
contentType: ProjectTypes.Flow,
|
|
597
|
+
async createOperateFile(contentFolder, projectId) {
|
|
598
|
+
await writeContentOperateFile(this.fileSystem, {
|
|
599
|
+
contentFolder,
|
|
619
600
|
projectId,
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
runtimeOptions: {
|
|
623
|
-
isAttended: false,
|
|
624
|
-
requiresUserInteraction: false
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
const operateJsonString = JSON.stringify(operateFileModel, null, 2);
|
|
628
|
-
await this.fileSystem.writeFile(filePath, operateJsonString);
|
|
601
|
+
contentType: ProjectTypes.Flow
|
|
602
|
+
});
|
|
629
603
|
}
|
|
630
604
|
async createPackageDescriptor(localBuildFolder, contentFolder) {
|
|
631
605
|
const descriptorFiles = {};
|
|
@@ -666,3 +640,5 @@ export {
|
|
|
666
640
|
FlowToolFactory,
|
|
667
641
|
FlowTool
|
|
668
642
|
};
|
|
643
|
+
|
|
644
|
+
//# debugId=7B7D19E0C515115B64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/packager-tool-flow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.197.0-preview.59",
|
|
4
4
|
"description": "UiPath Flow tool implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -20,19 +20,18 @@
|
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
|
-
"!dist/**/*.map",
|
|
24
23
|
"src"
|
|
25
24
|
],
|
|
26
25
|
"author": "",
|
|
27
26
|
"license": "ISC",
|
|
28
27
|
"peerDependencies": {
|
|
29
|
-
"@uipath/filesystem": "1.
|
|
30
|
-
"@uipath/flow-converter": "^0.
|
|
31
|
-
"@uipath/flow-core": "^0.
|
|
32
|
-
"@uipath/flow-migrations": "^0.
|
|
33
|
-
"@uipath/flow-schema": "^0.
|
|
34
|
-
"@uipath/solutionpackager-tool-core": "1.
|
|
35
|
-
"@uipath/tool-agent": "^
|
|
28
|
+
"@uipath/filesystem": "1.197.0",
|
|
29
|
+
"@uipath/flow-converter": "^0.8.2",
|
|
30
|
+
"@uipath/flow-core": "^0.10.3",
|
|
31
|
+
"@uipath/flow-migrations": "^0.8.0",
|
|
32
|
+
"@uipath/flow-schema": "^0.10.3",
|
|
33
|
+
"@uipath/solutionpackager-tool-core": "1.197.0",
|
|
34
|
+
"@uipath/tool-agent": "^2.0.0"
|
|
36
35
|
},
|
|
37
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "df0e2b8140cced13f463b487214927c82bc0f85b"
|
|
38
37
|
}
|
package/src/flow-tool.ts
CHANGED
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
type Workflow,
|
|
16
16
|
} from "@uipath/flow-schema";
|
|
17
17
|
import type {
|
|
18
|
-
EntryPointsFileModel,
|
|
19
18
|
IProjectBuildOptions,
|
|
20
19
|
IProjectPackOptions,
|
|
21
20
|
IProjectRestoreOptions,
|
|
22
21
|
IProjectValidateOptions,
|
|
23
22
|
} from "@uipath/solutionpackager-tool-core";
|
|
24
23
|
import {
|
|
24
|
+
ensureProjectId,
|
|
25
25
|
type IFileSystem,
|
|
26
26
|
type IToolLogger,
|
|
27
27
|
NugetConstants,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
TemporaryStorageService,
|
|
33
33
|
ToolErrorCodes,
|
|
34
34
|
ToolResult,
|
|
35
|
+
writeContentOperateFile,
|
|
35
36
|
} from "@uipath/solutionpackager-tool-core";
|
|
36
37
|
import pkg from "../package.json" with { type: "json" };
|
|
37
38
|
import { processAgents } from "./agents.js";
|
|
@@ -103,16 +104,17 @@ export class FlowTool extends ProjectTool {
|
|
|
103
104
|
this.logger.progress("Resolving process bindings...");
|
|
104
105
|
await this.resolveProcessBindings(contentFolder);
|
|
105
106
|
|
|
107
|
+
const projectId =
|
|
108
|
+
options.projectStorageId ??
|
|
109
|
+
(await ensureProjectId(options.projectPath, this.fileSystem));
|
|
110
|
+
|
|
106
111
|
this.logger.progress(
|
|
107
112
|
"Generating packaging artifacts from .flow...",
|
|
108
113
|
);
|
|
109
|
-
await this.generateFlowPackagingArtifacts(
|
|
110
|
-
contentFolder,
|
|
111
|
-
options.projectStorageId ?? "",
|
|
112
|
-
);
|
|
114
|
+
await this.generateFlowPackagingArtifacts(contentFolder, projectId);
|
|
113
115
|
|
|
114
116
|
this.logger.progress("Creating operate.json file...");
|
|
115
|
-
await this.createOperateFile(
|
|
117
|
+
await this.createOperateFile(contentFolder, projectId);
|
|
116
118
|
|
|
117
119
|
this.logger.progress("Creating package-descriptor.json file...");
|
|
118
120
|
await this.createPackageDescriptor(localBuildFolder, contentFolder);
|
|
@@ -497,72 +499,14 @@ export class FlowTool extends ProjectTool {
|
|
|
497
499
|
* Create operate.json file if it doesn't already exist
|
|
498
500
|
*/
|
|
499
501
|
private async createOperateFile(
|
|
500
|
-
options: IProjectBuildOptions,
|
|
501
502
|
contentFolder: string,
|
|
502
|
-
): Promise<void> {
|
|
503
|
-
const operateJsonFilePath = Path.join(
|
|
504
|
-
contentFolder,
|
|
505
|
-
NugetConstants.OperateFileName,
|
|
506
|
-
);
|
|
507
|
-
|
|
508
|
-
const exists = await this.fileSystem.exists(operateJsonFilePath);
|
|
509
|
-
if (!exists) {
|
|
510
|
-
await this.createOperateJsonFile(
|
|
511
|
-
contentFolder,
|
|
512
|
-
options.projectStorageId ?? "",
|
|
513
|
-
operateJsonFilePath,
|
|
514
|
-
);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* Create the operate.json file with project configuration
|
|
520
|
-
*/
|
|
521
|
-
private async createOperateJsonFile(
|
|
522
|
-
projectPath: string,
|
|
523
503
|
projectId: string,
|
|
524
|
-
filePath: string,
|
|
525
504
|
): Promise<void> {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
FlowConstants.EntryPointsFileName,
|
|
530
|
-
);
|
|
531
|
-
let mainPath = "";
|
|
532
|
-
|
|
533
|
-
const entryPointsExists =
|
|
534
|
-
await this.fileSystem.exists(entryPointsFilePath);
|
|
535
|
-
if (entryPointsExists) {
|
|
536
|
-
const entryPointsContent =
|
|
537
|
-
await this.fileSystem.readFile(entryPointsFilePath);
|
|
538
|
-
if (entryPointsContent) {
|
|
539
|
-
try {
|
|
540
|
-
const entryPointsText = new TextDecoder().decode(
|
|
541
|
-
entryPointsContent,
|
|
542
|
-
);
|
|
543
|
-
const entryPoints: EntryPointsFileModel =
|
|
544
|
-
JSON.parse(entryPointsText);
|
|
545
|
-
mainPath = entryPoints.entryPoints?.[0]?.filePath ?? "";
|
|
546
|
-
} catch {
|
|
547
|
-
// Ignore parsing errors, use empty mainPath
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
const operateFileModel = {
|
|
553
|
-
$schema: "https://cloud.uipath.com/draft/2024-12/operate",
|
|
505
|
+
await writeContentOperateFile(this.fileSystem, {
|
|
506
|
+
contentFolder,
|
|
507
|
+
projectId,
|
|
554
508
|
contentType: ProjectTypes.Flow,
|
|
555
|
-
|
|
556
|
-
main: mainPath,
|
|
557
|
-
targetFramework: "Portable",
|
|
558
|
-
runtimeOptions: {
|
|
559
|
-
isAttended: false,
|
|
560
|
-
requiresUserInteraction: false,
|
|
561
|
-
},
|
|
562
|
-
};
|
|
563
|
-
|
|
564
|
-
const operateJsonString = JSON.stringify(operateFileModel, null, 2);
|
|
565
|
-
await this.fileSystem.writeFile(filePath, operateJsonString);
|
|
509
|
+
});
|
|
566
510
|
}
|
|
567
511
|
|
|
568
512
|
/**
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Flow 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 { FlowToolFactory } from "./flow-tool-factory.js";
|
|
4
10
|
|