@haakco/hostingctl 1.0.357 → 1.0.363
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +620 -525
- package/dist/main.js.map +1 -1
- package/package.json +6 -6
package/dist/main.js
CHANGED
|
@@ -7214,6 +7214,22 @@ function hostingSiteUsersEnable(options) {
|
|
|
7214
7214
|
}));
|
|
7215
7215
|
}
|
|
7216
7216
|
/**
|
|
7217
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/storage-usage}
|
|
7218
|
+
*/
|
|
7219
|
+
function hostingEnvironmentsStorageUsage(options) {
|
|
7220
|
+
const { client: request = client, ...config } = options;
|
|
7221
|
+
return withUnwrap(request({
|
|
7222
|
+
method: "GET",
|
|
7223
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/storage-usage",
|
|
7224
|
+
security: [{
|
|
7225
|
+
type: "http",
|
|
7226
|
+
scheme: "bearer"
|
|
7227
|
+
}],
|
|
7228
|
+
...config,
|
|
7229
|
+
throwOnError: config.throwOnError ?? true
|
|
7230
|
+
}));
|
|
7231
|
+
}
|
|
7232
|
+
/**
|
|
7217
7233
|
* {@link /c/:company/hosting/environments/:environmentUuid/tools/:tool}
|
|
7218
7234
|
*/
|
|
7219
7235
|
function hostingToolsUpdateSelection(options) {
|
|
@@ -8395,7 +8411,7 @@ function yahooFeedbackUpdate(options) {
|
|
|
8395
8411
|
}
|
|
8396
8412
|
//#endregion
|
|
8397
8413
|
//#region src/commands/auth-account.ts
|
|
8398
|
-
var USAGE$
|
|
8414
|
+
var USAGE$51 = [
|
|
8399
8415
|
"Usage: hostingctl auth closure show",
|
|
8400
8416
|
" hostingctl auth closure request --reason <text> (--current-password-file <path>|--current-password-stdin)",
|
|
8401
8417
|
" hostingctl auth picture set --image-file <path>",
|
|
@@ -8419,26 +8435,26 @@ async function account$1(context, subcommand, rest) {
|
|
|
8419
8435
|
if (subcommand === "closure") return await closure(context, action, tail);
|
|
8420
8436
|
if (subcommand === "picture") return await picture(context, action, tail);
|
|
8421
8437
|
if (subcommand === "notifications") return await notifications(context, action, tail);
|
|
8422
|
-
throw new UsageError(USAGE$
|
|
8438
|
+
throw new UsageError(USAGE$51);
|
|
8423
8439
|
}
|
|
8424
8440
|
/** `auth closure show|request`. */
|
|
8425
8441
|
async function closure(context, action, tail) {
|
|
8426
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
8442
|
+
if (tail.length > 0) throw new UsageError(USAGE$51);
|
|
8427
8443
|
if (action === "show") return (await accountClosureShow({})).data;
|
|
8428
8444
|
if (action === "request") return await closeAccount(context);
|
|
8429
|
-
throw new UsageError(USAGE$
|
|
8445
|
+
throw new UsageError(USAGE$51);
|
|
8430
8446
|
}
|
|
8431
8447
|
/** `auth picture set|remove`. */
|
|
8432
8448
|
async function picture(context, action, tail) {
|
|
8433
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
8449
|
+
if (tail.length > 0) throw new UsageError(USAGE$51);
|
|
8434
8450
|
if (action === "set") return await setPicture(context);
|
|
8435
8451
|
if (action === "remove") return await removePicture(context);
|
|
8436
|
-
throw new UsageError(USAGE$
|
|
8452
|
+
throw new UsageError(USAGE$51);
|
|
8437
8453
|
}
|
|
8438
8454
|
/** `auth notifications`, `read <id>` or `read-all`. */
|
|
8439
8455
|
async function notifications(context, action, tail) {
|
|
8440
8456
|
if (action === void 0) {
|
|
8441
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
8457
|
+
if (tail.length > 0) throw new UsageError(USAGE$51);
|
|
8442
8458
|
return await allPages(async (page, perPage) => {
|
|
8443
8459
|
const answer = await notificationIndex({ query: {
|
|
8444
8460
|
page,
|
|
@@ -8454,7 +8470,7 @@ async function notifications(context, action, tail) {
|
|
|
8454
8470
|
await notificationMarkAllRead({});
|
|
8455
8471
|
return null;
|
|
8456
8472
|
});
|
|
8457
|
-
if (action !== "read" || tail.length !== 1) throw new UsageError(USAGE$
|
|
8473
|
+
if (action !== "read" || tail.length !== 1) throw new UsageError(USAGE$51);
|
|
8458
8474
|
const notification = tail[0] ?? "";
|
|
8459
8475
|
return await confirmableWrite(context, `Mark notification ${notification} read.`, async () => {
|
|
8460
8476
|
await notificationMarkRead({ path: { notification } });
|
|
@@ -8470,11 +8486,11 @@ async function notifications(context, action, tail) {
|
|
|
8470
8486
|
*/
|
|
8471
8487
|
async function closeAccount(context) {
|
|
8472
8488
|
const reason = context.flags.get("--reason")?.trim() ?? "";
|
|
8473
|
-
if (reason === "") throw new UsageError(`closure request needs --reason.\n\n${USAGE$
|
|
8489
|
+
if (reason === "") throw new UsageError(`closure request needs --reason.\n\n${USAGE$51}`);
|
|
8474
8490
|
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 () => {
|
|
8475
8491
|
const review = (await accountClosureShow({})).data;
|
|
8476
8492
|
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"));
|
|
8477
|
-
const currentPassword = readSecret(context, "current-password", 1024, USAGE$
|
|
8493
|
+
const currentPassword = readSecret(context, "current-password", 1024, USAGE$51);
|
|
8478
8494
|
return (await accountClosureStore({ body: {
|
|
8479
8495
|
reason,
|
|
8480
8496
|
reviewedDigest: review.digest,
|
|
@@ -8486,7 +8502,7 @@ async function closeAccount(context) {
|
|
|
8486
8502
|
async function setPicture(context) {
|
|
8487
8503
|
const file = context.flags.get("--image-file") ?? "";
|
|
8488
8504
|
return await confirmableWrite(context, file === "" ? "Set the profile picture." : `Set the profile picture to ${file}.`, async () => {
|
|
8489
|
-
return (await profilePictureStore({ body: await imageUpload(file, USAGE$
|
|
8505
|
+
return (await profilePictureStore({ body: await imageUpload(file, USAGE$51) })).data;
|
|
8490
8506
|
});
|
|
8491
8507
|
}
|
|
8492
8508
|
/** `auth picture remove`. */
|
|
@@ -8497,7 +8513,7 @@ async function removePicture(context) {
|
|
|
8497
8513
|
}
|
|
8498
8514
|
//#endregion
|
|
8499
8515
|
//#region src/commands/auth-identity.ts
|
|
8500
|
-
var USAGE$
|
|
8516
|
+
var USAGE$50 = [
|
|
8501
8517
|
"Usage: hostingctl auth profile [--name <name>] [--email <email>] [--current-password-file <path>]",
|
|
8502
8518
|
" hostingctl auth password (--current-password-file <path>|--current-password-stdin) (--new-password-file <path>|--new-password-stdin)",
|
|
8503
8519
|
" hostingctl auth register --name <name> --email <email> (--password-file <path>|--password-stdin)",
|
|
@@ -8522,12 +8538,12 @@ var MAX_TOKEN_BYTES = 4096;
|
|
|
8522
8538
|
/** One required flag's value, or a refusal naming the flag. */
|
|
8523
8539
|
function required$3(context, flag) {
|
|
8524
8540
|
const value = context.flags.get(flag)?.trim() ?? "";
|
|
8525
|
-
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$
|
|
8541
|
+
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$50}`);
|
|
8526
8542
|
return value;
|
|
8527
8543
|
}
|
|
8528
8544
|
/** No positional arguments: every input here is a flag or a secret source. */
|
|
8529
8545
|
function noPositional(rest) {
|
|
8530
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
8546
|
+
if (rest.length > 0) throw new UsageError(USAGE$50);
|
|
8531
8547
|
}
|
|
8532
8548
|
/** The API's password contract takes a confirmation; the CLI's one input is the new password itself. */
|
|
8533
8549
|
function passwordBody(password) {
|
|
@@ -8550,16 +8566,16 @@ async function identity(context, subcommand, rest) {
|
|
|
8550
8566
|
if (subcommand === "forgot-password") return await forgotPassword(context);
|
|
8551
8567
|
if (subcommand === "reset-password") return await resetPassword(context);
|
|
8552
8568
|
if (subcommand === "verify-email") return await verifyEmail(context);
|
|
8553
|
-
throw new UsageError(USAGE$
|
|
8569
|
+
throw new UsageError(USAGE$50);
|
|
8554
8570
|
}
|
|
8555
8571
|
/** `auth profile`: the account's own name and email, with the current password only when the email changes. */
|
|
8556
8572
|
async function profile$1(context) {
|
|
8557
8573
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
8558
8574
|
const email = context.flags.get("--email")?.trim() ?? "";
|
|
8559
|
-
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$
|
|
8575
|
+
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$50}`);
|
|
8560
8576
|
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 () => {
|
|
8561
8577
|
const current = (await authMe({})).data;
|
|
8562
|
-
const currentPassword = hasSecret(context, "current-password") ? readSecret(context, "current-password", MAX_PASSWORD_BYTES, USAGE$
|
|
8578
|
+
const currentPassword = hasSecret(context, "current-password") ? readSecret(context, "current-password", MAX_PASSWORD_BYTES, USAGE$50) : void 0;
|
|
8563
8579
|
return (await authUpdateProfile({ body: {
|
|
8564
8580
|
name: name === "" ? current.name ?? "" : name,
|
|
8565
8581
|
email: email === "" ? current.email ?? "" : email,
|
|
@@ -8575,8 +8591,8 @@ function hasSecret(context, name) {
|
|
|
8575
8591
|
async function password$1(context) {
|
|
8576
8592
|
return await confirmableWrite(context, "Change the account's password.", async () => {
|
|
8577
8593
|
return (await authChangePassword({ body: {
|
|
8578
|
-
currentPassword: readSecret(context, "current-password", MAX_PASSWORD_BYTES, USAGE$
|
|
8579
|
-
...passwordBody(readSecret(context, "new-password", MAX_PASSWORD_BYTES, USAGE$
|
|
8594
|
+
currentPassword: readSecret(context, "current-password", MAX_PASSWORD_BYTES, USAGE$50),
|
|
8595
|
+
...passwordBody(readSecret(context, "new-password", MAX_PASSWORD_BYTES, USAGE$50))
|
|
8580
8596
|
} })).data;
|
|
8581
8597
|
});
|
|
8582
8598
|
}
|
|
@@ -8588,7 +8604,7 @@ async function register$1(context) {
|
|
|
8588
8604
|
return (await authRegister({ body: {
|
|
8589
8605
|
name,
|
|
8590
8606
|
email,
|
|
8591
|
-
...passwordBody(readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$
|
|
8607
|
+
...passwordBody(readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$50))
|
|
8592
8608
|
} })).data;
|
|
8593
8609
|
});
|
|
8594
8610
|
}
|
|
@@ -8603,8 +8619,8 @@ async function forgotPassword(context) {
|
|
|
8603
8619
|
async function resetPassword(context) {
|
|
8604
8620
|
const email = required$3(context, "--email");
|
|
8605
8621
|
return await confirmableWrite(context, `Reset the password for ${email}.`, async () => {
|
|
8606
|
-
const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$
|
|
8607
|
-
const password = readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$
|
|
8622
|
+
const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$50);
|
|
8623
|
+
const password = readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$50);
|
|
8608
8624
|
return (await authResetPassword({ body: {
|
|
8609
8625
|
token,
|
|
8610
8626
|
email,
|
|
@@ -8620,7 +8636,7 @@ async function verifyEmail(context) {
|
|
|
8620
8636
|
}
|
|
8621
8637
|
//#endregion
|
|
8622
8638
|
//#region src/commands/auth-impersonation.ts
|
|
8623
|
-
var USAGE$
|
|
8639
|
+
var USAGE$49 = [
|
|
8624
8640
|
"Usage: hostingctl auth impersonate start --target <user-uuid> --company <slug> --reason <text> [--minutes <n>] --store-as <profile>",
|
|
8625
8641
|
" hostingctl auth impersonate status",
|
|
8626
8642
|
" hostingctl auth impersonate stop",
|
|
@@ -8653,7 +8669,7 @@ async function impersonation(context, rest) {
|
|
|
8653
8669
|
if (action === "stop" && tail.length === 0) return await stop(context);
|
|
8654
8670
|
if (action === "list" && tail.length === 0) return await list$5();
|
|
8655
8671
|
if (action === "end" && tail.length === 1) return await end(context, tail[0] ?? "");
|
|
8656
|
-
throw new UsageError(USAGE$
|
|
8672
|
+
throw new UsageError(USAGE$49);
|
|
8657
8673
|
}
|
|
8658
8674
|
/** `start`: mint a token for another user, and keep it in a profile of its own. */
|
|
8659
8675
|
async function start(context) {
|
|
@@ -8661,8 +8677,8 @@ async function start(context) {
|
|
|
8661
8677
|
const company = context.flags.get("--company")?.trim() ?? "";
|
|
8662
8678
|
const reason = context.flags.get("--reason")?.trim() ?? "";
|
|
8663
8679
|
const storeAs = context.flags.get("--store-as")?.trim() ?? "";
|
|
8664
|
-
if (target === "" || company === "" || reason === "") throw new UsageError(`start needs --target, --company and --reason.\n\n${USAGE$
|
|
8665
|
-
if (storeAs === "") throw new UsageError(`start needs --store-as <profile>.\n\n${USAGE$
|
|
8680
|
+
if (target === "" || company === "" || reason === "") throw new UsageError(`start needs --target, --company and --reason.\n\n${USAGE$49}`);
|
|
8681
|
+
if (storeAs === "") throw new UsageError(`start needs --store-as <profile>.\n\n${USAGE$49}`);
|
|
8666
8682
|
const minutes = wholeNumberFlag(context.flags, "--minutes") ?? DEFAULT_MINUTES;
|
|
8667
8683
|
const document = await readProfiles();
|
|
8668
8684
|
const operator = namedProfile(context.flags, document);
|
|
@@ -8756,7 +8772,7 @@ async function list$5() {
|
|
|
8756
8772
|
}
|
|
8757
8773
|
/** `end <uuid>`: end one recorded session by its uuid. */
|
|
8758
8774
|
async function end(context, uuid) {
|
|
8759
|
-
if (uuid === "") throw new UsageError(USAGE$
|
|
8775
|
+
if (uuid === "") throw new UsageError(USAGE$49);
|
|
8760
8776
|
return await confirmableWrite(context, `End impersonation session ${uuid}.`, async () => ({
|
|
8761
8777
|
...EMPTY,
|
|
8762
8778
|
action: "end",
|
|
@@ -8765,7 +8781,7 @@ async function end(context, uuid) {
|
|
|
8765
8781
|
}
|
|
8766
8782
|
//#endregion
|
|
8767
8783
|
//#region src/commands/auth-push.ts
|
|
8768
|
-
var USAGE$
|
|
8784
|
+
var USAGE$48 = [
|
|
8769
8785
|
"Usage: hostingctl auth push-token set (--token-file <path>|--token-stdin)",
|
|
8770
8786
|
" hostingctl auth push-token remove (--token-file <path>|--token-stdin)",
|
|
8771
8787
|
"",
|
|
@@ -8776,12 +8792,12 @@ var USAGE$47 = [
|
|
|
8776
8792
|
/** `auth push-token set|remove`: this account's mobile push registration. */
|
|
8777
8793
|
async function authPush(context, rest) {
|
|
8778
8794
|
const [action, ...tail] = rest;
|
|
8779
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
8795
|
+
if (tail.length > 0) throw new UsageError(USAGE$48);
|
|
8780
8796
|
if (action === "set") return {
|
|
8781
8797
|
kind: "push-token",
|
|
8782
8798
|
action: "set",
|
|
8783
8799
|
sent: (await confirmableWrite(context, "Register this device's push token.", async () => {
|
|
8784
|
-
await expoTokenStore({ body: { token: readSecret(context, "token", 4096, USAGE$
|
|
8800
|
+
await expoTokenStore({ body: { token: readSecret(context, "token", 4096, USAGE$48) } });
|
|
8785
8801
|
return null;
|
|
8786
8802
|
})).sent
|
|
8787
8803
|
};
|
|
@@ -8789,11 +8805,11 @@ async function authPush(context, rest) {
|
|
|
8789
8805
|
kind: "push-token",
|
|
8790
8806
|
action: "remove",
|
|
8791
8807
|
sent: (await confirmableWrite(context, "Remove this device's push token.", async () => {
|
|
8792
|
-
await expoTokenDestroy({ query: { token: readSecret(context, "token", 4096, USAGE$
|
|
8808
|
+
await expoTokenDestroy({ query: { token: readSecret(context, "token", 4096, USAGE$48) } });
|
|
8793
8809
|
return null;
|
|
8794
8810
|
})).sent
|
|
8795
8811
|
};
|
|
8796
|
-
throw new UsageError(USAGE$
|
|
8812
|
+
throw new UsageError(USAGE$48);
|
|
8797
8813
|
}
|
|
8798
8814
|
/** The `auth push-token` renderer. */
|
|
8799
8815
|
function authPushText(report) {
|
|
@@ -8944,47 +8960,47 @@ var AUTH_METADATA = {
|
|
|
8944
8960
|
var AUTH_TOPICS = [
|
|
8945
8961
|
{
|
|
8946
8962
|
path: ["profile"],
|
|
8947
|
-
usage: USAGE$
|
|
8963
|
+
usage: USAGE$50
|
|
8948
8964
|
},
|
|
8949
8965
|
{
|
|
8950
8966
|
path: ["password"],
|
|
8951
|
-
usage: USAGE$
|
|
8967
|
+
usage: USAGE$50
|
|
8952
8968
|
},
|
|
8953
8969
|
{
|
|
8954
8970
|
path: ["register"],
|
|
8955
|
-
usage: USAGE$
|
|
8971
|
+
usage: USAGE$50
|
|
8956
8972
|
},
|
|
8957
8973
|
{
|
|
8958
8974
|
path: ["forgot-password"],
|
|
8959
|
-
usage: USAGE$
|
|
8975
|
+
usage: USAGE$50
|
|
8960
8976
|
},
|
|
8961
8977
|
{
|
|
8962
8978
|
path: ["reset-password"],
|
|
8963
|
-
usage: USAGE$
|
|
8979
|
+
usage: USAGE$50
|
|
8964
8980
|
},
|
|
8965
8981
|
{
|
|
8966
8982
|
path: ["verify-email"],
|
|
8967
|
-
usage: USAGE$
|
|
8983
|
+
usage: USAGE$50
|
|
8968
8984
|
},
|
|
8969
8985
|
{
|
|
8970
8986
|
path: ["closure"],
|
|
8971
|
-
usage: USAGE$
|
|
8987
|
+
usage: USAGE$51
|
|
8972
8988
|
},
|
|
8973
8989
|
{
|
|
8974
8990
|
path: ["picture"],
|
|
8975
|
-
usage: USAGE$
|
|
8991
|
+
usage: USAGE$51
|
|
8976
8992
|
},
|
|
8977
8993
|
{
|
|
8978
8994
|
path: ["notifications"],
|
|
8979
|
-
usage: USAGE$
|
|
8995
|
+
usage: USAGE$51
|
|
8980
8996
|
},
|
|
8981
8997
|
{
|
|
8982
8998
|
path: ["push-token"],
|
|
8983
|
-
usage: USAGE$
|
|
8999
|
+
usage: USAGE$48
|
|
8984
9000
|
},
|
|
8985
9001
|
{
|
|
8986
9002
|
path: ["impersonate"],
|
|
8987
|
-
usage: USAGE$
|
|
9003
|
+
usage: USAGE$49
|
|
8988
9004
|
}
|
|
8989
9005
|
];
|
|
8990
9006
|
//#endregion
|
|
@@ -9517,7 +9533,7 @@ var MAILBOX_TOPICS = [{
|
|
|
9517
9533
|
}];
|
|
9518
9534
|
//#endregion
|
|
9519
9535
|
//#region src/commands/mailbox-recovery.ts
|
|
9520
|
-
var USAGE$
|
|
9536
|
+
var USAGE$47 = [
|
|
9521
9537
|
"Usage: hostingctl mailbox recovery <request|verify|reset> [options]",
|
|
9522
9538
|
"",
|
|
9523
9539
|
" request --address <address> Ask for a self-service reset link for a mailbox address.",
|
|
@@ -9545,16 +9561,16 @@ function isSessionlessMailboxCommand(argv) {
|
|
|
9545
9561
|
/** `mailbox recovery request|verify|reset`: the unauthenticated, token-authorized recovery journey. */
|
|
9546
9562
|
async function runMailboxRecovery(context, rest) {
|
|
9547
9563
|
const [action, extra] = rest;
|
|
9548
|
-
if (extra !== void 0) throw new UsageError(USAGE$
|
|
9564
|
+
if (extra !== void 0) throw new UsageError(USAGE$47);
|
|
9549
9565
|
if (action === "request") return await request$1(context);
|
|
9550
9566
|
if (action === "verify") return await verify$1(context);
|
|
9551
9567
|
if (action === "reset") return await reset(context);
|
|
9552
|
-
throw new UsageError(USAGE$
|
|
9568
|
+
throw new UsageError(USAGE$47);
|
|
9553
9569
|
}
|
|
9554
9570
|
/** `request`: the answer is deliberately identical whether or not an eligible mailbox exists. */
|
|
9555
9571
|
async function request$1(context) {
|
|
9556
9572
|
const address = context.flags.get("--address");
|
|
9557
|
-
if (address === void 0 || address === "") throw new UsageError(USAGE$
|
|
9573
|
+
if (address === void 0 || address === "") throw new UsageError(USAGE$47);
|
|
9558
9574
|
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);
|
|
9559
9575
|
}
|
|
9560
9576
|
/** `verify`: the token is read only when the send actually happens, so a dry run never touches a secret. */
|
|
@@ -9575,7 +9591,7 @@ async function reset(context) {
|
|
|
9575
9591
|
}
|
|
9576
9592
|
/** One recovery token or new password, read from a private file or stdin under the recovery bound. */
|
|
9577
9593
|
function recoverySecret(context, name) {
|
|
9578
|
-
return readSecret(context, name, MAX_RECOVERY_SECRET_BYTES, USAGE$
|
|
9594
|
+
return readSecret(context, name, MAX_RECOVERY_SECRET_BYTES, USAGE$47);
|
|
9579
9595
|
}
|
|
9580
9596
|
//#endregion
|
|
9581
9597
|
//#region src/commands/mailbox.ts
|
|
@@ -9711,7 +9727,7 @@ async function environmentGeneration(path) {
|
|
|
9711
9727
|
//#endregion
|
|
9712
9728
|
//#region src/commands/access-credentials.ts
|
|
9713
9729
|
/** The usage this module refuses with, owned by the commands it implements. */
|
|
9714
|
-
var USAGE$
|
|
9730
|
+
var USAGE$46 = [
|
|
9715
9731
|
"Usage: hostingctl access key add <environment-uuid> --company <slug> --access-user <uuid> --name <n> --public-key-file <path>",
|
|
9716
9732
|
" hostingctl access key remove <environment-uuid> --company <slug> --access-user <uuid> <key-uuid>",
|
|
9717
9733
|
" hostingctl access password set <environment-uuid> --company <slug> --access-user <uuid> (--password-file <path>|--password-stdin)",
|
|
@@ -9729,12 +9745,12 @@ var USAGE$45 = [
|
|
|
9729
9745
|
/** `key add|remove`. */
|
|
9730
9746
|
async function key(context, path, action, tail) {
|
|
9731
9747
|
const accessUserUuid = context.flags.get("--access-user") ?? "";
|
|
9732
|
-
if (accessUserUuid === "") throw new UsageError(`key needs --access-user.\\n\\n${USAGE$
|
|
9748
|
+
if (accessUserUuid === "") throw new UsageError(`key needs --access-user.\\n\\n${USAGE$46}`);
|
|
9733
9749
|
if (action === "add") {
|
|
9734
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
9750
|
+
if (tail.length > 0) throw new UsageError(USAGE$46);
|
|
9735
9751
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
9736
9752
|
const file = context.flags.get("--public-key-file") ?? "";
|
|
9737
|
-
if (name === "" || file === "") throw new UsageError(`key add needs --name and --public-key-file.\\n\\n${USAGE$
|
|
9753
|
+
if (name === "" || file === "") throw new UsageError(`key add needs --name and --public-key-file.\\n\\n${USAGE$46}`);
|
|
9738
9754
|
const publicKey = readPrivateFile(file, "public key", 8192).trim();
|
|
9739
9755
|
return await confirmableWrite(context, `Add key "${name}" to login ${accessUserUuid}.`, async () => {
|
|
9740
9756
|
const body = {
|
|
@@ -9753,7 +9769,7 @@ async function key(context, path, action, tail) {
|
|
|
9753
9769
|
}
|
|
9754
9770
|
if (action === "remove") {
|
|
9755
9771
|
const [keyUuid, ...extra] = tail;
|
|
9756
|
-
if (keyUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
9772
|
+
if (keyUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$46);
|
|
9757
9773
|
return await confirmableWrite(context, `Remove key ${keyUuid} from login ${accessUserUuid}.`, async () => {
|
|
9758
9774
|
return (await hostingAccessDestroyKey({
|
|
9759
9775
|
path: {
|
|
@@ -9765,18 +9781,18 @@ async function key(context, path, action, tail) {
|
|
|
9765
9781
|
})).data;
|
|
9766
9782
|
});
|
|
9767
9783
|
}
|
|
9768
|
-
throw new UsageError(USAGE$
|
|
9784
|
+
throw new UsageError(USAGE$46);
|
|
9769
9785
|
}
|
|
9770
9786
|
/** `password set|clear`. */
|
|
9771
9787
|
async function password(context, path, action, tail) {
|
|
9772
9788
|
const accessUserUuid = context.flags.get("--access-user") ?? "";
|
|
9773
|
-
if (accessUserUuid === "" || tail.length > 0) throw new UsageError(`password needs --access-user.\\n\\n${USAGE$
|
|
9789
|
+
if (accessUserUuid === "" || tail.length > 0) throw new UsageError(`password needs --access-user.\\n\\n${USAGE$46}`);
|
|
9774
9790
|
const userPath = {
|
|
9775
9791
|
...path,
|
|
9776
9792
|
accessUserUuid
|
|
9777
9793
|
};
|
|
9778
9794
|
if (action === "set") return await confirmableWrite(context, "Set this login's password. The previous password stops working when the change is applied.", async () => {
|
|
9779
|
-
const password = readSecret(context, "password", 1024, USAGE$
|
|
9795
|
+
const password = readSecret(context, "password", 1024, USAGE$46);
|
|
9780
9796
|
const body = {
|
|
9781
9797
|
desiredGeneration: await environmentGeneration(path),
|
|
9782
9798
|
password,
|
|
@@ -9794,7 +9810,7 @@ async function password(context, path, action, tail) {
|
|
|
9794
9810
|
query
|
|
9795
9811
|
})).data;
|
|
9796
9812
|
});
|
|
9797
|
-
throw new UsageError(USAGE$
|
|
9813
|
+
throw new UsageError(USAGE$46);
|
|
9798
9814
|
}
|
|
9799
9815
|
//#endregion
|
|
9800
9816
|
//#region src/commands/booleans.ts
|
|
@@ -9819,7 +9835,7 @@ function onOff$5(context, flag, usage) {
|
|
|
9819
9835
|
}
|
|
9820
9836
|
//#endregion
|
|
9821
9837
|
//#region src/commands/access-admin.ts
|
|
9822
|
-
var USAGE$
|
|
9838
|
+
var USAGE$45 = [
|
|
9823
9839
|
"Usage: hostingctl access settings <environment-uuid> --company <slug>",
|
|
9824
9840
|
" hostingctl access settings-set <environment-uuid> --company <slug> --password <on|off> --sftp-only <on|off>",
|
|
9825
9841
|
" hostingctl access grants <environment-uuid> --company <slug>",
|
|
@@ -9847,7 +9863,7 @@ var USAGE$44 = [
|
|
|
9847
9863
|
/** `access settings|settings-set|grants|grant|un-grant|key|password|user-show|user-set|received`. */
|
|
9848
9864
|
async function accessAdmin(context, subcommand, rest) {
|
|
9849
9865
|
if (subcommand === "received") {
|
|
9850
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
9866
|
+
if (rest.length > 0) throw new UsageError(USAGE$45);
|
|
9851
9867
|
return {
|
|
9852
9868
|
kind: "received",
|
|
9853
9869
|
grants: (await hostingAccessReceivedIndex({})).data.items
|
|
@@ -9855,7 +9871,7 @@ async function accessAdmin(context, subcommand, rest) {
|
|
|
9855
9871
|
}
|
|
9856
9872
|
const [first, ...after] = rest;
|
|
9857
9873
|
const takesAction = subcommand === "key" || subcommand === "password";
|
|
9858
|
-
const path = await environmentPath(context, takesAction ? after[0] : first, USAGE$
|
|
9874
|
+
const path = await environmentPath(context, takesAction ? after[0] : first, USAGE$45);
|
|
9859
9875
|
const tail = takesAction ? after.slice(1) : after;
|
|
9860
9876
|
return await routed(context, subcommand, path, first ?? "", tail);
|
|
9861
9877
|
}
|
|
@@ -9870,7 +9886,7 @@ async function routed(context, subcommand, path, action, tail) {
|
|
|
9870
9886
|
if (subcommand === "password") return await written$7(password(context, path, action, tail));
|
|
9871
9887
|
if (subcommand === "user-show") return await userShow(path, tail);
|
|
9872
9888
|
if (subcommand === "user-set") return await written$7(userSet(context, path, tail));
|
|
9873
|
-
throw new UsageError(USAGE$
|
|
9889
|
+
throw new UsageError(USAGE$45);
|
|
9874
9890
|
}
|
|
9875
9891
|
/** Tag one write's outcome with the group that produced it. */
|
|
9876
9892
|
async function written$7(pending) {
|
|
@@ -9881,7 +9897,7 @@ async function written$7(pending) {
|
|
|
9881
9897
|
}
|
|
9882
9898
|
/** A company-wide read takes no positionals. */
|
|
9883
9899
|
function noExtra$18(rest) {
|
|
9884
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
9900
|
+
if (rest.length > 0) throw new UsageError(USAGE$45);
|
|
9885
9901
|
}
|
|
9886
9902
|
/** `settings`. */
|
|
9887
9903
|
async function settings$1(path, rest) {
|
|
@@ -9894,8 +9910,8 @@ async function settings$1(path, rest) {
|
|
|
9894
9910
|
/** `settings-set --password … --sftp-only …`. */
|
|
9895
9911
|
async function settingsSet(context, path, rest) {
|
|
9896
9912
|
noExtra$18(rest);
|
|
9897
|
-
const passwordEnabled = onOff$5(context, "--password", USAGE$
|
|
9898
|
-
const sftpOnly = onOff$5(context, "--sftp-only", USAGE$
|
|
9913
|
+
const passwordEnabled = onOff$5(context, "--password", USAGE$45);
|
|
9914
|
+
const sftpOnly = onOff$5(context, "--sftp-only", USAGE$45);
|
|
9899
9915
|
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 () => {
|
|
9900
9916
|
return (await hostingAccessUpdate({
|
|
9901
9917
|
path,
|
|
@@ -9920,7 +9936,7 @@ async function grant(context, path, rest) {
|
|
|
9920
9936
|
noExtra$18(rest);
|
|
9921
9937
|
const userUuid = context.flags.get("--user") ?? "";
|
|
9922
9938
|
const accessUserUuid = context.flags.get("--access-user") ?? "";
|
|
9923
|
-
if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$
|
|
9939
|
+
if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$45}`);
|
|
9924
9940
|
return await confirmableWrite(context, `Grant user ${userUuid} the login ${accessUserUuid} on this environment.`, async () => {
|
|
9925
9941
|
return (await hostingAccessGrantStore({
|
|
9926
9942
|
path,
|
|
@@ -9935,7 +9951,7 @@ async function grant(context, path, rest) {
|
|
|
9935
9951
|
/** `un-grant <grant-uuid>`. */
|
|
9936
9952
|
async function unGrant(context, path, rest) {
|
|
9937
9953
|
const [grantUuid, ...extra] = rest;
|
|
9938
|
-
if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
9954
|
+
if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$45);
|
|
9939
9955
|
return await confirmableWrite(context, `Withdraw grant ${grantUuid}. The login stays; only this account's access to it ends.`, async () => {
|
|
9940
9956
|
const query = { desiredGeneration: await environmentGeneration(path) };
|
|
9941
9957
|
return (await hostingAccessGrantDestroy({
|
|
@@ -9950,7 +9966,7 @@ async function unGrant(context, path, rest) {
|
|
|
9950
9966
|
/** `user-show <access-user-uuid>`. */
|
|
9951
9967
|
async function userShow(path, rest) {
|
|
9952
9968
|
const [accessUserUuid, ...extra] = rest;
|
|
9953
|
-
if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
9969
|
+
if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$45);
|
|
9954
9970
|
return {
|
|
9955
9971
|
kind: "user",
|
|
9956
9972
|
user: (await hostingAccessShowUser({ path: {
|
|
@@ -9962,7 +9978,7 @@ async function userShow(path, rest) {
|
|
|
9962
9978
|
/** `user-set <access-user-uuid> [--name] [--enabled] [--read-only]`. */
|
|
9963
9979
|
async function userSet(context, path, rest) {
|
|
9964
9980
|
const [accessUserUuid, ...extra] = rest;
|
|
9965
|
-
if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
9981
|
+
if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$45);
|
|
9966
9982
|
const userPath = {
|
|
9967
9983
|
...path,
|
|
9968
9984
|
accessUserUuid
|
|
@@ -9971,7 +9987,7 @@ async function userSet(context, path, rest) {
|
|
|
9971
9987
|
const name = context.flags.get("--name")?.trim();
|
|
9972
9988
|
const enabled = onOffFlag(context, "--enabled");
|
|
9973
9989
|
const readOnly = onOffFlag(context, "--read-only");
|
|
9974
|
-
if (name === void 0 && enabled === null && readOnly === null) throw new UsageError(`user-set needs --name, --enabled, --read-only or a combination.\\n\\n${USAGE$
|
|
9990
|
+
if (name === void 0 && enabled === null && readOnly === null) throw new UsageError(`user-set needs --name, --enabled, --read-only or a combination.\\n\\n${USAGE$45}`);
|
|
9975
9991
|
const body = {
|
|
9976
9992
|
desiredGeneration: await environmentGeneration(path),
|
|
9977
9993
|
name: name === void 0 || name === "" ? current.name : name,
|
|
@@ -10122,43 +10138,43 @@ var ACCESS_METADATA = {
|
|
|
10122
10138
|
var ACCESS_TOPICS = [
|
|
10123
10139
|
{
|
|
10124
10140
|
path: ["settings"],
|
|
10125
|
-
usage: USAGE$
|
|
10141
|
+
usage: USAGE$45
|
|
10126
10142
|
},
|
|
10127
10143
|
{
|
|
10128
10144
|
path: ["settings-set"],
|
|
10129
|
-
usage: USAGE$
|
|
10145
|
+
usage: USAGE$45
|
|
10130
10146
|
},
|
|
10131
10147
|
{
|
|
10132
10148
|
path: ["grants"],
|
|
10133
|
-
usage: USAGE$
|
|
10149
|
+
usage: USAGE$45
|
|
10134
10150
|
},
|
|
10135
10151
|
{
|
|
10136
10152
|
path: ["grant"],
|
|
10137
|
-
usage: USAGE$
|
|
10153
|
+
usage: USAGE$45
|
|
10138
10154
|
},
|
|
10139
10155
|
{
|
|
10140
10156
|
path: ["un-grant"],
|
|
10141
|
-
usage: USAGE$
|
|
10157
|
+
usage: USAGE$45
|
|
10142
10158
|
},
|
|
10143
10159
|
{
|
|
10144
10160
|
path: ["user-show"],
|
|
10145
|
-
usage: USAGE$
|
|
10161
|
+
usage: USAGE$45
|
|
10146
10162
|
},
|
|
10147
10163
|
{
|
|
10148
10164
|
path: ["user-set"],
|
|
10149
|
-
usage: USAGE$
|
|
10165
|
+
usage: USAGE$45
|
|
10150
10166
|
},
|
|
10151
10167
|
{
|
|
10152
10168
|
path: ["received"],
|
|
10153
|
-
usage: USAGE$
|
|
10169
|
+
usage: USAGE$45
|
|
10154
10170
|
},
|
|
10155
10171
|
{
|
|
10156
10172
|
path: ["key"],
|
|
10157
|
-
usage: USAGE$
|
|
10173
|
+
usage: USAGE$46
|
|
10158
10174
|
},
|
|
10159
10175
|
{
|
|
10160
10176
|
path: ["password"],
|
|
10161
|
-
usage: USAGE$
|
|
10177
|
+
usage: USAGE$46
|
|
10162
10178
|
}
|
|
10163
10179
|
];
|
|
10164
10180
|
//#endregion
|
|
@@ -10378,7 +10394,7 @@ var ADMIN_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
10378
10394
|
]);
|
|
10379
10395
|
//#endregion
|
|
10380
10396
|
//#region src/commands/application-admin.ts
|
|
10381
|
-
var USAGE$
|
|
10397
|
+
var USAGE$44 = [
|
|
10382
10398
|
"Usage: hostingctl application administrator <environment-uuid> <application-uuid> --company <slug>",
|
|
10383
10399
|
" hostingctl application administrator-reset|administrator-reveal <environment-uuid> <application-uuid> --company <slug>",
|
|
10384
10400
|
" hostingctl application recovery-status|recovery-retry|recovery-cancel <environment-uuid> <application-uuid> <recovery-uuid> --company <slug>",
|
|
@@ -10405,7 +10421,7 @@ async function applicationAdmin(context, action, path, rest) {
|
|
|
10405
10421
|
if (action === "administrator-reset") return await credential(context, path, rest, "reset");
|
|
10406
10422
|
if (action === "administrator-reveal") return await credential(context, path, rest, "reveal");
|
|
10407
10423
|
const [recoveryUuid, ...extra] = rest;
|
|
10408
|
-
if (recoveryUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
10424
|
+
if (recoveryUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$44);
|
|
10409
10425
|
const recoveryPath = {
|
|
10410
10426
|
...path,
|
|
10411
10427
|
recoveryUuid
|
|
@@ -10418,7 +10434,7 @@ async function applicationAdmin(context, action, path, rest) {
|
|
|
10418
10434
|
return (await hostingApplicationRecoveryRetry({ path: recoveryPath })).data;
|
|
10419
10435
|
}));
|
|
10420
10436
|
if (action === "recovery-cancel") return await written$6(confirmableWrite(context, "Cancel this recovery. Writers are released and the application returns to its previous state.", async () => (await hostingApplicationRecoveryCancel({ path: recoveryPath })).data));
|
|
10421
|
-
throw new UsageError(USAGE$
|
|
10437
|
+
throw new UsageError(USAGE$44);
|
|
10422
10438
|
}
|
|
10423
10439
|
/** `administrator-reset|reveal`: the one place the application's own password is printed. */
|
|
10424
10440
|
async function credential(context, path, rest, kind) {
|
|
@@ -10439,7 +10455,7 @@ async function written$6(pending) {
|
|
|
10439
10455
|
}
|
|
10440
10456
|
/** No positional arguments, or a usage refusal. */
|
|
10441
10457
|
function noExtra$17(rest) {
|
|
10442
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
10458
|
+
if (rest.length > 0) throw new UsageError(USAGE$44);
|
|
10443
10459
|
}
|
|
10444
10460
|
/** One recovery as one line: what it is doing, how far, and what it holds. */
|
|
10445
10461
|
function recoveryLines$1(one) {
|
|
@@ -10476,7 +10492,7 @@ function applicationAdminText(report) {
|
|
|
10476
10492
|
}
|
|
10477
10493
|
//#endregion
|
|
10478
10494
|
//#region src/commands/application-builds.ts
|
|
10479
|
-
var USAGE$
|
|
10495
|
+
var USAGE$43 = [
|
|
10480
10496
|
"Usage: hostingctl application build-log <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
|
|
10481
10497
|
" hostingctl application build-retry|build-cancel <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
|
|
10482
10498
|
" hostingctl application source-bind <environment-uuid> <application-uuid> --company <slug> --selection <uuid> [--branch <name>] [--tag <name>] [--auto-deploy <on|off>]",
|
|
@@ -10499,7 +10515,7 @@ async function applicationBuilds(context, action, path, rest) {
|
|
|
10499
10515
|
}
|
|
10500
10516
|
if (action === "source-bind") return await bind$1(context, path, rest);
|
|
10501
10517
|
const [buildUuid, ...extra] = rest;
|
|
10502
|
-
if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
10518
|
+
if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$43);
|
|
10503
10519
|
const buildPath = {
|
|
10504
10520
|
...path,
|
|
10505
10521
|
buildUuid
|
|
@@ -10514,13 +10530,13 @@ async function applicationBuilds(context, action, path, rest) {
|
|
|
10514
10530
|
if (action === "build-cancel") return await written$5(confirmableWrite(context, "Stop this build. A running build stops where it is.", async () => {
|
|
10515
10531
|
return (await hostingDeploymentCancel({ path: buildPath })).data;
|
|
10516
10532
|
}));
|
|
10517
|
-
throw new UsageError(USAGE$
|
|
10533
|
+
throw new UsageError(USAGE$43);
|
|
10518
10534
|
}
|
|
10519
10535
|
/** `source-bind --selection … [--branch …] [--tag …] [--auto-deploy …]`. */
|
|
10520
10536
|
async function bind$1(context, path, rest) {
|
|
10521
10537
|
noExtra$16(rest);
|
|
10522
10538
|
const repositorySelectionUuid = context.flags.get("--selection") ?? "";
|
|
10523
|
-
if (repositorySelectionUuid === "") throw new UsageError(`source-bind needs --selection.\n\n${USAGE$
|
|
10539
|
+
if (repositorySelectionUuid === "") throw new UsageError(`source-bind needs --selection.\n\n${USAGE$43}`);
|
|
10524
10540
|
const branch = context.flags.get("--branch")?.trim();
|
|
10525
10541
|
const tag = context.flags.get("--tag")?.trim();
|
|
10526
10542
|
const autoDeploy = onOffFlag(context, "--auto-deploy");
|
|
@@ -10546,7 +10562,7 @@ async function written$5(pending) {
|
|
|
10546
10562
|
}
|
|
10547
10563
|
/** No positional arguments, or a usage refusal. */
|
|
10548
10564
|
function noExtra$16(rest) {
|
|
10549
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
10565
|
+
if (rest.length > 0) throw new UsageError(USAGE$43);
|
|
10550
10566
|
}
|
|
10551
10567
|
/** The write receipt: a build's own fields, or the deployment's source. */
|
|
10552
10568
|
function writeText$4(report) {
|
|
@@ -10575,7 +10591,7 @@ function applicationBuildText(report) {
|
|
|
10575
10591
|
}
|
|
10576
10592
|
//#endregion
|
|
10577
10593
|
//#region src/commands/application-cache.ts
|
|
10578
|
-
var USAGE$
|
|
10594
|
+
var USAGE$42 = [
|
|
10579
10595
|
"Usage: hostingctl application cache <environment-uuid> <application-uuid> --company <slug>",
|
|
10580
10596
|
" hostingctl application cache-set <environment-uuid> <application-uuid> --company <slug> [--enabled <on|off>] [--fresh <s>] [--background <s>] [--browser <s>] [--reset <on|off>]",
|
|
10581
10597
|
" hostingctl application cache-purge <environment-uuid> <application-uuid> --company <slug>",
|
|
@@ -10613,7 +10629,7 @@ async function applicationCache(context, action, path, rest) {
|
|
|
10613
10629
|
}
|
|
10614
10630
|
if (action === "canonical") {
|
|
10615
10631
|
const routeUuid = context.flags.get("--route") ?? "";
|
|
10616
|
-
if (routeUuid === "") throw new UsageError(`canonical needs --route.\n\n${USAGE$
|
|
10632
|
+
if (routeUuid === "") throw new UsageError(`canonical needs --route.\n\n${USAGE$42}`);
|
|
10617
10633
|
return await written$4(confirmableWrite(context, `Make route ${routeUuid} this application's canonical address.`, async () => {
|
|
10618
10634
|
const desiredGeneration = await generation$1(path);
|
|
10619
10635
|
return (await hostingApplicationRouteSelectCanonical({
|
|
@@ -10625,7 +10641,7 @@ async function applicationCache(context, action, path, rest) {
|
|
|
10625
10641
|
})).data;
|
|
10626
10642
|
}));
|
|
10627
10643
|
}
|
|
10628
|
-
throw new UsageError(USAGE$
|
|
10644
|
+
throw new UsageError(USAGE$42);
|
|
10629
10645
|
}
|
|
10630
10646
|
/** `application routes|route-add|route-remove`, which are environment-scoped. */
|
|
10631
10647
|
async function applicationRoutes(context, action, path, rest) {
|
|
@@ -10639,7 +10655,7 @@ async function applicationRoutes(context, action, path, rest) {
|
|
|
10639
10655
|
if (action === "route-add") return await addRoute(context, path, rest);
|
|
10640
10656
|
if (action === "route-remove") {
|
|
10641
10657
|
const [routeUuid, ...extra] = rest;
|
|
10642
|
-
if (routeUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
10658
|
+
if (routeUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$42);
|
|
10643
10659
|
return await written$4(confirmableWrite(context, `Remove route ${routeUuid}.`, async () => {
|
|
10644
10660
|
const body = { desiredGeneration: await generation$1(path) };
|
|
10645
10661
|
return (await hostingApplicationRouteRemove({
|
|
@@ -10651,7 +10667,7 @@ async function applicationRoutes(context, action, path, rest) {
|
|
|
10651
10667
|
})).data;
|
|
10652
10668
|
}));
|
|
10653
10669
|
}
|
|
10654
|
-
throw new UsageError(USAGE$
|
|
10670
|
+
throw new UsageError(USAGE$42);
|
|
10655
10671
|
}
|
|
10656
10672
|
/** `route-add --source … --target … --path …`. */
|
|
10657
10673
|
async function addRoute(context, path, rest) {
|
|
@@ -10659,7 +10675,7 @@ async function addRoute(context, path, rest) {
|
|
|
10659
10675
|
const sourceWorkloadUuid = context.flags.get("--source") ?? "";
|
|
10660
10676
|
const targetWorkloadUuid = context.flags.get("--target") ?? "";
|
|
10661
10677
|
const routePath = context.flags.get("--path") ?? "";
|
|
10662
|
-
if (sourceWorkloadUuid === "" || targetWorkloadUuid === "" || routePath === "") throw new UsageError(`route-add needs --source, --target and --path.\n\n${USAGE$
|
|
10678
|
+
if (sourceWorkloadUuid === "" || targetWorkloadUuid === "" || routePath === "") throw new UsageError(`route-add needs --source, --target and --path.\n\n${USAGE$42}`);
|
|
10663
10679
|
const domainUuid = context.flags.get("--domain")?.trim();
|
|
10664
10680
|
const canonical = onOffFlag(context, "--canonical") ?? false;
|
|
10665
10681
|
return await written$4(confirmableWrite(context, `Route ${routePath} from ${sourceWorkloadUuid} to ${targetWorkloadUuid}${canonical ? " as canonical" : ""}.`, async () => {
|
|
@@ -10692,10 +10708,10 @@ function cacheBody(context) {
|
|
|
10692
10708
|
const raw = context.flags.get(flag)?.trim() ?? "";
|
|
10693
10709
|
if (raw === "") continue;
|
|
10694
10710
|
const value = Number(raw);
|
|
10695
|
-
if (!Number.isInteger(value) || value < 0) throw new UsageError(`${flag} must be a whole number of seconds.\n\n${USAGE$
|
|
10711
|
+
if (!Number.isInteger(value) || value < 0) throw new UsageError(`${flag} must be a whole number of seconds.\n\n${USAGE$42}`);
|
|
10696
10712
|
body[field] = value;
|
|
10697
10713
|
}
|
|
10698
|
-
if (Object.keys(body).length === 0) throw new UsageError(`cache-set needs at least one field.\n\n${USAGE$
|
|
10714
|
+
if (Object.keys(body).length === 0) throw new UsageError(`cache-set needs at least one field.\n\n${USAGE$42}`);
|
|
10699
10715
|
return body;
|
|
10700
10716
|
}
|
|
10701
10717
|
/** The environment's generation, which every write here must name. */
|
|
@@ -10711,7 +10727,7 @@ async function written$4(pending) {
|
|
|
10711
10727
|
}
|
|
10712
10728
|
/** No positional arguments, or a usage refusal. */
|
|
10713
10729
|
function noExtra$15(rest) {
|
|
10714
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
10730
|
+
if (rest.length > 0) throw new UsageError(USAGE$42);
|
|
10715
10731
|
}
|
|
10716
10732
|
/** The `application cache*|routes|route-*` renderer. */
|
|
10717
10733
|
function applicationCacheText(report) {
|
|
@@ -10736,7 +10752,7 @@ function routeLines(page) {
|
|
|
10736
10752
|
}
|
|
10737
10753
|
//#endregion
|
|
10738
10754
|
//#region src/commands/application-create.ts
|
|
10739
|
-
var USAGE$
|
|
10755
|
+
var USAGE$41 = [
|
|
10740
10756
|
"Usage: hostingctl application create <environment-uuid> --company <slug> --type <wordpress|moodle> --name <name>",
|
|
10741
10757
|
" --cpu-request <millicores> --cpu-limit <millicores> --memory-request <MiB> --memory-limit <MiB>",
|
|
10742
10758
|
" [--replicas <count>] [--label <text>] [--hostname <host>]",
|
|
@@ -10754,11 +10770,11 @@ var USAGE$40 = [
|
|
|
10754
10770
|
var TYPES = /* @__PURE__ */ new Set(["wordpress", "moodle"]);
|
|
10755
10771
|
/** `application create <env> …`, from the `application` command. */
|
|
10756
10772
|
async function applicationCreate(context, path, rest) {
|
|
10757
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
10773
|
+
if (rest.length > 0) throw new UsageError(USAGE$41);
|
|
10758
10774
|
const type = context.flags.get("--type")?.trim().toLowerCase() ?? "";
|
|
10759
|
-
if (!TYPES.has(type)) throw new UsageError(`create needs --type wordpress or moodle.\n\n${USAGE$
|
|
10775
|
+
if (!TYPES.has(type)) throw new UsageError(`create needs --type wordpress or moodle.\n\n${USAGE$41}`);
|
|
10760
10776
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
10761
|
-
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$
|
|
10777
|
+
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$41}`);
|
|
10762
10778
|
const resources = {
|
|
10763
10779
|
cpuRequestMillicores: required$2(context, "--cpu-request"),
|
|
10764
10780
|
cpuLimitMillicores: required$2(context, "--cpu-limit"),
|
|
@@ -10792,7 +10808,7 @@ async function applicationCreate(context, path, rest) {
|
|
|
10792
10808
|
/** One required whole-number flag, or a usage refusal naming the flag. */
|
|
10793
10809
|
function required$2(context, flag) {
|
|
10794
10810
|
const value = wholeNumberFlag(context.flags, flag);
|
|
10795
|
-
if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$
|
|
10811
|
+
if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$41}`);
|
|
10796
10812
|
return value;
|
|
10797
10813
|
}
|
|
10798
10814
|
//#endregion
|
|
@@ -10822,7 +10838,7 @@ function requiredFlag$2(context, flag, usage) {
|
|
|
10822
10838
|
}
|
|
10823
10839
|
//#endregion
|
|
10824
10840
|
//#region src/commands/application-upload.ts
|
|
10825
|
-
var USAGE$
|
|
10841
|
+
var USAGE$40 = [
|
|
10826
10842
|
"Usage: hostingctl application import-upload <environment-uuid> <application-uuid> --company <slug>",
|
|
10827
10843
|
" --database <path-to.sql> [--archive <path-to.zip> | --directory <dir>]",
|
|
10828
10844
|
"",
|
|
@@ -10838,11 +10854,11 @@ var USAGE$39 = [
|
|
|
10838
10854
|
].join("\n");
|
|
10839
10855
|
/** `application import-upload`, which stages a client site for review. */
|
|
10840
10856
|
async function applicationUpload(context, path, rest) {
|
|
10841
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
10842
|
-
const database = requiredFlag$2(context, "--database", USAGE$
|
|
10857
|
+
if (rest.length > 0) throw new UsageError(USAGE$40);
|
|
10858
|
+
const database = requiredFlag$2(context, "--database", USAGE$40);
|
|
10843
10859
|
const archive = context.flags.get("--archive")?.trim() ?? "";
|
|
10844
10860
|
const directory = context.flags.get("--directory")?.trim() ?? "";
|
|
10845
|
-
if (archive !== "" && directory !== "") throw new UsageError(`Send the site files as either --archive or --directory, not both.\n\n${USAGE$
|
|
10861
|
+
if (archive !== "" && directory !== "") throw new UsageError(`Send the site files as either --archive or --directory, not both.\n\n${USAGE$40}`);
|
|
10846
10862
|
const databaseBytes = await sizeOf(database, "database");
|
|
10847
10863
|
const files = directory === "" ? [] : await manifestOf(directory);
|
|
10848
10864
|
const fileBytes = directory === "" ? 0 : await totalSize(files);
|
|
@@ -10920,7 +10936,7 @@ function describe(bytes) {
|
|
|
10920
10936
|
}
|
|
10921
10937
|
//#endregion
|
|
10922
10938
|
//#region src/commands/application-import.ts
|
|
10923
|
-
var USAGE$
|
|
10939
|
+
var USAGE$39 = [
|
|
10924
10940
|
"Usage: hostingctl application import <environment-uuid> <application-uuid> <import-uuid> --company <slug>",
|
|
10925
10941
|
" hostingctl application import-upload <environment-uuid> <application-uuid> --company <slug>",
|
|
10926
10942
|
" --database <path-to.sql> [--archive <path-to.zip> | --directory <dir>]",
|
|
@@ -10942,7 +10958,7 @@ async function applicationImport(context, action, path, rest) {
|
|
|
10942
10958
|
if (action === "url-repair-preview") return await previewRepair(context, path, rest);
|
|
10943
10959
|
if (action === "import-upload") return await applicationUpload(context, path, rest);
|
|
10944
10960
|
const [importUuid, ...extra] = rest;
|
|
10945
|
-
if (importUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
10961
|
+
if (importUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
|
|
10946
10962
|
if (action === "import") return {
|
|
10947
10963
|
kind: "import",
|
|
10948
10964
|
staged: (await hostingWordpressImportShowImport({ path: {
|
|
@@ -10955,13 +10971,13 @@ async function applicationImport(context, action, path, rest) {
|
|
|
10955
10971
|
importUuid
|
|
10956
10972
|
} })).data));
|
|
10957
10973
|
if (action === "url-repair-confirm") return await confirmRepair(context, path, importUuid);
|
|
10958
|
-
throw new UsageError(USAGE$
|
|
10974
|
+
throw new UsageError(USAGE$39);
|
|
10959
10975
|
}
|
|
10960
10976
|
/** `url-repair-preview --source-url …`: the review a confirmation is made against. */
|
|
10961
10977
|
async function previewRepair(context, path, rest) {
|
|
10962
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
10978
|
+
if (rest.length > 0) throw new UsageError(USAGE$39);
|
|
10963
10979
|
const sourceUrl = context.flags.get("--source-url")?.trim() ?? "";
|
|
10964
|
-
if (sourceUrl === "") throw new UsageError(`url-repair-preview needs --source-url.\n\n${USAGE$
|
|
10980
|
+
if (sourceUrl === "") throw new UsageError(`url-repair-preview needs --source-url.\n\n${USAGE$39}`);
|
|
10965
10981
|
return {
|
|
10966
10982
|
kind: "url-repair",
|
|
10967
10983
|
recovery: (await hostingWordpressUrlRepairPreview({
|
|
@@ -10973,7 +10989,7 @@ async function previewRepair(context, path, rest) {
|
|
|
10973
10989
|
/** `url-repair-confirm <recovery> --confirmation …`: the typed text the review asked for. */
|
|
10974
10990
|
async function confirmRepair(context, path, recoveryUuid) {
|
|
10975
10991
|
const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
|
|
10976
|
-
if (confirmation === "") throw new UsageError(`url-repair-confirm needs --confirmation.\n\n${USAGE$
|
|
10992
|
+
if (confirmation === "") throw new UsageError(`url-repair-confirm needs --confirmation.\n\n${USAGE$39}`);
|
|
10977
10993
|
return await written$3(confirmableWrite(context, `Confirm the URL repair by typing its confirmation ("${confirmation}").`, async () => {
|
|
10978
10994
|
const desiredGeneration = (await hostingEnvironmentShow({ path })).data.desiredGeneration;
|
|
10979
10995
|
const body = {
|
|
@@ -11024,7 +11040,7 @@ function recoveryLines(one) {
|
|
|
11024
11040
|
}
|
|
11025
11041
|
//#endregion
|
|
11026
11042
|
//#region src/commands/application-recovery.ts
|
|
11027
|
-
var USAGE$
|
|
11043
|
+
var USAGE$38 = [
|
|
11028
11044
|
"Usage: hostingctl application recovery-review <environment-uuid> <application-uuid> --company <slug>",
|
|
11029
11045
|
" hostingctl application recovery-confirm <environment-uuid> <application-uuid> --company <slug> --confirmation <text>",
|
|
11030
11046
|
"",
|
|
@@ -11040,16 +11056,16 @@ var USAGE$37 = [
|
|
|
11040
11056
|
].join("\n");
|
|
11041
11057
|
/** `application recovery-review|recovery-confirm`. */
|
|
11042
11058
|
async function applicationRecovery(context, action, path, rest) {
|
|
11043
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
11059
|
+
if (rest.length > 0) throw new UsageError(USAGE$38);
|
|
11044
11060
|
const review = (await hostingApplicationRecoveryShow({ path })).data;
|
|
11045
11061
|
if (action === "recovery-review") return {
|
|
11046
11062
|
kind: "recovery-review",
|
|
11047
11063
|
review
|
|
11048
11064
|
};
|
|
11049
|
-
if (action !== "recovery-confirm") throw new UsageError(USAGE$
|
|
11065
|
+
if (action !== "recovery-confirm") throw new UsageError(USAGE$38);
|
|
11050
11066
|
if (review.blockedReason !== null) throw new UsageError(`This restore is blocked: ${review.blockedReason}`);
|
|
11051
11067
|
const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
|
|
11052
|
-
if (confirmation === "") throw new UsageError(`recovery-confirm needs --confirmation.\n\n${USAGE$
|
|
11068
|
+
if (confirmation === "") throw new UsageError(`recovery-confirm needs --confirmation.\n\n${USAGE$38}`);
|
|
11053
11069
|
return {
|
|
11054
11070
|
kind: "recovery-write",
|
|
11055
11071
|
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 () => {
|
|
@@ -11249,7 +11265,7 @@ function siteAccessText(report) {
|
|
|
11249
11265
|
}
|
|
11250
11266
|
//#endregion
|
|
11251
11267
|
//#region src/commands/application-site-access.ts
|
|
11252
|
-
var USAGE$
|
|
11268
|
+
var USAGE$37 = [
|
|
11253
11269
|
"Usage: hostingctl application site-access <environment-uuid> <application-uuid> --company <slug>",
|
|
11254
11270
|
" hostingctl application site-access-set <environment-uuid> <application-uuid> --company <slug> --sign-in <on|off> [--audience <name>]",
|
|
11255
11271
|
" hostingctl application site-access-rotate <environment-uuid> <application-uuid> --company <slug>",
|
|
@@ -11292,10 +11308,10 @@ var flow$1 = siteAccessFlow({
|
|
|
11292
11308
|
refresh: async (path) => (await hostingApplicationSiteAccessUsersRefresh({ path })).data,
|
|
11293
11309
|
destroy: async (path) => (await hostingApplicationSiteAccessUsersDestroy({ path })).data,
|
|
11294
11310
|
rotate: async (path) => (await hostingApplicationSiteAccessRotate({ path })).data
|
|
11295
|
-
}, USAGE$
|
|
11311
|
+
}, USAGE$37);
|
|
11296
11312
|
/** `application site-access*|site-user*`, which the application dispatcher calls with its resolved path. */
|
|
11297
11313
|
async function applicationSiteAccess(context, action, path, rest) {
|
|
11298
|
-
if (rest.some((one) => one === "")) throw new UsageError(USAGE$
|
|
11314
|
+
if (rest.some((one) => one === "")) throw new UsageError(USAGE$37);
|
|
11299
11315
|
return await flow$1(context, action, path, rest);
|
|
11300
11316
|
}
|
|
11301
11317
|
//#endregion
|
|
@@ -11307,7 +11323,7 @@ async function applicationSiteAccess(context, action, path, rest) {
|
|
|
11307
11323
|
* paused. It starts no build and promotes nothing. The pause is the customer's own control: while it holds, a push to
|
|
11308
11324
|
* the bound ref is read and matched but builds nothing, and the release that is serving is untouched either way.
|
|
11309
11325
|
*/
|
|
11310
|
-
var USAGE$
|
|
11326
|
+
var USAGE$36 = [
|
|
11311
11327
|
"Usage: hostingctl application updates <environment-uuid> <application-uuid> --company <slug>",
|
|
11312
11328
|
" hostingctl application updates-pause <environment-uuid> <application-uuid> --company <slug>",
|
|
11313
11329
|
" hostingctl application updates-resume <environment-uuid> <application-uuid> --company <slug>",
|
|
@@ -11320,7 +11336,7 @@ var USAGE$35 = [
|
|
|
11320
11336
|
"Both writes need --confirm; --dry-run describes the change without sending it."
|
|
11321
11337
|
].join("\n");
|
|
11322
11338
|
async function applicationUpdates(context, action, path, rest) {
|
|
11323
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
11339
|
+
if (rest.length > 0) throw new UsageError(USAGE$36);
|
|
11324
11340
|
if (action === "updates") return {
|
|
11325
11341
|
kind: "updates",
|
|
11326
11342
|
surface: (await hostingApplicationUpdatesShow({ path })).data
|
|
@@ -11332,7 +11348,7 @@ async function applicationUpdates(context, action, path, rest) {
|
|
|
11332
11348
|
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)
|
|
11333
11349
|
};
|
|
11334
11350
|
}
|
|
11335
|
-
throw new UsageError(USAGE$
|
|
11351
|
+
throw new UsageError(USAGE$36);
|
|
11336
11352
|
}
|
|
11337
11353
|
/**
|
|
11338
11354
|
* The update state in words.
|
|
@@ -11620,83 +11636,83 @@ var APPLICATION_METADATA = {
|
|
|
11620
11636
|
var APPLICATION_TOPICS = [
|
|
11621
11637
|
{
|
|
11622
11638
|
path: ["create"],
|
|
11623
|
-
usage: USAGE$
|
|
11639
|
+
usage: USAGE$41
|
|
11624
11640
|
},
|
|
11625
11641
|
{
|
|
11626
11642
|
path: ["build-log"],
|
|
11627
|
-
usage: USAGE$
|
|
11643
|
+
usage: USAGE$43
|
|
11628
11644
|
},
|
|
11629
11645
|
{
|
|
11630
11646
|
path: ["build-retry"],
|
|
11631
|
-
usage: USAGE$
|
|
11647
|
+
usage: USAGE$43
|
|
11632
11648
|
},
|
|
11633
11649
|
{
|
|
11634
11650
|
path: ["build-cancel"],
|
|
11635
|
-
usage: USAGE$
|
|
11651
|
+
usage: USAGE$43
|
|
11636
11652
|
},
|
|
11637
11653
|
{
|
|
11638
11654
|
path: ["source-bind"],
|
|
11639
|
-
usage: USAGE$
|
|
11655
|
+
usage: USAGE$43
|
|
11640
11656
|
},
|
|
11641
11657
|
{
|
|
11642
11658
|
path: ["source-unbind"],
|
|
11643
|
-
usage: USAGE$
|
|
11659
|
+
usage: USAGE$43
|
|
11644
11660
|
},
|
|
11645
11661
|
{
|
|
11646
11662
|
path: ["cache"],
|
|
11647
|
-
usage: USAGE$
|
|
11663
|
+
usage: USAGE$42
|
|
11648
11664
|
},
|
|
11649
11665
|
{
|
|
11650
11666
|
path: ["cache-set"],
|
|
11651
|
-
usage: USAGE$
|
|
11667
|
+
usage: USAGE$42
|
|
11652
11668
|
},
|
|
11653
11669
|
{
|
|
11654
11670
|
path: ["cache-purge"],
|
|
11655
|
-
usage: USAGE$
|
|
11671
|
+
usage: USAGE$42
|
|
11656
11672
|
},
|
|
11657
11673
|
{
|
|
11658
11674
|
path: ["routes"],
|
|
11659
|
-
usage: USAGE$
|
|
11675
|
+
usage: USAGE$42
|
|
11660
11676
|
},
|
|
11661
11677
|
{
|
|
11662
11678
|
path: ["route-add"],
|
|
11663
|
-
usage: USAGE$
|
|
11679
|
+
usage: USAGE$42
|
|
11664
11680
|
},
|
|
11665
11681
|
{
|
|
11666
11682
|
path: ["route-remove"],
|
|
11667
|
-
usage: USAGE$
|
|
11683
|
+
usage: USAGE$42
|
|
11668
11684
|
},
|
|
11669
11685
|
{
|
|
11670
11686
|
path: ["canonical"],
|
|
11671
|
-
usage: USAGE$
|
|
11687
|
+
usage: USAGE$42
|
|
11672
11688
|
},
|
|
11673
11689
|
{
|
|
11674
11690
|
path: ["import"],
|
|
11675
|
-
usage: USAGE$
|
|
11691
|
+
usage: USAGE$39
|
|
11676
11692
|
},
|
|
11677
11693
|
{
|
|
11678
11694
|
path: ["import-upload"],
|
|
11679
|
-
usage: USAGE$
|
|
11695
|
+
usage: USAGE$40
|
|
11680
11696
|
},
|
|
11681
11697
|
{
|
|
11682
11698
|
path: ["import-discard"],
|
|
11683
|
-
usage: USAGE$
|
|
11699
|
+
usage: USAGE$39
|
|
11684
11700
|
},
|
|
11685
11701
|
{
|
|
11686
11702
|
path: ["url-repair-preview"],
|
|
11687
|
-
usage: USAGE$
|
|
11703
|
+
usage: USAGE$39
|
|
11688
11704
|
},
|
|
11689
11705
|
{
|
|
11690
11706
|
path: ["url-repair-confirm"],
|
|
11691
|
-
usage: USAGE$
|
|
11707
|
+
usage: USAGE$39
|
|
11692
11708
|
},
|
|
11693
11709
|
{
|
|
11694
11710
|
path: ["recovery-review"],
|
|
11695
|
-
usage: USAGE$
|
|
11711
|
+
usage: USAGE$38
|
|
11696
11712
|
},
|
|
11697
11713
|
{
|
|
11698
11714
|
path: ["recovery-confirm"],
|
|
11699
|
-
usage: USAGE$
|
|
11715
|
+
usage: USAGE$38
|
|
11700
11716
|
},
|
|
11701
11717
|
{
|
|
11702
11718
|
path: ["runtime"],
|
|
@@ -11704,59 +11720,59 @@ var APPLICATION_TOPICS = [
|
|
|
11704
11720
|
},
|
|
11705
11721
|
{
|
|
11706
11722
|
path: ["site-access"],
|
|
11707
|
-
usage: USAGE$
|
|
11723
|
+
usage: USAGE$37
|
|
11708
11724
|
},
|
|
11709
11725
|
{
|
|
11710
11726
|
path: ["site-access-set"],
|
|
11711
|
-
usage: USAGE$
|
|
11727
|
+
usage: USAGE$37
|
|
11712
11728
|
},
|
|
11713
11729
|
{
|
|
11714
11730
|
path: ["site-access-rotate"],
|
|
11715
|
-
usage: USAGE$
|
|
11731
|
+
usage: USAGE$37
|
|
11716
11732
|
},
|
|
11717
11733
|
{
|
|
11718
11734
|
path: ["site-users"],
|
|
11719
|
-
usage: USAGE$
|
|
11735
|
+
usage: USAGE$37
|
|
11720
11736
|
},
|
|
11721
11737
|
{
|
|
11722
11738
|
path: ["site-user"],
|
|
11723
|
-
usage: USAGE$
|
|
11739
|
+
usage: USAGE$37
|
|
11724
11740
|
},
|
|
11725
11741
|
{
|
|
11726
11742
|
path: ["updates"],
|
|
11727
|
-
usage: USAGE$
|
|
11743
|
+
usage: USAGE$36
|
|
11728
11744
|
},
|
|
11729
11745
|
{
|
|
11730
11746
|
path: ["updates-pause"],
|
|
11731
|
-
usage: USAGE$
|
|
11747
|
+
usage: USAGE$36
|
|
11732
11748
|
},
|
|
11733
11749
|
{
|
|
11734
11750
|
path: ["updates-resume"],
|
|
11735
|
-
usage: USAGE$
|
|
11751
|
+
usage: USAGE$36
|
|
11736
11752
|
},
|
|
11737
11753
|
{
|
|
11738
11754
|
path: ["administrator"],
|
|
11739
|
-
usage: USAGE$
|
|
11755
|
+
usage: USAGE$44
|
|
11740
11756
|
},
|
|
11741
11757
|
{
|
|
11742
11758
|
path: ["administrator-reset"],
|
|
11743
|
-
usage: USAGE$
|
|
11759
|
+
usage: USAGE$44
|
|
11744
11760
|
},
|
|
11745
11761
|
{
|
|
11746
11762
|
path: ["administrator-reveal"],
|
|
11747
|
-
usage: USAGE$
|
|
11763
|
+
usage: USAGE$44
|
|
11748
11764
|
},
|
|
11749
11765
|
{
|
|
11750
11766
|
path: ["recovery-status"],
|
|
11751
|
-
usage: USAGE$
|
|
11767
|
+
usage: USAGE$44
|
|
11752
11768
|
},
|
|
11753
11769
|
{
|
|
11754
11770
|
path: ["recovery-retry"],
|
|
11755
|
-
usage: USAGE$
|
|
11771
|
+
usage: USAGE$44
|
|
11756
11772
|
},
|
|
11757
11773
|
{
|
|
11758
11774
|
path: ["recovery-cancel"],
|
|
11759
|
-
usage: USAGE$
|
|
11775
|
+
usage: USAGE$44
|
|
11760
11776
|
}
|
|
11761
11777
|
];
|
|
11762
11778
|
//#endregion
|
|
@@ -12822,7 +12838,7 @@ function episode(rest) {
|
|
|
12822
12838
|
}
|
|
12823
12839
|
//#endregion
|
|
12824
12840
|
//#region src/commands/company-assets.ts
|
|
12825
|
-
var USAGE$
|
|
12841
|
+
var USAGE$35 = [
|
|
12826
12842
|
"Usage: hostingctl company logo|favicon set --image-file <path> --company <slug>",
|
|
12827
12843
|
" hostingctl company logo|favicon remove --company <slug>",
|
|
12828
12844
|
"",
|
|
@@ -12837,17 +12853,17 @@ var USAGE$34 = [
|
|
|
12837
12853
|
*/
|
|
12838
12854
|
async function companyAssets(context, asset, rest) {
|
|
12839
12855
|
const [action, ...tail] = rest;
|
|
12840
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
12856
|
+
if (tail.length > 0) throw new UsageError(USAGE$35);
|
|
12841
12857
|
const company = await requireCompany(context.flags);
|
|
12842
12858
|
if (action === "set") return await set(context, asset, company);
|
|
12843
12859
|
if (action === "remove") return await remove$2(context, asset, company);
|
|
12844
|
-
throw new UsageError(USAGE$
|
|
12860
|
+
throw new UsageError(USAGE$35);
|
|
12845
12861
|
}
|
|
12846
12862
|
/** `set --image-file …`: one multipart upload of the asset. */
|
|
12847
12863
|
async function set(context, asset, company) {
|
|
12848
12864
|
const file = context.flags.get("--image-file") ?? "";
|
|
12849
12865
|
return await confirmableWrite(context, file === "" ? `Set ${company}'s ${asset}.` : `Set ${company}'s ${asset} to ${file}.`, async () => {
|
|
12850
|
-
const body = await imageUpload(file, USAGE$
|
|
12866
|
+
const body = await imageUpload(file, USAGE$35);
|
|
12851
12867
|
return asset === "logo" ? (await companyAssetStoreLogo({
|
|
12852
12868
|
path: { company },
|
|
12853
12869
|
body
|
|
@@ -12885,7 +12901,7 @@ function companyRole(raw, usage) {
|
|
|
12885
12901
|
}
|
|
12886
12902
|
//#endregion
|
|
12887
12903
|
//#region src/commands/company-invitations.ts
|
|
12888
|
-
var USAGE$
|
|
12904
|
+
var USAGE$34 = [
|
|
12889
12905
|
"Usage: hostingctl company invitations --company <slug>",
|
|
12890
12906
|
" hostingctl company invite --company <slug> --email <email> --name <name> --role <admin|member>",
|
|
12891
12907
|
" hostingctl company cancel-invitation <invitation-uuid> --company <slug>",
|
|
@@ -12909,7 +12925,7 @@ var MAX_INVITATION_TOKEN_BYTES = 4096;
|
|
|
12909
12925
|
*/
|
|
12910
12926
|
async function companyInvitations(context, subcommand, rest) {
|
|
12911
12927
|
if (subcommand === "invitations") {
|
|
12912
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
12928
|
+
if (rest.length > 0) throw new UsageError(USAGE$34);
|
|
12913
12929
|
const company = await requireCompany(context.flags);
|
|
12914
12930
|
return {
|
|
12915
12931
|
kind: "invitations",
|
|
@@ -12920,20 +12936,20 @@ async function companyInvitations(context, subcommand, rest) {
|
|
|
12920
12936
|
if (subcommand === "invite") return await invite(context, rest);
|
|
12921
12937
|
if (subcommand === "cancel-invitation") return await cancel(context, rest);
|
|
12922
12938
|
if (subcommand === "invitation-preview") return (await companyInvitationPreview({
|
|
12923
|
-
path: { invitationUuid: oneUuid$7(rest, USAGE$
|
|
12924
|
-
body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$
|
|
12939
|
+
path: { invitationUuid: oneUuid$7(rest, USAGE$34) },
|
|
12940
|
+
body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$34) }
|
|
12925
12941
|
})).data;
|
|
12926
12942
|
if (subcommand === "invitation-accept") return await accept(context, rest);
|
|
12927
|
-
throw new UsageError(USAGE$
|
|
12943
|
+
throw new UsageError(USAGE$34);
|
|
12928
12944
|
}
|
|
12929
12945
|
/** `invite --email … --name … --role …`. */
|
|
12930
12946
|
async function invite(context, rest) {
|
|
12931
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
12947
|
+
if (rest.length > 0) throw new UsageError(USAGE$34);
|
|
12932
12948
|
const company = await requireCompany(context.flags);
|
|
12933
12949
|
const email = context.flags.get("--email")?.trim() ?? "";
|
|
12934
12950
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
12935
|
-
const role = companyRole(context.flags.get("--role"), USAGE$
|
|
12936
|
-
if (email === "" || name === "") throw new UsageError(`invite needs --email and --name.\n\n${USAGE$
|
|
12951
|
+
const role = companyRole(context.flags.get("--role"), USAGE$34);
|
|
12952
|
+
if (email === "" || name === "") throw new UsageError(`invite needs --email and --name.\n\n${USAGE$34}`);
|
|
12937
12953
|
return await confirmableWrite(context, `Invite ${name} <${email}> into ${company} as ${role}.`, async () => (await companyInvitationStore({
|
|
12938
12954
|
path: { company },
|
|
12939
12955
|
body: {
|
|
@@ -12945,7 +12961,7 @@ async function invite(context, rest) {
|
|
|
12945
12961
|
}
|
|
12946
12962
|
/** `cancel-invitation <uuid> --company …`. */
|
|
12947
12963
|
async function cancel(context, rest) {
|
|
12948
|
-
const invitationUuid = oneUuid$7(rest, USAGE$
|
|
12964
|
+
const invitationUuid = oneUuid$7(rest, USAGE$34);
|
|
12949
12965
|
const company = await requireCompany(context.flags);
|
|
12950
12966
|
return await confirmableWrite(context, `Cancel invitation ${invitationUuid}.`, async () => {
|
|
12951
12967
|
return (await companyInvitationDestroy({ path: {
|
|
@@ -12956,11 +12972,11 @@ async function cancel(context, rest) {
|
|
|
12956
12972
|
}
|
|
12957
12973
|
/** `invitation-accept <uuid>`: join the company the invitation names. */
|
|
12958
12974
|
async function accept(context, rest) {
|
|
12959
|
-
const invitationUuid = oneUuid$7(rest, USAGE$
|
|
12975
|
+
const invitationUuid = oneUuid$7(rest, USAGE$34);
|
|
12960
12976
|
return await confirmableWrite(context, `Accept invitation ${invitationUuid}.`, async () => {
|
|
12961
12977
|
return (await companyInvitationAccept({
|
|
12962
12978
|
path: { invitationUuid },
|
|
12963
|
-
body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$
|
|
12979
|
+
body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$34) }
|
|
12964
12980
|
})).data;
|
|
12965
12981
|
});
|
|
12966
12982
|
}
|
|
@@ -13061,31 +13077,31 @@ var COMPANY_METADATA = {
|
|
|
13061
13077
|
var COMPANY_TOPICS = [
|
|
13062
13078
|
{
|
|
13063
13079
|
path: ["logo"],
|
|
13064
|
-
usage: USAGE$
|
|
13080
|
+
usage: USAGE$35
|
|
13065
13081
|
},
|
|
13066
13082
|
{
|
|
13067
13083
|
path: ["favicon"],
|
|
13068
|
-
usage: USAGE$
|
|
13084
|
+
usage: USAGE$35
|
|
13069
13085
|
},
|
|
13070
13086
|
{
|
|
13071
13087
|
path: ["invitations"],
|
|
13072
|
-
usage: USAGE$
|
|
13088
|
+
usage: USAGE$34
|
|
13073
13089
|
},
|
|
13074
13090
|
{
|
|
13075
13091
|
path: ["invite"],
|
|
13076
|
-
usage: USAGE$
|
|
13092
|
+
usage: USAGE$34
|
|
13077
13093
|
},
|
|
13078
13094
|
{
|
|
13079
13095
|
path: ["cancel-invitation"],
|
|
13080
|
-
usage: USAGE$
|
|
13096
|
+
usage: USAGE$34
|
|
13081
13097
|
},
|
|
13082
13098
|
{
|
|
13083
13099
|
path: ["invitation-preview"],
|
|
13084
|
-
usage: USAGE$
|
|
13100
|
+
usage: USAGE$34
|
|
13085
13101
|
},
|
|
13086
13102
|
{
|
|
13087
13103
|
path: ["invitation-accept"],
|
|
13088
|
-
usage: USAGE$
|
|
13104
|
+
usage: USAGE$34
|
|
13089
13105
|
}
|
|
13090
13106
|
];
|
|
13091
13107
|
//#endregion
|
|
@@ -13906,7 +13922,7 @@ function readJsonObject(file, subject) {
|
|
|
13906
13922
|
}
|
|
13907
13923
|
//#endregion
|
|
13908
13924
|
//#region src/commands/dns-records.ts
|
|
13909
|
-
var USAGE$
|
|
13925
|
+
var USAGE$33 = [
|
|
13910
13926
|
"Usage: hostingctl dns enable <domain-uuid> --company <slug>",
|
|
13911
13927
|
" hostingctl dns record set <domain-uuid> --company <slug> --file <set.json>",
|
|
13912
13928
|
" hostingctl dns record remove <domain-uuid> --company <slug> --name <relative> --type <type>",
|
|
@@ -13945,7 +13961,7 @@ async function dnsWrites(context, subcommand, rest) {
|
|
|
13945
13961
|
if (subcommand === "record") return await record$4(context, rest);
|
|
13946
13962
|
if (subcommand === "dnssec") return await changeDnssec(context, rest);
|
|
13947
13963
|
if (subcommand === "handover") return await handover(context, rest);
|
|
13948
|
-
throw new UsageError(USAGE$
|
|
13964
|
+
throw new UsageError(USAGE$33);
|
|
13949
13965
|
}
|
|
13950
13966
|
/** The zone's current desired generation, which every write must name. */
|
|
13951
13967
|
async function generation(company, domainUuid) {
|
|
@@ -13956,7 +13972,7 @@ async function generation(company, domainUuid) {
|
|
|
13956
13972
|
}
|
|
13957
13973
|
/** `dns enable <uuid>`: take the zone over into managed DNS. */
|
|
13958
13974
|
async function enable(context, rest) {
|
|
13959
|
-
const domainUuid = oneUuid$7(rest, USAGE$
|
|
13975
|
+
const domainUuid = oneUuid$7(rest, USAGE$33);
|
|
13960
13976
|
const company = await requireCompany(context.flags);
|
|
13961
13977
|
return await confirmableWrite(context, "Publish this name's zone in managed DNS.", async () => (await domainsDnsStore({ path: {
|
|
13962
13978
|
company,
|
|
@@ -13966,16 +13982,16 @@ async function enable(context, rest) {
|
|
|
13966
13982
|
/** `dns record set|remove`. */
|
|
13967
13983
|
async function record$4(context, rest) {
|
|
13968
13984
|
const [action, ...tail] = rest;
|
|
13969
|
-
const domainUuid = oneUuid$7(tail, USAGE$
|
|
13985
|
+
const domainUuid = oneUuid$7(tail, USAGE$33);
|
|
13970
13986
|
const company = await requireCompany(context.flags);
|
|
13971
13987
|
if (action === "set") return await setRecord(context, company, domainUuid);
|
|
13972
13988
|
if (action === "remove") return await removeRecord(context, company, domainUuid);
|
|
13973
|
-
throw new UsageError(USAGE$
|
|
13989
|
+
throw new UsageError(USAGE$33);
|
|
13974
13990
|
}
|
|
13975
13991
|
/** `record set --file`: replace one set with the file's own values. */
|
|
13976
13992
|
async function setRecord(context, company, domainUuid) {
|
|
13977
13993
|
const file = context.flags.get("--file") ?? "";
|
|
13978
|
-
if (file === "") throw new UsageError(`record set needs --file <set.json>.\n\n${USAGE$
|
|
13994
|
+
if (file === "") throw new UsageError(`record set needs --file <set.json>.\n\n${USAGE$33}`);
|
|
13979
13995
|
const set = recordSetFromFile(file);
|
|
13980
13996
|
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 () => {
|
|
13981
13997
|
const body = {
|
|
@@ -13995,7 +14011,7 @@ async function setRecord(context, company, domainUuid) {
|
|
|
13995
14011
|
async function removeRecord(context, company, domainUuid) {
|
|
13996
14012
|
const relativeName = context.flags.get("--name") ?? "";
|
|
13997
14013
|
const recordType = recordTypeFlag(context);
|
|
13998
|
-
if (relativeName === "") throw new UsageError(`record remove needs --name.\n\n${USAGE$
|
|
14014
|
+
if (relativeName === "") throw new UsageError(`record remove needs --name.\n\n${USAGE$33}`);
|
|
13999
14015
|
return await confirmableWrite(context, `Remove the ${recordType.toUpperCase()} set "${relativeName}".`, async () => {
|
|
14000
14016
|
const query = {
|
|
14001
14017
|
relativeName,
|
|
@@ -14014,8 +14030,8 @@ async function removeRecord(context, company, domainUuid) {
|
|
|
14014
14030
|
/** `dns dnssec <signed|unsigned> <uuid>`: the signing mode, with the confirmation the API requires. */
|
|
14015
14031
|
async function changeDnssec(context, rest) {
|
|
14016
14032
|
const [mode, uuid, ...extra] = rest;
|
|
14017
|
-
if (mode === void 0 || mode !== "signed" && mode !== "unsigned" || extra.length > 0) throw new UsageError(USAGE$
|
|
14018
|
-
const domainUuid = oneUuid$7(uuid === void 0 ? [] : [uuid], USAGE$
|
|
14033
|
+
if (mode === void 0 || mode !== "signed" && mode !== "unsigned" || extra.length > 0) throw new UsageError(USAGE$33);
|
|
14034
|
+
const domainUuid = oneUuid$7(uuid === void 0 ? [] : [uuid], USAGE$33);
|
|
14019
14035
|
const company = await requireCompany(context.flags);
|
|
14020
14036
|
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 () => {
|
|
14021
14037
|
const body = {
|
|
@@ -14034,7 +14050,7 @@ async function changeDnssec(context, rest) {
|
|
|
14034
14050
|
}
|
|
14035
14051
|
/** `dns handover <uuid>`: hand the zone back, dropping what this platform publishes. */
|
|
14036
14052
|
async function handover(context, rest) {
|
|
14037
|
-
const domainUuid = oneUuid$7(rest, USAGE$
|
|
14053
|
+
const domainUuid = oneUuid$7(rest, USAGE$33);
|
|
14038
14054
|
const company = await requireCompany(context.flags);
|
|
14039
14055
|
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 () => {
|
|
14040
14056
|
const body = {
|
|
@@ -14053,7 +14069,7 @@ async function handover(context, rest) {
|
|
|
14053
14069
|
/** A record type flag, refused when it is not one of the API's own values. */
|
|
14054
14070
|
function recordTypeFlag(context) {
|
|
14055
14071
|
const raw = (context.flags.get("--type") ?? "").trim().toLowerCase();
|
|
14056
|
-
if (!RECORD_TYPES.has(raw)) throw new UsageError(`--type must be one of ${[...RECORD_TYPES].join(", ")} (got "${raw}").\n\n${USAGE$
|
|
14072
|
+
if (!RECORD_TYPES.has(raw)) throw new UsageError(`--type must be one of ${[...RECORD_TYPES].join(", ")} (got "${raw}").\n\n${USAGE$33}`);
|
|
14057
14073
|
return raw;
|
|
14058
14074
|
}
|
|
14059
14075
|
/**
|
|
@@ -14087,7 +14103,7 @@ function recordSetFromValue(value, subject) {
|
|
|
14087
14103
|
}
|
|
14088
14104
|
//#endregion
|
|
14089
14105
|
//#region src/commands/dns-templates.ts
|
|
14090
|
-
var USAGE$
|
|
14106
|
+
var USAGE$32 = [
|
|
14091
14107
|
"Usage: hostingctl dns template list --company <slug>",
|
|
14092
14108
|
" hostingctl dns template show <template-uuid> --company <slug>",
|
|
14093
14109
|
" hostingctl dns template save [<template-uuid>] --company <slug> --file <template.json>",
|
|
@@ -14109,24 +14125,24 @@ var USAGE$31 = [
|
|
|
14109
14125
|
async function dnsTemplates(context, rest) {
|
|
14110
14126
|
const [action, ...tail] = rest;
|
|
14111
14127
|
if (action === "list") {
|
|
14112
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
14128
|
+
if (tail.length > 0) throw new UsageError(USAGE$32);
|
|
14113
14129
|
return {
|
|
14114
14130
|
kind: "templates",
|
|
14115
14131
|
templates: (await dnsTemplatesIndex({ path: { company: await requireCompany(context.flags) } })).data.templates
|
|
14116
14132
|
};
|
|
14117
14133
|
}
|
|
14118
|
-
if (action === "show") return await show$4(context, oneUuid$7(tail, USAGE$
|
|
14134
|
+
if (action === "show") return await show$4(context, oneUuid$7(tail, USAGE$32));
|
|
14119
14135
|
if (action === "save") return await save$1(context, tail[0]);
|
|
14120
|
-
if (action === "delete") return await destroy$1(context, oneUuid$7(tail, USAGE$
|
|
14121
|
-
if (action === "from-zone") return await fromZone(context, oneUuid$7(tail, USAGE$
|
|
14136
|
+
if (action === "delete") return await destroy$1(context, oneUuid$7(tail, USAGE$32));
|
|
14137
|
+
if (action === "from-zone") return await fromZone(context, oneUuid$7(tail, USAGE$32));
|
|
14122
14138
|
if (action === "preview") return await preview$1(context, tail);
|
|
14123
14139
|
if (action === "apply") return await apply(context, tail);
|
|
14124
|
-
throw new UsageError(USAGE$
|
|
14140
|
+
throw new UsageError(USAGE$32);
|
|
14125
14141
|
}
|
|
14126
14142
|
/** Two uuids: the template, then the zone it applies to. */
|
|
14127
14143
|
function templateAndZone(rest) {
|
|
14128
14144
|
const [templateUuid, domainUuid, ...extra] = rest;
|
|
14129
|
-
if (templateUuid === void 0 || templateUuid === "" || domainUuid === void 0 || domainUuid === "" || extra.length > 0) throw new UsageError(USAGE$
|
|
14145
|
+
if (templateUuid === void 0 || templateUuid === "" || domainUuid === void 0 || domainUuid === "" || extra.length > 0) throw new UsageError(USAGE$32);
|
|
14130
14146
|
return {
|
|
14131
14147
|
templateUuid,
|
|
14132
14148
|
domainUuid
|
|
@@ -14145,7 +14161,7 @@ async function show$4(context, templateUuid) {
|
|
|
14145
14161
|
/** `save [<uuid>] --file …`: record a new template, or replace the one named. */
|
|
14146
14162
|
async function save$1(context, templateUuid) {
|
|
14147
14163
|
const file = context.flags.get("--file") ?? "";
|
|
14148
|
-
if (file === "") throw new UsageError(`template save needs --file <template.json>.\n\n${USAGE$
|
|
14164
|
+
if (file === "") throw new UsageError(`template save needs --file <template.json>.\n\n${USAGE$32}`);
|
|
14149
14165
|
const company = await requireCompany(context.flags);
|
|
14150
14166
|
const document = readJsonObject(file, "template");
|
|
14151
14167
|
const name = typeof document.name === "string" ? document.name.trim() : "";
|
|
@@ -14181,7 +14197,7 @@ async function destroy$1(context, templateUuid) {
|
|
|
14181
14197
|
async function fromZone(context, domainUuid) {
|
|
14182
14198
|
const company = await requireCompany(context.flags);
|
|
14183
14199
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
14184
|
-
if (name === "") throw new UsageError(`template from-zone needs --name.\n\n${USAGE$
|
|
14200
|
+
if (name === "") throw new UsageError(`template from-zone needs --name.\n\n${USAGE$32}`);
|
|
14185
14201
|
const zone = (await domainsDnsShow({ path: {
|
|
14186
14202
|
company,
|
|
14187
14203
|
domainUuid
|
|
@@ -14251,7 +14267,7 @@ function recordSetsFromFile$1(document, subject) {
|
|
|
14251
14267
|
}
|
|
14252
14268
|
//#endregion
|
|
14253
14269
|
//#region src/commands/dns-text.ts
|
|
14254
|
-
var USAGE$
|
|
14270
|
+
var USAGE$31 = [
|
|
14255
14271
|
"Usage: hostingctl dns <zone|export> <domain-uuid> --company <slug>",
|
|
14256
14272
|
" hostingctl dns import <preview|apply> <domain-uuid> --company <slug> --file <path> [--confirm]",
|
|
14257
14273
|
" hostingctl dns enable <domain-uuid> --company <slug>",
|
|
@@ -14322,7 +14338,7 @@ function applyText(result) {
|
|
|
14322
14338
|
var DNS_METADATA = {
|
|
14323
14339
|
name: "dns",
|
|
14324
14340
|
summary: "A managed name's zone, its zone-file export, and the reviewed import write.",
|
|
14325
|
-
usage: USAGE$
|
|
14341
|
+
usage: USAGE$31,
|
|
14326
14342
|
flags: [
|
|
14327
14343
|
{
|
|
14328
14344
|
name: "--file",
|
|
@@ -14360,23 +14376,23 @@ var DNS_METADATA = {
|
|
|
14360
14376
|
var DNS_TOPICS = [
|
|
14361
14377
|
{
|
|
14362
14378
|
path: ["enable"],
|
|
14363
|
-
usage: USAGE$
|
|
14379
|
+
usage: USAGE$33
|
|
14364
14380
|
},
|
|
14365
14381
|
{
|
|
14366
14382
|
path: ["record"],
|
|
14367
|
-
usage: USAGE$
|
|
14383
|
+
usage: USAGE$33
|
|
14368
14384
|
},
|
|
14369
14385
|
{
|
|
14370
14386
|
path: ["dnssec"],
|
|
14371
|
-
usage: USAGE$
|
|
14387
|
+
usage: USAGE$33
|
|
14372
14388
|
},
|
|
14373
14389
|
{
|
|
14374
14390
|
path: ["handover"],
|
|
14375
|
-
usage: USAGE$
|
|
14391
|
+
usage: USAGE$33
|
|
14376
14392
|
},
|
|
14377
14393
|
{
|
|
14378
14394
|
path: ["template"],
|
|
14379
|
-
usage: USAGE$
|
|
14395
|
+
usage: USAGE$32
|
|
14380
14396
|
}
|
|
14381
14397
|
];
|
|
14382
14398
|
//#endregion
|
|
@@ -14394,7 +14410,7 @@ var IMPORT_LINE = /^(\S+)\s+(\d+)\s+(\S+)\s+(.+)$/;
|
|
|
14394
14410
|
* hold customer DNS data, so its contents are never printed; only the API's own answer is shown.
|
|
14395
14411
|
*/
|
|
14396
14412
|
function recordSetsFromFile(file) {
|
|
14397
|
-
if (file === void 0 || file === "") throw new UsageError(`Importing needs the record sets from disk: pass --file <path>.\n\n${USAGE$
|
|
14413
|
+
if (file === void 0 || file === "") throw new UsageError(`Importing needs the record sets from disk: pass --file <path>.\n\n${USAGE$31}`);
|
|
14398
14414
|
const sets = /* @__PURE__ */ new Map();
|
|
14399
14415
|
for (const [index, raw] of readBoundedImportFile(file, "import").split("\n").entries()) addLine(sets, raw.trim(), index + 1);
|
|
14400
14416
|
if (sets.size === 0) throw new UsageError(`The import file [${file}] holds no record sets.`);
|
|
@@ -14488,7 +14504,7 @@ var dns = {
|
|
|
14488
14504
|
if (subcommand === "import") return await importRecords(context, rest);
|
|
14489
14505
|
if (subcommand === "template") return await dnsTemplates(context, rest);
|
|
14490
14506
|
if (WRITE_SUBCOMMANDS$1.has(subcommand ?? "")) return await dnsWrites(context, subcommand ?? "", rest);
|
|
14491
|
-
throw new UsageError(USAGE$
|
|
14507
|
+
throw new UsageError(USAGE$31);
|
|
14492
14508
|
},
|
|
14493
14509
|
human(report) {
|
|
14494
14510
|
if ("sent" in report) return renderWriteOutcome(report, dnsWriteText);
|
|
@@ -14507,7 +14523,7 @@ async function readZone(context, rest, which) {
|
|
|
14507
14523
|
/** `import preview|apply <uuid> --file <path>`: the review, or the reviewed write. */
|
|
14508
14524
|
async function importRecords(context, rest) {
|
|
14509
14525
|
const [action, ...tail] = rest;
|
|
14510
|
-
if (action !== "preview" && action !== "apply") throw new UsageError(USAGE$
|
|
14526
|
+
if (action !== "preview" && action !== "apply") throw new UsageError(USAGE$31);
|
|
14511
14527
|
const path = await domainPath$1(context, tail);
|
|
14512
14528
|
const recordSets = recordSetsFromFile(context.flags.get("--file"));
|
|
14513
14529
|
if (action === "preview") return (await domainsDnsImportPreview({
|
|
@@ -14544,7 +14560,7 @@ async function applyImport(context, path, recordSets) {
|
|
|
14544
14560
|
/** The company and the one domain uuid a DNS subcommand needs, or a usage refusal. */
|
|
14545
14561
|
async function domainPath$1(context, rest) {
|
|
14546
14562
|
const [domainUuid, ...extra] = rest;
|
|
14547
|
-
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
14563
|
+
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$31);
|
|
14548
14564
|
return {
|
|
14549
14565
|
company: await requireCompany(context.flags),
|
|
14550
14566
|
domainUuid
|
|
@@ -14713,7 +14729,7 @@ function checkText(check) {
|
|
|
14713
14729
|
//#endregion
|
|
14714
14730
|
//#region src/commands/email-alias.ts
|
|
14715
14731
|
/** The one usage string this group refuses with, owned by the group it belongs to. */
|
|
14716
|
-
var USAGE$
|
|
14732
|
+
var USAGE$30 = [
|
|
14717
14733
|
"Usage: hostingctl email alias add <email-domain-uuid> --company <slug> --local <name> --destinations a@x,b@y",
|
|
14718
14734
|
" hostingctl email alias set <email-domain-uuid> <alias-uuid> --company <slug> --destinations a@x,b@y",
|
|
14719
14735
|
" hostingctl email alias remove <email-domain-uuid> <alias-uuid> --company <slug>",
|
|
@@ -14737,16 +14753,16 @@ async function aliasGroup(context, action, tail) {
|
|
|
14737
14753
|
if (action === "set") return await aliasSet(context, tail);
|
|
14738
14754
|
if (action === "remove") return await aliasRemove(context, tail);
|
|
14739
14755
|
if (action === "unroute") return await aliasUnroute(context, tail);
|
|
14740
|
-
throw new UsageError(USAGE$
|
|
14756
|
+
throw new UsageError(USAGE$30);
|
|
14741
14757
|
}
|
|
14742
14758
|
/** `alias add <domain> --local … --destinations …`: a new forwarding address. */
|
|
14743
14759
|
async function aliasAdd(context, tail) {
|
|
14744
14760
|
const [emailDomainUuid, ...extra] = tail;
|
|
14745
|
-
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
14761
|
+
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$30);
|
|
14746
14762
|
const company = await requireCompany(context.flags);
|
|
14747
14763
|
const localPart = context.flags.get("--local")?.trim().toLowerCase() ?? "";
|
|
14748
14764
|
const list = destinations$1(context);
|
|
14749
|
-
if (localPart === "" || list.length === 0) throw new UsageError(`alias add needs --local and --destinations.\n\n${USAGE$
|
|
14765
|
+
if (localPart === "" || list.length === 0) throw new UsageError(`alias add needs --local and --destinations.\n\n${USAGE$30}`);
|
|
14750
14766
|
return await confirmableWrite(context, [`Create ${localPart}@… forwarding to:`, ...list.map((one) => ` ${one}`)].join("\n"), async () => {
|
|
14751
14767
|
return (await emailAliasesStore({
|
|
14752
14768
|
path: {
|
|
@@ -14763,10 +14779,10 @@ async function aliasAdd(context, tail) {
|
|
|
14763
14779
|
/** `alias set <domain> <alias> --destinations …`: replace the complete recipient list. */
|
|
14764
14780
|
async function aliasSet(context, tail) {
|
|
14765
14781
|
const [emailDomainUuid, aliasUuid, ...extra] = tail;
|
|
14766
|
-
if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
14782
|
+
if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$30);
|
|
14767
14783
|
const company = await requireCompany(context.flags);
|
|
14768
14784
|
const list = destinations$1(context);
|
|
14769
|
-
if (list.length === 0) throw new UsageError(`alias set needs --destinations.\n\n${USAGE$
|
|
14785
|
+
if (list.length === 0) throw new UsageError(`alias set needs --destinations.\n\n${USAGE$30}`);
|
|
14770
14786
|
return await confirmableWrite(context, [`Replace ${aliasUuid}'s destinations with:`, ...list.map((one) => ` ${one}`)].join("\n"), async () => {
|
|
14771
14787
|
return (await emailAliasesUpdate({
|
|
14772
14788
|
path: {
|
|
@@ -14781,7 +14797,7 @@ async function aliasSet(context, tail) {
|
|
|
14781
14797
|
/** `alias remove <domain> <alias>`. */
|
|
14782
14798
|
async function aliasRemove(context, tail) {
|
|
14783
14799
|
const [emailDomainUuid, aliasUuid, ...extra] = tail;
|
|
14784
|
-
if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
14800
|
+
if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$30);
|
|
14785
14801
|
const company = await requireCompany(context.flags);
|
|
14786
14802
|
return await confirmableWrite(context, `Remove alias ${aliasUuid}.`, async () => {
|
|
14787
14803
|
return (await emailAliasesDestroy({ path: {
|
|
@@ -14794,7 +14810,7 @@ async function aliasRemove(context, tail) {
|
|
|
14794
14810
|
/** `alias unroute <domain> <alias> <mailbox>`: drop one destination. */
|
|
14795
14811
|
async function aliasUnroute(context, tail) {
|
|
14796
14812
|
const [emailDomainUuid, aliasUuid, mailboxUuid, ...extra] = tail;
|
|
14797
|
-
if (emailDomainUuid === void 0 || aliasUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
14813
|
+
if (emailDomainUuid === void 0 || aliasUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$30);
|
|
14798
14814
|
const company = await requireCompany(context.flags);
|
|
14799
14815
|
return await confirmableWrite(context, `Stop forwarding ${aliasUuid} to mailbox ${mailboxUuid}.`, async () => {
|
|
14800
14816
|
return (await emailAliasesDestinationsDestroy({ path: {
|
|
@@ -14807,7 +14823,7 @@ async function aliasUnroute(context, tail) {
|
|
|
14807
14823
|
}
|
|
14808
14824
|
//#endregion
|
|
14809
14825
|
//#region src/commands/email-address.ts
|
|
14810
|
-
var USAGE$
|
|
14826
|
+
var USAGE$29 = [
|
|
14811
14827
|
"Usage: hostingctl email alias add <email-domain-uuid> --company <slug> --local <name> --destinations a@x,b@y",
|
|
14812
14828
|
" hostingctl email alias set <email-domain-uuid> <alias-uuid> --company <slug> --destinations a@x,b@y",
|
|
14813
14829
|
" hostingctl email alias remove <email-domain-uuid> <alias-uuid> --company <slug>",
|
|
@@ -14833,13 +14849,13 @@ async function emailAddresses(context, subcommand, rest) {
|
|
|
14833
14849
|
if (subcommand === "alias") return await aliasGroup(context, action, tail);
|
|
14834
14850
|
if (subcommand === "app-token") return await appToken(context, action, tail);
|
|
14835
14851
|
if (subcommand === "send-as") return await sendAs(context, action, tail);
|
|
14836
|
-
throw new UsageError(USAGE$
|
|
14852
|
+
throw new UsageError(USAGE$29);
|
|
14837
14853
|
}
|
|
14838
14854
|
/** `app-token list|issue|revoke|deliver`. */
|
|
14839
14855
|
async function appToken(context, action, tail) {
|
|
14840
14856
|
const company = await requireCompany(context.flags);
|
|
14841
14857
|
const [emailDomainUuid, mailboxUuid, third, ...extra] = tail;
|
|
14842
|
-
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
14858
|
+
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$29);
|
|
14843
14859
|
const path = {
|
|
14844
14860
|
company,
|
|
14845
14861
|
emailDomainUuid,
|
|
@@ -14867,7 +14883,7 @@ async function appToken(context, action, tail) {
|
|
|
14867
14883
|
}
|
|
14868
14884
|
if (action === "issue" && third === void 0) {
|
|
14869
14885
|
const label = context.flags.get("--label")?.trim() ?? "";
|
|
14870
|
-
if (label === "") throw new UsageError(`app-token issue needs --label.\n\n${USAGE$
|
|
14886
|
+
if (label === "") throw new UsageError(`app-token issue needs --label.\n\n${USAGE$29}`);
|
|
14871
14887
|
return await confirmableWrite(context, `Create an application password labelled "${label}".`, async () => {
|
|
14872
14888
|
return (await emailAppTokensStore({
|
|
14873
14889
|
path,
|
|
@@ -14875,7 +14891,7 @@ async function appToken(context, action, tail) {
|
|
|
14875
14891
|
})).data;
|
|
14876
14892
|
});
|
|
14877
14893
|
}
|
|
14878
|
-
if (third === void 0) throw new UsageError(USAGE$
|
|
14894
|
+
if (third === void 0) throw new UsageError(USAGE$29);
|
|
14879
14895
|
const tokenPath = {
|
|
14880
14896
|
...path,
|
|
14881
14897
|
tokenUuid: third
|
|
@@ -14884,14 +14900,14 @@ async function appToken(context, action, tail) {
|
|
|
14884
14900
|
return (await emailAppTokensRevoke({ path: tokenPath })).data;
|
|
14885
14901
|
});
|
|
14886
14902
|
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);
|
|
14887
|
-
throw new UsageError(USAGE$
|
|
14903
|
+
throw new UsageError(USAGE$29);
|
|
14888
14904
|
}
|
|
14889
14905
|
/** `send-as list|grant|revoke`. */
|
|
14890
14906
|
async function sendAs(context, action, tail) {
|
|
14891
14907
|
const company = await requireCompany(context.flags);
|
|
14892
14908
|
if (action === "revoke") {
|
|
14893
14909
|
const [grantUuid, ...extra] = tail;
|
|
14894
|
-
if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
14910
|
+
if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$29);
|
|
14895
14911
|
return await confirmableWrite(context, `Revoke send-as grant ${grantUuid}.`, async () => {
|
|
14896
14912
|
return (await emailSendAsGrantsDestroy({ path: {
|
|
14897
14913
|
company,
|
|
@@ -14900,7 +14916,7 @@ async function sendAs(context, action, tail) {
|
|
|
14900
14916
|
});
|
|
14901
14917
|
}
|
|
14902
14918
|
const [emailDomainUuid, mailboxUuid, ...extra] = tail;
|
|
14903
|
-
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
14919
|
+
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$29);
|
|
14904
14920
|
const path = {
|
|
14905
14921
|
company,
|
|
14906
14922
|
emailDomainUuid,
|
|
@@ -14927,7 +14943,7 @@ async function sendAs(context, action, tail) {
|
|
|
14927
14943
|
}
|
|
14928
14944
|
if (action === "grant") {
|
|
14929
14945
|
const grantedAddressUuid = context.flags.get("--address") ?? "";
|
|
14930
|
-
if (grantedAddressUuid === "") throw new UsageError(`send-as grant needs --address.\n\n${USAGE$
|
|
14946
|
+
if (grantedAddressUuid === "") throw new UsageError(`send-as grant needs --address.\n\n${USAGE$29}`);
|
|
14931
14947
|
return await confirmableWrite(context, `Allow this mailbox to send as address ${grantedAddressUuid}.`, async () => {
|
|
14932
14948
|
return (await emailSendAsGrantsStore({
|
|
14933
14949
|
path,
|
|
@@ -14935,7 +14951,7 @@ async function sendAs(context, action, tail) {
|
|
|
14935
14951
|
})).data;
|
|
14936
14952
|
});
|
|
14937
14953
|
}
|
|
14938
|
-
throw new UsageError(USAGE$
|
|
14954
|
+
throw new UsageError(USAGE$29);
|
|
14939
14955
|
}
|
|
14940
14956
|
//#endregion
|
|
14941
14957
|
//#region src/commands/email-write-text.ts
|
|
@@ -15004,7 +15020,7 @@ function emailAddressText(report) {
|
|
|
15004
15020
|
}
|
|
15005
15021
|
//#endregion
|
|
15006
15022
|
//#region src/commands/email-domain.ts
|
|
15007
|
-
var USAGE$
|
|
15023
|
+
var USAGE$28 = [
|
|
15008
15024
|
"Usage: hostingctl email offer",
|
|
15009
15025
|
" hostingctl email enroll --company <slug>",
|
|
15010
15026
|
" hostingctl email agree --company <slug> --term <package-term-uuid>",
|
|
@@ -15025,7 +15041,7 @@ var USAGE$27 = [
|
|
|
15025
15041
|
/** `email offer|agree|provision|domain|catch-all`, dispatched from the `email` command. */
|
|
15026
15042
|
async function emailDomains(context, subcommand, rest) {
|
|
15027
15043
|
if (subcommand === "offer") {
|
|
15028
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
15044
|
+
if (rest.length > 0) throw new UsageError(USAGE$28);
|
|
15029
15045
|
return {
|
|
15030
15046
|
kind: "offers",
|
|
15031
15047
|
offers: (await emailOffers({ path: { company: await requireCompany(context.flags) } })).data
|
|
@@ -15036,11 +15052,11 @@ async function emailDomains(context, subcommand, rest) {
|
|
|
15036
15052
|
if (subcommand === "provision") return await provision(context, rest);
|
|
15037
15053
|
if (subcommand === "domain") return await domain(context, rest);
|
|
15038
15054
|
if (subcommand === "catch-all") return await catchAll(context, rest);
|
|
15039
|
-
throw new UsageError(USAGE$
|
|
15055
|
+
throw new UsageError(USAGE$28);
|
|
15040
15056
|
}
|
|
15041
15057
|
/** A company-wide command takes no positionals. */
|
|
15042
15058
|
function noExtra$12(rest) {
|
|
15043
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
15059
|
+
if (rest.length > 0) throw new UsageError(USAGE$28);
|
|
15044
15060
|
}
|
|
15045
15061
|
/** `enroll`: create the service record and start provisioning, which is the API's own create. */
|
|
15046
15062
|
async function enroll(context, rest) {
|
|
@@ -15053,7 +15069,7 @@ async function agree(context, rest) {
|
|
|
15053
15069
|
noExtra$12(rest);
|
|
15054
15070
|
const company = await requireCompany(context.flags);
|
|
15055
15071
|
const packageTermUuid = context.flags.get("--term") ?? "";
|
|
15056
|
-
if (packageTermUuid === "") throw new UsageError(`agree needs --term.\n\n${USAGE$
|
|
15072
|
+
if (packageTermUuid === "") throw new UsageError(`agree needs --term.\n\n${USAGE$28}`);
|
|
15057
15073
|
return await confirmableWrite(context, `Accept email package term ${packageTermUuid} for ${company}.`, async () => (await emailAgreement({
|
|
15058
15074
|
path: { company },
|
|
15059
15075
|
body: { packageTermUuid }
|
|
@@ -15072,7 +15088,7 @@ async function domain(context, rest) {
|
|
|
15072
15088
|
if (action === "add") {
|
|
15073
15089
|
noExtra$12(tail);
|
|
15074
15090
|
const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
|
|
15075
|
-
if (hostname === "") throw new UsageError(`domain add needs --hostname.\n\n${USAGE$
|
|
15091
|
+
if (hostname === "") throw new UsageError(`domain add needs --hostname.\n\n${USAGE$28}`);
|
|
15076
15092
|
return await confirmableWrite(context, `Attach ${hostname} to ${company}'s mail service.`, async () => {
|
|
15077
15093
|
return (await emailDomainsStore({
|
|
15078
15094
|
path: { company },
|
|
@@ -15082,7 +15098,7 @@ async function domain(context, rest) {
|
|
|
15082
15098
|
}
|
|
15083
15099
|
const path = {
|
|
15084
15100
|
company,
|
|
15085
|
-
emailDomainUuid: oneUuid$7(tail, USAGE$
|
|
15101
|
+
emailDomainUuid: oneUuid$7(tail, USAGE$28)
|
|
15086
15102
|
};
|
|
15087
15103
|
if (action === "recheck") return await confirmableWrite(context, "Re-observe this name's DNS now.", async () => {
|
|
15088
15104
|
return (await emailDomainsRecheck({ path })).data;
|
|
@@ -15102,14 +15118,14 @@ async function domain(context, rest) {
|
|
|
15102
15118
|
body
|
|
15103
15119
|
})).data;
|
|
15104
15120
|
});
|
|
15105
|
-
throw new UsageError(USAGE$
|
|
15121
|
+
throw new UsageError(USAGE$28);
|
|
15106
15122
|
}
|
|
15107
15123
|
/** `catch-all show|set|clear`. */
|
|
15108
15124
|
async function catchAll(context, rest) {
|
|
15109
15125
|
const [action, ...tail] = rest;
|
|
15110
15126
|
const path = {
|
|
15111
15127
|
company: await requireCompany(context.flags),
|
|
15112
|
-
emailDomainUuid: oneUuid$7(tail, USAGE$
|
|
15128
|
+
emailDomainUuid: oneUuid$7(tail, USAGE$28)
|
|
15113
15129
|
};
|
|
15114
15130
|
if (action === "show") return {
|
|
15115
15131
|
kind: "catch-all",
|
|
@@ -15117,7 +15133,7 @@ async function catchAll(context, rest) {
|
|
|
15117
15133
|
};
|
|
15118
15134
|
if (action === "set") {
|
|
15119
15135
|
const destinations = destinationList(context);
|
|
15120
|
-
if (destinations.length === 0) throw new UsageError(`catch-all set needs --destinations a@x,b@y.\n\n${USAGE$
|
|
15136
|
+
if (destinations.length === 0) throw new UsageError(`catch-all set needs --destinations a@x,b@y.\n\n${USAGE$28}`);
|
|
15121
15137
|
return await confirmableWrite(context, [`Enable the catch-all for this name, forwarding to:`, ...destinations.map((one) => ` ${one}`)].join("\n"), async () => {
|
|
15122
15138
|
return (await emailCatchAllUpdate({
|
|
15123
15139
|
path,
|
|
@@ -15129,7 +15145,7 @@ async function catchAll(context, rest) {
|
|
|
15129
15145
|
});
|
|
15130
15146
|
}
|
|
15131
15147
|
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);
|
|
15132
|
-
throw new UsageError(USAGE$
|
|
15148
|
+
throw new UsageError(USAGE$28);
|
|
15133
15149
|
}
|
|
15134
15150
|
/**
|
|
15135
15151
|
* The comma-separated `--destinations`.
|
|
@@ -15161,7 +15177,7 @@ function catchAllText(one) {
|
|
|
15161
15177
|
}
|
|
15162
15178
|
//#endregion
|
|
15163
15179
|
//#region src/commands/email-holds.ts
|
|
15164
|
-
var USAGE$
|
|
15180
|
+
var USAGE$27 = [
|
|
15165
15181
|
"Usage: hostingctl email hold list --company <slug>",
|
|
15166
15182
|
" hostingctl email hold create --company <slug> --reason <compromise|abuse|operator> [--mailbox <uuid>]",
|
|
15167
15183
|
" hostingctl email hold release <hold-uuid> --company <slug>",
|
|
@@ -15184,21 +15200,21 @@ async function emailHolds(context, rest) {
|
|
|
15184
15200
|
const [action, ...tail] = rest;
|
|
15185
15201
|
const company = await requireCompany(context.flags);
|
|
15186
15202
|
if (action === "list") {
|
|
15187
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
15203
|
+
if (tail.length > 0) throw new UsageError(USAGE$27);
|
|
15188
15204
|
return {
|
|
15189
15205
|
kind: "holds",
|
|
15190
15206
|
holds: (await emailHoldsIndex({ path: { company } })).data.holds
|
|
15191
15207
|
};
|
|
15192
15208
|
}
|
|
15193
15209
|
if (action === "create") return await create$3(context, tail, company);
|
|
15194
|
-
if (action === "release") return await release(context, oneUuid$7(tail, USAGE$
|
|
15195
|
-
throw new UsageError(USAGE$
|
|
15210
|
+
if (action === "release") return await release(context, oneUuid$7(tail, USAGE$27), company);
|
|
15211
|
+
throw new UsageError(USAGE$27);
|
|
15196
15212
|
}
|
|
15197
15213
|
/** `create --reason … [--mailbox …]`. */
|
|
15198
15214
|
async function create$3(context, tail, company) {
|
|
15199
|
-
if (tail.length > 0) throw new UsageError(USAGE$
|
|
15215
|
+
if (tail.length > 0) throw new UsageError(USAGE$27);
|
|
15200
15216
|
const raw = context.flags.get("--reason")?.trim() ?? "";
|
|
15201
|
-
if (!REASONS.has(raw)) throw new UsageError(`--reason must be compromise, abuse or operator (got "${raw}").\n\n${USAGE$
|
|
15217
|
+
if (!REASONS.has(raw)) throw new UsageError(`--reason must be compromise, abuse or operator (got "${raw}").\n\n${USAGE$27}`);
|
|
15202
15218
|
const mailboxUuid = context.flags.get("--mailbox")?.trim() ?? "";
|
|
15203
15219
|
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 () => {
|
|
15204
15220
|
return (await emailHoldsStore({
|
|
@@ -15234,7 +15250,7 @@ function emailHoldText(report) {
|
|
|
15234
15250
|
}
|
|
15235
15251
|
//#endregion
|
|
15236
15252
|
//#region src/commands/email-mailbox-admin.ts
|
|
15237
|
-
var USAGE$
|
|
15253
|
+
var USAGE$26 = [
|
|
15238
15254
|
"Usage: hostingctl email mailbox add <email-domain-uuid> --company <slug> --local <name> --quota <gb-5|gb-10|gb-20>",
|
|
15239
15255
|
" hostingctl email mailbox change <email-domain-uuid> <mailbox-uuid> --company <slug> [--status enabled|suspended] [--quota <size>]",
|
|
15240
15256
|
" hostingctl email mailbox remove <email-domain-uuid> <mailbox-uuid> --company <slug>",
|
|
@@ -15266,7 +15282,7 @@ var STATUSES = /* @__PURE__ */ new Set(["enabled", "suspended"]);
|
|
|
15266
15282
|
async function emailMailboxAdmin(context, action, tail) {
|
|
15267
15283
|
if (action === "add") return await add$6(context, tail);
|
|
15268
15284
|
const [emailDomainUuid, mailboxUuid, ...extra] = tail;
|
|
15269
|
-
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
15285
|
+
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$26);
|
|
15270
15286
|
const path = {
|
|
15271
15287
|
company: await requireCompany(context.flags),
|
|
15272
15288
|
emailDomainUuid,
|
|
@@ -15284,7 +15300,7 @@ async function emailMailboxAdmin(context, action, tail) {
|
|
|
15284
15300
|
if (action === "preferences-set") return await preferences(context, path);
|
|
15285
15301
|
if (action === "credential") return await revealCredential(context, path, false);
|
|
15286
15302
|
if (action === "reset-credential") return await revealCredential(context, path, true);
|
|
15287
|
-
throw new UsageError(USAGE$
|
|
15303
|
+
throw new UsageError(USAGE$26);
|
|
15288
15304
|
}
|
|
15289
15305
|
/** A quota flag from the API's own values. */
|
|
15290
15306
|
function quota(context) {
|
|
@@ -15300,11 +15316,11 @@ function destinations(context) {
|
|
|
15300
15316
|
/** `add <domain> --local … --quota …`. */
|
|
15301
15317
|
async function add$6(context, tail) {
|
|
15302
15318
|
const [emailDomainUuid, ...extra] = tail;
|
|
15303
|
-
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
15319
|
+
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$26);
|
|
15304
15320
|
const company = await requireCompany(context.flags);
|
|
15305
15321
|
const localPart = context.flags.get("--local")?.trim().toLowerCase() ?? "";
|
|
15306
15322
|
const size = quota(context);
|
|
15307
|
-
if (localPart === "" || size === null) throw new UsageError(`mailbox add needs --local and --quota.\n\n${USAGE$
|
|
15323
|
+
if (localPart === "" || size === null) throw new UsageError(`mailbox add needs --local and --quota.\n\n${USAGE$26}`);
|
|
15308
15324
|
return await confirmableWrite(context, `Create mailbox ${localPart}@… with a ${size} quota.`, async () => {
|
|
15309
15325
|
return (await emailMailboxesStore({
|
|
15310
15326
|
path: {
|
|
@@ -15329,7 +15345,7 @@ function statusFlag(context) {
|
|
|
15329
15345
|
async function change$1(context, path) {
|
|
15330
15346
|
const status = statusFlag(context);
|
|
15331
15347
|
const size = quota(context);
|
|
15332
|
-
if (status === null && size === null) throw new UsageError(`mailbox change needs --status, --quota or both.\n\n${USAGE$
|
|
15348
|
+
if (status === null && size === null) throw new UsageError(`mailbox change needs --status, --quota or both.\n\n${USAGE$26}`);
|
|
15333
15349
|
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 () => {
|
|
15334
15350
|
return (await emailMailboxesUpdate({
|
|
15335
15351
|
path,
|
|
@@ -15357,7 +15373,7 @@ async function preferences(context, path) {
|
|
|
15357
15373
|
const markRead = onOff$4(context, "--spam-mark-read");
|
|
15358
15374
|
const threshold = context.flags.get("--spam-threshold");
|
|
15359
15375
|
const summary = context.flags.get("--vacation-subject");
|
|
15360
|
-
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$
|
|
15376
|
+
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$26}`);
|
|
15361
15377
|
const body = {
|
|
15362
15378
|
vacationEnabled: vacation ?? current.vacationEnabled,
|
|
15363
15379
|
vacationSubject: context.flags.get("--vacation-subject") ?? current.vacationSubject,
|
|
@@ -15412,7 +15428,7 @@ function emailMailboxAdminText(report) {
|
|
|
15412
15428
|
}
|
|
15413
15429
|
//#endregion
|
|
15414
15430
|
//#region src/commands/email-service.ts
|
|
15415
|
-
var USAGE$
|
|
15431
|
+
var USAGE$25 = [
|
|
15416
15432
|
"Usage: hostingctl email service <suspend|resume> --company <slug>",
|
|
15417
15433
|
" hostingctl email service cancellation --company <slug>",
|
|
15418
15434
|
" hostingctl email service cancel --company <slug> --ends-at <iso-date>",
|
|
@@ -15439,11 +15455,11 @@ async function emailService(context, subcommand, rest) {
|
|
|
15439
15455
|
if (subcommand === "dmarc-set") return await dmarcSet$1(context, rest);
|
|
15440
15456
|
if (subcommand === "blocklist-set") return await blocklistSet(context, rest);
|
|
15441
15457
|
if (subcommand === "service") return await service(context, rest);
|
|
15442
|
-
throw new UsageError(USAGE$
|
|
15458
|
+
throw new UsageError(USAGE$25);
|
|
15443
15459
|
}
|
|
15444
15460
|
/** A company-wide command takes no positionals. */
|
|
15445
15461
|
function noExtra$11(rest) {
|
|
15446
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
15462
|
+
if (rest.length > 0) throw new UsageError(USAGE$25);
|
|
15447
15463
|
}
|
|
15448
15464
|
/** `service suspend|resume|cancellation|cancel|cancel-withdraw`. */
|
|
15449
15465
|
async function service(context, rest) {
|
|
@@ -15469,7 +15485,7 @@ async function service(context, rest) {
|
|
|
15469
15485
|
if (action === "cancel") {
|
|
15470
15486
|
noExtra$11(tail);
|
|
15471
15487
|
const endsAt = context.flags.get("--ends-at")?.trim() ?? "";
|
|
15472
|
-
if (endsAt === "") throw new UsageError(`service cancel needs --ends-at.\n\n${USAGE$
|
|
15488
|
+
if (endsAt === "") throw new UsageError(`service cancel needs --ends-at.\n\n${USAGE$25}`);
|
|
15473
15489
|
if (Number.isNaN(Date.parse(endsAt))) throw new UsageError(`--ends-at must be an ISO date (got "${endsAt}").`);
|
|
15474
15490
|
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({
|
|
15475
15491
|
path: { company },
|
|
@@ -15482,7 +15498,7 @@ async function service(context, rest) {
|
|
|
15482
15498
|
return (await emailCancellationWithdraw({ path: { company } })).data;
|
|
15483
15499
|
});
|
|
15484
15500
|
}
|
|
15485
|
-
throw new UsageError(USAGE$
|
|
15501
|
+
throw new UsageError(USAGE$25);
|
|
15486
15502
|
}
|
|
15487
15503
|
/** `dmarc`: DMARC reporting for every attached name. */
|
|
15488
15504
|
async function dmarc$1(context, rest) {
|
|
@@ -15502,7 +15518,7 @@ async function blocklist$1(context, rest) {
|
|
|
15502
15518
|
}
|
|
15503
15519
|
/** `dmarc-set <name> --enabled on|off`. */
|
|
15504
15520
|
async function dmarcSet$1(context, rest) {
|
|
15505
|
-
const emailDomainUuid = oneUuid$7(rest, USAGE$
|
|
15521
|
+
const emailDomainUuid = oneUuid$7(rest, USAGE$25);
|
|
15506
15522
|
const company = await requireCompany(context.flags);
|
|
15507
15523
|
const enabled = onOff$3(context);
|
|
15508
15524
|
return await confirmableWrite(context, `${enabled ? "Enable" : "Disable"} DMARC reporting for this name.`, async () => {
|
|
@@ -15517,7 +15533,7 @@ async function dmarcSet$1(context, rest) {
|
|
|
15517
15533
|
}
|
|
15518
15534
|
/** `blocklist-set <name> --enabled on|off`. */
|
|
15519
15535
|
async function blocklistSet(context, rest) {
|
|
15520
|
-
const emailDomainUuid = oneUuid$7(rest, USAGE$
|
|
15536
|
+
const emailDomainUuid = oneUuid$7(rest, USAGE$25);
|
|
15521
15537
|
const company = await requireCompany(context.flags);
|
|
15522
15538
|
const enabled = onOff$3(context);
|
|
15523
15539
|
return await confirmableWrite(context, `${enabled ? "Enable" : "Disable"} blocklist monitoring for this name.`, async () => {
|
|
@@ -15534,7 +15550,7 @@ async function blocklistSet(context, rest) {
|
|
|
15534
15550
|
async function importSchema(context, rest) {
|
|
15535
15551
|
noExtra$11(rest);
|
|
15536
15552
|
const version = context.flags.get("--version")?.trim() ?? "";
|
|
15537
|
-
if (version === "") throw new UsageError(`import-schema needs --version.\n\n${USAGE$
|
|
15553
|
+
if (version === "") throw new UsageError(`import-schema needs --version.\n\n${USAGE$25}`);
|
|
15538
15554
|
return {
|
|
15539
15555
|
kind: "schema",
|
|
15540
15556
|
version,
|
|
@@ -15546,7 +15562,7 @@ function onOff$3(context) {
|
|
|
15546
15562
|
const raw = context.flags.get("--enabled")?.trim() ?? "";
|
|
15547
15563
|
if (raw === "on" || raw === "true") return true;
|
|
15548
15564
|
if (raw === "off" || raw === "false") return false;
|
|
15549
|
-
throw new UsageError(`--enabled must be on or off (got "${raw}").\n\n${USAGE$
|
|
15565
|
+
throw new UsageError(`--enabled must be on or off (got "${raw}").\n\n${USAGE$25}`);
|
|
15550
15566
|
}
|
|
15551
15567
|
/** The `email service|dmarc|blocklist|import-schema` renderer. */
|
|
15552
15568
|
function emailServiceText(report) {
|
|
@@ -15559,7 +15575,7 @@ function emailServiceText(report) {
|
|
|
15559
15575
|
//#endregion
|
|
15560
15576
|
//#region src/commands/email-sync-csv.ts
|
|
15561
15577
|
/** The usage this group refuses with, owned by the command it belongs to. */
|
|
15562
|
-
var USAGE$
|
|
15578
|
+
var USAGE$24 = [
|
|
15563
15579
|
"Usage: hostingctl email sync csv <preview|commit> <email-domain-uuid> --company <slug> --file <path>",
|
|
15564
15580
|
"",
|
|
15565
15581
|
" preview What the file's rows would become. Writes nothing.",
|
|
@@ -15570,7 +15586,7 @@ var USAGE$23 = [
|
|
|
15570
15586
|
/** One named uuid, or a usage refusal. */
|
|
15571
15587
|
function one$1(rest) {
|
|
15572
15588
|
const [uuid, ...extra] = rest;
|
|
15573
|
-
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$
|
|
15589
|
+
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$24);
|
|
15574
15590
|
return uuid;
|
|
15575
15591
|
}
|
|
15576
15592
|
/** `csv preview|commit <domain> --file <path>`: one multipart upload of the CSV itself. */
|
|
@@ -15578,7 +15594,7 @@ async function csv(context, tail) {
|
|
|
15578
15594
|
const [action, ...args] = tail;
|
|
15579
15595
|
const path = await domainPath(context, one$1(args));
|
|
15580
15596
|
const file = context.flags.get("--file") ?? "";
|
|
15581
|
-
if (file === "") throw new UsageError(`sync csv needs --file <path>.\n\n${USAGE$
|
|
15597
|
+
if (file === "") throw new UsageError(`sync csv needs --file <path>.\n\n${USAGE$24}`);
|
|
15582
15598
|
if (action === "preview") return {
|
|
15583
15599
|
kind: "csv-preview",
|
|
15584
15600
|
rows: (await emailMailboxSyncCsvPreview({
|
|
@@ -15586,10 +15602,10 @@ async function csv(context, tail) {
|
|
|
15586
15602
|
body: await csvPreviewBody(file)
|
|
15587
15603
|
})).data.rows
|
|
15588
15604
|
};
|
|
15589
|
-
if (action !== "commit") throw new UsageError(USAGE$
|
|
15605
|
+
if (action !== "commit") throw new UsageError(USAGE$24);
|
|
15590
15606
|
const recurrence = recurrenceFlag(context) ?? "once";
|
|
15591
15607
|
const endsAt = context.flags.get("--ends-at")?.trim() || null;
|
|
15592
|
-
if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$
|
|
15608
|
+
if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$24}`);
|
|
15593
15609
|
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 () => {
|
|
15594
15610
|
const accepted = (await emailMailboxSyncCsvPreview({
|
|
15595
15611
|
path,
|
|
@@ -15638,7 +15654,7 @@ async function csvCommitBody(file, accepted, recurrence, endsAt) {
|
|
|
15638
15654
|
}
|
|
15639
15655
|
//#endregion
|
|
15640
15656
|
//#region src/commands/email-sync.ts
|
|
15641
|
-
var USAGE$
|
|
15657
|
+
var USAGE$23 = [
|
|
15642
15658
|
"Usage: hostingctl email sync show <email-domain-uuid> --company <slug>",
|
|
15643
15659
|
" hostingctl email sync server <email-domain-uuid> --company <slug> --host <host> --port <n> --encryption <tls|starttls>",
|
|
15644
15660
|
" 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>]",
|
|
@@ -15663,12 +15679,12 @@ async function emailSync(context, rest) {
|
|
|
15663
15679
|
if (action === "server") return await server(context, tail);
|
|
15664
15680
|
if (action === "account") return await account(context, tail);
|
|
15665
15681
|
if (action === "csv") return await csv(context, tail);
|
|
15666
|
-
throw new UsageError(USAGE$
|
|
15682
|
+
throw new UsageError(USAGE$23);
|
|
15667
15683
|
}
|
|
15668
15684
|
/** One named uuid, or a usage refusal. */
|
|
15669
15685
|
function one(rest) {
|
|
15670
15686
|
const [uuid, ...extra] = rest;
|
|
15671
|
-
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$
|
|
15687
|
+
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$23);
|
|
15672
15688
|
return uuid;
|
|
15673
15689
|
}
|
|
15674
15690
|
/** `show`: the server and every account. */
|
|
@@ -15684,9 +15700,9 @@ async function server(context, tail) {
|
|
|
15684
15700
|
const host = context.flags.get("--host")?.trim() ?? "";
|
|
15685
15701
|
const port = Number(context.flags.get("--port") ?? "");
|
|
15686
15702
|
const encryption = context.flags.get("--encryption")?.trim() ?? "";
|
|
15687
|
-
if (host === "") throw new UsageError(`sync server needs --host.\n\n${USAGE$
|
|
15688
|
-
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new UsageError(`--port must be a whole number between 1 and 65535.\n\n${USAGE$
|
|
15689
|
-
if (!ENCRYPTIONS.has(encryption)) throw new UsageError(`--encryption must be tls or starttls (got "${encryption}").\n\n${USAGE$
|
|
15703
|
+
if (host === "") throw new UsageError(`sync server needs --host.\n\n${USAGE$23}`);
|
|
15704
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new UsageError(`--port must be a whole number between 1 and 65535.\n\n${USAGE$23}`);
|
|
15705
|
+
if (!ENCRYPTIONS.has(encryption)) throw new UsageError(`--encryption must be tls or starttls (got "${encryption}").\n\n${USAGE$23}`);
|
|
15690
15706
|
return await confirmableWrite(context, `Point the mailbox sync source at ${host}:${String(port)} over ${encryption}.`, async () => {
|
|
15691
15707
|
return (await emailMailboxSyncServerUpdate({
|
|
15692
15708
|
path,
|
|
@@ -15710,9 +15726,9 @@ async function account(context, tail) {
|
|
|
15710
15726
|
const [action, ...args] = tail;
|
|
15711
15727
|
if (action === "add") return await accountAdd(context, args);
|
|
15712
15728
|
if (action === "change") return await accountChange(context, args);
|
|
15713
|
-
if (action === void 0) throw new UsageError(USAGE$
|
|
15729
|
+
if (action === void 0) throw new UsageError(USAGE$23);
|
|
15714
15730
|
const [emailDomainUuid, accountUuid, ...extra] = args;
|
|
15715
|
-
if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
15731
|
+
if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$23);
|
|
15716
15732
|
return await accountAction(context, action, {
|
|
15717
15733
|
...await domainPath(context, emailDomainUuid),
|
|
15718
15734
|
accountUuid
|
|
@@ -15731,13 +15747,13 @@ async function accountAction(context, action, path) {
|
|
|
15731
15747
|
if (action === "start") return await startAccount(context, path);
|
|
15732
15748
|
if (action === "stop") return await confirmableWrite(context, "Stop this account's scheduled sync. The source credential is kept.", async () => (await emailMailboxSyncAccountsStop({ path })).data);
|
|
15733
15749
|
if (action === "forget") return await confirmableWrite(context, "Forget this account's source credential and stop future work.", async () => (await emailMailboxSyncAccountsForget({ path })).data);
|
|
15734
|
-
throw new UsageError(USAGE$
|
|
15750
|
+
throw new UsageError(USAGE$23);
|
|
15735
15751
|
}
|
|
15736
15752
|
/** `start`: the schedule the account should run on from now. */
|
|
15737
15753
|
async function startAccount(context, path) {
|
|
15738
15754
|
const recurrence = recurrenceFlag(context) ?? "once";
|
|
15739
15755
|
const endsAt = context.flags.get("--ends-at")?.trim() || null;
|
|
15740
|
-
if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$
|
|
15756
|
+
if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$23}`);
|
|
15741
15757
|
return await confirmableWrite(context, `Start this account's scheduled sync (${recurrence}${endsAt === null ? "" : ` until ${endsAt}`}).`, async () => (await emailMailboxSyncAccountsStart({
|
|
15742
15758
|
path,
|
|
15743
15759
|
body: {
|
|
@@ -15750,7 +15766,7 @@ async function startAccount(context, path) {
|
|
|
15750
15766
|
async function accountAdd(context, args) {
|
|
15751
15767
|
const path = await domainPath(context, one(args));
|
|
15752
15768
|
const body = accountBody(context);
|
|
15753
|
-
const sourcePassword = readSecret(context, "password", 4096, USAGE$
|
|
15769
|
+
const sourcePassword = readSecret(context, "password", 4096, USAGE$23);
|
|
15754
15770
|
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({
|
|
15755
15771
|
path,
|
|
15756
15772
|
body: {
|
|
@@ -15762,7 +15778,7 @@ async function accountAdd(context, args) {
|
|
|
15762
15778
|
/** `account change <domain> <account> [fields]`: only the fields named are sent. */
|
|
15763
15779
|
async function accountChange(context, args) {
|
|
15764
15780
|
const [emailDomainUuid, accountUuid, ...extra] = args;
|
|
15765
|
-
if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
15781
|
+
if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$23);
|
|
15766
15782
|
const path = {
|
|
15767
15783
|
...await domainPath(context, emailDomainUuid),
|
|
15768
15784
|
accountUuid
|
|
@@ -15776,8 +15792,8 @@ async function accountChange(context, args) {
|
|
|
15776
15792
|
if (mailbox !== "") body.mailboxUuid = mailbox;
|
|
15777
15793
|
if (recurrence !== null) body.recurrence = recurrence;
|
|
15778
15794
|
if (endsAt !== "") body.endsAt = endsAt;
|
|
15779
|
-
if (context.flags.has("--password-file") || context.flags.has("--password-stdin")) body.sourcePassword = readSecret(context, "password", 4096, USAGE$
|
|
15780
|
-
if (Object.keys(body).length === 0) throw new UsageError(`account change needs at least one field.\n\n${USAGE$
|
|
15795
|
+
if (context.flags.has("--password-file") || context.flags.has("--password-stdin")) body.sourcePassword = readSecret(context, "password", 4096, USAGE$23);
|
|
15796
|
+
if (Object.keys(body).length === 0) throw new UsageError(`account change needs at least one field.\n\n${USAGE$23}`);
|
|
15781
15797
|
return await confirmableWrite(context, "Change this sync account.", async () => {
|
|
15782
15798
|
return (await emailMailboxSyncAccountsUpdate({
|
|
15783
15799
|
path,
|
|
@@ -15791,8 +15807,8 @@ function accountBody(context) {
|
|
|
15791
15807
|
const mailboxUuid = context.flags.get("--mailbox")?.trim() ?? "";
|
|
15792
15808
|
const recurrence = recurrenceFlag(context) ?? "once";
|
|
15793
15809
|
const endsAt = context.flags.get("--ends-at")?.trim() ?? "";
|
|
15794
|
-
if (sourceUsername === "" || mailboxUuid === "") throw new UsageError(`account add needs --username and --mailbox.\n\n${USAGE$
|
|
15795
|
-
if (recurrence === "until" && endsAt === "") throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$
|
|
15810
|
+
if (sourceUsername === "" || mailboxUuid === "") throw new UsageError(`account add needs --username and --mailbox.\n\n${USAGE$23}`);
|
|
15811
|
+
if (recurrence === "until" && endsAt === "") throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$23}`);
|
|
15796
15812
|
return {
|
|
15797
15813
|
sourceUsername,
|
|
15798
15814
|
mailboxUuid,
|
|
@@ -15809,7 +15825,7 @@ function recurrenceFlag(context) {
|
|
|
15809
15825
|
}
|
|
15810
15826
|
//#endregion
|
|
15811
15827
|
//#region src/commands/email-text.ts
|
|
15812
|
-
var USAGE$
|
|
15828
|
+
var USAGE$22 = [
|
|
15813
15829
|
"Usage: hostingctl email <show|names> --company <slug>",
|
|
15814
15830
|
" hostingctl email <mailboxes|aliases> <email-domain-uuid> --company <slug>",
|
|
15815
15831
|
" hostingctl email mailbox <email-domain-uuid> <mailbox-uuid> --company <slug>",
|
|
@@ -15892,7 +15908,7 @@ function count(shown, total) {
|
|
|
15892
15908
|
var EMAIL_METADATA = {
|
|
15893
15909
|
name: "email",
|
|
15894
15910
|
summary: "A company's email service, its attached names, their mailboxes and aliases.",
|
|
15895
|
-
usage: USAGE$
|
|
15911
|
+
usage: USAGE$22,
|
|
15896
15912
|
flags: [
|
|
15897
15913
|
{
|
|
15898
15914
|
name: "--address",
|
|
@@ -16072,75 +16088,75 @@ var EMAIL_METADATA = {
|
|
|
16072
16088
|
var EMAIL_TOPICS = [
|
|
16073
16089
|
{
|
|
16074
16090
|
path: ["alias"],
|
|
16075
|
-
usage: USAGE$
|
|
16091
|
+
usage: USAGE$30
|
|
16076
16092
|
},
|
|
16077
16093
|
{
|
|
16078
16094
|
path: ["app-token"],
|
|
16079
|
-
usage: USAGE$
|
|
16095
|
+
usage: USAGE$29
|
|
16080
16096
|
},
|
|
16081
16097
|
{
|
|
16082
16098
|
path: ["send-as"],
|
|
16083
|
-
usage: USAGE$
|
|
16099
|
+
usage: USAGE$29
|
|
16084
16100
|
},
|
|
16085
16101
|
{
|
|
16086
16102
|
path: ["offer"],
|
|
16087
|
-
usage: USAGE$
|
|
16103
|
+
usage: USAGE$28
|
|
16088
16104
|
},
|
|
16089
16105
|
{
|
|
16090
16106
|
path: ["enroll"],
|
|
16091
|
-
usage: USAGE$
|
|
16107
|
+
usage: USAGE$28
|
|
16092
16108
|
},
|
|
16093
16109
|
{
|
|
16094
16110
|
path: ["agree"],
|
|
16095
|
-
usage: USAGE$
|
|
16111
|
+
usage: USAGE$28
|
|
16096
16112
|
},
|
|
16097
16113
|
{
|
|
16098
16114
|
path: ["provision"],
|
|
16099
|
-
usage: USAGE$
|
|
16115
|
+
usage: USAGE$28
|
|
16100
16116
|
},
|
|
16101
16117
|
{
|
|
16102
16118
|
path: ["domain"],
|
|
16103
|
-
usage: USAGE$
|
|
16119
|
+
usage: USAGE$28
|
|
16104
16120
|
},
|
|
16105
16121
|
{
|
|
16106
16122
|
path: ["catch-all"],
|
|
16107
|
-
usage: USAGE$
|
|
16123
|
+
usage: USAGE$28
|
|
16108
16124
|
},
|
|
16109
16125
|
{
|
|
16110
16126
|
path: ["service"],
|
|
16111
|
-
usage: USAGE$
|
|
16127
|
+
usage: USAGE$25
|
|
16112
16128
|
},
|
|
16113
16129
|
{
|
|
16114
16130
|
path: ["dmarc"],
|
|
16115
|
-
usage: USAGE$
|
|
16131
|
+
usage: USAGE$25
|
|
16116
16132
|
},
|
|
16117
16133
|
{
|
|
16118
16134
|
path: ["dmarc-set"],
|
|
16119
|
-
usage: USAGE$
|
|
16135
|
+
usage: USAGE$25
|
|
16120
16136
|
},
|
|
16121
16137
|
{
|
|
16122
16138
|
path: ["blocklist"],
|
|
16123
|
-
usage: USAGE$
|
|
16139
|
+
usage: USAGE$25
|
|
16124
16140
|
},
|
|
16125
16141
|
{
|
|
16126
16142
|
path: ["blocklist-set"],
|
|
16127
|
-
usage: USAGE$
|
|
16143
|
+
usage: USAGE$25
|
|
16128
16144
|
},
|
|
16129
16145
|
{
|
|
16130
16146
|
path: ["import-schema"],
|
|
16131
|
-
usage: USAGE$
|
|
16147
|
+
usage: USAGE$25
|
|
16132
16148
|
},
|
|
16133
16149
|
{
|
|
16134
16150
|
path: ["sync"],
|
|
16135
|
-
usage: USAGE$
|
|
16151
|
+
usage: USAGE$23
|
|
16136
16152
|
},
|
|
16137
16153
|
{
|
|
16138
16154
|
path: ["hold"],
|
|
16139
|
-
usage: USAGE$
|
|
16155
|
+
usage: USAGE$27
|
|
16140
16156
|
},
|
|
16141
16157
|
{
|
|
16142
16158
|
path: ["mailbox"],
|
|
16143
|
-
usage: USAGE$
|
|
16159
|
+
usage: USAGE$26
|
|
16144
16160
|
}
|
|
16145
16161
|
];
|
|
16146
16162
|
//#endregion
|
|
@@ -16182,7 +16198,7 @@ async function companyRead(context, subcommand, rest) {
|
|
|
16182
16198
|
if (subcommand === "mailboxes") return await mailboxes(company, rest);
|
|
16183
16199
|
if (subcommand === "mailbox") return await mailbox(company, rest);
|
|
16184
16200
|
if (subcommand === "aliases") return await aliases(company, rest);
|
|
16185
|
-
throw new UsageError(USAGE$
|
|
16201
|
+
throw new UsageError(USAGE$22);
|
|
16186
16202
|
}
|
|
16187
16203
|
/** The renderer for a tagged feature read, or null when this command renders the answer itself. */
|
|
16188
16204
|
function taggedText$1(report) {
|
|
@@ -16267,7 +16283,7 @@ var email$2 = {
|
|
|
16267
16283
|
...EMAIL_METADATA,
|
|
16268
16284
|
async run(context) {
|
|
16269
16285
|
const [subcommand, ...rest] = context.positional;
|
|
16270
|
-
if (subcommand === void 0 || !SUBCOMMANDS.has(subcommand)) throw new UsageError(USAGE$
|
|
16286
|
+
if (subcommand === void 0 || !SUBCOMMANDS.has(subcommand)) throw new UsageError(USAGE$22);
|
|
16271
16287
|
const feature = dispatched$1(context, subcommand, rest);
|
|
16272
16288
|
if (feature !== null) return await feature;
|
|
16273
16289
|
return await companyRead(context, subcommand, rest);
|
|
@@ -16352,7 +16368,7 @@ async function aliases(company, rest) {
|
|
|
16352
16368
|
/** `mailbox <email-domain-uuid> <mailbox-uuid>`: one record, independent of index pagination. */
|
|
16353
16369
|
async function mailbox(company, rest) {
|
|
16354
16370
|
const [emailDomainUuid, mailboxUuid, ...extra] = rest;
|
|
16355
|
-
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
16371
|
+
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$22);
|
|
16356
16372
|
return (await emailMailboxesShow({ path: {
|
|
16357
16373
|
company,
|
|
16358
16374
|
emailDomainUuid,
|
|
@@ -16362,16 +16378,16 @@ async function mailbox(company, rest) {
|
|
|
16362
16378
|
/** The one uuid a collection read names, or a usage refusal. */
|
|
16363
16379
|
function oneUuid$4(rest) {
|
|
16364
16380
|
const [uuid, ...extra] = rest;
|
|
16365
|
-
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
16381
|
+
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$22);
|
|
16366
16382
|
return uuid;
|
|
16367
16383
|
}
|
|
16368
16384
|
/** A company-wide read takes no positional arguments. */
|
|
16369
16385
|
function noExtra$10(rest) {
|
|
16370
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
16386
|
+
if (rest.length > 0) throw new UsageError(USAGE$22);
|
|
16371
16387
|
}
|
|
16372
16388
|
//#endregion
|
|
16373
16389
|
//#region src/commands/environment-admin.ts
|
|
16374
|
-
var USAGE$
|
|
16390
|
+
var USAGE$21 = [
|
|
16375
16391
|
"Usage: hostingctl environment retention <environment-uuid> --company <slug>",
|
|
16376
16392
|
" hostingctl environment retention-set <environment-uuid> --company <slug> --extra-days <n> --effective-at <iso> --agreement <uuid> [--package <key>]",
|
|
16377
16393
|
" hostingctl environment database-show <environment-uuid> <database-uuid> --company <slug>",
|
|
@@ -16395,9 +16411,9 @@ async function environmentAdmin(context, subcommand, rest) {
|
|
|
16395
16411
|
if (subcommand === "retention") return await retention(context, first);
|
|
16396
16412
|
if (subcommand === "retention-set") return await retentionSet(context, first);
|
|
16397
16413
|
if (subcommand === "database-show" || subcommand === "database-reveal") {
|
|
16398
|
-
if (first === void 0 || tail.length !== 1) throw new UsageError(USAGE$
|
|
16414
|
+
if (first === void 0 || tail.length !== 1) throw new UsageError(USAGE$21);
|
|
16399
16415
|
const path = {
|
|
16400
|
-
...await environmentPath(context, first, USAGE$
|
|
16416
|
+
...await environmentPath(context, first, USAGE$21),
|
|
16401
16417
|
databaseUuid: tail[0] ?? ""
|
|
16402
16418
|
};
|
|
16403
16419
|
if (subcommand === "database-show") return {
|
|
@@ -16407,24 +16423,24 @@ async function environmentAdmin(context, subcommand, rest) {
|
|
|
16407
16423
|
return await revealDatabase(context, path);
|
|
16408
16424
|
}
|
|
16409
16425
|
if (subcommand === "tuning") return await tuning(context, first, tail);
|
|
16410
|
-
throw new UsageError(USAGE$
|
|
16426
|
+
throw new UsageError(USAGE$21);
|
|
16411
16427
|
}
|
|
16412
16428
|
/** `retention <env>`. */
|
|
16413
16429
|
async function retention(context, environmentUuid) {
|
|
16414
16430
|
return {
|
|
16415
16431
|
kind: "retention",
|
|
16416
|
-
retention: (await hostingRetentionShow({ path: await environmentPath(context, environmentUuid, USAGE$
|
|
16432
|
+
retention: (await hostingRetentionShow({ path: await environmentPath(context, environmentUuid, USAGE$21) })).data
|
|
16417
16433
|
};
|
|
16418
16434
|
}
|
|
16419
16435
|
/** `retention-set <env> --extra-days … --effective-at … --agreement …`. */
|
|
16420
16436
|
async function retentionSet(context, environmentUuid) {
|
|
16421
|
-
const path = await environmentPath(context, environmentUuid, USAGE$
|
|
16437
|
+
const path = await environmentPath(context, environmentUuid, USAGE$21);
|
|
16422
16438
|
const extraDays = Number(context.flags.get("--extra-days") ?? "");
|
|
16423
16439
|
const effectiveAt = context.flags.get("--effective-at")?.trim() ?? "";
|
|
16424
16440
|
const baselineAgreementUuid = context.flags.get("--agreement")?.trim() ?? "";
|
|
16425
|
-
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$
|
|
16426
|
-
if (effectiveAt === "" || Number.isNaN(Date.parse(effectiveAt))) throw new UsageError(`retention-set needs --effective-at as an ISO date.\n\n${USAGE$
|
|
16427
|
-
if (baselineAgreementUuid === "") throw new UsageError(`retention-set needs --agreement.\n\n${USAGE$
|
|
16441
|
+
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$21}`);
|
|
16442
|
+
if (effectiveAt === "" || Number.isNaN(Date.parse(effectiveAt))) throw new UsageError(`retention-set needs --effective-at as an ISO date.\n\n${USAGE$21}`);
|
|
16443
|
+
if (baselineAgreementUuid === "") throw new UsageError(`retention-set needs --agreement.\n\n${USAGE$21}`);
|
|
16428
16444
|
const packageKey = context.flags.get("--package")?.trim();
|
|
16429
16445
|
return {
|
|
16430
16446
|
kind: "write",
|
|
@@ -16451,7 +16467,7 @@ async function revealDatabase(context, path) {
|
|
|
16451
16467
|
/** `tuning preview|restore <env>`. */
|
|
16452
16468
|
async function tuning(context, action, rest) {
|
|
16453
16469
|
const environmentUuid = rest[0];
|
|
16454
|
-
const path = await environmentPath(context, environmentUuid, USAGE$
|
|
16470
|
+
const path = await environmentPath(context, environmentUuid, USAGE$21);
|
|
16455
16471
|
if (action === "preview" && rest.length === 1) {
|
|
16456
16472
|
const body = (await hostingEnvironmentShow({ path })).data;
|
|
16457
16473
|
return {
|
|
@@ -16464,7 +16480,7 @@ async function tuning(context, action, rest) {
|
|
|
16464
16480
|
}
|
|
16465
16481
|
if (action === "restore" && rest.length === 1) {
|
|
16466
16482
|
const generation = Number(context.flags.get("--generation") ?? "");
|
|
16467
|
-
if (!Number.isInteger(generation) || generation < 1) throw new UsageError(`tuning restore needs --generation.\n\n${USAGE$
|
|
16483
|
+
if (!Number.isInteger(generation) || generation < 1) throw new UsageError(`tuning restore needs --generation.\n\n${USAGE$21}`);
|
|
16468
16484
|
return {
|
|
16469
16485
|
kind: "write",
|
|
16470
16486
|
outcome: await confirmableWrite(context, `Restore the recorded tuning for generation ${String(generation)}.`, async () => (await hostingTuningRestore({
|
|
@@ -16473,7 +16489,7 @@ async function tuning(context, action, rest) {
|
|
|
16473
16489
|
})).data)
|
|
16474
16490
|
};
|
|
16475
16491
|
}
|
|
16476
|
-
throw new UsageError(USAGE$
|
|
16492
|
+
throw new UsageError(USAGE$21);
|
|
16477
16493
|
}
|
|
16478
16494
|
/** One retention window as one line, and the write receipt for it. */
|
|
16479
16495
|
function retentionText(one) {
|
|
@@ -16518,7 +16534,7 @@ function environmentAdminText(report) {
|
|
|
16518
16534
|
}
|
|
16519
16535
|
//#endregion
|
|
16520
16536
|
//#region src/commands/environment-component-version.ts
|
|
16521
|
-
var USAGE$
|
|
16537
|
+
var USAGE$20 = [
|
|
16522
16538
|
"Usage: hostingctl environment component-version <environment-uuid> <workload-uuid> <version> --company <slug>",
|
|
16523
16539
|
"",
|
|
16524
16540
|
" component-version Move one curated component instance to another version this platform pins an image",
|
|
@@ -16536,7 +16552,7 @@ var USAGE$19 = [
|
|
|
16536
16552
|
*/
|
|
16537
16553
|
async function environmentComponentVersion(context, rest) {
|
|
16538
16554
|
const [uuid, workloadUuid, version, ...extra] = rest;
|
|
16539
|
-
if (uuid === void 0 || workloadUuid === void 0 || version === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
16555
|
+
if (uuid === void 0 || workloadUuid === void 0 || version === void 0 || extra.length > 0) throw new UsageError(USAGE$20);
|
|
16540
16556
|
const path = {
|
|
16541
16557
|
company: await requireCompany(context.flags),
|
|
16542
16558
|
environmentUuid: uuid,
|
|
@@ -16681,7 +16697,7 @@ function oneUuid$3(rest) {
|
|
|
16681
16697
|
}
|
|
16682
16698
|
//#endregion
|
|
16683
16699
|
//#region src/commands/environment-create.ts
|
|
16684
|
-
var USAGE$
|
|
16700
|
+
var USAGE$19 = [
|
|
16685
16701
|
"Usage: hostingctl environment create --company <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
16686
16702
|
"",
|
|
16687
16703
|
"The package is one of the keys this environment's catalog offers; the platform chooses the placement,",
|
|
@@ -16689,16 +16705,16 @@ var USAGE$18 = [
|
|
|
16689
16705
|
].join("\n");
|
|
16690
16706
|
/** `environment create --name … [--slug …] [--package …]`: a new environment from a platform package. */
|
|
16691
16707
|
async function create$2(context, rest) {
|
|
16692
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
16708
|
+
if (rest.length > 0) throw new UsageError(USAGE$19);
|
|
16693
16709
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
16694
|
-
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$
|
|
16695
|
-
const slug = slugFor(context.flags.get("--slug"), name, USAGE$
|
|
16710
|
+
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$19}`);
|
|
16711
|
+
const slug = slugFor(context.flags.get("--slug"), name, USAGE$19);
|
|
16696
16712
|
const company = await requireCompany(context.flags);
|
|
16697
16713
|
const packages = (await hostingEnvironmentPackagesIndex({ path: { company } })).data;
|
|
16698
16714
|
const offered = packages.map((one) => one.key).join(", ");
|
|
16699
16715
|
const requested = context.flags.get("--package")?.trim() ?? "";
|
|
16700
16716
|
const chosen = requested === "" ? packages[0] : packages.find((one) => one.key === requested);
|
|
16701
|
-
if (chosen === void 0) throw new UsageError(`--package must be one of ${offered} (got ${requested}).\n\n${USAGE$
|
|
16717
|
+
if (chosen === void 0) throw new UsageError(`--package must be one of ${offered} (got ${requested}).\n\n${USAGE$19}`);
|
|
16702
16718
|
const resourceProfile = chosen.key;
|
|
16703
16719
|
return await confirmableWrite(context, describeCreate$1(name, slug, chosen.key), async () => {
|
|
16704
16720
|
return (await hostingEnvironmentStore({
|
|
@@ -17048,7 +17064,7 @@ function oneUuid$2(rest) {
|
|
|
17048
17064
|
}
|
|
17049
17065
|
//#endregion
|
|
17050
17066
|
//#region src/commands/environment-domains.ts
|
|
17051
|
-
var USAGE$
|
|
17067
|
+
var USAGE$18 = [
|
|
17052
17068
|
"Usage: hostingctl environment domains <environment-uuid> --company <slug>",
|
|
17053
17069
|
" hostingctl environment domain-add <environment-uuid> --company <slug> --hostname <host> --workload <uuid> [--intended on|off]",
|
|
17054
17070
|
" hostingctl environment domain-verify|domain-check-routing|domain-intended|domain-primary|domain-remove <environment-uuid> <domain-uuid> --company <slug>",
|
|
@@ -17079,7 +17095,7 @@ var DOMAIN_ACTIONS = {
|
|
|
17079
17095
|
/** `environment domains|domain-add|domain-*|redirects|redirect-set|redirect-remove`. */
|
|
17080
17096
|
async function environmentDomains(context, subcommand, rest) {
|
|
17081
17097
|
const [environmentUuid, ...tail] = rest;
|
|
17082
|
-
const path = await environmentPath(context, environmentUuid, USAGE$
|
|
17098
|
+
const path = await environmentPath(context, environmentUuid, USAGE$18);
|
|
17083
17099
|
if (subcommand === "domains") return await domains(path, tail);
|
|
17084
17100
|
if (subcommand === "redirects") return await redirects(path, tail);
|
|
17085
17101
|
if (subcommand === "domain-add") return await add$5(context, path, tail);
|
|
@@ -17088,7 +17104,7 @@ async function environmentDomains(context, subcommand, rest) {
|
|
|
17088
17104
|
if (subcommand === "domain-remove") return await removeDomain(context, path, tail);
|
|
17089
17105
|
const action = DOMAIN_ACTIONS[subcommand];
|
|
17090
17106
|
if (action !== void 0) return await domainAction(context, subcommand, action, path, tail);
|
|
17091
|
-
throw new UsageError(USAGE$
|
|
17107
|
+
throw new UsageError(USAGE$18);
|
|
17092
17108
|
}
|
|
17093
17109
|
/** `domains <env>`. */
|
|
17094
17110
|
async function domains(path, rest) {
|
|
@@ -17111,7 +17127,7 @@ async function add$5(context, path, rest) {
|
|
|
17111
17127
|
noExtra$9(rest);
|
|
17112
17128
|
const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
|
|
17113
17129
|
const workloadUuid = context.flags.get("--workload")?.trim() ?? "";
|
|
17114
|
-
if (hostname === "" || workloadUuid === "") throw new UsageError(`domain-add needs --hostname and --workload.\n\n${USAGE$
|
|
17130
|
+
if (hostname === "" || workloadUuid === "") throw new UsageError(`domain-add needs --hostname and --workload.\n\n${USAGE$18}`);
|
|
17115
17131
|
const intended = onOffFlag(context, "--intended") ?? false;
|
|
17116
17132
|
return await written$2(confirmableWrite(context, `Serve ${hostname} from workload ${workloadUuid}${intended ? " as an intended name" : ""}.`, async () => {
|
|
17117
17133
|
return (await hostingDomainStore({
|
|
@@ -17127,7 +17143,7 @@ async function add$5(context, path, rest) {
|
|
|
17127
17143
|
/** The five actions that take only the environment and the name. */
|
|
17128
17144
|
async function domainAction(context, subcommand, action, path, rest) {
|
|
17129
17145
|
const [domainUuid, ...extra] = rest;
|
|
17130
|
-
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
17146
|
+
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$18);
|
|
17131
17147
|
const described = {
|
|
17132
17148
|
"domain-verify": "Check this name's routing now.",
|
|
17133
17149
|
"domain-check-routing": "Check this name's routing now.",
|
|
@@ -17145,7 +17161,7 @@ async function domainAction(context, subcommand, action, path, rest) {
|
|
|
17145
17161
|
/** `domain-remove <env> <domain>`: stop serving a name. */
|
|
17146
17162
|
async function removeDomain(context, path, rest) {
|
|
17147
17163
|
const [domainUuid, ...extra] = rest;
|
|
17148
|
-
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
17164
|
+
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$18);
|
|
17149
17165
|
const fallBackToGenerated = onOffFlag(context, "--fall-back-to-generated") ?? true;
|
|
17150
17166
|
return await written$2(confirmableWrite(context, "Stop serving this name. Its record stays readable, and the environment keeps its generated hostname.", async () => {
|
|
17151
17167
|
const body = { fallBackToGenerated };
|
|
@@ -17161,13 +17177,13 @@ async function removeDomain(context, path, rest) {
|
|
|
17161
17177
|
/** `redirect-set <env> <domain> --target … --mode … [--destination …]`. */
|
|
17162
17178
|
async function setRedirect(context, path, rest) {
|
|
17163
17179
|
const [domainUuid, ...extra] = rest;
|
|
17164
|
-
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
17180
|
+
if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$18);
|
|
17165
17181
|
const target = context.flags.get("--target")?.trim() ?? "";
|
|
17166
17182
|
const mode = context.flags.get("--mode")?.trim() ?? "";
|
|
17167
17183
|
const destinationUrl = context.flags.get("--destination")?.trim() ?? "";
|
|
17168
|
-
if (!TARGETS.has(target)) throw new UsageError(`--target must be application or fixed.\n\n${USAGE$
|
|
17169
|
-
if (!MODES$1.has(mode)) throw new UsageError(`--mode must be temporary or permanent.\n\n${USAGE$
|
|
17170
|
-
if (target === "fixed" && destinationUrl === "") throw new UsageError(`--target fixed needs --destination <url>.\n\n${USAGE$
|
|
17184
|
+
if (!TARGETS.has(target)) throw new UsageError(`--target must be application or fixed.\n\n${USAGE$18}`);
|
|
17185
|
+
if (!MODES$1.has(mode)) throw new UsageError(`--mode must be temporary or permanent.\n\n${USAGE$18}`);
|
|
17186
|
+
if (target === "fixed" && destinationUrl === "") throw new UsageError(`--target fixed needs --destination <url>.\n\n${USAGE$18}`);
|
|
17171
17187
|
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 () => {
|
|
17172
17188
|
const body = {
|
|
17173
17189
|
target,
|
|
@@ -17187,7 +17203,7 @@ async function setRedirect(context, path, rest) {
|
|
|
17187
17203
|
/** `redirect-remove <env> <redirect-uuid>`. */
|
|
17188
17204
|
async function removeRedirect(context, path, rest) {
|
|
17189
17205
|
const [redirectUuid, ...extra] = rest;
|
|
17190
|
-
if (redirectUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
17206
|
+
if (redirectUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$18);
|
|
17191
17207
|
return await written$2(confirmableWrite(context, `Remove redirect ${redirectUuid}.`, async () => {
|
|
17192
17208
|
return (await hostingDomainRedirectDestroy({ path: {
|
|
17193
17209
|
...path,
|
|
@@ -17204,11 +17220,11 @@ async function written$2(pending) {
|
|
|
17204
17220
|
}
|
|
17205
17221
|
/** No positional arguments, or a usage refusal. */
|
|
17206
17222
|
function noExtra$9(rest) {
|
|
17207
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
17223
|
+
if (rest.length > 0) throw new UsageError(USAGE$18);
|
|
17208
17224
|
}
|
|
17209
17225
|
//#endregion
|
|
17210
17226
|
//#region src/commands/environment-exports.ts
|
|
17211
|
-
var USAGE$
|
|
17227
|
+
var USAGE$17 = [
|
|
17212
17228
|
"Usage: hostingctl environment database-exports <environment-uuid> --company <slug>",
|
|
17213
17229
|
" hostingctl environment database-export-create <environment-uuid> <database-uuid> --company <slug>",
|
|
17214
17230
|
" hostingctl environment database-export-download <environment-uuid> <export-uuid> --company <slug>",
|
|
@@ -17228,7 +17244,7 @@ var USAGE$16 = [
|
|
|
17228
17244
|
async function environmentExports(context, subcommand, rest) {
|
|
17229
17245
|
if (subcommand === "release-bundle") {
|
|
17230
17246
|
const [releaseUuid, ...extra] = rest;
|
|
17231
|
-
if (releaseUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
17247
|
+
if (releaseUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$17);
|
|
17232
17248
|
return {
|
|
17233
17249
|
kind: "bundle",
|
|
17234
17250
|
releaseUuid,
|
|
@@ -17236,7 +17252,7 @@ async function environmentExports(context, subcommand, rest) {
|
|
|
17236
17252
|
};
|
|
17237
17253
|
}
|
|
17238
17254
|
const [environmentUuid, ...tail] = rest;
|
|
17239
|
-
const path = await environmentPath(context, environmentUuid, USAGE$
|
|
17255
|
+
const path = await environmentPath(context, environmentUuid, USAGE$17);
|
|
17240
17256
|
if (subcommand === "database-exports") {
|
|
17241
17257
|
noExtra$8(tail);
|
|
17242
17258
|
return {
|
|
@@ -17247,11 +17263,11 @@ async function environmentExports(context, subcommand, rest) {
|
|
|
17247
17263
|
if (subcommand === "database-export-create") return await create(context, path, tail);
|
|
17248
17264
|
if (subcommand === "database-export-download") return await download(path, tail);
|
|
17249
17265
|
if (subcommand === "database-export-remove") return await remove$1(context, path, tail);
|
|
17250
|
-
throw new UsageError(USAGE$
|
|
17266
|
+
throw new UsageError(USAGE$17);
|
|
17251
17267
|
}
|
|
17252
17268
|
/** `database-export-create <env> <db>`. */
|
|
17253
17269
|
async function create(context, path, rest) {
|
|
17254
|
-
const databaseUuid = oneUuid$7(rest, USAGE$
|
|
17270
|
+
const databaseUuid = oneUuid$7(rest, USAGE$17);
|
|
17255
17271
|
return {
|
|
17256
17272
|
kind: "export-write",
|
|
17257
17273
|
outcome: await confirmableWrite(context, "Take a portable export of this database now. It is downloadable until its expiry.", async () => {
|
|
@@ -17267,7 +17283,7 @@ async function create(context, path, rest) {
|
|
|
17267
17283
|
}
|
|
17268
17284
|
/** `database-export-download <env> <export>`: a time-limited URL, which is the customer's copy. */
|
|
17269
17285
|
async function download(path, rest) {
|
|
17270
|
-
const exportUuid = oneUuid$7(rest, USAGE$
|
|
17286
|
+
const exportUuid = oneUuid$7(rest, USAGE$17);
|
|
17271
17287
|
return {
|
|
17272
17288
|
kind: "download",
|
|
17273
17289
|
download: (await hostingDatabaseExportDownload({ path: {
|
|
@@ -17278,7 +17294,7 @@ async function download(path, rest) {
|
|
|
17278
17294
|
}
|
|
17279
17295
|
/** `database-export-remove <env> <export>`. */
|
|
17280
17296
|
async function remove$1(context, path, rest) {
|
|
17281
|
-
const exportUuid = oneUuid$7(rest, USAGE$
|
|
17297
|
+
const exportUuid = oneUuid$7(rest, USAGE$17);
|
|
17282
17298
|
return {
|
|
17283
17299
|
kind: "export-write",
|
|
17284
17300
|
outcome: await confirmableWrite(context, `Retire export ${exportUuid}. Its URL stops working once it is gone.`, async () => (await hostingDatabaseExportDestroy({ path: {
|
|
@@ -17289,7 +17305,7 @@ async function remove$1(context, path, rest) {
|
|
|
17289
17305
|
}
|
|
17290
17306
|
/** No positional arguments, or a usage refusal. */
|
|
17291
17307
|
function noExtra$8(rest) {
|
|
17292
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
17308
|
+
if (rest.length > 0) throw new UsageError(USAGE$17);
|
|
17293
17309
|
}
|
|
17294
17310
|
/** One export as one line. */
|
|
17295
17311
|
function exportLine(one) {
|
|
@@ -17315,6 +17331,53 @@ function environmentExportText(report) {
|
|
|
17315
17331
|
return `release ${report.releaseUuid}:\n${JSON.stringify(report.bundle, null, 2)}`;
|
|
17316
17332
|
}
|
|
17317
17333
|
//#endregion
|
|
17334
|
+
//#region src/commands/environment-usage.ts
|
|
17335
|
+
/**
|
|
17336
|
+
* `environment` — the description of the command itself, held beside the command rather than inside it.
|
|
17337
|
+
*
|
|
17338
|
+
* The usage text and the metadata that carries it are one document, so they live in one pair of files: this
|
|
17339
|
+
* one owns the wording, `environment-metadata.ts` owns the spec that publishes it.
|
|
17340
|
+
*/
|
|
17341
|
+
var ENVIRONMENT_USAGE = [
|
|
17342
|
+
"Usage: hostingctl environment create --company <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
17343
|
+
" hostingctl environment show|profile <uuid> --company <slug>",
|
|
17344
|
+
" hostingctl environment reconcile <uuid> --company <slug>",
|
|
17345
|
+
" hostingctl environment scale <uuid> --company <slug> [--cpu <millicores>] [--memory <mib>]",
|
|
17346
|
+
" hostingctl environment portable <export|preview|prepare|confirm> <uuid> --company <slug> [--file <path>]",
|
|
17347
|
+
" hostingctl environment configuration <show|preview|save|apply> <uuid> --company <slug> [--file <path>]",
|
|
17348
|
+
" hostingctl environment secret <write|import|local> <uuid> --company <slug> …",
|
|
17349
|
+
" hostingctl environment databases|database <uuid> … --company <slug>",
|
|
17350
|
+
" hostingctl environment component-version <uuid> <workload-uuid> <version> --company <slug>",
|
|
17351
|
+
" hostingctl environment references <uuid> --company <slug>",
|
|
17352
|
+
" hostingctl environment storage-usage <uuid> --company <slug>",
|
|
17353
|
+
"",
|
|
17354
|
+
" create Create an environment from a platform package; the platform chooses the placement.",
|
|
17355
|
+
" show One environment in detail, including the status the listing does not carry.",
|
|
17356
|
+
" profile Whether the shared catalog covers the profile this environment adopted, and which keys are short.",
|
|
17357
|
+
" reconcile Ask the platform to apply this environment's recorded desired state again.",
|
|
17358
|
+
" scale Set every workload's CPU/memory requests, keeping the existing request-to-limit headroom.",
|
|
17359
|
+
" portable Export, preview, draft and confirm this environment's portable YAML pattern.",
|
|
17360
|
+
" configuration Read, review, draft and apply this environment's YAML configuration.",
|
|
17361
|
+
" secret Set declared configuration secret values through the write-only control, or write the",
|
|
17362
|
+
" declarations' local development values for a local run.",
|
|
17363
|
+
" databases List the environment-owned databases, declare one, replace who may consume it, or retire",
|
|
17364
|
+
" one while retaining its data and its backups.",
|
|
17365
|
+
" component-version Move one curated component instance to another version this platform pins an image for.",
|
|
17366
|
+
" references Every producer a configuration document for this environment may reference, the kind each",
|
|
17367
|
+
" is written as, and the fields each admits: the key goes in the shape's first slot, the field",
|
|
17368
|
+
" in `field`, and a credential field is marked rather than valued.",
|
|
17369
|
+
" storage-usage What each volume was allocated, what it has written and what room is left, from the",
|
|
17370
|
+
" platform's own reading; a volume it could not read says so instead of reporting zero.",
|
|
17371
|
+
"",
|
|
17372
|
+
"The writes (create, reconcile, scale, component-version, portable prepare/confirm, configuration save/apply,",
|
|
17373
|
+
"secret write/import, database create/bind/retire) need --confirm; --dry-run describes the change without making it.",
|
|
17374
|
+
"",
|
|
17375
|
+
"`secret local` is the one exception and is a read: it writes each declaration's local development value - a",
|
|
17376
|
+
"development default such as `password`, not a credential - into an env file for a local run, names the declared",
|
|
17377
|
+
"secrets that have none, and reads nothing from the platform's secret store. It saves to --out at mode 600 or prints",
|
|
17378
|
+
"to standard output, and it changes nothing on the platform, so it needs no --confirm."
|
|
17379
|
+
].join("\n");
|
|
17380
|
+
//#endregion
|
|
17318
17381
|
//#region src/commands/export-file.ts
|
|
17319
17382
|
/**
|
|
17320
17383
|
* Write an exported pattern to the path `--out` named.
|
|
@@ -17561,7 +17624,7 @@ function oneUuid$1(rest) {
|
|
|
17561
17624
|
}
|
|
17562
17625
|
//#endregion
|
|
17563
17626
|
//#region src/commands/environment-services.ts
|
|
17564
|
-
var USAGE$
|
|
17627
|
+
var USAGE$16 = [
|
|
17565
17628
|
"Usage: hostingctl environment service-add-review <environment-uuid> <type> --company <slug> [--name <n>] [--replicas <n>]",
|
|
17566
17629
|
" hostingctl environment service-add <environment-uuid> <type> --company <slug> --name <n> [--replicas <n>]",
|
|
17567
17630
|
" hostingctl environment service-runtime <environment-uuid> <type> --company <slug> --running <on|off>",
|
|
@@ -17590,8 +17653,8 @@ var SERVICE_TYPES = /* @__PURE__ */ new Set([
|
|
|
17590
17653
|
/** `environment service-*`, from the `environment` command. */
|
|
17591
17654
|
async function environmentServices(context, subcommand, rest) {
|
|
17592
17655
|
const [environmentUuid, type, ...tail] = rest;
|
|
17593
|
-
const path = await environmentPath(context, environmentUuid, USAGE$
|
|
17594
|
-
if (type === void 0 || type === "" || tail.length > 0) throw new UsageError(USAGE$
|
|
17656
|
+
const path = await environmentPath(context, environmentUuid, USAGE$16);
|
|
17657
|
+
if (type === void 0 || type === "" || tail.length > 0) throw new UsageError(USAGE$16);
|
|
17595
17658
|
if (subcommand === "service-add-review") return await reviewAddition(context, path, type);
|
|
17596
17659
|
if (subcommand === "service-retirement") return {
|
|
17597
17660
|
kind: "service-retirement",
|
|
@@ -17604,7 +17667,7 @@ async function environmentServices(context, subcommand, rest) {
|
|
|
17604
17667
|
if (subcommand === "service-runtime") return await runtime$1(context, path, type);
|
|
17605
17668
|
if (subcommand === "service-protect") return await protect(context, path, type);
|
|
17606
17669
|
if (subcommand === "service-retire") return await retire(context, path, type);
|
|
17607
|
-
throw new UsageError(USAGE$
|
|
17670
|
+
throw new UsageError(USAGE$16);
|
|
17608
17671
|
}
|
|
17609
17672
|
/** `service-add-review <type> [--name …] [--replicas …]`. */
|
|
17610
17673
|
async function reviewAddition(context, path, type) {
|
|
@@ -17627,9 +17690,9 @@ async function reviewAddition(context, path, type) {
|
|
|
17627
17690
|
/** `service-add <type> --name … [--replicas …]`. */
|
|
17628
17691
|
async function add$4(context, path, type) {
|
|
17629
17692
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
17630
|
-
if (name === "") throw new UsageError(`service-add needs --name.\n\n${USAGE$
|
|
17693
|
+
if (name === "") throw new UsageError(`service-add needs --name.\n\n${USAGE$16}`);
|
|
17631
17694
|
const replicas = wholeNumber(context, "--replicas") ?? 1;
|
|
17632
|
-
if (!SERVICE_TYPES.has(type)) throw new UsageError(`--type must be one of ${[...SERVICE_TYPES].join(", ")} (got "${type}").\n\n${USAGE$
|
|
17695
|
+
if (!SERVICE_TYPES.has(type)) throw new UsageError(`--type must be one of ${[...SERVICE_TYPES].join(", ")} (got "${type}").\n\n${USAGE$16}`);
|
|
17633
17696
|
const serviceType = type;
|
|
17634
17697
|
return await written$1(confirmableWrite(context, `Add the ${type} service "${name}" with ${String(replicas)} replica(s).`, async () => {
|
|
17635
17698
|
const desiredGeneration = await environmentGeneration(path);
|
|
@@ -17646,7 +17709,7 @@ async function add$4(context, path, type) {
|
|
|
17646
17709
|
}
|
|
17647
17710
|
/** `service-runtime <type> --running …`. */
|
|
17648
17711
|
async function runtime$1(context, path, type) {
|
|
17649
|
-
const running = onOff$5(context, "--running", USAGE$
|
|
17712
|
+
const running = onOff$5(context, "--running", USAGE$16);
|
|
17650
17713
|
return await written$1(confirmableWrite(context, `${running ? "Start" : "Stop"} the ${type} service. Its data is kept either way.`, async () => {
|
|
17651
17714
|
const desiredGeneration = await environmentGeneration(path);
|
|
17652
17715
|
const body = {
|
|
@@ -17664,7 +17727,7 @@ async function runtime$1(context, path, type) {
|
|
|
17664
17727
|
}
|
|
17665
17728
|
/** `service-protect <type> --locked …`. */
|
|
17666
17729
|
async function protect(context, path, type) {
|
|
17667
|
-
const locked = onOff$5(context, "--locked", USAGE$
|
|
17730
|
+
const locked = onOff$5(context, "--locked", USAGE$16);
|
|
17668
17731
|
return await written$1(confirmableWrite(context, locked ? `Lock the ${type} service, so no removal path may delete it.` : `Unlock the ${type} service.`, async () => {
|
|
17669
17732
|
const desiredGeneration = await environmentGeneration(path);
|
|
17670
17733
|
const body = {
|
|
@@ -17683,7 +17746,7 @@ async function protect(context, path, type) {
|
|
|
17683
17746
|
/** `service-retire <type> --digest …`: the review's digest is the confirmation. */
|
|
17684
17747
|
async function retire(context, path, type) {
|
|
17685
17748
|
const digest = context.flags.get("--digest")?.trim() ?? "";
|
|
17686
|
-
if (digest === "") throw new UsageError(`service-retire needs --digest.\n\n${USAGE$
|
|
17749
|
+
if (digest === "") throw new UsageError(`service-retire needs --digest.\n\n${USAGE$16}`);
|
|
17687
17750
|
return await written$1(confirmableWrite(context, [`Request the retirement of the ${type} service.`, " The digest binds this request to the review it was made against."].join("\n"), async () => {
|
|
17688
17751
|
const desiredGeneration = await environmentGeneration(path);
|
|
17689
17752
|
const body = {
|
|
@@ -17711,7 +17774,7 @@ function wholeNumber(context, flag) {
|
|
|
17711
17774
|
const raw = context.flags.get(flag)?.trim() ?? "";
|
|
17712
17775
|
if (raw === "") return null;
|
|
17713
17776
|
const value = Number(raw);
|
|
17714
|
-
if (!Number.isInteger(value) || value < 1) throw new UsageError(`${flag} must be a whole number of at least 1 (got ${raw}).\n\n${USAGE$
|
|
17777
|
+
if (!Number.isInteger(value) || value < 1) throw new UsageError(`${flag} must be a whole number of at least 1 (got ${raw}).\n\n${USAGE$16}`);
|
|
17715
17778
|
return value;
|
|
17716
17779
|
}
|
|
17717
17780
|
/** The write receipt, by the shape the API answered with. */
|
|
@@ -17749,7 +17812,7 @@ function environmentServicesText(report) {
|
|
|
17749
17812
|
}
|
|
17750
17813
|
//#endregion
|
|
17751
17814
|
//#region src/commands/environment-shared.ts
|
|
17752
|
-
var USAGE$
|
|
17815
|
+
var USAGE$15 = [
|
|
17753
17816
|
"Usage: hostingctl environment shared-runtime <environment-uuid> --company <slug>",
|
|
17754
17817
|
" hostingctl environment shared-runtime-adopt|shared-runtime-release <environment-uuid> --company <slug>",
|
|
17755
17818
|
" hostingctl environment shared-app <environment-uuid> --company <slug>",
|
|
@@ -17766,7 +17829,7 @@ var USAGE$14 = [
|
|
|
17766
17829
|
/** `environment shared-runtime|shared-app|shared-adopt`, from the `environment` command. */
|
|
17767
17830
|
async function environmentShared(context, subcommand, rest) {
|
|
17768
17831
|
const [environmentUuid, ...tail] = rest;
|
|
17769
|
-
const path = await environmentPath(context, environmentUuid, USAGE$
|
|
17832
|
+
const path = await environmentPath(context, environmentUuid, USAGE$15);
|
|
17770
17833
|
noExtra$7(tail);
|
|
17771
17834
|
if (subcommand === "shared-runtime") return {
|
|
17772
17835
|
kind: "shared-runtime",
|
|
@@ -17781,7 +17844,7 @@ async function environmentShared(context, subcommand, rest) {
|
|
|
17781
17844
|
if (subcommand === "shared-app-adopt") return await app(context, "adopt", path);
|
|
17782
17845
|
if (subcommand === "shared-app-release") return await app(context, "release", path);
|
|
17783
17846
|
if (subcommand === "shared-adopt") return await environment$1(context, path);
|
|
17784
|
-
throw new UsageError(USAGE$
|
|
17847
|
+
throw new UsageError(USAGE$15);
|
|
17785
17848
|
}
|
|
17786
17849
|
/** `shared-runtime-adopt|release`: one runtime, adopted or given back. */
|
|
17787
17850
|
async function runtime(context, kind, path) {
|
|
@@ -17809,7 +17872,7 @@ async function environment$1(context, path) {
|
|
|
17809
17872
|
}
|
|
17810
17873
|
/** No positional arguments, or a usage refusal. */
|
|
17811
17874
|
function noExtra$7(rest) {
|
|
17812
|
-
if (rest.length > 0) throw new UsageError(USAGE$
|
|
17875
|
+
if (rest.length > 0) throw new UsageError(USAGE$15);
|
|
17813
17876
|
}
|
|
17814
17877
|
/** The line shared by both shared states: adopted, with whom, and the ceiling it lives inside. */
|
|
17815
17878
|
function sharedLine(one) {
|
|
@@ -17833,7 +17896,7 @@ function environmentSharedText(report) {
|
|
|
17833
17896
|
}
|
|
17834
17897
|
//#endregion
|
|
17835
17898
|
//#region src/commands/environment-site-access.ts
|
|
17836
|
-
var USAGE$
|
|
17899
|
+
var USAGE$14 = [
|
|
17837
17900
|
"Usage: hostingctl environment site-access <environment-uuid> --company <slug>",
|
|
17838
17901
|
" hostingctl environment site-access-set <environment-uuid> --company <slug> --sign-in <on|off> [--audience <name>]",
|
|
17839
17902
|
" hostingctl environment site-users <environment-uuid> --company <slug>",
|
|
@@ -17879,16 +17942,16 @@ var flow = siteAccessFlow({
|
|
|
17879
17942
|
refresh: async (path) => (await hostingSiteAccessUsersRefresh({ path })).data,
|
|
17880
17943
|
destroy: async (path) => (await hostingSiteAccessUsersDestroy({ path })).data,
|
|
17881
17944
|
rotate: null
|
|
17882
|
-
}, USAGE$
|
|
17945
|
+
}, USAGE$14);
|
|
17883
17946
|
/** `environment site-access*|site-user*`: resolve the environment, then run the shared flow. */
|
|
17884
17947
|
async function environmentSiteAccess(context, action, rest) {
|
|
17885
17948
|
const [environmentUuid, ...tail] = rest;
|
|
17886
|
-
if (environmentUuid === void 0 || environmentUuid === "") throw new UsageError(USAGE$
|
|
17887
|
-
return await flow(context, action, await environmentPath(context, environmentUuid, USAGE$
|
|
17949
|
+
if (environmentUuid === void 0 || environmentUuid === "") throw new UsageError(USAGE$14);
|
|
17950
|
+
return await flow(context, action, await environmentPath(context, environmentUuid, USAGE$14), tail);
|
|
17888
17951
|
}
|
|
17889
17952
|
//#endregion
|
|
17890
17953
|
//#region src/commands/environment-tools.ts
|
|
17891
|
-
var USAGE$
|
|
17954
|
+
var USAGE$13 = [
|
|
17892
17955
|
"Usage: hostingctl environment tools verify <environment-uuid> <tool> --company <slug>",
|
|
17893
17956
|
" hostingctl environment tools select <environment-uuid> <tool> --company <slug> --enabled <on|off>",
|
|
17894
17957
|
"",
|
|
@@ -17902,8 +17965,8 @@ var USAGE$12 = [
|
|
|
17902
17965
|
/** `environment tools verify|select`. */
|
|
17903
17966
|
async function environmentTools(context, rest) {
|
|
17904
17967
|
const [action, environmentUuid, tool, ...extra] = rest;
|
|
17905
|
-
if (action === void 0 || tool === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
17906
|
-
const path = await environmentPath(context, environmentUuid, USAGE$
|
|
17968
|
+
if (action === void 0 || tool === void 0 || extra.length > 0) throw new UsageError(USAGE$13);
|
|
17969
|
+
const path = await environmentPath(context, environmentUuid, USAGE$13);
|
|
17907
17970
|
if (action === "verify") return {
|
|
17908
17971
|
kind: "tool",
|
|
17909
17972
|
tool,
|
|
@@ -17913,11 +17976,11 @@ async function environmentTools(context, rest) {
|
|
|
17913
17976
|
} })).data
|
|
17914
17977
|
};
|
|
17915
17978
|
if (action === "select") return await select$1(context, path, tool);
|
|
17916
|
-
throw new UsageError(USAGE$
|
|
17979
|
+
throw new UsageError(USAGE$13);
|
|
17917
17980
|
}
|
|
17918
17981
|
/** `select --enabled …`: one tool's presence, echoed with the environment's generation. */
|
|
17919
17982
|
async function select$1(context, path, tool) {
|
|
17920
|
-
const enabled = onOff$5(context, "--enabled", USAGE$
|
|
17983
|
+
const enabled = onOff$5(context, "--enabled", USAGE$13);
|
|
17921
17984
|
return {
|
|
17922
17985
|
kind: "tools-write",
|
|
17923
17986
|
outcome: await confirmableWrite(context, `${enabled ? "Enable" : "Disable"} the ${tool} tool for this environment.`, async () => {
|
|
@@ -18037,23 +18100,23 @@ function list$3(values) {
|
|
|
18037
18100
|
var ENVIRONMENT_TOPICS = [
|
|
18038
18101
|
{
|
|
18039
18102
|
path: ["retention"],
|
|
18040
|
-
usage: USAGE$
|
|
18103
|
+
usage: USAGE$21
|
|
18041
18104
|
},
|
|
18042
18105
|
{
|
|
18043
18106
|
path: ["retention-set"],
|
|
18044
|
-
usage: USAGE$
|
|
18107
|
+
usage: USAGE$21
|
|
18045
18108
|
},
|
|
18046
18109
|
{
|
|
18047
18110
|
path: ["database-show"],
|
|
18048
|
-
usage: USAGE$
|
|
18111
|
+
usage: USAGE$21
|
|
18049
18112
|
},
|
|
18050
18113
|
{
|
|
18051
18114
|
path: ["database-reveal"],
|
|
18052
|
-
usage: USAGE$
|
|
18115
|
+
usage: USAGE$21
|
|
18053
18116
|
},
|
|
18054
18117
|
{
|
|
18055
18118
|
path: ["tuning"],
|
|
18056
|
-
usage: USAGE$
|
|
18119
|
+
usage: USAGE$21
|
|
18057
18120
|
},
|
|
18058
18121
|
{
|
|
18059
18122
|
path: ["configuration"],
|
|
@@ -18077,135 +18140,135 @@ var ENVIRONMENT_TOPICS = [
|
|
|
18077
18140
|
},
|
|
18078
18141
|
{
|
|
18079
18142
|
path: ["domains"],
|
|
18080
|
-
usage: USAGE$
|
|
18143
|
+
usage: USAGE$18
|
|
18081
18144
|
},
|
|
18082
18145
|
{
|
|
18083
18146
|
path: ["domain-add"],
|
|
18084
|
-
usage: USAGE$
|
|
18147
|
+
usage: USAGE$18
|
|
18085
18148
|
},
|
|
18086
18149
|
{
|
|
18087
18150
|
path: ["domain-verify"],
|
|
18088
|
-
usage: USAGE$
|
|
18151
|
+
usage: USAGE$18
|
|
18089
18152
|
},
|
|
18090
18153
|
{
|
|
18091
18154
|
path: ["domain-check-routing"],
|
|
18092
|
-
usage: USAGE$
|
|
18155
|
+
usage: USAGE$18
|
|
18093
18156
|
},
|
|
18094
18157
|
{
|
|
18095
18158
|
path: ["domain-intended"],
|
|
18096
|
-
usage: USAGE$
|
|
18159
|
+
usage: USAGE$18
|
|
18097
18160
|
},
|
|
18098
18161
|
{
|
|
18099
18162
|
path: ["domain-primary"],
|
|
18100
|
-
usage: USAGE$
|
|
18163
|
+
usage: USAGE$18
|
|
18101
18164
|
},
|
|
18102
18165
|
{
|
|
18103
18166
|
path: ["domain-remove"],
|
|
18104
|
-
usage: USAGE$
|
|
18167
|
+
usage: USAGE$18
|
|
18105
18168
|
},
|
|
18106
18169
|
{
|
|
18107
18170
|
path: ["redirects"],
|
|
18108
|
-
usage: USAGE$
|
|
18171
|
+
usage: USAGE$18
|
|
18109
18172
|
},
|
|
18110
18173
|
{
|
|
18111
18174
|
path: ["redirect-set"],
|
|
18112
|
-
usage: USAGE$
|
|
18175
|
+
usage: USAGE$18
|
|
18113
18176
|
},
|
|
18114
18177
|
{
|
|
18115
18178
|
path: ["redirect-remove"],
|
|
18116
|
-
usage: USAGE$
|
|
18179
|
+
usage: USAGE$18
|
|
18117
18180
|
},
|
|
18118
18181
|
{
|
|
18119
18182
|
path: ["database-exports"],
|
|
18120
|
-
usage: USAGE$
|
|
18183
|
+
usage: USAGE$17
|
|
18121
18184
|
},
|
|
18122
18185
|
{
|
|
18123
18186
|
path: ["database-export-create"],
|
|
18124
|
-
usage: USAGE$
|
|
18187
|
+
usage: USAGE$17
|
|
18125
18188
|
},
|
|
18126
18189
|
{
|
|
18127
18190
|
path: ["database-export-download"],
|
|
18128
|
-
usage: USAGE$
|
|
18191
|
+
usage: USAGE$17
|
|
18129
18192
|
},
|
|
18130
18193
|
{
|
|
18131
18194
|
path: ["database-export-remove"],
|
|
18132
|
-
usage: USAGE$
|
|
18195
|
+
usage: USAGE$17
|
|
18133
18196
|
},
|
|
18134
18197
|
{
|
|
18135
18198
|
path: ["release-bundle"],
|
|
18136
|
-
usage: USAGE$
|
|
18199
|
+
usage: USAGE$17
|
|
18137
18200
|
},
|
|
18138
18201
|
{
|
|
18139
18202
|
path: ["service-add-review"],
|
|
18140
|
-
usage: USAGE$
|
|
18203
|
+
usage: USAGE$16
|
|
18141
18204
|
},
|
|
18142
18205
|
{
|
|
18143
18206
|
path: ["service-add"],
|
|
18144
|
-
usage: USAGE$
|
|
18207
|
+
usage: USAGE$16
|
|
18145
18208
|
},
|
|
18146
18209
|
{
|
|
18147
18210
|
path: ["service-runtime"],
|
|
18148
|
-
usage: USAGE$
|
|
18211
|
+
usage: USAGE$16
|
|
18149
18212
|
},
|
|
18150
18213
|
{
|
|
18151
18214
|
path: ["service-protect"],
|
|
18152
|
-
usage: USAGE$
|
|
18215
|
+
usage: USAGE$16
|
|
18153
18216
|
},
|
|
18154
18217
|
{
|
|
18155
18218
|
path: ["service-retirement"],
|
|
18156
|
-
usage: USAGE$
|
|
18219
|
+
usage: USAGE$16
|
|
18157
18220
|
},
|
|
18158
18221
|
{
|
|
18159
18222
|
path: ["service-retire"],
|
|
18160
|
-
usage: USAGE$
|
|
18223
|
+
usage: USAGE$16
|
|
18161
18224
|
},
|
|
18162
18225
|
{
|
|
18163
18226
|
path: ["shared-runtime"],
|
|
18164
|
-
usage: USAGE$
|
|
18227
|
+
usage: USAGE$15
|
|
18165
18228
|
},
|
|
18166
18229
|
{
|
|
18167
18230
|
path: ["shared-runtime-adopt"],
|
|
18168
|
-
usage: USAGE$
|
|
18231
|
+
usage: USAGE$15
|
|
18169
18232
|
},
|
|
18170
18233
|
{
|
|
18171
18234
|
path: ["shared-runtime-release"],
|
|
18172
|
-
usage: USAGE$
|
|
18235
|
+
usage: USAGE$15
|
|
18173
18236
|
},
|
|
18174
18237
|
{
|
|
18175
18238
|
path: ["shared-app"],
|
|
18176
|
-
usage: USAGE$
|
|
18239
|
+
usage: USAGE$15
|
|
18177
18240
|
},
|
|
18178
18241
|
{
|
|
18179
18242
|
path: ["shared-app-adopt"],
|
|
18180
|
-
usage: USAGE$
|
|
18243
|
+
usage: USAGE$15
|
|
18181
18244
|
},
|
|
18182
18245
|
{
|
|
18183
18246
|
path: ["shared-app-release"],
|
|
18184
|
-
usage: USAGE$
|
|
18247
|
+
usage: USAGE$15
|
|
18185
18248
|
},
|
|
18186
18249
|
{
|
|
18187
18250
|
path: ["shared-adopt"],
|
|
18188
|
-
usage: USAGE$
|
|
18251
|
+
usage: USAGE$15
|
|
18189
18252
|
},
|
|
18190
18253
|
{
|
|
18191
18254
|
path: ["site-access"],
|
|
18192
|
-
usage: USAGE$
|
|
18255
|
+
usage: USAGE$14
|
|
18193
18256
|
},
|
|
18194
18257
|
{
|
|
18195
18258
|
path: ["site-access-set"],
|
|
18196
|
-
usage: USAGE$
|
|
18259
|
+
usage: USAGE$14
|
|
18197
18260
|
},
|
|
18198
18261
|
{
|
|
18199
18262
|
path: ["site-users"],
|
|
18200
|
-
usage: USAGE$
|
|
18263
|
+
usage: USAGE$14
|
|
18201
18264
|
},
|
|
18202
18265
|
{
|
|
18203
18266
|
path: ["site-user"],
|
|
18204
|
-
usage: USAGE$
|
|
18267
|
+
usage: USAGE$14
|
|
18205
18268
|
},
|
|
18206
18269
|
{
|
|
18207
18270
|
path: ["tools"],
|
|
18208
|
-
usage: USAGE$
|
|
18271
|
+
usage: USAGE$13
|
|
18209
18272
|
}
|
|
18210
18273
|
];
|
|
18211
18274
|
//#endregion
|
|
@@ -18214,42 +18277,6 @@ var ENVIRONMENT_TOPICS = [
|
|
|
18214
18277
|
* `environment` — creating an environment, reading one, and the writes that change it. The usage text moves here
|
|
18215
18278
|
* from the command module, so the description of the command and the command itself hold one copy of it between them.
|
|
18216
18279
|
*/
|
|
18217
|
-
var ENVIRONMENT_USAGE = [
|
|
18218
|
-
"Usage: hostingctl environment create --company <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
18219
|
-
" hostingctl environment show|profile <uuid> --company <slug>",
|
|
18220
|
-
" hostingctl environment reconcile <uuid> --company <slug>",
|
|
18221
|
-
" hostingctl environment scale <uuid> --company <slug> [--cpu <millicores>] [--memory <mib>]",
|
|
18222
|
-
" hostingctl environment portable <export|preview|prepare|confirm> <uuid> --company <slug> [--file <path>]",
|
|
18223
|
-
" hostingctl environment configuration <show|preview|save|apply> <uuid> --company <slug> [--file <path>]",
|
|
18224
|
-
" hostingctl environment secret <write|import|local> <uuid> --company <slug> …",
|
|
18225
|
-
" hostingctl environment databases|database <uuid> … --company <slug>",
|
|
18226
|
-
" hostingctl environment component-version <uuid> <workload-uuid> <version> --company <slug>",
|
|
18227
|
-
" hostingctl environment references <uuid> --company <slug>",
|
|
18228
|
-
"",
|
|
18229
|
-
" create Create an environment from a platform package; the platform chooses the placement.",
|
|
18230
|
-
" show One environment in detail, including the status the listing does not carry.",
|
|
18231
|
-
" profile Whether the shared catalog covers the profile this environment adopted, and which keys are short.",
|
|
18232
|
-
" reconcile Ask the platform to apply this environment's recorded desired state again.",
|
|
18233
|
-
" scale Set every workload's CPU/memory requests, keeping the existing request-to-limit headroom.",
|
|
18234
|
-
" portable Export, preview, draft and confirm this environment's portable YAML pattern.",
|
|
18235
|
-
" configuration Read, review, draft and apply this environment's YAML configuration.",
|
|
18236
|
-
" secret Set declared configuration secret values through the write-only control, or write the",
|
|
18237
|
-
" declarations' local development values for a local run.",
|
|
18238
|
-
" databases List the environment-owned databases, declare one, replace who may consume it, or retire",
|
|
18239
|
-
" one while retaining its data and its backups.",
|
|
18240
|
-
" component-version Move one curated component instance to another version this platform pins an image for.",
|
|
18241
|
-
" references Every producer a configuration document for this environment may reference, the kind each",
|
|
18242
|
-
" is written as, and the fields each admits: the key goes in the shape's first slot, the field",
|
|
18243
|
-
" in `field`, and a credential field is marked rather than valued.",
|
|
18244
|
-
"",
|
|
18245
|
-
"The writes (create, reconcile, scale, component-version, portable prepare/confirm, configuration save/apply,",
|
|
18246
|
-
"secret write/import, database create/bind/retire) need --confirm; --dry-run describes the change without making it.",
|
|
18247
|
-
"",
|
|
18248
|
-
"`secret local` is the one exception and is a read: it writes each declaration's local development value - a",
|
|
18249
|
-
"development default such as `password`, not a credential - into an env file for a local run, names the declared",
|
|
18250
|
-
"secrets that have none, and reads nothing from the platform's secret store. It saves to --out at mode 600 or prints",
|
|
18251
|
-
"to standard output, and it changes nothing on the platform, so it needs no --confirm."
|
|
18252
|
-
].join("\n");
|
|
18253
18280
|
var ENVIRONMENT_METADATA = {
|
|
18254
18281
|
name: "environment",
|
|
18255
18282
|
summary: "Create an environment, or read one in detail with its profile coverage, databases and writes.",
|
|
@@ -18464,6 +18491,7 @@ var ENVIRONMENT_METADATA = {
|
|
|
18464
18491
|
"database",
|
|
18465
18492
|
"component-version",
|
|
18466
18493
|
"references",
|
|
18494
|
+
"storage-usage",
|
|
18467
18495
|
"retention",
|
|
18468
18496
|
"retention-set",
|
|
18469
18497
|
"database-show",
|
|
@@ -18506,7 +18534,7 @@ var ENVIRONMENT_METADATA = {
|
|
|
18506
18534
|
};
|
|
18507
18535
|
//#endregion
|
|
18508
18536
|
//#region src/commands/environment-references.ts
|
|
18509
|
-
var USAGE$
|
|
18537
|
+
var USAGE$12 = [
|
|
18510
18538
|
"Usage: hostingctl environment references <environment-uuid> --company <slug>",
|
|
18511
18539
|
"",
|
|
18512
18540
|
" references Every producer a configuration document for this environment may reference, the kind",
|
|
@@ -18525,13 +18553,131 @@ var USAGE$11 = [
|
|
|
18525
18553
|
*/
|
|
18526
18554
|
async function environmentReferences(context, rest) {
|
|
18527
18555
|
const [uuid, ...extra] = rest;
|
|
18528
|
-
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$
|
|
18556
|
+
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$12);
|
|
18529
18557
|
return (await hostingEnvironmentsReferences({ path: {
|
|
18530
18558
|
company: await requireCompany(context.flags),
|
|
18531
18559
|
environmentUuid: uuid
|
|
18532
18560
|
} })).data;
|
|
18533
18561
|
}
|
|
18534
18562
|
//#endregion
|
|
18563
|
+
//#region src/commands/environment-scale.ts
|
|
18564
|
+
/** `environment reconcile <uuid>`: apply the recorded desired state again. */
|
|
18565
|
+
async function reconcile(context, path) {
|
|
18566
|
+
const current = await hostingEnvironmentShow({ path });
|
|
18567
|
+
return await confirmableWrite(context, `Apply the recorded desired state for ${current.data.name} again (generation ${String(current.data.desiredGeneration)}).`, async () => (await hostingEnvironmentRetry({ path })).data);
|
|
18568
|
+
}
|
|
18569
|
+
/** `environment scale <uuid> --cpu … --memory …`: the resource change journey. */
|
|
18570
|
+
async function scale(context, path) {
|
|
18571
|
+
const cpu = wholeNumberFlag(context.flags, "--cpu");
|
|
18572
|
+
const memory = wholeNumberFlag(context.flags, "--memory");
|
|
18573
|
+
if (cpu === null && memory === null) throw new UsageError(`Pass --cpu, --memory or both.\n\n${ENVIRONMENT_USAGE}`);
|
|
18574
|
+
const current = await hostingEnvironmentShow({ path });
|
|
18575
|
+
const body = updateBodyFrom(current.data, cpu, memory);
|
|
18576
|
+
return await confirmableWrite(context, describeScale(current.data, body), async () => {
|
|
18577
|
+
return (await hostingEnvironmentUpdate({
|
|
18578
|
+
path,
|
|
18579
|
+
body
|
|
18580
|
+
})).data;
|
|
18581
|
+
});
|
|
18582
|
+
}
|
|
18583
|
+
/**
|
|
18584
|
+
* The dry run states the change truthfully from the **computed body**: the request and the limit, before and
|
|
18585
|
+
* after, per workload. It reads the one calculation the write uses rather than repeating it, so a preview cannot
|
|
18586
|
+
* disagree with what is sent.
|
|
18587
|
+
*/
|
|
18588
|
+
function describeScale(environment, body) {
|
|
18589
|
+
const changes = environment.workloads.map((workload, index) => {
|
|
18590
|
+
const before = resourcesLine(workload.resources);
|
|
18591
|
+
const after = resourcesLine(body.workloads[index]?.resources ?? workload.resources);
|
|
18592
|
+
return ` ${workload.name} ${before} → ${after}${before === after ? " (unchanged)" : ""}`;
|
|
18593
|
+
});
|
|
18594
|
+
return [`Scale ${environment.name} (generation ${String(environment.desiredGeneration)}):`, ...changes].join("\n");
|
|
18595
|
+
}
|
|
18596
|
+
/** One workload's request and limit for both resources, so a preview shows what actually goes out. */
|
|
18597
|
+
function resourcesLine(resources) {
|
|
18598
|
+
return `cpu ${String(resources.cpuRequestMillicores)}m request / ${String(resources.cpuLimitMillicores)}m limit mem ${String(resources.memoryRequestMib)}MiB request / ${String(resources.memoryLimitMib)}MiB limit`;
|
|
18599
|
+
}
|
|
18600
|
+
/**
|
|
18601
|
+
* The whole desired state, which is what the update endpoint takes.
|
|
18602
|
+
*
|
|
18603
|
+
* The budget is echoed back exactly rather than recomputed: it is the purchased package, which the API's own
|
|
18604
|
+
* validation refuses to change here. Every workload carries its replicas, its web server and its tuning
|
|
18605
|
+
* overrides, and every volume is carried across — the read-side tuning is a view while the write side is flat,
|
|
18606
|
+
* and their field names match, so echoing the overrides is what stops a scale from resetting them.
|
|
18607
|
+
*/
|
|
18608
|
+
function updateBodyFrom(environment, cpu, memory) {
|
|
18609
|
+
return {
|
|
18610
|
+
desiredGeneration: environment.desiredGeneration,
|
|
18611
|
+
budget: {
|
|
18612
|
+
cpuRequestMillicores: environment.budget.cpuRequestMillicores,
|
|
18613
|
+
cpuLimitMillicores: environment.budget.cpuLimitMillicores,
|
|
18614
|
+
memoryRequestMib: environment.budget.memoryRequestMib,
|
|
18615
|
+
memoryLimitMib: environment.budget.memoryLimitMib,
|
|
18616
|
+
storageLimitMib: environment.budget.storageLimitMib
|
|
18617
|
+
},
|
|
18618
|
+
workloads: environment.workloads.map((workload) => ({
|
|
18619
|
+
type: workload.type,
|
|
18620
|
+
name: workload.name,
|
|
18621
|
+
replicas: workload.replicas,
|
|
18622
|
+
webServer: workload.webServer,
|
|
18623
|
+
resources: {
|
|
18624
|
+
cpuRequestMillicores: cpu ?? workload.resources.cpuRequestMillicores,
|
|
18625
|
+
cpuLimitMillicores: (cpu ?? workload.resources.cpuRequestMillicores) + (workload.resources.cpuLimitMillicores - workload.resources.cpuRequestMillicores),
|
|
18626
|
+
memoryRequestMib: memory ?? workload.resources.memoryRequestMib,
|
|
18627
|
+
memoryLimitMib: (memory ?? workload.resources.memoryRequestMib) + (workload.resources.memoryLimitMib - workload.resources.memoryRequestMib)
|
|
18628
|
+
},
|
|
18629
|
+
tuning: {
|
|
18630
|
+
...workload.tuning.overrides,
|
|
18631
|
+
reset: workload.tuning.overrides.reset ?? void 0
|
|
18632
|
+
}
|
|
18633
|
+
})),
|
|
18634
|
+
volumes: environment.volumes.map((volume) => ({
|
|
18635
|
+
type: volume.type,
|
|
18636
|
+
name: volume.name,
|
|
18637
|
+
sizeMib: volume.sizeMib
|
|
18638
|
+
}))
|
|
18639
|
+
};
|
|
18640
|
+
}
|
|
18641
|
+
//#endregion
|
|
18642
|
+
//#region src/commands/environment-storage-usage.ts
|
|
18643
|
+
var USAGE$11 = [
|
|
18644
|
+
"Usage: hostingctl environment storage-usage <environment-uuid> --company <slug>",
|
|
18645
|
+
"",
|
|
18646
|
+
" storage-usage What each volume was allocated, what it has written and what is left, from the",
|
|
18647
|
+
" platform's own reading.",
|
|
18648
|
+
"",
|
|
18649
|
+
"A volume the platform cannot read is reported with the reason it could not be read rather than as zero: a",
|
|
18650
|
+
"missing number and an empty volume are different facts, and an allocation that is nearly all unused is",
|
|
18651
|
+
"called out as idle."
|
|
18652
|
+
].join("\n");
|
|
18653
|
+
/**
|
|
18654
|
+
* `environment storage-usage <uuid>`: the allocation, the writing and the room left, per volume.
|
|
18655
|
+
*
|
|
18656
|
+
* The numbers come from the platform's own observation of the volume, so this command reports what was read and
|
|
18657
|
+
* never derives a figure of its own. A row whose volume could not be read keeps its allocation and says why the
|
|
18658
|
+
* other two numbers are absent.
|
|
18659
|
+
*/
|
|
18660
|
+
async function environmentStorageUsage(context, rest) {
|
|
18661
|
+
const [uuid, ...extra] = rest;
|
|
18662
|
+
if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$11);
|
|
18663
|
+
return (await hostingEnvironmentsStorageUsage({ path: {
|
|
18664
|
+
company: await requireCompany(context.flags),
|
|
18665
|
+
environmentUuid: uuid
|
|
18666
|
+
} })).data;
|
|
18667
|
+
}
|
|
18668
|
+
/** Bytes as the reader can compare them: GiB for an allocated volume, MiB when it is small. */
|
|
18669
|
+
function readableBytes(bytes) {
|
|
18670
|
+
if (bytes === null) return "not measured";
|
|
18671
|
+
const gib = bytes / 1024 ** 3;
|
|
18672
|
+
if (gib >= 1) return `${gib.toFixed(1)} GiB`;
|
|
18673
|
+
return `${(bytes / 1024 ** 2).toFixed(0)} MiB`;
|
|
18674
|
+
}
|
|
18675
|
+
/** One line per volume, with the state that makes the numbers read correctly. */
|
|
18676
|
+
function storageUsageText(report) {
|
|
18677
|
+
if (report.rows.length === 0) return report.unreadable ?? "No volumes are recorded for this environment yet.";
|
|
18678
|
+
return [...report.rows.map((row) => ` ${row.claim} ${readableBytes(row.usedBytes)} of ${readableBytes(row.provisionedBytes)}${row.freeBytes === null ? "" : `, ${readableBytes(row.freeBytes)} free`}${row.idle ? " idle: almost nothing written against a large allocation" : ""}${row.unreadable === null ? "" : ` unreadable: ${row.unreadable}`}`), ...report.unreadable === null ? [] : ["", report.unreadable]].join("\n");
|
|
18679
|
+
}
|
|
18680
|
+
//#endregion
|
|
18535
18681
|
//#region src/commands/environment-configuration-text.ts
|
|
18536
18682
|
/**
|
|
18537
18683
|
* The phrases the platform writes when the cluster itself answered that it cannot run an engine.
|
|
@@ -18650,11 +18796,24 @@ function taggedText(report) {
|
|
|
18650
18796
|
if (report.kind === "service-addition" || report.kind === "service-retirement" || report.kind === "service-write") return environmentServicesText(report);
|
|
18651
18797
|
return environmentAdminText(report);
|
|
18652
18798
|
}
|
|
18799
|
+
/**
|
|
18800
|
+
* The two answers that describe what an environment may reference or hold.
|
|
18801
|
+
*
|
|
18802
|
+
* A user-defined guard keeps the parent renderer's branch count where it was — one decision rather than two — and
|
|
18803
|
+
* still narrows the union, so the default branch below keeps its own type.
|
|
18804
|
+
*/
|
|
18805
|
+
function isReferenceOrUsage(report) {
|
|
18806
|
+
return "producers" in report || "rows" in report;
|
|
18807
|
+
}
|
|
18808
|
+
/** Render whichever of the two projections this answer is. */
|
|
18809
|
+
function referenceOrUsageText(report) {
|
|
18810
|
+
return "producers" in report ? referenceDirectoryText(report) : storageUsageText(report);
|
|
18811
|
+
}
|
|
18653
18812
|
/** Render one `environment` answer to a person, never to a value the payload does not carry. */
|
|
18654
18813
|
function environmentText(report) {
|
|
18655
18814
|
if ("kind" in report) return taggedText(report);
|
|
18656
18815
|
if ("sent" in report) return renderWriteOutcome(report, outcomeOf$1);
|
|
18657
|
-
if (
|
|
18816
|
+
if (isReferenceOrUsage(report)) return referenceOrUsageText(report);
|
|
18658
18817
|
if ("configuration" in report) return configurationPreviewText(report);
|
|
18659
18818
|
if ("canManage" in report && "revision" in report) return configurationPageText(report);
|
|
18660
18819
|
if ("canManage" in report && "databases" in report) return databasePageText(report);
|
|
@@ -26085,6 +26244,7 @@ var hostingApplicationCapabilitiesDataSchema = object({
|
|
|
26085
26244
|
unsupported: array(string()),
|
|
26086
26245
|
version: string().nullable(),
|
|
26087
26246
|
upgradableVersions: array(string()),
|
|
26247
|
+
schemas: array(string()),
|
|
26088
26248
|
outputs: array(hostingCuratedComponentOutputDataSchema)
|
|
26089
26249
|
});
|
|
26090
26250
|
var hostingResourceDataSchema = object({
|
|
@@ -26780,6 +26940,7 @@ var hostingClusterDataSchema = object({
|
|
|
26780
26940
|
name: string(),
|
|
26781
26941
|
baseDomain: string()
|
|
26782
26942
|
});
|
|
26943
|
+
object({ schemas: array(string()) });
|
|
26783
26944
|
object({
|
|
26784
26945
|
previous: string(),
|
|
26785
26946
|
version: string(),
|
|
@@ -28995,6 +29156,7 @@ var updateHostingApplicationCacheRequestSchema = object({
|
|
|
28995
29156
|
})).optional()
|
|
28996
29157
|
}).describe("The shape rules for an application's HTTP cache settings.\n\nShape only: types, presence and length. The bounds, the verified-hostname check and every\ncross-field rule live in `HostingHttpCacheService`, because they depend on the platform's\nconfiguration and on the application's own names — neither of which a static rule can see.");
|
|
28997
29158
|
var updateHostingApplicationRequestSchema = object({ label: string().max(100).nullable() }).describe("Renaming one application.\n\nOnly the label is accepted. Everything a rename must not touch — the workload UUID, the\nimmutable `name` matching key, the generated hostname, the tree path and the database\nidentity — is deliberately absent from this request, so no payload can move them.\n\nThe label is `present` rather than `required` so \"clear it\" is a distinct, expressible\ninstruction: a null or blank label means \"show the application's own name again\", which\nis what every application looked like before it was ever renamed.");
|
|
29159
|
+
var updateHostingComponentSettingsRequestSchema = object({ schemas: array(string().max(63)).min(1).max(8) }).describe("The schemas one environment's REST component should serve.\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, not a settings blob a client could\nfill with keys no composition reads. Whether each name is a usable identifier, and whether this\ncomponent may serve schemas at all, is decided by the service that records them.");
|
|
28998
29160
|
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.");
|
|
28999
29161
|
var updateHostingEnvironmentRequestSchema = object({
|
|
29000
29162
|
certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
|
|
@@ -30085,6 +30247,13 @@ union([
|
|
|
30085
30247
|
messageDataSchema,
|
|
30086
30248
|
messageDataSchema
|
|
30087
30249
|
]);
|
|
30250
|
+
updateHostingComponentSettingsRequestSchema.describe("The schemas one environment's REST component should serve.\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, not a settings blob a client could\nfill with keys no composition reads. Whether each name is a usable identifier, and whether this\ncomponent may serve schemas at all, is decided by the service that records them.");
|
|
30251
|
+
union([
|
|
30252
|
+
object({ message: string().describe("Error overview.") }),
|
|
30253
|
+
object({ message: string().describe("Error overview.") }),
|
|
30254
|
+
messageDataSchema,
|
|
30255
|
+
messageDataSchema
|
|
30256
|
+
]);
|
|
30088
30257
|
updateHostingComponentVersionRequestSchema.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.");
|
|
30089
30258
|
string().optional().default("restore").describe("The reviewed action: `reset` for a clean installation, `restore` for a retained backup.");
|
|
30090
30259
|
string().optional().describe("The application version a reset should install.");
|
|
@@ -31752,6 +31921,7 @@ function dispatched(context, subcommand, rest) {
|
|
|
31752
31921
|
if (simple !== void 0) return simple(context, rest);
|
|
31753
31922
|
if (COMPONENT_VERSION_SUBCOMMANDS.has(subcommand)) return environmentComponentVersion(context, rest);
|
|
31754
31923
|
if (REFERENCES_SUBCOMMANDS.has(subcommand)) return environmentReferences(context, rest);
|
|
31924
|
+
if (STORAGE_USAGE_SUBCOMMANDS.has(subcommand)) return environmentStorageUsage(context, rest);
|
|
31755
31925
|
return null;
|
|
31756
31926
|
}
|
|
31757
31927
|
/** The subcommands environment-services.ts owns: adding, stopping, locking and retiring one service. */
|
|
@@ -31765,6 +31935,8 @@ var SERVICE_SUBCOMMANDS = /* @__PURE__ */ new Set([
|
|
|
31765
31935
|
]);
|
|
31766
31936
|
/** The subcommands environment-references.ts owns: what a configuration document here may reference. */
|
|
31767
31937
|
var REFERENCES_SUBCOMMANDS = /* @__PURE__ */ new Set(["references"]);
|
|
31938
|
+
/** The subcommands environment-storage-usage.ts owns: what each volume holds and what is left. */
|
|
31939
|
+
var STORAGE_USAGE_SUBCOMMANDS = /* @__PURE__ */ new Set(["storage-usage"]);
|
|
31768
31940
|
/** The subcommands environment-component-version.ts owns: moving one curated component instance. */
|
|
31769
31941
|
var COMPONENT_VERSION_SUBCOMMANDS = /* @__PURE__ */ new Set(["component-version"]);
|
|
31770
31942
|
/** The subcommands environment-exports.ts owns: portable database exports and a release's bundle. */
|
|
@@ -31848,83 +32020,6 @@ var environment = {
|
|
|
31848
32020
|
},
|
|
31849
32021
|
human: environmentText
|
|
31850
32022
|
};
|
|
31851
|
-
/** `environment reconcile <uuid>`: apply the recorded desired state again. */
|
|
31852
|
-
async function reconcile(context, path) {
|
|
31853
|
-
const current = await hostingEnvironmentShow({ path });
|
|
31854
|
-
return await confirmableWrite(context, `Apply the recorded desired state for ${current.data.name} again (generation ${String(current.data.desiredGeneration)}).`, async () => (await hostingEnvironmentRetry({ path })).data);
|
|
31855
|
-
}
|
|
31856
|
-
/** `environment scale <uuid> --cpu … --memory …`: the resource change journey. */
|
|
31857
|
-
async function scale(context, path) {
|
|
31858
|
-
const cpu = wholeNumberFlag(context.flags, "--cpu");
|
|
31859
|
-
const memory = wholeNumberFlag(context.flags, "--memory");
|
|
31860
|
-
if (cpu === null && memory === null) throw new UsageError(`Pass --cpu, --memory or both.\n\n${ENVIRONMENT_USAGE}`);
|
|
31861
|
-
const current = await hostingEnvironmentShow({ path });
|
|
31862
|
-
const body = updateBodyFrom(current.data, cpu, memory);
|
|
31863
|
-
return await confirmableWrite(context, describeScale(current.data, body), async () => {
|
|
31864
|
-
return (await hostingEnvironmentUpdate({
|
|
31865
|
-
path,
|
|
31866
|
-
body
|
|
31867
|
-
})).data;
|
|
31868
|
-
});
|
|
31869
|
-
}
|
|
31870
|
-
/**
|
|
31871
|
-
* The dry run states the change truthfully from the **computed body**: the request and the limit, before and
|
|
31872
|
-
* after, per workload. It reads the one calculation the write uses rather than repeating it, so a preview cannot
|
|
31873
|
-
* disagree with what is sent.
|
|
31874
|
-
*/
|
|
31875
|
-
function describeScale(environment, body) {
|
|
31876
|
-
const changes = environment.workloads.map((workload, index) => {
|
|
31877
|
-
const before = resourcesLine(workload.resources);
|
|
31878
|
-
const after = resourcesLine(body.workloads[index]?.resources ?? workload.resources);
|
|
31879
|
-
return ` ${workload.name} ${before} → ${after}${before === after ? " (unchanged)" : ""}`;
|
|
31880
|
-
});
|
|
31881
|
-
return [`Scale ${environment.name} (generation ${String(environment.desiredGeneration)}):`, ...changes].join("\n");
|
|
31882
|
-
}
|
|
31883
|
-
/** One workload's request and limit for both resources, so a preview shows what actually goes out. */
|
|
31884
|
-
function resourcesLine(resources) {
|
|
31885
|
-
return `cpu ${String(resources.cpuRequestMillicores)}m request / ${String(resources.cpuLimitMillicores)}m limit mem ${String(resources.memoryRequestMib)}MiB request / ${String(resources.memoryLimitMib)}MiB limit`;
|
|
31886
|
-
}
|
|
31887
|
-
/**
|
|
31888
|
-
* The whole desired state, which is what the update endpoint takes.
|
|
31889
|
-
*
|
|
31890
|
-
* The budget is echoed back exactly rather than recomputed: it is the purchased package, which the API's own
|
|
31891
|
-
* validation refuses to change here. Every workload carries its replicas, its web server and its tuning
|
|
31892
|
-
* overrides, and every volume is carried across — the read-side tuning is a view while the write side is flat,
|
|
31893
|
-
* and their field names match, so echoing the overrides is what stops a scale from resetting them.
|
|
31894
|
-
*/
|
|
31895
|
-
function updateBodyFrom(environment, cpu, memory) {
|
|
31896
|
-
return {
|
|
31897
|
-
desiredGeneration: environment.desiredGeneration,
|
|
31898
|
-
budget: {
|
|
31899
|
-
cpuRequestMillicores: environment.budget.cpuRequestMillicores,
|
|
31900
|
-
cpuLimitMillicores: environment.budget.cpuLimitMillicores,
|
|
31901
|
-
memoryRequestMib: environment.budget.memoryRequestMib,
|
|
31902
|
-
memoryLimitMib: environment.budget.memoryLimitMib,
|
|
31903
|
-
storageLimitMib: environment.budget.storageLimitMib
|
|
31904
|
-
},
|
|
31905
|
-
workloads: environment.workloads.map((workload) => ({
|
|
31906
|
-
type: workload.type,
|
|
31907
|
-
name: workload.name,
|
|
31908
|
-
replicas: workload.replicas,
|
|
31909
|
-
webServer: workload.webServer,
|
|
31910
|
-
resources: {
|
|
31911
|
-
cpuRequestMillicores: cpu ?? workload.resources.cpuRequestMillicores,
|
|
31912
|
-
cpuLimitMillicores: (cpu ?? workload.resources.cpuRequestMillicores) + (workload.resources.cpuLimitMillicores - workload.resources.cpuRequestMillicores),
|
|
31913
|
-
memoryRequestMib: memory ?? workload.resources.memoryRequestMib,
|
|
31914
|
-
memoryLimitMib: (memory ?? workload.resources.memoryRequestMib) + (workload.resources.memoryLimitMib - workload.resources.memoryRequestMib)
|
|
31915
|
-
},
|
|
31916
|
-
tuning: {
|
|
31917
|
-
...workload.tuning.overrides,
|
|
31918
|
-
reset: workload.tuning.overrides.reset ?? void 0
|
|
31919
|
-
}
|
|
31920
|
-
})),
|
|
31921
|
-
volumes: environment.volumes.map((volume) => ({
|
|
31922
|
-
type: volume.type,
|
|
31923
|
-
name: volume.name,
|
|
31924
|
-
sizeMib: volume.sizeMib
|
|
31925
|
-
}))
|
|
31926
|
-
};
|
|
31927
|
-
}
|
|
31928
32023
|
//#endregion
|
|
31929
32024
|
//#region src/commands/environments.ts
|
|
31930
32025
|
var environments = {
|
|
@@ -36830,7 +36925,7 @@ function writeUpdateState(state, env = process.env) {
|
|
|
36830
36925
|
}
|
|
36831
36926
|
//#endregion
|
|
36832
36927
|
//#region src/version.ts
|
|
36833
|
-
var VERSION = "1.0.
|
|
36928
|
+
var VERSION = "1.0.363";
|
|
36834
36929
|
//#endregion
|
|
36835
36930
|
//#region src/commands/update.ts
|
|
36836
36931
|
/**
|
|
@@ -36905,7 +37000,7 @@ var update = {
|
|
|
36905
37000
|
}, process.env);
|
|
36906
37001
|
return {
|
|
36907
37002
|
...known,
|
|
36908
|
-
current: after ?? "1.0.
|
|
37003
|
+
current: after ?? "1.0.363",
|
|
36909
37004
|
latest: after ?? latest,
|
|
36910
37005
|
upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
|
|
36911
37006
|
action: "run",
|
|
@@ -37180,7 +37275,7 @@ async function printUpdateNotice(options) {
|
|
|
37180
37275
|
}, env, { waitMs: NOTICE_LOCK_WAIT_MS });
|
|
37181
37276
|
} catch {}
|
|
37182
37277
|
if (latest === null) return;
|
|
37183
|
-
if (!isNewerVersion(latest, "1.0.
|
|
37278
|
+
if (!isNewerVersion(latest, "1.0.363")) return;
|
|
37184
37279
|
process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
|
|
37185
37280
|
}
|
|
37186
37281
|
/** Whether an environment variable is set to something, which is how CI and the opt-out are read. */
|