@haakco/hostingctl 1.0.834 → 1.0.838

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -34337,6 +34337,39 @@ function hostingDatabaseExportDestroy(options) {
34337
34337
  }));
34338
34338
  }
34339
34339
  /**
34340
+ * {@link /c/:company/hosting/environments/:environmentUuid/database-exports/:exportUuid/import/:workloadUuid}
34341
+ */
34342
+ function hostingDatabaseImportShow(options) {
34343
+ const { client: request = client, ...config } = options;
34344
+ return withUnwrap(request({
34345
+ method: "GET",
34346
+ url: "/c/{company}/hosting/environments/{environmentUuid}/database-exports/{exportUuid}/import/{workloadUuid}",
34347
+ security: [{
34348
+ type: "http",
34349
+ scheme: "bearer"
34350
+ }],
34351
+ ...config,
34352
+ throwOnError: config.throwOnError ?? true
34353
+ }));
34354
+ }
34355
+ /**
34356
+ * {@link /c/:company/hosting/environments/:environmentUuid/database-exports/:exportUuid/import/:workloadUuid}
34357
+ */
34358
+ function hostingDatabaseImportConfirm(options) {
34359
+ const { client: request = client, ...config } = options;
34360
+ return withUnwrap(request({
34361
+ method: "POST",
34362
+ url: "/c/{company}/hosting/environments/{environmentUuid}/database-exports/{exportUuid}/import/{workloadUuid}",
34363
+ security: [{
34364
+ type: "http",
34365
+ scheme: "bearer"
34366
+ }],
34367
+ contentType: { request: "application/json" },
34368
+ ...config,
34369
+ throwOnError: config.throwOnError ?? true
34370
+ }));
34371
+ }
34372
+ /**
34340
34373
  * {@link /c/:company/hosting/environments/:environmentUuid/databases/:databaseUuid/retirement}
34341
34374
  */
34342
34375
  function hostingDatabaseRetirementShow(options) {
@@ -34744,6 +34777,39 @@ function hostingEnvironmentDeletionProtectionStore(options) {
34744
34777
  }));
34745
34778
  }
34746
34779
  /**
34780
+ * {@link /c/:company/hosting/environments/:environmentUuid/mode/review}
34781
+ */
34782
+ function hostingEnvironmentsModeReview(options) {
34783
+ const { client: request = client, ...config } = options;
34784
+ return withUnwrap(request({
34785
+ method: "GET",
34786
+ url: "/c/{company}/hosting/environments/{environmentUuid}/mode/review",
34787
+ security: [{
34788
+ type: "http",
34789
+ scheme: "bearer"
34790
+ }],
34791
+ ...config,
34792
+ throwOnError: config.throwOnError ?? true
34793
+ }));
34794
+ }
34795
+ /**
34796
+ * {@link /c/:company/hosting/environments/:environmentUuid/mode}
34797
+ */
34798
+ function hostingEnvironmentsModeUpdate(options) {
34799
+ const { client: request = client, ...config } = options;
34800
+ return withUnwrap(request({
34801
+ method: "PUT",
34802
+ url: "/c/{company}/hosting/environments/{environmentUuid}/mode",
34803
+ security: [{
34804
+ type: "http",
34805
+ scheme: "bearer"
34806
+ }],
34807
+ contentType: { request: "application/json" },
34808
+ ...config,
34809
+ throwOnError: config.throwOnError ?? true
34810
+ }));
34811
+ }
34812
+ /**
34747
34813
  * {@link /c/:company/hosting/environments/:environmentUuid/object-cache}
34748
34814
  */
34749
34815
  function hostingEnvironmentObjectCacheShow(options) {
@@ -37831,6 +37897,44 @@ function hostingWordpressImportStore(options) {
37831
37897
  }));
37832
37898
  }
37833
37899
  /**
37900
+ * @summary Fetch the site from the old host instead of uploading it: a checked file connection and folder (or an HTTPS
37901
+ * `.zip`, `.jpa`, `.tar.gz` archive URL) and the checked database connection are copied into the import's
37902
+ * staging by a bounded Job in this environment. Poll GET …/import/{uuid} exactly as after an upload
37903
+ * {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/import/fetch}
37904
+ */
37905
+ function hostingWordpressImportFetch(options) {
37906
+ const { client: request = client, ...config } = options;
37907
+ return withUnwrap(request({
37908
+ method: "POST",
37909
+ url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/import/fetch",
37910
+ security: [{
37911
+ type: "http",
37912
+ scheme: "bearer"
37913
+ }],
37914
+ contentType: { request: "application/json" },
37915
+ ...config,
37916
+ throwOnError: config.throwOnError ?? true
37917
+ }));
37918
+ }
37919
+ /**
37920
+ * @summary **Refresh from the old host**: fetch the source this site was last fetched from again, into a new import whose
37921
+ * `fetch.replaces` states the earlier import it replaces. Its review is the ordinary import review
37922
+ * {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/import/refresh}
37923
+ */
37924
+ function hostingWordpressImportRefresh(options) {
37925
+ const { client: request = client, ...config } = options;
37926
+ return withUnwrap(request({
37927
+ method: "POST",
37928
+ url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/import/refresh",
37929
+ security: [{
37930
+ type: "http",
37931
+ scheme: "bearer"
37932
+ }],
37933
+ ...config,
37934
+ throwOnError: config.throwOnError ?? true
37935
+ }));
37936
+ }
37937
+ /**
37834
37938
  * {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/url-repair/preview}
37835
37939
  */
37836
37940
  function hostingWordpressUrlRepairPreview(options) {
@@ -41111,7 +41215,7 @@ function emailText(email) {
41111
41215
  ].join("\n");
41112
41216
  }
41113
41217
  // src/commands/auth-account.ts
