@haakco/hostingctl 1.0.521 → 1.0.522

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
@@ -34701,6 +34701,209 @@ function hostingSiteUsersEnable(options) {
34701
34701
  }));
34702
34702
  }
34703
34703
  /**
34704
+ * {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/source/uploads}
34705
+ */
34706
+ function hostingSourceUploadsIndex(options) {
34707
+ const { client: request = client, ...config } = options;
34708
+ return withUnwrap(request({
34709
+ method: "GET",
34710
+ url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/source/uploads",
34711
+ security: [{
34712
+ type: "http",
34713
+ scheme: "bearer"
34714
+ }],
34715
+ ...config,
34716
+ throwOnError: config.throwOnError ?? true
34717
+ }));
34718
+ }
34719
+ /**
34720
+ * {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/source/uploads}
34721
+ */
34722
+ function hostingSourceUploadsStore(options) {
34723
+ const { client: request = client, ...config } = options;
34724
+ return withUnwrap(request({
34725
+ method: "POST",
34726
+ url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/source/uploads",
34727
+ security: [{
34728
+ type: "http",
34729
+ scheme: "bearer"
34730
+ }],
34731
+ contentType: { request: "multipart/form-data" },
34732
+ ...config,
34733
+ throwOnError: config.throwOnError ?? true
34734
+ }));
34735
+ }
34736
+ /**
34737
+ * {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/source/uploads/:uploadUuid}
34738
+ */
34739
+ function hostingSourceUploadsShow(options) {
34740
+ const { client: request = client, ...config } = options;
34741
+ return withUnwrap(request({
34742
+ method: "GET",
34743
+ url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/source/uploads/{uploadUuid}",
34744
+ security: [{
34745
+ type: "http",
34746
+ scheme: "bearer"
34747
+ }],
34748
+ ...config,
34749
+ throwOnError: config.throwOnError ?? true
34750
+ }));
34751
+ }
34752
+ /**
34753
+ * {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/source/uploads/:uploadUuid}
34754
+ */
34755
+ function hostingSourceUploadsDestroy(options) {
34756
+ const { client: request = client, ...config } = options;
34757
+ return withUnwrap(request({
34758
+ method: "DELETE",
34759
+ url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/source/uploads/{uploadUuid}",
34760
+ security: [{
34761
+ type: "http",
34762
+ scheme: "bearer"
34763
+ }],
34764
+ ...config,
34765
+ throwOnError: config.throwOnError ?? true
34766
+ }));
34767
+ }
34768
+ /**
34769
+ * {@link /c/:company/hosting/source/ssh/connections}
34770
+ */
34771
+ function hostingSshSourcesIndex(options) {
34772
+ const { client: request = client, ...config } = options;
34773
+ return withUnwrap(request({
34774
+ method: "GET",
34775
+ url: "/c/{company}/hosting/source/ssh/connections",
34776
+ security: [{
34777
+ type: "http",
34778
+ scheme: "bearer"
34779
+ }],
34780
+ ...config,
34781
+ throwOnError: config.throwOnError ?? true
34782
+ }));
34783
+ }
34784
+ /**
34785
+ * {@link /c/:company/hosting/source/ssh/connections}
34786
+ */
34787
+ function hostingSshSourcesStore(options) {
34788
+ const { client: request = client, ...config } = options;
34789
+ return withUnwrap(request({
34790
+ method: "POST",
34791
+ url: "/c/{company}/hosting/source/ssh/connections",
34792
+ security: [{
34793
+ type: "http",
34794
+ scheme: "bearer"
34795
+ }],
34796
+ ...config,
34797
+ throwOnError: config.throwOnError ?? true
34798
+ }));
34799
+ }
34800
+ /**
34801
+ * {@link /c/:company/hosting/source/ssh/connections/:connectionUuid}
34802
+ */
34803
+ function hostingSshSourcesShow(options) {
34804
+ const { client: request = client, ...config } = options;
34805
+ return withUnwrap(request({
34806
+ method: "GET",
34807
+ url: "/c/{company}/hosting/source/ssh/connections/{connectionUuid}",
34808
+ security: [{
34809
+ type: "http",
34810
+ scheme: "bearer"
34811
+ }],
34812
+ ...config,
34813
+ throwOnError: config.throwOnError ?? true
34814
+ }));
34815
+ }
34816
+ /**
34817
+ * {@link /c/:company/hosting/source/ssh/connections/:connectionUuid}
34818
+ */
34819
+ function hostingSshSourcesUpdate(options) {
34820
+ const { client: request = client, ...config } = options;
34821
+ return withUnwrap(request({
34822
+ method: "PATCH",
34823
+ url: "/c/{company}/hosting/source/ssh/connections/{connectionUuid}",
34824
+ security: [{
34825
+ type: "http",
34826
+ scheme: "bearer"
34827
+ }],
34828
+ ...config,
34829
+ throwOnError: config.throwOnError ?? true
34830
+ }));
34831
+ }
34832
+ /**
34833
+ * @description The fingerprint is compared with the discovered value by the service; a value the platform
34834
+ * supplied is refused, so this step is meaningful rather than an acknowledgement.
34835
+ * @summary Accept the server identity the client confirmed out of band
34836
+ * {@link /c/:company/hosting/source/ssh/connections/:connectionUuid/host-key/confirm}
34837
+ */
34838
+ function hostingSshSourcesConfirmHostKey(options) {
34839
+ const { client: request = client, ...config } = options;
34840
+ return withUnwrap(request({
34841
+ method: "POST",
34842
+ url: "/c/{company}/hosting/source/ssh/connections/{connectionUuid}/host-key/confirm",
34843
+ security: [{
34844
+ type: "http",
34845
+ scheme: "bearer"
34846
+ }],
34847
+ ...config,
34848
+ throwOnError: config.throwOnError ?? true
34849
+ }));
34850
+ }
34851
+ /**
34852
+ * @description This fetches and discards: it records whether access worked, and stores no source. A refusal is
34853
+ * recorded on the connection before it is returned, so the reason survives the response.
34854
+ * @summary Prove the key is installed on the server and can read the repository
34855
+ * {@link /c/:company/hosting/source/ssh/connections/:connectionUuid/verify}
34856
+ */
34857
+ function hostingSshSourcesVerify(options) {
34858
+ const { client: request = client, ...config } = options;
34859
+ return withUnwrap(request({
34860
+ method: "POST",
34861
+ url: "/c/{company}/hosting/source/ssh/connections/{connectionUuid}/verify",
34862
+ security: [{
34863
+ type: "http",
34864
+ scheme: "bearer"
34865
+ }],
34866
+ ...config,
34867
+ throwOnError: config.throwOnError ?? true
34868
+ }));
34869
+ }
34870
+ /**
34871
+ * @description Forward-only: the old key stops being used at once, and the earlier verification is cleared
34872
+ * because it described a key that no longer exists.
34873
+ * @summary Replace the deploy key
34874
+ * {@link /c/:company/hosting/source/ssh/connections/:connectionUuid/deploy-key/rotate}
34875
+ */
34876
+ function hostingSshSourcesRotateKey(options) {
34877
+ const { client: request = client, ...config } = options;
34878
+ return withUnwrap(request({
34879
+ method: "POST",
34880
+ url: "/c/{company}/hosting/source/ssh/connections/{connectionUuid}/deploy-key/rotate",
34881
+ security: [{
34882
+ type: "http",
34883
+ scheme: "bearer"
34884
+ }],
34885
+ ...config,
34886
+ throwOnError: config.throwOnError ?? true
34887
+ }));
34888
+ }
34889
+ /**
34890
+ * @summary Retire a source. A running release is unchanged; the source stops fetching
34891
+ * {@link /c/:company/hosting/source/ssh/connections/:connectionUuid/revoke}
34892
+ */
34893
+ function hostingSshSourcesRevoke(options) {
34894
+ const { client: request = client, ...config } = options;
34895
+ return withUnwrap(request({
34896
+ method: "POST",
34897
+ url: "/c/{company}/hosting/source/ssh/connections/{connectionUuid}/revoke",
34898
+ security: [{
34899
+ type: "http",
34900
+ scheme: "bearer"
34901
+ }],
34902
+ ...config,
34903
+ throwOnError: config.throwOnError ?? true
34904
+ }));
34905
+ }
34906
+ /**
34704
34907
  * {@link /c/:company/hosting/environments/:environmentUuid/storage-usage}
34705
34908
  */
