@haakco/hostingctl 1.0.525 → 1.0.537

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
@@ -34904,6 +34904,186 @@ function hostingSshSourcesRevoke(options) {
34904
34904
  }));
34905
34905
  }
34906
34906
  /**
34907
+ * {@link /c/:company/hosting/storage}
34908
+ */
34909
+ function hostingStorageIndex(options) {
34910
+ const { client: request = client, ...config } = options;
34911
+ return withUnwrap(request({
34912
+ method: "GET",
34913
+ url: "/c/{company}/hosting/storage",
34914
+ security: [{
34915
+ type: "http",
34916
+ scheme: "bearer"
34917
+ }],
34918
+ ...config,
34919
+ throwOnError: config.throwOnError ?? true
34920
+ }));
34921
+ }
34922
+ /**
34923
+ * {@link /c/:company/hosting/storage}
34924
+ */
34925
+ function hostingStorageStore(options) {
34926
+ const { client: request = client, ...config } = options;
34927
+ return withUnwrap(request({
34928
+ method: "POST",
34929
+ url: "/c/{company}/hosting/storage",
34930
+ security: [{
34931
+ type: "http",
34932
+ scheme: "bearer"
34933
+ }],
34934
+ ...config,
34935
+ throwOnError: config.throwOnError ?? true
34936
+ }));
34937
+ }
34938
+ /**
34939
+ * {@link /c/:company/hosting/storage/:bucketUuid}
34940
+ */
34941
+ function hostingStorageShow(options) {
34942
+ const { client: request = client, ...config } = options;
34943
+ return withUnwrap(request({
34944
+ method: "GET",
34945
+ url: "/c/{company}/hosting/storage/{bucketUuid}",
34946
+ security: [{
34947
+ type: "http",
34948
+ scheme: "bearer"
34949
+ }],
34950
+ ...config,
34951
+ throwOnError: config.throwOnError ?? true
34952
+ }));
34953
+ }
34954
+ /**
34955
+ * {@link /c/:company/hosting/storage/:bucketUuid}
34956
+ */
34957
+ function hostingStorageUpdate(options) {
34958
+ const { client: request = client, ...config } = options;
34959
+ return withUnwrap(request({
34960
+ method: "PATCH",
34961
+ url: "/c/{company}/hosting/storage/{bucketUuid}",
34962
+ security: [{
34963
+ type: "http",
34964
+ scheme: "bearer"
34965
+ }],
34966
+ ...config,
34967
+ throwOnError: config.throwOnError ?? true
34968
+ }));
34969
+ }
34970
+ /**
34971
+ * @description Retiring removes the client's accounts at the gateway, which is what stops writes, and leaves the
34972
+ * provider bucket untouched: deleting a client's data is a separately ordered operation owned by
34973
+ * retention, not a side effect of detaching access.
34974
+ * @summary Retire access, keeping every object
34975
+ * {@link /c/:company/hosting/storage/:bucketUuid}
34976
+ */
34977
+ function hostingStorageDestroy(options) {
34978
+ const { client: request = client, ...config } = options;
34979
+ return withUnwrap(request({
34980
+ method: "DELETE",
34981
+ url: "/c/{company}/hosting/storage/{bucketUuid}",
34982
+ security: [{
34983
+ type: "http",
34984
+ scheme: "bearer"
34985
+ }],
34986
+ ...config,
34987
+ throwOnError: config.throwOnError ?? true
34988
+ }));
34989
+ }
34990
+ /**
34991
+ * {@link /c/:company/hosting/storage/:bucketUuid/bindings/:environmentUuid}
34992
+ */
34993
+ function hostingStorageBindingsStore(options) {
34994
+ const { client: request = client, ...config } = options;
34995
+ return withUnwrap(request({
34996
+ method: "PUT",
34997
+ url: "/c/{company}/hosting/storage/{bucketUuid}/bindings/{environmentUuid}",
34998
+ security: [{
34999
+ type: "http",
35000
+ scheme: "bearer"
35001
+ }],
35002
+ ...config,
35003
+ throwOnError: config.throwOnError ?? true
35004
+ }));
35005
+ }
35006
+ /**
35007
+ * {@link /c/:company/hosting/storage/:bucketUuid/bindings/:environmentUuid}
35008
+ */
35009
+ function hostingStorageBindingsDestroy(options) {
35010
+ const { client: request = client, ...config } = options;
35011
+ return withUnwrap(request({
35012
+ method: "DELETE",
35013
+ url: "/c/{company}/hosting/storage/{bucketUuid}/bindings/{environmentUuid}",
35014
+ security: [{
35015
+ type: "http",
35016
+ scheme: "bearer"
35017
+ }],
35018
+ ...config,
35019
+ throwOnError: config.throwOnError ?? true
35020
+ }));
35021
+ }
35022
+ /**
35023
+ * {@link /c/:company/hosting/storage/:bucketUuid/credentials}
35024
+ */
35025
+ function hostingStorageCredentialsStore(options) {
35026
+ const { client: request = client, ...config } = options;
35027
+ return withUnwrap(request({
35028
+ method: "POST",
35029
+ url: "/c/{company}/hosting/storage/{bucketUuid}/credentials",
35030
+ security: [{
35031
+ type: "http",
35032
+ scheme: "bearer"
35033
+ }],
35034
+ ...config,
35035
+ throwOnError: config.throwOnError ?? true
35036
+ }));
35037
+ }
35038
+ /**
35039
+ * {@link /c/:company/hosting/storage/:bucketUuid/objects}
35040
+ */
35041
+ function hostingStorageObjectsIndex(options) {
35042
+ const { client: request = client, ...config } = options;
35043
+ return withUnwrap(request({
35044
+ method: "GET",
35045
+ url: "/c/{company}/hosting/storage/{bucketUuid}/objects",
35046
+ security: [{
35047
+ type: "http",
35048
+ scheme: "bearer"
35049
+ }],
35050
+ ...config,
35051
+ throwOnError: config.throwOnError ?? true
35052
+ }));
35053
+ }
35054
+ /**
35055
+ * {@link /c/:company/hosting/storage/:bucketUuid/objects/grants}
35056
+ */
35057
+ function hostingStorageObjectsGrant(options) {
35058
+ const { client: request = client, ...config } = options;
35059
+ return withUnwrap(request({
35060
+ method: "POST",
35061
+ url: "/c/{company}/hosting/storage/{bucketUuid}/objects/grants",
35062
+ security: [{
35063
+ type: "http",
35064
+ scheme: "bearer"
35065
+ }],
35066
+ ...config,
35067
+ throwOnError: config.throwOnError ?? true
35068
+ }));
35069
+ }
35070
+ /**
35071
+ * {@link /c/:company/hosting/storage-quote}
35072
+ */
35073
+ function hostingStorageQuoteShow(options) {
35074
+ const { client: request = client, ...config } = options;
35075
+ return withUnwrap(request({
35076
+ method: "GET",
35077
+ url: "/c/{company}/hosting/storage-quote",
35078
+ security: [{
35079
+ type: "http",
35080
+ scheme: "bearer"
35081
+ }],
35082
+ ...config,
35083
+ throwOnError: config.throwOnError ?? true
35084
+ }));
35085
+ }
35086
+ /**
34907
35087
  * {@link /c/:company/hosting/environments/:environmentUuid/storage-usage}
34908
35088
  */
34909
35089
  function hostingEnvironmentsStorageUsage(options) {
@@ -36854,7 +37034,7 @@ async function impersonation(context, rest) {
36854
37034
  if (action === "start" && tail.length === 0) return await start(context);
36855
37035
  if (action === "status" && tail.length === 0) return await status$1();
36856
37036
  if (action === "stop" && tail.length === 0) return await stop(context);
36857
- if (action === "list" && tail.length === 0) return await list$5();
37037
+ if (action === "list" && tail.length === 0) return await list$6();
36858
37038
  if (action === "end" && tail.length === 1) return await end(context, tail[0] ?? "");
36859
37039
  throw new UsageError(USAGE$52);
36860
37040
  }
@@ -36940,7 +37120,7 @@ async function stop(context) {
36940
37120
  });
36941
37121
  }
36942
37122
  /** `list`: every session, as the operator's own account sees them. */