41114
- var USAGE$64 = [
41218
+ var USAGE$65 = [
41115
41219
  "Usage: hostingctl auth closure show",
41116
41220
  " hostingctl auth closure request --reason <text> (--current-password-file <path>|--current-password-stdin)",
41117
41221
  " hostingctl auth picture set --image-file <path>",
@@ -41137,26 +41241,26 @@ async function account$1(context, subcommand, rest) {
41137
41241
  if (subcommand === "picture") return await picture(context, action, tail);
41138
41242
  if (subcommand === "notifications") return await notifications(context, action, tail);
41139
41243
  if (subcommand === "sent-email" || subcommand === "sent-email-show") return await sentEmail(context, { kind: "auth" }, subcommand, rest);
41140
- throw new UsageError(USAGE$64);
41244
+ throw new UsageError(USAGE$65);
41141
41245
  }
41142
41246
  /** `auth closure show|request`. */
41143
41247
  async function closure(context, action, tail) {
41144
- if (tail.length > 0) throw new UsageError(USAGE$64);
41248
+ if (tail.length > 0) throw new UsageError(USAGE$65);
41145
41249
  if (action === "show") return (await accountClosureShow({})).data;
41146
41250
  if (action === "request") return await closeAccount(context);
41147
- throw new UsageError(USAGE$64);
41251
+ throw new UsageError(USAGE$65);
41148
41252
  }
41149
41253
  /** `auth picture set|remove`. */
41150
41254
  async function picture(context, action, tail) {
41151
- if (tail.length > 0) throw new UsageError(USAGE$64);
41255
+ if (tail.length > 0) throw new UsageError(USAGE$65);
41152
41256
  if (action === "set") return await setPicture(context);
41153
41257
  if (action === "remove") return await removePicture(context);
41154
- throw new UsageError(USAGE$64);
41258
+ throw new UsageError(USAGE$65);
41155
41259
  }
41156
41260
  /** `auth notifications`, `read <id>` or `read-all`. */
41157
41261
  async function notifications(context, action, tail) {
41158
41262
  if (action === void 0) {
41159
- if (tail.length > 0) throw new UsageError(USAGE$64);
41263
+ if (tail.length > 0) throw new UsageError(USAGE$65);
41160
41264
  return await allPages(async (page, perPage) => {
41161
41265
  const answer = await notificationIndex({ query: {
41162
41266
  page,
@@ -41172,7 +41276,7 @@ async function notifications(context, action, tail) {
41172
41276
  await notificationMarkAllRead({});
41173
41277
  return null;
41174
41278
  });
41175
- if (action !== "read" || tail.length !== 1) throw new UsageError(USAGE$64);
41279
+ if (action !== "read" || tail.length !== 1) throw new UsageError(USAGE$65);
41176
41280
  const notification = tail[0] ?? "";
41177
41281
  return await confirmableWrite(context, `Mark notification ${notification} read.`, async () => {
41178
41282
  await notificationMarkRead({ path: { notification } });
@@ -41188,11 +41292,11 @@ async function notifications(context, action, tail) {
41188
41292
  */
41189
41293
  async function closeAccount(context) {
41190
41294
  const reason = context.flags.get("--reason")?.trim() ?? "";
41191
- if (reason === "") throw new UsageError(`closure request needs --reason.\n\n${USAGE$64}`);
41295
+ if (reason === "") throw new UsageError(`closure request needs --reason.\n\n${USAGE$65}`);
41192
41296
  return await confirmableWrite(context, ["Close this account, which removes the data the review lists and keeps what it lists as retained.", " The review is re-read first, so the digest sent is the one you are shown now."].join("\n"), async () => {
41193
41297
  const review = (await accountClosureShow({})).data;
41194
41298
  if (review.blockingReasons.length > 0) throw new UsageError(["This account cannot be closed while these reasons block it:", ...review.blockingReasons.map((one) => ` ${one.companySlug} (${one.role}): ${one.reason}`)].join("\n"));
41195
- const currentPassword = readSecret(context, "current-password", 1024, USAGE$64);
41299
+ const currentPassword = readSecret(context, "current-password", 1024, USAGE$65);
41196
41300
  return (await accountClosureStore({ body: {
41197
41301
  reason,
41198
41302
  reviewedDigest: review.digest,
@@ -41204,7 +41308,7 @@ async function closeAccount(context) {
41204
41308
  async function setPicture(context) {
41205
41309
  const file = context.flags.get("--image-file") ?? "";
41206
41310
  return await confirmableWrite(context, file === "" ? "Set the profile picture." : `Set the profile picture to ${file}.`, async () => {
41207
- return (await profilePictureStore({ body: await imageUpload(file, USAGE$64) })).data;
41311
+ return (await profilePictureStore({ body: await imageUpload(file, USAGE$65) })).data;
41208
41312
  });
41209
41313
  }
41210
41314
  /** `auth picture remove`. */
@@ -41214,7 +41318,7 @@ async function removePicture(context) {
41214
41318
  });
41215
41319
  }
41216
41320
  // src/commands/auth-identity.ts
41217
- var USAGE$63 = [
41321
+ var USAGE$64 = [
41218
41322
  "Usage: hostingctl auth profile [--name <name>] [--email <email>] [--current-password-file <path>]",
41219
41323
  " hostingctl auth password (--current-password-file <path>|--current-password-stdin) (--new-password-file <path>|--new-password-stdin)",
41220
41324
  " hostingctl auth register --name <name> --email <email> (--password-file <path>|--password-stdin)",
@@ -41239,12 +41343,12 @@ var MAX_TOKEN_BYTES = 4096;
41239
41343
  /** One required flag's value, or a refusal naming the flag. */
41240
41344
  function required$8(context, flag) {
41241
41345
  const value = context.flags.get(flag)?.trim() ?? "";
41242
- if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$63}`);
41346
+ if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$64}`);
41243
41347
  return value;
41244
41348
  }
41245
41349
  /** No positional arguments: every input here is a flag or a secret source. */
41246
41350
  function noPositional(rest) {
41247
- if (rest.length > 0) throw new UsageError(USAGE$63);
41351
+ if (rest.length > 0) throw new UsageError(USAGE$64);
41248
41352
  }
41249
41353
  /** The API's password contract takes a confirmation; the CLI's one input is the new password itself. */
41250
41354
  function passwordBody(password) {
@@ -41267,16 +41371,16 @@ async function identity(context, subcommand, rest) {
41267
41371
  if (subcommand === "forgot-password") return await forgotPassword(context);
41268
41372
  if (subcommand === "reset-password") return await resetPassword(context);
41269
41373
  if (subcommand === "verify-email") return await verifyEmail(context);
41270
- throw new UsageError(USAGE$63);
41374
+ throw new UsageError(USAGE$64);
41271
41375
  }
41272
41376
  /** `auth profile`: the account's own name and email, with the current password only when the email changes. */
41273
41377
  async function profile$2(context) {
41274
41378
  const name = context.flags.get("--name")?.trim() ?? "";
41275
41379
  const email = context.flags.get("--email")?.trim() ?? "";
41276
- if (name === "" && email === "" && !context.flags.has("--current-password-file") && !context.flags.has("--current-password-stdin")) throw new UsageError(`Pass --name, --email, or both.\n\n${USAGE$63}`);
41380
+ if (name === "" && email === "" && !context.flags.has("--current-password-file") && !context.flags.has("--current-password-stdin")) throw new UsageError(`Pass --name, --email, or both.\n\n${USAGE$64}`);
41277
41381
  return await confirmableWrite(context, `Update the account's ${[name === "" ? null : `name to "${name}"`, email === "" ? null : `email to ${email}`].filter((one) => one !== null).join(" and ")}.`, async () => {
41278
41382
  const current = (await authMe({})).data;
41279
- const currentPassword = hasSecret(context, "current-password") ? readSecret(context, "current-password", MAX_PASSWORD_BYTES$1, USAGE$63) : void 0;
41383
+ const currentPassword = hasSecret(context, "current-password") ? readSecret(context, "current-password", MAX_PASSWORD_BYTES$1, USAGE$64) : void 0;
41280
41384
  return (await authUpdateProfile({ body: {
41281
41385
  name: name === "" ? current.name ?? "" : name,
41282
41386
  email: email === "" ? current.email ?? "" : email,
@@ -41292,8 +41396,8 @@ function hasSecret(context, name) {
41292
41396
  async function password$1(context) {
41293
41397
  return await confirmableWrite(context, "Change the account's password.", async () => {
41294
41398
  return (await authChangePassword({ body: {
41295
- currentPassword: readSecret(context, "current-password", MAX_PASSWORD_BYTES$1, USAGE$63),
41296
- ...passwordBody(readSecret(context, "new-password", MAX_PASSWORD_BYTES$1, USAGE$63))
41399
+ currentPassword: readSecret(context, "current-password", MAX_PASSWORD_BYTES$1, USAGE$64),
41400
+ ...passwordBody(readSecret(context, "new-password", MAX_PASSWORD_BYTES$1, USAGE$64))
41297
41401
  } })).data;
41298
41402
  });
41299
41403
  }
@@ -41305,7 +41409,7 @@ async function register$1(context) {
41305
41409
  return (await authRegister({ body: {
41306
41410
  name,
41307
41411
  email,
41308
- ...passwordBody(readSecret(context, "password", MAX_PASSWORD_BYTES$1, USAGE$63))
41412
+ ...passwordBody(readSecret(context, "password", MAX_PASSWORD_BYTES$1, USAGE$64))
41309
41413
  } })).data;
41310
41414
  });
41311
41415
  }
@@ -41320,8 +41424,8 @@ async function forgotPassword(context) {
41320
41424
  async function resetPassword(context) {
41321
41425
  const email = required$8(context, "--email");
41322
41426
  return await confirmableWrite(context, `Reset the password for ${email}.`, async () => {
41323
- const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$63);
41324
- const password = readSecret(context, "password", MAX_PASSWORD_BYTES$1, USAGE$63);
41427
+ const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$64);
41428
+ const password = readSecret(context, "password", MAX_PASSWORD_BYTES$1, USAGE$64);
41325
41429
  return (await authResetPassword({ body: {
41326
41430
  token,
41327
41431
  email,
@@ -41336,7 +41440,7 @@ async function verifyEmail(context) {
41336
41440
  });
41337
41441
  }
41338
41442
  // src/commands/auth-impersonation.ts
41339
- var USAGE$62 = [
41443
+ var USAGE$63 = [
41340
41444
  "Usage: hostingctl auth impersonate start --target <user-uuid> --company <slug> --reason <text> [--minutes <n>] --store-as <profile>",
41341
41445
  " hostingctl auth impersonate status",
41342
41446
  " hostingctl auth impersonate stop",
@@ -41369,7 +41473,7 @@ async function impersonation(context, rest) {
41369
41473
  if (action === "stop" && tail.length === 0) return await stop(context);
41370
41474
  if (action === "list" && tail.length === 0) return await list$7();
41371
41475
  if (action === "end" && tail.length === 1) return await end(context, tail[0] ?? "");
41372
- throw new UsageError(USAGE$62);
41476
+ throw new UsageError(USAGE$63);
41373
41477
  }
41374
41478
  /** `start`: mint a token for another user, and keep it in a profile of its own. */
41375
41479
  async function start$2(context) {
@@ -41377,8 +41481,8 @@ async function start$2(context) {
41377
41481
  const company = context.flags.get("--company")?.trim() ?? "";
41378
41482
  const reason = context.flags.get("--reason")?.trim() ?? "";
41379
41483
  const storeAs = context.flags.get("--store-as")?.trim() ?? "";
41380
- if (target === "" || company === "" || reason === "") throw new UsageError(`start needs --target, --company and --reason.\n\n${USAGE$62}`);
41381
- if (storeAs === "") throw new UsageError(`start needs --store-as <profile>.\n\n${USAGE$62}`);
41484
+ if (target === "" || company === "" || reason === "") throw new UsageError(`start needs --target, --company and --reason.\n\n${USAGE$63}`);
41485
+ if (storeAs === "") throw new UsageError(`start needs --store-as <profile>.\n\n${USAGE$63}`);
41382
41486
  const minutes = wholeNumberFlag(context.flags, "--minutes") ?? DEFAULT_MINUTES;
41383
41487
  const document = await readProfiles();
41384
41488
  const operator = namedProfile(context.flags, document);
@@ -41472,7 +41576,7 @@ async function list$7() {
41472
41576
  }
41473
41577
  /** `end <uuid>`: end one recorded session by its uuid. */
41474
41578
  async function end(context, uuid) {
41475
- if (uuid === "") throw new UsageError(USAGE$62);
41579
+ if (uuid === "") throw new UsageError(USAGE$63);
41476
41580
  return await confirmableWrite(context, `End impersonation session ${uuid}.`, async () => ({
41477
41581
  ...EMPTY,
41478
41582
  action: "end",
@@ -41480,7 +41584,7 @@ async function end(context, uuid) {
41480
41584
  }));
41481
41585
  }
41482
41586
  // src/commands/auth-push.ts
41483
- var USAGE$61 = [
41587
+ var USAGE$62 = [
41484
41588
  "Usage: hostingctl auth push-token set (--token-file <path>|--token-stdin)",
41485
41589
  " hostingctl auth push-token remove (--token-file <path>|--token-stdin)",
41486
41590
  "",
@@ -41491,12 +41595,12 @@ var USAGE$61 = [
41491
41595
  /** `auth push-token set|remove`: this account's mobile push registration. */
41492
41596
  async function authPush(context, rest) {
41493
41597
  const [action, ...tail] = rest;
41494
- if (tail.length > 0) throw new UsageError(USAGE$61);
41598
+ if (tail.length > 0) throw new UsageError(USAGE$62);
41495
41599
  if (action === "set") return {
41496
41600
  kind: "push-token",
41497
41601
  action: "set",
41498
41602
  sent: (await confirmableWrite(context, "Register this device's push token.", async () => {
41499
- await expoTokenStore({ body: { token: readSecret(context, "token", 4096, USAGE$61) } });
41603
+ await expoTokenStore({ body: { token: readSecret(context, "token", 4096, USAGE$62) } });
41500
41604
  return null;
41501
41605
  })).sent
41502
41606
  };
@@ -41504,11 +41608,11 @@ async function authPush(context, rest) {
41504
41608
  kind: "push-token",
41505
41609
  action: "remove",
41506
41610
  sent: (await confirmableWrite(context, "Remove this device's push token.", async () => {
41507
- await expoTokenDestroy({ query: { token: readSecret(context, "token", 4096, USAGE$61) } });
41611
+ await expoTokenDestroy({ query: { token: readSecret(context, "token", 4096, USAGE$62) } });
41508
41612
  return null;
41509
41613
  })).sent
41510
41614
  };
41511
- throw new UsageError(USAGE$61);
41615
+ throw new UsageError(USAGE$62);
41512
41616
  }
41513
41617
  /** The `auth push-token` renderer. */
41514
41618
  function authPushText(report) {
@@ -41736,51 +41840,51 @@ var AUTH_TOPICS = [
41736
41840
  },
41737
41841
  {
41738
41842
  path: ["profile"],
41739
- usage: USAGE$63
41843
+ usage: USAGE$64
41740
41844
  },
41741
41845
  {
41742
41846
  path: ["password"],
41743
- usage: USAGE$63
41847
+ usage: USAGE$64
41744
41848
  },
41745
41849
  {
41746
41850
  path: ["register"],
41747
- usage: USAGE$63
41851
+ usage: USAGE$64
41748
41852
  },
41749
41853
  {
41750
41854
  path: ["forgot-password"],
41751
- usage: USAGE$63
41855
+ usage: USAGE$64
41752
41856
  },
41753
41857
  {
41754
41858
  path: ["reset-password"],
41755
- usage: USAGE$63
41859
+ usage: USAGE$64
41756
41860
  },
41757
41861
  {
41758
41862
  path: ["verify-email"],
41759
- usage: USAGE$63
41863
+ usage: USAGE$64
41760
41864
  },
41761
41865
  {
41762
41866
  path: ["closure"],
41763
- usage: USAGE$64
41867
+ usage: USAGE$65
41764
41868
  },
41765
41869
  {
41766
41870
  path: ["picture"],
41767
- usage: USAGE$64
41871
+ usage: USAGE$65
41768
41872
  },
41769
41873
  {
41770
41874
  path: ["notifications"],
41771
- usage: USAGE$64
41875
+ usage: USAGE$65
41772
41876
  },
41773
41877
  {
41774
41878
  path: ["push-token"],
41775
- usage: USAGE$61
41879
+ usage: USAGE$62
41776
41880
  },
41777
41881
  {
41778
41882
  path: ["impersonate"],
41779
- usage: USAGE$62
41883
+ usage: USAGE$63
41780
41884
  }
41781
41885
  ];
41782
41886
  // src/commands/auth-sessions.ts
41783
- var USAGE$60 = [
41887
+ var USAGE$61 = [
41784
41888
  "Usage: hostingctl auth profiles",
41785
41889
  "",
41786
41890
  "Lists every session this machine holds: the profile name, the API it signs in to, when its access token",
@@ -41798,7 +41902,7 @@ var USAGE$60 = [
41798
41902
  * made a machine signed in to two accounts look like a machine signed in to none.
41799
41903
  */
41800
41904
  async function authSessions(context, rest) {
41801
- if (rest.length > 0) throw new UsageError(USAGE$60);
41905
+ if (rest.length > 0) throw new UsageError(USAGE$61);
41802
41906
  const document = await readProfiles();
41803
41907
  const selected = namedProfile(context.flags, document);
41804
41908
  const profiles = Object.entries(document.profiles).map(([name, stored]) => ({
@@ -42546,7 +42650,7 @@ var MAILBOX_TOPICS = [{
42546
42650
  usage: MAILBOX_IMPORT_USAGE
42547
42651
  }];
42548
42652
  // src/commands/mailbox-recovery.ts
42549
- var USAGE$59 = [
42653
+ var USAGE$60 = [
42550
42654
  "Usage: hostingctl mailbox recovery <request|verify|reset> [options]",
42551
42655
  "",
42552
42656
  " request --address <address> Ask for a self-service reset link for a mailbox address.",
@@ -42574,16 +42678,16 @@ function isSessionlessMailboxCommand(argv) {
42574
42678
  /** `mailbox recovery request|verify|reset`: the unauthenticated, token-authorized recovery journey. */
42575
42679
  async function runMailboxRecovery(context, rest) {
42576
42680
  const [action, extra] = rest;
42577
- if (extra !== void 0) throw new UsageError(USAGE$59);
42681
+ if (extra !== void 0) throw new UsageError(USAGE$60);
42578
42682
  if (action === "request") return await request$3(context);
42579
42683
  if (action === "verify") return await verify$2(context);
42580
42684
  if (action === "reset") return await reset(context);
42581
- throw new UsageError(USAGE$59);
42685
+ throw new UsageError(USAGE$60);
42582
42686
  }
42583
42687
  /** `request`: the answer is deliberately identical whether or not an eligible mailbox exists. */
42584
42688
  async function request$3(context) {
42585
42689
  const address = context.flags.get("--address");
42586
- if (address === void 0 || address === "") throw new UsageError(USAGE$59);
42690
+ if (address === void 0 || address === "") throw new UsageError(USAGE$60);
42587
42691
  return await confirmableWrite(context, `Request a mailbox recovery link for ${address}. The answer is the same for an unknown mailbox, one with no confirmed fallback, and an eligible one.`, async () => (await emailMailboxRecoveryRequest({ body: { address } })).data);
42588
42692
  }
42589
42693
  /** `verify`: the token is read only when the send actually happens, so a dry run never touches a secret. */
@@ -42604,7 +42708,7 @@ async function reset(context) {
42604
42708
  }
42605
42709
  /** One recovery token or new password, read from a private file or stdin under the recovery bound. */
42606
42710
  function recoverySecret(context, name) {
42607
- return readSecret(context, name, MAX_RECOVERY_SECRET_BYTES, USAGE$59);
42711
+ return readSecret(context, name, MAX_RECOVERY_SECRET_BYTES, USAGE$60);
42608
42712
  }
42609
42713
  // src/commands/mailbox.ts
42610
42714
  /**
@@ -42737,7 +42841,7 @@ async function environmentGeneration(path) {
42737
42841
  }
42738
42842
  // src/commands/access-credentials.ts
42739
42843
  /** The usage this module refuses with, owned by the commands it implements. */
42740
- var USAGE$58 = [
42844
+ var USAGE$59 = [
42741
42845
  "Usage: hostingctl access key add <environment-uuid> --company <slug> --access-user <uuid> --name <n> --public-key-file <path>",
42742
42846
  " hostingctl access key remove <environment-uuid> --company <slug> --access-user <uuid> <key-uuid>",
42743
42847
  " hostingctl access password set <environment-uuid> --company <slug> --access-user <uuid> (--password-file <path>|--password-stdin)",
@@ -42755,12 +42859,12 @@ var USAGE$58 = [
42755
42859
  /** `key add|remove`. */
42756
42860
  async function key(context, path, action, tail) {
42757
42861
  const accessUserUuid = context.flags.get("--access-user") ?? "";
42758
- if (accessUserUuid === "") throw new UsageError(`key needs --access-user.\\n\\n${USAGE$58}`);
42862
+ if (accessUserUuid === "") throw new UsageError(`key needs --access-user.\\n\\n${USAGE$59}`);
42759
42863
  if (action === "add") {
42760
- if (tail.length > 0) throw new UsageError(USAGE$58);
42864
+ if (tail.length > 0) throw new UsageError(USAGE$59);
42761
42865
  const name = context.flags.get("--name")?.trim() ?? "";
42762
42866
  const file = context.flags.get("--public-key-file") ?? "";
42763
- if (name === "" || file === "") throw new UsageError(`key add needs --name and --public-key-file.\\n\\n${USAGE$58}`);
42867
+ if (name === "" || file === "") throw new UsageError(`key add needs --name and --public-key-file.\\n\\n${USAGE$59}`);
42764
42868
  const publicKey = readPrivateFile(file, "public key", 8192).trim();
42765
42869
  return await confirmableWrite(context, `Add key "${name}" to login ${accessUserUuid}.`, async () => {
42766
42870
  const body = {
@@ -42779,7 +42883,7 @@ async function key(context, path, action, tail) {
42779
42883
  }
42780
42884
  if (action === "remove") {
42781
42885
  const [keyUuid, ...extra] = tail;
42782
- if (keyUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$58);
42886
+ if (keyUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$59);
42783
42887
  return await confirmableWrite(context, `Remove key ${keyUuid} from login ${accessUserUuid}.`, async () => {
42784
42888
  return (await hostingAccessDestroyKey({
42785
42889
  path: {
@@ -42791,18 +42895,18 @@ async function key(context, path, action, tail) {
42791
42895
  })).data;
42792
42896
  });
42793
42897
  }
42794
- throw new UsageError(USAGE$58);
42898
+ throw new UsageError(USAGE$59);
42795
42899
  }
42796
42900
  /** `password set|clear`. */
42797
42901
  async function password(context, path, action, tail) {
42798
42902
  const accessUserUuid = context.flags.get("--access-user") ?? "";
42799
- if (accessUserUuid === "" || tail.length > 0) throw new UsageError(`password needs --access-user.\\n\\n${USAGE$58}`);
42903
+ if (accessUserUuid === "" || tail.length > 0) throw new UsageError(`password needs --access-user.\\n\\n${USAGE$59}`);
42800
42904
  const userPath = {
42801
42905
  ...path,
42802
42906
  accessUserUuid
42803
42907
  };
42804
42908
  if (action === "set") return await confirmableWrite(context, "Set this login's password. The previous password stops working when the change is applied.", async () => {
42805
- const password = readSecret(context, "password", 1024, USAGE$58);
42909
+ const password = readSecret(context, "password", 1024, USAGE$59);
42806
42910
  const body = {
42807
42911
  desiredGeneration: await environmentGeneration(path),
42808
42912
  password,
@@ -42820,7 +42924,7 @@ async function password(context, path, action, tail) {
42820
42924
  query
42821
42925
  })).data;
42822
42926
  });
42823
- throw new UsageError(USAGE$58);
42927
+ throw new UsageError(USAGE$59);
42824
42928
  }
42825
42929
  // src/commands/booleans.ts
42826
42930
  /**
@@ -42843,7 +42947,7 @@ function onOff$5(context, flag, usage) {
42843
42947
  return value;
42844
42948
  }
42845
42949
  // src/commands/access-admin.ts
42846
- var USAGE$57 = [
42950
+ var USAGE$58 = [
42847
42951
  "Usage: hostingctl access settings <environment-uuid> --company <slug>",
42848
42952
  " hostingctl access settings-set <environment-uuid> --company <slug> --password <on|off> --sftp-only <on|off>",
42849
42953
  " hostingctl access grants <environment-uuid> --company <slug>",
@@ -42871,7 +42975,7 @@ var USAGE$57 = [
42871
42975
  /** `access settings|settings-set|grants|grant|un-grant|key|password|user-show|user-set|received`. */
42872
42976
  async function accessAdmin(context, subcommand, rest) {
42873
42977
  if (subcommand === "received") {
42874
- if (rest.length > 0) throw new UsageError(USAGE$57);
42978
+ if (rest.length > 0) throw new UsageError(USAGE$58);
42875
42979
  return {
42876
42980
  kind: "received",
42877
42981
  grants: (await hostingAccessReceivedIndex({})).data.items
@@ -42879,7 +42983,7 @@ async function accessAdmin(context, subcommand, rest) {
42879
42983
  }
42880
42984
  const [first, ...after] = rest;
42881
42985
  const takesAction = subcommand === "key" || subcommand === "password";
42882
- const path = await environmentPath$1(context, takesAction ? after[0] : first, USAGE$57);
42986
+ const path = await environmentPath$1(context, takesAction ? after[0] : first, USAGE$58);
42883
42987
  const tail = takesAction ? after.slice(1) : after;
42884
42988
  return await routed(context, subcommand, path, first ?? "", tail);
42885
42989
  }
@@ -42894,7 +42998,7 @@ async function routed(context, subcommand, path, action, tail) {
42894
42998
  if (subcommand === "password") return await written$9(password(context, path, action, tail));
42895
42999
  if (subcommand === "user-show") return await userShow(path, tail);
42896
43000
  if (subcommand === "user-set") return await written$9(userSet(context, path, tail));
42897
- throw new UsageError(USAGE$57);
43001
+ throw new UsageError(USAGE$58);
42898
43002
  }
42899
43003
  /** Tag one write's outcome with the group that produced it. */
42900
43004
  async function written$9(pending) {
@@ -42905,7 +43009,7 @@ async function written$9(pending) {
42905
43009
  }
42906
43010
  /** A company-wide read takes no positionals. */
42907
43011
  function noExtra$22(rest) {
42908
- if (rest.length > 0) throw new UsageError(USAGE$57);
43012
+ if (rest.length > 0) throw new UsageError(USAGE$58);
42909
43013
  }
42910
43014
  /** `settings`. */
42911
43015
  async function settings$1(path, rest) {
@@ -42918,8 +43022,8 @@ async function settings$1(path, rest) {
42918
43022
  /** `settings-set --password … --sftp-only …`. */
42919
43023
  async function settingsSet(context, path, rest) {
42920
43024
  noExtra$22(rest);
42921
- const passwordEnabled = onOff$5(context, "--password", USAGE$57);
42922
- const sftpOnly = onOff$5(context, "--sftp-only", USAGE$57);
43025
+ const passwordEnabled = onOff$5(context, "--password", USAGE$58);
43026
+ const sftpOnly = onOff$5(context, "--sftp-only", USAGE$58);
42923
43027
  return await confirmableWrite(context, [`Set password sign-in ${passwordEnabled ? "on" : "off"} and SFTP-only ${sftpOnly ? "on" : "off"}.`, " Logins keep their keys either way; this changes how a login may authenticate."].join("\\n"), async () => {
42924
43028
  return (await hostingAccessUpdate({
42925
43029
  path,
@@ -42944,7 +43048,7 @@ async function grant$1(context, path, rest) {
42944
43048
  noExtra$22(rest);
42945
43049
  const userUuid = context.flags.get("--user") ?? "";
42946
43050
  const accessUserUuid = context.flags.get("--access-user") ?? "";
42947
- if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$57}`);
43051
+ if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$58}`);
42948
43052
  return await confirmableWrite(context, `Grant user ${userUuid} the login ${accessUserUuid} on this environment.`, async () => {
42949
43053
  return (await hostingAccessGrantStore({
42950
43054
  path,
@@ -42959,7 +43063,7 @@ async function grant$1(context, path, rest) {
42959
43063
  /** `un-grant <grant-uuid>`. */
42960
43064
  async function unGrant(context, path, rest) {
42961
43065
  const [grantUuid, ...extra] = rest;
42962
- if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$57);
43066
+ if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$58);
42963
43067
  return await confirmableWrite(context, `Withdraw grant ${grantUuid}. The login stays; only this account's access to it ends.`, async () => {
42964
43068
  const query = { desiredGeneration: await environmentGeneration(path) };
42965
43069
  return (await hostingAccessGrantDestroy({
@@ -42974,7 +43078,7 @@ async function unGrant(context, path, rest) {
42974
43078
  /** `user-show <access-user-uuid>`. */
42975
43079
  async function userShow(path, rest) {
42976
43080
  const [accessUserUuid, ...extra] = rest;
42977
- if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$57);
43081
+ if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$58);
42978
43082
  return {
42979
43083
  kind: "user",
42980
43084
  user: (await hostingAccessShowUser({ path: {
@@ -42986,7 +43090,7 @@ async function userShow(path, rest) {
42986
43090
  /** `user-set <access-user-uuid> [--name] [--enabled] [--read-only]`. */
42987
43091
  async function userSet(context, path, rest) {
42988
43092
  const [accessUserUuid, ...extra] = rest;
42989
- if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$57);
43093
+ if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$58);
42990
43094
  const userPath = {
42991
43095
  ...path,
42992
43096
  accessUserUuid
@@ -42995,7 +43099,7 @@ async function userSet(context, path, rest) {
42995
43099
  const name = context.flags.get("--name")?.trim();
42996
43100
  const enabled = onOffFlag(context, "--enabled");
42997
43101
  const readOnly = onOffFlag(context, "--read-only");
42998
- if (name === void 0 && enabled === null && readOnly === null) throw new UsageError(`user-set needs --name, --enabled, --read-only or a combination.\\n\\n${USAGE$57}`);
43102
+ if (name === void 0 && enabled === null && readOnly === null) throw new UsageError(`user-set needs --name, --enabled, --read-only or a combination.\\n\\n${USAGE$58}`);
42999
43103
  const body = {
43000
43104
  desiredGeneration: await environmentGeneration(path),
43001
43105
  name: name === void 0 || name === "" ? current.name : name,
@@ -43145,43 +43249,43 @@ var ACCESS_METADATA = {
43145
43249
  var ACCESS_TOPICS = [
43146
43250
  {
43147
43251
  path: ["settings"],
43148
- usage: USAGE$57
43252
+ usage: USAGE$58
43149
43253
  },
43150
43254
  {
43151
43255
  path: ["settings-set"],
43152
- usage: USAGE$57
43256
+ usage: USAGE$58
43153
43257
  },
43154
43258
  {
43155
43259
  path: ["grants"],
43156
- usage: USAGE$57
43260
+ usage: USAGE$58
43157
43261
  },
43158
43262
  {
43159
43263
  path: ["grant"],
43160
- usage: USAGE$57
43264
+ usage: USAGE$58
43161
43265
  },
43162
43266
  {
43163
43267
  path: ["un-grant"],
43164
- usage: USAGE$57
43268
+ usage: USAGE$58
43165
43269
  },
43166
43270
  {
43167
43271
  path: ["user-show"],
43168
- usage: USAGE$57
43272
+ usage: USAGE$58
43169
43273
  },
43170
43274
  {
43171
43275
  path: ["user-set"],
43172
- usage: USAGE$57
43276
+ usage: USAGE$58
43173
43277
  },
43174
43278
  {
43175
43279
  path: ["received"],
43176
- usage: USAGE$57
43280
+ usage: USAGE$58
43177
43281
  },
43178
43282
  {
43179
43283
  path: ["key"],
43180
- usage: USAGE$58
43284
+ usage: USAGE$59
43181
43285
  },
43182
43286
  {
43183
43287
  path: ["password"],
43184
- usage: USAGE$58
43288
+ usage: USAGE$59
43185
43289
  }
43186
43290
  ];
43187
43291
  // src/commands/access.ts
@@ -43546,7 +43650,7 @@ function notAMember(unknown, eligible) {
43546
43650
  ].join("\n");
43547
43651
  }
43548
43652
  // src/commands/environment-storage-usage.ts
43549
- var USAGE$56 = [
43653
+ var USAGE$57 = [
43550
43654
  "Usage: hostingctl environment storage-usage <environment-uuid> --company <slug>",
43551
43655
  "",
43552
43656
  " storage-usage What each volume was allocated, what it has written and what is left, from the",
@@ -43565,7 +43669,7 @@ var USAGE$56 = [
43565
43669
  */
43566
43670
  async function environmentStorageUsage(context, rest) {
43567
43671
  const [uuid, ...extra] = rest;
43568
- if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$56);
43672
+ if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$57);
43569
43673
  return (await hostingEnvironmentsStorageUsage({ path: {
43570
43674
  company: await requireCompany(context.flags),
43571
43675
  environmentUuid: uuid
@@ -43978,7 +44082,9 @@ var IMPORT_ACTIONS = /* @__PURE__ */ new Set([
43978
44082
  "import-upload",
43979
44083
  "import-discard",
43980
44084
  "url-repair-preview",
43981
- "url-repair-confirm"
44085
+ "url-repair-confirm",
44086
+ "import-fetch",
44087
+ "import-refresh"
43982
44088
  ]);
43983
44089
  /** The application-level site-access actions, which mirror the environment's group. */
43984
44090
  var SITE_ACTIONS = /* @__PURE__ */ new Set([
@@ -44011,7 +44117,7 @@ var ADMIN_ACTIONS = /* @__PURE__ */ new Set([
44011
44117
  "recovery-cancel"
44012
44118
  ]);
44013
44119
  // src/commands/application-admin.ts
44014
- var USAGE$55 = [
44120
+ var USAGE$56 = [
44015
44121
  "Usage: hostingctl application administrator <environment-uuid> <application-uuid> --company <slug>",
44016
44122
  " hostingctl application administrator-reset|administrator-reveal <environment-uuid> <application-uuid> --company <slug>",
44017
44123
  " hostingctl application recovery-status|recovery-retry|recovery-cancel <environment-uuid> <application-uuid> <recovery-uuid> --company <slug>",
@@ -44038,7 +44144,7 @@ async function applicationAdmin(context, action, path, rest) {
44038
44144
  if (action === "administrator-reset") return await credential(context, path, rest, "reset");
44039
44145
  if (action === "administrator-reveal") return await credential(context, path, rest, "reveal");
44040
44146
  const [recoveryUuid, ...extra] = rest;
44041
- if (recoveryUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$55);
44147
+ if (recoveryUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$56);
44042
44148
  const recoveryPath = {
44043
44149
  ...path,
44044
44150
  recoveryUuid
@@ -44051,7 +44157,7 @@ async function applicationAdmin(context, action, path, rest) {
44051
44157
  return (await hostingApplicationRecoveryRetry({ path: recoveryPath })).data;
44052
44158
  }));
44053
44159
  if (action === "recovery-cancel") return await written$8(confirmableWrite(context, "Cancel this recovery. Writers are released and the application returns to its previous state.", async () => (await hostingApplicationRecoveryCancel({ path: recoveryPath })).data));
44054
- throw new UsageError(USAGE$55);
44160
+ throw new UsageError(USAGE$56);
44055
44161
  }
44056
44162
  /** `administrator-reset|reveal`: the one place the application's own password is printed. */
44057
44163
  async function credential(context, path, rest, kind) {
@@ -44072,7 +44178,7 @@ async function written$8(pending) {
44072
44178
  }
44073
44179
  /** No positional arguments, or a usage refusal. */
44074
44180
  function noExtra$21(rest) {
44075
- if (rest.length > 0) throw new UsageError(USAGE$55);
44181
+ if (rest.length > 0) throw new UsageError(USAGE$56);
44076
44182
  }
44077
44183
  /** One recovery as one line: what it is doing, how far, and what it holds. */
44078
44184
  function recoveryLines$1(one) {
@@ -44471,7 +44577,7 @@ async function requireSelectionBranch(company, selectionUuid, branch) {
44471
44577
  throw new UsageError(`Branch "${branch}" is not a branch of ${found.selection.owner}/${found.selection.name}. Its branches: ${offered.branches.join(", ")}.`);
44472
44578
  }
44473
44579
  // src/commands/application-builds.ts
44474
- var USAGE$54 = [
44580
+ var USAGE$55 = [
44475
44581
  "Usage: hostingctl application build <environment-uuid> <application-uuid> --company <slug> [--source <selection-uuid> | --source-upload <upload-uuid> | --ssh-source <connection-uuid>] [--idempotency-key <key>] [--wait [--timeout <seconds>]]",
44476
44582
  " hostingctl application build-log <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
44477
44583
  " hostingctl application build-retry|build-cancel <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
@@ -44501,7 +44607,7 @@ async function applicationBuilds(context, action, path, rest) {
44501
44607
  }
44502
44608
  if (action === "source-bind") return await bind$2(context, path, rest);
44503
44609
  const [buildUuid, ...extra] = rest;
44504
- if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$54);
44610
+ if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$55);
44505
44611
  const buildPath = {
44506
44612
  ...path,
44507
44613
  buildUuid
@@ -44516,7 +44622,7 @@ async function applicationBuilds(context, action, path, rest) {
44516
44622
  if (action === "build-cancel") return await written$7(confirmableWrite(context, "Stop this build. A running build stops where it is.", async () => {
44517
44623
  return (await hostingDeploymentCancel({ path: buildPath })).data;
44518
44624
  }));
44519
- throw new UsageError(USAGE$54);
44625
+ throw new UsageError(USAGE$55);
44520
44626
  }
44521
44627
  /**
44522
44628
  * `source-bind --selection … | --ssh-source … [--source-kind …] [--branch …] [--tag …] [--auto-deploy …]`.
@@ -44528,7 +44634,7 @@ async function bind$2(context, path, rest) {
44528
44634
  noExtra$20(rest);
44529
44635
  const repositorySelectionUuid = context.flags.get("--selection")?.trim() ?? "";
44530
44636
  const sshSourceUuid = context.flags.get("--ssh-source")?.trim() ?? "";
44531
- if (repositorySelectionUuid === "" === (sshSourceUuid === "")) throw new UsageError(`source-bind needs exactly one of --selection or --ssh-source.\n\n${USAGE$54}`);
44637
+ if (repositorySelectionUuid === "" === (sshSourceUuid === "")) throw new UsageError(`source-bind needs exactly one of --selection or --ssh-source.\n\n${USAGE$55}`);
44532
44638
  const sourceKind = sourceKindFlag(context, sshSourceUuid === "" ? "github" : "ssh");
44533
44639
  const branch = context.flags.get("--branch")?.trim();
44534
44640
  const tag = context.flags.get("--tag")?.trim();
@@ -44553,8 +44659,8 @@ async function bind$2(context, path, rest) {
44553
44659
  function sourceKindFlag(context, implied) {
44554
44660
  const value = context.flags.get("--source-kind")?.trim() ?? "";
44555
44661
  if (value === "") return implied;
44556
- if (value !== "github" && value !== "ssh") throw new UsageError(`--source-kind must be github or ssh (got "${value}").\n\n${USAGE$54}`);
44557
- if (value !== implied) throw new UsageError(`--source-kind ${value} does not match the ${implied} reference named.\n\n${USAGE$54}`);
44662
+ if (value !== "github" && value !== "ssh") throw new UsageError(`--source-kind must be github or ssh (got "${value}").\n\n${USAGE$55}`);
44663
+ if (value !== implied) throw new UsageError(`--source-kind ${value} does not match the ${implied} reference named.\n\n${USAGE$55}`);
44558
44664
  return value;
44559
44665
  }
44560
44666
  /** Tag one write's outcome with the group that produced it. */
@@ -44566,7 +44672,7 @@ async function written$7(pending) {
44566
44672
  }
44567
44673
  /** No positional arguments, or a usage refusal. */
44568
44674
  function noExtra$20(rest) {
44569
- if (rest.length > 0) throw new UsageError(USAGE$54);
44675
+ if (rest.length > 0) throw new UsageError(USAGE$55);
44570
44676
  }
44571
44677
  /**
44572
44678
  * `build <env> <workload> [--source …|--source-upload …|--ssh-source …] [--idempotency-key …]`: queue a build.
@@ -44693,7 +44799,7 @@ function overCurrent(current, named) {
44693
44799
  };
44694
44800
  }
44695
44801
  // src/commands/application-cache.ts
44696
- var USAGE$53 = [
44802
+ var USAGE$54 = [
44697
44803
  "Usage: hostingctl application cache <environment-uuid> <application-uuid> --company <slug>",
44698
44804
  " hostingctl application cache-set <environment-uuid> <application-uuid> --company <slug> [--enabled <on|off>] [--fresh <s>] [--background <s>] [--browser <s>] [--reset <on|off>] [--template <id> | --rules-file <rules.json>]",
44699
44805
  " hostingctl application cache-purge <environment-uuid> <application-uuid> --company <slug>",
@@ -44736,7 +44842,7 @@ async function applicationCache(context, action, path, rest) {
44736
44842
  }
44737
44843
  if (action === "canonical") {
44738
44844
  const routeUuid = context.flags.get("--route") ?? "";
44739
- if (routeUuid === "") throw new UsageError(`canonical needs --route.\n\n${USAGE$53}`);
44845
+ if (routeUuid === "") throw new UsageError(`canonical needs --route.\n\n${USAGE$54}`);
44740
44846
  return await written$6(confirmableWrite(context, `Make route ${routeUuid} this application's canonical address.`, async () => {
44741
44847
  const desiredGeneration = await generation$1(path);
44742
44848
  return (await hostingApplicationRouteSelectCanonical({
@@ -44748,7 +44854,7 @@ async function applicationCache(context, action, path, rest) {
44748
44854
  })).data;
44749
44855
  }));
44750
44856
  }
44751
- throw new UsageError(USAGE$53);
44857
+ throw new UsageError(USAGE$54);
44752
44858
  }
44753
44859
  /** `application routes|route-add|route-remove`, which are environment-scoped. */
44754
44860
  async function applicationRoutes(context, action, path, rest) {
@@ -44762,7 +44868,7 @@ async function applicationRoutes(context, action, path, rest) {
44762
44868
  if (action === "route-add") return await addRoute(context, path, rest);
44763
44869
  if (action === "route-remove") {
44764
44870
  const [routeUuid, ...extra] = rest;
44765
- if (routeUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$53);
44871
+ if (routeUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$54);
44766
44872
  return await written$6(confirmableWrite(context, `Remove route ${routeUuid}.`, async () => {
44767
44873
  const body = { desiredGeneration: await generation$1(path) };
44768
44874
  return (await hostingApplicationRouteRemove({
@@ -44774,7 +44880,7 @@ async function applicationRoutes(context, action, path, rest) {
44774
44880
  })).data;
44775
44881
  }));
44776
44882
  }
44777
- throw new UsageError(USAGE$53);
44883
+ throw new UsageError(USAGE$54);
44778
44884
  }
44779
44885
  /** `route-add --source … --target … --path …`. */
44780
44886
  async function addRoute(context, path, rest) {
@@ -44782,7 +44888,7 @@ async function addRoute(context, path, rest) {
44782
44888
  const sourceWorkloadUuid = context.flags.get("--source") ?? "";
44783
44889
  const targetWorkloadUuid = context.flags.get("--target") ?? "";
44784
44890
  const routePath = context.flags.get("--path") ?? "";
44785
- if (sourceWorkloadUuid === "" || targetWorkloadUuid === "" || routePath === "") throw new UsageError(`route-add needs --source, --target and --path.\n\n${USAGE$53}`);
44891
+ if (sourceWorkloadUuid === "" || targetWorkloadUuid === "" || routePath === "") throw new UsageError(`route-add needs --source, --target and --path.\n\n${USAGE$54}`);
44786
44892
  const domainUuid = context.flags.get("--domain")?.trim();
44787
44893
  const canonical = onOffFlag(context, "--canonical") ?? false;
44788
44894
  return await written$6(confirmableWrite(context, `Route ${routePath} from ${sourceWorkloadUuid} to ${targetWorkloadUuid}${canonical ? " as canonical" : ""}.`, async () => {
@@ -44815,11 +44921,11 @@ function cacheBody(context) {
44815
44921
  const raw = context.flags.get(flag)?.trim() ?? "";
44816
44922
  if (raw === "") continue;
44817
44923
  const value = Number(raw);
44818
- if (!Number.isInteger(value) || value < 0) throw new UsageError(`${flag} must be a whole number of seconds.\n\n${USAGE$53}`);
44924
+ if (!Number.isInteger(value) || value < 0) throw new UsageError(`${flag} must be a whole number of seconds.\n\n${USAGE$54}`);
44819
44925
  body[field] = value;
44820
44926
  }
44821
- addCacheRules(context, body, USAGE$53);
44822
- if (Object.keys(body).length === 0) throw new UsageError(`cache-set needs at least one field.\n\n${USAGE$53}`);
44927
+ addCacheRules(context, body, USAGE$54);
44928
+ if (Object.keys(body).length === 0) throw new UsageError(`cache-set needs at least one field.\n\n${USAGE$54}`);
44823
44929
  return body;
44824
44930
  }
44825
44931
  /** The environment's generation, which every write here must name. */
@@ -44835,7 +44941,7 @@ async function written$6(pending) {
44835
44941
  }
44836
44942
  /** No positional arguments, or a usage refusal. */
44837
44943
  function noExtra$19(rest) {
44838
- if (rest.length > 0) throw new UsageError(USAGE$53);
44944
+ if (rest.length > 0) throw new UsageError(USAGE$54);
44839
44945
  }
44840
44946
  /** The `application cache*|routes|route-*` renderer. */
44841
44947
  function applicationCacheText(report) {
@@ -44995,7 +45101,7 @@ function describeAuth(workloadUuid, auth) {
44995
45101
  ].join("\n");
44996
45102
  }
44997
45103
  // src/commands/application-create.ts
44998
- var USAGE$52 = [
45104
+ var USAGE$53 = [
44999
45105
  "Usage: hostingctl application create <environment-uuid> --company <slug> --type <type> --name <name>",
45000
45106
  " --cpu-request <millicores> --memory-request <MiB>",
45001
45107
  " [--cpu-limit <millicores>] [--memory-limit <MiB>] [--label <text>] [--hostname <host>]",
@@ -45032,11 +45138,11 @@ var CREATE_FLAGS = [{
45032
45138
  }];
45033
45139
  /** `application create <env> …`, from the `application` command. */
45034
45140
  async function applicationCreate(context, path, rest) {
45035
- if (rest.length > 0) throw new UsageError(USAGE$52);
45141
+ if (rest.length > 0) throw new UsageError(USAGE$53);
45036
45142
  const type = context.flags.get("--type")?.trim().toLowerCase() ?? "";
45037
- if (!TYPES.has(type)) throw new UsageError(`create needs --type wordpress, moodle, infisical, supabase-auth, supabase-rest or supabase-realtime.\n\n${USAGE$52}`);
45143
+ if (!TYPES.has(type)) throw new UsageError(`create needs --type wordpress, moodle, infisical, supabase-auth, supabase-rest or supabase-realtime.\n\n${USAGE$53}`);
45038
45144
  const name = context.flags.get("--name")?.trim() ?? "";
45039
- if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$52}`);
45145
+ if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$53}`);
45040
45146
  const resources = requestedResources(context);
45041
45147
  const label = context.flags.get("--label")?.trim() ?? "";
45042
45148
  const intendedHostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
@@ -45081,11 +45187,74 @@ function requestedResources(context) {
45081
45187
  /** One required whole-number flag, or a usage refusal naming the flag. */
45082
45188
  function required$7(context, flag) {
45083
45189
  const value = wholeNumberFlag(context.flags, flag);
45084
- if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$52}`);
45190
+ if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$53}`);
45085
45191
  return value;
45086
45192
  }
45193
+ // src/commands/application-import-fetch.ts
45194
+ var FETCH_USAGE = [
45195
+ "Usage: hostingctl application import-fetch <environment-uuid> <application-uuid> --company <slug>",
45196
+ " (--connection <uuid> [--source-path <folder>] | --archive-url <https-url>) [--database-connection <uuid>]",
45197
+ " hostingctl application import-refresh <environment-uuid> <application-uuid> --company <slug>",
45198
+ "",
45199
+ " import-fetch Fetch a WordPress site from the old host into a staged import for review.",
45200
+ " import-refresh Refresh from the old host: fetch the same source again into a new review.",
45201
+ "",
45202
+ "A file connection and a database connection must have passed a check. An archive is an https:// .zip, .jpa,",
45203
+ ".tar.gz or .tgz on a public address; only an Akeeba .jpa carries its own database. Read the import with",
45204
+ "`application import` until it is staged, then review and confirm it as an upload. Every write needs --confirm."
45205
+ ].join("\n");
45206
+ /** The flags only the fetch reads. */
45207
+ var FETCH_FLAGS = [
45208
+ {
45209
+ name: "--connection",
45210
+ takesValue: true,
45211
+ description: "import-fetch: the checked file connection to fetch from."
45212
+ },
45213
+ {
45214
+ name: "--source-path",
45215
+ takesValue: true,
45216
+ description: "import-fetch: the folder on the old host (the connection's start path by default)."
45217
+ },
45218
+ {
45219
+ name: "--archive-url",
45220
+ takesValue: true,
45221
+ description: "import-fetch: an https:// archive of the site to fetch instead."
45222
+ },
45223
+ {
45224
+ name: "--database-connection",
45225
+ takesValue: true,
45226
+ description: "import-fetch: the checked MySQL connection the dump is taken from."
45227
+ }
45228
+ ];
45229
+ var FETCH_TOPICS = [{
45230
+ path: ["import-fetch"],
45231
+ usage: FETCH_USAGE
45232
+ }, {
45233
+ path: ["import-refresh"],
45234
+ usage: FETCH_USAGE
45235
+ }];
45236
+ /** `import-fetch` and `import-refresh`: both answer with the received import, to be read until it is staged. */
45237
+ async function fetchImport(context, action, path, rest) {
45238
+ if (rest.length > 0) throw new UsageError(FETCH_USAGE);
45239
+ if (action === "import-refresh") return await confirmableWrite(context, "Refresh from the old host: fetch this site's last source again into a new import for review. Nothing is applied yet.", async () => (await hostingWordpressImportRefresh({ path })).data);
45240
+ const value = (flag) => {
45241
+ const one = context.flags.get(flag)?.trim() ?? "";
45242
+ return one === "" ? void 0 : one;
45243
+ };
45244
+ const body = {
45245
+ connectionUuid: value("--connection"),
45246
+ sourcePath: value("--source-path"),
45247
+ archiveUrl: value("--archive-url"),
45248
+ databaseConnectionUuid: value("--database-connection")
45249
+ };
45250
+ if (body.connectionUuid === void 0 === (body.archiveUrl === void 0)) throw new UsageError(`import-fetch needs exactly one of --connection or --archive-url.\n\n${FETCH_USAGE}`);
45251
+ return await confirmableWrite(context, `Fetch a site import from ${body.archiveUrl ?? `connection ${String(body.connectionUuid)}, folder ${body.sourcePath ?? "(its start path)"}`}${body.databaseConnectionUuid === void 0 ? "" : ` with the database from ${body.databaseConnectionUuid}`}. The import is staged for review; nothing is applied yet.`, async () => (await hostingWordpressImportFetch({
45252
+ path,
45253
+ body
45254
+ })).data);
45255
+ }
45087
45256
  // src/commands/application-upload.ts
45088
- var USAGE$51 = [
45257
+ var USAGE$52 = [
45089
45258
  "Usage: hostingctl application import-upload <environment-uuid> <application-uuid> --company <slug>",
45090
45259
  " --database <path-to.sql> --archive <path-to.zip|path-to.jpa> | --directory <dir>",
45091
45260
  "",
@@ -45114,12 +45283,12 @@ var STAGING_WAIT_MS = 9e5;
45114
45283
  /** How often the staged import is asked for its state while the queue works. */
45115
45284
  var STAGING_POLL_MS = 3e3;
45116
45285
  async function applicationUpload(context, path, rest) {
45117
- if (rest.length > 0) throw new UsageError(USAGE$51);
45286
+ if (rest.length > 0) throw new UsageError(USAGE$52);
45118
45287
  const database = context.flags.get("--database")?.trim() ?? "";
45119
45288
  const archive = context.flags.get("--archive")?.trim() ?? "";
45120
45289
  const directory = context.flags.get("--directory")?.trim() ?? "";
45121
- if (archive !== "" && directory !== "") throw new UsageError(`Send the site files as either --archive or --directory, not both.\n\n${USAGE$51}`);
45122
- if (database === "" && !isAkeebaArchive(archive)) throw new UsageError(`--database is required unless --archive is an Akeeba backup (.jpa or .jps), which carries the site's database inside the archive. If --archive is an Akeeba backup renamed .zip, rename it so its own database is used.\n\n${USAGE$51}`);
45290
+ if (archive !== "" && directory !== "") throw new UsageError(`Send the site files as either --archive or --directory, not both.\n\n${USAGE$52}`);
45291
+ if (database === "" && !isAkeebaArchive(archive)) throw new UsageError(`--database is required unless --archive is an Akeeba backup (.jpa or .jps), which carries the site's database inside the archive. If --archive is an Akeeba backup renamed .zip, rename it so its own database is used.\n\n${USAGE$52}`);
45123
45292
  const databaseBytes = database === "" ? 0 : await sizeOf(database, "database");
45124
45293
  const files = directory === "" ? [] : await manifestOf(directory);
45125
45294
  const fileBytes = directory === "" ? 0 : await totalSize(files);
@@ -45228,7 +45397,7 @@ function describe$2(bytes) {
45228
45397
  return `${(bytes / 1048576).toFixed(1)} MiB`;
45229
45398
  }
45230
45399
  // src/commands/application-import.ts
45231
- var USAGE$50 = [
45400
+ var USAGE$51 = [
45232
45401
  "Usage: hostingctl application import <environment-uuid> <application-uuid> <import-uuid> --company <slug>",
45233
45402
  " hostingctl application import-upload <environment-uuid> <application-uuid> --company <slug>",
45234
45403
  " --database <path-to.sql> [--archive <path-to.zip> | --directory <dir>]",
@@ -45245,12 +45414,16 @@ var USAGE$50 = [
45245
45414
  "The confirmation is the text the review asked the person to type, so a rewrite is never confirmed by a flag",
45246
45415
  "alone. Every write needs --confirm; --dry-run describes the change without sending it."
45247
45416
  ].join("\n");
45248
- /** `application import|import-discard|url-repair-*`. */
45417
+ /** `application import|import-upload|import-fetch|import-refresh|import-discard|url-repair-*`. */
45249
45418
  async function applicationImport(context, action, path, rest) {
45250
45419
  if (action === "url-repair-preview") return await previewRepair(context, path, rest);
45251
45420
  if (action === "import-upload") return await applicationUpload(context, path, rest);
45421
+ if (action === "import-fetch" || action === "import-refresh") return {
45422
+ kind: "import-write",
45423
+ outcome: await fetchImport(context, action, path, rest)
45424
+ };
45252
45425
  const [importUuid, ...extra] = rest;
45253
- if (importUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$50);
45426
+ if (importUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$51);
45254
45427
  if (action === "import") return {
45255
45428
  kind: "import",
45256
45429
  staged: (await hostingWordpressImportShowImport({ path: {
@@ -45263,13 +45436,13 @@ async function applicationImport(context, action, path, rest) {
45263
45436
  importUuid
45264
45437
  } })).data));
45265
45438
  if (action === "url-repair-confirm") return await confirmRepair(context, path, importUuid);
45266
- throw new UsageError(USAGE$50);
45439
+ throw new UsageError(USAGE$51);
45267
45440
  }
45268
45441
  /** `url-repair-preview --source-url …`: the review a confirmation is made against. */
45269
45442
  async function previewRepair(context, path, rest) {
45270
- if (rest.length > 0) throw new UsageError(USAGE$50);
45443
+ if (rest.length > 0) throw new UsageError(USAGE$51);
45271
45444
  const sourceUrl = context.flags.get("--source-url")?.trim() ?? "";
45272
- if (sourceUrl === "") throw new UsageError(`url-repair-preview needs --source-url.\n\n${USAGE$50}`);
45445
+ if (sourceUrl === "") throw new UsageError(`url-repair-preview needs --source-url.\n\n${USAGE$51}`);
45273
45446
  return {
45274
45447
  kind: "url-repair",
45275
45448
  recovery: (await hostingWordpressUrlRepairPreview({
@@ -45281,7 +45454,7 @@ async function previewRepair(context, path, rest) {
45281
45454
  /** `url-repair-confirm <recovery> --confirmation …`: the typed text the review asked for. */
45282
45455
  async function confirmRepair(context, path, recoveryUuid) {
45283
45456
  const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
45284
- if (confirmation === "") throw new UsageError(`url-repair-confirm needs --confirmation.\n\n${USAGE$50}`);
45457
+ if (confirmation === "") throw new UsageError(`url-repair-confirm needs --confirmation.\n\n${USAGE$51}`);
45285
45458
  return await written$5(confirmableWrite(context, `Confirm the URL repair by typing its confirmation ("${confirmation}").`, async () => {
45286
45459
  const desiredGeneration = (await hostingEnvironmentShow({ path })).data.desiredGeneration;
45287
45460
  const body = {
@@ -45425,7 +45598,7 @@ function recoveryWaitText(report) {
45425
45598
  return `Recovery ${report.recovery.uuid} ${report.recovery.statusName}: ${report.recovery.actionName} of ${report.recovery.workloadName} is done.`;
45426
45599
  }
45427
45600
  // src/commands/application-recovery.ts
45428
- var USAGE$49 = [
45601
+ var USAGE$50 = [
45429
45602
  "Usage: hostingctl application recovery-review <environment-uuid> <application-uuid> --company <slug> [--import <uuid>]",
45430
45603
  " hostingctl application recovery-confirm <environment-uuid> <application-uuid> --company <slug> --confirmation <text> [--import <uuid>] [--wait [--timeout <seconds>]]",
45431
45604
  "",
@@ -45445,9 +45618,9 @@ var USAGE$49 = [
45445
45618
  ].join("\n");
45446
45619
  /** `application recovery-review|recovery-confirm`. */
45447
45620
  async function applicationRecovery(context, action, path, rest) {
45448
- if (rest.length > 0) throw new UsageError(USAGE$49);
45621
+ if (rest.length > 0) throw new UsageError(USAGE$50);
45449
45622
  const importUuid = context.flags.get("--import")?.trim();
45450
- if (importUuid === "") throw new UsageError(`--import needs the staged import's id.\n\n${USAGE$49}`);
45623
+ if (importUuid === "") throw new UsageError(`--import needs the staged import's id.\n\n${USAGE$50}`);
45451
45624
  const review = (await hostingApplicationRecoveryShow({
45452
45625
  path,
45453
45626
  ...importUuid === void 0 ? {} : { query: { importUuid } }
@@ -45456,10 +45629,10 @@ async function applicationRecovery(context, action, path, rest) {
45456
45629
  kind: "recovery-review",
45457
45630
  review
45458
45631
  };
45459
- if (action !== "recovery-confirm") throw new UsageError(USAGE$49);
45632
+ if (action !== "recovery-confirm") throw new UsageError(USAGE$50);
45460
45633
  if (review.blockedReason !== null) throw new UsageError(`This restore is blocked: ${review.blockedReason}`);
45461
45634
  const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
45462
- if (confirmation === "") throw new UsageError(`recovery-confirm needs --confirmation.\n\n${USAGE$49}`);
45635
+ if (confirmation === "") throw new UsageError(`recovery-confirm needs --confirmation.\n\n${USAGE$50}`);
45463
45636
  const wait = context.flags.has("--wait");
45464
45637
  const deadline = wait ? commandDeadline(context.flags) : 0;
45465
45638
  const outcome = await confirmableWrite(context, `Confirm ${review.actionName} of ${review.name}${review.installedVersion === null ? "" : ` from ${review.installedVersion}`}: ${String(review.routeUuids.length)} route(s) and ${String(review.hosts.length)} host(s) are rewritten.`, async () => {
@@ -45576,7 +45749,7 @@ function siteAccessFlow(callbacks, usage) {
45576
45749
  access: await callbacks.show(path)
45577
45750
  };
45578
45751
  }
45579
- if (action === "site-access-set") return await set$3(context, path, rest, callbacks, usage);
45752
+ if (action === "site-access-set") return await set$4(context, path, rest, callbacks, usage);
45580
45753
  if (action === "site-access-rotate") {
45581
45754
  noExtra$18(rest, usage);
45582
45755
  if (callbacks.rotate === null) throw new UsageError("This scope has no sign-in edge of its own to rotate.");
@@ -45588,7 +45761,7 @@ function siteAccessFlow(callbacks, usage) {
45588
45761
  };
45589
45762
  }
45590
45763
  /** `site-access-set --sign-in … [--audience …]`. */
45591
- async function set$3(context, path, rest, callbacks, usage) {
45764
+ async function set$4(context, path, rest, callbacks, usage) {
45592
45765
  noExtra$18(rest, usage);
45593
45766
  const requiredSignIn = onOffFlag(context, "--sign-in");
45594
45767
  if (requiredSignIn === null) throw new UsageError(`site-access-set needs --sign-in.\n\n${usage}`);
@@ -45661,7 +45834,7 @@ function siteAccessText(report) {
45661
45834
  return report.assignments.length === 0 ? "Nobody has been invited to sign in." : report.assignments.map(assignmentLine).join("\n");
45662
45835
  }
45663
45836
  // src/commands/application-site-access.ts
45664
- var USAGE$48 = [
45837
+ var USAGE$49 = [
45665
45838
  "Usage: hostingctl application site-access <environment-uuid> <application-uuid> --company <slug>",
45666
45839
  " hostingctl application site-access-set <environment-uuid> <application-uuid> --company <slug> --sign-in <on|off> [--audience <name>]",
45667
45840
  " hostingctl application site-access-rotate <environment-uuid> <application-uuid> --company <slug>",
@@ -45704,14 +45877,14 @@ var flow$1 = siteAccessFlow({
45704
45877
  refresh: async (path) => (await hostingApplicationSiteAccessUsersRefresh({ path })).data,
45705
45878
  destroy: async (path) => (await hostingApplicationSiteAccessUsersDestroy({ path })).data,
45706
45879
  rotate: async (path) => (await hostingApplicationSiteAccessRotate({ path })).data
45707
- }, USAGE$48);
45880
+ }, USAGE$49);
45708
45881
  /** `application site-access*|site-user*`, which the application dispatcher calls with its resolved path. */
45709
45882
  async function applicationSiteAccess(context, action, path, rest) {
45710
- if (rest.some((one) => one === "")) throw new UsageError(USAGE$48);
45883
+ if (rest.some((one) => one === "")) throw new UsageError(USAGE$49);
45711
45884
  return await flow$1(context, action, path, rest);
45712
45885
  }
45713
45886
  // src/commands/application-source-ssh.ts
45714
- var USAGE$47 = [
45887
+ var USAGE$48 = [
45715
45888
  "Usage: hostingctl application source-ssh-list --company <slug>",
45716
45889
  " hostingctl application source-ssh-show <connection-uuid> --company <slug>",
45717
45890
  " hostingctl application source-ssh-create --company <slug> --name <label> --repo <url> --ref <name> [--ref-kind branch|tag]",
@@ -45763,7 +45936,7 @@ async function applicationSshSources(context, action, company, rest) {
45763
45936
  }
45764
45937
  if (action === "source-ssh-create") return await create$5(context, company, rest);
45765
45938
  const [connectionUuid, ...extra] = rest;
45766
- if (connectionUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$47);
45939
+ if (connectionUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$48);
45767
45940
  const path = {
45768
45941
  company,
45769
45942
  connectionUuid
@@ -45785,7 +45958,7 @@ async function applicationSshSources(context, action, company, rest) {
45785
45958
  "to be installed on the Git server before access can be proved again."
45786
45959
  ].join("\n"), async () => (await hostingSshSourcesRotateKey({ path })).data));
45787
45960
  if (action === "source-ssh-revoke") return await written$4(confirmableWrite(context, [`Retire the SSH source ${connectionUuid}.`, "The source stops fetching and cannot promote a pending candidate; a release already serving is unchanged."].join("\n"), async () => (await hostingSshSourcesRevoke({ path })).data));
45788
- throw new UsageError(USAGE$47);
45961
+ throw new UsageError(USAGE$48);
45789
45962
  }
45790
45963
  /** `source-ssh-create --name … --repo … --ref … [--ref-kind …]`: one repository and the ref it reads. */
45791
45964
  async function create$5(context, company, rest) {
@@ -45815,7 +45988,7 @@ async function update$5(context, path) {
45815
45988
  const name = optionalFlag(context, "--name");
45816
45989
  const ref = optionalFlag(context, "--ref");
45817
45990
  const refKind = refKindFlag(context);
45818
- if (name === null && ref === null && refKind === null) throw new UsageError(`source-ssh-update needs --name, --ref or --ref-kind.\n\n${USAGE$47}`);
45991
+ if (name === null && ref === null && refKind === null) throw new UsageError(`source-ssh-update needs --name, --ref or --ref-kind.\n\n${USAGE$48}`);
45819
45992
  const described = [name === null ? "" : `label ${name}`, ref === null ? "" : `ref ${ref}`].filter((one) => one !== "").join(", ");
45820
45993
  return await written$4(confirmableWrite(context, [
45821
45994
  `Edit the SSH source ${path.connectionUuid}${described === "" ? "" : `: ${described}`}.`,
@@ -45847,7 +46020,7 @@ async function confirmHostKey(context, path) {
45847
46020
  /** A required flag's value, or a refusal naming the flag. */
45848
46021
  function required$6(context, flag) {
45849
46022
  const value = context.flags.get(flag)?.trim() ?? "";
45850
- if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$47}`);
46023
+ if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$48}`);
45851
46024
  return value;
45852
46025
  }
45853
46026
  /** An optional flag's value, or null when it was not given. */
@@ -45860,7 +46033,7 @@ function refKindFlag(context) {
45860
46033
  const value = context.flags.get("--ref-kind")?.trim() ?? "";
45861
46034
  if (value === "") return null;
45862
46035
  if (value === "branch" || value === "tag") return value;
45863
- throw new UsageError(`--ref-kind must be branch or tag (got "${value}").\n\n${USAGE$47}`);
46036
+ throw new UsageError(`--ref-kind must be branch or tag (got "${value}").\n\n${USAGE$48}`);
45864
46037
  }
45865
46038
  /** Tag one write's outcome with the group that produced it. */
45866
46039
  async function written$4(pending) {
@@ -45871,10 +46044,10 @@ async function written$4(pending) {
45871
46044
  }
45872
46045
  /** No positional arguments, or a usage refusal. */
45873
46046
  function noExtra$17(rest) {
45874
- if (rest.length > 0) throw new UsageError(USAGE$47);
46047
+ if (rest.length > 0) throw new UsageError(USAGE$48);
45875
46048
  }
45876
46049
  // src/commands/application-source-upload.ts
45877
- var USAGE$46 = [
46050
+ var USAGE$47 = [
45878
46051
  "Usage: hostingctl application source-upload <environment-uuid> <application-uuid> --company <slug> --file <path-to.zip>",
45879
46052
  " hostingctl application source-uploads <environment-uuid> <application-uuid> --company <slug>",
45880
46053
  " hostingctl application source-upload-show <environment-uuid> <application-uuid> <upload-uuid> --company <slug>",
@@ -45913,7 +46086,7 @@ async function applicationSourceUploads(context, action, path, rest) {
45913
46086
  };
45914
46087
  }
45915
46088
  const [uploadUuid, ...extra] = rest;
45916
- if (uploadUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$46);
46089
+ if (uploadUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$47);
45917
46090
  const uploadPath = {
45918
46091
  ...path,
45919
46092
  uploadUuid
@@ -45925,7 +46098,7 @@ async function applicationSourceUploads(context, action, path, rest) {
45925
46098
  if (action === "source-upload-discard") return await written$3(confirmableWrite(context, [`Discard the staged source upload ${uploadUuid}.`, "A build that already used it keeps the copy it was handed, so nothing that is serving changes."].join("\n"), async () => {
45926
46099
  await hostingSourceUploadsDestroy({ path: uploadPath });
45927
46100
  }));
45928
- throw new UsageError(USAGE$46);
46101
+ throw new UsageError(USAGE$47);
45929
46102
  }
45930
46103
  /**
45931
46104
  * `source-upload --file …`: stage one ZIP as the application's source.
@@ -45937,7 +46110,7 @@ async function applicationSourceUploads(context, action, path, rest) {
45937
46110
  async function store(context, path, rest) {
45938
46111
  noExtra$16(rest);
45939
46112
  const file = context.flags.get("--file")?.trim() ?? "";
45940
- if (file === "") throw new UsageError(`source-upload needs --file.\n\n${USAGE$46}`);
46113
+ if (file === "") throw new UsageError(`source-upload needs --file.\n\n${USAGE$47}`);
45941
46114
  return await written$3(confirmableWrite(context, [
45942
46115
  `Upload ${file} as the staged source for application ${path.workloadUuid}.`,
45943
46116
  "The platform normalizes the archive, measures it and reviews it; installing dependencies and changing anything",
@@ -45977,7 +46150,7 @@ async function written$3(pending) {
45977
46150
  }
45978
46151
  /** No positional arguments, or a usage refusal. */
45979
46152
  function noExtra$16(rest) {
45980
- if (rest.length > 0) throw new UsageError(USAGE$46);
46153
+ if (rest.length > 0) throw new UsageError(USAGE$47);
45981
46154
  }
45982
46155
  /** One staged upload: what the platform measured, what the review found, and when staging expires. */
45983
46156
  function uploadLines(upload) {
@@ -46104,51 +46277,51 @@ var SOURCE_SUBCOMMANDS = [
46104
46277
  var SOURCE_TOPICS = [
46105
46278
  {
46106
46279
  path: ["source-upload"],
46107
- usage: USAGE$46
46280
+ usage: USAGE$47
46108
46281
  },
46109
46282
  {
46110
46283
  path: ["source-uploads"],
46111
- usage: USAGE$46
46284
+ usage: USAGE$47
46112
46285
  },
46113
46286
  {
46114
46287
  path: ["source-upload-show"],
46115
- usage: USAGE$46
46288
+ usage: USAGE$47
46116
46289
  },
46117
46290
  {
46118
46291
  path: ["source-upload-discard"],
46119
- usage: USAGE$46
46292
+ usage: USAGE$47
46120
46293
  },
46121
46294
  {
46122
46295
  path: ["source-ssh-list"],
46123
- usage: USAGE$47
46296
+ usage: USAGE$48
46124
46297
  },
46125
46298
  {
46126
46299
  path: ["source-ssh-show"],
46127
- usage: USAGE$47
46300
+ usage: USAGE$48
46128
46301
  },
46129
46302
  {
46130
46303
  path: ["source-ssh-create"],
46131
- usage: USAGE$47
46304
+ usage: USAGE$48
46132
46305
  },
46133
46306
  {
46134
46307
  path: ["source-ssh-update"],
46135
- usage: USAGE$47
46308
+ usage: USAGE$48
46136
46309
  },
46137
46310
  {
46138
46311
  path: ["source-ssh-confirm-host-key"],
46139
- usage: USAGE$47
46312
+ usage: USAGE$48
46140
46313
  },
46141
46314
  {
46142
46315
  path: ["source-ssh-verify"],
46143
- usage: USAGE$47
46316
+ usage: USAGE$48
46144
46317
  },
46145
46318
  {
46146
46319
  path: ["source-ssh-rotate-key"],
46147
- usage: USAGE$47
46320
+ usage: USAGE$48
46148
46321
  },
46149
46322
  {
46150
46323
  path: ["source-ssh-revoke"],
46151
- usage: USAGE$47
46324
+ usage: USAGE$48
46152
46325
  }
46153
46326
  ];
46154
46327
  // src/commands/application-speed.ts
@@ -46178,7 +46351,7 @@ function applicationSpeedText(check) {
46178
46351
  * paused. It starts no build and promotes nothing. The pause is the customer's own control: while it holds, a push to
46179
46352
  * the bound ref is read and matched but builds nothing, and the release that is serving is untouched either way.
46180
46353
  */
46181
- var USAGE$45 = [
46354
+ var USAGE$46 = [
46182
46355
  "Usage: hostingctl application updates <environment-uuid> <application-uuid> --company <slug>",
46183
46356
  " hostingctl application updates-pause <environment-uuid> <application-uuid> --company <slug>",
46184
46357
  " hostingctl application updates-resume <environment-uuid> <application-uuid> --company <slug>",
@@ -46191,7 +46364,7 @@ var USAGE$45 = [
46191
46364
  "Both writes need --confirm; --dry-run describes the change without sending it."
46192
46365
  ].join("\n");
46193
46366
  async function applicationUpdates(context, action, path, rest) {
46194
- if (rest.length > 0) throw new UsageError(USAGE$45);
46367
+ if (rest.length > 0) throw new UsageError(USAGE$46);
46195
46368
  if (action === "updates") return {
46196
46369
  kind: "updates",
46197
46370
  surface: (await hostingApplicationUpdatesShow({ path })).data
@@ -46203,7 +46376,7 @@ async function applicationUpdates(context, action, path, rest) {
46203
46376
  outcome: await confirmableWrite(context, pausing ? `Pause updates for application ${path.workloadUuid}: a push to its bound ref stops building it, and the release that is serving is unchanged.` : `Resume updates for application ${path.workloadUuid}: it may be a candidate again. Nothing is deployed by resuming.`, async () => pausing ? (await hostingApplicationUpdatesPause({ path })).data : (await hostingApplicationUpdatesResume({ path })).data)
46204
46377
  };
46205
46378
  }
46206
- throw new UsageError(USAGE$45);
46379
+ throw new UsageError(USAGE$46);
46207
46380
  }
46208
46381
  /**
46209
46382
  * The update state in words.
@@ -46274,6 +46447,7 @@ var APPLICATION_METADATA = {
46274
46447
  description: "The workload a route is served from, or the repository selection a build is made from."
46275
46448
  },
46276
46449
  ...SOURCE_FLAGS,
46450
+ ...FETCH_FLAGS,
46277
46451
  {
46278
46452
  name: "--target",
46279
46453
  takesValue: true,
@@ -46421,11 +46595,7 @@ var APPLICATION_METADATA = {
46421
46595
  ...SOURCE_SUBCOMMANDS,
46422
46596
  "recovery-review",
46423
46597
  "recovery-confirm",
46424
- "import",
46425
- "import-upload",
46426
- "import-discard",
46427
- "url-repair-preview",
46428
- "url-repair-confirm",
46598
+ ...IMPORT_ACTIONS,
46429
46599
  "site-access",
46430
46600
  "site-access-set",
46431
46601
  "site-access-rotate",
@@ -46458,84 +46628,81 @@ var APPLICATION_TOPICS = [
46458
46628
  },
46459
46629
  {
46460
46630
  path: ["create"],
46461
- usage: USAGE$52
46631
+ usage: USAGE$53
46462
46632
  },
46463
46633
  {
46464
46634
  path: ["build-log"],
46465
- usage: USAGE$54
46635
+ usage: USAGE$55
46466
46636
  },
46467
46637
  {
46468
46638
  path: ["build-retry"],
46469
- usage: USAGE$54
46639
+ usage: USAGE$55
46470
46640
  },
46471
46641
  {
46472
46642
  path: ["build-cancel"],
46473
- usage: USAGE$54
46643
+ usage: USAGE$55
46474
46644
  },
46475
46645
  {
46476
46646
  path: ["source-bind"],
46477
- usage: USAGE$54
46647
+ usage: USAGE$55
46478
46648
  },
46479
46649
  {
46480
46650
  path: ["source-unbind"],
46481
- usage: USAGE$54
46651
+ usage: USAGE$55
46482
46652
  },
46483
46653
  ...SOURCE_TOPICS,
46484
46654
  {
46485
46655
  path: ["cache"],
46486
- usage: USAGE$53
46656
+ usage: USAGE$54
46487
46657
  },
46488
46658
  {
46489
46659
  path: ["cache-set"],
46490
- usage: USAGE$53
46660
+ usage: USAGE$54
46491
46661
  },
46492
46662
  {
46493
46663
  path: ["cache-purge"],
46494
- usage: USAGE$53
46664
+ usage: USAGE$54
46495
46665
  },
46496
46666
  {
46497
46667
  path: ["routes"],
46498
- usage: USAGE$53
46668
+ usage: USAGE$54
46499
46669
  },
46500
46670
  {
46501
46671
  path: ["route-add"],
46502
- usage: USAGE$53
46672
+ usage: USAGE$54
46503
46673
  },
46504
46674
  {
46505
46675
  path: ["route-remove"],
46506
- usage: USAGE$53
46676
+ usage: USAGE$54
46507
46677
  },
46508
46678
  {
46509
46679
  path: ["canonical"],
46510
- usage: USAGE$53
46680
+ usage: USAGE$54
46511
46681
  },
46512
46682
  {
46513
46683
  path: ["import"],
46514
- usage: USAGE$50
46515
- },
46516
- {
46517
- path: ["import-upload"],
46518
46684
  usage: USAGE$51
46519
46685
  },
46520
46686
  {
46521
- path: ["import-discard"],
46522
- usage: USAGE$50
46523
- },
46524
- {
46525
- path: ["url-repair-preview"],
46526
- usage: USAGE$50
46527
- },
46528
- {
46529
- path: ["url-repair-confirm"],
46530
- usage: USAGE$50
46687
+ path: ["import-upload"],
46688
+ usage: USAGE$52
46531
46689
  },
46690
+ ...[
46691
+ "import-discard",
46692
+ "url-repair-preview",
46693
+ "url-repair-confirm"
46694
+ ].map((one) => ({
46695
+ path: [one],
46696
+ usage: USAGE$51
46697
+ })),
46698
+ ...FETCH_TOPICS,
46532
46699
  {
46533
46700
  path: ["recovery-review"],
46534
- usage: USAGE$49
46701
+ usage: USAGE$50
46535
46702
  },
46536
46703
  {
46537
46704
  path: ["recovery-confirm"],
46538
- usage: USAGE$49
46705
+ usage: USAGE$50
46539
46706
  },
46540
46707
  {
46541
46708
  path: ["runtime"],
@@ -46547,59 +46714,59 @@ var APPLICATION_TOPICS = [
46547
46714
  },
46548
46715
  {
46549
46716
  path: ["site-access"],
46550
- usage: USAGE$48
46717
+ usage: USAGE$49
46551
46718
  },
46552
46719
  {
46553
46720
  path: ["site-access-set"],
46554
- usage: USAGE$48
46721
+ usage: USAGE$49
46555
46722
  },
46556
46723
  {
46557
46724
  path: ["site-access-rotate"],
46558
- usage: USAGE$48
46725
+ usage: USAGE$49
46559
46726
  },
46560
46727
  {
46561
46728
  path: ["site-users"],
46562
- usage: USAGE$48
46729
+ usage: USAGE$49
46563
46730
  },
46564
46731
  {
46565
46732
  path: ["site-user"],
46566
- usage: USAGE$48
46733
+ usage: USAGE$49
46567
46734
  },
46568
46735
  {
46569
46736
  path: ["updates"],
46570
- usage: USAGE$45
46737
+ usage: USAGE$46
46571
46738
  },
46572
46739
  {
46573
46740
  path: ["updates-pause"],
46574
- usage: USAGE$45
46741
+ usage: USAGE$46
46575
46742
  },
46576
46743
  {
46577
46744
  path: ["updates-resume"],
46578
- usage: USAGE$45
46745
+ usage: USAGE$46
46579
46746
  },
46580
46747
  {
46581
46748
  path: ["administrator"],
46582
- usage: USAGE$55
46749
+ usage: USAGE$56
46583
46750
  },
46584
46751
  {
46585
46752
  path: ["administrator-reset"],
46586
- usage: USAGE$55
46753
+ usage: USAGE$56
46587
46754
  },
46588
46755
  {
46589
46756
  path: ["administrator-reveal"],
46590
- usage: USAGE$55
46757
+ usage: USAGE$56
46591
46758
  },
46592
46759
  {
46593
46760
  path: ["recovery-status"],
46594
- usage: USAGE$55
46761
+ usage: USAGE$56
46595
46762
  },
46596
46763
  {
46597
46764
  path: ["recovery-retry"],
46598
- usage: USAGE$55
46765
+ usage: USAGE$56
46599
46766
  },
46600
46767
  {
46601
46768
  path: ["recovery-cancel"],
46602
- usage: USAGE$55
46769
+ usage: USAGE$56
46603
46770
  }
46604
46771
  ];
46605
46772
  // src/commands/application-lifecycle.ts
@@ -47337,7 +47504,7 @@ var backupDestination = {
47337
47504
  const [subcommand, ...rest] = context.positional;
47338
47505
  const action = subcommand ?? "show";
47339
47506
  if (action === "show") return await show$7(context, rest);
47340
- if (action === "set") return await set$2(context, rest);
47507
+ if (action === "set") return await set$3(context, rest);
47341
47508
  if (action === "remove") return await remove$5(context, rest);
47342
47509
  throw new UsageError(BACKUP_DESTINATION_USAGE);
47343
47510
  },
@@ -47356,7 +47523,7 @@ async function show$7(context, rest) {
47356
47523
  };
47357
47524
  }
47358
47525
  /** `set --endpoint … --bucket … --region … --access-key-id … --secret-key-file|stdin … [--prefix …] [--arm]`. */
47359
- async function set$2(context, rest) {
47526
+ async function set$3(context, rest) {
47360
47527
  noExtra$15(rest);
47361
47528
  const company = await requireCompany(context.flags);
47362
47529
  const endpoint = requiredFlag$4(context, "--endpoint", BACKUP_DESTINATION_USAGE);
@@ -56370,6 +56537,10 @@ var confirmHostingApplicationRecoveryRequestSchema = object({
56370
56537
  }).optional()
56371
56538
  })
56372
56539
  }).describe("Confirming one application's reset or restore against the inventory that was reviewed.\n\n`confirmation` is the digest the review returned, and it is required rather than optional: it is\nwhat makes the confirmation an approval of an exact inventory instead of an approval of a label.\n`desiredGeneration` is the same idea at the environment level, so a request composed before\nanother change is a conflict rather than a reset of something else.\n\nThe reviewed figures travel as one typed `intake` object rather than flat fields, so the HTTP\nboundary and the domain contract cannot drift into two shapes with the same names. The intake\nitself is validated by the DTO's own types when it is hydrated.");
56540
+ var confirmHostingDatabaseImportRequestSchema = object({
56541
+ confirmation: string().min(64).max(64),
56542
+ desiredGeneration: int().min(0)
56543
+ }).describe("Confirming a reviewed database import: the `recovery.inventoryDigest` and `recovery.desiredGeneration` the review\nreturned. Everything about the backup itself is the platform's own record, so nothing else is accepted.");
56373
56544
  var confirmHostingSshHostKeyRequestSchema = object({ fingerprint: string().max(120) }).describe("The fingerprint the client obtained independently for a source's server host key.\n\nIt is compared with the discovered value by the service, so only its shape belongs here. It is\nrequired rather than inferred: a confirmation that echoed what the platform already held would not\nbe a confirmation at all.");
56374
56545
  var hostingStorageObjectEncryptionEnumSchema = _enum(["none", "sse_c"]);
56375
56546
  var confirmHostingStorageAdoptionRequestSchema = object({
@@ -56523,6 +56694,7 @@ var hostingCertificateIssuerEnumSchema = _enum([
56523
56694
  "letsencrypt-staging",
56524
56695
  "zerossl"
56525
56696
  ]);
56697
+ var hostingEnvironmentModeEnumSchema = _enum(["live", "test"]);
56526
56698
  var hostingVolumeEnumSchema = _enum([
56527
56699
  "application-files",
56528
56700
  "database-data",
@@ -56531,6 +56703,7 @@ var hostingVolumeEnumSchema = _enum([
56531
56703
  var hostingWorkloadServerModeEnumSchema = _enum(["shared", "dedicated"]).describe("Whether a workload's database server is shared with the rest of its engine, or bought for it alone. An environment runs ONE server per engine, and every database of that engine binds to it. That is the purchase's shape: one server's memory and CPU serve every application on the engine. A second same-engine server splits that purchase between two Pods that each must still clear the engine's own floor — measured on Home 2026-10-19, where such a split left an engine 512Mi and it was OOM-killed on every boot. A second server is therefore a **client capability request** and never a side effect of declaring a workload. `DEDICATED` is that request: the workload pays its own floor out of the environment's budget, and the reconciler binds the databases to it by name rather than by engine. `SHARED` is every workload that did not ask. This is a named mode rather than a boolean because the same field may grow a third value (for example a replica-bearing server) without reinterpreting two call sites.\n| |\n|---|\n| `shared` <br/> The environment's existing server for this engine serves this workload's databases. |\n| `dedicated` <br/> The client asked for a server of this engine for this workload alone. |");
56532
56704
  var createHostingEnvironmentRequestSchema = object({
56533
56705
  certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
56706
+ mode: hostingEnvironmentModeEnumSchema.optional(),
56534
56707
  storageSelections: array(object({
56535
56708
  volumeType: hostingVolumeEnumSchema,
56536
56709
  storageClassUuid: uuid().optional(),
@@ -58050,6 +58223,22 @@ var hostingApplicationImportDetectionDataSchema = object({
58050
58223
  sourceUrl: string().nullable(),
58051
58224
  prefixSource: string()
58052
58225
  });
58226
+ var hostingApplicationImportReplacedDataSchema = object({
58227
+ importUuid: string(),
58228
+ stagedAt: string().nullable(),
58229
+ consumedAt: string().nullable(),
58230
+ fileCount: int().nullable(),
58231
+ databaseBytes: int().nullable(),
58232
+ sourceUrl: string().nullable()
58233
+ });
58234
+ var hostingApplicationImportFetchDataSchema = object({
58235
+ connectionUuid: string().nullable(),
58236
+ sourcePath: string().nullable(),
58237
+ databaseConnectionUuid: string().nullable(),
58238
+ archiveUrl: string().nullable(),
58239
+ replaces: union([hostingApplicationImportReplacedDataSchema, _null()]),
58240
+ jobAppliedAt: string().nullable()
58241
+ });
58053
58242
  object({
58054
58243
  uuid: string(),
58055
58244
  status: string(),
@@ -58066,7 +58255,8 @@ object({
58066
58255
  consumedAt: string().nullable(),
58067
58256
  stagedAt: string().nullable(),
58068
58257
  failedAt: string().nullable(),
58069
- failureReason: string().nullable()
58258
+ failureReason: string().nullable(),
58259
+ fetch: union([hostingApplicationImportFetchDataSchema, _null()])
58070
58260
  });
58071
58261
  var hostingApplicationSummaryDataSchema = object({
58072
58262
  uuid: string(),
@@ -58127,6 +58317,10 @@ var hostingWordpressUrlRepairDataSchema = object({
58127
58317
  refreshNonce: string().nullable(),
58128
58318
  omissions: array(string())
58129
58319
  });
58320
+ var hostingRecoveryVerifiedSummaryDataSchema = object({
58321
+ tables: int(),
58322
+ rows: int()
58323
+ });
58130
58324
  var hostingApplicationRecoveryDataSchema = object({
58131
58325
  uuid: string(),
58132
58326
  workloadUuid: string(),
@@ -58171,7 +58365,8 @@ var hostingApplicationRecoveryDataSchema = object({
58171
58365
  releasedAt: string().nullable(),
58172
58366
  cancelledAt: string().nullable(),
58173
58367
  completedAt: string().nullable(),
58174
- urlRepair: union([hostingWordpressUrlRepairDataSchema, _null()])
58368
+ urlRepair: union([hostingWordpressUrlRepairDataSchema, _null()]),
58369
+ verified: union([hostingRecoveryVerifiedSummaryDataSchema, _null()])
58175
58370
  });
58176
58371
  var hostingRecoveryCurrentDataDataSchema = object({
58177
58372
  removePlugins: array(string()),
@@ -58224,7 +58419,9 @@ var hostingRestoreIntakeRequestDataSchema = object({
58224
58419
  toolsLimitMib: int(),
58225
58420
  activeRestores: int(),
58226
58421
  importUuid: string().nullable(),
58227
- currentDataInnoDb: union([hostingRecoveryCurrentDataDataSchema, _null()])
58422
+ currentDataInnoDb: union([hostingRecoveryCurrentDataDataSchema, _null()]),
58423
+ databaseExportUuid: string().nullable(),
58424
+ expectedTables: int().nullable()
58228
58425
  });
58229
58426
  var hostingRestoreCheckOutcomeEnumSchema = _enum([
58230
58427
  "ok",
@@ -58255,7 +58452,7 @@ var hostingRestoreIntakeDataSchema = object({
58255
58452
  checks: array(hostingRestoreIntakeCheckDataSchema),
58256
58453
  phases: array(hostingRestoreIntakePhaseDataSchema)
58257
58454
  });
58258
- object({
58455
+ var hostingApplicationRecoveryReviewDataSchema = object({
58259
58456
  environmentUuid: string(),
58260
58457
  workloadUuid: string(),
58261
58458
  label: string(),
@@ -59101,6 +59298,7 @@ object({
59101
59298
  workloadUuid: string(),
59102
59299
  audience: string()
59103
59300
  });
59301
+ var hostingDataHandoverEnumSchema = _enum(["test_copy_is_current", "refreshed_from_source"]).describe("How the client says a tested copy relates to the site it was copied from, when it is made live (Plan 146). Going live is a configuration and traffic change, never a fresh restore over newer data, so the platform cannot know whether the original took orders, comments or sign-ups while the copy was tested. The client states it.\n| |\n|---|\n| `test_copy_is_current` <br/> The test copy holds everything that should go live; nothing the original took since the copy is needed. |\n| `refreshed_from_source` <br/> The original was restored into this test environment again, after writes stopped, just before going live. |");
59104
59302
  object({
59105
59303
  databaseUuid: string(),
59106
59304
  workloadUuid: string().nullable().describe("The workload this identity belongs to, so a page can address one application's."),
@@ -59316,6 +59514,27 @@ var hostingDatabaseGrantDataSchema = object({
59316
59514
  workloadUuid: string(),
59317
59515
  application: string()
59318
59516
  });
59517
+ object({
59518
+ exportUuid: string(),
59519
+ applicationUuid: string(),
59520
+ applicationName: string(),
59521
+ sourceEngine: string(),
59522
+ sourceVersion: string(),
59523
+ destinationEngine: string(),
59524
+ destinationVersion: string(),
59525
+ engineMatches: boolean(),
59526
+ sourceBytes: int(),
59527
+ backupBytes: int(),
59528
+ quotaBytes: int().nullable(),
59529
+ fitsQuota: boolean(),
59530
+ databaseName: string().nullable(),
59531
+ tables: array(string()),
59532
+ tableCount: int(),
59533
+ tablesTruncated: boolean(),
59534
+ replaces: string(),
59535
+ blockedReason: string().nullable(),
59536
+ recovery: hostingApplicationRecoveryReviewDataSchema
59537
+ });
59319
59538
  var hostingDatabaseInputDataSchema = object({
59320
59539
  application: string().nullable(),
59321
59540
  server: string(),
@@ -59737,6 +59956,18 @@ var hostingToolSelectionDataSchema = object({
59737
59956
  available: boolean(),
59738
59957
  unavailableReason: string().nullable()
59739
59958
  });
59959
+ var hostingEnvironmentProtectionDataSchema = object({
59960
+ mode: hostingEnvironmentModeEnumSchema,
59961
+ state: _enum([
59962
+ "live",
59963
+ "applying",
59964
+ "protected"
59965
+ ]).describe("Whether a test environment's protection is in force (Plan 146). Computed from the environment's mode and its reconciled generations, never stored: `applying` is a test environment whose protection has been recorded but not yet observed ready, and nothing may be restored into it until it reads `protected`.\n").describe("Whether a test environment's protection is in force (Plan 146). Computed from the environment's mode and its reconciled generations, never stored: `applying` is a test environment whose protection has been recorded but not yet observed ready, and nothing may be restored into it until it reads `protected`.\n"),
59966
+ modeGeneration: int().describe("The desired generation that recorded the current mode; protection is observed once it reaches ready."),
59967
+ mailToolUrl: string().nullable().describe("The captured-mail tool's address on a test environment, null on a live one."),
59968
+ previewSignInRequired: boolean().describe("Whether a visitor must sign in before the preview serves; no-index alone is not access control."),
59969
+ limitations: array(string())
59970
+ });
59740
59971
  var hostingEnvironmentDataSchema = object({
59741
59972
  uuid: string(),
59742
59973
  slug: string(),
@@ -59766,6 +59997,7 @@ var hostingEnvironmentDataSchema = object({
59766
59997
  canRestoreTuning: boolean().describe("Whether the live runtime tuning differs from the tuning that last reached ready, so a failed\ntuning change can be rolled back. Computed by the tuning owner from the recorded snapshot."),
59767
59998
  knownGoodTuningGeneration: int().nullable().describe("The generation the known-good tuning was observed at, or null when none is recorded."),
59768
59999
  toolSelection: array(hostingToolSelectionDataSchema).describe("Every browser tool with the client's own on/off state, including the ones switched off."),
60000
+ protection: hostingEnvironmentProtectionDataSchema,
59769
60001
  purchasePeriod: union([hostingPurchasePeriodDataSchema, _null()]),
59770
60002
  allocationSummary: union([hostingAllocationSummaryDataSchema, _null()])
59771
60003
  });
@@ -59789,6 +60021,21 @@ object({
59789
60021
  entries: array(hostingEnvironmentLogEntryDataSchema),
59790
60022
  detail: string()
59791
60023
  });
60024
+ var hostingEnvironmentModeChangeDataSchema = object({
60025
+ area: string(),
60026
+ before: string(),
60027
+ after: string()
60028
+ });
60029
+ object({
60030
+ currentMode: hostingEnvironmentModeEnumSchema,
60031
+ targetMode: hostingEnvironmentModeEnumSchema,
60032
+ desiredGeneration: int(),
60033
+ blockedReason: string().nullable().describe("Null when the change may be confirmed now; otherwise why it may not."),
60034
+ dataHandoverRequired: boolean().describe("Whether the confirmation must state how the tested data relates to the original site."),
60035
+ changes: array(hostingEnvironmentModeChangeDataSchema),
60036
+ addresses: array(string()),
60037
+ warnings: array(string())
60038
+ });
59792
60039
  var hostingEnvironmentPackageWorkloadDataSchema = object({
59793
60040
  type: string(),
59794
60041
  name: string(),
@@ -59816,7 +60063,8 @@ object({
59816
60063
  cluster: hostingClusterDataSchema,
59817
60064
  desiredGeneration: int(),
59818
60065
  budget: hostingBudgetDataSchema,
59819
- createdAt: string().nullable()
60066
+ createdAt: string().nullable(),
60067
+ mode: hostingEnvironmentModeEnumSchema
59820
60068
  })),
59821
60069
  meta: pageMetaDataSchema
59822
60070
  });
@@ -63042,6 +63290,12 @@ var storeHostingStorageObjectGrantRequestSchema = object({
63042
63290
  key: string().max(1024).regex(/^[^\x00-\x1F\x7F]+$/),
63043
63291
  direction: _enum(["download", "upload"])
63044
63292
  }).describe("Asking for one short-lived signed URL for one object.\n\nThe direction decides the verb: a download signs a GET and an upload signs a PUT, so a browser or the CLI\ncan move the bytes itself. The key is the client's own path inside their bucket and is validated as a key,\nnot as a filesystem path — control characters are refused because they would break signing and logging.");
63293
+ var storeHostingWordpressImportFetchRequestSchema = object({
63294
+ connectionUuid: uuid().nullish(),
63295
+ sourcePath: string().max(1024).nullish(),
63296
+ archiveUrl: string().max(2048).nullish(),
63297
+ databaseConnectionUuid: uuid().nullish()
63298
+ }).describe("Where to fetch a WordPress site from: exactly one of a saved file connection or an HTTPS archive URL, plus the\ndatabase connection. Whether each connection is this company's, checked and of the right kind is the fetch\nowner's refusal, so the shape is all this states.");
63045
63299
  var storeNativeHostingStorageBucketRequestSchema = object({
63046
63300
  name: string().min(1).max(64).regex(/^[\pL\pN][\pL\pN ._-]*$/).describe("The client's own label, so they can tell two purchases apart."),
63047
63301
  purchaseKey: uuid().nullish().describe("There is no token to replay, so the caller's own key is what makes a retry return the bucket it already\ncreated instead of buying a second one."),
@@ -63073,6 +63327,7 @@ var storePlatformCompanyRequestSchema = object({
63073
63327
  }).describe("Create a client company for a named founding Company Admin.\n\nThe admin must already hold a verified account: staff create the account for\nthe client, and a company whose only administrator cannot sign in is a\nsupport ticket rather than a client. Validating it here means the failure is a\nfield error on the screen that caused it, not a half-made company.");
63074
63328
  var storePlatformHostingEnvironmentRequestSchema = object({
63075
63329
  certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
63330
+ mode: hostingEnvironmentModeEnumSchema.optional(),
63076
63331
  storageSelections: array(object({
63077
63332
  volumeType: hostingVolumeEnumSchema,
63078
63333
  storageClassUuid: uuid().optional(),
@@ -63329,6 +63584,11 @@ var updateHostingComponentSettingsRequestSchema = object({
63329
63584
  }).optional().describe("Only these four keys: a typo inside `auth` would otherwise be dropped and reported as saved.\nEach one is OPTIONAL and carries only what the caller changes: sending the values back unchanged would\nundo a concurrent change another operator made, which is why the merge happens server-side under the\nworkload's lock rather than in the client.")
63330
63585
  }).describe("The settings one curated component instance should compose.\n\nA FormRequest rather than a bare array because that is what the generated contract can describe, and\nbecause the shape is part of the contract: a list of schema names or four typed auth values, not a\nsettings blob a client could fill with keys no composition reads. Which of the two a component owns, and\nwhether each schema name or OTP number is usable, is decided by the service that records them.\n\nA component serves schemas OR carries auth settings, never both, so naming both is refused here: the\nalternative is one write succeeding while the other is silently dropped.");
63331
63586
  var updateHostingComponentVersionRequestSchema = object({ version: string().max(64).describe("Which versions this platform pins an image for is decided by the service, from the version catalogue, and\nrefused there by name. This only says the field must be a non-empty string.") }).describe("The version one curated component instance should run.\n\nA FormRequest rather than a bare array because that is what the generated contract can describe: a Spatie Data\nargument was accepted by the action but never appeared as a `requestBody`, so the published client had no body to send\nand the CLI could not call the endpoint at all. The rules live here so the documented contract and the accepted input\nare the same thing.");
63587
+ var updateHostingEnvironmentModeRequestSchema = object({
63588
+ mode: hostingEnvironmentModeEnumSchema,
63589
+ desiredGeneration: int().min(1),
63590
+ dataHandover: union([hostingDataHandoverEnumSchema, _null()]).optional()
63591
+ }).describe("Making a test environment live, or returning a live one to test protection (Plan 146).\n\n`desiredGeneration` is the generation the client reviewed: a change since then refuses the confirmation, so the\nclient reviews again. Going live also needs the stated data handover.");
63332
63592
  var updateHostingEnvironmentRequestSchema = object({
63333
63593
  certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
63334
63594
  desiredGeneration: int().min(1),
@@ -66221,6 +66481,32 @@ object({
66221
66481
  environmentUuid: string(),
66222
66482
  exportUuid: string()
66223
66483
  });
66484
+ union([
66485
+ object({ message: string().describe("Error overview.") }),
66486
+ object({ message: string().describe("Error overview.") }),
66487
+ messageDataSchema,
66488
+ validationErrorDataSchema
66489
+ ]);
66490
+ object({
66491
+ company: string(),
66492
+ environmentUuid: string(),
66493
+ exportUuid: string(),
66494
+ workloadUuid: string()
66495
+ });
66496
+ union([
66497
+ object({ message: string().describe("Error overview.") }),
66498
+ object({ message: string().describe("Error overview.") }),
66499
+ messageDataSchema,
66500
+ messageDataSchema,
66501
+ validationErrorDataSchema
66502
+ ]);
66503
+ confirmHostingDatabaseImportRequestSchema.describe("Confirming a reviewed database import: the `recovery.inventoryDigest` and `recovery.desiredGeneration` the review\nreturned. Everything about the backup itself is the platform's own record, so nothing else is accepted.");
66504
+ object({
66505
+ company: string(),
66506
+ environmentUuid: string(),
66507
+ exportUuid: string(),
66508
+ workloadUuid: string()
66509
+ });
66224
66510
  union([
66225
66511
  object({ message: string().describe("Error overview.") }),
66226
66512
  object({ message: string().describe("Error overview.") }),
@@ -66475,6 +66761,31 @@ object({
66475
66761
  company: string(),
66476
66762
  environmentUuid: string()
66477
66763
  });
66764
+ string().describe("The mode to review a change to: `live` or `test`.");
66765
+ union([
66766
+ object({ message: string().describe("Error overview.") }),
66767
+ object({ message: string().describe("Error overview.") }),
66768
+ object({
66769
+ message: string().describe("Errors overview."),
66770
+ errors: record$4(string(), array(string())).describe("A detailed description of each field that failed validation.")
66771
+ })
66772
+ ]);
66773
+ object({
66774
+ company: string(),
66775
+ environmentUuid: string()
66776
+ });
66777
+ object({ mode: string().describe("The mode to review a change to: `live` or `test`.") });
66778
+ union([
66779
+ object({ message: string().describe("Error overview.") }),
66780
+ object({ message: string().describe("Error overview.") }),
66781
+ messageDataSchema,
66782
+ messageDataSchema
66783
+ ]);
66784
+ updateHostingEnvironmentModeRequestSchema.describe("Making a test environment live, or returning a live one to test protection (Plan 146).\n\n`desiredGeneration` is the generation the client reviewed: a change since then refuses the confirmation, so the\nclient reviews again. Going live also needs the stated data handover.");
66785
+ object({
66786
+ company: string(),
66787
+ environmentUuid: string()
66788
+ });
66478
66789
  union([
66479
66790
  object({ message: string().describe("Error overview.") }),
66480
66791
  object({ message: string().describe("Error overview.") }),
@@ -68427,6 +68738,29 @@ object({
68427
68738
  environmentUuid: string(),
68428
68739
  workloadUuid: string()
68429
68740
  });
68741
+ union([
68742
+ object({ message: string().describe("Error overview.") }),
68743
+ object({ message: string().describe("Error overview.") }),
68744
+ messageDataSchema,
68745
+ validationErrorDataSchema
68746
+ ]);
68747
+ storeHostingWordpressImportFetchRequestSchema.optional().describe("Where to fetch a WordPress site from: exactly one of a saved file connection or an HTTPS archive URL, plus the\ndatabase connection. Whether each connection is this company's, checked and of the right kind is the fetch\nowner's refusal, so the shape is all this states.");
68748
+ object({
68749
+ company: string(),
68750
+ environmentUuid: string(),
68751
+ workloadUuid: string()
68752
+ });
68753
+ union([
68754
+ object({ message: string().describe("Error overview.") }),
68755
+ object({ message: string().describe("Error overview.") }),
68756
+ messageDataSchema,
68757
+ validationErrorDataSchema
68758
+ ]);
68759
+ object({
68760
+ company: string(),
68761
+ environmentUuid: string(),
68762
+ workloadUuid: string()
68763
+ });
68430
68764
  var hostingWordpressUrlRepairPreviewStatus200Schema = hostingApplicationRecoveryDataSchema;
68431
68765
  var hostingWordpressUrlRepairPreviewStatus201Schema = hostingApplicationRecoveryDataSchema;
68432
68766
  var hostingWordpressUrlRepairPreviewStatus401Schema = object({ message: string().describe("Error overview.") });
@@ -71467,7 +71801,7 @@ function episode(rest) {
71467
71801
  };
71468
71802
  }
71469
71803
  // src/commands/company-assets.ts
71470
- var USAGE$44 = [
71804
+ var USAGE$45 = [
71471
71805
  "Usage: hostingctl company logo|favicon set --image-file <path> --company <slug>",
71472
71806
  " hostingctl company logo|favicon remove --company <slug>",
71473
71807
  "",
@@ -71482,17 +71816,17 @@ var USAGE$44 = [
71482
71816
  */
71483
71817
  async function companyAssets(context, asset, rest) {
71484
71818
  const [action, ...tail] = rest;
71485
- if (tail.length > 0) throw new UsageError(USAGE$44);
71819
+ if (tail.length > 0) throw new UsageError(USAGE$45);
71486
71820
  const company = await requireCompany(context.flags);
71487
- if (action === "set") return await set$1(context, asset, company);
71821
+ if (action === "set") return await set$2(context, asset, company);
71488
71822
  if (action === "remove") return await remove$4(context, asset, company);
71489
- throw new UsageError(USAGE$44);
71823
+ throw new UsageError(USAGE$45);
71490
71824
  }
71491
71825
  /** `set --image-file …`: one multipart upload of the asset. */
71492
- async function set$1(context, asset, company) {
71826
+ async function set$2(context, asset, company) {
71493
71827
  const file = context.flags.get("--image-file") ?? "";
71494
71828
  return await confirmableWrite(context, file === "" ? `Set ${company}'s ${asset}.` : `Set ${company}'s ${asset} to ${file}.`, async () => {
71495
- const body = await imageUpload(file, USAGE$44);
71829
+ const body = await imageUpload(file, USAGE$45);
71496
71830
  return asset === "logo" ? (await companyAssetStoreLogo({
71497
71831
  path: { company },
71498
71832
  body
@@ -71528,7 +71862,7 @@ function companyRole(raw, usage) {
71528
71862
  return named;
71529
71863
  }
71530
71864
  // src/commands/company-invitations.ts
71531
- var USAGE$43 = [
71865
+ var USAGE$44 = [
71532
71866
  "Usage: hostingctl company invitations --company <slug>",
71533
71867
  " hostingctl company invite --company <slug> --email <email> --name <name> --role <admin|member>",
71534
71868
  " hostingctl company cancel-invitation <invitation-uuid> --company <slug>",
@@ -71552,7 +71886,7 @@ var MAX_INVITATION_TOKEN_BYTES = 4096;
71552
71886
  */
71553
71887
  async function companyInvitations(context, subcommand, rest) {
71554
71888
  if (subcommand === "invitations") {
71555
- if (rest.length > 0) throw new UsageError(USAGE$43);
71889
+ if (rest.length > 0) throw new UsageError(USAGE$44);
71556
71890
  const company = await requireCompany(context.flags);
71557
71891
  return {
71558
71892
  kind: "invitations",
@@ -71563,20 +71897,20 @@ async function companyInvitations(context, subcommand, rest) {
71563
71897
  if (subcommand === "invite") return await invite(context, rest);
71564
71898
  if (subcommand === "cancel-invitation") return await cancel$1(context, rest);
71565
71899
  if (subcommand === "invitation-preview") return (await companyInvitationPreview({
71566
- path: { invitationUuid: oneUuid$7(rest, USAGE$43) },
71567
- body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$43) }
71900
+ path: { invitationUuid: oneUuid$7(rest, USAGE$44) },
71901
+ body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$44) }
71568
71902
  })).data;
71569
71903
  if (subcommand === "invitation-accept") return await accept(context, rest);
71570
- throw new UsageError(USAGE$43);
71904
+ throw new UsageError(USAGE$44);
71571
71905
  }
71572
71906
  /** `invite --email … --name … --role …`. */
71573
71907
  async function invite(context, rest) {
71574
- if (rest.length > 0) throw new UsageError(USAGE$43);
71908
+ if (rest.length > 0) throw new UsageError(USAGE$44);
71575
71909
  const company = await requireCompany(context.flags);
71576
71910
  const email = context.flags.get("--email")?.trim() ?? "";
71577
71911
  const name = context.flags.get("--name")?.trim() ?? "";
71578
- const role = companyRole(context.flags.get("--role"), USAGE$43);
71579
- if (email === "" || name === "") throw new UsageError(`invite needs --email and --name.\n\n${USAGE$43}`);
71912
+ const role = companyRole(context.flags.get("--role"), USAGE$44);
71913
+ if (email === "" || name === "") throw new UsageError(`invite needs --email and --name.\n\n${USAGE$44}`);
71580
71914
  return await confirmableWrite(context, `Invite ${name} <${email}> into ${company} as ${role}.`, async () => (await companyInvitationStore({
71581
71915
  path: { company },
71582
71916
  body: {
@@ -71588,7 +71922,7 @@ async function invite(context, rest) {
71588
71922
  }
71589
71923
  /** `cancel-invitation <uuid> --company …`. */
71590
71924
  async function cancel$1(context, rest) {
71591
- const invitationUuid = oneUuid$7(rest, USAGE$43);
71925
+ const invitationUuid = oneUuid$7(rest, USAGE$44);
71592
71926
  const company = await requireCompany(context.flags);
71593
71927
  return await confirmableWrite(context, `Cancel invitation ${invitationUuid}.`, async () => {
71594
71928
  return (await companyInvitationDestroy({ path: {
@@ -71599,11 +71933,11 @@ async function cancel$1(context, rest) {
71599
71933
  }
71600
71934
  /** `invitation-accept <uuid>`: join the company the invitation names. */
71601
71935
  async function accept(context, rest) {
71602
- const invitationUuid = oneUuid$7(rest, USAGE$43);
71936
+ const invitationUuid = oneUuid$7(rest, USAGE$44);
71603
71937
  return await confirmableWrite(context, `Accept invitation ${invitationUuid}.`, async () => {
71604
71938
  return (await companyInvitationAccept({
71605
71939
  path: { invitationUuid },
71606
- body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$43) }
71940
+ body: { token: readSecret(context, "token", MAX_INVITATION_TOKEN_BYTES, USAGE$44) }
71607
71941
  })).data;
71608
71942
  });
71609
71943
  }
@@ -71722,31 +72056,31 @@ var COMPANY_TOPICS = [
71722
72056
  },
71723
72057
  {
71724
72058
  path: ["logo"],
71725
- usage: USAGE$44
72059
+ usage: USAGE$45
71726
72060
  },
71727
72061
  {
71728
72062
  path: ["favicon"],
71729
- usage: USAGE$44
72063
+ usage: USAGE$45
71730
72064
  },
71731
72065
  {
71732
72066
  path: ["invitations"],
71733
- usage: USAGE$43
72067
+ usage: USAGE$44
71734
72068
  },
71735
72069
  {
71736
72070
  path: ["invite"],
71737
- usage: USAGE$43
72071
+ usage: USAGE$44
71738
72072
  },
71739
72073
  {
71740
72074
  path: ["cancel-invitation"],
71741
- usage: USAGE$43
72075
+ usage: USAGE$44
71742
72076
  },
71743
72077
  {
71744
72078
  path: ["invitation-preview"],
71745
- usage: USAGE$43
72079
+ usage: USAGE$44
71746
72080
  },
71747
72081
  {
71748
72082
  path: ["invitation-accept"],
71749
- usage: USAGE$43
72083
+ usage: USAGE$44
71750
72084
  }
71751
72085
  ];
71752
72086
  // src/commands/company-text.ts
@@ -74280,7 +74614,7 @@ var diagnostics = {
74280
74614
  }
74281
74615
  };
74282
74616
  // src/commands/dns-records.ts
74283
- var USAGE$42 = [
74617
+ var USAGE$43 = [
74284
74618
  "Usage: hostingctl dns enable <domain-uuid> --company <slug>",
74285
74619
  " hostingctl dns record set <domain-uuid> --company <slug> --file <set.json>",
74286
74620
  " hostingctl dns record remove <domain-uuid> --company <slug> --name <relative> --type <type>",
@@ -74319,7 +74653,7 @@ async function dnsWrites(context, subcommand, rest) {
74319
74653
  if (subcommand === "record") return await record$3(context, rest);
74320
74654
  if (subcommand === "dnssec") return await changeDnssec(context, rest);
74321
74655
  if (subcommand === "handover") return await handover(context, rest);
74322
- throw new UsageError(USAGE$42);
74656
+ throw new UsageError(USAGE$43);
74323
74657
  }
74324
74658
  /** The zone's current desired generation, which every write must name. */
74325
74659
  async function generation(company, domainUuid) {
@@ -74330,7 +74664,7 @@ async function generation(company, domainUuid) {
74330
74664
  }
74331
74665
  /** `dns enable <uuid>`: take the zone over into managed DNS. */
74332
74666
  async function enable(context, rest) {
74333
- const domainUuid = oneUuid$7(rest, USAGE$42);
74667
+ const domainUuid = oneUuid$7(rest, USAGE$43);
74334
74668
  const company = await requireCompany(context.flags);
74335
74669
  return await confirmableWrite(context, "Publish this name's zone in managed DNS.", async () => (await domainsDnsStore({ path: {
74336
74670
  company,
@@ -74340,16 +74674,16 @@ async function enable(context, rest) {
74340
74674
  /** `dns record set|remove`. */
74341
74675
  async function record$3(context, rest) {
74342
74676
  const [action, ...tail] = rest;
74343
- const domainUuid = oneUuid$7(tail, USAGE$42);
74677
+ const domainUuid = oneUuid$7(tail, USAGE$43);
74344
74678
  const company = await requireCompany(context.flags);
74345
74679
  if (action === "set") return await setRecord(context, company, domainUuid);
74346
74680
  if (action === "remove") return await removeRecord(context, company, domainUuid);
74347
- throw new UsageError(USAGE$42);
74681
+ throw new UsageError(USAGE$43);
74348
74682
  }
74349
74683
  /** `record set --file`: replace one set with the file's own values. */
74350
74684
  async function setRecord(context, company, domainUuid) {
74351
74685
  const file = context.flags.get("--file") ?? "";
74352
- if (file === "") throw new UsageError(`record set needs --file <set.json>.\n\n${USAGE$42}`);
74686
+ if (file === "") throw new UsageError(`record set needs --file <set.json>.\n\n${USAGE$43}`);
74353
74687
  const set = recordSetFromFile(file);
74354
74688
  return await confirmableWrite(context, [`Replace the ${set.recordType.toUpperCase()} set "${set.relativeName}" (ttl ${String(set.ttlSeconds)}) with:`, ...set.values.map((one) => ` ${one}`)].join("\n"), async () => {
74355
74689
  const body = {
@@ -74369,7 +74703,7 @@ async function setRecord(context, company, domainUuid) {
74369
74703
  async function removeRecord(context, company, domainUuid) {
74370
74704
  const relativeName = context.flags.get("--name") ?? "";
74371
74705
  const recordType = recordTypeFlag(context);
74372
- if (relativeName === "") throw new UsageError(`record remove needs --name.\n\n${USAGE$42}`);
74706
+ if (relativeName === "") throw new UsageError(`record remove needs --name.\n\n${USAGE$43}`);
74373
74707
  return await confirmableWrite(context, `Remove the ${recordType.toUpperCase()} set "${relativeName}".`, async () => {
74374
74708
  const query = {
74375
74709
  relativeName,
@@ -74388,8 +74722,8 @@ async function removeRecord(context, company, domainUuid) {
74388
74722
  /** `dns dnssec <signed|unsigned> <uuid>`: the signing mode, with the confirmation the API requires. */
74389
74723
  async function changeDnssec(context, rest) {
74390
74724
  const [mode, uuid, ...extra] = rest;
74391
- if (mode === void 0 || mode !== "signed" && mode !== "unsigned" || extra.length > 0) throw new UsageError(USAGE$42);
74392
- const domainUuid = oneUuid$7(uuid === void 0 ? [] : [uuid], USAGE$42);
74725
+ if (mode === void 0 || mode !== "signed" && mode !== "unsigned" || extra.length > 0) throw new UsageError(USAGE$43);
74726
+ const domainUuid = oneUuid$7(uuid === void 0 ? [] : [uuid], USAGE$43);
74393
74727
  const company = await requireCompany(context.flags);
74394
74728
  return await confirmableWrite(context, [`Set the zone's signing mode to ${mode}.`, ...mode === "signed" ? [" DNSSEC signing is added; resolvers that fail validation will not answer until DS records match."] : [" DNSSEC signing is removed; the DS record in the parent zone has to be removed too."]].join("\n"), async () => {
74395
74729
  const body = {
@@ -74408,7 +74742,7 @@ async function changeDnssec(context, rest) {
74408
74742
  }
74409
74743
  /** `dns handover <uuid>`: hand the zone back, dropping what this platform publishes. */
74410
74744
  async function handover(context, rest) {
74411
- const domainUuid = oneUuid$7(rest, USAGE$42);
74745
+ const domainUuid = oneUuid$7(rest, USAGE$43);
74412
74746
  const company = await requireCompany(context.flags);
74413
74747
  return await confirmableWrite(context, ["Hand this name's zone back out of managed DNS.", " Address records published here stop being published; the name and its applications stay."].join("\n"), async () => {
74414
74748
  const body = {
@@ -74427,7 +74761,7 @@ async function handover(context, rest) {
74427
74761
  /** A record type flag, refused when it is not one of the API's own values. */
74428
74762
  function recordTypeFlag(context) {
74429
74763
  const raw = (context.flags.get("--type") ?? "").trim().toLowerCase();
74430
- if (!RECORD_TYPES.has(raw)) throw new UsageError(`--type must be one of ${[...RECORD_TYPES].join(", ")} (got "${raw}").\n\n${USAGE$42}`);
74764
+ if (!RECORD_TYPES.has(raw)) throw new UsageError(`--type must be one of ${[...RECORD_TYPES].join(", ")} (got "${raw}").\n\n${USAGE$43}`);
74431
74765
  return raw;
74432
74766
  }
74433
74767
  /**
@@ -74460,7 +74794,7 @@ function recordSetFromValue(value, subject) {
74460
74794
  };
74461
74795
  }
74462
74796
  // src/commands/dns-templates.ts
74463
- var USAGE$41 = [
74797
+ var USAGE$42 = [
74464
74798
  "Usage: hostingctl dns template list --company <slug>",
74465
74799
  " hostingctl dns template show <template-uuid> --company <slug>",
74466
74800
  " hostingctl dns template save [<template-uuid>] --company <slug> --file <template.json>",
@@ -74482,24 +74816,24 @@ var USAGE$41 = [
74482
74816
  async function dnsTemplates(context, rest) {
74483
74817
  const [action, ...tail] = rest;
74484
74818
  if (action === "list") {
74485
- if (tail.length > 0) throw new UsageError(USAGE$41);
74819
+ if (tail.length > 0) throw new UsageError(USAGE$42);
74486
74820
  return {
74487
74821
  kind: "templates",
74488
74822
  templates: (await dnsTemplatesIndex({ path: { company: await requireCompany(context.flags) } })).data.templates
74489
74823
  };
74490
74824
  }
74491
- if (action === "show") return await show$5(context, oneUuid$7(tail, USAGE$41));
74825
+ if (action === "show") return await show$5(context, oneUuid$7(tail, USAGE$42));
74492
74826
  if (action === "save") return await save$1(context, tail[0]);
74493
- if (action === "delete") return await destroy$1(context, oneUuid$7(tail, USAGE$41));
74494
- if (action === "from-zone") return await fromZone(context, oneUuid$7(tail, USAGE$41));
74827
+ if (action === "delete") return await destroy$1(context, oneUuid$7(tail, USAGE$42));
74828
+ if (action === "from-zone") return await fromZone(context, oneUuid$7(tail, USAGE$42));
74495
74829
  if (action === "preview") return await preview$2(context, tail);
74496
74830
  if (action === "apply") return await apply(context, tail);
74497
- throw new UsageError(USAGE$41);
74831
+ throw new UsageError(USAGE$42);
74498
74832
  }
74499
74833
  /** Two uuids: the template, then the zone it applies to. */
74500
74834
  function templateAndZone(rest) {
74501
74835
  const [templateUuid, domainUuid, ...extra] = rest;
74502
- if (templateUuid === void 0 || templateUuid === "" || domainUuid === void 0 || domainUuid === "" || extra.length > 0) throw new UsageError(USAGE$41);
74836
+ if (templateUuid === void 0 || templateUuid === "" || domainUuid === void 0 || domainUuid === "" || extra.length > 0) throw new UsageError(USAGE$42);
74503
74837
  return {
74504
74838
  templateUuid,
74505
74839
  domainUuid
@@ -74518,7 +74852,7 @@ async function show$5(context, templateUuid) {
74518
74852
  /** `save [<uuid>] --file …`: record a new template, or replace the one named. */
74519
74853
  async function save$1(context, templateUuid) {
74520
74854
  const file = context.flags.get("--file") ?? "";
74521
- if (file === "") throw new UsageError(`template save needs --file <template.json>.\n\n${USAGE$41}`);
74855
+ if (file === "") throw new UsageError(`template save needs --file <template.json>.\n\n${USAGE$42}`);
74522
74856
  const company = await requireCompany(context.flags);
74523
74857
  const document = readJsonObject(file, "template");
74524
74858
  const name = typeof document.name === "string" ? document.name.trim() : "";
@@ -74554,7 +74888,7 @@ async function destroy$1(context, templateUuid) {
74554
74888
  async function fromZone(context, domainUuid) {
74555
74889
  const company = await requireCompany(context.flags);
74556
74890
  const name = context.flags.get("--name")?.trim() ?? "";
74557
- if (name === "") throw new UsageError(`template from-zone needs --name.\n\n${USAGE$41}`);
74891
+ if (name === "") throw new UsageError(`template from-zone needs --name.\n\n${USAGE$42}`);
74558
74892
  const zone = (await domainsDnsShow({ path: {
74559
74893
  company,
74560
74894
  domainUuid
@@ -74623,7 +74957,7 @@ function recordSetsFromFile$1(document, subject) {
74623
74957
  });
74624
74958
  }
74625
74959
  // src/commands/dns-text.ts
74626
- var USAGE$40 = [
74960
+ var USAGE$41 = [
74627
74961
  "Usage: hostingctl dns <zone|export> <domain-uuid> --company <slug>",
74628
74962
  " hostingctl dns import <preview|apply> <domain-uuid> --company <slug> --file <path> [--confirm]",
74629
74963
  " hostingctl dns enable <domain-uuid> --company <slug>",
@@ -74693,7 +75027,7 @@ function applyText(result) {
74693
75027
  var DNS_METADATA = {
74694
75028
  name: "dns",
74695
75029
  summary: "A managed name's zone, its zone-file export, and the reviewed import write.",
74696
- usage: USAGE$40,
75030
+ usage: USAGE$41,
74697
75031
  flags: [
74698
75032
  {
74699
75033
  name: "--file",
@@ -74731,23 +75065,23 @@ var DNS_METADATA = {
74731
75065
  var DNS_TOPICS = [
74732
75066
  {
74733
75067
  path: ["enable"],
74734
- usage: USAGE$42
75068
+ usage: USAGE$43
74735
75069
  },
74736
75070
  {
74737
75071
  path: ["record"],
74738
- usage: USAGE$42
75072
+ usage: USAGE$43
74739
75073
  },
74740
75074
  {
74741
75075
  path: ["dnssec"],
74742
- usage: USAGE$42
75076
+ usage: USAGE$43
74743
75077
  },
74744
75078
  {
74745
75079
  path: ["handover"],
74746
- usage: USAGE$42
75080
+ usage: USAGE$43
74747
75081
  },
74748
75082
  {
74749
75083
  path: ["template"],
74750
- usage: USAGE$41
75084
+ usage: USAGE$42
74751
75085
  }
74752
75086
  ];
74753
75087
  // src/commands/dns-import.ts
@@ -74764,7 +75098,7 @@ var IMPORT_LINE = /^(\S+)\s+(\d+)\s+(\S+)\s+(.+)$/;
74764
75098
  * hold customer DNS data, so its contents are never printed; only the API's own answer is shown.
74765
75099
  */
74766
75100
  function recordSetsFromFile(file) {
74767
- if (file === void 0 || file === "") throw new UsageError(`Importing needs the record sets from disk: pass --file <path>.\n\n${USAGE$40}`);
75101
+ if (file === void 0 || file === "") throw new UsageError(`Importing needs the record sets from disk: pass --file <path>.\n\n${USAGE$41}`);
74768
75102
  const sets = /* @__PURE__ */ new Map();
74769
75103
  for (const [index, raw] of readBoundedImportFile(file, "import").split("\n").entries()) addLine(sets, raw.trim(), index + 1);
74770
75104
  if (sets.size === 0) throw new UsageError(`The import file [${file}] holds no record sets.`);
@@ -74856,7 +75190,7 @@ var dns = {
74856
75190
  if (subcommand === "import") return await importRecords(context, rest);
74857
75191
  if (subcommand === "template") return await dnsTemplates(context, rest);
74858
75192
  if (WRITE_SUBCOMMANDS$1.has(subcommand ?? "")) return await dnsWrites(context, subcommand ?? "", rest);
74859
- throw new UsageError(USAGE$40);
75193
+ throw new UsageError(USAGE$41);
74860
75194
  },
74861
75195
  human(report) {
74862
75196
  if ("sent" in report) return renderWriteOutcome(report, dnsWriteText);
@@ -74875,7 +75209,7 @@ async function readZone(context, rest, which) {
74875
75209
  /** `import preview|apply <uuid> --file <path>`: the review, or the reviewed write. */
74876
75210
  async function importRecords(context, rest) {
74877
75211
  const [action, ...tail] = rest;
74878
- if (action !== "preview" && action !== "apply") throw new UsageError(USAGE$40);
75212
+ if (action !== "preview" && action !== "apply") throw new UsageError(USAGE$41);
74879
75213
  const path = await domainPath$1(context, tail);
74880
75214
  const recordSets = recordSetsFromFile(context.flags.get("--file"));
74881
75215
  if (action === "preview") return (await domainsDnsImportPreview({
@@ -74912,7 +75246,7 @@ async function applyImport(context, path, recordSets) {
74912
75246
  /** The company and the one domain uuid a DNS subcommand needs, or a usage refusal. */
74913
75247
  async function domainPath$1(context, rest) {
74914
75248
  const [domainUuid, ...extra] = rest;
74915
- if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
75249
+ if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$41);
74916
75250
  return {
74917
75251
  company: await requireCompany(context.flags),
74918
75252
  domainUuid
@@ -75078,7 +75412,7 @@ function checkText(check) {
75078
75412
  }
75079
75413
  // src/commands/email-alias.ts
75080
75414
  /** The one usage string this group refuses with, owned by the group it belongs to. */
75081
- var USAGE$39 = [
75415
+ var USAGE$40 = [
75082
75416
  "Usage: hostingctl email alias add <email-domain-uuid> --company <slug> --local <name> --destinations a@x,b@y",
75083
75417
  " hostingctl email alias set <email-domain-uuid> <alias-uuid> --company <slug> --destinations a@x,b@y",
75084
75418
  " hostingctl email alias remove <email-domain-uuid> <alias-uuid> --company <slug>",
@@ -75102,16 +75436,16 @@ async function aliasGroup(context, action, tail) {
75102
75436
  if (action === "set") return await aliasSet(context, tail);
75103
75437
  if (action === "remove") return await aliasRemove(context, tail);
75104
75438
  if (action === "unroute") return await aliasUnroute(context, tail);
75105
- throw new UsageError(USAGE$39);
75439
+ throw new UsageError(USAGE$40);
75106
75440
  }
75107
75441
  /** `alias add <domain> --local … --destinations …`: a new forwarding address. */
75108
75442
  async function aliasAdd(context, tail) {
75109
75443
  const [emailDomainUuid, ...extra] = tail;
75110
- if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
75444
+ if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
75111
75445
  const company = await requireCompany(context.flags);
75112
75446
  const localPart = context.flags.get("--local")?.trim().toLowerCase() ?? "";
75113
75447
  const list = destinations$1(context);
75114
- if (localPart === "" || list.length === 0) throw new UsageError(`alias add needs --local and --destinations.\n\n${USAGE$39}`);
75448
+ if (localPart === "" || list.length === 0) throw new UsageError(`alias add needs --local and --destinations.\n\n${USAGE$40}`);
75115
75449
  return await confirmableWrite(context, [`Create ${localPart}@… forwarding to:`, ...list.map((one) => ` ${one}`)].join("\n"), async () => {
75116
75450
  return (await emailAliasesStore({
75117
75451
  path: {
@@ -75128,10 +75462,10 @@ async function aliasAdd(context, tail) {
75128
75462
  /** `alias set <domain> <alias> --destinations …`: replace the complete recipient list. */
75129
75463
  async function aliasSet(context, tail) {
75130
75464
  const [emailDomainUuid, aliasUuid, ...extra] = tail;
75131
- if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
75465
+ if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
75132
75466
  const company = await requireCompany(context.flags);
75133
75467
  const list = destinations$1(context);
75134
- if (list.length === 0) throw new UsageError(`alias set needs --destinations.\n\n${USAGE$39}`);
75468
+ if (list.length === 0) throw new UsageError(`alias set needs --destinations.\n\n${USAGE$40}`);
75135
75469
  return await confirmableWrite(context, [`Replace ${aliasUuid}'s destinations with:`, ...list.map((one) => ` ${one}`)].join("\n"), async () => {
75136
75470
  return (await emailAliasesUpdate({
75137
75471
  path: {
@@ -75146,7 +75480,7 @@ async function aliasSet(context, tail) {
75146
75480
  /** `alias remove <domain> <alias>`. */
75147
75481
  async function aliasRemove(context, tail) {
75148
75482
  const [emailDomainUuid, aliasUuid, ...extra] = tail;
75149
- if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
75483
+ if (emailDomainUuid === void 0 || aliasUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
75150
75484
  const company = await requireCompany(context.flags);
75151
75485
  return await confirmableWrite(context, `Remove alias ${aliasUuid}.`, async () => {
75152
75486
  return (await emailAliasesDestroy({ path: {
@@ -75159,7 +75493,7 @@ async function aliasRemove(context, tail) {
75159
75493
  /** `alias unroute <domain> <alias> <mailbox>`: drop one destination. */
75160
75494
  async function aliasUnroute(context, tail) {
75161
75495
  const [emailDomainUuid, aliasUuid, mailboxUuid, ...extra] = tail;
75162
- if (emailDomainUuid === void 0 || aliasUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
75496
+ if (emailDomainUuid === void 0 || aliasUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
75163
75497
  const company = await requireCompany(context.flags);
75164
75498
  return await confirmableWrite(context, `Stop forwarding ${aliasUuid} to mailbox ${mailboxUuid}.`, async () => {
75165
75499
  return (await emailAliasesDestinationsDestroy({ path: {
@@ -75171,7 +75505,7 @@ async function aliasUnroute(context, tail) {
75171
75505
  });
75172
75506
  }
75173
75507
  // src/commands/email-address.ts
75174
- var USAGE$38 = [
75508
+ var USAGE$39 = [
75175
75509
  "Usage: hostingctl email alias add <email-domain-uuid> --company <slug> --local <name> --destinations a@x,b@y",
75176
75510
  " hostingctl email alias set <email-domain-uuid> <alias-uuid> --company <slug> --destinations a@x,b@y",
75177
75511
  " hostingctl email alias remove <email-domain-uuid> <alias-uuid> --company <slug>",
@@ -75197,13 +75531,13 @@ async function emailAddresses(context, subcommand, rest) {
75197
75531
  if (subcommand === "alias") return await aliasGroup(context, action, tail);
75198
75532
  if (subcommand === "app-token") return await appToken(context, action, tail);
75199
75533
  if (subcommand === "send-as") return await sendAs(context, action, tail);
75200
- throw new UsageError(USAGE$38);
75534
+ throw new UsageError(USAGE$39);
75201
75535
  }
75202
75536
  /** `app-token list|issue|revoke|deliver`. */
75203
75537
  async function appToken(context, action, tail) {
75204
75538
  const company = await requireCompany(context.flags);
75205
75539
  const [emailDomainUuid, mailboxUuid, third, ...extra] = tail;
75206
- if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$38);
75540
+ if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
75207
75541
  const path = {
75208
75542
  company,
75209
75543
  emailDomainUuid,
@@ -75231,7 +75565,7 @@ async function appToken(context, action, tail) {
75231
75565
  }
75232
75566
  if (action === "issue" && third === void 0) {
75233
75567
  const label = context.flags.get("--label")?.trim() ?? "";
75234
- if (label === "") throw new UsageError(`app-token issue needs --label.\n\n${USAGE$38}`);
75568
+ if (label === "") throw new UsageError(`app-token issue needs --label.\n\n${USAGE$39}`);
75235
75569
  return await confirmableWrite(context, `Create an application password labelled "${label}".`, async () => {
75236
75570
  return (await emailAppTokensStore({
75237
75571
  path,
@@ -75239,7 +75573,7 @@ async function appToken(context, action, tail) {
75239
75573
  })).data;
75240
75574
  });
75241
75575
  }
75242
- if (third === void 0) throw new UsageError(USAGE$38);
75576
+ if (third === void 0) throw new UsageError(USAGE$39);
75243
75577
  const tokenPath = {
75244
75578
  ...path,
75245
75579
  tokenUuid: third
@@ -75248,14 +75582,14 @@ async function appToken(context, action, tail) {
75248
75582
  return (await emailAppTokensRevoke({ path: tokenPath })).data;
75249
75583
  });
75250
75584
  if (action === "deliver") return await confirmableWrite(context, [`Return application password ${third} once.`, " The value is printed here and not stored: it cannot be read again after this."].join("\n"), async () => (await emailAppTokensDeliver({ path: tokenPath })).data);
75251
- throw new UsageError(USAGE$38);
75585
+ throw new UsageError(USAGE$39);
75252
75586
  }
75253
75587
  /** `send-as list|grant|revoke`. */
75254
75588
  async function sendAs(context, action, tail) {
75255
75589
  const company = await requireCompany(context.flags);
75256
75590
  if (action === "revoke") {
75257
75591
  const [grantUuid, ...extra] = tail;
75258
- if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$38);
75592
+ if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
75259
75593
  return await confirmableWrite(context, `Revoke send-as grant ${grantUuid}.`, async () => {
75260
75594
  return (await emailSendAsGrantsDestroy({ path: {
75261
75595
  company,
@@ -75264,7 +75598,7 @@ async function sendAs(context, action, tail) {
75264
75598
  });
75265
75599
  }
75266
75600
  const [emailDomainUuid, mailboxUuid, ...extra] = tail;
75267
- if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$38);
75601
+ if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
75268
75602
  const path = {
75269
75603
  company,
75270
75604
  emailDomainUuid,
@@ -75291,7 +75625,7 @@ async function sendAs(context, action, tail) {
75291
75625
  }
75292
75626
  if (action === "grant") {
75293
75627
  const grantedAddressUuid = context.flags.get("--address") ?? "";
75294
- if (grantedAddressUuid === "") throw new UsageError(`send-as grant needs --address.\n\n${USAGE$38}`);
75628
+ if (grantedAddressUuid === "") throw new UsageError(`send-as grant needs --address.\n\n${USAGE$39}`);
75295
75629
  return await confirmableWrite(context, `Allow this mailbox to send as address ${grantedAddressUuid}.`, async () => {
75296
75630
  return (await emailSendAsGrantsStore({
75297
75631
  path,
@@ -75299,7 +75633,7 @@ async function sendAs(context, action, tail) {
75299
75633
  })).data;
75300
75634
  });
75301
75635
  }
75302
- throw new UsageError(USAGE$38);
75636
+ throw new UsageError(USAGE$39);
75303
75637
  }
75304
75638
  // src/commands/email-write-text.ts
75305
75639
  /**
@@ -75365,7 +75699,7 @@ function emailAddressText(report) {
75365
75699
  return "Done.";
75366
75700
  }
75367
75701
  // src/commands/email-domain.ts
75368
- var USAGE$37 = [
75702
+ var USAGE$38 = [
75369
75703
  "Usage: hostingctl email offer",
75370
75704
  " hostingctl email enroll --company <slug>",
75371
75705
  " hostingctl email agree --company <slug> --term <package-term-uuid>",
@@ -75386,7 +75720,7 @@ var USAGE$37 = [
75386
75720
  /** `email offer|agree|provision|domain|catch-all`, dispatched from the `email` command. */
75387
75721
  async function emailDomains(context, subcommand, rest) {
75388
75722
  if (subcommand === "offer") {
75389
- if (rest.length > 0) throw new UsageError(USAGE$37);
75723
+ if (rest.length > 0) throw new UsageError(USAGE$38);
75390
75724
  return {
75391
75725
  kind: "offers",
75392
75726
  offers: (await emailOffers({ path: { company: await requireCompany(context.flags) } })).data
@@ -75397,11 +75731,11 @@ async function emailDomains(context, subcommand, rest) {
75397
75731
  if (subcommand === "provision") return await provision(context, rest);
75398
75732
  if (subcommand === "domain") return await domain(context, rest);
75399
75733
  if (subcommand === "catch-all") return await catchAll(context, rest);
75400
- throw new UsageError(USAGE$37);
75734
+ throw new UsageError(USAGE$38);
75401
75735
  }
75402
75736
  /** A company-wide command takes no positionals. */
75403
75737
  function noExtra$14(rest) {
75404
- if (rest.length > 0) throw new UsageError(USAGE$37);
75738
+ if (rest.length > 0) throw new UsageError(USAGE$38);
75405
75739
  }
75406
75740
  /** `enroll`: create the service record and start provisioning, which is the API's own create. */
75407
75741
  async function enroll(context, rest) {
@@ -75414,7 +75748,7 @@ async function agree(context, rest) {
75414
75748
  noExtra$14(rest);
75415
75749
  const company = await requireCompany(context.flags);
75416
75750
  const packageTermUuid = context.flags.get("--term") ?? "";
75417
- if (packageTermUuid === "") throw new UsageError(`agree needs --term.\n\n${USAGE$37}`);
75751
+ if (packageTermUuid === "") throw new UsageError(`agree needs --term.\n\n${USAGE$38}`);
75418
75752
  return await confirmableWrite(context, `Accept email package term ${packageTermUuid} for ${company}.`, async () => (await emailAgreement({
75419
75753
  path: { company },
75420
75754
  body: { packageTermUuid }
@@ -75433,7 +75767,7 @@ async function domain(context, rest) {
75433
75767
  if (action === "add") {
75434
75768
  noExtra$14(tail);
75435
75769
  const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
75436
- if (hostname === "") throw new UsageError(`domain add needs --hostname.\n\n${USAGE$37}`);
75770
+ if (hostname === "") throw new UsageError(`domain add needs --hostname.\n\n${USAGE$38}`);
75437
75771
  return await confirmableWrite(context, `Attach ${hostname} to ${company}'s mail service.`, async () => {
75438
75772
  return (await emailDomainsStore({
75439
75773
  path: { company },
@@ -75443,7 +75777,7 @@ async function domain(context, rest) {
75443
75777
  }
75444
75778
  const path = {
75445
75779
  company,
75446
- emailDomainUuid: oneUuid$7(tail, USAGE$37)
75780
+ emailDomainUuid: oneUuid$7(tail, USAGE$38)
75447
75781
  };
75448
75782
  if (action === "recheck") return await confirmableWrite(context, "Re-observe this name's DNS now.", async () => {
75449
75783
  return (await emailDomainsRecheck({ path })).data;
@@ -75463,14 +75797,14 @@ async function domain(context, rest) {
75463
75797
  body
75464
75798
  })).data;
75465
75799
  });
75466
- throw new UsageError(USAGE$37);
75800
+ throw new UsageError(USAGE$38);
75467
75801
  }
75468
75802
  /** `catch-all show|set|clear`. */
75469
75803
  async function catchAll(context, rest) {
75470
75804
  const [action, ...tail] = rest;
75471
75805
  const path = {
75472
75806
  company: await requireCompany(context.flags),
75473
- emailDomainUuid: oneUuid$7(tail, USAGE$37)
75807
+ emailDomainUuid: oneUuid$7(tail, USAGE$38)
75474
75808
  };
75475
75809
  if (action === "show") return {
75476
75810
  kind: "catch-all",
@@ -75478,7 +75812,7 @@ async function catchAll(context, rest) {
75478
75812
  };
75479
75813
  if (action === "set") {
75480
75814
  const destinations = destinationList(context);
75481
- if (destinations.length === 0) throw new UsageError(`catch-all set needs --destinations a@x,b@y.\n\n${USAGE$37}`);
75815
+ if (destinations.length === 0) throw new UsageError(`catch-all set needs --destinations a@x,b@y.\n\n${USAGE$38}`);
75482
75816
  return await confirmableWrite(context, [`Enable the catch-all for this name, forwarding to:`, ...destinations.map((one) => ` ${one}`)].join("\n"), async () => {
75483
75817
  return (await emailCatchAllUpdate({
75484
75818
  path,
@@ -75490,7 +75824,7 @@ async function catchAll(context, rest) {
75490
75824
  });
75491
75825
  }
75492
75826
  if (action === "clear") return await confirmableWrite(context, "Disable the catch-all: mail to an unknown address at this name is refused rather than forwarded.", async () => (await emailCatchAllDestroy({ path })).data);
75493
- throw new UsageError(USAGE$37);
75827
+ throw new UsageError(USAGE$38);
75494
75828
  }
75495
75829
  /**
75496
75830
  * The comma-separated `--destinations`.
@@ -75521,7 +75855,7 @@ function catchAllText(one) {
75521
75855
  return ` the catch-all forwards to ${one.destinations.join(", ") || "nobody"}`;
75522
75856
  }
75523
75857
  // src/commands/email-holds.ts
75524
- var USAGE$36 = [
75858
+ var USAGE$37 = [
75525
75859
  "Usage: hostingctl email hold list --company <slug>",
75526
75860
  " hostingctl email hold create --company <slug> --reason <compromise|abuse|operator> [--mailbox <uuid>]",
75527
75861
  " hostingctl email hold release <hold-uuid> --company <slug>",
@@ -75544,21 +75878,21 @@ async function emailHolds(context, rest) {
75544
75878
  const [action, ...tail] = rest;
75545
75879
  const company = await requireCompany(context.flags);
75546
75880
  if (action === "list") {
75547
- if (tail.length > 0) throw new UsageError(USAGE$36);
75881
+ if (tail.length > 0) throw new UsageError(USAGE$37);
75548
75882
  return {
75549
75883
  kind: "holds",
75550
75884
  holds: (await emailHoldsIndex({ path: { company } })).data.holds
75551
75885
  };
75552
75886
  }
75553
75887
  if (action === "create") return await create$3(context, tail, company);
75554
- if (action === "release") return await release$1(context, oneUuid$7(tail, USAGE$36), company);
75555
- throw new UsageError(USAGE$36);
75888
+ if (action === "release") return await release$1(context, oneUuid$7(tail, USAGE$37), company);
75889
+ throw new UsageError(USAGE$37);
75556
75890
  }
75557
75891
  /** `create --reason … [--mailbox …]`. */
75558
75892
  async function create$3(context, tail, company) {
75559
- if (tail.length > 0) throw new UsageError(USAGE$36);
75893
+ if (tail.length > 0) throw new UsageError(USAGE$37);
75560
75894
  const raw = context.flags.get("--reason")?.trim() ?? "";
75561
- if (!REASONS.has(raw)) throw new UsageError(`--reason must be compromise, abuse or operator (got "${raw}").\n\n${USAGE$36}`);
75895
+ if (!REASONS.has(raw)) throw new UsageError(`--reason must be compromise, abuse or operator (got "${raw}").\n\n${USAGE$37}`);
75562
75896
  const mailboxUuid = context.flags.get("--mailbox")?.trim() ?? "";
75563
75897
  return await confirmableWrite(context, [`Hold outbound mail for ${mailboxUuid === "" ? "the whole service" : `mailbox ${mailboxUuid}`} because: ${raw}.`, " Nothing is sent until this hold is released."].join("\n"), async () => {
75564
75898
  return (await emailHoldsStore({
@@ -75593,7 +75927,7 @@ function emailHoldText(report) {
75593
75927
  return report.holds.length === 0 ? "No sending holds." : report.holds.map(holdLine).join("\n");
75594
75928
  }
75595
75929
  // src/commands/email-mailbox-admin.ts
75596
- var USAGE$35 = [
75930
+ var USAGE$36 = [
75597
75931
  "Usage: hostingctl email mailbox add <email-domain-uuid> --company <slug> --local <name> --quota <gb-5|gb-10|gb-20>",
75598
75932
  " hostingctl email mailbox change <email-domain-uuid> <mailbox-uuid> --company <slug> [--status enabled|suspended] [--quota <size>]",
75599
75933
  " hostingctl email mailbox remove <email-domain-uuid> <mailbox-uuid> --company <slug>",
@@ -75625,7 +75959,7 @@ var STATUSES = /* @__PURE__ */ new Set(["enabled", "suspended"]);
75625
75959
  async function emailMailboxAdmin(context, action, tail) {
75626
75960
  if (action === "add") return await add$8(context, tail);
75627
75961
  const [emailDomainUuid, mailboxUuid, ...extra] = tail;
75628
- if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$35);
75962
+ if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$36);
75629
75963
  const path = {
75630
75964
  company: await requireCompany(context.flags),
75631
75965
  emailDomainUuid,
@@ -75643,7 +75977,7 @@ async function emailMailboxAdmin(context, action, tail) {
75643
75977
  if (action === "preferences-set") return await preferences(context, path);
75644
75978
  if (action === "credential") return await revealCredential(context, path, false);
75645
75979
  if (action === "reset-credential") return await revealCredential(context, path, true);
75646
- throw new UsageError(USAGE$35);
75980
+ throw new UsageError(USAGE$36);
75647
75981
  }
75648
75982
  /** A quota flag from the API's own values. */
75649
75983
  function quota(context) {
@@ -75659,11 +75993,11 @@ function destinations(context) {
75659
75993
  /** `add <domain> --local … --quota …`. */
75660
75994
  async function add$8(context, tail) {
75661
75995
  const [emailDomainUuid, ...extra] = tail;
75662
- if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$35);
75996
+ if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$36);
75663
75997
  const company = await requireCompany(context.flags);
75664
75998
  const localPart = context.flags.get("--local")?.trim().toLowerCase() ?? "";
75665
75999
  const size = quota(context);
75666
- if (localPart === "" || size === null) throw new UsageError(`mailbox add needs --local and --quota.\n\n${USAGE$35}`);
76000
+ if (localPart === "" || size === null) throw new UsageError(`mailbox add needs --local and --quota.\n\n${USAGE$36}`);
75667
76001
  return await confirmableWrite(context, `Create mailbox ${localPart}@… with a ${size} quota.`, async () => {
75668
76002
  return (await emailMailboxesStore({
75669
76003
  path: {
@@ -75688,7 +76022,7 @@ function statusFlag(context) {
75688
76022
  async function change$1(context, path) {
75689
76023
  const status = statusFlag(context);
75690
76024
  const size = quota(context);
75691
- if (status === null && size === null) throw new UsageError(`mailbox change needs --status, --quota or both.\n\n${USAGE$35}`);
76025
+ if (status === null && size === null) throw new UsageError(`mailbox change needs --status, --quota or both.\n\n${USAGE$36}`);
75692
76026
  return await confirmableWrite(context, `Set this mailbox's ${[status === null ? null : `status to ${status}`, size === null ? null : `quota to ${size}`].filter((one) => one !== null).join(" and ")}.`, async () => {
75693
76027
  return (await emailMailboxesUpdate({
75694
76028
  path,
@@ -75716,7 +76050,7 @@ async function preferences(context, path) {
75716
76050
  const markRead = onOff$4(context, "--spam-mark-read");
75717
76051
  const threshold = context.flags.get("--spam-threshold");
75718
76052
  const summary = context.flags.get("--vacation-subject");
75719
- 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$35}`);
76053
+ if (vacation === null && markRead === null && threshold === void 0 && summary === void 0) throw new UsageError(`preferences-set needs --vacation, --spam-threshold, --spam-mark-read or --vacation-subject.\n\n${USAGE$36}`);
75720
76054
  const body = {
75721
76055
  vacationEnabled: vacation ?? current.vacationEnabled,
75722
76056
  vacationSubject: context.flags.get("--vacation-subject") ?? current.vacationSubject,
@@ -75770,7 +76104,7 @@ function emailMailboxAdminText(report) {
75770
76104
  return preferencesText(report.preferences);
75771
76105
  }
75772
76106
  // src/commands/email-service.ts
75773
- var USAGE$34 = [
76107
+ var USAGE$35 = [
75774
76108
  "Usage: hostingctl email service <suspend|resume> --company <slug>",
75775
76109
  " hostingctl email service cancellation --company <slug>",
75776
76110
  " hostingctl email service cancel --company <slug> --ends-at <iso-date>",
@@ -75797,11 +76131,11 @@ async function emailService(context, subcommand, rest) {
75797
76131
  if (subcommand === "dmarc-set") return await dmarcSet$1(context, rest);
75798
76132
  if (subcommand === "blocklist-set") return await blocklistSet(context, rest);
75799
76133
  if (subcommand === "service") return await service(context, rest);
75800
- throw new UsageError(USAGE$34);
76134
+ throw new UsageError(USAGE$35);
75801
76135
  }
75802
76136
  /** A company-wide command takes no positionals. */
75803
76137
  function noExtra$13(rest) {
75804
- if (rest.length > 0) throw new UsageError(USAGE$34);
76138
+ if (rest.length > 0) throw new UsageError(USAGE$35);
75805
76139
  }
75806
76140
  /** `service suspend|resume|cancellation|cancel|cancel-withdraw`. */
75807
76141
  async function service(context, rest) {
@@ -75827,7 +76161,7 @@ async function service(context, rest) {
75827
76161
  if (action === "cancel") {
75828
76162
  noExtra$13(tail);
75829
76163
  const endsAt = context.flags.get("--ends-at")?.trim() ?? "";
75830
- if (endsAt === "") throw new UsageError(`service cancel needs --ends-at.\n\n${USAGE$34}`);
76164
+ if (endsAt === "") throw new UsageError(`service cancel needs --ends-at.\n\n${USAGE$35}`);
75831
76165
  if (Number.isNaN(Date.parse(endsAt))) throw new UsageError(`--ends-at must be an ISO date (got "${endsAt}").`);
75832
76166
  return await confirmableWrite(context, [`End the mail service at ${endsAt}.`, " Mail keeps working until then; the cancellation can be withdrawn before that date."].join("\n"), async () => (await emailCancellationStore({
75833
76167
  path: { company },
@@ -75840,7 +76174,7 @@ async function service(context, rest) {
75840
76174
  return (await emailCancellationWithdraw({ path: { company } })).data;
75841
76175
  });
75842
76176
  }
75843
- throw new UsageError(USAGE$34);
76177
+ throw new UsageError(USAGE$35);
75844
76178
  }
75845
76179
  /** `dmarc`: DMARC reporting for every attached name. */
75846
76180
  async function dmarc$1(context, rest) {
@@ -75860,7 +76194,7 @@ async function blocklist$1(context, rest) {
75860
76194
  }
75861
76195
  /** `dmarc-set <name> --enabled on|off`. */
75862
76196
  async function dmarcSet$1(context, rest) {
75863
- const emailDomainUuid = oneUuid$7(rest, USAGE$34);
76197
+ const emailDomainUuid = oneUuid$7(rest, USAGE$35);
75864
76198
  const company = await requireCompany(context.flags);
75865
76199
  const enabled = onOff$3(context);
75866
76200
  return await confirmableWrite(context, `${enabled ? "Enable" : "Disable"} DMARC reporting for this name.`, async () => {
@@ -75875,7 +76209,7 @@ async function dmarcSet$1(context, rest) {
75875
76209
  }
75876
76210
  /** `blocklist-set <name> --enabled on|off`. */
75877
76211
  async function blocklistSet(context, rest) {
75878
- const emailDomainUuid = oneUuid$7(rest, USAGE$34);
76212
+ const emailDomainUuid = oneUuid$7(rest, USAGE$35);
75879
76213
  const company = await requireCompany(context.flags);
75880
76214
  const enabled = onOff$3(context);
75881
76215
  return await confirmableWrite(context, `${enabled ? "Enable" : "Disable"} blocklist monitoring for this name.`, async () => {
@@ -75892,7 +76226,7 @@ async function blocklistSet(context, rest) {
75892
76226
  async function importSchema(context, rest) {
75893
76227
  noExtra$13(rest);
75894
76228
  const version = context.flags.get("--version")?.trim() ?? "";
75895
- if (version === "") throw new UsageError(`import-schema needs --version.\n\n${USAGE$34}`);
76229
+ if (version === "") throw new UsageError(`import-schema needs --version.\n\n${USAGE$35}`);
75896
76230
  return {
75897
76231
  kind: "schema",
75898
76232
  version,
@@ -75904,7 +76238,7 @@ function onOff$3(context) {
75904
76238
  const raw = context.flags.get("--enabled")?.trim() ?? "";
75905
76239
  if (raw === "on" || raw === "true") return true;
75906
76240
  if (raw === "off" || raw === "false") return false;
75907
- throw new UsageError(`--enabled must be on or off (got "${raw}").\n\n${USAGE$34}`);
76241
+ throw new UsageError(`--enabled must be on or off (got "${raw}").\n\n${USAGE$35}`);
75908
76242
  }
75909
76243
  /** The `email service|dmarc|blocklist|import-schema` renderer. */
75910
76244
  function emailServiceText(report) {
@@ -75916,7 +76250,7 @@ function emailServiceText(report) {
75916
76250
  }
75917
76251
  // src/commands/email-sync-csv.ts
75918
76252
  /** The usage this group refuses with, owned by the command it belongs to. */
75919
- var USAGE$33 = [
76253
+ var USAGE$34 = [
75920
76254
  "Usage: hostingctl email sync csv <preview|commit> <email-domain-uuid> --company <slug> --file <path>",
75921
76255
  "",
75922
76256
  " preview What the file's rows would become. Writes nothing.",
@@ -75927,7 +76261,7 @@ var USAGE$33 = [
75927
76261
  /** One named uuid, or a usage refusal. */
75928
76262
  function one$2(rest) {
75929
76263
  const [uuid, ...extra] = rest;
75930
- if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$33);
76264
+ if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$34);
75931
76265
  return uuid;
75932
76266
  }
75933
76267
  /** `csv preview|commit <domain> --file <path>`: one multipart upload of the CSV itself. */
@@ -75935,7 +76269,7 @@ async function csv(context, tail) {
75935
76269
  const [action, ...args] = tail;
75936
76270
  const path = await domainPath(context, one$2(args));
75937
76271
  const file = context.flags.get("--file") ?? "";
75938
- if (file === "") throw new UsageError(`sync csv needs --file <path>.\n\n${USAGE$33}`);
76272
+ if (file === "") throw new UsageError(`sync csv needs --file <path>.\n\n${USAGE$34}`);
75939
76273
  if (action === "preview") return {
75940
76274
  kind: "csv-preview",
75941
76275
  rows: (await emailMailboxSyncCsvPreview({
@@ -75943,10 +76277,10 @@ async function csv(context, tail) {
75943
76277
  body: await csvPreviewBody(file)
75944
76278
  })).data.rows
75945
76279
  };
75946
- if (action !== "commit") throw new UsageError(USAGE$33);
76280
+ if (action !== "commit") throw new UsageError(USAGE$34);
75947
76281
  const recurrence = recurrenceFlag(context) ?? "once";
75948
76282
  const endsAt = context.flags.get("--ends-at")?.trim() || null;
75949
- if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$33}`);
76283
+ if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$34}`);
75950
76284
  return await confirmableWrite(context, [`Commit the sync accounts in ${file}, once the API has reviewed it.`, ` The review is re-read here and only its accepted rows are committed: ${recurrence}${endsAt === null ? "" : ` until ${endsAt}`}.`].join("\n"), async () => {
75951
76285
  const accepted = (await emailMailboxSyncCsvPreview({
75952
76286
  path,
@@ -75994,7 +76328,7 @@ async function csvCommitBody(file, accepted, recurrence, endsAt) {
75994
76328
  return form;
75995
76329
  }
75996
76330
  // src/commands/email-sync.ts
75997
- var USAGE$32 = [
76331
+ var USAGE$33 = [
75998
76332
  "Usage: hostingctl email sync show <email-domain-uuid> --company <slug>",
75999
76333
  " hostingctl email sync server <email-domain-uuid> --company <slug> --host <host> --port <n> --encryption <tls|starttls>",
76000
76334
  " hostingctl email sync account add <email-domain-uuid> --company <slug> --username <login> (--password-file <path>|--password-stdin) --mailbox <uuid> --recurrence <once|until> [--ends-at <iso>]",
@@ -76019,12 +76353,12 @@ async function emailSync(context, rest) {
76019
76353
  if (action === "server") return await server(context, tail);
76020
76354
  if (action === "account") return await account(context, tail);
76021
76355
  if (action === "csv") return await csv(context, tail);
76022
- throw new UsageError(USAGE$32);
76356
+ throw new UsageError(USAGE$33);
76023
76357
  }
76024
76358
  /** One named uuid, or a usage refusal. */
76025
76359
  function one$1(rest) {
76026
76360
  const [uuid, ...extra] = rest;
76027
- if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$32);
76361
+ if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$33);
76028
76362
  return uuid;
76029
76363
  }
76030
76364
  /** `show`: the server and every account. */
@@ -76040,9 +76374,9 @@ async function server(context, tail) {
76040
76374
  const host = context.flags.get("--host")?.trim() ?? "";
76041
76375
  const port = Number(context.flags.get("--port") ?? "");
76042
76376
  const encryption = context.flags.get("--encryption")?.trim() ?? "";
76043
- if (host === "") throw new UsageError(`sync server needs --host.\n\n${USAGE$32}`);
76044
- if (!Number.isInteger(port) || port < 1 || port > 65535) throw new UsageError(`--port must be a whole number between 1 and 65535.\n\n${USAGE$32}`);
76045
- if (!ENCRYPTIONS.has(encryption)) throw new UsageError(`--encryption must be tls or starttls (got "${encryption}").\n\n${USAGE$32}`);
76377
+ if (host === "") throw new UsageError(`sync server needs --host.\n\n${USAGE$33}`);
76378
+ if (!Number.isInteger(port) || port < 1 || port > 65535) throw new UsageError(`--port must be a whole number between 1 and 65535.\n\n${USAGE$33}`);
76379
+ if (!ENCRYPTIONS.has(encryption)) throw new UsageError(`--encryption must be tls or starttls (got "${encryption}").\n\n${USAGE$33}`);
76046
76380
  return await confirmableWrite(context, `Point the mailbox sync source at ${host}:${String(port)} over ${encryption}.`, async () => {
76047
76381
  return (await emailMailboxSyncServerUpdate({
76048
76382
  path,
@@ -76066,9 +76400,9 @@ async function account(context, tail) {
76066
76400
  const [action, ...args] = tail;
76067
76401
  if (action === "add") return await accountAdd(context, args);
76068
76402
  if (action === "change") return await accountChange(context, args);
76069
- if (action === void 0) throw new UsageError(USAGE$32);
76403
+ if (action === void 0) throw new UsageError(USAGE$33);
76070
76404
  const [emailDomainUuid, accountUuid, ...extra] = args;
76071
- if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$32);
76405
+ if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$33);
76072
76406
  return await accountAction(context, action, {
76073
76407
  ...await domainPath(context, emailDomainUuid),
76074
76408
  accountUuid
@@ -76087,13 +76421,13 @@ async function accountAction(context, action, path) {
76087
76421
  if (action === "start") return await startAccount(context, path);
76088
76422
  if (action === "stop") return await confirmableWrite(context, "Stop this account's scheduled sync. The source credential is kept.", async () => (await emailMailboxSyncAccountsStop({ path })).data);
76089
76423
  if (action === "forget") return await confirmableWrite(context, "Forget this account's source credential and stop future work.", async () => (await emailMailboxSyncAccountsForget({ path })).data);
76090
- throw new UsageError(USAGE$32);
76424
+ throw new UsageError(USAGE$33);
76091
76425
  }
76092
76426
  /** `start`: the schedule the account should run on from now. */
76093
76427
  async function startAccount(context, path) {
76094
76428
  const recurrence = recurrenceFlag(context) ?? "once";
76095
76429
  const endsAt = context.flags.get("--ends-at")?.trim() || null;
76096
- if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$32}`);
76430
+ if (recurrence === "until" && endsAt === null) throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$33}`);
76097
76431
  return await confirmableWrite(context, `Start this account's scheduled sync (${recurrence}${endsAt === null ? "" : ` until ${endsAt}`}).`, async () => (await emailMailboxSyncAccountsStart({
76098
76432
  path,
76099
76433
  body: {
@@ -76106,7 +76440,7 @@ async function startAccount(context, path) {
76106
76440
  async function accountAdd(context, args) {
76107
76441
  const path = await domainPath(context, one$1(args));
76108
76442
  const body = accountBody(context);
76109
- const sourcePassword = readSecret(context, "password", 4096, USAGE$32);
76443
+ const sourcePassword = readSecret(context, "password", 4096, USAGE$33);
76110
76444
  return await confirmableWrite(context, [`Add a sync account for ${body.sourceUsername} into mailbox ${body.mailboxUuid}.`, ` It runs ${body.recurrence === "once" ? "once" : `until ${String(body.endsAt)}`}.`].join("\n"), async () => (await emailMailboxSyncAccountsStore({
76111
76445
  path,
76112
76446
  body: {
@@ -76118,7 +76452,7 @@ async function accountAdd(context, args) {
76118
76452
  /** `account change <domain> <account> [fields]`: only the fields named are sent. */
76119
76453
  async function accountChange(context, args) {
76120
76454
  const [emailDomainUuid, accountUuid, ...extra] = args;
76121
- if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$32);
76455
+ if (emailDomainUuid === void 0 || accountUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$33);
76122
76456
  const path = {
76123
76457
  ...await domainPath(context, emailDomainUuid),
76124
76458
  accountUuid
@@ -76132,8 +76466,8 @@ async function accountChange(context, args) {
76132
76466
  if (mailbox !== "") body.mailboxUuid = mailbox;
76133
76467
  if (recurrence !== null) body.recurrence = recurrence;
76134
76468
  if (endsAt !== "") body.endsAt = endsAt;
76135
- if (context.flags.has("--password-file") || context.flags.has("--password-stdin")) body.sourcePassword = readSecret(context, "password", 4096, USAGE$32);
76136
- if (Object.keys(body).length === 0) throw new UsageError(`account change needs at least one field.\n\n${USAGE$32}`);
76469
+ if (context.flags.has("--password-file") || context.flags.has("--password-stdin")) body.sourcePassword = readSecret(context, "password", 4096, USAGE$33);
76470
+ if (Object.keys(body).length === 0) throw new UsageError(`account change needs at least one field.\n\n${USAGE$33}`);
76137
76471
  return await confirmableWrite(context, "Change this sync account.", async () => {
76138
76472
  return (await emailMailboxSyncAccountsUpdate({
76139
76473
  path,
@@ -76147,8 +76481,8 @@ function accountBody(context) {
76147
76481
  const mailboxUuid = context.flags.get("--mailbox")?.trim() ?? "";
76148
76482
  const recurrence = recurrenceFlag(context) ?? "once";
76149
76483
  const endsAt = context.flags.get("--ends-at")?.trim() ?? "";
76150
- if (sourceUsername === "" || mailboxUuid === "") throw new UsageError(`account add needs --username and --mailbox.\n\n${USAGE$32}`);
76151
- if (recurrence === "until" && endsAt === "") throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$32}`);
76484
+ if (sourceUsername === "" || mailboxUuid === "") throw new UsageError(`account add needs --username and --mailbox.\n\n${USAGE$33}`);
76485
+ if (recurrence === "until" && endsAt === "") throw new UsageError(`--recurrence until needs --ends-at.\n\n${USAGE$33}`);
76152
76486
  return {
76153
76487
  sourceUsername,
76154
76488
  mailboxUuid,
@@ -76164,7 +76498,7 @@ function recurrenceFlag(context) {
76164
76498
  return raw;
76165
76499
  }
76166
76500
  // src/commands/email-text.ts
76167
- var USAGE$31 = [
76501
+ var USAGE$32 = [
76168
76502
  "Usage: hostingctl email <show|names> --company <slug>",
76169
76503
  " hostingctl email <mailboxes|aliases> <email-domain-uuid> --company <slug>",
76170
76504
  " hostingctl email mailbox <email-domain-uuid> <mailbox-uuid> --company <slug>",
@@ -76246,7 +76580,7 @@ function count$1(shown, total) {
76246
76580
  var EMAIL_METADATA = {
76247
76581
  name: "email",
76248
76582
  summary: "A company's email service, its attached names, their mailboxes and aliases.",
76249
- usage: USAGE$31,
76583
+ usage: USAGE$32,
76250
76584
  flags: [
76251
76585
  {
76252
76586
  name: "--address",
@@ -76426,75 +76760,75 @@ var EMAIL_METADATA = {
76426
76760
  var EMAIL_TOPICS = [
76427
76761
  {
76428
76762
  path: ["alias"],
76429
- usage: USAGE$39
76763
+ usage: USAGE$40
76430
76764
  },
76431
76765
  {
76432
76766
  path: ["app-token"],
76433
- usage: USAGE$38
76767
+ usage: USAGE$39
76434
76768
  },
76435
76769
  {
76436
76770
  path: ["send-as"],
76437
- usage: USAGE$38
76771
+ usage: USAGE$39
76438
76772
  },
76439
76773
  {
76440
76774
  path: ["offer"],
76441
- usage: USAGE$37
76775
+ usage: USAGE$38
76442
76776
  },
76443
76777
  {
76444
76778
  path: ["enroll"],
76445
- usage: USAGE$37
76779
+ usage: USAGE$38
76446
76780
  },
76447
76781
  {
76448
76782
  path: ["agree"],
76449
- usage: USAGE$37
76783
+ usage: USAGE$38
76450
76784
  },
76451
76785
  {
76452
76786
  path: ["provision"],
76453
- usage: USAGE$37
76787
+ usage: USAGE$38
76454
76788
  },
76455
76789
  {
76456
76790
  path: ["domain"],
76457
- usage: USAGE$37
76791
+ usage: USAGE$38
76458
76792
  },
76459
76793
  {
76460
76794
  path: ["catch-all"],
76461
- usage: USAGE$37
76795
+ usage: USAGE$38
76462
76796
  },
76463
76797
  {
76464
76798
  path: ["service"],
76465
- usage: USAGE$34
76799
+ usage: USAGE$35
76466
76800
  },
76467
76801
  {
76468
76802
  path: ["dmarc"],
76469
- usage: USAGE$34
76803
+ usage: USAGE$35
76470
76804
  },
76471
76805
  {
76472
76806
  path: ["dmarc-set"],
76473
- usage: USAGE$34
76807
+ usage: USAGE$35
76474
76808
  },
76475
76809
  {
76476
76810
  path: ["blocklist"],
76477
- usage: USAGE$34
76811
+ usage: USAGE$35
76478
76812
  },
76479
76813
  {
76480
76814
  path: ["blocklist-set"],
76481
- usage: USAGE$34
76815
+ usage: USAGE$35
76482
76816
  },
76483
76817
  {
76484
76818
  path: ["import-schema"],
76485
- usage: USAGE$34
76819
+ usage: USAGE$35
76486
76820
  },
76487
76821
  {
76488
76822
  path: ["sync"],
76489
- usage: USAGE$32
76823
+ usage: USAGE$33
76490
76824
  },
76491
76825
  {
76492
76826
  path: ["hold"],
76493
- usage: USAGE$36
76827
+ usage: USAGE$37
76494
76828
  },
76495
76829
  {
76496
76830
  path: ["mailbox"],
76497
- usage: USAGE$35
76831
+ usage: USAGE$36
76498
76832
  }
76499
76833
  ];
76500
76834
  // src/commands/email-sync-text.ts
@@ -76534,7 +76868,7 @@ async function companyRead(context, subcommand, rest) {
76534
76868
  if (subcommand === "mailboxes") return await mailboxes(company, rest);
76535
76869
  if (subcommand === "mailbox") return await mailbox(company, rest);
76536
76870
  if (subcommand === "aliases") return await aliases(company, rest);
76537
- throw new UsageError(USAGE$31);
76871
+ throw new UsageError(USAGE$32);
76538
76872
  }
76539
76873
  /** The renderer for a tagged feature read, or null when this command renders the answer itself. */
76540
76874
  function taggedText(report) {
@@ -76619,7 +76953,7 @@ var email = {
76619
76953
  ...EMAIL_METADATA,
76620
76954
  async run(context) {
76621
76955
  const [subcommand, ...rest] = context.positional;
76622
- if (subcommand === void 0 || !SUBCOMMANDS.has(subcommand)) throw new UsageError(USAGE$31);
76956
+ if (subcommand === void 0 || !SUBCOMMANDS.has(subcommand)) throw new UsageError(USAGE$32);
76623
76957
  const feature = dispatched$1(context, subcommand, rest);
76624
76958
  if (feature !== null) return await feature;
76625
76959
  return await companyRead(context, subcommand, rest);
@@ -76704,7 +77038,7 @@ async function aliases(company, rest) {
76704
77038
  /** `mailbox <email-domain-uuid> <mailbox-uuid>`: one record, independent of index pagination. */
76705
77039
  async function mailbox(company, rest) {
76706
77040
  const [emailDomainUuid, mailboxUuid, ...extra] = rest;
76707
- if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$31);
77041
+ if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$32);
76708
77042
  return (await emailMailboxesShow({ path: {
76709
77043
  company,
76710
77044
  emailDomainUuid,
@@ -76714,12 +77048,12 @@ async function mailbox(company, rest) {
76714
77048
  /** The one uuid a collection read names, or a usage refusal. */
76715
77049
  function oneUuid$4(rest) {
76716
77050
  const [uuid, ...extra] = rest;
76717
- if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$31);
77051
+ if (uuid === void 0 || extra.length > 0) throw new UsageError(USAGE$32);
76718
77052
  return uuid;
76719
77053
  }
76720
77054
  /** A company-wide read takes no positional arguments. */
76721
77055
  function noExtra$12(rest) {
76722
- if (rest.length > 0) throw new UsageError(USAGE$31);
77056
+ if (rest.length > 0) throw new UsageError(USAGE$32);
76723
77057
  }
76724
77058
  // src/commands/environment-activation.ts
76725
77059
  async function environmentActivation(context, args) {
@@ -76734,7 +77068,7 @@ async function environmentActivation(context, args) {
76734
77068
  };
76735
77069
  }
76736
77070
  // src/commands/environment-admin.ts
76737
- var USAGE$30 = [
77071
+ var USAGE$31 = [
76738
77072
  "Usage: hostingctl environment retention <environment-uuid> --company <slug>",
76739
77073
  " hostingctl environment retention-set <environment-uuid> --company <slug> --extra-days <n> --effective-at <iso> --agreement <uuid> [--package <key>]",
76740
77074
  " hostingctl environment database-show <environment-uuid> <database-uuid> --company <slug>",
@@ -76758,9 +77092,9 @@ async function environmentAdmin(context, subcommand, rest) {
76758
77092
  if (subcommand === "retention") return await retention(context, first);
76759
77093
  if (subcommand === "retention-set") return await retentionSet(context, first);
76760
77094
  if (subcommand === "database-show" || subcommand === "database-reveal") {
76761
- if (first === void 0 || tail.length !== 1) throw new UsageError(USAGE$30);
77095
+ if (first === void 0 || tail.length !== 1) throw new UsageError(USAGE$31);
76762
77096
  const path = {
76763
- ...await environmentPath$1(context, first, USAGE$30),
77097
+ ...await environmentPath$1(context, first, USAGE$31),
76764
77098
  databaseUuid: tail[0] ?? ""
76765
77099
  };
76766
77100
  if (subcommand === "database-show") return {
@@ -76770,24 +77104,24 @@ async function environmentAdmin(context, subcommand, rest) {
76770
77104
  return await revealDatabase(context, path);
76771
77105
  }
76772
77106
  if (subcommand === "tuning") return await tuning(context, first, tail);
76773
- throw new UsageError(USAGE$30);
77107
+ throw new UsageError(USAGE$31);
76774
77108
  }
76775
77109
  /** `retention <env>`. */
76776
77110
  async function retention(context, environmentUuid) {
76777
77111
  return {
76778
77112
  kind: "retention",
76779
- retention: (await hostingRetentionShow({ path: await environmentPath$1(context, environmentUuid, USAGE$30) })).data
77113
+ retention: (await hostingRetentionShow({ path: await environmentPath$1(context, environmentUuid, USAGE$31) })).data
76780
77114
  };
76781
77115
  }
76782
77116
  /** `retention-set <env> --extra-days … --effective-at … --agreement …`. */
76783
77117
  async function retentionSet(context, environmentUuid) {
76784
- const path = await environmentPath$1(context, environmentUuid, USAGE$30);
77118
+ const path = await environmentPath$1(context, environmentUuid, USAGE$31);
76785
77119
  const extraDays = Number(context.flags.get("--extra-days") ?? "");
76786
77120
  const effectiveAt = context.flags.get("--effective-at")?.trim() ?? "";
76787
77121
  const baselineAgreementUuid = context.flags.get("--agreement")?.trim() ?? "";
76788
- 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$30}`);
76789
- if (effectiveAt === "" || Number.isNaN(Date.parse(effectiveAt))) throw new UsageError(`retention-set needs --effective-at as an ISO date.\n\n${USAGE$30}`);
76790
- if (baselineAgreementUuid === "") throw new UsageError(`retention-set needs --agreement.\n\n${USAGE$30}`);
77122
+ if (!Number.isInteger(extraDays) || extraDays < 1) throw new UsageError(`retention-set needs --extra-days as a whole number of at least 1.\n\n${USAGE$31}`);
77123
+ if (effectiveAt === "" || Number.isNaN(Date.parse(effectiveAt))) throw new UsageError(`retention-set needs --effective-at as an ISO date.\n\n${USAGE$31}`);
77124
+ if (baselineAgreementUuid === "") throw new UsageError(`retention-set needs --agreement.\n\n${USAGE$31}`);
76791
77125
  const packageKey = context.flags.get("--package")?.trim();
76792
77126
  return {
76793
77127
  kind: "write",
@@ -76814,7 +77148,7 @@ async function revealDatabase(context, path) {
76814
77148
  /** `tuning preview|restore <env>`. */
76815
77149
  async function tuning(context, action, rest) {
76816
77150
  const environmentUuid = rest[0];
76817
- const path = await environmentPath$1(context, environmentUuid, USAGE$30);
77151
+ const path = await environmentPath$1(context, environmentUuid, USAGE$31);
76818
77152
  if (action === "preview" && rest.length === 1) {
76819
77153
  const body = (await hostingEnvironmentShow({ path })).data;
76820
77154
  return {
@@ -76827,7 +77161,7 @@ async function tuning(context, action, rest) {
76827
77161
  }
76828
77162
  if (action === "restore" && rest.length === 1) {
76829
77163
  const generation = Number(context.flags.get("--generation") ?? "");
76830
- if (!Number.isInteger(generation) || generation < 1) throw new UsageError(`tuning restore needs --generation.\n\n${USAGE$30}`);
77164
+ if (!Number.isInteger(generation) || generation < 1) throw new UsageError(`tuning restore needs --generation.\n\n${USAGE$31}`);
76831
77165
  return {
76832
77166
  kind: "write",
76833
77167
  outcome: await confirmableWrite(context, `Restore the recorded tuning for generation ${String(generation)}.`, async () => (await hostingTuningRestore({
@@ -76836,7 +77170,7 @@ async function tuning(context, action, rest) {
76836
77170
  })).data)
76837
77171
  };
76838
77172
  }
76839
- throw new UsageError(USAGE$30);
77173
+ throw new UsageError(USAGE$31);
76840
77174
  }
76841
77175
  /** One retention window as one line, and the write receipt for it. */
76842
77176
  function retentionText(one) {
@@ -76941,7 +77275,7 @@ async function cacheSet(context, path) {
76941
77275
  })).data);
76942
77276
  }
76943
77277
  // src/commands/environment-component-version.ts
76944
- var USAGE$29 = [
77278
+ var USAGE$30 = [
76945
77279
  "Usage: hostingctl environment component-version <environment-uuid> <workload-uuid> <version> --company <slug>",
76946
77280
  "",
76947
77281
  " component-version Move one curated component instance to another version this platform pins an image",
@@ -76959,7 +77293,7 @@ var USAGE$29 = [
76959
77293
  */
76960
77294
  async function environmentComponentVersion(context, rest) {
76961
77295
  const [uuid, workloadUuid, version, ...extra] = rest;
76962
- if (uuid === void 0 || workloadUuid === void 0 || version === void 0 || extra.length > 0) throw new UsageError(USAGE$29);
77296
+ if (uuid === void 0 || workloadUuid === void 0 || version === void 0 || extra.length > 0) throw new UsageError(USAGE$30);
76963
77297
  const path = {
76964
77298
  company: await requireCompany(context.flags),
76965
77299
  environmentUuid: uuid,
@@ -77395,10 +77729,10 @@ function initialSelectionText(selection) {
77395
77729
  return `${selection.volumeType}: ${selection.storageClass ?? selection.storageClassUuid ?? ""}`;
77396
77730
  }
77397
77731
  // src/commands/environment-create.ts
77398
- var USAGE$28 = [
77732
+ var USAGE$29 = [
77399
77733
  "Usage: hostingctl environment create --company <slug> --name <name> [--slug <slug>] [--package <key>]",
77400
77734
  " hostingctl environment create --client <slug> --name <name> [--slug <slug>] [--package <key>]",
77401
- " [--storage-classes <volume-type>=<class>[,<volume-type>=<class>...]]",
77735
+ " [--storage-classes <volume-type>=<class>[,<volume-type>=<class>...]] [--environment-mode <live|test>]",
77402
77736
  " [--cpu-request <millicores> --cpu-limit <millicores> --memory-request <MiB> --memory-limit <MiB>",
77403
77737
  " --storage-limit <MiB>]",
77404
77738
  "",
@@ -77416,6 +77750,8 @@ var USAGE$28 = [
77416
77750
  "",
77417
77751
  "The package is one of the keys this environment's catalog offers; the platform chooses the placement,",
77418
77752
  "so no cluster is sent or accepted.",
77753
+ "--environment-mode test creates a protected test copy: mail is captured, outside services are blocked,",
77754
+ "scheduled tasks are off and pages are not indexed. Make it live later with `environment mode set`.",
77419
77755
  "Initial storage classes are optional; each is reviewed and recorded before the environment's first reconcile.",
77420
77756
  "A class is its Kubernetes name (see `hostingctl storage-classes`) or its UUID."
77421
77757
  ].join("\n");
@@ -77451,6 +77787,11 @@ var CREATE_FLAG_SPECS = [
77451
77787
  takesValue: true,
77452
77788
  description: "The client a staff operator creates an environment for, through the platform route: one this account holds no membership in."
77453
77789
  },
77790
+ {
77791
+ name: "--environment-mode",
77792
+ takesValue: true,
77793
+ description: "live (the default) or test: a protected copy to restore into and make live later."
77794
+ },
77454
77795
  ...SLICE_FLAG_SPECS
77455
77796
  ];
77456
77797
  /**
@@ -77458,33 +77799,41 @@ var CREATE_FLAG_SPECS = [
77458
77799
  * not.
77459
77800
  */
77460
77801
  async function create$2(context, rest) {
77461
- if (rest.length > 0) throw new UsageError(USAGE$28);
77802
+ if (rest.length > 0) throw new UsageError(USAGE$29);
77462
77803
  const name = context.flags.get("--name")?.trim() ?? "";
77463
- if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$28}`);
77464
- const slug = slugFor(context.flags.get("--slug"), name, USAGE$28);
77465
- const slice = sliceFor(context.flags, USAGE$28);
77466
- const storageSelections = storageSelectionsFor(context.flags, USAGE$28);
77804
+ if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$29}`);
77805
+ const slug = slugFor(context.flags.get("--slug"), name, USAGE$29);
77806
+ const slice = sliceFor(context.flags, USAGE$29);
77807
+ const storageSelections = storageSelectionsFor(context.flags, USAGE$29);
77808
+ const mode = environmentModeFor(context.flags.get("--environment-mode"));
77467
77809
  const scope = await scopeFor(context.flags);
77468
77810
  const chosen = chosenPackage(await catalogFor(scope), context.flags.get("--package")?.trim() ?? "");
77469
77811
  const body = {
77470
77812
  name,
77471
77813
  slug,
77472
77814
  resourceProfile: chosen.key,
77815
+ mode,
77473
77816
  ...slice === null ? {} : { budget: slice },
77474
77817
  ...storageSelections === null ? {} : { storageSelections }
77475
77818
  };
77476
- return await confirmableWrite(context, describeCreate$1(name, slug, chosen.key, scope, slice, storageSelections), async () => await sendCreate(scope, body));
77819
+ return await confirmableWrite(context, describeCreate$1(name, slug, chosen.key, scope, slice, storageSelections, mode), async () => await sendCreate(scope, body));
77820
+ }
77821
+ /** Live unless the caller asked for a protected test copy; anything else is refused before a read. */
77822
+ function environmentModeFor(value) {
77823
+ const mode = value?.trim() ?? "live";
77824
+ if (mode === "live" || mode === "test") return mode;
77825
+ throw new UsageError(`--environment-mode must be live or test (got ${mode}).\n\n${USAGE$29}`);
77477
77826
  }
77478
77827
  /** Which company or client the create is for, from exactly one of `--company` and `--client`. */
77479
77828
  async function scopeFor(flags) {
77480
77829
  const client = flags.get("--client")?.trim() ?? "";
77481
77830
  const company = flags.get("--company")?.trim() ?? "";
77482
- if (client !== "" && company !== "") throw new UsageError(`Pass --company or --client, not both.\n\n${USAGE$28}`);
77831
+ if (client !== "" && company !== "") throw new UsageError(`Pass --company or --client, not both.\n\n${USAGE$29}`);
77483
77832
  if (client !== "") return {
77484
77833
  mode: "client",
77485
77834
  client
77486
77835
  };
77487
- if (company === "") throw new UsageError(`create needs --company <slug> or --client <slug>.\n\n${USAGE$28}`);
77836
+ if (company === "") throw new UsageError(`create needs --company <slug> or --client <slug>.\n\n${USAGE$29}`);
77488
77837
  return {
77489
77838
  mode: "company",
77490
77839
  company: await requireCompany(flags)
@@ -77498,7 +77847,7 @@ async function catalogFor(scope) {
77498
77847
  /** The package the create sends: the one named, or the catalog's first, refused when the catalog does not carry it. */
77499
77848
  function chosenPackage(packages, requested) {
77500
77849
  const chosen = requested === "" ? packages[0] : packages.find((one) => one.key === requested);
77501
- if (chosen === void 0) throw new UsageError(`--package must be one of ${packages.map((one) => one.key).join(", ")} (got ${requested}).\n\n${USAGE$28}`);
77850
+ if (chosen === void 0) throw new UsageError(`--package must be one of ${packages.map((one) => one.key).join(", ")} (got ${requested}).\n\n${USAGE$29}`);
77502
77851
  return chosen;
77503
77852
  }
77504
77853
  /** The create itself, through the route that addressee is reached by. */
@@ -77519,9 +77868,10 @@ async function sendCreate(scope, body) {
77519
77868
  * The addressee is named in every mode, so an operator who acted for a client sees that in the description and in
77520
77869
  * `--json`, rather than reading a receipt that could be their own company's.
77521
77870
  */
77522
- function describeCreate$1(name, slug, packageKey, scope, slice, storageSelections) {
77871
+ function describeCreate$1(name, slug, packageKey, scope, slice, storageSelections, mode) {
77872
+ const addressee = scope.mode === "client" ? `for client ${scope.client} through the platform route (this account holds no membership in it)` : `in company ${scope.company} through the company's own route`;
77523
77873
  return [
77524
- `Create environment "${name}" (${slug}) ${scope.mode === "client" ? `for client ${scope.client} through the platform route (this account holds no membership in it)` : `in company ${scope.company} through the company's own route`}, with the ${packageKey} package.`,
77874
+ `Create ${mode === "test" ? "protected test " : ""}environment "${name}" (${slug}) ${addressee}, with the ${packageKey} package.`,
77525
77875
  ...slice === null ? [] : [describeSlice(slice)],
77526
77876
  ...storageSelections === null ? [] : [" Initial storage classes (recorded before the first reconcile):", ...storageSelections.map((one) => ` ${initialSelectionText(one)}`)],
77527
77877
  " The platform chooses the placement from its own configuration: no cluster is sent or accepted, and",
@@ -77853,7 +78203,7 @@ function oneUuid$2(rest) {
77853
78203
  return uuid;
77854
78204
  }
77855
78205
  // src/commands/environment-domains.ts
77856
- var USAGE$27 = [
78206
+ var USAGE$28 = [
77857
78207
  "Usage: hostingctl environment domains <environment-uuid> --company <slug>",
77858
78208
  " hostingctl environment domain-add <environment-uuid> --company <slug> --hostname <host> --application <application-uuid> [--intended on|off]",
77859
78209
  " hostingctl environment domain-verify|domain-check-routing|domain-intended|domain-primary|domain-remove <environment-uuid> <domain-uuid> --company <slug>",
@@ -77875,7 +78225,7 @@ var USAGE$27 = [
77875
78225
  ].join("\n");
77876
78226
  /** The redirect vocabularies, typed from the API's own enums. */
77877
78227
  var TARGETS = /* @__PURE__ */ new Set(["application", "fixed"]);
77878
- var MODES$1 = /* @__PURE__ */ new Set(["temporary", "permanent"]);
78228
+ var MODES$2 = /* @__PURE__ */ new Set(["temporary", "permanent"]);
77879
78229
  /** The actions that change one existing name and take nothing else. */
77880
78230
  var DOMAIN_ACTIONS = {
77881
78231
  "domain-verify": hostingDomainVerify,
@@ -77886,7 +78236,7 @@ var DOMAIN_ACTIONS = {
77886
78236
  /** `environment domains|domain-add|domain-*|redirects|redirect-set|redirect-remove`. */
77887
78237
  async function environmentDomains(context, subcommand, rest) {
77888
78238
  const [environmentUuid, ...tail] = rest;
77889
- const path = await environmentPath$1(context, environmentUuid, USAGE$27);
78239
+ const path = await environmentPath$1(context, environmentUuid, USAGE$28);
77890
78240
  if (subcommand === "domains") return await domains(path, tail);
77891
78241
  if (subcommand === "redirects") return await redirects(path, tail);
77892
78242
  if (subcommand === "domain-add") return await add$7(context, path, tail);
@@ -77895,7 +78245,7 @@ async function environmentDomains(context, subcommand, rest) {
77895
78245
  if (subcommand === "domain-remove") return await removeDomain(context, path, tail);
77896
78246
  const action = DOMAIN_ACTIONS[subcommand];
77897
78247
  if (action !== void 0) return await domainAction(context, subcommand, action, path, tail);
77898
- throw new UsageError(USAGE$27);
78248
+ throw new UsageError(USAGE$28);
77899
78249
  }
77900
78250
  /** `domains <env>`. */
77901
78251
  async function domains(path, rest) {
@@ -77918,7 +78268,7 @@ async function add$7(context, path, rest) {
77918
78268
  noExtra$11(rest);
77919
78269
  const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
77920
78270
  const workloadUuid = context.flags.get("--application")?.trim() ?? "";
77921
- if (hostname === "" || workloadUuid === "") throw new UsageError(`domain-add needs --hostname and --application.\n\n${USAGE$27}`);
78271
+ if (hostname === "" || workloadUuid === "") throw new UsageError(`domain-add needs --hostname and --application.\n\n${USAGE$28}`);
77922
78272
  const intended = onOffFlag(context, "--intended") ?? false;
77923
78273
  return await written$2(confirmableWrite(context, `Serve ${hostname} from application ${workloadUuid}${intended ? " as an intended name" : ""}.`, async () => {
77924
78274
  return (await hostingDomainStore({
@@ -77934,7 +78284,7 @@ async function add$7(context, path, rest) {
77934
78284
  /** The five actions that take only the environment and the name. */
77935
78285
  async function domainAction(context, subcommand, action, path, rest) {
77936
78286
  const [domainUuid, ...extra] = rest;
77937
- if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$27);
78287
+ if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$28);
77938
78288
  const described = {
77939
78289
  "domain-verify": "Check this name's ownership TXT record now.",
77940
78290
  "domain-check-routing": "Check this name's routing now.",
@@ -77952,7 +78302,7 @@ async function domainAction(context, subcommand, action, path, rest) {
77952
78302
  /** `domain-remove <env> <domain>`: stop serving a name. */
77953
78303
  async function removeDomain(context, path, rest) {
77954
78304
  const [domainUuid, ...extra] = rest;
77955
- if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$27);
78305
+ if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$28);
77956
78306
  const fallBackToGenerated = onOffFlag(context, "--fall-back-to-generated") ?? true;
77957
78307
  return await written$2(confirmableWrite(context, "Stop serving this name. Its record stays readable, and the environment keeps its generated hostname.", async () => {
77958
78308
  const body = { fallBackToGenerated };
@@ -77968,13 +78318,13 @@ async function removeDomain(context, path, rest) {
77968
78318
  /** `redirect-set <env> <domain> --target … --mode … [--destination …]`. */
77969
78319
  async function setRedirect(context, path, rest) {
77970
78320
  const [domainUuid, ...extra] = rest;
77971
- if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$27);
78321
+ if (domainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$28);
77972
78322
  const target = context.flags.get("--target")?.trim() ?? "";
77973
78323
  const mode = context.flags.get("--mode")?.trim() ?? "";
77974
78324
  const destinationUrl = context.flags.get("--destination")?.trim() ?? "";
77975
- if (!TARGETS.has(target)) throw new UsageError(`--target must be application or fixed.\n\n${USAGE$27}`);
77976
- if (!MODES$1.has(mode)) throw new UsageError(`--mode must be temporary or permanent.\n\n${USAGE$27}`);
77977
- if (target === "fixed" && destinationUrl === "") throw new UsageError(`--target fixed needs --destination <url>.\n\n${USAGE$27}`);
78325
+ if (!TARGETS.has(target)) throw new UsageError(`--target must be application or fixed.\n\n${USAGE$28}`);
78326
+ if (!MODES$2.has(mode)) throw new UsageError(`--mode must be temporary or permanent.\n\n${USAGE$28}`);
78327
+ if (target === "fixed" && destinationUrl === "") throw new UsageError(`--target fixed needs --destination <url>.\n\n${USAGE$28}`);
77978
78328
  return await written$2(confirmableWrite(context, [`Redirect this name ${mode} to ${target === "fixed" ? destinationUrl : "its application"}.`, " The redirect activates once the source name's DNS resolves."].join("\n"), async () => {
77979
78329
  const body = {
77980
78330
  target,
@@ -77994,7 +78344,7 @@ async function setRedirect(context, path, rest) {
77994
78344
  /** `redirect-remove <env> <redirect-uuid>`. */
77995
78345
  async function removeRedirect(context, path, rest) {
77996
78346
  const [redirectUuid, ...extra] = rest;
77997
- if (redirectUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$27);
78347
+ if (redirectUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$28);
77998
78348
  return await written$2(confirmableWrite(context, `Remove redirect ${redirectUuid}.`, async () => {
77999
78349
  return (await hostingDomainRedirectDestroy({ path: {
78000
78350
  ...path,
@@ -78011,7 +78361,7 @@ async function written$2(pending) {
78011
78361
  }
78012
78362
  /** No positional arguments, or a usage refusal. */
78013
78363
  function noExtra$11(rest) {
78014
- if (rest.length > 0) throw new UsageError(USAGE$27);
78364
+ if (rest.length > 0) throw new UsageError(USAGE$28);
78015
78365
  }
78016
78366
  // src/commands/schedule-flags.ts
78017
78367
  /** The API's own bound on patterns in one schedule. */
@@ -78114,6 +78464,56 @@ function backupScheduleText(report) {
78114
78464
  if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
78115
78465
  return `${outcome.description}\n${scheduleLines$1(outcome.result)}`;
78116
78466
  }
78467
+ // src/commands/environment-database-import.ts
78468
+ var DATABASE_IMPORT_USAGE = [" hostingctl environment database-import <environment-uuid> <export-uuid> <application-uuid> --company <slug>", " hostingctl environment database-import-confirm <environment-uuid> <export-uuid> <application-uuid> --company <slug> --confirmation <digest>"];
78469
+ /**
78470
+ * `database-import <env> <export> <application>` reviews importing a backup of a database on another host into one
78471
+ * application's database; `database-import-confirm` reads that review again and confirms it with its digest.
78472
+ */
78473
+ async function databaseImport(context, path, subcommand, rest, usage) {
78474
+ const [exportUuid, workloadUuid, ...extra] = rest;
78475
+ if (!exportUuid || !workloadUuid || extra.length > 0) throw new UsageError(usage);
78476
+ const importPath = {
78477
+ ...path,
78478
+ exportUuid,
78479
+ workloadUuid
78480
+ };
78481
+ const review = (await hostingDatabaseImportShow({ path: importPath })).data;
78482
+ if (subcommand === "database-import") return {
78483
+ kind: "database-import-review",
78484
+ review
78485
+ };
78486
+ if (review.blockedReason !== null) throw new UsageError(`This import is blocked: ${review.blockedReason}`);
78487
+ const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
78488
+ if (confirmation === "") throw new UsageError(`database-import-confirm needs --confirmation.\n\n${usage}`);
78489
+ return {
78490
+ kind: "database-import-write",
78491
+ outcome: await confirmableWrite(context, `Import backup ${exportUuid} into ${review.applicationName}: ${review.replaces}`, async () => (await hostingDatabaseImportConfirm({
78492
+ path: importPath,
78493
+ body: {
78494
+ confirmation,
78495
+ desiredGeneration: review.recovery.desiredGeneration
78496
+ }
78497
+ })).data)
78498
+ };
78499
+ }
78500
+ function databaseImportText(report) {
78501
+ if (report.kind === "database-import-write") {
78502
+ const { outcome } = report;
78503
+ if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
78504
+ return `${outcome.description}\n recovery ${outcome.result.uuid} ${outcome.result.statusName}`;
78505
+ }
78506
+ const { review } = report;
78507
+ const quota = review.quotaBytes === null ? "unknown" : `${String(review.quotaBytes)} bytes`;
78508
+ return [
78509
+ ` import into ${review.applicationName}`,
78510
+ ` ${review.sourceEngine} ${review.sourceVersion} → ${review.destinationEngine} ${review.destinationVersion}: ${review.engineMatches ? "compatible" : "not compatible"}`,
78511
+ ` ${String(review.sourceBytes)} bytes against ${quota} of database storage: ${review.fitsQuota ? "fits" : "does not fit"}`,
78512
+ ` ${String(review.tableCount)} table(s)${review.tablesTruncated ? " (list truncated)" : ""}: ${review.tables.join(", ")}`,
78513
+ ` ${review.replaces}`,
78514
+ review.blockedReason === null ? ` confirm with --confirmation ${review.recovery.inventoryDigest}` : ` BLOCKED: ${review.blockedReason}`
78515
+ ].join("\n");
78516
+ }
78117
78517
  // src/commands/environment-export-sources.ts
78118
78518
  /** Refresh is an explicit write; reading its progress never starts another discovery Job. */
78119
78519
  async function environmentExportSources(context, path, subcommand) {
@@ -78171,7 +78571,7 @@ async function releaseBundle(context, args) {
78171
78571
  };
78172
78572
  }
78173
78573
  // src/commands/environment-exports.ts
78174
- var USAGE$26 = [
78574
+ var USAGE$27 = [
78175
78575
  "Usage: hostingctl environment export-sources <environment-uuid> --company <slug>",
78176
78576
  " hostingctl environment export-sources-refresh <environment-uuid> --company <slug>",
78177
78577
  " hostingctl environment export-create <environment-uuid> <source-id> --company <slug>",
@@ -78183,6 +78583,7 @@ var USAGE$26 = [
78183
78583
  " hostingctl environment database-backup-schedule-stop <environment-uuid> <schedule-uuid> --company <slug>",
78184
78584
  " hostingctl environment database-export-download <environment-uuid> <export-uuid> --company <slug>",
78185
78585
  " hostingctl environment database-export-remove <environment-uuid> <export-uuid> --company <slug>",
78586
+ ...DATABASE_IMPORT_USAGE,
78186
78587
  " hostingctl environment release-bundle <release-uuid> --environment <uuid> --application <uuid> --company <slug> --out <new-file>",
78187
78588
  "",
78188
78589
  " export-sources Retained database backups and file snapshots available for export.",
@@ -78196,6 +78597,9 @@ var USAGE$26 = [
78196
78597
  " database-backup-schedule-stop Stop one repeating backup. Its exports stay.",
78197
78598
  " database-export-download A time-limited URL for a finished export, and the tool that restores it.",
78198
78599
  " database-export-remove Retire one export early.",
78600
+ " database-import Review importing a finished backup from another host into a Moodle application's",
78601
+ " database: what is replaced, and that the current data is captured first.",
78602
+ " database-import-confirm Confirm that review with its digest. Other applications are backup only.",
78199
78603
  " release-bundle The recorded bundle for one release.",
78200
78604
  "",
78201
78605
  "These are portable exports the customer asked for, not the platform's own backup track: the URL is the",
@@ -78205,7 +78609,7 @@ var USAGE$26 = [
78205
78609
  async function environmentExports(context, subcommand, rest) {
78206
78610
  if (subcommand === "release-bundle") return await releaseBundle(context, rest);
78207
78611
  const [environmentUuid, ...tail] = rest;
78208
- const path = await environmentPath$1(context, environmentUuid, USAGE$26);
78612
+ const path = await environmentPath$1(context, environmentUuid, USAGE$27);
78209
78613
  if (subcommand === "export-sources" || subcommand === "export-sources-refresh") {
78210
78614
  noExtra$10(tail);
78211
78615
  return await environmentExportSources(context, path, subcommand);
@@ -78224,14 +78628,15 @@ async function environmentExports(context, subcommand, rest) {
78224
78628
  noExtra$10(tail);
78225
78629
  return await listBackupSchedules(path);
78226
78630
  }
78227
- if (subcommand === "database-backup-schedule-stop") return await stopBackupSchedule(context, path, tail, USAGE$26);
78631
+ if (subcommand === "database-backup-schedule-stop") return await stopBackupSchedule(context, path, tail, USAGE$27);
78632
+ if (subcommand === "database-import" || subcommand === "database-import-confirm") return await databaseImport(context, path, subcommand, tail, USAGE$27);
78228
78633
  if (subcommand === "database-export-download") return await download(path, tail);
78229
78634
  if (subcommand === "database-export-remove") return await remove$2(context, path, tail);
78230
- throw new UsageError(USAGE$26);
78635
+ throw new UsageError(USAGE$27);
78231
78636
  }
78232
78637
  async function createRetained(context, path, rest) {
78233
78638
  const [sourceId, ...extra] = rest;
78234
- if (!sourceId || extra.length > 0) throw new UsageError(USAGE$26);
78639
+ if (!sourceId || extra.length > 0) throw new UsageError(USAGE$27);
78235
78640
  return {
78236
78641
  kind: "export-write",
78237
78642
  outcome: await confirmableWrite(context, `Prepare a download from retained source ${sourceId}. Its capture, scope and expiry remain those recorded by the platform.`, async () => (await hostingExportStore({
@@ -78241,7 +78646,7 @@ async function createRetained(context, path, rest) {
78241
78646
  };
78242
78647
  }
78243
78648
  async function create(context, path, rest) {
78244
- const databaseUuid = oneUuid$7(rest, USAGE$26);
78649
+ const databaseUuid = oneUuid$7(rest, USAGE$27);
78245
78650
  return {
78246
78651
  kind: "export-write",
78247
78652
  outcome: await confirmableWrite(context, "Take a portable export of this database now. It is downloadable until its expiry.", async () => {
@@ -78257,7 +78662,7 @@ async function create(context, path, rest) {
78257
78662
  }
78258
78663
  /** `database-backup <env> <connection>`: back up a database on another host into an export of this environment. */
78259
78664
  async function backup(context, path, rest) {
78260
- const connection = oneUuid$7(rest, USAGE$26);
78665
+ const connection = oneUuid$7(rest, USAGE$27);
78261
78666
  if ([
78262
78667
  "--schedule",
78263
78668
  "--timezone",
@@ -78278,7 +78683,7 @@ async function backup(context, path, rest) {
78278
78683
  }
78279
78684
  /** `database-export-download <env> <export>`: a time-limited URL, which is the customer's copy. */
78280
78685
  async function download(path, rest) {
78281
- const exportUuid = oneUuid$7(rest, USAGE$26);
78686
+ const exportUuid = oneUuid$7(rest, USAGE$27);
78282
78687
  return {
78283
78688
  kind: "download",
78284
78689
  download: (await hostingDatabaseExportDownload({ path: {
@@ -78288,7 +78693,7 @@ async function download(path, rest) {
78288
78693
  };
78289
78694
  }
78290
78695
  async function remove$2(context, path, rest) {
78291
- const exportUuid = oneUuid$7(rest, USAGE$26);
78696
+ const exportUuid = oneUuid$7(rest, USAGE$27);
78292
78697
  return {
78293
78698
  kind: "export-write",
78294
78699
  outcome: await confirmableWrite(context, `Retire export ${exportUuid}. Its URL stops working once it is gone.`, async () => (await hostingDatabaseExportDestroy({ path: {
@@ -78298,7 +78703,7 @@ async function remove$2(context, path, rest) {
78298
78703
  };
78299
78704
  }
78300
78705
  function noExtra$10(rest) {
78301
- if (rest.length > 0) throw new UsageError(USAGE$26);
78706
+ if (rest.length > 0) throw new UsageError(USAGE$27);
78302
78707
  }
78303
78708
  function exportLine(one) {
78304
78709
  const size = one.sizeBytes === null ? "" : ` ${String(Math.round(one.sizeBytes / 1024))} KiB`;
@@ -78308,6 +78713,7 @@ function exportLine(one) {
78308
78713
  function environmentExportText(report) {
78309
78714
  if (report.kind === "source-refresh" || report.kind === "sources") return environmentExportSourcesText(report);
78310
78715
  if (report.kind === "backup-schedules" || report.kind === "backup-schedule-write") return backupScheduleText(report);
78716
+ if (report.kind === "database-import-review" || report.kind === "database-import-write") return databaseImportText(report);
78311
78717
  if (report.kind === "export-write") {
78312
78718
  const { outcome } = report;
78313
78719
  if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
@@ -78387,6 +78793,89 @@ function diagnosisText(result) {
78387
78793
  function environmentMailRelayText(report) {
78388
78794
  return renderWriteOutcome(report.outcome, diagnosisText);
78389
78795
  }
78796
+ // src/commands/environment-mode.ts
78797
+ var USAGE$26 = [
78798
+ "Usage: hostingctl environment mode review <environment-uuid> --company <slug> --to <live|test>",
78799
+ " hostingctl environment mode set <environment-uuid> --company <slug> --to live --data-handover <handover>",
78800
+ " hostingctl environment mode set <environment-uuid> --company <slug> --to test",
78801
+ "",
78802
+ " review What making the environment live (or returning it to test protection) changes, and whether it",
78803
+ " may be confirmed now.",
78804
+ " set Record the change against the generation the review read. A change to the environment since",
78805
+ " then is refused, so review again. Needs --confirm; --dry-run describes it without sending it.",
78806
+ "",
78807
+ " --data-handover Going live only: how the tested copy relates to the original site.",
78808
+ " test_copy_is_current the copy holds everything that should go live",
78809
+ " refreshed_from_source the original was restored into this environment again just before",
78810
+ "",
78811
+ "Going live does not move a domain or turn site sign-in off; the review says what to do for each."
78812
+ ].join("\n");
78813
+ var MODES$1 = ["live", "test"];
78814
+ var HANDOVERS = ["test_copy_is_current", "refreshed_from_source"];
78815
+ /** The flags this group reads, published by the environment group's metadata. */
78816
+ var MODE_FLAG_SPECS = [{
78817
+ name: "--data-handover",
78818
+ takesValue: true,
78819
+ description: "`mode set --to live`: test_copy_is_current or refreshed_from_source."
78820
+ }];
78821
+ /** `environment mode review|set`. */
78822
+ async function environmentMode(context, rest) {
78823
+ const [action, environmentUuid, ...extra] = rest;
78824
+ if (action === void 0 || extra.length > 0) throw new UsageError(USAGE$26);
78825
+ const path = await environmentPath$1(context, environmentUuid, USAGE$26);
78826
+ const target = oneOf(context.flags.get("--to"), MODES$1, "--to");
78827
+ if (action === "review") return {
78828
+ kind: "mode-review",
78829
+ review: (await hostingEnvironmentsModeReview({
78830
+ path,
78831
+ query: { mode: target }
78832
+ })).data
78833
+ };
78834
+ if (action === "set") return await set$1(context, path, target);
78835
+ throw new UsageError(USAGE$26);
78836
+ }
78837
+ async function set$1(context, path, target) {
78838
+ const handover = target === "live" ? oneOf(context.flags.get("--data-handover"), HANDOVERS, "--data-handover") : null;
78839
+ return {
78840
+ kind: "mode-write",
78841
+ outcome: await confirmableWrite(context, target === "live" ? `Make this environment live (${handover}): real mail, outside services and scheduled tasks switch on.` : "Return this environment to test protection: mail is captured and outside services are blocked from now on.", async () => {
78842
+ const { desiredGeneration } = (await hostingEnvironmentsModeReview({
78843
+ path,
78844
+ query: { mode: target }
78845
+ })).data;
78846
+ return (await hostingEnvironmentsModeUpdate({
78847
+ path,
78848
+ body: {
78849
+ mode: target,
78850
+ desiredGeneration,
78851
+ ...handover === null ? {} : { dataHandover: handover }
78852
+ }
78853
+ })).data;
78854
+ })
78855
+ };
78856
+ }
78857
+ function oneOf(value, allowed, flag) {
78858
+ const chosen = allowed.find((one) => one === value?.trim());
78859
+ if (chosen === void 0) throw new UsageError(`${flag} must be one of ${allowed.join(", ")}.\n\n${USAGE$26}`);
78860
+ return chosen;
78861
+ }
78862
+ /** The `environment mode …` renderer. */
78863
+ function environmentModeText(report) {
78864
+ if (report.kind === "mode-write") {
78865
+ const { outcome } = report;
78866
+ if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
78867
+ return `${outcome.description}\nRecorded: this environment is now ${outcome.result.mode}; the change is applying.`;
78868
+ }
78869
+ const { review } = report;
78870
+ return [
78871
+ `Mode: ${review.currentMode} -> ${review.targetMode} (generation ${review.desiredGeneration})`,
78872
+ review.blockedReason === null ? "May be confirmed now." : `Refused now: ${review.blockedReason}`,
78873
+ ...review.changes.map((change) => ` ${change.area}: ${change.before} -> ${change.after}`),
78874
+ ...review.addresses.length > 0 ? [`Addresses: ${review.addresses.join(", ")}`] : [],
78875
+ ...review.warnings.map((warning) => `! ${warning}`),
78876
+ ...review.dataHandoverRequired ? ["Going live needs --data-handover."] : []
78877
+ ].join("\n");
78878
+ }
78390
78879
  // src/commands/environment-runtime-version-grants.ts
78391
78880
  /**
78392
78881
  * The flags this command reads, declared beside it so the metadata owner spreads one list rather than
@@ -78601,6 +79090,7 @@ var ENVIRONMENT_SUBCOMMANDS = [
78601
79090
  "redirect-set",
78602
79091
  "redirect-remove",
78603
79092
  "tools",
79093
+ "mode",
78604
79094
  "export-sources",
78605
79095
  "export-sources-refresh",
78606
79096
  "export-create",
@@ -78611,6 +79101,8 @@ var ENVIRONMENT_SUBCOMMANDS = [
78611
79101
  "database-backup-schedule-stop",
78612
79102
  "database-export-download",
78613
79103
  "database-export-remove",
79104
+ "database-import",
79105
+ "database-import-confirm",
78614
79106
  "release-bundle",
78615
79107
  "service-add-review",
78616
79108
  "service-add",
@@ -79438,23 +79930,23 @@ function list$5(values) {
79438
79930
  var ENVIRONMENT_TOPICS = [
79439
79931
  {
79440
79932
  path: ["retention"],
79441
- usage: USAGE$30
79933
+ usage: USAGE$31
79442
79934
  },
79443
79935
  {
79444
79936
  path: ["retention-set"],
79445
- usage: USAGE$30
79937
+ usage: USAGE$31
79446
79938
  },
79447
79939
  {
79448
79940
  path: ["database-show"],
79449
- usage: USAGE$30
79941
+ usage: USAGE$31
79450
79942
  },
79451
79943
  {
79452
79944
  path: ["database-reveal"],
79453
- usage: USAGE$30
79945
+ usage: USAGE$31
79454
79946
  },
79455
79947
  {
79456
79948
  path: ["tuning"],
79457
- usage: USAGE$30
79949
+ usage: USAGE$31
79458
79950
  },
79459
79951
  {
79460
79952
  path: ["configuration"],
@@ -79482,87 +79974,95 @@ var ENVIRONMENT_TOPICS = [
79482
79974
  },
79483
79975
  {
79484
79976
  path: ["domains"],
79485
- usage: USAGE$27
79977
+ usage: USAGE$28
79486
79978
  },
79487
79979
  {
79488
79980
  path: ["domain-add"],
79489
- usage: USAGE$27
79981
+ usage: USAGE$28
79490
79982
  },
79491
79983
  {
79492
79984
  path: ["domain-verify"],
79493
- usage: USAGE$27
79985
+ usage: USAGE$28
79494
79986
  },
79495
79987
  {
79496
79988
  path: ["domain-check-routing"],
79497
- usage: USAGE$27
79989
+ usage: USAGE$28
79498
79990
  },
79499
79991
  {
79500
79992
  path: ["domain-intended"],
79501
- usage: USAGE$27
79993
+ usage: USAGE$28
79502
79994
  },
79503
79995
  {
79504
79996
  path: ["domain-primary"],
79505
- usage: USAGE$27
79997
+ usage: USAGE$28
79506
79998
  },
79507
79999
  {
79508
80000
  path: ["domain-remove"],
79509
- usage: USAGE$27
80001
+ usage: USAGE$28
79510
80002
  },
79511
80003
  {
79512
80004
  path: ["redirects"],
79513
- usage: USAGE$27
80005
+ usage: USAGE$28
79514
80006
  },
79515
80007
  {
79516
80008
  path: ["redirect-set"],
79517
- usage: USAGE$27
80009
+ usage: USAGE$28
79518
80010
  },
79519
80011
  {
79520
80012
  path: ["redirect-remove"],
79521
- usage: USAGE$27
80013
+ usage: USAGE$28
79522
80014
  },
79523
80015
  {
79524
80016
  path: ["export-sources"],
79525
- usage: USAGE$26
80017
+ usage: USAGE$27
79526
80018
  },
79527
80019
  {
79528
80020
  path: ["export-sources-refresh"],
79529
- usage: USAGE$26
80021
+ usage: USAGE$27
79530
80022
  },
79531
80023
  {
79532
80024
  path: ["export-create"],
79533
- usage: USAGE$26
80025
+ usage: USAGE$27
79534
80026
  },
79535
80027
  {
79536
80028
  path: ["database-exports"],
79537
- usage: USAGE$26
80029
+ usage: USAGE$27
79538
80030
  },
79539
80031
  {
79540
80032
  path: ["database-export-create"],
79541
- usage: USAGE$26
80033
+ usage: USAGE$27
79542
80034
  },
79543
80035
  {
79544
80036
  path: ["database-backup"],
79545
- usage: USAGE$26
80037
+ usage: USAGE$27
79546
80038
  },
79547
80039
  {
79548
80040
  path: ["database-backup-schedules"],
79549
- usage: USAGE$26
80041
+ usage: USAGE$27
79550
80042
  },
79551
80043
  {
79552
80044
  path: ["database-backup-schedule-stop"],
79553
- usage: USAGE$26
80045
+ usage: USAGE$27
79554
80046
  },
79555
80047
  {
79556
80048
  path: ["database-export-download"],
79557
- usage: USAGE$26
80049
+ usage: USAGE$27
79558
80050
  },
79559
80051
  {
79560
80052
  path: ["database-export-remove"],
79561
- usage: USAGE$26
80053
+ usage: USAGE$27
80054
+ },
80055
+ {
80056
+ path: ["database-import"],
80057
+ usage: USAGE$27
80058
+ },
80059
+ {
80060
+ path: ["database-import-confirm"],
80061
+ usage: USAGE$27
79562
80062
  },
79563
80063
  {
79564
80064
  path: ["release-bundle"],
79565
- usage: USAGE$26
80065
+ usage: USAGE$27
79566
80066
  },
79567
80067
  {
79568
80068
  path: ["service-add-review"],
@@ -79608,6 +80108,10 @@ var ENVIRONMENT_TOPICS = [
79608
80108
  path: ["tools"],
79609
80109
  usage: USAGE$21
79610
80110
  },
80111
+ {
80112
+ path: ["mode"],
80113
+ usage: USAGE$26
80114
+ },
79611
80115
  {
79612
80116
  path: ["runtime-versions"],
79613
80117
  usage: USAGE$24
@@ -79641,6 +80145,7 @@ var ENVIRONMENT_METADATA = {
79641
80145
  description: "The cache starting pattern: wordpress, static_build or application_headers."
79642
80146
  },
79643
80147
  ...RUNTIME_VERSION_GRANT_FLAG_SPECS,
80148
+ ...MODE_FLAG_SPECS,
79644
80149
  ...SETUP_FLAG_SPECS,
79645
80150
  {
79646
80151
  name: "--enabled",
@@ -79735,7 +80240,7 @@ var ENVIRONMENT_METADATA = {
79735
80240
  {
79736
80241
  name: "--to",
79737
80242
  takesValue: true,
79738
- description: "The address `mail-relay-test` sends its one test message to."
80243
+ description: "`mail-relay-test`: the address to send to. `mode`: live or test."
79739
80244
  },
79740
80245
  {
79741
80246
  name: "--wait",
@@ -79886,6 +80391,11 @@ var ENVIRONMENT_METADATA = {
79886
80391
  name: "--until",
79887
80392
  takesValue: true,
79888
80393
  description: "database-backup: the date and time, with a zone, after which no backup starts."
80394
+ },
80395
+ {
80396
+ name: "--confirmation",
80397
+ takesValue: true,
80398
+ description: "database-import-confirm: the review's digest, from its `confirm with` line."
79889
80399
  }
79890
80400
  ],
79891
80401
  subcommands: ENVIRONMENT_SUBCOMMANDS
@@ -80511,13 +81021,14 @@ function storageJournalText(journal) {
80511
81021
  function environmentTaggedText(report) {
80512
81022
  if (report.kind === "secret-reveal") return renderWriteOutcome(report.outcome, (result) => `Saved ${result.name} to ${result.savedTo} (mode 600).`);
80513
81023
  if (report.kind === "activation") return renderWriteOutcome(report.outcome, (result) => JSON.stringify(result, null, 2));
81024
+ if (report.kind === "mode-review" || report.kind === "mode-write") return environmentModeText(report);
80514
81025
  return featureText(report);
80515
81026
  }
80516
81027
  function featureText(report) {
80517
81028
  if (report.kind === "domains" || report.kind === "redirects" || report.kind === "domain-write") return environmentDomainText(report);
80518
81029
  if (report.kind === "site-access" || report.kind === "site-users" || report.kind === "site-write") return siteAccessText(report);
80519
81030
  if (report.kind === "tool" || report.kind === "tools-write") return environmentToolsText(report);
80520
- if (report.kind === "sources" || report.kind === "source-refresh" || report.kind === "exports" || report.kind === "download" || report.kind === "bundle" || report.kind === "export-write" || report.kind === "backup-schedules" || report.kind === "backup-schedule-write") return environmentExportText(report);
81031
+ if (report.kind === "sources" || report.kind === "source-refresh" || report.kind === "exports" || report.kind === "download" || report.kind === "bundle" || report.kind === "export-write" || report.kind === "backup-schedules" || report.kind === "backup-schedule-write" || report.kind === "database-import-review" || report.kind === "database-import-write") return environmentExportText(report);
80521
81032
  if (report.kind === "service-addition" || report.kind === "service-retirement" || report.kind === "service-write") return environmentServicesText(report);
80522
81033
  if (report.kind === "site-insights" || report.kind === "site-insights-write") return environmentSiteInsightsText(report);
80523
81034
  if (report.kind === "storage-journal") return storageJournalText(report.journal);
@@ -81088,6 +81599,7 @@ function oneUuid(rest) {
81088
81599
  */
81089
81600
  var SIMPLE_SUBCOMMANDS = {
81090
81601
  tools: environmentTools,
81602
+ mode: environmentMode,
81091
81603
  activate: environmentActivation,
81092
81604
  create: create$2,
81093
81605
  setup,
@@ -81146,6 +81658,8 @@ var EXPORT_SUBCOMMANDS = /* @__PURE__ */ new Set([
81146
81658
  "database-backup-schedule-stop",
81147
81659
  "database-export-download",
81148
81660
  "database-export-remove",
81661
+ "database-import",
81662
+ "database-import-confirm",
81149
81663
  "release-bundle"
81150
81664
  ]);
81151
81665
  /** The subcommands environment-site-access.ts owns: who may sign in to the sites, and how. */
@@ -88800,9 +89314,9 @@ var STORAGE_USAGE = [
88800
89314
  " hostingctl storage unbind <bucket-uuid> --company <slug> --environment <uuid>",
88801
89315
  " hostingctl storage adoption <bucket-uuid> --company <slug> [status]",
88802
89316
  " hostingctl storage adoption <bucket-uuid> --company <slug> start --maintenance",
88803
- " --retained-data [--confirm]",
89317
+ " --retained-data [--target-encryption none|sse_c] [--confirm]",
88804
89318
  " hostingctl storage adoption <bucket-uuid> --company <slug> confirm --operation-id <id>",
88805
- " --binding-generation <n> --capture-digest <digest> [--confirm]",
89319
+ " --binding-generation <n> --capture-digest <digest> [--target-encryption none|sse_c] [--confirm]",
88806
89320
  " hostingctl storage adoption <bucket-uuid> --company <slug> captured [--marker <m>]",
88807
89321
  " [--limit <n>]",
88808
89322
  " hostingctl storage adoption <bucket-uuid> --company <slug> retained",
@@ -88986,6 +89500,11 @@ var STORAGE_METADATA = {
88986
89500
  takesValue: false,
88987
89501
  description: "Acknowledge that objects written to the old namespace after the capture freeze are retained rather than merged, which `storage adoption start` requires."
88988
89502
  },
89503
+ {
89504
+ name: "--target-encryption",
89505
+ takesValue: true,
89506
+ description: "Adoption start or confirm: none or sse_c. Omit to keep the current mode; confirm sse_c explicitly when committing an encrypted capture."
89507
+ },
88989
89508
  {
88990
89509
  name: "--operation-id",
88991
89510
  takesValue: true,
@@ -89184,6 +89703,11 @@ function ceilingCents(context) {
89184
89703
  return cents;
89185
89704
  }
89186
89705
  // src/commands/storage-adoption-arguments.ts
89706
+ function targetEncryptionFlag(context) {
89707
+ const parsed = hostingStorageObjectEncryptionEnumSchema.optional().safeParse(context.flags.get("--target-encryption"));
89708
+ if (!parsed.success) throw new UsageError("--target-encryption must be none or sse_c.");
89709
+ return parsed.data;
89710
+ }
89187
89711
  /**
89188
89712
  * The arguments `storage adoption` reads, apart from the requests that use them.
89189
89713
  *
@@ -89240,15 +89764,17 @@ function generationFlag(context, flag) {
89240
89764
  */
89241
89765
  async function start(context, tail) {
89242
89766
  const path = await bucketPath(context, tail);
89767
+ const targetEncryption = targetEncryptionFlag(context);
89243
89768
  if (!context.flags.has("--maintenance") || !context.flags.has("--retained-data")) throw new UsageError(`start needs --maintenance and --retained-data: adopting the bucket pauses every client request to it until the new namespace is live, and whatever the old namespace still receives afterwards is retained rather than merged.\n\n${STORAGE_USAGE}`);
89244
- return await confirmableWrite(context, startDescription(path), async () => {
89769
+ return await confirmableWrite(context, `${startDescription(path)} Target encryption: ${targetEncryption ?? "unchanged"}.`, async () => {
89245
89770
  return {
89246
89771
  kind: "adoption",
89247
89772
  adoption: (await hostingStorageAdoptionStart({
89248
89773
  path,
89249
89774
  body: {
89250
89775
  maintenanceConfirmed: true,
89251
- retainedDataAcknowledged: true
89776
+ retainedDataAcknowledged: true,
89777
+ targetEncryption
89252
89778
  }
89253
89779
  })).data
89254
89780
  };
@@ -89266,7 +89792,8 @@ async function confirm$1(context, tail) {
89266
89792
  const body = {
89267
89793
  operationId: requiredFlag$4(context, "--operation-id", STORAGE_USAGE),
89268
89794
  bindingGeneration: generationFlag(context, "--binding-generation"),
89269
- captureDigest: requiredFlag$4(context, "--capture-digest", STORAGE_USAGE)
89795
+ captureDigest: requiredFlag$4(context, "--capture-digest", STORAGE_USAGE),
89796
+ targetEncryption: targetEncryptionFlag(context)
89270
89797
  };
89271
89798
  return await confirmableWrite(context, confirmDescription(path, body.captureDigest), async () => {
89272
89799
  return {
@@ -91801,7 +92328,7 @@ function writeUpdateState(state, env = process.env) {
91801
92328
  } catch {}
91802
92329
  }
91803
92330
  // src/version.ts
91804
- var VERSION = "1.0.834";
92331
+ var VERSION = "1.0.838";
91805
92332
  // src/commands/update.ts
91806
92333
  /**
91807
92334
  * `update` — bring this copy of the CLI up to the published version.
@@ -91875,7 +92402,7 @@ var update = {
91875
92402
  }, process.env);
91876
92403
  return {
91877
92404
  ...known,
91878
- current: after ?? "1.0.834",
92405
+ current: after ?? "1.0.838",
91879
92406
  latest: after ?? latest,
91880
92407
  upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
91881
92408
  action: "run",
@@ -92161,7 +92688,7 @@ async function printUpdateNotice(options) {
92161
92688
  }, env, { waitMs: NOTICE_LOCK_WAIT_MS });
92162
92689
  } catch {}
92163
92690
  if (latest === null) return;
92164
- if (!isNewerVersion(latest, "1.0.834")) return;
92691
+ if (!isNewerVersion(latest, "1.0.838")) return;
92165
92692
  process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
92166
92693
  }
92167
92694
  /** Whether an environment variable is set to something, which is how CI and the opt-out are read. */