@uipath/solution-tool 1.203.0-preview.203 → 1.204.0-preview.206
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/README.md +2 -2
- package/dist/THIRD-PARTY-NOTICES.md +42 -4
- package/dist/deploy-delete-service-y9dwehmn.js +22 -0
- package/dist/deploy-status-service-nmhnnjmy.js +256 -0
- package/dist/deploy.d.ts +11 -4
- package/dist/deploy.js +19 -7
- package/dist/deployment-search-eb337bjh.js +49 -0
- package/dist/{embedded-file-reader-xxqe8vs8.js → embedded-file-reader-rf2g1kfj.js} +2 -2
- package/dist/feed-resolver-dmtnswcc.js +27 -0
- package/dist/feed-scope-failure-e2yaqfg2.js +18 -0
- package/dist/feed-session-sxga31vn.js +17 -0
- package/dist/index.js +27 -18
- package/dist/init.js +10 -7
- package/dist/{list-n0xd5rgn.js → list-rbjqgz6s.js} +9 -6
- package/dist/pack.js +14 -11
- package/dist/{packager-tool-vas0xg5h.js → packager-tool-2cntqvdv.js} +5 -3
- package/dist/{packager-tool-1haahq17.js → packager-tool-3enm2h28.js} +5 -5
- package/dist/{packager-tool-2syrt51a.js → packager-tool-3fv6zc86.js} +1062 -825
- package/dist/packager-tool-3fyq6wjs.js +5889 -0
- package/dist/{packager-tool-k4mskzww.js → packager-tool-5dzjsw5q.js} +3 -3
- package/dist/{packager-tool-0f0wt9vh.js → packager-tool-5fjp60dk.js} +3071 -2794
- package/dist/{packager-tool-x6gzyxnn.js → packager-tool-752zvh64.js} +756 -359
- package/dist/{packager-tool-bkwnetqn.js → packager-tool-83rzavkx.js} +383 -88
- package/dist/{packager-tool-7znqtw3f.js → packager-tool-9vvdgbay.js} +8 -6
- package/dist/packager-tool-b8pppqbb.js +172 -0
- package/dist/packager-tool-bqre28m1.js +43 -0
- package/dist/packager-tool-dh0m3ebf.js +173 -0
- package/dist/packager-tool-f5gq77m5.js +28 -0
- package/dist/{packager-tool-nzghfa48.js → packager-tool-fv7xyzg2.js} +550 -2
- package/dist/{packager-tool-3jrq7smt.js → packager-tool-gb35b4qs.js} +206 -289
- package/dist/{packager-tool-j2cqgegq.js → packager-tool-he7ak44z.js} +16 -74
- package/dist/packager-tool-myn57mc3.js +322 -0
- package/dist/{packager-tool-4rzjjv2p.js → packager-tool-n1nzj2b9.js} +1008 -647
- package/dist/packager-tool-n6yb6zp9.js +113 -0
- package/dist/{packager-tool-h4wn0y42.js → packager-tool-qgaqqq41.js} +320 -151
- package/dist/{packager-tool-resolver-fmjr60x8.js → packager-tool-resolver-2cbxyq6k.js} +6 -5
- package/dist/{packager-tool-ge4rvy7p.js → packager-tool-t12hj6pd.js} +1022 -1342
- package/dist/{packager-tool-znakt6yw.js → packager-tool-vh4ng74p.js} +8 -6
- package/dist/packager-tool-vmsxq1pc.js +104 -0
- package/dist/packager-tool-w6jr4638.js +166 -0
- package/dist/packager-tool-zf3929se.js +237 -0
- package/dist/packager-tool-zns6n8zp.js +837 -0
- package/dist/packager-tool-zw3036b8.js +37 -0
- package/dist/packager-tool.js +2 -2
- package/dist/prepare-solution-resources-p3gzdecy.js +25 -0
- package/dist/{project-contributions-cvttys34.js → project-contributions-txe8v6sm.js} +12 -9
- package/dist/publish.js +12 -7
- package/dist/resource.js +9 -6
- package/dist/services/activation.d.ts +17 -2
- package/dist/services/deploy-activate-service.d.ts +10 -0
- package/dist/services/deploy-delete-service.d.ts +82 -0
- package/dist/services/deploy-list-service.d.ts +15 -45
- package/dist/services/deploy-run-service.d.ts +36 -23
- package/dist/services/deploy-upgrade-service.d.ts +198 -39
- package/dist/services/deployment-feed-locator.d.ts +50 -12
- package/dist/services/deployment-search-client.d.ts +55 -0
- package/dist/services/deployment-search.d.ts +87 -34
- package/dist/services/deployment-state.d.ts +119 -0
- package/dist/services/feed-resolver.d.ts +31 -0
- package/dist/services/feed-session.d.ts +70 -0
- package/dist/services/folder-helper.d.ts +4 -27
- package/dist/services/http-status.d.ts +9 -0
- package/dist/services/incomplete-feed-sweep.d.ts +77 -0
- package/dist/services/legacy-deployment-search-v3.d.ts +23 -0
- package/dist/services/packages-list-service.d.ts +5 -0
- package/dist/services/pipeline-deploy-poll.d.ts +69 -0
- package/dist/services/publish-service.d.ts +14 -16
- package/dist/services/search-failure.d.ts +27 -0
- package/dist/templates/AGENTS.md +60 -20
- package/dist/tool.js +27 -18
- package/dist/utils/deployment-errors.d.ts +57 -0
- package/package.json +2 -2
- package/dist/packager-tool-07bqr90h.js +0 -51960
- package/dist/packager-tool-jz2wbfjz.js +0 -2275
- package/dist/prepare-solution-resources-wds3r8bq.js +0 -22
- package/dist/services/personal-workspace-deploy.d.ts +0 -49
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolVerbForProjectType
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-5dzjsw5q.js";
|
|
4
4
|
import {
|
|
5
5
|
computeEntryPointSpec,
|
|
6
6
|
createResourceBuilderServices,
|
|
7
7
|
hasAnyTemplateRow,
|
|
8
8
|
hasBareTemplateRow,
|
|
9
9
|
readUipxProjects
|
|
10
|
-
} from "./packager-tool-
|
|
10
|
+
} from "./packager-tool-83rzavkx.js";
|
|
11
11
|
import {
|
|
12
12
|
toolsFactoryRepository
|
|
13
|
-
} from "./packager-tool-
|
|
13
|
+
} from "./packager-tool-fv7xyzg2.js";
|
|
14
14
|
import {
|
|
15
15
|
catchError,
|
|
16
|
-
getFileSystem,
|
|
17
16
|
logger
|
|
18
|
-
} from "./packager-tool-
|
|
17
|
+
} from "./packager-tool-5fjp60dk.js";
|
|
18
|
+
import {
|
|
19
|
+
getFileSystem
|
|
20
|
+
} from "./packager-tool-zf3929se.js";
|
|
19
21
|
|
|
20
22
|
// src/services/project-contributions.ts
|
|
21
23
|
var ENTRY_POINT_RESOURCE_KIND = "process";
|
|
@@ -185,4 +187,4 @@ function isSameSpecValue(a, b) {
|
|
|
185
187
|
|
|
186
188
|
export { ProjectContributionsError, collectProjectContributions, assertNoContributionErrors, contributionErrorMessages, applyProjectContributions };
|
|
187
189
|
|
|
188
|
-
//# debugId=
|
|
190
|
+
//# debugId=44C1EE84E4A52AC964756E2164756E21
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError,
|
|
3
|
+
logger
|
|
4
|
+
} from "./packager-tool-5fjp60dk.js";
|
|
5
|
+
|
|
6
|
+
// ../solution-sdk/src/solution-file.ts
|
|
7
|
+
var STUDIO_WEB_PROJECT_TYPE_OVERRIDES = {
|
|
8
|
+
ProcessOrchestration: "processOrchestration"
|
|
9
|
+
};
|
|
10
|
+
function normalizeProjectType(projectType) {
|
|
11
|
+
return STUDIO_WEB_PROJECT_TYPE_OVERRIDES[projectType] ?? projectType;
|
|
12
|
+
}
|
|
13
|
+
function toPortableRelativePath(relativePath) {
|
|
14
|
+
return relativePath.replace(/\\/g, "/");
|
|
15
|
+
}
|
|
16
|
+
async function readUipxFile(fs, solutionDir) {
|
|
17
|
+
const dirEntries = await fs.readdir(solutionDir);
|
|
18
|
+
const uipxFileName = dirEntries.find((f) => f.endsWith(".uipx"));
|
|
19
|
+
if (!uipxFileName) {
|
|
20
|
+
throw new Error(`No .uipx file found in ${solutionDir}. Run 'uip solution init' first.`);
|
|
21
|
+
}
|
|
22
|
+
const uipxContent = await fs.readFile(fs.path.join(solutionDir, uipxFileName), "utf-8");
|
|
23
|
+
if (!uipxContent) {
|
|
24
|
+
throw new Error(`Could not read .uipx file: ${uipxFileName} is empty or missing.`);
|
|
25
|
+
}
|
|
26
|
+
const [parseError, parsed] = catchError(() => JSON.parse(uipxContent));
|
|
27
|
+
if (parseError) {
|
|
28
|
+
throw new Error(`Invalid .uipx file: could not parse JSON in ${uipxFileName}.`);
|
|
29
|
+
}
|
|
30
|
+
const uipx = validateUipxFile(parsed, uipxFileName);
|
|
31
|
+
return { uipx, uipxFileName };
|
|
32
|
+
}
|
|
33
|
+
function validateUipxFile(parsed, uipxFileName) {
|
|
34
|
+
if (!isRecord(parsed)) {
|
|
35
|
+
throw new Error(`Invalid .uipx file: ${uipxFileName} must contain a JSON object.`);
|
|
36
|
+
}
|
|
37
|
+
if (typeof parsed.SolutionId !== "string" || !parsed.SolutionId.trim()) {
|
|
38
|
+
throw new Error("Invalid .uipx file: missing SolutionId.");
|
|
39
|
+
}
|
|
40
|
+
if (!Array.isArray(parsed.Projects) || parsed.Projects.length === 0) {
|
|
41
|
+
throw new Error("Invalid .uipx file: missing Projects.");
|
|
42
|
+
}
|
|
43
|
+
for (const [index, project] of parsed.Projects.entries()) {
|
|
44
|
+
if (!isRecord(project)) {
|
|
45
|
+
throw new Error(`Invalid .uipx file: Projects[${index}] must be an object.`);
|
|
46
|
+
}
|
|
47
|
+
if (typeof project.ProjectRelativePath !== "string" || !project.ProjectRelativePath.trim()) {
|
|
48
|
+
const pathHint = typeof project.Path === "string" ? " Found Path, but .uipx uses ProjectRelativePath." : "";
|
|
49
|
+
throw new Error(`Invalid .uipx file: Projects[${index}] is missing ProjectRelativePath.${pathHint} Use 'uip solution projects add' to add projects, or set ProjectRelativePath to the project file path, for example "Foo/project.uiproj".`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return parsed;
|
|
53
|
+
}
|
|
54
|
+
function isRecord(value) {
|
|
55
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56
|
+
}
|
|
57
|
+
function resolveSolutionDir(fs, inputPath) {
|
|
58
|
+
const resolved = fs.path.resolve(inputPath);
|
|
59
|
+
if (resolved.endsWith(".uipx")) {
|
|
60
|
+
return fs.path.dirname(resolved);
|
|
61
|
+
}
|
|
62
|
+
return resolved;
|
|
63
|
+
}
|
|
64
|
+
async function updateUipxSolutionId(fs, uipxPath, newSolutionId) {
|
|
65
|
+
const [readError, content] = await catchError(fs.readFile(uipxPath, "utf-8"));
|
|
66
|
+
if (readError || !content) {
|
|
67
|
+
logger.error(`Could not read .uipx file for update: ${readError?.message ?? "empty file"}`);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const [parseError, parsed] = catchError(() => JSON.parse(content));
|
|
71
|
+
if (parseError) {
|
|
72
|
+
logger.error(`Could not parse .uipx file for update: ${parseError.message}`);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
parsed.SolutionId = newSolutionId;
|
|
76
|
+
const [writeError] = await catchError(fs.writeFile(uipxPath, JSON.stringify(parsed, null, 4)));
|
|
77
|
+
if (writeError) {
|
|
78
|
+
logger.error(`Could not update .uipx with new SolutionId: ${writeError.message}`);
|
|
79
|
+
} else {
|
|
80
|
+
logger.info(`Updated .uipx with Studio Web SolutionId: ${newSolutionId}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async function findSolutionFileUpward(fs, startDir) {
|
|
84
|
+
let dir = startDir;
|
|
85
|
+
while (true) {
|
|
86
|
+
const entries = await fs.readdir(dir);
|
|
87
|
+
const files = entries.filter((f) => f.endsWith(".uipx"));
|
|
88
|
+
if (files.length === 1) {
|
|
89
|
+
return fs.path.join(dir, files[0]);
|
|
90
|
+
}
|
|
91
|
+
if (files.length > 1) {
|
|
92
|
+
throw new Error(`Multiple .uipx files found in ${dir}. Please specify which solution file to use.`);
|
|
93
|
+
}
|
|
94
|
+
const parent = fs.path.dirname(dir);
|
|
95
|
+
if (parent === dir) {
|
|
96
|
+
throw new Error(`No .uipx solution file found (searched from ${startDir} to filesystem root)`);
|
|
97
|
+
}
|
|
98
|
+
dir = parent;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { normalizeProjectType, toPortableRelativePath, readUipxFile, resolveSolutionDir, updateUipxSolutionId, findSolutionFileUpward };
|
|
103
|
+
|
|
104
|
+
//# debugId=FD084AD2795A138064756E2164756E21
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SolutionDeploymentAction
|
|
3
|
+
} from "./packager-tool-t12hj6pd.js";
|
|
4
|
+
import {
|
|
5
|
+
catchError
|
|
6
|
+
} from "./packager-tool-5fjp60dk.js";
|
|
7
|
+
|
|
8
|
+
// src/services/deployment-state.ts
|
|
9
|
+
function quoteForShell(name) {
|
|
10
|
+
return `'${name.replace(/'/g, "'\\''")}'`;
|
|
11
|
+
}
|
|
12
|
+
var RESOURCES_PAGE_SIZE = 50;
|
|
13
|
+
var RESOURCES_MAX_PAGES = 10;
|
|
14
|
+
async function readPendingResourcesAsync(api, deploymentKey, scope) {
|
|
15
|
+
const pending = [];
|
|
16
|
+
let complete = false;
|
|
17
|
+
for (let page = 0, skip = 0;page < RESOURCES_MAX_PAGES; page++) {
|
|
18
|
+
const [readError, result] = await catchError(api.deploymentsGetDeploymentResources({ deploymentKey, skip, take: RESOURCES_PAGE_SIZE }, scope));
|
|
19
|
+
if (readError || !result) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const values = result.values ?? [];
|
|
23
|
+
for (const resource of values) {
|
|
24
|
+
if (resource.requiresConfiguration) {
|
|
25
|
+
pending.push(toPendingResource(resource));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
skip += values.length;
|
|
29
|
+
if (values.length < RESOURCES_PAGE_SIZE || typeof result.count === "number" && skip >= result.count) {
|
|
30
|
+
complete = true;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (!complete) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (pending.length > 0) {
|
|
38
|
+
await attachActivationReasonsAsync(api, deploymentKey, pending, scope);
|
|
39
|
+
}
|
|
40
|
+
return pending;
|
|
41
|
+
}
|
|
42
|
+
function toPendingResource(resource) {
|
|
43
|
+
return {
|
|
44
|
+
key: resource.key,
|
|
45
|
+
name: resource.name,
|
|
46
|
+
kind: resource.kind,
|
|
47
|
+
type: resource.type
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async function attachActivationReasonsAsync(api, deploymentKey, pending, scope) {
|
|
51
|
+
const [readError, validation] = await catchError(() => api.deploymentsGetValidationResult({
|
|
52
|
+
deploymentKey,
|
|
53
|
+
deploymentAction: SolutionDeploymentAction.Activate
|
|
54
|
+
}, scope));
|
|
55
|
+
if (readError || !validation) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const reasons = new Map;
|
|
59
|
+
for (const resource of validation.resourceValidationErrors ?? []) {
|
|
60
|
+
const texts = (resource.errors ?? []).map((error) => error.errorCode ? `[${error.errorCode}] ${error.text}` : error.text).filter(Boolean);
|
|
61
|
+
if (texts.length > 0) {
|
|
62
|
+
reasons.set(resourceIdentity(resource.name, resource.type), texts.join("; "));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
for (const resource of pending) {
|
|
66
|
+
const reason = reasons.get(resourceIdentity(resource.name, resource.type));
|
|
67
|
+
if (reason) {
|
|
68
|
+
resource.reason = reason;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function resourceIdentity(name, type) {
|
|
73
|
+
return `${name}\x00${type ?? ""}`;
|
|
74
|
+
}
|
|
75
|
+
var MAX_LISTED_RESOURCES = 10;
|
|
76
|
+
function formatPendingResources(resources) {
|
|
77
|
+
const described = resources.slice(0, MAX_LISTED_RESOURCES).map((resource) => {
|
|
78
|
+
const type = resource.type && resource.type !== resource.kind ? ` (${resource.type})` : "";
|
|
79
|
+
const reason = resource.reason ? `: ${resource.reason}` : "";
|
|
80
|
+
return `${resource.kind} '${resource.name}'${type}${reason}`;
|
|
81
|
+
}).join("; ");
|
|
82
|
+
const remaining = resources.length - MAX_LISTED_RESOURCES;
|
|
83
|
+
return remaining > 0 ? `${described}; and ${remaining} more` : described;
|
|
84
|
+
}
|
|
85
|
+
function activationNextSteps(deployment, pendingResources) {
|
|
86
|
+
const name = deployment.name;
|
|
87
|
+
const version = deployment.currentPackageVersion ?? deployment.packageVersion;
|
|
88
|
+
const installed = `Deployment '${name}' is installed${version ? ` at version ${version}` : ""}`;
|
|
89
|
+
switch (deployment.activationStatus) {
|
|
90
|
+
case "NeedsSetupToActivate": {
|
|
91
|
+
const steps = [
|
|
92
|
+
`${installed} but not live: it needs 'Setup activation' before it can be activated.`,
|
|
93
|
+
describePendingResources(pendingResources)
|
|
94
|
+
];
|
|
95
|
+
steps.push(`Complete 'Setup activation' for '${name}' in Orchestrator (Tenant > Solutions > Deployments, open the deployment). The CLI has no command for this step on an existing deployment: 'uip solution deploy config link' applies only to a new 'deploy run', an upgrade takes no config file, and 'uip solution deploy activate' is refused until the setup is done.`);
|
|
96
|
+
return steps;
|
|
97
|
+
}
|
|
98
|
+
case "ReadyToActivate":
|
|
99
|
+
case "Inactive":
|
|
100
|
+
return [
|
|
101
|
+
`${installed} but inactive. Activate it with: uip solution deploy activate ${quoteForShell(name)}.`
|
|
102
|
+
];
|
|
103
|
+
case "ActivationFailed":
|
|
104
|
+
return [
|
|
105
|
+
`Activation of '${name}' failed. Inspect the deployment in Orchestrator, then retry with: uip solution deploy activate ${quoteForShell(name)}.`
|
|
106
|
+
];
|
|
107
|
+
default:
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function appendDeploymentStateInstructions(instructions, deployment, pendingResources, feedSelector = "") {
|
|
112
|
+
const steps = deployment ? explainRefusal(deployment, pendingResources, feedSelector) : undefined;
|
|
113
|
+
return steps ? `${instructions}
|
|
114
|
+
${steps.join(`
|
|
115
|
+
`)}` : instructions;
|
|
116
|
+
}
|
|
117
|
+
function explainRefusal(deployment, pendingResources, feedSelector = "") {
|
|
118
|
+
const explains = deployment.operationStatus === "Draft" || deployment.operationStatus === "Successful" && deployment.activationStatus === "NeedsSetupToActivate";
|
|
119
|
+
if (!explains) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const steps = deploymentNextSteps(deployment, pendingResources, feedSelector);
|
|
123
|
+
return steps && steps.length > 0 ? steps : undefined;
|
|
124
|
+
}
|
|
125
|
+
function needsPendingResources(deployment) {
|
|
126
|
+
return deployment.activationStatus === "NeedsSetupToActivate" || deployment.operationStatus === "Draft" && deployment.operation === "ActivationSetup";
|
|
127
|
+
}
|
|
128
|
+
function deploymentNextSteps(deployment, pendingResources, feedSelector = "") {
|
|
129
|
+
if (deployment.operationStatus === "Draft") {
|
|
130
|
+
const steps = [describeDraft(deployment, feedSelector)];
|
|
131
|
+
if (deployment.operation === "ActivationSetup") {
|
|
132
|
+
steps.push(describePendingResources(pendingResources));
|
|
133
|
+
}
|
|
134
|
+
return steps;
|
|
135
|
+
}
|
|
136
|
+
return activationNextSteps(deployment, pendingResources);
|
|
137
|
+
}
|
|
138
|
+
function describePendingResources(pendingResources) {
|
|
139
|
+
if (pendingResources === undefined) {
|
|
140
|
+
return "The CLI could not read which resources need configuration; the deployment's Resources tab in Orchestrator lists them.";
|
|
141
|
+
}
|
|
142
|
+
if (pendingResources.length === 0) {
|
|
143
|
+
return "The service lists no resource as needing configuration; the deployment's Resources tab in Orchestrator shows what it asks for.";
|
|
144
|
+
}
|
|
145
|
+
return `Resources that need configuration: ${formatPendingResources(pendingResources)}.`;
|
|
146
|
+
}
|
|
147
|
+
function describeDraft(deployment, feedSelector) {
|
|
148
|
+
const name = deployment.name;
|
|
149
|
+
const state = `(Operation: ${deployment.operation}, OperationStatus: Draft, ActivationStatus: ${deployment.activationStatus})`;
|
|
150
|
+
switch (deployment.operation) {
|
|
151
|
+
case "ActivationSetup":
|
|
152
|
+
return `Deployment '${name}' has a 'Setup activation' that was started but not completed ${state} and cannot be activated until it is. Finish it in Orchestrator (Tenant > Solutions > Deployments, open the deployment; the UI lists it as 'Activation setup / Draft'). The CLI has no command for this step on an existing deployment. To discard the unfinished setup instead, run: uip solution deploy delete ${quoteForShell(name)} --yes. That removes the draft alone; the deployment returns to its previous record, still waiting for setup.`;
|
|
153
|
+
case "VersionChange":
|
|
154
|
+
return `Deployment '${name}' has an upgrade that was queued but never installed ${state} and cannot be activated until it settles. 'uip solution deploy upgrade' installs the draft it queues; a draft left by another client stays until it is installed or removed; check it with: uip solution deploy list${feedSelector}.`;
|
|
155
|
+
case "Install":
|
|
156
|
+
case undefined:
|
|
157
|
+
case null:
|
|
158
|
+
return `Deployment '${name}' exists but is still in Draft state (OperationStatus: ${deployment.operationStatus}, ActivationStatus: ${deployment.activationStatus}). Draft deployments are created by deploy runs that did not complete successfully and cannot be activated. Fix the deploy run validation errors, rerun 'uip solution deploy run', then activate after 'uip solution deploy list${feedSelector}' shows the deployment is no longer Draft.`;
|
|
159
|
+
default:
|
|
160
|
+
return `Deployment '${name}' has a pending ${deployment.operation} ${state} and cannot be activated until it settles. Check it with: uip solution deploy list${feedSelector}.`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export { quoteForShell, readPendingResourcesAsync, appendDeploymentStateInstructions, explainRefusal, needsPendingResources, deploymentNextSteps };
|
|
165
|
+
|
|
166
|
+
//# debugId=ABAB11E889A49E7364756E2164756E21
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__require
|
|
3
|
+
} from "./packager-tool-1de529jm.js";
|
|
4
|
+
|
|
5
|
+
// ../filesystem/src/node.ts
|
|
6
|
+
import { randomUUID } from "node:crypto";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import * as fs from "node:fs/promises";
|
|
9
|
+
import * as os from "node:os";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
var LOCK_HEARTBEAT_MS = 5000;
|
|
12
|
+
var LOCK_STALE_MS = 15000;
|
|
13
|
+
var LOCK_MAX_WAIT_MS = 20000;
|
|
14
|
+
var LOCK_MAX_HOLD_MS = 60000;
|
|
15
|
+
var LOCK_RETRY_MIN_MS = 100;
|
|
16
|
+
var LOCK_RETRY_JITTER_MS = 200;
|
|
17
|
+
|
|
18
|
+
class NodeFileSystem {
|
|
19
|
+
path = {
|
|
20
|
+
join: path.join,
|
|
21
|
+
resolve: path.resolve,
|
|
22
|
+
relative: path.relative,
|
|
23
|
+
dirname: path.dirname,
|
|
24
|
+
isAbsolute: path.isAbsolute,
|
|
25
|
+
basename: path.basename
|
|
26
|
+
};
|
|
27
|
+
env = {
|
|
28
|
+
cwd: process.cwd,
|
|
29
|
+
homedir: os.homedir,
|
|
30
|
+
tmpdir: os.tmpdir,
|
|
31
|
+
getenv: (key) => process.env[key]
|
|
32
|
+
};
|
|
33
|
+
utils = {
|
|
34
|
+
open: async (url) => {
|
|
35
|
+
const { default: open } = await import("./index-sby22td6.js");
|
|
36
|
+
await open(url);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
async readFile(path2, options) {
|
|
40
|
+
try {
|
|
41
|
+
if (options) {
|
|
42
|
+
return await fs.readFile(path2, "utf-8");
|
|
43
|
+
}
|
|
44
|
+
return await fs.readFile(path2);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
if (this.isEnoent(error))
|
|
47
|
+
return null;
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async writeFile(filePath, data) {
|
|
52
|
+
const dir = path.dirname(filePath);
|
|
53
|
+
if (dir) {
|
|
54
|
+
await fs.mkdir(dir, { recursive: true });
|
|
55
|
+
}
|
|
56
|
+
await fs.writeFile(filePath, data);
|
|
57
|
+
}
|
|
58
|
+
async appendFile(filePath, data) {
|
|
59
|
+
const dir = path.dirname(filePath);
|
|
60
|
+
if (dir) {
|
|
61
|
+
await fs.mkdir(dir, { recursive: true });
|
|
62
|
+
}
|
|
63
|
+
await fs.appendFile(filePath, data);
|
|
64
|
+
}
|
|
65
|
+
async readdir(dirPath) {
|
|
66
|
+
try {
|
|
67
|
+
return await fs.readdir(dirPath);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
if (this.isEnoent(error))
|
|
70
|
+
return [];
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async stat(filePath) {
|
|
75
|
+
try {
|
|
76
|
+
const stats = await fs.stat(filePath);
|
|
77
|
+
return {
|
|
78
|
+
isFile: () => stats.isFile(),
|
|
79
|
+
isDirectory: () => stats.isDirectory(),
|
|
80
|
+
size: stats.size,
|
|
81
|
+
mtimeMs: stats.mtimeMs
|
|
82
|
+
};
|
|
83
|
+
} catch (error) {
|
|
84
|
+
if (this.isEnoent(error))
|
|
85
|
+
return null;
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async exists(filePath) {
|
|
90
|
+
return existsSync(filePath);
|
|
91
|
+
}
|
|
92
|
+
async mkdir(dirPath) {
|
|
93
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
94
|
+
}
|
|
95
|
+
async acquireLock(lockPath) {
|
|
96
|
+
const canonicalPath = await this.canonicalizeLockTarget(lockPath);
|
|
97
|
+
const lockFile = `${canonicalPath}.lock`;
|
|
98
|
+
const ownerId = randomUUID();
|
|
99
|
+
const start = Date.now();
|
|
100
|
+
while (true) {
|
|
101
|
+
try {
|
|
102
|
+
await fs.writeFile(lockFile, ownerId, { flag: "wx" });
|
|
103
|
+
return this.createLockRelease(lockFile, ownerId);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
if (!this.hasErrnoCode(error, "EEXIST")) {
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
const stats = await fs.stat(lockFile).catch(() => null);
|
|
109
|
+
if (stats && Date.now() - stats.mtimeMs > LOCK_STALE_MS) {
|
|
110
|
+
const reclaimed = await fs.rm(lockFile, { force: true }).then(() => true).catch(() => false);
|
|
111
|
+
if (reclaimed)
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (Date.now() - start > LOCK_MAX_WAIT_MS) {
|
|
115
|
+
throw new Error(`ELOCKED: timed out waiting for lock on ${canonicalPath}`);
|
|
116
|
+
}
|
|
117
|
+
await new Promise((resolve2) => setTimeout(resolve2, LOCK_RETRY_MIN_MS + Math.random() * LOCK_RETRY_JITTER_MS));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async canonicalizeLockTarget(lockPath) {
|
|
122
|
+
const absolute = path.resolve(lockPath);
|
|
123
|
+
const fullReal = await fs.realpath(absolute).catch(() => null);
|
|
124
|
+
if (fullReal)
|
|
125
|
+
return fullReal;
|
|
126
|
+
const parent = path.dirname(absolute);
|
|
127
|
+
const base = path.basename(absolute);
|
|
128
|
+
const canonicalParent = await fs.realpath(parent).catch(() => parent);
|
|
129
|
+
return path.join(canonicalParent, base);
|
|
130
|
+
}
|
|
131
|
+
createLockRelease(lockFile, ownerId) {
|
|
132
|
+
const heartbeatStart = Date.now();
|
|
133
|
+
let heartbeatTimer;
|
|
134
|
+
let stopped = false;
|
|
135
|
+
const stopHeartbeat = () => {
|
|
136
|
+
stopped = true;
|
|
137
|
+
if (heartbeatTimer)
|
|
138
|
+
clearTimeout(heartbeatTimer);
|
|
139
|
+
};
|
|
140
|
+
const scheduleNextHeartbeat = () => {
|
|
141
|
+
if (stopped)
|
|
142
|
+
return;
|
|
143
|
+
if (Date.now() - heartbeatStart >= LOCK_MAX_HOLD_MS) {
|
|
144
|
+
stopped = true;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
heartbeatTimer = setTimeout(() => {
|
|
148
|
+
runHeartbeat();
|
|
149
|
+
}, LOCK_HEARTBEAT_MS);
|
|
150
|
+
heartbeatTimer.unref?.();
|
|
151
|
+
};
|
|
152
|
+
const runHeartbeat = async () => {
|
|
153
|
+
if (stopped)
|
|
154
|
+
return;
|
|
155
|
+
const current = await fs.readFile(lockFile, "utf-8").catch(() => null);
|
|
156
|
+
if (stopped)
|
|
157
|
+
return;
|
|
158
|
+
if (current !== ownerId) {
|
|
159
|
+
stopped = true;
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const now = Date.now() / 1000;
|
|
163
|
+
await fs.utimes(lockFile, now, now).catch(() => {});
|
|
164
|
+
scheduleNextHeartbeat();
|
|
165
|
+
};
|
|
166
|
+
scheduleNextHeartbeat();
|
|
167
|
+
let released = false;
|
|
168
|
+
return async () => {
|
|
169
|
+
if (released)
|
|
170
|
+
return;
|
|
171
|
+
released = true;
|
|
172
|
+
stopHeartbeat();
|
|
173
|
+
const current = await fs.readFile(lockFile, "utf-8").catch(() => null);
|
|
174
|
+
if (current === ownerId) {
|
|
175
|
+
await fs.rm(lockFile, { force: true });
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
async rm(filePath) {
|
|
180
|
+
await fs.rm(filePath, { recursive: true, force: true });
|
|
181
|
+
}
|
|
182
|
+
async rename(oldPath, newPath) {
|
|
183
|
+
await fs.rename(oldPath, newPath);
|
|
184
|
+
}
|
|
185
|
+
async realpath(filePath) {
|
|
186
|
+
try {
|
|
187
|
+
return await fs.realpath(filePath);
|
|
188
|
+
} catch (error) {
|
|
189
|
+
if (this.isEnoent(error))
|
|
190
|
+
return filePath;
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async getTempDir() {
|
|
195
|
+
return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
|
|
196
|
+
}
|
|
197
|
+
async copyDirectory(sourcePath, destPath) {
|
|
198
|
+
const sourceStats = await this.stat(sourcePath);
|
|
199
|
+
if (!sourceStats) {
|
|
200
|
+
throw new Error(`Source directory does not exist: ${sourcePath}`);
|
|
201
|
+
}
|
|
202
|
+
if (!sourceStats.isDirectory()) {
|
|
203
|
+
throw new Error(`Source path is not a directory: ${sourcePath}`);
|
|
204
|
+
}
|
|
205
|
+
await this.mkdir(destPath);
|
|
206
|
+
const entries = await this.readdir(sourcePath);
|
|
207
|
+
for (const entry of entries) {
|
|
208
|
+
const srcEntry = path.join(sourcePath, entry);
|
|
209
|
+
const destEntry = path.join(destPath, entry);
|
|
210
|
+
const entryStats = await this.stat(srcEntry);
|
|
211
|
+
if (!entryStats)
|
|
212
|
+
continue;
|
|
213
|
+
if (entryStats.isDirectory()) {
|
|
214
|
+
await this.copyDirectory(srcEntry, destEntry);
|
|
215
|
+
} else if (entryStats.isFile()) {
|
|
216
|
+
const content = await this.readFile(srcEntry);
|
|
217
|
+
if (content !== null) {
|
|
218
|
+
await this.writeFile(destEntry, content);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
isEnoent(error) {
|
|
224
|
+
return this.hasErrnoCode(error, "ENOENT");
|
|
225
|
+
}
|
|
226
|
+
hasErrnoCode(error, code) {
|
|
227
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// ../filesystem/src/index.ts
|
|
232
|
+
var fsInstance = new NodeFileSystem;
|
|
233
|
+
var getFileSystem = () => fsInstance;
|
|
234
|
+
|
|
235
|
+
export { NodeFileSystem, getFileSystem };
|
|
236
|
+
|
|
237
|
+
//# debugId=E06D65CFBE49DC8C64756E2164756E21
|