@boatdev/sdk 1.0.1 → 1.2.0

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.
Files changed (55) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +8 -26
  3. package/dist/apis/BoatApi.d.ts +99 -80
  4. package/dist/apis/BoatApi.js +103 -28
  5. package/dist/esm/apis/BoatApi.d.ts +99 -80
  6. package/dist/esm/apis/BoatApi.js +103 -28
  7. package/dist/esm/models/CreateSandboxRequest.d.ts +6 -0
  8. package/dist/esm/models/CreateSandboxRequest.js +2 -0
  9. package/dist/esm/models/DataRetentionPolicyResponse.d.ts +12 -0
  10. package/dist/esm/models/DataRetentionPolicyResponse.js +4 -0
  11. package/dist/esm/models/DataRetentionUpdateRequest.d.ts +8 -2
  12. package/dist/esm/models/DataRetentionUpdateRequest.js +3 -3
  13. package/dist/esm/models/DeletionOperation.d.ts +24 -0
  14. package/dist/esm/models/DeletionOperation.js +15 -0
  15. package/dist/esm/models/DeletionOperationListResponse.d.ts +52 -0
  16. package/dist/esm/models/DeletionOperationListResponse.js +58 -0
  17. package/dist/esm/models/Sandbox.d.ts +6 -0
  18. package/dist/esm/models/Sandbox.js +2 -0
  19. package/dist/esm/models/index.d.ts +1 -0
  20. package/dist/esm/models/index.js +1 -0
  21. package/dist/esm/runtime.d.ts +8 -0
  22. package/dist/esm/runtime.js +18 -0
  23. package/dist/models/CreateSandboxRequest.d.ts +6 -0
  24. package/dist/models/CreateSandboxRequest.js +2 -0
  25. package/dist/models/DataRetentionPolicyResponse.d.ts +12 -0
  26. package/dist/models/DataRetentionPolicyResponse.js +4 -0
  27. package/dist/models/DataRetentionUpdateRequest.d.ts +8 -2
  28. package/dist/models/DataRetentionUpdateRequest.js +3 -3
  29. package/dist/models/DeletionOperation.d.ts +24 -0
  30. package/dist/models/DeletionOperation.js +16 -1
  31. package/dist/models/DeletionOperationListResponse.d.ts +52 -0
  32. package/dist/models/DeletionOperationListResponse.js +66 -0
  33. package/dist/models/Sandbox.d.ts +6 -0
  34. package/dist/models/Sandbox.js +2 -0
  35. package/dist/models/index.d.ts +1 -0
  36. package/dist/models/index.js +1 -0
  37. package/dist/runtime.d.ts +8 -0
  38. package/dist/runtime.js +19 -0
  39. package/docs/BoatApi.md +80 -1
  40. package/docs/CreateSandboxRequest.md +2 -0
  41. package/docs/DataRetentionPolicyResponse.md +4 -0
  42. package/docs/DataRetentionUpdateRequest.md +3 -0
  43. package/docs/DeletionOperation.md +4 -0
  44. package/docs/DeletionOperationListResponse.md +36 -0
  45. package/docs/Sandbox.md +2 -0
  46. package/package.json +1 -1
  47. package/src/apis/BoatApi.ts +182 -80
  48. package/src/models/CreateSandboxRequest.ts +8 -0
  49. package/src/models/DataRetentionPolicyResponse.ts +16 -0
  50. package/src/models/DataRetentionUpdateRequest.ts +11 -4
  51. package/src/models/DeletionOperation.ts +29 -0
  52. package/src/models/DeletionOperationListResponse.ts +102 -0
  53. package/src/models/Sandbox.ts +8 -0
  54. package/src/models/index.ts +1 -0
  55. package/src/runtime.ts +23 -0
