@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.
- package/README.md +80 -0
- package/dist/THIRD-PARTY-NOTICES.md +1617 -369
- package/dist/createSdk-2f9x47em.js +12 -0
- package/dist/deploy-jobs-3k87fkwz.js +23 -0
- package/dist/deploy-service-qaykt7er.js +1779 -0
- package/dist/deployment-search-arbm2z06.js +2649 -0
- package/dist/embedded-file-reader-r66242ey.js +114 -0
- package/dist/first-party-service-srxaftkn.js +27 -0
- package/dist/index-7a3eqtxv.js +3174 -0
- package/dist/index-8s9dxpj4.js +18812 -0
- package/dist/index-fyc0k5dd.js +51405 -0
- package/dist/index-h43sj8at.js +23075 -0
- package/dist/index-kmp9fmhb.js +25 -0
- package/dist/index-ngs0a2he.js +15 -0
- package/dist/index.js +14 -3
- package/dist/index.umd.min-fqefd9kn.js +7814 -0
- package/dist/job-commands-azgbrbdb.js +23 -0
- package/dist/job-output-t43hzj1f.js +36 -0
- package/dist/prompts-dtgt183n.js +260 -0
- package/dist/resume-service-mqfnnzb5.js +344 -0
- package/dist/seed-service-2d1f7zaz.js +2014 -0
- package/dist/seed-templates-sqqqratr.js +14 -0
- package/dist/service-errors-jzbq3z7p.js +22 -0
- package/dist/solution-auth-zq6gyxsv.js +11 -0
- package/dist/solution-deployments-m44fyb88.js +33 -0
- package/dist/templates-85yrztpk.js +15 -0
- package/dist/tool-342sz3hm.js +439 -0
- package/dist/tool-38ad77wd.js +1472 -0
- package/dist/tool-4z1dy1rn.js +260 -0
- package/dist/tool-53w8skv5.js +262 -0
- package/dist/tool-67587985.js +554 -0
- package/dist/tool-87e2ps7f.js +13 -0
- package/dist/tool-cag2z2d6.js +30 -0
- package/dist/tool-e4qgwf9h.js +2281 -0
- package/dist/tool-gdtpsdn7.js +342 -0
- package/dist/tool-gvmshnq9.js +555 -0
- package/dist/tool-h4f967yd.js +73 -0
- package/dist/tool-hdxtgckw.js +249 -0
- package/dist/tool-jjxbj28g.js +17067 -0
- package/dist/tool-keqjsxdx.js +28 -0
- package/dist/tool-maw0g02p.js +24 -0
- package/dist/tool-mn1wkbhw.js +113 -0
- package/dist/tool-n35nrs32.js +4949 -0
- package/dist/tool-p589v2r5.js +114 -0
- package/dist/tool-pz9qm3dv.js +6723 -0
- package/dist/tool-r1ewa0tf.js +5645 -0
- package/dist/tool-r2epw08s.js +164 -0
- package/dist/tool-rr9fensp.js +12 -0
- package/dist/tool-s04z9t80.js +19 -0
- package/dist/tool-s9qbxa2g.js +638 -0
- package/dist/tool-tjhwq0ez.js +261 -0
- package/dist/tool-v15vxc4x.js +183 -0
- package/dist/tool-vf2mgth0.js +14286 -0
- package/dist/tool-vp7rjr2q.js +22083 -0
- package/dist/tool-xd2ejt3h.js +103 -0
- package/dist/tool-yx29vb63.js +672 -0
- package/dist/tool.js +12 -2
- package/dist/watch-job-wh6m7xzq.js +31 -0
- package/package.json +3 -3
- package/dist/tool-xymb3dsq.js +0 -45085
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
credentialsFailure,
|
|
3
|
+
emitFailure,
|
|
4
|
+
exitIfCallerAborted,
|
|
5
|
+
readServiceUrl,
|
|
6
|
+
resolveConfigOrFail
|
|
7
|
+
} from "./tool-p589v2r5.js";
|
|
8
|
+
import"./tool-xd2ejt3h.js";
|
|
9
|
+
import"./tool-38ad77wd.js";
|
|
10
|
+
import"./tool-h4f967yd.js";
|
|
11
|
+
import"./tool-rr9fensp.js";
|
|
12
|
+
import"./tool-pz9qm3dv.js";
|
|
13
|
+
import"./tool-hdxtgckw.js";
|
|
14
|
+
import"./tool-1yh8g550.js";
|
|
15
|
+
export {
|
|
16
|
+
credentialsFailure,
|
|
17
|
+
emitFailure,
|
|
18
|
+
exitIfCallerAborted,
|
|
19
|
+
readServiceUrl,
|
|
20
|
+
resolveConfigOrFail
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//# debugId=62E8A0C7030A6A9164756E2164756E21
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collapseRowProblems,
|
|
3
|
+
failedStepsOf,
|
|
4
|
+
formatSkippedSteps,
|
|
5
|
+
formatStepSummary,
|
|
6
|
+
inExecutionOrder,
|
|
7
|
+
logLineText,
|
|
8
|
+
runningStepOf,
|
|
9
|
+
stepLabel,
|
|
10
|
+
writeJobLogLine,
|
|
11
|
+
writeProgress,
|
|
12
|
+
writeStepSummary,
|
|
13
|
+
writeSuccessSummary,
|
|
14
|
+
writeWarning
|
|
15
|
+
} from "./tool-v15vxc4x.js";
|
|
16
|
+
import"./tool-rr9fensp.js";
|
|
17
|
+
import"./tool-pz9qm3dv.js";
|
|
18
|
+
import"./tool-hdxtgckw.js";
|
|
19
|
+
import"./tool-1yh8g550.js";
|
|
20
|
+
export {
|
|
21
|
+
collapseRowProblems,
|
|
22
|
+
failedStepsOf,
|
|
23
|
+
formatSkippedSteps,
|
|
24
|
+
formatStepSummary,
|
|
25
|
+
inExecutionOrder,
|
|
26
|
+
logLineText,
|
|
27
|
+
runningStepOf,
|
|
28
|
+
stepLabel,
|
|
29
|
+
writeJobLogLine,
|
|
30
|
+
writeProgress,
|
|
31
|
+
writeStepSummary,
|
|
32
|
+
writeSuccessSummary,
|
|
33
|
+
writeWarning
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//# debugId=6A5739E4BBA0F27064756E2164756E21
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dist_default1 as dist_default,
|
|
3
|
+
dist_default2,
|
|
4
|
+
dist_default3,
|
|
5
|
+
dist_default4
|
|
6
|
+
} from "./tool-r1ewa0tf.js";
|
|
7
|
+
import {
|
|
8
|
+
forDisplay,
|
|
9
|
+
forDisplayIfSet
|
|
10
|
+
} from "./tool-rr9fensp.js";
|
|
11
|
+
import {
|
|
12
|
+
ScreenLogger
|
|
13
|
+
} from "./tool-pz9qm3dv.js";
|
|
14
|
+
import"./tool-hdxtgckw.js";
|
|
15
|
+
import {
|
|
16
|
+
__require
|
|
17
|
+
} from "./tool-1yh8g550.js";
|
|
18
|
+
|
|
19
|
+
// src/services/prompts.ts
|
|
20
|
+
var targetPrompts = {
|
|
21
|
+
async pickOne(label, choices) {
|
|
22
|
+
return dist_default4({
|
|
23
|
+
message: `Select ${label}`,
|
|
24
|
+
choices: choices.map((choice) => ({
|
|
25
|
+
name: forDisplay(choice.name),
|
|
26
|
+
value: choice.value,
|
|
27
|
+
disabled: choice.disabled
|
|
28
|
+
}))
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
async askText(label, defaultValue) {
|
|
32
|
+
return dist_default2({
|
|
33
|
+
message: forDisplay(label),
|
|
34
|
+
default: forDisplayIfSet(defaultValue)
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
async chooseDeployMode(existing) {
|
|
38
|
+
const summary = existing.map(({ deployment, folderLabel }) => `v${deployment.packageVersion} in ${folderLabel}`).join(", ");
|
|
39
|
+
return dist_default4({
|
|
40
|
+
message: `Already deployed: ${forDisplay(summary)}. What would you like to do?`,
|
|
41
|
+
choices: [
|
|
42
|
+
{
|
|
43
|
+
name: "Upgrade or downgrade the existing deployment",
|
|
44
|
+
value: "existing"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "Fresh install into another folder",
|
|
48
|
+
value: "fresh"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
async confirmSteppingStone(step) {
|
|
54
|
+
return dist_default({
|
|
55
|
+
message: forDisplay(`Upgrading from ${step.installed} to ${step.wanted} is not possible: ` + `there are breaking changes in between.
|
|
56
|
+
` + ` You can upgrade to ${step.stone} now, then re-run this command ` + `to reach ${step.wanted}.
|
|
57
|
+
` + `Deploy ${step.stone} instead?`),
|
|
58
|
+
default: true
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
async resolveNameCollision(held) {
|
|
62
|
+
const choices = [
|
|
63
|
+
...held.canUpgradeInPlace ? [
|
|
64
|
+
{
|
|
65
|
+
name: `Upgrade the existing "${forDisplay(held.name)}" instead`,
|
|
66
|
+
value: "upgrade"
|
|
67
|
+
}
|
|
68
|
+
] : [],
|
|
69
|
+
{
|
|
70
|
+
name: "Install alongside it under a different name",
|
|
71
|
+
value: "rename"
|
|
72
|
+
},
|
|
73
|
+
{ name: "Abort", value: "abort" }
|
|
74
|
+
];
|
|
75
|
+
return dist_default4({
|
|
76
|
+
message: forDisplay(`A deployment named "${held.name}" already exists on this tenant.
|
|
77
|
+
` + ` Solution: ${held.solution} v${held.version}
|
|
78
|
+
` + ` Folder: ${held.folder}
|
|
79
|
+
` + ` Status: ${held.status}
|
|
80
|
+
` + " Deployment names are unique per tenant — installing under this name " + `would target the existing deployment instead of creating a new one.
|
|
81
|
+
` + (held.reason ? ` ${held.reason}
|
|
82
|
+
` : "") + "What would you like to do?"),
|
|
83
|
+
choices
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var configurationPrompts = {
|
|
88
|
+
async askValue(key, options) {
|
|
89
|
+
const message = forDisplay(options.description ? `${options.description} (${key})` : key);
|
|
90
|
+
if (options.secret) {
|
|
91
|
+
return dist_default3({ message, mask: true });
|
|
92
|
+
}
|
|
93
|
+
return dist_default2({
|
|
94
|
+
message,
|
|
95
|
+
default: forDisplayIfSet(options.defaultValue),
|
|
96
|
+
...options.validate ? { validate: options.validate } : {}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
function createWatchPrompts() {
|
|
101
|
+
return {
|
|
102
|
+
async waitForActionRequired(kind, _url, signal) {
|
|
103
|
+
await dist_default2({
|
|
104
|
+
message: kind === "connection_setup" ? "Press Enter once the connections are authorized" : "Press Enter once the step above is complete"
|
|
105
|
+
}, { signal });
|
|
106
|
+
},
|
|
107
|
+
async confirmResume(job, signal) {
|
|
108
|
+
return dist_default({
|
|
109
|
+
message: `Retry job ${job.id} from the last checkpoint now?`,
|
|
110
|
+
default: true
|
|
111
|
+
}, { signal });
|
|
112
|
+
},
|
|
113
|
+
async confirmOpenBrowser(page, signal) {
|
|
114
|
+
return dist_default({
|
|
115
|
+
message: `Open the ${page.toLowerCase()} page in the browser?`,
|
|
116
|
+
default: true
|
|
117
|
+
}, { signal });
|
|
118
|
+
},
|
|
119
|
+
async openUrl(url) {
|
|
120
|
+
const { getFileSystem } = await import("./index-ngs0a2he.js");
|
|
121
|
+
await getFileSystem().utils.open(url);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
async function confirmProceed(summary) {
|
|
126
|
+
return dist_default({
|
|
127
|
+
message: `${forDisplay(summary)}
|
|
128
|
+
Proceed with the deploy?`,
|
|
129
|
+
default: true
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function progress(line) {
|
|
133
|
+
ScreenLogger.progress(forDisplay(line));
|
|
134
|
+
}
|
|
135
|
+
async function confirmSeed(offer) {
|
|
136
|
+
progress(`
|
|
137
|
+
Seed files: ${offer.workspaceDir}`);
|
|
138
|
+
progress(" (edit the CSVs there to change what gets seeded)");
|
|
139
|
+
progress(`Target: ${offer.organizationName ?? "?"} / ${offer.tenantName ?? "?"} — ${offer.scope}`);
|
|
140
|
+
for (const entity of offer.entities) {
|
|
141
|
+
progress(` ${entity.name}: ${entity.rows} row(s) — strategy: ${entity.strategy}`);
|
|
142
|
+
}
|
|
143
|
+
return dist_default({
|
|
144
|
+
message: "Seed Data Fabric data now?",
|
|
145
|
+
default: true
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
var seedPrompts = {
|
|
149
|
+
async pickOne(label, choices) {
|
|
150
|
+
return dist_default4({
|
|
151
|
+
message: forDisplay(`Select ${label}`),
|
|
152
|
+
choices: choices.map((choice) => ({
|
|
153
|
+
name: forDisplay(choice),
|
|
154
|
+
value: choice
|
|
155
|
+
}))
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
async confirmEntity(plan) {
|
|
159
|
+
const showDiff = await dist_default({
|
|
160
|
+
message: forDisplay(`${plan.entityName} has changes. Show diff?`),
|
|
161
|
+
default: true
|
|
162
|
+
});
|
|
163
|
+
const lines = [];
|
|
164
|
+
if (plan.toInsert.length > 0) {
|
|
165
|
+
lines.push(`
|
|
166
|
+
${plan.entityName} — inserts:`, ...previewInserts(plan.toInsert));
|
|
167
|
+
}
|
|
168
|
+
if (plan.toUpdate.length > 0) {
|
|
169
|
+
lines.push(`
|
|
170
|
+
${plan.entityName} — updates:`, ...previewChanges(plan.toUpdate));
|
|
171
|
+
}
|
|
172
|
+
if (plan.ignoredRows.length > 0) {
|
|
173
|
+
lines.push(`
|
|
174
|
+
${plan.entityName} — changed rows left alone (insert strategy):`, ...previewChanges(plan.ignoredRows));
|
|
175
|
+
}
|
|
176
|
+
if (plan.toRepairAttachments.length > 0) {
|
|
177
|
+
lines.push(`
|
|
178
|
+
${plan.entityName} — attachments to retry:`);
|
|
179
|
+
for (const row of plan.toRepairAttachments.slice(0, PREVIEW_ROWS)) {
|
|
180
|
+
lines.push(` ${row.label}: ${Object.keys(row.attachments).join(", ")}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (showDiff)
|
|
184
|
+
for (const line of lines)
|
|
185
|
+
progress(line);
|
|
186
|
+
const parts = [];
|
|
187
|
+
if (plan.toInsert.length > 0)
|
|
188
|
+
parts.push(`+${plan.toInsert.length} insert`);
|
|
189
|
+
if (plan.toUpdate.length > 0)
|
|
190
|
+
parts.push(`~${plan.toUpdate.length} update`);
|
|
191
|
+
if (plan.toRepairAttachments.length > 0)
|
|
192
|
+
parts.push(`${plan.toRepairAttachments.length} attachment retry`);
|
|
193
|
+
return dist_default({
|
|
194
|
+
message: forDisplay(`Seed ${plan.entityName} (${parts.join(", ")})?`),
|
|
195
|
+
default: true
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
async confirmClearOptional(diffs) {
|
|
199
|
+
progress(`
|
|
200
|
+
Some optional fields are empty in the seed files but have values in Data Fabric:`);
|
|
201
|
+
for (const diff of diffs.slice(0, PREVIEW_ROWS * 2)) {
|
|
202
|
+
progress(` ${diff.label}: ${diff.field} — Data Fabric has "${diff.live}"`);
|
|
203
|
+
}
|
|
204
|
+
if (diffs.length > PREVIEW_ROWS * 2) {
|
|
205
|
+
progress(` … and ${diffs.length - PREVIEW_ROWS * 2} more`);
|
|
206
|
+
}
|
|
207
|
+
return dist_default({
|
|
208
|
+
message: "Clear these optional fields in Data Fabric?",
|
|
209
|
+
default: false
|
|
210
|
+
});
|
|
211
|
+
},
|
|
212
|
+
async createSdk(options) {
|
|
213
|
+
const { createSdk } = await import("./createSdk-2f9x47em.js");
|
|
214
|
+
return createSdk({ ...options, requireNames: true });
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
var PREVIEW_ROWS = 8;
|
|
218
|
+
function previewInserts(rows) {
|
|
219
|
+
const lines = [];
|
|
220
|
+
for (const row of rows.slice(0, PREVIEW_ROWS)) {
|
|
221
|
+
lines.push(row.localId ? ` + insert (${row.localId}):` : " + insert:");
|
|
222
|
+
for (const [field, text] of Object.entries(row.display)) {
|
|
223
|
+
lines.push(` ${field}: ${text}`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (rows.length > PREVIEW_ROWS) {
|
|
227
|
+
lines.push(` … and ${rows.length - PREVIEW_ROWS} more`);
|
|
228
|
+
}
|
|
229
|
+
return lines;
|
|
230
|
+
}
|
|
231
|
+
function previewChanges(rows) {
|
|
232
|
+
const lines = [];
|
|
233
|
+
for (const row of rows.slice(0, PREVIEW_ROWS)) {
|
|
234
|
+
lines.push(` ~ Id: ${row.recordId ?? "?"} (${row.label})`);
|
|
235
|
+
const changes = row.changes ?? {};
|
|
236
|
+
for (const [field, text] of Object.entries(row.display)) {
|
|
237
|
+
const change = changes[field];
|
|
238
|
+
lines.push(change ? ` ${field}: ${change.from} → ${change.to}` : ` ${field}: ${text}`);
|
|
239
|
+
}
|
|
240
|
+
for (const [field, change] of Object.entries(changes)) {
|
|
241
|
+
if (field in row.display)
|
|
242
|
+
continue;
|
|
243
|
+
lines.push(` ${field}: ${change.from} → ${change.to}`);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (rows.length > PREVIEW_ROWS) {
|
|
247
|
+
lines.push(` … and ${rows.length - PREVIEW_ROWS} more`);
|
|
248
|
+
}
|
|
249
|
+
return lines;
|
|
250
|
+
}
|
|
251
|
+
export {
|
|
252
|
+
configurationPrompts,
|
|
253
|
+
confirmProceed,
|
|
254
|
+
confirmSeed,
|
|
255
|
+
createWatchPrompts,
|
|
256
|
+
seedPrompts,
|
|
257
|
+
targetPrompts
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
//# debugId=A427ADC583EAC0CE64756E2164756E21
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FOLDER_PLACEHOLDER,
|
|
3
|
+
FOLDER_SCOPE_UNKNOWN_NOTE,
|
|
4
|
+
describePauseKind,
|
|
5
|
+
finalizeSucceededJob,
|
|
6
|
+
linkedOutHint,
|
|
7
|
+
linkedOutWorkspace,
|
|
8
|
+
namedJob,
|
|
9
|
+
pauseErrorCode,
|
|
10
|
+
pauseInstructions,
|
|
11
|
+
pauseRetry,
|
|
12
|
+
prepareWorkspaceWithoutManifest,
|
|
13
|
+
rejectSeedWithoutWait,
|
|
14
|
+
seedCommandFor,
|
|
15
|
+
seedYesFlag,
|
|
16
|
+
stoppedWatching
|
|
17
|
+
} from "./tool-342sz3hm.js";
|
|
18
|
+
import {
|
|
19
|
+
getManifest,
|
|
20
|
+
readSeedContext
|
|
21
|
+
} from "./tool-e4qgwf9h.js";
|
|
22
|
+
import {
|
|
23
|
+
packageDir
|
|
24
|
+
} from "./tool-s9qbxa2g.js";
|
|
25
|
+
import {
|
|
26
|
+
credentialsFailure,
|
|
27
|
+
readServiceUrl,
|
|
28
|
+
rejectBlankOptions
|
|
29
|
+
} from "./tool-p589v2r5.js";
|
|
30
|
+
import {
|
|
31
|
+
watchDeployJob,
|
|
32
|
+
watchOptionsFrom,
|
|
33
|
+
withCapacityRetry
|
|
34
|
+
} from "./tool-gvmshnq9.js";
|
|
35
|
+
import {
|
|
36
|
+
writeProgress,
|
|
37
|
+
writeStepSummary,
|
|
38
|
+
writeSuccessSummary,
|
|
39
|
+
writeWarning
|
|
40
|
+
} from "./tool-v15vxc4x.js";
|
|
41
|
+
import {
|
|
42
|
+
createVssConfig
|
|
43
|
+
} from "./tool-xd2ejt3h.js";
|
|
44
|
+
import {
|
|
45
|
+
finishedJobConflict,
|
|
46
|
+
knownJobStatus,
|
|
47
|
+
toDeployFailure
|
|
48
|
+
} from "./tool-r2epw08s.js";
|
|
49
|
+
import {
|
|
50
|
+
getDeployJob,
|
|
51
|
+
resumeDeployJob
|
|
52
|
+
} from "./tool-mn1wkbhw.js";
|
|
53
|
+
import"./tool-4z1dy1rn.js";
|
|
54
|
+
import"./tool-87e2ps7f.js";
|
|
55
|
+
import"./tool-38ad77wd.js";
|
|
56
|
+
import {
|
|
57
|
+
routingFlags,
|
|
58
|
+
shellQuote
|
|
59
|
+
} from "./tool-cag2z2d6.js";
|
|
60
|
+
import {
|
|
61
|
+
failure
|
|
62
|
+
} from "./tool-h4f967yd.js";
|
|
63
|
+
import {
|
|
64
|
+
forDisplay,
|
|
65
|
+
forDisplayIfSet
|
|
66
|
+
} from "./tool-rr9fensp.js";
|
|
67
|
+
import"./tool-s04z9t80.js";
|
|
68
|
+
import"./tool-vf2mgth0.js";
|
|
69
|
+
import {
|
|
70
|
+
catchError
|
|
71
|
+
} from "./tool-pz9qm3dv.js";
|
|
72
|
+
import {
|
|
73
|
+
getFileSystem
|
|
74
|
+
} from "./tool-hdxtgckw.js";
|
|
75
|
+
import"./tool-1yh8g550.js";
|
|
76
|
+
|
|
77
|
+
// src/services/resume/seed-advice.ts
|
|
78
|
+
async function finishedJobSeedAdvice(config, finished, options) {
|
|
79
|
+
const job = namedJob(finished);
|
|
80
|
+
if (!job) {
|
|
81
|
+
return "The job carries no package name or version, so the workspace for it cannot be " + "named. Seed it with: uip vss deploy seed --package-name <name> " + `--package-version <version>${routingFlags(options)}${seedYesFlag(options)}`;
|
|
82
|
+
}
|
|
83
|
+
const scope = await finishedJobSeedScope(config, job, options.signal);
|
|
84
|
+
const [stateError, state] = await catchError(() => workspaceState(job, scope.tenantLevel));
|
|
85
|
+
if (state?.kind === "linked") {
|
|
86
|
+
const hint = linkedOutHint(job, scope.folderKey, options, state.target, scope.flag);
|
|
87
|
+
return `${state.message} ${hint}${scope.note}`;
|
|
88
|
+
}
|
|
89
|
+
const unread = stateError === undefined ? "" : ` The seed workspace could not be read (${stateError.message}), so whether it holds` + " this install's files is unknown: check it, or add --refresh to replace them.";
|
|
90
|
+
const command = seedCommandFor(job, scope.folderKey, options) + scope.flag + (state?.kind === "stale" ? " --refresh" : "") + seedYesFlag(options) + scope.note + folderDoubt(scope, state, job) + unread;
|
|
91
|
+
if (state?.kind === "file") {
|
|
92
|
+
return `The seed workspace ${state.dir} is not a directory, so 'uip vss deploy seed' would ` + `refuse it. Move it out of the way, then seed on its own with: ${command}`;
|
|
93
|
+
}
|
|
94
|
+
return `Seed on its own with: ${command}`;
|
|
95
|
+
}
|
|
96
|
+
function folderDoubt(scope, state, job) {
|
|
97
|
+
if (state?.kind !== "current")
|
|
98
|
+
return "";
|
|
99
|
+
if (state.recordedFolderKey === undefined)
|
|
100
|
+
return "";
|
|
101
|
+
if (scope.flag === FOLDER_PLACEHOLDER) {
|
|
102
|
+
return ` These files were filled in for folder ${state.recordedFolderKey}; add --refresh if you seed a different one.`;
|
|
103
|
+
}
|
|
104
|
+
const installed = job.installedFolderKey;
|
|
105
|
+
if (scope.tenantLevel === undefined && installed !== undefined && installed.toLowerCase() !== state.recordedFolderKey.toLowerCase()) {
|
|
106
|
+
return ` These files were filled in for folder ${state.recordedFolderKey}, but this job ` + `installed into folder ${installed}. If the package's entities are folder-scoped, ` + `add --folder-key ${shellQuote(installed)} --refresh.`;
|
|
107
|
+
}
|
|
108
|
+
return "";
|
|
109
|
+
}
|
|
110
|
+
async function finishedJobSeedScope(config, job, signal) {
|
|
111
|
+
const [error, manifest] = await catchError(getManifest(config, job.packageName, job.packageVersion, signal));
|
|
112
|
+
if (error || !manifest) {
|
|
113
|
+
return {
|
|
114
|
+
folderKey: undefined,
|
|
115
|
+
flag: "",
|
|
116
|
+
note: FOLDER_SCOPE_UNKNOWN_NOTE,
|
|
117
|
+
tenantLevel: undefined
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const tenantLevel = Boolean(manifest.dataFabric?.schemaFilename);
|
|
121
|
+
if (!job.installedFolderKey) {
|
|
122
|
+
return {
|
|
123
|
+
folderKey: undefined,
|
|
124
|
+
flag: tenantLevel ? "" : FOLDER_PLACEHOLDER,
|
|
125
|
+
note: "",
|
|
126
|
+
tenantLevel
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
folderKey: tenantLevel ? undefined : job.installedFolderKey,
|
|
131
|
+
flag: "",
|
|
132
|
+
note: "",
|
|
133
|
+
tenantLevel
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
async function workspaceState(job, tenantLevel) {
|
|
137
|
+
const linked = await linkedOutWorkspace(job.packageName);
|
|
138
|
+
if (linked)
|
|
139
|
+
return { kind: "linked", ...linked };
|
|
140
|
+
const dir = packageDir(job.packageName);
|
|
141
|
+
const stats = await getFileSystem().stat(dir);
|
|
142
|
+
if (!stats)
|
|
143
|
+
return { kind: "missing" };
|
|
144
|
+
if (!stats.isDirectory())
|
|
145
|
+
return { kind: "file", dir };
|
|
146
|
+
const context = await readSeedContext(dir);
|
|
147
|
+
const sameFolder = tenantLevel !== false || job.installedFolderKey === undefined || context?.folderKey === undefined || context.folderKey.toLowerCase() === job.installedFolderKey.toLowerCase();
|
|
148
|
+
const current = context?.packageName.trim().toLowerCase() === job.packageName.trim().toLowerCase() && context.packageVersion === job.packageVersion && sameFolder;
|
|
149
|
+
return {
|
|
150
|
+
kind: current ? "current" : "stale",
|
|
151
|
+
...context?.folderKey ? { recordedFolderKey: context.folderKey } : {}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/services/resume-service.ts
|
|
156
|
+
async function runResume(jobId, options, deps) {
|
|
157
|
+
const blank = rejectBlankOptions(options);
|
|
158
|
+
if (blank)
|
|
159
|
+
return blank;
|
|
160
|
+
const serviceUrl = readServiceUrl(options.serviceUrl, options.tenant);
|
|
161
|
+
if (!serviceUrl.ok)
|
|
162
|
+
return serviceUrl;
|
|
163
|
+
const seedWithoutWait = rejectSeedWithoutWait(options);
|
|
164
|
+
if (seedWithoutWait)
|
|
165
|
+
return seedWithoutWait;
|
|
166
|
+
const [authError, config] = await catchError(createVssConfig({
|
|
167
|
+
tenant: options.tenant,
|
|
168
|
+
loginValidity: options.loginValidity,
|
|
169
|
+
serviceUrl: serviceUrl.value
|
|
170
|
+
}));
|
|
171
|
+
if (authError || !config)
|
|
172
|
+
return credentialsFailure(authError);
|
|
173
|
+
const [readError, existing] = await catchError(() => getDeployJob(config, jobId, options.signal));
|
|
174
|
+
if (readError || !existing) {
|
|
175
|
+
if (options.signal?.aborted === true) {
|
|
176
|
+
return { ok: true, outcome: "detached", jobId };
|
|
177
|
+
}
|
|
178
|
+
return toDeployFailure(readError, `Could not read job ${jobId}`, {
|
|
179
|
+
notFound: "job",
|
|
180
|
+
jobId,
|
|
181
|
+
routing: options
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (existing.status === "succeeded" || existing.status === "canceled") {
|
|
185
|
+
return await nothingToResume(config, existing, options);
|
|
186
|
+
}
|
|
187
|
+
const step = await restartOrAttach(config, existing, options);
|
|
188
|
+
if (step.kind === "done")
|
|
189
|
+
return step.result;
|
|
190
|
+
if (options.wait === false) {
|
|
191
|
+
return { ok: true, outcome: "submitted", job: step.job };
|
|
192
|
+
}
|
|
193
|
+
const outcome = await watchDeployJob(watchOptionsFrom(options, {
|
|
194
|
+
jobId,
|
|
195
|
+
config,
|
|
196
|
+
serviceUrl: serviceUrl.value,
|
|
197
|
+
prompt: deps.watch,
|
|
198
|
+
sentResourceConfigurations: existing.hasResourceConfigurations === true,
|
|
199
|
+
attached: step.attached
|
|
200
|
+
}));
|
|
201
|
+
return resumedOutcome(outcome, jobId, options.timeout, options, (done) => afterSuccess((outcome.kind === "succeeded" ? outcome.config : undefined) ?? config, done, options, deps, serviceUrl.value, step.attached));
|
|
202
|
+
}
|
|
203
|
+
async function resumedOutcome(outcome, jobId, timeoutSeconds, routing, aftercare) {
|
|
204
|
+
const flags = routingFlags(routing);
|
|
205
|
+
switch (outcome.kind) {
|
|
206
|
+
case "detached":
|
|
207
|
+
case "timeout":
|
|
208
|
+
case "lost-contact":
|
|
209
|
+
return stoppedWatching(outcome, jobId, timeoutSeconds, routing);
|
|
210
|
+
case "succeeded": {
|
|
211
|
+
writeSuccessSummary(outcome.job, outcome.lastLogMessage);
|
|
212
|
+
const [extraError, extra] = await catchError(aftercare(outcome.job));
|
|
213
|
+
if (extraError) {
|
|
214
|
+
writeWarning(`The job finished. Preparing the seed workspace afterwards failed ` + `(${extraError.message}), so nothing was seeded: run 'uip vss deploy seed' ` + "when you are ready.");
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
ok: true,
|
|
218
|
+
outcome: "succeeded",
|
|
219
|
+
job: outcome.job,
|
|
220
|
+
failedSteps: outcome.failedSteps,
|
|
221
|
+
...extra ?? {}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
case "paused":
|
|
225
|
+
return failure("job-paused", `Job ${jobId} is paused again: it needs ${describePauseKind(outcome.actionKind)}.` + (outcome.url ? `
|
|
226
|
+
${forDisplay(outcome.url)}` : ""), pauseInstructions(outcome.actionKind, `uip vss deploy resume ${jobId}${flags}`), {
|
|
227
|
+
retry: pauseRetry(outcome.actionKind),
|
|
228
|
+
errorCode: pauseErrorCode(outcome.actionKind)
|
|
229
|
+
});
|
|
230
|
+
case "failed":
|
|
231
|
+
return failure("job-failed", `Job ${jobId} failed again` + (outcome.job.error?.step ? ` at step ${forDisplay(outcome.job.error.step)}` : "") + `: ${forDisplayIfSet(outcome.job.error?.message) ?? "unknown error"}`, `The job is still checkpointed. Retry with: uip vss deploy resume ${jobId}${flags}`, { retry: "RetryLater" });
|
|
232
|
+
case "canceled":
|
|
233
|
+
writeProgress(`
|
|
234
|
+
Deployment canceled.`);
|
|
235
|
+
writeStepSummary(outcome.job);
|
|
236
|
+
return failure("job-canceled", `Job ${jobId} was canceled.`, `Inspect it with: uip vss deploy status ${jobId}${flags}`);
|
|
237
|
+
case "rejected":
|
|
238
|
+
return toDeployFailure(outcome.error, `Could not ${outcome.attempting ?? "read"} job ${jobId}`, {
|
|
239
|
+
notFound: "job",
|
|
240
|
+
attempting: outcome.attempting ?? "read",
|
|
241
|
+
jobId,
|
|
242
|
+
routing
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
async function nothingToResume(config, job, options) {
|
|
247
|
+
if (options.seed !== true) {
|
|
248
|
+
return { ok: true, outcome: "nothing-to-resume", job };
|
|
249
|
+
}
|
|
250
|
+
const lead = `Job ${job.id} already ${job.status}, so there is nothing to resume and ` + "--seed has nothing to ride along with.";
|
|
251
|
+
writeWarning(job.status === "succeeded" ? `${lead} ${await finishedJobSeedAdvice(config, job, options)}` : `${lead} A canceled job is not seeded; deploy the package again to seed it.`);
|
|
252
|
+
return { ok: true, outcome: "nothing-to-resume", job };
|
|
253
|
+
}
|
|
254
|
+
async function settleConflict(config, existing, namedStatus, options) {
|
|
255
|
+
const [rereadError, reread] = await catchError(() => getDeployJob(config, existing.id, options.signal));
|
|
256
|
+
if (rereadError && options.signal?.aborted === true) {
|
|
257
|
+
return done({ ok: true, outcome: "detached", jobId: existing.id });
|
|
258
|
+
}
|
|
259
|
+
const status = reread?.status ?? knownJobStatus(namedStatus);
|
|
260
|
+
const flags = routingFlags(options);
|
|
261
|
+
const retry = `Check it with: uip vss deploy status ${existing.id}${flags}; then retry: uip vss deploy resume ${existing.id}${flags}`;
|
|
262
|
+
if (status === undefined) {
|
|
263
|
+
return done(failure("service-error", `Could not resume job ${existing.id}: the service refused the resume and its status could not be read back.`, retry, { retry: "RetryAfter10Seconds" }));
|
|
264
|
+
}
|
|
265
|
+
const settled = reread ?? { ...existing, status };
|
|
266
|
+
if (status === "running" || status === "queued") {
|
|
267
|
+
return {
|
|
268
|
+
kind: "live",
|
|
269
|
+
job: attachTo(settled, options),
|
|
270
|
+
attached: true
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
if (status === "succeeded" || status === "canceled") {
|
|
274
|
+
return done(await nothingToResume(config, settled, options));
|
|
275
|
+
}
|
|
276
|
+
return done(failure("service-error", `Could not resume job ${existing.id}: the service refused the resume, but the job is ${status}.`, retry, { retry: "RetryAfter10Seconds" }));
|
|
277
|
+
}
|
|
278
|
+
function done(result) {
|
|
279
|
+
return { kind: "done", result };
|
|
280
|
+
}
|
|
281
|
+
function attachTo(job, options) {
|
|
282
|
+
if (options.deploymentName) {
|
|
283
|
+
writeWarning("--deployment-name is ignored: the job is already running, so it is only " + "attached to, not restarted.");
|
|
284
|
+
}
|
|
285
|
+
writeProgress(`Attaching to the already-${job.status} job ${job.id}.`);
|
|
286
|
+
return job;
|
|
287
|
+
}
|
|
288
|
+
async function restartOrAttach(config, existing, options) {
|
|
289
|
+
if (existing.status === "running" || existing.status === "queued") {
|
|
290
|
+
return {
|
|
291
|
+
kind: "live",
|
|
292
|
+
job: attachTo(existing, options),
|
|
293
|
+
attached: true
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
const [error, resumed] = await catchError(withCapacityRetry(() => resumeDeployJob(config, existing.id, options.deploymentName, options.signal), "the resume", undefined, options.signal));
|
|
297
|
+
if (options.signal?.aborted) {
|
|
298
|
+
return done({ ok: true, outcome: "detached", jobId: existing.id });
|
|
299
|
+
}
|
|
300
|
+
if (error || !resumed) {
|
|
301
|
+
const finished = finishedJobConflict(error, "resume");
|
|
302
|
+
if (finished) {
|
|
303
|
+
return settleConflict(config, existing, finished.status, options);
|
|
304
|
+
}
|
|
305
|
+
return done(toDeployFailure(error, `Could not resume job ${existing.id}`, {
|
|
306
|
+
notFound: "job",
|
|
307
|
+
attempting: "resume",
|
|
308
|
+
jobId: existing.id,
|
|
309
|
+
routing: options
|
|
310
|
+
}));
|
|
311
|
+
}
|
|
312
|
+
if (options.deploymentName) {
|
|
313
|
+
writeProgress(`Resuming with deployment name "${options.deploymentName}".`);
|
|
314
|
+
}
|
|
315
|
+
writeProgress(`Job ${existing.id} resumed from the last checkpoint.`);
|
|
316
|
+
return { kind: "live", job: resumed, attached: false };
|
|
317
|
+
}
|
|
318
|
+
async function afterSuccess(config, job, options, deps, serviceUrl, attached) {
|
|
319
|
+
const [manifestError, manifest] = await catchError(readJobManifest(config, job, options.signal));
|
|
320
|
+
const workspace = {
|
|
321
|
+
config,
|
|
322
|
+
job,
|
|
323
|
+
deploymentName: job.deploymentName ?? (attached ? undefined : options.deploymentName),
|
|
324
|
+
options,
|
|
325
|
+
serviceUrl
|
|
326
|
+
};
|
|
327
|
+
if (manifestError || !manifest) {
|
|
328
|
+
const outcome = await prepareWorkspaceWithoutManifest(workspace);
|
|
329
|
+
writeWarning(`Could not read the package manifest (${manifestError?.message ?? "unknown error"}), ` + "so seeding is not offered." + (outcome.seedWorkspace === undefined ? " The seed workspace was not written either; the next step below says how to write it." : " The seed workspace is still written."));
|
|
330
|
+
return outcome;
|
|
331
|
+
}
|
|
332
|
+
return finalizeSucceededJob({ ...workspace, manifest, deps });
|
|
333
|
+
}
|
|
334
|
+
async function readJobManifest(config, job, signal) {
|
|
335
|
+
const named = namedJob(job);
|
|
336
|
+
if (!named)
|
|
337
|
+
throw new Error("the job carries no package name or version");
|
|
338
|
+
return getManifest(config, named.packageName, named.packageVersion, signal);
|
|
339
|
+
}
|
|
340
|
+
export {
|
|
341
|
+
runResume
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
//# debugId=D53A22B85A132A4564756E2164756E21
|