@uipath/solution-tool 1.206.0-preview.306 → 1.207.0-preview.307
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/THIRD-PARTY-NOTICES.md +4 -4
- package/dist/{archive-extract-ma0gy822.js → archive-extract-afgwacbg.js} +3 -3
- package/dist/{cleanup-command-service-abtxpefz.js → cleanup-command-service-0j6qxj96.js} +20 -15
- package/dist/deploy-delete-service-ghyetrvj.js +23 -0
- package/dist/deploy-run-service-sz77fpsz.js +24 -0
- package/dist/{deploy-status-service-k1gycn13.js → deploy-status-service-aj4m61hg.js} +49 -25
- package/dist/deploy.js +21 -20
- package/dist/{deployment-search-bjdwqh5w.js → deployment-search-mkvzgeq4.js} +9 -9
- package/dist/{embedded-file-reader-pxpwcq3n.js → embedded-file-reader-k94wt612.js} +16 -16
- package/dist/feed-resolver-yj94m9j1.js +31 -0
- package/dist/feed-scope-failure-7abh61sj.js +20 -0
- package/dist/{feed-session-ytew8k2j.js → feed-session-z8t87r5w.js} +6 -6
- package/dist/{first-party-service-6gf3n6d8.js → first-party-service-bmtxd7wx.js} +1 -1
- package/dist/folder-runtime-check-8nf63er2.js +25 -0
- package/dist/{governance-options-40m81z8h.js → governance-options-ft8bqz4p.js} +7 -7
- package/dist/{packager-tool-v3ze7wmr.js → index-6ma58k47.js} +33 -708
- package/dist/{index-yjvmjpdn.js → index-j3tpb2cr.js} +12 -11
- package/dist/{index-p3x7ztdr.js → index-jy1760qy.js} +1 -1
- package/dist/{index-2bn3jzn9.js → index-nbs04tqr.js} +9 -7
- package/dist/index.js +26 -26
- package/dist/init.js +10 -10
- package/dist/{list-0k8c4rt6.js → list-3a1tdrgm.js} +11 -11
- package/dist/models/pack-command-types.d.ts +12 -0
- package/dist/{node-6ay6nbnq.js → node-83xy0gm0.js} +6 -6
- package/dist/pack-command-service-42p3t8xa.js +32 -0
- package/dist/{pack-project-2g2ncn2k.js → pack-project-w514zr5v.js} +21 -18
- package/dist/pack.js +25 -22
- package/dist/{package-id-56k44s7y.js → package-id-2dgfbh5h.js} +3 -3
- package/dist/{packager-tool-2zn98p5r.js → packager-tool-0gyqtxvs.js} +4 -4
- package/dist/{packager-tool-vgrswa8p.js → packager-tool-1db1wqdy.js} +30 -8
- package/dist/{packager-tool-vx2c68sb.js → packager-tool-1dsxhz1r.js} +2 -2
- package/dist/{packager-tool-xxf8f4v2.js → packager-tool-2syv199e.js} +9 -5
- package/dist/packager-tool-3ft8hywr.js +449 -0
- package/dist/{packager-tool-829w06ns.js → packager-tool-3qach0s4.js} +14 -8
- package/dist/{packager-tool-bkmwknfn.js → packager-tool-4f1k64fh.js} +8 -74
- package/dist/{packager-tool-7v03ncmv.js → packager-tool-70ag56bf.js} +49 -24
- package/dist/{packager-tool-5e4gps62.js → packager-tool-71sz9598.js} +20 -8
- package/dist/{packager-tool-23g7kn35.js → packager-tool-7j920ac5.js} +18 -11
- package/dist/packager-tool-7s842xrq.js +140 -0
- package/dist/{packager-tool-s8q14fth.js → packager-tool-849ch2tq.js} +4 -6
- package/dist/{packager-tool-aws5w512.js → packager-tool-887bkh9y.js} +1 -1
- package/dist/{packager-tool-f5pzh184.js → packager-tool-a566400t.js} +26 -10
- package/dist/packager-tool-a813na66.js +75 -0
- package/dist/{packager-tool-c8x0tpe4.js → packager-tool-af8n6rqz.js} +85 -30
- package/dist/{packager-tool-y1304xzm.js → packager-tool-bpdyy6vs.js} +530 -204
- package/dist/{packager-tool-fx4ws49n.js → packager-tool-cenfraf4.js} +2 -2
- package/dist/{packager-tool-0z4aq300.js → packager-tool-cwqy5rb5.js} +119 -52
- package/dist/{packager-tool-a7s0gbxs.js → packager-tool-devc4w73.js} +7 -2
- package/dist/{packager-tool-pqk9v4h7.js → packager-tool-fbajevvm.js} +52 -15
- package/dist/{packager-tool-r0ha8c95.js → packager-tool-fz96p75n.js} +3 -3
- package/dist/{packager-tool-m07vyk89.js → packager-tool-gb3dq79g.js} +36 -9
- package/dist/{packager-tool-h8tksb5s.js → packager-tool-gns0nxbt.js} +28 -9
- package/dist/{packager-tool-wjvks6st.js → packager-tool-h8wam8pt.js} +15 -6
- package/dist/{packager-tool-z4cbca95.js → packager-tool-hczpvrc1.js} +6 -6
- package/dist/{packager-tool-t39pjz7n.js → packager-tool-jtvhkavz.js} +48 -6
- package/dist/{packager-tool-p5322gew.js → packager-tool-kmwjscby.js} +88 -10
- package/dist/{packager-tool-ppj5f4y7.js → packager-tool-n1zrk6zv.js} +4 -2
- package/dist/{packager-tool-2qsbh4kd.js → packager-tool-ncgpx1ce.js} +50 -12
- package/dist/{packager-tool-f15an17m.js → packager-tool-p1xfsv6c.js} +92 -4
- package/dist/{packager-tool-egc54x78.js → packager-tool-qhht1tc9.js} +2408 -771
- package/dist/packager-tool-r7fmsz2t.js +741 -0
- package/dist/{packager-tool-resolver-30hxk8vm.js → packager-tool-resolver-mynfj0rt.js} +6 -6
- package/dist/{packager-tool-ay4j9x92.js → packager-tool-s9tyw75r.js} +19 -8
- package/dist/{packager-tool-ckrt4gyr.js → packager-tool-t9zked1m.js} +3 -3
- package/dist/{packager-tool-1ctvbx0h.js → packager-tool-tr3ttz5c.js} +1 -1
- package/dist/{packager-tool-chff74yz.js → packager-tool-tt9v40x6.js} +3010 -846
- package/dist/{packager-tool-k9dk39tg.js → packager-tool-txygqgb2.js} +3 -3
- package/dist/packager-tool-v6jcys3s.js +46 -0
- package/dist/packager-tool-w0tmr9xe.js +279 -0
- package/dist/packager-tool-w35s60sx.js +179 -0
- package/dist/{packager-tool-axqk17xw.js → packager-tool-xbfr6y2x.js} +142 -34
- package/dist/{packager-tool-m5mwc6by.js → packager-tool-zsv8208n.js} +22 -18
- package/dist/{packager-tool-vrw36pdb.js → packager-tool-ztxsccjk.js} +140 -10
- package/dist/packager-tool.js +2 -2
- package/dist/prepare-solution-resources-g9y01pgd.js +26 -0
- package/dist/{project-command-utils-82tja3k0.js → project-command-utils-yxrgwzf9.js} +20 -13
- package/dist/project-contributions-c8v3bwjr.js +31 -0
- package/dist/project-identity-telemetry-yxdhswyq.js +18 -0
- package/dist/publish.js +14 -14
- package/dist/{resource-mutations-h6wfdqr4.js → resource-mutations-dn4f8xr1.js} +9 -9
- package/dist/{resource-version-lookup-xzgnvr48.js → resource-version-lookup-mksxc1dc.js} +9 -9
- package/dist/resource.js +9 -9
- package/dist/{restore-command-service-bqs7r9y3.js → restore-command-service-ztbt2ejp.js} +20 -15
- package/dist/run-service-r52wgf69.js +1056 -0
- package/dist/services/deploy-activate-service.d.ts +5 -2
- package/dist/services/deploy-config-file.d.ts +24 -0
- package/dist/services/deploy-delete-service.d.ts +1 -1
- package/dist/services/deploy-run-service.d.ts +8 -1
- package/dist/services/deploy-uninstall-service.d.ts +4 -2
- package/dist/services/deploy-upgrade-service.d.ts +23 -2
- package/dist/services/deployment-feed-locator.d.ts +19 -6
- package/dist/services/deployment-links.d.ts +16 -0
- package/dist/services/deployment-progress.d.ts +10 -0
- package/dist/services/deployment-search.d.ts +15 -2
- package/dist/services/deployment-state.d.ts +9 -0
- package/dist/services/feed-resolver.d.ts +17 -0
- package/dist/services/feed-selection.d.ts +59 -0
- package/dist/services/folder-runtime-check.d.ts +107 -0
- package/dist/services/incomplete-feed-sweep.d.ts +6 -0
- package/dist/services/pack-command-service.d.ts +6 -0
- package/dist/services/pack-project.d.ts +1 -1
- package/dist/services/package-metadata-rewrite.d.ts +13 -0
- package/dist/services/personal-workspace-resolver.d.ts +4 -1
- package/dist/services/prepare-solution-resources.d.ts +11 -6
- package/dist/services/project-contributions.d.ts +26 -2
- package/dist/services/project-identity-telemetry.d.ts +31 -0
- package/dist/services/solution-members.d.ts +31 -0
- package/dist/{ship-telemetry-19gx83af.js → ship-telemetry-9djqndmy.js} +4 -4
- package/dist/{solution-auth-jxcgd2m0.js → solution-auth-0e3qm74f.js} +3 -3
- package/dist/{solution-definition-helper-tqwd6cxn.js → solution-definition-helper-dreejga4.js} +1 -1
- package/dist/{solution-identity-c23d9bfv.js → solution-identity-j63p6n81.js} +4 -4
- package/dist/templates/AGENTS.md +131 -24
- package/dist/tool.js +26 -26
- package/package.json +2 -2
- package/dist/deploy-delete-service-as1jfycj.js +0 -23
- package/dist/deploy-run-service-gs1xv1y1.js +0 -23
- package/dist/feed-resolver-x0kt3yrw.js +0 -27
- package/dist/feed-scope-failure-9p8w0j1v.js +0 -20
- package/dist/pack-command-service-jzbch4eb.js +0 -29
- package/dist/packager-tool-qpryf1x2.js +0 -74
- package/dist/packager-tool-vrqbbh01.js +0 -182
- package/dist/prepare-solution-resources-h7zvnncd.js +0 -26
- package/dist/project-contributions-xx560n8y.js +0 -27
- package/dist/run-service-ekbx2jdg.js +0 -506
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getFileSystem
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-1db1wqdy.js";
|
|
4
4
|
import {
|
|
5
5
|
ShipDimensions,
|
|
6
6
|
catchError
|
|
7
|
-
} from "./packager-tool-
|
|
7
|
+
} from "./packager-tool-gb3dq79g.js";
|
|
8
8
|
import {
|
|
9
9
|
logger,
|
|
10
10
|
trackShipSucceeded
|
|
11
|
-
} from "./packager-tool-
|
|
11
|
+
} from "./packager-tool-xbfr6y2x.js";
|
|
12
12
|
import {
|
|
13
13
|
unzip2
|
|
14
14
|
} from "./packager-tool-rj2d1g0w.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/mappings/resource-subtype-mapper.js
|
|
2
|
+
var solutionsSubtypesMap = {
|
|
3
|
+
Text: "stringAsset",
|
|
4
|
+
Integer: "integerAsset",
|
|
5
|
+
Bool: "booleanAsset",
|
|
6
|
+
Credential: "credentialAsset",
|
|
7
|
+
Secret: "secretAsset",
|
|
8
|
+
Json: "jsonAsset",
|
|
9
|
+
Amazon: "amazonBucket",
|
|
10
|
+
Azure: "azureBucket",
|
|
11
|
+
Orchestrator: "orchestratorBucket",
|
|
12
|
+
Time: "timeTrigger",
|
|
13
|
+
Queue: "queueTrigger",
|
|
14
|
+
Event: "connectedEventTrigger",
|
|
15
|
+
Process: "process",
|
|
16
|
+
ProcessOrchestration: "processOrchestration",
|
|
17
|
+
WebApp: "webApp",
|
|
18
|
+
Agent: "agent",
|
|
19
|
+
TestAutomationProcess: "testAutomationProcess",
|
|
20
|
+
Api: "api",
|
|
21
|
+
Function: "function",
|
|
22
|
+
McpServer: "mcpserver",
|
|
23
|
+
BusinessRule: "businessRule",
|
|
24
|
+
Native: "native",
|
|
25
|
+
Federated: "federated",
|
|
26
|
+
Case: "case",
|
|
27
|
+
CaseMain: "caseMain",
|
|
28
|
+
CaseComment: "caseComment",
|
|
29
|
+
CaseDocument: "caseDocument"
|
|
30
|
+
};
|
|
31
|
+
function mapResourceToSolutionSubtype(entitySubtype) {
|
|
32
|
+
if (!entitySubtype)
|
|
33
|
+
return;
|
|
34
|
+
return solutionsSubtypesMap[entitySubtype] ?? entitySubtype;
|
|
35
|
+
}
|
|
36
|
+
function mapSolutionToResourceSubtype(solutionSubtype) {
|
|
37
|
+
if (!solutionSubtype)
|
|
38
|
+
return;
|
|
39
|
+
for (const [key, value] of Object.entries(solutionsSubtypesMap))
|
|
40
|
+
if (value.toLowerCase() === solutionSubtype.toLowerCase())
|
|
41
|
+
return key;
|
|
42
|
+
return solutionSubtype;
|
|
43
|
+
}
|
|
44
|
+
export { mapResourceToSolutionSubtype, mapSolutionToResourceSubtype };
|
|
45
|
+
|
|
46
|
+
//# debugId=49E336B9322847C764756E2164756E21
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError,
|
|
3
|
+
extractErrorDetails
|
|
4
|
+
} from "./packager-tool-gb3dq79g.js";
|
|
5
|
+
import {
|
|
6
|
+
logger,
|
|
7
|
+
quoteForShell
|
|
8
|
+
} from "./packager-tool-xbfr6y2x.js";
|
|
9
|
+
import {
|
|
10
|
+
MachinesApi,
|
|
11
|
+
createApiClient,
|
|
12
|
+
resolveFolder,
|
|
13
|
+
toProcessType,
|
|
14
|
+
folderRuntimeTypesFor,
|
|
15
|
+
usableFolderRuntimes,
|
|
16
|
+
readFolderRuntimesAsync
|
|
17
|
+
} from "./packager-tool-qhht1tc9.js";
|
|
18
|
+
import {
|
|
19
|
+
Configuration2,
|
|
20
|
+
PipelinesApi,
|
|
21
|
+
classifyFeedSession2
|
|
22
|
+
} from "./packager-tool-hczpvrc1.js";
|
|
23
|
+
import {
|
|
24
|
+
Configuration3,
|
|
25
|
+
DeploymentsApi2
|
|
26
|
+
} from "./packager-tool-2syv199e.js";
|
|
27
|
+
import {
|
|
28
|
+
readDeploymentByKeyAsync2
|
|
29
|
+
} from "./packager-tool-3qach0s4.js";
|
|
30
|
+
import {
|
|
31
|
+
resolvePersonalWorkspace,
|
|
32
|
+
tenantFlag2
|
|
33
|
+
} from "./packager-tool-7j920ac5.js";
|
|
34
|
+
import {
|
|
35
|
+
mapSolutionToResourceSubtype
|
|
36
|
+
} from "./packager-tool-v6jcys3s.js";
|
|
37
|
+
|
|
38
|
+
// src/services/folder-runtime-check.ts
|
|
39
|
+
var CHECK_DEADLINE_MS = 1e4;
|
|
40
|
+
var RESOURCES_PAGE_SIZE = 100;
|
|
41
|
+
var RESOURCES_MAX_PAGES = 20;
|
|
42
|
+
function linkedProcessNamesFromConfig2(config) {
|
|
43
|
+
const resources = config && typeof config === "object" && "resources" in config ? config.resources : undefined;
|
|
44
|
+
if (!Array.isArray(resources)) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return resources.flatMap((resource) => {
|
|
48
|
+
const entry = resource ?? {};
|
|
49
|
+
return String(entry.kind).toLowerCase() === "process" && entry.linkToResource && typeof entry.name === "string" ? [entry.name] : [];
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function folderBoundProcesses(resources, options = {}) {
|
|
53
|
+
const processes = [];
|
|
54
|
+
for (const resource of resources) {
|
|
55
|
+
if (typeof resource?.name !== "string" || String(resource.kind).toLowerCase() !== "process") {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const processType = toProcessType(mapSolutionToResourceSubtype(resource.type ?? undefined));
|
|
59
|
+
if (!processType) {
|
|
60
|
+
logger.debug(`Runtime check: process '${resource.name}' has type '${String(resource.type)}', which is no Orchestrator process type; skipped.`);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const runtimeTypes = folderRuntimeTypesFor(processType, options);
|
|
64
|
+
if (runtimeTypes) {
|
|
65
|
+
processes.push({ name: resource.name, processType, runtimeTypes });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return processes;
|
|
69
|
+
}
|
|
70
|
+
function missingRuntimeWarnings(processes, folderPath, runtimes, options = {}) {
|
|
71
|
+
return processes.filter((process) => usableFolderRuntimes(runtimes.get(process.processType) ?? [], process.runtimeTypes).length === 0).map((process) => missingRuntimeText(process, folderPath, tenantFlag2(options)) + (options.mayBeLinked ? `. If '${process.name}' is linked to an existing process in another folder, check that folder instead: the deployment's links could not be read.` : ""));
|
|
72
|
+
}
|
|
73
|
+
function missingRuntimeText(process, folderPath, tenant) {
|
|
74
|
+
const folder = quoteForShell(folderPath);
|
|
75
|
+
const fix = `find one with: uip or machines list${tenant}. Then assign it: uip or machines assign <machine-key> --folder-path ${folder}${tenant}. Check with: uip or folders runtimes --folder-path ${folder}${tenant}`;
|
|
76
|
+
const needs = `none of ${process.runtimeTypes.join(", ")} has slots there`;
|
|
77
|
+
if (!process.runtimeTypes.includes("Unattended")) {
|
|
78
|
+
return `Folder '${folderPath}' has no serverless runtime for the ${process.processType} process '${process.name}' (${needs}), so it will not start. To fix it, assign a serverless machine to the folder: ${fix}`;
|
|
79
|
+
}
|
|
80
|
+
const machine = process.processType === "TestAutomationProcess" ? "a machine with TestAutomation or Unattended slots (or a serverless machine)" : "a machine with Unattended slots (or a serverless machine)";
|
|
81
|
+
return `Folder '${folderPath}' has no runtime for unattended jobs of the ${process.processType} process '${process.name}' (${needs}): its triggers and the jobs Orchestrator starts will not run until one is assigned. Running it attended from Assistant is not affected. To fix it, assign ${machine} to the folder: ${fix}`;
|
|
82
|
+
}
|
|
83
|
+
function checkFailedText(folder, reason, tenant) {
|
|
84
|
+
const named = folder ? `folder '${folder}'` : "the deployment's folder";
|
|
85
|
+
const flag = folder ? quoteForShell(folder) : "<folder-path>";
|
|
86
|
+
return `Could not check that ${named} has the runtimes the package's processes need: ${reason}. The deploy is not affected. Check it yourself with: uip or folders runtimes --folder-path ${flag}${tenant}`;
|
|
87
|
+
}
|
|
88
|
+
async function failureReason(error) {
|
|
89
|
+
const { message, details } = await extractErrorDetails(error);
|
|
90
|
+
return details && details !== message ? `${message} (${details})` : message;
|
|
91
|
+
}
|
|
92
|
+
async function checkFolderRuntimesAsync2(options, reads) {
|
|
93
|
+
const tenant = tenantFlag2(options);
|
|
94
|
+
if (options.signal?.aborted) {
|
|
95
|
+
return [
|
|
96
|
+
checkFailedText(options.folderPath, "the deploy was cancelled", tenant)
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
const controller = new AbortController;
|
|
100
|
+
const cancel = () => controller.abort();
|
|
101
|
+
options.signal?.addEventListener("abort", cancel, { once: true });
|
|
102
|
+
const deadlineMs = options.deadlineMs ?? CHECK_DEADLINE_MS;
|
|
103
|
+
let timer;
|
|
104
|
+
const expired = new Promise((resolve) => {
|
|
105
|
+
timer = setTimeout(() => {
|
|
106
|
+
controller.abort();
|
|
107
|
+
resolve([
|
|
108
|
+
checkFailedText(options.folderPath, `it did not finish within ${deadlineMs / 1000}s`, tenant)
|
|
109
|
+
]);
|
|
110
|
+
}, deadlineMs);
|
|
111
|
+
if (typeof timer === "object" && "unref" in timer) {
|
|
112
|
+
timer.unref();
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const [error, warnings] = await catchError(Promise.race([
|
|
116
|
+
Promise.resolve().then(() => runCheckAsync(options, reads ?? folderRuntimeReads(options), controller.signal, tenant)),
|
|
117
|
+
expired
|
|
118
|
+
]));
|
|
119
|
+
clearTimeout(timer);
|
|
120
|
+
options.signal?.removeEventListener("abort", cancel);
|
|
121
|
+
if (error) {
|
|
122
|
+
return [
|
|
123
|
+
checkFailedText(options.folderPath, await failureReason(error), tenant)
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
return warnings;
|
|
127
|
+
}
|
|
128
|
+
function attempt(signal, read) {
|
|
129
|
+
return catchError(Promise.resolve().then(() => {
|
|
130
|
+
signal.throwIfAborted();
|
|
131
|
+
return read();
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
async function runCheckAsync(options, reads, signal, tenant) {
|
|
135
|
+
const [packageError, resources] = await attempt(signal, () => reads.packageResources(signal));
|
|
136
|
+
if (packageError) {
|
|
137
|
+
return [
|
|
138
|
+
checkFailedText(options.folderPath, `reading package '${options.packageName}' ${options.packageVersion} failed: ${await failureReason(packageError)}`, tenant)
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
const personalWorkspace = options.personalWorkspace ?? (options.feedKey ? (await attempt(signal, () => reads.inPersonalWorkspace(signal)))[1] === true : false);
|
|
142
|
+
const candidates = folderBoundProcesses(resources, { personalWorkspace });
|
|
143
|
+
if (candidates.length === 0) {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
const [linkError, deployed] = await attempt(signal, () => reads.linkedProcesses(signal));
|
|
147
|
+
const linked = new Set((options.configuredLinks ?? []).map((name) => name.toLowerCase()));
|
|
148
|
+
if (deployed && "names" in deployed) {
|
|
149
|
+
for (const name of deployed.names) {
|
|
150
|
+
linked.add(name);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const unknownBecause = deployed && "unknown" in deployed ? deployed.unknown : undefined;
|
|
154
|
+
const mayBeLinked = Boolean(linkError) || unknownBecause === "failed";
|
|
155
|
+
const processes = candidates.filter((process) => !linked.has(process.name.toLowerCase()));
|
|
156
|
+
if (processes.length === 0) {
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
const [folderError, folder] = await attempt(signal, () => reads.folder(signal));
|
|
160
|
+
if (folderError || !folder) {
|
|
161
|
+
return [
|
|
162
|
+
checkFailedText(options.folderPath, folderError ? `the folder lookup failed: ${await failureReason(folderError)}` : "the folder was not found", tenant)
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
const runtimes = new Map;
|
|
166
|
+
for (const processType of new Set(processes.map((p) => p.processType))) {
|
|
167
|
+
const [runtimesError, rows] = await attempt(signal, () => reads.runtimes(folder.id, processType, signal));
|
|
168
|
+
if (runtimesError) {
|
|
169
|
+
return [
|
|
170
|
+
checkFailedText(folder.path, `reading its runtimes failed: ${await failureReason(runtimesError)}`, tenant)
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
runtimes.set(processType, rows);
|
|
174
|
+
}
|
|
175
|
+
return missingRuntimeWarnings(processes, folder.path, runtimes, {
|
|
176
|
+
tenant: options.tenant,
|
|
177
|
+
mayBeLinked
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function withSignal(scope, signal) {
|
|
181
|
+
return async (context) => ({
|
|
182
|
+
...scope ? await scope(context) : {},
|
|
183
|
+
signal
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function folderRuntimeReads(options) {
|
|
187
|
+
const session = {
|
|
188
|
+
tenant: options.tenant,
|
|
189
|
+
loginValidity: options.loginValidity,
|
|
190
|
+
envFilePath: options.envFilePath
|
|
191
|
+
};
|
|
192
|
+
let machines;
|
|
193
|
+
return {
|
|
194
|
+
packageResources: async (signal) => {
|
|
195
|
+
const api = new PipelinesApi(new Configuration2({
|
|
196
|
+
basePath: options.auth.basePath,
|
|
197
|
+
accessToken: options.auth.accessToken
|
|
198
|
+
}));
|
|
199
|
+
const version = await api.pipelinesGetPackageVersion({
|
|
200
|
+
packageName: options.packageName,
|
|
201
|
+
packageVersion: options.packageVersion
|
|
202
|
+
}, withSignal(options.scope, signal));
|
|
203
|
+
const resources = version?.components?.resources;
|
|
204
|
+
if (!Array.isArray(resources)) {
|
|
205
|
+
throw new Error("the answer carried no resource list");
|
|
206
|
+
}
|
|
207
|
+
return resources;
|
|
208
|
+
},
|
|
209
|
+
linkedProcesses: (signal) => linkedProcessesAsync(options, signal),
|
|
210
|
+
inPersonalWorkspace: async (signal) => {
|
|
211
|
+
if (classifyFeedSession2(options.auth) !== "user") {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
const workspace = await resolvePersonalWorkspace({
|
|
215
|
+
...session,
|
|
216
|
+
signal
|
|
217
|
+
});
|
|
218
|
+
return workspace.key === options.feedKey;
|
|
219
|
+
},
|
|
220
|
+
folder: async (signal) => {
|
|
221
|
+
const folderKey = await installedRootFolderKeyAsync(options, signal);
|
|
222
|
+
signal.throwIfAborted();
|
|
223
|
+
const folder = await resolveFolder(folderKey ? { folderKey } : { folderPath: options.folderPath }, { ...session, signal });
|
|
224
|
+
return folder && { id: folder.id, path: folder.path };
|
|
225
|
+
},
|
|
226
|
+
runtimes: async (folderId, processType, signal) => {
|
|
227
|
+
machines ??= createApiClient(MachinesApi, session);
|
|
228
|
+
return readFolderRuntimesAsync(await machines, folderId, processType, { signal });
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
async function linkedProcessesAsync(options, signal) {
|
|
233
|
+
if (classifyFeedSession2(options.auth) !== "user") {
|
|
234
|
+
return { unknown: "session" };
|
|
235
|
+
}
|
|
236
|
+
const deploymentKey = options.deploymentKey;
|
|
237
|
+
if (!deploymentKey) {
|
|
238
|
+
return { unknown: "failed" };
|
|
239
|
+
}
|
|
240
|
+
const api = new DeploymentsApi2(new Configuration3({
|
|
241
|
+
basePath: options.auth.basePath,
|
|
242
|
+
accessToken: options.auth.accessToken
|
|
243
|
+
}));
|
|
244
|
+
const names = new Set;
|
|
245
|
+
for (let page = 0, skip = 0;page < RESOURCES_MAX_PAGES; page++) {
|
|
246
|
+
const result = await api.deploymentsGetDeploymentResources({ deploymentKey, skip, take: RESOURCES_PAGE_SIZE }, withSignal(options.scope, signal));
|
|
247
|
+
const values = result?.values ?? [];
|
|
248
|
+
for (const resource of values) {
|
|
249
|
+
if (typeof resource?.name === "string" && String(resource.kind).toLowerCase() === "process" && resource.resourceReplacement) {
|
|
250
|
+
names.add(resource.name.toLowerCase());
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
skip += values.length;
|
|
254
|
+
if (values.length < RESOURCES_PAGE_SIZE || typeof result?.count === "number" && skip >= result.count) {
|
|
255
|
+
return { names };
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return { unknown: "failed" };
|
|
259
|
+
}
|
|
260
|
+
async function installedRootFolderKeyAsync(options, signal) {
|
|
261
|
+
if (!options.deploymentKey) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
const [, record] = await catchError(readDeploymentByKeyAsync2(options.auth, options.deploymentKey, {
|
|
265
|
+
scope: options.scope,
|
|
266
|
+
signal
|
|
267
|
+
}));
|
|
268
|
+
return record?.deploymentKey === options.deploymentKey ? record.installedRootFolderKey ?? undefined : undefined;
|
|
269
|
+
}
|
|
270
|
+
function logFolderRuntimeWarnings2(warnings) {
|
|
271
|
+
for (const warning of warnings) {
|
|
272
|
+
logger.warn(warning);
|
|
273
|
+
}
|
|
274
|
+
return warnings;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export { linkedProcessNamesFromConfig2, checkFolderRuntimesAsync2, logFolderRuntimeWarnings2 };
|
|
278
|
+
|
|
279
|
+
//# debugId=9B9C3798A004BA3E64756E2164756E21
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFileSystem
|
|
3
|
+
} from "./packager-tool-1db1wqdy.js";
|
|
4
|
+
import {
|
|
5
|
+
CommandDimensions,
|
|
6
|
+
ProjectDimensions,
|
|
7
|
+
projectKey,
|
|
8
|
+
projectIdentityProperties,
|
|
9
|
+
PROJECT_IDENTITY_LOOKUP_BUDGET_MS,
|
|
10
|
+
withinProjectIdentityBudget,
|
|
11
|
+
catchError,
|
|
12
|
+
isProjectTelemetryDisabled
|
|
13
|
+
} from "./packager-tool-gb3dq79g.js";
|
|
14
|
+
import {
|
|
15
|
+
logger,
|
|
16
|
+
CommonTelemetryEvents,
|
|
17
|
+
telemetry
|
|
18
|
+
} from "./packager-tool-xbfr6y2x.js";
|
|
19
|
+
import {
|
|
20
|
+
toolsFactoryRepository
|
|
21
|
+
} from "./packager-tool-devc4w73.js";
|
|
22
|
+
import {
|
|
23
|
+
toPortableRelativePath2
|
|
24
|
+
} from "./packager-tool-kmwjscby.js";
|
|
25
|
+
|
|
26
|
+
// src/services/solution-members.ts
|
|
27
|
+
function projectDirOf(fs, declaredPath) {
|
|
28
|
+
const dir = fs.path.dirname(toPortableRelativePath2(declaredPath));
|
|
29
|
+
return dir && dir !== "." ? dir : "";
|
|
30
|
+
}
|
|
31
|
+
async function readSolutionProjects(solutionDir, fs) {
|
|
32
|
+
const entries = await fs.readdir(solutionDir);
|
|
33
|
+
const uipxFile = entries.find((f) => f.endsWith(".uipx"));
|
|
34
|
+
if (!uipxFile) {
|
|
35
|
+
throw new Error(`No .uipx solution file found in '${solutionDir}'. ` + `Pass a solution directory or run 'uip solution init' first.`);
|
|
36
|
+
}
|
|
37
|
+
const content = await fs.readFile(fs.path.join(solutionDir, uipxFile));
|
|
38
|
+
if (!content) {
|
|
39
|
+
throw new Error(`Solution file '${uipxFile}' is empty.`);
|
|
40
|
+
}
|
|
41
|
+
const json = typeof content === "string" ? content : new TextDecoder().decode(content);
|
|
42
|
+
const [parseError, solution] = catchError(() => JSON.parse(json));
|
|
43
|
+
if (parseError) {
|
|
44
|
+
throw new Error(`Failed to parse ${uipxFile}: ${parseError.message}`);
|
|
45
|
+
}
|
|
46
|
+
return (solution.Projects ?? []).map((p) => {
|
|
47
|
+
const relativePath = projectDirOf(fs, p.ProjectRelativePath ?? "");
|
|
48
|
+
return {
|
|
49
|
+
name: p.Name || fs.path.basename(relativePath || solutionDir) || "",
|
|
50
|
+
projectType: p.Type ?? "",
|
|
51
|
+
relativePath,
|
|
52
|
+
...p.Id ? { designId: p.Id } : {}
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/services/project-identity-telemetry.ts
|
|
58
|
+
function membershipProperties(memberId, solutionId) {
|
|
59
|
+
return {
|
|
60
|
+
[ProjectDimensions.SolutionProjectKey]: projectKey(memberId),
|
|
61
|
+
...solutionId ? { [ProjectDimensions.SolutionKey]: projectKey(solutionId) } : {}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function identityReaderFor(projectType) {
|
|
65
|
+
const factory = toolsFactoryRepository.canHandleProject(projectType) ? toolsFactoryRepository.getProjectToolFactory(projectType) : undefined;
|
|
66
|
+
return factory?.readProjectIdentityAsync;
|
|
67
|
+
}
|
|
68
|
+
async function readIdentityWithinBudget(reader, projectPath, what) {
|
|
69
|
+
try {
|
|
70
|
+
return await withinProjectIdentityBudget(reader(projectPath, getFileSystem()), () => logger.debug(`${what} identity skipped: no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
|
|
71
|
+
} catch {
|
|
72
|
+
return { status: "invalid" };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function createProjectActivityObserver2(commandName) {
|
|
76
|
+
if (isProjectTelemetryDisabled())
|
|
77
|
+
return;
|
|
78
|
+
const properties = new Map;
|
|
79
|
+
const finished = new Set;
|
|
80
|
+
return async (project, phase, success, solutionId) => {
|
|
81
|
+
if (project.Type !== "Api")
|
|
82
|
+
return;
|
|
83
|
+
const member = project.Id;
|
|
84
|
+
if (phase === "before") {
|
|
85
|
+
if (properties.has(member))
|
|
86
|
+
return;
|
|
87
|
+
const membership = membershipProperties(member, solutionId);
|
|
88
|
+
const row = (status, id) => ({
|
|
89
|
+
...projectIdentityProperties({
|
|
90
|
+
projectType: project.Type,
|
|
91
|
+
status,
|
|
92
|
+
...id ? { id } : {}
|
|
93
|
+
}),
|
|
94
|
+
...membership
|
|
95
|
+
});
|
|
96
|
+
const reader = identityReaderFor(project.Type);
|
|
97
|
+
if (!reader || !project.ProjectPath) {
|
|
98
|
+
properties.set(member, row("unsupported"));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
properties.set(member, row("timeout"));
|
|
102
|
+
const descriptor = await readIdentityWithinBudget(reader, project.ProjectPath, "project activity");
|
|
103
|
+
if (descriptor && !finished.has(member))
|
|
104
|
+
properties.set(member, row(descriptor.status, descriptor.id));
|
|
105
|
+
} else if (!finished.has(member)) {
|
|
106
|
+
finished.add(member);
|
|
107
|
+
telemetry.trackEvent(CommonTelemetryEvents.ProjectActivity, {
|
|
108
|
+
...properties.get(member),
|
|
109
|
+
[CommandDimensions.CommandName]: commandName,
|
|
110
|
+
[CommandDimensions.TerminalOutcome]: success ? "success" : "failure"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
async function trackUploadedProjectIdentities2(upload) {
|
|
116
|
+
if (isProjectTelemetryDisabled())
|
|
117
|
+
return;
|
|
118
|
+
try {
|
|
119
|
+
const fs = getFileSystem();
|
|
120
|
+
const members = await withinProjectIdentityBudget(readSolutionProjects(upload.solutionDir, fs), () => logger.debug(`upload project identity skipped: no answer from the solution manifest within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
|
|
121
|
+
if (!members)
|
|
122
|
+
return;
|
|
123
|
+
const assigned = assignedProjectIds(upload.response.projects);
|
|
124
|
+
const rows = await Promise.all(members.map((member) => uploadedMemberRow(member, assigned, upload, fs)));
|
|
125
|
+
for (const row of rows)
|
|
126
|
+
if (row)
|
|
127
|
+
telemetry.trackEvent(CommonTelemetryEvents.ProjectActivity, row);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
logger.debug(`upload project identity skipped: ${error instanceof Error ? error.message : String(error)}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function uploadedMemberRow(member, assigned, upload, fs) {
|
|
133
|
+
const skip = (why) => {
|
|
134
|
+
logger.debug(`upload project identity: no row for member '${member.name}': ${why}`);
|
|
135
|
+
return;
|
|
136
|
+
};
|
|
137
|
+
const memberKey = projectKey(member.designId);
|
|
138
|
+
if (!member.designId || !memberKey)
|
|
139
|
+
return skip("the .uipx entry has no GUID id");
|
|
140
|
+
const assignedId = assigned.get(memberKey);
|
|
141
|
+
if (!assignedId)
|
|
142
|
+
return skip("the response does not name it");
|
|
143
|
+
const cloudKey = projectKey(assignedId);
|
|
144
|
+
if (!cloudKey)
|
|
145
|
+
return skip("the Studio Web project id is not a GUID");
|
|
146
|
+
const reader = identityReaderFor(member.projectType);
|
|
147
|
+
if (!reader)
|
|
148
|
+
return skip(`no identity reader for type '${member.projectType}'`);
|
|
149
|
+
const answer = await readIdentityWithinBudget(reader, fs.path.join(upload.solutionDir, member.relativePath), `upload project '${member.name}'`);
|
|
150
|
+
if (answer === undefined)
|
|
151
|
+
return;
|
|
152
|
+
const localKey = answer.status === "resolved" ? projectKey(answer.id) : undefined;
|
|
153
|
+
if (!localKey)
|
|
154
|
+
return skip(answer.status === "resolved" ? "local id is not a GUID" : `local id ${answer.status}`);
|
|
155
|
+
return {
|
|
156
|
+
[CommandDimensions.CommandName]: "uip solution upload",
|
|
157
|
+
[CommandDimensions.TerminalOutcome]: "success",
|
|
158
|
+
...projectIdentityProperties({
|
|
159
|
+
projectType: member.projectType,
|
|
160
|
+
status: "resolved",
|
|
161
|
+
id: assignedId
|
|
162
|
+
}),
|
|
163
|
+
...localKey !== cloudKey ? { [ProjectDimensions.PreviousProjectKey]: localKey } : {},
|
|
164
|
+
...membershipProperties(member.designId, upload.solutionId)
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function assignedProjectIds(projects) {
|
|
168
|
+
const assigned = new Map;
|
|
169
|
+
for (const project of projects ?? []) {
|
|
170
|
+
const key = projectKey(project.designId);
|
|
171
|
+
if (key && project.id && !assigned.has(key))
|
|
172
|
+
assigned.set(key, project.id);
|
|
173
|
+
}
|
|
174
|
+
return assigned;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export { readSolutionProjects, createProjectActivityObserver2, trackUploadedProjectIdentities2 };
|
|
178
|
+
|
|
179
|
+
//# debugId=4FF633FBB6BE1FA864756E2164756E21
|