@uipath/vertical-solutions-tool 1.204.0 → 1.205.0-preview.258

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.
Files changed (60) hide show
  1. package/README.md +80 -0
  2. package/dist/THIRD-PARTY-NOTICES.md +1617 -369
  3. package/dist/createSdk-2f9x47em.js +12 -0
  4. package/dist/deploy-jobs-3k87fkwz.js +23 -0
  5. package/dist/deploy-service-qaykt7er.js +1779 -0
  6. package/dist/deployment-search-arbm2z06.js +2649 -0
  7. package/dist/embedded-file-reader-r66242ey.js +114 -0
  8. package/dist/first-party-service-srxaftkn.js +27 -0
  9. package/dist/index-7a3eqtxv.js +3174 -0
  10. package/dist/index-8s9dxpj4.js +18812 -0
  11. package/dist/index-fyc0k5dd.js +51405 -0
  12. package/dist/index-h43sj8at.js +23075 -0
  13. package/dist/index-kmp9fmhb.js +25 -0
  14. package/dist/index-ngs0a2he.js +15 -0
  15. package/dist/index.js +14 -3
  16. package/dist/index.umd.min-fqefd9kn.js +7814 -0
  17. package/dist/job-commands-azgbrbdb.js +23 -0
  18. package/dist/job-output-t43hzj1f.js +36 -0
  19. package/dist/prompts-dtgt183n.js +260 -0
  20. package/dist/resume-service-mqfnnzb5.js +344 -0
  21. package/dist/seed-service-2d1f7zaz.js +2014 -0
  22. package/dist/seed-templates-sqqqratr.js +14 -0
  23. package/dist/service-errors-jzbq3z7p.js +22 -0
  24. package/dist/solution-auth-zq6gyxsv.js +11 -0
  25. package/dist/solution-deployments-m44fyb88.js +33 -0
  26. package/dist/templates-85yrztpk.js +15 -0
  27. package/dist/tool-342sz3hm.js +439 -0
  28. package/dist/tool-38ad77wd.js +1472 -0
  29. package/dist/tool-4z1dy1rn.js +260 -0
  30. package/dist/tool-53w8skv5.js +262 -0
  31. package/dist/tool-67587985.js +554 -0
  32. package/dist/tool-87e2ps7f.js +13 -0
  33. package/dist/tool-cag2z2d6.js +30 -0
  34. package/dist/tool-e4qgwf9h.js +2281 -0
  35. package/dist/tool-gdtpsdn7.js +342 -0
  36. package/dist/tool-gvmshnq9.js +555 -0
  37. package/dist/tool-h4f967yd.js +73 -0
  38. package/dist/tool-hdxtgckw.js +249 -0
  39. package/dist/tool-jjxbj28g.js +17067 -0
  40. package/dist/tool-keqjsxdx.js +28 -0
  41. package/dist/tool-maw0g02p.js +24 -0
  42. package/dist/tool-mn1wkbhw.js +113 -0
  43. package/dist/tool-n35nrs32.js +4949 -0
  44. package/dist/tool-p589v2r5.js +114 -0
  45. package/dist/tool-pz9qm3dv.js +6723 -0
  46. package/dist/tool-r1ewa0tf.js +5645 -0
  47. package/dist/tool-r2epw08s.js +164 -0
  48. package/dist/tool-rr9fensp.js +12 -0
  49. package/dist/tool-s04z9t80.js +19 -0
  50. package/dist/tool-s9qbxa2g.js +638 -0
  51. package/dist/tool-tjhwq0ez.js +261 -0
  52. package/dist/tool-v15vxc4x.js +183 -0
  53. package/dist/tool-vf2mgth0.js +14286 -0
  54. package/dist/tool-vp7rjr2q.js +22083 -0
  55. package/dist/tool-xd2ejt3h.js +103 -0
  56. package/dist/tool-yx29vb63.js +672 -0
  57. package/dist/tool.js +12 -2
  58. package/dist/watch-job-wh6m7xzq.js +31 -0
  59. package/package.json +3 -3
  60. package/dist/tool-xymb3dsq.js +0 -45085
