@boatdev/sdk 1.0.1 → 1.1.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.
@@ -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
+ }
@@ -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
 
@@ -11,6 +11,8 @@ Name | Type
11
11
  `targetId` | string
12
12
  `reason` | string
13
13
  `status` | string
14
+ `stage` | string
15
+ `expectedBy` | Date
14
16
  `attemptCount` | number
15
17
  `requestedAt` | Date
16
18
  `completedAt` | Date
@@ -27,6 +29,8 @@ const example = {
27
29
  "targetId": null,
28
30
  "reason": null,
29
31
  "status": null,
32
+ "stage": null,
33
+ "expectedBy": null,
30
34
  "attemptCount": null,
31
35
  "requestedAt": null,
32
36
  "completedAt": null,
@@ -0,0 +1,36 @@
1
+
2
+ # DeletionOperationListResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `ok` | boolean
10
+ `type` | string
11
+ `operations` | [Array&lt;DeletionOperation&gt;](DeletionOperation.md)
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { DeletionOperationListResponse } from '@boatdev/sdk'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "ok": null,
21
+ "type": null,
22
+ "operations": null,
23
+ } satisfies DeletionOperationListResponse
24
+
25
+ console.log(example)
26
+
27
+ // Convert the instance to a JSON string
28
+ const exampleJSON: string = JSON.stringify(example)
29
+ console.log(exampleJSON)
30
+
31
+ // Parse the JSON string back to an object
32
+ const exampleParsed = JSON.parse(exampleJSON) as DeletionOperationListResponse
33
+ console.log(exampleParsed)
34
+ ```
35
+
36
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boatdev/sdk",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "OpenAPI client for @boatdev/sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "license": "MIT",