@haakco/hostingctl 1.0.833 → 1.0.838
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 +6 -2
- package/dist/main.js +1162 -552
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/platform/darwin-arm64/hostingctl +0 -0
- package/platform/darwin-x64/hostingctl +0 -0
- package/platform/linux-arm64/hostingctl +0 -0
- package/platform/linux-x64/hostingctl +0 -0
- package/platform/windows-x64/hostingctl.exe +0 -0
package/dist/main.js
CHANGED
|
@@ -34337,6 +34337,39 @@ function hostingDatabaseExportDestroy(options) {
|
|
|
34337
34337
|
}));
|
|
34338
34338
|
}
|
|
34339
34339
|
/**
|
|
34340
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/database-exports/:exportUuid/import/:workloadUuid}
|
|
34341
|
+
*/
|
|
34342
|
+
function hostingDatabaseImportShow(options) {
|
|
34343
|
+
const { client: request = client, ...config } = options;
|
|
34344
|
+
return withUnwrap(request({
|
|
34345
|
+
method: "GET",
|
|
34346
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/database-exports/{exportUuid}/import/{workloadUuid}",
|
|
34347
|
+
security: [{
|
|
34348
|
+
type: "http",
|
|
34349
|
+
scheme: "bearer"
|
|
34350
|
+
}],
|
|
34351
|
+
...config,
|
|
34352
|
+
throwOnError: config.throwOnError ?? true
|
|
34353
|
+
}));
|
|
34354
|
+
}
|
|
34355
|
+
/**
|
|
34356
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/database-exports/:exportUuid/import/:workloadUuid}
|
|
34357
|
+
*/
|
|
34358
|
+
function hostingDatabaseImportConfirm(options) {
|
|
34359
|
+
const { client: request = client, ...config } = options;
|
|
34360
|
+
return withUnwrap(request({
|
|
34361
|
+
method: "POST",
|
|
34362
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/database-exports/{exportUuid}/import/{workloadUuid}",
|
|
34363
|
+
security: [{
|
|
34364
|
+
type: "http",
|
|
34365
|
+
scheme: "bearer"
|
|
34366
|
+
}],
|
|
34367
|
+
contentType: { request: "application/json" },
|
|
34368
|
+
...config,
|
|
34369
|
+
throwOnError: config.throwOnError ?? true
|
|
34370
|
+
}));
|
|
34371
|
+
}
|
|
34372
|
+
/**
|
|
34340
34373
|
* {@link /c/:company/hosting/environments/:environmentUuid/databases/:databaseUuid/retirement}
|
|
34341
34374
|
*/
|
|
34342
34375
|
function hostingDatabaseRetirementShow(options) {
|
|
@@ -34744,6 +34777,39 @@ function hostingEnvironmentDeletionProtectionStore(options) {
|
|
|
34744
34777
|
}));
|
|
34745
34778
|
}
|
|
34746
34779
|
/**
|
|
34780
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/mode/review}
|
|
34781
|
+
*/
|
|
34782
|
+
function hostingEnvironmentsModeReview(options) {
|
|
34783
|
+
const { client: request = client, ...config } = options;
|
|
34784
|
+
return withUnwrap(request({
|
|
34785
|
+
method: "GET",
|
|
34786
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/mode/review",
|
|
34787
|
+
security: [{
|
|
34788
|
+
type: "http",
|
|
34789
|
+
scheme: "bearer"
|
|
34790
|
+
}],
|
|
34791
|
+
...config,
|
|
34792
|
+
throwOnError: config.throwOnError ?? true
|
|
34793
|
+
}));
|
|
34794
|
+
}
|
|
34795
|
+
/**
|
|
34796
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/mode}
|
|
34797
|
+
*/
|
|
34798
|
+
function hostingEnvironmentsModeUpdate(options) {
|
|
34799
|
+
const { client: request = client, ...config } = options;
|
|
34800
|
+
return withUnwrap(request({
|
|
34801
|
+
method: "PUT",
|
|
34802
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/mode",
|
|
34803
|
+
security: [{
|
|
34804
|
+
type: "http",
|
|
34805
|
+
scheme: "bearer"
|
|
34806
|
+
}],
|
|
34807
|
+
contentType: { request: "application/json" },
|
|
34808
|
+
...config,
|
|
34809
|
+
throwOnError: config.throwOnError ?? true
|
|
34810
|
+
}));
|
|
34811
|
+
}
|
|
34812
|
+
/**
|
|
34747
34813
|
* {@link /c/:company/hosting/environments/:environmentUuid/object-cache}
|
|
34748
34814
|
*/
|
|
34749
34815
|
function hostingEnvironmentObjectCacheShow(options) {
|
|
@@ -37831,6 +37897,44 @@ function hostingWordpressImportStore(options) {
|
|
|
37831
37897
|
}));
|
|
37832
37898
|
}
|
|
37833
37899
|
/**
|
|
37900
|
+
* @summary Fetch the site from the old host instead of uploading it: a checked file connection and folder (or an HTTPS
|
|
37901
|
+
* `.zip`, `.jpa`, `.tar.gz` archive URL) and the checked database connection are copied into the import's
|
|
37902
|
+
* staging by a bounded Job in this environment. Poll GET …/import/{uuid} exactly as after an upload
|
|
37903
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/import/fetch}
|
|
37904
|
+
*/
|
|
37905
|
+
function hostingWordpressImportFetch(options) {
|
|
37906
|
+
const { client: request = client, ...config } = options;
|
|
37907
|
+
return withUnwrap(request({
|
|
37908
|
+
method: "POST",
|
|
37909
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/import/fetch",
|
|
37910
|
+
security: [{
|
|
37911
|
+
type: "http",
|
|
37912
|
+
scheme: "bearer"
|
|
37913
|
+
}],
|
|
37914
|
+
contentType: { request: "application/json" },
|
|
37915
|
+
...config,
|
|
37916
|
+
throwOnError: config.throwOnError ?? true
|
|
37917
|
+
}));
|
|
37918
|
+
}
|
|
37919
|
+
/**
|
|
37920
|
+
* @summary **Refresh from the old host**: fetch the source this site was last fetched from again, into a new import whose
|
|
37921
|
+
* `fetch.replaces` states the earlier import it replaces. Its review is the ordinary import review
|
|
37922
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/import/refresh}
|
|
37923
|
+
*/
|
|
37924
|
+
function hostingWordpressImportRefresh(options) {
|
|
37925
|
+
const { client: request = client, ...config } = options;
|
|
37926
|
+
return withUnwrap(request({
|
|
37927
|
+
method: "POST",
|
|
37928
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/import/refresh",
|
|
37929
|
+
security: [{
|
|
37930
|
+
type: "http",
|
|
37931
|
+
scheme: "bearer"
|
|
37932
|
+
}],
|
|
37933
|
+
...config,
|
|
37934
|
+
throwOnError: config.throwOnError ?? true
|
|
37935
|
+
}));
|
|
37936
|
+
}
|
|
37937
|
+
/**
|
|
37834
37938
|
* {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/url-repair/preview}
|
|
37835
37939
|
*/
|
|
37836
37940
|
function hostingWordpressUrlRepairPreview(options) {
|
|
@@ -41111,7 +41215,7 @@ function emailText(email) {
|
|
|
41111
41215
|
].join("\n");
|
|
41112
41216
|
}
|
|
41113
41217
|
// src/commands/auth-account.ts
|
|
41114
|
-
var USAGE$
|
|
41218
|
+
var USAGE$65 = [
|
|
41115
41219
|
"Usage: hostingctl auth closure show",
|
|
41116
41220
|
" hostingctl auth closure request --reason <text> (--current-password-file <path>|--current-password-stdin)",
|
|
41117
41221
|
" hostingctl auth picture set --image-file <path>",
|
|
@@ -41137,26 +41241,26 @@ async function account$1(context, subcommand, rest) {
|
|
|
41137
41241
|
if (subcommand === "picture") return await picture(context, action, tail);
|
|
41138
41242
|
if (subcommand === "notifications") return await notifications(context, action, tail);
|
|
41139
41243
|
if (subcommand === "sent-email" || subcommand === "sent-email-show") return await sentEmail(context, { kind: "auth" }, subcommand, rest);
|
|
41140
|
-
throw new UsageError(USAGE$
|
|
41244
|
+
throw new UsageError(USAGE$65);
|
|
41141
41245
|
}
|
|
41142
41246
|
/** `auth closure show|request`. */
|
|
41143
41247
|
async function closure(context, action, tail) {
|
|
41144
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
41248
|
+
if (tail.length > 0) throw new UsageError(USAGE$65);
|
|
41145
41249
|
if (action === "show") return (await accountClosureShow({})).data;
|
|
41146
41250
|
if (action === "request") return await closeAccount(context);
|
|
41147
|
-
throw new UsageError(USAGE$
|
|
41251
|
+
throw new UsageError(USAGE$65);
|
|
41148
41252
|
}
|
|
41149
41253
|
/** `auth picture set|remove`. */
|
|
41150
41254
|
async function picture(context, action, tail) {
|
|
41151
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
41255
|
+
if (tail.length > 0) throw new UsageError(USAGE$65);
|
|
41152
41256
|
if (action === "set") return await setPicture(context);
|
|
41153
41257
|
if (action === "remove") return await removePicture(context);
|
|
41154
|
-
throw new UsageError(USAGE$
|
|
41258
|
+
throw new UsageError(USAGE$65);
|
|
41155
41259
|
}
|
|
41156
41260
|
/** `auth notifications`, `read <id>` or `read-all`. */
|
|
41157
41261
|
async function notifications(context, action, tail) {
|
|
41158
41262
|
if (action === void 0) {
|
|
41159
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
41263
|
+
if (tail.length > 0) throw new UsageError(USAGE$65);
|
|
41160
41264
|
return await allPages(async (page, perPage) => {
|
|
41161
41265
|
const answer = await notificationIndex({ query: {
|
|
41162
41266
|
page,
|
|
@@ -41172,7 +41276,7 @@ async function notifications(context, action, tail) {
|
|
|
41172
41276
|
await notificationMarkAllRead({});
|
|
41173
41277
|
return null;
|
|
41174
41278
|
});
|
|
41175
|
-
if (action !== "read" || tail.length !== 1) throw new UsageError(USAGE$
|
|
41279
|
+
if (action !== "read" || tail.length !== 1) throw new UsageError(USAGE$65);
|
|
41176
41280
|
const notification = tail[0] ?? "";
|
|
41177
41281
|
return await confirmableWrite(context, `Mark notification ${notification} read.`, async () => {
|
|
41178
41282
|
await notificationMarkRead({ path: { notification } });
|
|
@@ -41188,11 +41292,11 @@ async function notifications(context, action, tail) {
|
|
|
41188
41292
|
*/
|
|
41189
41293
|
async function closeAccount(context) {
|
|
41190
41294
|
const reason = context.flags.get("--reason")?.trim() ?? "";
|
|
41191
|
-
if (reason === "") throw new UsageError(`closure request needs --reason.\n\n${USAGE$
|
|
41295
|
+
if (reason === "") throw new UsageError(`closure request needs --reason.\n\n${USAGE$65}`);
|
|
41192
41296
|
return await confirmableWrite(context, ["Close this account, which removes the data the review lists and keeps what it lists as retained.", " The review is re-read first, so the digest sent is the one you are shown now."].join("\n"), async () => {
|
|
41193
41297
|
const review = (await accountClosureShow({})).data;
|
|
41194
41298
|
if (review.blockingReasons.length > 0) throw new UsageError(["This account cannot be closed while these reasons block it:", ...review.blockingReasons.map((one) => ` ${one.companySlug} (${one.role}): ${one.reason}`)].join("\n"));
|
|
41195
|
-
const currentPassword = readSecret(context, "current-password", 1024, USAGE$
|
|
41299
|
+
const currentPassword = readSecret(context, "current-password", 1024, USAGE$65);
|
|
41196
41300
|
return (await accountClosureStore({ body: {
|
|
41197
41301
|
reason,
|
|
41198
41302
|
reviewedDigest: review.digest,
|
|
@@ -41204,7 +41308,7 @@ async function closeAccount(context) {
|
|
|
41204
41308
|
async function setPicture(context) {
|
|
41205
41309
|
const file = context.flags.get("--image-file") ?? "";
|
|
41206
41310
|
return await confirmableWrite(context, file === "" ? "Set the profile picture." : `Set the profile picture to ${file}.`, async () => {
|
|
41207
|
-
return (await profilePictureStore({ body: await imageUpload(file, USAGE$
|
|
41311
|
+
return (await profilePictureStore({ body: await imageUpload(file, USAGE$65) })).data;
|
|
41208
41312
|
});
|
|
41209
41313
|
}
|
|
41210
41314
|
/** `auth picture remove`. */
|
|
@@ -41214,7 +41318,7 @@ async function removePicture(context) {
|
|
|
41214
41318
|
});
|
|
41215
41319
|
}
|
|
41216
41320
|
// src/commands/auth-identity.ts
|
|
41217
|
-
var USAGE$
|
|
41321
|
+
var USAGE$64 = [
|
|
41218
41322
|
"Usage: hostingctl auth profile [--name <name>] [--email <email>] [--current-password-file <path>]",
|
|
41219
41323
|
" hostingctl auth password (--current-password-file <path>|--current-password-stdin) (--new-password-file <path>|--new-password-stdin)",
|
|
41220
41324
|
" hostingctl auth register --name <name> --email <email> (--password-file <path>|--password-stdin)",
|
|
@@ -41239,12 +41343,12 @@ var MAX_TOKEN_BYTES = 4096;
|
|
|
41239
41343
|
/** One required flag's value, or a refusal naming the flag. */
|
|
41240
41344
|
function required$8(context, flag) {
|
|
41241
41345
|
const value = context.flags.get(flag)?.trim() ?? "";
|
|
41242
|
-
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$
|
|
41346
|
+
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$64}`);
|
|
41243
41347
|
return value;
|
|
41244
41348
|
}
|
|
41245
41349
|
/** No positional arguments: every input here is a flag or a secret source. */
|
|
41246
41350
|
function noPositional(rest) {
|
|
41247
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
41351
|
+
if (rest.length > 0) throw new UsageError(USAGE$64);
|
|
41248
41352
|
}
|
|
41249
41353
|
/** The API's password contract takes a confirmation; the CLI's one input is the new password itself. */
|
|
41250
41354
|
function passwordBody(password) {
|
|
@@ -41267,16 +41371,16 @@ async function identity(context, subcommand, rest) {
|
|
|
41267
41371
|
if (subcommand === "forgot-password") return await forgotPassword(context);
|
|
41268
41372
|
if (subcommand === "reset-password") return await resetPassword(context);
|
|
41269
41373
|
if (subcommand === "verify-email") return await verifyEmail(context);
|
|
41270
|
-
throw new UsageError(USAGE$
|
|
41374
|
+
throw new UsageError(USAGE$64);
|
|
41271
41375
|
}
|
|
41272
41376
|
/** `auth profile`: the account's own name and email, with the current password only when the email changes. */
|
|
41273
41377
|
async function profile$2(context) {
|
|
41274
41378
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
41275
41379
|
const email = context.flags.get("--email")?.trim() ?? "";
|
|
41276
|
-
if (name === "" && email === "" && !context.flags.has("--current-password-file") && !context.flags.has("--current-password-stdin")) throw new UsageError(`Pass --name, --email, or both.\n\n${USAGE$
|
|
41380
|
+
if (name === "" && email === "" && !context.flags.has("--current-password-file") && !context.flags.has("--current-password-stdin")) throw new UsageError(`Pass --name, --email, or both.\n\n${USAGE$64}`);
|
|
41277
41381
|
return await confirmableWrite(context, `Update the account's ${[name === "" ? null : `name to "${name}"`, email === "" ? null : `email to ${email}`].filter((one) => one !== null).join(" and ")}.`, async () => {
|
|
41278
41382
|
const current = (await authMe({})).data;
|
|
41279
|
-
const currentPassword = hasSecret(context, "current-password") ? readSecret(context, "current-password", MAX_PASSWORD_BYTES$1, USAGE$
|
|
41383
|
+
const currentPassword = hasSecret(context, "current-password") ? readSecret(context, "current-password", MAX_PASSWORD_BYTES$1, USAGE$64) : void 0;
|
|
41280
41384
|
return (await authUpdateProfile({ body: {
|
|
41281
41385
|
name: name === "" ? current.name ?? "" : name,
|
|
41282
41386
|
email: email === "" ? current.email ?? "" : email,
|
|
@@ -41292,8 +41396,8 @@ function hasSecret(context, name) {
|
|
|
41292
41396
|
async function password$1(context) {
|
|
41293
41397
|
return await confirmableWrite(context, "Change the account's password.", async () => {
|
|
41294
41398
|
return (await authChangePassword({ body: {
|
|
41295
|
-
currentPassword: readSecret(context, "current-password", MAX_PASSWORD_BYTES$1, USAGE$
|
|
41296
|
-
...passwordBody(readSecret(context, "new-password", MAX_PASSWORD_BYTES$1, USAGE$
|
|
41399
|
+
currentPassword: readSecret(context, "current-password", MAX_PASSWORD_BYTES$1, USAGE$64),
|
|
41400
|
+
...passwordBody(readSecret(context, "new-password", MAX_PASSWORD_BYTES$1, USAGE$64))
|
|
41297
41401
|
} })).data;
|
|
41298
41402
|
});
|
|
41299
41403
|
}
|
|
@@ -41305,7 +41409,7 @@ async function register$1(context) {
|
|
|
41305
41409
|
return (await authRegister({ body: {
|
|
41306
41410
|
name,
|
|
41307
41411
|
email,
|
|
41308
|
-
...passwordBody(readSecret(context, "password", MAX_PASSWORD_BYTES$1, USAGE$
|
|
41412
|
+
...passwordBody(readSecret(context, "password", MAX_PASSWORD_BYTES$1, USAGE$64))
|
|
41309
41413
|
} })).data;
|
|
41310
41414
|
});
|
|
41311
41415
|
}
|
|
@@ -41320,8 +41424,8 @@ async function forgotPassword(context) {
|
|
|
41320
41424
|
async function resetPassword(context) {
|
|
41321
41425
|
const email = required$8(context, "--email");
|
|
41322
41426
|
return await confirmableWrite(context, `Reset the password for ${email}.`, async () => {
|
|
41323
|
-
const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$
|
|
41324
|
-
const password = readSecret(context, "password", MAX_PASSWORD_BYTES$1, USAGE$
|
|
41427
|
+
const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$64);
|
|
41428
|
+
const password = readSecret(context, "password", MAX_PASSWORD_BYTES$1, USAGE$64);
|
|
41325
41429
|
return (await authResetPassword({ body: {
|
|
41326
41430
|
token,
|
|
41327
41431
|
email,
|
|
@@ -41336,7 +41440,7 @@ async function verifyEmail(context) {
|
|
|
41336
41440
|
});
|
|
41337
41441
|
}
|
|
41338
41442
|
// src/commands/auth-impersonation.ts
|
|
41339
|
-
var USAGE$
|
|
41443
|
+
var USAGE$63 = [
|
|
41340
41444
|
"Usage: hostingctl auth impersonate start --target <user-uuid> --company <slug> --reason <text> [--minutes <n>] --store-as <profile>",
|
|
41341
41445
|
" hostingctl auth impersonate status",
|
|
41342
41446
|
" hostingctl auth impersonate stop",
|
|
@@ -41369,7 +41473,7 @@ async function impersonation(context, rest) {
|
|
|
41369
41473
|
if (action === "stop" && tail.length === 0) return await stop(context);
|
|
41370
41474
|
if (action === "list" && tail.length === 0) return await list$7();
|
|
41371
41475
|
if (action === "end" && tail.length === 1) return await end(context, tail[0] ?? "");
|
|
41372
|
-
throw new UsageError(USAGE$
|
|
41476
|
+
throw new UsageError(USAGE$63);
|
|
41373
41477
|
}
|
|
41374
41478
|
/** `start`: mint a token for another user, and keep it in a profile of its own. */
|
|
41375
41479
|
async function start$2(context) {
|
|
@@ -41377,8 +41481,8 @@ async function start$2(context) {
|
|
|
41377
41481
|
const company = context.flags.get("--company")?.trim() ?? "";
|
|
41378
41482
|
const reason = context.flags.get("--reason")?.trim() ?? "";
|
|
41379
41483
|
const storeAs = context.flags.get("--store-as")?.trim() ?? "";
|
|
41380
|
-
if (target === "" || company === "" || reason === "") throw new UsageError(`start needs --target, --company and --reason.\n\n${USAGE$
|
|
41381
|
-
if (storeAs === "") throw new UsageError(`start needs --store-as <profile>.\n\n${USAGE$
|
|
41484
|
+
if (target === "" || company === "" || reason === "") throw new UsageError(`start needs --target, --company and --reason.\n\n${USAGE$63}`);
|
|
41485
|
+
if (storeAs === "") throw new UsageError(`start needs --store-as <profile>.\n\n${USAGE$63}`);
|
|
41382
41486
|
const minutes = wholeNumberFlag(context.flags, "--minutes") ?? DEFAULT_MINUTES;
|
|
41383
41487
|
const document = await readProfiles();
|
|
41384
41488
|
const operator = namedProfile(context.flags, document);
|
|
@@ -41472,7 +41576,7 @@ async function list$7() {
|
|
|
41472
41576
|
}
|
|
41473
41577
|
/** `end <uuid>`: end one recorded session by its uuid. */
|
|
41474
41578
|
async function end(context, uuid) {
|
|
41475
|
-
if (uuid === "") throw new UsageError(USAGE$
|
|
41579
|
+
if (uuid === "") throw new UsageError(USAGE$63);
|
|
41476
41580
|
return await confirmableWrite(context, `End impersonation session ${uuid}.`, async () => ({
|
|
41477
41581
|
...EMPTY,
|
|
41478
41582
|
action: "end",
|
|
@@ -41480,7 +41584,7 @@ async function end(context, uuid) {
|
|
|
41480
41584
|
}));
|
|
41481
41585
|
}
|
|
41482
41586
|
// src/commands/auth-push.ts
|
|
41483
|
-
var USAGE$
|
|
41587
|
+
var USAGE$62 = [
|
|
41484
41588
|
"Usage: hostingctl auth push-token set (--token-file <path>|--token-stdin)",
|
|
41485
41589
|
" hostingctl auth push-token remove (--token-file <path>|--token-stdin)",
|
|
41486
41590
|
"",
|
|
@@ -41491,12 +41595,12 @@ var USAGE$61 = [
|
|
|
41491
41595
|
/** `auth push-token set|remove`: this account's mobile push registration. */
|
|
41492
41596
|
async function authPush(context, rest) {
|
|
41493
41597
|
const [action, ...tail] = rest;
|
|
41494
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
41598
|
+
if (tail.length > 0) throw new UsageError(USAGE$62);
|
|
41495
41599
|
if (action === "set") return {
|
|
41496
41600
|
kind: "push-token",
|
|
41497
41601
|
action: "set",
|
|
41498
41602
|
sent: (await confirmableWrite(context, "Register this device's push token.", async () => {
|
|
41499
|
-
await expoTokenStore({ body: { token: readSecret(context, "token", 4096, USAGE$
|
|
41603
|
+
await expoTokenStore({ body: { token: readSecret(context, "token", 4096, USAGE$62) } });
|
|
41500
41604
|
return null;
|
|
41501
41605
|
})).sent
|
|
41502
41606
|
};
|
|
@@ -41504,11 +41608,11 @@ async function authPush(context, rest) {
|
|
|
41504
41608
|
kind: "push-token",
|
|
41505
41609
|
action: "remove",
|
|
41506
41610
|
sent: (await confirmableWrite(context, "Remove this device's push token.", async () => {
|
|
41507
|
-
await expoTokenDestroy({ query: { token: readSecret(context, "token", 4096, USAGE$
|
|
41611
|
+
await expoTokenDestroy({ query: { token: readSecret(context, "token", 4096, USAGE$62) } });
|
|
41508
41612
|
return null;
|
|
41509
41613
|
})).sent
|
|
41510
41614
|
};
|
|
41511
|
-
throw new UsageError(USAGE$
|
|
41615
|
+
throw new UsageError(USAGE$62);
|
|
41512
41616
|
}
|
|
41513
41617
|
/** The `auth push-token` renderer. */
|
|
41514
41618
|
function authPushText(report) {
|
|
@@ -41736,51 +41840,51 @@ var AUTH_TOPICS = [
|
|
|
41736
41840
|
},
|
|
41737
41841
|
{
|
|
41738
41842
|
path: ["profile"],
|
|
41739
|
-
usage: USAGE$
|
|
41843
|
+
usage: USAGE$64
|
|
41740
41844
|
},
|
|
41741
41845
|
{
|
|
41742
41846
|
path: ["password"],
|
|
41743
|
-
usage: USAGE$
|
|
41847
|
+
usage: USAGE$64
|
|
41744
41848
|
},
|
|
41745
41849
|
{
|
|
41746
41850
|
path: ["register"],
|
|
41747
|
-
usage: USAGE$
|
|
41851
|
+
usage: USAGE$64
|
|
41748
41852
|
},
|
|
41749
41853
|
{
|
|
41750
41854
|
path: ["forgot-password"],
|
|
41751
|
-
usage: USAGE$
|
|
41855
|
+
usage: USAGE$64
|
|
41752
41856
|
},
|
|
41753
41857
|
{
|
|
41754
41858
|
path: ["reset-password"],
|
|
41755
|
-
usage: USAGE$
|
|
41859
|
+
usage: USAGE$64
|
|
41756
41860
|
},
|
|
41757
41861
|
{
|
|
41758
41862
|
path: ["verify-email"],
|
|
41759
|
-
usage: USAGE$
|
|
41863
|
+
usage: USAGE$64
|
|
41760
41864
|
},
|
|
41761
41865
|
{
|
|
41762
41866
|
path: ["closure"],
|
|
41763
|
-
usage: USAGE$
|
|
41867
|
+
usage: USAGE$65
|
|
41764
41868
|
},
|
|
41765
41869
|
{
|
|
41766
41870
|
path: ["picture"],
|
|
41767
|
-
usage: USAGE$
|
|
41871
|
+
usage: USAGE$65
|
|
41768
41872
|
},
|
|
41769
41873
|
{
|
|
41770
41874
|
path: ["notifications"],
|
|
41771
|
-
usage: USAGE$
|
|
41875
|
+
usage: USAGE$65
|
|
41772
41876
|
},
|
|
41773
41877
|
{
|
|
41774
41878
|
path: ["push-token"],
|
|
41775
|
-
usage: USAGE$
|
|
41879
|
+
usage: USAGE$62
|
|
41776
41880
|
},
|
|
41777
41881
|
{
|
|
41778
41882
|
path: ["impersonate"],
|
|
41779
|
-
usage: USAGE$
|
|
41883
|
+
usage: USAGE$63
|
|
41780
41884
|
}
|
|
41781
41885
|
];
|
|
41782
41886
|
// src/commands/auth-sessions.ts
|
|
41783
|
-
var USAGE$
|
|
41887
|
+
var USAGE$61 = [
|
|
41784
41888
|
"Usage: hostingctl auth profiles",
|
|
41785
41889
|
"",
|
|
41786
41890
|
"Lists every session this machine holds: the profile name, the API it signs in to, when its access token",
|
|
@@ -41798,7 +41902,7 @@ var USAGE$60 = [
|
|
|
41798
41902
|
* made a machine signed in to two accounts look like a machine signed in to none.
|
|
41799
41903
|
*/
|
|
41800
41904
|
async function authSessions(context, rest) {
|
|
41801
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
41905
|
+
if (rest.length > 0) throw new UsageError(USAGE$61);
|
|
41802
41906
|
const document = await readProfiles();
|
|
41803
41907
|
const selected = namedProfile(context.flags, document);
|
|
41804
41908
|
const profiles = Object.entries(document.profiles).map(([name, stored]) => ({
|
|
@@ -42280,6 +42384,92 @@ async function logout(context, rest) {
|
|
|
42280
42384
|
remoteError
|
|
42281
42385
|
};
|
|
42282
42386
|
}
|
|
42387
|
+
// src/commands/dev-metadata.ts
|
|
42388
|
+
/** `hostingctl dev`: Plan 43's local copy of one WordPress site, from `files pull` and a Plan 63 database export. */
|
|
42389
|
+
var DEV_USAGE = [
|
|
42390
|
+
"Usage: hostingctl dev prepare <folder> --company <slug> --environment <uuid> --database <uuid> --from <env-path>",
|
|
42391
|
+
" --user <login> [sign-in] (--dry-run | --confirm)",
|
|
42392
|
+
" hostingctl dev start [<folder>]",
|
|
42393
|
+
" hostingctl dev status [<folder>]",
|
|
42394
|
+
" hostingctl dev stop [<folder>]",
|
|
42395
|
+
" hostingctl dev refresh [<folder>] --user <login> [sign-in] (--dry-run | --confirm)",
|
|
42396
|
+
" hostingctl dev delete [<folder>] (--dry-run | --confirm)",
|
|
42397
|
+
" Sign in as for files pull: --key-file <path>, --password-stdin or --password-file <path>; with none, the SSH agent.",
|
|
42398
|
+
"",
|
|
42399
|
+
" prepare Make a new folder with the site's files (files pull of --from, the WordPress folder such as",
|
|
42400
|
+
" /wordpress), a fresh export of its database, a local wp-config.php and a Compose file.",
|
|
42401
|
+
" start Run it with Docker on this computer: the site and Mailpit on 127.0.0.1 only. The first start",
|
|
42402
|
+
" imports the database and replaces the site's address with the local one.",
|
|
42403
|
+
" status Where it came from, when the files and the database were taken, and what is running.",
|
|
42404
|
+
" stop Stop it; files and database stay.",
|
|
42405
|
+
" refresh Prepare a new copy beside it with newer files and a fresh database, then swap it in. The old copy",
|
|
42406
|
+
" is kept as <folder>.previous-<time>; a failed refresh leaves the working copy as it was.",
|
|
42407
|
+
" delete Stop it and remove the folder and its database.",
|
|
42408
|
+
"",
|
|
42409
|
+
"The folder defaults to the current one. The copy is unsanitized: it is your own data, so keep it private.",
|
|
42410
|
+
"Its database is never pushed back. Exit 0 done, 1 refused, 2 not run (also when Docker is missing)."
|
|
42411
|
+
].join("\n");
|
|
42412
|
+
var DEV_METADATA = {
|
|
42413
|
+
name: "dev",
|
|
42414
|
+
summary: "A local copy of one WordPress site with its database, run with Docker.",
|
|
42415
|
+
usage: DEV_USAGE,
|
|
42416
|
+
flags: [
|
|
42417
|
+
{
|
|
42418
|
+
name: "--environment",
|
|
42419
|
+
takesValue: true,
|
|
42420
|
+
description: "prepare: the environment the site runs in."
|
|
42421
|
+
},
|
|
42422
|
+
{
|
|
42423
|
+
name: "--database",
|
|
42424
|
+
takesValue: true,
|
|
42425
|
+
description: "prepare: the site's database to export."
|
|
42426
|
+
},
|
|
42427
|
+
{
|
|
42428
|
+
name: "--from",
|
|
42429
|
+
takesValue: true,
|
|
42430
|
+
description: "prepare: the site's folder in the environment (env:/path), such as env:/wordpress."
|
|
42431
|
+
},
|
|
42432
|
+
{
|
|
42433
|
+
name: "--user",
|
|
42434
|
+
takesValue: true,
|
|
42435
|
+
description: "The environment's SFTP login the files are pulled with."
|
|
42436
|
+
},
|
|
42437
|
+
{
|
|
42438
|
+
name: "--key-file",
|
|
42439
|
+
takesValue: true,
|
|
42440
|
+
description: "Sign in with the private key in this file."
|
|
42441
|
+
},
|
|
42442
|
+
{
|
|
42443
|
+
name: "--password-stdin",
|
|
42444
|
+
takesValue: false,
|
|
42445
|
+
description: "Read the login's password, or the key's passphrase, from standard input."
|
|
42446
|
+
},
|
|
42447
|
+
{
|
|
42448
|
+
name: "--password-file",
|
|
42449
|
+
takesValue: true,
|
|
42450
|
+
description: "Read the login's password, or the key's passphrase, from a private file (mode 600)."
|
|
42451
|
+
}
|
|
42452
|
+
],
|
|
42453
|
+
subcommands: [
|
|
42454
|
+
"prepare",
|
|
42455
|
+
"start",
|
|
42456
|
+
"status",
|
|
42457
|
+
"stop",
|
|
42458
|
+
"refresh",
|
|
42459
|
+
"delete"
|
|
42460
|
+
]
|
|
42461
|
+
};
|
|
42462
|
+
/** The `dev` actions that run Docker on this computer and never reach the API, so they need no session. */
|
|
42463
|
+
var LOCAL_ACTIONS = /* @__PURE__ */ new Set([
|
|
42464
|
+
"start",
|
|
42465
|
+
"stop",
|
|
42466
|
+
"status",
|
|
42467
|
+
"delete"
|
|
42468
|
+
]);
|
|
42469
|
+
/** Whether `argv` names one of those. */
|
|
42470
|
+
function isLocalDevCommand(argv) {
|
|
42471
|
+
return LOCAL_ACTIONS.has(positional(argv)[0] ?? "");
|
|
42472
|
+
}
|
|
42283
42473
|
// src/commands/company-scope.ts
|
|
42284
42474
|
/**
|
|
42285
42475
|
* Which company a command is about: `--company`, then `HOSTINGCTL_COMPANY`, then the company the stored session's
|
|
@@ -42460,7 +42650,7 @@ var MAILBOX_TOPICS = [{
|
|
|
42460
42650
|
usage: MAILBOX_IMPORT_USAGE
|
|
42461
42651
|
}];
|
|
42462
42652
|
// src/commands/mailbox-recovery.ts
|
|
42463
|
-
var USAGE$
|
|
42653
|
+
var USAGE$60 = [
|
|
42464
42654
|
"Usage: hostingctl mailbox recovery <request|verify|reset> [options]",
|
|
42465
42655
|
"",
|
|
42466
42656
|
" request --address <address> Ask for a self-service reset link for a mailbox address.",
|
|
@@ -42488,16 +42678,16 @@ function isSessionlessMailboxCommand(argv) {
|
|
|
42488
42678
|
/** `mailbox recovery request|verify|reset`: the unauthenticated, token-authorized recovery journey. */
|
|
42489
42679
|
async function runMailboxRecovery(context, rest) {
|
|
42490
42680
|
const [action, extra] = rest;
|
|
42491
|
-
if (extra !== void 0) throw new UsageError(USAGE$
|
|
42681
|
+
if (extra !== void 0) throw new UsageError(USAGE$60);
|
|
42492
42682
|
if (action === "request") return await request$3(context);
|
|
42493
42683
|
if (action === "verify") return await verify$2(context);
|
|
42494
42684
|
if (action === "reset") return await reset(context);
|
|
42495
|
-
throw new UsageError(USAGE$
|
|
42685
|
+
throw new UsageError(USAGE$60);
|
|
42496
42686
|
}
|
|
42497
42687
|
/** `request`: the answer is deliberately identical whether or not an eligible mailbox exists. */
|
|
42498
42688
|
async function request$3(context) {
|
|
42499
42689
|
const address = context.flags.get("--address");
|
|
42500
|
-
if (address === void 0 || address === "") throw new UsageError(USAGE$
|
|
42690
|
+
if (address === void 0 || address === "") throw new UsageError(USAGE$60);
|
|
42501
42691
|
return await confirmableWrite(context, `Request a mailbox recovery link for ${address}. The answer is the same for an unknown mailbox, one with no confirmed fallback, and an eligible one.`, async () => (await emailMailboxRecoveryRequest({ body: { address } })).data);
|
|
42502
42692
|
}
|
|
42503
42693
|
/** `verify`: the token is read only when the send actually happens, so a dry run never touches a secret. */
|
|
@@ -42518,7 +42708,7 @@ async function reset(context) {
|
|
|
42518
42708
|
}
|
|
42519
42709
|
/** One recovery token or new password, read from a private file or stdin under the recovery bound. */
|
|
42520
42710
|
function recoverySecret(context, name) {
|
|
42521
|
-
return readSecret(context, name, MAX_RECOVERY_SECRET_BYTES, USAGE$
|
|
42711
|
+
return readSecret(context, name, MAX_RECOVERY_SECRET_BYTES, USAGE$60);
|
|
42522
42712
|
}
|
|
42523
42713
|
// src/commands/mailbox.ts
|
|
42524
42714
|
/**
|
|
@@ -42651,7 +42841,7 @@ async function environmentGeneration(path) {
|
|
|
42651
42841
|
}
|
|
42652
42842
|
// src/commands/access-credentials.ts
|
|
42653
42843
|
/** The usage this module refuses with, owned by the commands it implements. */
|
|
42654
|
-
var USAGE$
|
|
42844
|
+
var USAGE$59 = [
|
|
42655
42845
|
"Usage: hostingctl access key add <environment-uuid> --company <slug> --access-user <uuid> --name <n> --public-key-file <path>",
|
|
42656
42846
|
" hostingctl access key remove <environment-uuid> --company <slug> --access-user <uuid> <key-uuid>",
|
|
42657
42847
|
" hostingctl access password set <environment-uuid> --company <slug> --access-user <uuid> (--password-file <path>|--password-stdin)",
|
|
@@ -42669,12 +42859,12 @@ var USAGE$58 = [
|
|
|
42669
42859
|
/** `key add|remove`. */
|
|
42670
42860
|
async function key(context, path, action, tail) {
|
|
42671
42861
|
const accessUserUuid = context.flags.get("--access-user") ?? "";
|
|
42672
|
-
if (accessUserUuid === "") throw new UsageError(`key needs --access-user.\\n\\n${USAGE$
|
|
42862
|
+
if (accessUserUuid === "") throw new UsageError(`key needs --access-user.\\n\\n${USAGE$59}`);
|
|
42673
42863
|
if (action === "add") {
|
|
42674
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
42864
|
+
if (tail.length > 0) throw new UsageError(USAGE$59);
|
|
42675
42865
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
42676
42866
|
const file = context.flags.get("--public-key-file") ?? "";
|
|
42677
|
-
if (name === "" || file === "") throw new UsageError(`key add needs --name and --public-key-file.\\n\\n${USAGE$
|
|
42867
|
+
if (name === "" || file === "") throw new UsageError(`key add needs --name and --public-key-file.\\n\\n${USAGE$59}`);
|
|
42678
42868
|
const publicKey = readPrivateFile(file, "public key", 8192).trim();
|
|
42679
42869
|
return await confirmableWrite(context, `Add key "${name}" to login ${accessUserUuid}.`, async () => {
|
|
42680
42870
|
const body = {
|
|
@@ -42693,7 +42883,7 @@ async function key(context, path, action, tail) {
|
|
|
42693
42883
|
}
|
|
42694
42884
|
if (action === "remove") {
|
|
42695
42885
|
const [keyUuid, ...extra] = tail;
|
|
42696
|
-
if (keyUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
42886
|
+
if (keyUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$59);
|
|
42697
42887
|
return await confirmableWrite(context, `Remove key ${keyUuid} from login ${accessUserUuid}.`, async () => {
|
|
42698
42888
|
return (await hostingAccessDestroyKey({
|
|
42699
42889
|
path: {
|
|
@@ -42705,18 +42895,18 @@ async function key(context, path, action, tail) {
|
|
|
42705
42895
|
})).data;
|
|
42706
42896
|
});
|
|
42707
42897
|
}
|
|
42708
|
-
throw new UsageError(USAGE$
|
|
42898
|
+
throw new UsageError(USAGE$59);
|
|
42709
42899
|
}
|
|
42710
42900
|
/** `password set|clear`. */
|
|
42711
42901
|
async function password(context, path, action, tail) {
|
|
42712
42902
|
const accessUserUuid = context.flags.get("--access-user") ?? "";
|
|
42713
|
-
if (accessUserUuid === "" || tail.length > 0) throw new UsageError(`password needs --access-user.\\n\\n${USAGE$
|
|
42903
|
+
if (accessUserUuid === "" || tail.length > 0) throw new UsageError(`password needs --access-user.\\n\\n${USAGE$59}`);
|
|
42714
42904
|
const userPath = {
|
|
42715
42905
|
...path,
|
|
42716
42906
|
accessUserUuid
|
|
42717
42907
|
};
|
|
42718
42908
|
if (action === "set") return await confirmableWrite(context, "Set this login's password. The previous password stops working when the change is applied.", async () => {
|
|
42719
|
-
const password = readSecret(context, "password", 1024, USAGE$
|
|
42909
|
+
const password = readSecret(context, "password", 1024, USAGE$59);
|
|
42720
42910
|
const body = {
|
|
42721
42911
|
desiredGeneration: await environmentGeneration(path),
|
|
42722
42912
|
password,
|
|
@@ -42734,7 +42924,7 @@ async function password(context, path, action, tail) {
|
|
|
42734
42924
|
query
|
|
42735
42925
|
})).data;
|
|
42736
42926
|
});
|
|
42737
|
-
throw new UsageError(USAGE$
|
|
42927
|
+
throw new UsageError(USAGE$59);
|
|
42738
42928
|
}
|
|
42739
42929
|
// src/commands/booleans.ts
|
|
42740
42930
|
/**
|
|
@@ -42757,7 +42947,7 @@ function onOff$5(context, flag, usage) {
|
|
|
42757
42947
|
return value;
|
|
42758
42948
|
}
|
|
42759
42949
|
// src/commands/access-admin.ts
|
|
42760
|
-
var USAGE$
|
|
42950
|
+
var USAGE$58 = [
|
|
42761
42951
|
"Usage: hostingctl access settings <environment-uuid> --company <slug>",
|
|
42762
42952
|
" hostingctl access settings-set <environment-uuid> --company <slug> --password <on|off> --sftp-only <on|off>",
|
|
42763
42953
|
" hostingctl access grants <environment-uuid> --company <slug>",
|
|
@@ -42785,7 +42975,7 @@ var USAGE$57 = [
|
|
|
42785
42975
|
/** `access settings|settings-set|grants|grant|un-grant|key|password|user-show|user-set|received`. */
|
|
42786
42976
|
async function accessAdmin(context, subcommand, rest) {
|
|
42787
42977
|
if (subcommand === "received") {
|
|
42788
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
42978
|
+
if (rest.length > 0) throw new UsageError(USAGE$58);
|
|
42789
42979
|
return {
|
|
42790
42980
|
kind: "received",
|
|
42791
42981
|
grants: (await hostingAccessReceivedIndex({})).data.items
|
|
@@ -42793,7 +42983,7 @@ async function accessAdmin(context, subcommand, rest) {
|
|
|
42793
42983
|
}
|
|
42794
42984
|
const [first, ...after] = rest;
|
|
42795
42985
|
const takesAction = subcommand === "key" || subcommand === "password";
|
|
42796
|
-
const path = await environmentPath$1(context, takesAction ? after[0] : first, USAGE$
|
|
42986
|
+
const path = await environmentPath$1(context, takesAction ? after[0] : first, USAGE$58);
|
|
42797
42987
|
const tail = takesAction ? after.slice(1) : after;
|
|
42798
42988
|
return await routed(context, subcommand, path, first ?? "", tail);
|
|
42799
42989
|
}
|
|
@@ -42808,7 +42998,7 @@ async function routed(context, subcommand, path, action, tail) {
|
|
|
42808
42998
|
if (subcommand === "password") return await written$9(password(context, path, action, tail));
|
|
42809
42999
|
if (subcommand === "user-show") return await userShow(path, tail);
|
|
42810
43000
|
if (subcommand === "user-set") return await written$9(userSet(context, path, tail));
|
|
42811
|
-
throw new UsageError(USAGE$
|
|
43001
|
+
throw new UsageError(USAGE$58);
|
|
42812
43002
|
}
|
|
42813
43003
|
/** Tag one write's outcome with the group that produced it. */
|
|
42814
43004
|
async function written$9(pending) {
|
|
@@ -42819,7 +43009,7 @@ async function written$9(pending) {
|
|
|
42819
43009
|
}
|
|
42820
43010
|
/** A company-wide read takes no positionals. */
|
|
42821
43011
|
function noExtra$22(rest) {
|
|
42822
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
43012
|
+
if (rest.length > 0) throw new UsageError(USAGE$58);
|
|
42823
43013
|
}
|
|
42824
43014
|
/** `settings`. */
|
|
42825
43015
|
async function settings$1(path, rest) {
|
|
@@ -42832,8 +43022,8 @@ async function settings$1(path, rest) {
|
|
|
42832
43022
|
/** `settings-set --password … --sftp-only …`. */
|
|
42833
43023
|
async function settingsSet(context, path, rest) {
|
|
42834
43024
|
noExtra$22(rest);
|
|
42835
|
-
const passwordEnabled = onOff$5(context, "--password", USAGE$
|
|
42836
|
-
const sftpOnly = onOff$5(context, "--sftp-only", USAGE$
|
|
43025
|
+
const passwordEnabled = onOff$5(context, "--password", USAGE$58);
|
|
43026
|
+
const sftpOnly = onOff$5(context, "--sftp-only", USAGE$58);
|
|
42837
43027
|
return await confirmableWrite(context, [`Set password sign-in ${passwordEnabled ? "on" : "off"} and SFTP-only ${sftpOnly ? "on" : "off"}.`, " Logins keep their keys either way; this changes how a login may authenticate."].join("\\n"), async () => {
|
|
42838
43028
|
return (await hostingAccessUpdate({
|
|
42839
43029
|
path,
|
|
@@ -42858,7 +43048,7 @@ async function grant$1(context, path, rest) {
|
|
|
42858
43048
|
noExtra$22(rest);
|
|
42859
43049
|
const userUuid = context.flags.get("--user") ?? "";
|
|
42860
43050
|
const accessUserUuid = context.flags.get("--access-user") ?? "";
|
|
42861
|
-
if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$
|
|
43051
|
+
if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$58}`);
|
|
42862
43052
|
return await confirmableWrite(context, `Grant user ${userUuid} the login ${accessUserUuid} on this environment.`, async () => {
|
|
42863
43053
|
return (await hostingAccessGrantStore({
|
|
42864
43054
|
path,
|
|
@@ -42873,7 +43063,7 @@ async function grant$1(context, path, rest) {
|
|
|
42873
43063
|
/** `un-grant <grant-uuid>`. */
|
|
42874
43064
|
async function unGrant(context, path, rest) {
|
|
42875
43065
|
const [grantUuid, ...extra] = rest;
|
|
42876
|
-
if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
43066
|
+
if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$58);
|
|
42877
43067
|
return await confirmableWrite(context, `Withdraw grant ${grantUuid}. The login stays; only this account's access to it ends.`, async () => {
|
|
42878
43068
|
const query = { desiredGeneration: await environmentGeneration(path) };
|
|
42879
43069
|
return (await hostingAccessGrantDestroy({
|
|
@@ -42888,7 +43078,7 @@ async function unGrant(context, path, rest) {
|
|
|
42888
43078
|
/** `user-show <access-user-uuid>`. */
|
|
42889
43079
|
async function userShow(path, rest) {
|
|
42890
43080
|
const [accessUserUuid, ...extra] = rest;
|
|
42891
|
-
if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
43081
|
+
if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$58);
|
|
42892
43082
|
return {
|
|
42893
43083
|
kind: "user",
|
|
42894
43084
|
user: (await hostingAccessShowUser({ path: {
|
|
@@ -42900,7 +43090,7 @@ async function userShow(path, rest) {
|
|
|
42900
43090
|
/** `user-set <access-user-uuid> [--name] [--enabled] [--read-only]`. */
|
|
42901
43091
|
async function userSet(context, path, rest) {
|
|
42902
43092
|
const [accessUserUuid, ...extra] = rest;
|
|
42903
|
-
if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
43093
|
+
if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$58);
|
|
42904
43094
|
const userPath = {
|
|
42905
43095
|
...path,
|
|
42906
43096
|
accessUserUuid
|
|
@@ -42909,7 +43099,7 @@ async function userSet(context, path, rest) {
|
|
|
42909
43099
|
const name = context.flags.get("--name")?.trim();
|
|
42910
43100
|
const enabled = onOffFlag(context, "--enabled");
|
|
42911
43101
|
const readOnly = onOffFlag(context, "--read-only");
|
|
42912
|
-
if (name === void 0 && enabled === null && readOnly === null) throw new UsageError(`user-set needs --name, --enabled, --read-only or a combination.\\n\\n${USAGE$
|
|
43102
|
+
if (name === void 0 && enabled === null && readOnly === null) throw new UsageError(`user-set needs --name, --enabled, --read-only or a combination.\\n\\n${USAGE$58}`);
|
|
42913
43103
|
const body = {
|
|
42914
43104
|
desiredGeneration: await environmentGeneration(path),
|
|
42915
43105
|
name: name === void 0 || name === "" ? current.name : name,
|
|
@@ -43059,43 +43249,43 @@ var ACCESS_METADATA = {
|
|
|
43059
43249
|
var ACCESS_TOPICS = [
|
|
43060
43250
|
{
|
|
43061
43251
|
path: ["settings"],
|
|
43062
|
-
usage: USAGE$
|
|
43252
|
+
usage: USAGE$58
|
|
43063
43253
|
},
|
|
43064
43254
|
{
|
|
43065
43255
|
path: ["settings-set"],
|
|
43066
|
-
usage: USAGE$
|
|
43256
|
+
usage: USAGE$58
|
|
43067
43257
|
},
|
|
43068
43258
|
{
|
|
43069
43259
|
path: ["grants"],
|
|
43070
|
-
usage: USAGE$
|
|
43260
|
+
usage: USAGE$58
|
|
43071
43261
|
},
|
|
43072
43262
|
{
|
|
43073
43263
|
path: ["grant"],
|
|
43074
|
-
usage: USAGE$
|
|
43264
|
+
usage: USAGE$58
|
|
43075
43265
|
},
|
|
43076
43266
|
{
|
|
43077
43267
|
path: ["un-grant"],
|
|
43078
|
-
usage: USAGE$
|
|
43268
|
+
usage: USAGE$58
|
|
43079
43269
|
},
|
|
43080
43270
|
{
|
|
43081
43271
|
path: ["user-show"],
|
|
43082
|
-
usage: USAGE$
|
|
43272
|
+
usage: USAGE$58
|
|
43083
43273
|
},
|
|
43084
43274
|
{
|
|
43085
43275
|
path: ["user-set"],
|
|
43086
|
-
usage: USAGE$
|
|
43276
|
+
usage: USAGE$58
|
|
43087
43277
|
},
|
|
43088
43278
|
{
|
|
43089
43279
|
path: ["received"],
|
|
43090
|
-
usage: USAGE$
|
|
43280
|
+
usage: USAGE$58
|
|
43091
43281
|
},
|
|
43092
43282
|
{
|
|
43093
43283
|
path: ["key"],
|
|
43094
|
-
usage: USAGE$
|
|
43284
|
+
usage: USAGE$59
|
|
43095
43285
|
},
|
|
43096
43286
|
{
|
|
43097
43287
|
path: ["password"],
|
|
43098
|
-
usage: USAGE$
|
|
43288
|
+
usage: USAGE$59
|
|
43099
43289
|
}
|
|
43100
43290
|
];
|
|
43101
43291
|
// src/commands/access.ts
|
|
@@ -43460,7 +43650,7 @@ function notAMember(unknown, eligible) {
|
|
|
43460
43650
|
].join("\n");
|
|
43461
43651
|
}
|
|
43462
43652
|
// src/commands/environment-storage-usage.ts
|
|
43463
|
-
var USAGE$
|
|
43653
|
+
var USAGE$57 = [
|
|
43464
43654
|
"Usage: hostingctl environment storage-usage <environment-uuid> --company <slug>",
|
|
43465
43655
|
"",
|
|
43466
43656
|
" storage-usage What each volume was allocated, what it has written and what is left, from the",
|
|
@@ -43479,7 +43669,7 @@ var USAGE$56 = [
|
|
|
43479
43669
|
*/
|
|
43480
43670
|
async function environmentStorageUsage(context, rest) {
|
|
43481
43671
|
const [uuid, ...extra] = rest;
|
|
43482
|
-
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
43672
|
+
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$57);
|
|
43483
43673
|
return (await hostingEnvironmentsStorageUsage({ path: {
|
|
43484
43674
|
company: await requireCompany(context.flags),
|
|
43485
43675
|
environmentUuid: uuid
|
|
@@ -43892,7 +44082,9 @@ var IMPORT_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
43892
44082
|
"import-upload",
|
|
43893
44083
|
"import-discard",
|
|
43894
44084
|
"url-repair-preview",
|
|
43895
|
-
"url-repair-confirm"
|
|
44085
|
+
"url-repair-confirm",
|
|
44086
|
+
"import-fetch",
|
|
44087
|
+
"import-refresh"
|
|
43896
44088
|
]);
|
|
43897
44089
|
/** The application-level site-access actions, which mirror the environment's group. */
|
|
43898
44090
|
var SITE_ACTIONS = /* @__PURE__ */ new Set([
|
|
@@ -43925,7 +44117,7 @@ var ADMIN_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
43925
44117
|
"recovery-cancel"
|
|
43926
44118
|
]);
|
|
43927
44119
|
// src/commands/application-admin.ts
|
|
43928
|
-
var USAGE$
|
|
44120
|
+
var USAGE$56 = [
|
|
43929
44121
|
"Usage: hostingctl application administrator <environment-uuid> <application-uuid> --company <slug>",
|
|
43930
44122
|
" hostingctl application administrator-reset|administrator-reveal <environment-uuid> <application-uuid> --company <slug>",
|
|
43931
44123
|
" hostingctl application recovery-status|recovery-retry|recovery-cancel <environment-uuid> <application-uuid> <recovery-uuid> --company <slug>",
|
|
@@ -43952,7 +44144,7 @@ async function applicationAdmin(context, action, path, rest) {
|
|
|
43952
44144
|
if (action === "administrator-reset") return await credential(context, path, rest, "reset");
|
|
43953
44145
|
if (action === "administrator-reveal") return await credential(context, path, rest, "reveal");
|
|
43954
44146
|
const [recoveryUuid, ...extra] = rest;
|
|
43955
|
-
if (recoveryUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
44147
|
+
if (recoveryUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$56);
|
|
43956
44148
|
const recoveryPath = {
|
|
43957
44149
|
...path,
|
|
43958
44150
|
recoveryUuid
|
|
@@ -43965,7 +44157,7 @@ async function applicationAdmin(context, action, path, rest) {
|
|
|
43965
44157
|
return (await hostingApplicationRecoveryRetry({ path: recoveryPath })).data;
|
|
43966
44158
|
}));
|
|
43967
44159
|
if (action === "recovery-cancel") return await written$8(confirmableWrite(context, "Cancel this recovery. Writers are released and the application returns to its previous state.", async () => (await hostingApplicationRecoveryCancel({ path: recoveryPath })).data));
|
|
43968
|
-
throw new UsageError(USAGE$
|
|
44160
|
+
throw new UsageError(USAGE$56);
|
|
43969
44161
|
}
|
|
43970
44162
|
/** `administrator-reset|reveal`: the one place the application's own password is printed. */
|
|
43971
44163
|
async function credential(context, path, rest, kind) {
|
|
@@ -43986,7 +44178,7 @@ async function written$8(pending) {
|
|
|
43986
44178
|
}
|
|
43987
44179
|
/** No positional arguments, or a usage refusal. */
|
|
43988
44180
|
function noExtra$21(rest) {
|
|
43989
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
44181
|
+
if (rest.length > 0) throw new UsageError(USAGE$56);
|
|
43990
44182
|
}
|
|
43991
44183
|
/** One recovery as one line: what it is doing, how far, and what it holds. */
|
|
43992
44184
|
function recoveryLines$1(one) {
|
|
@@ -44385,7 +44577,7 @@ async function requireSelectionBranch(company, selectionUuid, branch) {
|
|
|
44385
44577
|
throw new UsageError(`Branch "${branch}" is not a branch of ${found.selection.owner}/${found.selection.name}. Its branches: ${offered.branches.join(", ")}.`);
|
|
44386
44578
|
}
|
|
44387
44579
|
// src/commands/application-builds.ts
|
|
44388
|
-
var USAGE$
|
|
44580
|
+
var USAGE$55 = [
|
|
44389
44581
|
"Usage: hostingctl application build <environment-uuid> <application-uuid> --company <slug> [--source <selection-uuid> | --source-upload <upload-uuid> | --ssh-source <connection-uuid>] [--idempotency-key <key>] [--wait [--timeout <seconds>]]",
|
|
44390
44582
|
" hostingctl application build-log <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
|
|
44391
44583
|
" hostingctl application build-retry|build-cancel <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
|
|
@@ -44415,7 +44607,7 @@ async function applicationBuilds(context, action, path, rest) {
|
|
|
44415
44607
|
}
|
|
44416
44608
|
if (action === "source-bind") return await bind$2(context, path, rest);
|
|
44417
44609
|
const [buildUuid, ...extra] = rest;
|
|
44418
|
-
if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
44610
|
+
if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$55);
|
|
44419
44611
|
const buildPath = {
|
|
44420
44612
|
...path,
|
|
44421
44613
|
buildUuid
|
|
@@ -44430,7 +44622,7 @@ async function applicationBuilds(context, action, path, rest) {
|
|
|
44430
44622
|
if (action === "build-cancel") return await written$7(confirmableWrite(context, "Stop this build. A running build stops where it is.", async () => {
|
|
44431
44623
|
return (await hostingDeploymentCancel({ path: buildPath })).data;
|
|
44432
44624
|
}));
|
|
44433
|
-
throw new UsageError(USAGE$
|
|
44625
|
+
throw new UsageError(USAGE$55);
|
|
44434
44626
|
}
|
|
44435
44627
|
/**
|
|
44436
44628
|
* `source-bind --selection … | --ssh-source … [--source-kind …] [--branch …] [--tag …] [--auto-deploy …]`.
|
|
@@ -44442,7 +44634,7 @@ async function bind$2(context, path, rest) {
|
|
|
44442
44634
|
noExtra$20(rest);
|
|
44443
44635
|
const repositorySelectionUuid = context.flags.get("--selection")?.trim() ?? "";
|
|
44444
44636
|
const sshSourceUuid = context.flags.get("--ssh-source")?.trim() ?? "";
|
|
44445
|
-
if (repositorySelectionUuid === "" === (sshSourceUuid === "")) throw new UsageError(`source-bind needs exactly one of --selection or --ssh-source.\n\n${USAGE$
|
|
44637
|
+
if (repositorySelectionUuid === "" === (sshSourceUuid === "")) throw new UsageError(`source-bind needs exactly one of --selection or --ssh-source.\n\n${USAGE$55}`);
|
|
44446
44638
|
const sourceKind = sourceKindFlag(context, sshSourceUuid === "" ? "github" : "ssh");
|
|
44447
44639
|
const branch = context.flags.get("--branch")?.trim();
|
|
44448
44640
|
const tag = context.flags.get("--tag")?.trim();
|
|
@@ -44467,8 +44659,8 @@ async function bind$2(context, path, rest) {
|
|
|
44467
44659
|
function sourceKindFlag(context, implied) {
|
|
44468
44660
|
const value = context.flags.get("--source-kind")?.trim() ?? "";
|
|
44469
44661
|
if (value === "") return implied;
|
|
44470
|
-
if (value !== "github" && value !== "ssh") throw new UsageError(`--source-kind must be github or ssh (got "${value}").\n\n${USAGE$
|
|
44471
|
-
if (value !== implied) throw new UsageError(`--source-kind ${value} does not match the ${implied} reference named.\n\n${USAGE$
|
|
44662
|
+
if (value !== "github" && value !== "ssh") throw new UsageError(`--source-kind must be github or ssh (got "${value}").\n\n${USAGE$55}`);
|
|
44663
|
+
if (value !== implied) throw new UsageError(`--source-kind ${value} does not match the ${implied} reference named.\n\n${USAGE$55}`);
|
|
44472
44664
|
return value;
|
|
44473
44665
|
}
|
|
44474
44666
|
/** Tag one write's outcome with the group that produced it. */
|
|
@@ -44480,7 +44672,7 @@ async function written$7(pending) {
|
|
|
44480
44672
|
}
|
|
44481
44673
|
/** No positional arguments, or a usage refusal. */
|
|
44482
44674
|
function noExtra$20(rest) {
|
|
44483
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
44675
|
+
if (rest.length > 0) throw new UsageError(USAGE$55);
|
|
44484
44676
|
}
|
|
44485
44677
|
/**
|
|
44486
44678
|
* `build <env> <workload> [--source …|--source-upload …|--ssh-source …] [--idempotency-key …]`: queue a build.
|
|
@@ -44607,7 +44799,7 @@ function overCurrent(current, named) {
|
|
|
44607
44799
|
};
|
|
44608
44800
|
}
|
|
44609
44801
|
// src/commands/application-cache.ts
|
|
44610
|
-
var USAGE$
|
|
44802
|
+
var USAGE$54 = [
|
|
44611
44803
|
"Usage: hostingctl application cache <environment-uuid> <application-uuid> --company <slug>",
|
|
44612
44804
|
" hostingctl application cache-set <environment-uuid> <application-uuid> --company <slug> [--enabled <on|off>] [--fresh <s>] [--background <s>] [--browser <s>] [--reset <on|off>] [--template <id> | --rules-file <rules.json>]",
|
|
44613
44805
|
" hostingctl application cache-purge <environment-uuid> <application-uuid> --company <slug>",
|
|
@@ -44650,7 +44842,7 @@ async function applicationCache(context, action, path, rest) {
|
|
|
44650
44842
|
}
|
|
44651
44843
|
if (action === "canonical") {
|
|
44652
44844
|
const routeUuid = context.flags.get("--route") ?? "";
|
|
44653
|
-
if (routeUuid === "") throw new UsageError(`canonical needs --route.\n\n${USAGE$
|
|
44845
|
+
if (routeUuid === "") throw new UsageError(`canonical needs --route.\n\n${USAGE$54}`);
|
|
44654
44846
|
return await written$6(confirmableWrite(context, `Make route ${routeUuid} this application's canonical address.`, async () => {
|
|
44655
44847
|
const desiredGeneration = await generation$1(path);
|
|
44656
44848
|
return (await hostingApplicationRouteSelectCanonical({
|
|
@@ -44662,7 +44854,7 @@ async function applicationCache(context, action, path, rest) {
|
|
|
44662
44854
|
})).data;
|
|
44663
44855
|
}));
|
|
44664
44856
|
}
|
|
44665
|
-
throw new UsageError(USAGE$
|
|
44857
|
+
throw new UsageError(USAGE$54);
|
|
44666
44858
|
}
|
|
44667
44859
|
/** `application routes|route-add|route-remove`, which are environment-scoped. */
|
|
44668
44860
|
async function applicationRoutes(context, action, path, rest) {
|
|
@@ -44676,7 +44868,7 @@ async function applicationRoutes(context, action, path, rest) {
|
|
|
44676
44868
|
if (action === "route-add") return await addRoute(context, path, rest);
|
|
44677
44869
|
if (action === "route-remove") {
|
|
44678
44870
|
const [routeUuid, ...extra] = rest;
|
|
44679
|
-
if (routeUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
44871
|
+
if (routeUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$54);
|
|
44680
44872
|
return await written$6(confirmableWrite(context, `Remove route ${routeUuid}.`, async () => {
|
|
44681
44873
|
const body = { desiredGeneration: await generation$1(path) };
|
|
44682
44874
|
return (await hostingApplicationRouteRemove({
|
|
@@ -44688,7 +44880,7 @@ async function applicationRoutes(context, action, path, rest) {
|
|
|
44688
44880
|
})).data;
|
|
44689
44881
|
}));
|
|
44690
44882
|
}
|
|
44691
|
-
throw new UsageError(USAGE$
|
|
44883
|
+
throw new UsageError(USAGE$54);
|
|
44692
44884
|
}
|
|
44693
44885
|
/** `route-add --source … --target … --path …`. */
|
|
44694
44886
|
async function addRoute(context, path, rest) {
|
|
@@ -44696,7 +44888,7 @@ async function addRoute(context, path, rest) {
|
|
|
44696
44888
|
const sourceWorkloadUuid = context.flags.get("--source") ?? "";
|
|
44697
44889
|
const targetWorkloadUuid = context.flags.get("--target") ?? "";
|
|
44698
44890
|
const routePath = context.flags.get("--path") ?? "";
|
|
44699
|
-
if (sourceWorkloadUuid === "" || targetWorkloadUuid === "" || routePath === "") throw new UsageError(`route-add needs --source, --target and --path.\n\n${USAGE$
|
|
44891
|
+
if (sourceWorkloadUuid === "" || targetWorkloadUuid === "" || routePath === "") throw new UsageError(`route-add needs --source, --target and --path.\n\n${USAGE$54}`);
|
|
44700
44892
|
const domainUuid = context.flags.get("--domain")?.trim();
|
|
44701
44893
|
const canonical = onOffFlag(context, "--canonical") ?? false;
|
|
44702
44894
|
return await written$6(confirmableWrite(context, `Route ${routePath} from ${sourceWorkloadUuid} to ${targetWorkloadUuid}${canonical ? " as canonical" : ""}.`, async () => {
|
|
@@ -44729,11 +44921,11 @@ function cacheBody(context) {
|
|
|
44729
44921
|
const raw = context.flags.get(flag)?.trim() ?? "";
|
|
44730
44922
|
if (raw === "") continue;
|
|
44731
44923
|
const value = Number(raw);
|
|
44732
|
-
if (!Number.isInteger(value) || value < 0) throw new UsageError(`${flag} must be a whole number of seconds.\n\n${USAGE$
|
|
44924
|
+
if (!Number.isInteger(value) || value < 0) throw new UsageError(`${flag} must be a whole number of seconds.\n\n${USAGE$54}`);
|
|
44733
44925
|
body[field] = value;
|
|
44734
44926
|
}
|
|
44735
|
-
addCacheRules(context, body, USAGE$
|
|
44736
|
-
if (Object.keys(body).length === 0) throw new UsageError(`cache-set needs at least one field.\n\n${USAGE$
|
|
44927
|
+
addCacheRules(context, body, USAGE$54);
|
|
44928
|
+
if (Object.keys(body).length === 0) throw new UsageError(`cache-set needs at least one field.\n\n${USAGE$54}`);
|
|
44737
44929
|
return body;
|
|
44738
44930
|
}
|
|
44739
44931
|
/** The environment's generation, which every write here must name. */
|
|
@@ -44749,7 +44941,7 @@ async function written$6(pending) {
|
|
|
44749
44941
|
}
|
|
44750
44942
|
/** No positional arguments, or a usage refusal. */
|
|
44751
44943
|
function noExtra$19(rest) {
|
|
44752
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
44944
|
+
if (rest.length > 0) throw new UsageError(USAGE$54);
|
|
44753
44945
|
}
|
|
44754
44946
|
/** The `application cache*|routes|route-*` renderer. */
|
|
44755
44947
|
function applicationCacheText(report) {
|
|
@@ -44909,7 +45101,7 @@ function describeAuth(workloadUuid, auth) {
|
|
|
44909
45101
|
].join("\n");
|
|
44910
45102
|
}
|
|
44911
45103
|
// src/commands/application-create.ts
|
|
44912
|
-
var USAGE$
|
|
45104
|
+
var USAGE$53 = [
|
|
44913
45105
|
"Usage: hostingctl application create <environment-uuid> --company <slug> --type <type> --name <name>",
|
|
44914
45106
|
" --cpu-request <millicores> --memory-request <MiB>",
|
|
44915
45107
|
" [--cpu-limit <millicores>] [--memory-limit <MiB>] [--label <text>] [--hostname <host>]",
|
|
@@ -44946,11 +45138,11 @@ var CREATE_FLAGS = [{
|
|
|
44946
45138
|
}];
|
|
44947
45139
|
/** `application create <env> …`, from the `application` command. */
|
|
44948
45140
|
async function applicationCreate(context, path, rest) {
|
|
44949
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
45141
|
+
if (rest.length > 0) throw new UsageError(USAGE$53);
|
|
44950
45142
|
const type = context.flags.get("--type")?.trim().toLowerCase() ?? "";
|
|
44951
|
-
if (!TYPES.has(type)) throw new UsageError(`create needs --type wordpress, moodle, infisical, supabase-auth, supabase-rest or supabase-realtime.\n\n${USAGE$
|
|
45143
|
+
if (!TYPES.has(type)) throw new UsageError(`create needs --type wordpress, moodle, infisical, supabase-auth, supabase-rest or supabase-realtime.\n\n${USAGE$53}`);
|
|
44952
45144
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
44953
|
-
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$
|
|
45145
|
+
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$53}`);
|
|
44954
45146
|
const resources = requestedResources(context);
|
|
44955
45147
|
const label = context.flags.get("--label")?.trim() ?? "";
|
|
44956
45148
|
const intendedHostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
|
|
@@ -44995,11 +45187,74 @@ function requestedResources(context) {
|
|
|
44995
45187
|
/** One required whole-number flag, or a usage refusal naming the flag. */
|
|
44996
45188
|
function required$7(context, flag) {
|
|
44997
45189
|
const value = wholeNumberFlag(context.flags, flag);
|
|
44998
|
-
if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$
|
|
45190
|
+
if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$53}`);
|
|
44999
45191
|
return value;
|
|
45000
45192
|
}
|
|
45193
|
+
// src/commands/application-import-fetch.ts
|
|
45194
|
+
var FETCH_USAGE = [
|
|
45195
|
+
"Usage: hostingctl application import-fetch <environment-uuid> <application-uuid> --company <slug>",
|
|
45196
|
+
" (--connection <uuid> [--source-path <folder>] | --archive-url <https-url>) [--database-connection <uuid>]",
|
|
45197
|
+
" hostingctl application import-refresh <environment-uuid> <application-uuid> --company <slug>",
|
|
45198
|
+
"",
|
|
45199
|
+
" import-fetch Fetch a WordPress site from the old host into a staged import for review.",
|
|
45200
|
+
" import-refresh Refresh from the old host: fetch the same source again into a new review.",
|
|
45201
|
+
"",
|
|
45202
|
+
"A file connection and a database connection must have passed a check. An archive is an https:// .zip, .jpa,",
|
|
45203
|
+
".tar.gz or .tgz on a public address; only an Akeeba .jpa carries its own database. Read the import with",
|
|
45204
|
+
"`application import` until it is staged, then review and confirm it as an upload. Every write needs --confirm."
|
|
45205
|
+
].join("\n");
|
|
45206
|
+
/** The flags only the fetch reads. */
|
|
45207
|
+
var FETCH_FLAGS = [
|
|
45208
|
+
{
|
|
45209
|
+
name: "--connection",
|
|
45210
|
+
takesValue: true,
|
|
45211
|
+
description: "import-fetch: the checked file connection to fetch from."
|
|
45212
|
+
},
|
|
45213
|
+
{
|
|
45214
|
+
name: "--source-path",
|
|
45215
|
+
takesValue: true,
|
|
45216
|
+
description: "import-fetch: the folder on the old host (the connection's start path by default)."
|
|
45217
|
+
},
|
|
45218
|
+
{
|
|
45219
|
+
name: "--archive-url",
|
|
45220
|
+
takesValue: true,
|
|
45221
|
+
description: "import-fetch: an https:// archive of the site to fetch instead."
|
|
45222
|
+
},
|
|
45223
|
+
{
|
|
45224
|
+
name: "--database-connection",
|
|
45225
|
+
takesValue: true,
|
|
45226
|
+
description: "import-fetch: the checked MySQL connection the dump is taken from."
|
|
45227
|
+
}
|
|
45228
|
+
];
|
|
45229
|
+
var FETCH_TOPICS = [{
|
|
45230
|
+
path: ["import-fetch"],
|
|
45231
|
+
usage: FETCH_USAGE
|
|
45232
|
+
}, {
|
|
45233
|
+
path: ["import-refresh"],
|
|
45234
|
+
usage: FETCH_USAGE
|
|
45235
|
+
}];
|
|
45236
|
+
/** `import-fetch` and `import-refresh`: both answer with the received import, to be read until it is staged. */
|
|
45237
|
+
async function fetchImport(context, action, path, rest) {
|
|
45238
|
+
if (rest.length > 0) throw new UsageError(FETCH_USAGE);
|
|
45239
|
+
if (action === "import-refresh") return await confirmableWrite(context, "Refresh from the old host: fetch this site's last source again into a new import for review. Nothing is applied yet.", async () => (await hostingWordpressImportRefresh({ path })).data);
|
|
45240
|
+
const value = (flag) => {
|
|
45241
|
+
const one = context.flags.get(flag)?.trim() ?? "";
|
|
45242
|
+
return one === "" ? void 0 : one;
|
|
45243
|
+
};
|
|
45244
|
+
const body = {
|
|
45245
|
+
connectionUuid: value("--connection"),
|
|
45246
|
+
sourcePath: value("--source-path"),
|
|
45247
|
+
archiveUrl: value("--archive-url"),
|
|
45248
|
+
databaseConnectionUuid: value("--database-connection")
|
|
45249
|
+
};
|
|
45250
|
+
if (body.connectionUuid === void 0 === (body.archiveUrl === void 0)) throw new UsageError(`import-fetch needs exactly one of --connection or --archive-url.\n\n${FETCH_USAGE}`);
|
|
45251
|
+
return await confirmableWrite(context, `Fetch a site import from ${body.archiveUrl ?? `connection ${String(body.connectionUuid)}, folder ${body.sourcePath ?? "(its start path)"}`}${body.databaseConnectionUuid === void 0 ? "" : ` with the database from ${body.databaseConnectionUuid}`}. The import is staged for review; nothing is applied yet.`, async () => (await hostingWordpressImportFetch({
|
|
45252
|
+
path,
|
|
45253
|
+
body
|
|
45254
|
+
})).data);
|
|
45255
|
+
}
|
|
45001
45256
|
// src/commands/application-upload.ts
|
|
45002
|
-
var USAGE$
|
|
45257
|
+
var USAGE$52 = [
|
|
45003
45258
|
"Usage: hostingctl application import-upload <environment-uuid> <application-uuid> --company <slug>",
|
|
45004
45259
|
" --database <path-to.sql> --archive <path-to.zip|path-to.jpa> | --directory <dir>",
|
|
45005
45260
|
"",
|
|
@@ -45028,12 +45283,12 @@ var STAGING_WAIT_MS = 9e5;
|
|
|
45028
45283
|
/** How often the staged import is asked for its state while the queue works. */
|
|
45029
45284
|
var STAGING_POLL_MS = 3e3;
|
|
45030
45285
|
async function applicationUpload(context, path, rest) {
|
|
45031
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
45286
|
+
if (rest.length > 0) throw new UsageError(USAGE$52);
|
|
45032
45287
|
const database = context.flags.get("--database")?.trim() ?? "";
|
|
45033
45288
|
const archive = context.flags.get("--archive")?.trim() ?? "";
|
|
45034
45289
|
const directory = context.flags.get("--directory")?.trim() ?? "";
|
|
45035
|
-
if (archive !== "" && directory !== "") throw new UsageError(`Send the site files as either --archive or --directory, not both.\n\n${USAGE$
|
|
45036
|
-
if (database === "" && !isAkeebaArchive(archive)) throw new UsageError(`--database is required unless --archive is an Akeeba backup (.jpa or .jps), which carries the site's database inside the archive. If --archive is an Akeeba backup renamed .zip, rename it so its own database is used.\n\n${USAGE$
|
|
45290
|
+
if (archive !== "" && directory !== "") throw new UsageError(`Send the site files as either --archive or --directory, not both.\n\n${USAGE$52}`);
|
|
45291
|
+
if (database === "" && !isAkeebaArchive(archive)) throw new UsageError(`--database is required unless --archive is an Akeeba backup (.jpa or .jps), which carries the site's database inside the archive. If --archive is an Akeeba backup renamed .zip, rename it so its own database is used.\n\n${USAGE$52}`);
|
|
45037
45292
|
const databaseBytes = database === "" ? 0 : await sizeOf(database, "database");
|
|
45038
45293
|
const files = directory === "" ? [] : await manifestOf(directory);
|
|
45039
45294
|
const fileBytes = directory === "" ? 0 : await totalSize(files);
|
|
@@ -45142,7 +45397,7 @@ function describe$2(bytes) {
|
|
|
45142
45397
|
return `${(bytes / 1048576).toFixed(1)} MiB`;
|
|
45143
45398
|
}
|
|
45144
45399
|
// src/commands/application-import.ts
|
|
45145
|
-
var USAGE$
|
|
45400
|
+
var USAGE$51 = [
|
|
45146
45401
|
"Usage: hostingctl application import <environment-uuid> <application-uuid> <import-uuid> --company <slug>",
|
|
45147
45402
|
" hostingctl application import-upload <environment-uuid> <application-uuid> --company <slug>",
|
|
45148
45403
|
" --database <path-to.sql> [--archive <path-to.zip> | --directory <dir>]",
|
|
@@ -45159,12 +45414,16 @@ var USAGE$50 = [
|
|
|
45159
45414
|
"The confirmation is the text the review asked the person to type, so a rewrite is never confirmed by a flag",
|
|
45160
45415
|
"alone. Every write needs --confirm; --dry-run describes the change without sending it."
|
|
45161
45416
|
].join("\n");
|
|
45162
|
-
/** `application import|import-discard|url-repair-*`. */
|
|
45417
|
+
/** `application import|import-upload|import-fetch|import-refresh|import-discard|url-repair-*`. */
|
|
45163
45418
|
async function applicationImport(context, action, path, rest) {
|
|
45164
45419
|
if (action === "url-repair-preview") return await previewRepair(context, path, rest);
|
|
45165
45420
|
if (action === "import-upload") return await applicationUpload(context, path, rest);
|
|
45421
|
+
if (action === "import-fetch" || action === "import-refresh") return {
|
|
45422
|
+
kind: "import-write",
|
|
45423
|
+
outcome: await fetchImport(context, action, path, rest)
|
|
45424
|
+
};
|
|
45166
45425
|
const [importUuid, ...extra] = rest;
|
|
45167
|
-
if (importUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
45426
|
+
if (importUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$51);
|
|
45168
45427
|
if (action === "import") return {
|
|
45169
45428
|
kind: "import",
|
|
45170
45429
|
staged: (await hostingWordpressImportShowImport({ path: {
|
|
@@ -45177,13 +45436,13 @@ async function applicationImport(context, action, path, rest) {
|
|
|
45177
45436
|
importUuid
|
|
45178
45437
|
} })).data));
|
|
45179
45438
|
if (action === "url-repair-confirm") return await confirmRepair(context, path, importUuid);
|
|
45180
|
-
throw new UsageError(USAGE$
|
|
45439
|
+
throw new UsageError(USAGE$51);
|
|
45181
45440
|
}
|
|
45182
45441
|
/** `url-repair-preview --source-url …`: the review a confirmation is made against. */
|
|
45183
45442
|
async function previewRepair(context, path, rest) {
|
|
45184
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
45443
|
+
if (rest.length > 0) throw new UsageError(USAGE$51);
|
|
45185
45444
|
const sourceUrl = context.flags.get("--source-url")?.trim() ?? "";
|
|
45186
|
-
if (sourceUrl === "") throw new UsageError(`url-repair-preview needs --source-url.\n\n${USAGE$
|
|
45445
|
+
if (sourceUrl === "") throw new UsageError(`url-repair-preview needs --source-url.\n\n${USAGE$51}`);
|
|
45187
45446
|
return {
|
|
45188
45447
|
kind: "url-repair",
|
|
45189
45448
|
recovery: (await hostingWordpressUrlRepairPreview({
|
|
@@ -45195,7 +45454,7 @@ async function previewRepair(context, path, rest) {
|
|
|
45195
45454
|
/** `url-repair-confirm <recovery> --confirmation …`: the typed text the review asked for. */
|
|
45196
45455
|
async function confirmRepair(context, path, recoveryUuid) {
|
|
45197
45456
|
const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
|
|
45198
|
-
if (confirmation === "") throw new UsageError(`url-repair-confirm needs --confirmation.\n\n${USAGE$
|
|
45457
|
+
if (confirmation === "") throw new UsageError(`url-repair-confirm needs --confirmation.\n\n${USAGE$51}`);
|
|
45199
45458
|
return await written$5(confirmableWrite(context, `Confirm the URL repair by typing its confirmation ("${confirmation}").`, async () => {
|
|
45200
45459
|
const desiredGeneration = (await hostingEnvironmentShow({ path })).data.desiredGeneration;
|
|
45201
45460
|
const body = {
|
|
@@ -45339,7 +45598,7 @@ function recoveryWaitText(report) {
|
|
|
45339
45598
|
return `Recovery ${report.recovery.uuid} ${report.recovery.statusName}: ${report.recovery.actionName} of ${report.recovery.workloadName} is done.`;
|
|
45340
45599
|
}
|
|
45341
45600
|
// src/commands/application-recovery.ts
|
|
45342
|
-
var USAGE$
|
|
45601
|
+
var USAGE$50 = [
|
|
45343
45602
|
"Usage: hostingctl application recovery-review <environment-uuid> <application-uuid> --company <slug> [--import <uuid>]",
|
|
45344
45603
|
" hostingctl application recovery-confirm <environment-uuid> <application-uuid> --company <slug> --confirmation <text> [--import <uuid>] [--wait [--timeout <seconds>]]",
|
|
45345
45604
|
"",
|
|
@@ -45359,9 +45618,9 @@ var USAGE$49 = [
|
|
|
45359
45618
|
].join("\n");
|
|
45360
45619
|
/** `application recovery-review|recovery-confirm`. */
|
|
45361
45620
|
async function applicationRecovery(context, action, path, rest) {
|
|
45362
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
45621
|
+
if (rest.length > 0) throw new UsageError(USAGE$50);
|
|
45363
45622
|
const importUuid = context.flags.get("--import")?.trim();
|
|
45364
|
-
if (importUuid === "") throw new UsageError(`--import needs the staged import's id.\n\n${USAGE$
|
|
45623
|
+
if (importUuid === "") throw new UsageError(`--import needs the staged import's id.\n\n${USAGE$50}`);
|
|
45365
45624
|
const review = (await hostingApplicationRecoveryShow({
|
|
45366
45625
|
path,
|
|
45367
45626
|
...importUuid === void 0 ? {} : { query: { importUuid } }
|
|
@@ -45370,10 +45629,10 @@ async function applicationRecovery(context, action, path, rest) {
|
|
|
45370
45629
|
kind: "recovery-review",
|
|
45371
45630
|
review
|
|
45372
45631
|
};
|
|
45373
|
-
if (action !== "recovery-confirm") throw new UsageError(USAGE$
|
|
45632
|
+
if (action !== "recovery-confirm") throw new UsageError(USAGE$50);
|
|
45374
45633
|
if (review.blockedReason !== null) throw new UsageError(`This restore is blocked: ${review.blockedReason}`);
|
|
45375
45634
|
const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
|
|
45376
|
-
if (confirmation === "") throw new UsageError(`recovery-confirm needs --confirmation.\n\n${USAGE$
|
|
45635
|
+
if (confirmation === "") throw new UsageError(`recovery-confirm needs --confirmation.\n\n${USAGE$50}`);
|
|
45377
45636
|
const wait = context.flags.has("--wait");
|
|
45378
45637
|
const deadline = wait ? commandDeadline(context.flags) : 0;
|
|
45379
45638
|
const outcome = await confirmableWrite(context, `Confirm ${review.actionName} of ${review.name}${review.installedVersion === null ? "" : ` from ${review.installedVersion}`}: ${String(review.routeUuids.length)} route(s) and ${String(review.hosts.length)} host(s) are rewritten.`, async () => {
|
|
@@ -45490,7 +45749,7 @@ function siteAccessFlow(callbacks, usage) {
|
|
|
45490
45749
|
access: await callbacks.show(path)
|
|
45491
45750
|
};
|
|
45492
45751
|
}
|
|
45493
|
-
if (action === "site-access-set") return await set$
|
|
45752
|
+
if (action === "site-access-set") return await set$4(context, path, rest, callbacks, usage);
|
|
45494
45753
|
if (action === "site-access-rotate") {
|
|
45495
45754
|
noExtra$18(rest, usage);
|
|
45496
45755
|
if (callbacks.rotate === null) throw new UsageError("This scope has no sign-in edge of its own to rotate.");
|
|
@@ -45502,7 +45761,7 @@ function siteAccessFlow(callbacks, usage) {
|
|
|
45502
45761
|
};
|
|
45503
45762
|
}
|
|
45504
45763
|
/** `site-access-set --sign-in … [--audience …]`. */
|
|
45505
|
-
async function set$
|
|
45764
|
+
async function set$4(context, path, rest, callbacks, usage) {
|
|
45506
45765
|
noExtra$18(rest, usage);
|
|
45507
45766
|
const requiredSignIn = onOffFlag(context, "--sign-in");
|
|
45508
45767
|
if (requiredSignIn === null) throw new UsageError(`site-access-set needs --sign-in.\n\n${usage}`);
|
|
@@ -45575,7 +45834,7 @@ function siteAccessText(report) {
|
|
|
45575
45834
|
return report.assignments.length === 0 ? "Nobody has been invited to sign in." : report.assignments.map(assignmentLine).join("\n");
|
|
45576
45835
|
}
|
|
45577
45836
|
// src/commands/application-site-access.ts
|
|
45578
|
-
var USAGE$
|
|
45837
|
+
var USAGE$49 = [
|
|
45579
45838
|
"Usage: hostingctl application site-access <environment-uuid> <application-uuid> --company <slug>",
|
|
45580
45839
|
" hostingctl application site-access-set <environment-uuid> <application-uuid> --company <slug> --sign-in <on|off> [--audience <name>]",
|
|
45581
45840
|
" hostingctl application site-access-rotate <environment-uuid> <application-uuid> --company <slug>",
|
|
@@ -45618,14 +45877,14 @@ var flow$1 = siteAccessFlow({
|
|
|
45618
45877
|
refresh: async (path) => (await hostingApplicationSiteAccessUsersRefresh({ path })).data,
|
|
45619
45878
|
destroy: async (path) => (await hostingApplicationSiteAccessUsersDestroy({ path })).data,
|
|
45620
45879
|
rotate: async (path) => (await hostingApplicationSiteAccessRotate({ path })).data
|
|
45621
|
-
}, USAGE$
|
|
45880
|
+
}, USAGE$49);
|
|
45622
45881
|
/** `application site-access*|site-user*`, which the application dispatcher calls with its resolved path. */
|
|
45623
45882
|
async function applicationSiteAccess(context, action, path, rest) {
|
|
45624
|
-
if (rest.some((one) => one === "")) throw new UsageError(USAGE$
|
|
45883
|
+
if (rest.some((one) => one === "")) throw new UsageError(USAGE$49);
|
|
45625
45884
|
return await flow$1(context, action, path, rest);
|
|
45626
45885
|
}
|
|
45627
45886
|
// src/commands/application-source-ssh.ts
|
|
45628
|
-
var USAGE$
|
|
45887
|
+
var USAGE$48 = [
|
|
45629
45888
|
"Usage: hostingctl application source-ssh-list --company <slug>",
|
|
45630
45889
|
" hostingctl application source-ssh-show <connection-uuid> --company <slug>",
|
|
45631
45890
|
" hostingctl application source-ssh-create --company <slug> --name <label> --repo <url> --ref <name> [--ref-kind branch|tag]",
|
|
@@ -45677,7 +45936,7 @@ async function applicationSshSources(context, action, company, rest) {
|
|
|
45677
45936
|
}
|
|
45678
45937
|
if (action === "source-ssh-create") return await create$5(context, company, rest);
|
|
45679
45938
|
const [connectionUuid, ...extra] = rest;
|
|
45680
|
-
if (connectionUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
45939
|
+
if (connectionUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$48);
|
|
45681
45940
|
const path = {
|
|
45682
45941
|
company,
|
|
45683
45942
|
connectionUuid
|
|
@@ -45699,7 +45958,7 @@ async function applicationSshSources(context, action, company, rest) {
|
|
|
45699
45958
|
"to be installed on the Git server before access can be proved again."
|
|
45700
45959
|
].join("\n"), async () => (await hostingSshSourcesRotateKey({ path })).data));
|
|
45701
45960
|
if (action === "source-ssh-revoke") return await written$4(confirmableWrite(context, [`Retire the SSH source ${connectionUuid}.`, "The source stops fetching and cannot promote a pending candidate; a release already serving is unchanged."].join("\n"), async () => (await hostingSshSourcesRevoke({ path })).data));
|
|
45702
|
-
throw new UsageError(USAGE$
|
|
45961
|
+
throw new UsageError(USAGE$48);
|
|
45703
45962
|
}
|
|
45704
45963
|
/** `source-ssh-create --name … --repo … --ref … [--ref-kind …]`: one repository and the ref it reads. */
|
|
45705
45964
|
async function create$5(context, company, rest) {
|
|
@@ -45729,7 +45988,7 @@ async function update$5(context, path) {
|
|
|
45729
45988
|
const name = optionalFlag(context, "--name");
|
|
45730
45989
|
const ref = optionalFlag(context, "--ref");
|
|
45731
45990
|
const refKind = refKindFlag(context);
|
|
45732
|
-
if (name === null && ref === null && refKind === null) throw new UsageError(`source-ssh-update needs --name, --ref or --ref-kind.\n\n${USAGE$
|
|
45991
|
+
if (name === null && ref === null && refKind === null) throw new UsageError(`source-ssh-update needs --name, --ref or --ref-kind.\n\n${USAGE$48}`);
|
|
45733
45992
|
const described = [name === null ? "" : `label ${name}`, ref === null ? "" : `ref ${ref}`].filter((one) => one !== "").join(", ");
|
|
45734
45993
|
return await written$4(confirmableWrite(context, [
|
|
45735
45994
|
`Edit the SSH source ${path.connectionUuid}${described === "" ? "" : `: ${described}`}.`,
|
|
@@ -45761,7 +46020,7 @@ async function confirmHostKey(context, path) {
|
|
|
45761
46020
|
/** A required flag's value, or a refusal naming the flag. */
|
|
45762
46021
|
function required$6(context, flag) {
|
|
45763
46022
|
const value = context.flags.get(flag)?.trim() ?? "";
|
|
45764
|
-
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$
|
|
46023
|
+
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$48}`);
|
|
45765
46024
|
return value;
|
|
45766
46025
|
}
|
|
45767
46026
|
/** An optional flag's value, or null when it was not given. */
|
|
@@ -45774,7 +46033,7 @@ function refKindFlag(context) {
|
|
|
45774
46033
|
const value = context.flags.get("--ref-kind")?.trim() ?? "";
|
|
45775
46034
|
if (value === "") return null;
|
|
45776
46035
|
if (value === "branch" || value === "tag") return value;
|
|
45777
|
-
throw new UsageError(`--ref-kind must be branch or tag (got "${value}").\n\n${USAGE$
|
|
46036
|
+
throw new UsageError(`--ref-kind must be branch or tag (got "${value}").\n\n${USAGE$48}`);
|
|
45778
46037
|
}
|
|
45779
46038
|
/** Tag one write's outcome with the group that produced it. */
|
|
45780
46039
|
async function written$4(pending) {
|
|
@@ -45785,10 +46044,10 @@ async function written$4(pending) {
|
|
|
45785
46044
|
}
|
|
45786
46045
|
/** No positional arguments, or a usage refusal. */
|
|
45787
46046
|
function noExtra$17(rest) {
|
|
45788
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
46047
|
+
if (rest.length > 0) throw new UsageError(USAGE$48);
|
|
45789
46048
|
}
|
|
45790
46049
|
// src/commands/application-source-upload.ts
|
|
45791
|
-
var USAGE$
|
|
46050
|
+
var USAGE$47 = [
|
|
45792
46051
|
"Usage: hostingctl application source-upload <environment-uuid> <application-uuid> --company <slug> --file <path-to.zip>",
|
|
45793
46052
|
" hostingctl application source-uploads <environment-uuid> <application-uuid> --company <slug>",
|
|
45794
46053
|
" hostingctl application source-upload-show <environment-uuid> <application-uuid> <upload-uuid> --company <slug>",
|
|
@@ -45827,7 +46086,7 @@ async function applicationSourceUploads(context, action, path, rest) {
|
|
|
45827
46086
|
};
|
|
45828
46087
|
}
|
|
45829
46088
|
const [uploadUuid, ...extra] = rest;
|
|
45830
|
-
if (uploadUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
46089
|
+
if (uploadUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$47);
|
|
45831
46090
|
const uploadPath = {
|
|
45832
46091
|
...path,
|
|
45833
46092
|
uploadUuid
|
|
@@ -45839,7 +46098,7 @@ async function applicationSourceUploads(context, action, path, rest) {
|
|
|
45839
46098
|
if (action === "source-upload-discard") return await written$3(confirmableWrite(context, [`Discard the staged source upload ${uploadUuid}.`, "A build that already used it keeps the copy it was handed, so nothing that is serving changes."].join("\n"), async () => {
|
|
45840
46099
|
await hostingSourceUploadsDestroy({ path: uploadPath });
|
|
45841
46100
|
}));
|
|
45842
|
-
throw new UsageError(USAGE$
|
|
46101
|
+
throw new UsageError(USAGE$47);
|
|
45843
46102
|
}
|
|
45844
46103
|
/**
|
|
45845
46104
|
* `source-upload --file …`: stage one ZIP as the application's source.
|
|
@@ -45851,7 +46110,7 @@ async function applicationSourceUploads(context, action, path, rest) {
|
|
|
45851
46110
|
async function store(context, path, rest) {
|
|
45852
46111
|
noExtra$16(rest);
|
|
45853
46112
|
const file = context.flags.get("--file")?.trim() ?? "";
|
|
45854
|
-
if (file === "") throw new UsageError(`source-upload needs --file.\n\n${USAGE$
|
|
46113
|
+
if (file === "") throw new UsageError(`source-upload needs --file.\n\n${USAGE$47}`);
|
|
45855
46114
|
return await written$3(confirmableWrite(context, [
|
|
45856
46115
|
`Upload ${file} as the staged source for application ${path.workloadUuid}.`,
|
|
45857
46116
|
"The platform normalizes the archive, measures it and reviews it; installing dependencies and changing anything",
|
|
@@ -45891,7 +46150,7 @@ async function written$3(pending) {
|
|
|
45891
46150
|
}
|
|
45892
46151
|
/** No positional arguments, or a usage refusal. */
|
|
45893
46152
|
function noExtra$16(rest) {
|
|
45894
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
46153
|
+
if (rest.length > 0) throw new UsageError(USAGE$47);
|
|
45895
46154
|
}
|
|
45896
46155
|
/** One staged upload: what the platform measured, what the review found, and when staging expires. */
|
|
45897
46156
|
function uploadLines(upload) {
|
|
@@ -46018,51 +46277,51 @@ var SOURCE_SUBCOMMANDS = [
|
|
|
46018
46277
|
var SOURCE_TOPICS = [
|
|
46019
46278
|
{
|
|
46020
46279
|
path: ["source-upload"],
|
|
46021
|
-
usage: USAGE$
|
|
46280
|
+
usage: USAGE$47
|
|
46022
46281
|
},
|
|
46023
46282
|
{
|
|
46024
46283
|
path: ["source-uploads"],
|
|
46025
|
-
usage: USAGE$
|
|
46284
|
+
usage: USAGE$47
|
|
46026
46285
|
},
|
|
46027
46286
|
{
|
|
46028
46287
|
path: ["source-upload-show"],
|
|
46029
|
-
usage: USAGE$
|
|
46288
|
+
usage: USAGE$47
|
|
46030
46289
|
},
|
|
46031
46290
|
{
|
|
46032
46291
|
path: ["source-upload-discard"],
|
|
46033
|
-
usage: USAGE$
|
|
46292
|
+
usage: USAGE$47
|
|
46034
46293
|
},
|
|
46035
46294
|
{
|
|
46036
46295
|
path: ["source-ssh-list"],
|
|
46037
|
-
usage: USAGE$
|
|
46296
|
+
usage: USAGE$48
|
|
46038
46297
|
},
|
|
46039
46298
|
{
|
|
46040
46299
|
path: ["source-ssh-show"],
|
|
46041
|
-
usage: USAGE$
|
|
46300
|
+
usage: USAGE$48
|
|
46042
46301
|
},
|
|
46043
46302
|
{
|
|
46044
46303
|
path: ["source-ssh-create"],
|
|
46045
|
-
usage: USAGE$
|
|
46304
|
+
usage: USAGE$48
|
|
46046
46305
|
},
|
|
46047
46306
|
{
|
|
46048
46307
|
path: ["source-ssh-update"],
|
|
46049
|
-
usage: USAGE$
|
|
46308
|
+
usage: USAGE$48
|
|
46050
46309
|
},
|
|
46051
46310
|
{
|
|
46052
46311
|
path: ["source-ssh-confirm-host-key"],
|
|
46053
|
-
usage: USAGE$
|
|
46312
|
+
usage: USAGE$48
|
|
46054
46313
|
},
|
|
46055
46314
|
{
|
|
46056
46315
|
path: ["source-ssh-verify"],
|
|
46057
|
-
usage: USAGE$
|
|
46316
|
+
usage: USAGE$48
|
|
46058
46317
|
},
|
|
46059
46318
|
{
|
|
46060
46319
|
path: ["source-ssh-rotate-key"],
|
|
46061
|
-
usage: USAGE$
|
|
46320
|
+
usage: USAGE$48
|
|
46062
46321
|
},
|
|
46063
46322
|
{
|
|
46064
46323
|
path: ["source-ssh-revoke"],
|
|
46065
|
-
usage: USAGE$
|
|
46324
|
+
usage: USAGE$48
|
|
46066
46325
|
}
|
|
46067
46326
|
];
|
|
46068
46327
|
// src/commands/application-speed.ts
|
|
@@ -46092,7 +46351,7 @@ function applicationSpeedText(check) {
|
|
|
46092
46351
|
* paused. It starts no build and promotes nothing. The pause is the customer's own control: while it holds, a push to
|
|
46093
46352
|
* the bound ref is read and matched but builds nothing, and the release that is serving is untouched either way.
|
|
46094
46353
|
*/
|
|
46095
|
-
var USAGE$
|
|
46354
|
+
var USAGE$46 = [
|
|
46096
46355
|
"Usage: hostingctl application updates <environment-uuid> <application-uuid> --company <slug>",
|
|
46097
46356
|
" hostingctl application updates-pause <environment-uuid> <application-uuid> --company <slug>",
|
|
46098
46357
|
" hostingctl application updates-resume <environment-uuid> <application-uuid> --company <slug>",
|
|
@@ -46105,7 +46364,7 @@ var USAGE$45 = [
|
|
|
46105
46364
|
"Both writes need --confirm; --dry-run describes the change without sending it."
|
|
46106
46365
|
].join("\n");
|
|
46107
46366
|
async function applicationUpdates(context, action, path, rest) {
|
|
46108
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
46367
|
+
if (rest.length > 0) throw new UsageError(USAGE$46);
|
|
46109
46368
|
if (action === "updates") return {
|
|
46110
46369
|
kind: "updates",
|
|
46111
46370
|
surface: (await hostingApplicationUpdatesShow({ path })).data
|
|
@@ -46117,7 +46376,7 @@ async function applicationUpdates(context, action, path, rest) {
|
|
|
46117
46376
|
outcome: await confirmableWrite(context, pausing ? `Pause updates for application ${path.workloadUuid}: a push to its bound ref stops building it, and the release that is serving is unchanged.` : `Resume updates for application ${path.workloadUuid}: it may be a candidate again. Nothing is deployed by resuming.`, async () => pausing ? (await hostingApplicationUpdatesPause({ path })).data : (await hostingApplicationUpdatesResume({ path })).data)
|
|
46118
46377
|
};
|
|
46119
46378
|
}
|
|
46120
|
-
throw new UsageError(USAGE$
|
|
46379
|
+
throw new UsageError(USAGE$46);
|
|
46121
46380
|
}
|
|
46122
46381
|
/**
|
|
46123
46382
|
* The update state in words.
|
|
@@ -46188,6 +46447,7 @@ var APPLICATION_METADATA = {
|
|
|
46188
46447
|
description: "The workload a route is served from, or the repository selection a build is made from."
|
|
46189
46448
|
},
|
|
46190
46449
|
...SOURCE_FLAGS,
|
|
46450
|
+
...FETCH_FLAGS,
|
|
46191
46451
|
{
|
|
46192
46452
|
name: "--target",
|
|
46193
46453
|
takesValue: true,
|
|
@@ -46335,11 +46595,7 @@ var APPLICATION_METADATA = {
|
|
|
46335
46595
|
...SOURCE_SUBCOMMANDS,
|
|
46336
46596
|
"recovery-review",
|
|
46337
46597
|
"recovery-confirm",
|
|
46338
|
-
|
|
46339
|
-
"import-upload",
|
|
46340
|
-
"import-discard",
|
|
46341
|
-
"url-repair-preview",
|
|
46342
|
-
"url-repair-confirm",
|
|
46598
|
+
...IMPORT_ACTIONS,
|
|
46343
46599
|
"site-access",
|
|
46344
46600
|
"site-access-set",
|
|
46345
46601
|
"site-access-rotate",
|
|
@@ -46372,84 +46628,81 @@ var APPLICATION_TOPICS = [
|
|
|
46372
46628
|
},
|
|
46373
46629
|
{
|
|
46374
46630
|
path: ["create"],
|
|
46375
|
-
usage: USAGE$
|
|
46631
|
+
usage: USAGE$53
|
|
46376
46632
|
},
|
|
46377
46633
|
{
|
|
46378
46634
|
path: ["build-log"],
|
|
46379
|
-
usage: USAGE$
|
|
46635
|
+
usage: USAGE$55
|
|
46380
46636
|
},
|
|
46381
46637
|
{
|
|
46382
46638
|
path: ["build-retry"],
|
|
46383
|
-
usage: USAGE$
|
|
46639
|
+
usage: USAGE$55
|
|
46384
46640
|
},
|
|
46385
46641
|
{
|
|
46386
46642
|
path: ["build-cancel"],
|
|
46387
|
-
usage: USAGE$
|
|
46643
|
+
usage: USAGE$55
|
|
46388
46644
|
},
|
|
46389
46645
|
{
|
|
46390
46646
|
path: ["source-bind"],
|
|
46391
|
-
usage: USAGE$
|
|
46647
|
+
usage: USAGE$55
|
|
46392
46648
|
},
|
|
46393
46649
|
{
|
|
46394
46650
|
path: ["source-unbind"],
|
|
46395
|
-
usage: USAGE$
|
|
46651
|
+
usage: USAGE$55
|
|
46396
46652
|
},
|
|
46397
46653
|
...SOURCE_TOPICS,
|
|
46398
46654
|
{
|
|
46399
46655
|
path: ["cache"],
|
|
46400
|
-
usage: USAGE$
|
|
46656
|
+
usage: USAGE$54
|
|
46401
46657
|
},
|
|
46402
46658
|
{
|
|
46403
46659
|
path: ["cache-set"],
|
|
46404
|
-
usage: USAGE$
|
|
46660
|
+
usage: USAGE$54
|
|
46405
46661
|
},
|
|
46406
46662
|
{
|
|
46407
46663
|
path: ["cache-purge"],
|
|
46408
|
-
usage: USAGE$
|
|
46664
|
+
usage: USAGE$54
|
|
46409
46665
|
},
|
|
46410
46666
|
{
|
|
46411
46667
|
path: ["routes"],
|
|
46412
|
-
usage: USAGE$
|
|
46668
|
+
usage: USAGE$54
|
|
46413
46669
|
},
|
|
46414
46670
|
{
|
|
46415
46671
|
path: ["route-add"],
|
|
46416
|
-
usage: USAGE$
|
|
46672
|
+
usage: USAGE$54
|
|
46417
46673
|
},
|
|
46418
46674
|
{
|
|
46419
46675
|
path: ["route-remove"],
|
|
46420
|
-
usage: USAGE$
|
|
46676
|
+
usage: USAGE$54
|
|
46421
46677
|
},
|
|
46422
46678
|
{
|
|
46423
46679
|
path: ["canonical"],
|
|
46424
|
-
usage: USAGE$
|
|
46680
|
+
usage: USAGE$54
|
|
46425
46681
|
},
|
|
46426
46682
|
{
|
|
46427
46683
|
path: ["import"],
|
|
46428
|
-
usage: USAGE$50
|
|
46429
|
-
},
|
|
46430
|
-
{
|
|
46431
|
-
path: ["import-upload"],
|
|
46432
46684
|
usage: USAGE$51
|
|
46433
46685
|
},
|
|
46434
46686
|
{
|
|
46435
|
-
path: ["import-
|
|
46436
|
-
usage: USAGE$
|
|
46437
|
-
},
|
|
46438
|
-
{
|
|
46439
|
-
path: ["url-repair-preview"],
|
|
46440
|
-
usage: USAGE$50
|
|
46441
|
-
},
|
|
46442
|
-
{
|
|
46443
|
-
path: ["url-repair-confirm"],
|
|
46444
|
-
usage: USAGE$50
|
|
46687
|
+
path: ["import-upload"],
|
|
46688
|
+
usage: USAGE$52
|
|
46445
46689
|
},
|
|
46690
|
+
...[
|
|
46691
|
+
"import-discard",
|
|
46692
|
+
"url-repair-preview",
|
|
46693
|
+
"url-repair-confirm"
|
|
46694
|
+
].map((one) => ({
|
|
46695
|
+
path: [one],
|
|
46696
|
+
usage: USAGE$51
|
|
46697
|
+
})),
|
|
46698
|
+
...FETCH_TOPICS,
|
|
46446
46699
|
{
|
|
46447
46700
|
path: ["recovery-review"],
|
|
46448
|
-
usage: USAGE$
|
|
46701
|
+
usage: USAGE$50
|
|
46449
46702
|
},
|
|
46450
46703
|
{
|
|
46451
46704
|
path: ["recovery-confirm"],
|
|
46452
|
-
usage: USAGE$
|
|
46705
|
+
usage: USAGE$50
|
|
46453
46706
|
},
|
|
46454
46707
|
{
|
|
46455
46708
|
path: ["runtime"],
|
|
@@ -46461,59 +46714,59 @@ var APPLICATION_TOPICS = [
|
|
|
46461
46714
|
},
|
|
46462
46715
|
{
|
|
46463
46716
|
path: ["site-access"],
|
|
46464
|
-
usage: USAGE$
|
|
46717
|
+
usage: USAGE$49
|
|
46465
46718
|
},
|
|
46466
46719
|
{
|
|
46467
46720
|
path: ["site-access-set"],
|
|
46468
|
-
usage: USAGE$
|
|
46721
|
+
usage: USAGE$49
|
|
46469
46722
|
},
|
|
46470
46723
|
{
|
|
46471
46724
|
path: ["site-access-rotate"],
|
|
46472
|
-
usage: USAGE$
|
|
46725
|
+
usage: USAGE$49
|
|
46473
46726
|
},
|
|
46474
46727
|
{
|
|
46475
46728
|
path: ["site-users"],
|
|
46476
|
-
usage: USAGE$
|
|
46729
|
+
usage: USAGE$49
|
|
46477
46730
|
},
|
|
46478
46731
|
{
|
|
46479
46732
|
path: ["site-user"],
|
|
46480
|
-
usage: USAGE$
|
|
46733
|
+
usage: USAGE$49
|
|
46481
46734
|
},
|
|
46482
46735
|
{
|
|
46483
46736
|
path: ["updates"],
|
|
46484
|
-
usage: USAGE$
|
|
46737
|
+
usage: USAGE$46
|
|
46485
46738
|
},
|
|
46486
46739
|
{
|
|
46487
46740
|
path: ["updates-pause"],
|
|
46488
|
-
usage: USAGE$
|
|
46741
|
+
usage: USAGE$46
|
|
46489
46742
|
},
|
|
46490
46743
|
{
|
|
46491
46744
|
path: ["updates-resume"],
|
|
46492
|
-
usage: USAGE$
|
|
46745
|
+
usage: USAGE$46
|
|
46493
46746
|
},
|
|
46494
46747
|
{
|
|
46495
46748
|
path: ["administrator"],
|
|
46496
|
-
usage: USAGE$
|
|
46749
|
+
usage: USAGE$56
|
|
46497
46750
|
},
|
|
46498
46751
|
{
|
|
46499
46752
|
path: ["administrator-reset"],
|
|
46500
|
-
usage: USAGE$
|
|
46753
|
+
usage: USAGE$56
|
|
46501
46754
|
},
|
|
46502
46755
|
{
|
|
46503
46756
|
path: ["administrator-reveal"],
|
|
46504
|
-
usage: USAGE$
|
|
46757
|
+
usage: USAGE$56
|
|
46505
46758
|
},
|
|
46506
46759
|
{
|
|
46507
46760
|
path: ["recovery-status"],
|
|
46508
|
-
usage: USAGE$
|
|
46761
|
+
usage: USAGE$56
|
|
46509
46762
|
},
|
|
46510
46763
|
{
|
|
46511
46764
|
path: ["recovery-retry"],
|
|
46512
|
-
usage: USAGE$
|
|
46765
|
+
usage: USAGE$56
|
|
46513
46766
|
},
|
|
46514
46767
|
{
|
|
46515
46768
|
path: ["recovery-cancel"],
|
|
46516
|
-
usage: USAGE$
|
|
46769
|
+
usage: USAGE$56
|
|
46517
46770
|
}
|
|
46518
46771
|
];
|
|
46519
46772
|
// src/commands/application-lifecycle.ts
|
|
@@ -47251,7 +47504,7 @@ var backupDestination = {
|
|
|
47251
47504
|
const [subcommand, ...rest] = context.positional;
|
|
47252
47505
|
const action = subcommand ?? "show";
|
|
47253
47506
|
if (action === "show") return await show$7(context, rest);
|
|
47254
|
-
if (action === "set") return await set$
|
|
47507
|
+
if (action === "set") return await set$3(context, rest);
|
|
47255
47508
|
if (action === "remove") return await remove$5(context, rest);
|
|
47256
47509
|
throw new UsageError(BACKUP_DESTINATION_USAGE);
|
|
47257
47510
|
},
|
|
@@ -47270,7 +47523,7 @@ async function show$7(context, rest) {
|
|
|
47270
47523
|
};
|
|
47271
47524
|
}
|
|
47272
47525
|
/** `set --endpoint … --bucket … --region … --access-key-id … --secret-key-file|stdin … [--prefix …] [--arm]`. */
|
|
47273
|
-
async function set$
|
|
47526
|
+
async function set$3(context, rest) {
|
|
47274
47527
|
noExtra$15(rest);
|
|
47275
47528
|
const company = await requireCompany(context.flags);
|
|
47276
47529
|
const endpoint = requiredFlag$4(context, "--endpoint", BACKUP_DESTINATION_USAGE);
|
|
@@ -56284,6 +56537,10 @@ var confirmHostingApplicationRecoveryRequestSchema = object({
|
|
|
56284
56537
|
}).optional()
|
|
56285
56538
|
})
|
|
56286
56539
|
}).describe("Confirming one application's reset or restore against the inventory that was reviewed.\n\n`confirmation` is the digest the review returned, and it is required rather than optional: it is\nwhat makes the confirmation an approval of an exact inventory instead of an approval of a label.\n`desiredGeneration` is the same idea at the environment level, so a request composed before\nanother change is a conflict rather than a reset of something else.\n\nThe reviewed figures travel as one typed `intake` object rather than flat fields, so the HTTP\nboundary and the domain contract cannot drift into two shapes with the same names. The intake\nitself is validated by the DTO's own types when it is hydrated.");
|
|
56540
|
+
var confirmHostingDatabaseImportRequestSchema = object({
|
|
56541
|
+
confirmation: string().min(64).max(64),
|
|
56542
|
+
desiredGeneration: int().min(0)
|
|
56543
|
+
}).describe("Confirming a reviewed database import: the `recovery.inventoryDigest` and `recovery.desiredGeneration` the review\nreturned. Everything about the backup itself is the platform's own record, so nothing else is accepted.");
|
|
56287
56544
|
var confirmHostingSshHostKeyRequestSchema = object({ fingerprint: string().max(120) }).describe("The fingerprint the client obtained independently for a source's server host key.\n\nIt is compared with the discovered value by the service, so only its shape belongs here. It is\nrequired rather than inferred: a confirmation that echoed what the platform already held would not\nbe a confirmation at all.");
|
|
56288
56545
|
var hostingStorageObjectEncryptionEnumSchema = _enum(["none", "sse_c"]);
|
|
56289
56546
|
var confirmHostingStorageAdoptionRequestSchema = object({
|
|
@@ -56437,6 +56694,7 @@ var hostingCertificateIssuerEnumSchema = _enum([
|
|
|
56437
56694
|
"letsencrypt-staging",
|
|
56438
56695
|
"zerossl"
|
|
56439
56696
|
]);
|
|
56697
|
+
var hostingEnvironmentModeEnumSchema = _enum(["live", "test"]);
|
|
56440
56698
|
var hostingVolumeEnumSchema = _enum([
|
|
56441
56699
|
"application-files",
|
|
56442
56700
|
"database-data",
|
|
@@ -56445,6 +56703,7 @@ var hostingVolumeEnumSchema = _enum([
|
|
|
56445
56703
|
var hostingWorkloadServerModeEnumSchema = _enum(["shared", "dedicated"]).describe("Whether a workload's database server is shared with the rest of its engine, or bought for it alone. An environment runs ONE server per engine, and every database of that engine binds to it. That is the purchase's shape: one server's memory and CPU serve every application on the engine. A second same-engine server splits that purchase between two Pods that each must still clear the engine's own floor — measured on Home 2026-10-19, where such a split left an engine 512Mi and it was OOM-killed on every boot. A second server is therefore a **client capability request** and never a side effect of declaring a workload. `DEDICATED` is that request: the workload pays its own floor out of the environment's budget, and the reconciler binds the databases to it by name rather than by engine. `SHARED` is every workload that did not ask. This is a named mode rather than a boolean because the same field may grow a third value (for example a replica-bearing server) without reinterpreting two call sites.\n| |\n|---|\n| `shared` <br/> The environment's existing server for this engine serves this workload's databases. |\n| `dedicated` <br/> The client asked for a server of this engine for this workload alone. |");
|
|
56446
56704
|
var createHostingEnvironmentRequestSchema = object({
|
|
56447
56705
|
certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
|
|
56706
|
+
mode: hostingEnvironmentModeEnumSchema.optional(),
|
|
56448
56707
|
storageSelections: array(object({
|
|
56449
56708
|
volumeType: hostingVolumeEnumSchema,
|
|
56450
56709
|
storageClassUuid: uuid().optional(),
|
|
@@ -57964,6 +58223,22 @@ var hostingApplicationImportDetectionDataSchema = object({
|
|
|
57964
58223
|
sourceUrl: string().nullable(),
|
|
57965
58224
|
prefixSource: string()
|
|
57966
58225
|
});
|
|
58226
|
+
var hostingApplicationImportReplacedDataSchema = object({
|
|
58227
|
+
importUuid: string(),
|
|
58228
|
+
stagedAt: string().nullable(),
|
|
58229
|
+
consumedAt: string().nullable(),
|
|
58230
|
+
fileCount: int().nullable(),
|
|
58231
|
+
databaseBytes: int().nullable(),
|
|
58232
|
+
sourceUrl: string().nullable()
|
|
58233
|
+
});
|
|
58234
|
+
var hostingApplicationImportFetchDataSchema = object({
|
|
58235
|
+
connectionUuid: string().nullable(),
|
|
58236
|
+
sourcePath: string().nullable(),
|
|
58237
|
+
databaseConnectionUuid: string().nullable(),
|
|
58238
|
+
archiveUrl: string().nullable(),
|
|
58239
|
+
replaces: union([hostingApplicationImportReplacedDataSchema, _null()]),
|
|
58240
|
+
jobAppliedAt: string().nullable()
|
|
58241
|
+
});
|
|
57967
58242
|
object({
|
|
57968
58243
|
uuid: string(),
|
|
57969
58244
|
status: string(),
|
|
@@ -57980,7 +58255,8 @@ object({
|
|
|
57980
58255
|
consumedAt: string().nullable(),
|
|
57981
58256
|
stagedAt: string().nullable(),
|
|
57982
58257
|
failedAt: string().nullable(),
|
|
57983
|
-
failureReason: string().nullable()
|
|
58258
|
+
failureReason: string().nullable(),
|
|
58259
|
+
fetch: union([hostingApplicationImportFetchDataSchema, _null()])
|
|
57984
58260
|
});
|
|
57985
58261
|
var hostingApplicationSummaryDataSchema = object({
|
|
57986
58262
|
uuid: string(),
|
|
@@ -58041,6 +58317,10 @@ var hostingWordpressUrlRepairDataSchema = object({
|
|
|
58041
58317
|
refreshNonce: string().nullable(),
|
|
58042
58318
|
omissions: array(string())
|
|
58043
58319
|
});
|
|
58320
|
+
var hostingRecoveryVerifiedSummaryDataSchema = object({
|
|
58321
|
+
tables: int(),
|
|
58322
|
+
rows: int()
|
|
58323
|
+
});
|
|
58044
58324
|
var hostingApplicationRecoveryDataSchema = object({
|
|
58045
58325
|
uuid: string(),
|
|
58046
58326
|
workloadUuid: string(),
|
|
@@ -58085,7 +58365,8 @@ var hostingApplicationRecoveryDataSchema = object({
|
|
|
58085
58365
|
releasedAt: string().nullable(),
|
|
58086
58366
|
cancelledAt: string().nullable(),
|
|
58087
58367
|
completedAt: string().nullable(),
|
|
58088
|
-
urlRepair: union([hostingWordpressUrlRepairDataSchema, _null()])
|
|
58368
|
+
urlRepair: union([hostingWordpressUrlRepairDataSchema, _null()]),
|
|
58369
|
+
verified: union([hostingRecoveryVerifiedSummaryDataSchema, _null()])
|
|
58089
58370
|
});
|
|
58090
58371
|
var hostingRecoveryCurrentDataDataSchema = object({
|
|
58091
58372
|
removePlugins: array(string()),
|
|
@@ -58138,7 +58419,9 @@ var hostingRestoreIntakeRequestDataSchema = object({
|
|
|
58138
58419
|
toolsLimitMib: int(),
|
|
58139
58420
|
activeRestores: int(),
|
|
58140
58421
|
importUuid: string().nullable(),
|
|
58141
|
-
currentDataInnoDb: union([hostingRecoveryCurrentDataDataSchema, _null()])
|
|
58422
|
+
currentDataInnoDb: union([hostingRecoveryCurrentDataDataSchema, _null()]),
|
|
58423
|
+
databaseExportUuid: string().nullable(),
|
|
58424
|
+
expectedTables: int().nullable()
|
|
58142
58425
|
});
|
|
58143
58426
|
var hostingRestoreCheckOutcomeEnumSchema = _enum([
|
|
58144
58427
|
"ok",
|
|
@@ -58169,7 +58452,7 @@ var hostingRestoreIntakeDataSchema = object({
|
|
|
58169
58452
|
checks: array(hostingRestoreIntakeCheckDataSchema),
|
|
58170
58453
|
phases: array(hostingRestoreIntakePhaseDataSchema)
|
|
58171
58454
|
});
|
|
58172
|
-
object({
|
|
58455
|
+
var hostingApplicationRecoveryReviewDataSchema = object({
|
|
58173
58456
|
environmentUuid: string(),
|
|
58174
58457
|
workloadUuid: string(),
|
|
58175
58458
|
label: string(),
|
|
@@ -59015,6 +59298,7 @@ object({
|
|
|
59015
59298
|
workloadUuid: string(),
|
|
59016
59299
|
audience: string()
|
|
59017
59300
|
});
|
|
59301
|
+
var hostingDataHandoverEnumSchema = _enum(["test_copy_is_current", "refreshed_from_source"]).describe("How the client says a tested copy relates to the site it was copied from, when it is made live (Plan 146). Going live is a configuration and traffic change, never a fresh restore over newer data, so the platform cannot know whether the original took orders, comments or sign-ups while the copy was tested. The client states it.\n| |\n|---|\n| `test_copy_is_current` <br/> The test copy holds everything that should go live; nothing the original took since the copy is needed. |\n| `refreshed_from_source` <br/> The original was restored into this test environment again, after writes stopped, just before going live. |");
|
|
59018
59302
|
object({
|
|
59019
59303
|
databaseUuid: string(),
|
|
59020
59304
|
workloadUuid: string().nullable().describe("The workload this identity belongs to, so a page can address one application's."),
|
|
@@ -59230,6 +59514,27 @@ var hostingDatabaseGrantDataSchema = object({
|
|
|
59230
59514
|
workloadUuid: string(),
|
|
59231
59515
|
application: string()
|
|
59232
59516
|
});
|
|
59517
|
+
object({
|
|
59518
|
+
exportUuid: string(),
|
|
59519
|
+
applicationUuid: string(),
|
|
59520
|
+
applicationName: string(),
|
|
59521
|
+
sourceEngine: string(),
|
|
59522
|
+
sourceVersion: string(),
|
|
59523
|
+
destinationEngine: string(),
|
|
59524
|
+
destinationVersion: string(),
|
|
59525
|
+
engineMatches: boolean(),
|
|
59526
|
+
sourceBytes: int(),
|
|
59527
|
+
backupBytes: int(),
|
|
59528
|
+
quotaBytes: int().nullable(),
|
|
59529
|
+
fitsQuota: boolean(),
|
|
59530
|
+
databaseName: string().nullable(),
|
|
59531
|
+
tables: array(string()),
|
|
59532
|
+
tableCount: int(),
|
|
59533
|
+
tablesTruncated: boolean(),
|
|
59534
|
+
replaces: string(),
|
|
59535
|
+
blockedReason: string().nullable(),
|
|
59536
|
+
recovery: hostingApplicationRecoveryReviewDataSchema
|
|
59537
|
+
});
|
|
59233
59538
|
var hostingDatabaseInputDataSchema = object({
|
|
59234
59539
|
application: string().nullable(),
|
|
59235
59540
|
server: string(),
|
|
@@ -59651,6 +59956,18 @@ var hostingToolSelectionDataSchema = object({
|
|
|
59651
59956
|
available: boolean(),
|
|
59652
59957
|
unavailableReason: string().nullable()
|
|
59653
59958
|
});
|
|
59959
|
+
var hostingEnvironmentProtectionDataSchema = object({
|
|
59960
|
+
mode: hostingEnvironmentModeEnumSchema,
|
|
59961
|
+
state: _enum([
|
|
59962
|
+
"live",
|
|
59963
|
+
"applying",
|
|
59964
|
+
"protected"
|
|
59965
|
+
]).describe("Whether a test environment's protection is in force (Plan 146). Computed from the environment's mode and its reconciled generations, never stored: `applying` is a test environment whose protection has been recorded but not yet observed ready, and nothing may be restored into it until it reads `protected`.\n").describe("Whether a test environment's protection is in force (Plan 146). Computed from the environment's mode and its reconciled generations, never stored: `applying` is a test environment whose protection has been recorded but not yet observed ready, and nothing may be restored into it until it reads `protected`.\n"),
|
|
59966
|
+
modeGeneration: int().describe("The desired generation that recorded the current mode; protection is observed once it reaches ready."),
|
|
59967
|
+
mailToolUrl: string().nullable().describe("The captured-mail tool's address on a test environment, null on a live one."),
|
|
59968
|
+
previewSignInRequired: boolean().describe("Whether a visitor must sign in before the preview serves; no-index alone is not access control."),
|
|
59969
|
+
limitations: array(string())
|
|
59970
|
+
});
|
|
59654
59971
|
var hostingEnvironmentDataSchema = object({
|
|
59655
59972
|
uuid: string(),
|
|
59656
59973
|
slug: string(),
|
|
@@ -59680,6 +59997,7 @@ var hostingEnvironmentDataSchema = object({
|
|
|
59680
59997
|
canRestoreTuning: boolean().describe("Whether the live runtime tuning differs from the tuning that last reached ready, so a failed\ntuning change can be rolled back. Computed by the tuning owner from the recorded snapshot."),
|
|
59681
59998
|
knownGoodTuningGeneration: int().nullable().describe("The generation the known-good tuning was observed at, or null when none is recorded."),
|
|
59682
59999
|
toolSelection: array(hostingToolSelectionDataSchema).describe("Every browser tool with the client's own on/off state, including the ones switched off."),
|
|
60000
|
+
protection: hostingEnvironmentProtectionDataSchema,
|
|
59683
60001
|
purchasePeriod: union([hostingPurchasePeriodDataSchema, _null()]),
|
|
59684
60002
|
allocationSummary: union([hostingAllocationSummaryDataSchema, _null()])
|
|
59685
60003
|
});
|
|
@@ -59703,6 +60021,21 @@ object({
|
|
|
59703
60021
|
entries: array(hostingEnvironmentLogEntryDataSchema),
|
|
59704
60022
|
detail: string()
|
|
59705
60023
|
});
|
|
60024
|
+
var hostingEnvironmentModeChangeDataSchema = object({
|
|
60025
|
+
area: string(),
|
|
60026
|
+
before: string(),
|
|
60027
|
+
after: string()
|
|
60028
|
+
});
|
|
60029
|
+
object({
|
|
60030
|
+
currentMode: hostingEnvironmentModeEnumSchema,
|
|
60031
|
+
targetMode: hostingEnvironmentModeEnumSchema,
|
|
60032
|
+
desiredGeneration: int(),
|
|
60033
|
+
blockedReason: string().nullable().describe("Null when the change may be confirmed now; otherwise why it may not."),
|
|
60034
|
+
dataHandoverRequired: boolean().describe("Whether the confirmation must state how the tested data relates to the original site."),
|
|
60035
|
+
changes: array(hostingEnvironmentModeChangeDataSchema),
|
|
60036
|
+
addresses: array(string()),
|
|
60037
|
+
warnings: array(string())
|
|
60038
|
+
});
|
|
59706
60039
|
var hostingEnvironmentPackageWorkloadDataSchema = object({
|
|
59707
60040
|
type: string(),
|
|
59708
60041
|
name: string(),
|
|
@@ -59730,7 +60063,8 @@ object({
|
|
|
59730
60063
|
cluster: hostingClusterDataSchema,
|
|
59731
60064
|
desiredGeneration: int(),
|
|
59732
60065
|
budget: hostingBudgetDataSchema,
|
|
59733
|
-
createdAt: string().nullable()
|
|
60066
|
+
createdAt: string().nullable(),
|
|
60067
|
+
mode: hostingEnvironmentModeEnumSchema
|
|
59734
60068
|
})),
|
|
59735
60069
|
meta: pageMetaDataSchema
|
|
59736
60070
|
});
|
|
@@ -60331,7 +60665,8 @@ var hostingProviderListingDataSchema = object({
|
|
|
60331
60665
|
entries: array(hostingProviderListingEntryDataSchema),
|
|
60332
60666
|
siteRoots: array(string()),
|
|
60333
60667
|
truncated: boolean(),
|
|
60334
|
-
database: union([hostingProviderDatabaseFactsDataSchema, _null()])
|
|
60668
|
+
database: union([hostingProviderDatabaseFactsDataSchema, _null()]),
|
|
60669
|
+
rsyncVersion: string().nullable()
|
|
60335
60670
|
});
|
|
60336
60671
|
var hostingProviderSiteDatabaseDataSchema = object({
|
|
60337
60672
|
application: string(),
|
|
@@ -60388,6 +60723,7 @@ object({
|
|
|
60388
60723
|
publicKey: string().nullable(),
|
|
60389
60724
|
pinnedHostKey: string().nullable(),
|
|
60390
60725
|
certificateHost: string().nullable(),
|
|
60726
|
+
sshConnectionUuid: string().nullable(),
|
|
60391
60727
|
connections: int(),
|
|
60392
60728
|
speedLimit: string().nullable(),
|
|
60393
60729
|
requestsPerSecond: int().nullable(),
|
|
@@ -62841,6 +63177,7 @@ var storeHostingProviderConnectionRequestSchema = object({
|
|
|
62841
63177
|
requestsPerSecond: int().min(1).max(20).nullish(),
|
|
62842
63178
|
retryWaitSeconds: int().min(1).max(600).nullish(),
|
|
62843
63179
|
hostImports: int().min(1).max(4).optional(),
|
|
63180
|
+
sshConnectionUuid: uuid().nullish().describe("\"Through SSH\": a database reached by running its client on the old server over this SFTP connection."),
|
|
62844
63181
|
certificateHost: string().max(253).regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*\.?$/).nullish()
|
|
62845
63182
|
}).describe("A new provider connection: protocol, address, account, start folder, sign-in and the old-host limits.\n\n`retention` defaults to `saved`; a `single-use` connection (a login entered for one run) carries no name.\nEvery field is checked here before any network call, so the wizard can tie an error to its field. A key\n(supplied or generated) is SFTP-only; a generated key carries no credential because Hosting makes it. The\nlimits are bounded to the same ranges as the table's check constraints.");
|
|
62846
63183
|
var storeHostingRegistryConnectionRequestSchema = object({
|
|
@@ -62953,6 +63290,12 @@ var storeHostingStorageObjectGrantRequestSchema = object({
|
|
|
62953
63290
|
key: string().max(1024).regex(/^[^\x00-\x1F\x7F]+$/),
|
|
62954
63291
|
direction: _enum(["download", "upload"])
|
|
62955
63292
|
}).describe("Asking for one short-lived signed URL for one object.\n\nThe direction decides the verb: a download signs a GET and an upload signs a PUT, so a browser or the CLI\ncan move the bytes itself. The key is the client's own path inside their bucket and is validated as a key,\nnot as a filesystem path — control characters are refused because they would break signing and logging.");
|
|
63293
|
+
var storeHostingWordpressImportFetchRequestSchema = object({
|
|
63294
|
+
connectionUuid: uuid().nullish(),
|
|
63295
|
+
sourcePath: string().max(1024).nullish(),
|
|
63296
|
+
archiveUrl: string().max(2048).nullish(),
|
|
63297
|
+
databaseConnectionUuid: uuid().nullish()
|
|
63298
|
+
}).describe("Where to fetch a WordPress site from: exactly one of a saved file connection or an HTTPS archive URL, plus the\ndatabase connection. Whether each connection is this company's, checked and of the right kind is the fetch\nowner's refusal, so the shape is all this states.");
|
|
62956
63299
|
var storeNativeHostingStorageBucketRequestSchema = object({
|
|
62957
63300
|
name: string().min(1).max(64).regex(/^[\pL\pN][\pL\pN ._-]*$/).describe("The client's own label, so they can tell two purchases apart."),
|
|
62958
63301
|
purchaseKey: uuid().nullish().describe("There is no token to replay, so the caller's own key is what makes a retry return the bucket it already\ncreated instead of buying a second one."),
|
|
@@ -62984,6 +63327,7 @@ var storePlatformCompanyRequestSchema = object({
|
|
|
62984
63327
|
}).describe("Create a client company for a named founding Company Admin.\n\nThe admin must already hold a verified account: staff create the account for\nthe client, and a company whose only administrator cannot sign in is a\nsupport ticket rather than a client. Validating it here means the failure is a\nfield error on the screen that caused it, not a half-made company.");
|
|
62985
63328
|
var storePlatformHostingEnvironmentRequestSchema = object({
|
|
62986
63329
|
certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
|
|
63330
|
+
mode: hostingEnvironmentModeEnumSchema.optional(),
|
|
62987
63331
|
storageSelections: array(object({
|
|
62988
63332
|
volumeType: hostingVolumeEnumSchema,
|
|
62989
63333
|
storageClassUuid: uuid().optional(),
|
|
@@ -63240,6 +63584,11 @@ var updateHostingComponentSettingsRequestSchema = object({
|
|
|
63240
63584
|
}).optional().describe("Only these four keys: a typo inside `auth` would otherwise be dropped and reported as saved.\nEach one is OPTIONAL and carries only what the caller changes: sending the values back unchanged would\nundo a concurrent change another operator made, which is why the merge happens server-side under the\nworkload's lock rather than in the client.")
|
|
63241
63585
|
}).describe("The settings one curated component instance should compose.\n\nA FormRequest rather than a bare array because that is what the generated contract can describe, and\nbecause the shape is part of the contract: a list of schema names or four typed auth values, not a\nsettings blob a client could fill with keys no composition reads. Which of the two a component owns, and\nwhether each schema name or OTP number is usable, is decided by the service that records them.\n\nA component serves schemas OR carries auth settings, never both, so naming both is refused here: the\nalternative is one write succeeding while the other is silently dropped.");
|
|
63242
63586
|
var updateHostingComponentVersionRequestSchema = object({ version: string().max(64).describe("Which versions this platform pins an image for is decided by the service, from the version catalogue, and\nrefused there by name. This only says the field must be a non-empty string.") }).describe("The version one curated component instance should run.\n\nA FormRequest rather than a bare array because that is what the generated contract can describe: a Spatie Data\nargument was accepted by the action but never appeared as a `requestBody`, so the published client had no body to send\nand the CLI could not call the endpoint at all. The rules live here so the documented contract and the accepted input\nare the same thing.");
|
|
63587
|
+
var updateHostingEnvironmentModeRequestSchema = object({
|
|
63588
|
+
mode: hostingEnvironmentModeEnumSchema,
|
|
63589
|
+
desiredGeneration: int().min(1),
|
|
63590
|
+
dataHandover: union([hostingDataHandoverEnumSchema, _null()]).optional()
|
|
63591
|
+
}).describe("Making a test environment live, or returning a live one to test protection (Plan 146).\n\n`desiredGeneration` is the generation the client reviewed: a change since then refuses the confirmation, so the\nclient reviews again. Going live also needs the stated data handover.");
|
|
63243
63592
|
var updateHostingEnvironmentRequestSchema = object({
|
|
63244
63593
|
certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
|
|
63245
63594
|
desiredGeneration: int().min(1),
|
|
@@ -63323,6 +63672,7 @@ var updateHostingProviderConnectionRequestSchema = object({
|
|
|
63323
63672
|
requestsPerSecond: int().min(1).max(20).nullish(),
|
|
63324
63673
|
retryWaitSeconds: int().min(1).max(600).nullish(),
|
|
63325
63674
|
hostImports: int().min(1).max(4).optional(),
|
|
63675
|
+
sshConnectionUuid: uuid().nullish().describe("\"Through SSH\": a database reached by running its client on the old server over this SFTP connection."),
|
|
63326
63676
|
certificateHost: string().max(253).regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*\.?$/).nullish()
|
|
63327
63677
|
}).describe("A change to a provider connection, submitted as the whole definition again.\n\n`credential` is optional: omitting it keeps the stored secret, sending one replaces it. Changing the sign-in\ntype needs a new credential, except to a generated key, which Hosting makes. Any change to what is connected\nto clears the verified state; the service decides that by comparing with what is stored.");
|
|
63328
63678
|
var updateHostingRegistryConnectionRequestSchema = object({
|
|
@@ -66131,6 +66481,32 @@ object({
|
|
|
66131
66481
|
environmentUuid: string(),
|
|
66132
66482
|
exportUuid: string()
|
|
66133
66483
|
});
|
|
66484
|
+
union([
|
|
66485
|
+
object({ message: string().describe("Error overview.") }),
|
|
66486
|
+
object({ message: string().describe("Error overview.") }),
|
|
66487
|
+
messageDataSchema,
|
|
66488
|
+
validationErrorDataSchema
|
|
66489
|
+
]);
|
|
66490
|
+
object({
|
|
66491
|
+
company: string(),
|
|
66492
|
+
environmentUuid: string(),
|
|
66493
|
+
exportUuid: string(),
|
|
66494
|
+
workloadUuid: string()
|
|
66495
|
+
});
|
|
66496
|
+
union([
|
|
66497
|
+
object({ message: string().describe("Error overview.") }),
|
|
66498
|
+
object({ message: string().describe("Error overview.") }),
|
|
66499
|
+
messageDataSchema,
|
|
66500
|
+
messageDataSchema,
|
|
66501
|
+
validationErrorDataSchema
|
|
66502
|
+
]);
|
|
66503
|
+
confirmHostingDatabaseImportRequestSchema.describe("Confirming a reviewed database import: the `recovery.inventoryDigest` and `recovery.desiredGeneration` the review\nreturned. Everything about the backup itself is the platform's own record, so nothing else is accepted.");
|
|
66504
|
+
object({
|
|
66505
|
+
company: string(),
|
|
66506
|
+
environmentUuid: string(),
|
|
66507
|
+
exportUuid: string(),
|
|
66508
|
+
workloadUuid: string()
|
|
66509
|
+
});
|
|
66134
66510
|
union([
|
|
66135
66511
|
object({ message: string().describe("Error overview.") }),
|
|
66136
66512
|
object({ message: string().describe("Error overview.") }),
|
|
@@ -66385,6 +66761,31 @@ object({
|
|
|
66385
66761
|
company: string(),
|
|
66386
66762
|
environmentUuid: string()
|
|
66387
66763
|
});
|
|
66764
|
+
string().describe("The mode to review a change to: `live` or `test`.");
|
|
66765
|
+
union([
|
|
66766
|
+
object({ message: string().describe("Error overview.") }),
|
|
66767
|
+
object({ message: string().describe("Error overview.") }),
|
|
66768
|
+
object({
|
|
66769
|
+
message: string().describe("Errors overview."),
|
|
66770
|
+
errors: record$4(string(), array(string())).describe("A detailed description of each field that failed validation.")
|
|
66771
|
+
})
|
|
66772
|
+
]);
|
|
66773
|
+
object({
|
|
66774
|
+
company: string(),
|
|
66775
|
+
environmentUuid: string()
|
|
66776
|
+
});
|
|
66777
|
+
object({ mode: string().describe("The mode to review a change to: `live` or `test`.") });
|
|
66778
|
+
union([
|
|
66779
|
+
object({ message: string().describe("Error overview.") }),
|
|
66780
|
+
object({ message: string().describe("Error overview.") }),
|
|
66781
|
+
messageDataSchema,
|
|
66782
|
+
messageDataSchema
|
|
66783
|
+
]);
|
|
66784
|
+
updateHostingEnvironmentModeRequestSchema.describe("Making a test environment live, or returning a live one to test protection (Plan 146).\n\n`desiredGeneration` is the generation the client reviewed: a change since then refuses the confirmation, so the\nclient reviews again. Going live also needs the stated data handover.");
|
|
66785
|
+
object({
|
|
66786
|
+
company: string(),
|
|
66787
|
+
environmentUuid: string()
|
|
66788
|
+
});
|
|
66388
66789
|
union([
|
|
66389
66790
|
object({ message: string().describe("Error overview.") }),
|
|
66390
66791
|
object({ message: string().describe("Error overview.") }),
|
|
@@ -68337,6 +68738,29 @@ object({
|
|
|
68337
68738
|
environmentUuid: string(),
|
|
68338
68739
|
workloadUuid: string()
|
|
68339
68740
|
});
|
|
68741
|
+
union([
|
|
68742
|
+
object({ message: string().describe("Error overview.") }),
|
|
68743
|
+
object({ message: string().describe("Error overview.") }),
|
|
68744
|
+
messageDataSchema,
|
|
68745
|
+
validationErrorDataSchema
|
|
68746
|
+
]);
|
|
68747
|
+
storeHostingWordpressImportFetchRequestSchema.optional().describe("Where to fetch a WordPress site from: exactly one of a saved file connection or an HTTPS archive URL, plus the\ndatabase connection. Whether each connection is this company's, checked and of the right kind is the fetch\nowner's refusal, so the shape is all this states.");
|
|
68748
|
+
object({
|
|
68749
|
+
company: string(),
|
|
68750
|
+
environmentUuid: string(),
|
|
68751
|
+
workloadUuid: string()
|
|
68752
|
+
});
|
|
68753
|
+
union([
|
|
68754
|
+
object({ message: string().describe("Error overview.") }),
|
|
68755
|
+
object({ message: string().describe("Error overview.") }),
|
|
68756
|
+
messageDataSchema,
|
|
68757
|
+
validationErrorDataSchema
|
|
68758
|
+
]);
|
|
68759
|
+
object({
|
|
68760
|
+
company: string(),
|
|
68761
|
+
environmentUuid: string(),
|
|
68762
|
+
workloadUuid: string()
|
|
68763
|
+
});
|
|
68340
68764
|
var hostingWordpressUrlRepairPreviewStatus200Schema = hostingApplicationRecoveryDataSchema;
|
|
68341
68765
|
var hostingWordpressUrlRepairPreviewStatus201Schema = hostingApplicationRecoveryDataSchema;
|
|
68342
68766
|
var hostingWordpressUrlRepairPreviewStatus401Schema = object({ message: string().describe("Error overview.") });
|
|
@@ -71377,7 +71801,7 @@ function episode(rest) {
|
|
|
71377
71801
|
};
|
|
71378
71802
|
}
|
|
71379
71803
|
// src/commands/company-assets.ts
|
|
71380
|
-
var USAGE$
|
|
71804
|
+
var USAGE$45 = [
|
|
71381
71805
|
"Usage: hostingctl company logo|favicon set --image-file <path> --company <slug>",
|
|
71382
71806
|
" hostingctl company logo|favicon remove --company <slug>",
|
|
71383
71807
|
"",
|
|
@@ -71392,17 +71816,17 @@ var USAGE$44 = [
|
|
|
71392
71816
|
*/
|
|
71393
71817
|
async function companyAssets(context, asset, rest) {
|
|
71394
71818
|
const [action, ...tail] = rest;
|
|
71395
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
71819
|
+
if (tail.length > 0) throw new UsageError(USAGE$45);
|
|
71396
71820
|
const company = await requireCompany(context.flags);
|
|
71397
|
-
if (action === "set") return await set$
|
|
71821
|
+
if (action === "set") return await set$2(context, asset, company);
|
|
71398
71822
|
if (action === "remove") return await remove$4(context, asset, company);
|
|
71399
|
-
throw new UsageError(USAGE$
|
|
71823
|
+
throw new UsageError(USAGE$45);
|
|
71400
71824
|
}
|
|
71401
71825
|
/** `set --image-file …`: one multipart upload of the asset. */
|
|
71402
|
-
async function set$
|
|
71826
|
+
async function set$2(context, asset, company) {
|
|
71403
71827
|
const file = context.flags.get("--image-file") ?? "";
|
|
71404
71828
|
return await confirmableWrite(context, file === "" ? `Set ${company}'s ${asset}.` : `Set ${company}'s ${asset} to ${file}.`, async () => {
|
|
71405
|
-
const body = await imageUpload(file, USAGE$
|
|
71829
|
+
const body = await imageUpload(file, USAGE$45);
|
|
71406
71830
|
return asset === "logo" ? (await companyAssetStoreLogo({
|
|
71407
71831
|
path: { company },
|
|
71408
71832
|
body
|
|
@@ -71438,7 +71862,7 @@ function companyRole(raw, usage) {
|
|
|
71438
71862
|
return named;
|
|
71439
71863
|
}
|
|
71440
71864
|
// src/commands/company-invitations.ts
|
|
71441
|
-
var USAGE$
|
|
71865
|
+
var USAGE$44 = [
|
|
71442
71866
|
"Usage: hostingctl company invitations --company <slug>",
|
|
71443
71867
|
" hostingctl company invite --company <slug> --email <email> --name <name> --role <admin|member>",
|
|
71444
71868
|
" hostingctl company cancel-invitation <invitation-uuid> --company <slug>",
|
|
@@ -71462,7 +71886,7 @@ var MAX_INVITATION_TOKEN_BYTES = 4096;
|
|
|
71462
71886
|
*/
|
|
71463
71887
|
async function companyInvitations(context, subcommand, rest) {
|
|
71464
71888
|
if (subcommand === "invitations") {
|
|
71465
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
71889
|
+
if (rest.length > 0) throw new UsageError(USAGE$44);
|
|
71466
71890
|
const company = await requireCompany(context.flags);
|
|
71467
71891
|
return {
|
|
71468
71892
|
kind: "invitations",
|
|
@@ -71473,20 +71897,20 @@ async function companyInvitations(context, subcommand, rest) {
|
|
|
71473
71897
|
if (subcommand === "invite") return await invite(context, rest);
|
|
71474
71898
|
if (subcommand === "cancel-invitation") return await cancel$1(context, rest);
|
|
71475
71899
|
if (subcommand === "invitation-preview") return (await companyInvitationPreview({
|
|
71476
|
-
path: { invitationUuid: oneUuid$7(rest, USAGE$
|
|
71477
|
-
body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$
|
|
71900
|
+
path: { invitationUuid: oneUuid$7(rest, USAGE$44) },
|
|
71901
|
+
body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$44) }
|
|
71478
71902
|
})).data;
|
|
71479
71903
|
if (subcommand === "invitation-accept") return await accept(context, rest);
|
|
71480
|
-
throw new UsageError(USAGE$
|
|
71904
|
+
throw new UsageError(USAGE$44);
|
|
71481
71905
|
}
|
|
71482
71906
|
/** `invite --email … --name … --role …`. */
|
|
71483
71907
|
async function invite(context, rest) {
|
|
71484
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
71908
|
+
if (rest.length > 0) throw new UsageError(USAGE$44);
|
|
71485
71909
|
const company = await requireCompany(context.flags);
|
|
71486
71910
|
const email = context.flags.get("--email")?.trim() ?? "";
|
|
71487
71911
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
71488
|
-
const role = companyRole(context.flags.get("--role"), USAGE$
|
|
71489
|
-
if (email === "" || name === "") throw new UsageError(`invite needs --email and --name.\n\n${USAGE$
|
|
71912
|
+
const role = companyRole(context.flags.get("--role"), USAGE$44);
|
|
71913
|
+
if (email === "" || name === "") throw new UsageError(`invite needs --email and --name.\n\n${USAGE$44}`);
|
|
71490
71914
|
return await confirmableWrite(context, `Invite ${name} <${email}> into ${company} as ${role}.`, async () => (await companyInvitationStore({
|
|
71491
71915
|
path: { company },
|
|
71492
71916
|
body: {
|
|
@@ -71498,7 +71922,7 @@ async function invite(context, rest) {
|
|
|
71498
71922
|
}
|
|
71499
71923
|
/** `cancel-invitation <uuid> --company …`. */
|
|
71500
71924
|
async function cancel$1(context, rest) {
|
|
71501
|
-
const invitationUuid = oneUuid$7(rest, USAGE$
|
|
71925
|
+
const invitationUuid = oneUuid$7(rest, USAGE$44);
|
|
71502
71926
|
const company = await requireCompany(context.flags);
|
|
71503
71927
|
return await confirmableWrite(context, `Cancel invitation ${invitationUuid}.`, async () => {
|
|
71504
71928
|
return (await companyInvitationDestroy({ path: {
|
|
@@ -71509,11 +71933,11 @@ async function cancel$1(context, rest) {
|
|
|
71509
71933
|
}
|
|
71510
71934
|
/** `invitation-accept <uuid>`: join the company the invitation names. */
|
|
71511
71935
|
async function accept(context, rest) {
|
|
71512
|
-
const invitationUuid = oneUuid$7(rest, USAGE$
|
|
71936
|
+
const invitationUuid = oneUuid$7(rest, USAGE$44);
|
|
71513
71937
|
return await confirmableWrite(context, `Accept invitation ${invitationUuid}.`, async () => {
|
|
71514
71938
|
return (await companyInvitationAccept({
|
|
71515
71939
|
path: { invitationUuid },
|
|
71516
|
-
body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$
|
|
71940
|
+
body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$44) }
|
|
71517
71941
|
})).data;
|
|
71518
71942
|
});
|
|
71519
71943
|
}
|
|
@@ -71632,31 +72056,31 @@ var COMPANY_TOPICS = [
|
|
|
71632
72056
|
},
|
|
71633
72057
|
{
|
|
71634
72058
|
path: ["logo"],
|
|
71635
|
-
usage: USAGE$
|
|
72059
|
+
usage: USAGE$45
|
|
71636
72060
|
},
|
|
71637
72061
|
{
|
|
71638
72062
|
path: ["favicon"],
|
|
71639
|
-
usage: USAGE$
|
|
72063
|
+
usage: USAGE$45
|
|
71640
72064
|
},
|
|
71641
72065
|
{
|
|
71642
72066
|
path: ["invitations"],
|
|
71643
|
-
usage: USAGE$
|
|
72067
|
+
usage: USAGE$44
|
|
71644
72068
|
},
|
|
71645
72069
|
{
|
|
71646
72070
|
path: ["invite"],
|
|
71647
|
-
usage: USAGE$
|
|
72071
|
+
usage: USAGE$44
|
|
71648
72072
|
},
|
|
71649
72073
|
{
|
|
71650
72074
|
path: ["cancel-invitation"],
|
|
71651
|
-
usage: USAGE$
|
|
72075
|
+
usage: USAGE$44
|
|
71652
72076
|
},
|
|
71653
72077
|
{
|
|
71654
72078
|
path: ["invitation-preview"],
|
|
71655
|
-
usage: USAGE$
|
|
72079
|
+
usage: USAGE$44
|
|
71656
72080
|
},
|
|
71657
72081
|
{
|
|
71658
72082
|
path: ["invitation-accept"],
|
|
71659
|
-
usage: USAGE$
|
|
72083
|
+
usage: USAGE$44
|
|
71660
72084
|
}
|
|
71661
72085
|
];
|
|
71662
72086
|
// src/commands/company-text.ts
|
|
@@ -72791,81 +73215,6 @@ function workloadPair(rest) {
|
|
|
72791
73215
|
workloadUuid
|
|
72792
73216
|
};
|
|
72793
73217
|
}
|
|
72794
|
-
// src/commands/dev-metadata.ts
|
|
72795
|
-
/** `hostingctl dev`: Plan 43's local copy of one WordPress site, from `files pull` and a Plan 63 database export. */
|
|
72796
|
-
var DEV_USAGE = [
|
|
72797
|
-
"Usage: hostingctl dev prepare <folder> --company <slug> --environment <uuid> --database <uuid> --from <env-path>",
|
|
72798
|
-
" --user <login> [sign-in] (--dry-run | --confirm)",
|
|
72799
|
-
" hostingctl dev start [<folder>]",
|
|
72800
|
-
" hostingctl dev status [<folder>]",
|
|
72801
|
-
" hostingctl dev stop [<folder>]",
|
|
72802
|
-
" hostingctl dev refresh [<folder>] --user <login> [sign-in] (--dry-run | --confirm)",
|
|
72803
|
-
" hostingctl dev delete [<folder>] (--dry-run | --confirm)",
|
|
72804
|
-
" Sign in as for files pull: --key-file <path>, --password-stdin or --password-file <path>; with none, the SSH agent.",
|
|
72805
|
-
"",
|
|
72806
|
-
" prepare Make a new folder with the site's files (files pull of --from, the WordPress folder such as",
|
|
72807
|
-
" /wordpress), a fresh export of its database, a local wp-config.php and a Compose file.",
|
|
72808
|
-
" start Run it with Docker on this computer: the site and Mailpit on 127.0.0.1 only. The first start",
|
|
72809
|
-
" imports the database and replaces the site's address with the local one.",
|
|
72810
|
-
" status Where it came from, when the files and the database were taken, and what is running.",
|
|
72811
|
-
" stop Stop it; files and database stay.",
|
|
72812
|
-
" refresh Prepare a new copy beside it with newer files and a fresh database, then swap it in. The old copy",
|
|
72813
|
-
" is kept as <folder>.previous-<time>; a failed refresh leaves the working copy as it was.",
|
|
72814
|
-
" delete Stop it and remove the folder and its database.",
|
|
72815
|
-
"",
|
|
72816
|
-
"The folder defaults to the current one. The copy is unsanitized: it is your own data, so keep it private.",
|
|
72817
|
-
"Its database is never pushed back. Exit 0 done, 1 refused, 2 not run (also when Docker is missing)."
|
|
72818
|
-
].join("\n");
|
|
72819
|
-
var DEV_METADATA = {
|
|
72820
|
-
name: "dev",
|
|
72821
|
-
summary: "A local copy of one WordPress site with its database, run with Docker.",
|
|
72822
|
-
usage: DEV_USAGE,
|
|
72823
|
-
flags: [
|
|
72824
|
-
{
|
|
72825
|
-
name: "--environment",
|
|
72826
|
-
takesValue: true,
|
|
72827
|
-
description: "prepare: the environment the site runs in."
|
|
72828
|
-
},
|
|
72829
|
-
{
|
|
72830
|
-
name: "--database",
|
|
72831
|
-
takesValue: true,
|
|
72832
|
-
description: "prepare: the site's database to export."
|
|
72833
|
-
},
|
|
72834
|
-
{
|
|
72835
|
-
name: "--from",
|
|
72836
|
-
takesValue: true,
|
|
72837
|
-
description: "prepare: the site's folder in the environment (env:/path), such as env:/wordpress."
|
|
72838
|
-
},
|
|
72839
|
-
{
|
|
72840
|
-
name: "--user",
|
|
72841
|
-
takesValue: true,
|
|
72842
|
-
description: "The environment's SFTP login the files are pulled with."
|
|
72843
|
-
},
|
|
72844
|
-
{
|
|
72845
|
-
name: "--key-file",
|
|
72846
|
-
takesValue: true,
|
|
72847
|
-
description: "Sign in with the private key in this file."
|
|
72848
|
-
},
|
|
72849
|
-
{
|
|
72850
|
-
name: "--password-stdin",
|
|
72851
|
-
takesValue: false,
|
|
72852
|
-
description: "Read the login's password, or the key's passphrase, from standard input."
|
|
72853
|
-
},
|
|
72854
|
-
{
|
|
72855
|
-
name: "--password-file",
|
|
72856
|
-
takesValue: true,
|
|
72857
|
-
description: "Read the login's password, or the key's passphrase, from a private file (mode 600)."
|
|
72858
|
-
}
|
|
72859
|
-
],
|
|
72860
|
-
subcommands: [
|
|
72861
|
-
"prepare",
|
|
72862
|
-
"start",
|
|
72863
|
-
"status",
|
|
72864
|
-
"stop",
|
|
72865
|
-
"refresh",
|
|
72866
|
-
"delete"
|
|
72867
|
-
]
|
|
72868
|
-
};
|
|
72869
73218
|
// src/commands/dev-database.ts
|
|
72870
73219
|
/** How often, and for how long, `dev prepare` waits for the export it asked for. */
|
|
72871
73220
|
var EXPORT_POLL_MS = 5e3;
|
|
@@ -72949,7 +73298,7 @@ var FILES_LOCAL_USAGE = [
|
|
|
72949
73298
|
" hostingctl files push <local-folder> <env-path> --environment <uuid> --user <login>",
|
|
72950
73299
|
" [--delete [--max-delete <n>]] [--with-wp-config] (--preview | --dry-run | --confirm)",
|
|
72951
73300
|
" hostingctl files sync <env-path> <local-folder> --two-way --environment <uuid> --user <login>",
|
|
72952
|
-
" [--max-delete-percent <n>] [--resync] [--with-wp-config] (--dry-run | --confirm)",
|
|
73301
|
+
" [--max-delete-percent <n>] [--resync] [--with-wp-config] (--preview | --dry-run | --confirm)",
|
|
72953
73302
|
" hostingctl files mount <env-path> <mountpoint> --environment <uuid> --user <login>",
|
|
72954
73303
|
" hostingctl files connect --environment <uuid> --user <login> [--key-file <path>]",
|
|
72955
73304
|
" Sign in with --key-file <path> (its passphrase, if any, from --password-stdin or --password-file),",
|
|
@@ -72976,7 +73325,8 @@ var FILES_LOCAL_USAGE = [
|
|
|
72976
73325
|
" never prints a password.",
|
|
72977
73326
|
"",
|
|
72978
73327
|
"Environment paths start at the login's home (/srv, where the application trees are); / is that folder.",
|
|
72979
|
-
"--preview lists what a pull or
|
|
73328
|
+
"--preview lists what a pull, push or sync would add, update and delete and changes nothing (a sync names the",
|
|
73329
|
+
"side each change was made on); --dry-run says what",
|
|
72980
73330
|
"the command would do and contacts nothing; --confirm does it. A deleting pull or push previews first and",
|
|
72981
73331
|
"refuses more than --max-delete deletions (default 100). Any failed transfer cancels the deletions.",
|
|
72982
73332
|
"pull, push and sync leave out .git, wp-content/cache and .hostingctl; push and sync leave wp-config.php alone",
|
|
@@ -73009,7 +73359,7 @@ var FILES_LOCAL_FLAGS = [
|
|
|
73009
73359
|
{
|
|
73010
73360
|
name: "--preview",
|
|
73011
73361
|
takesValue: false,
|
|
73012
|
-
description: "pull/push: list what would be added, updated and deleted, and change nothing."
|
|
73362
|
+
description: "pull/push/sync: list what would be added, updated and deleted, and change nothing."
|
|
73013
73363
|
},
|
|
73014
73364
|
{
|
|
73015
73365
|
name: "--with-wp-config",
|
|
@@ -73140,9 +73490,9 @@ function mountArguments(remote, mountpoint) {
|
|
|
73140
73490
|
"30s"
|
|
73141
73491
|
];
|
|
73142
73492
|
}
|
|
73143
|
-
/** Whether
|
|
73144
|
-
function
|
|
73145
|
-
return args.includes("--dry-run");
|
|
73493
|
+
/** Whether a run prints no progress: a dry run only looks, and a mount's stats are not a transfer. */
|
|
73494
|
+
function isQuiet(args) {
|
|
73495
|
+
return args.includes("--dry-run") || args[0] === "mount";
|
|
73146
73496
|
}
|
|
73147
73497
|
function filters(rules) {
|
|
73148
73498
|
return rules.flatMap((rule) => ["--filter", rule]);
|
|
@@ -73473,6 +73823,8 @@ var COMMON_ARGUMENTS = [
|
|
|
73473
73823
|
"--timeout",
|
|
73474
73824
|
"60s"
|
|
73475
73825
|
];
|
|
73826
|
+
/** At most this many bisync notices are kept. */
|
|
73827
|
+
var NOTICE_LIMIT = 1e4;
|
|
73476
73828
|
/** At most this many failed names are kept. */
|
|
73477
73829
|
var FAILED_LIMIT = 100;
|
|
73478
73830
|
/** How long rclone gets to stop on its own after Ctrl-C before it is killed. */
|
|
@@ -73508,7 +73860,8 @@ async function runEngine(program, args, env, options = {}) {
|
|
|
73508
73860
|
stdout: "",
|
|
73509
73861
|
stats: null,
|
|
73510
73862
|
failed: [],
|
|
73511
|
-
lastError: null
|
|
73863
|
+
lastError: null,
|
|
73864
|
+
notices: []
|
|
73512
73865
|
};
|
|
73513
73866
|
const windows = process.platform === "win32";
|
|
73514
73867
|
const child = spawn(program, [...COMMON_ARGUMENTS, ...args], {
|
|
@@ -73560,21 +73913,22 @@ function readLog(lines) {
|
|
|
73560
73913
|
let stats = null;
|
|
73561
73914
|
const failed = /* @__PURE__ */ new Set();
|
|
73562
73915
|
let lastError = null;
|
|
73916
|
+
const notices = [];
|
|
73563
73917
|
for (const line of lines) {
|
|
73564
73918
|
stats = statsOf(line) ?? stats;
|
|
73565
73919
|
const entry = parsed$1(line);
|
|
73920
|
+
const notice = bisyncNotice(entry);
|
|
73921
|
+
if (notice !== null && notices.length < NOTICE_LIMIT) notices.push(notice);
|
|
73566
73922
|
if (entry === null || entry.level !== "error" && entry.level !== "critical") continue;
|
|
73567
73923
|
if (typeof entry.msg === "string") lastError = entry.msg.slice(0, 500);
|
|
73568
|
-
const object = entry
|
|
73569
|
-
|
|
73570
|
-
if (typeof object === "string" && object !== "" && typeof type === "string" && type.endsWith(".Object")) {
|
|
73571
|
-
if (failed.size < FAILED_LIMIT) failed.add(object);
|
|
73572
|
-
}
|
|
73924
|
+
const object = failedObject(entry);
|
|
73925
|
+
if (object !== null && failed.size < FAILED_LIMIT) failed.add(object);
|
|
73573
73926
|
}
|
|
73574
73927
|
return {
|
|
73575
73928
|
stats,
|
|
73576
73929
|
failed: [...failed],
|
|
73577
|
-
lastError
|
|
73930
|
+
lastError,
|
|
73931
|
+
notices
|
|
73578
73932
|
};
|
|
73579
73933
|
}
|
|
73580
73934
|
/** The outcome a run's status, stats and last error amount to. */
|
|
@@ -73596,6 +73950,17 @@ async function obscure(program, password, env) {
|
|
|
73596
73950
|
if (run.status !== 0 || value === "") throw new Error("The copy engine could not prepare the password.");
|
|
73597
73951
|
return value;
|
|
73598
73952
|
}
|
|
73953
|
+
/** The object an error names, when it names one. */
|
|
73954
|
+
function failedObject(entry) {
|
|
73955
|
+
const object = entry.object;
|
|
73956
|
+
const type = entry.objectType;
|
|
73957
|
+
return typeof object === "string" && object !== "" && typeof type === "string" && type.endsWith(".Object") ? object : null;
|
|
73958
|
+
}
|
|
73959
|
+
/** A bisync per-file notice (`- Path1 …`), or null for every other log line. */
|
|
73960
|
+
function bisyncNotice(entry) {
|
|
73961
|
+
const said = entry?.msg;
|
|
73962
|
+
return entry?.level === "notice" && typeof said === "string" && said.startsWith("- Path") ? said : null;
|
|
73963
|
+
}
|
|
73599
73964
|
function parsed$1(line) {
|
|
73600
73965
|
const trimmed = line.trim();
|
|
73601
73966
|
if (!trimmed.startsWith("{")) return null;
|
|
@@ -73731,7 +74096,7 @@ async function openSession(context, command) {
|
|
|
73731
74096
|
return {
|
|
73732
74097
|
program,
|
|
73733
74098
|
env,
|
|
73734
|
-
run: async (args) => await runEngine(program, args, env, { onStats: watched && !
|
|
74099
|
+
run: async (args) => await runEngine(program, args, env, { onStats: watched && !isQuiet(args) ? progressLines() : void 0 })
|
|
73735
74100
|
};
|
|
73736
74101
|
}
|
|
73737
74102
|
/** One progress line on stderr per stats line, with the predicted finish, for a person watching a long transfer. */
|
|
@@ -74249,7 +74614,7 @@ var diagnostics = {
|
|
|
74249
74614
|
}
|
|
74250
74615
|
};
|
|
74251
74616
|
// src/commands/dns-records.ts
|
|
74252
|
-
var USAGE$
|
|
74617
|
+
var USAGE$43 = [
|
|
74253
74618
|
"Usage: hostingctl dns enable <domain-uuid> --company <slug>",
|
|
74254
74619
|
" hostingctl dns record set <domain-uuid> --company <slug> --file <set.json>",
|
|
74255
74620
|
" hostingctl dns record remove <domain-uuid> --company <slug> --name <relative> --type <type>",
|
|
@@ -74288,7 +74653,7 @@ async function dnsWrites(context, subcommand, rest) {
|
|
|
74288
74653
|
if (subcommand === "record") return await record$3(context, rest);
|
|
74289
74654
|
if (subcommand === "dnssec") return await changeDnssec(context, rest);
|
|
74290
74655
|
if (subcommand === "handover") return await handover(context, rest);
|
|
74291
|
-
throw new UsageError(USAGE$
|
|
74656
|
+
throw new UsageError(USAGE$43);
|
|
74292
74657
|
}
|
|
74293
74658
|
/** The zone's current desired generation, which every write must name. */
|
|
74294
74659
|
async function generation(company, domainUuid) {
|
|
@@ -74299,7 +74664,7 @@ async function generation(company, domainUuid) {
|
|
|
74299
74664
|
}
|
|
74300
74665
|
/** `dns enable <uuid>`: take the zone over into managed DNS. */
|
|
74301
74666
|
async function enable(context, rest) {
|
|
74302
|
-
const domainUuid = oneUuid$7(rest, USAGE$
|
|
74667
|
+
const domainUuid = oneUuid$7(rest, USAGE$43);
|
|
74303
74668
|
const company = await requireCompany(context.flags);
|
|
74304
74669
|
return await confirmableWrite(context, "Publish this name's zone in managed DNS.", async () => (await domainsDnsStore({ path: {
|
|
74305
74670
|
company,
|
|
@@ -74309,16 +74674,16 @@ async function enable(context, rest) {
|
|
|
74309
74674
|
/** `dns record set|remove`. */
|
|
74310
74675
|
async function record$3(context, rest) {
|
|
74311
74676
|
const [action, ...tail] = rest;
|
|
74312
|
-
const domainUuid = oneUuid$7(tail, USAGE$
|
|
74677
|
+
const domainUuid = oneUuid$7(tail, USAGE$43);
|
|
74313
74678
|
const company = await requireCompany(context.flags);
|
|
74314
74679
|
if (action === "set") return await setRecord(context, company, domainUuid);
|
|
74315
74680
|
if (action === "remove") return await removeRecord(context, company, domainUuid);
|
|
74316
|
-
throw new UsageError(USAGE$
|
|
74681
|
+
throw new UsageError(USAGE$43);
|
|
74317
74682
|
}
|
|
74318
74683
|
/** `record set --file`: replace one set with the file's own values. */
|
|
74319
74684
|
async function setRecord(context, company, domainUuid) {
|
|
74320
74685
|
const file = context.flags.get("--file") ?? "";
|
|
74321
|
-
if (file === "") throw new UsageError(`record set needs --file <set.json>.\n\n${USAGE$
|
|
74686
|
+
if (file === "") throw new UsageError(`record set needs --file <set.json>.\n\n${USAGE$43}`);
|
|
74322
74687
|
const set = recordSetFromFile(file);
|
|
74323
74688
|
return await confirmableWrite(context, [`Replace the ${set.recordType.toUpperCase()} set "${set.relativeName}" (ttl ${String(set.ttlSeconds)}) with:`, ...set.values.map((one) => ` ${one}`)].join("\n"), async () => {
|
|
74324
74689
|
const body = {
|
|
@@ -74338,7 +74703,7 @@ async function setRecord(context, company, domainUuid) {
|
|
|
74338
74703
|
async function removeRecord(context, company, domainUuid) {
|
|
74339
74704
|
const relativeName = context.flags.get("--name") ?? "";
|
|
74340
74705
|
const recordType = recordTypeFlag(context);
|
|
74341
|
-
if (relativeName === "") throw new UsageError(`record remove needs --name.\n\n${USAGE$
|
|
74706
|
+
if (relativeName === "") throw new UsageError(`record remove needs --name.\n\n${USAGE$43}`);
|
|
74342
74707
|
return await confirmableWrite(context, `Remove the ${recordType.toUpperCase()} set "${relativeName}".`, async () => {
|
|
74343
74708
|
const query = {
|
|
74344
74709
|
relativeName,
|
|
@@ -74357,8 +74722,8 @@ async function removeRecord(context, company, domainUuid) {
|
|
|
74357
74722
|
/** `dns dnssec <signed|unsigned> <uuid>`: the signing mode, with the confirmation the API requires. */
|
|
74358
74723
|
async function changeDnssec(context, rest) {
|
|
74359
74724
|
const [mode, uuid, ...extra] = rest;
|
|
74360
|
-
if (mode === void 0 || mode !== "signed" && mode !== "unsigned" || extra.length > 0) throw new UsageError(USAGE$
|
|
74361
|
-
const domainUuid = oneUuid$7(uuid === void 0 ? [] : [uuid], USAGE$
|
|
74725
|
+
if (mode === void 0 || mode !== "signed" && mode !== "unsigned" || extra.length > 0) throw new UsageError(USAGE$43);
|
|
74726
|
+
const domainUuid = oneUuid$7(uuid === void 0 ? [] : [uuid], USAGE$43);
|
|
74362
74727
|
const company = await requireCompany(context.flags);
|
|
74363
74728
|
return await confirmableWrite(context, [`Set the zone's signing mode to ${mode}.`, ...mode === "signed" ? [" DNSSEC signing is added; resolvers that fail validation will not answer until DS records match."] : [" DNSSEC signing is removed; the DS record in the parent zone has to be removed too."]].join("\n"), async () => {
|
|
74364
74729
|
const body = {
|
|
@@ -74377,7 +74742,7 @@ async function changeDnssec(context, rest) {
|
|
|
74377
74742
|
}
|
|
74378
74743
|
/** `dns handover <uuid>`: hand the zone back, dropping what this platform publishes. */
|
|
74379
74744
|
async function handover(context, rest) {
|
|
74380
|
-
const domainUuid = oneUuid$7(rest, USAGE$
|
|
74745
|
+
const domainUuid = oneUuid$7(rest, USAGE$43);
|
|
74381
74746
|
const company = await requireCompany(context.flags);
|
|
74382
74747
|
return await confirmableWrite(context, ["Hand this name's zone back out of managed DNS.", " Address records published here stop being published; the name and its applications stay."].join("\n"), async () => {
|
|
74383
74748
|
const body = {
|
|
@@ -74396,7 +74761,7 @@ async function handover(context, rest) {
|
|
|
74396
74761
|
/** A record type flag, refused when it is not one of the API's own values. */
|
|
74397
74762
|
function recordTypeFlag(context) {
|
|
74398
74763
|
const raw = (context.flags.get("--type") ?? "").trim().toLowerCase();
|
|
74399
|
-
if (!RECORD_TYPES.has(raw)) throw new UsageError(`--type must be one of ${[...RECORD_TYPES].join(", ")} (got "${raw}").\n\n${USAGE$
|
|
74764
|
+
if (!RECORD_TYPES.has(raw)) throw new UsageError(`--type must be one of ${[...RECORD_TYPES].join(", ")} (got "${raw}").\n\n${USAGE$43}`);
|
|
74400
74765
|
return raw;
|
|
74401
74766
|
}
|
|
74402
74767
|
/**
|
|
@@ -74429,7 +74794,7 @@ function recordSetFromValue(value, subject) {
|
|
|
74429
74794
|
};
|
|
74430
74795
|
}
|
|
74431
74796
|
// src/commands/dns-templates.ts
|
|
74432
|
-
var USAGE$
|
|
74797
|
+
var USAGE$42 = [
|
|
74433
74798
|
"Usage: hostingctl dns template list --company <slug>",
|
|
74434
74799
|
" hostingctl dns template show <template-uuid> --company <slug>",
|
|
74435
74800
|
" hostingctl dns template save [<template-uuid>] --company <slug> --file <template.json>",
|
|
@@ -74451,24 +74816,24 @@ var USAGE$41 = [
|
|
|
74451
74816
|
async function dnsTemplates(context, rest) {
|
|
74452
74817
|
const [action, ...tail] = rest;
|
|
74453
74818
|
if (action === "list") {
|
|
74454
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
74819
|
+
if (tail.length > 0) throw new UsageError(USAGE$42);
|
|
74455
74820
|
return {
|
|
74456
74821
|
kind: "templates",
|
|
74457
74822
|
templates: (await dnsTemplatesIndex({ path: { company: await requireCompany(context.flags) } })).data.templates
|
|
74458
74823
|
};
|
|
74459
74824
|
}
|
|
74460
|
-
if (action === "show") return await show$5(context, oneUuid$7(tail, USAGE$
|
|
74825
|
+
if (action === "show") return await show$5(context, oneUuid$7(tail, USAGE$42));
|
|
74461
74826
|
if (action === "save") return await save$1(context, tail[0]);
|
|
74462
|
-
if (action === "delete") return await destroy$1(context, oneUuid$7(tail, USAGE$
|
|
74463
|
-
if (action === "from-zone") return await fromZone(context, oneUuid$7(tail, USAGE$
|
|
74827
|
+
if (action === "delete") return await destroy$1(context, oneUuid$7(tail, USAGE$42));
|
|
74828
|
+
if (action === "from-zone") return await fromZone(context, oneUuid$7(tail, USAGE$42));
|
|
74464
74829
|
if (action === "preview") return await preview$2(context, tail);
|
|
74465
74830
|
if (action === "apply") return await apply(context, tail);
|
|
74466
|
-
throw new UsageError(USAGE$
|
|
74831
|
+
throw new UsageError(USAGE$42);
|
|
74467
74832
|
}
|
|
74468
74833
|
/** Two uuids: the template, then the zone it applies to. */
|
|
74469
74834
|
function templateAndZone(rest) {
|
|
74470
74835
|
const [templateUuid, domainUuid, ...extra] = rest;
|
|
74471
|
-
if (templateUuid === void 0 || templateUuid === "" || domainUuid === void 0 || domainUuid === "" || extra.length > 0) throw new UsageError(USAGE$
|
|
74836
|
+
if (templateUuid === void 0 || templateUuid === "" || domainUuid === void 0 || domainUuid === "" || extra.length > 0) throw new UsageError(USAGE$42);
|
|
74472
74837
|
return {
|
|
74473
74838
|
templateUuid,
|
|
74474
74839
|
domainUuid
|
|
@@ -74487,7 +74852,7 @@ async function show$5(context, templateUuid) {
|
|
|
74487
74852
|
/** `save [<uuid>] --file …`: record a new template, or replace the one named. */
|
|
74488
74853
|
async function save$1(context, templateUuid) {
|
|
74489
74854
|
const file = context.flags.get("--file") ?? "";
|
|
74490
|
-
if (file === "") throw new UsageError(`template save needs --file <template.json>.\n\n${USAGE$
|
|
74855
|
+
if (file === "") throw new UsageError(`template save needs --file <template.json>.\n\n${USAGE$42}`);
|
|
74491
74856
|
const company = await requireCompany(context.flags);
|
|
74492
74857
|
const document = readJsonObject(file, "template");
|
|
74493
74858
|
const name = typeof document.name === "string" ? document.name.trim() : "";
|
|
@@ -74523,7 +74888,7 @@ async function destroy$1(context, templateUuid) {
|
|
|
74523
74888
|
async function fromZone(context, domainUuid) {
|
|
74524
74889
|
const company = await requireCompany(context.flags);
|
|
74525
74890
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
74526
|
-
if (name === "") throw new UsageError(`template from-zone needs --name.\n\n${USAGE$
|
|
74891
|
+
if (name === "") throw new UsageError(`template from-zone needs --name.\n\n${USAGE$42}`);
|
|
74527
74892
|
const zone = (await domainsDnsShow({ path: {
|
|
74528
74893
|
company,
|
|
74529
74894
|
domainUuid
|
|
@@ -74592,7 +74957,7 @@ function recordSetsFromFile$1(document, subject) {
|
|
|
74592
74957
|
});
|
|
74593
74958
|
}
|
|
74594
74959
|
// src/commands/dns-text.ts
|
|
74595
|
-
var USAGE$
|
|
74960
|
+
var USAGE$41 = [
|
|
74596
74961
|
"Usage: hostingctl dns <zone|export> <domain-uuid> --company <slug>",
|
|
74597
74962
|
" hostingctl dns import <preview|apply> <domain-uuid> --company <slug> --file <path> [--confirm]",
|
|
74598
74963
|
" hostingctl dns enable <domain-uuid> --company <slug>",
|
|
@@ -74662,7 +75027,7 @@ function applyText(result) {
|
|
|
74662
75027
|
var DNS_METADATA = {
|
|
74663
75028
|
name: "dns",
|
|
74664
75029
|
summary: "A managed name's zone, its zone-file export, and the reviewed import write.",
|
|
74665
|
-
usage: USAGE$
|
|
75030
|
+
usage: USAGE$41,
|
|
74666
75031
|
flags: [
|
|
74667
75032
|
{
|
|
74668
75033
|
name: "--file",
|
|
@@ -74700,23 +75065,23 @@ var DNS_METADATA = {
|
|
|
74700
75065
|
var DNS_TOPICS = [
|
|
74701
75066
|
{
|
|
74702
75067
|
path: ["enable"],
|
|
74703
|
-
usage: USAGE$
|
|
75068
|
+
usage: USAGE$43
|
|
74704
75069
|
},
|
|
74705
75070
|
{
|
|
74706
75071
|
path: ["record"],
|
|
74707
|
-
usage: USAGE$
|
|
75072
|
+
usage: USAGE$43
|
|
74708
75073
|
},
|
|
74709
75074
|
{
|
|
74710
75075
|
path: ["dnssec"],
|
|
74711
|
-
usage: USAGE$
|
|
75076
|
+
usage: USAGE$43
|
|
74712
75077
|
},
|
|
74713
75078
|
{
|
|
74714
75079
|
path: ["handover"],
|
|
74715
|
-
usage: USAGE$
|
|
75080
|
+
usage: USAGE$43
|
|
74716
75081
|
},
|
|
74717
75082
|
{
|
|
74718
75083
|
path: ["template"],
|
|
74719
|
-
usage: USAGE$
|
|
75084
|
+
usage: USAGE$42
|
|
74720
75085
|
}
|
|
74721
75086
|
];
|
|
74722
75087
|
// src/commands/dns-import.ts
|
|
@@ -74733,7 +75098,7 @@ var IMPORT_LINE = /^(\S+)\s+(\d+)\s+(\S+)\s+(.+)$/;
|
|
|
74733
75098
|
* hold customer DNS data, so its contents are never printed; only the API's own answer is shown.
|
|
74734
75099
|
*/
|
|
74735
75100
|
function recordSetsFromFile(file) {
|
|
74736
|
-
if (file === void 0 || file === "") throw new UsageError(`Importing needs the record sets from disk: pass --file <path>.\n\n${USAGE$
|
|
75101
|
+
if (file === void 0 || file === "") throw new UsageError(`Importing needs the record sets from disk: pass --file <path>.\n\n${USAGE$41}`);
|
|
74737
75102
|
const sets = /* @__PURE__ */ new Map();
|
|
74738
75103
|
for (const [index, raw] of readBoundedImportFile(file, "import").split("\n").entries()) addLine(sets, raw.trim(), index + 1);
|
|
74739
75104
|
if (sets.size === 0) throw new UsageError(`The import file [${file}] holds no record sets.`);
|
|
@@ -74825,7 +75190,7 @@ var dns = {
|
|
|
74825
75190
|
if (subcommand === "import") return await importRecords(context, rest);
|
|
74826
75191
|
if (subcommand === "template") return await dnsTemplates(context, rest);
|
|
74827
75192
|
if (WRITE_SUBCOMMANDS$1.has(subcommand ?? "")) return await dnsWrites(context, subcommand ?? "", rest);
|
|
74828
|
-
throw new UsageError(USAGE$
|
|
75193
|
+
throw new UsageError(USAGE$41);
|
|
74829
75194
|
},
|
|
74830
75195
|
human(report) {
|
|
74831
75196
|
if ("sent" in report) return renderWriteOutcome(report, dnsWriteText);
|
|
@@ -74844,7 +75209,7 @@ async function readZone(context, rest, which) {
|
|
|
74844
75209
|
/** `import preview|apply <uuid> --file <path>`: the review, or the reviewed write. */
|
|
74845
75210
|
async function importRecords(context, rest) {
|
|
74846
75211
|
const [action, ...tail] = rest;
|
|
74847
|
-
if (action !== "preview" && action !== "apply") throw new UsageError(USAGE$
|
|
75212
|
+
if (action !== "preview" && action !== "apply") throw new UsageError(USAGE$41);
|
|
74848
75213
|
const path = await domainPath$1(context, tail);
|
|
74849
75214
|
const recordSets = recordSetsFromFile(context.flags.get("--file"));
|
|
74850
75215
|
if (action === "preview") return (await domainsDnsImportPreview({
|
|
@@ -74881,7 +75246,7 @@ async function applyImport(context, path, recordSets) {
|
|
|
74881
75246
|
/** The company and the one domain uuid a DNS subcommand needs, or a usage refusal. */
|
|
74882
75247
|
async function domainPath$1(context, rest) {
|
|
74883
75248
|
const [domainUuid, ...extra] = rest;
|
|
74884
|
-
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75249
|
+
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$41);
|
|
74885
75250
|
return {
|
|
74886
75251
|
company: await requireCompany(context.flags),
|
|
74887
75252
|
domainUuid
|
|
@@ -75047,7 +75412,7 @@ function checkText(check) {
|
|
|
75047
75412
|
}
|
|
75048
75413
|
// src/commands/email-alias.ts
|
|
75049
75414
|
/** The one usage string this group refuses with, owned by the group it belongs to. */
|
|
75050
|
-
var USAGE$
|
|
75415
|
+
var USAGE$40 = [
|
|
75051
75416
|
"Usage: hostingctl email alias add <email-domain-uuid> --company <slug> --local <name> --destinations a@x,b@y",
|
|
75052
75417
|
" hostingctl email alias set <email-domain-uuid> <alias-uuid> --company <slug> --destinations a@x,b@y",
|
|
75053
75418
|
" hostingctl email alias remove <email-domain-uuid> <alias-uuid> --company <slug>",
|
|
@@ -75071,16 +75436,16 @@ async function aliasGroup(context, action, tail) {
|
|
|
75071
75436
|
if (action === "set") return await aliasSet(context, tail);
|
|
75072
75437
|
if (action === "remove") return await aliasRemove(context, tail);
|
|
75073
75438
|
if (action === "unroute") return await aliasUnroute(context, tail);
|
|
75074
|
-
throw new UsageError(USAGE$
|
|
75439
|
+
throw new UsageError(USAGE$40);
|
|
75075
75440
|
}
|
|
75076
75441
|
/** `alias add <domain> --local … --destinations …`: a new forwarding address. */
|
|
75077
75442
|
async function aliasAdd(context, tail) {
|
|
75078
75443
|
const [emailDomainUuid, ...extra] = tail;
|
|
75079
|
-
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75444
|
+
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
|
|
75080
75445
|
const company = await requireCompany(context.flags);
|
|
75081
75446
|
const localPart = context.flags.get("--local")?.trim().toLowerCase() ?? "";
|
|
75082
75447
|
const list = destinations$1(context);
|
|
75083
|
-
if (localPart === "" || list.length === 0) throw new UsageError(`alias add needs --local and --destinations.\n\n${USAGE$
|
|
75448
|
+
if (localPart === "" || list.length === 0) throw new UsageError(`alias add needs --local and --destinations.\n\n${USAGE$40}`);
|
|
75084
75449
|
return await confirmableWrite(context, [`Create ${localPart}@… forwarding to:`, ...list.map((one) => ` ${one}`)].join("\n"), async () => {
|
|
75085
75450
|
return (await emailAliasesStore({
|
|
75086
75451
|
path: {
|
|
@@ -75097,10 +75462,10 @@ async function aliasAdd(context, tail) {
|
|
|
75097
75462
|
/** `alias set <domain> <alias> --destinations …`: replace the complete recipient list. */
|
|
75098
75463
|
async function aliasSet(context, tail) {
|
|
75099
75464
|
const [emailDomainUuid, aliasUuid, ...extra] = tail;
|
|
75100
|
-
if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75465
|
+
if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
|
|
75101
75466
|
const company = await requireCompany(context.flags);
|
|
75102
75467
|
const list = destinations$1(context);
|
|
75103
|
-
if (list.length === 0) throw new UsageError(`alias set needs --destinations.\n\n${USAGE$
|
|
75468
|
+
if (list.length === 0) throw new UsageError(`alias set needs --destinations.\n\n${USAGE$40}`);
|
|
75104
75469
|
return await confirmableWrite(context, [`Replace ${aliasUuid}'s destinations with:`, ...list.map((one) => ` ${one}`)].join("\n"), async () => {
|
|
75105
75470
|
return (await emailAliasesUpdate({
|
|
75106
75471
|
path: {
|
|
@@ -75115,7 +75480,7 @@ async function aliasSet(context, tail) {
|
|
|
75115
75480
|
/** `alias remove <domain> <alias>`. */
|
|
75116
75481
|
async function aliasRemove(context, tail) {
|
|
75117
75482
|
const [emailDomainUuid, aliasUuid, ...extra] = tail;
|
|
75118
|
-
if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75483
|
+
if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
|
|
75119
75484
|
const company = await requireCompany(context.flags);
|
|
75120
75485
|
return await confirmableWrite(context, `Remove alias ${aliasUuid}.`, async () => {
|
|
75121
75486
|
return (await emailAliasesDestroy({ path: {
|
|
@@ -75128,7 +75493,7 @@ async function aliasRemove(context, tail) {
|
|
|
75128
75493
|
/** `alias unroute <domain> <alias> <mailbox>`: drop one destination. */
|
|
75129
75494
|
async function aliasUnroute(context, tail) {
|
|
75130
75495
|
const [emailDomainUuid, aliasUuid, mailboxUuid, ...extra] = tail;
|
|
75131
|
-
if (emailDomainUuid === void 0 || aliasUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75496
|
+
if (emailDomainUuid === void 0 || aliasUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
|
|
75132
75497
|
const company = await requireCompany(context.flags);
|
|
75133
75498
|
return await confirmableWrite(context, `Stop forwarding ${aliasUuid} to mailbox ${mailboxUuid}.`, async () => {
|
|
75134
75499
|
return (await emailAliasesDestinationsDestroy({ path: {
|
|
@@ -75140,7 +75505,7 @@ async function aliasUnroute(context, tail) {
|
|
|
75140
75505
|
});
|
|
75141
75506
|
}
|
|
75142
75507
|
// src/commands/email-address.ts
|
|
75143
|
-
var USAGE$
|
|
75508
|
+
var USAGE$39 = [
|
|
75144
75509
|
"Usage: hostingctl email alias add <email-domain-uuid> --company <slug> --local <name> --destinations a@x,b@y",
|
|
75145
75510
|
" hostingctl email alias set <email-domain-uuid> <alias-uuid> --company <slug> --destinations a@x,b@y",
|
|
75146
75511
|
" hostingctl email alias remove <email-domain-uuid> <alias-uuid> --company <slug>",
|
|
@@ -75166,13 +75531,13 @@ async function emailAddresses(context, subcommand, rest) {
|
|
|
75166
75531
|
if (subcommand === "alias") return await aliasGroup(context, action, tail);
|
|
75167
75532
|
if (subcommand === "app-token") return await appToken(context, action, tail);
|
|
75168
75533
|
if (subcommand === "send-as") return await sendAs(context, action, tail);
|
|
75169
|
-
throw new UsageError(USAGE$
|
|
75534
|
+
throw new UsageError(USAGE$39);
|
|
75170
75535
|
}
|
|
75171
75536
|
/** `app-token list|issue|revoke|deliver`. */
|
|
75172
75537
|
async function appToken(context, action, tail) {
|
|
75173
75538
|
const company = await requireCompany(context.flags);
|
|
75174
75539
|
const [emailDomainUuid, mailboxUuid, third, ...extra] = tail;
|
|
75175
|
-
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75540
|
+
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
|
|
75176
75541
|
const path = {
|
|
75177
75542
|
company,
|
|
75178
75543
|
emailDomainUuid,
|
|
@@ -75200,7 +75565,7 @@ async function appToken(context, action, tail) {
|
|
|
75200
75565
|
}
|
|
75201
75566
|
if (action === "issue" && third === void 0) {
|
|
75202
75567
|
const label = context.flags.get("--label")?.trim() ?? "";
|
|
75203
|
-
if (label === "") throw new UsageError(`app-token issue needs --label.\n\n${USAGE$
|
|
75568
|
+
if (label === "") throw new UsageError(`app-token issue needs --label.\n\n${USAGE$39}`);
|
|
75204
75569
|
return await confirmableWrite(context, `Create an application password labelled "${label}".`, async () => {
|
|
75205
75570
|
return (await emailAppTokensStore({
|
|
75206
75571
|
path,
|
|
@@ -75208,7 +75573,7 @@ async function appToken(context, action, tail) {
|
|
|
75208
75573
|
})).data;
|
|
75209
75574
|
});
|
|
75210
75575
|
}
|
|
75211
|
-
if (third === void 0) throw new UsageError(USAGE$
|
|
75576
|
+
if (third === void 0) throw new UsageError(USAGE$39);
|
|
75212
75577
|
const tokenPath = {
|
|
75213
75578
|
...path,
|
|
75214
75579
|
tokenUuid: third
|
|
@@ -75217,14 +75582,14 @@ async function appToken(context, action, tail) {
|
|
|
75217
75582
|
return (await emailAppTokensRevoke({ path: tokenPath })).data;
|
|
75218
75583
|
});
|
|
75219
75584
|
if (action === "deliver") return await confirmableWrite(context, [`Return application password ${third} once.`, " The value is printed here and not stored: it cannot be read again after this."].join("\n"), async () => (await emailAppTokensDeliver({ path: tokenPath })).data);
|
|
75220
|
-
throw new UsageError(USAGE$
|
|
75585
|
+
throw new UsageError(USAGE$39);
|
|
75221
75586
|
}
|
|
75222
75587
|
/** `send-as list|grant|revoke`. */
|
|
75223
75588
|
async function sendAs(context, action, tail) {
|
|
75224
75589
|
const company = await requireCompany(context.flags);
|
|
75225
75590
|
if (action === "revoke") {
|
|
75226
75591
|
const [grantUuid, ...extra] = tail;
|
|
75227
|
-
if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75592
|
+
if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
|
|
75228
75593
|
return await confirmableWrite(context, `Revoke send-as grant ${grantUuid}.`, async () => {
|
|
75229
75594
|
return (await emailSendAsGrantsDestroy({ path: {
|
|
75230
75595
|
company,
|
|
@@ -75233,7 +75598,7 @@ async function sendAs(context, action, tail) {
|
|
|
75233
75598
|
});
|
|
75234
75599
|
}
|
|
75235
75600
|
const [emailDomainUuid, mailboxUuid, ...extra] = tail;
|
|
75236
|
-
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75601
|
+
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
|
|
75237
75602
|
const path = {
|
|
75238
75603
|
company,
|
|
75239
75604
|
emailDomainUuid,
|
|
@@ -75260,7 +75625,7 @@ async function sendAs(context, action, tail) {
|
|
|
75260
75625
|
}
|
|
75261
75626
|
if (action === "grant") {
|
|
75262
75627
|
const grantedAddressUuid = context.flags.get("--address") ?? "";
|
|
75263
|
-
if (grantedAddressUuid === "") throw new UsageError(`send-as grant needs --address.\n\n${USAGE$
|
|
75628
|
+
if (grantedAddressUuid === "") throw new UsageError(`send-as grant needs --address.\n\n${USAGE$39}`);
|
|
75264
75629
|
return await confirmableWrite(context, `Allow this mailbox to send as address ${grantedAddressUuid}.`, async () => {
|
|
75265
75630
|
return (await emailSendAsGrantsStore({
|
|
75266
75631
|
path,
|
|
@@ -75268,7 +75633,7 @@ async function sendAs(context, action, tail) {
|
|
|
75268
75633
|
})).data;
|
|
75269
75634
|
});
|
|
75270
75635
|
}
|
|
75271
|
-
throw new UsageError(USAGE$
|
|
75636
|
+
throw new UsageError(USAGE$39);
|
|
75272
75637
|
}
|
|
75273
75638
|
// src/commands/email-write-text.ts
|
|
75274
75639
|
/**
|
|
@@ -75334,7 +75699,7 @@ function emailAddressText(report) {
|
|
|
75334
75699
|
return "Done.";
|
|
75335
75700
|
}
|
|
75336
75701
|
// src/commands/email-domain.ts
|
|
75337
|
-
var USAGE$
|
|
75702
|
+
var USAGE$38 = [
|
|
75338
75703
|
"Usage: hostingctl email offer",
|
|
75339
75704
|
" hostingctl email enroll --company <slug>",
|
|
75340
75705
|
" hostingctl email agree --company <slug> --term <package-term-uuid>",
|
|
@@ -75355,7 +75720,7 @@ var USAGE$37 = [
|
|
|
75355
75720
|
/** `email offer|agree|provision|domain|catch-all`, dispatched from the `email` command. */
|
|
75356
75721
|
async function emailDomains(context, subcommand, rest) {
|
|
75357
75722
|
if (subcommand === "offer") {
|
|
75358
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
75723
|
+
if (rest.length > 0) throw new UsageError(USAGE$38);
|
|
75359
75724
|
return {
|
|
75360
75725
|
kind: "offers",
|
|
75361
75726
|
offers: (await emailOffers({ path: { company: await requireCompany(context.flags) } })).data
|
|
@@ -75366,11 +75731,11 @@ async function emailDomains(context, subcommand, rest) {
|
|
|
75366
75731
|
if (subcommand === "provision") return await provision(context, rest);
|
|
75367
75732
|
if (subcommand === "domain") return await domain(context, rest);
|
|
75368
75733
|
if (subcommand === "catch-all") return await catchAll(context, rest);
|
|
75369
|
-
throw new UsageError(USAGE$
|
|
75734
|
+
throw new UsageError(USAGE$38);
|
|
75370
75735
|
}
|
|
75371
75736
|
/** A company-wide command takes no positionals. */
|
|
75372
75737
|
function noExtra$14(rest) {
|
|
75373
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
75738
|
+
if (rest.length > 0) throw new UsageError(USAGE$38);
|
|
75374
75739
|
}
|
|
75375
75740
|
/** `enroll`: create the service record and start provisioning, which is the API's own create. */
|
|
75376
75741
|
async function enroll(context, rest) {
|
|
@@ -75383,7 +75748,7 @@ async function agree(context, rest) {
|
|
|
75383
75748
|
noExtra$14(rest);
|
|
75384
75749
|
const company = await requireCompany(context.flags);
|
|
75385
75750
|
const packageTermUuid = context.flags.get("--term") ?? "";
|
|
75386
|
-
if (packageTermUuid === "") throw new UsageError(`agree needs --term.\n\n${USAGE$
|
|
75751
|
+
if (packageTermUuid === "") throw new UsageError(`agree needs --term.\n\n${USAGE$38}`);
|
|
75387
75752
|
return await confirmableWrite(context, `Accept email package term ${packageTermUuid} for ${company}.`, async () => (await emailAgreement({
|
|
75388
75753
|
path: { company },
|
|
75389
75754
|
body: { packageTermUuid }
|
|
@@ -75402,7 +75767,7 @@ async function domain(context, rest) {
|
|
|
75402
75767
|
if (action === "add") {
|
|
75403
75768
|
noExtra$14(tail);
|
|
75404
75769
|
const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
|
|
75405
|
-
if (hostname === "") throw new UsageError(`domain add needs --hostname.\n\n${USAGE$
|
|
75770
|
+
if (hostname === "") throw new UsageError(`domain add needs --hostname.\n\n${USAGE$38}`);
|
|
75406
75771
|
return await confirmableWrite(context, `Attach ${hostname} to ${company}'s mail service.`, async () => {
|
|
75407
75772
|
return (await emailDomainsStore({
|
|
75408
75773
|
path: { company },
|
|
@@ -75412,7 +75777,7 @@ async function domain(context, rest) {
|
|
|
75412
75777
|
}
|
|
75413
75778
|
const path = {
|
|
75414
75779
|
company,
|
|
75415
|
-
emailDomainUuid: oneUuid$7(tail, USAGE$
|
|
75780
|
+
emailDomainUuid: oneUuid$7(tail, USAGE$38)
|
|
75416
75781
|
};
|
|
75417
75782
|
if (action === "recheck") return await confirmableWrite(context, "Re-observe this name's DNS now.", async () => {
|
|
75418
75783
|
return (await emailDomainsRecheck({ path })).data;
|
|
@@ -75432,14 +75797,14 @@ async function domain(context, rest) {
|
|
|
75432
75797
|
body
|
|
75433
75798
|
})).data;
|
|
75434
75799
|
});
|
|
75435
|
-
throw new UsageError(USAGE$
|
|
75800
|
+
throw new UsageError(USAGE$38);
|
|
75436
75801
|
}
|
|
75437
75802
|
/** `catch-all show|set|clear`. */
|
|
75438
75803
|
async function catchAll(context, rest) {
|
|
75439
75804
|
const [action, ...tail] = rest;
|
|
75440
75805
|
const path = {
|
|
75441
75806
|
company: await requireCompany(context.flags),
|
|
75442
|
-
emailDomainUuid: oneUuid$7(tail, USAGE$
|
|
75807
|
+
emailDomainUuid: oneUuid$7(tail, USAGE$38)
|
|
75443
75808
|
};
|
|
75444
75809
|
if (action === "show") return {
|
|
75445
75810
|
kind: "catch-all",
|
|
@@ -75447,7 +75812,7 @@ async function catchAll(context, rest) {
|
|
|
75447
75812
|
};
|
|
75448
75813
|
if (action === "set") {
|
|
75449
75814
|
const destinations = destinationList(context);
|
|
75450
|
-
if (destinations.length === 0) throw new UsageError(`catch-all set needs --destinations a@x,b@y.\n\n${USAGE$
|
|
75815
|
+
if (destinations.length === 0) throw new UsageError(`catch-all set needs --destinations a@x,b@y.\n\n${USAGE$38}`);
|
|
75451
75816
|
return await confirmableWrite(context, [`Enable the catch-all for this name, forwarding to:`, ...destinations.map((one) => ` ${one}`)].join("\n"), async () => {
|
|
75452
75817
|
return (await emailCatchAllUpdate({
|
|
75453
75818
|
path,
|
|
@@ -75459,7 +75824,7 @@ async function catchAll(context, rest) {
|
|
|
75459
75824
|
});
|
|
75460
75825
|
}
|
|
75461
75826
|
if (action === "clear") return await confirmableWrite(context, "Disable the catch-all: mail to an unknown address at this name is refused rather than forwarded.", async () => (await emailCatchAllDestroy({ path })).data);
|
|
75462
|
-
throw new UsageError(USAGE$
|
|
75827
|
+
throw new UsageError(USAGE$38);
|
|
75463
75828
|
}
|
|
75464
75829
|
/**
|
|
75465
75830
|
* The comma-separated `--destinations`.
|
|
@@ -75490,7 +75855,7 @@ function catchAllText(one) {
|
|
|
75490
75855
|
return ` the catch-all forwards to ${one.destinations.join(", ") || "nobody"}`;
|
|
75491
75856
|
}
|
|
75492
75857
|
// src/commands/email-holds.ts
|
|
75493
|
-
var USAGE$
|
|
75858
|
+
var USAGE$37 = [
|
|
75494
75859
|
"Usage: hostingctl email hold list --company <slug>",
|
|
75495
75860
|
" hostingctl email hold create --company <slug> --reason <compromise|abuse|operator> [--mailbox <uuid>]",
|
|
75496
75861
|
" hostingctl email hold release <hold-uuid> --company <slug>",
|
|
@@ -75513,21 +75878,21 @@ async function emailHolds(context, rest) {
|
|
|
75513
75878
|
const [action, ...tail] = rest;
|
|
75514
75879
|
const company = await requireCompany(context.flags);
|
|
75515
75880
|
if (action === "list") {
|
|
75516
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
75881
|
+
if (tail.length > 0) throw new UsageError(USAGE$37);
|
|
75517
75882
|
return {
|
|
75518
75883
|
kind: "holds",
|
|
75519
75884
|
holds: (await emailHoldsIndex({ path: { company } })).data.holds
|
|
75520
75885
|
};
|
|
75521
75886
|
}
|
|
75522
75887
|
if (action === "create") return await create$3(context, tail, company);
|
|
75523
|
-
if (action === "release") return await release$1(context, oneUuid$7(tail, USAGE$
|
|
75524
|
-
throw new UsageError(USAGE$
|
|
75888
|
+
if (action === "release") return await release$1(context, oneUuid$7(tail, USAGE$37), company);
|
|
75889
|
+
throw new UsageError(USAGE$37);
|
|
75525
75890
|
}
|
|
75526
75891
|
/** `create --reason … [--mailbox …]`. */
|
|
75527
75892
|
async function create$3(context, tail, company) {
|
|
75528
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
75893
|
+
if (tail.length > 0) throw new UsageError(USAGE$37);
|
|
75529
75894
|
const raw = context.flags.get("--reason")?.trim() ?? "";
|
|
75530
|
-
if (!REASONS.has(raw)) throw new UsageError(`--reason must be compromise, abuse or operator (got "${raw}").\n\n${USAGE$
|
|
75895
|
+
if (!REASONS.has(raw)) throw new UsageError(`--reason must be compromise, abuse or operator (got "${raw}").\n\n${USAGE$37}`);
|
|
75531
75896
|
const mailboxUuid = context.flags.get("--mailbox")?.trim() ?? "";
|
|
75532
75897
|
return await confirmableWrite(context, [`Hold outbound mail for ${mailboxUuid === "" ? "the whole service" : `mailbox ${mailboxUuid}`} because: ${raw}.`, " Nothing is sent until this hold is released."].join("\n"), async () => {
|
|
75533
75898
|
return (await emailHoldsStore({
|
|
@@ -75562,7 +75927,7 @@ function emailHoldText(report) {
|
|
|
75562
75927
|
return report.holds.length === 0 ? "No sending holds." : report.holds.map(holdLine).join("\n");
|
|
75563
75928
|
}
|
|
75564
75929
|
// src/commands/email-mailbox-admin.ts
|
|
75565
|
-
var USAGE$
|
|
75930
|
+
var USAGE$36 = [
|
|
75566
75931
|
"Usage: hostingctl email mailbox add <email-domain-uuid> --company <slug> --local <name> --quota <gb-5|gb-10|gb-20>",
|
|
75567
75932
|
" hostingctl email mailbox change <email-domain-uuid> <mailbox-uuid> --company <slug> [--status enabled|suspended] [--quota <size>]",
|
|
75568
75933
|
" hostingctl email mailbox remove <email-domain-uuid> <mailbox-uuid> --company <slug>",
|
|
@@ -75594,7 +75959,7 @@ var STATUSES = /* @__PURE__ */ new Set(["enabled", "suspended"]);
|
|
|
75594
75959
|
async function emailMailboxAdmin(context, action, tail) {
|
|
75595
75960
|
if (action === "add") return await add$8(context, tail);
|
|
75596
75961
|
const [emailDomainUuid, mailboxUuid, ...extra] = tail;
|
|
75597
|
-
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75962
|
+
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$36);
|
|
75598
75963
|
const path = {
|
|
75599
75964
|
company: await requireCompany(context.flags),
|
|
75600
75965
|
emailDomainUuid,
|
|
@@ -75612,7 +75977,7 @@ async function emailMailboxAdmin(context, action, tail) {
|
|
|
75612
75977
|
if (action === "preferences-set") return await preferences(context, path);
|
|
75613
75978
|
if (action === "credential") return await revealCredential(context, path, false);
|
|
75614
75979
|
if (action === "reset-credential") return await revealCredential(context, path, true);
|
|
75615
|
-
throw new UsageError(USAGE$
|
|
75980
|
+
throw new UsageError(USAGE$36);
|
|
75616
75981
|
}
|
|
75617
75982
|
/** A quota flag from the API's own values. */
|
|
75618
75983
|
function quota(context) {
|
|
@@ -75628,11 +75993,11 @@ function destinations(context) {
|
|
|
75628
75993
|
/** `add <domain> --local … --quota …`. */
|
|
75629
75994
|
async function add$8(context, tail) {
|
|
75630
75995
|
const [emailDomainUuid, ...extra] = tail;
|
|
75631
|
-
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
75996
|
+
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$36);
|
|
75632
75997
|
const company = await requireCompany(context.flags);
|
|
75633
75998
|
const localPart = context.flags.get("--local")?.trim().toLowerCase() ?? "";
|
|
75634
75999
|
const size = quota(context);
|
|
75635
|
-
if (localPart === "" || size === null) throw new UsageError(`mailbox add needs --local and --quota.\n\n${USAGE$
|
|
76000
|
+
if (localPart === "" || size === null) throw new UsageError(`mailbox add needs --local and --quota.\n\n${USAGE$36}`);
|
|
75636
76001
|
return await confirmableWrite(context, `Create mailbox ${localPart}@… with a ${size} quota.`, async () => {
|
|
75637
76002
|
return (await emailMailboxesStore({
|
|
75638
76003
|
path: {
|
|
@@ -75657,7 +76022,7 @@ function statusFlag(context) {
|
|
|
75657
76022
|
async function change$1(context, path) {
|
|
75658
76023
|
const status = statusFlag(context);
|
|
75659
76024
|
const size = quota(context);
|
|
75660
|
-
if (status === null && size === null) throw new UsageError(`mailbox change needs --status, --quota or both.\n\n${USAGE$
|
|
76025
|
+
if (status === null && size === null) throw new UsageError(`mailbox change needs --status, --quota or both.\n\n${USAGE$36}`);
|
|
75661
76026
|
return await confirmableWrite(context, `Set this mailbox's ${[status === null ? null : `status to ${status}`, size === null ? null : `quota to ${size}`].filter((one) => one !== null).join(" and ")}.`, async () => {
|
|
75662
76027
|
return (await emailMailboxesUpdate({
|
|
75663
76028
|
path,
|
|
@@ -75685,7 +76050,7 @@ async function preferences(context, path) {
|
|
|
75685
76050
|
const markRead = onOff$4(context, "--spam-mark-read");
|
|
75686
76051
|
const threshold = context.flags.get("--spam-threshold");
|
|
75687
76052
|
const summary = context.flags.get("--vacation-subject");
|
|
75688
|
-
if (vacation === null && markRead === null && threshold === void 0 && summary === void 0) throw new UsageError(`preferences-set needs --vacation, --spam-threshold, --spam-mark-read or --vacation-subject.\n\n${USAGE$
|
|
76053
|
+
if (vacation === null && markRead === null && threshold === void 0 && summary === void 0) throw new UsageError(`preferences-set needs --vacation, --spam-threshold, --spam-mark-read or --vacation-subject.\n\n${USAGE$36}`);
|
|
75689
76054
|
const body = {
|
|
75690
76055
|
vacationEnabled: vacation ?? current.vacationEnabled,
|
|
75691
76056
|
vacationSubject: context.flags.get("--vacation-subject") ?? current.vacationSubject,
|
|
@@ -75739,7 +76104,7 @@ function emailMailboxAdminText(report) {
|
|
|
75739
76104
|
return preferencesText(report.preferences);
|
|
75740
76105
|
}
|
|
75741
76106
|
// src/commands/email-service.ts
|
|
75742
|
-
var USAGE$
|
|
76107
|
+
var USAGE$35 = [
|
|
75743
76108
|
"Usage: hostingctl email service <suspend|resume> --company <slug>",
|
|
75744
76109
|
" hostingctl email service cancellation --company <slug>",
|
|
75745
76110
|
" hostingctl email service cancel --company <slug> --ends-at <iso-date>",
|
|
@@ -75766,11 +76131,11 @@ async function emailService(context, subcommand, rest) {
|
|
|
75766
76131
|
if (subcommand === "dmarc-set") return await dmarcSet$1(context, rest);
|
|
75767
76132
|
if (subcommand === "blocklist-set") return await blocklistSet(context, rest);
|
|
75768
76133
|
if (subcommand === "service") return await service(context, rest);
|
|
75769
|
-
throw new UsageError(USAGE$
|
|
76134
|
+
throw new UsageError(USAGE$35);
|
|
75770
76135
|
}
|
|
75771
76136
|
/** A company-wide command takes no positionals. */
|
|
75772
76137
|
function noExtra$13(rest) {
|
|
75773
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
76138
|
+
if (rest.length > 0) throw new UsageError(USAGE$35);
|
|
75774
76139
|
}
|
|
75775
76140
|
/** `service suspend|resume|cancellation|cancel|cancel-withdraw`. */
|
|
75776
76141
|
async function service(context, rest) {
|
|
@@ -75796,7 +76161,7 @@ async function service(context, rest) {
|
|
|
75796
76161
|
if (action === "cancel") {
|
|
75797
76162
|
noExtra$13(tail);
|
|
75798
76163
|
const endsAt = context.flags.get("--ends-at")?.trim() ?? "";
|
|
75799
|
-
if (endsAt === "") throw new UsageError(`service cancel needs --ends-at.\n\n${USAGE$
|
|
76164
|
+
if (endsAt === "") throw new UsageError(`service cancel needs --ends-at.\n\n${USAGE$35}`);
|
|
75800
76165
|
if (Number.isNaN(Date.parse(endsAt))) throw new UsageError(`--ends-at must be an ISO date (got "${endsAt}").`);
|
|
75801
76166
|
return await confirmableWrite(context, [`End the mail service at ${endsAt}.`, " Mail keeps working until then; the cancellation can be withdrawn before that date."].join("\n"), async () => (await emailCancellationStore({
|
|
75802
76167
|
path: { company },
|
|
@@ -75809,7 +76174,7 @@ async function service(context, rest) {
|
|
|
75809
76174
|
return (await emailCancellationWithdraw({ path: { company } })).data;
|
|
75810
76175
|
});
|
|
75811
76176
|
}
|
|
75812
|
-
throw new UsageError(USAGE$
|
|
76177
|
+
throw new UsageError(USAGE$35);
|
|
75813
76178
|
}
|
|
75814
76179
|
/** `dmarc`: DMARC reporting for every attached name. */
|
|
75815
76180
|
async function dmarc$1(context, rest) {
|
|
@@ -75829,7 +76194,7 @@ async function blocklist$1(context, rest) {
|
|
|
75829
76194
|
}
|
|
75830
76195
|
/** `dmarc-set <name> --enabled on|off`. */
|
|
75831
76196
|
async function dmarcSet$1(context, rest) {
|
|
75832
|
-
const emailDomainUuid = oneUuid$7(rest, USAGE$
|
|
76197
|
+
const emailDomainUuid = oneUuid$7(rest, USAGE$35);
|
|
75833
76198
|
const company = await requireCompany(context.flags);
|
|
75834
76199
|
const enabled = onOff$3(context);
|
|
75835
76200
|
return await confirmableWrite(context, `${enabled ? "Enable" : "Disable"} DMARC reporting for this name.`, async () => {
|
|
@@ -75844,7 +76209,7 @@ async function dmarcSet$1(context, rest) {
|
|
|
75844
76209
|
}
|
|
75845
76210
|
/** `blocklist-set <name> --enabled on|off`. */
|
|
75846
76211
|
async function blocklistSet(context, rest) {
|
|
75847
|
-
const emailDomainUuid = oneUuid$7(rest, USAGE$
|
|
76212
|
+
const emailDomainUuid = oneUuid$7(rest, USAGE$35);
|
|
75848
76213
|
const company = await requireCompany(context.flags);
|
|
75849
76214
|
const enabled = onOff$3(context);
|
|
75850
76215
|
return await confirmableWrite(context, `${enabled ? "Enable" : "Disable"} blocklist monitoring for this name.`, async () => {
|
|
@@ -75861,7 +76226,7 @@ async function blocklistSet(context, rest) {
|
|
|
75861
76226
|
async function importSchema(context, rest) {
|
|
75862
76227
|
noExtra$13(rest);
|
|
75863
76228
|
const version = context.flags.get("--version")?.trim() ?? "";
|
|
75864
|
-
if (version === "") throw new UsageError(`import-schema needs --version.\n\n${USAGE$
|
|
76229
|
+
if (version === "") throw new UsageError(`import-schema needs --version.\n\n${USAGE$35}`);
|
|
75865
76230
|
return {
|
|
75866
76231
|
kind: "schema",
|
|
75867
76232
|
version,
|
|
@@ -75873,7 +76238,7 @@ function onOff$3(context) {
|
|
|
75873
76238
|
const raw = context.flags.get("--enabled")?.trim() ?? "";
|
|
75874
76239
|
if (raw === "on" || raw === "true") return true;
|
|
75875
76240
|
if (raw === "off" || raw === "false") return false;
|
|
75876
|
-
throw new UsageError(`--enabled must be on or off (got "${raw}").\n\n${USAGE$
|
|
76241
|
+
throw new UsageError(`--enabled must be on or off (got "${raw}").\n\n${USAGE$35}`);
|
|
75877
76242
|
}
|
|
75878
76243
|
/** The `email service|dmarc|blocklist|import-schema` renderer. */
|
|
75879
76244
|
function emailServiceText(report) {
|
|
@@ -75885,7 +76250,7 @@ function emailServiceText(report) {
|
|
|
75885
76250
|
}
|
|
75886
76251
|
// src/commands/email-sync-csv.ts
|
|
75887
76252
|
/** The usage this group refuses with, owned by the command it belongs to. */
|
|
75888
|
-
var USAGE$
|
|
76253
|
+
var USAGE$34 = [
|
|
75889
76254
|
"Usage: hostingctl email sync csv <preview|commit> <email-domain-uuid> --company <slug> --file <path>",
|
|
75890
76255
|
"",
|
|
75891
76256
|
" preview What the file's rows would become. Writes nothing.",
|
|
@@ -75896,7 +76261,7 @@ var USAGE$33 = [
|
|
|
75896
76261
|
/** One named uuid, or a usage refusal. */
|
|
75897
76262
|
function one$2(rest) {
|
|
75898
76263
|
const [uuid, ...extra] = rest;
|
|
75899
|
-
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$
|
|
76264
|
+
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$34);
|
|
75900
76265
|
return uuid;
|
|
75901
76266
|
}
|
|
75902
76267
|
/** `csv preview|commit <domain> --file <path>`: one multipart upload of the CSV itself. */
|
|
@@ -75904,7 +76269,7 @@ async function csv(context, tail) {
|
|
|
75904
76269
|
const [action, ...args] = tail;
|
|
75905
76270
|
const path = await domainPath(context, one$2(args));
|
|
75906
76271
|
const file = context.flags.get("--file") ?? "";
|
|
75907
|
-
if (file === "") throw new UsageError(`sync csv needs --file <path>.\n\n${USAGE$
|
|
76272
|
+
if (file === "") throw new UsageError(`sync csv needs --file <path>.\n\n${USAGE$34}`);
|
|
75908
76273
|
if (action === "preview") return {
|
|
75909
76274
|
kind: "csv-preview",
|
|
75910
76275
|
rows: (await emailMailboxSyncCsvPreview({
|
|
@@ -75912,10 +76277,10 @@ async function csv(context, tail) {
|
|
|
75912
76277
|
body: await csvPreviewBody(file)
|
|
75913
76278
|
})).data.rows
|
|
75914
76279
|
};
|
|
75915
|
-
if (action !== "commit") throw new UsageError(USAGE$
|
|
76280
|
+
if (action !== "commit") throw new UsageError(USAGE$34);
|
|
75916
76281
|
const recurrence = recurrenceFlag(context) ?? "once";
|
|
75917
76282
|
const endsAt = context.flags.get("--ends-at")?.trim() || null;
|
|
75918
|
-
if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$
|
|
76283
|
+
if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$34}`);
|
|
75919
76284
|
return await confirmableWrite(context, [`Commit the sync accounts in ${file}, once the API has reviewed it.`, ` The review is re-read here and only its accepted rows are committed: ${recurrence}${endsAt === null ? "" : ` until ${endsAt}`}.`].join("\n"), async () => {
|
|
75920
76285
|
const accepted = (await emailMailboxSyncCsvPreview({
|
|
75921
76286
|
path,
|
|
@@ -75963,7 +76328,7 @@ async function csvCommitBody(file, accepted, recurrence, endsAt) {
|
|
|
75963
76328
|
return form;
|
|
75964
76329
|
}
|
|
75965
76330
|
// src/commands/email-sync.ts
|
|
75966
|
-
var USAGE$
|
|
76331
|
+
var USAGE$33 = [
|
|
75967
76332
|
"Usage: hostingctl email sync show <email-domain-uuid> --company <slug>",
|
|
75968
76333
|
" hostingctl email sync server <email-domain-uuid> --company <slug> --host <host> --port <n> --encryption <tls|starttls>",
|
|
75969
76334
|
" hostingctl email sync account add <email-domain-uuid> --company <slug> --username <login> (--password-file <path>|--password-stdin) --mailbox <uuid> --recurrence <once|until> [--ends-at <iso>]",
|
|
@@ -75988,12 +76353,12 @@ async function emailSync(context, rest) {
|
|
|
75988
76353
|
if (action === "server") return await server(context, tail);
|
|
75989
76354
|
if (action === "account") return await account(context, tail);
|
|
75990
76355
|
if (action === "csv") return await csv(context, tail);
|
|
75991
|
-
throw new UsageError(USAGE$
|
|
76356
|
+
throw new UsageError(USAGE$33);
|
|
75992
76357
|
}
|
|
75993
76358
|
/** One named uuid, or a usage refusal. */
|
|
75994
76359
|
function one$1(rest) {
|
|
75995
76360
|
const [uuid, ...extra] = rest;
|
|
75996
|
-
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$
|
|
76361
|
+
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$33);
|
|
75997
76362
|
return uuid;
|
|
75998
76363
|
}
|
|
75999
76364
|
/** `show`: the server and every account. */
|
|
@@ -76009,9 +76374,9 @@ async function server(context, tail) {
|
|
|
76009
76374
|
const host = context.flags.get("--host")?.trim() ?? "";
|
|
76010
76375
|
const port = Number(context.flags.get("--port") ?? "");
|
|
76011
76376
|
const encryption = context.flags.get("--encryption")?.trim() ?? "";
|
|
76012
|
-
if (host === "") throw new UsageError(`sync server needs --host.\n\n${USAGE$
|
|
76013
|
-
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new UsageError(`--port must be a whole number between 1 and 65535.\n\n${USAGE$
|
|
76014
|
-
if (!ENCRYPTIONS.has(encryption)) throw new UsageError(`--encryption must be tls or starttls (got "${encryption}").\n\n${USAGE$
|
|
76377
|
+
if (host === "") throw new UsageError(`sync server needs --host.\n\n${USAGE$33}`);
|
|
76378
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new UsageError(`--port must be a whole number between 1 and 65535.\n\n${USAGE$33}`);
|
|
76379
|
+
if (!ENCRYPTIONS.has(encryption)) throw new UsageError(`--encryption must be tls or starttls (got "${encryption}").\n\n${USAGE$33}`);
|
|
76015
76380
|
return await confirmableWrite(context, `Point the mailbox sync source at ${host}:${String(port)} over ${encryption}.`, async () => {
|
|
76016
76381
|
return (await emailMailboxSyncServerUpdate({
|
|
76017
76382
|
path,
|
|
@@ -76035,9 +76400,9 @@ async function account(context, tail) {
|
|
|
76035
76400
|
const [action, ...args] = tail;
|
|
76036
76401
|
if (action === "add") return await accountAdd(context, args);
|
|
76037
76402
|
if (action === "change") return await accountChange(context, args);
|
|
76038
|
-
if (action === void 0) throw new UsageError(USAGE$
|
|
76403
|
+
if (action === void 0) throw new UsageError(USAGE$33);
|
|
76039
76404
|
const [emailDomainUuid, accountUuid, ...extra] = args;
|
|
76040
|
-
if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
76405
|
+
if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$33);
|
|
76041
76406
|
return await accountAction(context, action, {
|
|
76042
76407
|
...await domainPath(context, emailDomainUuid),
|
|
76043
76408
|
accountUuid
|
|
@@ -76056,13 +76421,13 @@ async function accountAction(context, action, path) {
|
|
|
76056
76421
|
if (action === "start") return await startAccount(context, path);
|
|
76057
76422
|
if (action === "stop") return await confirmableWrite(context, "Stop this account's scheduled sync. The source credential is kept.", async () => (await emailMailboxSyncAccountsStop({ path })).data);
|
|
76058
76423
|
if (action === "forget") return await confirmableWrite(context, "Forget this account's source credential and stop future work.", async () => (await emailMailboxSyncAccountsForget({ path })).data);
|
|
76059
|
-
throw new UsageError(USAGE$
|
|
76424
|
+
throw new UsageError(USAGE$33);
|
|
76060
76425
|
}
|
|
76061
76426
|
/** `start`: the schedule the account should run on from now. */
|
|
76062
76427
|
async function startAccount(context, path) {
|
|
76063
76428
|
const recurrence = recurrenceFlag(context) ?? "once";
|
|
76064
76429
|
const endsAt = context.flags.get("--ends-at")?.trim() || null;
|
|
76065
|
-
if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$
|
|
76430
|
+
if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$33}`);
|
|
76066
76431
|
return await confirmableWrite(context, `Start this account's scheduled sync (${recurrence}${endsAt === null ? "" : ` until ${endsAt}`}).`, async () => (await emailMailboxSyncAccountsStart({
|
|
76067
76432
|
path,
|
|
76068
76433
|
body: {
|
|
@@ -76075,7 +76440,7 @@ async function startAccount(context, path) {
|
|
|
76075
76440
|
async function accountAdd(context, args) {
|
|
76076
76441
|
const path = await domainPath(context, one$1(args));
|
|
76077
76442
|
const body = accountBody(context);
|
|
76078
|
-
const sourcePassword = readSecret(context, "password", 4096, USAGE$
|
|
76443
|
+
const sourcePassword = readSecret(context, "password", 4096, USAGE$33);
|
|
76079
76444
|
return await confirmableWrite(context, [`Add a sync account for ${body.sourceUsername} into mailbox ${body.mailboxUuid}.`, ` It runs ${body.recurrence === "once" ? "once" : `until ${String(body.endsAt)}`}.`].join("\n"), async () => (await emailMailboxSyncAccountsStore({
|
|
76080
76445
|
path,
|
|
76081
76446
|
body: {
|
|
@@ -76087,7 +76452,7 @@ async function accountAdd(context, args) {
|
|
|
76087
76452
|
/** `account change <domain> <account> [fields]`: only the fields named are sent. */
|
|
76088
76453
|
async function accountChange(context, args) {
|
|
76089
76454
|
const [emailDomainUuid, accountUuid, ...extra] = args;
|
|
76090
|
-
if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
76455
|
+
if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$33);
|
|
76091
76456
|
const path = {
|
|
76092
76457
|
...await domainPath(context, emailDomainUuid),
|
|
76093
76458
|
accountUuid
|
|
@@ -76101,8 +76466,8 @@ async function accountChange(context, args) {
|
|
|
76101
76466
|
if (mailbox !== "") body.mailboxUuid = mailbox;
|
|
76102
76467
|
if (recurrence !== null) body.recurrence = recurrence;
|
|
76103
76468
|
if (endsAt !== "") body.endsAt = endsAt;
|
|
76104
|
-
if (context.flags.has("--password-file") || context.flags.has("--password-stdin")) body.sourcePassword = readSecret(context, "password", 4096, USAGE$
|
|
76105
|
-
if (Object.keys(body).length === 0) throw new UsageError(`account change needs at least one field.\n\n${USAGE$
|
|
76469
|
+
if (context.flags.has("--password-file") || context.flags.has("--password-stdin")) body.sourcePassword = readSecret(context, "password", 4096, USAGE$33);
|
|
76470
|
+
if (Object.keys(body).length === 0) throw new UsageError(`account change needs at least one field.\n\n${USAGE$33}`);
|
|
76106
76471
|
return await confirmableWrite(context, "Change this sync account.", async () => {
|
|
76107
76472
|
return (await emailMailboxSyncAccountsUpdate({
|
|
76108
76473
|
path,
|
|
@@ -76116,8 +76481,8 @@ function accountBody(context) {
|
|
|
76116
76481
|
const mailboxUuid = context.flags.get("--mailbox")?.trim() ?? "";
|
|
76117
76482
|
const recurrence = recurrenceFlag(context) ?? "once";
|
|
76118
76483
|
const endsAt = context.flags.get("--ends-at")?.trim() ?? "";
|
|
76119
|
-
if (sourceUsername === "" || mailboxUuid === "") throw new UsageError(`account add needs --username and --mailbox.\n\n${USAGE$
|
|
76120
|
-
if (recurrence === "until" && endsAt === "") throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$
|
|
76484
|
+
if (sourceUsername === "" || mailboxUuid === "") throw new UsageError(`account add needs --username and --mailbox.\n\n${USAGE$33}`);
|
|
76485
|
+
if (recurrence === "until" && endsAt === "") throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$33}`);
|
|
76121
76486
|
return {
|
|
76122
76487
|
sourceUsername,
|
|
76123
76488
|
mailboxUuid,
|
|
@@ -76133,7 +76498,7 @@ function recurrenceFlag(context) {
|
|
|
76133
76498
|
return raw;
|
|
76134
76499
|
}
|
|
76135
76500
|
// src/commands/email-text.ts
|
|
76136
|
-
var USAGE$
|
|
76501
|
+
var USAGE$32 = [
|
|
76137
76502
|
"Usage: hostingctl email <show|names> --company <slug>",
|
|
76138
76503
|
" hostingctl email <mailboxes|aliases> <email-domain-uuid> --company <slug>",
|
|
76139
76504
|
" hostingctl email mailbox <email-domain-uuid> <mailbox-uuid> --company <slug>",
|
|
@@ -76215,7 +76580,7 @@ function count$1(shown, total) {
|
|
|
76215
76580
|
var EMAIL_METADATA = {
|
|
76216
76581
|
name: "email",
|
|
76217
76582
|
summary: "A company's email service, its attached names, their mailboxes and aliases.",
|
|
76218
|
-
usage: USAGE$
|
|
76583
|
+
usage: USAGE$32,
|
|
76219
76584
|
flags: [
|
|
76220
76585
|
{
|
|
76221
76586
|
name: "--address",
|
|
@@ -76395,75 +76760,75 @@ var EMAIL_METADATA = {
|
|
|
76395
76760
|
var EMAIL_TOPICS = [
|
|
76396
76761
|
{
|
|
76397
76762
|
path: ["alias"],
|
|
76398
|
-
usage: USAGE$
|
|
76763
|
+
usage: USAGE$40
|
|
76399
76764
|
},
|
|
76400
76765
|
{
|
|
76401
76766
|
path: ["app-token"],
|
|
76402
|
-
usage: USAGE$
|
|
76767
|
+
usage: USAGE$39
|
|
76403
76768
|
},
|
|
76404
76769
|
{
|
|
76405
76770
|
path: ["send-as"],
|
|
76406
|
-
usage: USAGE$
|
|
76771
|
+
usage: USAGE$39
|
|
76407
76772
|
},
|
|
76408
76773
|
{
|
|
76409
76774
|
path: ["offer"],
|
|
76410
|
-
usage: USAGE$
|
|
76775
|
+
usage: USAGE$38
|
|
76411
76776
|
},
|
|
76412
76777
|
{
|
|
76413
76778
|
path: ["enroll"],
|
|
76414
|
-
usage: USAGE$
|
|
76779
|
+
usage: USAGE$38
|
|
76415
76780
|
},
|
|
76416
76781
|
{
|
|
76417
76782
|
path: ["agree"],
|
|
76418
|
-
usage: USAGE$
|
|
76783
|
+
usage: USAGE$38
|
|
76419
76784
|
},
|
|
76420
76785
|
{
|
|
76421
76786
|
path: ["provision"],
|
|
76422
|
-
usage: USAGE$
|
|
76787
|
+
usage: USAGE$38
|
|
76423
76788
|
},
|
|
76424
76789
|
{
|
|
76425
76790
|
path: ["domain"],
|
|
76426
|
-
usage: USAGE$
|
|
76791
|
+
usage: USAGE$38
|
|
76427
76792
|
},
|
|
76428
76793
|
{
|
|
76429
76794
|
path: ["catch-all"],
|
|
76430
|
-
usage: USAGE$
|
|
76795
|
+
usage: USAGE$38
|
|
76431
76796
|
},
|
|
76432
76797
|
{
|
|
76433
76798
|
path: ["service"],
|
|
76434
|
-
usage: USAGE$
|
|
76799
|
+
usage: USAGE$35
|
|
76435
76800
|
},
|
|
76436
76801
|
{
|
|
76437
76802
|
path: ["dmarc"],
|
|
76438
|
-
usage: USAGE$
|
|
76803
|
+
usage: USAGE$35
|
|
76439
76804
|
},
|
|
76440
76805
|
{
|
|
76441
76806
|
path: ["dmarc-set"],
|
|
76442
|
-
usage: USAGE$
|
|
76807
|
+
usage: USAGE$35
|
|
76443
76808
|
},
|
|
76444
76809
|
{
|
|
76445
76810
|
path: ["blocklist"],
|
|
76446
|
-
usage: USAGE$
|
|
76811
|
+
usage: USAGE$35
|
|
76447
76812
|
},
|
|
76448
76813
|
{
|
|
76449
76814
|
path: ["blocklist-set"],
|
|
76450
|
-
usage: USAGE$
|
|
76815
|
+
usage: USAGE$35
|
|
76451
76816
|
},
|
|
76452
76817
|
{
|
|
76453
76818
|
path: ["import-schema"],
|
|
76454
|
-
usage: USAGE$
|
|
76819
|
+
usage: USAGE$35
|
|
76455
76820
|
},
|
|
76456
76821
|
{
|
|
76457
76822
|
path: ["sync"],
|
|
76458
|
-
usage: USAGE$
|
|
76823
|
+
usage: USAGE$33
|
|
76459
76824
|
},
|
|
76460
76825
|
{
|
|
76461
76826
|
path: ["hold"],
|
|
76462
|
-
usage: USAGE$
|
|
76827
|
+
usage: USAGE$37
|
|
76463
76828
|
},
|
|
76464
76829
|
{
|
|
76465
76830
|
path: ["mailbox"],
|
|
76466
|
-
usage: USAGE$
|
|
76831
|
+
usage: USAGE$36
|
|
76467
76832
|
}
|
|
76468
76833
|
];
|
|
76469
76834
|
// src/commands/email-sync-text.ts
|
|
@@ -76503,7 +76868,7 @@ async function companyRead(context, subcommand, rest) {
|
|
|
76503
76868
|
if (subcommand === "mailboxes") return await mailboxes(company, rest);
|
|
76504
76869
|
if (subcommand === "mailbox") return await mailbox(company, rest);
|
|
76505
76870
|
if (subcommand === "aliases") return await aliases(company, rest);
|
|
76506
|
-
throw new UsageError(USAGE$
|
|
76871
|
+
throw new UsageError(USAGE$32);
|
|
76507
76872
|
}
|
|
76508
76873
|
/** The renderer for a tagged feature read, or null when this command renders the answer itself. */
|
|
76509
76874
|
function taggedText(report) {
|
|
@@ -76588,7 +76953,7 @@ var email = {
|
|
|
76588
76953
|
...EMAIL_METADATA,
|
|
76589
76954
|
async run(context) {
|
|
76590
76955
|
const [subcommand, ...rest] = context.positional;
|
|
76591
|
-
if (subcommand === void 0 || !SUBCOMMANDS.has(subcommand)) throw new UsageError(USAGE$
|
|
76956
|
+
if (subcommand === void 0 || !SUBCOMMANDS.has(subcommand)) throw new UsageError(USAGE$32);
|
|
76592
76957
|
const feature = dispatched$1(context, subcommand, rest);
|
|
76593
76958
|
if (feature !== null) return await feature;
|
|
76594
76959
|
return await companyRead(context, subcommand, rest);
|
|
@@ -76673,7 +77038,7 @@ async function aliases(company, rest) {
|
|
|
76673
77038
|
/** `mailbox <email-domain-uuid> <mailbox-uuid>`: one record, independent of index pagination. */
|
|
76674
77039
|
async function mailbox(company, rest) {
|
|
76675
77040
|
const [emailDomainUuid, mailboxUuid, ...extra] = rest;
|
|
76676
|
-
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
77041
|
+
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$32);
|
|
76677
77042
|
return (await emailMailboxesShow({ path: {
|
|
76678
77043
|
company,
|
|
76679
77044
|
emailDomainUuid,
|
|
@@ -76683,12 +77048,12 @@ async function mailbox(company, rest) {
|
|
|
76683
77048
|
/** The one uuid a collection read names, or a usage refusal. */
|
|
76684
77049
|
function oneUuid$4(rest) {
|
|
76685
77050
|
const [uuid, ...extra] = rest;
|
|
76686
|
-
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
77051
|
+
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$32);
|
|
76687
77052
|
return uuid;
|
|
76688
77053
|
}
|
|
76689
77054
|
/** A company-wide read takes no positional arguments. */
|
|
76690
77055
|
function noExtra$12(rest) {
|
|
76691
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
77056
|
+
if (rest.length > 0) throw new UsageError(USAGE$32);
|
|
76692
77057
|
}
|
|
76693
77058
|
// src/commands/environment-activation.ts
|
|
76694
77059
|
async function environmentActivation(context, args) {
|
|
@@ -76703,7 +77068,7 @@ async function environmentActivation(context, args) {
|
|
|
76703
77068
|
};
|
|
76704
77069
|
}
|
|
76705
77070
|
// src/commands/environment-admin.ts
|
|
76706
|
-
var USAGE$
|
|
77071
|
+
var USAGE$31 = [
|
|
76707
77072
|
"Usage: hostingctl environment retention <environment-uuid> --company <slug>",
|
|
76708
77073
|
" hostingctl environment retention-set <environment-uuid> --company <slug> --extra-days <n> --effective-at <iso> --agreement <uuid> [--package <key>]",
|
|
76709
77074
|
" hostingctl environment database-show <environment-uuid> <database-uuid> --company <slug>",
|
|
@@ -76727,9 +77092,9 @@ async function environmentAdmin(context, subcommand, rest) {
|
|
|
76727
77092
|
if (subcommand === "retention") return await retention(context, first);
|
|
76728
77093
|
if (subcommand === "retention-set") return await retentionSet(context, first);
|
|
76729
77094
|
if (subcommand === "database-show" || subcommand === "database-reveal") {
|
|
76730
|
-
if (first === void 0 || tail.length !== 1) throw new UsageError(USAGE$
|
|
77095
|
+
if (first === void 0 || tail.length !== 1) throw new UsageError(USAGE$31);
|
|
76731
77096
|
const path = {
|
|
76732
|
-
...await environmentPath$1(context, first, USAGE$
|
|
77097
|
+
...await environmentPath$1(context, first, USAGE$31),
|
|
76733
77098
|
databaseUuid: tail[0] ?? ""
|
|
76734
77099
|
};
|
|
76735
77100
|
if (subcommand === "database-show") return {
|
|
@@ -76739,24 +77104,24 @@ async function environmentAdmin(context, subcommand, rest) {
|
|
|
76739
77104
|
return await revealDatabase(context, path);
|
|
76740
77105
|
}
|
|
76741
77106
|
if (subcommand === "tuning") return await tuning(context, first, tail);
|
|
76742
|
-
throw new UsageError(USAGE$
|
|
77107
|
+
throw new UsageError(USAGE$31);
|
|
76743
77108
|
}
|
|
76744
77109
|
/** `retention <env>`. */
|
|
76745
77110
|
async function retention(context, environmentUuid) {
|
|
76746
77111
|
return {
|
|
76747
77112
|
kind: "retention",
|
|
76748
|
-
retention: (await hostingRetentionShow({ path: await environmentPath$1(context, environmentUuid, USAGE$
|
|
77113
|
+
retention: (await hostingRetentionShow({ path: await environmentPath$1(context, environmentUuid, USAGE$31) })).data
|
|
76749
77114
|
};
|
|
76750
77115
|
}
|
|
76751
77116
|
/** `retention-set <env> --extra-days … --effective-at … --agreement …`. */
|
|
76752
77117
|
async function retentionSet(context, environmentUuid) {
|
|
76753
|
-
const path = await environmentPath$1(context, environmentUuid, USAGE$
|
|
77118
|
+
const path = await environmentPath$1(context, environmentUuid, USAGE$31);
|
|
76754
77119
|
const extraDays = Number(context.flags.get("--extra-days") ?? "");
|
|
76755
77120
|
const effectiveAt = context.flags.get("--effective-at")?.trim() ?? "";
|
|
76756
77121
|
const baselineAgreementUuid = context.flags.get("--agreement")?.trim() ?? "";
|
|
76757
|
-
if (!Number.isInteger(extraDays) || extraDays < 1) throw new UsageError(`retention-set needs --extra-days as a whole number of at least 1.\n\n${USAGE$
|
|
76758
|
-
if (effectiveAt === "" || Number.isNaN(Date.parse(effectiveAt))) throw new UsageError(`retention-set needs --effective-at as an ISO date.\n\n${USAGE$
|
|
76759
|
-
if (baselineAgreementUuid === "") throw new UsageError(`retention-set needs --agreement.\n\n${USAGE$
|
|
77122
|
+
if (!Number.isInteger(extraDays) || extraDays < 1) throw new UsageError(`retention-set needs --extra-days as a whole number of at least 1.\n\n${USAGE$31}`);
|
|
77123
|
+
if (effectiveAt === "" || Number.isNaN(Date.parse(effectiveAt))) throw new UsageError(`retention-set needs --effective-at as an ISO date.\n\n${USAGE$31}`);
|
|
77124
|
+
if (baselineAgreementUuid === "") throw new UsageError(`retention-set needs --agreement.\n\n${USAGE$31}`);
|
|
76760
77125
|
const packageKey = context.flags.get("--package")?.trim();
|
|
76761
77126
|
return {
|
|
76762
77127
|
kind: "write",
|
|
@@ -76783,7 +77148,7 @@ async function revealDatabase(context, path) {
|
|
|
76783
77148
|
/** `tuning preview|restore <env>`. */
|
|
76784
77149
|
async function tuning(context, action, rest) {
|
|
76785
77150
|
const environmentUuid = rest[0];
|
|
76786
|
-
const path = await environmentPath$1(context, environmentUuid, USAGE$
|
|
77151
|
+
const path = await environmentPath$1(context, environmentUuid, USAGE$31);
|
|
76787
77152
|
if (action === "preview" && rest.length === 1) {
|
|
76788
77153
|
const body = (await hostingEnvironmentShow({ path })).data;
|
|
76789
77154
|
return {
|
|
@@ -76796,7 +77161,7 @@ async function tuning(context, action, rest) {
|
|
|
76796
77161
|
}
|
|
76797
77162
|
if (action === "restore" && rest.length === 1) {
|
|
76798
77163
|
const generation = Number(context.flags.get("--generation") ?? "");
|
|
76799
|
-
if (!Number.isInteger(generation) || generation < 1) throw new UsageError(`tuning restore needs --generation.\n\n${USAGE$
|
|
77164
|
+
if (!Number.isInteger(generation) || generation < 1) throw new UsageError(`tuning restore needs --generation.\n\n${USAGE$31}`);
|
|
76800
77165
|
return {
|
|
76801
77166
|
kind: "write",
|
|
76802
77167
|
outcome: await confirmableWrite(context, `Restore the recorded tuning for generation ${String(generation)}.`, async () => (await hostingTuningRestore({
|
|
@@ -76805,7 +77170,7 @@ async function tuning(context, action, rest) {
|
|
|
76805
77170
|
})).data)
|
|
76806
77171
|
};
|
|
76807
77172
|
}
|
|
76808
|
-
throw new UsageError(USAGE$
|
|
77173
|
+
throw new UsageError(USAGE$31);
|
|
76809
77174
|
}
|
|
76810
77175
|
/** One retention window as one line, and the write receipt for it. */
|
|
76811
77176
|
function retentionText(one) {
|
|
@@ -76910,7 +77275,7 @@ async function cacheSet(context, path) {
|
|
|
76910
77275
|
})).data);
|
|
76911
77276
|
}
|
|
76912
77277
|
// src/commands/environment-component-version.ts
|
|
76913
|
-
var USAGE$
|
|
77278
|
+
var USAGE$30 = [
|
|
76914
77279
|
"Usage: hostingctl environment component-version <environment-uuid> <workload-uuid> <version> --company <slug>",
|
|
76915
77280
|
"",
|
|
76916
77281
|
" component-version Move one curated component instance to another version this platform pins an image",
|
|
@@ -76928,7 +77293,7 @@ var USAGE$29 = [
|
|
|
76928
77293
|
*/
|
|
76929
77294
|
async function environmentComponentVersion(context, rest) {
|
|
76930
77295
|
const [uuid, workloadUuid, version, ...extra] = rest;
|
|
76931
|
-
if (uuid === void 0 || workloadUuid === void 0 || version === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
77296
|
+
if (uuid === void 0 || workloadUuid === void 0 || version === void 0 || extra.length > 0) throw new UsageError(USAGE$30);
|
|
76932
77297
|
const path = {
|
|
76933
77298
|
company: await requireCompany(context.flags),
|
|
76934
77299
|
environmentUuid: uuid,
|
|
@@ -77364,10 +77729,10 @@ function initialSelectionText(selection) {
|
|
|
77364
77729
|
return `${selection.volumeType}: ${selection.storageClass ?? selection.storageClassUuid ?? ""}`;
|
|
77365
77730
|
}
|
|
77366
77731
|
// src/commands/environment-create.ts
|
|
77367
|
-
var USAGE$
|
|
77732
|
+
var USAGE$29 = [
|
|
77368
77733
|
"Usage: hostingctl environment create --company <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
77369
77734
|
" hostingctl environment create --client <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
77370
|
-
" [--storage-classes <volume-type>=<class>[,<volume-type>=<class>...]]",
|
|
77735
|
+
" [--storage-classes <volume-type>=<class>[,<volume-type>=<class>...]] [--environment-mode <live|test>]",
|
|
77371
77736
|
" [--cpu-request <millicores> --cpu-limit <millicores> --memory-request <MiB> --memory-limit <MiB>",
|
|
77372
77737
|
" --storage-limit <MiB>]",
|
|
77373
77738
|
"",
|
|
@@ -77385,6 +77750,8 @@ var USAGE$28 = [
|
|
|
77385
77750
|
"",
|
|
77386
77751
|
"The package is one of the keys this environment's catalog offers; the platform chooses the placement,",
|
|
77387
77752
|
"so no cluster is sent or accepted.",
|
|
77753
|
+
"--environment-mode test creates a protected test copy: mail is captured, outside services are blocked,",
|
|
77754
|
+
"scheduled tasks are off and pages are not indexed. Make it live later with `environment mode set`.",
|
|
77388
77755
|
"Initial storage classes are optional; each is reviewed and recorded before the environment's first reconcile.",
|
|
77389
77756
|
"A class is its Kubernetes name (see `hostingctl storage-classes`) or its UUID."
|
|
77390
77757
|
].join("\n");
|
|
@@ -77420,6 +77787,11 @@ var CREATE_FLAG_SPECS = [
|
|
|
77420
77787
|
takesValue: true,
|
|
77421
77788
|
description: "The client a staff operator creates an environment for, through the platform route: one this account holds no membership in."
|
|
77422
77789
|
},
|
|
77790
|
+
{
|
|
77791
|
+
name: "--environment-mode",
|
|
77792
|
+
takesValue: true,
|
|
77793
|
+
description: "live (the default) or test: a protected copy to restore into and make live later."
|
|
77794
|
+
},
|
|
77423
77795
|
...SLICE_FLAG_SPECS
|
|
77424
77796
|
];
|
|
77425
77797
|
/**
|
|
@@ -77427,33 +77799,41 @@ var CREATE_FLAG_SPECS = [
|
|
|
77427
77799
|
* not.
|
|
77428
77800
|
*/
|
|
77429
77801
|
async function create$2(context, rest) {
|
|
77430
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
77802
|
+
if (rest.length > 0) throw new UsageError(USAGE$29);
|
|
77431
77803
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
77432
|
-
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$
|
|
77433
|
-
const slug = slugFor(context.flags.get("--slug"), name, USAGE$
|
|
77434
|
-
const slice = sliceFor(context.flags, USAGE$
|
|
77435
|
-
const storageSelections = storageSelectionsFor(context.flags, USAGE$
|
|
77804
|
+
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$29}`);
|
|
77805
|
+
const slug = slugFor(context.flags.get("--slug"), name, USAGE$29);
|
|
77806
|
+
const slice = sliceFor(context.flags, USAGE$29);
|
|
77807
|
+
const storageSelections = storageSelectionsFor(context.flags, USAGE$29);
|
|
77808
|
+
const mode = environmentModeFor(context.flags.get("--environment-mode"));
|
|
77436
77809
|
const scope = await scopeFor(context.flags);
|
|
77437
77810
|
const chosen = chosenPackage(await catalogFor(scope), context.flags.get("--package")?.trim() ?? "");
|
|
77438
77811
|
const body = {
|
|
77439
77812
|
name,
|
|
77440
77813
|
slug,
|
|
77441
77814
|
resourceProfile: chosen.key,
|
|
77815
|
+
mode,
|
|
77442
77816
|
...slice === null ? {} : { budget: slice },
|
|
77443
77817
|
...storageSelections === null ? {} : { storageSelections }
|
|
77444
77818
|
};
|
|
77445
|
-
return await confirmableWrite(context, describeCreate$1(name, slug, chosen.key, scope, slice, storageSelections), async () => await sendCreate(scope, body));
|
|
77819
|
+
return await confirmableWrite(context, describeCreate$1(name, slug, chosen.key, scope, slice, storageSelections, mode), async () => await sendCreate(scope, body));
|
|
77820
|
+
}
|
|
77821
|
+
/** Live unless the caller asked for a protected test copy; anything else is refused before a read. */
|
|
77822
|
+
function environmentModeFor(value) {
|
|
77823
|
+
const mode = value?.trim() ?? "live";
|
|
77824
|
+
if (mode === "live" || mode === "test") return mode;
|
|
77825
|
+
throw new UsageError(`--environment-mode must be live or test (got ${mode}).\n\n${USAGE$29}`);
|
|
77446
77826
|
}
|
|
77447
77827
|
/** Which company or client the create is for, from exactly one of `--company` and `--client`. */
|
|
77448
77828
|
async function scopeFor(flags) {
|
|
77449
77829
|
const client = flags.get("--client")?.trim() ?? "";
|
|
77450
77830
|
const company = flags.get("--company")?.trim() ?? "";
|
|
77451
|
-
if (client !== "" && company !== "") throw new UsageError(`Pass --company or --client, not both.\n\n${USAGE$
|
|
77831
|
+
if (client !== "" && company !== "") throw new UsageError(`Pass --company or --client, not both.\n\n${USAGE$29}`);
|
|
77452
77832
|
if (client !== "") return {
|
|
77453
77833
|
mode: "client",
|
|
77454
77834
|
client
|
|
77455
77835
|
};
|
|
77456
|
-
if (company === "") throw new UsageError(`create needs --company <slug> or --client <slug>.\n\n${USAGE$
|
|
77836
|
+
if (company === "") throw new UsageError(`create needs --company <slug> or --client <slug>.\n\n${USAGE$29}`);
|
|
77457
77837
|
return {
|
|
77458
77838
|
mode: "company",
|
|
77459
77839
|
company: await requireCompany(flags)
|
|
@@ -77467,7 +77847,7 @@ async function catalogFor(scope) {
|
|
|
77467
77847
|
/** The package the create sends: the one named, or the catalog's first, refused when the catalog does not carry it. */
|
|
77468
77848
|
function chosenPackage(packages, requested) {
|
|
77469
77849
|
const chosen = requested === "" ? packages[0] : packages.find((one) => one.key === requested);
|
|
77470
|
-
if (chosen === void 0) throw new UsageError(`--package must be one of ${packages.map((one) => one.key).join(", ")} (got ${requested}).\n\n${USAGE$
|
|
77850
|
+
if (chosen === void 0) throw new UsageError(`--package must be one of ${packages.map((one) => one.key).join(", ")} (got ${requested}).\n\n${USAGE$29}`);
|
|
77471
77851
|
return chosen;
|
|
77472
77852
|
}
|
|
77473
77853
|
/** The create itself, through the route that addressee is reached by. */
|
|
@@ -77488,9 +77868,10 @@ async function sendCreate(scope, body) {
|
|
|
77488
77868
|
* The addressee is named in every mode, so an operator who acted for a client sees that in the description and in
|
|
77489
77869
|
* `--json`, rather than reading a receipt that could be their own company's.
|
|
77490
77870
|
*/
|
|
77491
|
-
function describeCreate$1(name, slug, packageKey, scope, slice, storageSelections) {
|
|
77871
|
+
function describeCreate$1(name, slug, packageKey, scope, slice, storageSelections, mode) {
|
|
77872
|
+
const addressee = scope.mode === "client" ? `for client ${scope.client} through the platform route (this account holds no membership in it)` : `in company ${scope.company} through the company's own route`;
|
|
77492
77873
|
return [
|
|
77493
|
-
`Create
|
|
77874
|
+
`Create ${mode === "test" ? "protected test " : ""}environment "${name}" (${slug}) ${addressee}, with the ${packageKey} package.`,
|
|
77494
77875
|
...slice === null ? [] : [describeSlice(slice)],
|
|
77495
77876
|
...storageSelections === null ? [] : [" Initial storage classes (recorded before the first reconcile):", ...storageSelections.map((one) => ` ${initialSelectionText(one)}`)],
|
|
77496
77877
|
" The platform chooses the placement from its own configuration: no cluster is sent or accepted, and",
|
|
@@ -77822,7 +78203,7 @@ function oneUuid$2(rest) {
|
|
|
77822
78203
|
return uuid;
|
|
77823
78204
|
}
|
|
77824
78205
|
// src/commands/environment-domains.ts
|
|
77825
|
-
var USAGE$
|
|
78206
|
+
var USAGE$28 = [
|
|
77826
78207
|
"Usage: hostingctl environment domains <environment-uuid> --company <slug>",
|
|
77827
78208
|
" hostingctl environment domain-add <environment-uuid> --company <slug> --hostname <host> --application <application-uuid> [--intended on|off]",
|
|
77828
78209
|
" hostingctl environment domain-verify|domain-check-routing|domain-intended|domain-primary|domain-remove <environment-uuid> <domain-uuid> --company <slug>",
|
|
@@ -77844,7 +78225,7 @@ var USAGE$27 = [
|
|
|
77844
78225
|
].join("\n");
|
|
77845
78226
|
/** The redirect vocabularies, typed from the API's own enums. */
|
|
77846
78227
|
var TARGETS = /* @__PURE__ */ new Set(["application", "fixed"]);
|
|
77847
|
-
var MODES$
|
|
78228
|
+
var MODES$2 = /* @__PURE__ */ new Set(["temporary", "permanent"]);
|
|
77848
78229
|
/** The actions that change one existing name and take nothing else. */
|
|
77849
78230
|
var DOMAIN_ACTIONS = {
|
|
77850
78231
|
"domain-verify": hostingDomainVerify,
|
|
@@ -77855,7 +78236,7 @@ var DOMAIN_ACTIONS = {
|
|
|
77855
78236
|
/** `environment domains|domain-add|domain-*|redirects|redirect-set|redirect-remove`. */
|
|
77856
78237
|
async function environmentDomains(context, subcommand, rest) {
|
|
77857
78238
|
const [environmentUuid, ...tail] = rest;
|
|
77858
|
-
const path = await environmentPath$1(context, environmentUuid, USAGE$
|
|
78239
|
+
const path = await environmentPath$1(context, environmentUuid, USAGE$28);
|
|
77859
78240
|
if (subcommand === "domains") return await domains(path, tail);
|
|
77860
78241
|
if (subcommand === "redirects") return await redirects(path, tail);
|
|
77861
78242
|
if (subcommand === "domain-add") return await add$7(context, path, tail);
|
|
@@ -77864,7 +78245,7 @@ async function environmentDomains(context, subcommand, rest) {
|
|
|
77864
78245
|
if (subcommand === "domain-remove") return await removeDomain(context, path, tail);
|
|
77865
78246
|
const action = DOMAIN_ACTIONS[subcommand];
|
|
77866
78247
|
if (action !== void 0) return await domainAction(context, subcommand, action, path, tail);
|
|
77867
|
-
throw new UsageError(USAGE$
|
|
78248
|
+
throw new UsageError(USAGE$28);
|
|
77868
78249
|
}
|
|
77869
78250
|
/** `domains <env>`. */
|
|
77870
78251
|
async function domains(path, rest) {
|
|
@@ -77887,7 +78268,7 @@ async function add$7(context, path, rest) {
|
|
|
77887
78268
|
noExtra$11(rest);
|
|
77888
78269
|
const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
|
|
77889
78270
|
const workloadUuid = context.flags.get("--application")?.trim() ?? "";
|
|
77890
|
-
if (hostname === "" || workloadUuid === "") throw new UsageError(`domain-add needs --hostname and --application.\n\n${USAGE$
|
|
78271
|
+
if (hostname === "" || workloadUuid === "") throw new UsageError(`domain-add needs --hostname and --application.\n\n${USAGE$28}`);
|
|
77891
78272
|
const intended = onOffFlag(context, "--intended") ?? false;
|
|
77892
78273
|
return await written$2(confirmableWrite(context, `Serve ${hostname} from application ${workloadUuid}${intended ? " as an intended name" : ""}.`, async () => {
|
|
77893
78274
|
return (await hostingDomainStore({
|
|
@@ -77903,7 +78284,7 @@ async function add$7(context, path, rest) {
|
|
|
77903
78284
|
/** The five actions that take only the environment and the name. */
|
|
77904
78285
|
async function domainAction(context, subcommand, action, path, rest) {
|
|
77905
78286
|
const [domainUuid, ...extra] = rest;
|
|
77906
|
-
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
78287
|
+
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$28);
|
|
77907
78288
|
const described = {
|
|
77908
78289
|
"domain-verify": "Check this name's ownership TXT record now.",
|
|
77909
78290
|
"domain-check-routing": "Check this name's routing now.",
|
|
@@ -77921,7 +78302,7 @@ async function domainAction(context, subcommand, action, path, rest) {
|
|
|
77921
78302
|
/** `domain-remove <env> <domain>`: stop serving a name. */
|
|
77922
78303
|
async function removeDomain(context, path, rest) {
|
|
77923
78304
|
const [domainUuid, ...extra] = rest;
|
|
77924
|
-
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
78305
|
+
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$28);
|
|
77925
78306
|
const fallBackToGenerated = onOffFlag(context, "--fall-back-to-generated") ?? true;
|
|
77926
78307
|
return await written$2(confirmableWrite(context, "Stop serving this name. Its record stays readable, and the environment keeps its generated hostname.", async () => {
|
|
77927
78308
|
const body = { fallBackToGenerated };
|
|
@@ -77937,13 +78318,13 @@ async function removeDomain(context, path, rest) {
|
|
|
77937
78318
|
/** `redirect-set <env> <domain> --target … --mode … [--destination …]`. */
|
|
77938
78319
|
async function setRedirect(context, path, rest) {
|
|
77939
78320
|
const [domainUuid, ...extra] = rest;
|
|
77940
|
-
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
78321
|
+
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$28);
|
|
77941
78322
|
const target = context.flags.get("--target")?.trim() ?? "";
|
|
77942
78323
|
const mode = context.flags.get("--mode")?.trim() ?? "";
|
|
77943
78324
|
const destinationUrl = context.flags.get("--destination")?.trim() ?? "";
|
|
77944
|
-
if (!TARGETS.has(target)) throw new UsageError(`--target must be application or fixed.\n\n${USAGE$
|
|
77945
|
-
if (!MODES$
|
|
77946
|
-
if (target === "fixed" && destinationUrl === "") throw new UsageError(`--target fixed needs --destination <url>.\n\n${USAGE$
|
|
78325
|
+
if (!TARGETS.has(target)) throw new UsageError(`--target must be application or fixed.\n\n${USAGE$28}`);
|
|
78326
|
+
if (!MODES$2.has(mode)) throw new UsageError(`--mode must be temporary or permanent.\n\n${USAGE$28}`);
|
|
78327
|
+
if (target === "fixed" && destinationUrl === "") throw new UsageError(`--target fixed needs --destination <url>.\n\n${USAGE$28}`);
|
|
77947
78328
|
return await written$2(confirmableWrite(context, [`Redirect this name ${mode} to ${target === "fixed" ? destinationUrl : "its application"}.`, " The redirect activates once the source name's DNS resolves."].join("\n"), async () => {
|
|
77948
78329
|
const body = {
|
|
77949
78330
|
target,
|
|
@@ -77963,7 +78344,7 @@ async function setRedirect(context, path, rest) {
|
|
|
77963
78344
|
/** `redirect-remove <env> <redirect-uuid>`. */
|
|
77964
78345
|
async function removeRedirect(context, path, rest) {
|
|
77965
78346
|
const [redirectUuid, ...extra] = rest;
|
|
77966
|
-
if (redirectUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
78347
|
+
if (redirectUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$28);
|
|
77967
78348
|
return await written$2(confirmableWrite(context, `Remove redirect ${redirectUuid}.`, async () => {
|
|
77968
78349
|
return (await hostingDomainRedirectDestroy({ path: {
|
|
77969
78350
|
...path,
|
|
@@ -77980,7 +78361,7 @@ async function written$2(pending) {
|
|
|
77980
78361
|
}
|
|
77981
78362
|
/** No positional arguments, or a usage refusal. */
|
|
77982
78363
|
function noExtra$11(rest) {
|
|
77983
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
78364
|
+
if (rest.length > 0) throw new UsageError(USAGE$28);
|
|
77984
78365
|
}
|
|
77985
78366
|
// src/commands/schedule-flags.ts
|
|
77986
78367
|
/** The API's own bound on patterns in one schedule. */
|
|
@@ -78083,6 +78464,56 @@ function backupScheduleText(report) {
|
|
|
78083
78464
|
if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
|
|
78084
78465
|
return `${outcome.description}\n${scheduleLines$1(outcome.result)}`;
|
|
78085
78466
|
}
|
|
78467
|
+
// src/commands/environment-database-import.ts
|
|
78468
|
+
var DATABASE_IMPORT_USAGE = [" hostingctl environment database-import <environment-uuid> <export-uuid> <application-uuid> --company <slug>", " hostingctl environment database-import-confirm <environment-uuid> <export-uuid> <application-uuid> --company <slug> --confirmation <digest>"];
|
|
78469
|
+
/**
|
|
78470
|
+
* `database-import <env> <export> <application>` reviews importing a backup of a database on another host into one
|
|
78471
|
+
* application's database; `database-import-confirm` reads that review again and confirms it with its digest.
|
|
78472
|
+
*/
|
|
78473
|
+
async function databaseImport(context, path, subcommand, rest, usage) {
|
|
78474
|
+
const [exportUuid, workloadUuid, ...extra] = rest;
|
|
78475
|
+
if (!exportUuid || !workloadUuid || extra.length > 0) throw new UsageError(usage);
|
|
78476
|
+
const importPath = {
|
|
78477
|
+
...path,
|
|
78478
|
+
exportUuid,
|
|
78479
|
+
workloadUuid
|
|
78480
|
+
};
|
|
78481
|
+
const review = (await hostingDatabaseImportShow({ path: importPath })).data;
|
|
78482
|
+
if (subcommand === "database-import") return {
|
|
78483
|
+
kind: "database-import-review",
|
|
78484
|
+
review
|
|
78485
|
+
};
|
|
78486
|
+
if (review.blockedReason !== null) throw new UsageError(`This import is blocked: ${review.blockedReason}`);
|
|
78487
|
+
const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
|
|
78488
|
+
if (confirmation === "") throw new UsageError(`database-import-confirm needs --confirmation.\n\n${usage}`);
|
|
78489
|
+
return {
|
|
78490
|
+
kind: "database-import-write",
|
|
78491
|
+
outcome: await confirmableWrite(context, `Import backup ${exportUuid} into ${review.applicationName}: ${review.replaces}`, async () => (await hostingDatabaseImportConfirm({
|
|
78492
|
+
path: importPath,
|
|
78493
|
+
body: {
|
|
78494
|
+
confirmation,
|
|
78495
|
+
desiredGeneration: review.recovery.desiredGeneration
|
|
78496
|
+
}
|
|
78497
|
+
})).data)
|
|
78498
|
+
};
|
|
78499
|
+
}
|
|
78500
|
+
function databaseImportText(report) {
|
|
78501
|
+
if (report.kind === "database-import-write") {
|
|
78502
|
+
const { outcome } = report;
|
|
78503
|
+
if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
|
|
78504
|
+
return `${outcome.description}\n recovery ${outcome.result.uuid} ${outcome.result.statusName}`;
|
|
78505
|
+
}
|
|
78506
|
+
const { review } = report;
|
|
78507
|
+
const quota = review.quotaBytes === null ? "unknown" : `${String(review.quotaBytes)} bytes`;
|
|
78508
|
+
return [
|
|
78509
|
+
` import into ${review.applicationName}`,
|
|
78510
|
+
` ${review.sourceEngine} ${review.sourceVersion} → ${review.destinationEngine} ${review.destinationVersion}: ${review.engineMatches ? "compatible" : "not compatible"}`,
|
|
78511
|
+
` ${String(review.sourceBytes)} bytes against ${quota} of database storage: ${review.fitsQuota ? "fits" : "does not fit"}`,
|
|
78512
|
+
` ${String(review.tableCount)} table(s)${review.tablesTruncated ? " (list truncated)" : ""}: ${review.tables.join(", ")}`,
|
|
78513
|
+
` ${review.replaces}`,
|
|
78514
|
+
review.blockedReason === null ? ` confirm with --confirmation ${review.recovery.inventoryDigest}` : ` BLOCKED: ${review.blockedReason}`
|
|
78515
|
+
].join("\n");
|
|
78516
|
+
}
|
|
78086
78517
|
// src/commands/environment-export-sources.ts
|
|
78087
78518
|
/** Refresh is an explicit write; reading its progress never starts another discovery Job. */
|
|
78088
78519
|
async function environmentExportSources(context, path, subcommand) {
|
|
@@ -78140,7 +78571,7 @@ async function releaseBundle(context, args) {
|
|
|
78140
78571
|
};
|
|
78141
78572
|
}
|
|
78142
78573
|
// src/commands/environment-exports.ts
|
|
78143
|
-
var USAGE$
|
|
78574
|
+
var USAGE$27 = [
|
|
78144
78575
|
"Usage: hostingctl environment export-sources <environment-uuid> --company <slug>",
|
|
78145
78576
|
" hostingctl environment export-sources-refresh <environment-uuid> --company <slug>",
|
|
78146
78577
|
" hostingctl environment export-create <environment-uuid> <source-id> --company <slug>",
|
|
@@ -78152,6 +78583,7 @@ var USAGE$26 = [
|
|
|
78152
78583
|
" hostingctl environment database-backup-schedule-stop <environment-uuid> <schedule-uuid> --company <slug>",
|
|
78153
78584
|
" hostingctl environment database-export-download <environment-uuid> <export-uuid> --company <slug>",
|
|
78154
78585
|
" hostingctl environment database-export-remove <environment-uuid> <export-uuid> --company <slug>",
|
|
78586
|
+
...DATABASE_IMPORT_USAGE,
|
|
78155
78587
|
" hostingctl environment release-bundle <release-uuid> --environment <uuid> --application <uuid> --company <slug> --out <new-file>",
|
|
78156
78588
|
"",
|
|
78157
78589
|
" export-sources Retained database backups and file snapshots available for export.",
|
|
@@ -78165,6 +78597,9 @@ var USAGE$26 = [
|
|
|
78165
78597
|
" database-backup-schedule-stop Stop one repeating backup. Its exports stay.",
|
|
78166
78598
|
" database-export-download A time-limited URL for a finished export, and the tool that restores it.",
|
|
78167
78599
|
" database-export-remove Retire one export early.",
|
|
78600
|
+
" database-import Review importing a finished backup from another host into a Moodle application's",
|
|
78601
|
+
" database: what is replaced, and that the current data is captured first.",
|
|
78602
|
+
" database-import-confirm Confirm that review with its digest. Other applications are backup only.",
|
|
78168
78603
|
" release-bundle The recorded bundle for one release.",
|
|
78169
78604
|
"",
|
|
78170
78605
|
"These are portable exports the customer asked for, not the platform's own backup track: the URL is the",
|
|
@@ -78174,7 +78609,7 @@ var USAGE$26 = [
|
|
|
78174
78609
|
async function environmentExports(context, subcommand, rest) {
|
|
78175
78610
|
if (subcommand === "release-bundle") return await releaseBundle(context, rest);
|
|
78176
78611
|
const [environmentUuid, ...tail] = rest;
|
|
78177
|
-
const path = await environmentPath$1(context, environmentUuid, USAGE$
|
|
78612
|
+
const path = await environmentPath$1(context, environmentUuid, USAGE$27);
|
|
78178
78613
|
if (subcommand === "export-sources" || subcommand === "export-sources-refresh") {
|
|
78179
78614
|
noExtra$10(tail);
|
|
78180
78615
|
return await environmentExportSources(context, path, subcommand);
|
|
@@ -78193,14 +78628,15 @@ async function environmentExports(context, subcommand, rest) {
|
|
|
78193
78628
|
noExtra$10(tail);
|
|
78194
78629
|
return await listBackupSchedules(path);
|
|
78195
78630
|
}
|
|
78196
|
-
if (subcommand === "database-backup-schedule-stop") return await stopBackupSchedule(context, path, tail, USAGE$
|
|
78631
|
+
if (subcommand === "database-backup-schedule-stop") return await stopBackupSchedule(context, path, tail, USAGE$27);
|
|
78632
|
+
if (subcommand === "database-import" || subcommand === "database-import-confirm") return await databaseImport(context, path, subcommand, tail, USAGE$27);
|
|
78197
78633
|
if (subcommand === "database-export-download") return await download(path, tail);
|
|
78198
78634
|
if (subcommand === "database-export-remove") return await remove$2(context, path, tail);
|
|
78199
|
-
throw new UsageError(USAGE$
|
|
78635
|
+
throw new UsageError(USAGE$27);
|
|
78200
78636
|
}
|
|
78201
78637
|
async function createRetained(context, path, rest) {
|
|
78202
78638
|
const [sourceId, ...extra] = rest;
|
|
78203
|
-
if (!sourceId || extra.length > 0) throw new UsageError(USAGE$
|
|
78639
|
+
if (!sourceId || extra.length > 0) throw new UsageError(USAGE$27);
|
|
78204
78640
|
return {
|
|
78205
78641
|
kind: "export-write",
|
|
78206
78642
|
outcome: await confirmableWrite(context, `Prepare a download from retained source ${sourceId}. Its capture, scope and expiry remain those recorded by the platform.`, async () => (await hostingExportStore({
|
|
@@ -78210,7 +78646,7 @@ async function createRetained(context, path, rest) {
|
|
|
78210
78646
|
};
|
|
78211
78647
|
}
|
|
78212
78648
|
async function create(context, path, rest) {
|
|
78213
|
-
const databaseUuid = oneUuid$7(rest, USAGE$
|
|
78649
|
+
const databaseUuid = oneUuid$7(rest, USAGE$27);
|
|
78214
78650
|
return {
|
|
78215
78651
|
kind: "export-write",
|
|
78216
78652
|
outcome: await confirmableWrite(context, "Take a portable export of this database now. It is downloadable until its expiry.", async () => {
|
|
@@ -78226,7 +78662,7 @@ async function create(context, path, rest) {
|
|
|
78226
78662
|
}
|
|
78227
78663
|
/** `database-backup <env> <connection>`: back up a database on another host into an export of this environment. */
|
|
78228
78664
|
async function backup(context, path, rest) {
|
|
78229
|
-
const connection = oneUuid$7(rest, USAGE$
|
|
78665
|
+
const connection = oneUuid$7(rest, USAGE$27);
|
|
78230
78666
|
if ([
|
|
78231
78667
|
"--schedule",
|
|
78232
78668
|
"--timezone",
|
|
@@ -78247,7 +78683,7 @@ async function backup(context, path, rest) {
|
|
|
78247
78683
|
}
|
|
78248
78684
|
/** `database-export-download <env> <export>`: a time-limited URL, which is the customer's copy. */
|
|
78249
78685
|
async function download(path, rest) {
|
|
78250
|
-
const exportUuid = oneUuid$7(rest, USAGE$
|
|
78686
|
+
const exportUuid = oneUuid$7(rest, USAGE$27);
|
|
78251
78687
|
return {
|
|
78252
78688
|
kind: "download",
|
|
78253
78689
|
download: (await hostingDatabaseExportDownload({ path: {
|
|
@@ -78257,7 +78693,7 @@ async function download(path, rest) {
|
|
|
78257
78693
|
};
|
|
78258
78694
|
}
|
|
78259
78695
|
async function remove$2(context, path, rest) {
|
|
78260
|
-
const exportUuid = oneUuid$7(rest, USAGE$
|
|
78696
|
+
const exportUuid = oneUuid$7(rest, USAGE$27);
|
|
78261
78697
|
return {
|
|
78262
78698
|
kind: "export-write",
|
|
78263
78699
|
outcome: await confirmableWrite(context, `Retire export ${exportUuid}. Its URL stops working once it is gone.`, async () => (await hostingDatabaseExportDestroy({ path: {
|
|
@@ -78267,7 +78703,7 @@ async function remove$2(context, path, rest) {
|
|
|
78267
78703
|
};
|
|
78268
78704
|
}
|
|
78269
78705
|
function noExtra$10(rest) {
|
|
78270
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
78706
|
+
if (rest.length > 0) throw new UsageError(USAGE$27);
|
|
78271
78707
|
}
|
|
78272
78708
|
function exportLine(one) {
|
|
78273
78709
|
const size = one.sizeBytes === null ? "" : ` ${String(Math.round(one.sizeBytes / 1024))} KiB`;
|
|
@@ -78277,6 +78713,7 @@ function exportLine(one) {
|
|
|
78277
78713
|
function environmentExportText(report) {
|
|
78278
78714
|
if (report.kind === "source-refresh" || report.kind === "sources") return environmentExportSourcesText(report);
|
|
78279
78715
|
if (report.kind === "backup-schedules" || report.kind === "backup-schedule-write") return backupScheduleText(report);
|
|
78716
|
+
if (report.kind === "database-import-review" || report.kind === "database-import-write") return databaseImportText(report);
|
|
78280
78717
|
if (report.kind === "export-write") {
|
|
78281
78718
|
const { outcome } = report;
|
|
78282
78719
|
if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
|
|
@@ -78356,6 +78793,89 @@ function diagnosisText(result) {
|
|
|
78356
78793
|
function environmentMailRelayText(report) {
|
|
78357
78794
|
return renderWriteOutcome(report.outcome, diagnosisText);
|
|
78358
78795
|
}
|
|
78796
|
+
// src/commands/environment-mode.ts
|
|
78797
|
+
var USAGE$26 = [
|
|
78798
|
+
"Usage: hostingctl environment mode review <environment-uuid> --company <slug> --to <live|test>",
|
|
78799
|
+
" hostingctl environment mode set <environment-uuid> --company <slug> --to live --data-handover <handover>",
|
|
78800
|
+
" hostingctl environment mode set <environment-uuid> --company <slug> --to test",
|
|
78801
|
+
"",
|
|
78802
|
+
" review What making the environment live (or returning it to test protection) changes, and whether it",
|
|
78803
|
+
" may be confirmed now.",
|
|
78804
|
+
" set Record the change against the generation the review read. A change to the environment since",
|
|
78805
|
+
" then is refused, so review again. Needs --confirm; --dry-run describes it without sending it.",
|
|
78806
|
+
"",
|
|
78807
|
+
" --data-handover Going live only: how the tested copy relates to the original site.",
|
|
78808
|
+
" test_copy_is_current the copy holds everything that should go live",
|
|
78809
|
+
" refreshed_from_source the original was restored into this environment again just before",
|
|
78810
|
+
"",
|
|
78811
|
+
"Going live does not move a domain or turn site sign-in off; the review says what to do for each."
|
|
78812
|
+
].join("\n");
|
|
78813
|
+
var MODES$1 = ["live", "test"];
|
|
78814
|
+
var HANDOVERS = ["test_copy_is_current", "refreshed_from_source"];
|
|
78815
|
+
/** The flags this group reads, published by the environment group's metadata. */
|
|
78816
|
+
var MODE_FLAG_SPECS = [{
|
|
78817
|
+
name: "--data-handover",
|
|
78818
|
+
takesValue: true,
|
|
78819
|
+
description: "`mode set --to live`: test_copy_is_current or refreshed_from_source."
|
|
78820
|
+
}];
|
|
78821
|
+
/** `environment mode review|set`. */
|
|
78822
|
+
async function environmentMode(context, rest) {
|
|
78823
|
+
const [action, environmentUuid, ...extra] = rest;
|
|
78824
|
+
if (action === void 0 || extra.length > 0) throw new UsageError(USAGE$26);
|
|
78825
|
+
const path = await environmentPath$1(context, environmentUuid, USAGE$26);
|
|
78826
|
+
const target = oneOf(context.flags.get("--to"), MODES$1, "--to");
|
|
78827
|
+
if (action === "review") return {
|
|
78828
|
+
kind: "mode-review",
|
|
78829
|
+
review: (await hostingEnvironmentsModeReview({
|
|
78830
|
+
path,
|
|
78831
|
+
query: { mode: target }
|
|
78832
|
+
})).data
|
|
78833
|
+
};
|
|
78834
|
+
if (action === "set") return await set$1(context, path, target);
|
|
78835
|
+
throw new UsageError(USAGE$26);
|
|
78836
|
+
}
|
|
78837
|
+
async function set$1(context, path, target) {
|
|
78838
|
+
const handover = target === "live" ? oneOf(context.flags.get("--data-handover"), HANDOVERS, "--data-handover") : null;
|
|
78839
|
+
return {
|
|
78840
|
+
kind: "mode-write",
|
|
78841
|
+
outcome: await confirmableWrite(context, target === "live" ? `Make this environment live (${handover}): real mail, outside services and scheduled tasks switch on.` : "Return this environment to test protection: mail is captured and outside services are blocked from now on.", async () => {
|
|
78842
|
+
const { desiredGeneration } = (await hostingEnvironmentsModeReview({
|
|
78843
|
+
path,
|
|
78844
|
+
query: { mode: target }
|
|
78845
|
+
})).data;
|
|
78846
|
+
return (await hostingEnvironmentsModeUpdate({
|
|
78847
|
+
path,
|
|
78848
|
+
body: {
|
|
78849
|
+
mode: target,
|
|
78850
|
+
desiredGeneration,
|
|
78851
|
+
...handover === null ? {} : { dataHandover: handover }
|
|
78852
|
+
}
|
|
78853
|
+
})).data;
|
|
78854
|
+
})
|
|
78855
|
+
};
|
|
78856
|
+
}
|
|
78857
|
+
function oneOf(value, allowed, flag) {
|
|
78858
|
+
const chosen = allowed.find((one) => one === value?.trim());
|
|
78859
|
+
if (chosen === void 0) throw new UsageError(`${flag} must be one of ${allowed.join(", ")}.\n\n${USAGE$26}`);
|
|
78860
|
+
return chosen;
|
|
78861
|
+
}
|
|
78862
|
+
/** The `environment mode …` renderer. */
|
|
78863
|
+
function environmentModeText(report) {
|
|
78864
|
+
if (report.kind === "mode-write") {
|
|
78865
|
+
const { outcome } = report;
|
|
78866
|
+
if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
|
|
78867
|
+
return `${outcome.description}\nRecorded: this environment is now ${outcome.result.mode}; the change is applying.`;
|
|
78868
|
+
}
|
|
78869
|
+
const { review } = report;
|
|
78870
|
+
return [
|
|
78871
|
+
`Mode: ${review.currentMode} -> ${review.targetMode} (generation ${review.desiredGeneration})`,
|
|
78872
|
+
review.blockedReason === null ? "May be confirmed now." : `Refused now: ${review.blockedReason}`,
|
|
78873
|
+
...review.changes.map((change) => ` ${change.area}: ${change.before} -> ${change.after}`),
|
|
78874
|
+
...review.addresses.length > 0 ? [`Addresses: ${review.addresses.join(", ")}`] : [],
|
|
78875
|
+
...review.warnings.map((warning) => `! ${warning}`),
|
|
78876
|
+
...review.dataHandoverRequired ? ["Going live needs --data-handover."] : []
|
|
78877
|
+
].join("\n");
|
|
78878
|
+
}
|
|
78359
78879
|
// src/commands/environment-runtime-version-grants.ts
|
|
78360
78880
|
/**
|
|
78361
78881
|
* The flags this command reads, declared beside it so the metadata owner spreads one list rather than
|
|
@@ -78570,6 +79090,7 @@ var ENVIRONMENT_SUBCOMMANDS = [
|
|
|
78570
79090
|
"redirect-set",
|
|
78571
79091
|
"redirect-remove",
|
|
78572
79092
|
"tools",
|
|
79093
|
+
"mode",
|
|
78573
79094
|
"export-sources",
|
|
78574
79095
|
"export-sources-refresh",
|
|
78575
79096
|
"export-create",
|
|
@@ -78580,6 +79101,8 @@ var ENVIRONMENT_SUBCOMMANDS = [
|
|
|
78580
79101
|
"database-backup-schedule-stop",
|
|
78581
79102
|
"database-export-download",
|
|
78582
79103
|
"database-export-remove",
|
|
79104
|
+
"database-import",
|
|
79105
|
+
"database-import-confirm",
|
|
78583
79106
|
"release-bundle",
|
|
78584
79107
|
"service-add-review",
|
|
78585
79108
|
"service-add",
|
|
@@ -79407,23 +79930,23 @@ function list$5(values) {
|
|
|
79407
79930
|
var ENVIRONMENT_TOPICS = [
|
|
79408
79931
|
{
|
|
79409
79932
|
path: ["retention"],
|
|
79410
|
-
usage: USAGE$
|
|
79933
|
+
usage: USAGE$31
|
|
79411
79934
|
},
|
|
79412
79935
|
{
|
|
79413
79936
|
path: ["retention-set"],
|
|
79414
|
-
usage: USAGE$
|
|
79937
|
+
usage: USAGE$31
|
|
79415
79938
|
},
|
|
79416
79939
|
{
|
|
79417
79940
|
path: ["database-show"],
|
|
79418
|
-
usage: USAGE$
|
|
79941
|
+
usage: USAGE$31
|
|
79419
79942
|
},
|
|
79420
79943
|
{
|
|
79421
79944
|
path: ["database-reveal"],
|
|
79422
|
-
usage: USAGE$
|
|
79945
|
+
usage: USAGE$31
|
|
79423
79946
|
},
|
|
79424
79947
|
{
|
|
79425
79948
|
path: ["tuning"],
|
|
79426
|
-
usage: USAGE$
|
|
79949
|
+
usage: USAGE$31
|
|
79427
79950
|
},
|
|
79428
79951
|
{
|
|
79429
79952
|
path: ["configuration"],
|
|
@@ -79451,87 +79974,95 @@ var ENVIRONMENT_TOPICS = [
|
|
|
79451
79974
|
},
|
|
79452
79975
|
{
|
|
79453
79976
|
path: ["domains"],
|
|
79454
|
-
usage: USAGE$
|
|
79977
|
+
usage: USAGE$28
|
|
79455
79978
|
},
|
|
79456
79979
|
{
|
|
79457
79980
|
path: ["domain-add"],
|
|
79458
|
-
usage: USAGE$
|
|
79981
|
+
usage: USAGE$28
|
|
79459
79982
|
},
|
|
79460
79983
|
{
|
|
79461
79984
|
path: ["domain-verify"],
|
|
79462
|
-
usage: USAGE$
|
|
79985
|
+
usage: USAGE$28
|
|
79463
79986
|
},
|
|
79464
79987
|
{
|
|
79465
79988
|
path: ["domain-check-routing"],
|
|
79466
|
-
usage: USAGE$
|
|
79989
|
+
usage: USAGE$28
|
|
79467
79990
|
},
|
|
79468
79991
|
{
|
|
79469
79992
|
path: ["domain-intended"],
|
|
79470
|
-
usage: USAGE$
|
|
79993
|
+
usage: USAGE$28
|
|
79471
79994
|
},
|
|
79472
79995
|
{
|
|
79473
79996
|
path: ["domain-primary"],
|
|
79474
|
-
usage: USAGE$
|
|
79997
|
+
usage: USAGE$28
|
|
79475
79998
|
},
|
|
79476
79999
|
{
|
|
79477
80000
|
path: ["domain-remove"],
|
|
79478
|
-
usage: USAGE$
|
|
80001
|
+
usage: USAGE$28
|
|
79479
80002
|
},
|
|
79480
80003
|
{
|
|
79481
80004
|
path: ["redirects"],
|
|
79482
|
-
usage: USAGE$
|
|
80005
|
+
usage: USAGE$28
|
|
79483
80006
|
},
|
|
79484
80007
|
{
|
|
79485
80008
|
path: ["redirect-set"],
|
|
79486
|
-
usage: USAGE$
|
|
80009
|
+
usage: USAGE$28
|
|
79487
80010
|
},
|
|
79488
80011
|
{
|
|
79489
80012
|
path: ["redirect-remove"],
|
|
79490
|
-
usage: USAGE$
|
|
80013
|
+
usage: USAGE$28
|
|
79491
80014
|
},
|
|
79492
80015
|
{
|
|
79493
80016
|
path: ["export-sources"],
|
|
79494
|
-
usage: USAGE$
|
|
80017
|
+
usage: USAGE$27
|
|
79495
80018
|
},
|
|
79496
80019
|
{
|
|
79497
80020
|
path: ["export-sources-refresh"],
|
|
79498
|
-
usage: USAGE$
|
|
80021
|
+
usage: USAGE$27
|
|
79499
80022
|
},
|
|
79500
80023
|
{
|
|
79501
80024
|
path: ["export-create"],
|
|
79502
|
-
usage: USAGE$
|
|
80025
|
+
usage: USAGE$27
|
|
79503
80026
|
},
|
|
79504
80027
|
{
|
|
79505
80028
|
path: ["database-exports"],
|
|
79506
|
-
usage: USAGE$
|
|
80029
|
+
usage: USAGE$27
|
|
79507
80030
|
},
|
|
79508
80031
|
{
|
|
79509
80032
|
path: ["database-export-create"],
|
|
79510
|
-
usage: USAGE$
|
|
80033
|
+
usage: USAGE$27
|
|
79511
80034
|
},
|
|
79512
80035
|
{
|
|
79513
80036
|
path: ["database-backup"],
|
|
79514
|
-
usage: USAGE$
|
|
80037
|
+
usage: USAGE$27
|
|
79515
80038
|
},
|
|
79516
80039
|
{
|
|
79517
80040
|
path: ["database-backup-schedules"],
|
|
79518
|
-
usage: USAGE$
|
|
80041
|
+
usage: USAGE$27
|
|
79519
80042
|
},
|
|
79520
80043
|
{
|
|
79521
80044
|
path: ["database-backup-schedule-stop"],
|
|
79522
|
-
usage: USAGE$
|
|
80045
|
+
usage: USAGE$27
|
|
79523
80046
|
},
|
|
79524
80047
|
{
|
|
79525
80048
|
path: ["database-export-download"],
|
|
79526
|
-
usage: USAGE$
|
|
80049
|
+
usage: USAGE$27
|
|
79527
80050
|
},
|
|
79528
80051
|
{
|
|
79529
80052
|
path: ["database-export-remove"],
|
|
79530
|
-
usage: USAGE$
|
|
80053
|
+
usage: USAGE$27
|
|
80054
|
+
},
|
|
80055
|
+
{
|
|
80056
|
+
path: ["database-import"],
|
|
80057
|
+
usage: USAGE$27
|
|
80058
|
+
},
|
|
80059
|
+
{
|
|
80060
|
+
path: ["database-import-confirm"],
|
|
80061
|
+
usage: USAGE$27
|
|
79531
80062
|
},
|
|
79532
80063
|
{
|
|
79533
80064
|
path: ["release-bundle"],
|
|
79534
|
-
usage: USAGE$
|
|
80065
|
+
usage: USAGE$27
|
|
79535
80066
|
},
|
|
79536
80067
|
{
|
|
79537
80068
|
path: ["service-add-review"],
|
|
@@ -79577,6 +80108,10 @@ var ENVIRONMENT_TOPICS = [
|
|
|
79577
80108
|
path: ["tools"],
|
|
79578
80109
|
usage: USAGE$21
|
|
79579
80110
|
},
|
|
80111
|
+
{
|
|
80112
|
+
path: ["mode"],
|
|
80113
|
+
usage: USAGE$26
|
|
80114
|
+
},
|
|
79580
80115
|
{
|
|
79581
80116
|
path: ["runtime-versions"],
|
|
79582
80117
|
usage: USAGE$24
|
|
@@ -79610,6 +80145,7 @@ var ENVIRONMENT_METADATA = {
|
|
|
79610
80145
|
description: "The cache starting pattern: wordpress, static_build or application_headers."
|
|
79611
80146
|
},
|
|
79612
80147
|
...RUNTIME_VERSION_GRANT_FLAG_SPECS,
|
|
80148
|
+
...MODE_FLAG_SPECS,
|
|
79613
80149
|
...SETUP_FLAG_SPECS,
|
|
79614
80150
|
{
|
|
79615
80151
|
name: "--enabled",
|
|
@@ -79704,7 +80240,7 @@ var ENVIRONMENT_METADATA = {
|
|
|
79704
80240
|
{
|
|
79705
80241
|
name: "--to",
|
|
79706
80242
|
takesValue: true,
|
|
79707
|
-
description: "
|
|
80243
|
+
description: "`mail-relay-test`: the address to send to. `mode`: live or test."
|
|
79708
80244
|
},
|
|
79709
80245
|
{
|
|
79710
80246
|
name: "--wait",
|
|
@@ -79855,6 +80391,11 @@ var ENVIRONMENT_METADATA = {
|
|
|
79855
80391
|
name: "--until",
|
|
79856
80392
|
takesValue: true,
|
|
79857
80393
|
description: "database-backup: the date and time, with a zone, after which no backup starts."
|
|
80394
|
+
},
|
|
80395
|
+
{
|
|
80396
|
+
name: "--confirmation",
|
|
80397
|
+
takesValue: true,
|
|
80398
|
+
description: "database-import-confirm: the review's digest, from its `confirm with` line."
|
|
79858
80399
|
}
|
|
79859
80400
|
],
|
|
79860
80401
|
subcommands: ENVIRONMENT_SUBCOMMANDS
|
|
@@ -80480,13 +81021,14 @@ function storageJournalText(journal) {
|
|
|
80480
81021
|
function environmentTaggedText(report) {
|
|
80481
81022
|
if (report.kind === "secret-reveal") return renderWriteOutcome(report.outcome, (result) => `Saved ${result.name} to ${result.savedTo} (mode 600).`);
|
|
80482
81023
|
if (report.kind === "activation") return renderWriteOutcome(report.outcome, (result) => JSON.stringify(result, null, 2));
|
|
81024
|
+
if (report.kind === "mode-review" || report.kind === "mode-write") return environmentModeText(report);
|
|
80483
81025
|
return featureText(report);
|
|
80484
81026
|
}
|
|
80485
81027
|
function featureText(report) {
|
|
80486
81028
|
if (report.kind === "domains" || report.kind === "redirects" || report.kind === "domain-write") return environmentDomainText(report);
|
|
80487
81029
|
if (report.kind === "site-access" || report.kind === "site-users" || report.kind === "site-write") return siteAccessText(report);
|
|
80488
81030
|
if (report.kind === "tool" || report.kind === "tools-write") return environmentToolsText(report);
|
|
80489
|
-
if (report.kind === "sources" || report.kind === "source-refresh" || report.kind === "exports" || report.kind === "download" || report.kind === "bundle" || report.kind === "export-write" || report.kind === "backup-schedules" || report.kind === "backup-schedule-write") return environmentExportText(report);
|
|
81031
|
+
if (report.kind === "sources" || report.kind === "source-refresh" || report.kind === "exports" || report.kind === "download" || report.kind === "bundle" || report.kind === "export-write" || report.kind === "backup-schedules" || report.kind === "backup-schedule-write" || report.kind === "database-import-review" || report.kind === "database-import-write") return environmentExportText(report);
|
|
80490
81032
|
if (report.kind === "service-addition" || report.kind === "service-retirement" || report.kind === "service-write") return environmentServicesText(report);
|
|
80491
81033
|
if (report.kind === "site-insights" || report.kind === "site-insights-write") return environmentSiteInsightsText(report);
|
|
80492
81034
|
if (report.kind === "storage-journal") return storageJournalText(report.journal);
|
|
@@ -81057,6 +81599,7 @@ function oneUuid(rest) {
|
|
|
81057
81599
|
*/
|
|
81058
81600
|
var SIMPLE_SUBCOMMANDS = {
|
|
81059
81601
|
tools: environmentTools,
|
|
81602
|
+
mode: environmentMode,
|
|
81060
81603
|
activate: environmentActivation,
|
|
81061
81604
|
create: create$2,
|
|
81062
81605
|
setup,
|
|
@@ -81115,6 +81658,8 @@ var EXPORT_SUBCOMMANDS = /* @__PURE__ */ new Set([
|
|
|
81115
81658
|
"database-backup-schedule-stop",
|
|
81116
81659
|
"database-export-download",
|
|
81117
81660
|
"database-export-remove",
|
|
81661
|
+
"database-import",
|
|
81662
|
+
"database-import-confirm",
|
|
81118
81663
|
"release-bundle"
|
|
81119
81664
|
]);
|
|
81120
81665
|
/** The subcommands environment-site-access.ts owns: who may sign in to the sites, and how. */
|
|
@@ -82186,6 +82731,30 @@ function isFolder$1(path) {
|
|
|
82186
82731
|
return false;
|
|
82187
82732
|
}
|
|
82188
82733
|
}
|
|
82734
|
+
// src/commands/files-local-two-way-preview.ts
|
|
82735
|
+
/**
|
|
82736
|
+
* What a two-way sync would do, from `bisync --dry-run`'s per-file notices. Path1 is this computer and Path2 the
|
|
82737
|
+
* environment; each name says on which side it changed, and the change goes to the other side. Mirrors
|
|
82738
|
+
* `crates/hostingctl/src/commands/files_local/two_way_preview.rs`.
|
|
82739
|
+
*/
|
|
82740
|
+
function bisyncPreview(notices) {
|
|
82741
|
+
const shown = {
|
|
82742
|
+
adds: [],
|
|
82743
|
+
updates: [],
|
|
82744
|
+
deletes: [],
|
|
82745
|
+
kept: []
|
|
82746
|
+
};
|
|
82747
|
+
for (const notice of notices) {
|
|
82748
|
+
const found = /^- (Path1|Path2)\s+(File is new|File changed|File was deleted)[^-]*- (.+)$/.exec(notice);
|
|
82749
|
+
if (found === null) continue;
|
|
82750
|
+
const [, side, change, name] = found;
|
|
82751
|
+
const entry = `${side === "Path1" ? "here" : "environment"}: ${name?.trim() ?? ""}`;
|
|
82752
|
+
if (change === "File is new") shown.adds.push(entry);
|
|
82753
|
+
else if (change === "File changed") shown.updates.push(entry);
|
|
82754
|
+
else shown.deletes.push(entry);
|
|
82755
|
+
}
|
|
82756
|
+
return shown;
|
|
82757
|
+
}
|
|
82189
82758
|
// src/commands/files-local-two-way.ts
|
|
82190
82759
|
/**
|
|
82191
82760
|
* `files sync <env-path> <local-folder> --two-way`: rclone bisync between a folder on this computer and one in the
|
|
@@ -82195,13 +82764,7 @@ function isFolder$1(path) {
|
|
|
82195
82764
|
/** The linked folder's own state: never synced, pulled or pushed. */
|
|
82196
82765
|
var STATE_FOLDER = ".hostingctl";
|
|
82197
82766
|
async function twoWayCommand(context, rest) {
|
|
82198
|
-
|
|
82199
|
-
const [remoteRaw, localRaw, extra] = rest;
|
|
82200
|
-
if (remoteRaw === void 0 || localRaw === void 0 || extra !== void 0) throw new UsageError(FILES_LOCAL_USAGE);
|
|
82201
|
-
if (localRaw.startsWith(`env:`)) throw new UsageError("Name the environment folder first, then the folder on this computer: hostingctl files sync env:/path ./folder --two-way");
|
|
82202
|
-
const remote = environmentPath(remoteRaw);
|
|
82203
|
-
const local = resolve(localRaw);
|
|
82204
|
-
if (!isFolder(local)) throw new UsageError(`${local} is not a folder on this computer.`);
|
|
82767
|
+
const { remote, local } = folders(context, rest);
|
|
82205
82768
|
const percent = maxDeletePercent(context);
|
|
82206
82769
|
const link = {
|
|
82207
82770
|
environment: requiredFlag$4(context, "--environment", FILES_LOCAL_USAGE),
|
|
@@ -82212,11 +82775,38 @@ async function twoWayCommand(context, rest) {
|
|
|
82212
82775
|
const rules = context.flags.has("--with-wp-config") ? DEFAULT_FILTERS : [...DEFAULT_FILTERS, PUSH_PROTECTED];
|
|
82213
82776
|
const workdir = join(local, STATE_FOLDER, "sync");
|
|
82214
82777
|
const resync = context.flags.has("--resync") || linked === null || !hasListings(workdir);
|
|
82215
|
-
|
|
82778
|
+
const description = `Sync ${local} and ${shownPath(remote)} both ways: ${resync ? "copy each side's missing and newer files to the other, deleting nothing" : "copy the changes and deletions made on either side since the last sync"}. A file changed on both sides keeps both copies. Refuses to delete more than ${String(percent)}% of either side. Left out: ${leftOut(rules)}.`;
|
|
82779
|
+
const args = twoWayArguments(local, remoteSpec(remote), workdir, rules, percent, resync);
|
|
82780
|
+
if (context.flags.has("--preview")) {
|
|
82781
|
+
loginFlags(context);
|
|
82782
|
+
const session = await openSession(context, "sync");
|
|
82783
|
+
if ("kind" in session) return session;
|
|
82784
|
+
const run = await session.run([...args, "--dry-run"]);
|
|
82785
|
+
const counts = resync ? run.stats : null;
|
|
82786
|
+
return {
|
|
82787
|
+
...twoWayResult(run, local),
|
|
82788
|
+
preview: bisyncPreview(run.notices),
|
|
82789
|
+
transferred: counts
|
|
82790
|
+
};
|
|
82791
|
+
}
|
|
82792
|
+
return await engineWrite(context, "sync", description, async (session) => {
|
|
82216
82793
|
writeLink(local, link);
|
|
82217
|
-
return twoWayResult(await session.run(
|
|
82794
|
+
return twoWayResult(await session.run(args), local);
|
|
82218
82795
|
});
|
|
82219
82796
|
}
|
|
82797
|
+
/** The environment folder and the local folder a sync names, refused before anything is read. */
|
|
82798
|
+
function folders(context, rest) {
|
|
82799
|
+
if (!context.flags.has("--two-way")) throw new UsageError("files sync changes both sides, so it needs --two-way. To copy one way, use files pull or files push.");
|
|
82800
|
+
const [remoteRaw, localRaw, extra] = rest;
|
|
82801
|
+
if (remoteRaw === void 0 || localRaw === void 0 || extra !== void 0) throw new UsageError(FILES_LOCAL_USAGE);
|
|
82802
|
+
if (localRaw.startsWith(`env:`)) throw new UsageError("Name the environment folder first, then the folder on this computer: hostingctl files sync env:/path ./folder --two-way");
|
|
82803
|
+
const local = resolve(localRaw);
|
|
82804
|
+
if (!isFolder(local)) throw new UsageError(`${local} is not a folder on this computer.`);
|
|
82805
|
+
return {
|
|
82806
|
+
remote: environmentPath(remoteRaw),
|
|
82807
|
+
local
|
|
82808
|
+
};
|
|
82809
|
+
}
|
|
82220
82810
|
/** One bisync run as the report: its refusals named, and every conflict copy now in the folder listed. */
|
|
82221
82811
|
function twoWayResult(run, local) {
|
|
82222
82812
|
const result = {
|
|
@@ -86117,6 +86707,7 @@ function describeConnection$2(one) {
|
|
|
86117
86707
|
const speed = one.speedLimit ?? "off";
|
|
86118
86708
|
const requests = one.requestsPerSecond === null ? "off" : String(one.requestsPerSecond);
|
|
86119
86709
|
const lines = [connectionLine(one), ` start folder ${one.startPath}; limits: ${String(one.connections)} at once, speed ${speed}, requests a second ${requests}, ${String(one.hostImports)} import(s) at once`];
|
|
86710
|
+
if (one.sshConnectionUuid) lines.push(` through SSH connection ${one.sshConnectionUuid}`);
|
|
86120
86711
|
if (one.lastFailureReason !== null) lines.push(` last check failed: ${one.lastFailureReason}`);
|
|
86121
86712
|
if (one.publicKey !== null) lines.push(" Add this public key on the old host:", ` ${one.publicKey}`);
|
|
86122
86713
|
if (one.status !== "verified" && one.status !== "revoked") lines.push(` Check it: \`hostingctl provider-connections check ${one.uuid} --environment <uuid> --wait --confirm\``);
|
|
@@ -86142,7 +86733,7 @@ function describeCheck$1(check) {
|
|
|
86142
86733
|
/** The database a site's configuration names, without its password (`--json` carries it). */
|
|
86143
86734
|
function siteDatabaseLines(site) {
|
|
86144
86735
|
const prefix = site.tablePrefix === null ? "" : `, table prefix ${site.tablePrefix}`;
|
|
86145
|
-
const route = site.sshNeeded ? "It listens only on the old server, so it
|
|
86736
|
+
const route = site.sshNeeded ? "It listens only on the old server, so add it through SSH: a database connection with sshConnectionUuid set to the site's SFTP connection." : "Add it as a database connection with these details; the password is in --json.";
|
|
86146
86737
|
return [`Site database (${site.application}, ${site.configFile}): ${site.kind} ${site.username}@${site.host}:${String(site.port)}/${site.name}${prefix}; password ${site.password === null ? "not found" : "found"}.`, route];
|
|
86147
86738
|
}
|
|
86148
86739
|
/** A provider answer as a person reads it. */
|
|
@@ -86203,6 +86794,7 @@ var USAGE$4 = [
|
|
|
86203
86794
|
"check --wait follows the check to its end, prints each stage as pass or FAIL, and exits 1 when it failed.",
|
|
86204
86795
|
"check --site-folder also reads that folder's wp-config.php, .env or config.php and reports the site's database.",
|
|
86205
86796
|
"Every write needs --confirm (check too); --dry-run sends nothing. Credentials occur only in private request files.",
|
|
86797
|
+
"A database reached through SSH names its SFTP connection as sshConnectionUuid in the request file.",
|
|
86206
86798
|
"Omit --file on rotate only for a generated-key connection. Only its public key is returned.",
|
|
86207
86799
|
"limits: [--preset normal|gentle|very-gentle] [--connections <1-8>] [--speed-limit <rate>]",
|
|
86208
86800
|
" [--requests-per-second <1-20>] [--host-imports <1-4>] [--retry-wait <30s>]",
|
|
@@ -86369,6 +86961,7 @@ function currentDefinition(current) {
|
|
|
86369
86961
|
name: current.name,
|
|
86370
86962
|
retention: current.retention,
|
|
86371
86963
|
certificateHost: current.certificateHost,
|
|
86964
|
+
sshConnectionUuid: current.sshConnectionUuid,
|
|
86372
86965
|
connections: current.connections,
|
|
86373
86966
|
hostImports: current.hostImports,
|
|
86374
86967
|
requestsPerSecond: current.requestsPerSecond,
|
|
@@ -88721,9 +89314,9 @@ var STORAGE_USAGE = [
|
|
|
88721
89314
|
" hostingctl storage unbind <bucket-uuid> --company <slug> --environment <uuid>",
|
|
88722
89315
|
" hostingctl storage adoption <bucket-uuid> --company <slug> [status]",
|
|
88723
89316
|
" hostingctl storage adoption <bucket-uuid> --company <slug> start --maintenance",
|
|
88724
|
-
" --retained-data [--confirm]",
|
|
89317
|
+
" --retained-data [--target-encryption none|sse_c] [--confirm]",
|
|
88725
89318
|
" hostingctl storage adoption <bucket-uuid> --company <slug> confirm --operation-id <id>",
|
|
88726
|
-
" --binding-generation <n> --capture-digest <digest> [--confirm]",
|
|
89319
|
+
" --binding-generation <n> --capture-digest <digest> [--target-encryption none|sse_c] [--confirm]",
|
|
88727
89320
|
" hostingctl storage adoption <bucket-uuid> --company <slug> captured [--marker <m>]",
|
|
88728
89321
|
" [--limit <n>]",
|
|
88729
89322
|
" hostingctl storage adoption <bucket-uuid> --company <slug> retained",
|
|
@@ -88907,6 +89500,11 @@ var STORAGE_METADATA = {
|
|
|
88907
89500
|
takesValue: false,
|
|
88908
89501
|
description: "Acknowledge that objects written to the old namespace after the capture freeze are retained rather than merged, which `storage adoption start` requires."
|
|
88909
89502
|
},
|
|
89503
|
+
{
|
|
89504
|
+
name: "--target-encryption",
|
|
89505
|
+
takesValue: true,
|
|
89506
|
+
description: "Adoption start or confirm: none or sse_c. Omit to keep the current mode; confirm sse_c explicitly when committing an encrypted capture."
|
|
89507
|
+
},
|
|
88910
89508
|
{
|
|
88911
89509
|
name: "--operation-id",
|
|
88912
89510
|
takesValue: true,
|
|
@@ -89105,6 +89703,11 @@ function ceilingCents(context) {
|
|
|
89105
89703
|
return cents;
|
|
89106
89704
|
}
|
|
89107
89705
|
// src/commands/storage-adoption-arguments.ts
|
|
89706
|
+
function targetEncryptionFlag(context) {
|
|
89707
|
+
const parsed = hostingStorageObjectEncryptionEnumSchema.optional().safeParse(context.flags.get("--target-encryption"));
|
|
89708
|
+
if (!parsed.success) throw new UsageError("--target-encryption must be none or sse_c.");
|
|
89709
|
+
return parsed.data;
|
|
89710
|
+
}
|
|
89108
89711
|
/**
|
|
89109
89712
|
* The arguments `storage adoption` reads, apart from the requests that use them.
|
|
89110
89713
|
*
|
|
@@ -89161,15 +89764,17 @@ function generationFlag(context, flag) {
|
|
|
89161
89764
|
*/
|
|
89162
89765
|
async function start(context, tail) {
|
|
89163
89766
|
const path = await bucketPath(context, tail);
|
|
89767
|
+
const targetEncryption = targetEncryptionFlag(context);
|
|
89164
89768
|
if (!context.flags.has("--maintenance") || !context.flags.has("--retained-data")) throw new UsageError(`start needs --maintenance and --retained-data: adopting the bucket pauses every client request to it until the new namespace is live, and whatever the old namespace still receives afterwards is retained rather than merged.\n\n${STORAGE_USAGE}`);
|
|
89165
|
-
return await confirmableWrite(context, startDescription(path)
|
|
89769
|
+
return await confirmableWrite(context, `${startDescription(path)} Target encryption: ${targetEncryption ?? "unchanged"}.`, async () => {
|
|
89166
89770
|
return {
|
|
89167
89771
|
kind: "adoption",
|
|
89168
89772
|
adoption: (await hostingStorageAdoptionStart({
|
|
89169
89773
|
path,
|
|
89170
89774
|
body: {
|
|
89171
89775
|
maintenanceConfirmed: true,
|
|
89172
|
-
retainedDataAcknowledged: true
|
|
89776
|
+
retainedDataAcknowledged: true,
|
|
89777
|
+
targetEncryption
|
|
89173
89778
|
}
|
|
89174
89779
|
})).data
|
|
89175
89780
|
};
|
|
@@ -89187,7 +89792,8 @@ async function confirm$1(context, tail) {
|
|
|
89187
89792
|
const body = {
|
|
89188
89793
|
operationId: requiredFlag$4(context, "--operation-id", STORAGE_USAGE),
|
|
89189
89794
|
bindingGeneration: generationFlag(context, "--binding-generation"),
|
|
89190
|
-
captureDigest: requiredFlag$4(context, "--capture-digest", STORAGE_USAGE)
|
|
89795
|
+
captureDigest: requiredFlag$4(context, "--capture-digest", STORAGE_USAGE),
|
|
89796
|
+
targetEncryption: targetEncryptionFlag(context)
|
|
89191
89797
|
};
|
|
89192
89798
|
return await confirmableWrite(context, confirmDescription(path, body.captureDigest), async () => {
|
|
89193
89799
|
return {
|
|
@@ -91722,7 +92328,7 @@ function writeUpdateState(state, env = process.env) {
|
|
|
91722
92328
|
} catch {}
|
|
91723
92329
|
}
|
|
91724
92330
|
// src/version.ts
|
|
91725
|
-
var VERSION = "1.0.
|
|
92331
|
+
var VERSION = "1.0.838";
|
|
91726
92332
|
// src/commands/update.ts
|
|
91727
92333
|
/**
|
|
91728
92334
|
* `update` — bring this copy of the CLI up to the published version.
|
|
@@ -91796,7 +92402,7 @@ var update = {
|
|
|
91796
92402
|
}, process.env);
|
|
91797
92403
|
return {
|
|
91798
92404
|
...known,
|
|
91799
|
-
current: after ?? "1.0.
|
|
92405
|
+
current: after ?? "1.0.838",
|
|
91800
92406
|
latest: after ?? latest,
|
|
91801
92407
|
upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
|
|
91802
92408
|
action: "run",
|
|
@@ -92082,7 +92688,7 @@ async function printUpdateNotice(options) {
|
|
|
92082
92688
|
}, env, { waitMs: NOTICE_LOCK_WAIT_MS });
|
|
92083
92689
|
} catch {}
|
|
92084
92690
|
if (latest === null) return;
|
|
92085
|
-
if (!isNewerVersion(latest, "1.0.
|
|
92691
|
+
if (!isNewerVersion(latest, "1.0.838")) return;
|
|
92086
92692
|
process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
|
|
92087
92693
|
}
|
|
92088
92694
|
/** Whether an environment variable is set to something, which is how CI and the opt-out are read. */
|
|
@@ -92110,10 +92716,14 @@ async function main(argv) {
|
|
|
92110
92716
|
if (command.name === login.name) return await dispatch(command, argv);
|
|
92111
92717
|
if (command.name === auth.name && isSessionlessAuthCommand(argv)) return isPublicAuthCommand(argv) ? await dispatchPublic(argv, command) : await dispatch(command, argv);
|
|
92112
92718
|
if (command.name === mailbox$1.name && isSessionlessMailboxCommand(argv)) return await dispatchPublic(argv, command);
|
|
92113
|
-
if (
|
|
92719
|
+
if (runsWithoutApi(command.name, argv)) return await dispatch(command, argv);
|
|
92114
92720
|
await configureTarget(argv);
|
|
92115
92721
|
return await dispatch(command, argv);
|
|
92116
92722
|
}
|
|
92723
|
+
/** The machine-only commands, and the `dev` lifecycle actions that run Docker here and never reach the API. */
|
|
92724
|
+
function runsWithoutApi(name, argv) {
|
|
92725
|
+
return commandsWithoutApi.has(name) || name === DEV_METADATA.name && isLocalDevCommand(argv);
|
|
92726
|
+
}
|
|
92117
92727
|
/**
|
|
92118
92728
|
* Run one command, and tell the client afterwards when a newer version is published.
|
|
92119
92729
|
*
|