@boatdev/sdk 1.8.0 → 1.9.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 (40) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/dist/apis/BoatApi.d.ts +55 -0
  3. package/dist/apis/BoatApi.js +133 -0
  4. package/dist/esm/apis/BoatApi.d.ts +55 -0
  5. package/dist/esm/apis/BoatApi.js +133 -0
  6. package/dist/esm/models/CreateSandboxRequest.d.ts +1 -1
  7. package/dist/esm/models/NamedSnapshotShare.d.ts +76 -0
  8. package/dist/esm/models/NamedSnapshotShare.js +74 -0
  9. package/dist/esm/models/NamedSnapshotShareCreatedResponse.d.ts +64 -0
  10. package/dist/esm/models/NamedSnapshotShareCreatedResponse.js +66 -0
  11. package/dist/esm/models/NamedSnapshotShareListResponse.d.ts +58 -0
  12. package/dist/esm/models/NamedSnapshotShareListResponse.js +62 -0
  13. package/dist/esm/models/NamedSnapshotShareRevokedResponse.d.ts +58 -0
  14. package/dist/esm/models/NamedSnapshotShareRevokedResponse.js +62 -0
  15. package/dist/esm/models/index.d.ts +4 -0
  16. package/dist/esm/models/index.js +4 -0
  17. package/dist/models/CreateSandboxRequest.d.ts +1 -1
  18. package/dist/models/NamedSnapshotShare.d.ts +76 -0
  19. package/dist/models/NamedSnapshotShare.js +82 -0
  20. package/dist/models/NamedSnapshotShareCreatedResponse.d.ts +64 -0
  21. package/dist/models/NamedSnapshotShareCreatedResponse.js +74 -0
  22. package/dist/models/NamedSnapshotShareListResponse.d.ts +58 -0
  23. package/dist/models/NamedSnapshotShareListResponse.js +70 -0
  24. package/dist/models/NamedSnapshotShareRevokedResponse.d.ts +58 -0
  25. package/dist/models/NamedSnapshotShareRevokedResponse.js +70 -0
  26. package/dist/models/index.d.ts +4 -0
  27. package/dist/models/index.js +4 -0
  28. package/docs/BoatApi.md +225 -0
  29. package/docs/NamedSnapshotShare.md +45 -0
  30. package/docs/NamedSnapshotShareCreatedResponse.md +40 -0
  31. package/docs/NamedSnapshotShareListResponse.md +38 -0
  32. package/docs/NamedSnapshotShareRevokedResponse.md +38 -0
  33. package/package.json +1 -1
  34. package/src/apis/BoatApi.ts +201 -0
  35. package/src/models/CreateSandboxRequest.ts +1 -1
  36. package/src/models/NamedSnapshotShare.ts +131 -0
  37. package/src/models/NamedSnapshotShareCreatedResponse.ts +120 -0
  38. package/src/models/NamedSnapshotShareListResponse.ts +111 -0
  39. package/src/models/NamedSnapshotShareRevokedResponse.ts +111 -0
  40. package/src/models/index.ts +4 -0
