@haakco/hostingctl 1.0.660 → 1.0.673
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 +1268 -325
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
- package/platform/darwin-arm64/hostingctl +0 -0
- package/platform/darwin-x64/hostingctl +0 -0
- package/platform/linux-arm64/hostingctl +0 -0
- package/platform/linux-x64/hostingctl +0 -0
- package/platform/windows-x64/hostingctl.exe +0 -0
package/dist/main.js
CHANGED
|
@@ -32541,6 +32541,22 @@ function hostingApplicationCachePurge(options) {
|
|
|
32541
32541
|
}));
|
|
32542
32542
|
}
|
|
32543
32543
|
/**
|
|
32544
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/capacity}
|
|
32545
|
+
*/
|
|
32546
|
+
function hostingApplicationCapacityShow(options) {
|
|
32547
|
+
const { client: request = client, ...config } = options;
|
|
32548
|
+
return withUnwrap(request({
|
|
32549
|
+
method: "GET",
|
|
32550
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/applications/{workloadUuid}/capacity",
|
|
32551
|
+
security: [{
|
|
32552
|
+
type: "http",
|
|
32553
|
+
scheme: "bearer"
|
|
32554
|
+
}],
|
|
32555
|
+
...config,
|
|
32556
|
+
throwOnError: config.throwOnError ?? true
|
|
32557
|
+
}));
|
|
32558
|
+
}
|
|
32559
|
+
/**
|
|
32544
32560
|
* {@link /c/:company/hosting/environments/:environmentUuid/applications/:workloadUuid/component-settings}
|
|
32545
32561
|
*/
|
|
32546
32562
|
function hostingApplicationsComponentSettings(options) {
|
|
@@ -33891,6 +33907,54 @@ function hostingEnvironmentsReferences(options) {
|
|
|
33891
33907
|
}));
|
|
33892
33908
|
}
|
|
33893
33909
|
/**
|
|
33910
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/storage}
|
|
33911
|
+
*/
|
|
33912
|
+
function hostingEnvironmentStorageIndex(options) {
|
|
33913
|
+
const { client: request = client, ...config } = options;
|
|
33914
|
+
return withUnwrap(request({
|
|
33915
|
+
method: "GET",
|
|
33916
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/storage",
|
|
33917
|
+
security: [{
|
|
33918
|
+
type: "http",
|
|
33919
|
+
scheme: "bearer"
|
|
33920
|
+
}],
|
|
33921
|
+
...config,
|
|
33922
|
+
throwOnError: config.throwOnError ?? true
|
|
33923
|
+
}));
|
|
33924
|
+
}
|
|
33925
|
+
/**
|
|
33926
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/storage}
|
|
33927
|
+
*/
|
|
33928
|
+
function hostingEnvironmentStorageUpdate(options) {
|
|
33929
|
+
const { client: request = client, ...config } = options;
|
|
33930
|
+
return withUnwrap(request({
|
|
33931
|
+
method: "PUT",
|
|
33932
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/storage",
|
|
33933
|
+
security: [{
|
|
33934
|
+
type: "http",
|
|
33935
|
+
scheme: "bearer"
|
|
33936
|
+
}],
|
|
33937
|
+
...config,
|
|
33938
|
+
throwOnError: config.throwOnError ?? true
|
|
33939
|
+
}));
|
|
33940
|
+
}
|
|
33941
|
+
/**
|
|
33942
|
+
* {@link /c/:company/hosting/environments/:environmentUuid/storage/:volumeType}
|
|
33943
|
+
*/
|
|
33944
|
+
function hostingEnvironmentStorageDestroy(options) {
|
|
33945
|
+
const { client: request = client, ...config } = options;
|
|
33946
|
+
return withUnwrap(request({
|
|
33947
|
+
method: "DELETE",
|
|
33948
|
+
url: "/c/{company}/hosting/environments/{environmentUuid}/storage/{volumeType}",
|
|
33949
|
+
security: [{
|
|
33950
|
+
type: "http",
|
|
33951
|
+
scheme: "bearer"
|
|
33952
|
+
}],
|
|
33953
|
+
...config,
|
|
33954
|
+
throwOnError: config.throwOnError ?? true
|
|
33955
|
+
}));
|
|
33956
|
+
}
|
|
33957
|
+
/**
|
|
33894
33958
|
* {@link /c/:company/hosting/environments/:environmentUuid/secret-connections}
|
|
33895
33959
|
*/
|
|
33896
33960
|
function hostingExternalSecretIndex(options) {
|
|
@@ -37559,6 +37623,22 @@ function platformCompanyMemberStore(options) {
|
|
|
37559
37623
|
}));
|
|
37560
37624
|
}
|
|
37561
37625
|
/**
|
|
37626
|
+
* {@link /platform/companies/:company/hosting/pool/allowance}
|
|
37627
|
+
*/
|
|
37628
|
+
function platformHostingPoolAllowance(options) {
|
|
37629
|
+
const { client: request = client, ...config } = options;
|
|
37630
|
+
return withUnwrap(request({
|
|
37631
|
+
method: "PUT",
|
|
37632
|
+
url: "/platform/companies/{company}/hosting/pool/allowance",
|
|
37633
|
+
security: [{
|
|
37634
|
+
type: "http",
|
|
37635
|
+
scheme: "bearer"
|
|
37636
|
+
}],
|
|
37637
|
+
...config,
|
|
37638
|
+
throwOnError: config.throwOnError ?? true
|
|
37639
|
+
}));
|
|
37640
|
+
}
|
|
37641
|
+
/**
|
|
37562
37642
|
* {@link /platform/hosting/environments/:environmentUuid/realm}
|
|
37563
37643
|
*/
|
|
37564
37644
|
function platformHostingRealmStore(options) {
|
|
@@ -37874,6 +37954,118 @@ function platformSentEmailShow(options) {
|
|
|
37874
37954
|
}));
|
|
37875
37955
|
}
|
|
37876
37956
|
/**
|
|
37957
|
+
* {@link /platform/hosting/storage/classes}
|
|
37958
|
+
*/
|
|
37959
|
+
function platformStorageClassIndex(options = {}) {
|
|
37960
|
+
const { client: request = client, ...config } = options;
|
|
37961
|
+
return withUnwrap(request({
|
|
37962
|
+
method: "GET",
|
|
37963
|
+
url: "/platform/hosting/storage/classes",
|
|
37964
|
+
security: [{
|
|
37965
|
+
type: "http",
|
|
37966
|
+
scheme: "bearer"
|
|
37967
|
+
}],
|
|
37968
|
+
...config,
|
|
37969
|
+
throwOnError: config.throwOnError ?? true
|
|
37970
|
+
}));
|
|
37971
|
+
}
|
|
37972
|
+
/**
|
|
37973
|
+
* {@link /platform/hosting/storage/classes}
|
|
37974
|
+
*/
|
|
37975
|
+
function platformStorageClassStore(options) {
|
|
37976
|
+
const { client: request = client, ...config } = options;
|
|
37977
|
+
return withUnwrap(request({
|
|
37978
|
+
method: "POST",
|
|
37979
|
+
url: "/platform/hosting/storage/classes",
|
|
37980
|
+
security: [{
|
|
37981
|
+
type: "http",
|
|
37982
|
+
scheme: "bearer"
|
|
37983
|
+
}],
|
|
37984
|
+
...config,
|
|
37985
|
+
throwOnError: config.throwOnError ?? true
|
|
37986
|
+
}));
|
|
37987
|
+
}
|
|
37988
|
+
/**
|
|
37989
|
+
* {@link /platform/hosting/storage/classes/:storageClassUuid/observation}
|
|
37990
|
+
*/
|
|
37991
|
+
function platformStorageClassObservation(options) {
|
|
37992
|
+
const { client: request = client, ...config } = options;
|
|
37993
|
+
return withUnwrap(request({
|
|
37994
|
+
method: "GET",
|
|
37995
|
+
url: "/platform/hosting/storage/classes/{storageClassUuid}/observation",
|
|
37996
|
+
security: [{
|
|
37997
|
+
type: "http",
|
|
37998
|
+
scheme: "bearer"
|
|
37999
|
+
}],
|
|
38000
|
+
...config,
|
|
38001
|
+
throwOnError: config.throwOnError ?? true
|
|
38002
|
+
}));
|
|
38003
|
+
}
|
|
38004
|
+
/**
|
|
38005
|
+
* {@link /platform/hosting/storage/classes/:storageClassUuid}
|
|
38006
|
+
*/
|
|
38007
|
+
function platformStorageClassUpdate(options) {
|
|
38008
|
+
const { client: request = client, ...config } = options;
|
|
38009
|
+
return withUnwrap(request({
|
|
38010
|
+
method: "PATCH",
|
|
38011
|
+
url: "/platform/hosting/storage/classes/{storageClassUuid}",
|
|
38012
|
+
security: [{
|
|
38013
|
+
type: "http",
|
|
38014
|
+
scheme: "bearer"
|
|
38015
|
+
}],
|
|
38016
|
+
...config,
|
|
38017
|
+
throwOnError: config.throwOnError ?? true
|
|
38018
|
+
}));
|
|
38019
|
+
}
|
|
38020
|
+
/**
|
|
38021
|
+
* {@link /platform/hosting/storage/classes/:storageClassUuid/enabled}
|
|
38022
|
+
*/
|
|
38023
|
+
function platformStorageClassSetEnabled(options) {
|
|
38024
|
+
const { client: request = client, ...config } = options;
|
|
38025
|
+
return withUnwrap(request({
|
|
38026
|
+
method: "PATCH",
|
|
38027
|
+
url: "/platform/hosting/storage/classes/{storageClassUuid}/enabled",
|
|
38028
|
+
security: [{
|
|
38029
|
+
type: "http",
|
|
38030
|
+
scheme: "bearer"
|
|
38031
|
+
}],
|
|
38032
|
+
...config,
|
|
38033
|
+
throwOnError: config.throwOnError ?? true
|
|
38034
|
+
}));
|
|
38035
|
+
}
|
|
38036
|
+
/**
|
|
38037
|
+
* {@link /platform/hosting/storage/classes/:storageClassUuid/volume-types}
|
|
38038
|
+
*/
|
|
38039
|
+
function platformStorageClassUpdateVolumeTypes(options) {
|
|
38040
|
+
const { client: request = client, ...config } = options;
|
|
38041
|
+
return withUnwrap(request({
|
|
38042
|
+
method: "PUT",
|
|
38043
|
+
url: "/platform/hosting/storage/classes/{storageClassUuid}/volume-types",
|
|
38044
|
+
security: [{
|
|
38045
|
+
type: "http",
|
|
38046
|
+
scheme: "bearer"
|
|
38047
|
+
}],
|
|
38048
|
+
...config,
|
|
38049
|
+
throwOnError: config.throwOnError ?? true
|
|
38050
|
+
}));
|
|
38051
|
+
}
|
|
38052
|
+
/**
|
|
38053
|
+
* {@link /platform/hosting/storage/clusters/:clusterUuid/default}
|
|
38054
|
+
*/
|
|
38055
|
+
function platformStorageClassSetDefault(options) {
|
|
38056
|
+
const { client: request = client, ...config } = options;
|
|
38057
|
+
return withUnwrap(request({
|
|
38058
|
+
method: "PUT",
|
|
38059
|
+
url: "/platform/hosting/storage/clusters/{clusterUuid}/default",
|
|
38060
|
+
security: [{
|
|
38061
|
+
type: "http",
|
|
38062
|
+
scheme: "bearer"
|
|
38063
|
+
}],
|
|
38064
|
+
...config,
|
|
38065
|
+
throwOnError: config.throwOnError ?? true
|
|
38066
|
+
}));
|
|
38067
|
+
}
|
|
38068
|
+
/**
|
|
37877
38069
|
* {@link /platform/hosting/orphans}
|
|
37878
38070
|
*/
|
|
37879
38071
|
function platformHostingOrphans(options = {}) {
|
|
@@ -38382,12 +38574,12 @@ function usageFor(scope) {
|
|
|
38382
38574
|
/** `sent-email` and `sent-email-show`, answered by the one scope endpoint that owns them. */
|
|
38383
38575
|
async function sentEmail(context, scope, group, args) {
|
|
38384
38576
|
if (group === "sent-email") return await index$1(context, scope, args);
|
|
38385
|
-
if (group === "sent-email-show") return await one$
|
|
38577
|
+
if (group === "sent-email-show") return await one$3(scope, args);
|
|
38386
38578
|
throw new UsageError(usageFor(scope));
|
|
38387
38579
|
}
|
|
38388
38580
|
/** `sent-email`: every page the API reports for the filters named. */
|
|
38389
38581
|
async function index$1(context, scope, args) {
|
|
38390
|
-
noExtra$
|
|
38582
|
+
noExtra$23(args, usageFor(scope));
|
|
38391
38583
|
const query = filters(context);
|
|
38392
38584
|
let retentionDays = 0;
|
|
38393
38585
|
const { items, meta } = await allPages(async (page, perPage) => {
|
|
@@ -38422,7 +38614,7 @@ async function index$1(context, scope, args) {
|
|
|
38422
38614
|
};
|
|
38423
38615
|
}
|
|
38424
38616
|
/** `sent-email-show <uuid>`: the stored wording of one email. */
|
|
38425
|
-
async function one$
|
|
38617
|
+
async function one$3(scope, args) {
|
|
38426
38618
|
const uuid = oneUuid$7(args, usageFor(scope));
|
|
38427
38619
|
return {
|
|
38428
38620
|
kind: "sent-email",
|
|
@@ -38464,7 +38656,7 @@ function companyFilter(context) {
|
|
|
38464
38656
|
return company === "" ? void 0 : company;
|
|
38465
38657
|
}
|
|
38466
38658
|
/** No positional arguments, or a usage refusal. */
|
|
38467
|
-
function noExtra$
|
|
38659
|
+
function noExtra$23(args, usage) {
|
|
38468
38660
|
if (args.length > 0) throw new UsageError(usage);
|
|
38469
38661
|
}
|
|
38470
38662
|
/**
|
|
@@ -38672,7 +38864,7 @@ var USAGE$58 = [
|
|
|
38672
38864
|
var MAX_PASSWORD_BYTES = 1024;
|
|
38673
38865
|
var MAX_TOKEN_BYTES = 4096;
|
|
38674
38866
|
/** One required flag's value, or a refusal naming the flag. */
|
|
38675
|
-
function required$
|
|
38867
|
+
function required$8(context, flag) {
|
|
38676
38868
|
const value = context.flags.get(flag)?.trim() ?? "";
|
|
38677
38869
|
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$58}`);
|
|
38678
38870
|
return value;
|
|
@@ -38734,8 +38926,8 @@ async function password$1(context) {
|
|
|
38734
38926
|
}
|
|
38735
38927
|
/** `auth register`: a new account, which needs no session. */
|
|
38736
38928
|
async function register$1(context) {
|
|
38737
|
-
const name = required$
|
|
38738
|
-
const email = required$
|
|
38929
|
+
const name = required$8(context, "--name");
|
|
38930
|
+
const email = required$8(context, "--email");
|
|
38739
38931
|
return await confirmableWrite(context, `Create the account ${email} for ${name}.`, async () => {
|
|
38740
38932
|
return (await authRegister({ body: {
|
|
38741
38933
|
name,
|
|
@@ -38746,14 +38938,14 @@ async function register$1(context) {
|
|
|
38746
38938
|
}
|
|
38747
38939
|
/** `auth forgot-password`: the API answers the same way for any address, so the output claims nothing more. */
|
|
38748
38940
|
async function forgotPassword(context) {
|
|
38749
|
-
const email = required$
|
|
38941
|
+
const email = required$8(context, "--email");
|
|
38750
38942
|
return await confirmableWrite(context, `Ask for a password reset mail for ${email}.`, async () => {
|
|
38751
38943
|
return (await authForgotPassword({ body: { email } })).data;
|
|
38752
38944
|
});
|
|
38753
38945
|
}
|
|
38754
38946
|
/** `auth reset-password`: the token from the mail, the address it was sent to, and the new password. */
|
|
38755
38947
|
async function resetPassword(context) {
|
|
38756
|
-
const email = required$
|
|
38948
|
+
const email = required$8(context, "--email");
|
|
38757
38949
|
return await confirmableWrite(context, `Reset the password for ${email}.`, async () => {
|
|
38758
38950
|
const token = readSecret(context, "token", MAX_TOKEN_BYTES, USAGE$58);
|
|
38759
38951
|
const password = readSecret(context, "password", MAX_PASSWORD_BYTES, USAGE$58);
|
|
@@ -40204,12 +40396,12 @@ async function written$9(pending) {
|
|
|
40204
40396
|
};
|
|
40205
40397
|
}
|
|
40206
40398
|
/** A company-wide read takes no positionals. */
|
|
40207
|
-
function noExtra$
|
|
40399
|
+
function noExtra$22(rest) {
|
|
40208
40400
|
if (rest.length > 0) throw new UsageError(USAGE$52);
|
|
40209
40401
|
}
|
|
40210
40402
|
/** `settings`. */
|
|
40211
40403
|
async function settings$1(path, rest) {
|
|
40212
|
-
noExtra$
|
|
40404
|
+
noExtra$22(rest);
|
|
40213
40405
|
return {
|
|
40214
40406
|
kind: "settings",
|
|
40215
40407
|
access: (await hostingAccessShow({ path })).data
|
|
@@ -40217,7 +40409,7 @@ async function settings$1(path, rest) {
|
|
|
40217
40409
|
}
|
|
40218
40410
|
/** `settings-set --password … --sftp-only …`. */
|
|
40219
40411
|
async function settingsSet(context, path, rest) {
|
|
40220
|
-
noExtra$
|
|
40412
|
+
noExtra$22(rest);
|
|
40221
40413
|
const passwordEnabled = onOff$5(context, "--password", USAGE$52);
|
|
40222
40414
|
const sftpOnly = onOff$5(context, "--sftp-only", USAGE$52);
|
|
40223
40415
|
return await confirmableWrite(context, [`Set password sign-in ${passwordEnabled ? "on" : "off"} and SFTP-only ${sftpOnly ? "on" : "off"}.`, " Logins keep their keys either way; this changes how a login may authenticate."].join("\\n"), async () => {
|
|
@@ -40233,7 +40425,7 @@ async function settingsSet(context, path, rest) {
|
|
|
40233
40425
|
}
|
|
40234
40426
|
/** `grants`. */
|
|
40235
40427
|
async function grants(path, rest) {
|
|
40236
|
-
noExtra$
|
|
40428
|
+
noExtra$22(rest);
|
|
40237
40429
|
return {
|
|
40238
40430
|
kind: "grants",
|
|
40239
40431
|
grants: (await hostingAccessGrantIndex({ path })).data.items
|
|
@@ -40241,7 +40433,7 @@ async function grants(path, rest) {
|
|
|
40241
40433
|
}
|
|
40242
40434
|
/** `grant --user … --access-user …`. */
|
|
40243
40435
|
async function grant$1(context, path, rest) {
|
|
40244
|
-
noExtra$
|
|
40436
|
+
noExtra$22(rest);
|
|
40245
40437
|
const userUuid = context.flags.get("--user") ?? "";
|
|
40246
40438
|
const accessUserUuid = context.flags.get("--access-user") ?? "";
|
|
40247
40439
|
if (userUuid === "" || accessUserUuid === "") throw new UsageError(`grant needs --user and --access-user.\\n\\n${USAGE$52}`);
|
|
@@ -41340,7 +41532,7 @@ var USAGE$50 = [
|
|
|
41340
41532
|
/** `application administrator*|recovery-*`, from the `application` command. */
|
|
41341
41533
|
async function applicationAdmin(context, action, path, rest) {
|
|
41342
41534
|
if (action === "administrator") {
|
|
41343
|
-
noExtra$
|
|
41535
|
+
noExtra$21(rest);
|
|
41344
41536
|
return {
|
|
41345
41537
|
kind: "administrator",
|
|
41346
41538
|
administrator: (await hostingAdministratorShow({ path })).data
|
|
@@ -41366,7 +41558,7 @@ async function applicationAdmin(context, action, path, rest) {
|
|
|
41366
41558
|
}
|
|
41367
41559
|
/** `administrator-reset|reveal`: the one place the application's own password is printed. */
|
|
41368
41560
|
async function credential(context, path, rest, kind) {
|
|
41369
|
-
noExtra$
|
|
41561
|
+
noExtra$21(rest);
|
|
41370
41562
|
return await written$8(confirmableWrite(context, kind === "reset" ? ["Set a new administrator password and return it once.", " A password changed inside the application is not this one; this credential is the platform's."].join("\n") : "Return the current administrator password once, recorded as its own audited action.", async () => {
|
|
41371
41563
|
return kind === "reset" ? (await hostingAdministratorReset({
|
|
41372
41564
|
path,
|
|
@@ -41382,7 +41574,7 @@ async function written$8(pending) {
|
|
|
41382
41574
|
};
|
|
41383
41575
|
}
|
|
41384
41576
|
/** No positional arguments, or a usage refusal. */
|
|
41385
|
-
function noExtra$
|
|
41577
|
+
function noExtra$21(rest) {
|
|
41386
41578
|
if (rest.length > 0) throw new UsageError(USAGE$50);
|
|
41387
41579
|
}
|
|
41388
41580
|
/** One recovery as one line: what it is doing, how far, and what it holds. */
|
|
@@ -41426,6 +41618,7 @@ var APPLICATION_USAGE = [
|
|
|
41426
41618
|
" hostingctl application show <environment-uuid> <workload-uuid> --company <slug>",
|
|
41427
41619
|
" hostingctl application public-key <environment-uuid> <workload-uuid> --company <slug>",
|
|
41428
41620
|
" hostingctl application speed-check <environment-uuid> <workload-uuid> --company <slug>",
|
|
41621
|
+
" hostingctl application capacity <environment-uuid> <workload-uuid> --company <slug>",
|
|
41429
41622
|
" hostingctl application deployment <environment-uuid> <workload-uuid> --company <slug>",
|
|
41430
41623
|
" hostingctl application build <environment-uuid> <workload-uuid> --company <slug> [--source <selection-uuid> | --source-upload <upload-uuid> | --ssh-source <connection-uuid>] [--idempotency-key <key>]",
|
|
41431
41624
|
" hostingctl application source-upload <environment-uuid> <workload-uuid> --company <slug> --file <path-to.zip>",
|
|
@@ -41457,6 +41650,7 @@ var APPLICATION_USAGE = [
|
|
|
41457
41650
|
" list|show The applications in an environment, and one in detail.",
|
|
41458
41651
|
" public-key Read the component's publishable anonymous key (never its service/signing secrets).",
|
|
41459
41652
|
" speed-check Three bounded HEAD timing, TLS and cache-header checks; not a browser audit.",
|
|
41653
|
+
" capacity The red-line rung one application sits on, why, and the platform's next step.",
|
|
41460
41654
|
" deployment The running, requested and interrupted builds and releases of one application.",
|
|
41461
41655
|
" build Queue a build of the application's applied configuration from one source choice.",
|
|
41462
41656
|
" source-upload Stage a ZIP of the project, review what it measured, then build from it.",
|
|
@@ -41503,7 +41697,7 @@ var USAGE$49 = [
|
|
|
41503
41697
|
async function applicationBuilds(context, action, path, rest) {
|
|
41504
41698
|
if (action === "build") return await build$1(context, path, rest);
|
|
41505
41699
|
if (action === "source-unbind") {
|
|
41506
|
-
noExtra$
|
|
41700
|
+
noExtra$20(rest);
|
|
41507
41701
|
return await written$7(confirmableWrite(context, "Stop deploying this application from a repository. The running release stays.", async () => (await hostingDeploymentUnbindSource({ path })).data));
|
|
41508
41702
|
}
|
|
41509
41703
|
if (action === "source-bind") return await bind$2(context, path, rest);
|
|
@@ -41532,7 +41726,7 @@ async function applicationBuilds(context, action, path, rest) {
|
|
|
41532
41726
|
* meant ambiguous rather than merely surprising.
|
|
41533
41727
|
*/
|
|
41534
41728
|
async function bind$2(context, path, rest) {
|
|
41535
|
-
noExtra$
|
|
41729
|
+
noExtra$20(rest);
|
|
41536
41730
|
const repositorySelectionUuid = context.flags.get("--selection")?.trim() ?? "";
|
|
41537
41731
|
const sshSourceUuid = context.flags.get("--ssh-source")?.trim() ?? "";
|
|
41538
41732
|
if (repositorySelectionUuid === "" === (sshSourceUuid === "")) throw new UsageError(`source-bind needs exactly one of --selection or --ssh-source.\n\n${USAGE$49}`);
|
|
@@ -41571,7 +41765,7 @@ async function written$7(pending) {
|
|
|
41571
41765
|
};
|
|
41572
41766
|
}
|
|
41573
41767
|
/** No positional arguments, or a usage refusal. */
|
|
41574
|
-
function noExtra$
|
|
41768
|
+
function noExtra$20(rest) {
|
|
41575
41769
|
if (rest.length > 0) throw new UsageError(USAGE$49);
|
|
41576
41770
|
}
|
|
41577
41771
|
/**
|
|
@@ -41661,7 +41855,7 @@ var USAGE$48 = [
|
|
|
41661
41855
|
].join("\n");
|
|
41662
41856
|
/** `application cache*`, from the `application` command. */
|
|
41663
41857
|
async function applicationCache(context, action, path, rest) {
|
|
41664
|
-
noExtra$
|
|
41858
|
+
noExtra$19(rest);
|
|
41665
41859
|
if (action === "cache") return {
|
|
41666
41860
|
kind: "cache",
|
|
41667
41861
|
cache: (await hostingApplicationCacheShow({ path })).data
|
|
@@ -41695,7 +41889,7 @@ async function applicationCache(context, action, path, rest) {
|
|
|
41695
41889
|
/** `application routes|route-add|route-remove`, which are environment-scoped. */
|
|
41696
41890
|
async function applicationRoutes(context, action, path, rest) {
|
|
41697
41891
|
if (action === "routes") {
|
|
41698
|
-
noExtra$
|
|
41892
|
+
noExtra$19(rest);
|
|
41699
41893
|
return {
|
|
41700
41894
|
kind: "routes",
|
|
41701
41895
|
page: (await hostingApplicationRouteIndex({ path })).data
|
|
@@ -41720,7 +41914,7 @@ async function applicationRoutes(context, action, path, rest) {
|
|
|
41720
41914
|
}
|
|
41721
41915
|
/** `route-add --source … --target … --path …`. */
|
|
41722
41916
|
async function addRoute(context, path, rest) {
|
|
41723
|
-
noExtra$
|
|
41917
|
+
noExtra$19(rest);
|
|
41724
41918
|
const sourceWorkloadUuid = context.flags.get("--source") ?? "";
|
|
41725
41919
|
const targetWorkloadUuid = context.flags.get("--target") ?? "";
|
|
41726
41920
|
const routePath = context.flags.get("--path") ?? "";
|
|
@@ -41775,7 +41969,7 @@ async function written$6(pending) {
|
|
|
41775
41969
|
};
|
|
41776
41970
|
}
|
|
41777
41971
|
/** No positional arguments, or a usage refusal. */
|
|
41778
|
-
function noExtra$
|
|
41972
|
+
function noExtra$19(rest) {
|
|
41779
41973
|
if (rest.length > 0) throw new UsageError(USAGE$48);
|
|
41780
41974
|
}
|
|
41781
41975
|
/** The `application cache*|routes|route-*` renderer. */
|
|
@@ -41971,10 +42165,10 @@ async function applicationCreate(context, path, rest) {
|
|
|
41971
42165
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
41972
42166
|
if (name === "") throw new UsageError(`create needs --name.\n\n${USAGE$47}`);
|
|
41973
42167
|
const resources = {
|
|
41974
|
-
cpuRequestMillicores: required$
|
|
41975
|
-
cpuLimitMillicores: required$
|
|
41976
|
-
memoryRequestMib: required$
|
|
41977
|
-
memoryLimitMib: required$
|
|
42168
|
+
cpuRequestMillicores: required$7(context, "--cpu-request"),
|
|
42169
|
+
cpuLimitMillicores: required$7(context, "--cpu-limit"),
|
|
42170
|
+
memoryRequestMib: required$7(context, "--memory-request"),
|
|
42171
|
+
memoryLimitMib: required$7(context, "--memory-limit")
|
|
41978
42172
|
};
|
|
41979
42173
|
if (resources.cpuRequestMillicores > resources.cpuLimitMillicores) throw new UsageError("--cpu-request cannot exceed --cpu-limit.");
|
|
41980
42174
|
if (resources.memoryRequestMib > resources.memoryLimitMib) throw new UsageError("--memory-request cannot exceed --memory-limit.");
|
|
@@ -42003,7 +42197,7 @@ async function applicationCreate(context, path, rest) {
|
|
|
42003
42197
|
};
|
|
42004
42198
|
}
|
|
42005
42199
|
/** One required whole-number flag, or a usage refusal naming the flag. */
|
|
42006
|
-
function required$
|
|
42200
|
+
function required$7(context, flag) {
|
|
42007
42201
|
const value = wholeNumberFlag(context.flags, flag);
|
|
42008
42202
|
if (value === null) throw new UsageError(`create needs ${flag}.\n\n${USAGE$47}`);
|
|
42009
42203
|
return value;
|
|
@@ -42272,6 +42466,43 @@ function recoveryLines(one) {
|
|
|
42272
42466
|
].join("\n");
|
|
42273
42467
|
}
|
|
42274
42468
|
//#endregion
|
|
42469
|
+
//#region src/commands/application-capacity.ts
|
|
42470
|
+
var CAPACITY_USAGE = [
|
|
42471
|
+
"Usage: hostingctl application capacity <environment-uuid> <application-uuid> --company <slug> [--json]",
|
|
42472
|
+
"",
|
|
42473
|
+
"The rung one application sits on in the platform's red-line ladder, read from the application's own share",
|
|
42474
|
+
"of the capacity its environment shares: the reason it was placed there and the platform's next step.",
|
|
42475
|
+
"It names no neighbour and changes nothing, so no --confirm is needed."
|
|
42476
|
+
].join("\n");
|
|
42477
|
+
/** Each rung as the short title the heading carries, so an operator reads a verdict rather than a key. */
|
|
42478
|
+
var RUNG_TITLES = {
|
|
42479
|
+
healthy: "within its limits",
|
|
42480
|
+
unmeasured: "not measured",
|
|
42481
|
+
warn: "approaching a limit",
|
|
42482
|
+
throttle: "being throttled",
|
|
42483
|
+
memory: "near its memory limit",
|
|
42484
|
+
oom: "stopped by its memory limit"
|
|
42485
|
+
};
|
|
42486
|
+
/** `capacity <env> <workload>`: one application's own red-line state. */
|
|
42487
|
+
async function applicationCapacity(path) {
|
|
42488
|
+
return (await hostingApplicationCapacityShow({ path })).data;
|
|
42489
|
+
}
|
|
42490
|
+
/**
|
|
42491
|
+
* The finding as the API stated it: the rung as a title, then the reason and the recommendation verbatim.
|
|
42492
|
+
*
|
|
42493
|
+
* A signal the platform could not read is named on its own line, because a rung that no measurement established
|
|
42494
|
+
* is not a clean bill of health and must not be read as one.
|
|
42495
|
+
*/
|
|
42496
|
+
function applicationCapacityText(finding) {
|
|
42497
|
+
const { decision, signals } = finding;
|
|
42498
|
+
return [
|
|
42499
|
+
`${signals.application}: ${RUNG_TITLES[decision.rung]}`,
|
|
42500
|
+
` reason ${decision.reason}`,
|
|
42501
|
+
` next step ${decision.recommendation}`,
|
|
42502
|
+
...signals.unmeasured.length === 0 ? [] : [` not measured ${signals.unmeasured.join(", ")}: this is not the same as healthy.`]
|
|
42503
|
+
].join("\n");
|
|
42504
|
+
}
|
|
42505
|
+
//#endregion
|
|
42275
42506
|
//#region src/commands/application-recovery.ts
|
|
42276
42507
|
var USAGE$44 = [
|
|
42277
42508
|
"Usage: hostingctl application recovery-review <environment-uuid> <application-uuid> --company <slug> [--import <uuid>]",
|
|
@@ -42414,15 +42645,15 @@ function siteAccessFlow(callbacks, usage) {
|
|
|
42414
42645
|
});
|
|
42415
42646
|
return async (context, action, path, rest) => {
|
|
42416
42647
|
if (action === "site-access") {
|
|
42417
|
-
noExtra$
|
|
42648
|
+
noExtra$18(rest, usage);
|
|
42418
42649
|
return {
|
|
42419
42650
|
kind: "site-access",
|
|
42420
42651
|
access: await callbacks.show(path)
|
|
42421
42652
|
};
|
|
42422
42653
|
}
|
|
42423
|
-
if (action === "site-access-set") return await set$
|
|
42654
|
+
if (action === "site-access-set") return await set$3(context, path, rest, callbacks, usage);
|
|
42424
42655
|
if (action === "site-access-rotate") {
|
|
42425
|
-
noExtra$
|
|
42656
|
+
noExtra$18(rest, usage);
|
|
42426
42657
|
if (callbacks.rotate === null) throw new UsageError("This scope has no sign-in edge of its own to rotate.");
|
|
42427
42658
|
return await written(confirmableWrite(context, "Rotate the sign-in edge's credentials. The edge rolls, so a session may re-authenticate.", async () => await callbacks.rotate?.(path)));
|
|
42428
42659
|
}
|
|
@@ -42432,8 +42663,8 @@ function siteAccessFlow(callbacks, usage) {
|
|
|
42432
42663
|
};
|
|
42433
42664
|
}
|
|
42434
42665
|
/** `site-access-set --sign-in … [--audience …]`. */
|
|
42435
|
-
async function set$
|
|
42436
|
-
noExtra$
|
|
42666
|
+
async function set$3(context, path, rest, callbacks, usage) {
|
|
42667
|
+
noExtra$18(rest, usage);
|
|
42437
42668
|
const requiredSignIn = onOffFlag(context, "--sign-in");
|
|
42438
42669
|
if (requiredSignIn === null) throw new UsageError(`site-access-set needs --sign-in.\n\n${usage}`);
|
|
42439
42670
|
const current = await callbacks.show(path);
|
|
@@ -42445,7 +42676,7 @@ async function set$2(context, path, rest, callbacks, usage) {
|
|
|
42445
42676
|
}
|
|
42446
42677
|
/** `site-users`: every invited identity, across every page. */
|
|
42447
42678
|
async function users$1(path, rest, callbacks, usage) {
|
|
42448
|
-
noExtra$
|
|
42679
|
+
noExtra$18(rest, usage);
|
|
42449
42680
|
const items = [];
|
|
42450
42681
|
for (let page = 1; page <= 100; page += 1) {
|
|
42451
42682
|
const answer = await callbacks.usersIndex(path, page, 100);
|
|
@@ -42461,7 +42692,7 @@ async function users$1(path, rest, callbacks, usage) {
|
|
|
42461
42692
|
async function user(context, path, rest, callbacks, usage, written) {
|
|
42462
42693
|
const [action, ...args] = rest;
|
|
42463
42694
|
if (action === "invite") {
|
|
42464
|
-
noExtra$
|
|
42695
|
+
noExtra$18(args, usage);
|
|
42465
42696
|
const email = context.flags.get("--email")?.trim().toLowerCase() ?? "";
|
|
42466
42697
|
if (email === "") throw new UsageError(`site-user invite needs --email.\n\n${usage}`);
|
|
42467
42698
|
return await written(confirmableWrite(context, `Invite ${email} to sign in.`, async () => await callbacks.usersStore(path, email)));
|
|
@@ -42478,7 +42709,7 @@ async function user(context, path, rest, callbacks, usage, written) {
|
|
|
42478
42709
|
throw new UsageError(usage);
|
|
42479
42710
|
}
|
|
42480
42711
|
/** No positional arguments, or a usage refusal. */
|
|
42481
|
-
function noExtra$
|
|
42712
|
+
function noExtra$18(rest, usage) {
|
|
42482
42713
|
if (rest.length > 0) throw new UsageError(usage);
|
|
42483
42714
|
}
|
|
42484
42715
|
/** One invitation as one line. */
|
|
@@ -42601,7 +42832,7 @@ var SSH_SOURCE_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
42601
42832
|
/** `application source-ssh-*`, which is company-scoped and names no application. */
|
|
42602
42833
|
async function applicationSshSources(context, action, company, rest) {
|
|
42603
42834
|
if (action === "source-ssh-list") {
|
|
42604
|
-
noExtra$
|
|
42835
|
+
noExtra$17(rest);
|
|
42605
42836
|
return {
|
|
42606
42837
|
kind: "ssh-sources",
|
|
42607
42838
|
connections: (await hostingSshSourcesIndex({ path: { company } })).data
|
|
@@ -42635,10 +42866,10 @@ async function applicationSshSources(context, action, company, rest) {
|
|
|
42635
42866
|
}
|
|
42636
42867
|
/** `source-ssh-create --name … --repo … --ref … [--ref-kind …]`: one repository and the ref it reads. */
|
|
42637
42868
|
async function create$5(context, company, rest) {
|
|
42638
|
-
noExtra$
|
|
42639
|
-
const name = required$
|
|
42640
|
-
const repositoryUrl = required$
|
|
42641
|
-
const ref = required$
|
|
42869
|
+
noExtra$17(rest);
|
|
42870
|
+
const name = required$6(context, "--name");
|
|
42871
|
+
const repositoryUrl = required$6(context, "--repo");
|
|
42872
|
+
const ref = required$6(context, "--ref");
|
|
42642
42873
|
const refKind = refKindFlag(context) ?? "branch";
|
|
42643
42874
|
return await written$4(confirmableWrite(context, [
|
|
42644
42875
|
`Add the SSH source "${name}" for ${repositoryUrl} at ${refKind} ${ref}.`,
|
|
@@ -42680,7 +42911,7 @@ async function update$4(context, path) {
|
|
|
42680
42911
|
}
|
|
42681
42912
|
/** `source-ssh-confirm-host-key <connection> --fingerprint …`: the client's own out-of-band value. */
|
|
42682
42913
|
async function confirmHostKey(context, path) {
|
|
42683
|
-
const fingerprint = required$
|
|
42914
|
+
const fingerprint = required$6(context, "--fingerprint");
|
|
42684
42915
|
return await written$4(confirmableWrite(context, [
|
|
42685
42916
|
`Accept ${fingerprint} as the server host key of the SSH source ${path.connectionUuid}.`,
|
|
42686
42917
|
"The API compares it with the value it discovered; a fingerprint the platform supplied is refused, so this",
|
|
@@ -42691,7 +42922,7 @@ async function confirmHostKey(context, path) {
|
|
|
42691
42922
|
})).data));
|
|
42692
42923
|
}
|
|
42693
42924
|
/** A required flag's value, or a refusal naming the flag. */
|
|
42694
|
-
function required$
|
|
42925
|
+
function required$6(context, flag) {
|
|
42695
42926
|
const value = context.flags.get(flag)?.trim() ?? "";
|
|
42696
42927
|
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$42}`);
|
|
42697
42928
|
return value;
|
|
@@ -42716,7 +42947,7 @@ async function written$4(pending) {
|
|
|
42716
42947
|
};
|
|
42717
42948
|
}
|
|
42718
42949
|
/** No positional arguments, or a usage refusal. */
|
|
42719
|
-
function noExtra$
|
|
42950
|
+
function noExtra$17(rest) {
|
|
42720
42951
|
if (rest.length > 0) throw new UsageError(USAGE$42);
|
|
42721
42952
|
}
|
|
42722
42953
|
//#endregion
|
|
@@ -42753,7 +42984,7 @@ var SOURCE_UPLOAD_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
42753
42984
|
async function applicationSourceUploads(context, action, path, rest) {
|
|
42754
42985
|
if (action === "source-upload") return await store(context, path, rest);
|
|
42755
42986
|
if (action === "source-uploads") {
|
|
42756
|
-
noExtra$
|
|
42987
|
+
noExtra$16(rest);
|
|
42757
42988
|
return {
|
|
42758
42989
|
kind: "source-uploads",
|
|
42759
42990
|
uploads: listed$1((await hostingSourceUploadsIndex({ path })).data)
|
|
@@ -42782,7 +43013,7 @@ async function applicationSourceUploads(context, action, path, rest) {
|
|
|
42782
43013
|
* sending anything.
|
|
42783
43014
|
*/
|
|
42784
43015
|
async function store(context, path, rest) {
|
|
42785
|
-
noExtra$
|
|
43016
|
+
noExtra$16(rest);
|
|
42786
43017
|
const file = context.flags.get("--file")?.trim() ?? "";
|
|
42787
43018
|
if (file === "") throw new UsageError(`source-upload needs --file.\n\n${USAGE$41}`);
|
|
42788
43019
|
return await written$3(confirmableWrite(context, [
|
|
@@ -42823,7 +43054,7 @@ async function written$3(pending) {
|
|
|
42823
43054
|
};
|
|
42824
43055
|
}
|
|
42825
43056
|
/** No positional arguments, or a usage refusal. */
|
|
42826
|
-
function noExtra$
|
|
43057
|
+
function noExtra$16(rest) {
|
|
42827
43058
|
if (rest.length > 0) throw new UsageError(USAGE$41);
|
|
42828
43059
|
}
|
|
42829
43060
|
/** One staged upload: what the platform measured, what the review found, and when staging expires. */
|
|
@@ -43246,6 +43477,7 @@ var APPLICATION_METADATA = {
|
|
|
43246
43477
|
subcommands: [
|
|
43247
43478
|
"public-key",
|
|
43248
43479
|
"speed-check",
|
|
43480
|
+
"capacity",
|
|
43249
43481
|
"list",
|
|
43250
43482
|
"show",
|
|
43251
43483
|
"deployment",
|
|
@@ -43305,6 +43537,10 @@ var APPLICATION_TOPICS = [
|
|
|
43305
43537
|
path: ["speed-check"],
|
|
43306
43538
|
usage: SPEED_USAGE
|
|
43307
43539
|
},
|
|
43540
|
+
{
|
|
43541
|
+
path: ["capacity"],
|
|
43542
|
+
usage: CAPACITY_USAGE
|
|
43543
|
+
},
|
|
43308
43544
|
{
|
|
43309
43545
|
path: ["create"],
|
|
43310
43546
|
usage: USAGE$47
|
|
@@ -43500,6 +43736,7 @@ async function reads(context, action, path, extra) {
|
|
|
43500
43736
|
if (extra.length > 0) throw new UsageError(APPLICATION_USAGE);
|
|
43501
43737
|
if (action === "public-key") return (await hostingApplicationsPublicKey({ path })).data;
|
|
43502
43738
|
if (action === "speed-check") return (await hostingApplicationSpeedShow({ path })).data;
|
|
43739
|
+
if (action === "capacity") return await applicationCapacity(path);
|
|
43503
43740
|
if (action === "deployment") return (await hostingDeploymentShow({ path })).data;
|
|
43504
43741
|
if (action === "runs") return (await hostingProcessRunIndex({ path })).data;
|
|
43505
43742
|
if (action === "removal") return (await hostingApplicationShowRemoval({ path })).data;
|
|
@@ -43794,12 +44031,12 @@ function deploymentImageText(releases) {
|
|
|
43794
44031
|
* What preparing an image did, and what it has not done yet.
|
|
43795
44032
|
*
|
|
43796
44033
|
* Preparing records and verifies the import. Scanning is informational and does not delay readiness.
|
|
43797
|
-
* The receipt identifies the release to activate through the existing deployment operation.
|
|
43798
|
-
*
|
|
44034
|
+
* The receipt identifies the release to activate through the existing deployment operation. A deployment
|
|
44035
|
+
* receipt without a status still says it is preparing, rather than printing an empty column.
|
|
43799
44036
|
*/
|
|
43800
44037
|
function prepareImageText(result) {
|
|
43801
44038
|
if (typeof result === "string") return ` ${result}`;
|
|
43802
|
-
const status = result.status
|
|
44039
|
+
const status = result.status === null || result.status === "" ? "preparing" : result.status;
|
|
43803
44040
|
return [` release ${result.releaseUuid} ${status}`, " Import and verification continue in the background. Scanning does not delay readiness. Deploy the ready release; this command deploys nothing."].join("\n");
|
|
43804
44041
|
}
|
|
43805
44042
|
//#endregion
|
|
@@ -43893,6 +44130,7 @@ function sourceGroupText(report) {
|
|
|
43893
44130
|
function applicationText(report) {
|
|
43894
44131
|
if ("anonymousKey" in report) return report.anonymousKey;
|
|
43895
44132
|
if ("measurement" in report) return applicationSpeedText(report);
|
|
44133
|
+
if ("signals" in report) return applicationCapacityText(report);
|
|
43896
44134
|
if ("kind" in report) return sourceGroupText(report) ?? taggedText$1(report);
|
|
43897
44135
|
if ("sent" in report) return renderWriteOutcome(report, writeAnyResultText);
|
|
43898
44136
|
if ("applications" in report) return listText(report);
|
|
@@ -44178,7 +44416,7 @@ var backupDestination = {
|
|
|
44178
44416
|
const [subcommand, ...rest] = context.positional;
|
|
44179
44417
|
const action = subcommand ?? "show";
|
|
44180
44418
|
if (action === "show") return await show$7(context, rest);
|
|
44181
|
-
if (action === "set") return await set$
|
|
44419
|
+
if (action === "set") return await set$2(context, rest);
|
|
44182
44420
|
if (action === "remove") return await remove$3(context, rest);
|
|
44183
44421
|
throw new UsageError(BACKUP_DESTINATION_USAGE);
|
|
44184
44422
|
},
|
|
@@ -44190,15 +44428,15 @@ var backupDestination = {
|
|
|
44190
44428
|
};
|
|
44191
44429
|
/** `show`, which is also what a bare `backup-destination` does. */
|
|
44192
44430
|
async function show$7(context, rest) {
|
|
44193
|
-
noExtra$
|
|
44431
|
+
noExtra$15(rest);
|
|
44194
44432
|
return {
|
|
44195
44433
|
kind: "destination",
|
|
44196
44434
|
destination: (await hostingBackupDestinationShow({ path: { company: await requireCompany(context.flags) } })).data
|
|
44197
44435
|
};
|
|
44198
44436
|
}
|
|
44199
44437
|
/** `set --endpoint … --bucket … --region … --access-key-id … --secret-key-file|stdin … [--prefix …] [--arm]`. */
|
|
44200
|
-
async function set$
|
|
44201
|
-
noExtra$
|
|
44438
|
+
async function set$2(context, rest) {
|
|
44439
|
+
noExtra$15(rest);
|
|
44202
44440
|
const company = await requireCompany(context.flags);
|
|
44203
44441
|
const endpoint = requiredFlag$3(context, "--endpoint", BACKUP_DESTINATION_USAGE);
|
|
44204
44442
|
const bucket = requiredFlag$3(context, "--bucket", BACKUP_DESTINATION_USAGE);
|
|
@@ -44227,7 +44465,7 @@ async function set$1(context, rest) {
|
|
|
44227
44465
|
}
|
|
44228
44466
|
/** `remove`. */
|
|
44229
44467
|
async function remove$3(context, rest) {
|
|
44230
|
-
noExtra$
|
|
44468
|
+
noExtra$15(rest);
|
|
44231
44469
|
const company = await requireCompany(context.flags);
|
|
44232
44470
|
const outcome = await confirmableWrite(context, "Remove this company's own backup destination. Copies already written there stay in the bucket; our own copy and its retention are unaffected.", async () => (await hostingBackupDestinationDestroy({ path: { company } })).data);
|
|
44233
44471
|
return {
|
|
@@ -44236,7 +44474,7 @@ async function remove$3(context, rest) {
|
|
|
44236
44474
|
};
|
|
44237
44475
|
}
|
|
44238
44476
|
/** No positional arguments, or a usage refusal. */
|
|
44239
|
-
function noExtra$
|
|
44477
|
+
function noExtra$15(rest) {
|
|
44240
44478
|
if (rest.length > 0) throw new UsageError(BACKUP_DESTINATION_USAGE);
|
|
44241
44479
|
}
|
|
44242
44480
|
/** The destination as a few readable lines, saying plainly when there is none. */
|
|
@@ -46880,12 +47118,12 @@ async function companyAssets(context, asset, rest) {
|
|
|
46880
47118
|
const [action, ...tail] = rest;
|
|
46881
47119
|
if (tail.length > 0) throw new UsageError(USAGE$39);
|
|
46882
47120
|
const company = await requireCompany(context.flags);
|
|
46883
|
-
if (action === "set") return await set(context, asset, company);
|
|
47121
|
+
if (action === "set") return await set$1(context, asset, company);
|
|
46884
47122
|
if (action === "remove") return await remove$2(context, asset, company);
|
|
46885
47123
|
throw new UsageError(USAGE$39);
|
|
46886
47124
|
}
|
|
46887
47125
|
/** `set --image-file …`: one multipart upload of the asset. */
|
|
46888
|
-
async function set(context, asset, company) {
|
|
47126
|
+
async function set$1(context, asset, company) {
|
|
46889
47127
|
const file = context.flags.get("--image-file") ?? "";
|
|
46890
47128
|
return await confirmableWrite(context, file === "" ? `Set ${company}'s ${asset}.` : `Set ${company}'s ${asset} to ${file}.`, async () => {
|
|
46891
47129
|
const body = await imageUpload(file, USAGE$39);
|
|
@@ -49101,18 +49339,18 @@ async function emailDomains(context, subcommand, rest) {
|
|
|
49101
49339
|
throw new UsageError(USAGE$32);
|
|
49102
49340
|
}
|
|
49103
49341
|
/** A company-wide command takes no positionals. */
|
|
49104
|
-
function noExtra$
|
|
49342
|
+
function noExtra$14(rest) {
|
|
49105
49343
|
if (rest.length > 0) throw new UsageError(USAGE$32);
|
|
49106
49344
|
}
|
|
49107
49345
|
/** `enroll`: create the service record and start provisioning, which is the API's own create. */
|
|
49108
49346
|
async function enroll(context, rest) {
|
|
49109
|
-
noExtra$
|
|
49347
|
+
noExtra$14(rest);
|
|
49110
49348
|
const company = await requireCompany(context.flags);
|
|
49111
49349
|
return await confirmableWrite(context, "Create this company's mail service record and start provisioning.", async () => (await emailStore({ path: { company } })).data);
|
|
49112
49350
|
}
|
|
49113
49351
|
/** `agree --term …`: accept one package's recorded term. */
|
|
49114
49352
|
async function agree(context, rest) {
|
|
49115
|
-
noExtra$
|
|
49353
|
+
noExtra$14(rest);
|
|
49116
49354
|
const company = await requireCompany(context.flags);
|
|
49117
49355
|
const packageTermUuid = context.flags.get("--term") ?? "";
|
|
49118
49356
|
if (packageTermUuid === "") throw new UsageError(`agree needs --term.\n\n${USAGE$32}`);
|
|
@@ -49123,7 +49361,7 @@ async function agree(context, rest) {
|
|
|
49123
49361
|
}
|
|
49124
49362
|
/** `provision`: build the mail service the agreement bought. */
|
|
49125
49363
|
async function provision(context, rest) {
|
|
49126
|
-
noExtra$
|
|
49364
|
+
noExtra$14(rest);
|
|
49127
49365
|
const company = await requireCompany(context.flags);
|
|
49128
49366
|
return await confirmableWrite(context, "Provision the mail service this company's agreement bought.", async () => (await emailProvision({ path: { company } })).data);
|
|
49129
49367
|
}
|
|
@@ -49132,7 +49370,7 @@ async function domain(context, rest) {
|
|
|
49132
49370
|
const [action, ...tail] = rest;
|
|
49133
49371
|
const company = await requireCompany(context.flags);
|
|
49134
49372
|
if (action === "add") {
|
|
49135
|
-
noExtra$
|
|
49373
|
+
noExtra$14(tail);
|
|
49136
49374
|
const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
|
|
49137
49375
|
if (hostname === "") throw new UsageError(`domain add needs --hostname.\n\n${USAGE$32}`);
|
|
49138
49376
|
return await confirmableWrite(context, `Attach ${hostname} to ${company}'s mail service.`, async () => {
|
|
@@ -49326,7 +49564,7 @@ var QUOTAS = /* @__PURE__ */ new Set([
|
|
|
49326
49564
|
var STATUSES = /* @__PURE__ */ new Set(["enabled", "suspended"]);
|
|
49327
49565
|
/** `email mailbox add|change|remove|forward|preferences|preferences-set|credential|reset-credential`. */
|
|
49328
49566
|
async function emailMailboxAdmin(context, action, tail) {
|
|
49329
|
-
if (action === "add") return await add$
|
|
49567
|
+
if (action === "add") return await add$8(context, tail);
|
|
49330
49568
|
const [emailDomainUuid, mailboxUuid, ...extra] = tail;
|
|
49331
49569
|
if (emailDomainUuid === void 0 || mailboxUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$30);
|
|
49332
49570
|
const path = {
|
|
@@ -49360,7 +49598,7 @@ function destinations(context) {
|
|
|
49360
49598
|
return (context.flags.get("--destinations") ?? "").split(",").map((one) => one.trim().toLowerCase()).filter((one) => one !== "");
|
|
49361
49599
|
}
|
|
49362
49600
|
/** `add <domain> --local … --quota …`. */
|
|
49363
|
-
async function add$
|
|
49601
|
+
async function add$8(context, tail) {
|
|
49364
49602
|
const [emailDomainUuid, ...extra] = tail;
|
|
49365
49603
|
if (emailDomainUuid === void 0 || extra.length > 0) throw new UsageError(USAGE$30);
|
|
49366
49604
|
const company = await requireCompany(context.flags);
|
|
@@ -49504,7 +49742,7 @@ async function emailService(context, subcommand, rest) {
|
|
|
49504
49742
|
throw new UsageError(USAGE$29);
|
|
49505
49743
|
}
|
|
49506
49744
|
/** A company-wide command takes no positionals. */
|
|
49507
|
-
function noExtra$
|
|
49745
|
+
function noExtra$13(rest) {
|
|
49508
49746
|
if (rest.length > 0) throw new UsageError(USAGE$29);
|
|
49509
49747
|
}
|
|
49510
49748
|
/** `service suspend|resume|cancellation|cancel|cancel-withdraw`. */
|
|
@@ -49512,24 +49750,24 @@ async function service(context, rest) {
|
|
|
49512
49750
|
const [action, ...tail] = rest;
|
|
49513
49751
|
const company = await requireCompany(context.flags);
|
|
49514
49752
|
if (action === "cancellation") {
|
|
49515
|
-
noExtra$
|
|
49753
|
+
noExtra$13(tail);
|
|
49516
49754
|
return {
|
|
49517
49755
|
kind: "cancellation",
|
|
49518
49756
|
cancellation: (await emailCancellationShow({ path: { company } })).data
|
|
49519
49757
|
};
|
|
49520
49758
|
}
|
|
49521
49759
|
if (action === "suspend") {
|
|
49522
|
-
noExtra$
|
|
49760
|
+
noExtra$13(tail);
|
|
49523
49761
|
return await confirmableWrite(context, "Suspend delivery for the whole mail service. Mail is refused while suspended.", async () => (await emailSuspend({ path: { company } })).data);
|
|
49524
49762
|
}
|
|
49525
49763
|
if (action === "resume") {
|
|
49526
|
-
noExtra$
|
|
49764
|
+
noExtra$13(tail);
|
|
49527
49765
|
return await confirmableWrite(context, "Resume delivery for the mail service.", async () => {
|
|
49528
49766
|
return (await emailResume({ path: { company } })).data;
|
|
49529
49767
|
});
|
|
49530
49768
|
}
|
|
49531
49769
|
if (action === "cancel") {
|
|
49532
|
-
noExtra$
|
|
49770
|
+
noExtra$13(tail);
|
|
49533
49771
|
const endsAt = context.flags.get("--ends-at")?.trim() ?? "";
|
|
49534
49772
|
if (endsAt === "") throw new UsageError(`service cancel needs --ends-at.\n\n${USAGE$29}`);
|
|
49535
49773
|
if (Number.isNaN(Date.parse(endsAt))) throw new UsageError(`--ends-at must be an ISO date (got "${endsAt}").`);
|
|
@@ -49539,7 +49777,7 @@ async function service(context, rest) {
|
|
|
49539
49777
|
})).data);
|
|
49540
49778
|
}
|
|
49541
49779
|
if (action === "cancel-withdraw") {
|
|
49542
|
-
noExtra$
|
|
49780
|
+
noExtra$13(tail);
|
|
49543
49781
|
return await confirmableWrite(context, "Withdraw the pending cancellation.", async () => {
|
|
49544
49782
|
return (await emailCancellationWithdraw({ path: { company } })).data;
|
|
49545
49783
|
});
|
|
@@ -49548,7 +49786,7 @@ async function service(context, rest) {
|
|
|
49548
49786
|
}
|
|
49549
49787
|
/** `dmarc`: DMARC reporting for every attached name. */
|
|
49550
49788
|
async function dmarc$1(context, rest) {
|
|
49551
|
-
noExtra$
|
|
49789
|
+
noExtra$13(rest);
|
|
49552
49790
|
return {
|
|
49553
49791
|
kind: "dmarc",
|
|
49554
49792
|
domains: (await emailDmarcShow({ path: { company: await requireCompany(context.flags) } })).data.domains
|
|
@@ -49556,7 +49794,7 @@ async function dmarc$1(context, rest) {
|
|
|
49556
49794
|
}
|
|
49557
49795
|
/** `blocklist`: blocklist monitoring for every attached name. */
|
|
49558
49796
|
async function blocklist$1(context, rest) {
|
|
49559
|
-
noExtra$
|
|
49797
|
+
noExtra$13(rest);
|
|
49560
49798
|
return {
|
|
49561
49799
|
kind: "blocklist",
|
|
49562
49800
|
subjects: (await emailBlocklistMonitoringShow({ path: { company: await requireCompany(context.flags) } })).data.subjects.map((one) => ({ ...one }))
|
|
@@ -49594,7 +49832,7 @@ async function blocklistSet(context, rest) {
|
|
|
49594
49832
|
}
|
|
49595
49833
|
/** `import-schema --version …`: the schema document as the API publishes it. */
|
|
49596
49834
|
async function importSchema(context, rest) {
|
|
49597
|
-
noExtra$
|
|
49835
|
+
noExtra$13(rest);
|
|
49598
49836
|
const version = context.flags.get("--version")?.trim() ?? "";
|
|
49599
49837
|
if (version === "") throw new UsageError(`import-schema needs --version.\n\n${USAGE$29}`);
|
|
49600
49838
|
return {
|
|
@@ -49630,7 +49868,7 @@ var USAGE$28 = [
|
|
|
49630
49868
|
"Every write needs --confirm; --dry-run describes the change without reading the file or sending it."
|
|
49631
49869
|
].join("\n");
|
|
49632
49870
|
/** One named uuid, or a usage refusal. */
|
|
49633
|
-
function one$
|
|
49871
|
+
function one$2(rest) {
|
|
49634
49872
|
const [uuid, ...extra] = rest;
|
|
49635
49873
|
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$28);
|
|
49636
49874
|
return uuid;
|
|
@@ -49638,7 +49876,7 @@ function one$1(rest) {
|
|
|
49638
49876
|
/** `csv preview|commit <domain> --file <path>`: one multipart upload of the CSV itself. */
|
|
49639
49877
|
async function csv(context, tail) {
|
|
49640
49878
|
const [action, ...args] = tail;
|
|
49641
|
-
const path = await domainPath(context, one$
|
|
49879
|
+
const path = await domainPath(context, one$2(args));
|
|
49642
49880
|
const file = context.flags.get("--file") ?? "";
|
|
49643
49881
|
if (file === "") throw new UsageError(`sync csv needs --file <path>.\n\n${USAGE$28}`);
|
|
49644
49882
|
if (action === "preview") return {
|
|
@@ -49728,7 +49966,7 @@ async function emailSync(context, rest) {
|
|
|
49728
49966
|
throw new UsageError(USAGE$27);
|
|
49729
49967
|
}
|
|
49730
49968
|
/** One named uuid, or a usage refusal. */
|
|
49731
|
-
function one(rest) {
|
|
49969
|
+
function one$1(rest) {
|
|
49732
49970
|
const [uuid, ...extra] = rest;
|
|
49733
49971
|
if (uuid === void 0 || uuid === "" || extra.length > 0) throw new UsageError(USAGE$27);
|
|
49734
49972
|
return uuid;
|
|
@@ -49737,12 +49975,12 @@ function one(rest) {
|
|
|
49737
49975
|
async function show$4(context, tail) {
|
|
49738
49976
|
return {
|
|
49739
49977
|
kind: "overview",
|
|
49740
|
-
overview: (await emailMailboxSyncIndex({ path: await domainPath(context, one(tail)) })).data
|
|
49978
|
+
overview: (await emailMailboxSyncIndex({ path: await domainPath(context, one$1(tail)) })).data
|
|
49741
49979
|
};
|
|
49742
49980
|
}
|
|
49743
49981
|
/** `server --host … --port … --encryption …`. */
|
|
49744
49982
|
async function server(context, tail) {
|
|
49745
|
-
const path = await domainPath(context, one(tail));
|
|
49983
|
+
const path = await domainPath(context, one$1(tail));
|
|
49746
49984
|
const host = context.flags.get("--host")?.trim() ?? "";
|
|
49747
49985
|
const port = Number(context.flags.get("--port") ?? "");
|
|
49748
49986
|
const encryption = context.flags.get("--encryption")?.trim() ?? "";
|
|
@@ -49810,7 +50048,7 @@ async function startAccount(context, path) {
|
|
|
49810
50048
|
}
|
|
49811
50049
|
/** `account add <domain> --username … --password-* … --mailbox … --recurrence …`. */
|
|
49812
50050
|
async function accountAdd(context, args) {
|
|
49813
|
-
const path = await domainPath(context, one(args));
|
|
50051
|
+
const path = await domainPath(context, one$1(args));
|
|
49814
50052
|
const body = accountBody(context);
|
|
49815
50053
|
const sourcePassword = readSecret(context, "password", 4096, USAGE$27);
|
|
49816
50054
|
return await confirmableWrite(context, [`Add a sync account for ${body.sourceUsername} into mailbox ${body.mailboxUuid}.`, ` It runs ${body.recurrence === "once" ? "once" : `until ${String(body.endsAt)}`}.`].join("\n"), async () => (await emailMailboxSyncAccountsStore({
|
|
@@ -49894,7 +50132,7 @@ function serviceText$1(summary) {
|
|
|
49894
50132
|
}
|
|
49895
50133
|
/** Enrollment is optional on the summary, so an absent or unshaped value reads as not reported. */
|
|
49896
50134
|
function enrollmentLine(availability) {
|
|
49897
|
-
if (!("available" in availability) || typeof availability.available !== "boolean") return " Enrollment: not reported by the API.";
|
|
50135
|
+
if (availability === void 0 || !("available" in availability) || typeof availability.available !== "boolean") return " Enrollment: not reported by the API.";
|
|
49898
50136
|
const message = "message" in availability && typeof availability.message === "string" ? availability.message : "";
|
|
49899
50137
|
return ` Enrollment: ${availability.available ? "available" : "not available"}${message === "" ? "" : ` — ${message}`}`;
|
|
49900
50138
|
}
|
|
@@ -50347,12 +50585,12 @@ var email$2 = {
|
|
|
50347
50585
|
};
|
|
50348
50586
|
/** `show [--company]`: the service state, its entitlement and whether enrollment is available. */
|
|
50349
50587
|
async function show$3(company, rest) {
|
|
50350
|
-
noExtra$
|
|
50588
|
+
noExtra$12(rest);
|
|
50351
50589
|
return (await emailShow({ path: { company } })).data;
|
|
50352
50590
|
}
|
|
50353
50591
|
/** `names [--company]`: the attached names with the readiness the API observed for each. */
|
|
50354
50592
|
async function names(company, rest) {
|
|
50355
|
-
noExtra$
|
|
50593
|
+
noExtra$12(rest);
|
|
50356
50594
|
return (await emailShow({ path: { company } })).data.domains;
|
|
50357
50595
|
}
|
|
50358
50596
|
/** `mailboxes <email-domain-uuid>`: every mailbox on the name, across every reported page. */
|
|
@@ -50428,7 +50666,7 @@ function oneUuid$4(rest) {
|
|
|
50428
50666
|
return uuid;
|
|
50429
50667
|
}
|
|
50430
50668
|
/** A company-wide read takes no positional arguments. */
|
|
50431
|
-
function noExtra$
|
|
50669
|
+
function noExtra$12(rest) {
|
|
50432
50670
|
if (rest.length > 0) throw new UsageError(USAGE$26);
|
|
50433
50671
|
}
|
|
50434
50672
|
//#endregion
|
|
@@ -50638,11 +50876,106 @@ async function environmentComponentVersion(context, rest) {
|
|
|
50638
50876
|
})).data);
|
|
50639
50877
|
}
|
|
50640
50878
|
//#endregion
|
|
50879
|
+
//#region src/commands/environment-configuration-text.ts
|
|
50880
|
+
/**
|
|
50881
|
+
* The phrases the platform writes when the cluster itself answered that it cannot run an engine.
|
|
50882
|
+
*
|
|
50883
|
+
* Every verdict sentence it writes says the engine "cannot run" here, and names the missing
|
|
50884
|
+
* operator. A reason carrying neither is a check that did not complete, which is the safe
|
|
50885
|
+
* direction: a failed check is never presented as the cluster's verdict.
|
|
50886
|
+
*/
|
|
50887
|
+
var CLUSTER_VERDICT = ["cannot run", "operator is missing"];
|
|
50888
|
+
function engineCapabilityState(engine) {
|
|
50889
|
+
if (engine.supported) return "ready";
|
|
50890
|
+
if (engine.unavailableReason === null) return "failed";
|
|
50891
|
+
return CLUSTER_VERDICT.some((phrase) => engine.unavailableReason?.includes(phrase)) ? "unsupported" : "failed";
|
|
50892
|
+
}
|
|
50893
|
+
/**
|
|
50894
|
+
* Every engine this environment can declare, with the state the cluster's answer gives it.
|
|
50895
|
+
*
|
|
50896
|
+
* The catalog and the cluster are two answers and both are read: an engine the catalog offers and the answer
|
|
50897
|
+
* never mentions is pending, and one the answer reports is its own state. Nothing is printed when the payload
|
|
50898
|
+
* carries no engine capability at all — an API that does not answer the field was not asked, which is not the
|
|
50899
|
+
* same claim as "everything is supported".
|
|
50900
|
+
*/
|
|
50901
|
+
function engineCapabilityLines(offered, engines) {
|
|
50902
|
+
const reported = new Map(engines.map((engine) => [engine.slug, engine]));
|
|
50903
|
+
return [.../* @__PURE__ */ new Set([...offered, ...reported.keys()])].map((slug, index) => {
|
|
50904
|
+
const engine = reported.get(slug);
|
|
50905
|
+
const state = engine === void 0 ? "pending" : engineCapabilityState(engine);
|
|
50906
|
+
const reason = engine?.unavailableReason;
|
|
50907
|
+
const detail = state === "pending" ? " (the catalog offers it; this cluster was not asked)" : state === "ready" || reason == null ? "" : `: ${reason}`;
|
|
50908
|
+
return `${index === 0 ? " engines " : " "}${slug} ${state}${detail}`;
|
|
50909
|
+
});
|
|
50910
|
+
}
|
|
50911
|
+
/**
|
|
50912
|
+
* The `configuration` group's human rendering. A read names the revision and its declared secrets; a review
|
|
50913
|
+
* names its verdict. A write's page answer renders through `configurationPageText` too, so a `secret` write
|
|
50914
|
+
* and a `configuration save` show the same page rather than inventing two readings of one payload.
|
|
50915
|
+
*/
|
|
50916
|
+
function configurationPageText(page) {
|
|
50917
|
+
const lines = [
|
|
50918
|
+
`generation ${String(page.desiredGeneration)}`,
|
|
50919
|
+
` canManage ${page.canManage ? "yes" : "no"}`,
|
|
50920
|
+
` restore ${page.canRestore ? "a known-good revision is available" : "nothing to restore"}`
|
|
50921
|
+
];
|
|
50922
|
+
lines.push(...engineCapabilityLines(page.capabilities?.databases ?? [], page.capabilities?.engines ?? []));
|
|
50923
|
+
lines.push(...revisionLines("revision", page.revision));
|
|
50924
|
+
lines.push(...revisionLines("active", page.activeRevision));
|
|
50925
|
+
lines.push(...revisionLines("known good", page.knownGoodRevision));
|
|
50926
|
+
return lines.join("\n");
|
|
50927
|
+
}
|
|
50928
|
+
/**
|
|
50929
|
+
* One revision's line and the secrets it declares.
|
|
50930
|
+
*
|
|
50931
|
+
* The page carries one revision in full and names the others, so both shapes are read by the same
|
|
50932
|
+
* printing: every field here is one the reference carries too, and the document is not printed.
|
|
50933
|
+
*/
|
|
50934
|
+
function revisionLines(label, revision) {
|
|
50935
|
+
if (revision === null) return [` ${label} none`];
|
|
50936
|
+
const lines = [` ${label} ${revision.origin} ${revision.applied ? "applied" : "draft"} ${revision.configHash}`];
|
|
50937
|
+
for (const secret of revision.secrets) lines.push(` secret ${secret.name} ${secret.isSet ? "set" : secret.willGenerateOnApply ? "will generate on apply" : "unset"} ${secret.description}`);
|
|
50938
|
+
return lines;
|
|
50939
|
+
}
|
|
50940
|
+
/**
|
|
50941
|
+
* The installation, cluster, company and environment a review was made against, on one line.
|
|
50942
|
+
*
|
|
50943
|
+
* Two installations may use the same company and environment names, so the line a person reads before a write
|
|
50944
|
+
* names all four and the API decides which they are. An older API answers no target at all, and the line is
|
|
50945
|
+
* then absent rather than guessed — a preview that cannot say where it applies must not imply an address.
|
|
50946
|
+
*/
|
|
50947
|
+
function configurationTargetLine(target) {
|
|
50948
|
+
if (target === null) return null;
|
|
50949
|
+
return `Target: ${target.installation} · cluster ${target.cluster} · company ${target.company} · environment ${target.environment}`;
|
|
50950
|
+
}
|
|
50951
|
+
/** A review's verdict: what it creates or adopts, whether it applies, and what it still needs. */
|
|
50952
|
+
function configurationPreviewText(review) {
|
|
50953
|
+
const unset = review.secrets.filter((one) => !one.isSet && !one.willGenerateOnApply).map((one) => one.name);
|
|
50954
|
+
const lines = [
|
|
50955
|
+
`Preview at generation ${String(review.desiredGeneration)} (hash ${review.previewHash}):`,
|
|
50956
|
+
` ${review.noOp ? "no change" : review.createsApplication ? "creates an application" : review.adoptsApplication ? "adopts an application" : "changes the configuration"}`,
|
|
50957
|
+
` runtime supported ${review.runtimeSupported ? "yes" : "no"}`,
|
|
50958
|
+
` can apply ${review.canApply ? "yes" : "no"}`,
|
|
50959
|
+
` proposed storage ${String(review.proposedStorageMib)} MiB, retention ${String(review.retentionDays)} days`
|
|
50960
|
+
];
|
|
50961
|
+
const target = configurationTargetLine(review.target ?? null);
|
|
50962
|
+
if (target !== null) lines.unshift(target);
|
|
50963
|
+
const summary = review.allocationSummary;
|
|
50964
|
+
if (summary !== null) lines.push(` commits ${String(summary.applicationCount)} application(s), requests ${String(summary.cpuRequestMillicores)}m / ${String(summary.memoryRequestMib)}Mi, limits ${String(summary.cpuLimitMillicores)}m / ${String(summary.memoryLimitMib)}Mi`, ` sharing ceiling CPU ${String(summary.cpuLimitCeilingMillicores)}m at ${String(Math.round(summary.cpuCommittedRatio * 100))}% · memory ${String(summary.memoryLimitCeilingMib)}Mi at ${String(Math.round(summary.memoryCommittedRatio * 100))}%`);
|
|
50965
|
+
const generated = review.secrets.filter((one) => !one.isSet && one.willGenerateOnApply).map((one) => one.name);
|
|
50966
|
+
if (generated.length > 0) lines.push(` generate on apply ${generated.join(", ")}`);
|
|
50967
|
+
if (unset.length > 0) lines.push(` secrets unset ${unset.join(", ")}`);
|
|
50968
|
+
if (review.applyUnavailableReason !== null) lines.push(` apply unavailable ${review.applyUnavailableReason}`);
|
|
50969
|
+
return lines.join("\n");
|
|
50970
|
+
}
|
|
50971
|
+
//#endregion
|
|
50641
50972
|
//#region src/commands/environment-configuration-description.ts
|
|
50642
50973
|
/** Describe the reviewed scope and resource changes before sending the write. */
|
|
50643
50974
|
function describeRecord(review, apply, target) {
|
|
50644
50975
|
const verdict = apply ? review.canApply ? "The review reports it can be applied." : `The review refuses to apply it: ${review.applyUnavailableReason ?? "see the API answer"}.` : "It is recorded as a draft revision and is not applied.";
|
|
50976
|
+
const address = configurationTargetLine(review.target ?? null);
|
|
50645
50977
|
return [
|
|
50978
|
+
...address === null ? [] : [address],
|
|
50646
50979
|
`${apply ? "Apply" : "Save"} the reviewed configuration at generation ${String(review.desiredGeneration)}:`,
|
|
50647
50980
|
` ${review.createsApplication ? "It creates an application." : review.adoptsApplication ? "It adopts an existing application." : "It changes the existing configuration."}`,
|
|
50648
50981
|
` ${review.noOp ? "The review reports no change." : verdict}`,
|
|
@@ -51417,7 +51750,7 @@ async function environmentDomains(context, subcommand, rest) {
|
|
|
51417
51750
|
const path = await environmentPath(context, environmentUuid, USAGE$22);
|
|
51418
51751
|
if (subcommand === "domains") return await domains(path, tail);
|
|
51419
51752
|
if (subcommand === "redirects") return await redirects(path, tail);
|
|
51420
|
-
if (subcommand === "domain-add") return await add$
|
|
51753
|
+
if (subcommand === "domain-add") return await add$7(context, path, tail);
|
|
51421
51754
|
if (subcommand === "redirect-set") return await setRedirect(context, path, tail);
|
|
51422
51755
|
if (subcommand === "redirect-remove") return await removeRedirect(context, path, tail);
|
|
51423
51756
|
if (subcommand === "domain-remove") return await removeDomain(context, path, tail);
|
|
@@ -51427,7 +51760,7 @@ async function environmentDomains(context, subcommand, rest) {
|
|
|
51427
51760
|
}
|
|
51428
51761
|
/** `domains <env>`. */
|
|
51429
51762
|
async function domains(path, rest) {
|
|
51430
|
-
noExtra$
|
|
51763
|
+
noExtra$11(rest);
|
|
51431
51764
|
return {
|
|
51432
51765
|
kind: "domains",
|
|
51433
51766
|
page: (await hostingDomainIndex({ path })).data
|
|
@@ -51435,15 +51768,15 @@ async function domains(path, rest) {
|
|
|
51435
51768
|
}
|
|
51436
51769
|
/** `redirects <env>`. */
|
|
51437
51770
|
async function redirects(path, rest) {
|
|
51438
|
-
noExtra$
|
|
51771
|
+
noExtra$11(rest);
|
|
51439
51772
|
return {
|
|
51440
51773
|
kind: "redirects",
|
|
51441
51774
|
page: (await hostingDomainRedirectIndex({ path })).data
|
|
51442
51775
|
};
|
|
51443
51776
|
}
|
|
51444
51777
|
/** `domain-add --hostname … --workload … [--intended …]`. */
|
|
51445
|
-
async function add$
|
|
51446
|
-
noExtra$
|
|
51778
|
+
async function add$7(context, path, rest) {
|
|
51779
|
+
noExtra$11(rest);
|
|
51447
51780
|
const hostname = context.flags.get("--hostname")?.trim().toLowerCase() ?? "";
|
|
51448
51781
|
const workloadUuid = context.flags.get("--workload")?.trim() ?? "";
|
|
51449
51782
|
if (hostname === "" || workloadUuid === "") throw new UsageError(`domain-add needs --hostname and --workload.\n\n${USAGE$22}`);
|
|
@@ -51538,7 +51871,7 @@ async function written$2(pending) {
|
|
|
51538
51871
|
};
|
|
51539
51872
|
}
|
|
51540
51873
|
/** No positional arguments, or a usage refusal. */
|
|
51541
|
-
function noExtra$
|
|
51874
|
+
function noExtra$11(rest) {
|
|
51542
51875
|
if (rest.length > 0) throw new UsageError(USAGE$22);
|
|
51543
51876
|
}
|
|
51544
51877
|
//#endregion
|
|
@@ -51573,7 +51906,7 @@ async function environmentExports(context, subcommand, rest) {
|
|
|
51573
51906
|
const [environmentUuid, ...tail] = rest;
|
|
51574
51907
|
const path = await environmentPath(context, environmentUuid, USAGE$21);
|
|
51575
51908
|
if (subcommand === "database-exports") {
|
|
51576
|
-
noExtra$
|
|
51909
|
+
noExtra$10(tail);
|
|
51577
51910
|
return {
|
|
51578
51911
|
kind: "exports",
|
|
51579
51912
|
exports: (await hostingDatabaseExportIndex({ path })).data.exports
|
|
@@ -51623,7 +51956,7 @@ async function remove$1(context, path, rest) {
|
|
|
51623
51956
|
};
|
|
51624
51957
|
}
|
|
51625
51958
|
/** No positional arguments, or a usage refusal. */
|
|
51626
|
-
function noExtra$
|
|
51959
|
+
function noExtra$10(rest) {
|
|
51627
51960
|
if (rest.length > 0) throw new UsageError(USAGE$21);
|
|
51628
51961
|
}
|
|
51629
51962
|
/** One export as one line. */
|
|
@@ -51727,14 +52060,14 @@ async function environmentRuntimeVersionGrants(context, rest) {
|
|
|
51727
52060
|
throw new UsageError(USAGE$20);
|
|
51728
52061
|
}
|
|
51729
52062
|
async function grant(context, company) {
|
|
51730
|
-
const type = required$
|
|
51731
|
-
const line = required$
|
|
51732
|
-
const scope = required$
|
|
52063
|
+
const type = required$5(context, "--type");
|
|
52064
|
+
const line = required$5(context, "--line");
|
|
52065
|
+
const scope = required$5(context, "--scope");
|
|
51733
52066
|
if (scope !== "company" && scope !== "workload") throw new UsageError(`--scope must be company or workload.\n\n${USAGE$20}`);
|
|
51734
52067
|
const workloadUuid = context.flags.get("--workload")?.trim() ?? "";
|
|
51735
52068
|
if (scope === "workload" && workloadUuid === "") throw new UsageError(`--scope workload needs the application's --workload <uuid>.\n\n${USAGE$20}`);
|
|
51736
|
-
const reason = required$
|
|
51737
|
-
const expiresAt = required$
|
|
52069
|
+
const reason = required$5(context, "--reason");
|
|
52070
|
+
const expiresAt = required$5(context, "--expires");
|
|
51738
52071
|
return {
|
|
51739
52072
|
kind: "runtime-version-grant-write",
|
|
51740
52073
|
outcome: await confirmableWrite(context, `grant ${type} ${line} to ${scope === "workload" ? `application ${workloadUuid}` : `company ${company}`} until ${expiresAt}`, async () => (await hostingRuntimeVersionGrantsStore({
|
|
@@ -51753,7 +52086,7 @@ async function grant(context, company) {
|
|
|
51753
52086
|
};
|
|
51754
52087
|
}
|
|
51755
52088
|
async function revoke$3(context, company) {
|
|
51756
|
-
const grantUuid = required$
|
|
52089
|
+
const grantUuid = required$5(context, "--grant");
|
|
51757
52090
|
return {
|
|
51758
52091
|
kind: "runtime-version-grant-write",
|
|
51759
52092
|
outcome: await confirmableWrite(context, `revoke runtime version grant ${grantUuid}`, async () => (await hostingRuntimeVersionGrantsRevoke({ path: {
|
|
@@ -51763,7 +52096,7 @@ async function revoke$3(context, company) {
|
|
|
51763
52096
|
};
|
|
51764
52097
|
}
|
|
51765
52098
|
/** One flag's value, refused by name when it was not given. */
|
|
51766
|
-
function required$
|
|
52099
|
+
function required$5(context, flag) {
|
|
51767
52100
|
const value = context.flags.get(flag)?.trim() ?? "";
|
|
51768
52101
|
if (value === "") throw new UsageError(`${flag} is required.\n\n${USAGE$20}`);
|
|
51769
52102
|
return value;
|
|
@@ -52330,7 +52663,7 @@ async function environmentServices(context, subcommand, rest) {
|
|
|
52330
52663
|
typeSlug: type
|
|
52331
52664
|
} })).data
|
|
52332
52665
|
};
|
|
52333
|
-
if (subcommand === "service-add") return await add$
|
|
52666
|
+
if (subcommand === "service-add") return await add$6(context, path, type);
|
|
52334
52667
|
if (subcommand === "service-runtime") return await runtime$1(context, path, type);
|
|
52335
52668
|
if (subcommand === "service-protect") return await protect(context, path, type);
|
|
52336
52669
|
if (subcommand === "service-retire") return await retire$1(context, path, type);
|
|
@@ -52355,7 +52688,7 @@ async function reviewAddition(context, path, type) {
|
|
|
52355
52688
|
};
|
|
52356
52689
|
}
|
|
52357
52690
|
/** `service-add <type> --name … [--replicas …]`. */
|
|
52358
|
-
async function add$
|
|
52691
|
+
async function add$6(context, path, type) {
|
|
52359
52692
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
52360
52693
|
if (name === "") throw new UsageError(`service-add needs --name.\n\n${USAGE$18}`);
|
|
52361
52694
|
const replicas = wholeNumber(context, "--replicas") ?? 1;
|
|
@@ -52497,7 +52830,7 @@ var USAGE$17 = [
|
|
|
52497
52830
|
async function environmentShared(context, subcommand, rest) {
|
|
52498
52831
|
const [environmentUuid, ...tail] = rest;
|
|
52499
52832
|
const path = await environmentPath(context, environmentUuid, USAGE$17);
|
|
52500
|
-
noExtra$
|
|
52833
|
+
noExtra$9(tail);
|
|
52501
52834
|
if (subcommand === "shared-runtime") return {
|
|
52502
52835
|
kind: "shared-runtime",
|
|
52503
52836
|
runtime: (await hostingSharedRuntimeShow({ path })).data
|
|
@@ -52538,7 +52871,7 @@ async function environment$1(context, path) {
|
|
|
52538
52871
|
};
|
|
52539
52872
|
}
|
|
52540
52873
|
/** No positional arguments, or a usage refusal. */
|
|
52541
|
-
function noExtra$
|
|
52874
|
+
function noExtra$9(rest) {
|
|
52542
52875
|
if (rest.length > 0) throw new UsageError(USAGE$17);
|
|
52543
52876
|
}
|
|
52544
52877
|
/** The line shared by both shared states: adopted, with whom, and the ceiling it lives inside. */
|
|
@@ -52955,6 +53288,16 @@ var ENVIRONMENT_METADATA = {
|
|
|
52955
53288
|
usage: ENVIRONMENT_USAGE,
|
|
52956
53289
|
flags: [
|
|
52957
53290
|
...CREATE_FLAG_SPECS,
|
|
53291
|
+
{
|
|
53292
|
+
name: "--volume-type",
|
|
53293
|
+
takesValue: true,
|
|
53294
|
+
description: "The claim type `storage` reads or changes."
|
|
53295
|
+
},
|
|
53296
|
+
{
|
|
53297
|
+
name: "--class",
|
|
53298
|
+
takesValue: true,
|
|
53299
|
+
description: "The storage class `environment storage set` chooses."
|
|
53300
|
+
},
|
|
52958
53301
|
{
|
|
52959
53302
|
name: "--template",
|
|
52960
53303
|
takesValue: true,
|
|
@@ -53697,86 +54040,6 @@ async function workloadRegistry(company, environmentUuid) {
|
|
|
53697
54040
|
return new Map(environment.workloads.map((one) => [one.uuid, one]));
|
|
53698
54041
|
}
|
|
53699
54042
|
//#endregion
|
|
53700
|
-
//#region src/commands/environment-configuration-text.ts
|
|
53701
|
-
/**
|
|
53702
|
-
* The phrases the platform writes when the cluster itself answered that it cannot run an engine.
|
|
53703
|
-
*
|
|
53704
|
-
* Every verdict sentence it writes says the engine "cannot run" here, and names the missing
|
|
53705
|
-
* operator. A reason carrying neither is a check that did not complete, which is the safe
|
|
53706
|
-
* direction: a failed check is never presented as the cluster's verdict.
|
|
53707
|
-
*/
|
|
53708
|
-
var CLUSTER_VERDICT = ["cannot run", "operator is missing"];
|
|
53709
|
-
function engineCapabilityState(engine) {
|
|
53710
|
-
if (engine.supported) return "ready";
|
|
53711
|
-
if (engine.unavailableReason === null) return "failed";
|
|
53712
|
-
return CLUSTER_VERDICT.some((phrase) => engine.unavailableReason?.includes(phrase)) ? "unsupported" : "failed";
|
|
53713
|
-
}
|
|
53714
|
-
/**
|
|
53715
|
-
* Every engine this environment can declare, with the state the cluster's answer gives it.
|
|
53716
|
-
*
|
|
53717
|
-
* The catalog and the cluster are two answers and both are read: an engine the catalog offers and the answer
|
|
53718
|
-
* never mentions is pending, and one the answer reports is its own state. Nothing is printed when the payload
|
|
53719
|
-
* carries no engine capability at all — an API that does not answer the field was not asked, which is not the
|
|
53720
|
-
* same claim as "everything is supported".
|
|
53721
|
-
*/
|
|
53722
|
-
function engineCapabilityLines(offered, engines) {
|
|
53723
|
-
const reported = new Map(engines.map((engine) => [engine.slug, engine]));
|
|
53724
|
-
return [.../* @__PURE__ */ new Set([...offered, ...reported.keys()])].map((slug, index) => {
|
|
53725
|
-
const engine = reported.get(slug);
|
|
53726
|
-
const state = engine === void 0 ? "pending" : engineCapabilityState(engine);
|
|
53727
|
-
const reason = engine?.unavailableReason;
|
|
53728
|
-
const detail = state === "pending" ? " (the catalog offers it; this cluster was not asked)" : state === "ready" || reason == null ? "" : `: ${reason}`;
|
|
53729
|
-
return `${index === 0 ? " engines " : " "}${slug} ${state}${detail}`;
|
|
53730
|
-
});
|
|
53731
|
-
}
|
|
53732
|
-
/**
|
|
53733
|
-
* The `configuration` group's human rendering. A read names the revision and its declared secrets; a review
|
|
53734
|
-
* names its verdict. A write's page answer renders through `configurationPageText` too, so a `secret` write
|
|
53735
|
-
* and a `configuration save` show the same page rather than inventing two readings of one payload.
|
|
53736
|
-
*/
|
|
53737
|
-
function configurationPageText(page) {
|
|
53738
|
-
const lines = [
|
|
53739
|
-
`generation ${String(page.desiredGeneration)}`,
|
|
53740
|
-
` canManage ${page.canManage ? "yes" : "no"}`,
|
|
53741
|
-
` restore ${page.canRestore ? "a known-good revision is available" : "nothing to restore"}`
|
|
53742
|
-
];
|
|
53743
|
-
lines.push(...engineCapabilityLines(page.capabilities?.databases ?? [], page.capabilities?.engines ?? []));
|
|
53744
|
-
lines.push(...revisionLines("revision", page.revision));
|
|
53745
|
-
lines.push(...revisionLines("active", page.activeRevision));
|
|
53746
|
-
lines.push(...revisionLines("known good", page.knownGoodRevision));
|
|
53747
|
-
return lines.join("\n");
|
|
53748
|
-
}
|
|
53749
|
-
/**
|
|
53750
|
-
* One revision's line and the secrets it declares.
|
|
53751
|
-
*
|
|
53752
|
-
* The page carries one revision in full and names the others, so both shapes are read by the same
|
|
53753
|
-
* printing: every field here is one the reference carries too, and the document is not printed.
|
|
53754
|
-
*/
|
|
53755
|
-
function revisionLines(label, revision) {
|
|
53756
|
-
if (revision === null) return [` ${label} none`];
|
|
53757
|
-
const lines = [` ${label} ${revision.origin} ${revision.applied ? "applied" : "draft"} ${revision.configHash}`];
|
|
53758
|
-
for (const secret of revision.secrets) lines.push(` secret ${secret.name} ${secret.isSet ? "set" : secret.willGenerateOnApply ? "will generate on apply" : "unset"} ${secret.description}`);
|
|
53759
|
-
return lines;
|
|
53760
|
-
}
|
|
53761
|
-
/** A review's verdict: what it creates or adopts, whether it applies, and what it still needs. */
|
|
53762
|
-
function configurationPreviewText(review) {
|
|
53763
|
-
const unset = review.secrets.filter((one) => !one.isSet && !one.willGenerateOnApply).map((one) => one.name);
|
|
53764
|
-
const lines = [
|
|
53765
|
-
`Preview at generation ${String(review.desiredGeneration)} (hash ${review.previewHash}):`,
|
|
53766
|
-
` ${review.noOp ? "no change" : review.createsApplication ? "creates an application" : review.adoptsApplication ? "adopts an application" : "changes the configuration"}`,
|
|
53767
|
-
` runtime supported ${review.runtimeSupported ? "yes" : "no"}`,
|
|
53768
|
-
` can apply ${review.canApply ? "yes" : "no"}`,
|
|
53769
|
-
` proposed storage ${String(review.proposedStorageMib)} MiB, retention ${String(review.retentionDays)} days`
|
|
53770
|
-
];
|
|
53771
|
-
const summary = review.allocationSummary;
|
|
53772
|
-
if (summary !== null) lines.push(` commits ${String(summary.applicationCount)} application(s), requests ${String(summary.cpuRequestMillicores)}m / ${String(summary.memoryRequestMib)}Mi, limits ${String(summary.cpuLimitMillicores)}m / ${String(summary.memoryLimitMib)}Mi`, ` sharing ceiling CPU ${String(summary.cpuLimitCeilingMillicores)}m at ${String(Math.round(summary.cpuCommittedRatio * 100))}% · memory ${String(summary.memoryLimitCeilingMib)}Mi at ${String(Math.round(summary.memoryCommittedRatio * 100))}%`);
|
|
53773
|
-
const generated = review.secrets.filter((one) => !one.isSet && one.willGenerateOnApply).map((one) => one.name);
|
|
53774
|
-
if (generated.length > 0) lines.push(` generate on apply ${generated.join(", ")}`);
|
|
53775
|
-
if (unset.length > 0) lines.push(` secrets unset ${unset.join(", ")}`);
|
|
53776
|
-
if (review.applyUnavailableReason !== null) lines.push(` apply unavailable ${review.applyUnavailableReason}`);
|
|
53777
|
-
return lines.join("\n");
|
|
53778
|
-
}
|
|
53779
|
-
//#endregion
|
|
53780
54043
|
//#region src/commands/environment-object-cache-text.ts
|
|
53781
54044
|
/**
|
|
53782
54045
|
* The environment's WordPress object-cache answer: the recorded choice, whether it can serve, and
|
|
@@ -53795,6 +54058,109 @@ function objectCacheText(settings) {
|
|
|
53795
54058
|
].join("\n");
|
|
53796
54059
|
}
|
|
53797
54060
|
//#endregion
|
|
54061
|
+
//#region src/commands/environment-storage-choice.ts
|
|
54062
|
+
/** The claim types the platform allocates, as the API spells them. */
|
|
54063
|
+
var VOLUME_TYPES$1 = [
|
|
54064
|
+
"application-files",
|
|
54065
|
+
"database-data",
|
|
54066
|
+
"redis-data"
|
|
54067
|
+
];
|
|
54068
|
+
function volumeType(value) {
|
|
54069
|
+
const known = VOLUME_TYPES$1.find((type) => type === value);
|
|
54070
|
+
if (known === void 0) throw new UsageError(`[${value}] is not a claim type; use one of ${VOLUME_TYPES$1.join(", ")}.`);
|
|
54071
|
+
return known;
|
|
54072
|
+
}
|
|
54073
|
+
var ENVIRONMENT_STORAGE_USAGE = [
|
|
54074
|
+
"Usage: hostingctl environment storage get <environment-uuid> --company <slug>",
|
|
54075
|
+
" hostingctl environment storage set <environment-uuid> --company <slug>",
|
|
54076
|
+
" --volume-type <type> --class <uuid>",
|
|
54077
|
+
" hostingctl environment storage clear <environment-uuid> --volume-type <type> --company <slug>",
|
|
54078
|
+
"",
|
|
54079
|
+
" get Each claim type, the class a new claim would take, and the classes this environment may choose.",
|
|
54080
|
+
" set Choose a class for one claim type. It applies to future allocation only: a volume already",
|
|
54081
|
+
" bound keeps the class recorded on it, because Kubernetes cannot change one in place.",
|
|
54082
|
+
" clear Return one claim type to the cluster default.",
|
|
54083
|
+
"",
|
|
54084
|
+
"Every write needs --confirm; --dry-run describes the change and sends nothing."
|
|
54085
|
+
].join("\n");
|
|
54086
|
+
/**
|
|
54087
|
+
* An environment's storage classes: what it may choose, and what it uses now.
|
|
54088
|
+
*
|
|
54089
|
+
* A choice is future allocation only. The screen and this command say the same thing, because a client who
|
|
54090
|
+
* read either one must not believe a provisioned volume moves.
|
|
54091
|
+
*/
|
|
54092
|
+
async function environmentStorage(context, rest) {
|
|
54093
|
+
const [action, uuid, ...extra] = rest;
|
|
54094
|
+
if (uuid === void 0 || extra.length > 0) throw new UsageError(ENVIRONMENT_STORAGE_USAGE);
|
|
54095
|
+
const path = {
|
|
54096
|
+
company: await requireCompany(context.flags),
|
|
54097
|
+
environmentUuid: uuid
|
|
54098
|
+
};
|
|
54099
|
+
if (action === "get") return {
|
|
54100
|
+
kind: "storage-choices",
|
|
54101
|
+
choices: (await hostingEnvironmentStorageIndex({ path })).data
|
|
54102
|
+
};
|
|
54103
|
+
if (action === "set") {
|
|
54104
|
+
const type = volumeType(required$4(context, "--volume-type"));
|
|
54105
|
+
const storageClassUuid = required$4(context, "--class");
|
|
54106
|
+
return {
|
|
54107
|
+
kind: "storage-write",
|
|
54108
|
+
outcome: await confirm$2(context, `Allocate future ${type} claims in environment ${uuid} from class ${storageClassUuid}`, async () => (await hostingEnvironmentStorageUpdate({
|
|
54109
|
+
path,
|
|
54110
|
+
body: {
|
|
54111
|
+
volumeType: type,
|
|
54112
|
+
storageClassUuid
|
|
54113
|
+
}
|
|
54114
|
+
})).data)
|
|
54115
|
+
};
|
|
54116
|
+
}
|
|
54117
|
+
if (action === "clear") {
|
|
54118
|
+
const type = volumeType(required$4(context, "--volume-type"));
|
|
54119
|
+
return {
|
|
54120
|
+
kind: "storage-write",
|
|
54121
|
+
outcome: await confirm$2(context, `Return ${type} claims in environment ${uuid} to the cluster default`, async () => {
|
|
54122
|
+
await hostingEnvironmentStorageDestroy({ path: {
|
|
54123
|
+
...path,
|
|
54124
|
+
volumeType: type
|
|
54125
|
+
} });
|
|
54126
|
+
return (await hostingEnvironmentStorageIndex({ path })).data;
|
|
54127
|
+
})
|
|
54128
|
+
};
|
|
54129
|
+
}
|
|
54130
|
+
throw new UsageError(ENVIRONMENT_STORAGE_USAGE);
|
|
54131
|
+
}
|
|
54132
|
+
function required$4(context, flag) {
|
|
54133
|
+
const value = (context.flags.get(flag) ?? "").trim();
|
|
54134
|
+
if (value === "") throw new UsageError(`${flag} is required.\n\n${ENVIRONMENT_STORAGE_USAGE}`);
|
|
54135
|
+
return value;
|
|
54136
|
+
}
|
|
54137
|
+
async function confirm$2(context, description, send) {
|
|
54138
|
+
if (context.flags.has("--dry-run")) return {
|
|
54139
|
+
sent: false,
|
|
54140
|
+
description
|
|
54141
|
+
};
|
|
54142
|
+
if (!context.flags.has("--confirm")) throw new UsageError([
|
|
54143
|
+
description,
|
|
54144
|
+
"",
|
|
54145
|
+
"Nothing was sent. Pass --confirm to make this change, or --dry-run to see it without making it."
|
|
54146
|
+
].join("\n"));
|
|
54147
|
+
return {
|
|
54148
|
+
sent: true,
|
|
54149
|
+
description,
|
|
54150
|
+
result: await send()
|
|
54151
|
+
};
|
|
54152
|
+
}
|
|
54153
|
+
function storageChoicesText(choices) {
|
|
54154
|
+
return choices.map((choice) => {
|
|
54155
|
+
const selected = choice.selectedUuid === null ? "cluster default" : choice.selectedUuid;
|
|
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}`;
|
|
54158
|
+
}).join("\n");
|
|
54159
|
+
}
|
|
54160
|
+
function storageWriteText(outcome) {
|
|
54161
|
+
return renderWriteOutcome(outcome, (choices) => choices.length === 0 ? "This environment holds no claim yet." : storageChoicesText(choices));
|
|
54162
|
+
}
|
|
54163
|
+
//#endregion
|
|
53798
54164
|
//#region src/commands/environment-domains-text.ts
|
|
53799
54165
|
/** One name as one line: its address, where it points and how far routing has got. */
|
|
53800
54166
|
function domainLine(one) {
|
|
@@ -53867,6 +54233,8 @@ function taggedReportText(report) {
|
|
|
53867
54233
|
if (report.kind === "cache-write") return renderWriteOutcome(report.outcome, outcomeOf$1);
|
|
53868
54234
|
if (report.kind === "object-cache") return objectCacheText(report.settings);
|
|
53869
54235
|
if (report.kind === "object-cache-write") return renderWriteOutcome(report.outcome, objectCacheText);
|
|
54236
|
+
if (report.kind === "storage-choices") return storageChoicesText(report.choices);
|
|
54237
|
+
if (report.kind === "storage-write") return storageWriteText(report.outcome);
|
|
53870
54238
|
return environmentTaggedText(report);
|
|
53871
54239
|
}
|
|
53872
54240
|
/** Render one `environment` answer to a person, never to a value the payload does not carry. */
|
|
@@ -53890,10 +54258,22 @@ function environmentText(report) {
|
|
|
53890
54258
|
` status ${report.status.status} generation ${String(report.status.generation)} applied ${String(report.status.appliedGeneration)}`,
|
|
53891
54259
|
` observed ${report.status.observedAt ?? "never"}`,
|
|
53892
54260
|
` reconciled ${lastReconcile(report.lastReconcile)}`,
|
|
53893
|
-
` layout ${report.applicationLayout}
|
|
54261
|
+
` layout ${report.applicationLayout}`,
|
|
54262
|
+
...allocationSummaryLines(report.allocationSummary)
|
|
53894
54263
|
].join("\n");
|
|
53895
54264
|
}
|
|
53896
54265
|
/**
|
|
54266
|
+
* What the environment's applications commit against the capacity it shares, in the terms a refusal is
|
|
54267
|
+
* written in: the total beside the ceiling it is measured against and how much of that ceiling is taken.
|
|
54268
|
+
*
|
|
54269
|
+
* An older API answers no summary at all — omitted or null — and then nothing is printed rather than zeroes the
|
|
54270
|
+
* platform never reported.
|
|
54271
|
+
*/
|
|
54272
|
+
function allocationSummaryLines(summary) {
|
|
54273
|
+
if (summary === null || summary === void 0) return [];
|
|
54274
|
+
return [` committed ${String(summary.applicationCount)} application(s); requests ${String(summary.cpuRequestMillicores)}m / ${String(summary.memoryRequestMib)}Mi; limits ${String(summary.cpuLimitMillicores)}m / ${String(summary.memoryLimitMib)}Mi`, ` sharing ceiling CPU ${String(summary.cpuLimitCeilingMillicores)}m at ${String(Math.round(summary.cpuCommittedRatio * 100))}% · memory ${String(summary.memoryLimitCeilingMib)}Mi at ${String(Math.round(summary.memoryCommittedRatio * 100))}%`];
|
|
54275
|
+
}
|
|
54276
|
+
/**
|
|
53897
54277
|
* A write's receipt, and — when an apply waited — the environment reading it ended on.
|
|
53898
54278
|
*
|
|
53899
54279
|
* The receipt says what was recorded; the reading says what the platform has done with it, in the same status lines
|
|
@@ -53957,16 +54337,13 @@ function componentVersionText(data) {
|
|
|
53957
54337
|
return [` version ${data.previous} → ${data.version}`, ` image ${data.image}`].join("\n");
|
|
53958
54338
|
}
|
|
53959
54339
|
/**
|
|
53960
|
-
* The three states, each named for what it means
|
|
53961
|
-
* adopted the shared set is not participating, not incomplete, and the difference is the whole reason the
|
|
53962
|
-
* payload carries a mode rather than a list of missing keys.
|
|
54340
|
+
* The three states, each named for what it means: never adopted is not participating, not incomplete.
|
|
53963
54341
|
*/
|
|
53964
54342
|
function profile(report) {
|
|
53965
54343
|
const state = report.mode === "not_participating" ? "not participating: this environment never adopted the shared set" : `profile ${String(report.present)} of ${String(report.expected)}`;
|
|
53966
54344
|
if (report.mode !== "short_of_catalog") return state;
|
|
53967
54345
|
return [state, ` short of the catalog: ${report.missing.map((one) => one.key).join(", ")}`].join("\n");
|
|
53968
54346
|
}
|
|
53969
|
-
/** The environment-wide cache answer lives beside the other small renderers, in its own module. */
|
|
53970
54347
|
//#endregion
|
|
53971
54348
|
//#region src/commands/environment-setup-text.ts
|
|
53972
54349
|
/**
|
|
@@ -54420,7 +54797,7 @@ function partial(Class, schema, mask, name = "partial") {
|
|
|
54420
54797
|
checks: []
|
|
54421
54798
|
}));
|
|
54422
54799
|
}
|
|
54423
|
-
function required$
|
|
54800
|
+
function required$3(Class, schema, mask) {
|
|
54424
54801
|
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
54425
54802
|
const newShape = {};
|
|
54426
54803
|
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({
|
|
@@ -59458,7 +59835,7 @@ var ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
|
59458
59835
|
return partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
59459
59836
|
},
|
|
59460
59837
|
required(...args) {
|
|
59461
|
-
return required$
|
|
59838
|
+
return required$3(ZodNonOptional, this, args[0]);
|
|
59462
59839
|
}
|
|
59463
59840
|
});
|
|
59464
59841
|
function object(shape, params) {
|
|
@@ -60756,6 +61133,7 @@ var permissionSchema = _enum([
|
|
|
60756
61133
|
"hosting.deletion.execute",
|
|
60757
61134
|
"hosting.vocabulary.manage",
|
|
60758
61135
|
"hosting.seeds.manage",
|
|
61136
|
+
"hosting.storage.manage",
|
|
60759
61137
|
"email.installation.adopt",
|
|
60760
61138
|
"email.monitoring.manage",
|
|
60761
61139
|
"platform.domains.ownership.attest",
|
|
@@ -60779,7 +61157,7 @@ var permissionSchema = _enum([
|
|
|
60779
61157
|
"platform.billing.write_off",
|
|
60780
61158
|
"billing.view",
|
|
60781
61159
|
"billing.profile.manage"
|
|
60782
|
-
]).describe("Every application permission. Permissions belong to roles in a scope; users receive roles. Company permissions are scoped to the company team, platform permissions to the reserved platform team. Nothing assigns a permission directly to a user.\n| |\n|---|\n| `operations.horizon.view` <br/> |\n| `operations.impersonate` <br/> |\n| `platform.clients.view` <br/> |\n| `platform.clients.manage` <br/> |\n| `platform.alerts.manage` <br/> |\n| `hosting.diagnostics.view` <br/> |\n| `hosting.retention.approve` <br/> |\n| `platform.users.manage` <br/> Granting or removing a platform role. Deliberately granted to no role: it is a Super Admin act, reached through the platform bypass that already exists for that role. A grant that let a system admin promote another system admin would make the boundary it protects meaningless. |\n| `platform.accounts.close` <br/> |\n| `platform.companies.close` <br/> |\n| `hosting.deletion.execute` <br/> |\n| `hosting.vocabulary.manage` <br/> |\n| `hosting.seeds.manage` <br/> |\n| `email.installation.adopt` <br/> |\n| `email.monitoring.manage` <br/> |\n| `platform.domains.ownership.attest` <br/> |\n| `platform.custd.ownership.attest` <br/> |\n| `platform.domains.ownership.transfer` <br/> |\n| `company.view` <br/> |\n| `company.update` <br/> |\n| `company.members.manage` <br/> |\n| `company.activity.view` <br/> |\n| `domain.view` <br/> |\n| `domain.manage` <br/> |\n| `dns.view` <br/> |\n| `dns.manage` <br/> |\n| `email.view` <br/> |\n| `email.manage` <br/> |\n| `hosting.tools.use` <br/> |\n| `hosting.access.view` <br/> |\n| `hosting.access.manage` <br/> |\n| `platform.billing.view` <br/> |\n| `platform.billing.manage` <br/> |\n| `platform.billing.write_off` <br/> |\n| `billing.view` <br/> |\n| `billing.profile.manage` <br/> |");
|
|
61160
|
+
]).describe("Every application permission. Permissions belong to roles in a scope; users receive roles. Company permissions are scoped to the company team, platform permissions to the reserved platform team. Nothing assigns a permission directly to a user.\n| |\n|---|\n| `operations.horizon.view` <br/> |\n| `operations.impersonate` <br/> |\n| `platform.clients.view` <br/> |\n| `platform.clients.manage` <br/> |\n| `platform.alerts.manage` <br/> |\n| `hosting.diagnostics.view` <br/> |\n| `hosting.retention.approve` <br/> |\n| `platform.users.manage` <br/> Granting or removing a platform role. Deliberately granted to no role: it is a Super Admin act, reached through the platform bypass that already exists for that role. A grant that let a system admin promote another system admin would make the boundary it protects meaningless. |\n| `platform.accounts.close` <br/> |\n| `platform.companies.close` <br/> |\n| `hosting.deletion.execute` <br/> |\n| `hosting.vocabulary.manage` <br/> |\n| `hosting.seeds.manage` <br/> |\n| `hosting.storage.manage` <br/> |\n| `email.installation.adopt` <br/> |\n| `email.monitoring.manage` <br/> |\n| `platform.domains.ownership.attest` <br/> |\n| `platform.custd.ownership.attest` <br/> |\n| `platform.domains.ownership.transfer` <br/> |\n| `company.view` <br/> |\n| `company.update` <br/> |\n| `company.members.manage` <br/> |\n| `company.activity.view` <br/> |\n| `domain.view` <br/> |\n| `domain.manage` <br/> |\n| `dns.view` <br/> |\n| `dns.manage` <br/> |\n| `email.view` <br/> |\n| `email.manage` <br/> |\n| `hosting.tools.use` <br/> |\n| `hosting.access.view` <br/> |\n| `hosting.access.manage` <br/> |\n| `platform.billing.view` <br/> |\n| `platform.billing.manage` <br/> |\n| `platform.billing.write_off` <br/> |\n| `billing.view` <br/> |\n| `billing.profile.manage` <br/> |");
|
|
60783
61161
|
var companySummaryDataSchema = object({
|
|
60784
61162
|
slug: string(),
|
|
60785
61163
|
name: string(),
|
|
@@ -61076,7 +61454,7 @@ var createHostingAccessUserRequestSchema = object({
|
|
|
61076
61454
|
key: object({
|
|
61077
61455
|
name: string().max(100).optional(),
|
|
61078
61456
|
publicKey: string().max(4096).optional()
|
|
61079
|
-
}).
|
|
61457
|
+
}).nullish(),
|
|
61080
61458
|
password_confirmation: string().max(1024).nullish()
|
|
61081
61459
|
}).describe("Creating one environment access user.\n\nThe submitted generation must match the stored one, which the service checks\nagain under its row lock. At least one way to authenticate is required for an\nenabled user, and the service enforces that too: it is the rule that stops a\nrow existing that nobody can log in with.\n\n`username` is validated against the same grammar the database CHECK enforces,\nso a malformed name is a field error rather than a constraint violation.\n\n`readOnly` is optional here and required on update, deliberately: creating a\nlogin without mentioning it produces the read-write credential that existed\nbefore the flag, while changing one must state which access is wanted rather\nthan resetting a read-only login by omission.");
|
|
61082
61460
|
var createHostingApplicationRequestSchema = object({
|
|
@@ -61223,7 +61601,7 @@ var createHostingEnvironmentRequestSchema = object({
|
|
|
61223
61601
|
application: string().max(100),
|
|
61224
61602
|
server: string().max(100)
|
|
61225
61603
|
})).optional(),
|
|
61226
|
-
postgresRestoreSource: object({ sourceEnvironmentUuid: uuid().optional() }).
|
|
61604
|
+
postgresRestoreSource: object({ sourceEnvironmentUuid: uuid().optional() }).nullish(),
|
|
61227
61605
|
configuration: string().max(65536).optional()
|
|
61228
61606
|
}).describe("The submitted desired state of a new environment.\n\nField-level rules live here: shape, type, range, catalog membership and the\nname uniqueness within the company that the database also enforces through a\npartial unique index on active rows. Everything that needs to compare one\nsubmitted value with another, or with stored rows, belongs to\n`HostingResourceService`.\n\nA submitted `budget` is an echo of the chosen package for every company but one holding an agreed pool, where it\nis that environment's slice (plan 181). Which of the two it is belongs to creation, so this request only makes\nsure the package fills what the caller left unsaid instead of overwriting what they said.");
|
|
61229
61607
|
var createHostingExternalSecretConnectionRequestSchema = object({
|
|
@@ -61270,13 +61648,13 @@ var createHostingServiceRequestSchema = object({
|
|
|
61270
61648
|
persistence: hostingValkeyPersistenceEnumSchema.optional().describe("Whether the store keeps its own copy of the data on disk. `none` is a cache: losing the process loses the contents, which is what a cache promises. `aof` appends every write, which is what a client chooses when the store holds sessions or queues rather than only rendered pages.\n"),
|
|
61271
61649
|
auth: hostingValkeyAuthEnumSchema.optional().describe("Whether the store requires a credential. `required` is the client's choice and never the platform's: a store reachable only inside the environment's own network can reasonably run without one, and a store whose address leaves that network cannot. Which is why the transport choice and this one are recorded separately rather than as a single \"secure\" switch.\n"),
|
|
61272
61650
|
tls: hostingValkeyTransportEnumSchema.optional().describe("Whether the store speaks TLS, and whether it also speaks plaintext. `required` means the plaintext port is not composed at all, so no client can fall back to it by accident. `optional` keeps both listeners and is the only choice a client can make while the TLS listener is not yet composed — which the settings owner refuses rather than accepting a choice it cannot deliver.\n")
|
|
61273
|
-
}).
|
|
61651
|
+
}).nullish().describe("A Valkey service's choices. Optional: omitted means the type's preset, which is what a client who\ndid not choose gets, and what every service created before these settings existed holds."),
|
|
61274
61652
|
resources: object({
|
|
61275
61653
|
cpuRequestMillicores: int().min(1).optional(),
|
|
61276
61654
|
cpuLimitMillicores: int().min(1).optional(),
|
|
61277
61655
|
memoryRequestMib: int().min(1).optional(),
|
|
61278
61656
|
memoryLimitMib: int().min(1).optional()
|
|
61279
|
-
}).
|
|
61657
|
+
}).nullish().describe("Optional on purpose: a browser holds no resource constants, so an omitted size means\nthe platform's own default envelope for this type, which the resource editor changes\nafterwards. A size that IS submitted must be complete, because a half-specified one\nwould be silently completed with platform numbers the customer never reviewed."),
|
|
61280
61658
|
desiredGeneration: int().min(0)
|
|
61281
61659
|
}).describe("Adding one shared service to an environment that already exists.\n\n`type` is checked against the same list the cardinality owner decides, so a request cannot name a\ntype this product would never admit as a service, and the application types are refused here\nrather than travelling to a service that would have to explain why an application is not one.\nEverything that compares the new row with the environment's purchase, its existing rows or its\nvolume set belongs to the admission owners, because a static rule cannot see the environment.\n\n`desiredGeneration` is required: adding a service changes the environment, so the customer states\nwhich version of it they reviewed, and a stale one is a conflict rather than a second server.");
|
|
61282
61660
|
var creditBillingInvoiceRequestSchema = object({ reason: string().min(3).max(255) }).describe("A full credit note for one issued invoice.\n\nThe reason is required because s21 makes it part of the document: a credit note must say why it\ncorrects the invoice it names, and a later reader has no other way to know. It is bounded to the\ncolumn's own width rather than truncated silently after the number has been spent.");
|
|
@@ -61574,10 +61952,10 @@ var domainDataSchema = object({
|
|
|
61574
61952
|
ownershipRecord: union([hostingDomainRecordDataSchema, _null()]),
|
|
61575
61953
|
summary: domainServiceSummaryDataSchema,
|
|
61576
61954
|
validationOverride: union([domainValidationOverrideDataSchema, _null()]),
|
|
61577
|
-
canViewDomain:
|
|
61578
|
-
canManageDomain:
|
|
61579
|
-
canViewDns:
|
|
61580
|
-
canManageDns:
|
|
61955
|
+
canViewDomain: boolean().optional(),
|
|
61956
|
+
canManageDomain: boolean().optional(),
|
|
61957
|
+
canViewDns: boolean().optional(),
|
|
61958
|
+
canManageDns: boolean().optional()
|
|
61581
61959
|
});
|
|
61582
61960
|
object({ reason: string() });
|
|
61583
61961
|
object({
|
|
@@ -62039,9 +62417,9 @@ object({
|
|
|
62039
62417
|
entitlement: union([emailEntitlementDataSchema, _null()])
|
|
62040
62418
|
}), _null()]),
|
|
62041
62419
|
domains: array(emailDomainSummaryDataSchema),
|
|
62042
|
-
canViewEmail:
|
|
62043
|
-
canManageEmail:
|
|
62044
|
-
enrollmentAvailability:
|
|
62420
|
+
canViewEmail: boolean().optional(),
|
|
62421
|
+
canManageEmail: boolean().optional(),
|
|
62422
|
+
enrollmentAvailability: emailEnrollmentAvailabilityDataSchema.optional()
|
|
62045
62423
|
});
|
|
62046
62424
|
var endBillingRateRequestSchema = object({ effectiveUntil: datetime() }).describe("Ending one recorded price window.\n\nEnding is not an edit: it sets the one boundary the window has left, and the refusal to move an already\nended window is the service's, because only it can see the rows this window shares a scope with.");
|
|
62047
62425
|
var evacuateHostingRuntimeVersionRequestSchema = object({
|
|
@@ -62877,6 +63255,32 @@ object({
|
|
|
62877
63255
|
blockedReason: string().nullable(),
|
|
62878
63256
|
recovery: union([hostingApplicationRecoveryDataSchema, _null()])
|
|
62879
63257
|
});
|
|
63258
|
+
object({
|
|
63259
|
+
decision: object({
|
|
63260
|
+
rung: _enum([
|
|
63261
|
+
"healthy",
|
|
63262
|
+
"unmeasured",
|
|
63263
|
+
"warn",
|
|
63264
|
+
"throttle",
|
|
63265
|
+
"memory",
|
|
63266
|
+
"oom"
|
|
63267
|
+
]).describe("The rung one APPLICATION sits on in the red-line ladder. The vocabulary is closed for the same reason {@see HostingNoisyNeighbourRungEnum}'s is: the ladder escalates in a fixed order, every consumer has to be able to switch on the rung exhaustively, and an unrecognised rung would be a bug rather than a state. The order is the escalation order, and it is the order the responses are meant to be taken in: 1. `healthy` — every signal that could be measured is below its warn line. 2. `unmeasured` — nothing could be measured, so no red line was established. This is NOT an escalation: it sits above `healthy` only because an operator reading the ranked list should see the applications the ladder cannot speak for, rather than a clean bill of health nobody measured. 3. `warn` — a signal reached its warn line and nothing more is true of the application yet. 4. `throttle` — the kernel held the application back for a material share of its CPU periods. 5. `memory` — the working set is at the red line under the declared memory limit, one step before the kernel enforces it. 6. `oom` — the kernel already stopped it for exceeding that limit. Worst, because this is an outage rather than a slowdown, and because \"your site went down\" and \"your site exceeded 512 MiB\" are different support tickets.\n").describe("The rung one APPLICATION sits on in the red-line ladder. The vocabulary is closed for the same reason {@see HostingNoisyNeighbourRungEnum}'s is: the ladder escalates in a fixed order, every consumer has to be able to switch on the rung exhaustively, and an unrecognised rung would be a bug rather than a state. The order is the escalation order, and it is the order the responses are meant to be taken in: 1. `healthy` — every signal that could be measured is below its warn line. 2. `unmeasured` — nothing could be measured, so no red line was established. This is NOT an escalation: it sits above `healthy` only because an operator reading the ranked list should see the applications the ladder cannot speak for, rather than a clean bill of health nobody measured. 3. `warn` — a signal reached its warn line and nothing more is true of the application yet. 4. `throttle` — the kernel held the application back for a material share of its CPU periods. 5. `memory` — the working set is at the red line under the declared memory limit, one step before the kernel enforces it. 6. `oom` — the kernel already stopped it for exceeding that limit. Worst, because this is an outage rather than a slowdown, and because \"your site went down\" and \"your site exceeded 512 MiB\" are different support tickets.\n"),
|
|
63268
|
+
reason: string(),
|
|
63269
|
+
recommendation: string()
|
|
63270
|
+
}),
|
|
63271
|
+
signals: object({
|
|
63272
|
+
tenant: string(),
|
|
63273
|
+
environment: string(),
|
|
63274
|
+
application: string(),
|
|
63275
|
+
cpuThrottledRatio: number().nullable(),
|
|
63276
|
+
memoryUsedMib: int().nullable(),
|
|
63277
|
+
memoryLimitMib: int(),
|
|
63278
|
+
oomKills: int().nullable(),
|
|
63279
|
+
cpuCommittedRatio: number(),
|
|
63280
|
+
memoryCommittedRatio: number(),
|
|
63281
|
+
unmeasured: array(string())
|
|
63282
|
+
})
|
|
63283
|
+
});
|
|
62880
63284
|
var hostingApplicationRemovalDataSchema = object({
|
|
62881
63285
|
uuid: string(),
|
|
62882
63286
|
workloadUuid: string(),
|
|
@@ -63245,7 +63649,8 @@ var hostingConfigurationEnvironmentDataSchema = object({
|
|
|
63245
63649
|
field: string().nullable(),
|
|
63246
63650
|
redis: string().nullable(),
|
|
63247
63651
|
service: string().nullable(),
|
|
63248
|
-
storage: string().nullable()
|
|
63652
|
+
storage: string().nullable(),
|
|
63653
|
+
application: string().optional()
|
|
63249
63654
|
});
|
|
63250
63655
|
var hostingConfigurationBuildDataSchema = object({
|
|
63251
63656
|
install: array(string()),
|
|
@@ -63256,7 +63661,8 @@ var hostingConfigurationBuildDataSchema = object({
|
|
|
63256
63661
|
var hostingConfigurationRunDataSchema = object({
|
|
63257
63662
|
command: array(string()),
|
|
63258
63663
|
port: int(),
|
|
63259
|
-
healthPath: string()
|
|
63664
|
+
healthPath: string(),
|
|
63665
|
+
httpProbeContractRecorded: boolean()
|
|
63260
63666
|
});
|
|
63261
63667
|
var hostingConfigurationMountDataSchema = object({
|
|
63262
63668
|
volume: string(),
|
|
@@ -63299,7 +63705,8 @@ var hostingConfigurationRoutingDataSchema = object({
|
|
|
63299
63705
|
var hostingConfigurationImageDataSchema = object({
|
|
63300
63706
|
repository: string(),
|
|
63301
63707
|
reference: string(),
|
|
63302
|
-
connection: string().nullable()
|
|
63708
|
+
connection: string().nullable(),
|
|
63709
|
+
registryHost: string().nullable()
|
|
63303
63710
|
});
|
|
63304
63711
|
var hostingConfigurationApplicationDataSchema = object({
|
|
63305
63712
|
key: string(),
|
|
@@ -63319,7 +63726,8 @@ var hostingConfigurationApplicationDataSchema = object({
|
|
|
63319
63726
|
routing: union([hostingConfigurationRoutingDataSchema, _null()]),
|
|
63320
63727
|
resources: union([hostingResourceDataSchema, _null()]),
|
|
63321
63728
|
image: union([hostingConfigurationImageDataSchema, _null()]),
|
|
63322
|
-
filesGib: int().nullable()
|
|
63729
|
+
filesGib: int().nullable(),
|
|
63730
|
+
webServer: string().nullish()
|
|
63323
63731
|
});
|
|
63324
63732
|
var hostingConfigurationApplicationPreviewDataSchema = object({
|
|
63325
63733
|
key: string(),
|
|
@@ -63492,6 +63900,23 @@ var hostingConfigurationPageDataSchema = object({
|
|
|
63492
63900
|
capabilities: hostingConfigurationCapabilitiesDataSchema
|
|
63493
63901
|
});
|
|
63494
63902
|
var hostingConfigurationScopeEnumSchema = _enum(["environment", "application"]);
|
|
63903
|
+
var hostingConfigurationTargetDataSchema = object({
|
|
63904
|
+
installation: string().describe("The API the client reached, so two installations with the same company names cannot be confused."),
|
|
63905
|
+
cluster: string(),
|
|
63906
|
+
company: string().describe("The company slug the company middleware scoped this request to."),
|
|
63907
|
+
environment: string()
|
|
63908
|
+
});
|
|
63909
|
+
var hostingStorageBindingPreviewDataSchema = object({
|
|
63910
|
+
volumeUuid: string(),
|
|
63911
|
+
volumeType: string(),
|
|
63912
|
+
storageClassName: string()
|
|
63913
|
+
});
|
|
63914
|
+
var hostingConfigurationStorageClassPreviewDataSchema = object({
|
|
63915
|
+
volumeType: string(),
|
|
63916
|
+
effectiveClassUuid: string().nullable(),
|
|
63917
|
+
effectiveClassName: string().nullable(),
|
|
63918
|
+
existingBindings: array(hostingStorageBindingPreviewDataSchema)
|
|
63919
|
+
});
|
|
63495
63920
|
object({
|
|
63496
63921
|
environmentUuid: string(),
|
|
63497
63922
|
desiredGeneration: int(),
|
|
@@ -63519,7 +63944,9 @@ object({
|
|
|
63519
63944
|
allocationSummary: union([hostingAllocationSummaryDataSchema, _null()]),
|
|
63520
63945
|
scope: union([hostingConfigurationScopeEnumSchema, _null()]),
|
|
63521
63946
|
applicationKey: string().nullable(),
|
|
63522
|
-
bucket: union([hostingConfigurationBucketPreviewDataSchema, _null()])
|
|
63947
|
+
bucket: union([hostingConfigurationBucketPreviewDataSchema, _null()]),
|
|
63948
|
+
target: union([hostingConfigurationTargetDataSchema, _null()]),
|
|
63949
|
+
storageClasses: array(hostingConfigurationStorageClassPreviewDataSchema).describe("Per claim type: the class a claim this apply creates would be allocated from, and the class\neach existing claim keeps. A review states both so applying a document cannot look like it\nmoves storage.")
|
|
63523
63950
|
});
|
|
63524
63951
|
object({
|
|
63525
63952
|
name: string(),
|
|
@@ -63702,6 +64129,18 @@ var hostingReleaseImageScanDataSchema = object({
|
|
|
63702
64129
|
scanner: string().nullable(),
|
|
63703
64130
|
scannerVersion: string().nullable()
|
|
63704
64131
|
});
|
|
64132
|
+
var hostingReleaseHttpProbeDataSchema = object({
|
|
64133
|
+
port: int(),
|
|
64134
|
+
path: string(),
|
|
64135
|
+
startupInitialDelaySeconds: int(),
|
|
64136
|
+
startupPeriodSeconds: int(),
|
|
64137
|
+
startupTimeoutSeconds: int(),
|
|
64138
|
+
startupFailureThreshold: int(),
|
|
64139
|
+
readinessInitialDelaySeconds: int(),
|
|
64140
|
+
readinessPeriodSeconds: int(),
|
|
64141
|
+
readinessTimeoutSeconds: int(),
|
|
64142
|
+
readinessFailureThreshold: int()
|
|
64143
|
+
});
|
|
63705
64144
|
var hostingReleaseImageDataSchema = object({
|
|
63706
64145
|
connectionUuid: string(),
|
|
63707
64146
|
connectionVersion: int(),
|
|
@@ -63717,7 +64156,8 @@ var hostingReleaseImageDataSchema = object({
|
|
|
63717
64156
|
workingDirectory: string().nullable(),
|
|
63718
64157
|
importedAt: datetime().nullable(),
|
|
63719
64158
|
sourceReference: string(),
|
|
63720
|
-
preparedByUserId: int().nullable()
|
|
64159
|
+
preparedByUserId: int().nullable(),
|
|
64160
|
+
httpProbe: union([hostingReleaseHttpProbeDataSchema, _null()])
|
|
63721
64161
|
});
|
|
63722
64162
|
var hostingReleaseDataSchema = object({
|
|
63723
64163
|
uuid: string(),
|
|
@@ -63884,6 +64324,15 @@ var hostingValkeyEndpointDataSchema = object({
|
|
|
63884
64324
|
port: int(),
|
|
63885
64325
|
warning: string().nullable().describe("What a client must know before using this endpoint, or null when there is nothing to warn about.")
|
|
63886
64326
|
});
|
|
64327
|
+
var hostingWebServerOptionDataSchema = object({
|
|
64328
|
+
value: string(),
|
|
64329
|
+
label: string(),
|
|
64330
|
+
detail: string()
|
|
64331
|
+
});
|
|
64332
|
+
var hostingWebServerCapabilitiesDataSchema = object({
|
|
64333
|
+
default: string(),
|
|
64334
|
+
options: array(hostingWebServerOptionDataSchema)
|
|
64335
|
+
});
|
|
63887
64336
|
var hostingWorkloadDataSchema = object({
|
|
63888
64337
|
uuid: string(),
|
|
63889
64338
|
type: string(),
|
|
@@ -63897,7 +64346,7 @@ var hostingWorkloadDataSchema = object({
|
|
|
63897
64346
|
generatedHostnames: array(string()),
|
|
63898
64347
|
tuning: hostingWorkloadTuningDataSchema,
|
|
63899
64348
|
webServer: string().nullable().describe("The web server the customer chose, or null when the application follows the platform\ndefault. Exposed beside `webServerEffective` so a screen can say which one is running\nand why, rather than implying the choice from a value it derived itself."),
|
|
63900
|
-
webServerEffective: string().nullable().describe("
|
|
64349
|
+
webServerEffective: string().nullable().describe("The effective desired shape, not an observation of the serving Pod."),
|
|
63901
64350
|
runtimeVersion: string().nullable().describe("The version line the customer chose, or null when the application's type offers none.\nReported beside `runtimeVersionEffective` for the same reason the web server pair is: a\nscreen says which line is running rather than deriving it from a value it guessed."),
|
|
63902
64351
|
runtimeVersionEffective: string().nullable().describe("What this application actually runs: the served line; null when its type offers no version lines."),
|
|
63903
64352
|
bounds: hostingWorkloadBoundsDataSchema,
|
|
@@ -63906,7 +64355,8 @@ var hostingWorkloadDataSchema = object({
|
|
|
63906
64355
|
capabilities: hostingApplicationCapabilitiesDataSchema.describe("What this workload can and cannot do. Carried here as well as on the application payload because this is the\nshape the applications table renders; the ANSWERS come from one owner either way."),
|
|
63907
64356
|
requiresBuild: boolean(),
|
|
63908
64357
|
valkey: union([hostingValkeySettingsDataSchema, _null()]),
|
|
63909
|
-
valkeyEndpoints: array(hostingValkeyEndpointDataSchema).describe("The endpoints that actually exist for this service, each with its own warning. Empty for every type that\nis not a Valkey service.")
|
|
64358
|
+
valkeyEndpoints: array(hostingValkeyEndpointDataSchema).describe("The endpoints that actually exist for this service, each with its own warning. Empty for every type that\nis not a Valkey service."),
|
|
64359
|
+
webServerCapabilities: union([hostingWebServerCapabilitiesDataSchema, _null()])
|
|
63910
64360
|
});
|
|
63911
64361
|
var hostingVolumeDataSchema = object({
|
|
63912
64362
|
uuid: string(),
|
|
@@ -64004,7 +64454,8 @@ var hostingEnvironmentDataSchema = object({
|
|
|
64004
64454
|
canRestoreTuning: boolean().describe("Whether the live runtime tuning differs from the tuning that last reached ready, so a failed\ntuning change can be rolled back. Computed by the tuning owner from the recorded snapshot."),
|
|
64005
64455
|
knownGoodTuningGeneration: int().nullable().describe("The generation the known-good tuning was observed at, or null when none is recorded."),
|
|
64006
64456
|
toolSelection: array(hostingToolSelectionDataSchema).describe("Every browser tool with the client's own on/off state, including the ones switched off."),
|
|
64007
|
-
purchasePeriod: union([hostingPurchasePeriodDataSchema, _null()])
|
|
64457
|
+
purchasePeriod: union([hostingPurchasePeriodDataSchema, _null()]),
|
|
64458
|
+
allocationSummary: union([hostingAllocationSummaryDataSchema, _null()])
|
|
64008
64459
|
});
|
|
64009
64460
|
object({
|
|
64010
64461
|
environmentUuid: string(),
|
|
@@ -64056,6 +64507,27 @@ object({
|
|
|
64056
64507
|
})),
|
|
64057
64508
|
meta: pageMetaDataSchema
|
|
64058
64509
|
});
|
|
64510
|
+
var hostingStorageClassDataSchema = object({
|
|
64511
|
+
uuid: string(),
|
|
64512
|
+
clusterUuid: string(),
|
|
64513
|
+
clusterName: string(),
|
|
64514
|
+
backendType: string(),
|
|
64515
|
+
backendName: string(),
|
|
64516
|
+
kubernetesName: string(),
|
|
64517
|
+
name: string(),
|
|
64518
|
+
description: string(),
|
|
64519
|
+
enabled: boolean(),
|
|
64520
|
+
volumeTypes: array(string()),
|
|
64521
|
+
reportsUsedBytes: boolean(),
|
|
64522
|
+
supportsBackingImages: boolean()
|
|
64523
|
+
});
|
|
64524
|
+
object({
|
|
64525
|
+
volumeType: string(),
|
|
64526
|
+
selectedUuid: string().nullable(),
|
|
64527
|
+
effectiveUuid: string().nullable(),
|
|
64528
|
+
effectiveName: string().nullable(),
|
|
64529
|
+
classes: array(hostingStorageClassDataSchema)
|
|
64530
|
+
});
|
|
64059
64531
|
var hostingExternalSecretStatusDataSchema = object({
|
|
64060
64532
|
status: string(),
|
|
64061
64533
|
lastSuccessAt: string().nullable(),
|
|
@@ -64435,15 +64907,9 @@ var hostingRegistryProviderEnumSchema = _enum([
|
|
|
64435
64907
|
"gar",
|
|
64436
64908
|
"custom"
|
|
64437
64909
|
]);
|
|
64438
|
-
var
|
|
64439
|
-
|
|
64440
|
-
|
|
64441
|
-
name: string(),
|
|
64442
|
-
description: string(),
|
|
64443
|
-
enabled: boolean(),
|
|
64444
|
-
order_column: int(),
|
|
64445
|
-
created_at: datetime(),
|
|
64446
|
-
updated_at: datetime()
|
|
64910
|
+
var hostingReleasePrepareDataSchema = object({
|
|
64911
|
+
releaseUuid: string(),
|
|
64912
|
+
status: string().nullable()
|
|
64447
64913
|
});
|
|
64448
64914
|
var hostingRepositoryDeliveryDataSchema = object({
|
|
64449
64915
|
event: string(),
|
|
@@ -64966,6 +65432,11 @@ object({
|
|
|
64966
65432
|
bucket: string(),
|
|
64967
65433
|
retained: array(hostingStorageGatewayRetainedDataSchema)
|
|
64968
65434
|
});
|
|
65435
|
+
var hostingStorageBackendEnumSchema = _enum([
|
|
65436
|
+
"longhorn",
|
|
65437
|
+
"ceph",
|
|
65438
|
+
"local-path"
|
|
65439
|
+
]);
|
|
64969
65440
|
var hostingStorageBindingDataSchema = object({
|
|
64970
65441
|
uuid: string(),
|
|
64971
65442
|
environmentUuid: string(),
|
|
@@ -65015,12 +65486,42 @@ var hostingStorageBucketDataSchema = object({
|
|
|
65015
65486
|
retiredAt: string().nullable()
|
|
65016
65487
|
});
|
|
65017
65488
|
object({ items: array(hostingStorageBucketDataSchema) });
|
|
65489
|
+
var hostingStorageDefaultDataSchema = object({
|
|
65490
|
+
clusterUuid: string(),
|
|
65491
|
+
volumeType: string(),
|
|
65492
|
+
storageClassUuid: string(),
|
|
65493
|
+
storageClassName: string()
|
|
65494
|
+
});
|
|
65495
|
+
object({
|
|
65496
|
+
classes: array(hostingStorageClassDataSchema),
|
|
65497
|
+
defaults: array(hostingStorageDefaultDataSchema),
|
|
65498
|
+
backends: array(object({
|
|
65499
|
+
slug: string(),
|
|
65500
|
+
name: string(),
|
|
65501
|
+
reportsUsedBytes: boolean(),
|
|
65502
|
+
supportsBackingImages: boolean(),
|
|
65503
|
+
enabled: boolean()
|
|
65504
|
+
})),
|
|
65505
|
+
volumeTypes: array(object({
|
|
65506
|
+
slug: string(),
|
|
65507
|
+
name: string()
|
|
65508
|
+
}))
|
|
65509
|
+
});
|
|
65018
65510
|
object({
|
|
65019
65511
|
ceilingCents: int().nullable(),
|
|
65020
65512
|
effectiveFrom: string().nullable(),
|
|
65021
65513
|
currency: string()
|
|
65022
65514
|
});
|
|
65023
65515
|
var hostingStorageCeilingRequestSchema = object({ ceilingCents: int().min(0).max(1e8).nullable() }).describe("Setting the most a company may be charged for S3 download overage in a month.\n\nThe amount includes VAT, like every other storage price, and zero is a real choice: it means the client allows no\noverage at all. `ceilingCents: null` is how the ceiling is removed, which is a different promise from zero and must\nnot be expressible by omission — a body without the key is refused rather than read as \"remove it\".");
|
|
65516
|
+
object({
|
|
65517
|
+
observed: boolean(),
|
|
65518
|
+
provisioner: string().nullable(),
|
|
65519
|
+
backendMatches: boolean(),
|
|
65520
|
+
reclaimPolicy: string().nullable(),
|
|
65521
|
+
allowVolumeExpansion: boolean().nullable(),
|
|
65522
|
+
volumeBindingMode: string().nullable(),
|
|
65523
|
+
reason: string().nullable()
|
|
65524
|
+
});
|
|
65024
65525
|
object({ items: array(object({
|
|
65025
65526
|
uuid: string(),
|
|
65026
65527
|
accessKeyHint: string(),
|
|
@@ -65185,6 +65686,11 @@ object({
|
|
|
65185
65686
|
pause: hostingUpdatePauseDataSchema,
|
|
65186
65687
|
capabilities: hostingUpdateSurfaceCapabilitiesDataSchema
|
|
65187
65688
|
});
|
|
65689
|
+
var hostingVolumeEnumSchema = _enum([
|
|
65690
|
+
"application-files",
|
|
65691
|
+
"database-data",
|
|
65692
|
+
"redis-data"
|
|
65693
|
+
]);
|
|
65188
65694
|
var impersonationSessionDataSchema = object({
|
|
65189
65695
|
uuid: string(),
|
|
65190
65696
|
operator: userDataSchema,
|
|
@@ -65549,6 +66055,7 @@ object({
|
|
|
65549
66055
|
requiresReauthentication: boolean()
|
|
65550
66056
|
});
|
|
65551
66057
|
var promoteHostingSeedVersionRequestSchema = object({ versionUuid: uuid() }).describe("Promote one immutable version to the version this definition selects for future claims.\n\nThe version is named by UUID; whether it belongs to the addressed definition is checked in the\nservice against the definition that owns the route, so the field rule is a shape check only.");
|
|
66058
|
+
var provisionHostingPoolRequestSchema = object({ unitQuantity: int().min(1) }).describe("Platform client-management middleware owns authority; the service refuses priced accounts.");
|
|
65552
66059
|
var publicPriceDataSchema = object({
|
|
65553
66060
|
product: string(),
|
|
65554
66061
|
priceKey: string(),
|
|
@@ -65628,6 +66135,15 @@ var refundBillingCollectionReceiptRequestSchema = object({
|
|
|
65628
66135
|
refundReference: string().max(64).describe("The provider's refund reference. Required, and kept on this return only: it is not a destination."),
|
|
65629
66136
|
requestKey: string().max(64).nullish().describe("Idempotency key, unique per company. A replay returns this return; a different payload fails.")
|
|
65630
66137
|
}).describe("Record that verified money came back.\n\nThe reason is required because it is the evidence for a return: a refund is a cash movement, and the record\nhas to say who established it and why. A credit note is a supply reversal and is not this.\n\nThere is no destination field, by design. The money goes back to the original payment instrument; this\nrequest only carries the provider's own refund reference so the return can be checked against it later.");
|
|
66138
|
+
var registerHostingStorageClassRequestSchema = object({
|
|
66139
|
+
clusterUuid: uuid(),
|
|
66140
|
+
backendType: hostingStorageBackendEnumSchema,
|
|
66141
|
+
kubernetesName: string().max(253).regex(/^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/),
|
|
66142
|
+
name: string().max(100),
|
|
66143
|
+
description: string().max(500).nullish(),
|
|
66144
|
+
volumeTypes: array(hostingVolumeEnumSchema).min(1),
|
|
66145
|
+
enabled: boolean().optional()
|
|
66146
|
+
}).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.");
|
|
65631
66147
|
object({
|
|
65632
66148
|
name: string().max(255),
|
|
65633
66149
|
email: email().max(255).describe("Live rows only. A closed account keeps its address as retained\nhistory, so the address is registrable again as a new person — which\nis the only reason this is not the whole-table rule it used to be."),
|
|
@@ -66006,6 +66522,10 @@ object({
|
|
|
66006
66522
|
desiredGeneration: int().min(1),
|
|
66007
66523
|
running: boolean()
|
|
66008
66524
|
});
|
|
66525
|
+
var setHostingClusterStorageDefaultRequestSchema = object({
|
|
66526
|
+
volumeType: hostingVolumeEnumSchema,
|
|
66527
|
+
storageClassUuid: uuid()
|
|
66528
|
+
}).describe("Choose the class a cluster allocates a claim type from when an environment names no choice.\n\nIt is desired state for future allocation only: a volume already bound keeps its recorded class.");
|
|
66009
66529
|
var setHostingEnvironmentDeletionProtectionRequestSchema = object({
|
|
66010
66530
|
locked: boolean(),
|
|
66011
66531
|
desiredGeneration: int().min(0),
|
|
@@ -66027,6 +66547,7 @@ var setHostingServiceRuntimeRequestSchema = object({
|
|
|
66027
66547
|
type: string().optional(),
|
|
66028
66548
|
stoppedAt: string().optional()
|
|
66029
66549
|
}).describe("Stopping or starting one shared service.\n\nThe service is addressed by its route type slug inside the authorized environment, so this request\ncannot reach a different service, and neither a status nor a retirement state can be sent here: this\nendpoint changes whether a service is serving, and nothing else.");
|
|
66550
|
+
var setHostingStorageClassEnabledRequestSchema = object({ enabled: boolean() }).describe("Switch one registered class's enabled state.");
|
|
66030
66551
|
var setHostingStorageSubscriptionAllocationRequestSchema = object({ gigabytes: int().min(0).max(1e5) }).describe("Set how much of the company's included package storage one bucket holds.\n\nThe body is the desired quantity, not a delta, so a retry is not a second change. Zero is a real instruction: it\nreleases the storage back to the pool, which is why the value is validated as \"at least nothing\" rather than \"at\n * least one\".");
|
|
66031
66552
|
var startEmailMailboxSyncActionRequestSchema = object({
|
|
66032
66553
|
recurrence: emailMailboxSyncRecurrenceModeEnumSchema,
|
|
@@ -66415,7 +66936,7 @@ var storePlatformHostingEnvironmentRequestSchema = object({
|
|
|
66415
66936
|
application: string().max(100),
|
|
66416
66937
|
server: string().max(100)
|
|
66417
66938
|
})).optional(),
|
|
66418
|
-
postgresRestoreSource: object({ sourceEnvironmentUuid: uuid().optional() }).
|
|
66939
|
+
postgresRestoreSource: object({ sourceEnvironmentUuid: uuid().optional() }).nullish(),
|
|
66419
66940
|
configuration: string().max(65536).optional()
|
|
66420
66941
|
}).describe("One client's environment, submitted by a staff operator who holds no membership in that client.\n\nEvery field rule is the customer's own, including the preset merge and the package allowlist: only the source of the\ncompany differs, because this request has no company middleware and names the client in the URL. A rule restated\nhere would be a second definition of what an environment may be.");
|
|
66421
66942
|
var systemOrphansHolderDataSchema = object({
|
|
@@ -66640,6 +67161,10 @@ var updateHostingEnvironmentRequestSchema = object({
|
|
|
66640
67161
|
sizeMib: int().min(1)
|
|
66641
67162
|
})).min(1).max(20)
|
|
66642
67163
|
}).describe("A change to an existing environment's budget and allocations.\n\nThe submitted lists must name exactly the workloads and volumes that already\nexist: this request replaces values, and adding or removing a workload or\nvolume is a different operation. `desiredGeneration` must match the stored\ngeneration, which the service checks under its lock.");
|
|
67164
|
+
var updateHostingEnvironmentStorageSelectionRequestSchema = object({
|
|
67165
|
+
volumeType: hostingVolumeEnumSchema,
|
|
67166
|
+
storageClassUuid: uuid()
|
|
67167
|
+
}).describe("Choose the storage class one environment allocates a claim type from.\n\nThe chosen class must be enabled, registered on the environment's own cluster and offered for the\ntype; the writer refuses anything else with a field error. Existing volumes keep their binding.");
|
|
66643
67168
|
var updateHostingGeneratedHostnameWordRequestSchema = object({ enabled: boolean() }).describe("Switch one word in the generated-hostname vocabulary on or off.\n\nDisabling is the only write: a word already drawn into an address is never removed or renamed, because\nthe address is a client's permanent fallback route. Disabling stops a word being drawn again.");
|
|
66644
67169
|
var updateHostingObjectCacheSettingsRequestSchema = object({
|
|
66645
67170
|
desiredGeneration: int().min(1),
|
|
@@ -66712,6 +67237,11 @@ var updateHostingStorageCapacityRequestSchema = object({ quote: object({
|
|
|
66712
67237
|
generatedAt: string(),
|
|
66713
67238
|
reviewToken: string()
|
|
66714
67239
|
}) }).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
|
+
var updateHostingStorageClassRequestSchema = object({
|
|
67241
|
+
name: string().max(100),
|
|
67242
|
+
description: string().max(500).nullish()
|
|
67243
|
+
}).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
|
+
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.");
|
|
66715
67245
|
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.");
|
|
66716
67246
|
var updateHostingToolSelectionRequestSchema = object({
|
|
66717
67247
|
enabled: boolean(),
|
|
@@ -67913,6 +68443,11 @@ union([
|
|
|
67913
68443
|
messageDataSchema,
|
|
67914
68444
|
messageDataSchema
|
|
67915
68445
|
]);
|
|
68446
|
+
union([
|
|
68447
|
+
object({ message: string().describe("Error overview.") }),
|
|
68448
|
+
object({ message: string().describe("Error overview.") }),
|
|
68449
|
+
messageDataSchema
|
|
68450
|
+
]);
|
|
67916
68451
|
union([
|
|
67917
68452
|
object({ message: string().describe("Error overview.") }),
|
|
67918
68453
|
object({ message: string().describe("Error overview.") }),
|
|
@@ -68461,6 +68996,18 @@ union([
|
|
|
68461
68996
|
object({ message: string().describe("Error overview.") }),
|
|
68462
68997
|
messageDataSchema
|
|
68463
68998
|
]);
|
|
68999
|
+
union([
|
|
69000
|
+
object({ message: string().describe("Error overview.") }),
|
|
69001
|
+
object({ message: string().describe("Error overview.") }),
|
|
69002
|
+
messageDataSchema
|
|
69003
|
+
]);
|
|
69004
|
+
updateHostingEnvironmentStorageSelectionRequestSchema.describe("Choose the storage class one environment allocates a claim type from.\n\nThe chosen class must be enabled, registered on the environment's own cluster and offered for the\ntype; the writer refuses anything else with a field error. Existing volumes keep their binding.");
|
|
69005
|
+
union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
|
|
69006
|
+
union([
|
|
69007
|
+
object({ message: string().describe("Error overview.") }),
|
|
69008
|
+
object({ message: string().describe("Error overview.") }),
|
|
69009
|
+
messageDataSchema
|
|
69010
|
+
]);
|
|
68464
69011
|
var hostingExternalSecretStoreStatus200Schema = hostingExternalSecretConnectionDataSchema;
|
|
68465
69012
|
var hostingExternalSecretStoreStatus201Schema = hostingExternalSecretConnectionDataSchema;
|
|
68466
69013
|
var hostingExternalSecretStoreStatus401Schema = object({ message: string().describe("Error overview.") });
|
|
@@ -68674,11 +69221,8 @@ union([
|
|
|
68674
69221
|
object({ message: string().describe("Error overview.") }),
|
|
68675
69222
|
messageDataSchema
|
|
68676
69223
|
]);
|
|
68677
|
-
var hostingDeploymentPrepareImageStatus200Schema =
|
|
68678
|
-
|
|
68679
|
-
status: union([hostingReleaseStatusTypeSchema, _null()])
|
|
68680
|
-
});
|
|
68681
|
-
var hostingDeploymentPrepareImageStatus202Schema = string();
|
|
69224
|
+
var hostingDeploymentPrepareImageStatus200Schema = hostingReleasePrepareDataSchema;
|
|
69225
|
+
var hostingDeploymentPrepareImageStatus202Schema = hostingReleasePrepareDataSchema;
|
|
68682
69226
|
var hostingDeploymentPrepareImageStatus401Schema = object({ message: string().describe("Error overview.") });
|
|
68683
69227
|
var hostingDeploymentPrepareImageStatus403Schema = object({ message: string().describe("Error overview.") });
|
|
68684
69228
|
var hostingDeploymentPrepareImageStatus404Schema = messageDataSchema;
|
|
@@ -70005,6 +70549,17 @@ union([
|
|
|
70005
70549
|
object({ message: string().describe("Error overview.") }),
|
|
70006
70550
|
messageDataSchema
|
|
70007
70551
|
]);
|
|
70552
|
+
string().describe("The company slug");
|
|
70553
|
+
union([
|
|
70554
|
+
object({ message: string().describe("Error overview.") }),
|
|
70555
|
+
object({ message: string().describe("Error overview.") }),
|
|
70556
|
+
object({ message: string().describe("Error overview.") }),
|
|
70557
|
+
object({
|
|
70558
|
+
message: string().describe("Errors overview."),
|
|
70559
|
+
errors: record$1(string(), array(string())).describe("A detailed description of each field that failed validation.")
|
|
70560
|
+
})
|
|
70561
|
+
]);
|
|
70562
|
+
provisionHostingPoolRequestSchema.describe("Platform client-management middleware owns authority; the service refuses priced accounts.");
|
|
70008
70563
|
union([
|
|
70009
70564
|
object({ message: string().describe("Error overview.") }),
|
|
70010
70565
|
object({ message: string().describe("Error overview.") }),
|
|
@@ -70198,6 +70753,51 @@ union([
|
|
|
70198
70753
|
errors: record$1(string(), array(string())).describe("A detailed description of each field that failed validation.")
|
|
70199
70754
|
})
|
|
70200
70755
|
]);
|
|
70756
|
+
union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
|
|
70757
|
+
union([
|
|
70758
|
+
object({ message: string().describe("Error overview.") }),
|
|
70759
|
+
object({ message: string().describe("Error overview.") }),
|
|
70760
|
+
object({
|
|
70761
|
+
message: string().describe("Errors overview."),
|
|
70762
|
+
errors: record$1(string(), array(string())).describe("A detailed description of each field that failed validation.")
|
|
70763
|
+
})
|
|
70764
|
+
]);
|
|
70765
|
+
registerHostingStorageClassRequestSchema.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.");
|
|
70766
|
+
union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
|
|
70767
|
+
union([
|
|
70768
|
+
object({ message: string().describe("Error overview.") }),
|
|
70769
|
+
object({ message: string().describe("Error overview.") }),
|
|
70770
|
+
messageDataSchema,
|
|
70771
|
+
object({
|
|
70772
|
+
message: string().describe("Errors overview."),
|
|
70773
|
+
errors: record$1(string(), array(string())).describe("A detailed description of each field that failed validation.")
|
|
70774
|
+
})
|
|
70775
|
+
]);
|
|
70776
|
+
updateHostingStorageClassRequestSchema.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.");
|
|
70777
|
+
union([
|
|
70778
|
+
object({ message: string().describe("Error overview.") }),
|
|
70779
|
+
object({ message: string().describe("Error overview.") }),
|
|
70780
|
+
object({
|
|
70781
|
+
message: string().describe("Errors overview."),
|
|
70782
|
+
errors: record$1(string(), array(string())).describe("A detailed description of each field that failed validation.")
|
|
70783
|
+
})
|
|
70784
|
+
]);
|
|
70785
|
+
setHostingStorageClassEnabledRequestSchema.describe("Switch one registered class's enabled state.");
|
|
70786
|
+
union([
|
|
70787
|
+
object({ message: string().describe("Error overview.") }),
|
|
70788
|
+
object({ message: string().describe("Error overview.") }),
|
|
70789
|
+
messageDataSchema
|
|
70790
|
+
]);
|
|
70791
|
+
updateHostingStorageClassVolumeTypesRequestSchema.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.");
|
|
70792
|
+
union([
|
|
70793
|
+
object({ message: string().describe("Error overview.") }),
|
|
70794
|
+
object({ message: string().describe("Error overview.") }),
|
|
70795
|
+
object({
|
|
70796
|
+
message: string().describe("Errors overview."),
|
|
70797
|
+
errors: record$1(string(), array(string())).describe("A detailed description of each field that failed validation.")
|
|
70798
|
+
})
|
|
70799
|
+
]);
|
|
70800
|
+
setHostingClusterStorageDefaultRequestSchema.describe("Choose the class a cluster allocates a claim type from when an environment names no choice.\n\nIt is desired state for future allocation only: a volume already bound keeps its recorded class.");
|
|
70201
70801
|
union([
|
|
70202
70802
|
object({ message: string().describe("Error overview.") }),
|
|
70203
70803
|
messageDataSchema,
|
|
@@ -70574,7 +71174,8 @@ var SIMPLE_SUBCOMMANDS = {
|
|
|
70574
71174
|
databases,
|
|
70575
71175
|
database,
|
|
70576
71176
|
"runtime-versions": environmentRuntimeVersions,
|
|
70577
|
-
"runtime-version-grants": environmentRuntimeVersionGrants
|
|
71177
|
+
"runtime-version-grants": environmentRuntimeVersionGrants,
|
|
71178
|
+
storage: environmentStorage
|
|
70578
71179
|
};
|
|
70579
71180
|
/** Which feature group answers this subcommand and arguments, or null when the command itself does. */
|
|
70580
71181
|
function dispatched(context, subcommand, rest) {
|
|
@@ -70829,7 +71430,7 @@ var keys$1 = {
|
|
|
70829
71430
|
async run(context) {
|
|
70830
71431
|
const [subcommand, ...rest] = context.positional;
|
|
70831
71432
|
if (subcommand === void 0) return await list$3();
|
|
70832
|
-
if (subcommand === "add") return await add$
|
|
71433
|
+
if (subcommand === "add") return await add$5(context, rest);
|
|
70833
71434
|
if (subcommand === "remove") return await remove(context, rest);
|
|
70834
71435
|
throw new UsageError(KEYS_USAGE);
|
|
70835
71436
|
},
|
|
@@ -70856,7 +71457,7 @@ async function list$3() {
|
|
|
70856
71457
|
}, "personal SSH keys");
|
|
70857
71458
|
}
|
|
70858
71459
|
/** `add --name … --public-key-file … --current-password-* …`. */
|
|
70859
|
-
async function add$
|
|
71460
|
+
async function add$5(context, rest) {
|
|
70860
71461
|
if (rest.length > 0) throw new UsageError(KEYS_USAGE);
|
|
70861
71462
|
const name = context.flags.get("--name")?.trim() ?? "";
|
|
70862
71463
|
const file = context.flags.get("--public-key-file") ?? "";
|
|
@@ -71033,7 +71634,7 @@ async function platformDirectory(context, group, args) {
|
|
|
71033
71634
|
}
|
|
71034
71635
|
/** `users`, filtered by the API's own query keys. */
|
|
71035
71636
|
async function users(context, args) {
|
|
71036
|
-
noExtra$
|
|
71637
|
+
noExtra$8(args);
|
|
71037
71638
|
const search = context.flags.get("--search")?.trim() ?? "";
|
|
71038
71639
|
const company = context.flags.get("--company")?.trim() ?? "";
|
|
71039
71640
|
const { items } = await allPages(async (page, perPage) => {
|
|
@@ -71055,7 +71656,7 @@ async function users(context, args) {
|
|
|
71055
71656
|
}
|
|
71056
71657
|
/** `company-activity <slug>`, newest first. */
|
|
71057
71658
|
async function companyActivity(context, slug, rest) {
|
|
71058
|
-
noExtra$
|
|
71659
|
+
noExtra$8(rest);
|
|
71059
71660
|
const event = context.flags.get("--event")?.trim() ?? "";
|
|
71060
71661
|
const log = context.flags.get("--log")?.trim() ?? "";
|
|
71061
71662
|
const { items } = await allPages(async (page, perPage) => {
|
|
@@ -71093,7 +71694,7 @@ async function activityOne(slug, rest) {
|
|
|
71093
71694
|
}
|
|
71094
71695
|
/** `user-closure <uuid>`: what closing the account would remove and keep. */
|
|
71095
71696
|
async function userClosure(uuid, rest) {
|
|
71096
|
-
noExtra$
|
|
71697
|
+
noExtra$8(rest);
|
|
71097
71698
|
return {
|
|
71098
71699
|
kind: "user-closure",
|
|
71099
71700
|
review: (await platformUserClosureShow({ path: { userUuid: uuid } })).data
|
|
@@ -71101,7 +71702,7 @@ async function userClosure(uuid, rest) {
|
|
|
71101
71702
|
}
|
|
71102
71703
|
/** `user-close <uuid> --reason …`: close the account the review described. */
|
|
71103
71704
|
async function closeUser(context, uuid, rest) {
|
|
71104
|
-
noExtra$
|
|
71705
|
+
noExtra$8(rest);
|
|
71105
71706
|
const reason = context.flags.get("--reason")?.trim() ?? "";
|
|
71106
71707
|
if (reason === "") throw new UsageError(`user-close needs --reason.\n\n${USAGE$13}`);
|
|
71107
71708
|
const review = (await platformUserClosureShow({ path: { userUuid: uuid } })).data;
|
|
@@ -71118,7 +71719,7 @@ async function closeUser(context, uuid, rest) {
|
|
|
71118
71719
|
};
|
|
71119
71720
|
}
|
|
71120
71721
|
/** No positional arguments, or a usage refusal. */
|
|
71121
|
-
function noExtra$
|
|
71722
|
+
function noExtra$8(rest) {
|
|
71122
71723
|
if (rest.length > 0) throw new UsageError(USAGE$13);
|
|
71123
71724
|
}
|
|
71124
71725
|
//#endregion
|
|
@@ -71169,7 +71770,7 @@ async function platformAdmin(context, group, args) {
|
|
|
71169
71770
|
}
|
|
71170
71771
|
/** `companies`, filtered by the API's own query keys. */
|
|
71171
71772
|
async function companies(context, args) {
|
|
71172
|
-
noExtra$
|
|
71773
|
+
noExtra$7(args);
|
|
71173
71774
|
const search = context.flags.get("--search")?.trim() ?? "";
|
|
71174
71775
|
const state = context.flags.get("--state")?.trim() ?? "";
|
|
71175
71776
|
const { items } = await allPages(async (page, perPage) => {
|
|
@@ -71191,7 +71792,7 @@ async function companies(context, args) {
|
|
|
71191
71792
|
}
|
|
71192
71793
|
/** `company-add --name … --slug … --admin-email …`. */
|
|
71193
71794
|
async function addCompany(context, args) {
|
|
71194
|
-
noExtra$
|
|
71795
|
+
noExtra$7(args);
|
|
71195
71796
|
const body = {
|
|
71196
71797
|
name: requiredFlag$3(context, "--name", USAGE$12),
|
|
71197
71798
|
slug: requiredFlag$3(context, "--slug", USAGE$12).toLowerCase(),
|
|
@@ -71204,7 +71805,7 @@ async function addCompany(context, args) {
|
|
|
71204
71805
|
}
|
|
71205
71806
|
/** `company-member-add --company … --email … --role …`: attach an account that already exists. */
|
|
71206
71807
|
async function addCompanyMember(context, args) {
|
|
71207
|
-
noExtra$
|
|
71808
|
+
noExtra$7(args);
|
|
71208
71809
|
const company = requiredFlag$3(context, "--company", USAGE$12);
|
|
71209
71810
|
const email = requiredFlag$3(context, "--email", USAGE$12).toLowerCase();
|
|
71210
71811
|
const role = companyRole(context.flags.get("--role"), USAGE$12);
|
|
@@ -71221,7 +71822,7 @@ async function addCompanyMember(context, args) {
|
|
|
71221
71822
|
}
|
|
71222
71823
|
/** `domain-lookup --hostname …`: which company's claim the name sits on. */
|
|
71223
71824
|
async function lookup(context, args) {
|
|
71224
|
-
noExtra$
|
|
71825
|
+
noExtra$7(args);
|
|
71225
71826
|
return {
|
|
71226
71827
|
kind: "domain-claim",
|
|
71227
71828
|
claim: (await platformDomainOwnershipLookup({ query: { "filter[hostname]": requiredFlag$3(context, "--hostname", USAGE$12).toLowerCase() } })).data
|
|
@@ -71229,7 +71830,7 @@ async function lookup(context, args) {
|
|
|
71229
71830
|
}
|
|
71230
71831
|
/** `company-closure <slug>`: what closing the company would do. */
|
|
71231
71832
|
async function companyClosure(slug, rest) {
|
|
71232
|
-
noExtra$
|
|
71833
|
+
noExtra$7(rest);
|
|
71233
71834
|
return {
|
|
71234
71835
|
kind: "company-closure",
|
|
71235
71836
|
review: (await platformCompanyClosureShow({ path: { company: slug } })).data
|
|
@@ -71237,7 +71838,7 @@ async function companyClosure(slug, rest) {
|
|
|
71237
71838
|
}
|
|
71238
71839
|
/** `company-close <slug> --reason …`: request the closure the review described. */
|
|
71239
71840
|
async function closeCompany(context, slug, rest) {
|
|
71240
|
-
noExtra$
|
|
71841
|
+
noExtra$7(rest);
|
|
71241
71842
|
const reason = requiredFlag$3(context, "--reason", USAGE$12);
|
|
71242
71843
|
const review = (await platformCompanyClosureShow({ path: { company: slug } })).data;
|
|
71243
71844
|
if (!review.canFinalise) throw new UsageError(`Closing ${slug} is blocked: ${review.blockingReasons.join("; ") || "the review cannot be finalised"}.`);
|
|
@@ -71254,7 +71855,7 @@ async function closeCompany(context, slug, rest) {
|
|
|
71254
71855
|
}
|
|
71255
71856
|
/** `company-close-accept <slug>`: the step that acts on a recorded closure. */
|
|
71256
71857
|
async function acceptCompany(context, slug, rest) {
|
|
71257
|
-
noExtra$
|
|
71858
|
+
noExtra$7(rest);
|
|
71258
71859
|
const outcome = await confirmableWrite(context, `Accept the recorded closure of ${slug}. This is the step that acts on it.`, async () => (await platformCompanyClosureAccept({ path: { company: slug } })).data);
|
|
71259
71860
|
return outcome.sent ? {
|
|
71260
71861
|
kind: "admin-message",
|
|
@@ -71265,7 +71866,7 @@ async function acceptCompany(context, slug, rest) {
|
|
|
71265
71866
|
};
|
|
71266
71867
|
}
|
|
71267
71868
|
/** No positional arguments, or a usage refusal. */
|
|
71268
|
-
function noExtra$
|
|
71869
|
+
function noExtra$7(rest) {
|
|
71269
71870
|
if (rest.length > 0) throw new UsageError(USAGE$12);
|
|
71270
71871
|
}
|
|
71271
71872
|
//#endregion
|
|
@@ -71381,25 +71982,25 @@ var USAGE$11 = [
|
|
|
71381
71982
|
/** `platform alerts|alert-*|github-app|yahoo-feedback*`. */
|
|
71382
71983
|
async function platformAlerts(context, group, args) {
|
|
71383
71984
|
if (group === "alerts") {
|
|
71384
|
-
noExtra$
|
|
71985
|
+
noExtra$6(args);
|
|
71385
71986
|
return {
|
|
71386
71987
|
kind: "alert-settings",
|
|
71387
71988
|
settings: (await platformAlertIndex()).data
|
|
71388
71989
|
};
|
|
71389
71990
|
}
|
|
71390
71991
|
if (group === "github-app") {
|
|
71391
|
-
noExtra$
|
|
71992
|
+
noExtra$6(args);
|
|
71392
71993
|
return {
|
|
71393
71994
|
kind: "github-app",
|
|
71394
71995
|
app: (await platformGithubAppStatus()).data
|
|
71395
71996
|
};
|
|
71396
71997
|
}
|
|
71397
|
-
if (group === "alert-add") return await add$
|
|
71998
|
+
if (group === "alert-add") return await add$4(context, args);
|
|
71398
71999
|
if (group === "alert-test") return await test(context, args);
|
|
71399
72000
|
if (group === "alert-settings") return await settings(context, args);
|
|
71400
72001
|
if (group === "alert") return await alert(context, args);
|
|
71401
72002
|
if (group === "yahoo-feedback") {
|
|
71402
|
-
noExtra$
|
|
72003
|
+
noExtra$6(args);
|
|
71403
72004
|
return {
|
|
71404
72005
|
kind: "yahoo-feedback",
|
|
71405
72006
|
feedback: (await yahooFeedbackShow()).data
|
|
@@ -71409,8 +72010,8 @@ async function platformAlerts(context, group, args) {
|
|
|
71409
72010
|
throw new UsageError(USAGE$11);
|
|
71410
72011
|
}
|
|
71411
72012
|
/** `alert-add --email …`. */
|
|
71412
|
-
async function add$
|
|
71413
|
-
noExtra$
|
|
72013
|
+
async function add$4(context, args) {
|
|
72014
|
+
noExtra$6(args);
|
|
71414
72015
|
const email = context.flags.get("--email")?.trim().toLowerCase() ?? "";
|
|
71415
72016
|
if (email === "") throw new UsageError(`alert-add needs --email.\n\n${USAGE$11}`);
|
|
71416
72017
|
return {
|
|
@@ -71422,7 +72023,7 @@ async function add$3(context, args) {
|
|
|
71422
72023
|
}
|
|
71423
72024
|
/** `alert-test`: one alert to every enabled recipient. */
|
|
71424
72025
|
async function test(context, args) {
|
|
71425
|
-
noExtra$
|
|
72026
|
+
noExtra$6(args);
|
|
71426
72027
|
return {
|
|
71427
72028
|
kind: "alert-write",
|
|
71428
72029
|
outcome: await confirmableWrite(context, "Send one test platform alert to every enabled recipient.", async () => (await platformAlertTest()).data)
|
|
@@ -71430,7 +72031,7 @@ async function test(context, args) {
|
|
|
71430
72031
|
}
|
|
71431
72032
|
/** `alert-settings --monitoring on|off`. */
|
|
71432
72033
|
async function settings(context, args) {
|
|
71433
|
-
noExtra$
|
|
72034
|
+
noExtra$6(args);
|
|
71434
72035
|
const monitoringEnabled = onOffFlag(context, "--monitoring");
|
|
71435
72036
|
if (monitoringEnabled === null) throw new UsageError(`alert-settings needs --monitoring.\n\n${USAGE$11}`);
|
|
71436
72037
|
const outcome = await confirmableWrite(context, `Turn platform monitoring ${monitoringEnabled ? "on" : "off"}.`, async () => (await platformAlertUpdateSettings({ body: { monitoringEnabled } })).data);
|
|
@@ -71472,7 +72073,7 @@ async function alert(context, args) {
|
|
|
71472
72073
|
}
|
|
71473
72074
|
/** `yahoo-feedback-set --enabled … [--mailbox …]`. */
|
|
71474
72075
|
async function feedback(context, args) {
|
|
71475
|
-
noExtra$
|
|
72076
|
+
noExtra$6(args);
|
|
71476
72077
|
const enabled = onOffFlag(context, "--enabled");
|
|
71477
72078
|
if (enabled === null) throw new UsageError(`yahoo-feedback-set needs --enabled.\n\n${USAGE$11}`);
|
|
71478
72079
|
const mailbox = context.flags.get("--mailbox")?.trim() ?? "";
|
|
@@ -71489,7 +72090,7 @@ async function current() {
|
|
|
71489
72090
|
return (await platformAlertIndex()).data;
|
|
71490
72091
|
}
|
|
71491
72092
|
/** No positional arguments, or a usage refusal. */
|
|
71492
|
-
function noExtra$
|
|
72093
|
+
function noExtra$6(args) {
|
|
71493
72094
|
if (args.length > 0) throw new UsageError(USAGE$11);
|
|
71494
72095
|
}
|
|
71495
72096
|
/** The `platform alerts|alert-*|github-app|yahoo-feedback*` renderer. */
|
|
@@ -71849,7 +72450,7 @@ async function platformEmail(context, rest) {
|
|
|
71849
72450
|
if (action === "dmarc-replay") return await replay(context, tail);
|
|
71850
72451
|
if (action === "signals") return await signals(tail);
|
|
71851
72452
|
if (action === "postmaster") {
|
|
71852
|
-
noExtra$
|
|
72453
|
+
noExtra$5(tail);
|
|
71853
72454
|
return {
|
|
71854
72455
|
kind: "postmaster",
|
|
71855
72456
|
status: (await googlePostmasterShow({})).data
|
|
@@ -71858,12 +72459,12 @@ async function platformEmail(context, rest) {
|
|
|
71858
72459
|
throw new UsageError(USAGE$8);
|
|
71859
72460
|
}
|
|
71860
72461
|
/** No positional arguments, or a usage refusal. */
|
|
71861
|
-
function noExtra$
|
|
72462
|
+
function noExtra$5(rest) {
|
|
71862
72463
|
if (rest.length > 0) throw new UsageError(USAGE$8);
|
|
71863
72464
|
}
|
|
71864
72465
|
/** `blocklist`. */
|
|
71865
72466
|
async function blocklist(rest) {
|
|
71866
|
-
noExtra$
|
|
72467
|
+
noExtra$5(rest);
|
|
71867
72468
|
return {
|
|
71868
72469
|
kind: "blocklist",
|
|
71869
72470
|
blocklist: (await emailBlocklistIndex({})).data
|
|
@@ -71891,7 +72492,7 @@ async function acknowledge(context, rest) {
|
|
|
71891
72492
|
}
|
|
71892
72493
|
/** `dmarc`. */
|
|
71893
72494
|
async function dmarc(rest) {
|
|
71894
|
-
noExtra$
|
|
72495
|
+
noExtra$5(rest);
|
|
71895
72496
|
return {
|
|
71896
72497
|
kind: "dmarc",
|
|
71897
72498
|
settings: (await emailDmarcReportingShow({})).data
|
|
@@ -71899,7 +72500,7 @@ async function dmarc(rest) {
|
|
|
71899
72500
|
}
|
|
71900
72501
|
/** `dmarc-set --enabled … [--mailbox …]`. */
|
|
71901
72502
|
async function dmarcSet(context, rest) {
|
|
71902
|
-
noExtra$
|
|
72503
|
+
noExtra$5(rest);
|
|
71903
72504
|
const enabled = onOff$2(context, "--enabled");
|
|
71904
72505
|
const mailboxUuid = context.flags.get("--mailbox")?.trim() ?? "";
|
|
71905
72506
|
return {
|
|
@@ -71922,7 +72523,7 @@ async function replay(context, rest) {
|
|
|
71922
72523
|
}
|
|
71923
72524
|
/** `signals`. */
|
|
71924
72525
|
async function signals(rest) {
|
|
71925
|
-
noExtra$
|
|
72526
|
+
noExtra$5(rest);
|
|
71926
72527
|
return {
|
|
71927
72528
|
kind: "signals",
|
|
71928
72529
|
signals: (await emailNativeSignalShow({})).data
|
|
@@ -72165,8 +72766,8 @@ async function platformRuntimeVersions(context, rest) {
|
|
|
72165
72766
|
const [action, ...tail] = rest;
|
|
72166
72767
|
if (tail.length > 0) throw new UsageError(USAGE$7);
|
|
72167
72768
|
const path = {
|
|
72168
|
-
type: required$
|
|
72169
|
-
line: required$
|
|
72769
|
+
type: required$2(context, "--type"),
|
|
72770
|
+
line: required$2(context, "--line")
|
|
72170
72771
|
};
|
|
72171
72772
|
switch (action) {
|
|
72172
72773
|
case "preview": return {
|
|
@@ -72180,16 +72781,16 @@ async function platformRuntimeVersions(context, rest) {
|
|
|
72180
72781
|
note: flag(context, "--note")
|
|
72181
72782
|
}
|
|
72182
72783
|
})).data);
|
|
72183
|
-
case "announce": return write$1(context, `announce ${path.type} ${path.line} ending ${required$
|
|
72784
|
+
case "announce": return write$1(context, `announce ${path.type} ${path.line} ending ${required$2(context, "--until")}`, async () => (await platformRuntimeVersionAnnounce({
|
|
72184
72785
|
path,
|
|
72185
72786
|
body: {
|
|
72186
|
-
until: required$
|
|
72187
|
-
note: required$
|
|
72787
|
+
until: required$2(context, "--until"),
|
|
72788
|
+
note: required$2(context, "--note")
|
|
72188
72789
|
}
|
|
72189
72790
|
})).data);
|
|
72190
72791
|
case "retire": return write$1(context, `retire ${path.type} ${path.line}`, async () => (await platformRuntimeVersionRetirement({
|
|
72191
72792
|
path,
|
|
72192
|
-
body: { reason: required$
|
|
72793
|
+
body: { reason: required$2(context, "--reason") }
|
|
72193
72794
|
})).data);
|
|
72194
72795
|
case "evacuate": {
|
|
72195
72796
|
const limit = flag(context, "--limit");
|
|
@@ -72198,7 +72799,7 @@ async function platformRuntimeVersions(context, rest) {
|
|
|
72198
72799
|
outcome: await confirmableWrite(context, `move up to ${limit === "" ? "the configured batch of" : limit} applications off ${path.type} ${path.line}`, async () => (await platformRuntimeVersionEvacuate({
|
|
72199
72800
|
path,
|
|
72200
72801
|
body: {
|
|
72201
|
-
reason: required$
|
|
72802
|
+
reason: required$2(context, "--reason"),
|
|
72202
72803
|
...limit === "" ? {} : { limit: Number(limit) }
|
|
72203
72804
|
}
|
|
72204
72805
|
})).data)
|
|
@@ -72215,7 +72816,7 @@ async function write$1(context, description, send) {
|
|
|
72215
72816
|
};
|
|
72216
72817
|
}
|
|
72217
72818
|
/** One flag's value, refused by name when it was not given. */
|
|
72218
|
-
function required$
|
|
72819
|
+
function required$2(context, flagName) {
|
|
72219
72820
|
const value = flag(context, flagName);
|
|
72220
72821
|
if (value === "") throw new UsageError(`${flagName} is required.\n\n${USAGE$7}`);
|
|
72221
72822
|
return value;
|
|
@@ -72229,7 +72830,7 @@ var STATES = [
|
|
|
72229
72830
|
"forced"
|
|
72230
72831
|
];
|
|
72231
72832
|
function stateFlag(context) {
|
|
72232
|
-
const value = required$
|
|
72833
|
+
const value = required$2(context, "--state");
|
|
72233
72834
|
if (!STATES.includes(value)) throw new UsageError(`--state must be one of ${STATES.join(", ")}.\n\n${USAGE$7}`);
|
|
72234
72835
|
return value;
|
|
72235
72836
|
}
|
|
@@ -72437,7 +73038,7 @@ async function platformSeedPlacements(context, action, seedUuid, rest) {
|
|
|
72437
73038
|
if (versionUuid === void 0) throw new UsageError(USAGE$6);
|
|
72438
73039
|
if (action === "placement-add") {
|
|
72439
73040
|
if (third !== void 0 || extra.length > 0) throw new UsageError(USAGE$6);
|
|
72440
|
-
return await add$
|
|
73041
|
+
return await add$3(context, seedUuid, versionUuid);
|
|
72441
73042
|
}
|
|
72442
73043
|
if (third === void 0 || extra.length > 0) throw new UsageError(USAGE$6);
|
|
72443
73044
|
const path = {
|
|
@@ -72454,7 +73055,7 @@ async function platformSeedPlacements(context, action, seedUuid, rest) {
|
|
|
72454
73055
|
throw new UsageError(USAGE$6);
|
|
72455
73056
|
}
|
|
72456
73057
|
/** `placement-add`: ask for the version to be prepared on one cluster. */
|
|
72457
|
-
async function add$
|
|
73058
|
+
async function add$3(context, seedUuid, versionUuid) {
|
|
72458
73059
|
const body = {
|
|
72459
73060
|
clusterUuid: requiredFlag$3(context, "--cluster", USAGE$6),
|
|
72460
73061
|
preparationMode: preparationModeOf$1(context, "placement-add"),
|
|
@@ -72522,7 +73123,7 @@ var USAGE$5 = [
|
|
|
72522
73123
|
/** `seed words|word-add|word`. */
|
|
72523
73124
|
async function platformSeedWords(context, action, rest) {
|
|
72524
73125
|
if (action === "words") {
|
|
72525
|
-
noExtra$
|
|
73126
|
+
noExtra$4(rest);
|
|
72526
73127
|
return {
|
|
72527
73128
|
kind: "seed-words",
|
|
72528
73129
|
vocabulary: (await hostingGeneratedHostnameVocabularyIndex()).data
|
|
@@ -72534,7 +73135,7 @@ async function platformSeedWords(context, action, rest) {
|
|
|
72534
73135
|
}
|
|
72535
73136
|
/** `word-add --position … --word …`. */
|
|
72536
73137
|
async function addWord(context, rest) {
|
|
72537
|
-
noExtra$
|
|
73138
|
+
noExtra$4(rest);
|
|
72538
73139
|
const body = {
|
|
72539
73140
|
position: pickPosition(context),
|
|
72540
73141
|
word: requiredFlag$3(context, "--word", USAGE$5).toLowerCase(),
|
|
@@ -72573,7 +73174,7 @@ function onOff$1(context, flag) {
|
|
|
72573
73174
|
throw new UsageError(`${flag} must be on or off.\n\n${USAGE$5}`);
|
|
72574
73175
|
}
|
|
72575
73176
|
/** No positional arguments, or a usage refusal. */
|
|
72576
|
-
function noExtra$
|
|
73177
|
+
function noExtra$4(rest) {
|
|
72577
73178
|
if (rest.length > 0) throw new UsageError(USAGE$5);
|
|
72578
73179
|
}
|
|
72579
73180
|
//#endregion
|
|
@@ -72626,7 +73227,7 @@ async function platformSeeds(context, args) {
|
|
|
72626
73227
|
}
|
|
72627
73228
|
/** `list`: every definition with its selected version and placements. */
|
|
72628
73229
|
async function catalogue(rest) {
|
|
72629
|
-
noExtra$
|
|
73230
|
+
noExtra$3(rest);
|
|
72630
73231
|
return {
|
|
72631
73232
|
kind: "seed-catalogue",
|
|
72632
73233
|
catalogue: (await hostingSeedIndex()).data
|
|
@@ -72634,7 +73235,7 @@ async function catalogue(rest) {
|
|
|
72634
73235
|
}
|
|
72635
73236
|
/** `add --workload-type … --scope … --preparation-mode …`. */
|
|
72636
73237
|
async function addSeed(context, rest) {
|
|
72637
|
-
noExtra$
|
|
73238
|
+
noExtra$3(rest);
|
|
72638
73239
|
const body = {
|
|
72639
73240
|
workloadType: pick(Object.values(hostingWorkloadEnum), "--workload-type", context, "add"),
|
|
72640
73241
|
scope: pick(Object.values(hostingSeedScopeEnum), "--scope", context, "add"),
|
|
@@ -72649,7 +73250,7 @@ async function addSeed(context, rest) {
|
|
|
72649
73250
|
}
|
|
72650
73251
|
/** `set <seed> --preparation-mode …`. */
|
|
72651
73252
|
async function setSeed(context, seedUuid, rest) {
|
|
72652
|
-
noExtra$
|
|
73253
|
+
noExtra$3(rest);
|
|
72653
73254
|
const preparationMode = preparationModeOf(context, "set");
|
|
72654
73255
|
return {
|
|
72655
73256
|
kind: "seed-write",
|
|
@@ -72661,7 +73262,7 @@ async function setSeed(context, seedUuid, rest) {
|
|
|
72661
73262
|
}
|
|
72662
73263
|
/** `consumption <seed> --enabled …`: whether the definition is offered at all. */
|
|
72663
73264
|
async function consumption(context, seedUuid, rest) {
|
|
72664
|
-
noExtra$
|
|
73265
|
+
noExtra$3(rest);
|
|
72665
73266
|
const enabled = onOff(context, "--enabled", "consumption");
|
|
72666
73267
|
return {
|
|
72667
73268
|
kind: "seed-write",
|
|
@@ -72673,7 +73274,7 @@ async function consumption(context, seedUuid, rest) {
|
|
|
72673
73274
|
}
|
|
72674
73275
|
/** `promote <seed> --version …`. */
|
|
72675
73276
|
async function promote(context, seedUuid, rest) {
|
|
72676
|
-
noExtra$
|
|
73277
|
+
noExtra$3(rest);
|
|
72677
73278
|
const versionUuid = requiredFlag$3(context, "--version", USAGE$4);
|
|
72678
73279
|
return {
|
|
72679
73280
|
kind: "seed-write",
|
|
@@ -72685,7 +73286,7 @@ async function promote(context, seedUuid, rest) {
|
|
|
72685
73286
|
}
|
|
72686
73287
|
/** `version-add <seed> --source-* … [--content-contract <path>]`. */
|
|
72687
73288
|
async function addVersion(context, seedUuid, rest) {
|
|
72688
|
-
noExtra$
|
|
73289
|
+
noExtra$3(rest);
|
|
72689
73290
|
const body = {
|
|
72690
73291
|
sourceRelease: requiredFlag$3(context, "--source-release", USAGE$4),
|
|
72691
73292
|
sourceCommit: requiredFlag$3(context, "--source-commit", USAGE$4),
|
|
@@ -72722,7 +73323,7 @@ function onOff(context, flag, verb) {
|
|
|
72722
73323
|
throw new UsageError(`${verb} needs ${flag} on or off.\n\n${USAGE$4}`);
|
|
72723
73324
|
}
|
|
72724
73325
|
/** Exactly one positional value. */
|
|
72725
|
-
function noExtra$
|
|
73326
|
+
function noExtra$3(rest) {
|
|
72726
73327
|
if (rest.length > 0) throw new UsageError(USAGE$4);
|
|
72727
73328
|
}
|
|
72728
73329
|
//#endregion
|
|
@@ -73054,7 +73655,7 @@ function platformSeedsText(report) {
|
|
|
73054
73655
|
const { vocabulary } = report;
|
|
73055
73656
|
return [` ${String(vocabulary.words.length)} word(s), ${String(vocabulary.combinations)} possible name(s)`, ...vocabulary.words.map((one) => ` ${one.slug.padEnd(24)} ${one.position.padEnd(10)} ${one.enabled ? "enabled" : "disabled"}`)].join("\n");
|
|
73056
73657
|
}
|
|
73057
|
-
return catalogueText(report.catalogue);
|
|
73658
|
+
return catalogueText$1(report.catalogue);
|
|
73058
73659
|
}
|
|
73059
73660
|
/** Which write answered, named by the fields only that answer carries. */
|
|
73060
73661
|
function resultText(value) {
|
|
@@ -73064,7 +73665,7 @@ function resultText(value) {
|
|
|
73064
73665
|
return ` seed ${String(value.uuid)} ${String(value.workloadType)}/${String(value.scope)} ${String(value.preparationMode)}${value.enabled === false ? " not offered" : ""}`;
|
|
73065
73666
|
}
|
|
73066
73667
|
/** The catalogue: every definition, then what may be chosen. */
|
|
73067
|
-
function catalogueText(catalogue) {
|
|
73668
|
+
function catalogueText$1(catalogue) {
|
|
73068
73669
|
return [...catalogue.definitions.flatMap(definitionLines), ...catalogue.choices === null ? [" choices unavailable"] : choicesLines(catalogue.choices)].join("\n");
|
|
73069
73670
|
}
|
|
73070
73671
|
/** One definition, its selected version and its placements. */
|
|
@@ -73255,6 +73856,7 @@ var POOL_USAGE = [
|
|
|
73255
73856
|
"Usage: hostingctl pool --company <slug>",
|
|
73256
73857
|
" hostingctl pool quote --company <slug> --units <n>",
|
|
73257
73858
|
" hostingctl pool purchase --company <slug> --units <n> [--confirm]",
|
|
73859
|
+
" hostingctl pool provision --company <slug> --units <n> [--confirm]",
|
|
73258
73860
|
" hostingctl pool blocks --company <slug>",
|
|
73259
73861
|
" hostingctl pool blocks quote --company <slug> --blocks <n>",
|
|
73260
73862
|
" hostingctl pool blocks purchase --company <slug> --blocks <n> [--confirm]",
|
|
@@ -73267,6 +73869,9 @@ var POOL_USAGE = [
|
|
|
73267
73869
|
" billing. The API refuses a second purchase, an account still billed per environment, and a",
|
|
73268
73870
|
" company founded by HaakCo: changing a pool, converting an account and selling capacity to a",
|
|
73269
73871
|
" company we founded are decisions recorded as an agreement, not a self-service purchase.",
|
|
73872
|
+
" provision Platform client administrators assign an unbilled total holding before billing starts.",
|
|
73873
|
+
" No invoice details, paid quote or billing activation are required. Included storage can",
|
|
73874
|
+
" be assigned to S3 without another purchase. This cannot make an already billed account free.",
|
|
73270
73875
|
" blocks The NVMe blocks the company bought, which its environments' volumes draw from: what it",
|
|
73271
73876
|
" holds, what a stated total costs, and the purchase that raises it.",
|
|
73272
73877
|
"",
|
|
@@ -73274,15 +73879,15 @@ var POOL_USAGE = [
|
|
|
73274
73879
|
"the total the company holds after the purchase rather than an increment: a total equal to the current holding",
|
|
73275
73880
|
"writes nothing, and a lower total is refused because blocks are only ever added and reducing capacity is a",
|
|
73276
73881
|
"reviewed request rather than a purchase.",
|
|
73277
|
-
"
|
|
73278
|
-
"
|
|
73279
|
-
"
|
|
73882
|
+
"Capacity belongs to the company, not an environment. A purchase starts billing; provision does not.",
|
|
73883
|
+
"A pool read's monthly price is a quote, not evidence that billing is active. Provision 1 unit for a 40 GiB",
|
|
73884
|
+
"budget; for example, 10 GiB databases + 10 GiB application files + 10 GiB S3 leaves 10 GiB spare.",
|
|
73280
73885
|
"",
|
|
73281
73886
|
"A purchase needs --confirm; --dry-run describes it, at the same quoted price, and sends no change."
|
|
73282
73887
|
].join("\n");
|
|
73283
73888
|
var POOL_METADATA = {
|
|
73284
73889
|
name: "pool",
|
|
73285
|
-
summary: "A company's capacity pool:
|
|
73890
|
+
summary: "A company's capacity pool: holdings, prices, paid purchase, or staff provisioning before billing.",
|
|
73286
73891
|
usage: POOL_USAGE,
|
|
73287
73892
|
flags: [
|
|
73288
73893
|
{
|
|
@@ -73303,17 +73908,18 @@ var POOL_METADATA = {
|
|
|
73303
73908
|
{
|
|
73304
73909
|
name: "--confirm",
|
|
73305
73910
|
takesValue: false,
|
|
73306
|
-
description: "
|
|
73911
|
+
description: "Confirm the purchase or unbilled provisioning. Without it no write is sent."
|
|
73307
73912
|
},
|
|
73308
73913
|
{
|
|
73309
73914
|
name: "--dry-run",
|
|
73310
73915
|
takesValue: false,
|
|
73311
|
-
description: "Describe the purchase and send nothing."
|
|
73916
|
+
description: "Describe the purchase or unbilled provisioning and send nothing."
|
|
73312
73917
|
}
|
|
73313
73918
|
],
|
|
73314
73919
|
subcommands: [
|
|
73315
73920
|
"quote",
|
|
73316
73921
|
"purchase",
|
|
73922
|
+
"provision",
|
|
73317
73923
|
"blocks"
|
|
73318
73924
|
]
|
|
73319
73925
|
};
|
|
@@ -73379,12 +73985,12 @@ function blocksPurchasedText(quote) {
|
|
|
73379
73985
|
}
|
|
73380
73986
|
/** The pool a company holds, or the plain fact that it holds none. */
|
|
73381
73987
|
function poolSummaryText(pool) {
|
|
73382
|
-
if (!pool.recorded || pool.units === null) return "No capacity pool is recorded for this company
|
|
73383
|
-
const lines = [pool.agreed ? `A pool of ${String(pool.units)} unit(s) is recorded as an agreed
|
|
73988
|
+
if (!pool.recorded || pool.units === null) return "No capacity pool is recorded for this company. Staff can use pool provision to assign unbilled capacity; clients use pool purchase for paid capacity. No pool does not establish whether billing is active.";
|
|
73989
|
+
const lines = [pool.agreed ? `A pool of ${String(pool.units)} unit(s) is recorded as an agreed capacity holding. An agreement alone does not activate billing.` : `A pool of ${String(pool.units)} unit(s) is recorded, but not as an agreed holding: it records what the company already holds, so admission grants no slice from it.`];
|
|
73384
73990
|
if (pool.total !== null) lines.push(` total: ${budgetText(pool.total)}`);
|
|
73385
73991
|
if (pool.allocated !== null) lines.push(` allocated: ${budgetText(pool.allocated)}`);
|
|
73386
73992
|
if (pool.remaining !== null) lines.push(` remaining: ${budgetText(pool.remaining)}`);
|
|
73387
|
-
if (pool.monthly !== null) lines.push(` monthly: ${quotePrice(pool.monthly)}`);
|
|
73993
|
+
if (pool.monthly !== null) lines.push(` monthly price quote (not billing status): ${quotePrice(pool.monthly)}`);
|
|
73388
73994
|
else if (pool.monthlyUnavailable !== null) lines.push(` monthly price unavailable: ${pool.monthlyUnavailable}`);
|
|
73389
73995
|
if (pool.purchasedStorage !== null && pool.purchasedStorage.blocks !== null) lines.push(` bought storage: ${String(pool.purchasedStorage.blocks)} block(s), ${String(pool.purchasedStorageMib ?? 0)}Mi added to the pool${pool.purchasedStorage.usableFrom === null ? "" : `, usable from ${pool.purchasedStorage.usableFrom.slice(0, 10)}`}`);
|
|
73390
73996
|
return lines.join("\n");
|
|
@@ -73396,6 +74002,7 @@ function purchasedText(report) {
|
|
|
73396
74002
|
function poolText(report) {
|
|
73397
74003
|
if (report.kind === "pool") return poolSummaryText(report.pool);
|
|
73398
74004
|
if (report.kind === "poolQuote") return quoteText$2(report.quote);
|
|
74005
|
+
if (report.kind === "poolProvision") return renderWriteOutcome(report.outcome, (held) => `${poolSummaryText(held)}\nUnbilled capacity assigned. Billing was not activated; no invoice details were required.`);
|
|
73399
74006
|
if (report.kind === "poolBlocks") return blocksHeldText(report.held);
|
|
73400
74007
|
if (report.kind === "poolBlocksQuote") return blocksQuoteText(report.quote);
|
|
73401
74008
|
if (report.kind === "poolBlocksPurchase") return renderWriteOutcome(report.outcome, blocksPurchasedText);
|
|
@@ -73440,6 +74047,17 @@ async function purchasePool(context, company) {
|
|
|
73440
74047
|
}).unwrap())
|
|
73441
74048
|
};
|
|
73442
74049
|
}
|
|
74050
|
+
/** Staff assign the company's total capacity before billing, with no paid quote or activation. */
|
|
74051
|
+
async function provisionPool(context, company) {
|
|
74052
|
+
const unitQuantity = requiredUnits(context);
|
|
74053
|
+
return {
|
|
74054
|
+
kind: "poolProvision",
|
|
74055
|
+
outcome: await confirmableWrite(context, `Assign ${String(unitQuantity)} unbilled unit(s) to ${company}. This is the company's total holding, not an increment. It starts no billing, needs no invoice details, and cannot make a billed account free.`, async () => platformHostingPoolAllowance({
|
|
74056
|
+
path: { company },
|
|
74057
|
+
body: { unitQuantity }
|
|
74058
|
+
}).unwrap())
|
|
74059
|
+
};
|
|
74060
|
+
}
|
|
73443
74061
|
/**
|
|
73444
74062
|
* The blocks a blocks quote or purchase names.
|
|
73445
74063
|
*
|
|
@@ -73505,6 +74123,7 @@ var pool = {
|
|
|
73505
74123
|
if (rest.length > 0) throw new UsageError(POOL_USAGE);
|
|
73506
74124
|
if (subcommand === "quote") return await quotePool(context, company);
|
|
73507
74125
|
if (subcommand === "purchase") return await purchasePool(context, company);
|
|
74126
|
+
if (subcommand === "provision") return await provisionPool(context, company);
|
|
73508
74127
|
throw new UsageError(POOL_USAGE);
|
|
73509
74128
|
},
|
|
73510
74129
|
human(report) {
|
|
@@ -74529,20 +75148,20 @@ function nameserversForBody(context, action = "register") {
|
|
|
74529
75148
|
function registrantOf(context, action) {
|
|
74530
75149
|
if (action === "renew") return void 0;
|
|
74531
75150
|
return {
|
|
74532
|
-
name: required(context, "--name"),
|
|
74533
|
-
email: required(context, "--email"),
|
|
74534
|
-
country: required(context, "--country"),
|
|
74535
|
-
province: required(context, "--province"),
|
|
74536
|
-
contactNumber: required(context, "--contact"),
|
|
74537
|
-
postalCode: required(context, "--postal-code"),
|
|
74538
|
-
address1: required(context, "--address1"),
|
|
75151
|
+
name: required$1(context, "--name"),
|
|
75152
|
+
email: required$1(context, "--email"),
|
|
75153
|
+
country: required$1(context, "--country"),
|
|
75154
|
+
province: required$1(context, "--province"),
|
|
75155
|
+
contactNumber: required$1(context, "--contact"),
|
|
75156
|
+
postalCode: required$1(context, "--postal-code"),
|
|
75157
|
+
address1: required$1(context, "--address1"),
|
|
74539
75158
|
address2: optional(context, "--address2"),
|
|
74540
75159
|
address3: optional(context, "--address3"),
|
|
74541
|
-
city: required(context, "--city")
|
|
75160
|
+
city: required$1(context, "--city")
|
|
74542
75161
|
};
|
|
74543
75162
|
}
|
|
74544
75163
|
/** A flag whose absence is a refusal, named so the operator knows what to pass. */
|
|
74545
|
-
function required(context, flag) {
|
|
75164
|
+
function required$1(context, flag) {
|
|
74546
75165
|
const value = context.flags.get(flag) ?? "";
|
|
74547
75166
|
if (value === "") throw new UsageError(`${flag} is required here.\n\n${USAGE$2}`);
|
|
74548
75167
|
return value;
|
|
@@ -74607,7 +75226,7 @@ var registrar = {
|
|
|
74607
75226
|
};
|
|
74608
75227
|
/** Close one unknown zero-cost transfer after the provider checks; this never starts a new transfer. */
|
|
74609
75228
|
async function supersedeTransfer(context, path) {
|
|
74610
|
-
const operationUuid = required(context, "--operation");
|
|
75229
|
+
const operationUuid = required$1(context, "--operation");
|
|
74611
75230
|
return await confirmableWrite(context, `Close the unknown zero-cost transfer ${operationUuid} for ${(await domainsRegistrarShow({ path })).data.hostname}. Its prior outcome remains unknown; this does not start another transfer.`, async () => {
|
|
74612
75231
|
if (!context.flags.has("--accept-terms")) throw new UsageError(`Superseding an unknown transfer needs --accept-terms, which confirms this closure after the provider checks.\n\n${USAGE$2}`);
|
|
74613
75232
|
return (await domainsRegistrarOperationsSupersedeTransfer({
|
|
@@ -74621,9 +75240,9 @@ async function supersedeTransfer(context, path) {
|
|
|
74621
75240
|
}
|
|
74622
75241
|
/** `register|renew|transfer <uuid>`: one consented, serialized registrar operation. */
|
|
74623
75242
|
async function operation(context, path, action) {
|
|
74624
|
-
const quoteUuid = required(context, "--quote");
|
|
74625
|
-
const amount = required(context, "--amount");
|
|
74626
|
-
const currency = required(context, "--currency");
|
|
75243
|
+
const quoteUuid = required$1(context, "--quote");
|
|
75244
|
+
const amount = required$1(context, "--amount");
|
|
75245
|
+
const currency = required$1(context, "--currency");
|
|
74627
75246
|
const periodYears = periodYearsOf(context);
|
|
74628
75247
|
const status = await domainsRegistrarShow({ path });
|
|
74629
75248
|
return await confirmableWrite(context, `${label(action)} ${status.data.hostname} for ${String(periodYears)} year(s) at ${amount} ${currency} through ${status.data.providerName ?? "the registrar"}.`, async () => (await domainsRegistrarOperationsStore({
|
|
@@ -75013,11 +75632,11 @@ var registryConnections = {
|
|
|
75013
75632
|
if (subcommand === void 0) throw new UsageError(USAGE);
|
|
75014
75633
|
const company = await requireCompany(context.flags);
|
|
75015
75634
|
if (subcommand === "list") {
|
|
75016
|
-
noExtra$
|
|
75635
|
+
noExtra$2(rest);
|
|
75017
75636
|
return (await hostingRegistryConnectionsIndex({ path: { company } })).data;
|
|
75018
75637
|
}
|
|
75019
75638
|
if (subcommand === "add") {
|
|
75020
|
-
noExtra$
|
|
75639
|
+
noExtra$2(rest);
|
|
75021
75640
|
return await addRegistryConnection(context, company);
|
|
75022
75641
|
}
|
|
75023
75642
|
if (!CONNECTION_SUBCOMMANDS.has(subcommand)) throw new UsageError(USAGE);
|
|
@@ -75037,7 +75656,7 @@ var registryConnections = {
|
|
|
75037
75656
|
}
|
|
75038
75657
|
};
|
|
75039
75658
|
/** Refuse arguments a subcommand does not take, rather than silently ignoring them. */
|
|
75040
|
-
function noExtra$
|
|
75659
|
+
function noExtra$2(rest) {
|
|
75041
75660
|
if (rest.length > 0) throw new UsageError(USAGE);
|
|
75042
75661
|
}
|
|
75043
75662
|
/** `check`: prove the credential reads one repository and reference, and record the digest it resolved. */
|
|
@@ -75191,7 +75810,7 @@ var repository = {
|
|
|
75191
75810
|
};
|
|
75192
75811
|
/** `list`. */
|
|
75193
75812
|
async function list$2(company, rest) {
|
|
75194
|
-
noExtra(rest);
|
|
75813
|
+
noExtra$1(rest);
|
|
75195
75814
|
return {
|
|
75196
75815
|
kind: "connections",
|
|
75197
75816
|
connections: (await hostingRepositoryConnectionIndex({ path: { company } })).data
|
|
@@ -75206,7 +75825,7 @@ async function list$2(company, rest) {
|
|
|
75206
75825
|
* authorisation handoff instead, and that one returns code and state like any other callback.
|
|
75207
75826
|
*/
|
|
75208
75827
|
async function connect(context, company, rest) {
|
|
75209
|
-
noExtra(rest);
|
|
75828
|
+
noExtra$1(rest);
|
|
75210
75829
|
const account = context.flags.get("--account")?.trim() ?? "";
|
|
75211
75830
|
return {
|
|
75212
75831
|
kind: "start",
|
|
@@ -75218,7 +75837,7 @@ async function connect(context, company, rest) {
|
|
|
75218
75837
|
}
|
|
75219
75838
|
/** `complete --callback-* …`: the code and state from the redirect GitHub sent. */
|
|
75220
75839
|
async function complete(context, company, rest) {
|
|
75221
|
-
noExtra(rest);
|
|
75840
|
+
noExtra$1(rest);
|
|
75222
75841
|
return {
|
|
75223
75842
|
kind: "connection",
|
|
75224
75843
|
connection: await completed(context, company)
|
|
@@ -75249,7 +75868,7 @@ async function completed(context, company) {
|
|
|
75249
75868
|
}
|
|
75250
75869
|
/** `repositories <connection>`. */
|
|
75251
75870
|
async function repositories(path, rest) {
|
|
75252
|
-
noExtra(rest);
|
|
75871
|
+
noExtra$1(rest);
|
|
75253
75872
|
return {
|
|
75254
75873
|
kind: "repositories",
|
|
75255
75874
|
repositories: (await hostingRepositoryConnectionRepositories({ path })).data
|
|
@@ -75257,7 +75876,7 @@ async function repositories(path, rest) {
|
|
|
75257
75876
|
}
|
|
75258
75877
|
/** `select <connection> --repository …`. */
|
|
75259
75878
|
async function select(context, path, rest) {
|
|
75260
|
-
noExtra(rest);
|
|
75879
|
+
noExtra$1(rest);
|
|
75261
75880
|
const raw = context.flags.get("--repository") ?? "";
|
|
75262
75881
|
const repositoryId = Number(raw);
|
|
75263
75882
|
if (!Number.isInteger(repositoryId) || repositoryId < 1) throw new UsageError(`select needs --repository <id>.\n\n${REPOSITORY_USAGE}`);
|
|
@@ -75293,14 +75912,14 @@ async function resync(context, path, rest) {
|
|
|
75293
75912
|
}
|
|
75294
75913
|
/** `revoke <connection>`. */
|
|
75295
75914
|
async function revoke$1(context, path, rest) {
|
|
75296
|
-
noExtra(rest);
|
|
75915
|
+
noExtra$1(rest);
|
|
75297
75916
|
return {
|
|
75298
75917
|
kind: "repository-write",
|
|
75299
75918
|
outcome: await confirmableWrite(context, "Revoke this GitHub connection. Applications bound to its selections stop deploying.", async () => (await hostingRepositoryConnectionRevoke({ path })).data)
|
|
75300
75919
|
};
|
|
75301
75920
|
}
|
|
75302
75921
|
/** No positional arguments, or a usage refusal. */
|
|
75303
|
-
function noExtra(rest) {
|
|
75922
|
+
function noExtra$1(rest) {
|
|
75304
75923
|
if (rest.length > 0) throw new UsageError(REPOSITORY_USAGE);
|
|
75305
75924
|
}
|
|
75306
75925
|
/** The read and handoff renderer. */
|
|
@@ -75396,7 +76015,7 @@ function writeSummary(result) {
|
|
|
75396
76015
|
//#region src/commands/secret-connection-write.ts
|
|
75397
76016
|
/** Every write, each describing what it will do before it sends anything. */
|
|
75398
76017
|
async function write(context, subcommand, path, connectionPath, reference) {
|
|
75399
|
-
if (subcommand === "add") return await add$
|
|
76018
|
+
if (subcommand === "add") return await add$2(context, path);
|
|
75400
76019
|
if (subcommand === "link") return await link(context, connectionPath);
|
|
75401
76020
|
if (subcommand === "unlink") {
|
|
75402
76021
|
if (reference === void 0) throw new UsageError(SECRET_CONNECTION_USAGE);
|
|
@@ -75415,7 +76034,7 @@ async function write(context, subcommand, path, connectionPath, reference) {
|
|
|
75415
76034
|
throw new UsageError(SECRET_CONNECTION_USAGE);
|
|
75416
76035
|
}
|
|
75417
76036
|
/** `add`: connect a secret manager, with the identity read from a private file or stdin. */
|
|
75418
|
-
async function add$
|
|
76037
|
+
async function add$2(context, path) {
|
|
75419
76038
|
const provider = context.flags.get("--provider") ?? "";
|
|
75420
76039
|
const endpoint = context.flags.get("--endpoint") ?? "";
|
|
75421
76040
|
const projectId = context.flags.get("--project-id") ?? "";
|
|
@@ -75651,7 +76270,7 @@ var services = {
|
|
|
75651
76270
|
report.environmentUuid,
|
|
75652
76271
|
`desired generation ${String(report.desiredGeneration)}`,
|
|
75653
76272
|
`applied generation ${String(report.observed.appliedGeneration)}`,
|
|
75654
|
-
observationText(report)
|
|
76273
|
+
observationText$1(report)
|
|
75655
76274
|
].join(" ");
|
|
75656
76275
|
if (report.services.length === 0) return [header, " no services are recorded for this environment"].join("\n");
|
|
75657
76276
|
const width = report.services.reduce((widest, one) => Math.max(widest, one.name.length), 0);
|
|
@@ -75662,7 +76281,7 @@ var services = {
|
|
|
75662
76281
|
* The observation in words. Any status other than `ready` is the API's own word passed through rather than
|
|
75663
76282
|
* mapped, so a status added later reads as itself instead of being silently folded into a known case.
|
|
75664
76283
|
*/
|
|
75665
|
-
function observationText(report) {
|
|
76284
|
+
function observationText$1(report) {
|
|
75666
76285
|
const { observed } = report;
|
|
75667
76286
|
if (observed.observedAt === null) return "nothing observed yet";
|
|
75668
76287
|
if (observed.status !== "ready") return observed.status;
|
|
@@ -76273,7 +76892,7 @@ async function start(context, tail) {
|
|
|
76273
76892
|
* never the latest one this CLI happened to read, because a capture that moved on between review and confirmation
|
|
76274
76893
|
* is exactly the change nobody looked at.
|
|
76275
76894
|
*/
|
|
76276
|
-
async function confirm(context, tail) {
|
|
76895
|
+
async function confirm$1(context, tail) {
|
|
76277
76896
|
const path = await bucketPath(context, tail);
|
|
76278
76897
|
const body = {
|
|
76279
76898
|
operationId: requiredFlag$3(context, "--operation-id", STORAGE_USAGE),
|
|
@@ -76420,7 +77039,7 @@ async function adoption(context, tail) {
|
|
|
76420
77039
|
case "retained-objects": return await retainedObjects(context, rest);
|
|
76421
77040
|
case "recovery": return await recovery(context, rest);
|
|
76422
77041
|
case "start": return await start(context, rest);
|
|
76423
|
-
case "confirm": return await confirm(context, rest);
|
|
77042
|
+
case "confirm": return await confirm$1(context, rest);
|
|
76424
77043
|
case "cancel": return await cancel(context, rest);
|
|
76425
77044
|
case "resume": return await resume(context, rest);
|
|
76426
77045
|
case "restore": return await restore(context, rest);
|
|
@@ -77415,7 +78034,7 @@ function maximumDescription(path, bytes) {
|
|
|
77415
78034
|
* Use included package storage by default. Paid capacity is explicit through `--mode allocated` or a saved
|
|
77416
78035
|
* `--quote-file`; `--mode native` buys usage-billed storage. Never turn a package refusal into a charge.
|
|
77417
78036
|
*/
|
|
77418
|
-
async function add(context, tail) {
|
|
78037
|
+
async function add$1(context, tail) {
|
|
77419
78038
|
refuseExtra(tail);
|
|
77420
78039
|
const name = requiredName(context);
|
|
77421
78040
|
const company = await requireCompany(context.flags);
|
|
@@ -77597,7 +78216,7 @@ async function dispatch$1(context) {
|
|
|
77597
78216
|
case "downloads": return await downloads(context, tail);
|
|
77598
78217
|
case "ceiling": return await ceiling(context, tail);
|
|
77599
78218
|
case "maximum": return await maximum(context, tail);
|
|
77600
|
-
case "add": return await add(context, tail);
|
|
78219
|
+
case "add": return await add$1(context, tail);
|
|
77601
78220
|
case "grow": return await grow(context, tail);
|
|
77602
78221
|
case "resize": return await resize(context, tail);
|
|
77603
78222
|
case "subscription": return await subscription(context, tail);
|
|
@@ -77691,6 +78310,329 @@ async function signedUrl(context, tail, direction) {
|
|
|
77691
78310
|
};
|
|
77692
78311
|
}
|
|
77693
78312
|
//#endregion
|
|
78313
|
+
//#region src/commands/storage-class-text.ts
|
|
78314
|
+
/**
|
|
78315
|
+
* How each storage-catalogue answer reads to a person.
|
|
78316
|
+
*
|
|
78317
|
+
* Kept beside the command rather than inside it: the command owns argument parsing and the write gate, and
|
|
78318
|
+
* these functions own the words, so the file the complexity guard watches stays small.
|
|
78319
|
+
*/
|
|
78320
|
+
function catalogueText(catalogue) {
|
|
78321
|
+
const lines = [`Registered classes (${catalogue.classes.length}):`, ...catalogue.classes.map((one) => ` ${classLine(one)}`)];
|
|
78322
|
+
if (catalogue.defaults.length > 0) {
|
|
78323
|
+
lines.push("", "Cluster defaults:");
|
|
78324
|
+
lines.push(...catalogue.defaults.map((one) => ` ${defaultText(one)}`));
|
|
78325
|
+
}
|
|
78326
|
+
lines.push("", `Backends: ${catalogue.backends.map((one) => one.slug).join(", ")}`);
|
|
78327
|
+
lines.push(`Claim types: ${catalogue.volumeTypes.map((one) => one.slug).join(", ")}`);
|
|
78328
|
+
return lines.join("\n");
|
|
78329
|
+
}
|
|
78330
|
+
function classLine(one) {
|
|
78331
|
+
const types = one.volumeTypes.join(", ");
|
|
78332
|
+
return `${one.name} [${one.kubernetesName}] on ${one.clusterName}, ${one.backendName}, ${types}${one.enabled ? "" : " disabled"}`;
|
|
78333
|
+
}
|
|
78334
|
+
function classText(one) {
|
|
78335
|
+
return [
|
|
78336
|
+
`Kubernetes name: ${one.kubernetesName}`,
|
|
78337
|
+
`Name: ${one.name}`,
|
|
78338
|
+
one.description === "" ? null : `Description: ${one.description}`,
|
|
78339
|
+
`Cluster: ${one.clusterName}`,
|
|
78340
|
+
`Backend: ${one.backendName}`,
|
|
78341
|
+
`Claim types: ${one.volumeTypes.join(", ")}`,
|
|
78342
|
+
`Enabled: ${one.enabled ? "yes" : "no"}`,
|
|
78343
|
+
`Reports written bytes: ${one.reportsUsedBytes ? "yes" : "no"}`,
|
|
78344
|
+
`Can carry a seed: ${one.supportsBackingImages ? "yes" : "no"}`,
|
|
78345
|
+
`UUID: ${one.uuid}`
|
|
78346
|
+
].filter((line) => line !== null).join("\n");
|
|
78347
|
+
}
|
|
78348
|
+
function defaultText(one) {
|
|
78349
|
+
return `${one.volumeType} -> ${one.storageClassName} (${one.storageClassUuid}) on cluster ${one.clusterUuid}`;
|
|
78350
|
+
}
|
|
78351
|
+
function observationText(one) {
|
|
78352
|
+
if (!one.observed) return `Not observed: ${one.reason ?? "the cluster did not answer."}`;
|
|
78353
|
+
return [
|
|
78354
|
+
`Observed: yes`,
|
|
78355
|
+
`Provisioner: ${one.provisioner ?? "unreported"}`,
|
|
78356
|
+
`Matches the recorded backend: ${one.backendMatches ? "yes" : "no"}`,
|
|
78357
|
+
`Reclaim policy: ${one.reclaimPolicy ?? "unreported"}`,
|
|
78358
|
+
`Allows expansion: ${one.allowVolumeExpansion === null ? "unreported" : one.allowVolumeExpansion ? "yes" : "no"}`,
|
|
78359
|
+
`Volume binding mode: ${one.volumeBindingMode ?? "unreported"}`,
|
|
78360
|
+
one.reason === null ? null : `Note: ${one.reason}`
|
|
78361
|
+
].filter((line) => line !== null).join("\n");
|
|
78362
|
+
}
|
|
78363
|
+
//#endregion
|
|
78364
|
+
//#region src/commands/storage-class-writes.ts
|
|
78365
|
+
/**
|
|
78366
|
+
* The catalogue's writes, and the vocabulary each one accepts.
|
|
78367
|
+
*
|
|
78368
|
+
* Split from the command so the file the complexity guard watches stays small. Every write goes through the
|
|
78369
|
+
* one `confirm` gate below, so a dry run and a refusal say the same sentence about the same change.
|
|
78370
|
+
*/
|
|
78371
|
+
/** The claim types the platform allocates, as the API's own vocabulary spells them. */
|
|
78372
|
+
var VOLUME_TYPES = [
|
|
78373
|
+
"application-files",
|
|
78374
|
+
"database-data",
|
|
78375
|
+
"redis-data"
|
|
78376
|
+
];
|
|
78377
|
+
/** The backends the platform's closed behaviour vocabulary carries. */
|
|
78378
|
+
var BACKENDS = [
|
|
78379
|
+
"longhorn",
|
|
78380
|
+
"ceph",
|
|
78381
|
+
"local-path"
|
|
78382
|
+
];
|
|
78383
|
+
function claimType(value) {
|
|
78384
|
+
const known = VOLUME_TYPES.find((type) => type === value);
|
|
78385
|
+
if (known === void 0) throw new UsageError(`[${value}] is not a claim type; use one of ${VOLUME_TYPES.join(", ")}.`);
|
|
78386
|
+
return known;
|
|
78387
|
+
}
|
|
78388
|
+
function backend(value) {
|
|
78389
|
+
const known = BACKENDS.find((one) => one === value);
|
|
78390
|
+
if (known === void 0) throw new UsageError(`[${value}] is not a storage backend; use one of ${BACKENDS.join(", ")}.`);
|
|
78391
|
+
return known;
|
|
78392
|
+
}
|
|
78393
|
+
/** A flag a write requires, refused by name rather than sent empty. */
|
|
78394
|
+
function required(context, flag) {
|
|
78395
|
+
const value = (context.flags.get(flag) ?? "").trim();
|
|
78396
|
+
if (value === "") throw new UsageError(`${flag} is required.\n\n${STORAGE_CLASS_USAGE}`);
|
|
78397
|
+
return value;
|
|
78398
|
+
}
|
|
78399
|
+
function one(rest) {
|
|
78400
|
+
const [value, ...extra] = rest;
|
|
78401
|
+
if (value === void 0 || extra.length > 0) throw new UsageError(STORAGE_CLASS_USAGE);
|
|
78402
|
+
return value;
|
|
78403
|
+
}
|
|
78404
|
+
function noExtra(rest) {
|
|
78405
|
+
if (rest.length > 0) throw new UsageError(STORAGE_CLASS_USAGE);
|
|
78406
|
+
}
|
|
78407
|
+
function description(context) {
|
|
78408
|
+
return (context.flags.get("--description") ?? "").trim();
|
|
78409
|
+
}
|
|
78410
|
+
/** The claim types a write names, accepted as one comma-separated flag. */
|
|
78411
|
+
function volumeTypes(context) {
|
|
78412
|
+
const types = (context.flags.get("--volume-types") ?? "").split(",").map((type) => type.trim()).filter((type) => type.length > 0);
|
|
78413
|
+
if (types.length === 0) throw new UsageError("--volume-types names at least one claim type, separated by commas.");
|
|
78414
|
+
return types.map((type) => claimType(type));
|
|
78415
|
+
}
|
|
78416
|
+
/** The one gate every write goes through, so a dry run and a refusal say the same sentence. */
|
|
78417
|
+
async function confirm(context, statement, send) {
|
|
78418
|
+
if (context.flags.has("--dry-run")) return {
|
|
78419
|
+
sent: false,
|
|
78420
|
+
description: statement
|
|
78421
|
+
};
|
|
78422
|
+
if (!context.flags.has("--confirm")) throw new UsageError([
|
|
78423
|
+
statement,
|
|
78424
|
+
"",
|
|
78425
|
+
"Nothing was sent. Pass --confirm to make this change, or --dry-run to see it without making it."
|
|
78426
|
+
].join("\n"));
|
|
78427
|
+
return {
|
|
78428
|
+
sent: true,
|
|
78429
|
+
description: statement,
|
|
78430
|
+
result: await send()
|
|
78431
|
+
};
|
|
78432
|
+
}
|
|
78433
|
+
async function add(context, rest) {
|
|
78434
|
+
noExtra(rest);
|
|
78435
|
+
const body = {
|
|
78436
|
+
clusterUuid: required(context, "--cluster"),
|
|
78437
|
+
backendType: backend(required(context, "--backend")),
|
|
78438
|
+
kubernetesName: required(context, "--kubernetes-name"),
|
|
78439
|
+
name: required(context, "--name"),
|
|
78440
|
+
description: description(context),
|
|
78441
|
+
volumeTypes: volumeTypes(context),
|
|
78442
|
+
enabled: !context.flags.has("--disabled")
|
|
78443
|
+
};
|
|
78444
|
+
return {
|
|
78445
|
+
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)
|
|
78447
|
+
};
|
|
78448
|
+
}
|
|
78449
|
+
async function set(context, rest) {
|
|
78450
|
+
const uuid = one(rest);
|
|
78451
|
+
const body = {
|
|
78452
|
+
name: required(context, "--name"),
|
|
78453
|
+
description: description(context)
|
|
78454
|
+
};
|
|
78455
|
+
return {
|
|
78456
|
+
kind: "write",
|
|
78457
|
+
outcome: await confirm(context, `Rename storage class ${uuid} to ${body.name}`, async () => (await platformStorageClassUpdate({
|
|
78458
|
+
path: { storageClassUuid: uuid },
|
|
78459
|
+
body
|
|
78460
|
+
})).data)
|
|
78461
|
+
};
|
|
78462
|
+
}
|
|
78463
|
+
async function enabled(context, rest) {
|
|
78464
|
+
const uuid = one(rest);
|
|
78465
|
+
const on = context.flags.has("--on");
|
|
78466
|
+
if (on === context.flags.has("--off")) throw new UsageError(`Name exactly one of --on or --off.\n\n${STORAGE_CLASS_USAGE}`);
|
|
78467
|
+
return {
|
|
78468
|
+
kind: "write",
|
|
78469
|
+
outcome: await confirm(context, `${on ? "Enable" : "Disable"} storage class ${uuid} for future allocation`, async () => (await platformStorageClassSetEnabled({
|
|
78470
|
+
path: { storageClassUuid: uuid },
|
|
78471
|
+
body: { enabled: on }
|
|
78472
|
+
})).data)
|
|
78473
|
+
};
|
|
78474
|
+
}
|
|
78475
|
+
async function replaceVolumeTypes(context, rest) {
|
|
78476
|
+
const uuid = one(rest);
|
|
78477
|
+
const types = volumeTypes(context);
|
|
78478
|
+
return {
|
|
78479
|
+
kind: "write",
|
|
78480
|
+
outcome: await confirm(context, `Serve ${types.join(", ")} from storage class ${uuid}`, async () => (await platformStorageClassUpdateVolumeTypes({
|
|
78481
|
+
path: { storageClassUuid: uuid },
|
|
78482
|
+
body: { volumeTypes: types }
|
|
78483
|
+
})).data)
|
|
78484
|
+
};
|
|
78485
|
+
}
|
|
78486
|
+
async function setDefault(context, rest) {
|
|
78487
|
+
noExtra(rest);
|
|
78488
|
+
const cluster = required(context, "--cluster");
|
|
78489
|
+
const type = claimType(required(context, "--volume-type"));
|
|
78490
|
+
const classUuid = required(context, "--class");
|
|
78491
|
+
return {
|
|
78492
|
+
kind: "write",
|
|
78493
|
+
outcome: await confirm(context, `Allocate ${type} claims on cluster ${cluster} from storage class ${classUuid}`, async () => (await platformStorageClassSetDefault({
|
|
78494
|
+
path: { clusterUuid: cluster },
|
|
78495
|
+
body: {
|
|
78496
|
+
volumeType: type,
|
|
78497
|
+
storageClassUuid: classUuid
|
|
78498
|
+
}
|
|
78499
|
+
})).data)
|
|
78500
|
+
};
|
|
78501
|
+
}
|
|
78502
|
+
async function observation(rest) {
|
|
78503
|
+
return {
|
|
78504
|
+
kind: "observation",
|
|
78505
|
+
observation: (await platformStorageClassObservation({ path: { storageClassUuid: one(rest) } })).data
|
|
78506
|
+
};
|
|
78507
|
+
}
|
|
78508
|
+
//#endregion
|
|
78509
|
+
//#region src/commands/storage-class.ts
|
|
78510
|
+
var STORAGE_CLASS_USAGE = [
|
|
78511
|
+
"Usage: hostingctl storage-class list",
|
|
78512
|
+
" hostingctl storage-class add --cluster <uuid> --backend <slug> --kubernetes-name <name>",
|
|
78513
|
+
" --name <text> --volume-types <type[,type...]> [--description <text>] [--disabled]",
|
|
78514
|
+
" hostingctl storage-class set <uuid> --name <text> [--description <text>]",
|
|
78515
|
+
" hostingctl storage-class enabled <uuid> (--on|--off)",
|
|
78516
|
+
" hostingctl storage-class volume-types <uuid> --volume-types <type[,type...]>",
|
|
78517
|
+
" hostingctl storage-class default --cluster <uuid> --volume-type <type> --class <uuid>",
|
|
78518
|
+
" hostingctl storage-class observation <uuid>",
|
|
78519
|
+
"",
|
|
78520
|
+
" list Every registered class, each cluster's defaults, and the vocabularies a class may use.",
|
|
78521
|
+
" add Register one cluster's Kubernetes StorageClass. Registering records intent: it does not",
|
|
78522
|
+
" 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.",
|
|
78524
|
+
" enabled Switch a class on or off. Disabling removes it from future selection; a claim already",
|
|
78525
|
+
" bound to it keeps its class, because Kubernetes cannot change one in place.",
|
|
78526
|
+
" volume-types Replace the claim types a class serves. A type a bound volume already uses cannot be",
|
|
78527
|
+
" withdrawn.",
|
|
78528
|
+
" default The class a cluster allocates a claim type from when an environment names no choice.",
|
|
78529
|
+
" observation What the cluster reports for the class, or why it could not be read.",
|
|
78530
|
+
"",
|
|
78531
|
+
"Every write needs --confirm; --dry-run describes the change and sends nothing."
|
|
78532
|
+
].join("\n");
|
|
78533
|
+
/**
|
|
78534
|
+
* The storage catalogue, for a staff reader with no database console.
|
|
78535
|
+
*
|
|
78536
|
+
* A catalogue rather than a cluster change: registering a class records what the platform may offer, and the
|
|
78537
|
+
* `observation` subcommand is what asks the cluster whether that is true. Nothing here migrates a claim or
|
|
78538
|
+
* rewrites one that already exists.
|
|
78539
|
+
*/
|
|
78540
|
+
var storageClass = {
|
|
78541
|
+
name: "storage-class",
|
|
78542
|
+
summary: "The storage classes the platform may allocate from, what each serves, and each cluster's default.",
|
|
78543
|
+
usage: STORAGE_CLASS_USAGE,
|
|
78544
|
+
flags: [
|
|
78545
|
+
{
|
|
78546
|
+
name: "--cluster",
|
|
78547
|
+
takesValue: true,
|
|
78548
|
+
description: "The cluster a class exists on, by UUID."
|
|
78549
|
+
},
|
|
78550
|
+
{
|
|
78551
|
+
name: "--backend",
|
|
78552
|
+
takesValue: true,
|
|
78553
|
+
description: "The backend that serves the class."
|
|
78554
|
+
},
|
|
78555
|
+
{
|
|
78556
|
+
name: "--kubernetes-name",
|
|
78557
|
+
takesValue: true,
|
|
78558
|
+
description: "The StorageClass object's own name on the cluster."
|
|
78559
|
+
},
|
|
78560
|
+
{
|
|
78561
|
+
name: "--name",
|
|
78562
|
+
takesValue: true,
|
|
78563
|
+
description: "The name a person reads."
|
|
78564
|
+
},
|
|
78565
|
+
{
|
|
78566
|
+
name: "--description",
|
|
78567
|
+
takesValue: true,
|
|
78568
|
+
description: "What the class is for."
|
|
78569
|
+
},
|
|
78570
|
+
{
|
|
78571
|
+
name: "--volume-types",
|
|
78572
|
+
takesValue: true,
|
|
78573
|
+
description: "The claim types the class serves, separated by commas."
|
|
78574
|
+
},
|
|
78575
|
+
{
|
|
78576
|
+
name: "--volume-type",
|
|
78577
|
+
takesValue: true,
|
|
78578
|
+
description: "The claim type a default answers."
|
|
78579
|
+
},
|
|
78580
|
+
{
|
|
78581
|
+
name: "--class",
|
|
78582
|
+
takesValue: true,
|
|
78583
|
+
description: "The class to make a cluster's default."
|
|
78584
|
+
},
|
|
78585
|
+
{
|
|
78586
|
+
name: "--disabled",
|
|
78587
|
+
takesValue: false,
|
|
78588
|
+
description: "Register the class switched off."
|
|
78589
|
+
},
|
|
78590
|
+
{
|
|
78591
|
+
name: "--on",
|
|
78592
|
+
takesValue: false,
|
|
78593
|
+
description: "Switch the class on."
|
|
78594
|
+
},
|
|
78595
|
+
{
|
|
78596
|
+
name: "--off",
|
|
78597
|
+
takesValue: false,
|
|
78598
|
+
description: "Switch the class off."
|
|
78599
|
+
}
|
|
78600
|
+
],
|
|
78601
|
+
subcommands: [
|
|
78602
|
+
"list",
|
|
78603
|
+
"add",
|
|
78604
|
+
"set",
|
|
78605
|
+
"enabled",
|
|
78606
|
+
"volume-types",
|
|
78607
|
+
"default",
|
|
78608
|
+
"observation"
|
|
78609
|
+
],
|
|
78610
|
+
async run(context) {
|
|
78611
|
+
const [action, ...rest] = context.positional;
|
|
78612
|
+
if (action === "list") {
|
|
78613
|
+
if (rest.length > 0) throw new UsageError(STORAGE_CLASS_USAGE);
|
|
78614
|
+
return {
|
|
78615
|
+
kind: "catalogue",
|
|
78616
|
+
catalogue: (await platformStorageClassIndex()).data
|
|
78617
|
+
};
|
|
78618
|
+
}
|
|
78619
|
+
if (action === "add") return await add(context, rest);
|
|
78620
|
+
if (action === "set") return await set(context, rest);
|
|
78621
|
+
if (action === "enabled") return await enabled(context, rest);
|
|
78622
|
+
if (action === "volume-types") return await replaceVolumeTypes(context, rest);
|
|
78623
|
+
if (action === "default") return await setDefault(context, rest);
|
|
78624
|
+
if (action === "observation") return await observation(rest);
|
|
78625
|
+
throw new UsageError(STORAGE_CLASS_USAGE);
|
|
78626
|
+
},
|
|
78627
|
+
human(report) {
|
|
78628
|
+
if (report.kind === "catalogue") return catalogueText(report.catalogue);
|
|
78629
|
+
if (report.kind === "class") return classText(report.storageClass);
|
|
78630
|
+
if (report.kind === "default") return defaultText(report.default);
|
|
78631
|
+
if (report.kind === "observation") return observationText(report.observation);
|
|
78632
|
+
return renderWriteOutcome(report.outcome, (result) => "kubernetesName" in result ? classText(result) : defaultText(result));
|
|
78633
|
+
}
|
|
78634
|
+
};
|
|
78635
|
+
//#endregion
|
|
77694
78636
|
//#region src/commands/system-metadata.ts
|
|
77695
78637
|
/**
|
|
77696
78638
|
* `system` — what this system sees left on the cluster it manages.
|
|
@@ -78387,7 +79329,7 @@ function writeUpdateState(state, env = process.env) {
|
|
|
78387
79329
|
}
|
|
78388
79330
|
//#endregion
|
|
78389
79331
|
//#region src/version.ts
|
|
78390
|
-
var VERSION = "1.0.
|
|
79332
|
+
var VERSION = "1.0.673";
|
|
78391
79333
|
//#endregion
|
|
78392
79334
|
//#region src/commands/update.ts
|
|
78393
79335
|
/**
|
|
@@ -78462,7 +79404,7 @@ var update = {
|
|
|
78462
79404
|
}, process.env);
|
|
78463
79405
|
return {
|
|
78464
79406
|
...known,
|
|
78465
|
-
current: after ?? "1.0.
|
|
79407
|
+
current: after ?? "1.0.673",
|
|
78466
79408
|
latest: after ?? latest,
|
|
78467
79409
|
upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
|
|
78468
79410
|
action: "run",
|
|
@@ -78629,6 +79571,7 @@ var COMMANDS = [
|
|
|
78629
79571
|
register(backups),
|
|
78630
79572
|
register(backupDestination),
|
|
78631
79573
|
register(storage),
|
|
79574
|
+
register(storageClass),
|
|
78632
79575
|
register(logs),
|
|
78633
79576
|
register(pricing),
|
|
78634
79577
|
register(purchases),
|
|
@@ -78743,7 +79686,7 @@ async function printUpdateNotice(options) {
|
|
|
78743
79686
|
}, env, { waitMs: NOTICE_LOCK_WAIT_MS });
|
|
78744
79687
|
} catch {}
|
|
78745
79688
|
if (latest === null) return;
|
|
78746
|
-
if (!isNewerVersion(latest, "1.0.
|
|
79689
|
+
if (!isNewerVersion(latest, "1.0.673")) return;
|
|
78747
79690
|
process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
|
|
78748
79691
|
}
|
|
78749
79692
|
/** Whether an environment variable is set to something, which is how CI and the opt-out are read. */
|