@uipath/solution-tool 1.206.0-preview.301 → 1.207.0-preview.305
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-ma0gy822.js → archive-extract-afgwacbg.js} +3 -3
- package/dist/{cleanup-command-service-8whhrsvy.js → cleanup-command-service-j9kawew9.js} +20 -15
- package/dist/deploy-delete-service-1erqap9a.js +23 -0
- package/dist/deploy-run-service-jbs6dxye.js +24 -0
- package/dist/{deploy-status-service-at6cxp1a.js → deploy-status-service-4zn90vds.js} +49 -25
- package/dist/deploy.js +21 -20
- package/dist/{deployment-search-40dknsk1.js → deployment-search-dwzahe4v.js} +9 -9
- package/dist/feed-resolver-d14rdjss.js +31 -0
- package/dist/feed-scope-failure-w16mze3z.js +20 -0
- package/dist/{feed-session-dvyfw5k7.js → feed-session-f2sby6t8.js} +6 -6
- package/dist/{first-party-service-6gf3n6d8.js → first-party-service-7cggb17y.js} +1 -1
- package/dist/folder-runtime-check-586c41dq.js +25 -0
- package/dist/{governance-options-am1hfj5b.js → governance-options-y2xsv7ff.js} +7 -7
- package/dist/{packager-tool-5vf0v538.js → index-6ma58k47.js} +33 -708
- package/dist/{index-p3x7ztdr.js → index-795rsz0e.js} +1 -1
- package/dist/{index-yjvmjpdn.js → index-pzkzbqbs.js} +12 -11
- package/dist/{index-1cfw8mj0.js → index-wfqzwh7k.js} +9 -7
- package/dist/index.js +26 -26
- package/dist/init.js +10 -10
- package/dist/{list-vsecskj1.js → list-6pe1nab5.js} +11 -11
- package/dist/models/pack-command-types.d.ts +12 -0
- package/dist/{node-vndr59bc.js → node-13wj5mzd.js} +6 -6
- package/dist/pack-command-service-j9bqnsn1.js +32 -0
- package/dist/{pack-project-re7s480k.js → pack-project-3sdddc42.js} +21 -18
- package/dist/pack.js +25 -22
- package/dist/{package-id-rx8gq6y2.js → package-id-5j4q232a.js} +3 -3
- 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-t2r6z24f.js → packager-tool-1tvhgac9.js} +15 -6
- package/dist/{packager-tool-4pt71nf1.js → packager-tool-2atxqqgd.js} +49 -24
- package/dist/packager-tool-3ft8hywr.js +449 -0
- package/dist/{packager-tool-g1c0xdh2.js → packager-tool-46x80z85.js} +8 -4
- package/dist/{packager-tool-gjfb0wcy.js → packager-tool-4hm40a32.js} +8 -74
- package/dist/{packager-tool-f15an17m.js → packager-tool-5p1vy335.js} +1 -1
- package/dist/packager-tool-612prgtc.js +140 -0
- package/dist/packager-tool-7gqn5apd.js +72 -0
- package/dist/{packager-tool-aws5w512.js → packager-tool-887bkh9y.js} +1 -1
- package/dist/{packager-tool-vj88gh5b.js → packager-tool-8tckw03n.js} +28 -9
- package/dist/{packager-tool-9vtp28fb.js → packager-tool-93qy1v8m.js} +52 -15
- package/dist/{packager-tool-fx4ws49n.js → packager-tool-cenfraf4.js} +2 -2
- package/dist/{packager-tool-chff74yz.js → packager-tool-cr1khqtm.js} +103 -166
- package/dist/{packager-tool-6tn79r1b.js → packager-tool-da3hvfyn.js} +528 -202
- package/dist/{packager-tool-2zn98p5r.js → packager-tool-dd937g7k.js} +4 -4
- package/dist/{packager-tool-a7s0gbxs.js → packager-tool-devc4w73.js} +7 -2
- package/dist/{packager-tool-v7h8s6yj.js → packager-tool-ewbkaecg.js} +18 -11
- package/dist/{packager-tool-d7v4083a.js → packager-tool-g08b669a.js} +22 -18
- package/dist/{packager-tool-m07vyk89.js → packager-tool-gb3dq79g.js} +36 -9
- package/dist/{packager-tool-395kmy70.js → packager-tool-gmbcn83x.js} +3 -3
- package/dist/{packager-tool-btz44ase.js → packager-tool-jhtsana2.js} +119 -52
- package/dist/{packager-tool-4rvfxkyh.js → packager-tool-jtg2arr8.js} +20 -8
- package/dist/{packager-tool-t39pjz7n.js → packager-tool-jtvhkavz.js} +48 -6
- package/dist/packager-tool-kffz64hn.js +279 -0
- 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-avrdp2za.js → packager-tool-pmc5txbm.js} +4 -6
- package/dist/{packager-tool-egc54x78.js → packager-tool-qhht1tc9.js} +2408 -771
- package/dist/{packager-tool-zcqfq3vc.js → packager-tool-qm876ezh.js} +84 -29
- package/dist/{packager-tool-resolver-30hxk8vm.js → packager-tool-resolver-y52kztnx.js} +6 -6
- package/dist/{packager-tool-3ejz0af8.js → packager-tool-rhg3mwkn.js} +14 -8
- package/dist/{packager-tool-ckrt4gyr.js → packager-tool-t9zked1m.js} +3 -3
- package/dist/{packager-tool-36w7az7k.js → packager-tool-tat0qs6z.js} +26 -10
- package/dist/packager-tool-tf0rn1tp.js +741 -0
- package/dist/{packager-tool-p5aar2k0.js → packager-tool-tmba5jv0.js} +140 -10
- package/dist/{packager-tool-vk3e239z.js → packager-tool-tqe3m1xp.js} +6 -6
- package/dist/{packager-tool-1ctvbx0h.js → packager-tool-tr3ttz5c.js} +1 -1
- package/dist/{packager-tool-k9dk39tg.js → packager-tool-txygqgb2.js} +3 -3
- package/dist/packager-tool-v6jcys3s.js +46 -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-2qsbh4kd.js → packager-tool-yfcscjfp.js} +50 -12
- package/dist/{packager-tool-ay4j9x92.js → packager-tool-ykq6gmhc.js} +19 -8
- package/dist/packager-tool.js +2 -2
- package/dist/prepare-solution-resources-sk3tyy8b.js +26 -0
- package/dist/{project-command-utils-82tja3k0.js → project-command-utils-7ygs8xq0.js} +20 -13
- package/dist/project-contributions-nzh06q0y.js +31 -0
- package/dist/project-identity-telemetry-47k2g7nq.js +18 -0
- package/dist/publish.js +14 -14
- package/dist/{resource-mutations-h6wfdqr4.js → resource-mutations-qcz2vcxe.js} +9 -9
- package/dist/{resource-version-lookup-xzgnvr48.js → resource-version-lookup-w3kzh4z9.js} +9 -9
- package/dist/resource.js +9 -9
- package/dist/{restore-command-service-wgqxp5tb.js → restore-command-service-m6c8fb7q.js} +20 -15
- package/dist/run-service-cmrzccnm.js +1055 -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-bkyhs1bd.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-dwd4qb1m.js +0 -23
- package/dist/deploy-run-service-0kzfrvnn.js +0 -23
- package/dist/feed-resolver-w4y5aspe.js +0 -27
- package/dist/feed-scope-failure-4ef9zxcx.js +0 -20
- package/dist/pack-command-service-k7ebbfya.js +0 -29
- package/dist/packager-tool-vrqbbh01.js +0 -182
- package/dist/packager-tool-wwzg88qy.js +0 -74
- package/dist/prepare-solution-resources-h7zvnncd.js +0 -26
- package/dist/project-contributions-xx560n8y.js +0 -27
- package/dist/run-service-2rc4we5q.js +0 -506
|
@@ -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-tqe3m1xp.js";
|
|
23
|
+
import {
|
|
24
|
+
Configuration3,
|
|
25
|
+
DeploymentsApi2
|
|
26
|
+
} from "./packager-tool-46x80z85.js";
|
|
27
|
+
import {
|
|
28
|
+
readDeploymentByKeyAsync2
|
|
29
|
+
} from "./packager-tool-rhg3mwkn.js";
|
|
30
|
+
import {
|
|
31
|
+
resolvePersonalWorkspace,
|
|
32
|
+
tenantFlag2
|
|
33
|
+
} from "./packager-tool-ewbkaecg.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
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catchError
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-gb3dq79g.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
|
-
} from "./packager-tool-
|
|
6
|
+
} from "./packager-tool-xbfr6y2x.js";
|
|
7
7
|
|
|
8
8
|
// ../solution-sdk/src/solution-file.ts
|
|
9
|
+
class SolutionFileError extends Error {
|
|
10
|
+
errorCode;
|
|
11
|
+
constructor(message, errorCode) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "SolutionFileError";
|
|
14
|
+
this.errorCode = errorCode;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
9
17
|
var STUDIO_WEB_PROJECT_TYPE_OVERRIDES = {
|
|
10
18
|
ProcessOrchestration: "processOrchestration"
|
|
11
19
|
};
|
|
@@ -63,6 +71,29 @@ function resolveSolutionDir2(fs, inputPath) {
|
|
|
63
71
|
}
|
|
64
72
|
return resolved;
|
|
65
73
|
}
|
|
74
|
+
var DEFAULT_UIPX_INDENT = " ";
|
|
75
|
+
function escapeRegExp(text) {
|
|
76
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
77
|
+
}
|
|
78
|
+
function withSolutionId(content, parsed, newSolutionId) {
|
|
79
|
+
const previous = parsed.SolutionId;
|
|
80
|
+
if (typeof previous === "string") {
|
|
81
|
+
const pattern = new RegExp(`("SolutionId"\\s*:\\s*")${escapeRegExp(previous)}(")`, "g");
|
|
82
|
+
const matches = content.match(pattern) ?? [];
|
|
83
|
+
if (matches.length === 1) {
|
|
84
|
+
return content.replace(pattern, (_match, open, close) => `${open}${newSolutionId}${close}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const indent = content.match(/^([ \t]+)"/m)?.[1] ?? DEFAULT_UIPX_INDENT;
|
|
88
|
+
const text = JSON.stringify({ ...parsed, SolutionId: newSolutionId }, null, indent);
|
|
89
|
+
const eol = content.includes(`\r
|
|
90
|
+
`) ? `\r
|
|
91
|
+
` : `
|
|
92
|
+
`;
|
|
93
|
+
const body = text.replace(/\n/g, eol);
|
|
94
|
+
return content.endsWith(`
|
|
95
|
+
`) ? `${body}${eol}` : body;
|
|
96
|
+
}
|
|
66
97
|
async function updateUipxSolutionId2(fs, uipxPath, newSolutionId) {
|
|
67
98
|
const [readError, content] = await catchError(fs.readFile(uipxPath, "utf-8"));
|
|
68
99
|
if (readError || !content) {
|
|
@@ -74,13 +105,21 @@ async function updateUipxSolutionId2(fs, uipxPath, newSolutionId) {
|
|
|
74
105
|
logger.error(`Could not parse .uipx file for update: ${parseError.message}`);
|
|
75
106
|
return;
|
|
76
107
|
}
|
|
77
|
-
parsed.SolutionId
|
|
78
|
-
|
|
108
|
+
if (parsed.SolutionId === newSolutionId) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const [writeError] = await catchError(fs.writeFile(uipxPath, withSolutionId(content, parsed, newSolutionId)));
|
|
79
112
|
if (writeError) {
|
|
80
113
|
logger.error(`Could not update .uipx with new SolutionId: ${writeError.message}`);
|
|
81
|
-
|
|
82
|
-
logger.info(`Updated .uipx with Studio Web SolutionId: ${newSolutionId}`);
|
|
114
|
+
return;
|
|
83
115
|
}
|
|
116
|
+
const from = typeof parsed.SolutionId === "string" ? parsed.SolutionId : undefined;
|
|
117
|
+
logger.warn(from ? `Rewrote SolutionId in ${uipxPath}: ${from} -> ${newSolutionId} (Studio Web's id for this solution).` : `Wrote SolutionId ${newSolutionId} into ${uipxPath} (Studio Web's id for this solution).`);
|
|
118
|
+
return {
|
|
119
|
+
Path: uipxPath,
|
|
120
|
+
...from ? { From: from } : {},
|
|
121
|
+
To: newSolutionId
|
|
122
|
+
};
|
|
84
123
|
}
|
|
85
124
|
async function findSolutionFileUpward(fs, startDir) {
|
|
86
125
|
let dir = startDir;
|
|
@@ -91,16 +130,55 @@ async function findSolutionFileUpward(fs, startDir) {
|
|
|
91
130
|
return fs.path.join(dir, files[0]);
|
|
92
131
|
}
|
|
93
132
|
if (files.length > 1) {
|
|
94
|
-
throw new
|
|
133
|
+
throw new SolutionFileError(`Multiple .uipx files found in ${dir}. Please specify which solution file to use.`, "invalid_argument");
|
|
95
134
|
}
|
|
96
135
|
const parent = fs.path.dirname(dir);
|
|
97
136
|
if (parent === dir) {
|
|
98
|
-
throw new
|
|
137
|
+
throw new SolutionFileError(`No .uipx solution file found (searched from ${startDir} to filesystem root)`, "not_found");
|
|
99
138
|
}
|
|
100
139
|
dir = parent;
|
|
101
140
|
}
|
|
102
141
|
}
|
|
103
142
|
|
|
104
|
-
|
|
143
|
+
// ../solution-sdk/src/resources/services/resource-name.ts
|
|
144
|
+
var MAX_RESOURCE_NAME_LENGTH = 256;
|
|
145
|
+
var UNSAFE_NAME_CHARS = /[\\/:*?"<>|]/;
|
|
146
|
+
function hasControlChar(value) {
|
|
147
|
+
for (let i = 0;i < value.length; i++) {
|
|
148
|
+
if (value.charCodeAt(i) < 32)
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
function hasUnsafeNameChars(name) {
|
|
154
|
+
return UNSAFE_NAME_CHARS.test(name) || hasControlChar(name);
|
|
155
|
+
}
|
|
156
|
+
function validateResourceName2(name, options = {}) {
|
|
157
|
+
const optionName = options.optionName ?? "--name";
|
|
158
|
+
if (name.trim() === "") {
|
|
159
|
+
return {
|
|
160
|
+
ok: false,
|
|
161
|
+
message: `${optionName} must not be blank`,
|
|
162
|
+
instructions: "Pass a non-empty resource name."
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
if (name.length > MAX_RESOURCE_NAME_LENGTH) {
|
|
166
|
+
return {
|
|
167
|
+
ok: false,
|
|
168
|
+
message: `${optionName} exceeds the ${MAX_RESOURCE_NAME_LENGTH}-character limit (got ${name.length})`,
|
|
169
|
+
instructions: "Shorten the resource name. Orchestrator name limits are kind-specific (queues cap at 50, assets at 256)."
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
if (hasUnsafeNameChars(name)) {
|
|
173
|
+
return {
|
|
174
|
+
ok: false,
|
|
175
|
+
message: `${optionName} contains unsafe characters`,
|
|
176
|
+
instructions: 'Resource names cannot contain path separators (/, \\), control characters, or any of: : * ? " < > |'
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return { ok: true };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { SolutionFileError, normalizeProjectType, toPortableRelativePath2, readUipxFile, resolveSolutionDir2, updateUipxSolutionId2, findSolutionFileUpward, hasUnsafeNameChars, validateResourceName2 };
|
|
105
183
|
|
|
106
|
-
//# debugId=
|
|
184
|
+
//# debugId=8EDCA88CEAA6E29B64756E2164756E21
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAuthContext
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-jtvhkavz.js";
|
|
4
4
|
|
|
5
5
|
// ../solution-sdk/src/solution-auth.ts
|
|
6
6
|
async function getSolutionAuthContext2(options) {
|
|
@@ -16,6 +16,8 @@ async function getSolutionAuthContext2(options) {
|
|
|
16
16
|
return {
|
|
17
17
|
accessToken: ctx.accessToken,
|
|
18
18
|
basePath,
|
|
19
|
+
baseUrl: ctx.baseUrl,
|
|
20
|
+
organizationName: ctx.organizationName,
|
|
19
21
|
organizationId,
|
|
20
22
|
tenantName,
|
|
21
23
|
identity: ctx.identity
|
|
@@ -24,4 +26,4 @@ async function getSolutionAuthContext2(options) {
|
|
|
24
26
|
|
|
25
27
|
export { getSolutionAuthContext2 };
|
|
26
28
|
|
|
27
|
-
//# debugId=
|
|
29
|
+
//# debugId=DC4278ED780D063764756E2164756E21
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
catchError
|
|
3
|
-
} from "./packager-tool-m07vyk89.js";
|
|
4
|
-
import {
|
|
2
|
+
catchError,
|
|
5
3
|
RESULTS
|
|
6
|
-
} from "./packager-tool-
|
|
4
|
+
} from "./packager-tool-gb3dq79g.js";
|
|
7
5
|
import {
|
|
8
6
|
describeFeedResolutionFailureAsync2,
|
|
9
7
|
resolveFeedScope2
|
|
10
|
-
} from "./packager-tool-
|
|
8
|
+
} from "./packager-tool-ewbkaecg.js";
|
|
11
9
|
|
|
12
10
|
// src/services/feed-scope-failure.ts
|
|
13
11
|
async function resolveFeedScopeOrFailureAsync2(options, session) {
|
|
@@ -36,4 +34,4 @@ async function resolveFeedScopeOrFailureAsync2(options, session) {
|
|
|
36
34
|
|
|
37
35
|
export { resolveFeedScopeOrFailureAsync2 };
|
|
38
36
|
|
|
39
|
-
//# debugId=
|
|
37
|
+
//# debugId=A27212915EB0418664756E2164756E21
|