34706
34909
  function hostingEnvironmentsStorageUsage(options) {
@@ -36395,7 +36598,7 @@ function yahooFeedbackUpdate(options) {
36395
36598
  }
36396
36599
  //#endregion
36397
36600
  //#region src/commands/auth-account.ts
36398
- var USAGE$52 = [
36601
+ var USAGE$54 = [
36399
36602
  "Usage: hostingctl auth closure show",
36400
36603
  " hostingctl auth closure request --reason <text> (--current-password-file <path>|--current-password-stdin)",
36401
36604
  " hostingctl auth picture set --image-file <path>",
@@ -36419,26 +36622,26 @@ async function account$1(context, subcommand, rest) {
36419
36622
  if (subcommand === "closure") return await closure(context, action, tail);
36420
36623
  if (subcommand === "picture") return await picture(context, action, tail);
36421
36624
  if (subcommand === "notifications") return await notifications(context, action, tail);
36422
- throw new UsageError(USAGE$52);
36625
+ throw new UsageError(USAGE$54);
36423
36626
  }
36424
36627
  /** `auth closure show|request`. */
36425
36628
  async function closure(context, action, tail) {
36426
- if (tail.length > 0) throw new UsageError(USAGE$52);
36629
+ if (tail.length > 0) throw new UsageError(USAGE$54);
36427
36630
  if (action === "show") return (await accountClosureShow({})).data;
36428
36631
  if (action === "request") return await closeAccount(context);
36429
- throw new UsageError(USAGE$52);
36632
+ throw new UsageError(USAGE$54);
36430
36633
  }
36431
36634
  /** `auth picture set|remove`. */
36432
36635
  async function picture(context, action, tail) {
36433
- if (tail.length > 0) throw new UsageError(USAGE$52);
36636
+ if (tail.length > 0) throw new UsageError(USAGE$54);
36434
36637
  if (action === "set") return await setPicture(context);
36435
36638
  if (action === "remove") return await removePicture(context);
36436
- throw new UsageError(USAGE$52);
36639
+ throw new UsageError(USAGE$54);
36437
36640
  }
36438
36641
  /** `auth notifications`, `read <id>` or `read-all`. */
36439
36642
  async function notifications(context, action, tail) {
36440
36643
  if (action === void 0) {
36441
- if (tail.length > 0) throw new UsageError(USAGE$52);
36644
+ if (tail.length > 0) throw new UsageError(USAGE$54);
36442
36645
  return await allPages(async (page, perPage) => {
36443
36646
  const answer = await notificationIndex({ query: {
36444
36647
  page,
@@ -36454,7 +36657,7 @@ async function notifications(context, action, tail) {
36454
36657
  await notificationMarkAllRead({});
36455
36658
  return null;
36456
36659
  });
36457
- if (action !== "read" || tail.length !== 1) throw new UsageError(USAGE$52);
36660
+ if (action !== "read" || tail.length !== 1) throw new UsageError(USAGE$54);
36458
36661
  const notification = tail[0] ?? "";
36459
36662
  return await confirmableWrite(context, `Mark notification ${notification} read.`, async () => {
36460
36663
  await notificationMarkRead({ path: { notification } });
@@ -36470,11 +36673,11 @@ async function notifications(context, action, tail) {
36470
36673
  */
36471
36674
  async function closeAccount(context) {
36472
36675
  const reason = context.flags.get("--reason")?.trim() ?? "";
36473
- if (reason === "") throw new UsageError(`closure request needs --reason.\n\n${USAGE$52}`);
36676
+ if (reason === "") throw new UsageError(`closure request needs --reason.\n\n${USAGE$54}`);
36474
36677
  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 () => {
36475
36678
  const review = (await accountClosureShow({})).data;
36476
36679
  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"));
36477
- const currentPassword = readSecret(context, "current-password", 1024, USAGE$52);
36680
+ const currentPassword = readSecret(context, "current-password", 1024, USAGE$54);
36478
36681
  return (await accountClosureStore({ body: {
36479
36682
  reason,
36480
36683
  reviewedDigest: review.digest,
@@ -36486,7 +36689,7 @@ async function closeAccount(context) {
36486
36689
  async function setPicture(context) {
36487
36690
  const file = context.flags.get("--image-file") ?? "";
36488
36691
  return await confirmableWrite(context, file === "" ? "Set the profile picture." : `Set the profile picture to ${file}.`, async () => {
36489
- return (await profilePictureStore({ body: await imageUpload(file, USAGE$52) })).data;
36692
+ return (await profilePictureStore({ body: await imageUpload(file, USAGE$54) })).data;
36490
36693
  });
36491
36694
  }
36492
36695
  /** `auth picture remove`. */
@@ -36497,7 +36700,7 @@ async function removePicture(context) {
36497
36700
  }
36498
36701
  //#endregion
36499
36702
  //#region src/commands/auth-identity.ts
36500
- var USAGE$51 = [
36703
+ var USAGE$53 = [
36501
36704
  "Usage: hostingctl auth profile [--name <name>] [--email <email>] [--current-password-file <path>]",
36502
36705
  " hostingctl auth password (--current-password-file <path>|--current-password-stdin) (--new-password-file <path>|--new-password-stdin)",
36503
36706
  " hostingctl auth register --name <name> --email <email> (--password-file <path>|--password-stdin)",
@@ -36520,14 +36723,14 @@ var USAGE$51 = [
36520
36723
  var MAX_PASSWORD_BYTES = 1024;
36521
36724
  var MAX_TOKEN_BYTES = 4096;
36522
36725
  /** One required flag's value, or a refusal naming the flag. */
36523
- function required$3(context, flag) {
36726
+ function required$4(context, flag) {
36524
36727
  const value = context.flags.get(flag)?.trim() ?? "";
36525
- if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$51}`);
36728
+ if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$53}`);
36526
36729
  return value;
36527
36730
  }
36528
36731
  /** No positional arguments: every input here is a flag or a secret source. */
36529
36732
  function noPositional(rest) {
36530
- if (rest.length > 0) throw new UsageError(USAGE$51);
36733
+ if (rest.length > 0) throw new UsageError(USAGE$53);
36531
36734
  }
36532
36735
  /** The API's password contract takes a confirmation; the CLI's one input is the new password itself. */
36533
36736
  function passwordBody(password) {
@@ -36550,16 +36753,16 @@ async function identity(context, subcommand, rest) {
36550
36753
  if (subcommand === "forgot-password") return await forgotPassword(context);
36551
36754
  if (subcommand === "reset-password") return await resetPassword(context);
36552
36755
  if (subcommand === "verify-email") return await verifyEmail(context);
36553
- throw new UsageError(USAGE$51);
36756
+ throw new UsageError(USAGE$53);
36554
36757
  }
36555
36758
  /** `auth profile`: the account's own name and email, with the current password only when the email changes. */
36556
36759
  async function profile$2(context) {
36557
36760
  const name = context.flags.get("--name")?.trim() ?? "";
36558
36761
  const email = context.flags.get("--email")?.trim() ?? "";
36559
- 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$51}`);
36762
+ 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$53}`);
36560
36763
  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 () => {
36561
36764
  const current = (await authMe({})).data;
36562
- const currentPassword = hasSecret(context, "current-password") ? readSecret(context, "current-password", MAX_PASSWORD_BYTES, USAGE$51) : void 0;
36765
+ const currentPassword = hasSecret(context, "current-password") ? readSecret(context, "current-password", MAX_PASSWORD_BYTES, USAGE$53) : void 0;
36563
36766
  return (await authUpdateProfile({ body: {
36564
36767
  name: name === "" ? current.name ?? "" : name,
36565
36768
  email: email === "" ? current.email ?? "" : email,
@@ -36575,36 +36778,36 @@ function hasSecret(context, name) {
36575
36778
  async function password$1(context) {
36576
36779
  return await confirmableWrite(context, "Change the account's password.", async () => {
36577
36780
  return (await authChangePassword({ body: {
36578
- currentPassword: readSecret(context, "current-password", MAX_PASSWORD_BYTES, USAGE$51),
36579
- ...passwordBody(readSecret(context, "new-password", MAX_PASSWORD_BYTES, USAGE$51))
36781
+ currentPassword: readSecret(context, "current-password", MAX_PASSWORD_BYTES, USAGE$53),
36782
+ ...passwordBody(readSecret(context, "new-password", MAX_PASSWORD_BYTES, USAGE$53))
36580
36783
  } })).data;
36581
36784
  });
36582
36785
  }
36583
36786
  /** `auth register`: a new account, which needs no session. */
36584
36787
  async function register$1(context) {
36585
- const name = required$3(context, "--name");
36586
- const email = required$3(context, "--email");
36788
+ const name = required$4(context, "--name");
36789
+ const email = required$4(context, "--email");
36587
36790
  return await confirmableWrite(context, `Create the account ${email} for ${name}.`, async () => {
36588
36791
  return (await authRegister({ body: {
36589
36792
  name,
36590
36793
  email,
36591
- ...passwordBody(readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$51))
36794
+ ...passwordBody(readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$53))
36592
36795
  } })).data;
36593
36796
  });
36594
36797
  }
36595
36798
  /** `auth forgot-password`: the API answers the same way for any address, so the output claims nothing more. */
36596
36799
  async function forgotPassword(context) {
36597
- const email = required$3(context, "--email");
36800
+ const email = required$4(context, "--email");
36598
36801
  return await confirmableWrite(context, `Ask for a password reset mail for ${email}.`, async () => {
36599
36802
  return (await authForgotPassword({ body: { email } })).data;
36600
36803
  });
36601
36804
  }
36602
36805
  /** `auth reset-password`: the token from the mail, the address it was sent to, and the new password. */
36603
36806
  async function resetPassword(context) {
36604
- const email = required$3(context, "--email");
36807
+ const email = required$4(context, "--email");
36605
36808
  return await confirmableWrite(context, `Reset the password for ${email}.`, async () => {
36606
- const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$51);
36607
- const password = readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$51);
36809
+ const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$53);
36810
+ const password = readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$53);
36608
36811
  return (await authResetPassword({ body: {
36609
36812
  token,
36610
36813
  email,
@@ -36620,7 +36823,7 @@ async function verifyEmail(context) {
36620
36823
  }
36621
36824
  //#endregion
36622
36825
  //#region src/commands/auth-impersonation.ts
36623
- var USAGE$50 = [
36826
+ var USAGE$52 = [
36624
36827
  "Usage: hostingctl auth impersonate start --target <user-uuid> --company <slug> --reason <text> [--minutes <n>] --store-as <profile>",
36625
36828
  " hostingctl auth impersonate status",
36626
36829
  " hostingctl auth impersonate stop",
@@ -36653,7 +36856,7 @@ async function impersonation(context, rest) {
36653
36856
  if (action === "stop" && tail.length === 0) return await stop(context);
36654
36857
  if (action === "list" && tail.length === 0) return await list$5();
36655
36858
  if (action === "end" && tail.length === 1) return await end(context, tail[0] ?? "");
36656
- throw new UsageError(USAGE$50);
36859
+ throw new UsageError(USAGE$52);
36657
36860
  }
36658
36861
  /** `start`: mint a token for another user, and keep it in a profile of its own. */
36659
36862
  async function start(context) {
@@ -36661,8 +36864,8 @@ async function start(context) {
36661
36864
  const company = context.flags.get("--company")?.trim() ?? "";
36662
36865
  const reason = context.flags.get("--reason")?.trim() ?? "";
36663
36866
  const storeAs = context.flags.get("--store-as")?.trim() ?? "";
36664
- if (target === "" || company === "" || reason === "") throw new UsageError(`start needs --target, --company and --reason.\n\n${USAGE$50}`);
36665
- if (storeAs === "") throw new UsageError(`start needs --store-as <profile>.\n\n${USAGE$50}`);
36867
+ if (target === "" || company === "" || reason === "") throw new UsageError(`start needs --target, --company and --reason.\n\n${USAGE$52}`);
36868
+ if (storeAs === "") throw new UsageError(`start needs --store-as <profile>.\n\n${USAGE$52}`);
36666
36869
  const minutes = wholeNumberFlag(context.flags, "--minutes") ?? DEFAULT_MINUTES;
36667
36870
  const document = await readProfiles();
36668
36871
  const operator = namedProfile(context.flags, document);
@@ -36756,7 +36959,7 @@ async function list$5() {
36756
36959
  }
36757
36960
  /** `end <uuid>`: end one recorded session by its uuid. */
36758
36961
  async function end(context, uuid) {
36759
- if (uuid === "") throw new UsageError(USAGE$50);
36962
+ if (uuid === "") throw new UsageError(USAGE$52);
36760
36963
  return await confirmableWrite(context, `End impersonation session ${uuid}.`, async () => ({
36761
36964
  ...EMPTY,
36762
36965
  action: "end",
@@ -36765,7 +36968,7 @@ async function end(context, uuid) {
36765
36968
  }
36766
36969
  //#endregion
36767
36970
  //#region src/commands/auth-push.ts
36768
- var USAGE$49 = [
36971
+ var USAGE$51 = [
36769
36972
  "Usage: hostingctl auth push-token set (--token-file <path>|--token-stdin)",
36770
36973
  " hostingctl auth push-token remove (--token-file <path>|--token-stdin)",
36771
36974
  "",
@@ -36776,12 +36979,12 @@ var USAGE$49 = [
36776
36979
  /** `auth push-token set|remove`: this account's mobile push registration. */
36777
36980
  async function authPush(context, rest) {
36778
36981
  const [action, ...tail] = rest;
36779
- if (tail.length > 0) throw new UsageError(USAGE$49);
36982
+ if (tail.length > 0) throw new UsageError(USAGE$51);
36780
36983
  if (action === "set") return {
36781
36984
  kind: "push-token",
36782
36985
  action: "set",
36783
36986
  sent: (await confirmableWrite(context, "Register this device's push token.", async () => {
36784
- await expoTokenStore({ body: { token: readSecret(context, "token", 4096, USAGE$49) } });
36987
+ await expoTokenStore({ body: { token: readSecret(context, "token", 4096, USAGE$51) } });
36785
36988
  return null;
36786
36989
  })).sent
36787
36990
  };
@@ -36789,11 +36992,11 @@ async function authPush(context, rest) {
36789
36992
  kind: "push-token",
36790
36993
  action: "remove",
36791
36994
  sent: (await confirmableWrite(context, "Remove this device's push token.", async () => {
36792
- await expoTokenDestroy({ query: { token: readSecret(context, "token", 4096, USAGE$49) } });
36995
+ await expoTokenDestroy({ query: { token: readSecret(context, "token", 4096, USAGE$51) } });
36793
36996
  return null;
36794
36997
  })).sent
36795
36998
  };
36796
- throw new UsageError(USAGE$49);
36999
+ throw new UsageError(USAGE$51);
36797
37000
  }
36798
37001
  /** The `auth push-token` renderer. */
36799
37002
  function authPushText(report) {
@@ -36944,47 +37147,47 @@ var AUTH_METADATA = {
36944
37147
  var AUTH_TOPICS = [
36945
37148
  {
36946
37149
  path: ["profile"],
36947
- usage: USAGE$51
37150
+ usage: USAGE$53
36948
37151
  },
36949
37152
  {
36950
37153
  path: ["password"],
36951
- usage: USAGE$51
37154
+ usage: USAGE$53
36952
37155
  },
36953
37156
  {
36954
37157
  path: ["register"],
36955
- usage: USAGE$51
37158
+ usage: USAGE$53
36956
37159
  },
36957
37160
  {
36958
37161
  path: ["forgot-password"],
36959
- usage: USAGE$51
37162
+ usage: USAGE$53
36960
37163
  },
36961
37164
  {
36962
37165
  path: ["reset-password"],
36963
- usage: USAGE$51
37166
+ usage: USAGE$53
36964
37167
  },
36965
37168
  {
36966
37169
  path: ["verify-email"],
36967
- usage: USAGE$51
37170
+ usage: USAGE$53
36968
37171
  },
36969
37172
  {
36970
37173
  path: ["closure"],
36971
- usage: USAGE$52
37174
+ usage: USAGE$54
36972
37175
  },
36973
37176
  {
36974
37177
  path: ["picture"],
36975
- usage: USAGE$52
37178
+ usage: USAGE$54
36976
37179
  },
36977
37180
  {
36978
37181
  path: ["notifications"],
36979
- usage: USAGE$52
37182
+ usage: USAGE$54
36980
37183
  },
36981
37184
  {
36982
37185
  path: ["push-token"],
36983
- usage: USAGE$49
37186
+ usage: USAGE$51
36984
37187
  },
36985
37188
  {
36986
37189
  path: ["impersonate"],
36987
- usage: USAGE$50
37190
+ usage: USAGE$52
36988
37191
  }
36989
37192
  ];
36990
37193
  //#endregion
@@ -37524,7 +37727,7 @@ var MAILBOX_TOPICS = [{
37524
37727
  }];
37525
37728
  //#endregion
37526
37729
  //#region src/commands/mailbox-recovery.ts
37527
- var USAGE$48 = [
37730
+ var USAGE$50 = [
37528
37731
  "Usage: hostingctl mailbox recovery <request|verify|reset> [options]",
37529
37732
  "",
37530
37733
  " request --address <address> Ask for a self-service reset link for a mailbox address.",
@@ -37552,16 +37755,16 @@ function isSessionlessMailboxCommand(argv) {
37552
37755
  /** `mailbox recovery request|verify|reset`: the unauthenticated, token-authorized recovery journey. */
37553
37756
  async function runMailboxRecovery(context, rest) {
37554
37757
  const [action, extra] = rest;
37555
- if (extra !== void 0) throw new UsageError(USAGE$48);
37758
+ if (extra !== void 0) throw new UsageError(USAGE$50);
37556
37759
  if (action === "request") return await request$1(context);
37557
37760
  if (action === "verify") return await verify$1(context);
37558
37761
  if (action === "reset") return await reset(context);
37559
- throw new UsageError(USAGE$48);
37762
+ throw new UsageError(USAGE$50);
37560
37763
  }
37561
37764
  /** `request`: the answer is deliberately identical whether or not an eligible mailbox exists. */
37562
37765
  async function request$1(context) {
37563
37766
  const address = context.flags.get("--address");
37564
- if (address === void 0 || address === "") throw new UsageError(USAGE$48);
37767
+ if (address === void 0 || address === "") throw new UsageError(USAGE$50);
37565
37768
  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);
37566
37769
  }
37567
37770
  /** `verify`: the token is read only when the send actually happens, so a dry run never touches a secret. */
@@ -37582,7 +37785,7 @@ async function reset(context) {
37582
37785
  }
37583
37786
  /** One recovery token or new password, read from a private file or stdin under the recovery bound. */
37584
37787
  function recoverySecret(context, name) {
37585
- return readSecret(context, name, MAX_RECOVERY_SECRET_BYTES, USAGE$48);
37788
+ return readSecret(context, name, MAX_RECOVERY_SECRET_BYTES, USAGE$50);
37586
37789
  }
37587
37790
  //#endregion
37588
37791
  //#region src/commands/mailbox.ts
@@ -37718,7 +37921,7 @@ async function environmentGeneration(path) {
37718
37921
  //#endregion
37719
37922
  //#region src/commands/access-credentials.ts
37720
37923
  /** The usage this module refuses with, owned by the commands it implements. */
37721
- var USAGE$47 = [
37924
+ var USAGE$49 = [
37722
37925
  "Usage: hostingctl access key add <environment-uuid> --company <slug> --access-user <uuid> --name <n> --public-key-file <path>",
37723
37926
  " hostingctl access key remove <environment-uuid> --company <slug> --access-user <uuid> <key-uuid>",
37724
37927
  " hostingctl access password set <environment-uuid> --company <slug> --access-user <uuid> (--password-file <path>|--password-stdin)",
@@ -37736,12 +37939,12 @@ var USAGE$47 = [
37736
37939
  /** `key add|remove`. */
37737
37940
  async function key(context, path, action, tail) {
37738
37941
  const accessUserUuid = context.flags.get("--access-user") ?? "";
37739
- if (accessUserUuid === "") throw new UsageError(`key needs --access-user.\\n\\n${USAGE$47}`);
37942
+ if (accessUserUuid === "") throw new UsageError(`key needs --access-user.\\n\\n${USAGE$49}`);
37740
37943
  if (action === "add") {
37741
- if (tail.length > 0) throw new UsageError(USAGE$47);
37944
+ if (tail.length > 0) throw new UsageError(USAGE$49);
37742
37945
  const name = context.flags.get("--name")?.trim() ?? "";
37743
37946
  const file = context.flags.get("--public-key-file") ?? "";
37744
- if (name === "" || file === "") throw new UsageError(`key add needs --name and --public-key-file.\\n\\n${USAGE$47}`);
37947
+ if (name === "" || file === "") throw new UsageError(`key add needs --name and --public-key-file.\\n\\n${USAGE$49}`);
37745
37948
  const publicKey = readPrivateFile(file, "public key", 8192).trim();
37746
37949
  return await confirmableWrite(context, `Add key "${name}" to login ${accessUserUuid}.`, async () => {
37747
37950
  const body = {
@@ -37760,7 +37963,7 @@ async function key(context, path, action, tail) {
37760
37963
  }
37761
37964
  if (action === "remove") {
37762
37965
  const [keyUuid, ...extra] = tail;
37763
- if (keyUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$47);
37966
+ if (keyUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$49);
37764
37967
  return await confirmableWrite(context, `Remove key ${keyUuid} from login ${accessUserUuid}.`, async () => {
37765
37968
  return (await hostingAccessDestroyKey({
37766
37969
  path: {
@@ -37772,18 +37975,18 @@ async function key(context, path, action, tail) {
37772
37975
  })).data;
37773
37976
  });
37774
37977
  }
37775
- throw new UsageError(USAGE$47);
37978
+ throw new UsageError(USAGE$49);
37776
37979
  }
37777
37980
  /** `password set|clear`. */
37778
37981
  async function password(context, path, action, tail) {
37779
37982
  const accessUserUuid = context.flags.get("--access-user") ?? "";
37780
- if (accessUserUuid === "" || tail.length > 0) throw new UsageError(`password needs --access-user.\\n\\n${USAGE$47}`);
37983
+ if (accessUserUuid === "" || tail.length > 0) throw new UsageError(`password needs --access-user.\\n\\n${USAGE$49}`);
37781
37984
  const userPath = {
37782
37985
  ...path,
37783
37986
  accessUserUuid
37784
37987
  };
37785
37988
  if (action === "set") return await confirmableWrite(context, "Set this login's password. The previous password stops working when the change is applied.", async () => {
37786
- const password = readSecret(context, "password", 1024, USAGE$47);
37989
+ const password = readSecret(context, "password", 1024, USAGE$49);
37787
37990
  const body = {
37788
37991
  desiredGeneration: await environmentGeneration(path),
37789
37992
  password,
@@ -37801,7 +38004,7 @@ async function password(context, path, action, tail) {
37801
38004
  query
37802
38005
  })).data;
37803
38006
  });
37804
- throw new UsageError(USAGE$47);
38007
+ throw new UsageError(USAGE$49);
37805
38008
  }
37806
38009
  //#endregion
37807
38010
  //#region src/commands/booleans.ts
@@ -37826,7 +38029,7 @@ function onOff$5(context, flag, usage) {
37826
38029
  }
37827
38030
  //#endregion
37828
38031
  //#region src/commands/access-admin.ts
37829
- var USAGE$46 = [
38032
+ var USAGE$48 = [
37830
38033
  "Usage: hostingctl access settings <environment-uuid> --company <slug>",
37831
38034
  " hostingctl access settings-set <environment-uuid> --company <slug> --password <on|off> --sftp-only <on|off>",
37832
38035
  " hostingctl access grants <environment-uuid> --company <slug>",
@@ -37854,7 +38057,7 @@ var USAGE$46 = [
37854
38057
  /** `access settings|settings-set|grants|grant|un-grant|key|password|user-show|user-set|received`. */
37855
38058
  async function accessAdmin(context, subcommand, rest) {
37856
38059
  if (subcommand === "received") {
37857
- if (rest.length > 0) throw new UsageError(USAGE$46);
38060
+ if (rest.length > 0) throw new UsageError(USAGE$48);
37858
38061
  return {
37859
38062
  kind: "received",
37860
38063
  grants: (await hostingAccessReceivedIndex({})).data.items
@@ -37862,37 +38065,37 @@ async function accessAdmin(context, subcommand, rest) {
37862
38065
  }
37863
38066
  const [first, ...after] = rest;
37864
38067
  const takesAction = subcommand === "key" || subcommand === "password";
37865
- const path = await environmentPath(context, takesAction ? after[0] : first, USAGE$46);
38068
+ const path = await environmentPath(context, takesAction ? after[0] : first, USAGE$48);
37866
38069
  const tail = takesAction ? after.slice(1) : after;
37867
38070
  return await routed(context, subcommand, path, first ?? "", tail);
37868
38071
  }
37869
38072
  /** One environment's admin subcommands, once the path is resolved. */
37870
38073
  async function routed(context, subcommand, path, action, tail) {
37871
38074
  if (subcommand === "settings") return await settings$1(path, tail);
37872
- if (subcommand === "settings-set") return await written$7(settingsSet(context, path, tail));
38075
+ if (subcommand === "settings-set") return await written$9(settingsSet(context, path, tail));
37873
38076
  if (subcommand === "grants") return await grants(path, tail);
37874
- if (subcommand === "grant") return await written$7(grant(context, path, tail));
37875
- if (subcommand === "un-grant") return await written$7(unGrant(context, path, tail));
37876
- if (subcommand === "key") return await written$7(key(context, path, action, tail));
37877
- if (subcommand === "password") return await written$7(password(context, path, action, tail));
38077
+ if (subcommand === "grant") return await written$9(grant(context, path, tail));
38078
+ if (subcommand === "un-grant") return await written$9(unGrant(context, path, tail));
38079
+ if (subcommand === "key") return await written$9(key(context, path, action, tail));
38080
+ if (subcommand === "password") return await written$9(password(context, path, action, tail));
37878
38081
  if (subcommand === "user-show") return await userShow(path, tail);
37879
- if (subcommand === "user-set") return await written$7(userSet(context, path, tail));
37880
- throw new UsageError(USAGE$46);
38082
+ if (subcommand === "user-set") return await written$9(userSet(context, path, tail));
38083
+ throw new UsageError(USAGE$48);
37881
38084
  }
37882
38085
  /** Tag one write's outcome with the group that produced it. */
37883
- async function written$7(pending) {
38086
+ async function written$9(pending) {
37884
38087
  return {
37885
38088
  kind: "write",
37886
38089
  outcome: await pending
37887
38090
  };
37888
38091
  }
37889
38092
  /** A company-wide read takes no positionals. */
37890
- function noExtra$18(rest) {
37891
- if (rest.length > 0) throw new UsageError(USAGE$46);
38093
+ function noExtra$20(rest) {
38094
+ if (rest.length > 0) throw new UsageError(USAGE$48);
37892
38095
  }
37893
38096
  /** `settings`. */
37894
38097
  async function settings$1(path, rest) {
37895
- noExtra$18(rest);
38098
+ noExtra$20(rest);
37896
38099
  return {
37897
38100
  kind: "settings",
37898
38101
  access: (await hostingAccessShow({ path })).data
@@ -37900,9 +38103,9 @@ async function settings$1(path, rest) {
37900
38103
  }
37901
38104
  /** `settings-set --password … --sftp-only …`. */
37902
38105
  async function settingsSet(context, path, rest) {
37903
- noExtra$18(rest);
37904
- const passwordEnabled = onOff$5(context, "--password", USAGE$46);
37905
- const sftpOnly = onOff$5(context, "--sftp-only", USAGE$46);
38106
+ noExtra$20(rest);
38107
+ const passwordEnabled = onOff$5(context, "--password", USAGE$48);
38108
+ const sftpOnly = onOff$5(context, "--sftp-only", USAGE$48);
37906
38109
  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 () => {
37907
38110
  return (await hostingAccessUpdate({
37908
38111
  path,
@@ -37916,7 +38119,7 @@ async function settingsSet(context, path, rest) {
37916
38119
  }
37917
38120
  /** `grants`. */
37918
38121
  async function grants(path, rest) {
37919
- noExtra$18(rest);
38122
+ noExtra$20(rest);
37920
38123
  return {
37921
38124
  kind: "grants",
37922
38125
  grants: (await hostingAccessGrantIndex({ path })).data.items
@@ -37924,10 +38127,10 @@ async function grants(path, rest) {
37924
38127
  }
37925
38128
  /** `grant --user … --access-user …`. */
37926
38129
  async function grant(context, path, rest) {
37927
- noExtra$18(rest);
38130
+ noExtra$20(rest);
37928
38131
  const userUuid = context.flags.get("--user") ?? "";
37929
38132
  const accessUserUuid = context.flags.get("--access-user") ?? "";
37930
- if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$46}`);
38133
+ if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$48}`);
37931
38134
  return await confirmableWrite(context, `Grant user ${userUuid} the login ${accessUserUuid} on this environment.`, async () => {
37932
38135
  return (await hostingAccessGrantStore({
37933
38136
  path,
@@ -37942,7 +38145,7 @@ async function grant(context, path, rest) {
37942
38145
  /** `un-grant <grant-uuid>`. */
37943
38146
  async function unGrant(context, path, rest) {
37944
38147
  const [grantUuid, ...extra] = rest;
37945
- if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$46);
38148
+ if (grantUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$48);
37946
38149
  return await confirmableWrite(context, `Withdraw grant ${grantUuid}. The login stays; only this account's access to it ends.`, async () => {
37947
38150
  const query = { desiredGeneration: await environmentGeneration(path) };
37948
38151
  return (await hostingAccessGrantDestroy({
@@ -37957,7 +38160,7 @@ async function unGrant(context, path, rest) {
37957
38160
  /** `user-show <access-user-uuid>`. */
37958
38161
  async function userShow(path, rest) {
37959
38162
  const [accessUserUuid, ...extra] = rest;
37960
- if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$46);
38163
+ if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$48);
37961
38164
  return {
37962
38165
  kind: "user",
37963
38166
  user: (await hostingAccessShowUser({ path: {
@@ -37969,7 +38172,7 @@ async function userShow(path, rest) {
37969
38172
  /** `user-set <access-user-uuid> [--name] [--enabled] [--read-only]`. */
37970
38173
  async function userSet(context, path, rest) {
37971
38174
  const [accessUserUuid, ...extra] = rest;
37972
- if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$46);
38175
+ if (accessUserUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$48);
37973
38176
  const userPath = {
37974
38177
  ...path,
37975
38178
  accessUserUuid
@@ -37978,7 +38181,7 @@ async function userSet(context, path, rest) {
37978
38181
  const name = context.flags.get("--name")?.trim();
37979
38182
  const enabled = onOffFlag(context, "--enabled");
37980
38183
  const readOnly = onOffFlag(context, "--read-only");
37981
- if (name === void 0 && enabled === null && readOnly === null) throw new UsageError(`user-set needs --name, --enabled, --read-only or a combination.\\n\\n${USAGE$46}`);
38184
+ if (name === void 0 && enabled === null && readOnly === null) throw new UsageError(`user-set needs --name, --enabled, --read-only or a combination.\\n\\n${USAGE$48}`);
37982
38185
  const body = {
37983
38186
  desiredGeneration: await environmentGeneration(path),
37984
38187
  name: name === void 0 || name === "" ? current.name : name,
@@ -38130,43 +38333,43 @@ var ACCESS_METADATA = {
38130
38333
  var ACCESS_TOPICS = [
38131
38334
  {
38132
38335
  path: ["settings"],
38133
- usage: USAGE$46
38336
+ usage: USAGE$48
38134
38337
  },
38135
38338
  {
38136
38339
  path: ["settings-set"],
38137
- usage: USAGE$46
38340
+ usage: USAGE$48
38138
38341
  },
38139
38342
  {
38140
38343
  path: ["grants"],
38141
- usage: USAGE$46
38344
+ usage: USAGE$48
38142
38345
  },
38143
38346
  {
38144
38347
  path: ["grant"],
38145
- usage: USAGE$46
38348
+ usage: USAGE$48
38146
38349
  },
38147
38350
  {
38148
38351
  path: ["un-grant"],
38149
- usage: USAGE$46
38352
+ usage: USAGE$48
38150
38353
  },
38151
38354
  {
38152
38355
  path: ["user-show"],
38153
- usage: USAGE$46
38356
+ usage: USAGE$48
38154
38357
  },
38155
38358
  {
38156
38359
  path: ["user-set"],
38157
- usage: USAGE$46
38360
+ usage: USAGE$48
38158
38361
  },
38159
38362
  {
38160
38363
  path: ["received"],
38161
- usage: USAGE$46
38364
+ usage: USAGE$48
38162
38365
  },
38163
38366
  {
38164
38367
  path: ["key"],
38165
- usage: USAGE$47
38368
+ usage: USAGE$49
38166
38369
  },
38167
38370
  {
38168
38371
  path: ["password"],
38169
- usage: USAGE$47
38372
+ usage: USAGE$49
38170
38373
  }
38171
38374
  ];
38172
38375
  //#endregion
@@ -38388,7 +38591,7 @@ var ADMIN_ACTIONS = /* @__PURE__ */ new Set([
38388
38591
  ]);
38389
38592
  //#endregion
38390
38593
  //#region src/commands/application-admin.ts
38391
- var USAGE$45 = [
38594
+ var USAGE$47 = [
38392
38595
  "Usage: hostingctl application administrator <environment-uuid> <application-uuid> --company <slug>",
38393
38596
  " hostingctl application administrator-reset|administrator-reveal <environment-uuid> <application-uuid> --company <slug>",
38394
38597
  " hostingctl application recovery-status|recovery-retry|recovery-cancel <environment-uuid> <application-uuid> <recovery-uuid> --company <slug>",
@@ -38406,7 +38609,7 @@ var USAGE$45 = [
38406
38609
  /** `application administrator*|recovery-*`, from the `application` command. */
38407
38610
  async function applicationAdmin(context, action, path, rest) {
38408
38611
  if (action === "administrator") {
38409
- noExtra$17(rest);
38612
+ noExtra$19(rest);
38410
38613
  return {
38411
38614
  kind: "administrator",
38412
38615
  administrator: (await hostingAdministratorShow({ path })).data
@@ -38415,7 +38618,7 @@ async function applicationAdmin(context, action, path, rest) {
38415
38618
  if (action === "administrator-reset") return await credential(context, path, rest, "reset");
38416
38619
  if (action === "administrator-reveal") return await credential(context, path, rest, "reveal");
38417
38620
  const [recoveryUuid, ...extra] = rest;
38418
- if (recoveryUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$45);
38621
+ if (recoveryUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$47);
38419
38622
  const recoveryPath = {
38420
38623
  ...path,
38421
38624
  recoveryUuid
@@ -38424,16 +38627,16 @@ async function applicationAdmin(context, action, path, rest) {
38424
38627
  kind: "recovery",
38425
38628
  recovery: (await hostingApplicationRecoveryStatus({ path: recoveryPath })).data
38426
38629
  };
38427
- if (action === "recovery-retry") return await written$6(confirmableWrite(context, "Retry the recovery step that failed.", async () => {
38630
+ if (action === "recovery-retry") return await written$8(confirmableWrite(context, "Retry the recovery step that failed.", async () => {
38428
38631
  return (await hostingApplicationRecoveryRetry({ path: recoveryPath })).data;
38429
38632
  }));
38430
- if (action === "recovery-cancel") return await written$6(confirmableWrite(context, "Cancel this recovery. Writers are released and the application returns to its previous state.", async () => (await hostingApplicationRecoveryCancel({ path: recoveryPath })).data));
38431
- throw new UsageError(USAGE$45);
38633
+ 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));
38634
+ throw new UsageError(USAGE$47);
38432
38635
  }
38433
38636
  /** `administrator-reset|reveal`: the one place the application's own password is printed. */
38434
38637
  async function credential(context, path, rest, kind) {
38435
- noExtra$17(rest);
38436
- return await written$6(confirmableWrite(context, kind === "reset" ? ["Set a new administrator password and return it once.", " A password changed inside the application is not this one; this credential is the platform's."].join("\n") : "Return the current administrator password once, recorded as its own audited action.", async () => {
38638
+ noExtra$19(rest);
38639
+ return await written$8(confirmableWrite(context, kind === "reset" ? ["Set a new administrator password and return it once.", " A password changed inside the application is not this one; this credential is the platform's."].join("\n") : "Return the current administrator password once, recorded as its own audited action.", async () => {
38437
38640
  return kind === "reset" ? (await hostingAdministratorReset({
38438
38641
  path,
38439
38642
  body: { confirm: true }
@@ -38441,15 +38644,15 @@ async function credential(context, path, rest, kind) {
38441
38644
  }));
38442
38645
  }
38443
38646
  /** Tag one write's outcome with the group that produced it. */
38444
- async function written$6(pending) {
38647
+ async function written$8(pending) {
38445
38648
  return {
38446
38649
  kind: "app-write",
38447
38650
  outcome: await pending
38448
38651
  };
38449
38652
  }
38450
38653
  /** No positional arguments, or a usage refusal. */
38451
- function noExtra$17(rest) {
38452
- if (rest.length > 0) throw new UsageError(USAGE$45);
38654
+ function noExtra$19(rest) {
38655
+ if (rest.length > 0) throw new UsageError(USAGE$47);
38453
38656
  }
38454
38657
  /** One recovery as one line: what it is doing, how far, and what it holds. */
38455
38658
  function recoveryLines$1(one) {
@@ -38485,31 +38688,89 @@ function applicationAdminText(report) {
38485
38688
  return recoveryLines$1(report.recovery).join("\n");
38486
38689
  }
38487
38690
  //#endregion
38691
+ //#region src/commands/application-usage.ts
38692
+ /** Every `application` invocation the command accepts, and what each one does. */
38693
+ var APPLICATION_USAGE = [
38694
+ "Usage: hostingctl application list <environment-uuid> --company <slug>",
38695
+ " hostingctl application show <environment-uuid> <workload-uuid> --company <slug>",
38696
+ " hostingctl application public-key <environment-uuid> <workload-uuid> --company <slug>",
38697
+ " hostingctl application speed-check <environment-uuid> <workload-uuid> --company <slug>",
38698
+ " hostingctl application deployment <environment-uuid> <workload-uuid> --company <slug>",
38699
+ " hostingctl application build <environment-uuid> <workload-uuid> --company <slug> [--source <selection-uuid> | --source-upload <upload-uuid> | --ssh-source <connection-uuid>] [--idempotency-key <key>]",
38700
+ " hostingctl application source-upload <environment-uuid> <workload-uuid> --company <slug> --file <path-to.zip>",
38701
+ " hostingctl application source-uploads <environment-uuid> <workload-uuid> --company <slug>",
38702
+ " hostingctl application source-upload-show <environment-uuid> <workload-uuid> <upload-uuid> --company <slug>",
38703
+ " hostingctl application source-upload-discard <environment-uuid> <workload-uuid> <upload-uuid> --company <slug>",
38704
+ " hostingctl application source-ssh-list --company <slug>",
38705
+ " hostingctl application source-ssh-show <connection-uuid> --company <slug>",
38706
+ " hostingctl application source-ssh-create --company <slug> --name <label> --repo <url> --ref <name> [--ref-kind branch|tag]",
38707
+ " hostingctl application source-ssh-update <connection-uuid> --company <slug> [--name <label>] [--ref <name>] [--ref-kind branch|tag]",
38708
+ " hostingctl application source-ssh-confirm-host-key <connection-uuid> --company <slug> --fingerprint <sha256>",
38709
+ " hostingctl application source-ssh-verify <connection-uuid> --company <slug>",
38710
+ " hostingctl application source-ssh-rotate-key <connection-uuid> --company <slug>",
38711
+ " hostingctl application source-ssh-revoke <connection-uuid> --company <slug>",
38712
+ " hostingctl application deploy <environment-uuid> <workload-uuid> <release-uuid> --company <slug>",
38713
+ " hostingctl application runs <environment-uuid> <workload-uuid> --company <slug>",
38714
+ " hostingctl application run-log <environment-uuid> <workload-uuid> <run-name> --company <slug>",
38715
+ " hostingctl application schedule-run <environment-uuid> <workload-uuid> <schedule-key> --company <slug>",
38716
+ " hostingctl application runtime <environment-uuid> <workload-uuid> --company <slug> --mode <stop|start|restart>",
38717
+ " hostingctl application component-settings <environment-uuid> <workload-uuid> --company <slug> --schemas <name>[,<name>…]",
38718
+ " hostingctl application component-settings <environment-uuid> <workload-uuid> --company <slug> [--signup|--no-signup] [--autoconfirm|--no-autoconfirm] [--otp-length <6-10>] [--otp-expiry-seconds <60-86400>]",
38719
+ " hostingctl application update <environment-uuid> <workload-uuid> --company <slug> --label <label>",
38720
+ " hostingctl application removal <environment-uuid> <workload-uuid> --company <slug>",
38721
+ " hostingctl application remove <environment-uuid> <workload-uuid> --company <slug>",
38722
+ "",
38723
+ " list|show The applications in an environment, and one in detail.",
38724
+ " public-key Read the component's publishable anonymous key (never its service/signing secrets).",
38725
+ " speed-check Three bounded HEAD timing, TLS and cache-header checks; not a browser audit.",
38726
+ " deployment The running, requested and interrupted builds and releases of one application.",
38727
+ " build Queue a build of the application's applied configuration from one source choice.",
38728
+ " source-upload Stage a ZIP of the project, review what it measured, then build from it.",
38729
+ " source-ssh-* Add, inspect, confirm, verify, rotate and retire a Git-over-SSH source.",
38730
+ " deploy Make an existing release the one the application runs.",
38731
+ " runs|run-log The process run history, and one run's own output.",
38732
+ " schedule-run Run a declared schedule now, beside the schedule's own runs.",
38733
+ " runtime Stop, start or restart the application's desired runtime.",
38734
+ " component-settings The schemas a REST component serves, or the sign-up, mail-confirmation and email-OTP",
38735
+ " values an auth component runs with. `show` publishes what the platform composes.",
38736
+ " update Rename an application's label only.",
38737
+ " removal|remove Review, then request, the withdrawal of one application and its runtime.",
38738
+ "",
38739
+ "The writes (build, deploy, schedule-run, update, remove, runtime, component-settings) need --confirm;",
38740
+ "--dry-run describes the change without sending it. remove re-reads the removal review to send its inventory",
38741
+ "digest; the retained-data retirement of an environment-owned database is a separate, later decision."
38742
+ ].join("\n");
38743
+ //#endregion
38488
38744
  //#region src/commands/application-builds.ts
38489
- var USAGE$44 = [
38490
- "Usage: hostingctl application build-log <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
38745
+ var USAGE$46 = [
38746
+ "Usage: hostingctl application build <environment-uuid> <application-uuid> --company <slug> [--source <selection-uuid> | --source-upload <upload-uuid> | --ssh-source <connection-uuid>] [--idempotency-key <key>]",
38747
+ " hostingctl application build-log <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
38491
38748
  " hostingctl application build-retry|build-cancel <environment-uuid> <application-uuid> <build-uuid> --company <slug>",
38492
38749
  " hostingctl application source-bind <environment-uuid> <application-uuid> --company <slug> --selection <uuid> [--branch <name>] [--tag <name>] [--auto-deploy <on|off>]",
38750
+ " hostingctl application source-bind <environment-uuid> <application-uuid> --company <slug> --ssh-source <uuid> [--branch <name>] [--tag <name>] [--auto-deploy <on|off>]",
38493
38751
  " hostingctl application source-unbind <environment-uuid> <application-uuid> --company <slug>",
38494
38752
  "",
38753
+ " build Queue a build of the application's applied configuration from one source choice.",
38495
38754
  " build-log The retained log of one build attempt.",
38496
38755
  " build-retry Run the same build again.",
38497
38756
  " build-cancel Stop a build that is still running.",
38498
- " source-bind Point the application at one selected repository and branch or tag.",
38757
+ " source-bind Point the application at one selected repository or SSH source, and a branch or tag.",
38499
38758
  " source-unbind Stop deploying from a repository.",
38500
38759
  "",
38501
- "A bind names a repository selection the connection already offers, so no token or URL is typed here.",
38502
- "The writes need --confirm; --dry-run describes the change without sending it."
38760
+ "A bind names a repository selection the connection already offers or a Git-over-SSH source the company",
38761
+ "owns, so no token or URL is typed here. The writes need --confirm; --dry-run describes the change without",
38762
+ "sending it."
38503
38763
  ].join("\n");
38504
38764
  /** `application build-*|source-*`, from the `application` command. */
38505
38765
  async function applicationBuilds(context, action, path, rest) {
38766
+ if (action === "build") return await build$1(context, path, rest);
38506
38767
  if (action === "source-unbind") {
38507
- noExtra$16(rest);
38508
- return await written$5(confirmableWrite(context, "Stop deploying this application from a repository. The running release stays.", async () => (await hostingDeploymentUnbindSource({ path })).data));
38768
+ noExtra$18(rest);
38769
+ return await written$7(confirmableWrite(context, "Stop deploying this application from a repository. The running release stays.", async () => (await hostingDeploymentUnbindSource({ path })).data));
38509
38770
  }
38510
38771
  if (action === "source-bind") return await bind$1(context, path, rest);
38511
38772
  const [buildUuid, ...extra] = rest;
38512
- if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$44);
38773
+ if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$46);
38513
38774
  const buildPath = {
38514
38775
  ...path,
38515
38776
  buildUuid
@@ -38518,28 +38779,37 @@ async function applicationBuilds(context, action, path, rest) {
38518
38779
  kind: "build-log",
38519
38780
  log: (await hostingDeploymentBuildLog({ path: buildPath })).data
38520
38781
  };
38521
- if (action === "build-retry") return await written$5(confirmableWrite(context, "Run this build again.", async () => {
38782
+ if (action === "build-retry") return await written$7(confirmableWrite(context, "Run this build again.", async () => {
38522
38783
  return (await hostingDeploymentRetry({ path: buildPath })).data;
38523
38784
  }));
38524
- if (action === "build-cancel") return await written$5(confirmableWrite(context, "Stop this build. A running build stops where it is.", async () => {
38785
+ if (action === "build-cancel") return await written$7(confirmableWrite(context, "Stop this build. A running build stops where it is.", async () => {
38525
38786
  return (await hostingDeploymentCancel({ path: buildPath })).data;
38526
38787
  }));
38527
- throw new UsageError(USAGE$44);
38788
+ throw new UsageError(USAGE$46);
38528
38789
  }
38529
- /** `source-bind --selection … [--branch …] [--tag …] [--auto-deploy …]`. */
38790
+ /**
38791
+ * `source-bind --selection … | --ssh-source … [--source-kind …] [--branch …] [--tag …] [--auto-deploy …]`.
38792
+ *
38793
+ * Exactly one of the two references is named, because a binding that named both would leave which source is
38794
+ * meant ambiguous rather than merely surprising.
38795
+ */
38530
38796
  async function bind$1(context, path, rest) {
38531
- noExtra$16(rest);
38532
- const repositorySelectionUuid = context.flags.get("--selection") ?? "";
38533
- if (repositorySelectionUuid === "") throw new UsageError(`source-bind needs --selection.\n\n${USAGE$44}`);
38797
+ noExtra$18(rest);
38798
+ const repositorySelectionUuid = context.flags.get("--selection")?.trim() ?? "";
38799
+ const sshSourceUuid = context.flags.get("--ssh-source")?.trim() ?? "";
38800
+ if (repositorySelectionUuid === "" === (sshSourceUuid === "")) throw new UsageError(`source-bind needs exactly one of --selection or --ssh-source.\n\n${USAGE$46}`);
38801
+ const sourceKind = sourceKindFlag(context, sshSourceUuid === "" ? "github" : "ssh");
38534
38802
  const branch = context.flags.get("--branch")?.trim();
38535
38803
  const tag = context.flags.get("--tag")?.trim();
38536
38804
  const autoDeploy = onOffFlag(context, "--auto-deploy");
38537
38805
  const ref = branch === void 0 || branch === "" ? tag ?? "" : branch;
38538
- return await written$5(confirmableWrite(context, `Deploy this application from the selected repository${ref === "" ? "" : ` at ${ref}`}${autoDeploy === true ? ", automatically on push" : ""}.`, async () => {
38806
+ return await written$7(confirmableWrite(context, `Deploy this application from ${sshSourceUuid === "" ? "the selected repository" : `SSH source ${sshSourceUuid}`}${ref === "" ? "" : ` at ${ref}`}${autoDeploy === true ? ", automatically on push" : ""}.`, async () => {
38539
38807
  return (await hostingDeploymentBindSource({
38540
38808
  path,
38541
38809
  body: {
38542
- repositorySelectionUuid,
38810
+ sourceKind,
38811
+ repositorySelectionUuid: repositorySelectionUuid === "" ? null : repositorySelectionUuid,
38812
+ sshSourceUuid: sshSourceUuid === "" ? null : sshSourceUuid,
38543
38813
  branch: branch === void 0 || branch === "" ? null : branch,
38544
38814
  tag: tag === void 0 || tag === "" ? null : tag,
38545
38815
  autoDeploy: autoDeploy ?? null
@@ -38547,16 +38817,63 @@ async function bind$1(context, path, rest) {
38547
38817
  })).data;
38548
38818
  }));
38549
38819
  }
38820
+ /** `--source-kind`, which must agree with the reference the bind names. */
38821
+ function sourceKindFlag(context, implied) {
38822
+ const value = context.flags.get("--source-kind")?.trim() ?? "";
38823
+ if (value === "") return implied;
38824
+ if (value !== "github" && value !== "ssh") throw new UsageError(`--source-kind must be github or ssh (got "${value}").\n\n${USAGE$46}`);
38825
+ if (value !== implied) throw new UsageError(`--source-kind ${value} does not match the ${implied} reference named.\n\n${USAGE$46}`);
38826
+ return value;
38827
+ }
38550
38828
  /** Tag one write's outcome with the group that produced it. */
38551
- async function written$5(pending) {
38829
+ async function written$7(pending) {
38552
38830
  return {
38553
38831
  kind: "build-write",
38554
38832
  outcome: await pending
38555
38833
  };
38556
38834
  }
38557
38835
  /** No positional arguments, or a usage refusal. */
38558
- function noExtra$16(rest) {
38559
- if (rest.length > 0) throw new UsageError(USAGE$44);
38836
+ function noExtra$18(rest) {
38837
+ if (rest.length > 0) throw new UsageError(USAGE$46);
38838
+ }
38839
+ /**
38840
+ * `build <env> <workload> [--source …|--source-upload …|--ssh-source …] [--idempotency-key …]`: queue a build.
38841
+ *
38842
+ * At most one source may be named, because the API accepts exactly one: a repository selection, a staged upload
38843
+ * or a Git-over-SSH source. Naming none builds from the application's own binding.
38844
+ */
38845
+ async function build$1(context, path, rest) {
38846
+ if (rest.length > 0) throw new UsageError(APPLICATION_USAGE);
38847
+ const selection = optionalFlag$1(context, "--source");
38848
+ const upload = optionalFlag$1(context, "--source-upload");
38849
+ const sshSource = optionalFlag$1(context, "--ssh-source");
38850
+ if ([
38851
+ selection,
38852
+ upload,
38853
+ sshSource
38854
+ ].filter((one) => one !== null).length > 1) throw new UsageError(`Name one source: --source, --source-upload or --ssh-source, not several.\n\n${APPLICATION_USAGE}`);
38855
+ const idempotencyKey = optionalFlag$1(context, "--idempotency-key");
38856
+ const body = {
38857
+ ...selection === null ? {} : { repositorySelectionUuid: selection },
38858
+ ...upload === null ? {} : { sourceUploadUuid: upload },
38859
+ ...sshSource === null ? {} : { sshSourceUuid: sshSource },
38860
+ ...idempotencyKey === null ? {} : { idempotencyKey }
38861
+ };
38862
+ return await written$7(confirmableWrite(context, [`Build application ${path.workloadUuid} from its applied configuration, ${sourceDescription(selection, upload, sshSource)}.`, "The source resolves to an exact commit or a measured archive digest; nothing here names a commit or an image."].join("\n"), async () => (await hostingDeploymentStore({
38863
+ path,
38864
+ body
38865
+ })).data));
38866
+ }
38867
+ /** Which source a build names, in the words the description uses. */
38868
+ function sourceDescription(selection, upload, sshSource) {
38869
+ if (upload !== null) return `staged upload ${upload}`;
38870
+ if (sshSource !== null) return `SSH source ${sshSource}`;
38871
+ return `generation source ${selection ?? "the bound selection"}`;
38872
+ }
38873
+ /** An optional flag's value, or null when it was not given. */
38874
+ function optionalFlag$1(context, flag) {
38875
+ const value = context.flags.get(flag)?.trim() ?? "";
38876
+ return value === "" ? null : value;
38560
38877
  }
38561
38878
  /** The write receipt: a build's own fields, or the deployment's source. */
38562
38879
  function writeText$5(report) {
@@ -38585,7 +38902,7 @@ function applicationBuildText(report) {
38585
38902
  }
38586
38903
  //#endregion
38587
38904
  //#region src/commands/application-cache.ts
38588
- var USAGE$43 = [
38905
+ var USAGE$45 = [
38589
38906
  "Usage: hostingctl application cache <environment-uuid> <application-uuid> --company <slug>",
38590
38907
  " hostingctl application cache-set <environment-uuid> <application-uuid> --company <slug> [--enabled <on|off>] [--fresh <s>] [--background <s>] [--browser <s>] [--reset <on|off>]",
38591
38908
  " hostingctl application cache-purge <environment-uuid> <application-uuid> --company <slug>",
@@ -38606,25 +38923,25 @@ var USAGE$43 = [
38606
38923
  ].join("\n");
38607
38924
  /** `application cache*`, from the `application` command. */
38608
38925
  async function applicationCache(context, action, path, rest) {
38609
- noExtra$15(rest);
38926
+ noExtra$17(rest);
38610
38927
  if (action === "cache") return {
38611
38928
  kind: "cache",
38612
38929
  cache: (await hostingApplicationCacheShow({ path })).data
38613
38930
  };
38614
- if (action === "cache-purge") return await written$4(confirmableWrite(context, "Clear this application's HTTP cache now.", async () => {
38931
+ if (action === "cache-purge") return await written$6(confirmableWrite(context, "Clear this application's HTTP cache now.", async () => {
38615
38932
  return (await hostingApplicationCachePurge({ path })).data;
38616
38933
  }));
38617
38934
  if (action === "cache-set") {
38618
38935
  const body = cacheBody(context);
38619
- return await written$4(confirmableWrite(context, `Change this application's cache: ${Object.keys(body).join(", ") || "nothing named"}.`, async () => (await hostingApplicationCacheUpdate({
38936
+ return await written$6(confirmableWrite(context, `Change this application's cache: ${Object.keys(body).join(", ") || "nothing named"}.`, async () => (await hostingApplicationCacheUpdate({
38620
38937
  path,
38621
38938
  body
38622
38939
  })).data));
38623
38940
  }
38624
38941
  if (action === "canonical") {
38625
38942
  const routeUuid = context.flags.get("--route") ?? "";
38626
- if (routeUuid === "") throw new UsageError(`canonical needs --route.\n\n${USAGE$43}`);
38627
- return await written$4(confirmableWrite(context, `Make route ${routeUuid} this application's canonical address.`, async () => {
38943
+ if (routeUuid === "") throw new UsageError(`canonical needs --route.\n\n${USAGE$45}`);
38944
+ return await written$6(confirmableWrite(context, `Make route ${routeUuid} this application's canonical address.`, async () => {
38628
38945
  const desiredGeneration = await generation$1(path);
38629
38946
  return (await hostingApplicationRouteSelectCanonical({
38630
38947
  path,
@@ -38635,12 +38952,12 @@ async function applicationCache(context, action, path, rest) {
38635
38952
  })).data;
38636
38953
  }));
38637
38954
  }
38638
- throw new UsageError(USAGE$43);
38955
+ throw new UsageError(USAGE$45);
38639
38956
  }
38640
38957
  /** `application routes|route-add|route-remove`, which are environment-scoped. */
38641
38958
  async function applicationRoutes(context, action, path, rest) {
38642
38959
  if (action === "routes") {
38643
- noExtra$15(rest);
38960
+ noExtra$17(rest);
38644
38961
  return {
38645
38962
  kind: "routes",
38646
38963
  page: (await hostingApplicationRouteIndex({ path })).data
@@ -38649,8 +38966,8 @@ async function applicationRoutes(context, action, path, rest) {
38649
38966
  if (action === "route-add") return await addRoute(context, path, rest);
38650
38967
  if (action === "route-remove") {
38651
38968
  const [routeUuid, ...extra] = rest;
38652
- if (routeUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$43);
38653
- return await written$4(confirmableWrite(context, `Remove route ${routeUuid}.`, async () => {
38969
+ if (routeUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$45);
38970
+ return await written$6(confirmableWrite(context, `Remove route ${routeUuid}.`, async () => {
38654
38971
  const body = { desiredGeneration: await generation$1(path) };
38655
38972
  return (await hostingApplicationRouteRemove({
38656
38973
  path: {
@@ -38661,18 +38978,18 @@ async function applicationRoutes(context, action, path, rest) {
38661
38978
  })).data;
38662
38979
  }));
38663
38980
  }
38664
- throw new UsageError(USAGE$43);
38981
+ throw new UsageError(USAGE$45);
38665
38982
  }
38666
38983
  /** `route-add --source … --target … --path …`. */
38667
38984
  async function addRoute(context, path, rest) {
38668
- noExtra$15(rest);
38985
+ noExtra$17(rest);
38669
38986
  const sourceWorkloadUuid = context.flags.get("--source") ?? "";
38670
38987
  const targetWorkloadUuid = context.flags.get("--target") ?? "";
38671
38988
  const routePath = context.flags.get("--path") ?? "";
38672
- if (sourceWorkloadUuid === "" || targetWorkloadUuid === "" || routePath === "") throw new UsageError(`route-add needs --source, --target and --path.\n\n${USAGE$43}`);
38989
+ if (sourceWorkloadUuid === "" || targetWorkloadUuid === "" || routePath === "") throw new UsageError(`route-add needs --source, --target and --path.\n\n${USAGE$45}`);
38673
38990
  const domainUuid = context.flags.get("--domain")?.trim();
38674
38991
  const canonical = onOffFlag(context, "--canonical") ?? false;
38675
- return await written$4(confirmableWrite(context, `Route ${routePath} from ${sourceWorkloadUuid} to ${targetWorkloadUuid}${canonical ? " as canonical" : ""}.`, async () => {
38992
+ return await written$6(confirmableWrite(context, `Route ${routePath} from ${sourceWorkloadUuid} to ${targetWorkloadUuid}${canonical ? " as canonical" : ""}.`, async () => {
38676
38993
  const desiredGeneration = await generation$1(path);
38677
38994
  return (await hostingApplicationRouteStore({
38678
38995
  path,
@@ -38702,10 +39019,10 @@ function cacheBody(context) {
38702
39019
  const raw = context.flags.get(flag)?.trim() ?? "";
38703
39020
  if (raw === "") continue;
38704
39021
  const value = Number(raw);
38705
- if (!Number.isInteger(value) || value < 0) throw new UsageError(`${flag} must be a whole number of seconds.\n\n${USAGE$43}`);
39022
+ if (!Number.isInteger(value) || value < 0) throw new UsageError(`${flag} must be a whole number of seconds.\n\n${USAGE$45}`);
38706
39023
  body[field] = value;
38707
39024
  }
38708
- if (Object.keys(body).length === 0) throw new UsageError(`cache-set needs at least one field.\n\n${USAGE$43}`);
39025
+ if (Object.keys(body).length === 0) throw new UsageError(`cache-set needs at least one field.\n\n${USAGE$45}`);
38709
39026
  return body;
38710
39027
  }
38711
39028
  /** The environment's generation, which every write here must name. */
@@ -38713,15 +39030,15 @@ async function generation$1(path) {
38713
39030
  return (await hostingEnvironmentShow({ path })).data.desiredGeneration;
38714
39031
  }
38715
39032
  /** Tag one write's outcome with the group that produced it. */
38716
- async function written$4(pending) {
39033
+ async function written$6(pending) {
38717
39034
  return {
38718
39035
  kind: "cache-write",
38719
39036
  outcome: await pending
38720
39037
  };
38721
39038
  }
38722
39039
  /** No positional arguments, or a usage refusal. */
38723
- function noExtra$15(rest) {
38724
- if (rest.length > 0) throw new UsageError(USAGE$43);
39040
+ function noExtra$17(rest) {
39041
+ if (rest.length > 0) throw new UsageError(USAGE$45);
38725
39042
  }
38726
39043
  /** The `application cache*|routes|route-*` renderer. */
38727
39044
  function applicationCacheText(report) {
@@ -38883,7 +39200,7 @@ function describeAuth(workloadUuid, auth) {
38883
39200
  }
38884
39201
  //#endregion
38885
39202
  //#region src/commands/application-create.ts
38886
- var USAGE$42 = [
39203
+ var USAGE$44 = [
38887
39204
  "Usage: hostingctl application create <environment-uuid> --company <slug> --type <wordpress|moodle> --name <name>",
38888
39205
  " --cpu-request <millicores> --cpu-limit <millicores> --memory-request <MiB> --memory-limit <MiB>",
38889
39206
  " [--replicas <count>] [--label <text>] [--hostname <host>] [--php-minor <minor>]",
@@ -38909,16 +39226,16 @@ var CREATE_FLAGS = [{
38909
39226
  }];
38910
39227
  /** `application create <env> …`, from the `application` command. */
38911
39228
  async function applicationCreate(context, path, rest) {
38912
- if (rest.length > 0) throw new UsageError(USAGE$42);
39229
+ if (rest.length > 0) throw new UsageError(USAGE$44);
38913
39230
  const type = context.flags.get("--type")?.trim().toLowerCase() ?? "";
38914
- if (!TYPES.has(type)) throw new UsageError(`create needs --type wordpress or moodle.\n\n${USAGE$42}`);
39231
+ if (!TYPES.has(type)) throw new UsageError(`create needs --type wordpress or moodle.\n\n${USAGE$44}`);
38915
39232
  const name = context.flags.get("--name")?.trim() ?? "";
38916
- if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$42}`);
39233
+ if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$44}`);
38917
39234
  const resources = {
38918
- cpuRequestMillicores: required$2(context, "--cpu-request"),
38919
- cpuLimitMillicores: required$2(context, "--cpu-limit"),
38920
- memoryRequestMib: required$2(context, "--memory-request"),
38921
- memoryLimitMib: required$2(context, "--memory-limit")
39235
+ cpuRequestMillicores: required$3(context, "--cpu-request"),
39236
+ cpuLimitMillicores: required$3(context, "--cpu-limit"),
39237
+ memoryRequestMib: required$3(context, "--memory-request"),
39238
+ memoryLimitMib: required$3(context, "--memory-limit")
38922
39239
  };
38923
39240
  if (resources.cpuRequestMillicores > resources.cpuLimitMillicores) throw new UsageError("--cpu-request cannot exceed --cpu-limit.");
38924
39241
  if (resources.memoryRequestMib > resources.memoryLimitMib) throw new UsageError("--memory-request cannot exceed --memory-limit.");
@@ -38947,14 +39264,14 @@ async function applicationCreate(context, path, rest) {
38947
39264
  };
38948
39265
  }
38949
39266
  /** One required whole-number flag, or a usage refusal naming the flag. */
38950
- function required$2(context, flag) {
39267
+ function required$3(context, flag) {
38951
39268
  const value = wholeNumberFlag(context.flags, flag);
38952
- if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$42}`);
39269
+ if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$44}`);
38953
39270
  return value;
38954
39271
  }
38955
39272
  //#endregion
38956
39273
  //#region src/commands/application-upload.ts
38957
- var USAGE$41 = [
39274
+ var USAGE$43 = [
38958
39275
  "Usage: hostingctl application import-upload <environment-uuid> <application-uuid> --company <slug>",
38959
39276
  " --database <path-to.sql> --archive <path-to.zip|path-to.jpa> | --directory <dir>",
38960
39277
  "",
@@ -38983,12 +39300,12 @@ var STAGING_WAIT_MS = 9e5;
38983
39300
  /** How often the staged import is asked for its state while the queue works. */
38984
39301
  var STAGING_POLL_MS = 3e3;
38985
39302
  async function applicationUpload(context, path, rest) {
38986
- if (rest.length > 0) throw new UsageError(USAGE$41);
39303
+ if (rest.length > 0) throw new UsageError(USAGE$43);
38987
39304
  const database = context.flags.get("--database")?.trim() ?? "";
38988
39305
  const archive = context.flags.get("--archive")?.trim() ?? "";
38989
39306
  const directory = context.flags.get("--directory")?.trim() ?? "";
38990
- if (archive !== "" && directory !== "") throw new UsageError(`Send the site files as either --archive or --directory, not both.\n\n${USAGE$41}`);
38991
- 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$41}`);
39307
+ if (archive !== "" && directory !== "") throw new UsageError(`Send the site files as either --archive or --directory, not both.\n\n${USAGE$43}`);
39308
+ 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$43}`);
38992
39309
  const databaseBytes = database === "" ? 0 : await sizeOf(database, "database");
38993
39310
  const files = directory === "" ? [] : await manifestOf(directory);
38994
39311
  const fileBytes = directory === "" ? 0 : await totalSize(files);
@@ -39098,7 +39415,7 @@ function describe(bytes) {
39098
39415
  }
39099
39416
  //#endregion
39100
39417
  //#region src/commands/application-import.ts
39101
- var USAGE$40 = [
39418
+ var USAGE$42 = [
39102
39419
  "Usage: hostingctl application import <environment-uuid> <application-uuid> <import-uuid> --company <slug>",
39103
39420
  " hostingctl application import-upload <environment-uuid> <application-uuid> --company <slug>",
39104
39421
  " --database <path-to.sql> [--archive <path-to.zip> | --directory <dir>]",
@@ -39120,7 +39437,7 @@ async function applicationImport(context, action, path, rest) {
39120
39437
  if (action === "url-repair-preview") return await previewRepair(context, path, rest);
39121
39438
  if (action === "import-upload") return await applicationUpload(context, path, rest);
39122
39439
  const [importUuid, ...extra] = rest;
39123
- if (importUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$40);
39440
+ if (importUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$42);
39124
39441
  if (action === "import") return {
39125
39442
  kind: "import",
39126
39443
  staged: (await hostingWordpressImportShowImport({ path: {
@@ -39128,18 +39445,18 @@ async function applicationImport(context, action, path, rest) {
39128
39445
  importUuid
39129
39446
  } })).data
39130
39447
  };
39131
- if (action === "import-discard") return await written$3(confirmableWrite(context, `Discard the staged import ${importUuid}, dropping its uploaded archive.`, async () => (await hostingWordpressImportDiscard({ path: {
39448
+ if (action === "import-discard") return await written$5(confirmableWrite(context, `Discard the staged import ${importUuid}, dropping its uploaded archive.`, async () => (await hostingWordpressImportDiscard({ path: {
39132
39449
  ...path,
39133
39450
  importUuid
39134
39451
  } })).data));
39135
39452
  if (action === "url-repair-confirm") return await confirmRepair(context, path, importUuid);
39136
- throw new UsageError(USAGE$40);
39453
+ throw new UsageError(USAGE$42);
39137
39454
  }
39138
39455
  /** `url-repair-preview --source-url …`: the review a confirmation is made against. */
39139
39456
  async function previewRepair(context, path, rest) {
39140
- if (rest.length > 0) throw new UsageError(USAGE$40);
39457
+ if (rest.length > 0) throw new UsageError(USAGE$42);
39141
39458
  const sourceUrl = context.flags.get("--source-url")?.trim() ?? "";
39142
- if (sourceUrl === "") throw new UsageError(`url-repair-preview needs --source-url.\n\n${USAGE$40}`);
39459
+ if (sourceUrl === "") throw new UsageError(`url-repair-preview needs --source-url.\n\n${USAGE$42}`);
39143
39460
  return {
39144
39461
  kind: "url-repair",
39145
39462
  recovery: (await hostingWordpressUrlRepairPreview({
@@ -39151,8 +39468,8 @@ async function previewRepair(context, path, rest) {
39151
39468
  /** `url-repair-confirm <recovery> --confirmation …`: the typed text the review asked for. */
39152
39469
  async function confirmRepair(context, path, recoveryUuid) {
39153
39470
  const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
39154
- if (confirmation === "") throw new UsageError(`url-repair-confirm needs --confirmation.\n\n${USAGE$40}`);
39155
- return await written$3(confirmableWrite(context, `Confirm the URL repair by typing its confirmation ("${confirmation}").`, async () => {
39471
+ if (confirmation === "") throw new UsageError(`url-repair-confirm needs --confirmation.\n\n${USAGE$42}`);
39472
+ return await written$5(confirmableWrite(context, `Confirm the URL repair by typing its confirmation ("${confirmation}").`, async () => {
39156
39473
  const desiredGeneration = (await hostingEnvironmentShow({ path })).data.desiredGeneration;
39157
39474
  const body = {
39158
39475
  confirmation,
@@ -39168,7 +39485,7 @@ async function confirmRepair(context, path, recoveryUuid) {
39168
39485
  }));
39169
39486
  }
39170
39487
  /** Tag one write's outcome with the group that produced it. */
39171
- async function written$3(pending) {
39488
+ async function written$5(pending) {
39172
39489
  return {
39173
39490
  kind: "import-write",
39174
39491
  outcome: await pending
@@ -39217,7 +39534,7 @@ function recoveryLines(one) {
39217
39534
  }
39218
39535
  //#endregion
39219
39536
  //#region src/commands/application-recovery.ts
39220
- var USAGE$39 = [
39537
+ var USAGE$41 = [
39221
39538
  "Usage: hostingctl application recovery-review <environment-uuid> <application-uuid> --company <slug> [--import <uuid>]",
39222
39539
  " hostingctl application recovery-confirm <environment-uuid> <application-uuid> --company <slug> --confirmation <text> [--import <uuid>]",
39223
39540
  "",
@@ -39236,9 +39553,9 @@ var USAGE$39 = [
39236
39553
  ].join("\n");
39237
39554
  /** `application recovery-review|recovery-confirm`. */
39238
39555
  async function applicationRecovery(context, action, path, rest) {
39239
- if (rest.length > 0) throw new UsageError(USAGE$39);
39556
+ if (rest.length > 0) throw new UsageError(USAGE$41);
39240
39557
  const importUuid = context.flags.get("--import")?.trim();
39241
- if (importUuid === "") throw new UsageError(`--import needs the staged import's id.\n\n${USAGE$39}`);
39558
+ if (importUuid === "") throw new UsageError(`--import needs the staged import's id.\n\n${USAGE$41}`);
39242
39559
  const review = (await hostingApplicationRecoveryShow({
39243
39560
  path,
39244
39561
  ...importUuid === void 0 ? {} : { query: { importUuid } }
@@ -39247,10 +39564,10 @@ async function applicationRecovery(context, action, path, rest) {
39247
39564
  kind: "recovery-review",
39248
39565
  review
39249
39566
  };
39250
- if (action !== "recovery-confirm") throw new UsageError(USAGE$39);
39567
+ if (action !== "recovery-confirm") throw new UsageError(USAGE$41);
39251
39568
  if (review.blockedReason !== null) throw new UsageError(`This restore is blocked: ${review.blockedReason}`);
39252
39569
  const confirmation = context.flags.get("--confirmation")?.trim() ?? "";
39253
- if (confirmation === "") throw new UsageError(`recovery-confirm needs --confirmation.\n\n${USAGE$39}`);
39570
+ if (confirmation === "") throw new UsageError(`recovery-confirm needs --confirmation.\n\n${USAGE$41}`);
39254
39571
  return {
39255
39572
  kind: "recovery-write",
39256
39573
  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 () => {
@@ -39358,7 +39675,7 @@ function siteAccessFlow(callbacks, usage) {
39358
39675
  });
39359
39676
  return async (context, action, path, rest) => {
39360
39677
  if (action === "site-access") {
39361
- noExtra$14(rest, usage);
39678
+ noExtra$16(rest, usage);
39362
39679
  return {
39363
39680
  kind: "site-access",
39364
39681
  access: await callbacks.show(path)
@@ -39366,7 +39683,7 @@ function siteAccessFlow(callbacks, usage) {
39366
39683
  }
39367
39684
  if (action === "site-access-set") return await set$2(context, path, rest, callbacks, usage);
39368
39685
  if (action === "site-access-rotate") {
39369
- noExtra$14(rest, usage);
39686
+ noExtra$16(rest, usage);
39370
39687
  if (callbacks.rotate === null) throw new UsageError("This scope has no sign-in edge of its own to rotate.");
39371
39688
  return await written(confirmableWrite(context, "Rotate the sign-in edge's credentials. The edge rolls, so a session may re-authenticate.", async () => await callbacks.rotate?.(path)));
39372
39689
  }
@@ -39377,7 +39694,7 @@ function siteAccessFlow(callbacks, usage) {
39377
39694
  }
39378
39695
  /** `site-access-set --sign-in … [--audience …]`. */
39379
39696
  async function set$2(context, path, rest, callbacks, usage) {
39380
- noExtra$14(rest, usage);
39697
+ noExtra$16(rest, usage);
39381
39698
  const requiredSignIn = onOffFlag(context, "--sign-in");
39382
39699
  if (requiredSignIn === null) throw new UsageError(`site-access-set needs --sign-in.\n\n${usage}`);
39383
39700
  const current = await callbacks.show(path);
@@ -39389,7 +39706,7 @@ async function set$2(context, path, rest, callbacks, usage) {
39389
39706
  }
39390
39707
  /** `site-users`: every invited identity, across every page. */
39391
39708
  async function users$1(path, rest, callbacks, usage) {
39392
- noExtra$14(rest, usage);
39709
+ noExtra$16(rest, usage);
39393
39710
  const items = [];
39394
39711
  for (let page = 1; page <= 100; page += 1) {
39395
39712
  const answer = await callbacks.usersIndex(path, page, 100);
@@ -39405,7 +39722,7 @@ async function users$1(path, rest, callbacks, usage) {
39405
39722
  async function user(context, path, rest, callbacks, usage, written) {
39406
39723
  const [action, ...args] = rest;
39407
39724
  if (action === "invite") {
39408
- noExtra$14(args, usage);
39725
+ noExtra$16(args, usage);
39409
39726
  const email = context.flags.get("--email")?.trim().toLowerCase() ?? "";
39410
39727
  if (email === "") throw new UsageError(`site-user invite needs --email.\n\n${usage}`);
39411
39728
  return await written(confirmableWrite(context, `Invite ${email} to sign in.`, async () => await callbacks.usersStore(path, email)));
@@ -39422,7 +39739,7 @@ async function user(context, path, rest, callbacks, usage, written) {
39422
39739
  throw new UsageError(usage);
39423
39740
  }
39424
39741
  /** No positional arguments, or a usage refusal. */
39425
- function noExtra$14(rest, usage) {
39742
+ function noExtra$16(rest, usage) {
39426
39743
  if (rest.length > 0) throw new UsageError(usage);
39427
39744
  }
39428
39745
  /** One invitation as one line. */
@@ -39450,7 +39767,7 @@ function siteAccessText(report) {
39450
39767
  }
39451
39768
  //#endregion
39452
39769
  //#region src/commands/application-site-access.ts
39453
- var USAGE$38 = [
39770
+ var USAGE$40 = [
39454
39771
  "Usage: hostingctl application site-access <environment-uuid> <application-uuid> --company <slug>",
39455
39772
  " hostingctl application site-access-set <environment-uuid> <application-uuid> --company <slug> --sign-in <on|off> [--audience <name>]",
39456
39773
  " hostingctl application site-access-rotate <environment-uuid> <application-uuid> --company <slug>",
@@ -39493,13 +39810,455 @@ var flow$1 = siteAccessFlow({
39493
39810
  refresh: async (path) => (await hostingApplicationSiteAccessUsersRefresh({ path })).data,
39494
39811
  destroy: async (path) => (await hostingApplicationSiteAccessUsersDestroy({ path })).data,
39495
39812
  rotate: async (path) => (await hostingApplicationSiteAccessRotate({ path })).data
39496
- }, USAGE$38);
39813
+ }, USAGE$40);
39497
39814
  /** `application site-access*|site-user*`, which the application dispatcher calls with its resolved path. */
39498
39815
  async function applicationSiteAccess(context, action, path, rest) {
39499
- if (rest.some((one) => one === "")) throw new UsageError(USAGE$38);
39816
+ if (rest.some((one) => one === "")) throw new UsageError(USAGE$40);
39500
39817
  return await flow$1(context, action, path, rest);
39501
39818
  }
39502
39819
  //#endregion
39820
+ //#region src/commands/application-source-ssh.ts
39821
+ var USAGE$39 = [
39822
+ "Usage: hostingctl application source-ssh-list --company <slug>",
39823
+ " hostingctl application source-ssh-show <connection-uuid> --company <slug>",
39824
+ " hostingctl application source-ssh-create --company <slug> --name <label> --repo <url> --ref <name> [--ref-kind branch|tag]",
39825
+ " hostingctl application source-ssh-update <connection-uuid> --company <slug> [--name <label>] [--ref <name>] [--ref-kind branch|tag]",
39826
+ " hostingctl application source-ssh-confirm-host-key <connection-uuid> --company <slug> --fingerprint <sha256>",
39827
+ " hostingctl application source-ssh-verify <connection-uuid> --company <slug>",
39828
+ " hostingctl application source-ssh-rotate-key <connection-uuid> --company <slug>",
39829
+ " hostingctl application source-ssh-revoke <connection-uuid> --company <slug>",
39830
+ "",
39831
+ " source-ssh-list The company's Git-over-SSH sources and whether access works.",
39832
+ " source-ssh-show One source: its public key, its fingerprint and the server host key.",
39833
+ " source-ssh-create Add a repository and the branch or tag it reads.",
39834
+ " source-ssh-update Change a source's label or ref; the address and key are not editable.",
39835
+ " source-ssh-confirm-host-key Accept the server host key you compared out of band.",
39836
+ " source-ssh-verify Fetch and discard, recording whether the key can read the repository.",
39837
+ " source-ssh-rotate-key Replace the deploy key; the earlier verification is cleared.",
39838
+ " source-ssh-revoke Retire a source; a running release keeps serving.",
39839
+ "",
39840
+ "A new source takes the standard SSH Git forms (`git@host:owner/repo.git` or `ssh://[user@]host[:port]/path`)",
39841
+ "and nothing else: no transport helper, no local path and no SSH option. `create` prints the deploy key, its",
39842
+ "fingerprint and the host-key fingerprint the platform discovered; install the public key on your Git server",
39843
+ "and confirm the host-key fingerprint you obtained from that server, or nothing is fetched. The writes need",
39844
+ "--confirm; --dry-run describes the change without sending it."
39845
+ ].join("\n");
39846
+ /**
39847
+ * The actions this module answers.
39848
+ *
39849
+ * Kept beside the handlers rather than in the dispatcher's registry, so an action cannot be routed to a
39850
+ * module that no longer implements it.
39851
+ */
39852
+ var SSH_SOURCE_ACTIONS = /* @__PURE__ */ new Set([
39853
+ "source-ssh-list",
39854
+ "source-ssh-show",
39855
+ "source-ssh-create",
39856
+ "source-ssh-update",
39857
+ "source-ssh-confirm-host-key",
39858
+ "source-ssh-verify",
39859
+ "source-ssh-rotate-key",
39860
+ "source-ssh-revoke"
39861
+ ]);
39862
+ /** `application source-ssh-*`, which is company-scoped and names no application. */
39863
+ async function applicationSshSources(context, action, company, rest) {
39864
+ if (action === "source-ssh-list") {
39865
+ noExtra$15(rest);
39866
+ return {
39867
+ kind: "ssh-sources",
39868
+ connections: (await hostingSshSourcesIndex({ path: { company } })).data
39869
+ };
39870
+ }
39871
+ if (action === "source-ssh-create") return await create$5(context, company, rest);
39872
+ const [connectionUuid, ...extra] = rest;
39873
+ if (connectionUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$39);
39874
+ const path = {
39875
+ company,
39876
+ connectionUuid
39877
+ };
39878
+ if (action === "source-ssh-show") return {
39879
+ kind: "ssh-source",
39880
+ connection: (await hostingSshSourcesShow({ path })).data
39881
+ };
39882
+ if (action === "source-ssh-update") return await update$3(context, path);
39883
+ if (action === "source-ssh-confirm-host-key") return await confirmHostKey(context, path);
39884
+ if (action === "source-ssh-verify") return await written$4(confirmableWrite(context, [
39885
+ `Prove the deploy key can read ${connectionUuid}'s repository.`,
39886
+ "This fetches and discards: it records whether access worked and stores no source, so a refusal is",
39887
+ "reported without changing what the application serves."
39888
+ ].join("\n"), async () => (await hostingSshSourcesVerify({ path })).data));
39889
+ if (action === "source-ssh-rotate-key") return await written$4(confirmableWrite(context, [
39890
+ `Replace the deploy key for ${connectionUuid}.`,
39891
+ "The old key stops being used at once, the earlier verification is cleared, and the new public key has",
39892
+ "to be installed on the Git server before access can be proved again."
39893
+ ].join("\n"), async () => (await hostingSshSourcesRotateKey({ path })).data));
39894
+ 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));
39895
+ throw new UsageError(USAGE$39);
39896
+ }
39897
+ /** `source-ssh-create --name … --repo … --ref … [--ref-kind …]`: one repository and the ref it reads. */
39898
+ async function create$5(context, company, rest) {
39899
+ noExtra$15(rest);
39900
+ const name = required$2(context, "--name");
39901
+ const repositoryUrl = required$2(context, "--repo");
39902
+ const ref = required$2(context, "--ref");
39903
+ const refKind = refKindFlag(context) ?? "branch";
39904
+ return await written$4(confirmableWrite(context, [
39905
+ `Add the SSH source "${name}" for ${repositoryUrl} at ${refKind} ${ref}.`,
39906
+ "The platform generates a deploy key and discovers the server's host key but fetches nothing yet: install",
39907
+ "the public key on the Git server, confirm the host-key fingerprint you obtained there, then verify access."
39908
+ ].join("\n"), async () => {
39909
+ return (await hostingSshSourcesStore({
39910
+ path: { company },
39911
+ body: {
39912
+ name,
39913
+ repositoryUrl,
39914
+ ref,
39915
+ refKind
39916
+ }
39917
+ })).data;
39918
+ }));
39919
+ }
39920
+ /** `source-ssh-update <connection> [--name …] [--ref …] [--ref-kind …]`: an edit, never a new source. */
39921
+ async function update$3(context, path) {
39922
+ const name = optionalFlag(context, "--name");
39923
+ const ref = optionalFlag(context, "--ref");
39924
+ const refKind = refKindFlag(context);
39925
+ if (name === null && ref === null && refKind === null) throw new UsageError(`source-ssh-update needs --name, --ref or --ref-kind.\n\n${USAGE$39}`);
39926
+ const described = [name === null ? "" : `label ${name}`, ref === null ? "" : `ref ${ref}`].filter((one) => one !== "").join(", ");
39927
+ return await written$4(confirmableWrite(context, [
39928
+ `Edit the SSH source ${path.connectionUuid}${described === "" ? "" : `: ${described}`}.`,
39929
+ "The repository address and the deploy key are not editable: either one describes a different source, which",
39930
+ "is a new connection rather than an edit."
39931
+ ].join("\n"), async () => {
39932
+ return (await hostingSshSourcesUpdate({
39933
+ path,
39934
+ body: {
39935
+ ...name === null ? {} : { name },
39936
+ ...ref === null ? {} : { ref },
39937
+ ...refKind === null ? {} : { refKind }
39938
+ }
39939
+ })).data;
39940
+ }));
39941
+ }
39942
+ /** `source-ssh-confirm-host-key <connection> --fingerprint …`: the client's own out-of-band value. */
39943
+ async function confirmHostKey(context, path) {
39944
+ const fingerprint = required$2(context, "--fingerprint");
39945
+ return await written$4(confirmableWrite(context, [
39946
+ `Accept ${fingerprint} as the server host key of the SSH source ${path.connectionUuid}.`,
39947
+ "The API compares it with the value it discovered; a fingerprint the platform supplied is refused, so this",
39948
+ "is a confirmation rather than an acknowledgement."
39949
+ ].join("\n"), async () => (await hostingSshSourcesConfirmHostKey({
39950
+ path,
39951
+ body: { fingerprint }
39952
+ })).data));
39953
+ }
39954
+ /** A required flag's value, or a refusal naming the flag. */
39955
+ function required$2(context, flag) {
39956
+ const value = context.flags.get(flag)?.trim() ?? "";
39957
+ if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$39}`);
39958
+ return value;
39959
+ }
39960
+ /** An optional flag's value, or null when it was not given. */
39961
+ function optionalFlag(context, flag) {
39962
+ const value = context.flags.get(flag)?.trim() ?? "";
39963
+ return value === "" ? null : value;
39964
+ }
39965
+ /** `--ref-kind`, which names the Git namespace the ref resolves in, or null when it was not given. */
39966
+ function refKindFlag(context) {
39967
+ const value = context.flags.get("--ref-kind")?.trim() ?? "";
39968
+ if (value === "") return null;
39969
+ if (value === "branch" || value === "tag") return value;
39970
+ throw new UsageError(`--ref-kind must be branch or tag (got "${value}").\n\n${USAGE$39}`);
39971
+ }
39972
+ /** Tag one write's outcome with the group that produced it. */
39973
+ async function written$4(pending) {
39974
+ return {
39975
+ kind: "ssh-source-write",
39976
+ outcome: await pending
39977
+ };
39978
+ }
39979
+ /** No positional arguments, or a usage refusal. */
39980
+ function noExtra$15(rest) {
39981
+ if (rest.length > 0) throw new UsageError(USAGE$39);
39982
+ }
39983
+ //#endregion
39984
+ //#region src/commands/application-source-upload.ts
39985
+ var USAGE$38 = [
39986
+ "Usage: hostingctl application source-upload <environment-uuid> <application-uuid> --company <slug> --file <path-to.zip>",
39987
+ " hostingctl application source-uploads <environment-uuid> <application-uuid> --company <slug>",
39988
+ " hostingctl application source-upload-show <environment-uuid> <application-uuid> <upload-uuid> --company <slug>",
39989
+ " hostingctl application source-upload-discard <environment-uuid> <application-uuid> <upload-uuid> --company <slug>",
39990
+ "",
39991
+ " source-upload Upload a ZIP of the project as one application's staged source.",
39992
+ " source-uploads The staged uploads this application still holds, with their review and expiry.",
39993
+ " source-upload-show One staged upload, measured and reviewed.",
39994
+ " source-upload-discard Drop a staged upload nothing has built from yet.",
39995
+ "",
39996
+ "A staged upload is not a build: the platform normalizes and measures the archive, reports what the review",
39997
+ "found, and installs nothing. Building from it is `application build --source-upload <upload-uuid>`, and",
39998
+ "deploying stays the separate, explicit decision `application deploy` makes. The writes need --confirm;",
39999
+ "--dry-run describes the upload without reading the file or sending it."
40000
+ ].join("\n");
40001
+ /**
40002
+ * The actions this module answers.
40003
+ *
40004
+ * Kept beside the handlers rather than in the dispatcher's registry, so an action cannot be routed to a
40005
+ * module that no longer implements it.
40006
+ */
40007
+ var SOURCE_UPLOAD_ACTIONS = /* @__PURE__ */ new Set([
40008
+ "source-upload",
40009
+ "source-uploads",
40010
+ "source-upload-show",
40011
+ "source-upload-discard"
40012
+ ]);
40013
+ /** `application source-upload*`, from the `application` command. */
40014
+ async function applicationSourceUploads(context, action, path, rest) {
40015
+ if (action === "source-upload") return await store(context, path, rest);
40016
+ if (action === "source-uploads") {
40017
+ noExtra$14(rest);
40018
+ return {
40019
+ kind: "source-uploads",
40020
+ uploads: listed$1((await hostingSourceUploadsIndex({ path })).data)
40021
+ };
40022
+ }
40023
+ const [uploadUuid, ...extra] = rest;
40024
+ if (uploadUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$38);
40025
+ const uploadPath = {
40026
+ ...path,
40027
+ uploadUuid
40028
+ };
40029
+ if (action === "source-upload-show") return {
40030
+ kind: "source-upload",
40031
+ upload: (await hostingSourceUploadsShow({ path: uploadPath })).data
40032
+ };
40033
+ 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 () => (await hostingSourceUploadsDestroy({ path: uploadPath })).data));
40034
+ throw new UsageError(USAGE$38);
40035
+ }
40036
+ /**
40037
+ * `source-upload --file …`: stage one ZIP as the application's source.
40038
+ *
40039
+ * The description names the archive and what the platform will do with it, because a dry run must not read
40040
+ * the file: what the review measures is the API's answer, not something this command could report ahead of
40041
+ * sending anything.
40042
+ */
40043
+ async function store(context, path, rest) {
40044
+ noExtra$14(rest);
40045
+ const file = context.flags.get("--file")?.trim() ?? "";
40046
+ if (file === "") throw new UsageError(`source-upload needs --file.\n\n${USAGE$38}`);
40047
+ return await written$3(confirmableWrite(context, [
40048
+ `Upload ${file} as the staged source for application ${path.workloadUuid}.`,
40049
+ "The platform normalizes the archive, measures it and reviews it; installing dependencies and changing anything",
40050
+ "that serves is a later build and an explicit deploy."
40051
+ ].join("\n"), async () => (await hostingSourceUploadsStore({
40052
+ path,
40053
+ body: { archive: await archivePart(file) }
40054
+ })).data));
40055
+ }
40056
+ /**
40057
+ * The archive, as the one multipart part the request carries.
40058
+ *
40059
+ * The part keeps the name the file had on disk, because the API refuses an archive that is not a `.zip` by
40060
+ * that name before it opens the bytes. The blob is opened rather than read, so a project archive is streamed
40061
+ * instead of held in memory. Opened only when the write is actually sent, so `--dry-run` reads nothing.
40062
+ */
40063
+ async function archivePart(file) {
40064
+ const readable = await stat(file).catch(() => null);
40065
+ if (readable === null || !readable.isFile()) throw new UsageError(`--file [${file}] is not a readable file.`);
40066
+ return new File([await openAsBlob(file)], path.basename(file), { type: "application/zip" });
40067
+ }
40068
+ /**
40069
+ * The staged uploads a listing answers with.
40070
+ *
40071
+ * The contract publishes that one route's items as an untyped collection, while every other route in the group
40072
+ * answers `HostingSourceUploadData`; that is the item's documented shape, so it is the type this group reads.
40073
+ */
40074
+ function listed$1(data) {
40075
+ return data;
40076
+ }
40077
+ /** Tag one write's outcome with the group that produced it. */
40078
+ async function written$3(pending) {
40079
+ return {
40080
+ kind: "source-upload-write",
40081
+ outcome: await pending
40082
+ };
40083
+ }
40084
+ /** No positional arguments, or a usage refusal. */
40085
+ function noExtra$14(rest) {
40086
+ if (rest.length > 0) throw new UsageError(USAGE$38);
40087
+ }
40088
+ /** One staged upload: what the platform measured, what the review found, and when staging expires. */
40089
+ function uploadLines(upload) {
40090
+ const { review } = upload;
40091
+ return [
40092
+ ` upload ${upload.uuid} ${upload.status} ${upload.originalFilename}`,
40093
+ ` ${sizeText(upload.compressedBytes)} compressed, ${sizeText(upload.expandedBytes)} expanded, ${String(upload.fileCount)} file(s)`,
40094
+ ` root ${upload.detectedRoot === "" ? "the archive's own root" : upload.detectedRoot} sha256 ${upload.archiveSha256}`,
40095
+ ` review: ${packageText(review.hasPackageJson, review.hasLockfile, review.lockfileName)}${review.nodeEngine === null ? "" : `, node ${review.nodeEngine}`}`,
40096
+ ...review.missing.length === 0 ? [" missing: nothing — the archive carries what a build needs."] : [` missing: ${review.missing.join(", ")}`],
40097
+ ` expires ${upload.expiresAt ?? "no staging clock: a build has bound it"}`
40098
+ ].join("\n");
40099
+ }
40100
+ /** Whether the review found a `package.json`, and which lockfile it found beside it. */
40101
+ function packageText(hasPackageJson, hasLockfile, lockfileName) {
40102
+ const manifest = hasPackageJson ? "package.json found" : "no package.json";
40103
+ if (!hasLockfile) return `${manifest}, no lockfile`;
40104
+ return `${manifest}, ${lockfileName ?? "a lockfile"}`;
40105
+ }
40106
+ /** A size in the unit a person reads it in. */
40107
+ function sizeText(bytes) {
40108
+ if (bytes < 1024) return `${String(bytes)} B`;
40109
+ if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KiB`;
40110
+ return `${(bytes / 1048576).toFixed(1)} MiB`;
40111
+ }
40112
+ /** The `application source-upload*` renderer. */
40113
+ function applicationSourceUploadText(report) {
40114
+ if (report.kind === "source-upload") return uploadLines(report.upload);
40115
+ if (report.kind === "source-uploads") {
40116
+ if (report.uploads.length === 0) return "No staged source uploads for this application. Upload one with `application source-upload --file <path-to.zip>`.";
40117
+ return report.uploads.map((one) => uploadLines(one)).join("\n");
40118
+ }
40119
+ const { outcome } = report;
40120
+ if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
40121
+ return typeof outcome.result === "object" && outcome.result !== null ? `${outcome.description}\n${uploadLines(outcome.result)}` : outcome.description;
40122
+ }
40123
+ //#endregion
40124
+ //#region src/commands/application-source-metadata.ts
40125
+ /**
40126
+ * The metadata of the two source groups, kept beside the commands that read them.
40127
+ *
40128
+ * `application`'s own metadata record is already at the size a maintained file is allowed, and every one of
40129
+ * these entries belongs to the source groups rather than to the command that dispatches them — so they are
40130
+ * stated once, here, and spread into the command's record.
40131
+ */
40132
+ /** The flags the upload, source-binding and SSH-source commands read. */
40133
+ var SOURCE_FLAGS = [
40134
+ {
40135
+ name: "--selection",
40136
+ takesValue: true,
40137
+ description: "The selected repository a source is bound to."
40138
+ },
40139
+ {
40140
+ name: "--branch",
40141
+ takesValue: true,
40142
+ description: "The branch the bound source is built from."
40143
+ },
40144
+ {
40145
+ name: "--tag",
40146
+ takesValue: true,
40147
+ description: "The tag the bound source is built from."
40148
+ },
40149
+ {
40150
+ name: "--auto-deploy",
40151
+ takesValue: true,
40152
+ description: "Whether a new commit deploys by itself: on or off."
40153
+ },
40154
+ {
40155
+ name: "--source-upload",
40156
+ takesValue: true,
40157
+ description: "The staged source upload a build is made from."
40158
+ },
40159
+ {
40160
+ name: "--ssh-source",
40161
+ takesValue: true,
40162
+ description: "The Git-over-SSH source a build or a binding names."
40163
+ },
40164
+ {
40165
+ name: "--source-kind",
40166
+ takesValue: true,
40167
+ description: "Which kind of source a binding names: github or ssh."
40168
+ },
40169
+ {
40170
+ name: "--file",
40171
+ takesValue: true,
40172
+ description: "The local ZIP archive uploaded as one application's source."
40173
+ },
40174
+ {
40175
+ name: "--repo",
40176
+ takesValue: true,
40177
+ description: "The SSH Git address a source reads."
40178
+ },
40179
+ {
40180
+ name: "--ref",
40181
+ takesValue: true,
40182
+ description: "The branch or tag an SSH source reads."
40183
+ },
40184
+ {
40185
+ name: "--ref-kind",
40186
+ takesValue: true,
40187
+ description: "Which namespace --ref names: branch or tag."
40188
+ },
40189
+ {
40190
+ name: "--fingerprint",
40191
+ takesValue: true,
40192
+ description: "The server host-key fingerprint obtained independently from the Git server."
40193
+ }
40194
+ ];
40195
+ /** Every source action, in the order the reference page lists them. */
40196
+ var SOURCE_SUBCOMMANDS = [
40197
+ "source-upload",
40198
+ "source-uploads",
40199
+ "source-upload-show",
40200
+ "source-upload-discard",
40201
+ "source-ssh-list",
40202
+ "source-ssh-show",
40203
+ "source-ssh-create",
40204
+ "source-ssh-update",
40205
+ "source-ssh-confirm-host-key",
40206
+ "source-ssh-verify",
40207
+ "source-ssh-rotate-key",
40208
+ "source-ssh-revoke"
40209
+ ];
40210
+ /** The help topic for each source action, each answered by the usage block of the group that owns it. */
40211
+ var SOURCE_TOPICS = [
40212
+ {
40213
+ path: ["source-upload"],
40214
+ usage: USAGE$38
40215
+ },
40216
+ {
40217
+ path: ["source-uploads"],
40218
+ usage: USAGE$38
40219
+ },
40220
+ {
40221
+ path: ["source-upload-show"],
40222
+ usage: USAGE$38
40223
+ },
40224
+ {
40225
+ path: ["source-upload-discard"],
40226
+ usage: USAGE$38
40227
+ },
40228
+ {
40229
+ path: ["source-ssh-list"],
40230
+ usage: USAGE$39
40231
+ },
40232
+ {
40233
+ path: ["source-ssh-show"],
40234
+ usage: USAGE$39
40235
+ },
40236
+ {
40237
+ path: ["source-ssh-create"],
40238
+ usage: USAGE$39
40239
+ },
40240
+ {
40241
+ path: ["source-ssh-update"],
40242
+ usage: USAGE$39
40243
+ },
40244
+ {
40245
+ path: ["source-ssh-confirm-host-key"],
40246
+ usage: USAGE$39
40247
+ },
40248
+ {
40249
+ path: ["source-ssh-verify"],
40250
+ usage: USAGE$39
40251
+ },
40252
+ {
40253
+ path: ["source-ssh-rotate-key"],
40254
+ usage: USAGE$39
40255
+ },
40256
+ {
40257
+ path: ["source-ssh-revoke"],
40258
+ usage: USAGE$39
40259
+ }
40260
+ ];
40261
+ //#endregion
39503
40262
  //#region src/commands/application-speed.ts
39504
40263
  var SPEED_USAGE = [
39505
40264
  "Usage: hostingctl application speed-check <environment-uuid> <application-uuid> --company <slug> [--json]",
@@ -39572,50 +40331,11 @@ function applicationUpdatesText(report) {
39572
40331
  return `${outcome.description} Updates are ${outcome.result?.pause.paused ? "paused" : "not paused"}; the release that is serving is unchanged.`;
39573
40332
  }
39574
40333
  //#endregion
39575
- //#region src/commands/application-usage.ts
39576
- /** Every `application` invocation the command accepts, and what each one does. */
39577
- var APPLICATION_USAGE = [
39578
- "Usage: hostingctl application list <environment-uuid> --company <slug>",
39579
- " hostingctl application show <environment-uuid> <workload-uuid> --company <slug>",
39580
- " hostingctl application public-key <environment-uuid> <workload-uuid> --company <slug>",
39581
- " hostingctl application speed-check <environment-uuid> <workload-uuid> --company <slug>",
39582
- " hostingctl application deployment <environment-uuid> <workload-uuid> --company <slug>",
39583
- " hostingctl application build <environment-uuid> <workload-uuid> --company <slug> [--source <selection-uuid>] [--idempotency-key <key>]",
39584
- " hostingctl application deploy <environment-uuid> <workload-uuid> <release-uuid> --company <slug>",
39585
- " hostingctl application runs <environment-uuid> <workload-uuid> --company <slug>",
39586
- " hostingctl application run-log <environment-uuid> <workload-uuid> <run-name> --company <slug>",
39587
- " hostingctl application schedule-run <environment-uuid> <workload-uuid> <schedule-key> --company <slug>",
39588
- " hostingctl application runtime <environment-uuid> <workload-uuid> --company <slug> --mode <stop|start|restart>",
39589
- " hostingctl application component-settings <environment-uuid> <workload-uuid> --company <slug> --schemas <name>[,<name>…]",
39590
- " hostingctl application component-settings <environment-uuid> <workload-uuid> --company <slug> [--signup|--no-signup] [--autoconfirm|--no-autoconfirm] [--otp-length <6-10>] [--otp-expiry-seconds <60-86400>]",
39591
- " hostingctl application update <environment-uuid> <workload-uuid> --company <slug> --label <label>",
39592
- " hostingctl application removal <environment-uuid> <workload-uuid> --company <slug>",
39593
- " hostingctl application remove <environment-uuid> <workload-uuid> --company <slug>",
39594
- "",
39595
- " list|show The applications in an environment, and one in detail.",
39596
- " public-key Read the component's publishable anonymous key (never its service/signing secrets).",
39597
- " speed-check Three bounded HEAD timing, TLS and cache-header checks; not a browser audit.",
39598
- " deployment The running, requested and interrupted builds and releases of one application.",
39599
- " build Queue a build of the application's applied configuration from a source selection.",
39600
- " deploy Make an existing release the one the application runs.",
39601
- " runs|run-log The process run history, and one run's own output.",
39602
- " schedule-run Run a declared schedule now, beside the schedule's own runs.",
39603
- " runtime Stop, start or restart the application's desired runtime.",
39604
- " component-settings The schemas a REST component serves, or the sign-up, mail-confirmation and email-OTP",
39605
- " values an auth component runs with. `show` publishes what the platform composes.",
39606
- " update Rename an application's label only.",
39607
- " removal|remove Review, then request, the withdrawal of one application and its runtime.",
39608
- "",
39609
- "The writes (build, deploy, schedule-run, update, remove, runtime, component-settings) need --confirm;",
39610
- "--dry-run describes the change without sending it. remove re-reads the removal review to send its inventory",
39611
- "digest; the retained-data retirement of an environment-owned database is a separate, later decision."
39612
- ].join("\n");
39613
- //#endregion
39614
40334
  //#region src/commands/application-metadata.ts
39615
40335
  /** Application command metadata; usage stays beside the command that owns it. */
39616
40336
  var APPLICATION_METADATA = {
39617
40337
  name: "application",
39618
- summary: "One application's build, deployment, runs, rename and removal journey.",
40338
+ summary: "One application's build, deployment, runs, source, rename and removal journey.",
39619
40339
  usage: APPLICATION_USAGE,
39620
40340
  flags: [
39621
40341
  {
@@ -39626,7 +40346,7 @@ var APPLICATION_METADATA = {
39626
40346
  {
39627
40347
  name: "--name",
39628
40348
  takesValue: true,
39629
- description: "The application's own name."
40349
+ description: "The application's own name, or the label a new Git-over-SSH source is listed under."
39630
40350
  },
39631
40351
  {
39632
40352
  name: "--replicas",
@@ -39666,8 +40386,9 @@ var APPLICATION_METADATA = {
39666
40386
  {
39667
40387
  name: "--source",
39668
40388
  takesValue: true,
39669
- description: "The workload a route is served from."
40389
+ description: "The workload a route is served from, or the repository selection a build is made from."
39670
40390
  },
40391
+ ...SOURCE_FLAGS,
39671
40392
  {
39672
40393
  name: "--target",
39673
40394
  takesValue: true,
@@ -39718,26 +40439,6 @@ var APPLICATION_METADATA = {
39718
40439
  takesValue: true,
39719
40440
  description: "Whether the cache is reset on every request: on or off."
39720
40441
  },
39721
- {
39722
- name: "--selection",
39723
- takesValue: true,
39724
- description: "The selected repository a source is bound to."
39725
- },
39726
- {
39727
- name: "--branch",
39728
- takesValue: true,
39729
- description: "The branch the bound source is built from."
39730
- },
39731
- {
39732
- name: "--tag",
39733
- takesValue: true,
39734
- description: "The tag the bound source is built from."
39735
- },
39736
- {
39737
- name: "--auto-deploy",
39738
- takesValue: true,
39739
- description: "Whether a new commit deploys by itself: on or off."
39740
- },
39741
40442
  {
39742
40443
  name: "--idempotency-key",
39743
40444
  takesValue: true,
@@ -39823,6 +40524,7 @@ var APPLICATION_METADATA = {
39823
40524
  "build-cancel",
39824
40525
  "source-bind",
39825
40526
  "source-unbind",
40527
+ ...SOURCE_SUBCOMMANDS,
39826
40528
  "recovery-review",
39827
40529
  "recovery-confirm",
39828
40530
  "import",
@@ -39858,83 +40560,84 @@ var APPLICATION_TOPICS = [
39858
40560
  },
39859
40561
  {
39860
40562
  path: ["create"],
39861
- usage: USAGE$42
40563
+ usage: USAGE$44
39862
40564
  },
39863
40565
  {
39864
40566
  path: ["build-log"],
39865
- usage: USAGE$44
40567
+ usage: USAGE$46
39866
40568
  },
39867
40569
  {
39868
40570
  path: ["build-retry"],
39869
- usage: USAGE$44
40571
+ usage: USAGE$46
39870
40572
  },
39871
40573
  {
39872
40574
  path: ["build-cancel"],
39873
- usage: USAGE$44
40575
+ usage: USAGE$46
39874
40576
  },
39875
40577
  {
39876
40578
  path: ["source-bind"],
39877
- usage: USAGE$44
40579
+ usage: USAGE$46
39878
40580
  },
39879
40581
  {
39880
40582
  path: ["source-unbind"],
39881
- usage: USAGE$44
40583
+ usage: USAGE$46
39882
40584
  },
40585
+ ...SOURCE_TOPICS,
39883
40586
  {
39884
40587
  path: ["cache"],
39885
- usage: USAGE$43
40588
+ usage: USAGE$45
39886
40589
  },
39887
40590
  {
39888
40591
  path: ["cache-set"],
39889
- usage: USAGE$43
40592
+ usage: USAGE$45
39890
40593
  },
39891
40594
  {
39892
40595
  path: ["cache-purge"],
39893
- usage: USAGE$43
40596
+ usage: USAGE$45
39894
40597
  },
39895
40598
  {
39896
40599
  path: ["routes"],
39897
- usage: USAGE$43
40600
+ usage: USAGE$45
39898
40601
  },
39899
40602
  {
39900
40603
  path: ["route-add"],
39901
- usage: USAGE$43
40604
+ usage: USAGE$45
39902
40605
  },
39903
40606
  {
39904
40607
  path: ["route-remove"],
39905
- usage: USAGE$43
40608
+ usage: USAGE$45
39906
40609
  },
39907
40610
  {
39908
40611
  path: ["canonical"],
39909
- usage: USAGE$43
40612
+ usage: USAGE$45
39910
40613
  },
39911
40614
  {
39912
40615
  path: ["import"],
39913
- usage: USAGE$40
40616
+ usage: USAGE$42
39914
40617
  },
39915
40618
  {
39916
40619
  path: ["import-upload"],
39917
- usage: USAGE$41
40620
+ usage: USAGE$43
39918
40621
  },
39919
40622
  {
39920
40623
  path: ["import-discard"],
39921
- usage: USAGE$40
40624
+ usage: USAGE$42
39922
40625
  },
39923
40626
  {
39924
40627
  path: ["url-repair-preview"],
39925
- usage: USAGE$40
40628
+ usage: USAGE$42
39926
40629
  },
39927
40630
  {
39928
40631
  path: ["url-repair-confirm"],
39929
- usage: USAGE$40
40632
+ usage: USAGE$42
39930
40633
  },
39931
40634
  {
39932
40635
  path: ["recovery-review"],
39933
- usage: USAGE$39
40636
+ usage: USAGE$41
39934
40637
  },
39935
40638
  {
39936
40639
  path: ["recovery-confirm"],
39937
- usage: USAGE$39
40640
+ usage: USAGE$41
39938
40641
  },
39939
40642
  {
39940
40643
  path: ["runtime"],
@@ -39946,23 +40649,23 @@ var APPLICATION_TOPICS = [
39946
40649
  },
39947
40650
  {
39948
40651
  path: ["site-access"],
39949
- usage: USAGE$38
40652
+ usage: USAGE$40
39950
40653
  },
39951
40654
  {
39952
40655
  path: ["site-access-set"],
39953
- usage: USAGE$38
40656
+ usage: USAGE$40
39954
40657
  },
39955
40658
  {
39956
40659
  path: ["site-access-rotate"],
39957
- usage: USAGE$38
40660
+ usage: USAGE$40
39958
40661
  },
39959
40662
  {
39960
40663
  path: ["site-users"],
39961
- usage: USAGE$38
40664
+ usage: USAGE$40
39962
40665
  },
39963
40666
  {
39964
40667
  path: ["site-user"],
39965
- usage: USAGE$38
40668
+ usage: USAGE$40
39966
40669
  },
39967
40670
  {
39968
40671
  path: ["updates"],
@@ -39978,27 +40681,27 @@ var APPLICATION_TOPICS = [
39978
40681
  },
39979
40682
  {
39980
40683
  path: ["administrator"],
39981
- usage: USAGE$45
40684
+ usage: USAGE$47
39982
40685
  },
39983
40686
  {
39984
40687
  path: ["administrator-reset"],
39985
- usage: USAGE$45
40688
+ usage: USAGE$47
39986
40689
  },
39987
40690
  {
39988
40691
  path: ["administrator-reveal"],
39989
- usage: USAGE$45
40692
+ usage: USAGE$47
39990
40693
  },
39991
40694
  {
39992
40695
  path: ["recovery-status"],
39993
- usage: USAGE$45
40696
+ usage: USAGE$47
39994
40697
  },
39995
40698
  {
39996
40699
  path: ["recovery-retry"],
39997
- usage: USAGE$45
40700
+ usage: USAGE$47
39998
40701
  },
39999
40702
  {
40000
40703
  path: ["recovery-cancel"],
40001
- usage: USAGE$45
40704
+ usage: USAGE$47
40002
40705
  }
40003
40706
  ];
40004
40707
  //#endregion
@@ -40097,6 +40800,63 @@ async function scheduleAction(context, action, path, extra) {
40097
40800
  } })).data);
40098
40801
  }
40099
40802
  //#endregion
40803
+ //#region src/commands/application-source-ssh-text.ts
40804
+ /**
40805
+ * One SSH source as a person needs it, whether it is serving or not.
40806
+ *
40807
+ * The public key, its fingerprint and the host-key fingerprint are the whole point of these commands: the
40808
+ * key goes on the client's Git server and the fingerprint is what they compare out of band. Nothing private
40809
+ * can leak here — `HostingSshSourceConnectionData` has no private field at all, because the deploy key's
40810
+ * private half never leaves the API.
40811
+ */
40812
+ function connectionLines(connection) {
40813
+ return [
40814
+ ` ssh source ${connection.uuid} ${connection.name}`,
40815
+ ` repository ${connection.repositoryUrl} ${connection.refKind} ${connection.ref}`,
40816
+ ` host ${connection.host}:${String(connection.port)} host key ${connection.hostKeyType}`,
40817
+ ` host-key fingerprint ${connection.hostKeyFingerprint}`,
40818
+ ` host key ${confirmedText(connection.hostKeyConfirmedAt)}`,
40819
+ ` public key ${connection.publicKey}`,
40820
+ ` key fingerprint ${connection.keyFingerprint}`,
40821
+ ` access ${accessText(connection)}`,
40822
+ ...connection.revokedAt === null ? [] : [` revoked ${connection.revokedAt}`]
40823
+ ].join("\n");
40824
+ }
40825
+ /** Whether the server's host key has been confirmed, and what that confirmation means. */
40826
+ function confirmedText(confirmedAt) {
40827
+ return confirmedAt === null ? "discovered, not confirmed — compare the fingerprint with the server, then source-ssh-confirm-host-key" : `confirmed ${confirmedAt}`;
40828
+ }
40829
+ /** What the platform last observed about the key's access, kept apart from whether the key exists. */
40830
+ function accessText(connection) {
40831
+ if (connection.revokedAt !== null) return "revoked — this source cannot fetch";
40832
+ if (connection.accessFailureReason !== null) return `refused: ${connection.accessFailureReason}`;
40833
+ if (connection.accessVerifiedAt !== null) return `verified ${connection.accessVerifiedAt}`;
40834
+ return "not verified yet — source-ssh-verify proves the key can read the repository";
40835
+ }
40836
+ /** A new source: the host key it discovered, and the same three values `show` prints. */
40837
+ function createdLines(created) {
40838
+ const { hostKey } = created;
40839
+ return [
40840
+ ` discovered host key ${hostKey.hostKeyType} on ${hostKey.host}:${String(hostKey.port)}`,
40841
+ ` host-key fingerprint ${hostKey.fingerprint}`,
40842
+ " Compare that fingerprint with the one your Git server reports, then confirm it with",
40843
+ " `application source-ssh-confirm-host-key`. Until it is confirmed nothing is fetched: a discovered key",
40844
+ " is a candidate, never a trust decision.",
40845
+ connectionLines(created.connection)
40846
+ ].join("\n");
40847
+ }
40848
+ /** The `application source-ssh-*` renderer. */
40849
+ function applicationSshSourceText(report) {
40850
+ if (report.kind === "ssh-source") return connectionLines(report.connection);
40851
+ if (report.kind === "ssh-sources") {
40852
+ if (report.connections.length === 0) return "No Git-over-SSH sources in this company. Add one with `application source-ssh-create`.";
40853
+ return report.connections.map((one) => connectionLines(one)).join("\n");
40854
+ }
40855
+ const { outcome } = report;
40856
+ if (!outcome.sent) return `Would: ${outcome.description}\nNothing was sent (--dry-run).`;
40857
+ return `${outcome.description}\n${"connection" in outcome.result ? createdLines(outcome.result) : connectionLines(outcome.result)}`;
40858
+ }
40859
+ //#endregion
40100
40860
  //#region src/commands/application-text.ts
40101
40861
  /** The `application` group's human rendering, each answer read from the API's own payload. */
40102
40862
  /** Each group tags its own answers, so the kind names the renderer. */
@@ -40110,10 +40870,26 @@ function taggedText$1(report) {
40110
40870
  if (report.kind === "create-write") return createText(report);
40111
40871
  return applicationAdminText(report);
40112
40872
  }
40873
+ /**
40874
+ * The two source groups' answers: the staged uploads one application holds, and the Git-over-SSH sources the
40875
+ * company owns. They are dispatched apart from `taggedText` because between them they add six kinds to a
40876
+ * chain that is already as long as the complexity rule allows.
40877
+ */
40878
+ function sourceGroupText(report) {
40879
+ switch (report.kind) {
40880
+ case "source-upload":
40881
+ case "source-uploads":
40882
+ case "source-upload-write": return applicationSourceUploadText(report);
40883
+ case "ssh-source":
40884
+ case "ssh-sources":
40885
+ case "ssh-source-write": return applicationSshSourceText(report);
40886
+ default: return null;
40887
+ }
40888
+ }
40113
40889
  function applicationText(report) {
40114
40890
  if ("anonymousKey" in report) return report.anonymousKey;
40115
40891
  if ("measurement" in report) return applicationSpeedText(report);
40116
- if ("kind" in report) return taggedText$1(report);
40892
+ if ("kind" in report) return sourceGroupText(report) ?? taggedText$1(report);
40117
40893
  if ("sent" in report) return renderWriteOutcome(report, writeAnyResultText);
40118
40894
  if ("applications" in report) return listText(report);
40119
40895
  if ("runs" in report) return runsText(report);
@@ -40227,6 +41003,7 @@ async function journey(context) {
40227
41003
  const [action, ...rest] = context.positional;
40228
41004
  const company = await requireCompany(context.flags);
40229
41005
  if (action === "list") return await list$4(company, rest);
41006
+ if (action !== void 0 && SSH_SOURCE_ACTIONS.has(action)) return await applicationSshSources(context, action, company, rest);
40230
41007
  const [environmentUuid, workloadUuid, ...extra] = rest;
40231
41008
  if (environmentUuid === void 0) throw new UsageError(APPLICATION_USAGE);
40232
41009
  if (action === "show") return await show$7(company, environmentUuid, workloadUuid, extra);
@@ -40249,6 +41026,7 @@ async function journey(context) {
40249
41026
  async function dispatched$2(context, action, path, extra) {
40250
41027
  if (action === "build") return await build(context, path, extra);
40251
41028
  if (action === "deploy") return await deploy(context, path, extra);
41029
+ if (action !== void 0 && SOURCE_UPLOAD_ACTIONS.has(action)) return await applicationSourceUploads(context, action, path, extra);
40252
41030
  if (action === "run-log") return await runLog(path, extra);
40253
41031
  if (action === "schedule-run" || action === "schedule-suspend" || action === "schedule-resume") return await scheduleAction(context, action, path, extra);
40254
41032
  if (action === "runtime") return await setRuntime(context, path, extra);
@@ -40286,19 +41064,14 @@ async function show$7(company, environmentUuid, workloadUuid, extra) {
40286
41064
  workloadUuid
40287
41065
  } })).data;
40288
41066
  }
40289
- /** `build <env> <workload> [--source …] [--idempotency-key …]`: queue a build of applied config. */
41067
+ /**
41068
+ * `build <env> <workload> [--source …|--source-upload …|--ssh-source …] [--idempotency-key …]`: queue a build.
41069
+ *
41070
+ * The build and source actions live together in application-builds.ts, so the source choice a build names and
41071
+ * the binding that would otherwise decide it are read in one place.
41072
+ */
40290
41073
  async function build(context, path, extra) {
40291
- if (extra.length > 0) throw new UsageError(APPLICATION_USAGE);
40292
- const source = optionalFlag(context, "--source");
40293
- const idempotencyKey = optionalFlag(context, "--idempotency-key");
40294
- const body = {
40295
- ...source === null ? {} : { repositorySelectionUuid: source },
40296
- ...idempotencyKey === null ? {} : { idempotencyKey }
40297
- };
40298
- return await confirmableWrite(context, [`Build application ${path.workloadUuid} from its applied configuration, generation source ${source ?? "the bound selection"}.`, "The source resolves to an exact commit; nothing here names a commit or an image."].join("\n"), async () => (await hostingDeploymentStore({
40299
- path,
40300
- body
40301
- })).data);
41074
+ return await applicationBuilds(context, "build", path, extra);
40302
41075
  }
40303
41076
  /** `deploy <env> <workload> <release-uuid>`: run an existing release. */
40304
41077
  async function deploy(context, path, extra) {
@@ -40318,11 +41091,6 @@ async function runLog(path, extra) {
40318
41091
  runName
40319
41092
  } })).data;
40320
41093
  }
40321
- /** `update <env> <workload> --label …`: rename the label only, never the immutable name. */
40322
- function optionalFlag(context, flag) {
40323
- const value = context.flags.get(flag)?.trim() ?? "";
40324
- return value === "" ? null : value;
40325
- }
40326
41094
  //#endregion
40327
41095
  //#region src/commands/arguments.ts
40328
41096
  /**
@@ -54923,14 +55691,21 @@ object({ items: array(object({
54923
55691
  effectiveFrom: datetime(),
54924
55692
  effectiveUntil: datetime().nullable()
54925
55693
  })) });
55694
+ var hostingSourceKindEnumSchema = _enum([
55695
+ "github",
55696
+ "upload",
55697
+ "ssh"
55698
+ ]).describe("Where an application's source code came from. The value is recorded on the build attempt, not only on the application, because the attempt is what the platform can already prove: a build row keeps its own provenance after the binding or the connection behind it is replaced. `github` is the original GitHub App path; `upload` is a client-supplied ZIP and `ssh` is a Git repository fetched over SSH with a deploy key.\n");
54926
55699
  var hostingTagRuleEnumSchema = _enum(["exact", "line"]).describe("How a binding follows the tag it names. `EXACT` is \"this tag and no other\". `LINE` is \"newer tags in this line\", where the line is the major version — which is what makes a major bump the one thing a line will not walk across. The decision is a method here rather than a service because it is a table of rules over two values, with no IO, no storage and no cluster: every row is provable with data, which is the cheapest rung this obligation has. It takes the tag a binding recorded and the tag a push delivered, because those are the two facts a delivery is judged against — and a tag that is legal when bound can always be followed by one that is not, so the judgement belongs at delivery.\n| |\n|---|\n| `exact` <br/> The binding follows the exact tag it named. |\n| `line` <br/> The binding follows newer stable tags in the same major line. |");
54927
55700
  var bindHostingApplicationSourceRequestSchema = object({
54928
- repositorySelectionUuid: uuid(),
55701
+ sourceKind: union([hostingSourceKindEnumSchema, _null()]).optional(),
55702
+ repositorySelectionUuid: uuid().nullish(),
55703
+ sshSourceUuid: uuid().nullish(),
54929
55704
  branch: string().max(255).nullish(),
54930
55705
  tag: string().max(255).nullish().describe("A binding names EITHER a branch or a tag, and naming one clears the other: a binding that\nnamed both would make the delivery match ambiguous rather than merely surprising."),
54931
55706
  tagRule: union([hostingTagRuleEnumSchema, _null()]).optional(),
54932
55707
  autoDeploy: boolean().nullish()
54933
- }).describe("Choosing the repository an application builds from, the branch it builds, and whether that branch\ndeploys by itself.\n\nThe selection is a UUID resolved inside the authorized company, so nothing here names a host, a\ntoken or a checkout. `branch` is the customer's own name for a ref, not a SHA: the platform resolves\nit to an exact commit before it stores anything, and refuses a name that resolves to nothing. Naming\nno branch leaves an existing choice alone rather than clearing it. `autoDeploy` is consent rather than\na setting: turning it on lets anyone who can write to the selected branch execute code beside this\napplication's runtime secrets, which the interface states next to the control.");
55708
+ }).describe("Choosing the source an application builds from, the ref it builds, and whether that ref deploys by\nitself.\n\nThe selection is a UUID resolved inside the authorized company, so nothing here names a host, a\ntoken or a checkout. `branch` is the customer's own name for a ref, not a SHA: the platform resolves\nit to an exact commit before it stores anything, and refuses a name that resolves to nothing. Naming\nno branch leaves an existing choice alone rather than clearing it. `autoDeploy` is consent rather than\na setting: turning it on lets anyone who can write to the selected branch execute code beside this\napplication's runtime secrets, which the interface states next to the control.");
54934
55709
  var bindHostingDatabaseRequestSchema = object({
54935
55710
  bindings: array(uuid()).max(16).refine((items) => new Set(items).size === items.length, { message: "Array entries must be unique" }),
54936
55711
  desiredGeneration: int().min(0),
@@ -55208,6 +55983,7 @@ var confirmHostingApplicationRecoveryRequestSchema = object({
55208
55983
  }).optional()
55209
55984
  })
55210
55985
  }).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.");
55986
+ 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.");
55211
55987
  object({
55212
55988
  confirmation: string().min(64).max(64).regex(/^[a-f0-9]+$/),
55213
55989
  desiredGeneration: int().min(0)
@@ -57075,6 +57851,7 @@ var hostingBuildDataSchema = object({
57075
57851
  status: string(),
57076
57852
  sourceBranch: string().nullable(),
57077
57853
  sourceCommitSha: string().nullable(),
57854
+ sourceKind: string(),
57078
57855
  recipeDigest: string().nullable(),
57079
57856
  toolchainDigest: string().nullable(),
57080
57857
  artifactDigest: string().nullable(),
@@ -57690,6 +58467,46 @@ var hostingRepositorySelectionDataSchema = object({
57690
58467
  lastCommitSha: string().nullable(),
57691
58468
  lastFetchedAt: string().nullable()
57692
58469
  });
58470
+ var hostingSourceUploadReviewDataSchema = object({
58471
+ hasPackageJson: boolean(),
58472
+ hasLockfile: boolean(),
58473
+ lockfileName: string().nullable(),
58474
+ nodeEngine: string().nullable(),
58475
+ missing: array(string())
58476
+ });
58477
+ var hostingSourceUploadDataSchema = object({
58478
+ uuid: string(),
58479
+ workloadUuid: string(),
58480
+ status: string(),
58481
+ originalFilename: string(),
58482
+ archiveSha256: string(),
58483
+ compressedBytes: int(),
58484
+ expandedBytes: int(),
58485
+ fileCount: int(),
58486
+ detectedRoot: string(),
58487
+ expiresAt: string().nullable(),
58488
+ createdAt: string(),
58489
+ review: hostingSourceUploadReviewDataSchema
58490
+ });
58491
+ var hostingSshSourceConnectionDataSchema = object({
58492
+ uuid: string(),
58493
+ name: string(),
58494
+ repositoryUrl: string(),
58495
+ host: string(),
58496
+ port: int(),
58497
+ ref: string(),
58498
+ refKind: string(),
58499
+ hostKeyType: string(),
58500
+ hostKeyFingerprint: string(),
58501
+ hostKeyPublic: string(),
58502
+ hostKeyConfirmedAt: string().nullable(),
58503
+ publicKey: string(),
58504
+ keyFingerprint: string(),
58505
+ accessVerifiedAt: string().nullable(),
58506
+ accessFailureReason: string().nullable(),
58507
+ revokedAt: string().nullable(),
58508
+ createdAt: string()
58509
+ });
57693
58510
  object({
57694
58511
  applicationUuid: string(),
57695
58512
  running: union([hostingReleaseDataSchema, _null()]),
@@ -57701,7 +58518,10 @@ object({
57701
58518
  autoDeploy: boolean(),
57702
58519
  autoDeployVerdict: union([hostingAutoDeployVerdictDataSchema, _null()]),
57703
58520
  availableSources: array(hostingRepositorySelectionDataSchema),
57704
- canManage: boolean()
58521
+ canManage: boolean(),
58522
+ sourceKind: string(),
58523
+ uploadedSource: union([hostingSourceUploadDataSchema, _null()]),
58524
+ sshSource: union([hostingSshSourceConnectionDataSchema, _null()])
57705
58525
  });
57706
58526
  object({
57707
58527
  environmentUuid: string(),
@@ -58509,6 +59329,7 @@ object({
58509
59329
  })),
58510
59330
  meta: pageMetaDataSchema
58511
59331
  });
59332
+ var hostingSourceRefKindEnumSchema = _enum(["branch", "tag"]).describe("Which namespace a Git-over-SSH source's ref resolves in. A branch and a tag can have the same name, and they mean different things: a branch moves, a tag is meant to be released. Naming the namespace is what stops a fetch from accepting a tag where the client meant a branch (or the reverse).\n");
58512
59333
  object({
58513
59334
  repositoryId: string(),
58514
59335
  owner: string(),
@@ -58547,6 +59368,16 @@ object({
58547
59368
  samples: array(hostingSpeedSampleDataSchema),
58548
59369
  findings: array(hostingSpeedFindingDataSchema)
58549
59370
  });
59371
+ object({
59372
+ connection: hostingSshSourceConnectionDataSchema,
59373
+ hostKey: object({
59374
+ host: string(),
59375
+ port: int(),
59376
+ hostKeyType: string(),
59377
+ hostKeyPublic: string(),
59378
+ fingerprint: string()
59379
+ })
59380
+ });
58550
59381
  object({
58551
59382
  rows: array(object({
58552
59383
  claim: string(),
@@ -59167,9 +59998,11 @@ var requestHostingApplicationRemovalRequestSchema = object({
59167
59998
  desiredGeneration: int().min(0)
59168
59999
  }).describe("Confirming the removal of one application against the inventory that was reviewed.\n\n`confirmation` is the digest the review returned, and it is required rather than optional: it\nis what makes the confirmation an approval of an exact inventory instead of an approval of a\nlabel. `desiredGeneration` is the same idea at the environment level, so a request that was\ncomposed before another change is a conflict rather than a removal of something else.");
59169
60000
  var requestHostingBuildRequestSchema = object({
59170
- repositorySelectionUuid: uuid().nullish(),
60001
+ repositorySelectionUuid: uuid().nullish().describe("Exactly one source may be named. A repository selection and an upload are the two a request\nmay choose directly; an SSH source is usually the application's binding and is named only to\nbuild from a connection that is not the bound one."),
60002
+ sourceUploadUuid: uuid().nullish(),
60003
+ sshSourceUuid: uuid().nullish(),
59171
60004
  idempotencyKey: string().max(128).nullish()
59172
- }).describe("A request to build an application's applied configuration.\n\nNothing here names a commit, an image or a recipe: the source is whichever repository selection\nthe caller names, resolved to an exact commit by the source service, and the rest comes from the\napplied configuration. A caller cannot ask for a build of something the environment did not\ndeclare.\n\n`idempotencyKey` is optional. Supplying one makes a repeated request resolve to the attempt that\nalready exists — useful for a retried HTTP call — while omitting it means a deliberate new\nattempt, which is what a second deploy actually is.");
60005
+ }).describe("A request to build an application's applied configuration.\n\nNothing here names a commit, an image or a recipe: the source is whichever of the three source kinds\nthe caller names, resolved to an exact identity by that kind's own owner, and the rest comes from the\napplied configuration. A caller cannot ask for a build of something the environment did not declare.\n\nNaming more than one source is refused by the deployment owner rather than here, because \"which one\n * would be used\" is a rule about the build rather than about a field's shape.\n\n`idempotencyKey` is optional. Supplying one makes a repeated request resolve to the attempt that\nalready exists — useful for a retried HTTP call — while omitting it means a deliberate new\nattempt, which is what a second deploy actually is.");
59173
60006
  var requestHostingDatabaseRetirementRequestSchema = object({
59174
60007
  confirmation: string().min(64).max(64),
59175
60008
  desiredGeneration: int().min(0),
@@ -59488,6 +60321,13 @@ var storeHostingSeedVersionRequestSchema = object({
59488
60321
  }),
59489
60322
  releaseUuid: uuid().nullish()
59490
60323
  }).describe("Record one immutable seed version.\n\nThe source snapshot is a release/commit *and* a checksum, and the content contract names the tree\nthe adoption step verifies. `releaseUuid` is a reference to the existing immutable artifact owner,\nnever a copied snapshot or an object path, and a platform version may not point at a company's\nrelease — the service refuses that, because a shared seed cannot carry private bytes.\n\n`sourceCommit` and `runtimeImageDigest` are identity, so they are validated as identity: a commit\nis a full 40- or 64-character hex object id, and the runtime image must end in an `@sha256:`\ndigest — either a bare digest or the full `repository[:tag]@sha256:…` reference a Pod can pull.\nA mutable tag like `latest` is deliberately refused here rather than persisted as if it pinned\nbytes, because a version whose runtime can change under it is not a version.");
60324
+ var storeHostingSourceUploadRequestSchema = object({ archive: _instanceof(File).describe("`extensions:zip` rather than a MIME assertion: a ZIP's declared MIME type is chosen by the\nclient's browser, while the archive itself is opened and validated before anything is\nstored. The extension check only keeps an obvious mistake away from that work.") }).describe("One uploaded source archive for one application.\n\nThe only thing a client chooses here is the file. Everything else the review reports — the wrapper\ndirectory, the digest, the sizes, the file count, whether a `package.json` and a lockfile are present —\nis measured by the platform from the bytes it accepted, because a client-supplied description of an\narchive is exactly what a build must not trust.\n\nThe size ceiling is read from configuration rather than written here, so the number the review screen\nshows a client and the number the validator enforces cannot drift apart.");
60325
+ var storeHostingSshSourceRequestSchema = object({
60326
+ name: string().max(100),
60327
+ repositoryUrl: string().max(1024).describe("Bounded well above a real address only so a refusal names the URL rule rather than a\nlength rule; the normalized form is what is stored."),
60328
+ ref: string().max(255),
60329
+ refKind: hostingSourceRefKindEnumSchema.describe("Which namespace a Git-over-SSH source's ref resolves in. A branch and a tag can have the same name, and they mean different things: a branch moves, a tag is meant to be released. Naming the namespace is what stops a fetch from accepting a tag where the client meant a branch (or the reverse).\n")
60330
+ }).describe("A new Git-over-SSH source: a label, a repository address and the ref to read.\n\nOnly shape is checked here. Whether the address is an accepted SSH Git URL, whether the server\nanswers and whether the ref exists are the service's answers, because each requires a decision\nabout the world rather than about the submitted string.");
59491
60331
  var storePlatformAlertRecipientRequestSchema = object({ email: email().max(254) }).describe("Add one system-admin address to the platform alert recipient list.\n\nSyntax is the request's (`email:rfc|max:254`); normalization to the canonical value is the\nexisting `emails` owner's, never a second normalizer here. The route's `can:` middleware owns the\npermission check, so authorization is not repeated.");
59492
60332
  var storePlatformCompanyRequestSchema = object({
59493
60333
  name: string().max(255),
@@ -59726,6 +60566,11 @@ object({
59726
60566
  requiredSignIn: boolean(),
59727
60567
  audienceName: string().max(120)
59728
60568
  });
60569
+ var updateHostingSshSourceRequestSchema = object({
60570
+ name: string().max(100).nullish(),
60571
+ ref: string().max(255).nullish(),
60572
+ refKind: union([hostingSourceRefKindEnumSchema, _null()]).optional()
60573
+ }).describe("An edit to a Git-over-SSH source's label or ref.\n\nEvery field is optional: naming only a label leaves the ref alone, and naming only a ref leaves the\nlabel alone. The repository address and the key are absent on purpose — either one describes a\ndifferent source, so replacing it is a new connection rather than an edit.");
59729
60574
  var updateHostingToolSelectionRequestSchema = object({
59730
60575
  enabled: boolean(),
59731
60576
  desiredGeneration: int().min(1)
@@ -60998,7 +61843,7 @@ union([
60998
61843
  messageDataSchema,
60999
61844
  hostingRefusalDataSchema
61000
61845
  ]);
61001
- requestHostingBuildRequestSchema.optional().describe("A request to build an application's applied configuration.\n\nNothing here names a commit, an image or a recipe: the source is whichever repository selection\nthe caller names, resolved to an exact commit by the source service, and the rest comes from the\napplied configuration. A caller cannot ask for a build of something the environment did not\ndeclare.\n\n`idempotencyKey` is optional. Supplying one makes a repeated request resolve to the attempt that\nalready exists — useful for a retried HTTP call — while omitting it means a deliberate new\nattempt, which is what a second deploy actually is.");
61846
+ requestHostingBuildRequestSchema.optional().describe("A request to build an application's applied configuration.\n\nNothing here names a commit, an image or a recipe: the source is whichever of the three source kinds\nthe caller names, resolved to an exact identity by that kind's own owner, and the rest comes from the\napplied configuration. A caller cannot ask for a build of something the environment did not declare.\n\nNaming more than one source is refused by the deployment owner rather than here, because \"which one\n * would be used\" is a rule about the build rather than about a field's shape.\n\n`idempotencyKey` is optional. Supplying one makes a repeated request resolve to the attempt that\nalready exists — useful for a retried HTTP call — while omitting it means a deliberate new\nattempt, which is what a second deploy actually is.");
61002
61847
  union([
61003
61848
  object({ message: string().describe("Error overview.") }),
61004
61849
  object({ message: string().describe("Error overview.") }),
@@ -61193,7 +62038,7 @@ union([
61193
62038
  messageDataSchema,
61194
62039
  hostingRefusalDataSchema
61195
62040
  ]);
61196
- bindHostingApplicationSourceRequestSchema.describe("Choosing the repository an application builds from, the branch it builds, and whether that branch\ndeploys by itself.\n\nThe selection is a UUID resolved inside the authorized company, so nothing here names a host, a\ntoken or a checkout. `branch` is the customer's own name for a ref, not a SHA: the platform resolves\nit to an exact commit before it stores anything, and refuses a name that resolves to nothing. Naming\nno branch leaves an existing choice alone rather than clearing it. `autoDeploy` is consent rather than\na setting: turning it on lets anyone who can write to the selected branch execute code beside this\napplication's runtime secrets, which the interface states next to the control.");
62041
+ bindHostingApplicationSourceRequestSchema.optional().describe("Choosing the source an application builds from, the ref it builds, and whether that ref deploys by\nitself.\n\nThe selection is a UUID resolved inside the authorized company, so nothing here names a host, a\ntoken or a checkout. `branch` is the customer's own name for a ref, not a SHA: the platform resolves\nit to an exact commit before it stores anything, and refuses a name that resolves to nothing. Naming\nno branch leaves an existing choice alone rather than clearing it. `autoDeploy` is consent rather than\na setting: turning it on lets anyone who can write to the selected branch execute code beside this\napplication's runtime secrets, which the interface states next to the control.");
61197
62042
  union([
61198
62043
  object({ message: string().describe("Error overview.") }),
61199
62044
  object({ message: string().describe("Error overview.") }),
@@ -61848,6 +62693,72 @@ union([
61848
62693
  object({ message: string().describe("Error overview.") }),
61849
62694
  messageDataSchema
61850
62695
  ]);
62696
+ union([
62697
+ object({ message: string().describe("Error overview.") }),
62698
+ object({ message: string().describe("Error overview.") }),
62699
+ messageDataSchema,
62700
+ hostingRefusalDataSchema
62701
+ ]);
62702
+ storeHostingSourceUploadRequestSchema.describe("One uploaded source archive for one application.\n\nThe only thing a client chooses here is the file. Everything else the review reports — the wrapper\ndirectory, the digest, the sizes, the file count, whether a `package.json` and a lockfile are present —\nis measured by the platform from the bytes it accepted, because a client-supplied description of an\narchive is exactly what a build must not trust.\n\nThe size ceiling is read from configuration rather than written here, so the number the review screen\nshows a client and the number the validator enforces cannot drift apart.");
62703
+ union([
62704
+ object({ message: string().describe("Error overview.") }),
62705
+ object({ message: string().describe("Error overview.") }),
62706
+ messageDataSchema
62707
+ ]);
62708
+ union([
62709
+ object({ message: string().describe("Error overview.") }),
62710
+ object({ message: string().describe("Error overview.") }),
62711
+ messageDataSchema,
62712
+ hostingRefusalDataSchema
62713
+ ]);
62714
+ union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
62715
+ union([
62716
+ object({ message: string().describe("Error overview.") }),
62717
+ object({ message: string().describe("Error overview.") }),
62718
+ hostingRefusalDataSchema
62719
+ ]);
62720
+ storeHostingSshSourceRequestSchema.describe("A new Git-over-SSH source: a label, a repository address and the ref to read.\n\nOnly shape is checked here. Whether the address is an accepted SSH Git URL, whether the server\nanswers and whether the ref exists are the service's answers, because each requires a decision\nabout the world rather than about the submitted string.");
62721
+ union([
62722
+ object({ message: string().describe("Error overview.") }),
62723
+ object({ message: string().describe("Error overview.") }),
62724
+ messageDataSchema
62725
+ ]);
62726
+ union([
62727
+ object({ message: string().describe("Error overview.") }),
62728
+ object({ message: string().describe("Error overview.") }),
62729
+ messageDataSchema,
62730
+ hostingRefusalDataSchema
62731
+ ]);
62732
+ updateHostingSshSourceRequestSchema.optional().describe("An edit to a Git-over-SSH source's label or ref.\n\nEvery field is optional: naming only a label leaves the ref alone, and naming only a ref leaves the\nlabel alone. The repository address and the key are absent on purpose — either one describes a\ndifferent source, so replacing it is a new connection rather than an edit.");
62733
+ union([
62734
+ object({ message: string().describe("Error overview.") }),
62735
+ object({ message: string().describe("Error overview.") }),
62736
+ messageDataSchema,
62737
+ hostingRefusalDataSchema
62738
+ ]);
62739
+ confirmHostingSshHostKeyRequestSchema.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.");
62740
+ union([
62741
+ object({ message: string().describe("Error overview.") }),
62742
+ object({ message: string().describe("Error overview.") }),
62743
+ messageDataSchema,
62744
+ hostingRefusalDataSchema
62745
+ ]);
62746
+ union([
62747
+ object({ message: string().describe("Error overview.") }),
62748
+ object({ message: string().describe("Error overview.") }),
62749
+ messageDataSchema,
62750
+ hostingRefusalDataSchema
62751
+ ]);
62752
+ union([
62753
+ object({ message: string().describe("Error overview.") }),
62754
+ object({ message: string().describe("Error overview.") }),
62755
+ messageDataSchema
62756
+ ]);
62757
+ union([
62758
+ object({ message: string().describe("Error overview.") }),
62759
+ object({ message: string().describe("Error overview.") }),
62760
+ messageDataSchema
62761
+ ]);
61851
62762
  union([
61852
62763
  object({ message: string().describe("Error overview.") }),
61853
62764
  object({ message: string().describe("Error overview.") }),
@@ -67728,7 +68639,7 @@ function writeUpdateState(state, env = process.env) {
67728
68639
  }
67729
68640
  //#endregion
67730
68641
  //#region src/version.ts
67731
- var VERSION = "1.0.521";
68642
+ var VERSION = "1.0.522";
67732
68643
  //#endregion
67733
68644
  //#region src/commands/update.ts
67734
68645
  /**
@@ -67803,7 +68714,7 @@ var update = {
67803
68714
  }, process.env);
67804
68715
  return {
67805
68716
  ...known,
67806
- current: after ?? "1.0.521",
68717
+ current: after ?? "1.0.522",
67807
68718
  latest: after ?? latest,
67808
68719
  upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
67809
68720
  action: "run",
@@ -68079,7 +68990,7 @@ async function printUpdateNotice(options) {
68079
68990
  }, env, { waitMs: NOTICE_LOCK_WAIT_MS });
68080
68991
  } catch {}
68081
68992
  if (latest === null) return;
68082
- if (!isNewerVersion(latest, "1.0.521")) return;
68993
+ if (!isNewerVersion(latest, "1.0.522")) return;
68083
68994
  process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
68084
68995
  }
68085
68996
  /** Whether an environment variable is set to something, which is how CI and the opt-out are read. */