@haakco/hostingctl 1.0.677 → 1.0.682

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
@@ -44895,9 +44895,9 @@ var hostingWorkloadEnum = {
44895
44895
  rust: "rust",
44896
44896
  dotnet: "dotnet",
44897
44897
  python: "python",
44898
+ client_image: "client_image",
44898
44899
  static: "static",
44899
- php: "php",
44900
- client_image: "client_image"
44900
+ php: "php"
44901
44901
  };
44902
44902
  var hostingGeneratedHostnameWordTypeEnum = {
44903
44903
  adjective: "adjective",
@@ -54154,7 +54154,7 @@ function storageChoicesText(choices) {
54154
54154
  return choices.map((choice) => {
54155
54155
  const selected = choice.selectedUuid === null ? "cluster default" : choice.selectedUuid;
54156
54156
  const offered = choice.classes.map((one) => `${one.name}${one.enabled ? "" : " (disabled)"}`).join(", ");
54157
- return ` ${choice.volumeType}: new claims take ${choice.effectiveName ?? "nothing"} (${selected}); offered: ${offered}`;
54157
+ return ` ${choice.volumeType}: new claims take ${choice.effectiveName ?? "nothing"} (selection: ${selected}); offered: ${offered}`;
54158
54158
  }).join("\n");
54159
54159
  }
54160
54160
  function storageWriteText(outcome) {
@@ -61119,6 +61119,7 @@ var blocklistStatusDataSchema = object({
61119
61119
  acknowledgedAt: string().nullable(),
61120
61120
  mutedUntil: string().nullable()
61121
61121
  });
61122
+ var buildHostingSeedPlacementRequestSchema = object({ sourceStorageClassUuid: uuid().nullish() });
61122
61123
  var permissionSchema = _enum([
61123
61124
  "operations.horizon.view",
61124
61125
  "operations.impersonate",
@@ -62922,9 +62923,9 @@ var hostingWorkloadEnumSchema = _enum([
62922
62923
  "rust",
62923
62924
  "dotnet",
62924
62925
  "python",
62926
+ "client_image",
62925
62927
  "static",
62926
- "php",
62927
- "client_image"
62928
+ "php"
62928
62929
  ]);
62929
62930
  var hostingDatabaseRetirementDataSchema = object({
62930
62931
  status: string(),
@@ -64517,6 +64518,7 @@ var hostingStorageClassDataSchema = object({
64517
64518
  name: string(),
64518
64519
  description: string(),
64519
64520
  enabled: boolean(),
64521
+ restricted: boolean(),
64520
64522
  volumeTypes: array(string()),
64521
64523
  reportsUsedBytes: boolean(),
64522
64524
  supportsBackingImages: boolean()
@@ -65018,7 +65020,8 @@ var hostingSeedCatalogueChoicesDataSchema = object({
65018
65020
  images: array(hostingSeedImageChoiceDataSchema),
65019
65021
  workloadTypes: array(string()),
65020
65022
  scopes: array(string()),
65021
- preparationModes: array(string())
65023
+ preparationModes: array(string()),
65024
+ sourceStorageClasses: array(hostingStorageClassDataSchema)
65022
65025
  });
65023
65026
  var hostingSeedContentContractDataSchema = object({
65024
65027
  treeSource: string(),
@@ -65045,7 +65048,11 @@ var hostingSeedPlacementDataSchema = object({
65045
65048
  retirementRequestedAt: string().nullable().describe("When retirement was requested. Withdrawal is observed, so this is the pending fact: the\nplacement is no longer selectable and must not be rebuilt, but it is not yet retired."),
65046
65049
  awaitingExecutionAt: string().nullable(),
65047
65050
  failureSummary: string().nullable(),
65048
- createdAt: string()
65051
+ createdAt: string(),
65052
+ sourceStorageClassUuid: string().nullable(),
65053
+ sourceStorageClassName: string().nullable(),
65054
+ requestedSourceStorageClassUuid: string().nullable(),
65055
+ requestedSourceStorageClassName: string().nullable()
65049
65056
  });
65050
65057
  var hostingSeedVersionDataSchema = object({
65051
65058
  uuid: string(),
@@ -66142,7 +66149,8 @@ var registerHostingStorageClassRequestSchema = object({
66142
66149
  name: string().max(100),
66143
66150
  description: string().max(500).nullish(),
66144
66151
  volumeTypes: array(hostingVolumeEnumSchema).min(1),
66145
- enabled: boolean().optional()
66152
+ enabled: boolean().optional(),
66153
+ restricted: boolean().optional()
66146
66154
  }).describe("Register one cluster's Kubernetes StorageClass in the catalogue.\n\nThe name is validated as a Kubernetes object name and unique per cluster, because it names an\nobject that already exists: a second row for the same class would let two records disagree about\none pool. Nothing here contacts the cluster; registration records intent.");
66147
66155
  object({
66148
66156
  name: string().max(255),
@@ -66762,7 +66770,8 @@ var storeHostingSeedDefinitionRequestSchema = object({
66762
66770
  var storeHostingSeedPlacementRequestSchema = object({
66763
66771
  clusterUuid: uuid(),
66764
66772
  preparationMode: hostingSeedPreparationModeEnumSchema,
66765
- minimumSizeMib: int().min(1)
66773
+ minimumSizeMib: int().min(1),
66774
+ sourceStorageClassUuid: uuid().nullish()
66766
66775
  }).describe("Record one seed version's desired state on one cluster.\n\nA caller supplies the cluster, the per-placement execution mode and the smallest claim the storage\nclass can provision. Resource names and observed readiness are deliberately not accepted: those are\nwritten by construction and by a real observation, and never fabricated from a request.");
66767
66776
  var storeHostingSeedVersionRequestSchema = object({
66768
66777
  sourceRelease: string().max(191),
@@ -67239,7 +67248,8 @@ var updateHostingStorageCapacityRequestSchema = object({ quote: object({
67239
67248
  }) }).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 invent a\npartial refund, neither of which this product offers. The target capacity is the quote's own, and a quote for less\nthan the bucket holds is refused by the purchase service rather than silently accepting it.");
67240
67249
  var updateHostingStorageClassRequestSchema = object({
67241
67250
  name: string().max(100),
67242
- description: string().max(500).nullish()
67251
+ description: string().max(500).nullish(),
67252
+ restricted: boolean().optional()
67243
67253
  }).describe("Edit a registered class's display text.\n\nOnly the name and description are editable. The Kubernetes name, backend and cluster are the\nclass's identity and changing them would make an existing claim's history untrue.");
67244
67254
  var updateHostingStorageClassVolumeTypesRequestSchema = object({ volumeTypes: array(hostingVolumeEnumSchema).min(1) }).describe("Replace the claim types one registered class serves.\n\nWithdrawing a type that a bound volume already uses is refused by the writer, because that claim\nwould describe a class which no longer admits it. The list is the whole set, so repeating a request\nchanges nothing.");
67245
67255
  var updateHostingStorageNativeMaximumRequestSchema = object({ maximumBytes: int().min(0).max(0x5af3107a4000).nullable() }).describe("The optional stored-byte maximum one bucket may be held to.\n\n`maximumBytes: null` is how a maximum is removed, which is a different statement from zero: zero is a real ceiling\nfor an empty bucket, and a body without the key is refused rather than read as \"remove it\". The ceiling is an\nexisting operational size bound (the largest storage this product sells), not a new knob and not a price.");
@@ -69411,6 +69421,7 @@ union([
69411
69421
  object({ message: string().describe("Error overview.") }),
69412
69422
  messageDataSchema
69413
69423
  ]);
69424
+ buildHostingSeedPlacementRequestSchema.optional();
69414
69425
  union([
69415
69426
  object({ message: string().describe("Error overview.") }),
69416
69427
  object({ message: string().describe("Error overview.") }),
@@ -72902,6 +72913,11 @@ var PLATFORM_SEED_FLAGS = [
72902
72913
  takesValue: true,
72903
72914
  description: "The storage class the placement is adopted with."
72904
72915
  },
72916
+ {
72917
+ name: "--source-storage-class",
72918
+ takesValue: true,
72919
+ description: "Source class UUID for placement-add or placement-build; omitted uses the platform's selection."
72920
+ },
72905
72921
  {
72906
72922
  name: "--backing-image",
72907
72923
  takesValue: true,
@@ -73018,11 +73034,12 @@ function requiredSize(context, usage) {
73018
73034
  */
73019
73035
  var USAGE$6 = [
73020
73036
  "Usage: hostingctl platform seed placement-add <seed-uuid> <version-uuid> --cluster <uuid>",
73021
- " --preparation-mode <mode> --minimum-size <MiB>",
73037
+ " --preparation-mode <mode> --minimum-size <MiB> [--source-storage-class <uuid>]",
73022
73038
  " hostingctl platform seed placement-adopt <seed-uuid> <version-uuid> <placement-uuid>",
73023
73039
  " --cluster <uuid> --storage-class <name> --backing-image <name> --expected-checksum <sha>",
73024
73040
  " --minimum-size <MiB>",
73025
73041
  " hostingctl platform seed placement-build <seed-uuid> <version-uuid> <placement-uuid>",
73042
+ " [--source-storage-class <uuid>]",
73026
73043
  " hostingctl platform seed placement-retire <seed-uuid> <version-uuid> <placement-uuid>",
73027
73044
  " hostingctl platform seed placement-diagnostics <seed-uuid> <version-uuid> <placement-uuid>",
73028
73045
  "",
@@ -73059,7 +73076,8 @@ async function add$3(context, seedUuid, versionUuid) {
73059
73076
  const body = {
73060
73077
  clusterUuid: requiredFlag$3(context, "--cluster", USAGE$6),
73061
73078
  preparationMode: preparationModeOf$1(context, "placement-add"),
73062
- minimumSizeMib: requiredSize(context, USAGE$6)
73079
+ minimumSizeMib: requiredSize(context, USAGE$6),
73080
+ ...sourceStorageClassBody(context)
73063
73081
  };
73064
73082
  return {
73065
73083
  kind: "seed-write",
@@ -73093,9 +73111,23 @@ async function adopt$1(context, path) {
73093
73111
  async function change(context, retiring, placementUuid, path) {
73094
73112
  return {
73095
73113
  kind: "seed-write",
73096
- outcome: await confirmableWrite(context, retiring ? `Retire placement ${placementUuid}: its prepared image is withdrawn from the cluster.` : `Build placement ${placementUuid} on its cluster.`, async () => retiring ? (await hostingSeedPlacementStoreRetirement({ path })).data : (await hostingSeedPlacementStoreBuild({ path })).data)
73114
+ outcome: await confirmableWrite(context, retiring ? `Retire placement ${placementUuid}: its prepared image is withdrawn from the cluster.` : `Build placement ${placementUuid} on its cluster.`, async () => retiring ? (await hostingSeedPlacementStoreRetirement({ path })).data : (await hostingSeedPlacementStoreBuild({
73115
+ path,
73116
+ body: sourceStorageClassBody(context)
73117
+ })).data)
73097
73118
  };
73098
73119
  }
73120
+ /**
73121
+ * The optional source storage class a caller may pin, as the body field that carries it.
73122
+ *
73123
+ * `source` is the storage class the prepared image is built from, so a caller whose seed content already lives on
73124
+ * one class can name it. Left out unless given: the platform then applies its own staff-or-customer default, and a
73125
+ * choice this CLI invented would silently override it.
73126
+ */
73127
+ function sourceStorageClassBody(context) {
73128
+ const source = context.flags.get("--source-storage-class")?.trim() ?? "";
73129
+ return source === "" ? {} : { sourceStorageClassUuid: source };
73130
+ }
73099
73131
  /** `--preparation-mode`, required and one of the API's own named modes. */
73100
73132
  function preparationModeOf$1(context, verb) {
73101
73133
  const raw = context.flags.get("--preparation-mode")?.trim() ?? "";
@@ -78329,7 +78361,7 @@ function catalogueText(catalogue) {
78329
78361
  }
78330
78362
  function classLine(one) {
78331
78363
  const types = one.volumeTypes.join(", ");
78332
- return `${one.name} [${one.kubernetesName}] on ${one.clusterName}, ${one.backendName}, ${types}${one.enabled ? "" : " disabled"}`;
78364
+ return `${one.name} [${one.kubernetesName}] on ${one.clusterName}, ${one.backendName}, ${types}${one.enabled ? "" : " disabled"}${one.restricted ? " trial" : ""}`;
78333
78365
  }
78334
78366
  function classText(one) {
78335
78367
  return [
@@ -78340,6 +78372,7 @@ function classText(one) {
78340
78372
  `Backend: ${one.backendName}`,
78341
78373
  `Claim types: ${one.volumeTypes.join(", ")}`,
78342
78374
  `Enabled: ${one.enabled ? "yes" : "no"}`,
78375
+ `Trial (offered only where an operator selects it): ${one.restricted ? "yes" : "no"}`,
78343
78376
  `Reports written bytes: ${one.reportsUsedBytes ? "yes" : "no"}`,
78344
78377
  `Can carry a seed: ${one.supportsBackingImages ? "yes" : "no"}`,
78345
78378
  `UUID: ${one.uuid}`
@@ -78407,6 +78440,20 @@ function noExtra(rest) {
78407
78440
  function description(context) {
78408
78441
  return (context.flags.get("--description") ?? "").trim();
78409
78442
  }
78443
+ /**
78444
+ * Whether a class is a trial, or null when the operator named no change.
78445
+ *
78446
+ * A trial is offered to no company until an operator selects it on one environment, so registering one without
78447
+ * mentioning it would publish it to every tenant. Omission therefore means "leave it as it is" on an update, and
78448
+ * the API records a new class as not restricted when the flag is absent.
78449
+ */
78450
+ function restricted(context) {
78451
+ return onOffFlag(context, "--restricted");
78452
+ }
78453
+ /** The sentence a dry run states for a trial, so offering one or withdrawing it reads as the change it is. */
78454
+ function trialStatement(value) {
78455
+ return value ? ", as a trial offered only where an operator selects it" : ", offered to every company";
78456
+ }
78410
78457
  /** The claim types a write names, accepted as one comma-separated flag. */
78411
78458
  function volumeTypes(context) {
78412
78459
  const types = (context.flags.get("--volume-types") ?? "").split(",").map((type) => type.trim()).filter((type) => type.length > 0);
@@ -78432,6 +78479,7 @@ async function confirm(context, statement, send) {
78432
78479
  }
78433
78480
  async function add(context, rest) {
78434
78481
  noExtra(rest);
78482
+ const trial = restricted(context);
78435
78483
  const body = {
78436
78484
  clusterUuid: required(context, "--cluster"),
78437
78485
  backendType: backend(required(context, "--backend")),
@@ -78439,22 +78487,25 @@ async function add(context, rest) {
78439
78487
  name: required(context, "--name"),
78440
78488
  description: description(context),
78441
78489
  volumeTypes: volumeTypes(context),
78442
- enabled: !context.flags.has("--disabled")
78490
+ enabled: !context.flags.has("--disabled"),
78491
+ ...trial === null ? {} : { restricted: trial }
78443
78492
  };
78444
78493
  return {
78445
78494
  kind: "write",
78446
- outcome: await confirm(context, `Register storage class ${body.kubernetesName} on cluster ${body.clusterUuid} for ${body.volumeTypes.join(", ")}`, async () => (await platformStorageClassStore({ body })).data)
78495
+ outcome: await confirm(context, `Register storage class ${body.kubernetesName} on cluster ${body.clusterUuid} for ${body.volumeTypes.join(", ")}${trial === null ? "" : trialStatement(trial)}`, async () => (await platformStorageClassStore({ body })).data)
78447
78496
  };
78448
78497
  }
78449
78498
  async function set(context, rest) {
78450
78499
  const uuid = one(rest);
78500
+ const trial = restricted(context);
78451
78501
  const body = {
78452
78502
  name: required(context, "--name"),
78453
- description: description(context)
78503
+ description: description(context),
78504
+ ...trial === null ? {} : { restricted: trial }
78454
78505
  };
78455
78506
  return {
78456
78507
  kind: "write",
78457
- outcome: await confirm(context, `Rename storage class ${uuid} to ${body.name}`, async () => (await platformStorageClassUpdate({
78508
+ outcome: await confirm(context, `Rename storage class ${uuid} to ${body.name}${trial === null ? "" : trialStatement(trial)}`, async () => (await platformStorageClassUpdate({
78458
78509
  path: { storageClassUuid: uuid },
78459
78510
  body
78460
78511
  })).data)
@@ -78511,7 +78562,8 @@ var STORAGE_CLASS_USAGE = [
78511
78562
  "Usage: hostingctl storage-class list",
78512
78563
  " hostingctl storage-class add --cluster <uuid> --backend <slug> --kubernetes-name <name>",
78513
78564
  " --name <text> --volume-types <type[,type...]> [--description <text>] [--disabled]",
78514
- " hostingctl storage-class set <uuid> --name <text> [--description <text>]",
78565
+ " [--restricted <on|off>]",
78566
+ " hostingctl storage-class set <uuid> --name <text> [--description <text>] [--restricted <on|off>]",
78515
78567
  " hostingctl storage-class enabled <uuid> (--on|--off)",
78516
78568
  " hostingctl storage-class volume-types <uuid> --volume-types <type[,type...]>",
78517
78569
  " hostingctl storage-class default --cluster <uuid> --volume-type <type> --class <uuid>",
@@ -78520,7 +78572,8 @@ var STORAGE_CLASS_USAGE = [
78520
78572
  " list Every registered class, each cluster's defaults, and the vocabularies a class may use.",
78521
78573
  " add Register one cluster's Kubernetes StorageClass. Registering records intent: it does not",
78522
78574
  " create the class on the cluster, and an operator grants no company anything by it.",
78523
- " set Edit the display text. The Kubernetes name, backend and cluster are the class's identity.",
78575
+ " set Edit the display text and whether the class is a trial. The Kubernetes name, backend and",
78576
+ " cluster are the class's identity.",
78524
78577
  " enabled Switch a class on or off. Disabling removes it from future selection; a claim already",
78525
78578
  " bound to it keeps its class, because Kubernetes cannot change one in place.",
78526
78579
  " volume-types Replace the claim types a class serves. A type a bound volume already uses cannot be",
@@ -78528,6 +78581,9 @@ var STORAGE_CLASS_USAGE = [
78528
78581
  " default The class a cluster allocates a claim type from when an environment names no choice.",
78529
78582
  " observation What the cluster reports for the class, or why it could not be read.",
78530
78583
  "",
78584
+ " --restricted on makes a class a trial: it is offered to no company until an operator selects it on one",
78585
+ " environment. Existing claims keep the class recorded on them, whichever way this is set.",
78586
+ "",
78531
78587
  "Every write needs --confirm; --dry-run describes the change and sends nothing."
78532
78588
  ].join("\n");
78533
78589
  /**
@@ -78587,6 +78643,11 @@ var storageClass = {
78587
78643
  takesValue: false,
78588
78644
  description: "Register the class switched off."
78589
78645
  },
78646
+ {
78647
+ name: "--restricted",
78648
+ takesValue: true,
78649
+ description: "Whether the class is a trial offered only where an operator selects it: on or off."
78650
+ },
78590
78651
  {
78591
78652
  name: "--on",
78592
78653
  takesValue: false,
@@ -79329,7 +79390,7 @@ function writeUpdateState(state, env = process.env) {
79329
79390
  }
79330
79391
  //#endregion
79331
79392
  //#region src/version.ts
79332
- var VERSION = "1.0.677";
79393
+ var VERSION = "1.0.682";
79333
79394
  //#endregion
79334
79395
  //#region src/commands/update.ts
79335
79396
  /**
@@ -79404,7 +79465,7 @@ var update = {
79404
79465
  }, process.env);
79405
79466
  return {
79406
79467
  ...known,
79407
- current: after ?? "1.0.677",
79468
+ current: after ?? "1.0.682",
79408
79469
  latest: after ?? latest,
79409
79470
  upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
79410
79471
  action: "run",
@@ -79686,7 +79747,7 @@ async function printUpdateNotice(options) {
79686
79747
  }, env, { waitMs: NOTICE_LOCK_WAIT_MS });
79687
79748
  } catch {}
79688
79749
  if (latest === null) return;
79689
- if (!isNewerVersion(latest, "1.0.677")) return;
79750
+ if (!isNewerVersion(latest, "1.0.682")) return;
79690
79751
  process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
79691
79752
  }
79692
79753
  /** Whether an environment variable is set to something, which is how CI and the opt-out are read. */