@@ -0,0 +1,261 @@
1
+ import {
2
+ catchError,
3
+ extractErrorDetails
4
+ } from "./tool-pz9qm3dv.js";
5
+ import {
6
+ __require
7
+ } from "./tool-1yh8g550.js";
8
+
9
+ // src/api/solution-deployments.ts
10
+ class SolutionDeploymentsError extends Error {
11
+ errorCode;
12
+ refusal;
13
+ name = "SolutionDeploymentsError";
14
+ constructor(message, errorCode, refusal) {
15
+ super(message);
16
+ this.errorCode = errorCode;
17
+ this.refusal = refusal;
18
+ }
19
+ }
20
+ var INSTALLED_ACTIVATION_STATUSES = new Set([
21
+ "Active",
22
+ "NeedsSetupToActivate",
23
+ "ReadyToActivate",
24
+ "Inactive",
25
+ "ActivationFailed",
26
+ "DeactivationFailed"
27
+ ]);
28
+ var FAILED_OPERATION_STATUSES = new Set(["Failed", "FailedRollback"]);
29
+ var PENDING_SETUP_OPERATIONS = new Set(["ActivationSetup", "VersionChange"]);
30
+ function newestDeployment(deployments) {
31
+ let newest;
32
+ let newestAt = Number.NEGATIVE_INFINITY;
33
+ for (const deployment of deployments) {
34
+ const at = startedMillis(deployment);
35
+ if (newest === undefined || at > newestAt) {
36
+ newest = deployment;
37
+ newestAt = at;
38
+ }
39
+ }
40
+ return newest;
41
+ }
42
+ function startedMillis(deployment) {
43
+ const millis = timeOf(deployment.deploymentCreationTime ?? deployment.startTime);
44
+ return Number.isFinite(millis) ? millis : 0;
45
+ }
46
+ function timeOf(value) {
47
+ return value ? new Date(value).getTime() : Number.NaN;
48
+ }
49
+ function isCompletedUninstall(deployment) {
50
+ return deployment.operation === "Uninstall" && deployment.operationStatus === "Successful";
51
+ }
52
+ function isInstalledDeployment(deployment) {
53
+ if (isCompletedUninstall(deployment))
54
+ return false;
55
+ if (deployment.operation === "Install" && FAILED_OPERATION_STATUSES.has(deployment.operationStatus ?? "")) {
56
+ return false;
57
+ }
58
+ if (INSTALLED_ACTIVATION_STATUSES.has(deployment.activationStatus ?? "")) {
59
+ return true;
60
+ }
61
+ return deployment.operationStatus === "Draft" && PENDING_SETUP_OPERATIONS.has(deployment.operation ?? "");
62
+ }
63
+ var DEPLOYMENT_PAGE_SIZE = 100;
64
+ var MAX_DEPLOYMENT_PAGES = 100;
65
+ async function listSolutionDeployments(config, signal, packageName) {
66
+ const auth = await solutionAuth(config);
67
+ const { searchDeployments } = await import("./deployment-search-arbm2z06.js");
68
+ const [error, raw] = await catchError(searchDeployments(auth, {
69
+ orderByColumn: "startTime",
70
+ orderByDirection: "Descending",
71
+ ...packageName ? { packageName } : {},
72
+ ...signal ? { scope: { signal } } : {},
73
+ pageSize: DEPLOYMENT_PAGE_SIZE,
74
+ maxPages: MAX_DEPLOYMENT_PAGES
75
+ }));
76
+ if (error || !raw)
77
+ throw await toSolutionDeploymentsError(error);
78
+ return raw.map(toSolutionDeployment);
79
+ }
80
+ var NAMED_DEPLOYMENT_PAGE_SIZE = 50;
81
+ async function listDeploymentsNamed(config, name, signal) {
82
+ const auth = await solutionAuth(config);
83
+ const { searchDeploymentsPage } = await import("./deployment-search-arbm2z06.js");
84
+ const wanted = name.toLowerCase();
85
+ const readAll = async (filter) => {
86
+ const rows = [];
87
+ let skip = 0;
88
+ for (let page = 0;page < MAX_DEPLOYMENT_PAGES; page += 1) {
89
+ const [error, result] = await catchError(searchDeploymentsPage(auth, {
90
+ ...filter,
91
+ take: NAMED_DEPLOYMENT_PAGE_SIZE,
92
+ skip,
93
+ orderByColumn: "startTime",
94
+ orderByDirection: "Descending"
95
+ }, signal ? { signal } : undefined));
96
+ if (error || !result)
97
+ throw await toSolutionDeploymentsError(error);
98
+ for (const record of result.values) {
99
+ if (record.name.toLowerCase() === wanted) {
100
+ rows.push(toSolutionDeployment(record));
101
+ }
102
+ }
103
+ skip += result.values.length;
104
+ const lastPage = result.values.length < NAMED_DEPLOYMENT_PAGE_SIZE || result.count !== undefined && skip >= result.count;
105
+ if (lastPage)
106
+ return rows;
107
+ }
108
+ throw new SolutionDeploymentsError(`Could not check the deployment name "${name}": the search kept returning records after ${skip} of them.`, "server_error");
109
+ };
110
+ const byName = await readAll({ deploymentName: name });
111
+ if (byName.length > 0)
112
+ return byName;
113
+ return readAll({ searchTerm: name });
114
+ }
115
+ async function solutionAuth(config) {
116
+ const tenantName = requireSolutionRouteContext(config);
117
+ const { getSolutionAuthContext } = await import("./solution-auth-zq6gyxsv.js");
118
+ return getSolutionAuthContext({ tenant: tenantName });
119
+ }
120
+ async function toSolutionDeploymentsError(error) {
121
+ const {
122
+ DeploymentSearchNeedsUserSessionError,
123
+ DeploymentSearchTruncatedError
124
+ } = await import("./deployment-search-arbm2z06.js");
125
+ if (error instanceof DeploymentSearchNeedsUserSessionError) {
126
+ return new SolutionDeploymentsError("Could not list solution deployments: this tenant's Automation Solutions search reads user logins only, and this login is an application.", "permission_denied", "needs-user-session");
127
+ }
128
+ if (error instanceof DeploymentSearchTruncatedError) {
129
+ return new SolutionDeploymentsError(`Could not read every solution deployment on this tenant: read ${error.rowsRead} rows and more remain.`, "server_error");
130
+ }
131
+ const { errorCode, message } = await extractErrorDetails(error);
132
+ return new SolutionDeploymentsError(`Could not list solution deployments: ${message}`, errorCode);
133
+ }
134
+ function requireSolutionRouteContext(config) {
135
+ if (!config.tenantName) {
136
+ throw new SolutionDeploymentsError("No tenant selected — run 'uip login tenant set <tenant>' first.", "configuration_error");
137
+ }
138
+ if (!config.organizationId) {
139
+ throw new SolutionDeploymentsError("The login carries no organization id, which the Automation Solutions route " + "needs — run 'uip login' again.", "configuration_error");
140
+ }
141
+ return config.tenantName;
142
+ }
143
+ function toSolutionDeployment(record) {
144
+ return {
145
+ name: record.name,
146
+ packageName: record.packageName,
147
+ packageVersion: record.currentPackageVersion || record.packageVersion,
148
+ installedRootFolderKey: record.installedRootFolderKey || undefined,
149
+ folderPath: record.folderPath ?? undefined,
150
+ activationStatus: record.activationStatus,
151
+ operation: record.operation,
152
+ operationStatus: record.operationStatus,
153
+ startTime: isoOf(record.startTime),
154
+ deploymentCreationTime: isoOf(record.deploymentCreationTime)
155
+ };
156
+ }
157
+ function isoOf(value) {
158
+ if (value === null || value === undefined)
159
+ return;
160
+ return typeof value === "string" ? value : value.toISOString();
161
+ }
162
+ function solutionNameFromManifest(manifest) {
163
+ const artifact = manifest.solution?.artifactFilename ?? "";
164
+ if (!artifact.endsWith(".zip"))
165
+ return "";
166
+ const version = manifest.packageVersion ?? "";
167
+ const versionSuffix = `_${version}.zip`;
168
+ if (version && artifact.endsWith(versionSuffix)) {
169
+ return artifact.slice(0, -versionSuffix.length);
170
+ }
171
+ const stem = artifact.slice(0, -".zip".length);
172
+ const lastUnderscore = stem.lastIndexOf("_");
173
+ return lastUnderscore > 0 ? stem.slice(0, lastUnderscore) : stem;
174
+ }
175
+ function resolveInstalledFolder(input) {
176
+ if (!input.solutionName)
177
+ return { kind: "none" };
178
+ if (input.deploymentName) {
179
+ const wanted = input.deploymentName.toLowerCase();
180
+ const generation = newestDeployment(input.deployments.filter((deployment) => deployment.name.toLowerCase() === wanted));
181
+ const match = generation && asInstalled(generation);
182
+ if (!match || !isSameInstall(match, input))
183
+ return { kind: "none" };
184
+ return {
185
+ kind: "resolved",
186
+ folderKey: match.installedRootFolderKey,
187
+ deployment: match
188
+ };
189
+ }
190
+ const candidates = newestPerName(input.deployments).flatMap((deployment) => {
191
+ const installed = asInstalled(deployment);
192
+ return installed && isSameInstall(installed, input) ? [installed] : [];
193
+ });
194
+ const [only, ...others] = candidates;
195
+ if (only === undefined)
196
+ return { kind: "none" };
197
+ if (others.length === 0) {
198
+ return {
199
+ kind: "resolved",
200
+ folderKey: only.installedRootFolderKey,
201
+ deployment: only
202
+ };
203
+ }
204
+ const newest = input.preferNewest ? newestDeployment(candidates) : undefined;
205
+ if (newest) {
206
+ return {
207
+ kind: "resolved",
208
+ folderKey: newest.installedRootFolderKey,
209
+ deployment: newest
210
+ };
211
+ }
212
+ return { kind: "ambiguous", candidates };
213
+ }
214
+ function asInstalled(deployment) {
215
+ const folderKey = deployment.installedRootFolderKey;
216
+ if (!folderKey || !isInstalledDeployment(deployment))
217
+ return;
218
+ return { ...deployment, installedRootFolderKey: folderKey };
219
+ }
220
+ function newestPerName(deployments) {
221
+ const byName = new Map;
222
+ for (const deployment of deployments) {
223
+ const key = deployment.name.toLowerCase();
224
+ const rows = byName.get(key);
225
+ if (rows)
226
+ rows.push(deployment);
227
+ else
228
+ byName.set(key, [deployment]);
229
+ }
230
+ const newest = [];
231
+ for (const rows of byName.values()) {
232
+ const row = newestDeployment(rows);
233
+ if (row)
234
+ newest.push(row);
235
+ }
236
+ return newest;
237
+ }
238
+ function isSameInstall(deployment, input) {
239
+ const solution = input.solutionName?.toLowerCase();
240
+ const recorded = (deployment.packageName || deployment.name).toLowerCase();
241
+ if (solution && recorded !== solution)
242
+ return false;
243
+ return !input.packageVersion || deployment.packageVersion === input.packageVersion;
244
+ }
245
+ async function listDeploymentsOfSolution(config, solutionName, signal, deploymentName) {
246
+ if (!solutionName)
247
+ return [];
248
+ if (deploymentName) {
249
+ return listDeploymentsNamed(config, deploymentName, signal);
250
+ }
251
+ const narrowed = await listSolutionDeployments(config, signal, solutionName);
252
+ const wanted = solutionName.toLowerCase();
253
+ const hasMatch = narrowed.some((deployment) => (deployment.packageName || deployment.name).toLowerCase() === wanted);
254
+ if (hasMatch)
255
+ return narrowed;
256
+ return listSolutionDeployments(config, signal);
257
+ }
258
+
259
+ export { SolutionDeploymentsError, newestDeployment, isCompletedUninstall, isInstalledDeployment, DEPLOYMENT_PAGE_SIZE, MAX_DEPLOYMENT_PAGES, listSolutionDeployments, NAMED_DEPLOYMENT_PAGE_SIZE, listDeploymentsNamed, solutionNameFromManifest, resolveInstalledFolder, listDeploymentsOfSolution };
260
+
261
+ //# debugId=4483E08B7F109E9D64756E2164756E21
@@ -0,0 +1,183 @@
1
+ import {
2
+ forDisplay
3
+ } from "./tool-rr9fensp.js";
4
+ import {
5
+ OutputFormatter,
6
+ ScreenLogger,
7
+ getOutputFormat,
8
+ getOutputFormatExplicit,
9
+ getOutputSink
10
+ } from "./tool-pz9qm3dv.js";
11
+
12
+ // src/services/job-output.ts
13
+ function renderForHuman() {
14
+ if (getOutputFormatExplicit())
15
+ return getOutputFormat() !== "json";
16
+ return getOutputSink().capabilities.isInteractive;
17
+ }
18
+ function emitLines(message, key) {
19
+ for (const line of message.split(`
20
+ `)) {
21
+ if (line === "")
22
+ continue;
23
+ OutputFormatter.log({ [key]: line });
24
+ }
25
+ }
26
+ var SERVICE_SUCCESS_LINE = "Deployment succeeded.";
27
+ function logLineText(message) {
28
+ return forDisplay(message).replaceAll(`
29
+ `, " ");
30
+ }
31
+ function writeJobLogLine(line) {
32
+ const message = logLineText(line.message);
33
+ if (renderForHuman()) {
34
+ ScreenLogger.progress(` ${message}`);
35
+ return;
36
+ }
37
+ OutputFormatter.log({
38
+ Seq: typeof line.seq === "string" ? logLineText(line.seq) : line.seq,
39
+ Level: line.level === undefined ? undefined : logLineText(line.level),
40
+ Message: message
41
+ });
42
+ }
43
+ function writeProgress(text) {
44
+ const message = forDisplay(text);
45
+ if (renderForHuman()) {
46
+ ScreenLogger.progress(message);
47
+ return;
48
+ }
49
+ emitLines(message, "Message");
50
+ }
51
+ function writeWarning(text) {
52
+ const message = forDisplay(text);
53
+ if (renderForHuman()) {
54
+ const [first, ...rest] = message.split(`
55
+ `);
56
+ ScreenLogger.progress(`Warning: ${first}`);
57
+ for (const line of rest)
58
+ ScreenLogger.progress(line);
59
+ return;
60
+ }
61
+ emitLines(message, "Warning");
62
+ }
63
+ function collapseRowProblems(problems) {
64
+ const ROW = /^(.*?) row (\d+)([:,] .*)$/;
65
+ const entries = [];
66
+ const groups = new Map;
67
+ const seen = new Set;
68
+ for (const problem of problems) {
69
+ const match = ROW.exec(problem);
70
+ if (!match) {
71
+ if (!seen.has(problem)) {
72
+ seen.add(problem);
73
+ entries.push(problem);
74
+ }
75
+ continue;
76
+ }
77
+ const [, prefix, row, suffix] = match;
78
+ const key = `${prefix}${suffix}`;
79
+ const existing = groups.get(key);
80
+ if (existing) {
81
+ existing.rows.push(Number(row));
82
+ continue;
83
+ }
84
+ const group = { prefix, suffix, rows: [Number(row)] };
85
+ groups.set(key, group);
86
+ entries.push(group);
87
+ }
88
+ return entries.map((entry) => {
89
+ if (typeof entry === "string")
90
+ return entry;
91
+ const rows = entry.rows.length === 1 ? `row ${entry.rows[0]}` : `rows ${formatRanges(entry.rows)}`;
92
+ return `${entry.prefix} ${rows}${entry.suffix}`;
93
+ });
94
+ }
95
+ function formatRanges(rows) {
96
+ const sorted = [...rows].sort((a, b) => a - b);
97
+ const parts = [];
98
+ let start = sorted[0];
99
+ let previous = sorted[0];
100
+ for (const row of sorted.slice(1)) {
101
+ if (row === previous + 1) {
102
+ previous = row;
103
+ continue;
104
+ }
105
+ parts.push(start === previous ? `${start}` : `${start}-${previous}`);
106
+ start = row;
107
+ previous = row;
108
+ }
109
+ parts.push(start === previous ? `${start}` : `${start}-${previous}`);
110
+ return parts.join(", ");
111
+ }
112
+ var STEP_MARKERS = {
113
+ succeeded: "✓",
114
+ failed: "✗",
115
+ running: "…"
116
+ };
117
+ function stepLabel(step) {
118
+ return step.key.toLowerCase().replaceAll("_", "-");
119
+ }
120
+ function formatStepSummary(job) {
121
+ const executed = job.steps.filter((step) => step.status !== "skipped");
122
+ if (executed.length === 0)
123
+ return "No steps recorded.";
124
+ return inExecutionOrder(executed).map((step) => `${STEP_MARKERS[step.status] ?? "?"} ${stepLabel(step)}`).join(" → ");
125
+ }
126
+ function inExecutionOrder(steps) {
127
+ const timedSlots = [];
128
+ const timed = [];
129
+ steps.forEach((step, index) => {
130
+ const at = Date.parse(step.startedAt ?? "");
131
+ if (!Number.isFinite(at))
132
+ return;
133
+ timedSlots.push(index);
134
+ timed.push({ step, at, index });
135
+ });
136
+ if (timed.length < 2)
137
+ return steps;
138
+ timed.sort((a, b) => a.at - b.at || a.index - b.index);
139
+ const ordered = [...steps];
140
+ timedSlots.forEach((slot, position) => {
141
+ ordered[slot] = timed[position].step;
142
+ });
143
+ return ordered;
144
+ }
145
+ function formatSkippedSteps(job) {
146
+ const skipped = job.steps.filter((step) => step.status === "skipped").map(stepLabel).sort((a, b) => a.localeCompare(b));
147
+ if (skipped.length === 0)
148
+ return;
149
+ return `Skipped (not applicable): ${skipped.join(", ")}`;
150
+ }
151
+ function writeStepSummary(job) {
152
+ writeProgress(` Steps: ${formatStepSummary(job)}`);
153
+ const skipped = formatSkippedSteps(job);
154
+ if (skipped)
155
+ writeProgress(` ${skipped}`);
156
+ }
157
+ function failedStepsOf(job) {
158
+ return job.steps.filter((step) => step.status === "failed").map((step) => forDisplay(step.key));
159
+ }
160
+ function writeSuccessSummary(job, lastLogMessage) {
161
+ const failed = job.steps.filter((step) => step.status === "failed");
162
+ if (failed.length === 0) {
163
+ if (lastLogMessage?.trim() !== SERVICE_SUCCESS_LINE) {
164
+ writeProgress(`
165
+ ${SERVICE_SUCCESS_LINE}`);
166
+ }
167
+ } else {
168
+ writeWarning("Deployment succeeded — with warnings:");
169
+ for (const step of failed) {
170
+ writeProgress(` ! ${stepLabel(step)} — ${step.detail ?? "failed"}`);
171
+ }
172
+ writeProgress(" These optional steps did not block the deployment. Fix the cause in the " + "package and deploy a new version to address them.");
173
+ }
174
+ writeStepSummary(job);
175
+ }
176
+ function runningStepOf(job) {
177
+ const running = job.steps.find((step) => step.status === "running");
178
+ return running ? stepLabel(running) : undefined;
179
+ }
180
+
181
+ export { logLineText, writeJobLogLine, writeProgress, writeWarning, collapseRowProblems, stepLabel, formatStepSummary, inExecutionOrder, formatSkippedSteps, writeStepSummary, failedStepsOf, writeSuccessSummary, runningStepOf };
182
+
183
+ //# debugId=0843E80C22EE50B464756E2164756E21