@@ -0,0 +1,45 @@
1
+
2
+ # NamedSnapshotShare
3
+
4
+ A share code for a named snapshot. Any Boat account that holds the code can create a sandbox from the snapshot. Boat stores only a hash of the code. The full code is in the create response only.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `id` | string
11
+ `codePrefix` | string
12
+ `status` | string
13
+ `useCount` | number
14
+ `lastUsedAt` | Date
15
+ `revokedAt` | Date
16
+ `createdAt` | Date
17
+
18
+ ## Example
19
+
20
+ ```typescript
21
+ import type { NamedSnapshotShare } from '@boatdev/sdk'
22
+
23
+ // TODO: Update the object below with actual values
24
+ const example = {
25
+ "id": null,
26
+ "codePrefix": null,
27
+ "status": null,
28
+ "useCount": null,
29
+ "lastUsedAt": null,
30
+ "revokedAt": null,
31
+ "createdAt": null,
32
+ } satisfies NamedSnapshotShare
33
+
34
+ console.log(example)
35
+
36
+ // Convert the instance to a JSON string
37
+ const exampleJSON: string = JSON.stringify(example)
38
+ console.log(exampleJSON)
39
+
40
+ // Parse the JSON string back to an object
41
+ const exampleParsed = JSON.parse(exampleJSON) as NamedSnapshotShare
42
+ console.log(exampleParsed)
43
+ ```
44
+
45
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -0,0 +1,40 @@
1
+
2
+ # NamedSnapshotShareCreatedResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `ok` | boolean
10
+ `type` | string
11
+ `name` | string
12
+ `shareCode` | string
13
+ `share` | [NamedSnapshotShare](NamedSnapshotShare.md)
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { NamedSnapshotShareCreatedResponse } from '@boatdev/sdk'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "ok": null,
23
+ "type": null,
24
+ "name": null,
25
+ "shareCode": null,
26
+ "share": null,
27
+ } satisfies NamedSnapshotShareCreatedResponse
28
+
29
+ console.log(example)
30
+
31
+ // Convert the instance to a JSON string
32
+ const exampleJSON: string = JSON.stringify(example)
33
+ console.log(exampleJSON)
34
+
35
+ // Parse the JSON string back to an object
36
+ const exampleParsed = JSON.parse(exampleJSON) as NamedSnapshotShareCreatedResponse
37
+ console.log(exampleParsed)
38
+ ```
39
+
40
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -0,0 +1,38 @@
1
+
2
+ # NamedSnapshotShareListResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `ok` | boolean
10
+ `type` | string
11
+ `name` | string
12
+ `shares` | [Array<NamedSnapshotShare>](NamedSnapshotShare.md)
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { NamedSnapshotShareListResponse } from '@boatdev/sdk'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "ok": null,
22
+ "type": null,
23
+ "name": null,
24
+ "shares": null,
25
+ } satisfies NamedSnapshotShareListResponse
26
+
27
+ console.log(example)
28
+
29
+ // Convert the instance to a JSON string
30
+ const exampleJSON: string = JSON.stringify(example)
31
+ console.log(exampleJSON)
32
+
33
+ // Parse the JSON string back to an object
34
+ const exampleParsed = JSON.parse(exampleJSON) as NamedSnapshotShareListResponse
35
+ console.log(exampleParsed)
36
+ ```
37
+
38
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -0,0 +1,38 @@
1
+
2
+ # NamedSnapshotShareRevokedResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `ok` | boolean
10
+ `type` | string
11
+ `name` | string
12
+ `share` | [NamedSnapshotShare](NamedSnapshotShare.md)
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { NamedSnapshotShareRevokedResponse } from '@boatdev/sdk'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "ok": null,
22
+ "type": null,
23
+ "name": null,
24
+ "share": null,
25
+ } satisfies NamedSnapshotShareRevokedResponse
26
+
27
+ console.log(example)
28
+
29
+ // Convert the instance to a JSON string
30
+ const exampleJSON: string = JSON.stringify(example)
31
+ console.log(exampleJSON)
32
+
33
+ // Parse the JSON string back to an object
34
+ const exampleParsed = JSON.parse(exampleJSON) as NamedSnapshotShareRevokedResponse
35
+ console.log(exampleParsed)
36
+ ```
37
+
38
+ [[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.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "OpenAPI client for @boatdev/sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "license": "MIT",
@@ -208,6 +208,21 @@ import {
208
208
  NamedSnapshotSavingResponseFromJSON,
209
209
  NamedSnapshotSavingResponseToJSON,
210
210
  } from '../models/NamedSnapshotSavingResponse';
211
+ import {
212
+ type NamedSnapshotShareCreatedResponse,
213
+ NamedSnapshotShareCreatedResponseFromJSON,
214
+ NamedSnapshotShareCreatedResponseToJSON,
215
+ } from '../models/NamedSnapshotShareCreatedResponse';
216
+ import {
217
+ type NamedSnapshotShareListResponse,
218
+ NamedSnapshotShareListResponseFromJSON,
219
+ NamedSnapshotShareListResponseToJSON,
220
+ } from '../models/NamedSnapshotShareListResponse';
221
+ import {
222
+ type NamedSnapshotShareRevokedResponse,
223
+ NamedSnapshotShareRevokedResponseFromJSON,
224
+ NamedSnapshotShareRevokedResponseToJSON,
225
+ } from '../models/NamedSnapshotShareRevokedResponse';
211
226
  import {
212
227
  type OrgListResponse,
213
228
  OrgListResponseFromJSON,
@@ -458,6 +473,10 @@ export interface CreateScopedApiKeyOperationRequest {
458
473
  createScopedApiKeyRequest: CreateScopedApiKeyRequest;
459
474
  }
460
475
 
476
+ export interface CreateSnapshotShareRequest {
477
+ name: string;
478
+ }
479
+
461
480
  export interface CreateWebhookRequest {
462
481
  webhookCreateRequest: WebhookCreateRequest;
463
482
  }
@@ -587,6 +606,10 @@ export interface ListSandboxSnapshotsRequest {
587
606
  sort?: ListSandboxSnapshotsSortEnum;
588
607
  }
589
608
 
609
+ export interface ListSnapshotSharesRequest {
610
+ name: string;
611
+ }
612
+
590
613
  export interface ListSnapshotsRequest {
591
614
  limit?: number;
592
615
  cursor?: string | null;
@@ -631,6 +654,11 @@ export interface RevokeApiKeyRequest {
631
654
  apiKeyId: string;
632
655
  }
633
656
 
657
+ export interface RevokeSnapshotShareRequest {
658
+ name: string;
659
+ shareId: string;
660
+ }
661
+
634
662
  export interface RotateApiKeyRequest {
635
663
  apiKeyId: string;
636
664
  }
@@ -1334,6 +1362,61 @@ export class BoatApi extends runtime.BaseAPI {
1334
1362
  return await response.value();
1335
1363
  }
1336
1364
 
1365
+ /**
1366
+ * Creates request options for createSnapshotShare without sending the request
1367
+ */
1368
+ async createSnapshotShareRequestOpts(requestParameters: CreateSnapshotShareRequest): Promise<runtime.RequestOpts> {
1369
+ if (requestParameters['name'] == null) {
1370
+ throw new runtime.RequiredError(
1371
+ 'name',
1372
+ 'Required parameter "name" was null or undefined when calling createSnapshotShare().'
1373
+ );
1374
+ }
1375
+
1376
+ const queryParameters: any = {};
1377
+
1378
+ const headerParameters: runtime.HTTPHeaders = {};
1379
+
1380
+ if (this.configuration && this.configuration.accessToken) {
1381
+ const token = this.configuration.accessToken;
1382
+ const tokenString = await token("BoatBearerAuth", []);
1383
+
1384
+ if (tokenString) {
1385
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1386
+ }
1387
+ }
1388
+
1389
+ let urlPath = `/named-snapshots/{name}/shares`;
1390
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
1391
+
1392
+ return {
1393
+ path: urlPath,
1394
+ method: 'POST',
1395
+ headers: headerParameters,
1396
+ query: queryParameters,
1397
+ };
1398
+ }
1399
+
1400
+ /**
1401
+ * Make a secret code that lets any Boat account create a sandbox from this named snapshot (`boat snapshot share <name>` in the CLI). The response shows the code once; Boat stores only a hash. Re-saving the name changes what the code deploys. Removing the name removes its codes. Everything on the disk is shared, so do not keep secrets in files on it. Needs `snapshot.write`.
1402
+ * Share a named snapshot
1403
+ */
1404
+ async createSnapshotShareRaw(requestParameters: CreateSnapshotShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NamedSnapshotShareCreatedResponse>> {
1405
+ const requestOptions = await this.createSnapshotShareRequestOpts(requestParameters);
1406
+ const response = await this.request(requestOptions, initOverrides);
1407
+
1408
+ return new runtime.JSONApiResponse(response, (jsonValue) => NamedSnapshotShareCreatedResponseFromJSON(jsonValue));
1409
+ }
1410
+
1411
+ /**
1412
+ * Make a secret code that lets any Boat account create a sandbox from this named snapshot (`boat snapshot share <name>` in the CLI). The response shows the code once; Boat stores only a hash. Re-saving the name changes what the code deploys. Removing the name removes its codes. Everything on the disk is shared, so do not keep secrets in files on it. Needs `snapshot.write`.
1413
+ * Share a named snapshot
1414
+ */
1415
+ async createSnapshotShare(requestParameters: CreateSnapshotShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NamedSnapshotShareCreatedResponse> {
1416
+ const response = await this.createSnapshotShareRaw(requestParameters, initOverrides);
1417
+ return await response.value();
1418
+ }
1419
+
1337
1420
  /**
1338
1421
  * Creates request options for createWebhook without sending the request
1339
1422
  */
@@ -3096,6 +3179,61 @@ export class BoatApi extends runtime.BaseAPI {
3096
3179
  return await response.value();
3097
3180
  }
3098
3181
 
3182
+ /**
3183
+ * Creates request options for listSnapshotShares without sending the request
3184
+ */
3185
+ async listSnapshotSharesRequestOpts(requestParameters: ListSnapshotSharesRequest): Promise<runtime.RequestOpts> {
3186
+ if (requestParameters['name'] == null) {
3187
+ throw new runtime.RequiredError(
3188
+ 'name',
3189
+ 'Required parameter "name" was null or undefined when calling listSnapshotShares().'
3190
+ );
3191
+ }
3192
+
3193
+ const queryParameters: any = {};
3194
+
3195
+ const headerParameters: runtime.HTTPHeaders = {};
3196
+
3197
+ if (this.configuration && this.configuration.accessToken) {
3198
+ const token = this.configuration.accessToken;
3199
+ const tokenString = await token("BoatBearerAuth", []);
3200
+
3201
+ if (tokenString) {
3202
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3203
+ }
3204
+ }
3205
+
3206
+ let urlPath = `/named-snapshots/{name}/shares`;
3207
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
3208
+
3209
+ return {
3210
+ path: urlPath,
3211
+ method: 'GET',
3212
+ headers: headerParameters,
3213
+ query: queryParameters,
3214
+ };
3215
+ }
3216
+
3217
+ /**
3218
+ * List the share codes of a named snapshot, active and revoked (`boat snapshot shares <name>` in the CLI). The full codes are not returned. Needs `snapshot.read`.
3219
+ * List share codes of a named snapshot
3220
+ */
3221
+ async listSnapshotSharesRaw(requestParameters: ListSnapshotSharesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NamedSnapshotShareListResponse>> {
3222
+ const requestOptions = await this.listSnapshotSharesRequestOpts(requestParameters);
3223
+ const response = await this.request(requestOptions, initOverrides);
3224
+
3225
+ return new runtime.JSONApiResponse(response, (jsonValue) => NamedSnapshotShareListResponseFromJSON(jsonValue));
3226
+ }
3227
+
3228
+ /**
3229
+ * List the share codes of a named snapshot, active and revoked (`boat snapshot shares <name>` in the CLI). The full codes are not returned. Needs `snapshot.read`.
3230
+ * List share codes of a named snapshot
3231
+ */
3232
+ async listSnapshotShares(requestParameters: ListSnapshotSharesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NamedSnapshotShareListResponse> {
3233
+ const response = await this.listSnapshotSharesRaw(requestParameters, initOverrides);
3234
+ return await response.value();
3235
+ }
3236
+
3099
3237
  /**
3100
3238
  * Creates request options for listSnapshots without sending the request
3101
3239
  */
@@ -3686,6 +3824,69 @@ export class BoatApi extends runtime.BaseAPI {
3686
3824
  return await response.value();
3687
3825
  }
3688
3826
 
3827
+ /**
3828
+ * Creates request options for revokeSnapshotShare without sending the request
3829
+ */
3830
+ async revokeSnapshotShareRequestOpts(requestParameters: RevokeSnapshotShareRequest): Promise<runtime.RequestOpts> {
3831
+ if (requestParameters['name'] == null) {
3832
+ throw new runtime.RequiredError(
3833
+ 'name',
3834
+ 'Required parameter "name" was null or undefined when calling revokeSnapshotShare().'
3835
+ );
3836
+ }
3837
+
3838
+ if (requestParameters['shareId'] == null) {
3839
+ throw new runtime.RequiredError(
3840
+ 'shareId',
3841
+ 'Required parameter "shareId" was null or undefined when calling revokeSnapshotShare().'
3842
+ );
3843
+ }
3844
+
3845
+ const queryParameters: any = {};
3846
+
3847
+ const headerParameters: runtime.HTTPHeaders = {};
3848
+
3849
+ if (this.configuration && this.configuration.accessToken) {
3850
+ const token = this.configuration.accessToken;
3851
+ const tokenString = await token("BoatBearerAuth", []);
3852
+
3853
+ if (tokenString) {
3854
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3855
+ }
3856
+ }
3857
+
3858
+ let urlPath = `/named-snapshots/{name}/shares/{shareId}`;
3859
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
3860
+ urlPath = urlPath.replace('{shareId}', encodeURIComponent(String(requestParameters['shareId'])));
3861
+
3862
+ return {
3863
+ path: urlPath,
3864
+ method: 'DELETE',
3865
+ headers: headerParameters,
3866
+ query: queryParameters,
3867
+ };
3868
+ }
3869
+
3870
+ /**
3871
+ * Revoke a share code (`boat snapshot unshare <name> <share-id>` in the CLI). The code stops creating new sandboxes. Sandboxes already created from it keep their own copy. Needs `snapshot.write`.
3872
+ * Revoke a share code
3873
+ */
3874
+ async revokeSnapshotShareRaw(requestParameters: RevokeSnapshotShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NamedSnapshotShareRevokedResponse>> {
3875
+ const requestOptions = await this.revokeSnapshotShareRequestOpts(requestParameters);
3876
+ const response = await this.request(requestOptions, initOverrides);
3877
+
3878
+ return new runtime.JSONApiResponse(response, (jsonValue) => NamedSnapshotShareRevokedResponseFromJSON(jsonValue));
3879
+ }
3880
+
3881
+ /**
3882
+ * Revoke a share code (`boat snapshot unshare <name> <share-id>` in the CLI). The code stops creating new sandboxes. Sandboxes already created from it keep their own copy. Needs `snapshot.write`.
3883
+ * Revoke a share code
3884
+ */
3885
+ async revokeSnapshotShare(requestParameters: RevokeSnapshotShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NamedSnapshotShareRevokedResponse> {
3886
+ const response = await this.revokeSnapshotShareRaw(requestParameters, initOverrides);
3887
+ return await response.value();
3888
+ }
3889
+
3689
3890
  /**
3690
3891
  * Creates request options for rotateApiKey without sending the request
3691
3892
  */
@@ -80,7 +80,7 @@ export interface CreateSandboxRequest {
80
80
  */
81
81
  teamId?: string;
82
82
  /**
83
- * Create the sandbox from a named snapshot (saved with `POST /named-snapshots`, or `boat snapshot <id> <name>` in the CLI). The sandbox starts from that exact frozen state. Omitting `type` inherits the type the snapshot was saved from; env and no-env inherit from the snapshot's source sandbox unless the request passes its own, with the same rules as forking.
83
+ * Create the sandbox from a named snapshot (saved with `POST /named-snapshots`, or `boat snapshot <id> <name>` in the CLI). The sandbox starts from that exact frozen state. Omitting `type` inherits the type the snapshot was saved from; env and no-env inherit from the snapshot's source sandbox unless the request passes its own, with the same rules as forking. Also accepts a share code (`bsh_...`) that another account made with `POST /named-snapshots/{name}/shares`. The new sandbox lives in and is billed to your account. It does not get the owner's per-sandbox env; your own environment applies normally. A wrong or revoked code returns `404 snapshot_not_found`.
84
84
  * @type {string}
85
85
  * @memberof CreateSandboxRequest
86
86
  */
@@ -0,0 +1,131 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Boat Public API v1
5
+ * 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.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * A share code for a named snapshot. Any Boat account that holds the code can create a sandbox from the snapshot. Boat stores only a hash of the code. The full code is in the create response only.
18
+ * @export
19
+ * @interface NamedSnapshotShare
20
+ */
21
+ export interface NamedSnapshotShare {
22
+ /**
23
+ * Share id, for example `shr_...`. Pass it to revoke the code.
24
+ * @type {string}
25
+ * @memberof NamedSnapshotShare
26
+ */
27
+ id: string;
28
+ /**
29
+ * The first characters of the code, for example `bsh_xxxxxxxx`. Use it to tell codes apart.
30
+ * @type {string}
31
+ * @memberof NamedSnapshotShare
32
+ */
33
+ codePrefix: string;
34
+ /**
35
+ *
36
+ * @type {NamedSnapshotShareStatusEnum}
37
+ * @memberof NamedSnapshotShare
38
+ */
39
+ status: NamedSnapshotShareStatusEnum;
40
+ /**
41
+ * Number of sandboxes created with this code.
42
+ * @type {number}
43
+ * @memberof NamedSnapshotShare
44
+ */
45
+ useCount: number;
46
+ /**
47
+ * When a sandbox was last created with this code. null if never.
48
+ * @type {Date}
49
+ * @memberof NamedSnapshotShare
50
+ */
51
+ lastUsedAt: Date | null;
52
+ /**
53
+ * When the code was revoked. null while active.
54
+ * @type {Date}
55
+ * @memberof NamedSnapshotShare
56
+ */
57
+ revokedAt: Date | null;
58
+ /**
59
+ *
60
+ * @type {Date}
61
+ * @memberof NamedSnapshotShare
62
+ */
63
+ createdAt: Date;
64
+ }
65
+
66
+
67
+ /**
68
+ * @export
69
+ */
70
+ export const NamedSnapshotShareStatusEnum = {
71
+ Active: 'active',
72
+ Revoked: 'revoked'
73
+ } as const;
74
+ export type NamedSnapshotShareStatusEnum = typeof NamedSnapshotShareStatusEnum[keyof typeof NamedSnapshotShareStatusEnum];
75
+
76
+
77
+ /**
78
+ * Check if a given object implements the NamedSnapshotShare interface.
79
+ */
80
+ export function instanceOfNamedSnapshotShare(value: object): value is NamedSnapshotShare {
81
+ if (!('id' in value) || value['id'] === undefined) return false;
82
+ if (!('codePrefix' in value) || value['codePrefix'] === undefined) return false;
83
+ if (!('status' in value) || value['status'] === undefined) return false;
84
+ if (!('useCount' in value) || value['useCount'] === undefined) return false;
85
+ if (!('lastUsedAt' in value) || value['lastUsedAt'] === undefined) return false;
86
+ if (!('revokedAt' in value) || value['revokedAt'] === undefined) return false;
87
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
88
+ return true;
89
+ }
90
+
91
+ export function NamedSnapshotShareFromJSON(json: any): NamedSnapshotShare {
92
+ return NamedSnapshotShareFromJSONTyped(json, false);
93
+ }
94
+
95
+ export function NamedSnapshotShareFromJSONTyped(json: any, ignoreDiscriminator: boolean): NamedSnapshotShare {
96
+ if (json == null) {
97
+ return json;
98
+ }
99
+ return {
100
+
101
+ 'id': json['id'],
102
+ 'codePrefix': json['codePrefix'],
103
+ 'status': json['status'],
104
+ 'useCount': json['useCount'],
105
+ 'lastUsedAt': (json['lastUsedAt'] == null ? null : new Date(json['lastUsedAt'])),
106
+ 'revokedAt': (json['revokedAt'] == null ? null : new Date(json['revokedAt'])),
107
+ 'createdAt': (new Date(json['createdAt'])),
108
+ };
109
+ }
110
+
111
+ export function NamedSnapshotShareToJSON(json: any): NamedSnapshotShare {
112
+ return NamedSnapshotShareToJSONTyped(json, false);
113
+ }
114
+
115
+ export function NamedSnapshotShareToJSONTyped(value?: NamedSnapshotShare | null, ignoreDiscriminator: boolean = false): any {
116
+ if (value == null) {
117
+ return value;
118
+ }
119
+
120
+ return {
121
+
122
+ 'id': value['id'],
123
+ 'codePrefix': value['codePrefix'],
124
+ 'status': value['status'],
125
+ 'useCount': value['useCount'],
126
+ 'lastUsedAt': value['lastUsedAt'] == null ? value['lastUsedAt'] : value['lastUsedAt'].toISOString(),
127
+ 'revokedAt': value['revokedAt'] == null ? value['revokedAt'] : value['revokedAt'].toISOString(),
128
+ 'createdAt': value['createdAt'].toISOString(),
129
+ };
130
+ }
131
+
@@ -0,0 +1,120 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Boat Public API v1
5
+ * 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.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { NamedSnapshotShare } from './NamedSnapshotShare';
17
+ import {
18
+ NamedSnapshotShareFromJSON,
19
+ NamedSnapshotShareFromJSONTyped,
20
+ NamedSnapshotShareToJSON,
21
+ NamedSnapshotShareToJSONTyped,
22
+ } from './NamedSnapshotShare';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface NamedSnapshotShareCreatedResponse
28
+ */
29
+ export interface NamedSnapshotShareCreatedResponse {
30
+ /**
31
+ *
32
+ * @type {boolean}
33
+ * @memberof NamedSnapshotShareCreatedResponse
34
+ */
35
+ ok: boolean;
36
+ /**
37
+ *
38
+ * @type {NamedSnapshotShareCreatedResponseTypeEnum}
39
+ * @memberof NamedSnapshotShareCreatedResponse
40
+ */
41
+ type: NamedSnapshotShareCreatedResponseTypeEnum;
42
+ /**
43
+ * The named snapshot the code deploys.
44
+ * @type {string}
45
+ * @memberof NamedSnapshotShareCreatedResponse
46
+ */
47
+ name: string;
48
+ /**
49
+ * The share code, for example `bsh_...`. Boat shows it only in this response. Store it now; you cannot get it again.
50
+ * @type {string}
51
+ * @memberof NamedSnapshotShareCreatedResponse
52
+ */
53
+ shareCode: string;
54
+ /**
55
+ *
56
+ * @type {NamedSnapshotShare}
57
+ * @memberof NamedSnapshotShareCreatedResponse
58
+ */
59
+ share: NamedSnapshotShare;
60
+ }
61
+
62
+
63
+ /**
64
+ * @export
65
+ */
66
+ export const NamedSnapshotShareCreatedResponseTypeEnum = {
67
+ SnapshotShareCreated: 'snapshot.share.created'
68
+ } as const;
69
+ export type NamedSnapshotShareCreatedResponseTypeEnum = typeof NamedSnapshotShareCreatedResponseTypeEnum[keyof typeof NamedSnapshotShareCreatedResponseTypeEnum];
70
+
71
+
72
+ /**
73
+ * Check if a given object implements the NamedSnapshotShareCreatedResponse interface.
74
+ */
75
+ export function instanceOfNamedSnapshotShareCreatedResponse(value: object): value is NamedSnapshotShareCreatedResponse {
76
+ if (!('ok' in value) || value['ok'] === undefined) return false;
77
+ if (!('type' in value) || value['type'] === undefined) return false;
78
+ if (!('name' in value) || value['name'] === undefined) return false;
79
+ if (!('shareCode' in value) || value['shareCode'] === undefined) return false;
80
+ if (!('share' in value) || value['share'] === undefined) return false;
81
+ return true;
82
+ }
83
+
84
+ export function NamedSnapshotShareCreatedResponseFromJSON(json: any): NamedSnapshotShareCreatedResponse {
85
+ return NamedSnapshotShareCreatedResponseFromJSONTyped(json, false);
86
+ }
87
+
88
+ export function NamedSnapshotShareCreatedResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): NamedSnapshotShareCreatedResponse {
89
+ if (json == null) {
90
+ return json;
91
+ }
92
+ return {
93
+
94
+ 'ok': json['ok'],
95
+ 'type': json['type'],
96
+ 'name': json['name'],
97
+ 'shareCode': json['shareCode'],
98
+ 'share': NamedSnapshotShareFromJSON(json['share']),
99
+ };
100
+ }
101
+
102
+ export function NamedSnapshotShareCreatedResponseToJSON(json: any): NamedSnapshotShareCreatedResponse {
103
+ return NamedSnapshotShareCreatedResponseToJSONTyped(json, false);
104
+ }
105
+
106
+ export function NamedSnapshotShareCreatedResponseToJSONTyped(value?: NamedSnapshotShareCreatedResponse | null, ignoreDiscriminator: boolean = false): any {
107
+ if (value == null) {
108
+ return value;
109
+ }
110
+
111
+ return {
112
+
113
+ 'ok': value['ok'],
114
+ 'type': value['type'],
115
+ 'name': value['name'],
116
+ 'shareCode': value['shareCode'],
117
+ 'share': NamedSnapshotShareToJSON(value['share']),
118
+ };
119
+ }
120
+