@uipath/solution-tool 1.205.0-preview.281 → 1.206.0-preview.279
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/{archive-extract-x35t9ktj.js → archive-extract-136rn3ja.js} +13 -15
- package/dist/{cleanup-command-service-je9d70vv.js → cleanup-command-service-ejakyhea.js} +34 -31
- package/dist/deploy-delete-service-r7abfh28.js +23 -0
- package/dist/deploy-run-service-rnthz10q.js +23 -0
- package/dist/{deploy-status-service-919yn8wn.js → deploy-status-service-6my5vm61.js} +72 -62
- package/dist/deploy.js +35 -37
- package/dist/deployment-search-gfm907tx.js +54 -0
- package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/feed-resolver-14crsx5y.js +27 -0
- package/dist/feed-scope-failure-67cyybn0.js +20 -0
- package/dist/feed-session-g94q2bjc.js +23 -0
- package/dist/first-party-service-n3vva2m4.js +8 -0
- package/dist/governance-options-t20vsznh.js +19 -0
- package/dist/index-aspmac9f.js +24 -0
- package/dist/index-ddk6v1ej.js +60 -0
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-qq4kre7a.js +93 -0
- package/dist/index-t262f2xv.js +16 -0
- package/dist/index.js +33 -34
- package/dist/init.js +18 -21
- package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/{list-5fke71jn.js → list-jntan9tx.js} +23 -23
- package/dist/models/pack-command-types.d.ts +3 -1
- package/dist/node-kwzcw5ex.js +25 -0
- package/dist/pack-command-service-pwaeha7y.js +29 -0
- package/dist/{pack-project-ha0pxw3h.js → pack-project-ztt1hfrs.js} +33 -40
- package/dist/pack.js +26 -30
- package/dist/package-id-4tsg5jsb.js +11 -0
- package/dist/{packager-tool-4pa108k7.js → packager-tool-1bz9h5ca.js} +11 -11
- package/dist/{packager-tool-gs3f3tf7.js → packager-tool-1ctvbx0h.js} +1 -1
- package/dist/{packager-tool-f23a485e.js → packager-tool-55ztfccd.js} +176 -196
- package/dist/{packager-tool-45a8fkw0.js → packager-tool-95y24705.js} +37 -39
- package/dist/{packager-tool-2vmz56qh.js → packager-tool-9j8e5q1z.js} +184 -33
- package/dist/{packager-tool-tx834spe.js → packager-tool-9vrwpgt3.js} +757 -309
- package/dist/packager-tool-a6va4gc5.js +1178 -0
- package/dist/{packager-tool-pbmqk39a.js → packager-tool-a7s0gbxs.js} +33 -28
- package/dist/{packager-tool-47wzvqw0.js → packager-tool-aws5w512.js} +6 -6
- package/dist/{packager-tool-97rcgwvv.js → packager-tool-bs1jn1yn.js} +331 -55
- package/dist/packager-tool-c64hqa8n.js +106 -0
- package/dist/{packager-tool-5ddtwzva.js → packager-tool-ca5ngmqv.js} +12 -12
- package/dist/{packager-tool-6kz1pv9f.js → packager-tool-d1texmvn.js} +828 -338
- package/dist/{packager-tool-1de529jm.js → packager-tool-epsr41wx.js} +12 -3
- package/dist/packager-tool-f84z7nds.js +130 -0
- package/dist/{packager-tool-8ptbmmmp.js → packager-tool-fp46ebde.js} +147 -76
- package/dist/packager-tool-fqs6hdcy.js +290 -0
- package/dist/{packager-tool-3bwnkjdq.js → packager-tool-fx4ws49n.js} +12 -12
- package/dist/{packager-tool-6ybywxxn.js → packager-tool-m07vyk89.js} +371 -221
- package/dist/{packager-tool-gyqfs04e.js → packager-tool-nrhqgr4z.js} +273 -255
- package/dist/{packager-tool-61pwb567.js → packager-tool-ppj5f4y7.js} +6 -7
- package/dist/{packager-tool-d78ww4hb.js → packager-tool-pyt9fvty.js} +51 -48
- package/dist/packager-tool-q5d9df2q.js +74 -0
- package/dist/{packager-tool-cvf46scg.js → packager-tool-q8ryk6q9.js} +122 -89
- package/dist/{packager-tool-t8gh825q.js → packager-tool-qf8753ee.js} +53 -41
- package/dist/{packager-tool-60af1hw2.js → packager-tool-qzcd5c9s.js} +3 -3
- package/dist/packager-tool-resolver-td3bhccd.js +20 -0
- package/dist/{packager-tool-dfrk01gn.js → packager-tool-rj2d1g0w.js} +154 -154
- package/dist/{packager-tool-2t72aez8.js → packager-tool-snm6s7b5.js} +15 -15
- package/dist/{packager-tool-43ahv5mn.js → packager-tool-t39pjz7n.js} +35 -18
- package/dist/{packager-tool-wm0jaz7p.js → packager-tool-t3a48ys5.js} +305 -657
- package/dist/{packager-tool-dnrk1gg6.js → packager-tool-t3ahzjh1.js} +356 -298
- package/dist/{packager-tool-v1f5e8t9.js → packager-tool-vgrswa8p.js} +53 -8
- package/dist/packager-tool-vrtabg73.js +2307 -0
- package/dist/{packager-tool-gmwva4yv.js → packager-tool-vx2c68sb.js} +2 -2
- package/dist/{packager-tool-h1tq7bqf.js → packager-tool-vx39dhvn.js} +65 -35
- package/dist/{packager-tool-5qzgdb66.js → packager-tool-w34wyhwf.js} +13 -15
- package/dist/packager-tool-w8bcwfd3.js +280 -0
- package/dist/{packager-tool-1ybnxbp9.js → packager-tool-wm0h0wa1.js} +18 -18
- package/dist/{packager-tool-b2nhscfk.js → packager-tool-wm8nj6e9.js} +18 -18
- package/dist/{packager-tool-amhyxzz6.js → packager-tool-x33sdw6n.js} +16 -16
- package/dist/{packager-tool-wy4fx250.js → packager-tool-yetmzme9.js} +89 -30
- package/dist/{packager-tool-056k8w2f.js → packager-tool-z5r49ky9.js} +75 -9
- package/dist/packager-tool.js +6 -7
- package/dist/prepare-solution-resources-pwnyvtza.js +26 -0
- package/dist/{project-command-utils-t6pmpvq3.js → project-command-utils-zcmbecfy.js} +23 -26
- package/dist/project-contributions-kh9yftvg.js +27 -0
- package/dist/publish.js +17 -17
- package/dist/resource-mutations-mfn5k1hb.js +27 -0
- package/dist/{resource-version-lookup-0e3e2j58.js → resource-version-lookup-6ejh1hwd.js} +20 -23
- package/dist/resource.js +13 -16
- package/dist/{restore-command-service-pzpet021.js → restore-command-service-n880dxre.js} +37 -34
- package/dist/{run-service-hk8w2h31.js → run-service-4vhn6mtb.js} +144 -66
- package/dist/services/deploy-activate-service.d.ts +2 -1
- package/dist/services/deployment-search-client.d.ts +2 -1
- package/dist/services/deployment-search.d.ts +39 -0
- package/dist/services/feed-resolver.d.ts +13 -1
- package/dist/services/feed-selection.d.ts +8 -5
- package/dist/services/feed-session.d.ts +34 -0
- package/dist/services/install-run.d.ts +92 -0
- package/dist/services/prepare-solution-resources.d.ts +11 -2
- package/dist/services/project-contributions.d.ts +2 -0
- package/dist/services/project-identity-telemetry.d.ts +3 -0
- package/dist/services/publish-service.d.ts +20 -3
- package/dist/services/solution-identity.d.ts +18 -0
- package/dist/ship-telemetry-bkf3800w.js +16 -0
- package/dist/solution-auth-jxcgd2m0.js +10 -0
- package/dist/solution-identity-92h2fbpa.js +19 -0
- package/dist/templates/AGENTS.md +27 -29
- package/dist/tool.js +32 -33
- package/package.json +2 -2
- package/dist/deploy-delete-service-0tm600d1.js +0 -25
- package/dist/deploy-run-service-hne5w17k.js +0 -25
- package/dist/deployment-search-32zvxn35.js +0 -55
- package/dist/feed-resolver-pdeb4wkq.js +0 -28
- package/dist/feed-scope-failure-4baame72.js +0 -19
- package/dist/feed-session-7xqphdrg.js +0 -17
- package/dist/first-party-service-sd8yaf73.js +0 -27
- package/dist/governance-options-bqgv5fte.js +0 -32
- package/dist/index-dqa169gp.js +0 -25
- package/dist/index-prm27bvm.js +0 -138
- package/dist/index-wdndcwab.js +0 -667
- package/dist/node-v7xhqwe2.js +0 -86
- package/dist/pack-command-service-b1v9c8cw.js +0 -35
- package/dist/package-id-rpzgy31w.js +0 -13
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-5edvzz80.js +0 -543
- package/dist/packager-tool-99jaqabz.js +0 -171
- package/dist/packager-tool-9hsmn8th.js +0 -418
- package/dist/packager-tool-azre7mm1.js +0 -182
- package/dist/packager-tool-fn13r8e1.js +0 -188
- package/dist/packager-tool-gdtpsdn7.js +0 -342
- package/dist/packager-tool-qw47eyw7.js +0 -43
- package/dist/packager-tool-resolver-994z3jkj.js +0 -23
- package/dist/packager-tool-tedbebpq.js +0 -5367
- package/dist/packager-tool-x1ah4eez.js +0 -68
- package/dist/prepare-solution-resources-m1djfj62.js +0 -29
- package/dist/project-contributions-79ndycrx.js +0 -32
- package/dist/resource-mutations-c3krjqze.js +0 -36
- package/dist/ship-telemetry-myes7ak5.js +0 -21
- package/dist/solution-auth-aead70sw.js +0 -11
- /package/dist/{packager-tool-act5r386.js → packager-tool-2pxe2r4j.js} +0 -0
- /package/dist/{packager-tool-kkfb5kgn.js → packager-tool-vrqbbh01.js} +0 -0
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
|
-
I18nManager,
|
|
3
|
-
LogMessage,
|
|
4
|
-
NugetPackager,
|
|
5
2
|
Path,
|
|
6
|
-
ProjectTool,
|
|
7
3
|
TemporaryStorageService,
|
|
8
|
-
ToolResult,
|
|
9
4
|
ZipService,
|
|
5
|
+
I18nManager,
|
|
6
|
+
translate,
|
|
10
7
|
normalizeIgnoredRules,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
LogMessage,
|
|
9
|
+
ToolResult,
|
|
10
|
+
NugetPackager,
|
|
11
|
+
ProjectTool,
|
|
12
|
+
toolsFactoryRepository
|
|
13
|
+
} from "./packager-tool-a7s0gbxs.js";
|
|
14
14
|
import {
|
|
15
|
+
ProjectDimensions,
|
|
15
16
|
PackagerDimensions,
|
|
16
|
-
|
|
17
|
+
projectKey,
|
|
18
|
+
PROJECT_IDENTITY_LOOKUP_BUDGET_MS,
|
|
19
|
+
withinProjectIdentityBudget,
|
|
20
|
+
catchError,
|
|
17
21
|
carriedInstructions,
|
|
18
|
-
|
|
19
|
-
} from "./packager-tool-
|
|
22
|
+
isProjectTelemetryDisabled
|
|
23
|
+
} from "./packager-tool-m07vyk89.js";
|
|
20
24
|
// ../packager/project-packager/src/i18n/locales/de.json
|
|
21
25
|
var de_default = {
|
|
22
26
|
solutionpackager: {
|
|
@@ -1388,13 +1392,6 @@ I18nManager.registerTranslations("zh-TW", zh_TW_default);
|
|
|
1388
1392
|
I18nManager.registerTranslations("zu", zu_default);
|
|
1389
1393
|
|
|
1390
1394
|
// ../packager/project-packager/src/models/packager-parameters.ts
|
|
1391
|
-
var RulesConfigFileType;
|
|
1392
|
-
((RulesConfigFileType2) => {
|
|
1393
|
-
RulesConfigFileType2["Default"] = "Default";
|
|
1394
|
-
RulesConfigFileType2["AutomationOps"] = "AutomationOps";
|
|
1395
|
-
RulesConfigFileType2["Studio"] = "Studio";
|
|
1396
|
-
})(RulesConfigFileType ||= {});
|
|
1397
|
-
|
|
1398
1395
|
class PackagerParameters {
|
|
1399
1396
|
inputPath;
|
|
1400
1397
|
downloadUrl;
|
|
@@ -1429,43 +1426,17 @@ class ProjectValidateOptions extends ProjectRestoreOptions {
|
|
|
1429
1426
|
// ../packager/project-packager/src/models/project-build-options.ts
|
|
1430
1427
|
class ProjectBuildOptions extends ProjectValidateOptions {
|
|
1431
1428
|
outputType;
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
// ../packager/project-packager/src/models/project-cleanup-options.ts
|
|
1435
|
-
class ProjectCleanupOptions extends PackagerParameters {
|
|
1436
|
-
dryRun = false;
|
|
1437
|
-
skipImports = false;
|
|
1438
|
-
lockKey;
|
|
1429
|
+
activitiesRootCategory;
|
|
1439
1430
|
}
|
|
1440
1431
|
|
|
1441
1432
|
// ../packager/project-packager/src/models/project-pack-options.ts
|
|
1442
|
-
class
|
|
1433
|
+
class ProjectPackOptions2 extends ProjectBuildOptions {
|
|
1443
1434
|
destinationPath;
|
|
1444
1435
|
package;
|
|
1445
1436
|
signingInfo;
|
|
1446
1437
|
packOptions;
|
|
1447
1438
|
}
|
|
1448
1439
|
|
|
1449
|
-
// ../packager/project-packager/src/publish/models/publish-options.ts
|
|
1450
|
-
var PublishDestinationKind;
|
|
1451
|
-
((PublishDestinationKind2) => {
|
|
1452
|
-
PublishDestinationKind2["LocalFolder"] = "LocalFolder";
|
|
1453
|
-
PublishDestinationKind2["NugetFeed"] = "NugetFeed";
|
|
1454
|
-
PublishDestinationKind2["OrchestratorPersonalWorkspace"] = "OrchestratorPersonalWorkspace";
|
|
1455
|
-
PublishDestinationKind2["OrchestratorTenantProcesses"] = "OrchestratorTenantProcesses";
|
|
1456
|
-
PublishDestinationKind2["OrchestratorSharedLibraries"] = "OrchestratorSharedLibraries";
|
|
1457
|
-
PublishDestinationKind2["OrchestratorCustom"] = "OrchestratorCustom";
|
|
1458
|
-
})(PublishDestinationKind ||= {});
|
|
1459
|
-
|
|
1460
|
-
class ProjectPublishOptions {
|
|
1461
|
-
packagePaths;
|
|
1462
|
-
destination;
|
|
1463
|
-
constructor(packagePaths, destination) {
|
|
1464
|
-
this.packagePaths = packagePaths;
|
|
1465
|
-
this.destination = destination;
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
1440
|
// ../packager/project-packager/src/services/tool-logger.ts
|
|
1470
1441
|
var globalLogHandler = (logMessage) => {
|
|
1471
1442
|
const formattedMessage = logMessage.toFormattedString();
|
|
@@ -1485,10 +1456,12 @@ var globalLogHandler = (logMessage) => {
|
|
|
1485
1456
|
}
|
|
1486
1457
|
};
|
|
1487
1458
|
function setGlobalLogHandler(handler) {
|
|
1459
|
+
const previous = globalLogHandler;
|
|
1488
1460
|
globalLogHandler = handler;
|
|
1461
|
+
return previous;
|
|
1489
1462
|
}
|
|
1490
1463
|
|
|
1491
|
-
class
|
|
1464
|
+
class ToolLogger2 {
|
|
1492
1465
|
source;
|
|
1493
1466
|
sourceTarget;
|
|
1494
1467
|
constructor(source, sourceTarget) {
|
|
@@ -1548,566 +1521,6 @@ class ToolLogger {
|
|
|
1548
1521
|
}
|
|
1549
1522
|
}
|
|
1550
1523
|
|
|
1551
|
-
// ../packager/project-packager/src/publish/services/local-folder-publisher.ts
|
|
1552
|
-
class LocalFolderPublisher {
|
|
1553
|
-
fileSystem;
|
|
1554
|
-
logger;
|
|
1555
|
-
constructor(fileSystem) {
|
|
1556
|
-
this.fileSystem = fileSystem;
|
|
1557
|
-
this.logger = new ToolLogger("ProjectPublisher", "LocalFolder");
|
|
1558
|
-
}
|
|
1559
|
-
async publishAsync(packagePaths, destination) {
|
|
1560
|
-
const overwrite = destination.overwrite ?? true;
|
|
1561
|
-
if (!destination.folderPath) {
|
|
1562
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.localFolderRequired"));
|
|
1563
|
-
}
|
|
1564
|
-
if (!await this.fileSystem.exists(destination.folderPath)) {
|
|
1565
|
-
await this.fileSystem.mkdir(destination.folderPath);
|
|
1566
|
-
}
|
|
1567
|
-
const written = [];
|
|
1568
|
-
for (const sourcePath of packagePaths) {
|
|
1569
|
-
const fileName = this.fileSystem.path.basename(sourcePath);
|
|
1570
|
-
const destPath = this.fileSystem.path.join(destination.folderPath, fileName);
|
|
1571
|
-
if (!overwrite && await this.fileSystem.exists(destPath)) {
|
|
1572
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.localFolderFileExists", { path: destPath }));
|
|
1573
|
-
}
|
|
1574
|
-
const data = await this.fileSystem.readFile(sourcePath);
|
|
1575
|
-
if (!data) {
|
|
1576
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.failedToReadPackage", { path: sourcePath }));
|
|
1577
|
-
}
|
|
1578
|
-
await this.fileSystem.writeFile(destPath, data);
|
|
1579
|
-
written.push(destPath);
|
|
1580
|
-
this.logger.info(`Copied package to ${destPath}`);
|
|
1581
|
-
}
|
|
1582
|
-
return new ToolResult("SUCCESS" /* Success */, undefined, written);
|
|
1583
|
-
}
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
// ../packager/project-packager/src/publish/services/nuget-feed-publisher.ts
|
|
1587
|
-
var NUGET_V3_PACKAGE_PUBLISH_TYPE = "PackagePublish/2.0.0";
|
|
1588
|
-
|
|
1589
|
-
class NugetFeedPublisher {
|
|
1590
|
-
fileSystem;
|
|
1591
|
-
logger;
|
|
1592
|
-
constructor(fileSystem) {
|
|
1593
|
-
this.fileSystem = fileSystem;
|
|
1594
|
-
this.logger = new ToolLogger("ProjectPublisher", "NugetFeed");
|
|
1595
|
-
}
|
|
1596
|
-
async publishAsync(packagePaths, destination) {
|
|
1597
|
-
if (!destination.feedUrl) {
|
|
1598
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.nugetFeedUrlRequired"));
|
|
1599
|
-
}
|
|
1600
|
-
let pushUrl;
|
|
1601
|
-
try {
|
|
1602
|
-
pushUrl = await this.resolvePushUrl(destination.feedUrl, destination.apiKey);
|
|
1603
|
-
} catch (error) {
|
|
1604
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1605
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.nugetPushUrlResolutionFailed", { feedUrl: destination.feedUrl, message }));
|
|
1606
|
-
}
|
|
1607
|
-
const published = [];
|
|
1608
|
-
for (const packagePath of packagePaths) {
|
|
1609
|
-
const data = await this.fileSystem.readFile(packagePath);
|
|
1610
|
-
if (!data) {
|
|
1611
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.failedToReadPackage", { path: packagePath }));
|
|
1612
|
-
}
|
|
1613
|
-
const fileName = this.fileSystem.path.basename(packagePath);
|
|
1614
|
-
const form = new FormData;
|
|
1615
|
-
form.append("package", new Blob([data], {
|
|
1616
|
-
type: "application/octet-stream"
|
|
1617
|
-
}), fileName);
|
|
1618
|
-
const headers = {};
|
|
1619
|
-
if (destination.apiKey) {
|
|
1620
|
-
headers["X-NuGet-ApiKey"] = destination.apiKey;
|
|
1621
|
-
}
|
|
1622
|
-
this.logger.info(`Pushing ${fileName} to ${pushUrl}`);
|
|
1623
|
-
const response = await fetch(pushUrl, {
|
|
1624
|
-
method: "PUT",
|
|
1625
|
-
headers,
|
|
1626
|
-
body: form
|
|
1627
|
-
});
|
|
1628
|
-
if (!response.ok) {
|
|
1629
|
-
const body = await this.safeReadBody(response);
|
|
1630
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.nugetPushFailed", {
|
|
1631
|
-
fileName,
|
|
1632
|
-
status: response.status,
|
|
1633
|
-
statusText: response.statusText,
|
|
1634
|
-
body: body ? ` - ${body}` : ""
|
|
1635
|
-
}));
|
|
1636
|
-
}
|
|
1637
|
-
published.push(packagePath);
|
|
1638
|
-
this.logger.info(`Pushed ${fileName} successfully.`);
|
|
1639
|
-
}
|
|
1640
|
-
return new ToolResult("SUCCESS" /* Success */, undefined, published);
|
|
1641
|
-
}
|
|
1642
|
-
async resolvePushUrl(feedUrl, apiKey) {
|
|
1643
|
-
let end = feedUrl.length;
|
|
1644
|
-
while (end > 0 && feedUrl.charCodeAt(end - 1) === 47)
|
|
1645
|
-
end--;
|
|
1646
|
-
const trimmed = feedUrl.slice(0, end);
|
|
1647
|
-
if (/\/api\/v2\/package\/?$/i.test(trimmed)) {
|
|
1648
|
-
return trimmed;
|
|
1649
|
-
}
|
|
1650
|
-
if (/\.json$/i.test(trimmed)) {
|
|
1651
|
-
return this.resolveFromServiceIndex(trimmed, apiKey);
|
|
1652
|
-
}
|
|
1653
|
-
return `${trimmed}/api/v2/package`;
|
|
1654
|
-
}
|
|
1655
|
-
async resolveFromServiceIndex(serviceIndexUrl, apiKey) {
|
|
1656
|
-
const headers = { Accept: "application/json" };
|
|
1657
|
-
if (apiKey) {
|
|
1658
|
-
headers["X-NuGet-ApiKey"] = apiKey;
|
|
1659
|
-
}
|
|
1660
|
-
const response = await fetch(serviceIndexUrl, { headers });
|
|
1661
|
-
if (!response.ok) {
|
|
1662
|
-
throw new Error(`service index returned ${response.status} ${response.statusText}`);
|
|
1663
|
-
}
|
|
1664
|
-
const index = await response.json();
|
|
1665
|
-
const resource = index.resources?.find((r) => r["@type"] === NUGET_V3_PACKAGE_PUBLISH_TYPE);
|
|
1666
|
-
if (!resource?.["@id"]) {
|
|
1667
|
-
throw new Error(`service index has no ${NUGET_V3_PACKAGE_PUBLISH_TYPE} resource`);
|
|
1668
|
-
}
|
|
1669
|
-
return resource["@id"];
|
|
1670
|
-
}
|
|
1671
|
-
async safeReadBody(response) {
|
|
1672
|
-
try {
|
|
1673
|
-
const text = await response.text();
|
|
1674
|
-
return text.slice(0, 500);
|
|
1675
|
-
} catch {
|
|
1676
|
-
return "";
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
// ../packager/project-packager/src/publish/services/orchestrator-feed-types.ts
|
|
1682
|
-
var PackageFeedDtoPurposeEnum = {
|
|
1683
|
-
Undefined: "Undefined",
|
|
1684
|
-
Processes: "Processes",
|
|
1685
|
-
Libraries: "Libraries",
|
|
1686
|
-
PersonalWorkspace: "PersonalWorkspace",
|
|
1687
|
-
FolderHierarchy: "FolderHierarchy"
|
|
1688
|
-
};
|
|
1689
|
-
var PackageFeedDtoAuthenticationTypeEnum = {
|
|
1690
|
-
Secure: "Secure",
|
|
1691
|
-
ApiKey: "ApiKey",
|
|
1692
|
-
Basic: "Basic"
|
|
1693
|
-
};
|
|
1694
|
-
var ExtendedFolderDtoFeedTypeEnum = {
|
|
1695
|
-
Undefined: "Undefined",
|
|
1696
|
-
Processes: "Processes",
|
|
1697
|
-
Libraries: "Libraries",
|
|
1698
|
-
PersonalWorkspace: "PersonalWorkspace",
|
|
1699
|
-
FolderHierarchy: "FolderHierarchy"
|
|
1700
|
-
};
|
|
1701
|
-
// ../packager/project-packager/package.json
|
|
1702
|
-
var package_default = {
|
|
1703
|
-
name: "@uipath/project-packager",
|
|
1704
|
-
author: "UiPath",
|
|
1705
|
-
license: "SEE LICENSE IN LICENSE.txt",
|
|
1706
|
-
version: "1.205.0-preview.281",
|
|
1707
|
-
description: "UiPath Project Packager - core library for packing individual UiPath projects",
|
|
1708
|
-
type: "module",
|
|
1709
|
-
main: "./dist/index.js",
|
|
1710
|
-
exports: {
|
|
1711
|
-
".": {
|
|
1712
|
-
types: "./dist/src/index.d.ts",
|
|
1713
|
-
default: "./dist/index.js"
|
|
1714
|
-
},
|
|
1715
|
-
"./node": {
|
|
1716
|
-
types: "./dist/src/node.d.ts",
|
|
1717
|
-
default: "./dist/node.js"
|
|
1718
|
-
},
|
|
1719
|
-
"./browser": {
|
|
1720
|
-
types: "./dist/src/browser.d.ts",
|
|
1721
|
-
default: "./dist/browser.js"
|
|
1722
|
-
}
|
|
1723
|
-
},
|
|
1724
|
-
types: "./dist/src/index.d.ts",
|
|
1725
|
-
repository: {
|
|
1726
|
-
type: "git",
|
|
1727
|
-
url: "https://github.com/UiPath/cli.git",
|
|
1728
|
-
directory: "packages/packager/project-packager"
|
|
1729
|
-
},
|
|
1730
|
-
publishConfig: {
|
|
1731
|
-
registry: "https://npm.pkg.github.com/"
|
|
1732
|
-
},
|
|
1733
|
-
files: [
|
|
1734
|
-
"dist"
|
|
1735
|
-
],
|
|
1736
|
-
scripts: {
|
|
1737
|
-
build: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && bun build ./src/browser.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && bun build ./src/node.ts --outdir dist --format esm --target node --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && tsc -p tsconfig.build.json --emitDeclarationOnly --noCheck --outDir dist",
|
|
1738
|
-
typecheck: "tsc --noEmit",
|
|
1739
|
-
clean: "rimraf dist",
|
|
1740
|
-
test: "vitest run",
|
|
1741
|
-
e2e: "vitest run --config vitest.e2e.config.ts",
|
|
1742
|
-
"test:coverage": "vitest run --coverage",
|
|
1743
|
-
prepack: "bun run build",
|
|
1744
|
-
"publish:dry": "bun publish --dry-run",
|
|
1745
|
-
"publish:gh": "bun publish",
|
|
1746
|
-
"version:patch": "bun version patch --no-git-tag-version",
|
|
1747
|
-
"version:minor": "bun version minor --no-git-tag-version",
|
|
1748
|
-
"version:major": "bun version major --no-git-tag-version",
|
|
1749
|
-
lint: "biome check ."
|
|
1750
|
-
},
|
|
1751
|
-
dependencies: {
|
|
1752
|
-
"@uipath/aops-policy-sdk": "workspace:*",
|
|
1753
|
-
"@uipath/filesystem": "workspace:*",
|
|
1754
|
-
"@uipath/solutionpackager-tool-core": "workspace:*",
|
|
1755
|
-
"@uipath/common": "workspace:*"
|
|
1756
|
-
},
|
|
1757
|
-
peerDependencies: {
|
|
1758
|
-
fflate: "^0.8.2"
|
|
1759
|
-
},
|
|
1760
|
-
devDependencies: {
|
|
1761
|
-
"@types/node": "^25.5.2",
|
|
1762
|
-
"@uipath/resource-builder-tool": "2025.11.0-alpha6004-4107",
|
|
1763
|
-
"@uipath/tool-agent": "^2.0.0",
|
|
1764
|
-
"@uipath/packager-tool-apiworkflow": "workspace:*",
|
|
1765
|
-
"@uipath/packager-tool-connector": "workspace:*",
|
|
1766
|
-
"@uipath/packager-tool-flow": "workspace:*",
|
|
1767
|
-
"@uipath/packager-tool-functions": "workspace:*",
|
|
1768
|
-
"@uipath/packager-tool-webapp": "workspace:*",
|
|
1769
|
-
"@uipath/packager-tool-workflowcompiler": "workspace:*",
|
|
1770
|
-
"@vitest/coverage-v8": "^4.1.12",
|
|
1771
|
-
jsdom: "^30.0.1",
|
|
1772
|
-
typescript: "^7.0.2",
|
|
1773
|
-
"vite-tsconfig-paths": "^6.1.1",
|
|
1774
|
-
vitest: "^4.1.12"
|
|
1775
|
-
}
|
|
1776
|
-
};
|
|
1777
|
-
|
|
1778
|
-
// ../packager/project-packager/src/publish/services/orchestrator-feeds-service.ts
|
|
1779
|
-
var HEADER_TENANT_ID = "X-UIPATH-TenantId";
|
|
1780
|
-
var FEEDS_PATH = "/api/PackageFeeds/GetFeeds";
|
|
1781
|
-
var FOLDERS_PATH = "/api/FoldersNavigation/GetAllFoldersForCurrentUser";
|
|
1782
|
-
var SDK_USER_AGENT = `${package_default.name.replace(/^@uipath\//, "")}/${package_default.version}`;
|
|
1783
|
-
|
|
1784
|
-
class OrchestratorFeedsService {
|
|
1785
|
-
logger;
|
|
1786
|
-
constructor() {
|
|
1787
|
-
this.logger = new ToolLogger("OrchestratorFeedsService", "Feeds");
|
|
1788
|
-
}
|
|
1789
|
-
async getAccessibleFeedsAsync(connection) {
|
|
1790
|
-
this.ensureOrchestratorUrl(connection);
|
|
1791
|
-
this.logger.info(`Fetching accessible feeds from ${connection.orchestratorUrl}`);
|
|
1792
|
-
try {
|
|
1793
|
-
const json = await orchestratorGet(connection, FEEDS_PATH);
|
|
1794
|
-
return Array.isArray(json) ? json : [];
|
|
1795
|
-
} catch (error) {
|
|
1796
|
-
const { status, statusText, body } = await describeResponseError(error);
|
|
1797
|
-
throw new Error(translate.t("solutionpackager.publish.errors.getAccessibleFeedsFailed", { status, statusText, body }));
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
async getFoldersForCurrentUserAsync(connection) {
|
|
1801
|
-
this.ensureOrchestratorUrl(connection);
|
|
1802
|
-
this.logger.info(`Fetching folders from ${connection.orchestratorUrl}`);
|
|
1803
|
-
try {
|
|
1804
|
-
const json = await orchestratorGet(connection, FOLDERS_PATH);
|
|
1805
|
-
return Array.isArray(json) ? json.map(mapExtendedFolder) : [];
|
|
1806
|
-
} catch (error) {
|
|
1807
|
-
const { status, statusText, body } = await describeResponseError(error);
|
|
1808
|
-
throw new Error(translate.t("solutionpackager.publish.errors.getFoldersForCurrentUserFailed", { status, statusText, body }));
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
1811
|
-
ensureOrchestratorUrl(connection) {
|
|
1812
|
-
if (!connection.orchestratorUrl) {
|
|
1813
|
-
throw new Error(translate.t("solutionpackager.publish.errors.orchestratorUrlRequired"));
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
function mapExtendedFolder(json) {
|
|
1818
|
-
return {
|
|
1819
|
-
isSelectable: json.IsSelectable,
|
|
1820
|
-
hasChildren: json.HasChildren,
|
|
1821
|
-
level: json.Level,
|
|
1822
|
-
key: json.Key,
|
|
1823
|
-
displayName: json.DisplayName,
|
|
1824
|
-
fullyQualifiedName: json.FullyQualifiedName,
|
|
1825
|
-
description: json.Description,
|
|
1826
|
-
folderType: json.FolderType,
|
|
1827
|
-
isPersonal: json.IsPersonal,
|
|
1828
|
-
provisionType: json.ProvisionType,
|
|
1829
|
-
permissionModel: json.PermissionModel,
|
|
1830
|
-
parentId: json.ParentId,
|
|
1831
|
-
parentKey: json.ParentKey,
|
|
1832
|
-
feedType: json.FeedType,
|
|
1833
|
-
id: json.Id
|
|
1834
|
-
};
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
class OrchestratorResponseError extends Error {
|
|
1838
|
-
response;
|
|
1839
|
-
constructor(response) {
|
|
1840
|
-
super(`Orchestrator request failed with status ${response.status}.`);
|
|
1841
|
-
this.response = response;
|
|
1842
|
-
this.name = "OrchestratorResponseError";
|
|
1843
|
-
}
|
|
1844
|
-
}
|
|
1845
|
-
async function orchestratorGet(connection, relativePath) {
|
|
1846
|
-
const url = `${normalizeOrchestratorBasePath(connection.orchestratorUrl)}${relativePath}`;
|
|
1847
|
-
const response = await fetch(url, {
|
|
1848
|
-
method: "GET",
|
|
1849
|
-
headers: buildHeaders(connection)
|
|
1850
|
-
});
|
|
1851
|
-
if (!response.ok) {
|
|
1852
|
-
throw new OrchestratorResponseError(response);
|
|
1853
|
-
}
|
|
1854
|
-
const text = await response.text();
|
|
1855
|
-
if (text === "" || text === "null") {
|
|
1856
|
-
return null;
|
|
1857
|
-
}
|
|
1858
|
-
return JSON.parse(text);
|
|
1859
|
-
}
|
|
1860
|
-
function buildHeaders(connection) {
|
|
1861
|
-
const headers = {};
|
|
1862
|
-
if (connection.accessToken) {
|
|
1863
|
-
headers.Authorization = `Bearer ${connection.accessToken}`;
|
|
1864
|
-
}
|
|
1865
|
-
if (connection.tenantId) {
|
|
1866
|
-
headers[HEADER_TENANT_ID] = connection.tenantId;
|
|
1867
|
-
}
|
|
1868
|
-
return addSdkUserAgentHeader(headers, SDK_USER_AGENT);
|
|
1869
|
-
}
|
|
1870
|
-
function normalizeOrchestratorBasePath(orchestratorUrl) {
|
|
1871
|
-
let end = orchestratorUrl.length;
|
|
1872
|
-
while (end > 0 && orchestratorUrl.charCodeAt(end - 1) === 47)
|
|
1873
|
-
end--;
|
|
1874
|
-
const trimmed = orchestratorUrl.slice(0, end);
|
|
1875
|
-
return /\/orchestrator_$/i.test(trimmed) ? trimmed : `${trimmed}/orchestrator_`;
|
|
1876
|
-
}
|
|
1877
|
-
async function describeResponseError(error) {
|
|
1878
|
-
const response = error?.response;
|
|
1879
|
-
if (response) {
|
|
1880
|
-
let body = "";
|
|
1881
|
-
try {
|
|
1882
|
-
body = (await response.text()).slice(0, 500);
|
|
1883
|
-
} catch {
|
|
1884
|
-
body = "";
|
|
1885
|
-
}
|
|
1886
|
-
return {
|
|
1887
|
-
status: response.status,
|
|
1888
|
-
statusText: response.statusText,
|
|
1889
|
-
body: body ? ` - ${body}` : ""
|
|
1890
|
-
};
|
|
1891
|
-
}
|
|
1892
|
-
const cause = error?.cause;
|
|
1893
|
-
const message = cause instanceof Error ? cause.message : error instanceof Error ? error.message : String(error);
|
|
1894
|
-
return { status: "?", statusText: message, body: "" };
|
|
1895
|
-
}
|
|
1896
|
-
|
|
1897
|
-
// ../packager/project-packager/src/publish/services/orchestrator-publisher.ts
|
|
1898
|
-
var HEADER_FOLDER_ID = "X-UIPATH-OrganizationUnitId";
|
|
1899
|
-
var HEADER_TENANT_ID2 = "X-UIPATH-TenantId";
|
|
1900
|
-
var HEADER_NUGET_API_KEY = "X-NuGet-ApiKey";
|
|
1901
|
-
var ORCHESTRATOR_RELATIVE_URL = "/orchestrator_";
|
|
1902
|
-
var PROCESSES_UPLOAD_PATH = "/odata/Processes/UiPath.Server.Configuration.OData.UploadPackage";
|
|
1903
|
-
var LIBRARIES_UPLOAD_PATH = "/odata/Libraries/UiPath.Server.Configuration.OData.UploadPackage";
|
|
1904
|
-
|
|
1905
|
-
class OrchestratorPublisher {
|
|
1906
|
-
fileSystem;
|
|
1907
|
-
logger;
|
|
1908
|
-
feedsService;
|
|
1909
|
-
constructor(fileSystem, feedsService) {
|
|
1910
|
-
this.fileSystem = fileSystem;
|
|
1911
|
-
this.logger = new ToolLogger("ProjectPublisher", "Orchestrator");
|
|
1912
|
-
this.feedsService = feedsService ?? new OrchestratorFeedsService;
|
|
1913
|
-
}
|
|
1914
|
-
async publishAsync(packagePaths, destination) {
|
|
1915
|
-
if (packagePaths.length === 0) {
|
|
1916
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.orchestratorNoPackages"));
|
|
1917
|
-
}
|
|
1918
|
-
if (destination.kind === "OrchestratorCustom" /* OrchestratorCustom */) {
|
|
1919
|
-
if (!destination.publishUrl) {
|
|
1920
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.orchestratorCustomPublishUrlRequired"));
|
|
1921
|
-
}
|
|
1922
|
-
this.logger.info(`Publishing ${packagePaths.length} package(s) to ${destination.publishUrl} (custom)`);
|
|
1923
|
-
return this.postPackages(packagePaths, destination.publishUrl, this.buildCustomHeaders(destination));
|
|
1924
|
-
}
|
|
1925
|
-
if (!destination.connectionInfo?.cloudUrl) {
|
|
1926
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.orchestratorCloudUrlRequired"));
|
|
1927
|
-
}
|
|
1928
|
-
const orchestratorUrl = this.deriveOrchestratorUrl(destination.connectionInfo);
|
|
1929
|
-
let feed;
|
|
1930
|
-
try {
|
|
1931
|
-
feed = await this.resolveFeed(destination, orchestratorUrl);
|
|
1932
|
-
} catch (error) {
|
|
1933
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1934
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.orchestratorFeedResolutionFailed", { message }));
|
|
1935
|
-
}
|
|
1936
|
-
const targetUrl = this.buildPublishUrl(orchestratorUrl, feed);
|
|
1937
|
-
const headers = this.buildHeaders(destination, feed);
|
|
1938
|
-
this.logger.info(`Publishing ${packagePaths.length} package(s) to ${targetUrl} (feed ${feed.name}, ${feed.purpose})`);
|
|
1939
|
-
return this.postPackages(packagePaths, targetUrl, headers);
|
|
1940
|
-
}
|
|
1941
|
-
async postPackages(packagePaths, targetUrl, headers) {
|
|
1942
|
-
const form = new FormData;
|
|
1943
|
-
for (const packagePath of packagePaths) {
|
|
1944
|
-
const data = await this.fileSystem.readFile(packagePath);
|
|
1945
|
-
if (!data) {
|
|
1946
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.failedToReadPackage", { path: packagePath }));
|
|
1947
|
-
}
|
|
1948
|
-
const fileName = this.fileSystem.path.basename(packagePath);
|
|
1949
|
-
form.append("file", new Blob([data], {
|
|
1950
|
-
type: "application/octet-stream"
|
|
1951
|
-
}), fileName);
|
|
1952
|
-
}
|
|
1953
|
-
const response = await fetch(targetUrl, {
|
|
1954
|
-
method: "POST",
|
|
1955
|
-
headers,
|
|
1956
|
-
body: form
|
|
1957
|
-
});
|
|
1958
|
-
if (!response.ok) {
|
|
1959
|
-
const body = await this.safeReadBody(response);
|
|
1960
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.orchestratorPublishFailed", {
|
|
1961
|
-
status: response.status,
|
|
1962
|
-
statusText: response.statusText,
|
|
1963
|
-
body: body ? ` - ${body}` : ""
|
|
1964
|
-
}));
|
|
1965
|
-
}
|
|
1966
|
-
this.logger.info("Orchestrator publish completed.");
|
|
1967
|
-
return new ToolResult("SUCCESS" /* Success */, undefined, packagePaths);
|
|
1968
|
-
}
|
|
1969
|
-
async resolveFeed(destination, orchestratorUrl) {
|
|
1970
|
-
const connection = {
|
|
1971
|
-
orchestratorUrl,
|
|
1972
|
-
accessToken: destination.connectionInfo.accessToken,
|
|
1973
|
-
tenantId: destination.connectionInfo.tenantId
|
|
1974
|
-
};
|
|
1975
|
-
const feeds = await this.feedsService.getAccessibleFeedsAsync(connection);
|
|
1976
|
-
if (destination.kind === "OrchestratorPersonalWorkspace" /* OrchestratorPersonalWorkspace */) {
|
|
1977
|
-
const folders = await this.feedsService.getFoldersForCurrentUserAsync(connection);
|
|
1978
|
-
const personalFolder = folders.find((f) => f.feedType === ExtendedFolderDtoFeedTypeEnum.PersonalWorkspace);
|
|
1979
|
-
if (!personalFolder) {
|
|
1980
|
-
const foldersDebug = folders.length === 0 ? "<none>" : folders.map((f) => `${f.displayName} (id=${f.id}, feedType=${f.feedType})`).join(", ");
|
|
1981
|
-
throw new Error(translate.t("solutionpackager.publish.errors.orchestratorPersonalWorkspaceFolderNotFound", { folders: foldersDebug }));
|
|
1982
|
-
}
|
|
1983
|
-
if (personalFolder.id == null) {
|
|
1984
|
-
throw new Error(`Personal-workspace folder "${personalFolder.displayName}" has no id; cannot resolve its feed.`);
|
|
1985
|
-
}
|
|
1986
|
-
const match2 = feeds.find((f) => f.folderId === personalFolder.id);
|
|
1987
|
-
if (!match2) {
|
|
1988
|
-
this.throwFeedNotFound(destination, feeds);
|
|
1989
|
-
}
|
|
1990
|
-
return match2;
|
|
1991
|
-
}
|
|
1992
|
-
const expectedPurpose = destination.kind === "OrchestratorSharedLibraries" /* OrchestratorSharedLibraries */ ? PackageFeedDtoPurposeEnum.Libraries : PackageFeedDtoPurposeEnum.Processes;
|
|
1993
|
-
const match = feeds.find((f) => f.purpose === expectedPurpose && f.folderId == null);
|
|
1994
|
-
if (!match) {
|
|
1995
|
-
this.throwFeedNotFound(destination, feeds);
|
|
1996
|
-
}
|
|
1997
|
-
return match;
|
|
1998
|
-
}
|
|
1999
|
-
throwFeedNotFound(destination, feeds) {
|
|
2000
|
-
const available = feeds.length === 0 ? "<none>" : feeds.map((f) => `${f.name} (purpose=${f.purpose}, folderId=${f.folderId ?? "null"})`).join(", ");
|
|
2001
|
-
throw new Error(translate.t("solutionpackager.publish.errors.orchestratorFeedNotFound", {
|
|
2002
|
-
kind: destination.kind,
|
|
2003
|
-
available
|
|
2004
|
-
}));
|
|
2005
|
-
}
|
|
2006
|
-
buildPublishUrl(orchestratorUrl, feed) {
|
|
2007
|
-
const baseUrl = feed.publishUrl ? feed.publishUrl : `${orchestratorUrl}${feed.purpose === PackageFeedDtoPurposeEnum.Libraries ? LIBRARIES_UPLOAD_PATH : PROCESSES_UPLOAD_PATH}`;
|
|
2008
|
-
const parsed = new URL(baseUrl);
|
|
2009
|
-
if (feed.id) {
|
|
2010
|
-
parsed.searchParams.set("feedId", feed.id);
|
|
2011
|
-
}
|
|
2012
|
-
return parsed.toString();
|
|
2013
|
-
}
|
|
2014
|
-
deriveOrchestratorUrl(connectionInfo) {
|
|
2015
|
-
const raw = connectionInfo.cloudUrl ?? "";
|
|
2016
|
-
let end = raw.length;
|
|
2017
|
-
while (end > 0 && raw.charCodeAt(end - 1) === 47)
|
|
2018
|
-
end--;
|
|
2019
|
-
return `${raw.slice(0, end)}${ORCHESTRATOR_RELATIVE_URL}`;
|
|
2020
|
-
}
|
|
2021
|
-
buildHeaders(destination, feed) {
|
|
2022
|
-
const headers = this.buildAuthHeaders(destination.connectionInfo);
|
|
2023
|
-
const folderHeader = destination.kind === "OrchestratorSharedLibraries" /* OrchestratorSharedLibraries */ ? destination.folderId : feed.folderId;
|
|
2024
|
-
if (folderHeader != null) {
|
|
2025
|
-
headers[HEADER_FOLDER_ID] = String(folderHeader);
|
|
2026
|
-
}
|
|
2027
|
-
if (feed.authenticationType === PackageFeedDtoAuthenticationTypeEnum.ApiKey && feed.apiKey) {
|
|
2028
|
-
headers[HEADER_NUGET_API_KEY] = feed.apiKey;
|
|
2029
|
-
}
|
|
2030
|
-
return headers;
|
|
2031
|
-
}
|
|
2032
|
-
buildCustomHeaders(destination) {
|
|
2033
|
-
const headers = this.buildAuthHeaders(destination.connectionInfo);
|
|
2034
|
-
if (destination.folderId != null) {
|
|
2035
|
-
headers[HEADER_FOLDER_ID] = String(destination.folderId);
|
|
2036
|
-
}
|
|
2037
|
-
if (destination.apiKey) {
|
|
2038
|
-
headers[HEADER_NUGET_API_KEY] = destination.apiKey;
|
|
2039
|
-
}
|
|
2040
|
-
return headers;
|
|
2041
|
-
}
|
|
2042
|
-
buildAuthHeaders(connectionInfo) {
|
|
2043
|
-
const headers = {};
|
|
2044
|
-
if (connectionInfo.accessToken) {
|
|
2045
|
-
headers.Authorization = `Bearer ${connectionInfo.accessToken}`;
|
|
2046
|
-
}
|
|
2047
|
-
if (connectionInfo.tenantId) {
|
|
2048
|
-
headers[HEADER_TENANT_ID2] = connectionInfo.tenantId;
|
|
2049
|
-
}
|
|
2050
|
-
return headers;
|
|
2051
|
-
}
|
|
2052
|
-
async safeReadBody(response) {
|
|
2053
|
-
try {
|
|
2054
|
-
const text = await response.text();
|
|
2055
|
-
return text.slice(0, 500);
|
|
2056
|
-
} catch {
|
|
2057
|
-
return "";
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
|
-
// ../packager/project-packager/src/publish/services/project-publisher.ts
|
|
2063
|
-
class ProjectPublisher {
|
|
2064
|
-
fileSystem;
|
|
2065
|
-
logger;
|
|
2066
|
-
localFolderPublisher;
|
|
2067
|
-
nugetFeedPublisher;
|
|
2068
|
-
orchestratorPublisher;
|
|
2069
|
-
constructor(fileSystem, publishers) {
|
|
2070
|
-
this.fileSystem = fileSystem;
|
|
2071
|
-
this.logger = new ToolLogger("ProjectPublisher", "Publish");
|
|
2072
|
-
this.localFolderPublisher = publishers?.localFolder ?? new LocalFolderPublisher(fileSystem);
|
|
2073
|
-
this.nugetFeedPublisher = publishers?.nugetFeed ?? new NugetFeedPublisher(fileSystem);
|
|
2074
|
-
this.orchestratorPublisher = publishers?.orchestrator ?? new OrchestratorPublisher(fileSystem);
|
|
2075
|
-
}
|
|
2076
|
-
async publishAsync(options) {
|
|
2077
|
-
if (!options.packagePaths || options.packagePaths.length === 0) {
|
|
2078
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.atLeastOnePackage"));
|
|
2079
|
-
}
|
|
2080
|
-
for (const path of options.packagePaths) {
|
|
2081
|
-
if (!await this.fileSystem.exists(path)) {
|
|
2082
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.packageNotFound", { path }));
|
|
2083
|
-
}
|
|
2084
|
-
}
|
|
2085
|
-
try {
|
|
2086
|
-
const destination = options.destination;
|
|
2087
|
-
switch (destination.kind) {
|
|
2088
|
-
case "LocalFolder" /* LocalFolder */:
|
|
2089
|
-
return await this.localFolderPublisher.publishAsync(options.packagePaths, destination);
|
|
2090
|
-
case "NugetFeed" /* NugetFeed */:
|
|
2091
|
-
return await this.nugetFeedPublisher.publishAsync(options.packagePaths, destination);
|
|
2092
|
-
case "OrchestratorPersonalWorkspace" /* OrchestratorPersonalWorkspace */:
|
|
2093
|
-
case "OrchestratorTenantProcesses" /* OrchestratorTenantProcesses */:
|
|
2094
|
-
case "OrchestratorSharedLibraries" /* OrchestratorSharedLibraries */:
|
|
2095
|
-
case "OrchestratorCustom" /* OrchestratorCustom */:
|
|
2096
|
-
return await this.orchestratorPublisher.publishAsync(options.packagePaths, destination);
|
|
2097
|
-
default: {
|
|
2098
|
-
const exhaustive = destination;
|
|
2099
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, translate.t("solutionpackager.publish.errors.unknownDestination", { destination: JSON.stringify(exhaustive) }));
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
} catch (error) {
|
|
2103
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
2104
|
-
const localized = translate.t("solutionpackager.publish.errors.publishFailed", { message });
|
|
2105
|
-
this.logger.error(localized);
|
|
2106
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, localized);
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
1524
|
// ../gov/aops-policy-sdk/generated/src/runtime.ts
|
|
2112
1525
|
var BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
|
2113
1526
|
|
|
@@ -3722,6 +3135,82 @@ function requireText(field, value) {
|
|
|
3722
3135
|
throw new RequiredError(field, `Required option "${field}" must be a non-empty string.`);
|
|
3723
3136
|
}
|
|
3724
3137
|
}
|
|
3138
|
+
// ../packager/project-packager/package.json
|
|
3139
|
+
var package_default = {
|
|
3140
|
+
name: "@uipath/project-packager",
|
|
3141
|
+
author: "UiPath",
|
|
3142
|
+
license: "SEE LICENSE IN LICENSE.txt",
|
|
3143
|
+
version: "1.206.0-preview.279",
|
|
3144
|
+
description: "UiPath Project Packager - core library for packing individual UiPath projects",
|
|
3145
|
+
type: "module",
|
|
3146
|
+
main: "./dist/index.js",
|
|
3147
|
+
exports: {
|
|
3148
|
+
".": {
|
|
3149
|
+
types: "./dist/src/index.d.ts",
|
|
3150
|
+
default: "./dist/index.js"
|
|
3151
|
+
},
|
|
3152
|
+
"./node": {
|
|
3153
|
+
types: "./dist/src/node.d.ts",
|
|
3154
|
+
default: "./dist/node.js"
|
|
3155
|
+
},
|
|
3156
|
+
"./browser": {
|
|
3157
|
+
types: "./dist/src/browser.d.ts",
|
|
3158
|
+
default: "./dist/browser.js"
|
|
3159
|
+
}
|
|
3160
|
+
},
|
|
3161
|
+
types: "./dist/src/index.d.ts",
|
|
3162
|
+
repository: {
|
|
3163
|
+
type: "git",
|
|
3164
|
+
url: "https://github.com/UiPath/cli.git",
|
|
3165
|
+
directory: "packages/packager/project-packager"
|
|
3166
|
+
},
|
|
3167
|
+
publishConfig: {
|
|
3168
|
+
registry: "https://npm.pkg.github.com/"
|
|
3169
|
+
},
|
|
3170
|
+
files: [
|
|
3171
|
+
"dist"
|
|
3172
|
+
],
|
|
3173
|
+
scripts: {
|
|
3174
|
+
build: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && bun build ./src/browser.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && bun build ./src/node.ts --outdir dist --format esm --target node --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && tsc -p tsconfig.build.json --emitDeclarationOnly --noCheck --outDir dist",
|
|
3175
|
+
typecheck: "tsc --noEmit",
|
|
3176
|
+
clean: "rimraf dist",
|
|
3177
|
+
test: "vitest run",
|
|
3178
|
+
e2e: "vitest run --config vitest.e2e.config.ts",
|
|
3179
|
+
"test:coverage": "vitest run --coverage",
|
|
3180
|
+
prepack: "bun run build",
|
|
3181
|
+
"publish:dry": "bun publish --dry-run",
|
|
3182
|
+
"publish:gh": "bun publish",
|
|
3183
|
+
"version:patch": "bun version patch --no-git-tag-version",
|
|
3184
|
+
"version:minor": "bun version minor --no-git-tag-version",
|
|
3185
|
+
"version:major": "bun version major --no-git-tag-version",
|
|
3186
|
+
lint: "biome check ."
|
|
3187
|
+
},
|
|
3188
|
+
dependencies: {
|
|
3189
|
+
"@uipath/aops-policy-sdk": "workspace:*",
|
|
3190
|
+
"@uipath/filesystem": "workspace:*",
|
|
3191
|
+
"@uipath/solutionpackager-tool-core": "workspace:*",
|
|
3192
|
+
"@uipath/common": "workspace:*"
|
|
3193
|
+
},
|
|
3194
|
+
peerDependencies: {
|
|
3195
|
+
fflate: "^0.8.2"
|
|
3196
|
+
},
|
|
3197
|
+
devDependencies: {
|
|
3198
|
+
"@types/node": "^25.5.2",
|
|
3199
|
+
"@uipath/resource-builder-tool": "2025.11.0-alpha6004-4107",
|
|
3200
|
+
"@uipath/tool-agent": "^2.0.0",
|
|
3201
|
+
"@uipath/packager-tool-apiworkflow": "workspace:*",
|
|
3202
|
+
"@uipath/packager-tool-connector": "workspace:*",
|
|
3203
|
+
"@uipath/packager-tool-flow": "workspace:*",
|
|
3204
|
+
"@uipath/packager-tool-functions": "workspace:*",
|
|
3205
|
+
"@uipath/packager-tool-webapp": "workspace:*",
|
|
3206
|
+
"@uipath/packager-tool-workflowcompiler": "workspace:*",
|
|
3207
|
+
"@vitest/coverage-v8": "^4.1.12",
|
|
3208
|
+
jsdom: "^30.0.1",
|
|
3209
|
+
typescript: "^7.0.2",
|
|
3210
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
3211
|
+
vitest: "^4.1.12"
|
|
3212
|
+
}
|
|
3213
|
+
};
|
|
3725
3214
|
|
|
3726
3215
|
// ../packager/project-packager/src/services/governance-policy-service.ts
|
|
3727
3216
|
var LICENSE_TYPES = {
|
|
@@ -3750,7 +3239,7 @@ class GovernancePolicyService {
|
|
|
3750
3239
|
fileSystem;
|
|
3751
3240
|
temporaryStorage;
|
|
3752
3241
|
fetchFn;
|
|
3753
|
-
logger = new
|
|
3242
|
+
logger = new ToolLogger2("GovernancePolicyService", "ResolvePolicy");
|
|
3754
3243
|
constructor(fileSystem, temporaryStorage, fetchFn = fetch.bind(globalThis)) {
|
|
3755
3244
|
this.fileSystem = fileSystem;
|
|
3756
3245
|
this.temporaryStorage = temporaryStorage;
|
|
@@ -4081,8 +3570,8 @@ class PackagerParametersValidator {
|
|
|
4081
3570
|
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, error);
|
|
4082
3571
|
}
|
|
4083
3572
|
} catch (error) {
|
|
4084
|
-
const
|
|
4085
|
-
const errorLog = `Governance file not found or inaccessible: ${validateOptions.governanceFilePath}. Error: ${
|
|
3573
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
3574
|
+
const errorLog = `Governance file not found or inaccessible: ${validateOptions.governanceFilePath}. Error: ${errorMessage}`;
|
|
4086
3575
|
this.logger.error(errorLog);
|
|
4087
3576
|
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, errorLog);
|
|
4088
3577
|
}
|
|
@@ -4170,23 +3659,9 @@ class ProjectLoader {
|
|
|
4170
3659
|
};
|
|
4171
3660
|
}
|
|
4172
3661
|
}
|
|
4173
|
-
|
|
4174
|
-
// ../packager/project-packager/src/telemetry-names.ts
|
|
4175
|
-
var TelemetryNames;
|
|
4176
|
-
((TelemetryNames2) => {
|
|
4177
|
-
TelemetryNames2["ProjectToolPack"] = "ProjectPackager.Tool.Pack";
|
|
4178
|
-
TelemetryNames2["ProjectToolRestore"] = "ProjectPackager.Tool.Restore";
|
|
4179
|
-
TelemetryNames2["ProjectToolValidate"] = "ProjectPackager.Tool.Validate";
|
|
4180
|
-
TelemetryNames2["ProjectToolBuild"] = "ProjectPackager.Tool.Build";
|
|
4181
|
-
TelemetryNames2["ProjectToolCleanup"] = "ProjectPackager.Tool.Cleanup";
|
|
4182
|
-
TelemetryNames2["ProjectPackagerPack"] = "ProjectPackager.Pack";
|
|
4183
|
-
TelemetryNames2["ProjectPackagerRestore"] = "ProjectPackager.Restore";
|
|
4184
|
-
TelemetryNames2["ProjectPackagerValidate"] = "ProjectPackager.Validate";
|
|
4185
|
-
TelemetryNames2["ProjectPackagerBuild"] = "ProjectPackager.Build";
|
|
4186
|
-
TelemetryNames2["ProjectPackagerCleanup"] = "ProjectPackager.Cleanup";
|
|
4187
|
-
TelemetryNames2["ProjectPackagerProjectLoaded"] = "ProjectPackager.ProjectLoaded";
|
|
4188
|
-
})(TelemetryNames ||= {});
|
|
4189
3662
|
// ../packager/project-packager/src/services/project-tool-executor.ts
|
|
3663
|
+
var observerTimedOut = (phase) => () => new ToolLogger2("ProjectToolExecutor", "ProjectActivity").debug(`project activity (${phase}) skipped: no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`);
|
|
3664
|
+
|
|
4190
3665
|
class ProjectToolExecutor {
|
|
4191
3666
|
toolsFactory;
|
|
4192
3667
|
telemetry;
|
|
@@ -4195,36 +3670,44 @@ class ProjectToolExecutor {
|
|
|
4195
3670
|
this.telemetry = telemetry;
|
|
4196
3671
|
}
|
|
4197
3672
|
async restoreAsync(options, project, context, cancellationToken) {
|
|
4198
|
-
return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Restore" /* ProjectToolRestore */, project.Type, async () => tool.restoreAsync(options, cancellationToken),
|
|
4199
|
-
[PackagerDimensions.ProjectId]: project.Id,
|
|
4200
|
-
[PackagerDimensions.ProjectType]: project.Type
|
|
4201
|
-
}));
|
|
3673
|
+
return await this.executeToolOperationAsync(project, context, (tool, properties) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Restore" /* ProjectToolRestore */, project.Type, async () => tool.restoreAsync(options, cancellationToken), properties));
|
|
4202
3674
|
}
|
|
4203
3675
|
async validateAsync(options, project, context, cancellationToken) {
|
|
4204
|
-
return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Validate" /* ProjectToolValidate */, project.Type, async () => tool.validateAsync(options, cancellationToken),
|
|
4205
|
-
[PackagerDimensions.ProjectId]: project.Id,
|
|
4206
|
-
[PackagerDimensions.ProjectType]: project.Type
|
|
4207
|
-
}));
|
|
3676
|
+
return await this.executeToolOperationAsync(project, context, (tool, properties) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Validate" /* ProjectToolValidate */, project.Type, async () => tool.validateAsync(options, cancellationToken), properties));
|
|
4208
3677
|
}
|
|
4209
3678
|
async buildAsync(options, project, context, cancellationToken) {
|
|
4210
|
-
return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Build" /* ProjectToolBuild */, project.Type, async () => tool.buildAsync(options, cancellationToken),
|
|
4211
|
-
[PackagerDimensions.ProjectId]: project.Id,
|
|
4212
|
-
[PackagerDimensions.ProjectType]: project.Type
|
|
4213
|
-
}));
|
|
3679
|
+
return await this.executeToolOperationAsync(project, context, (tool, properties) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Build" /* ProjectToolBuild */, project.Type, async () => tool.buildAsync(options, cancellationToken), properties));
|
|
4214
3680
|
}
|
|
4215
3681
|
async packAsync(options, project, context, cancellationToken) {
|
|
4216
|
-
return await this.executeToolOperationAsync(project, context, async (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Pack" /* ProjectToolPack */, project.Type, async () => tool.packAsync(options, cancellationToken),
|
|
4217
|
-
[PackagerDimensions.ProjectId]: project.Id,
|
|
4218
|
-
[PackagerDimensions.ProjectType]: project.Type
|
|
4219
|
-
}));
|
|
3682
|
+
return await this.executeToolOperationAsync(project, context, async (tool, properties) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Pack" /* ProjectToolPack */, project.Type, async () => tool.packAsync(options, cancellationToken), properties));
|
|
4220
3683
|
}
|
|
4221
3684
|
async cleanupAsync(options, project, context, cancellationToken) {
|
|
4222
|
-
return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Cleanup" /* ProjectToolCleanup */, project.Type, async () => tool.cleanupAsync(options, cancellationToken),
|
|
4223
|
-
[PackagerDimensions.ProjectId]: project.Id,
|
|
4224
|
-
[PackagerDimensions.ProjectType]: project.Type
|
|
4225
|
-
}));
|
|
3685
|
+
return await this.executeToolOperationAsync(project, context, (tool, properties) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Cleanup" /* ProjectToolCleanup */, project.Type, async () => tool.cleanupAsync(options, cancellationToken), properties));
|
|
4226
3686
|
}
|
|
4227
3687
|
async executeToolOperationAsync(project, context, operation) {
|
|
3688
|
+
const solutionKey = context?.solutionId ? projectKey(context.solutionId) : undefined;
|
|
3689
|
+
const identity = solutionKey && !isProjectTelemetryDisabled() ? {
|
|
3690
|
+
[ProjectDimensions.SolutionKey]: solutionKey,
|
|
3691
|
+
[ProjectDimensions.SolutionProjectKey]: projectKey(project.Id)
|
|
3692
|
+
} : {};
|
|
3693
|
+
const properties = {
|
|
3694
|
+
[PackagerDimensions.ProjectId]: project.Id,
|
|
3695
|
+
[PackagerDimensions.ProjectType]: project.Type,
|
|
3696
|
+
...identity
|
|
3697
|
+
};
|
|
3698
|
+
return this.observeToolOperationAsync(project, context, (tool) => operation(tool, properties));
|
|
3699
|
+
}
|
|
3700
|
+
async observeToolOperationAsync(project, context, operation) {
|
|
3701
|
+
if (!context?.projectActivity) {
|
|
3702
|
+
return this.runToolOperationAsync(project, context, operation);
|
|
3703
|
+
}
|
|
3704
|
+
const observe = context.projectActivity;
|
|
3705
|
+
await withinProjectIdentityBudget(Promise.resolve().then(() => observe(project, "before", undefined, context.solutionId)).catch(() => {}), observerTimedOut("before"));
|
|
3706
|
+
const result = await this.runToolOperationAsync(project, context, operation);
|
|
3707
|
+
await withinProjectIdentityBudget(Promise.resolve().then(() => observe(project, "after", result.isSuccess, context.solutionId)).catch(() => {}), observerTimedOut("after"));
|
|
3708
|
+
return result;
|
|
3709
|
+
}
|
|
3710
|
+
async runToolOperationAsync(project, context, operation) {
|
|
4228
3711
|
try {
|
|
4229
3712
|
const tool = await this.toolsFactory.createProjectToolAsync(project, context);
|
|
4230
3713
|
try {
|
|
@@ -4257,13 +3740,13 @@ class ToolsFactory {
|
|
|
4257
3740
|
this.fileSystem = fileSystem;
|
|
4258
3741
|
}
|
|
4259
3742
|
async createSolutionToolAsync(solutionName) {
|
|
4260
|
-
const logger = new
|
|
3743
|
+
const logger = new ToolLogger2("ResourceBuilder", solutionName);
|
|
4261
3744
|
const factory = this.repository.getSolutionToolFactory();
|
|
4262
3745
|
return await factory.createAsync(logger, this.fileSystem);
|
|
4263
3746
|
}
|
|
4264
3747
|
async createProjectToolAsync(project, context) {
|
|
4265
3748
|
const sourceTarget = getSourceTarget();
|
|
4266
|
-
const logger = new
|
|
3749
|
+
const logger = new ToolLogger2(project.Type, sourceTarget);
|
|
4267
3750
|
if (!project.ProjectPath) {
|
|
4268
3751
|
throw new Error(`Project path not set for project: ${project.Id}`);
|
|
4269
3752
|
}
|
|
@@ -4313,6 +3796,7 @@ class ProjectPackOptionsBuilder {
|
|
|
4313
3796
|
policyFileType: parameters.validateOptions.governanceFileType,
|
|
4314
3797
|
outputPath: parameters.outputPath,
|
|
4315
3798
|
outputType: parameters.outputType,
|
|
3799
|
+
activitiesRootCategory: parameters.activitiesRootCategory,
|
|
4316
3800
|
projectType: project.type,
|
|
4317
3801
|
package: packageInfo,
|
|
4318
3802
|
skipDependencyOptimization: parameters.packOptions?.skipDependencyOptimization ?? false,
|
|
@@ -4363,7 +3847,7 @@ class ProjectPackager {
|
|
|
4363
3847
|
this.temporaryStorage = new TemporaryStorageService(this.fileSystem);
|
|
4364
3848
|
this.zipService = new ZipService(this.fileSystem);
|
|
4365
3849
|
this.nugetPackager = new NugetPackager(this.fileSystem);
|
|
4366
|
-
this.logger = new
|
|
3850
|
+
this.logger = new ToolLogger2("ProjectPackager", "PackProject");
|
|
4367
3851
|
this.validateOptionsValidator = new ProjectValidateOptionsValidator(this.logger, this.fileSystem);
|
|
4368
3852
|
this.buildOptionsValidator = new ProjectBuildOptionsValidator(this.logger, this.fileSystem);
|
|
4369
3853
|
this.packOptionsValidator = new ProjectPackOptionsValidator(this.logger, this.fileSystem);
|
|
@@ -4458,6 +3942,7 @@ class ProjectPackager {
|
|
|
4458
3942
|
policyFileType: options.validateOptions.governanceFileType,
|
|
4459
3943
|
outputPath: options.outputPath,
|
|
4460
3944
|
outputType: options.outputType,
|
|
3945
|
+
activitiesRootCategory: options.activitiesRootCategory,
|
|
4461
3946
|
projectType: uiPathProject.Type
|
|
4462
3947
|
};
|
|
4463
3948
|
const context = this.createOperationContext(options, uiPathProject);
|
|
@@ -4501,9 +3986,9 @@ class ProjectPackager {
|
|
|
4501
3986
|
}
|
|
4502
3987
|
return result;
|
|
4503
3988
|
} catch (error) {
|
|
4504
|
-
const
|
|
4505
|
-
this.logger.error(`Processing error: ${
|
|
4506
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `Project pack failed: ${
|
|
3989
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
3990
|
+
this.logger.error(`Processing error: ${errorMessage}`);
|
|
3991
|
+
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `Project pack failed: ${errorMessage}`, carriedInstructions(error));
|
|
4507
3992
|
} finally {
|
|
4508
3993
|
await this.temporaryStorage.cleanup();
|
|
4509
3994
|
}
|
|
@@ -4568,9 +4053,9 @@ class ProjectPackager {
|
|
|
4568
4053
|
}
|
|
4569
4054
|
return operationResult;
|
|
4570
4055
|
} catch (error) {
|
|
4571
|
-
const
|
|
4572
|
-
this.logger.error(`Processing error: ${
|
|
4573
|
-
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `Project ${operationName.toLowerCase()} failed: ${
|
|
4056
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
4057
|
+
this.logger.error(`Processing error: ${errorMessage}`);
|
|
4058
|
+
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `Project ${operationName.toLowerCase()} failed: ${errorMessage}`);
|
|
4574
4059
|
} finally {
|
|
4575
4060
|
await this.temporaryStorage.cleanup();
|
|
4576
4061
|
}
|
|
@@ -4625,7 +4110,170 @@ class ProjectPackager {
|
|
|
4625
4110
|
return destinationPackages;
|
|
4626
4111
|
}
|
|
4627
4112
|
}
|
|
4113
|
+
// ../packager/project-packager/src/publish/services/orchestrator-feeds-service.ts
|
|
4114
|
+
var SDK_USER_AGENT = `${package_default.name.replace(/^@uipath\//, "")}/${package_default.version}`;
|
|
4115
|
+
// ../packager/solution-packager/src/services/package-id-reader.ts
|
|
4116
|
+
var legacySolutionResourcesFileName = "resources.json";
|
|
4117
|
+
|
|
4118
|
+
class PackageIdReader {
|
|
4119
|
+
fileSystem;
|
|
4120
|
+
packService;
|
|
4121
|
+
projectTypesToFolderNameMapping = {
|
|
4122
|
+
processorchestration: "processOrchestration",
|
|
4123
|
+
casemanagement: "caseManagement",
|
|
4124
|
+
agent: "agent",
|
|
4125
|
+
api: "api",
|
|
4126
|
+
webapp: "webApp",
|
|
4127
|
+
process: "process",
|
|
4128
|
+
flow: "flow"
|
|
4129
|
+
};
|
|
4130
|
+
static projectTypeMap = {
|
|
4131
|
+
process: "Rpa",
|
|
4132
|
+
library: "Lib",
|
|
4133
|
+
tests: "Tests",
|
|
4134
|
+
webapp: "App",
|
|
4135
|
+
processorchestration: "Agentic",
|
|
4136
|
+
casemanagement: "Case",
|
|
4137
|
+
api: "Api",
|
|
4138
|
+
agent: "Agent",
|
|
4139
|
+
flow: "Flow"
|
|
4140
|
+
};
|
|
4141
|
+
constructor(fileSystem, packService) {
|
|
4142
|
+
this.fileSystem = fileSystem;
|
|
4143
|
+
this.packService = packService;
|
|
4144
|
+
}
|
|
4145
|
+
async read(project, solutionPath, solutionName) {
|
|
4146
|
+
try {
|
|
4147
|
+
if (!solutionPath || solutionPath.trim() === "") {
|
|
4148
|
+
return this.defaultToProjectFolder(project, solutionPath, solutionName);
|
|
4149
|
+
}
|
|
4150
|
+
return await this.readFromResourcesDirectory(project, solutionPath) || await this.readFromLegacyResourcesJson(project, solutionPath) || this.defaultToProjectFolder(project, solutionPath, solutionName);
|
|
4151
|
+
} catch (ex) {
|
|
4152
|
+
console.error("Error reading package ID:", ex);
|
|
4153
|
+
return this.defaultToProjectFolder(project, solutionPath, solutionName);
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
defaultToProjectFolder(project, solutionPath, solutionName) {
|
|
4157
|
+
const projectFolderName = Path.dirname(project.ProjectRelativePath);
|
|
4158
|
+
const id = this.packService.sanitizePackageId(projectFolderName);
|
|
4159
|
+
return this.getPackageId(id, project, solutionPath, solutionName);
|
|
4160
|
+
}
|
|
4161
|
+
getPackageId(rootPackageId, project, solutionPath, solutionName) {
|
|
4162
|
+
const packageId = this.composePackageId(rootPackageId, project, solutionPath, solutionName);
|
|
4163
|
+
return this.packService.sanitizePackageId(packageId);
|
|
4164
|
+
}
|
|
4165
|
+
composePackageId(rootPackageId, project, solutionPath, solutionName) {
|
|
4166
|
+
if (!solutionName && (!solutionPath || solutionPath.trim() === "")) {
|
|
4167
|
+
return rootPackageId;
|
|
4168
|
+
}
|
|
4169
|
+
const resolvedSolutionName = solutionName || this.deriveSolutionName(solutionPath);
|
|
4170
|
+
const parts = [resolvedSolutionName];
|
|
4171
|
+
if (project.Type) {
|
|
4172
|
+
parts.push(PackageIdReader.normalizeProjectType(project.Type));
|
|
4173
|
+
}
|
|
4174
|
+
parts.push(rootPackageId);
|
|
4175
|
+
return parts.join(".");
|
|
4176
|
+
}
|
|
4177
|
+
static normalizeProjectType(projectType) {
|
|
4178
|
+
const normalizedKey = projectType.toLowerCase();
|
|
4179
|
+
return PackageIdReader.projectTypeMap[normalizedKey] || projectType;
|
|
4180
|
+
}
|
|
4181
|
+
deriveSolutionName(solutionPath) {
|
|
4182
|
+
const ext = Path.extname(solutionPath);
|
|
4183
|
+
const base = Path.basename(solutionPath);
|
|
4184
|
+
return ext ? base.substring(0, base.length - ext.length) : base;
|
|
4185
|
+
}
|
|
4186
|
+
async readFromLegacyResourcesJson(project, solutionPath) {
|
|
4187
|
+
const resourcesFilePath = Path.join(solutionPath, legacySolutionResourcesFileName);
|
|
4188
|
+
const exists = await this.fileSystem.exists(resourcesFilePath);
|
|
4189
|
+
if (!exists) {
|
|
4190
|
+
return null;
|
|
4191
|
+
}
|
|
4192
|
+
const data = await this.fileSystem.readFile(resourcesFilePath);
|
|
4193
|
+
if (!data) {
|
|
4194
|
+
return null;
|
|
4195
|
+
}
|
|
4196
|
+
const json = new TextDecoder().decode(data);
|
|
4197
|
+
return this.getProjectIdFromJson(project, json);
|
|
4198
|
+
}
|
|
4199
|
+
getProjectIdFromJson(project, json) {
|
|
4200
|
+
try {
|
|
4201
|
+
const jsonObject = JSON.parse(json);
|
|
4202
|
+
const resources = this.getProperty(jsonObject, "resources");
|
|
4203
|
+
if (!Array.isArray(resources)) {
|
|
4204
|
+
return null;
|
|
4205
|
+
}
|
|
4206
|
+
const resource = resources.find((r) => {
|
|
4207
|
+
const projectKey = this.getProperty(r, "projectKey");
|
|
4208
|
+
const kind = this.getProperty(r, "kind");
|
|
4209
|
+
return projectKey === project.Id && typeof kind === "string" && kind.toLowerCase() === "process";
|
|
4210
|
+
});
|
|
4211
|
+
if (!resource) {
|
|
4212
|
+
return null;
|
|
4213
|
+
}
|
|
4214
|
+
const spec = this.getProperty(resource, "spec");
|
|
4215
|
+
if (!spec) {
|
|
4216
|
+
return null;
|
|
4217
|
+
}
|
|
4218
|
+
const packageName = this.getProperty(spec, "packageName");
|
|
4219
|
+
if (!packageName || typeof packageName !== "string" || packageName.trim() === "") {
|
|
4220
|
+
return null;
|
|
4221
|
+
}
|
|
4222
|
+
return packageName;
|
|
4223
|
+
} catch (ex) {
|
|
4224
|
+
console.error("Error parsing legacy resources JSON:", ex);
|
|
4225
|
+
return null;
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
async readFromResourcesDirectory(project, solutionPath) {
|
|
4229
|
+
const projectTypeLower = project.Type.toLowerCase();
|
|
4230
|
+
const projectTypeFolder = this.projectTypesToFolderNameMapping[projectTypeLower] || Path.dirname(project.ProjectRelativePath);
|
|
4231
|
+
const processDirectory = Path.join(solutionPath, "resources", "solution_folder", "process", projectTypeFolder);
|
|
4232
|
+
const stats = await this.fileSystem.stat(processDirectory);
|
|
4233
|
+
if (!stats?.isDirectory()) {
|
|
4234
|
+
return null;
|
|
4235
|
+
}
|
|
4236
|
+
const files = await this.fileSystem.readdir(processDirectory);
|
|
4237
|
+
const jsonFiles = files.filter((f) => f.endsWith(".json")).map((f) => Path.join(processDirectory, f));
|
|
4238
|
+
for (const jsonFile of jsonFiles) {
|
|
4239
|
+
try {
|
|
4240
|
+
const data = await this.fileSystem.readFile(jsonFile);
|
|
4241
|
+
if (!data) {
|
|
4242
|
+
continue;
|
|
4243
|
+
}
|
|
4244
|
+
const json = new TextDecoder().decode(data);
|
|
4245
|
+
const jsonObject = JSON.parse(json);
|
|
4246
|
+
const resource = this.getProperty(jsonObject, "resource");
|
|
4247
|
+
const projectKey = this.getProperty(resource, "projectKey");
|
|
4248
|
+
if (projectKey === project.Id) {
|
|
4249
|
+
const spec = this.getProperty(resource, "spec");
|
|
4250
|
+
const packageName = this.getProperty(spec, "packageName");
|
|
4251
|
+
if (typeof packageName !== "string" || packageName.trim() === "") {
|
|
4252
|
+
return null;
|
|
4253
|
+
}
|
|
4254
|
+
return packageName;
|
|
4255
|
+
}
|
|
4256
|
+
} catch (ex) {
|
|
4257
|
+
console.error("Error reading resource file:", jsonFile, ex);
|
|
4258
|
+
}
|
|
4259
|
+
}
|
|
4260
|
+
return null;
|
|
4261
|
+
}
|
|
4262
|
+
getProperty(obj, propertyName) {
|
|
4263
|
+
if (!obj || typeof obj !== "object") {
|
|
4264
|
+
return null;
|
|
4265
|
+
}
|
|
4266
|
+
const keys = Object.keys(obj);
|
|
4267
|
+
const matchingKey = keys.find((key) => key.toLowerCase() === propertyName.toLowerCase());
|
|
4268
|
+
return matchingKey ? obj[matchingKey] : null;
|
|
4269
|
+
}
|
|
4270
|
+
}
|
|
4271
|
+
async function readMemberPackageIdAsync2(fileSystem, project, solutionPath, solutionName) {
|
|
4272
|
+
const packService = new PackService;
|
|
4273
|
+
const packageId = await new PackageIdReader(fileSystem, packService).read(project, solutionPath, solutionName);
|
|
4274
|
+
return packageId ? packService.sanitizePackageId(packageId) : packageId;
|
|
4275
|
+
}
|
|
4628
4276
|
|
|
4629
|
-
export {
|
|
4277
|
+
export { PackagerParameters, ProjectPackOptions2, setGlobalLogHandler, ToolLogger2, GovernancePolicyService, resolveProducedNupkgsAsync, isPackageIdTooLongError, PackService, signNupkgsAsync, PackagerParametersValidator, ProjectLoader, ProjectToolExecutor, ToolsFactory, ProjectPackager, PackageIdReader, readMemberPackageIdAsync2 };
|
|
4630
4278
|
|
|
4631
|
-
//# debugId=
|
|
4279
|
+
//# debugId=2C1A662FEEBF028264756E2164756E21
|