36943
- async function list$5() {
37123
+ async function list$6() {
36944
37124
  const sessions = await allPages(async (page, perPage) => {
36945
37125
  const answer = await impersonationIndex({ query: {
36946
37126
  page,
@@ -38768,7 +38948,7 @@ async function applicationBuilds(context, action, path, rest) {
38768
38948
  noExtra$18(rest);
38769
38949
  return await written$7(confirmableWrite(context, "Stop deploying this application from a repository. The running release stays.", async () => (await hostingDeploymentUnbindSource({ path })).data));
38770
38950
  }
38771
- if (action === "source-bind") return await bind$1(context, path, rest);
38951
+ if (action === "source-bind") return await bind$2(context, path, rest);
38772
38952
  const [buildUuid, ...extra] = rest;
38773
38953
  if (buildUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$46);
38774
38954
  const buildPath = {
@@ -38793,7 +38973,7 @@ async function applicationBuilds(context, action, path, rest) {
38793
38973
  * Exactly one of the two references is named, because a binding that named both would leave which source is
38794
38974
  * meant ambiguous rather than merely surprising.
38795
38975
  */
38796
- async function bind$1(context, path, rest) {
38976
+ async function bind$2(context, path, rest) {
38797
38977
  noExtra$18(rest);
38798
38978
  const repositorySelectionUuid = context.flags.get("--selection")?.trim() ?? "";
38799
38979
  const sshSourceUuid = context.flags.get("--ssh-source")?.trim() ?? "";
@@ -41004,11 +41184,11 @@ var application = {
41004
41184
  async function journey(context) {
41005
41185
  const [action, ...rest] = context.positional;
41006
41186
  const company = await requireCompany(context.flags);
41007
- if (action === "list") return await list$4(company, rest);
41187
+ if (action === "list") return await list$5(company, rest);
41008
41188
  if (action !== void 0 && SSH_SOURCE_ACTIONS.has(action)) return await applicationSshSources(context, action, company, rest);
41009
41189
  const [environmentUuid, workloadUuid, ...extra] = rest;
41010
41190
  if (environmentUuid === void 0) throw new UsageError(APPLICATION_USAGE);
41011
- if (action === "show") return await show$7(company, environmentUuid, workloadUuid, extra);
41191
+ if (action === "show") return await show$8(company, environmentUuid, workloadUuid, extra);
41012
41192
  if (action !== void 0 && ROUTE_ACTIONS.has(action)) return await applicationRoutes(context, action, {
41013
41193
  company,
41014
41194
  environmentUuid
@@ -41049,7 +41229,7 @@ function groupFor(action) {
41049
41229
  return null;
41050
41230
  }
41051
41231
  /** `list <env>`: the environment's applications as summaries, carrying the API's `canManage`. */
41052
- async function list$4(company, rest) {
41232
+ async function list$5(company, rest) {
41053
41233
  const [environmentUuid, ...extra] = rest;
41054
41234
  if (environmentUuid === void 0 || extra.length > 0) throw new UsageError(APPLICATION_USAGE);
41055
41235
  return (await hostingApplicationIndex({ path: {
@@ -41058,7 +41238,7 @@ async function list$4(company, rest) {
41058
41238
  } })).data;
41059
41239
  }
41060
41240
  /** `show <env> <workload>`: one application in detail. */
41061
- async function show$7(company, environmentUuid, workloadUuid, extra) {
41241
+ async function show$8(company, environmentUuid, workloadUuid, extra) {
41062
41242
  if (workloadUuid === void 0 || extra.length > 0) throw new UsageError(APPLICATION_USAGE);
41063
41243
  return (await hostingApplicationShow({ path: {
41064
41244
  company,
@@ -41203,7 +41383,7 @@ var backupDestination = {
41203
41383
  async run(context) {
41204
41384
  const [subcommand, ...rest] = context.positional;
41205
41385
  const action = subcommand ?? "show";
41206
- if (action === "show") return await show$6(context, rest);
41386
+ if (action === "show") return await show$7(context, rest);
41207
41387
  if (action === "set") return await set$1(context, rest);
41208
41388
  if (action === "remove") return await remove$3(context, rest);
41209
41389
  throw new UsageError(BACKUP_DESTINATION_USAGE);
@@ -41215,7 +41395,7 @@ var backupDestination = {
41215
41395
  }
41216
41396
  };
41217
41397
  /** `show`, which is also what a bare `backup-destination` does. */
41218
- async function show$6(context, rest) {
41398
+ async function show$7(context, rest) {
41219
41399
  noExtra$13(rest);
41220
41400
  return {
41221
41401
  kind: "destination",
@@ -41574,7 +41754,9 @@ var dnsRecordEnum = {
41574
41754
  };
41575
41755
  var billingProductEnum = {
41576
41756
  MHU: "MHU",
41577
- MHS: "MHS"
41757
+ MHS: "MHS",
41758
+ STO: "STO",
41759
+ TRF: "TRF"
41578
41760
  };
41579
41761
  var hostingCancellationDeletionTimingEnum = {
41580
41762
  "at-service-end": "at-service-end",
@@ -42091,7 +42273,7 @@ function discountsText(items) {
42091
42273
  ]).join("\n");
42092
42274
  }
42093
42275
  /** An issue's answer: the spelling is the one thing the operator cannot reconstruct, so it leads. */
42094
- function issuedText(outcome, now) {
42276
+ function issuedText$1(outcome, now) {
42095
42277
  return renderWriteOutcome(outcome, (code) => [
42096
42278
  `The code is ${code.code} — that spelling is what the client types, so it is the part to keep.`,
42097
42279
  ` ${promiseLine(code, now)}`,
@@ -42116,7 +42298,7 @@ function redeemedText(outcome) {
42116
42298
  /** The text for a discount answer, or null when this module does not own the report. */
42117
42299
  function discountText(report) {
42118
42300
  if (report.kind === "discounts") return discountsText(report.items);
42119
- if (report.kind === "discountIssued") return issuedText(report.outcome, Date.now());
42301
+ if (report.kind === "discountIssued") return issuedText$1(report.outcome, Date.now());
42120
42302
  if (report.kind === "discountEnded") return endedText(report.outcome);
42121
42303
  if (report.kind === "discountRedeemed") return redeemedText(report.outcome);
42122
42304
  return null;
@@ -43014,7 +43196,7 @@ var cancellation = {
43014
43196
  ...CANCELLATION_METADATA,
43015
43197
  async run(context) {
43016
43198
  const [subcommand, ...rest] = context.positional;
43017
- if (subcommand === "show") return await show$5(context, oneUuid$6(rest));
43199
+ if (subcommand === "show") return await show$6(context, oneUuid$6(rest));
43018
43200
  if (subcommand === "request") return await request(context, oneUuid$6(rest));
43019
43201
  const { environmentUuid, cancellationUuid } = episode(rest);
43020
43202
  if (subcommand === "withdraw") return await withdraw(context, environmentUuid, cancellationUuid);
@@ -43029,7 +43211,7 @@ var cancellation = {
43029
43211
  * `cancellation show <uuid>`: the recorded episode, the review, the recorded refusal and the capabilities. A
43030
43212
  * read: it needs no `--confirm`.
43031
43213
  */
43032
- async function show$5(context, environmentUuid) {
43214
+ async function show$6(context, environmentUuid) {
43033
43215
  return (await hostingCancellationShow({ path: {
43034
43216
  company: await requireCompany(context.flags),
43035
43217
  environmentUuid
@@ -43797,31 +43979,31 @@ function bashScript(specs) {
43797
43979
  "# hostingctl shell completion for bash.",
43798
43980
  "_hostingctl() {",
43799
43981
  " local current previous command subcommand",
43800
- " current=\"${COMP_WORDS[COMP_CWORD]}\"",
43801
- " previous=\"${COMP_WORDS[COMP_CWORD-1]}\"",
43982
+ ` current="\${COMP_WORDS[COMP_CWORD]}"`,
43983
+ ` previous="\${COMP_WORDS[COMP_CWORD-1]}"`,
43802
43984
  " command=\"\"",
43803
43985
  " subcommand=\"\"",
43804
43986
  " local index",
43805
43987
  " for (( index=1; index < COMP_CWORD; index++ )); do",
43806
- " case \"${COMP_WORDS[index]}\" in",
43988
+ ` case "\${COMP_WORDS[index]}" in`,
43807
43989
  " -*) continue ;;",
43808
43990
  " esac",
43809
- " if [[ -z \"${command}\" ]]; then",
43810
- " command=\"${COMP_WORDS[index]}\"",
43991
+ ` if [[ -z "\${command}" ]]; then`,
43992
+ ` command="\${COMP_WORDS[index]}"`,
43811
43993
  " else",
43812
- " subcommand=\"${COMP_WORDS[index]}\"",
43994
+ ` subcommand="\${COMP_WORDS[index]}"`,
43813
43995
  " break",
43814
43996
  " fi",
43815
43997
  " done",
43816
43998
  "",
43817
- " case \"${previous}\" in",
43999
+ ` case "\${previous}" in`,
43818
44000
  ` ${VALUE_FLAGS.join("|")})`,
43819
- " COMPREPLY=( $(compgen -f -- \"${current}\") )",
44001
+ ` COMPREPLY=( $(compgen -f -- "\${current}") )`,
43820
44002
  " return 0",
43821
44003
  " ;;",
43822
44004
  " esac",
43823
44005
  "",
43824
- " case \"${command}\" in",
44006
+ ` case "\${command}" in`,
43825
44007
  cases,
43826
44008
  " \"\")",
43827
44009
  ` COMPREPLY=( $(compgen -W "${commandList}" -- "\${current}") )`,
@@ -43859,14 +44041,14 @@ function zshScript(specs) {
43859
44041
  " local command=\"\"",
43860
44042
  " local index",
43861
44043
  " for (( index = 2; index < CURRENT; index++ )); do",
43862
- " case \"${words[index]}\" in",
44044
+ ` case "\${words[index]}" in`,
43863
44045
  " -*) continue ;;",
43864
44046
  " esac",
43865
- " command=\"${words[index]}\"",
44047
+ ` command="\${words[index]}"`,
43866
44048
  " break",
43867
44049
  " done",
43868
44050
  "",
43869
- " case \"${command}\" in",
44051
+ ` case "\${command}" in`,
43870
44052
  specs.map((spec) => {
43871
44053
  const subcommands = spec.subcommands.map((one) => ` '${one}:${spec.summary.replace(/'/g, "")}'`).join("\n");
43872
44054
  const flags = [...spec.flags, ...GLOBAL_FLAGS].map(zshFlagEntry).join("\n");
@@ -43891,10 +44073,10 @@ function zshScript(specs) {
43891
44073
  " ;;",
43892
44074
  " esac",
43893
44075
  "",
43894
- " if (( ${#entries} > 0 )); then",
44076
+ ` if (( \${#entries} > 0 )); then`,
43895
44077
  " _describe -t commands \"hostingctl\" entries",
43896
44078
  " fi",
43897
- " _arguments -s -S ${flags[@]}",
44079
+ ` _arguments -s -S \${flags[@]}`,
43898
44080
  "}",
43899
44081
  "compdef _hostingctl hostingctl",
43900
44082
  ""
@@ -44452,7 +44634,7 @@ async function dnsTemplates(context, rest) {
44452
44634
  templates: (await dnsTemplatesIndex({ path: { company: await requireCompany(context.flags) } })).data.templates
44453
44635
  };
44454
44636
  }
44455
- if (action === "show") return await show$4(context, oneUuid$7(tail, USAGE$33));
44637
+ if (action === "show") return await show$5(context, oneUuid$7(tail, USAGE$33));
44456
44638
  if (action === "save") return await save$1(context, tail[0]);
44457
44639
  if (action === "delete") return await destroy$1(context, oneUuid$7(tail, USAGE$33));
44458
44640
  if (action === "from-zone") return await fromZone(context, oneUuid$7(tail, USAGE$33));
@@ -44470,7 +44652,7 @@ function templateAndZone(rest) {
44470
44652
  };
44471
44653
  }
44472
44654
  /** `show <uuid>`. */
44473
- async function show$4(context, templateUuid) {
44655
+ async function show$5(context, templateUuid) {
44474
44656
  return {
44475
44657
  kind: "template",
44476
44658
  template: (await dnsTemplatesShow({ path: {
@@ -45601,7 +45783,7 @@ var QUOTAS = /* @__PURE__ */ new Set([
45601
45783
  var STATUSES = /* @__PURE__ */ new Set(["enabled", "suspended"]);
45602
45784
  /** `email mailbox add|change|remove|forward|preferences|preferences-set|credential|reset-credential`. */
45603
45785
  async function emailMailboxAdmin(context, action, tail) {
45604
- if (action === "add") return await add$6(context, tail);
45786
+ if (action === "add") return await add$7(context, tail);
45605
45787
  const [emailDomainUuid, mailboxUuid, ...extra] = tail;
45606
45788
  if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$27);
45607
45789
  const path = {
@@ -45635,7 +45817,7 @@ function destinations(context) {
45635
45817
  return (context.flags.get("--destinations") ?? "").split(",").map((one) => one.trim().toLowerCase()).filter((one) => one !== "");
45636
45818
  }
45637
45819
  /** `add <domain> --local … --quota …`. */
45638
- async function add$6(context, tail) {
45820
+ async function add$7(context, tail) {
45639
45821
  const [emailDomainUuid, ...extra] = tail;
45640
45822
  if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$27);
45641
45823
  const company = await requireCompany(context.flags);
@@ -45996,7 +46178,7 @@ var ENCRYPTIONS = /* @__PURE__ */ new Set(["tls", "starttls"]);
45996
46178
  /** `email sync …`, dispatched from the `email` command. */
45997
46179
  async function emailSync(context, rest) {
45998
46180
  const [action, ...tail] = rest;
45999
- if (action === "show") return await show$3(context, tail);
46181
+ if (action === "show") return await show$4(context, tail);
46000
46182
  if (action === "server") return await server(context, tail);
46001
46183
  if (action === "account") return await account(context, tail);
46002
46184
  if (action === "csv") return await csv(context, tail);
@@ -46009,7 +46191,7 @@ function one(rest) {
46009
46191
  return uuid;
46010
46192
  }
46011
46193
  /** `show`: the server and every account. */
46012
- async function show$3(context, tail) {
46194
+ async function show$4(context, tail) {
46013
46195
  return {
46014
46196
  kind: "overview",
46015
46197
  overview: (await emailMailboxSyncIndex({ path: await domainPath(context, one(tail)) })).data
@@ -46514,7 +46696,7 @@ function dispatched$1(context, subcommand, rest) {
46514
46696
  /** The reads this command owns itself, all company-scoped. */
46515
46697
  async function companyRead(context, subcommand, rest) {
46516
46698
  const company = await requireCompany(context.flags);
46517
- if (subcommand === "show") return await show$2(company, rest);
46699
+ if (subcommand === "show") return await show$3(company, rest);
46518
46700
  if (subcommand === "names") return await names(company, rest);
46519
46701
  if (subcommand === "mailboxes") return await mailboxes(company, rest);
46520
46702
  if (subcommand === "mailbox") return await mailbox(company, rest);
@@ -46621,7 +46803,7 @@ var email$2 = {
46621
46803
  }
46622
46804
  };
46623
46805
  /** `show [--company]`: the service state, its entitlement and whether enrollment is available. */
46624
- async function show$2(company, rest) {
46806
+ async function show$3(company, rest) {
46625
46807
  noExtra$10(rest);
46626
46808
  return (await emailShow({ path: { company } })).data;
46627
46809
  }
@@ -47202,7 +47384,7 @@ function isGrant(value) {
47202
47384
  * previously reviewed. The API refuses them if the inventory or generation changed meanwhile.
47203
47385
  */
47204
47386
  async function databaseRetirement(context, company, action, rest) {
47205
- return action === "review" ? await review$1(company, rest) : await retire$1(context, company, rest);
47387
+ return action === "review" ? await review$1(company, rest) : await retire$2(context, company, rest);
47206
47388
  }
47207
47389
  /**
47208
47390
  * `database review …`: what retiring this identity would do, against the exact inventory digest a
@@ -47223,7 +47405,7 @@ async function review$1(company, rest) {
47223
47405
  * backup track, the database name, the SQL user name and the credential version are retained, and existing
47224
47406
  * SQL sessions are NOT terminated.
47225
47407
  */
47226
- async function retire$1(context, company, rest) {
47408
+ async function retire$2(context, company, rest) {
47227
47409
  const path = retirementPath(company, rest);
47228
47410
  return await confirmableWrite(context, describeRetire(path.environmentUuid, path.databaseUuid), async () => (await hostingDatabaseRetirementStore({
47229
47411
  path,
@@ -47296,7 +47478,7 @@ async function database(context, rest) {
47296
47478
  const [action, ...tail] = rest;
47297
47479
  const company = await requireCompany(context.flags);
47298
47480
  if (action === "create") return await create$1(context, company, tail);
47299
- if (action === "bind") return await bind(context, company, tail);
47481
+ if (action === "bind") return await bind$1(context, company, tail);
47300
47482
  if (action === "review" || action === "retire") return await databaseRetirement(context, company, action, tail);
47301
47483
  throw new UsageError(DATABASES_USAGE);
47302
47484
  }
@@ -47327,7 +47509,7 @@ async function create$1(context, company, rest) {
47327
47509
  })).data);
47328
47510
  }
47329
47511
  /** `database bind <uuid> <database-uuid> (--bind … | --clear-bindings)`: replace the consumer list. */
47330
- async function bind(context, company, rest) {
47512
+ async function bind$1(context, company, rest) {
47331
47513
  const [environmentUuid, databaseUuid, ...extra] = rest;
47332
47514
  if (environmentUuid === void 0 || databaseUuid === void 0 || extra.length > 0) throw new UsageError(DATABASES_USAGE);
47333
47515
  const grants = bindFlag(context);
@@ -47456,7 +47638,7 @@ async function environmentDomains(context, subcommand, rest) {
47456
47638
  const path = await environmentPath(context, environmentUuid, USAGE$19);
47457
47639
  if (subcommand === "domains") return await domains(path, tail);
47458
47640
  if (subcommand === "redirects") return await redirects(path, tail);
47459
- if (subcommand === "domain-add") return await add$5(context, path, tail);
47641
+ if (subcommand === "domain-add") return await add$6(context, path, tail);
47460
47642
  if (subcommand === "redirect-set") return await setRedirect(context, path, tail);
47461
47643
  if (subcommand === "redirect-remove") return await removeRedirect(context, path, tail);
47462
47644
  if (subcommand === "domain-remove") return await removeDomain(context, path, tail);
@@ -47481,7 +47663,7 @@ async function redirects(path, rest) {
47481
47663
  };
47482
47664
  }
47483
47665
  /** `domain-add --hostname … --workload … [--intended …]`. */
47484
- async function add$5(context, path, rest) {
47666
+ async function add$6(context, path, rest) {
47485
47667
  noExtra$9(rest);
47486
47668
  const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
47487
47669
  const workloadUuid = context.flags.get("--workload")?.trim() ?? "";
@@ -48063,10 +48245,10 @@ async function environmentServices(context, subcommand, rest) {
48063
48245
  typeSlug: type
48064
48246
  } })).data
48065
48247
  };
48066
- if (subcommand === "service-add") return await add$4(context, path, type);
48248
+ if (subcommand === "service-add") return await add$5(context, path, type);
48067
48249
  if (subcommand === "service-runtime") return await runtime$1(context, path, type);
48068
48250
  if (subcommand === "service-protect") return await protect(context, path, type);
48069
- if (subcommand === "service-retire") return await retire(context, path, type);
48251
+ if (subcommand === "service-retire") return await retire$1(context, path, type);
48070
48252
  throw new UsageError(USAGE$16);
48071
48253
  }
48072
48254
  /** `service-add-review <type> [--name …] [--replicas …]`. */
@@ -48088,7 +48270,7 @@ async function reviewAddition(context, path, type) {
48088
48270
  };
48089
48271
  }
48090
48272
  /** `service-add <type> --name … [--replicas …]`. */
48091
- async function add$4(context, path, type) {
48273
+ async function add$5(context, path, type) {
48092
48274
  const name = context.flags.get("--name")?.trim() ?? "";
48093
48275
  if (name === "") throw new UsageError(`service-add needs --name.\n\n${USAGE$16}`);
48094
48276
  const replicas = wholeNumber(context, "--replicas") ?? 1;
@@ -48144,7 +48326,7 @@ async function protect(context, path, type) {
48144
48326
  }));
48145
48327
  }
48146
48328
  /** `service-retire <type> --digest …`: the review's digest is the confirmation. */
48147
- async function retire(context, path, type) {
48329
+ async function retire$1(context, path, type) {
48148
48330
  const digest = context.flags.get("--digest")?.trim() ?? "";
48149
48331
  if (digest === "") throw new UsageError(`service-retire needs --digest.\n\n${USAGE$16}`);
48150
48332
  return await written$1(confirmableWrite(context, [`Request the retirement of the ${type} service.`, " The digest binds this request to the review it was made against."].join("\n"), async () => {
@@ -48429,9 +48611,9 @@ function portablePreviewText(preview) {
48429
48611
  const lines = [
48430
48612
  `Portable preview for ${preview.environmentUuid} format ${preview.formatVersion} generation ${String(preview.desiredGeneration)}`,
48431
48613
  ...sectionLines(preview.sections),
48432
- ` Required secrets: ${list$3(preview.requiredSecrets)}`,
48433
- ` Unset secrets: ${list$3(preview.unsetSecrets)}`,
48434
- ` Blockers: ${list$3(preview.blockers)}`,
48614
+ ` Required secrets: ${list$4(preview.requiredSecrets)}`,
48615
+ ` Unset secrets: ${list$4(preview.unsetSecrets)}`,
48616
+ ` Blockers: ${list$4(preview.blockers)}`,
48435
48617
  ` ${preview.noOp ? "This pattern is already recorded (no-op)." : preview.prepared ? "The draft is prepared." : "Not prepared yet; run `prepare` before `confirm`."}`
48436
48618
  ];
48437
48619
  if (preview.unsetSecrets.length > 0) lines.push(" Set each unset secret through the existing configuration secret control before confirming.");
@@ -48443,8 +48625,8 @@ function portablePreparationText(report) {
48443
48625
  const lines = [
48444
48626
  ` Prepared the draft for ${report.environmentUuid} at generation ${String(report.desiredGeneration)}; no workloads were created.`,
48445
48627
  ...sectionLines(report.sections),
48446
- ` Required secrets: ${list$3(report.requiredSecrets)}`,
48447
- ` Unset secrets: ${list$3(report.unsetSecrets)}`
48628
+ ` Required secrets: ${list$4(report.requiredSecrets)}`,
48629
+ ` Unset secrets: ${list$4(report.unsetSecrets)}`
48448
48630
  ];
48449
48631
  if (report.unsetSecrets.length > 0) lines.push(" Set each unset secret through the existing configuration secret control, then preview and confirm again.");
48450
48632
  return lines.join("\n");
@@ -48486,7 +48668,7 @@ function componentLine(item) {
48486
48668
  const next = item.nextAction === null ? "" : ` next: ${item.nextAction}`;
48487
48669
  return `${item.path} ${item.kind} ${item.logicalRef} ${item.decision}${target}${message}${next}`;
48488
48670
  }
48489
- function list$3(values) {
48671
+ function list$4(values) {
48490
48672
  return values.length === 0 ? "none" : values.join(", ");
48491
48673
  }
48492
48674
  //#endregion
@@ -55230,7 +55412,16 @@ var billingActorDataSchema = object({
55230
55412
  name: string(),
55231
55413
  email: string()
55232
55414
  });
55233
- var billingAmountBasisEnumSchema = _enum(["per_month", "once_off"]).describe("What one rate amount is for. A recurring packaging price is charged per month and prorated by time held; a setup price is charged once for an approved event and is never prorated. Keeping both in one effective-dated price table means there is one place a price lives, not two.\n");
55415
+ var billingAmountBasisEnumSchema = _enum([
55416
+ "per_month",
55417
+ "once_off",
55418
+ "per_month_including_vat"
55419
+ ]).describe("What one rate amount is for, and whether the amount already includes VAT. A recurring packaging price is charged per month and prorated by time held; a setup price is charged once for an approved event and is never prorated. A **VAT-inclusive** recurring price is the third case, and it exists because some prices are agreed as a consumer figure: R3.00 per 10 GB including VAT cannot be expressed as a whole number of net cents that reproduces R30.00 for ten blocks, so the agreed gross figure is what the price book stores and the VAT is separated out of it. That keeps a quote and an invoice equal to the number the client was given, instead of two cents away from it. Keeping all three in one effective-dated price table means there is one place a price lives, not three.\n");
55420
+ var billingAmountsDataSchema = object({
55421
+ netCents: int(),
55422
+ vatCents: int(),
55423
+ grossCents: int()
55424
+ });
55234
55425
  var billingDocumentStateEnumSchema = _enum([
55235
55426
  "preparing",
55236
55427
  "issued",
@@ -55351,7 +55542,12 @@ var billingDeliveryStateEnumSchema = _enum([
55351
55542
  "sent",
55352
55543
  "failed"
55353
55544
  ]).describe("What we know about sending the document. The mail transport can prove submission, not mailbox delivery, so `sent` means \"the transport * accepted it for the billing contact\". A failed or missing contact never un-issues the document.\n");
55354
- var billingProductEnumSchema = _enum(["MHU", "MHS"]).describe("The two tariff lines the accountant's documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n");
55545
+ var billingProductEnumSchema = _enum([
55546
+ "MHU",
55547
+ "MHS",
55548
+ "STO",
55549
+ "TRF"
55550
+ ]).describe("The tariff lines our documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. `STO` is one recurring 10 GB storage block and `TRF` is one recurring chargeable 10 GB transfer block; the product variant (object storage, disk) is the rate's `package_key`, which is the price book's existing scope. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n");
55355
55551
  var billingDiscountCodeRedemptionDataSchema = object({
55356
55552
  state: _enum(["pending", "applied"]).describe("Whether a redeemed code has priced the account yet. A code can be redeemed before the account holds anything to price: a client types it while creating their account, and a brand-new company has no environment, so no purchase period, so nothing a price window could name. `pending` is that state — the promise exists and is spent, and the first environment the client creates prices it. `applied` is a redemption that already wrote the company's price window. The distinction is a fact about the record, not a workflow step a caller advances by hand: only the environment creation path moves a redemption from `pending` to `applied`, in the transaction that opens the period.\n| |\n|---|\n| `pending` <br/> Redeemed, and waiting for the account to hold a package that can be priced. |\n| `applied` <br/> Redeemed, and the company's own price window carries the code's amount. |").describe("Whether a redeemed code has priced the account yet. A code can be redeemed before the account holds anything to price: a client types it while creating their account, and a brand-new company has no environment, so no purchase period, so nothing a price window could name. `pending` is that state — the promise exists and is spent, and the first environment the client creates prices it. `applied` is a redemption that already wrote the company's price window. The distinction is a fact about the record, not a workflow step a caller advances by hand: only the environment creation path moves a redemption from `pending` to `applied`, in the transaction that opens the period.\n| |\n|---|\n| `pending` <br/> Redeemed, and waiting for the account to hold a package that can be priced. |\n| `applied` <br/> Redeemed, and the company's own price window carries the code's amount. |"),
55357
55553
  code: string(),
@@ -55367,7 +55563,7 @@ var billingDiscountCodeDataSchema = object({
55367
55563
  id: int(),
55368
55564
  uuid: string(),
55369
55565
  code: string(),
55370
- product: billingProductEnumSchema.describe("The two tariff lines the accountant's documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
55566
+ product: billingProductEnumSchema.describe("The tariff lines our documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. `STO` is one recurring 10 GB storage block and `TRF` is one recurring chargeable 10 GB transfer block; the product variant (object storage, disk) is the rate's `package_key`, which is the price book's existing scope. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
55371
55567
  packageKey: string().nullable(),
55372
55568
  amountCents: int(),
55373
55569
  currency: string(),
@@ -55444,7 +55640,7 @@ var billingExportProfileTaxMappingDataSchema = object({
55444
55640
  taxCode: string().nullable()
55445
55641
  });
55446
55642
  var billingExportProfileProductMappingDataSchema = object({
55447
- productCode: billingProductEnumSchema.describe("The two tariff lines the accountant's documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
55643
+ productCode: billingProductEnumSchema.describe("The tariff lines our documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. `STO` is one recurring 10 GB storage block and `TRF` is one recurring chargeable 10 GB transfer block; the product variant (object storage, disk) is the rate's `package_key`, which is the price book's existing scope. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
55448
55644
  accountCode: string().nullable(),
55449
55645
  itemName: string().nullable()
55450
55646
  });
@@ -55609,9 +55805,9 @@ object({ items: array(object({
55609
55805
  id: int(),
55610
55806
  uuid: string(),
55611
55807
  companySlug: string().nullable(),
55612
- product: billingProductEnumSchema.describe("The two tariff lines the accountant's documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
55808
+ product: billingProductEnumSchema.describe("The tariff lines our documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. `STO` is one recurring 10 GB storage block and `TRF` is one recurring chargeable 10 GB transfer block; the product variant (object storage, disk) is the rate's `package_key`, which is the price book's existing scope. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
55613
55809
  packageKey: string().nullable(),
55614
- amountBasis: billingAmountBasisEnumSchema.describe("What one rate amount is for. A recurring packaging price is charged per month and prorated by time held; a setup price is charged once for an approved event and is never prorated. Keeping both in one effective-dated price table means there is one place a price lives, not two.\n"),
55810
+ amountBasis: billingAmountBasisEnumSchema.describe("What one rate amount is for, and whether the amount already includes VAT. A recurring packaging price is charged per month and prorated by time held; a setup price is charged once for an approved event and is never prorated. A **VAT-inclusive** recurring price is the third case, and it exists because some prices are agreed as a consumer figure: R3.00 per 10 GB including VAT cannot be expressed as a whole number of net cents that reproduces R30.00 for ten blocks, so the agreed gross figure is what the price book stores and the VAT is separated out of it. That keeps a quote and an invoice equal to the number the client was given, instead of two cents away from it. Keeping all three in one effective-dated price table means there is one place a price lives, not three.\n"),
55615
55811
  amountCents: int(),
55616
55812
  currency: string(),
55617
55813
  effectiveFrom: string(),
@@ -55620,6 +55816,7 @@ object({ items: array(object({
55620
55816
  var billingRunLineDataSchema = object({
55621
55817
  lineNumber: int(),
55622
55818
  productCode: string(),
55819
+ quantity: int(),
55623
55820
  description: string(),
55624
55821
  purchasePeriodUuid: string(),
55625
55822
  environmentUuid: string(),
@@ -55638,6 +55835,7 @@ var billingRunLineDataSchema = object({
55638
55835
  priceSource: billingPriceSourceEnumSchema.describe("Which price a rated line segment resolved to. The source is frozen onto the line so a later price book change cannot rewrite why a past segment was worth what it was. A free-allowance segment has no rate at all.\n| |\n|---|\n| `company_rate` <br/> A company-specific rate window applied. |\n| `default_rate` <br/> The default (company-null) rate window applied. |\n| `free_allowance` <br/> A period held under the free allowance: a stated zero line, never an omission. |"),
55639
55836
  rateUuid: string().nullable(),
55640
55837
  monthlyAmountCents: int().nullable(),
55838
+ amountBasis: union([billingAmountBasisEnumSchema, _null()]),
55641
55839
  vatBasisPoints: int(),
55642
55840
  netCents: int(),
55643
55841
  vatCents: int(),
@@ -59380,6 +59578,94 @@ object({
59380
59578
  fingerprint: string()
59381
59579
  })
59382
59580
  });
59581
+ var hostingStorageBindingDataSchema = object({
59582
+ uuid: string(),
59583
+ environmentUuid: string(),
59584
+ path: string().nullable(),
59585
+ mode: string()
59586
+ });
59587
+ var hostingStorageBindingModeEnumSchema = _enum(["native", "mount"]).describe("How one environment reaches a company's purchased object storage. The two modes are access paths to the *same* bucket, not separate products: a client can use a normal S3 client, mount the bucket at a directory in an application, or do both, and switching between them moves no data and costs nothing extra. `native` records that the client uses the branded S3 endpoint itself, so the platform composes no mount for it.\n");
59588
+ var hostingStorageConnectionDataSchema = object({
59589
+ endpoint: string(),
59590
+ bucket: string(),
59591
+ region: string(),
59592
+ pathStyle: boolean()
59593
+ });
59594
+ var hostingStorageObservationDataSchema = object({
59595
+ observedBytes: int().nullable(),
59596
+ observedObjectCount: int().nullable(),
59597
+ observedAt: string().nullable(),
59598
+ stale: boolean()
59599
+ });
59600
+ object({ items: array(object({
59601
+ uuid: string(),
59602
+ name: string(),
59603
+ bucket: string(),
59604
+ capacityBytes: int(),
59605
+ includedDownloadBytes: int(),
59606
+ status: string(),
59607
+ statusMessage: string(),
59608
+ hardQuotaEnforced: boolean(),
59609
+ connection: hostingStorageConnectionDataSchema,
59610
+ accessKeyHint: string().nullable(),
59611
+ usage: hostingStorageObservationDataSchema,
59612
+ bindings: array(hostingStorageBindingDataSchema),
59613
+ createdAt: string(),
59614
+ retiredAt: string().nullable()
59615
+ })) });
59616
+ object({ items: array(object({
59617
+ uuid: string(),
59618
+ accessKeyHint: string(),
59619
+ state: string(),
59620
+ createdAt: string(),
59621
+ activatedAt: string().nullable(),
59622
+ revokedAt: string().nullable()
59623
+ })) });
59624
+ object({
59625
+ uuid: string(),
59626
+ accessKeyId: string(),
59627
+ secretAccessKey: string(),
59628
+ accessKeyHint: string(),
59629
+ state: string(),
59630
+ createdAt: string()
59631
+ });
59632
+ var hostingStorageObjectDataSchema = object({
59633
+ key: string(),
59634
+ size: int(),
59635
+ lastModified: string().nullable(),
59636
+ etag: string().nullable()
59637
+ });
59638
+ object({
59639
+ url: string(),
59640
+ method: string(),
59641
+ expiresAt: string(),
59642
+ key: string()
59643
+ });
59644
+ object({
59645
+ objects: array(hostingStorageObjectDataSchema),
59646
+ nextToken: string().nullable(),
59647
+ truncated: boolean()
59648
+ });
59649
+ object({
59650
+ bucketUuid: string().nullable(),
59651
+ bucketName: string().nullable(),
59652
+ productKey: string(),
59653
+ currency: string(),
59654
+ blockBytes: int().describe("Decimal bytes in one sold block: 10,000,000,000."),
59655
+ currentBlocks: int(),
59656
+ targetBlocks: int(),
59657
+ addedBlocks: int(),
59658
+ storageUnit: billingAmountsDataSchema.describe("One block, for one month."),
59659
+ addedMonthly: billingAmountsDataSchema.describe("The increase, for one full month."),
59660
+ targetMonthly: billingAmountsDataSchema.describe("Everything the bucket will hold once this lands, for one full month."),
59661
+ proratedCharge: billingAmountsDataSchema.describe("The increase for the remainder of the current billing month."),
59662
+ proratedHeldSeconds: int(),
59663
+ proratedMonthSeconds: int(),
59664
+ transferUnit: billingAmountsDataSchema.describe("One block of chargeable download above the included allowance."),
59665
+ includedDownloadBytes: int().describe("Included external downloads for one full month, in bytes."),
59666
+ vatBasisPoints: int(),
59667
+ generatedAt: string()
59668
+ });
59383
59669
  object({
59384
59670
  rows: array(object({
59385
59671
  claim: string(),
@@ -60165,7 +60451,7 @@ var stateManagerIntentRequestSchema = object({
60165
60451
  }).describe("The manager's intent-resolution request.\n\nThe run reference is the exact manager tuple the callback must bind and echo.\nThe intent reference is the Laravel-owned record it must resolve. Neither a\ncompany, an actor nor a credential is accepted: the handler resolves those\nserver-side and a caller-supplied identity grants no authority.\n\nThe callback is a Laravel/HTTP boundary, so its own fields are camelCase like\nthe rest of the API. The complete unfiltered payload is checked against the one\nshared callback schema, so a superseded snake_case, mixed or unknown-field body\nis refused rather than silently coerced by Laravel's field filtering.");
60166
60452
  var storeBillingDiscountCodeRequestSchema = object({
60167
60453
  company: string().max(64).nullish(),
60168
- product: billingProductEnumSchema.optional().describe("The two tariff lines the accountant's documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
60454
+ product: billingProductEnumSchema.optional().describe("The tariff lines our documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. `STO` is one recurring 10 GB storage block and `TRF` is one recurring chargeable 10 GB transfer block; the product variant (object storage, disk) is the rate's `package_key`, which is the price book's existing scope. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
60169
60455
  packageKey: string().max(64).nullish(),
60170
60456
  amountCents: int().min(0).max(1e8),
60171
60457
  maxRedemptions: int().min(1).max(1e4).optional(),
@@ -60188,7 +60474,7 @@ var storeBillingExportProfileRequestSchema = object({
60188
60474
  taxCode: string().max(32).nullish()
60189
60475
  })).refine((items) => new Set(items).size === items.length, { message: "Array entries must be unique" }).optional(),
60190
60476
  productMappings: array(object({
60191
- productCode: billingProductEnumSchema.describe("The two tariff lines the accountant's documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
60477
+ productCode: billingProductEnumSchema.describe("The tariff lines our documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. `STO` is one recurring 10 GB storage block and `TRF` is one recurring chargeable 10 GB transfer block; the product variant (object storage, disk) is the rate's `package_key`, which is the price book's existing scope. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
60192
60478
  accountCode: string().max(32).nullish(),
60193
60479
  itemName: string().max(64).nullish()
60194
60480
  })).refine((items) => new Set(items).size === items.length, { message: "Array entries must be unique" }).optional(),
@@ -60205,7 +60491,7 @@ var storeBillingExportRequestSchema = object({
60205
60491
  }).describe("One accountant's pack over a date range, or the preview of the same range.\n\nThe range is a pair of local calendar dates, matched against the document's own issue date (an\ninvoice's `invoice_date`, a credit note's `credit_date`), which is why they are `Y-m-d` rather than\ninstants: the accountant thinks in issue months, and a service period is never the selector. The\nrange is bounded so one request cannot try to build a pack over years of history.");
60206
60492
  var storeBillingRateRequestSchema = object({
60207
60493
  company: string().max(64).nullish(),
60208
- product: billingProductEnumSchema.describe("The two tariff lines the accountant's documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
60494
+ product: billingProductEnumSchema.describe("The tariff lines our documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. `STO` is one recurring 10 GB storage block and `TRF` is one recurring chargeable 10 GB transfer block; the product variant (object storage, disk) is the rate's `package_key`, which is the price book's existing scope. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
60209
60495
  packageKey: string().max(64).nullish(),
60210
60496
  amountCents: int().min(0).max(1e8),
60211
60497
  effectiveFrom: datetime(),
@@ -60330,6 +60616,18 @@ var storeHostingSshSourceRequestSchema = object({
60330
60616
  ref: string().max(255),
60331
60617
  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")
60332
60618
  }).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.");
60619
+ var storeHostingStorageBindingRequestSchema = object({
60620
+ path: string().max(255).optional(),
60621
+ mode: hostingStorageBindingModeEnumSchema.describe("How one environment reaches a company's purchased object storage. The two modes are access paths to the *same* bucket, not separate products: a client can use a normal S3 client, mount the bucket at a directory in an application, or do both, and switching between them moves no data and costs nothing extra. `native` records that the client uses the branded S3 endpoint itself, so the platform composes no mount for it.\n")
60622
+ }).describe("Binding a purchased bucket to one environment, natively or as a managed directory.\n\nThe path is the dangerous part, so its rule is owned by `StorageMountPath` rather than written as\nbranching inside this declaration; a path that is not absolute, contains a traversal segment, is the\nfilesystem root or lands on a reserved system/managed location is refused before any write. Only the\nmount path is a directory inside the application tree, so it is validated here rather than by a\nbranching rule inside the controller.");
60623
+ var storeHostingStorageBucketRequestSchema = object({
60624
+ name: string().min(1).max(64).regex(/^[\pL\pN][\pL\pN ._-]*$/).describe("The client's own label, so they can tell two purchases apart. Anything printable and short."),
60625
+ capacityGb: int().min(10).max(1e5)
60626
+ }).describe("One storage purchase.\n\nStorage is sold in whole 10 GB blocks, so the request states decimal gigabytes and the platform converts\nonce, into the bytes the row stores. A quantity that is not a whole block is refused here rather than\nrounded into an entitlement the quote did not show.");
60627
+ var storeHostingStorageObjectGrantRequestSchema = object({
60628
+ key: string().max(1024).regex(/^[^\x00-\x1F\x7F]+$/),
60629
+ direction: _enum(["download", "upload"])
60630
+ }).describe("Asking for one short-lived signed URL for one object.\n\nThe direction decides the verb: a download signs a GET and an upload signs a PUT, so a browser or the CLI\ncan move the bytes itself. The key is the client's own path inside their bucket and is validated as a key,\nnot as a filesystem path — control characters are refused because they would break signing and logging.");
60333
60631
  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.");
60334
60632
  var storePlatformCompanyRequestSchema = object({
60335
60633
  name: string().max(255),
@@ -60386,7 +60684,7 @@ var updateBillingExportProfileRequestSchema = object({
60386
60684
  taxCode: string().max(32).nullish()
60387
60685
  })).refine((items) => new Set(items).size === items.length, { message: "Array entries must be unique" }).optional(),
60388
60686
  productMappings: array(object({
60389
- productCode: billingProductEnumSchema.describe("The two tariff lines the accountant's documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
60687
+ productCode: billingProductEnumSchema.describe("The tariff lines our documents define. `MHU` is the recurring managed hosting unit; `MHS` is the one-off managed hosting setup. `STO` is one recurring 10 GB storage block and `TRF` is one recurring chargeable 10 GB transfer block; the product variant (object storage, disk) is the rate's `package_key`, which is the price book's existing scope. They are our product codes, not package keys: a package says what an environment holds, a product says what it is billed as.\n"),
60390
60688
  accountCode: string().max(32).nullish(),
60391
60689
  itemName: string().max(64).nullish()
60392
60690
  })).refine((items) => new Set(items).size === items.length, { message: "Array entries must be unique" }).optional(),
@@ -60573,6 +60871,7 @@ var updateHostingSshSourceRequestSchema = object({
60573
60871
  ref: string().max(255).nullish(),
60574
60872
  refKind: union([hostingSourceRefKindEnumSchema, _null()]).optional()
60575
60873
  }).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.");
60874
+ var updateHostingStorageCapacityRequestSchema = object({ capacityGb: int().min(10).max(1e5) }).describe("Adding capacity to an existing purchase.\n\nOnly an increase is accepted: a client buys more space, and a decrease would have to remove objects or\ninvent a partial refund, neither of which this product offers. The controller refuses a smaller value\nwith a useful reason rather than silently accepting it.");
60576
60875
  var updateHostingToolSelectionRequestSchema = object({
60577
60876
  enabled: boolean(),
60578
60877
  desiredGeneration: int().min(1)
@@ -62756,6 +63055,67 @@ union([
62756
63055
  object({ message: string().describe("Error overview.") }),
62757
63056
  messageDataSchema
62758
63057
  ]);
63058
+ union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
63059
+ union([
63060
+ object({ message: string().describe("Error overview.") }),
63061
+ object({ message: string().describe("Error overview.") }),
63062
+ messageDataSchema
63063
+ ]);
63064
+ storeHostingStorageBucketRequestSchema.describe("One storage purchase.\n\nStorage is sold in whole 10 GB blocks, so the request states decimal gigabytes and the platform converts\nonce, into the bytes the row stores. A quantity that is not a whole block is refused here rather than\nrounded into an entitlement the quote did not show.");
63065
+ union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
63066
+ union([
63067
+ object({ message: string().describe("Error overview.") }),
63068
+ object({ message: string().describe("Error overview.") }),
63069
+ messageDataSchema
63070
+ ]);
63071
+ updateHostingStorageCapacityRequestSchema.describe("Adding capacity to an existing purchase.\n\nOnly an increase is accepted: a client buys more space, and a decrease would have to remove objects or\ninvent a partial refund, neither of which this product offers. The controller refuses a smaller value\nwith a useful reason rather than silently accepting it.");
63072
+ union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
63073
+ union([
63074
+ object({ message: string().describe("Error overview.") }),
63075
+ object({ message: string().describe("Error overview.") }),
63076
+ messageDataSchema
63077
+ ]);
63078
+ storeHostingStorageBindingRequestSchema.describe("Binding a purchased bucket to one environment, natively or as a managed directory.\n\nThe path is the dangerous part, so its rule is owned by `StorageMountPath` rather than written as\nbranching inside this declaration; a path that is not absolute, contains a traversal segment, is the\nfilesystem root or lands on a reserved system/managed location is refused before any write. Only the\nmount path is a directory inside the application tree, so it is validated here rather than by a\nbranching rule inside the controller.");
63079
+ union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
63080
+ union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
63081
+ union([
63082
+ object({ message: string().describe("Error overview.") }),
63083
+ object({ message: string().describe("Error overview.") }),
63084
+ messageDataSchema
63085
+ ]);
63086
+ union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
63087
+ string().optional().describe("Only list keys beginning with this prefix.");
63088
+ string().optional().describe("The nextToken from a previous page.");
63089
+ int().optional().describe("Keys to return in this page (bounded by the platform maximum).");
63090
+ union([
63091
+ object({ message: string().describe("Error overview.") }),
63092
+ object({ message: string().describe("Error overview.") }),
63093
+ messageDataSchema
63094
+ ]);
63095
+ string().optional().describe("The exact object key to delete.");
63096
+ union([
63097
+ object({ message: string().describe("Error overview.") }),
63098
+ object({ message: string().describe("Error overview.") }),
63099
+ object({ message: string().describe("Error overview.").meta({ examples: ["Name the object key to delete."] }) })
63100
+ ]);
63101
+ union([
63102
+ object({ message: string().describe("Error overview.") }),
63103
+ object({ message: string().describe("Error overview.") }),
63104
+ object({
63105
+ message: string().describe("Errors overview."),
63106
+ errors: record$1(string(), array(string())).describe("A detailed description of each field that failed validation.")
63107
+ })
63108
+ ]);
63109
+ storeHostingStorageObjectGrantRequestSchema.describe("Asking for one short-lived signed URL for one object.\n\nThe direction decides the verb: a download signs a GET and an upload signs a PUT, so a browser or the CLI\ncan move the bytes itself. The key is the client's own path inside their bucket and is validated as a key,\nnot as a filesystem path — control characters are refused because they would break signing and logging.");
63110
+ int().min(10).max(1e5);
63111
+ uuid().nullish();
63112
+ union([
63113
+ object({ message: string().describe("Error overview.") }),
63114
+ object({ message: string().describe("Error overview.") }),
63115
+ messageDataSchema,
63116
+ messageDataSchema,
63117
+ messageDataSchema
63118
+ ]);
62759
63119
  union([
62760
63120
  object({ message: string().describe("Error overview.") }),
62761
63121
  object({ message: string().describe("Error overview.") }),
@@ -63873,8 +64233,8 @@ var keys = {
63873
64233
  subcommands: ["add", "remove"],
63874
64234
  async run(context) {
63875
64235
  const [subcommand, ...rest] = context.positional;
63876
- if (subcommand === void 0) return await list$2();
63877
- if (subcommand === "add") return await add$3(context, rest);
64236
+ if (subcommand === void 0) return await list$3();
64237
+ if (subcommand === "add") return await add$4(context, rest);
63878
64238
  if (subcommand === "remove") return await remove(context, rest);
63879
64239
  throw new UsageError(KEYS_USAGE);
63880
64240
  },
@@ -63888,7 +64248,7 @@ var keys = {
63888
64248
  }
63889
64249
  };
63890
64250
  /** The list, across every reported page. */
63891
- async function list$2() {
64251
+ async function list$3() {
63892
64252
  return await allPages(async (page, perPage) => {
63893
64253
  const answer = await hostingPersonalKeyIndex({ query: {
63894
64254
  page,
@@ -63901,7 +64261,7 @@ async function list$2() {
63901
64261
  }, "personal SSH keys");
63902
64262
  }
63903
64263
  /** `add --name … --public-key-file … --current-password-* …`. */
63904
- async function add$3(context, rest) {
64264
+ async function add$4(context, rest) {
63905
64265
  if (rest.length > 0) throw new UsageError(KEYS_USAGE);
63906
64266
  const name = context.flags.get("--name")?.trim() ?? "";
63907
64267
  const file = context.flags.get("--public-key-file") ?? "";
@@ -64415,7 +64775,7 @@ async function platformAlerts(context, group, args) {
64415
64775
  app: (await platformGithubAppStatus()).data
64416
64776
  };
64417
64777
  }
64418
- if (group === "alert-add") return await add$2(context, args);
64778
+ if (group === "alert-add") return await add$3(context, args);
64419
64779
  if (group === "alert-test") return await test(context, args);
64420
64780
  if (group === "alert-settings") return await settings(context, args);
64421
64781
  if (group === "alert") return await alert(context, args);
@@ -64430,7 +64790,7 @@ async function platformAlerts(context, group, args) {
64430
64790
  throw new UsageError(USAGE$8);
64431
64791
  }
64432
64792
  /** `alert-add --email …`. */
64433
- async function add$2(context, args) {
64793
+ async function add$3(context, args) {
64434
64794
  noExtra$4(args);
64435
64795
  const email = context.flags.get("--email")?.trim().toLowerCase() ?? "";
64436
64796
  if (email === "") throw new UsageError(`alert-add needs --email.\n\n${USAGE$8}`);
@@ -65322,7 +65682,7 @@ async function platformSeedPlacements(context, action, seedUuid, rest) {
65322
65682
  if (versionUuid === void 0) throw new UsageError(USAGE$4);
65323
65683
  if (action === "placement-add") {
65324
65684
  if (third !== void 0 || extra.length > 0) throw new UsageError(USAGE$4);
65325
- return await add$1(context, seedUuid, versionUuid);
65685
+ return await add$2(context, seedUuid, versionUuid);
65326
65686
  }
65327
65687
  if (third === void 0 || extra.length > 0) throw new UsageError(USAGE$4);
65328
65688
  const path = {
@@ -65339,7 +65699,7 @@ async function platformSeedPlacements(context, action, seedUuid, rest) {
65339
65699
  throw new UsageError(USAGE$4);
65340
65700
  }
65341
65701
  /** `placement-add`: ask for the version to be prepared on one cluster. */
65342
- async function add$1(context, seedUuid, versionUuid) {
65702
+ async function add$2(context, seedUuid, versionUuid) {
65343
65703
  const body = {
65344
65704
  clusterUuid: requiredFlag$3(context, "--cluster", USAGE$4),
65345
65705
  preparationMode: preparationModeOf$1(context, "placement-add"),
@@ -66283,7 +66643,7 @@ var realm = {
66283
66643
  const [subcommand, ...rest] = context.positional;
66284
66644
  const [environmentUuid, second, ...extra] = rest;
66285
66645
  if (subcommand === void 0 || environmentUuid === void 0 || extra.length > 0) throw new UsageError(REALM_USAGE);
66286
- if (subcommand === "show" && second === void 0) return await show$1(context, environmentUuid);
66646
+ if (subcommand === "show" && second === void 0) return await show$2(context, environmentUuid);
66287
66647
  if (subcommand === "adopt" && second === void 0) return await adopt(context, environmentUuid);
66288
66648
  if (subcommand === "record" && second === void 0) return await record(context, environmentUuid);
66289
66649
  if (subcommand === "retry" && second === void 0) return await retry(context, environmentUuid);
@@ -66293,7 +66653,7 @@ var realm = {
66293
66653
  human: realmText
66294
66654
  };
66295
66655
  /** `realm show <uuid>`: the deployment identity the access view already exposes, addressed by company. */
66296
- async function show$1(context, environmentUuid) {
66656
+ async function show$2(context, environmentUuid) {
66297
66657
  return (await hostingAccessShow({ path: {
66298
66658
  company: await requireCompany(context.flags),
66299
66659
  environmentUuid
@@ -66571,13 +66931,13 @@ async function registrarContacts(context, rest) {
66571
66931
  contacts: items
66572
66932
  };
66573
66933
  }
66574
- if (action === "show") return await show(context, oneUuid$7(tail, USAGE$1));
66934
+ if (action === "show") return await show$1(context, oneUuid$7(tail, USAGE$1));
66575
66935
  if (action === "save") return await save(context, tail[0]);
66576
66936
  if (action === "delete") return await destroy(context, oneUuid$7(tail, USAGE$1));
66577
66937
  throw new UsageError(USAGE$1);
66578
66938
  }
66579
66939
  /** `show <uuid>`. */
66580
- async function show(context, contactUuid) {
66940
+ async function show$1(context, contactUuid) {
66581
66941
  return {
66582
66942
  kind: "contact",
66583
66943
  contact: (await registrarContactsShow({ path: {
@@ -67314,7 +67674,7 @@ var repository = {
67314
67674
  const [subcommand, ...rest] = context.positional;
67315
67675
  if (subcommand === void 0) throw new UsageError(REPOSITORY_USAGE);
67316
67676
  const company = await requireCompany(context.flags);
67317
- if (subcommand === "list") return await list$1(company, rest);
67677
+ if (subcommand === "list") return await list$2(company, rest);
67318
67678
  if (subcommand === "connect") return await connect(company, rest);
67319
67679
  if (subcommand === "complete") return await complete(context, company, rest);
67320
67680
  const [connectionUuid, ...tail] = rest;
@@ -67334,7 +67694,7 @@ var repository = {
67334
67694
  }
67335
67695
  };
67336
67696
  /** `list`. */
67337
- async function list$1(company, rest) {
67697
+ async function list$2(company, rest) {
67338
67698
  noExtra(rest);
67339
67699
  return {
67340
67700
  kind: "connections",
@@ -67532,7 +67892,7 @@ function writeSummary(result) {
67532
67892
  //#region src/commands/secret-connection-write.ts
67533
67893
  /** Every write, each describing what it will do before it sends anything. */
67534
67894
  async function write(context, subcommand, path, connectionPath, reference) {
67535
- if (subcommand === "add") return await add(context, path);
67895
+ if (subcommand === "add") return await add$1(context, path);
67536
67896
  if (subcommand === "link") return await link(context, connectionPath);
67537
67897
  if (subcommand === "unlink") {
67538
67898
  if (reference === void 0) throw new UsageError(SECRET_CONNECTION_USAGE);
@@ -67542,7 +67902,7 @@ async function write(context, subcommand, path, connectionPath, reference) {
67542
67902
  } })).data);
67543
67903
  }
67544
67904
  if (subcommand === "sync") return await confirmableWrite(context, "Refresh every mapping now.", async () => (await hostingExternalSecretSync({ path: connectionPath })).data);
67545
- if (subcommand === "rotate") return await rotate(context, connectionPath);
67905
+ if (subcommand === "rotate") return await rotate$1(context, connectionPath);
67546
67906
  if (subcommand === "revoke") return await confirmableWrite(context, "Stop serving new values. Values already loaded are retained.", async () => (await hostingExternalSecretRevoke({ path: connectionPath })).data);
67547
67907
  if (subcommand === "remove") return await confirmableWrite(context, "Delete this connection, its mappings and our copy of its identity.", async () => {
67548
67908
  await hostingExternalSecretDestroy({ path: connectionPath });
@@ -67551,7 +67911,7 @@ async function write(context, subcommand, path, connectionPath, reference) {
67551
67911
  throw new UsageError(SECRET_CONNECTION_USAGE);
67552
67912
  }
67553
67913
  /** `add`: connect a secret manager, with the identity read from a private file or stdin. */
67554
- async function add(context, path) {
67914
+ async function add$1(context, path) {
67555
67915
  const provider = context.flags.get("--provider") ?? "";
67556
67916
  const endpoint = context.flags.get("--endpoint") ?? "";
67557
67917
  const projectId = context.flags.get("--project-id") ?? "";
@@ -67597,7 +67957,7 @@ async function link(context, path) {
67597
67957
  })).data);
67598
67958
  }
67599
67959
  /** `rotate`: replace the machine identity, keeping the connection and its mappings. */
67600
- async function rotate(context, path) {
67960
+ async function rotate$1(context, path) {
67601
67961
  const clientId = context.flags.get("--client-id") ?? "";
67602
67962
  if (clientId === "") throw new UsageError(`rotate needs --client-id.\n\n${SECRET_CONNECTION_USAGE}`);
67603
67963
  const clientSecret = readSecret(context, "client-secret", 8192, SECRET_CONNECTION_USAGE);
@@ -67932,6 +68292,502 @@ function userText(user) {
67932
68292
  ].join("\n");
67933
68293
  }
67934
68294
  //#endregion
68295
+ //#region src/commands/storage-metadata.ts
68296
+ /**
68297
+ * `storage` — a company's purchased object storage, from the purchase to one object's key.
68298
+ *
68299
+ * The usage text lives here so the command module and the record the help, the completion and the committed
68300
+ * reference page read hold one copy of it between them.
68301
+ */
68302
+ var STORAGE_USAGE = [
68303
+ "Usage: hostingctl storage list --company <slug>",
68304
+ " hostingctl storage show <bucket-uuid> --company <slug>",
68305
+ " hostingctl storage add --company <slug> --name <name> --size <gb>",
68306
+ " hostingctl storage grow <bucket-uuid> --company <slug> --size <gb>",
68307
+ " hostingctl storage rotate <bucket-uuid> --company <slug>",
68308
+ " hostingctl storage retire <bucket-uuid> --company <slug>",
68309
+ " hostingctl storage objects <bucket-uuid> --company <slug> [--prefix <key-prefix>]",
68310
+ " [--limit <n>] [--continuation-token <token>]",
68311
+ " hostingctl storage download-url <bucket-uuid> --company <slug> --key <key>",
68312
+ " hostingctl storage upload-url <bucket-uuid> --company <slug> --key <key>",
68313
+ " hostingctl storage bind <bucket-uuid> --company <slug> --environment <uuid>",
68314
+ " (--path <directory>|--native)",
68315
+ " hostingctl storage unbind <bucket-uuid> --company <slug> --environment <uuid>",
68316
+ "",
68317
+ " list Every bucket the company bought, its capacity, its usage and its bindings.",
68318
+ " show One bucket: the endpoint, bucket name and region to configure, and what it holds.",
68319
+ " add Buy storage. Capacity is sold in whole 10 GB blocks, from 10 to 100000 GB.",
68320
+ " grow Buy more capacity for a bucket. Capacity is never reduced here.",
68321
+ " rotate Issue a new access key; the secret is printed once and never again.",
68322
+ " retire Stop the bucket's access at the gateway. Every object is kept.",
68323
+ " objects One page of keys and sizes; --prefix narrows it to a key prefix.",
68324
+ " download-url One short-lived signed URL that reads one key.",
68325
+ " upload-url One short-lived signed URL that writes one key.",
68326
+ " bind Reach the bucket from an environment, natively or at a directory.",
68327
+ " unbind Stop an environment reaching the bucket. The objects are unchanged.",
68328
+ "",
68329
+ "The bucket endpoint, name and region are what an S3 client is configured with; keys are issued by",
68330
+ "`storage rotate` and the secret is shown in that one answer. Every write needs --confirm; --dry-run",
68331
+ "describes the change without sending it."
68332
+ ].join("\n");
68333
+ var STORAGE_METADATA = {
68334
+ name: "storage",
68335
+ summary: "A company's purchased object storage: the purchase, its keys, its objects and its bindings.",
68336
+ usage: STORAGE_USAGE,
68337
+ flags: [
68338
+ {
68339
+ name: "--name",
68340
+ takesValue: true,
68341
+ description: "The client's own label for the purchase, so two buckets can be told apart."
68342
+ },
68343
+ {
68344
+ name: "--size",
68345
+ takesValue: true,
68346
+ description: "Capacity bought, in whole GB of at least 10 and in 10 GB blocks."
68347
+ },
68348
+ {
68349
+ name: "--prefix",
68350
+ takesValue: true,
68351
+ description: "List only the keys that begin with this prefix."
68352
+ },
68353
+ {
68354
+ name: "--limit",
68355
+ takesValue: true,
68356
+ description: "How many keys one page of the listing holds."
68357
+ },
68358
+ {
68359
+ name: "--continuation-token",
68360
+ takesValue: true,
68361
+ description: "The nextToken the previous page ended with, to continue the listing."
68362
+ },
68363
+ {
68364
+ name: "--key",
68365
+ takesValue: true,
68366
+ description: "The object's key inside the bucket, as a key rather than a filesystem path."
68367
+ },
68368
+ {
68369
+ name: "--environment",
68370
+ takesValue: true,
68371
+ description: "The environment that reaches the bucket."
68372
+ },
68373
+ {
68374
+ name: "--path",
68375
+ takesValue: true,
68376
+ description: "The directory the environment mounts the bucket at; it has to be absolute."
68377
+ },
68378
+ {
68379
+ name: "--native",
68380
+ takesValue: false,
68381
+ description: "Record that the environment uses the S3 endpoint itself, so no mount is composed."
68382
+ }
68383
+ ],
68384
+ subcommands: [
68385
+ "list",
68386
+ "show",
68387
+ "add",
68388
+ "grow",
68389
+ "rotate",
68390
+ "retire",
68391
+ "objects",
68392
+ "download-url",
68393
+ "upload-url",
68394
+ "bind",
68395
+ "unbind"
68396
+ ]
68397
+ };
68398
+ //#endregion
68399
+ //#region src/commands/storage-arguments.ts
68400
+ /**
68401
+ * What each `storage` subcommand is asked for, read from the arguments the runner parsed.
68402
+ *
68403
+ * These live apart from the requests themselves so the requests read as the calls they make: one owner for
68404
+ * the bucket a subcommand names, one for each flag a write needs, and one for the binding the two reaches
68405
+ * turn into. Every refusal here is a usage refusal, because nothing has been read or sent yet.
68406
+ */
68407
+ /** The bucket a bucket-scoped subcommand names: the one token after the subcommand, and nothing else. */
68408
+ async function bucketPath(context, tail) {
68409
+ const [bucketUuid, ...extra] = tail;
68410
+ if (bucketUuid === void 0 || extra.length > 0) throw new UsageError(STORAGE_USAGE);
68411
+ return {
68412
+ company: await requireCompany(context.flags),
68413
+ bucketUuid
68414
+ };
68415
+ }
68416
+ /** A subcommand whose bucket is the company rather than a row takes no positional at all. */
68417
+ function refuseExtra(tail) {
68418
+ if (tail.length > 0) throw new UsageError(STORAGE_USAGE);
68419
+ }
68420
+ /** The purchase's label, which is the client's own name for it. */
68421
+ function requiredName(context) {
68422
+ const name = trimmedFlag(context, "--name");
68423
+ if (name === "") throw new UsageError(`add needs --name.\n\n${STORAGE_USAGE}`);
68424
+ return name;
68425
+ }
68426
+ /** How much capacity is bought, in the GB the API's request names. */
68427
+ function requiredSizeGb(context) {
68428
+ const size = wholeNumberFlag(context.flags, "--size");
68429
+ if (size === null) throw new UsageError(`--size is required, in whole GB.\n\n${STORAGE_USAGE}`);
68430
+ return size;
68431
+ }
68432
+ /** The environment a binding is for, which every binding write needs. */
68433
+ function requiredEnvironment(context) {
68434
+ const environmentUuid = trimmedFlag(context, "--environment");
68435
+ if (environmentUuid === "") throw new UsageError(`bind and unbind need --environment.\n\n${STORAGE_USAGE}`);
68436
+ return environmentUuid;
68437
+ }
68438
+ /**
68439
+ * The binding to record: a directory to mount the bucket at, or the native endpoint the client calls itself.
68440
+ *
68441
+ * Exactly one of the two arrives. Both would be two answers about one binding, and neither says nothing.
68442
+ */
68443
+ function bindingBody(context) {
68444
+ const directory = trimmedFlag(context, "--path");
68445
+ const native = context.flags.has("--native");
68446
+ if (native === (directory !== "")) throw new UsageError(`bind needs exactly one of --path <directory> or --native.\n\n${STORAGE_USAGE}`);
68447
+ return native ? { mode: "native" } : {
68448
+ mode: "mount",
68449
+ path: directory
68450
+ };
68451
+ }
68452
+ /** A flag's value with the surrounding space removed, or the empty string when it was not given. */
68453
+ function trimmedFlag(context, flag) {
68454
+ return context.flags.get(flag)?.trim() ?? "";
68455
+ }
68456
+ /** The bucket, named for a sentence rather than for a path. */
68457
+ function describeBucket(path) {
68458
+ return `bucket ${path.bucketUuid} (${path.company})`;
68459
+ }
68460
+ //#endregion
68461
+ //#region src/commands/storage-text.ts
68462
+ /**
68463
+ * How `storage` answers a person.
68464
+ *
68465
+ * The rendering reads the API's own fields and derives nothing: a usage figure the platform has not measured
68466
+ * is reported as unmeasured rather than as zero, and the connection facts are printed exactly as the bucket
68467
+ * carries them because they are what a client's S3 configuration is filled in with.
68468
+ *
68469
+ * One answer carries a secret — the key rotation — and it says in the same breath that this is the only time
68470
+ * it is shown. Every other line here is safe to paste into a ticket.
68471
+ */
68472
+ function storageText(report) {
68473
+ if ("sent" in report) return renderWriteOutcome(report, storageChangeText);
68474
+ switch (report.kind) {
68475
+ case "buckets": return bucketsText(report.buckets);
68476
+ case "objects": return objectsText(report.page, report.prefix);
68477
+ case "grant": return grantText(report.grant);
68478
+ case "bucket": return bucketText(report.bucket);
68479
+ }
68480
+ }
68481
+ /** What a storage write changed, in the words of the thing it changed. */
68482
+ function storageChangeText(change) {
68483
+ switch (change.kind) {
68484
+ case "issued": return issuedText(change.issued);
68485
+ case "binding": return `Bound to environment ${change.binding.environmentUuid}: ${bindingReach(change.binding)}.`;
68486
+ case "unbound": return `Environment ${change.environmentUuid} no longer reaches bucket ${change.bucketUuid}. Its objects are unchanged.`;
68487
+ case "bucket": return bucketText(change.bucket);
68488
+ }
68489
+ }
68490
+ /** Every bucket on one line each, so a list of purchases reads as a ledger. */
68491
+ function bucketsText(buckets) {
68492
+ if (buckets.length === 0) return "This company has bought no object storage.";
68493
+ return buckets.map((bucket) => ` ${bucket.name} ${bucket.uuid} ${bucket.status} ${readableBytes(bucket.capacityBytes)} of storage, ${usageLine(bucket.usage)} ${String(bucket.bindings.length)} binding(s)`).join("\n");
68494
+ }
68495
+ /**
68496
+ * One bucket: how to connect to it, what it is allowed to hold, what it holds and who reaches it.
68497
+ *
68498
+ * The access key is reported as its hint, which is what the platform keeps. The secret exists only in the
68499
+ * answer to the rotation that issued it.
68500
+ */
68501
+ function bucketText(bucket) {
68502
+ const connection = bucket.connection;
68503
+ return [
68504
+ ` name ${bucket.name}`,
68505
+ ` bucket ${connection.bucket}`,
68506
+ ` endpoint ${connection.endpoint}`,
68507
+ ` region ${connection.region}`,
68508
+ ` addressing ${connection.pathStyle ? "path-style" : "virtual-hosted-style"}`,
68509
+ ` capacity ${readableBytes(bucket.capacityBytes)}`,
68510
+ ` included download ${readableBytes(bucket.includedDownloadBytes)} a month`,
68511
+ ` hard quota ${bucket.hardQuotaEnforced ? "enforced by the gateway" : "not enforced"}`,
68512
+ ` access key ${bucket.accessKeyHint ?? "none issued yet; run storage rotate"}`,
68513
+ ` usage ${usageLine(bucket.usage)}`,
68514
+ ` status ${bucket.status}${bucket.statusMessage === "" ? "" : ` (${bucket.statusMessage})`}`,
68515
+ ...bucket.retiredAt === null ? [] : [` retired ${bucket.retiredAt}`],
68516
+ ...bindingsLines(bucket.bindings)
68517
+ ].join("\n");
68518
+ }
68519
+ /** What the platform last measured, or the fact that it has not measured anything. */
68520
+ function usageLine(usage) {
68521
+ if (usage.observedBytes === null || usage.observedAt === null) return "not measured yet";
68522
+ const count = usage.observedObjectCount === null ? "an unknown number" : String(usage.observedObjectCount);
68523
+ return `${readableBytes(usage.observedBytes)} in ${count} object(s), read ${usage.observedAt}${usage.stale ? " (stale)" : ""}`;
68524
+ }
68525
+ /** One line per binding, or the fact that nothing reaches the bucket. */
68526
+ function bindingsLines(bindings) {
68527
+ if (bindings.length === 0) return [" bindings no environment reaches this bucket"];
68528
+ return bindings.map((binding) => ` bindings ${binding.environmentUuid} ${bindingReach(binding)}`);
68529
+ }
68530
+ /** How one environment reaches the bucket: the endpoint itself, or a directory the platform composes. */
68531
+ function bindingReach(binding) {
68532
+ return binding.path === null ? "natively through the S3 endpoint" : `mounted at ${binding.path}`;
68533
+ }
68534
+ /** One page of keys and sizes, and how to continue when the page is not the whole bucket. */
68535
+ function objectsText(page, prefix) {
68536
+ const heading = prefix === "" ? "Objects:" : `Objects under ${prefix}:`;
68537
+ if (page.objects.length === 0) return `${heading} none.`;
68538
+ const lines = page.objects.map((object) => ` ${object.key} ${readableBytes(object.size)}${object.lastModified === null ? "" : ` ${object.lastModified}`}`);
68539
+ if (!page.truncated) return [
68540
+ heading,
68541
+ ...lines,
68542
+ "That is every object."
68543
+ ].join("\n");
68544
+ return [
68545
+ heading,
68546
+ ...lines,
68547
+ `This page is truncated. Continue with --continuation-token ${page.nextToken ?? "(none returned)"}.`
68548
+ ].join("\n");
68549
+ }
68550
+ /** The signed URL, what it authorizes, and how long it lasts. */
68551
+ function grantText(grant) {
68552
+ return [
68553
+ grant.url,
68554
+ "",
68555
+ `${grant.method} on ${grant.key}, valid until ${grant.expiresAt}.`,
68556
+ "The URL is the whole authorization for that one request and it is short-lived: ask again for a fresh one."
68557
+ ].join("\n");
68558
+ }
68559
+ /**
68560
+ * The one key pair the platform ever returns.
68561
+ *
68562
+ * The warning is not decoration: nothing here is written to a file, the platform cannot answer the pair a
68563
+ * second time, and the terminal's next command has no way to recover it.
68564
+ */
68565
+ function issuedText(issued) {
68566
+ return [
68567
+ ` access key id ${issued.accessKeyId}`,
68568
+ ` secret access key ${issued.secretAccessKey}`,
68569
+ ` key hint ${issued.accessKeyHint}`,
68570
+ ` state ${issued.state}`,
68571
+ "",
68572
+ "This is the only time the secret access key is printed. It is not stored on this machine and the",
68573
+ "platform cannot show it again: put it in the environment's own secret store now. The previous key",
68574
+ "stays valid until this one is authorized."
68575
+ ].join("\n");
68576
+ }
68577
+ //#endregion
68578
+ //#region src/commands/storage-writes.ts
68579
+ /**
68580
+ * The write half of `hostingctl storage`: buy, enlarge, issue a key, retire, bind and unbind.
68581
+ *
68582
+ * Split from the read half so each module stays small enough to hold in mind, and because every function
68583
+ * here goes through `confirmableWrite` — a dry run describes the change and sends nothing, and the write
68584
+ * needs `--confirm`. The purchase and enlargement confirm lines carry the price book's own figures.
68585
+ *
68586
+ * The report types live with the command that returns them; importing them as types keeps this module from
68587
+ * depending on the dispatcher at run time.
68588
+ */
68589
+ /**
68590
+ * The price book's answer for a purchase or an enlargement, as the sentence a confirmation shows.
68591
+ *
68592
+ * The CLI computes no amount: the figures come from the same owner the invoice is produced from, so the
68593
+ * number a client confirms cannot disagree with what they are billed. A product with no recorded price
68594
+ * refuses the command here, before anything is sent, rather than asking for confirmation of an unknown cost.
68595
+ */
68596
+ async function quoteSentence(company, capacityGb, bucketUuid) {
68597
+ const quote = (await hostingStorageQuoteShow({
68598
+ path: { company },
68599
+ query: {
68600
+ capacityGb,
68601
+ ...bucketUuid === void 0 ? {} : { bucket: bucketUuid }
68602
+ }
68603
+ })).data;
68604
+ const included = `${String(Math.round(quote.includedDownloadBytes / 1e9))} GB of downloads included a month`;
68605
+ const prorated = quote.proratedHeldSeconds > 0 ? ` ${formatMoney(quote.proratedCharge.grossCents, quote.currency)} covers the rest of this month.` : "";
68606
+ return `It costs ${formatMoney(quote.addedMonthly.grossCents, quote.currency)} a month including VAT for ${String(quote.addedBlocks * 10)} GB more.${prorated} The bucket will cost ${formatMoney(quote.targetMonthly.grossCents, quote.currency)} a month including VAT, with ${included}, and ${formatMoney(quote.transferUnit.grossCents, quote.currency)} per additional 10 GB.`;
68607
+ }
68608
+ /** `storage add`: buy a bucket. The API records the purchase and reconciles it after the commit. */
68609
+ async function add(context, tail) {
68610
+ refuseExtra(tail);
68611
+ const name = requiredName(context);
68612
+ const capacityGb = requiredSizeGb(context);
68613
+ const company = await requireCompany(context.flags);
68614
+ return await confirmableWrite(context, `Buy ${String(capacityGb)} GB of object storage named "${name}" for ${company}. It is provisioning until reconciliation completes. ${await quoteSentence(company, capacityGb)}`, async () => {
68615
+ return {
68616
+ kind: "bucket",
68617
+ bucket: (await hostingStorageStore({
68618
+ path: { company },
68619
+ body: {
68620
+ name,
68621
+ capacityGb
68622
+ }
68623
+ })).data
68624
+ };
68625
+ });
68626
+ }
68627
+ /** `storage grow <uuid>`: buy more of a bucket's capacity. The API refuses a decrease. */
68628
+ async function grow(context, tail) {
68629
+ const path = await bucketPath(context, tail);
68630
+ const capacityGb = requiredSizeGb(context);
68631
+ return await confirmableWrite(context, `Grow ${describeBucket(path)} to ${String(capacityGb)} GB. Capacity is only ever added here, and the objects are unchanged. ${await quoteSentence(path.company, capacityGb, path.bucketUuid)}`, async () => {
68632
+ return {
68633
+ kind: "bucket",
68634
+ bucket: (await hostingStorageUpdate({
68635
+ path,
68636
+ body: { capacityGb }
68637
+ })).data
68638
+ };
68639
+ });
68640
+ }
68641
+ /**
68642
+ * `storage rotate <uuid>`: the one answer that carries a secret.
68643
+ *
68644
+ * The API answers a new key pair exactly once, so this command's dry run has to say that the answer is the
68645
+ * only copy: there is nothing to re-read afterwards.
68646
+ */
68647
+ async function rotate(context, tail) {
68648
+ const path = await bucketPath(context, tail);
68649
+ return await confirmableWrite(context, `Issue a new access key for ${describeBucket(path)}. The secret is printed once in the answer and cannot be read again; the previous key stays valid until the new one is authorized.`, async () => {
68650
+ return {
68651
+ kind: "issued",
68652
+ issued: (await hostingStorageCredentialsStore({ path })).data
68653
+ };
68654
+ });
68655
+ }
68656
+ /** `storage retire <uuid>`: stop the bucket's access. Retiring is not a deletion, and says so. */
68657
+ async function retire(context, tail) {
68658
+ const path = await bucketPath(context, tail);
68659
+ return await confirmableWrite(context, `Retire the access to ${describeBucket(path)}: its issued keys stop working at the gateway. Every object is kept, and deleting them is a separately ordered operation.`, async () => {
68660
+ return {
68661
+ kind: "bucket",
68662
+ bucket: (await hostingStorageDestroy({ path })).data
68663
+ };
68664
+ });
68665
+ }
68666
+ /** `storage bind <uuid> --environment <uuid>`: an environment reaches the bucket natively or at a directory. */
68667
+ async function bind(context, tail) {
68668
+ const path = await bucketPath(context, tail);
68669
+ const environmentUuid = requiredEnvironment(context);
68670
+ const body = bindingBody(context);
68671
+ const reach = body.mode === "native" ? "natively through the S3 endpoint" : `at the directory ${body.path ?? ""}`;
68672
+ return await confirmableWrite(context, `Bind ${describeBucket(path)} to environment ${environmentUuid} ${reach}.`, async () => {
68673
+ return {
68674
+ kind: "binding",
68675
+ binding: (await hostingStorageBindingsStore({
68676
+ path: {
68677
+ ...path,
68678
+ environmentUuid
68679
+ },
68680
+ body
68681
+ })).data
68682
+ };
68683
+ });
68684
+ }
68685
+ /** `storage unbind <uuid> --environment <uuid>`: the environment stops reaching the bucket. */
68686
+ async function unbind(context, tail) {
68687
+ const path = await bucketPath(context, tail);
68688
+ const environmentUuid = requiredEnvironment(context);
68689
+ return await confirmableWrite(context, `Unbind ${describeBucket(path)} from environment ${environmentUuid}: the mount is removed and its objects are left where they are.`, async () => {
68690
+ await hostingStorageBindingsDestroy({ path: {
68691
+ ...path,
68692
+ environmentUuid
68693
+ } });
68694
+ return {
68695
+ kind: "unbound",
68696
+ bucketUuid: path.bucketUuid,
68697
+ environmentUuid
68698
+ };
68699
+ });
68700
+ }
68701
+ //#endregion
68702
+ //#region src/commands/storage.ts
68703
+ /**
68704
+ * `storage` — a company's purchased object storage, from buying it to one object's signed URL.
68705
+ *
68706
+ * The purchase is a desired-state write: the API records the intent and answers `provisioning`, and the
68707
+ * reconcile job does the provider and gateway work. So `add` and `grow` report the row they recorded rather
68708
+ * than a bucket that is already reachable, and `show` is how a client checks what reconciliation reached.
68709
+ *
68710
+ * `rotate` is the only command that prints a secret, and it prints it in that single answer, because the
68711
+ * platform cannot return it again. Everything else reports the key's hint and never the key.
68712
+ */
68713
+ var storage = {
68714
+ ...STORAGE_METADATA,
68715
+ async run(context) {
68716
+ return await dispatch$1(context);
68717
+ },
68718
+ human: storageText
68719
+ };
68720
+ /** Which subcommand was asked for, and the read or write that answers it. */
68721
+ async function dispatch$1(context) {
68722
+ const [subcommand, ...tail] = context.positional;
68723
+ switch (subcommand) {
68724
+ case "list": return await list$1(context, tail);
68725
+ case "show": return await show(context, tail);
68726
+ case "add": return await add(context, tail);
68727
+ case "grow": return await grow(context, tail);
68728
+ case "rotate": return await rotate(context, tail);
68729
+ case "retire": return await retire(context, tail);
68730
+ case "objects": return await objects(context, tail);
68731
+ case "download-url": return await signedUrl(context, tail, "download");
68732
+ case "upload-url": return await signedUrl(context, tail, "upload");
68733
+ case "bind": return await bind(context, tail);
68734
+ case "unbind": return await unbind(context, tail);
68735
+ default: throw new UsageError(STORAGE_USAGE);
68736
+ }
68737
+ }
68738
+ /** `storage list`: every bucket the company bought. */
68739
+ async function list$1(context, tail) {
68740
+ refuseExtra(tail);
68741
+ return {
68742
+ kind: "buckets",
68743
+ buckets: (await hostingStorageIndex({ path: { company: await requireCompany(context.flags) } })).data.items
68744
+ };
68745
+ }
68746
+ /** `storage show <uuid>`: the connection facts, the last observed usage and the bindings, never a secret. */
68747
+ async function show(context, tail) {
68748
+ return {
68749
+ kind: "bucket",
68750
+ bucket: (await hostingStorageShow({ path: await bucketPath(context, tail) })).data
68751
+ };
68752
+ }
68753
+ /** `storage objects <uuid>`: one bounded page of keys and sizes, optionally under a prefix. */
68754
+ async function objects(context, tail) {
68755
+ const path = await bucketPath(context, tail);
68756
+ const prefix = trimmedFlag(context, "--prefix");
68757
+ const continuationToken = trimmedFlag(context, "--continuation-token");
68758
+ const limit = wholeNumberFlag(context.flags, "--limit");
68759
+ const answer = await hostingStorageObjectsIndex({
68760
+ path,
68761
+ query: {
68762
+ ...prefix === "" ? {} : { prefix },
68763
+ ...continuationToken === "" ? {} : { continuationToken },
68764
+ ...limit === null ? {} : { limit }
68765
+ }
68766
+ });
68767
+ return {
68768
+ kind: "objects",
68769
+ bucketUuid: path.bucketUuid,
68770
+ prefix,
68771
+ page: answer.data
68772
+ };
68773
+ }
68774
+ /** `download-url|upload-url <uuid> --key <key>`: one short-lived signed URL for one key. */
68775
+ async function signedUrl(context, tail, direction) {
68776
+ const path = await bucketPath(context, tail);
68777
+ const key = trimmedFlag(context, "--key");
68778
+ if (key === "") throw new UsageError(`--key is required: the object's key inside the bucket.\n\n${STORAGE_USAGE}`);
68779
+ return {
68780
+ kind: "grant",
68781
+ grant: (await hostingStorageObjectsGrant({
68782
+ path,
68783
+ body: {
68784
+ key,
68785
+ direction
68786
+ }
68787
+ })).data
68788
+ };
68789
+ }
68790
+ //#endregion
67935
68791
  //#region src/commands/system-metadata.ts
67936
68792
  /**
67937
68793
  * `system` — what this system sees left on the cluster it manages.
@@ -68641,7 +69497,7 @@ function writeUpdateState(state, env = process.env) {
68641
69497
  }
68642
69498
  //#endregion
68643
69499
  //#region src/version.ts
68644
- var VERSION = "1.0.525";
69500
+ var VERSION = "1.0.537";
68645
69501
  //#endregion
68646
69502
  //#region src/commands/update.ts
68647
69503
  /**
@@ -68716,7 +69572,7 @@ var update = {
68716
69572
  }, process.env);
68717
69573
  return {
68718
69574
  ...known,
68719
- current: after ?? "1.0.525",
69575
+ current: after ?? "1.0.537",
68720
69576
  latest: after ?? latest,
68721
69577
  upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
68722
69578
  action: "run",
@@ -68881,6 +69737,7 @@ var COMMANDS = [
68881
69737
  register(diagnostics),
68882
69738
  register(backups),
68883
69739
  register(backupDestination),
69740
+ register(storage),
68884
69741
  register(logs),
68885
69742
  register(purchases),
68886
69743
  register(services),
@@ -68992,7 +69849,7 @@ async function printUpdateNotice(options) {
68992
69849
  }, env, { waitMs: NOTICE_LOCK_WAIT_MS });
68993
69850
  } catch {}
68994
69851
  if (latest === null) return;
68995
- if (!isNewerVersion(latest, "1.0.525")) return;
69852
+ if (!isNewerVersion(latest, "1.0.537")) return;
68996
69853
  process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
68997
69854
  }
68998
69855
  /** Whether an environment variable is set to something, which is how CI and the opt-out are read. */