@@ -103,6 +103,7 @@ export function SandboxFromJSONTyped(json, ignoreDiscriminator) {
103
103
  'archiveAfter': json['archiveAfter'] == null ? undefined : (new Date(json['archiveAfter'])),
104
104
  'desktopAvailable': json['desktopAvailable'],
105
105
  'desktopUrl': json['desktopUrl'] == null ? undefined : json['desktopUrl'],
106
+ 'snapshots': json['snapshots'] == null ? undefined : json['snapshots'],
106
107
  'snapshotAvailable': json['snapshotAvailable'],
107
108
  'snapshotCompletedAt': json['snapshotCompletedAt'] == null ? undefined : (new Date(json['snapshotCompletedAt'])),
108
109
  'snapshotVerifiedAt': json['snapshotVerifiedAt'] == null ? undefined : (new Date(json['snapshotVerifiedAt'])),
@@ -141,6 +142,7 @@ export function SandboxToJSONTyped(value, ignoreDiscriminator = false) {
141
142
  'archiveAfter': value['archiveAfter'] == null ? value['archiveAfter'] : value['archiveAfter'].toISOString(),
142
143
  'desktopAvailable': value['desktopAvailable'],
143
144
  'desktopUrl': value['desktopUrl'],
145
+ 'snapshots': value['snapshots'],
144
146
  'snapshotAvailable': value['snapshotAvailable'],
145
147
  'snapshotCompletedAt': value['snapshotCompletedAt'] == null ? value['snapshotCompletedAt'] : value['snapshotCompletedAt'].toISOString(),
146
148
  'snapshotVerifiedAt': value['snapshotVerifiedAt'] == null ? value['snapshotVerifiedAt'] : value['snapshotVerifiedAt'].toISOString(),
@@ -31,6 +31,7 @@ export * from './CreateScopedApiKeyRequest';
31
31
  export * from './DataRetentionPolicyResponse';
32
32
  export * from './DataRetentionUpdateRequest';
33
33
  export * from './DeletionOperation';
34
+ export * from './DeletionOperationListResponse';
34
35
  export * from './DeletionOperationResponse';
35
36
  export * from './DesktopRequest';
36
37
  export * from './DesktopResponse';
@@ -33,6 +33,7 @@ export * from './CreateScopedApiKeyRequest';
33
33
  export * from './DataRetentionPolicyResponse';
34
34
  export * from './DataRetentionUpdateRequest';
35
35
  export * from './DeletionOperation';
36
+ export * from './DeletionOperationListResponse';
36
37
  export * from './DeletionOperationResponse';
37
38
  export * from './DesktopRequest';
38
39
  export * from './DesktopResponse';
@@ -182,3 +182,11 @@ export declare class TextApiResponse {
182
182
  constructor(raw: Response);
183
183
  value(): Promise<string>;
184
184
  }
185
+ /**
186
+ * A body-taking call's parameters with the body's fields inline, next to the
187
+ * path/query/header parameters: `fork({ sandboxId, type: 'small' })` is
188
+ * `fork({ sandboxId, forkRequest: { type: 'small' } })`. Both shapes are accepted.
189
+ */
190
+ export type FlatBody<R, K extends keyof R> = Omit<R, K> & NonNullable<R[K]>;
191
+ /** Turns either call shape into the wrapped one the generated code sends. */
192
+ export declare function unflattenBody<R>(input: object, bodyKey: string, paramKeys: string[], sharedKeys: string[]): R;
@@ -335,3 +335,21 @@ export class TextApiResponse {
335
335
  }
336
336
  ;
337
337
  }
338
+ /** Turns either call shape into the wrapped one the generated code sends. */
339
+ export function unflattenBody(input, bodyKey, paramKeys, sharedKeys) {
340
+ if (input == null || bodyKey in input)
341
+ return input;
342
+ const params = {};
343
+ const body = {};
344
+ for (const [k, v] of Object.entries(input)) {
345
+ const isParam = paramKeys.indexOf(k) !== -1;
346
+ if (isParam)
347
+ params[k] = v;
348
+ if (!isParam || sharedKeys.indexOf(k) !== -1)
349
+ body[k] = v;
350
+ }
351
+ // No body field given: send no body, exactly like the wrapped call with the key omitted.
352
+ if (Object.keys(body).length > 0)
353
+ params[bodyKey] = body;
354
+ return params;
355
+ }
@@ -47,6 +47,12 @@ export interface CreateSandboxRequest {
47
47
  * @memberof CreateSandboxRequest
48
48
  */
49
49
  noEnv?: boolean;
50
+ /**
51
+ * Pass `false` to never snapshot this sandbox. Nothing is captured in the background, so it pays no CPU or memory for it, and stopping it erases its disk the way zero data retention does. It cannot be resumed, forked, or saved as a named snapshot, and if its machine fails there is no backup to rebuild it from.
52
+ * @type {boolean}
53
+ * @memberof CreateSandboxRequest
54
+ */
55
+ snapshots?: boolean;
50
56
  /**
51
57
  * Shell script that runs on the sandbox after it is ready. Ready means "ready to accept the user", not "setup done": the script starts in the background once provisioning completes and never blocks the sandbox becoming usable. It runs as the sandbox user via `bash`, with the sandbox's environment applied, and its output goes to a log file on the sandbox. Observe the outcome as `setupStatus` (pending/running/done/failed) and `setupError` on the sandbox. Rejected with a 400 `invalid_setup_script` error when it is not a string or exceeds 64KB.
52
58
  * @type {string}
@@ -46,6 +46,7 @@ function CreateSandboxRequestFromJSONTyped(json, ignoreDiscriminator) {
46
46
  'env': json['env'] == null ? undefined : json['env'],
47
47
  'environment': json['environment'] == null ? undefined : json['environment'],
48
48
  'noEnv': json['noEnv'] == null ? undefined : json['noEnv'],
49
+ 'snapshots': json['snapshots'] == null ? undefined : json['snapshots'],
49
50
  'setupScript': json['setupScript'] == null ? undefined : json['setupScript'],
50
51
  'org': json['org'] == null ? undefined : json['org'],
51
52
  'teamId': json['teamId'] == null ? undefined : json['teamId'],
@@ -65,6 +66,7 @@ function CreateSandboxRequestToJSONTyped(value, ignoreDiscriminator = false) {
65
66
  'env': value['env'],
66
67
  'environment': value['environment'],
67
68
  'noEnv': value['noEnv'],
69
+ 'snapshots': value['snapshots'],
68
70
  'setupScript': value['setupScript'],
69
71
  'org': value['org'],
70
72
  'teamId': value['teamId'],
@@ -51,6 +51,18 @@ export interface DataRetentionPolicyResponse {
51
51
  * @memberof DataRetentionPolicyResponse
52
52
  */
53
53
  acceptedDeletionOperationsIrreversible?: boolean;
54
+ /**
55
+ * When true, every new sandbox of this account is created with snapshots off.
56
+ * @type {boolean}
57
+ * @memberof DataRetentionPolicyResponse
58
+ */
59
+ snapshotsOff?: boolean;
60
+ /**
61
+ *
62
+ * @type {Date}
63
+ * @memberof DataRetentionPolicyResponse
64
+ */
65
+ snapshotsOffAt?: Date | null;
54
66
  }
55
67
  /**
56
68
  * @export
@@ -54,6 +54,8 @@ function DataRetentionPolicyResponseFromJSONTyped(json, ignoreDiscriminator) {
54
54
  'enabledAt': (json['enabledAt'] == null ? null : new Date(json['enabledAt'])),
55
55
  'queuedSandboxes': json['queuedSandboxes'] == null ? undefined : json['queuedSandboxes'],
56
56
  'acceptedDeletionOperationsIrreversible': json['acceptedDeletionOperationsIrreversible'] == null ? undefined : json['acceptedDeletionOperationsIrreversible'],
57
+ 'snapshotsOff': json['snapshotsOff'] == null ? undefined : json['snapshotsOff'],
58
+ 'snapshotsOffAt': json['snapshotsOffAt'] == null ? undefined : (new Date(json['snapshotsOffAt'])),
57
59
  };
58
60
  }
59
61
  function DataRetentionPolicyResponseToJSON(json) {
@@ -70,5 +72,7 @@ function DataRetentionPolicyResponseToJSONTyped(value, ignoreDiscriminator = fal
70
72
  'enabledAt': value['enabledAt'] == null ? value['enabledAt'] : value['enabledAt'].toISOString(),
71
73
  'queuedSandboxes': value['queuedSandboxes'],
72
74
  'acceptedDeletionOperationsIrreversible': value['acceptedDeletionOperationsIrreversible'],
75
+ 'snapshotsOff': value['snapshotsOff'],
76
+ 'snapshotsOffAt': value['snapshotsOffAt'] == null ? value['snapshotsOffAt'] : value['snapshotsOffAt'].toISOString(),
73
77
  };
74
78
  }
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- *
13
+ * Pass `enabled` to change zero data retention, or `snapshotsOff` alone to change the account's snapshots-off setting.
14
14
  * @export
15
15
  * @interface DataRetentionUpdateRequest
16
16
  */
@@ -20,7 +20,13 @@ export interface DataRetentionUpdateRequest {
20
20
  * @type {boolean}
21
21
  * @memberof DataRetentionUpdateRequest
22
22
  */
23
- enabled: boolean;
23
+ enabled?: boolean;
24
+ /**
25
+ * Turn snapshots off for every sandbox created from now on. Existing sandboxes keep their setting. While on, a create or fork that passes `snapshots: true` is refused with 409 `snapshots_off_for_account`.
26
+ * @type {boolean}
27
+ * @memberof DataRetentionUpdateRequest
28
+ */
29
+ snapshotsOff?: boolean;
24
30
  /**
25
31
  * Required when enabling and must exactly equal `delete archived sandbox data`.
26
32
  * @type {DataRetentionUpdateRequestConfirmationEnum}
@@ -29,8 +29,6 @@ exports.DataRetentionUpdateRequestConfirmationEnum = {
29
29
  * Check if a given object implements the DataRetentionUpdateRequest interface.
30
30
  */
31
31
  function instanceOfDataRetentionUpdateRequest(value) {
32
- if (!('enabled' in value) || value['enabled'] === undefined)
33
- return false;
34
32
  return true;
35
33
  }
36
34
  function DataRetentionUpdateRequestFromJSON(json) {
@@ -41,7 +39,8 @@ function DataRetentionUpdateRequestFromJSONTyped(json, ignoreDiscriminator) {
41
39
  return json;
42
40
  }
43
41
  return {
44
- 'enabled': json['enabled'],
42
+ 'enabled': json['enabled'] == null ? undefined : json['enabled'],
43
+ 'snapshotsOff': json['snapshotsOff'] == null ? undefined : json['snapshotsOff'],
45
44
  'confirmation': json['confirmation'] == null ? undefined : json['confirmation'],
46
45
  };
47
46
  }
@@ -54,6 +53,7 @@ function DataRetentionUpdateRequestToJSONTyped(value, ignoreDiscriminator = fals
54
53
  }
55
54
  return {
56
55
  'enabled': value['enabled'],
56
+ 'snapshotsOff': value['snapshotsOff'],
57
57
  'confirmation': value['confirmation'],
58
58
  };
59
59
  }
@@ -45,6 +45,18 @@ export interface DeletionOperation {
45
45
  * @memberof DeletionOperation
46
46
  */
47
47
  status: DeletionOperationStatusEnum;
48
+ /**
49
+ * What the background purge is doing. The target is already gone from every list, restore and fork once the operation exists. `waiting_for_uploads`: stored data is erased once the last upload URL issued for it expires (`expectedBy`). `kept_for_newer_snapshots`: a newer snapshot you kept is built on this one; its data goes when they go. `waiting_for_restore`: a sandbox is still restoring from it. `retrying`: a transient fault, retried automatically.
50
+ * @type {DeletionOperationStageEnum}
51
+ * @memberof DeletionOperation
52
+ */
53
+ stage?: DeletionOperationStageEnum;
54
+ /**
55
+ * When `waiting_for_uploads` ends.
56
+ * @type {Date}
57
+ * @memberof DeletionOperation
58
+ */
59
+ expectedBy?: Date | null;
48
60
  /**
49
61
  *
50
62
  * @type {number}
@@ -91,6 +103,18 @@ export declare const DeletionOperationStatusEnum: {
91
103
  readonly Completed: 'completed';
92
104
  };
93
105
  export type DeletionOperationStatusEnum = typeof DeletionOperationStatusEnum[keyof typeof DeletionOperationStatusEnum];
106
+ /**
107
+ * @export
108
+ */
109
+ export declare const DeletionOperationStageEnum: {
110
+ readonly Removing: 'removing';
111
+ readonly WaitingForUploads: 'waiting_for_uploads';
112
+ readonly KeptForNewerSnapshots: 'kept_for_newer_snapshots';
113
+ readonly WaitingForRestore: 'waiting_for_restore';
114
+ readonly Retrying: 'retrying';
115
+ readonly Completed: 'completed';
116
+ };
117
+ export type DeletionOperationStageEnum = typeof DeletionOperationStageEnum[keyof typeof DeletionOperationStageEnum];
94
118
  /**
95
119
  * Check if a given object implements the DeletionOperation interface.
96
120
  */
@@ -13,7 +13,7 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.DeletionOperationStatusEnum = exports.DeletionOperationReasonEnum = exports.DeletionOperationKindEnum = void 0;
16
+ exports.DeletionOperationStageEnum = exports.DeletionOperationStatusEnum = exports.DeletionOperationReasonEnum = exports.DeletionOperationKindEnum = void 0;
17
17
  exports.instanceOfDeletionOperation = instanceOfDeletionOperation;
18
18
  exports.DeletionOperationFromJSON = DeletionOperationFromJSON;
19
19
  exports.DeletionOperationFromJSONTyped = DeletionOperationFromJSONTyped;
@@ -43,6 +43,17 @@ exports.DeletionOperationStatusEnum = {
43
43
  Blocked: 'blocked',
44
44
  Completed: 'completed'
45
45
  };
46
+ /**
47
+ * @export
48
+ */
49
+ exports.DeletionOperationStageEnum = {
50
+ Removing: 'removing',
51
+ WaitingForUploads: 'waiting_for_uploads',
52
+ KeptForNewerSnapshots: 'kept_for_newer_snapshots',
53
+ WaitingForRestore: 'waiting_for_restore',
54
+ Retrying: 'retrying',
55
+ Completed: 'completed'
56
+ };
46
57
  /**
47
58
  * Check if a given object implements the DeletionOperation interface.
48
59
  */
@@ -78,6 +89,8 @@ function DeletionOperationFromJSONTyped(json, ignoreDiscriminator) {
78
89
  'targetId': json['targetId'],
79
90
  'reason': json['reason'],
80
91
  'status': json['status'],
92
+ 'stage': json['stage'] == null ? undefined : json['stage'],
93
+ 'expectedBy': json['expectedBy'] == null ? undefined : (new Date(json['expectedBy'])),
81
94
  'attemptCount': json['attemptCount'],
82
95
  'requestedAt': (new Date(json['requestedAt'])),
83
96
  'completedAt': (json['completedAt'] == null ? null : new Date(json['completedAt'])),
@@ -96,6 +109,8 @@ function DeletionOperationToJSONTyped(value, ignoreDiscriminator = false) {
96
109
  'targetId': value['targetId'],
97
110
  'reason': value['reason'],
98
111
  'status': value['status'],
112
+ 'stage': value['stage'],
113
+ 'expectedBy': value['expectedBy'] == null ? value['expectedBy'] : value['expectedBy'].toISOString(),
99
114
  'attemptCount': value['attemptCount'],
100
115
  'requestedAt': value['requestedAt'].toISOString(),
101
116
  'completedAt': value['completedAt'] == null ? value['completedAt'] : value['completedAt'].toISOString(),
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Boat Public API v1
3
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { DeletionOperation } from './DeletionOperation';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface DeletionOperationListResponse
17
+ */
18
+ export interface DeletionOperationListResponse {
19
+ /**
20
+ *
21
+ * @type {boolean}
22
+ * @memberof DeletionOperationListResponse
23
+ */
24
+ ok: boolean;
25
+ /**
26
+ *
27
+ * @type {DeletionOperationListResponseTypeEnum}
28
+ * @memberof DeletionOperationListResponse
29
+ */
30
+ type: DeletionOperationListResponseTypeEnum;
31
+ /**
32
+ *
33
+ * @type {Array<DeletionOperation>}
34
+ * @memberof DeletionOperationListResponse
35
+ */
36
+ operations: Array<DeletionOperation>;
37
+ }
38
+ /**
39
+ * @export
40
+ */
41
+ export declare const DeletionOperationListResponseTypeEnum: {
42
+ readonly SnapshotDeleting: 'snapshot.deleting';
43
+ };
44
+ export type DeletionOperationListResponseTypeEnum = typeof DeletionOperationListResponseTypeEnum[keyof typeof DeletionOperationListResponseTypeEnum];
45
+ /**
46
+ * Check if a given object implements the DeletionOperationListResponse interface.
47
+ */
48
+ export declare function instanceOfDeletionOperationListResponse(value: object): value is DeletionOperationListResponse;
49
+ export declare function DeletionOperationListResponseFromJSON(json: any): DeletionOperationListResponse;
50
+ export declare function DeletionOperationListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeletionOperationListResponse;
51
+ export declare function DeletionOperationListResponseToJSON(json: any): DeletionOperationListResponse;
52
+ export declare function DeletionOperationListResponseToJSONTyped(value?: DeletionOperationListResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Boat Public API v1
6
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.DeletionOperationListResponseTypeEnum = void 0;
17
+ exports.instanceOfDeletionOperationListResponse = instanceOfDeletionOperationListResponse;
18
+ exports.DeletionOperationListResponseFromJSON = DeletionOperationListResponseFromJSON;
19
+ exports.DeletionOperationListResponseFromJSONTyped = DeletionOperationListResponseFromJSONTyped;
20
+ exports.DeletionOperationListResponseToJSON = DeletionOperationListResponseToJSON;
21
+ exports.DeletionOperationListResponseToJSONTyped = DeletionOperationListResponseToJSONTyped;
22
+ const DeletionOperation_1 = require("./DeletionOperation");
23
+ /**
24
+ * @export
25
+ */
26
+ exports.DeletionOperationListResponseTypeEnum = {
27
+ SnapshotDeleting: 'snapshot.deleting'
28
+ };
29
+ /**
30
+ * Check if a given object implements the DeletionOperationListResponse interface.
31
+ */
32
+ function instanceOfDeletionOperationListResponse(value) {
33
+ if (!('ok' in value) || value['ok'] === undefined)
34
+ return false;
35
+ if (!('type' in value) || value['type'] === undefined)
36
+ return false;
37
+ if (!('operations' in value) || value['operations'] === undefined)
38
+ return false;
39
+ return true;
40
+ }
41
+ function DeletionOperationListResponseFromJSON(json) {
42
+ return DeletionOperationListResponseFromJSONTyped(json, false);
43
+ }
44
+ function DeletionOperationListResponseFromJSONTyped(json, ignoreDiscriminator) {
45
+ if (json == null) {
46
+ return json;
47
+ }
48
+ return {
49
+ 'ok': json['ok'],
50
+ 'type': json['type'],
51
+ 'operations': (json['operations'].map(DeletionOperation_1.DeletionOperationFromJSON)),
52
+ };
53
+ }
54
+ function DeletionOperationListResponseToJSON(json) {
55
+ return DeletionOperationListResponseToJSONTyped(json, false);
56
+ }
57
+ function DeletionOperationListResponseToJSONTyped(value, ignoreDiscriminator = false) {
58
+ if (value == null) {
59
+ return value;
60
+ }
61
+ return {
62
+ 'ok': value['ok'],
63
+ 'type': value['type'],
64
+ 'operations': (value['operations'].map(DeletionOperation_1.DeletionOperationToJSON)),
65
+ };
66
+ }
@@ -118,6 +118,12 @@ export interface Sandbox {
118
118
  * @memberof Sandbox
119
119
  */
120
120
  desktopUrl?: string | null;
121
+ /**
122
+ * False when the sandbox was created with snapshots off.
123
+ * @type {boolean}
124
+ * @memberof Sandbox
125
+ */
126
+ snapshots?: boolean;
121
127
  /**
122
128
  *
123
129
  * @type {boolean}
@@ -111,6 +111,7 @@ function SandboxFromJSONTyped(json, ignoreDiscriminator) {
111
111
  'archiveAfter': json['archiveAfter'] == null ? undefined : (new Date(json['archiveAfter'])),
112
112
  'desktopAvailable': json['desktopAvailable'],
113
113
  'desktopUrl': json['desktopUrl'] == null ? undefined : json['desktopUrl'],
114
+ 'snapshots': json['snapshots'] == null ? undefined : json['snapshots'],
114
115
  'snapshotAvailable': json['snapshotAvailable'],
115
116
  'snapshotCompletedAt': json['snapshotCompletedAt'] == null ? undefined : (new Date(json['snapshotCompletedAt'])),
116
117
  'snapshotVerifiedAt': json['snapshotVerifiedAt'] == null ? undefined : (new Date(json['snapshotVerifiedAt'])),
@@ -149,6 +150,7 @@ function SandboxToJSONTyped(value, ignoreDiscriminator = false) {
149
150
  'archiveAfter': value['archiveAfter'] == null ? value['archiveAfter'] : value['archiveAfter'].toISOString(),
150
151
  'desktopAvailable': value['desktopAvailable'],
151
152
  'desktopUrl': value['desktopUrl'],
153
+ 'snapshots': value['snapshots'],
152
154
  'snapshotAvailable': value['snapshotAvailable'],
153
155
  'snapshotCompletedAt': value['snapshotCompletedAt'] == null ? value['snapshotCompletedAt'] : value['snapshotCompletedAt'].toISOString(),
154
156
  'snapshotVerifiedAt': value['snapshotVerifiedAt'] == null ? value['snapshotVerifiedAt'] : value['snapshotVerifiedAt'].toISOString(),
@@ -31,6 +31,7 @@ export * from './CreateScopedApiKeyRequest';
31
31
  export * from './DataRetentionPolicyResponse';
32
32
  export * from './DataRetentionUpdateRequest';
33
33
  export * from './DeletionOperation';
34
+ export * from './DeletionOperationListResponse';
34
35
  export * from './DeletionOperationResponse';
35
36
  export * from './DesktopRequest';
36
37
  export * from './DesktopResponse';
@@ -49,6 +49,7 @@ __exportStar(require("./CreateScopedApiKeyRequest"), exports);
49
49
  __exportStar(require("./DataRetentionPolicyResponse"), exports);
50
50
  __exportStar(require("./DataRetentionUpdateRequest"), exports);
51
51
  __exportStar(require("./DeletionOperation"), exports);
52
+ __exportStar(require("./DeletionOperationListResponse"), exports);
52
53
  __exportStar(require("./DeletionOperationResponse"), exports);
53
54
  __exportStar(require("./DesktopRequest"), exports);
54
55
  __exportStar(require("./DesktopResponse"), exports);
package/dist/runtime.d.ts CHANGED
@@ -182,3 +182,11 @@ export declare class TextApiResponse {
182
182
  constructor(raw: Response);
183
183
  value(): Promise<string>;
184
184
  }
185
+ /**
186
+ * A body-taking call's parameters with the body's fields inline, next to the
187
+ * path/query/header parameters: `fork({ sandboxId, type: 'small' })` is
188
+ * `fork({ sandboxId, forkRequest: { type: 'small' } })`. Both shapes are accepted.
189
+ */
190
+ export type FlatBody<R, K extends keyof R> = Omit<R, K> & NonNullable<R[K]>;
191
+ /** Turns either call shape into the wrapped one the generated code sends. */
192
+ export declare function unflattenBody<R>(input: object, bodyKey: string, paramKeys: string[], sharedKeys: string[]): R;
package/dist/runtime.js CHANGED
@@ -18,6 +18,7 @@ exports.querystring = querystring;
18
18
  exports.exists = exists;
19
19
  exports.mapValues = mapValues;
20
20
  exports.canConsumeForm = canConsumeForm;
21
+ exports.unflattenBody = unflattenBody;
21
22
  exports.BASE_PATH = "https://boat.dev/api/v1".replace(/\/+$/, "");
22
23
  class Configuration {
23
24
  constructor(configuration = {}) {
@@ -351,3 +352,21 @@ class TextApiResponse {
351
352
  ;
352
353
  }
353
354
  exports.TextApiResponse = TextApiResponse;
355
+ /** Turns either call shape into the wrapped one the generated code sends. */
356
+ function unflattenBody(input, bodyKey, paramKeys, sharedKeys) {
357
+ if (input == null || bodyKey in input)
358
+ return input;
359
+ const params = {};
360
+ const body = {};
361
+ for (const [k, v] of Object.entries(input)) {
362
+ const isParam = paramKeys.indexOf(k) !== -1;
363
+ if (isParam)
364
+ params[k] = v;
365
+ if (!isParam || sharedKeys.indexOf(k) !== -1)
366
+ body[k] = v;
367
+ }
368
+ // No body field given: send no body, exactly like the wrapped call with the key omitted.
369
+ if (Object.keys(body).length > 0)
370
+ params[bodyKey] = body;
371
+ return params;
372
+ }
package/docs/BoatApi.md CHANGED
@@ -21,6 +21,7 @@ All URIs are relative to *https://boat.dev/api/v1*
21
21
  | [**deleteEnvironmentVar**](BoatApi.md#deleteenvironmentvar) | **DELETE** /environments/{environmentId}/vars/{key} | Remove one environment variable |
22
22
  | [**deleteNamedSnapshot**](BoatApi.md#deletenamedsnapshot) | **DELETE** /named-snapshots/{name} | Remove a named snapshot |
23
23
  | [**deleteSandbox**](BoatApi.md#deletesandbox) | **DELETE** /sandboxes/{sandboxId} | Permanently delete sandbox data |
24
+ | [**deleteSandboxSnapshots**](BoatApi.md#deletesandboxsnapshots) | **DELETE** /sandboxes/{sandboxId}/snapshots | Permanently delete all snapshots of a sandbox |
24
25
  | [**deleteSnapshot**](BoatApi.md#deletesnapshot) | **DELETE** /snapshots/{snapshotId} | Permanently delete snapshot data |
25
26
  | [**deleteWebhook**](BoatApi.md#deletewebhook) | **DELETE** /webhooks/{webhookId} | Delete webhook |
26
27
  | [**desktop**](BoatApi.md#desktopoperation) | **POST** /sandboxes/{sandboxId}/desktop | Get desktop streaming URL |
@@ -1352,13 +1353,91 @@ example().catch(console.error);
1352
1353
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1353
1354
 
1354
1355
 
1356
+ ## deleteSandboxSnapshots
1357
+
1358
+ > DeletionOperationListResponse deleteSandboxSnapshots(sandboxId, xAsciiConfirmDelete)
1359
+
1360
+ Permanently delete all snapshots of a sandbox
1361
+
1362
+ Accept irreversible deletion of every unpinned snapshot of this sandbox. The sandbox itself and its named snapshots stay. Snapshots disappear from lists, restores and forks immediately; their stored data is purged in the background. Set &#x60;X-Ascii-Confirm-Delete&#x60; to the sandbox id.
1363
+
1364
+ ### Example
1365
+
1366
+ ```ts
1367
+ import {
1368
+ Configuration,
1369
+ BoatApi,
1370
+ } from '@boatdev/sdk';
1371
+ import type { DeleteSandboxSnapshotsRequest } from '@boatdev/sdk';
1372
+
1373
+ async function example() {
1374
+ console.log("🚀 Testing @boatdev/sdk SDK...");
1375
+ const config = new Configuration({
1376
+ // Configure HTTP bearer authorization: BoatBearerAuth
1377
+ accessToken: "YOUR BEARER TOKEN",
1378
+ });
1379
+ const api = new BoatApi(config);
1380
+
1381
+ const body = {
1382
+ // string | Public Sandbox id returned by create/list/get sandbox calls.
1383
+ sandboxId: sandboxId_example,
1384
+ // string | Must exactly equal the target `sandboxId` or `snapshotId`. A missing or mismatched value returns `409` without accepting deletion.
1385
+ xAsciiConfirmDelete: xAsciiConfirmDelete_example,
1386
+ } satisfies DeleteSandboxSnapshotsRequest;
1387
+
1388
+ try {
1389
+ const data = await api.deleteSandboxSnapshots(body);
1390
+ console.log(data);
1391
+ } catch (error) {
1392
+ console.error(error);
1393
+ }
1394
+ }
1395
+
1396
+ // Run the test
1397
+ example().catch(console.error);
1398
+ ```
1399
+
1400
+ ### Parameters
1401
+
1402
+
1403
+ | Name | Type | Description | Notes |
1404
+ |------------- | ------------- | ------------- | -------------|
1405
+ | **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
1406
+ | **xAsciiConfirmDelete** | `string` | Must exactly equal the target &#x60;sandboxId&#x60; or &#x60;snapshotId&#x60;. A missing or mismatched value returns &#x60;409&#x60; without accepting deletion. | [Defaults to `undefined`] |
1407
+
1408
+ ### Return type
1409
+
1410
+ [**DeletionOperationListResponse**](DeletionOperationListResponse.md)
1411
+
1412
+ ### Authorization
1413
+
1414
+ [BoatBearerAuth](../README.md#BoatBearerAuth)
1415
+
1416
+ ### HTTP request headers
1417
+
1418
+ - **Content-Type**: Not defined
1419
+ - **Accept**: `application/json`
1420
+
1421
+
1422
+ ### HTTP response details
1423
+ | Status code | Description | Response headers |
1424
+ |-------------|-------------|------------------|
1425
+ | **202** | One accepted deletion operation per snapshot. | - |
1426
+ | **401** | Missing or invalid bearer token. | - |
1427
+ | **403** | Authenticated token is not allowed to perform this action. | - |
1428
+ | **404** | Resource not found. | - |
1429
+ | **409** | Request conflicts with current account or sandbox state. | - |
1430
+
1431
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1432
+
1433
+
1355
1434
  ## deleteSnapshot
1356
1435
 
1357
1436
  > DeletionOperationResponse deleteSnapshot(snapshotId, xAsciiConfirmDelete)
1358
1437
 
1359
1438
  Permanently delete snapshot data
1360
1439
 
1361
- Accept irreversible background deletion of an unpinned snapshot owned by the authenticated account. Snapshots required by another incremental snapshot or active restore return &#x60;409&#x60;. Poll the returned operation until &#x60;completed&#x60;.
1440
+ Accept irreversible deletion of an unpinned snapshot owned by the authenticated account. Any such snapshot is accepted: it disappears from lists, restores and forks immediately, and its stored data is purged in the background once nothing still reads it (see the operation\&#39;s &#x60;stage&#x60;). &#x60;409&#x60; only means &#x60;X-Ascii-Confirm-Delete&#x60; is missing or wrong.
1362
1441
 
1363
1442
  ### Example
1364
1443
 
@@ -12,6 +12,7 @@ Name | Type
12
12
  `env` | { [key: string]: string; }
13
13
  `environment` | string
14
14
  `noEnv` | boolean
15
+ `snapshots` | boolean
15
16
  `setupScript` | string
16
17
  `org` | string
17
18
  `teamId` | string
@@ -29,6 +30,7 @@ const example = {
29
30
  "env": null,
30
31
  "environment": null,
31
32
  "noEnv": null,
33
+ "snapshots": null,
32
34
  "setupScript": null,
33
35
  "org": null,
34
36
  "teamId": null,
@@ -12,6 +12,8 @@ Name | Type
12
12
  `enabledAt` | Date
13
13
  `queuedSandboxes` | number
14
14
  `acceptedDeletionOperationsIrreversible` | boolean
15
+ `snapshotsOff` | boolean
16
+ `snapshotsOffAt` | Date
15
17
 
16
18
  ## Example
17
19
 
@@ -26,6 +28,8 @@ const example = {
26
28
  "enabledAt": null,
27
29
  "queuedSandboxes": null,
28
30
  "acceptedDeletionOperationsIrreversible": null,
31
+ "snapshotsOff": null,
32
+ "snapshotsOffAt": null,
29
33
  } satisfies DataRetentionPolicyResponse
30
34
 
31
35
  console.log(example)
@@ -1,12 +1,14 @@
1
1
 
2
2
  # DataRetentionUpdateRequest
3
3
 
4
+ Pass `enabled` to change zero data retention, or `snapshotsOff` alone to change the account\'s snapshots-off setting.
4
5
 
5
6
  ## Properties
6
7
 
7
8
  Name | Type
8
9
  ------------ | -------------
9
10
  `enabled` | boolean
11
+ `snapshotsOff` | boolean
10
12
  `confirmation` | string
11
13
 
12
14
  ## Example
@@ -17,6 +19,7 @@ import type { DataRetentionUpdateRequest } from '@boatdev/sdk'
17
19
  // TODO: Update the object below with actual values
18
20
  const example = {
19
21
  "enabled": null,
22
+ "snapshotsOff": null,
20
23
  "confirmation": null,
21
24
  } satisfies DataRetentionUpdateRequest
22
25