@sealant/api-contracts-next 0.40.0-next.872 → 0.40.0-next.875
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/core-api/boat-accounts.d.ts +313 -3
- package/dist/core-api/boat-accounts.js +63 -1
- package/dist/core-api/control-plane.d.ts +1541 -1366
- package/package.json +2 -2
|
@@ -230,6 +230,74 @@ export declare const boatKeyReportSchema: Schema.Struct<{
|
|
|
230
230
|
}>]>;
|
|
231
231
|
}>;
|
|
232
232
|
export type BoatKeyReport = typeof boatKeyReportSchema.Type;
|
|
233
|
+
/** The steps of a Boat key's full check, in order: the last two are also its cleanup. */
|
|
234
|
+
export declare const BOAT_KEY_PROOF_STEPS: readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"];
|
|
235
|
+
export type BoatKeyProofStepName = (typeof BOAT_KEY_PROOF_STEPS)[number];
|
|
236
|
+
/**
|
|
237
|
+
* One step of a full check. `passed`: Boat did it. `refused`: Boat refused it, `boat` says why.
|
|
238
|
+
* `no-answer`: Boat did not answer (the step may have happened; cleanup assumes it did).
|
|
239
|
+
* `not-reached`: an earlier step stopped the check, and this one was not tried.
|
|
240
|
+
*/
|
|
241
|
+
export declare const boatKeyProofStepSchema: Schema.Struct<{
|
|
242
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
243
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
244
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
245
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
246
|
+
readonly retryable: Schema.Boolean;
|
|
247
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
248
|
+
readonly code: Schema.optional<Schema.String>;
|
|
249
|
+
readonly message: Schema.optional<Schema.String>;
|
|
250
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
251
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
252
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
253
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
254
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
255
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
256
|
+
}>>;
|
|
257
|
+
}>;
|
|
258
|
+
export type BoatKeyProofStep = typeof boatKeyProofStepSchema.Type;
|
|
259
|
+
/**
|
|
260
|
+
* A full check of a Boat key: Core started the smallest VM, ran a command in it, published a port,
|
|
261
|
+
* saved a snapshot, then deleted the snapshot and the VM, and says how far it got. `outcome`:
|
|
262
|
+
* `passed` (every step), `refused` (Boat refused a step; the first refused or unanswered step
|
|
263
|
+
* says why), or `interrupted` (the check stopped before it finished; what it made was removed by
|
|
264
|
+
* the sweep). `starts`: how many VM starts it asked Boat for (0 or 1). `leftBehind`: what Boat
|
|
265
|
+
* may still hold of it when the answer was given. `removalConfirmed` true: Core saw Boat delete
|
|
266
|
+
* everything it made. False: the worker's sweep owns what is left and keeps deleting it, with
|
|
267
|
+
* `vm` (an id) and `snapshot` (a name) naming what is known; `vm` is null when a VM may exist
|
|
268
|
+
* whose id Boat never answered (the sweep finds it by its label). Until the sweep has finished,
|
|
269
|
+
* the account's key is neither rotated nor removed.
|
|
270
|
+
*/
|
|
271
|
+
export declare const boatKeyProofSchema: Schema.Struct<{
|
|
272
|
+
readonly proofId: Schema.String;
|
|
273
|
+
readonly startedAt: Schema.String;
|
|
274
|
+
readonly finishedAt: Schema.String;
|
|
275
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
276
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
277
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
278
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
279
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
280
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
281
|
+
readonly retryable: Schema.Boolean;
|
|
282
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
283
|
+
readonly code: Schema.optional<Schema.String>;
|
|
284
|
+
readonly message: Schema.optional<Schema.String>;
|
|
285
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
286
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
287
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
288
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
289
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
290
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
291
|
+
}>>;
|
|
292
|
+
}>>;
|
|
293
|
+
readonly starts: Schema.Int;
|
|
294
|
+
readonly leftBehind: Schema.Struct<{
|
|
295
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
296
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
297
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
298
|
+
}>;
|
|
299
|
+
}>;
|
|
300
|
+
export type BoatKeyProof = typeof boatKeyProofSchema.Type;
|
|
233
301
|
export declare const boatAccountSchema: Schema.Struct<{
|
|
234
302
|
readonly boatAccountId: Schema.String;
|
|
235
303
|
readonly label: Schema.String;
|
|
@@ -423,6 +491,36 @@ export declare const boatAccountSchema: Schema.Struct<{
|
|
|
423
491
|
}>>;
|
|
424
492
|
}>]>;
|
|
425
493
|
}>>>;
|
|
494
|
+
/** The account's last full check (`prove`), kept beside its report; null until it is proven. */
|
|
495
|
+
readonly lastProof: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
496
|
+
readonly proofId: Schema.String;
|
|
497
|
+
readonly startedAt: Schema.String;
|
|
498
|
+
readonly finishedAt: Schema.String;
|
|
499
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
500
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
501
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
502
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
503
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
504
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
505
|
+
readonly retryable: Schema.Boolean;
|
|
506
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
507
|
+
readonly code: Schema.optional<Schema.String>;
|
|
508
|
+
readonly message: Schema.optional<Schema.String>;
|
|
509
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
510
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
511
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
512
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
513
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
514
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
515
|
+
}>>;
|
|
516
|
+
}>>;
|
|
517
|
+
readonly starts: Schema.Int;
|
|
518
|
+
readonly leftBehind: Schema.Struct<{
|
|
519
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
520
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
521
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
522
|
+
}>;
|
|
523
|
+
}>>>;
|
|
426
524
|
}>;
|
|
427
525
|
export type BoatAccountWire = typeof boatAccountSchema.Type;
|
|
428
526
|
/**
|
|
@@ -828,6 +926,36 @@ export declare const listBoatAccountsResponseSchema: Schema.Struct<{
|
|
|
828
926
|
}>>;
|
|
829
927
|
}>]>;
|
|
830
928
|
}>>>;
|
|
929
|
+
/** The account's last full check (`prove`), kept beside its report; null until it is proven. */
|
|
930
|
+
readonly lastProof: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
931
|
+
readonly proofId: Schema.String;
|
|
932
|
+
readonly startedAt: Schema.String;
|
|
933
|
+
readonly finishedAt: Schema.String;
|
|
934
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
935
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
936
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
937
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
938
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
939
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
940
|
+
readonly retryable: Schema.Boolean;
|
|
941
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
942
|
+
readonly code: Schema.optional<Schema.String>;
|
|
943
|
+
readonly message: Schema.optional<Schema.String>;
|
|
944
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
945
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
946
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
947
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
948
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
949
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
950
|
+
}>>;
|
|
951
|
+
}>>;
|
|
952
|
+
readonly starts: Schema.Int;
|
|
953
|
+
readonly leftBehind: Schema.Struct<{
|
|
954
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
955
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
956
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
957
|
+
}>;
|
|
958
|
+
}>>>;
|
|
831
959
|
}>>;
|
|
832
960
|
}>;
|
|
833
961
|
export type ListBoatAccountsResponse = typeof listBoatAccountsResponseSchema.Type;
|
|
@@ -1052,7 +1180,7 @@ export declare class BoatAccountNotFoundError extends BoatAccountNotFoundError_b
|
|
|
1052
1180
|
}
|
|
1053
1181
|
declare const BoatAccountConflictError_base: Schema.Class<BoatAccountConflictError, Schema.TaggedStruct<"BoatAccountConflictError", {
|
|
1054
1182
|
readonly message: Schema.String;
|
|
1055
|
-
readonly code: Schema.Literals<readonly ["boat-account-in-use", "boat-key-cannot-see", "boat-account-removing", "boat-account-changed", "boat-account-environment"]>;
|
|
1183
|
+
readonly code: Schema.Literals<readonly ["boat-account-in-use", "boat-key-cannot-see", "boat-account-removing", "boat-account-changed", "boat-account-environment", "boat-proof-running"]>;
|
|
1056
1184
|
readonly liveRuns: Schema.optional<Schema.Int>;
|
|
1057
1185
|
readonly buildsInFlight: Schema.optional<Schema.Int>;
|
|
1058
1186
|
readonly unseen: Schema.optional<Schema.Int>;
|
|
@@ -1066,7 +1194,9 @@ declare const BoatAccountConflictError_base: Schema.Class<BoatAccountConflictErr
|
|
|
1066
1194
|
* now (`unseen`), so it is most likely another Boat account's key. `boat-account-removing`: the
|
|
1067
1195
|
* account's removal was asked. `boat-account-changed`: another rotation won; read and try again.
|
|
1068
1196
|
* `boat-account-environment`: the install's own key (`default`) is set in its environment, not
|
|
1069
|
-
* through this API.
|
|
1197
|
+
* through this API. `boat-proof-running`: a full check of the account is running, or Boat may
|
|
1198
|
+
* still hold what one made (the message names the VM and the snapshot): a second check, a key
|
|
1199
|
+
* rotation and a removal wait until Core has deleted it.
|
|
1070
1200
|
*/
|
|
1071
1201
|
export declare class BoatAccountConflictError extends BoatAccountConflictError_base {
|
|
1072
1202
|
}
|
|
@@ -1276,6 +1406,36 @@ export declare const BoatAccountsGroup: HttpApiGroup.HttpApiGroup<"boatAccounts"
|
|
|
1276
1406
|
}>>;
|
|
1277
1407
|
}>]>;
|
|
1278
1408
|
}>>>;
|
|
1409
|
+
/** The account's last full check (`prove`), kept beside its report; null until it is proven. */
|
|
1410
|
+
readonly lastProof: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
1411
|
+
readonly proofId: Schema.String;
|
|
1412
|
+
readonly startedAt: Schema.String;
|
|
1413
|
+
readonly finishedAt: Schema.String;
|
|
1414
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
1415
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
1416
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
1417
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
1418
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
1419
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
1420
|
+
readonly retryable: Schema.Boolean;
|
|
1421
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
1422
|
+
readonly code: Schema.optional<Schema.String>;
|
|
1423
|
+
readonly message: Schema.optional<Schema.String>;
|
|
1424
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
1425
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
1426
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
1427
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
1428
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
1429
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
1430
|
+
}>>;
|
|
1431
|
+
}>>;
|
|
1432
|
+
readonly starts: Schema.Int;
|
|
1433
|
+
readonly leftBehind: Schema.Struct<{
|
|
1434
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
1435
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
1436
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
1437
|
+
}>;
|
|
1438
|
+
}>>>;
|
|
1279
1439
|
}>>, Schema.toCodecJson<typeof BoatAccountKeyRefusedError | typeof BoatAccountNotFoundError | typeof BoatAccountServiceUnavailableError | typeof BoatAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"checkBoatInstallKey", "POST", "/install-key", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1280
1440
|
readonly label: Schema.String;
|
|
1281
1441
|
/** The key's last report, with when it was observed; null until it is checked. */
|
|
@@ -1664,6 +1824,36 @@ export declare const BoatAccountsGroup: HttpApiGroup.HttpApiGroup<"boatAccounts"
|
|
|
1664
1824
|
}>>;
|
|
1665
1825
|
}>]>;
|
|
1666
1826
|
}>>>;
|
|
1827
|
+
/** The account's last full check (`prove`), kept beside its report; null until it is proven. */
|
|
1828
|
+
readonly lastProof: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
1829
|
+
readonly proofId: Schema.String;
|
|
1830
|
+
readonly startedAt: Schema.String;
|
|
1831
|
+
readonly finishedAt: Schema.String;
|
|
1832
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
1833
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
1834
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
1835
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
1836
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
1837
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
1838
|
+
readonly retryable: Schema.Boolean;
|
|
1839
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
1840
|
+
readonly code: Schema.optional<Schema.String>;
|
|
1841
|
+
readonly message: Schema.optional<Schema.String>;
|
|
1842
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
1843
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
1844
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
1845
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
1846
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
1847
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
1848
|
+
}>>;
|
|
1849
|
+
}>>;
|
|
1850
|
+
readonly starts: Schema.Int;
|
|
1851
|
+
readonly leftBehind: Schema.Struct<{
|
|
1852
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
1853
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
1854
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
1855
|
+
}>;
|
|
1856
|
+
}>>>;
|
|
1667
1857
|
}>>, Schema.toCodecJson<typeof BoatAccountBadRequestError | typeof BoatAccountKeyRefusedError | typeof BoatAccountServiceUnavailableError | typeof BoatAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getBoatInstallKey", "GET", "/install-key", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1668
1858
|
readonly label: Schema.String;
|
|
1669
1859
|
/** The key's last report, with when it was observed; null until it is checked. */
|
|
@@ -2043,8 +2233,68 @@ export declare const BoatAccountsGroup: HttpApiGroup.HttpApiGroup<"boatAccounts"
|
|
|
2043
2233
|
}>>;
|
|
2044
2234
|
}>]>;
|
|
2045
2235
|
}>>>;
|
|
2236
|
+
/** The account's last full check (`prove`), kept beside its report; null until it is proven. */
|
|
2237
|
+
readonly lastProof: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
2238
|
+
readonly proofId: Schema.String;
|
|
2239
|
+
readonly startedAt: Schema.String;
|
|
2240
|
+
readonly finishedAt: Schema.String;
|
|
2241
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
2242
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
2243
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
2244
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
2245
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
2246
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
2247
|
+
readonly retryable: Schema.Boolean;
|
|
2248
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
2249
|
+
readonly code: Schema.optional<Schema.String>;
|
|
2250
|
+
readonly message: Schema.optional<Schema.String>;
|
|
2251
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
2252
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
2253
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
2254
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
2255
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
2256
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
2257
|
+
}>>;
|
|
2258
|
+
}>>;
|
|
2259
|
+
readonly starts: Schema.Int;
|
|
2260
|
+
readonly leftBehind: Schema.Struct<{
|
|
2261
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
2262
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
2263
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
2264
|
+
}>;
|
|
2265
|
+
}>>>;
|
|
2046
2266
|
}>>;
|
|
2047
|
-
}>>, Schema.toCodecJson<typeof BoatAccountServiceUnavailableError | typeof BoatAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
2267
|
+
}>>, Schema.toCodecJson<typeof BoatAccountServiceUnavailableError | typeof BoatAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"proveBoatAccount", "POST", "/:boatAccountId/prove", Schema.toCodecStringTree<Schema.Struct<{
|
|
2268
|
+
readonly boatAccountId: Schema.String;
|
|
2269
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
2270
|
+
readonly proofId: Schema.String;
|
|
2271
|
+
readonly startedAt: Schema.String;
|
|
2272
|
+
readonly finishedAt: Schema.String;
|
|
2273
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
2274
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
2275
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
2276
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
2277
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
2278
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
2279
|
+
readonly retryable: Schema.Boolean;
|
|
2280
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
2281
|
+
readonly code: Schema.optional<Schema.String>;
|
|
2282
|
+
readonly message: Schema.optional<Schema.String>;
|
|
2283
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
2284
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
2285
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
2286
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
2287
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
2288
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
2289
|
+
}>>;
|
|
2290
|
+
}>>;
|
|
2291
|
+
readonly starts: Schema.Int;
|
|
2292
|
+
readonly leftBehind: Schema.Struct<{
|
|
2293
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
2294
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
2295
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
2296
|
+
}>;
|
|
2297
|
+
}>>, Schema.toCodecJson<typeof BoatAccountNotFoundError | typeof BoatAccountConflictError | typeof BoatAccountServiceUnavailableError | typeof BoatAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"removeBoatAccount", "DELETE", "/:boatAccountId", Schema.toCodecStringTree<Schema.Struct<{
|
|
2048
2298
|
readonly boatAccountId: Schema.Union<readonly [Schema.String, Schema.Literal<"default">]>;
|
|
2049
2299
|
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
2050
2300
|
readonly boatAccountId: Schema.String;
|
|
@@ -2239,6 +2489,36 @@ export declare const BoatAccountsGroup: HttpApiGroup.HttpApiGroup<"boatAccounts"
|
|
|
2239
2489
|
}>>;
|
|
2240
2490
|
}>]>;
|
|
2241
2491
|
}>>>;
|
|
2492
|
+
/** The account's last full check (`prove`), kept beside its report; null until it is proven. */
|
|
2493
|
+
readonly lastProof: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
2494
|
+
readonly proofId: Schema.String;
|
|
2495
|
+
readonly startedAt: Schema.String;
|
|
2496
|
+
readonly finishedAt: Schema.String;
|
|
2497
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
2498
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
2499
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
2500
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
2501
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
2502
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
2503
|
+
readonly retryable: Schema.Boolean;
|
|
2504
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
2505
|
+
readonly code: Schema.optional<Schema.String>;
|
|
2506
|
+
readonly message: Schema.optional<Schema.String>;
|
|
2507
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
2508
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
2509
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
2510
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
2511
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
2512
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
2513
|
+
}>>;
|
|
2514
|
+
}>>;
|
|
2515
|
+
readonly starts: Schema.Int;
|
|
2516
|
+
readonly leftBehind: Schema.Struct<{
|
|
2517
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
2518
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
2519
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
2520
|
+
}>;
|
|
2521
|
+
}>>>;
|
|
2242
2522
|
}>>, Schema.toCodecJson<typeof BoatAccountNotFoundError | typeof BoatAccountConflictError | typeof BoatAccountServiceUnavailableError | typeof BoatAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"rotateBoatAccountKey", "PUT", "/:boatAccountId/key", Schema.toCodecStringTree<Schema.Struct<{
|
|
2243
2523
|
readonly boatAccountId: Schema.Union<readonly [Schema.String, Schema.Literal<"default">]>;
|
|
2244
2524
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
@@ -2437,5 +2717,35 @@ export declare const BoatAccountsGroup: HttpApiGroup.HttpApiGroup<"boatAccounts"
|
|
|
2437
2717
|
}>>;
|
|
2438
2718
|
}>]>;
|
|
2439
2719
|
}>>>;
|
|
2720
|
+
/** The account's last full check (`prove`), kept beside its report; null until it is proven. */
|
|
2721
|
+
readonly lastProof: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
2722
|
+
readonly proofId: Schema.String;
|
|
2723
|
+
readonly startedAt: Schema.String;
|
|
2724
|
+
readonly finishedAt: Schema.String;
|
|
2725
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "interrupted"]>;
|
|
2726
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
2727
|
+
readonly step: Schema.Literals<readonly ["start-vm", "run-command", "publish-port", "save-snapshot", "delete-snapshot", "delete-vm"]>;
|
|
2728
|
+
readonly outcome: Schema.Literals<readonly ["passed", "refused", "no-answer", "not-reached"]>;
|
|
2729
|
+
readonly boat: Schema.optional<Schema.Struct<{
|
|
2730
|
+
readonly kind: Schema.Literals<readonly ["key-refused", "key-expired", "permission-missing", "sandbox-outside-key", "organization-mismatch", "account-suspended", "billing-required", "running-limit", "member-cap", "rate-limited", "trial-restricted", "no-machine", "snapshot-allowance-full", "no-answer", "refused"]>;
|
|
2731
|
+
readonly retryable: Schema.Boolean;
|
|
2732
|
+
readonly operation: Schema.optional<Schema.String>;
|
|
2733
|
+
readonly code: Schema.optional<Schema.String>;
|
|
2734
|
+
readonly message: Schema.optional<Schema.String>;
|
|
2735
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
2736
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
2737
|
+
readonly permission: Schema.optional<Schema.String>;
|
|
2738
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Int>;
|
|
2739
|
+
readonly retryAt: Schema.optional<Schema.String>;
|
|
2740
|
+
readonly billingUrl: Schema.optional<Schema.String>;
|
|
2741
|
+
}>>;
|
|
2742
|
+
}>>;
|
|
2743
|
+
readonly starts: Schema.Int;
|
|
2744
|
+
readonly leftBehind: Schema.Struct<{
|
|
2745
|
+
readonly vm: Schema.NullOr<Schema.String>;
|
|
2746
|
+
readonly snapshot: Schema.NullOr<Schema.String>;
|
|
2747
|
+
readonly removalConfirmed: Schema.Boolean;
|
|
2748
|
+
}>;
|
|
2749
|
+
}>>>;
|
|
2440
2750
|
}>>, Schema.toCodecJson<typeof BoatAccountBadRequestError | typeof BoatAccountKeyRefusedError | typeof BoatAccountNotFoundError | typeof BoatAccountConflictError | typeof BoatAccountServiceUnavailableError | typeof BoatAccountInternalServerError>, never, never>, false>;
|
|
2441
2751
|
export {};
|
|
@@ -98,6 +98,50 @@ export const boatKeyReportSchema = Schema.Struct({
|
|
|
98
98
|
/** Saved snapshot slots of the wallet (`GET /saved-snapshots`). */
|
|
99
99
|
snapshots: observedOr({ used: Schema.Int, included: Schema.Int }),
|
|
100
100
|
});
|
|
101
|
+
/** The steps of a Boat key's full check, in order: the last two are also its cleanup. */
|
|
102
|
+
export const BOAT_KEY_PROOF_STEPS = [
|
|
103
|
+
"start-vm",
|
|
104
|
+
"run-command",
|
|
105
|
+
"publish-port",
|
|
106
|
+
"save-snapshot",
|
|
107
|
+
"delete-snapshot",
|
|
108
|
+
"delete-vm",
|
|
109
|
+
];
|
|
110
|
+
/**
|
|
111
|
+
* One step of a full check. `passed`: Boat did it. `refused`: Boat refused it, `boat` says why.
|
|
112
|
+
* `no-answer`: Boat did not answer (the step may have happened; cleanup assumes it did).
|
|
113
|
+
* `not-reached`: an earlier step stopped the check, and this one was not tried.
|
|
114
|
+
*/
|
|
115
|
+
export const boatKeyProofStepSchema = Schema.Struct({
|
|
116
|
+
step: Schema.Literals(BOAT_KEY_PROOF_STEPS),
|
|
117
|
+
outcome: Schema.Literals(["passed", "refused", "no-answer", "not-reached"]),
|
|
118
|
+
boat: Schema.optional(boatFailureSchema),
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* A full check of a Boat key: Core started the smallest VM, ran a command in it, published a port,
|
|
122
|
+
* saved a snapshot, then deleted the snapshot and the VM, and says how far it got. `outcome`:
|
|
123
|
+
* `passed` (every step), `refused` (Boat refused a step; the first refused or unanswered step
|
|
124
|
+
* says why), or `interrupted` (the check stopped before it finished; what it made was removed by
|
|
125
|
+
* the sweep). `starts`: how many VM starts it asked Boat for (0 or 1). `leftBehind`: what Boat
|
|
126
|
+
* may still hold of it when the answer was given. `removalConfirmed` true: Core saw Boat delete
|
|
127
|
+
* everything it made. False: the worker's sweep owns what is left and keeps deleting it, with
|
|
128
|
+
* `vm` (an id) and `snapshot` (a name) naming what is known; `vm` is null when a VM may exist
|
|
129
|
+
* whose id Boat never answered (the sweep finds it by its label). Until the sweep has finished,
|
|
130
|
+
* the account's key is neither rotated nor removed.
|
|
131
|
+
*/
|
|
132
|
+
export const boatKeyProofSchema = Schema.Struct({
|
|
133
|
+
proofId: Schema.String,
|
|
134
|
+
startedAt: Schema.String,
|
|
135
|
+
finishedAt: Schema.String,
|
|
136
|
+
outcome: Schema.Literals(["passed", "refused", "interrupted"]),
|
|
137
|
+
steps: Schema.Array(boatKeyProofStepSchema),
|
|
138
|
+
starts: Schema.Int,
|
|
139
|
+
leftBehind: Schema.Struct({
|
|
140
|
+
vm: Schema.NullOr(Schema.String),
|
|
141
|
+
snapshot: Schema.NullOr(Schema.String),
|
|
142
|
+
removalConfirmed: Schema.Boolean,
|
|
143
|
+
}),
|
|
144
|
+
});
|
|
101
145
|
export const boatAccountSchema = Schema.Struct({
|
|
102
146
|
boatAccountId: BoatAccountId,
|
|
103
147
|
label: NonEmptyString,
|
|
@@ -110,6 +154,8 @@ export const boatAccountSchema = Schema.Struct({
|
|
|
110
154
|
organization: Schema.optional(Schema.NullOr(Schema.String)),
|
|
111
155
|
/** The key's last report, with when it was observed; null until the key is checked. */
|
|
112
156
|
report: Schema.optional(Schema.NullOr(boatKeyReportSchema)),
|
|
157
|
+
/** The account's last full check (`prove`), kept beside its report; null until it is proven. */
|
|
158
|
+
lastProof: Schema.optional(Schema.NullOr(boatKeyProofSchema)),
|
|
113
159
|
});
|
|
114
160
|
/**
|
|
115
161
|
* The install's own Boat key (`SEALANT_BOAT_API_KEY`), which workspaces run in when they name no
|
|
@@ -171,7 +217,9 @@ export class BoatAccountNotFoundError extends Schema.TaggedError()("BoatAccountN
|
|
|
171
217
|
* now (`unseen`), so it is most likely another Boat account's key. `boat-account-removing`: the
|
|
172
218
|
* account's removal was asked. `boat-account-changed`: another rotation won; read and try again.
|
|
173
219
|
* `boat-account-environment`: the install's own key (`default`) is set in its environment, not
|
|
174
|
-
* through this API.
|
|
220
|
+
* through this API. `boat-proof-running`: a full check of the account is running, or Boat may
|
|
221
|
+
* still hold what one made (the message names the VM and the snapshot): a second check, a key
|
|
222
|
+
* rotation and a removal wait until Core has deleted it.
|
|
175
223
|
*/
|
|
176
224
|
export class BoatAccountConflictError extends Schema.TaggedError()("BoatAccountConflictError", {
|
|
177
225
|
message: Schema.String,
|
|
@@ -181,6 +229,7 @@ export class BoatAccountConflictError extends Schema.TaggedError()("BoatAccountC
|
|
|
181
229
|
"boat-account-removing",
|
|
182
230
|
"boat-account-changed",
|
|
183
231
|
"boat-account-environment",
|
|
232
|
+
"boat-proof-running",
|
|
184
233
|
]),
|
|
185
234
|
liveRuns: Schema.optional(Schema.Int),
|
|
186
235
|
buildsInFlight: Schema.optional(Schema.Int),
|
|
@@ -252,6 +301,19 @@ HttpApiEndpoint.post("checkBoatAccount", "/:boatAccountId/check", {
|
|
|
252
301
|
],
|
|
253
302
|
}))
|
|
254
303
|
.add(
|
|
304
|
+
// A full check: a throwaway VM is started, used and deleted, with a snapshot saved and
|
|
305
|
+
// deleted; whatever it made is removed on every path. One per account at a time.
|
|
306
|
+
HttpApiEndpoint.post("proveBoatAccount", "/:boatAccountId/prove", {
|
|
307
|
+
params: Schema.Struct({ boatAccountId: BoatAccountId }),
|
|
308
|
+
success: boatKeyProofSchema,
|
|
309
|
+
error: [
|
|
310
|
+
BoatAccountNotFoundError,
|
|
311
|
+
BoatAccountConflictError,
|
|
312
|
+
BoatAccountServiceUnavailableError,
|
|
313
|
+
BoatAccountInternalServerError,
|
|
314
|
+
],
|
|
315
|
+
}))
|
|
316
|
+
.add(
|
|
255
317
|
// The removal's first step: the account takes no new workspace at once, and its saved images
|
|
256
318
|
// are deleted from Boat by the worker before it is gone from the list.
|
|
257
319
|
HttpApiEndpoint.delete("removeBoatAccount", "/:boatAccountId", {
|