@haakco/hostingctl 1.0.701 → 1.0.702

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
@@ -34005,6 +34005,22 @@ function hostingEnvironmentStorageDestroy(options) {
34005
34005
  }));
34006
34006
  }
34007
34007
  /**
34008
+ * {@link /c/:company/hosting/environments/:environmentUuid/storage/journal}
34009
+ */
34010
+ function hostingEnvironmentsStorageJournal(options) {
34011
+ const { client: request = client, ...config } = options;
34012
+ return withUnwrap(request({
34013
+ method: "GET",
34014
+ url: "/c/{company}/hosting/environments/{environmentUuid}/storage/journal",
34015
+ security: [{
34016
+ type: "http",
34017
+ scheme: "bearer"
34018
+ }],
34019
+ ...config,
34020
+ throwOnError: config.throwOnError ?? true
34021
+ }));
34022
+ }
34023
+ /**
34008
34024
  * {@link /c/:company/hosting/environments/:environmentUuid/secret-connections}
34009
34025
  */
34010
34026
  function hostingExternalSecretIndex(options) {
@@ -52358,6 +52374,7 @@ var ENVIRONMENT_SUBCOMMANDS = [
52358
52374
  "component-version",
52359
52375
  "references",
52360
52376
  "storage-usage",
52377
+ "storage-journal",
52361
52378
  "runtime-versions",
52362
52379
  "runtime-version-grants",
52363
52380
  "retention",
@@ -52426,6 +52443,7 @@ var ENVIRONMENT_USAGE = [
52426
52443
  " hostingctl environment component-version <uuid> <workload-uuid> <version> --company <slug>",
52427
52444
  " hostingctl environment references <uuid> --company <slug>",
52428
52445
  " hostingctl environment storage-usage <uuid> --company <slug>",
52446
+ " hostingctl environment storage-journal <uuid> --company <slug>",
52429
52447
  " hostingctl environment runtime-versions --company <slug>",
52430
52448
  " hostingctl environment setup --company <slug> --file <hosting.yaml> --confirm",
52431
52449
  " [--environment <uuid> | --name <name> [--slug <slug>] [--package <key>]]",
@@ -52462,6 +52480,9 @@ var ENVIRONMENT_USAGE = [
52462
52480
  " in `field`, and a credential field is marked rather than valued.",
52463
52481
  " storage-usage What each volume was allocated, what it has written and what room is left, from the",
52464
52482
  " platform's own reading; a volume it could not read says so instead of reporting zero.",
52483
+ " storage-journal The disposal rows this environment recorded: which claim was captured, how far its",
52484
+ " reclaim got, and the reason a pass refused to continue. Recorded rows only, never a",
52485
+ " live reading, and nothing in it makes a volume disposable.",
52465
52486
  " runtime-versions The version lines each application type offers, which of them may be chosen now, and why",
52466
52487
  " the others may not.",
52467
52488
  "",
@@ -54368,6 +54389,59 @@ function environmentDomainText(report) {
54368
54389
  return redirects.length === 0 ? "This environment answers no redirects." : redirects.map((one) => ` ${one.sourceHostname.padEnd(36)} ${one.modeName.padEnd(10)} → ${one.destinationUrl ?? one.applicationLabel ?? "its application"} ${one.active ? "active" : one.pendingReason ?? "pending"}`).join("\n");
54369
54390
  }
54370
54391
  //#endregion
54392
+ //#region src/commands/environment-storage-journal.ts
54393
+ var STORAGE_JOURNAL_USAGE = [
54394
+ "Usage: hostingctl environment storage-journal <environment-uuid> --company <slug>",
54395
+ "",
54396
+ " storage-journal The disposal rows this environment recorded for its volumes: which claim was",
54397
+ " captured, how far its reclaim got, and the reason a pass refused to continue.",
54398
+ "",
54399
+ "Every field is a row the platform wrote down before it tried to destroy a volume, so this answers why storage is",
54400
+ "still held. It is not a live reading: the cluster's own retained-volume listing is `hosting:cluster-state`, and",
54401
+ "nothing here says a volume is disposable. A row whose pass recorded no refusal says so rather than guessing one."
54402
+ ].join("\n");
54403
+ /**
54404
+ * `environment storage-journal <uuid>`: why this environment's storage is still held, from its recorded rows.
54405
+ *
54406
+ * One read of the API's own projection of the disposal protocol's capture, so this command and the operator's
54407
+ * `diagnostics:status` cannot disagree about a blocked reclaim.
54408
+ */
54409
+ async function environmentStorageJournal(context, rest) {
54410
+ const [uuid, ...extra] = rest;
54411
+ if (uuid === void 0 || extra.length > 0) throw new UsageError(STORAGE_JOURNAL_USAGE);
54412
+ return {
54413
+ kind: "storage-journal",
54414
+ journal: (await hostingEnvironmentsStorageJournal({ path: {
54415
+ company: await requireCompany(context.flags),
54416
+ environmentUuid: uuid
54417
+ } })).data
54418
+ };
54419
+ }
54420
+ /** What the recorded rows add up to, in the terms a refusal is investigated in. */
54421
+ function recordedCounts(journal) {
54422
+ return `${String(journal.open)} open, ${String(journal.verifiedDeleted)} verified deleted`;
54423
+ }
54424
+ /** One recorded row: the claim, the stage it reached, the refusal it recorded and when it last changed. */
54425
+ function recordedRowText(row) {
54426
+ const refusal = row.blockedReason === null ? "no reason recorded" : `blocked: ${row.blockedReason}`;
54427
+ return ` ${row.claim} ${row.stage}, ${refusal}; recorded state changed ${row.stateChangedAt}`;
54428
+ }
54429
+ /**
54430
+ * The journal as a person reads it: the counts first, then one line per still-held claim.
54431
+ *
54432
+ * The closing line carries the boundary the payload's `evidence` states, so an operator cannot read these rows as
54433
+ * the cluster's current phase. A truncated list says so rather than looking like the whole backlog.
54434
+ */
54435
+ function storageJournalText(journal) {
54436
+ if (journal.claims.length === 0) return `${recordedCounts(journal)}: this environment records no captured backend still waiting to be reclaimed.`;
54437
+ return [
54438
+ `Storage journal for this environment (${recordedCounts(journal)}):`,
54439
+ ...journal.claims.map(recordedRowText),
54440
+ ...journal.truncated ? [" … more open rows than this list shows; the counts above are the recorded totals."] : [],
54441
+ "Recorded rows only: what the disposal protocol wrote down, never a live reading of any volume."
54442
+ ].join("\n");
54443
+ }
54444
+ //#endregion
54371
54445
  //#region src/commands/environment-tagged-text.ts
54372
54446
  /**
54373
54447
  * The renderer for a group-tagged answer.
@@ -54382,6 +54456,7 @@ function environmentTaggedText(report) {
54382
54456
  if (report.kind === "shared-runtime" || report.kind === "shared-app" || report.kind === "shared-write") return environmentSharedText(report);
54383
54457
  if (report.kind === "exports" || report.kind === "download" || report.kind === "bundle" || report.kind === "export-write") return environmentExportText(report);
54384
54458
  if (report.kind === "service-addition" || report.kind === "service-retirement" || report.kind === "service-write") return environmentServicesText(report);
54459
+ if (report.kind === "storage-journal") return storageJournalText(report.journal);
54385
54460
  return environmentAdminText(report);
54386
54461
  }
54387
54462
  //#endregion
@@ -61857,6 +61932,23 @@ var diagnosticsCheckDataSchema = object({
61857
61932
  status: string(),
61858
61933
  detail: string()
61859
61934
  });
61935
+ var diagnosticsClaimDisposalDataSchema = object({
61936
+ disposal: string().describe("The disposal row's own uuid, so a reason can be matched to its operational log line."),
61937
+ claim: string().describe("The claim whose backend this row captured, so several volumes in one environment stay distinguishable."),
61938
+ stage: string().describe("The furthest recorded stage: `captured`, `reclaim-requested` or `guard-observed`."),
61939
+ blockedReason: string().nullable().describe("The recorded `blocked_reason`: why the last pass would not progress, or null when it recorded none."),
61940
+ stateChangedAt: string().describe("When this row last changed. A repeated reason writes nothing, so a newer attempt changes no timestamp."),
61941
+ capturedAt: string(),
61942
+ reclaimRequestedAt: string().nullable(),
61943
+ reclaimGuardObservedAt: string().nullable()
61944
+ });
61945
+ object({
61946
+ open: int(),
61947
+ verifiedDeleted: int(),
61948
+ truncated: boolean(),
61949
+ evidence: string(),
61950
+ claims: array(diagnosticsClaimDisposalDataSchema)
61951
+ });
61860
61952
  var diagnosticsDoctorDataSchema = object({
61861
61953
  ok: boolean(),
61862
61954
  environment: string(),
@@ -65951,6 +66043,16 @@ var hostingVolumeEnumSchema = _enum([
65951
66043
  "database-data",
65952
66044
  "redis-data"
65953
66045
  ]);
66046
+ var hostingVolumeMigrationPhaseEnumSchema = _enum([
66047
+ "review",
66048
+ "writers-hold",
66049
+ "destination",
66050
+ "copy",
66051
+ "quiesce",
66052
+ "promote",
66053
+ "verify",
66054
+ "done"
66055
+ ]);
65954
66056
  var impersonationSessionDataSchema = object({
65955
66057
  uuid: string(),
65956
66058
  operator: userDataSchema,
@@ -66877,6 +66979,38 @@ var stateManagerCallbackRefusalDataSchema = object({
66877
66979
  reason: string(),
66878
66980
  version: int()
66879
66981
  });
66982
+ var stateManagerHoldDataSchema = object({
66983
+ kind: _enum(["volume-migration", "application-recovery"]).describe("Closed transport vocabulary for the authoritative hold snapshot.\n").describe("Closed transport vocabulary for the authoritative hold snapshot.\n"),
66984
+ operationUuid: string(),
66985
+ phase: union([hostingRecoveryPhaseEnumSchema, hostingVolumeMigrationPhaseEnumSchema]),
66986
+ environmentUuid: string(),
66987
+ companySlug: string(),
66988
+ namespace: string(),
66989
+ claimNames: array(string()),
66990
+ heldSince: string().nullable()
66991
+ });
66992
+ var stateManagerHoldSnapshotReasonEnumSchema = _enum([
66993
+ "truncated",
66994
+ "read_failed",
66995
+ "claim_membership_unknown"
66996
+ ]).describe("Closed transport vocabulary for the authoritative hold snapshot.\n");
66997
+ object({
66998
+ version: int(),
66999
+ deployment: string(),
67000
+ cluster: string(),
67001
+ scope: string(),
67002
+ observedAt: string(),
67003
+ complete: boolean(),
67004
+ reason: union([stateManagerHoldSnapshotReasonEnumSchema, _null()]),
67005
+ limit: int(),
67006
+ holds: array(stateManagerHoldDataSchema)
67007
+ });
67008
+ var stateManagerHoldSnapshotRequestSchema = object({
67009
+ version: literal(1),
67010
+ deployment: string().max(64),
67011
+ cluster: string().max(64),
67012
+ scope: string().max(64)
67013
+ }).describe("The manager's hold-snapshot request.\n\nIt carries one target and nothing else: the deployment decides what that target\nauthorizes, so a caller cannot name a cluster, a company or an operation. The\nroute's machine-client middleware owns authorization; the resolver compares the\npresented target with the configured one before it reads anything.");
66880
67014
  object({
66881
67015
  ref: object({
66882
67016
  deployment: string(),
@@ -69372,6 +69506,11 @@ union([
69372
69506
  object({ message: string().describe("Error overview.") }),
69373
69507
  messageDataSchema
69374
69508
  ]);
69509
+ union([
69510
+ object({ message: string().describe("Error overview.") }),
69511
+ object({ message: string().describe("Error overview.") }),
69512
+ messageDataSchema
69513
+ ]);
69375
69514
  var hostingExternalSecretStoreStatus200Schema = hostingExternalSecretConnectionDataSchema;
69376
69515
  var hostingExternalSecretStoreStatus201Schema = hostingExternalSecretConnectionDataSchema;
69377
69516
  var hostingExternalSecretStoreStatus401Schema = object({ message: string().describe("Error overview.") });
@@ -71356,6 +71495,13 @@ union([
71356
71495
  ]);
71357
71496
  registrarSupersedeTransferRequestSchema.describe("Explicit consent to close the prior unknown transfer after fresh provider checks.");
71358
71497
  union([object({ message: string().describe("Error overview.") }), messageDataSchema]);
71498
+ union([
71499
+ stateManagerCallbackRefusalDataSchema,
71500
+ stateManagerCallbackRefusalDataSchema,
71501
+ stateManagerCallbackRefusalDataSchema,
71502
+ stateManagerCallbackRefusalDataSchema
71503
+ ]);
71504
+ stateManagerHoldSnapshotRequestSchema.describe("The manager's hold-snapshot request.\n\nIt carries one target and nothing else: the deployment decides what that target\nauthorizes, so a caller cannot name a cluster, a company or an operation. The\nroute's machine-client middleware owns authorization; the resolver compares the\npresented target with the configured one before it reads anything.");
71359
71505
  union([
71360
71506
  stateManagerCallbackRefusalDataSchema,
71361
71507
  stateManagerCallbackRefusalDataSchema,
@@ -71634,7 +71780,8 @@ var SIMPLE_SUBCOMMANDS = {
71634
71780
  database,
71635
71781
  "runtime-versions": environmentRuntimeVersions,
71636
71782
  "runtime-version-grants": environmentRuntimeVersionGrants,
71637
- storage: environmentStorage
71783
+ storage: environmentStorage,
71784
+ "storage-journal": environmentStorageJournal
71638
71785
  };
71639
71786
  /** Which feature group answers this subcommand and arguments, or null when the command itself does. */
71640
71787
  function dispatched(context, subcommand, rest) {
@@ -79960,7 +80107,7 @@ function writeUpdateState(state, env = process.env) {
79960
80107
  }
79961
80108
  //#endregion
79962
80109
  //#region src/version.ts
79963
- var VERSION = "1.0.701";
80110
+ var VERSION = "1.0.702";
79964
80111
  //#endregion
79965
80112
  //#region src/commands/update.ts
79966
80113
  /**
@@ -80035,7 +80182,7 @@ var update = {
80035
80182
  }, process.env);
80036
80183
  return {
80037
80184
  ...known,
80038
- current: after ?? "1.0.701",
80185
+ current: after ?? "1.0.702",
80039
80186
  latest: after ?? latest,
80040
80187
  upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
80041
80188
  action: "run",
@@ -80317,7 +80464,7 @@ async function printUpdateNotice(options) {
80317
80464
  }, env, { waitMs: NOTICE_LOCK_WAIT_MS });
80318
80465
  } catch {}
80319
80466
  if (latest === null) return;
80320
- if (!isNewerVersion(latest, "1.0.701")) return;
80467
+ if (!isNewerVersion(latest, "1.0.702")) return;
80321
80468
  process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
80322
80469
  }
80323
80470
  /** Whether an environment variable is set to something, which is how CI and the opt-out are read. */