@haakco/hostingctl 1.0.374 → 1.0.384

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
@@ -3671,7 +3671,7 @@ function emailMailboxesCredential(options) {
3671
3671
  }
3672
3672
  /**
3673
3673
  * @description Unlike credential delivery retries, every accepted reset replaces the current password.
3674
- * Adopted native credentials remain protected by the credential service's ownership guard.
3674
+ * An authorized reset may rotate an adopted credential; its ownership binding remains intact.
3675
3675
  * @summary Explicitly reset the mailbox password to a new version and reveal it once
3676
3676
  * {@link /c/:company/email/domains/:emailDomainUuid/mailboxes/:mailboxUuid/credential/reset}
3677
3677
  */
@@ -27514,6 +27514,22 @@ var hostingToolDataSchema = object({
27514
27514
  url: string(),
27515
27515
  permitted: boolean()
27516
27516
  });
27517
+ var hostingServiceIncidentDataSchema = object({
27518
+ kind: _enum(["application_database_connection"]),
27519
+ reason: union([_enum([
27520
+ "credential_refused",
27521
+ "server_unreachable",
27522
+ "query_failed",
27523
+ "server_error",
27524
+ "probe_failed",
27525
+ "no_database_declared",
27526
+ "extension_missing",
27527
+ "unanswered"
27528
+ ]).describe("The closed set of safe reason codes an application observation can carry. These are the codes the application's own stats reading reports, and the only vocabulary an observer or a client message may name. They deliberately describe what was seen rather than why: `credential_refused` means a server evaluated the credential and refused it, while `server_unreachable` means no server answered — two different repairs, and only the first is about a password. A driver message, a host, a database name or a password never becomes one of these. {@see self::outcome()} owns the one decision each code makes, so the confirmation rule cannot drift between the observer that records a fact and the presentation that explains it.\n| |\n|---|\n| `credential_refused` <br/> MySQL error 1044/1045: a server answered and rejected the credential or the grant. |\n| `server_unreachable` <br/> A client-library code (2000+): the connection never reached a database server. |\n| `query_failed` <br/> The connection and the credential were accepted but the probe query did not answer. |\n| `server_error` <br/> A server answered and could not evaluate the question, for example at its connection ceiling. |\n| `probe_failed` <br/> The probe inside the application could not run at all, so acceptance is unknown. |\n| `no_database_declared` <br/> The application tree declares no database, so there is nothing for it to connect to. |\n| `extension_missing` <br/> The runtime has no MySQL client, so the probe could not be made. |\n| `unanswered` <br/> The application did not answer the reading at all. |"), _null()]),
27529
+ summary: string().describe("The impact in plain language, safe to show a client."),
27530
+ openedAt: string().describe("ISO-8601 UTC instant the outage was confirmed."),
27531
+ lastObservedAt: string().describe("ISO-8601 UTC instant the platform last looked at the resource.")
27532
+ });
27517
27533
  var hostingLastReconcileDataSchema = object({
27518
27534
  status: string(),
27519
27535
  generation: int(),
@@ -27578,6 +27594,7 @@ var hostingEnvironmentDataSchema = object({
27578
27594
  databases: array(hostingDatabaseDataSchema),
27579
27595
  tools: array(hostingToolDataSchema),
27580
27596
  status: hostingEnvironmentStatusDataSchema,
27597
+ serviceIncidents: array(hostingServiceIncidentDataSchema),
27581
27598
  lastReconcile: union([hostingLastReconcileDataSchema, _null()]),
27582
27599
  allocation: hostingAllocationDataSchema,
27583
27600
  namespaceAllocation: hostingAllocationDataSchema,
@@ -36939,7 +36956,7 @@ function writeUpdateState(state, env = process.env) {
36939
36956
  }
36940
36957
  //#endregion
36941
36958
  //#region src/version.ts
36942
- var VERSION = "0.0.0-dev";
36959
+ var VERSION = "1.0.384";
36943
36960
  //#endregion
36944
36961
  //#region src/commands/update.ts
36945
36962
  /**
@@ -37014,7 +37031,7 @@ var update = {
37014
37031
  }, process.env);
37015
37032
  return {
37016
37033
  ...known,
37017
- current: after ?? "0.0.0-dev",
37034
+ current: after ?? "1.0.384",
37018
37035
  latest: after ?? latest,
37019
37036
  upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
37020
37037
  action: "run",
@@ -37252,6 +37269,13 @@ function startsWith(path, prefix) {
37252
37269
  return prefix.every((one, index) => path[index] === one);
37253
37270
  }
37254
37271
  /**
37272
+ * How long the notice waits for the lock that guards the state file.
37273
+ *
37274
+ * Short, because the notice runs beside a command a person is waiting on: a machine that is busy updating
37275
+ * its session is not a reason to hold this one up, and the check simply happens again next time.
37276
+ */
37277
+ var NOTICE_LOCK_WAIT_MS = 150;
37278
+ /**
37255
37279
  * Tell the client, once a day, that a newer version is published.
37256
37280
  *
37257
37281
  * The notice goes to stderr, so it never mixes into a command's output, and it names `hostingctl update`
@@ -37260,6 +37284,34 @@ function startsWith(path, prefix) {
37260
37284
  */
37261
37285
  async function printUpdateNotice(options) {
37262
37286
  if (options.json) return;
37287
+ const env = options.env ?? process.env;
37288
+ if (isSet(env.CI)) return;
37289
+ if (isSet(env.HOSTINGCTL_NO_UPDATE_CHECK)) return;
37290
+ const state = readUpdateState(env);
37291
+ const now = Date.now();
37292
+ if (state !== null && now - state.checkedAt < 864e5) return;
37293
+ const latest = await latestVersion();
37294
+ try {
37295
+ mkdirSync(credentialDirectory(env), {
37296
+ recursive: true,
37297
+ mode: 448
37298
+ });
37299
+ await withCredentialLock(async () => {
37300
+ writeUpdateState({
37301
+ method: state?.method ?? null,
37302
+ entry: state?.entry ?? "",
37303
+ checkedAt: now,
37304
+ latest
37305
+ }, env);
37306
+ }, env, { waitMs: NOTICE_LOCK_WAIT_MS });
37307
+ } catch {}
37308
+ if (latest === null) return;
37309
+ if (!isNewerVersion(latest, "1.0.384")) return;
37310
+ process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
37311
+ }
37312
+ /** Whether an environment variable is set to something, which is how CI and the opt-out are read. */
37313
+ function isSet(value) {
37314
+ return value !== void 0 && value !== "";
37263
37315
  }
37264
37316
  //#endregion
37265
37317
  //#region src/main.ts