@boatdev/sdk 1.8.0 → 1.9.1

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 (50) 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/CreateScopedApiKey503Response.d.ts +2 -9
  8. package/dist/esm/models/CreateScopedApiKey503Response.js +0 -6
  9. package/dist/esm/models/NamedSnapshotShare.d.ts +76 -0
  10. package/dist/esm/models/NamedSnapshotShare.js +74 -0
  11. package/dist/esm/models/NamedSnapshotShareCreatedResponse.d.ts +64 -0
  12. package/dist/esm/models/NamedSnapshotShareCreatedResponse.js +66 -0
  13. package/dist/esm/models/NamedSnapshotShareListResponse.d.ts +58 -0
  14. package/dist/esm/models/NamedSnapshotShareListResponse.js +62 -0
  15. package/dist/esm/models/NamedSnapshotShareRevokedResponse.d.ts +58 -0
  16. package/dist/esm/models/NamedSnapshotShareRevokedResponse.js +62 -0
  17. package/dist/esm/models/SandboxEnvironmentListResponse.d.ts +2 -9
  18. package/dist/esm/models/SandboxEnvironmentListResponse.js +0 -6
  19. package/dist/esm/models/index.d.ts +4 -0
  20. package/dist/esm/models/index.js +4 -0
  21. package/dist/models/CreateSandboxRequest.d.ts +1 -1
  22. package/dist/models/CreateScopedApiKey503Response.d.ts +2 -9
  23. package/dist/models/CreateScopedApiKey503Response.js +1 -7
  24. package/dist/models/NamedSnapshotShare.d.ts +76 -0
  25. package/dist/models/NamedSnapshotShare.js +82 -0
  26. package/dist/models/NamedSnapshotShareCreatedResponse.d.ts +64 -0
  27. package/dist/models/NamedSnapshotShareCreatedResponse.js +74 -0
  28. package/dist/models/NamedSnapshotShareListResponse.d.ts +58 -0
  29. package/dist/models/NamedSnapshotShareListResponse.js +70 -0
  30. package/dist/models/NamedSnapshotShareRevokedResponse.d.ts +58 -0
  31. package/dist/models/NamedSnapshotShareRevokedResponse.js +70 -0
  32. package/dist/models/SandboxEnvironmentListResponse.d.ts +2 -9
  33. package/dist/models/SandboxEnvironmentListResponse.js +1 -7
  34. package/dist/models/index.d.ts +4 -0
  35. package/dist/models/index.js +4 -0
  36. package/docs/BoatApi.md +225 -0
  37. package/docs/NamedSnapshotShare.md +45 -0
  38. package/docs/NamedSnapshotShareCreatedResponse.md +40 -0
  39. package/docs/NamedSnapshotShareListResponse.md +38 -0
  40. package/docs/NamedSnapshotShareRevokedResponse.md +38 -0
  41. package/package.json +1 -1
  42. package/src/apis/BoatApi.ts +201 -0
  43. package/src/models/CreateSandboxRequest.ts +1 -1
  44. package/src/models/CreateScopedApiKey503Response.ts +2 -10
  45. package/src/models/NamedSnapshotShare.ts +131 -0
  46. package/src/models/NamedSnapshotShareCreatedResponse.ts +120 -0
  47. package/src/models/NamedSnapshotShareListResponse.ts +111 -0
  48. package/src/models/NamedSnapshotShareRevokedResponse.ts +111 -0
  49. package/src/models/SandboxEnvironmentListResponse.ts +2 -10
  50. package/src/models/index.ts +4 -0
package/docs/BoatApi.md CHANGED
@@ -14,6 +14,7 @@ All URIs are relative to *https://boat.dev/api/v1*
14
14
  | [**create**](BoatApi.md#create) | **POST** /sandboxes | Create sandbox |
15
15
  | [**createEnvironment**](BoatApi.md#createenvironment) | **POST** /environments | Create a sandbox environment |
16
16
  | [**createScopedApiKey**](BoatApi.md#createscopedapikeyoperation) | **POST** /api-keys/scoped | Create a scoped API key |
17
+ | [**createSnapshotShare**](BoatApi.md#createsnapshotshare) | **POST** /named-snapshots/{name}/shares | Share a named snapshot |
17
18
  | [**createWebhook**](BoatApi.md#createwebhook) | **POST** /webhooks | Create webhook |
18
19
  | [**deleteEnvironment**](BoatApi.md#deleteenvironment) | **DELETE** /environments/{environmentId} | Delete a sandbox environment |
19
20
  | [**deleteEnvironmentRepo**](BoatApi.md#deleteenvironmentrepo) | **DELETE** /environments/{environmentId}/repos/{repositoryId} | Remove a repository from an environment |
@@ -44,6 +45,7 @@ All URIs are relative to *https://boat.dev/api/v1*
44
45
  | [**listNamedSnapshots**](BoatApi.md#listnamedsnapshots) | **GET** /named-snapshots | List named snapshots |
45
46
  | [**listOrganizations**](BoatApi.md#listorganizations) | **GET** /orgs | List organizations |
46
47
  | [**listSandboxSnapshots**](BoatApi.md#listsandboxsnapshots) | **GET** /sandboxes/{sandboxId}/snapshots | List boat snapshots |
48
+ | [**listSnapshotShares**](BoatApi.md#listsnapshotshares) | **GET** /named-snapshots/{name}/shares | List share codes of a named snapshot |
47
49
  | [**listSnapshots**](BoatApi.md#listsnapshots) | **GET** /snapshots | List snapshots |
48
50
  | [**listWebhooks**](BoatApi.md#listwebhooks) | **GET** /webhooks | List webhooks |
49
51
  | [**me**](BoatApi.md#me) | **GET** /me | Get current Boat user |
@@ -54,6 +56,7 @@ All URIs are relative to *https://boat.dev/api/v1*
54
56
  | [**repos**](BoatApi.md#repos) | **GET** /repos | List GitHub repositories available to Boat |
55
57
  | [**resume**](BoatApi.md#resumeoperation) | **POST** /sandboxes/{sandboxId}/resume | Resume sandbox |
56
58
  | [**revokeApiKey**](BoatApi.md#revokeapikey) | **DELETE** /api-keys/{apiKeyId} | Revoke an API key |
59
+ | [**revokeSnapshotShare**](BoatApi.md#revokesnapshotshare) | **DELETE** /named-snapshots/{name}/shares/{shareId} | Revoke a share code |
57
60
  | [**rotateApiKey**](BoatApi.md#rotateapikey) | **POST** /api-keys/{apiKeyId}/rotate | Rotate an API key |
58
61
  | [**rotateWebhookSigningSecret**](BoatApi.md#rotatewebhooksigningsecret) | **POST** /webhooks/{webhookId}/rotate | Rotate webhook signing secret |
59
62
  | [**sandboxes**](BoatApi.md#sandboxes) | **GET** /sandboxes | List sandboxes |
@@ -831,6 +834,79 @@ example().catch(console.error);
831
834
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
832
835
 
833
836
 
837
+ ## createSnapshotShare
838
+
839
+ > NamedSnapshotShareCreatedResponse createSnapshotShare(name)
840
+
841
+ Share a named snapshot
842
+
843
+ 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`.
844
+
845
+ ### Example
846
+
847
+ ```ts
848
+ import {
849
+ Configuration,
850
+ BoatApi,
851
+ } from '@boatdev/sdk';
852
+ import type { CreateSnapshotShareRequest } from '@boatdev/sdk';
853
+
854
+ async function example() {
855
+ console.log("🚀 Testing @boatdev/sdk SDK...");
856
+ const config = new Configuration({
857
+ // Configure HTTP bearer authorization: BoatBearerAuth
858
+ accessToken: "YOUR BEARER TOKEN",
859
+ });
860
+ const api = new BoatApi(config);
861
+
862
+ const body = {
863
+ // string
864
+ name: name_example,
865
+ } satisfies CreateSnapshotShareRequest;
866
+
867
+ try {
868
+ const data = await api.createSnapshotShare(body);
869
+ console.log(data);
870
+ } catch (error) {
871
+ console.error(error);
872
+ }
873
+ }
874
+
875
+ // Run the test
876
+ example().catch(console.error);
877
+ ```
878
+
879
+ ### Parameters
880
+
881
+
882
+ | Name | Type | Description | Notes |
883
+ |------------- | ------------- | ------------- | -------------|
884
+ | **name** | `string` | | [Defaults to `undefined`] |
885
+
886
+ ### Return type
887
+
888
+ [**NamedSnapshotShareCreatedResponse**](NamedSnapshotShareCreatedResponse.md)
889
+
890
+ ### Authorization
891
+
892
+ [BoatBearerAuth](../README.md#BoatBearerAuth)
893
+
894
+ ### HTTP request headers
895
+
896
+ - **Content-Type**: Not defined
897
+ - **Accept**: `application/json`
898
+
899
+
900
+ ### HTTP response details
901
+ | Status code | Description | Response headers |
902
+ |-------------|-------------|------------------|
903
+ | **201** | Code created. Store `shareCode` now; Boat does not show it again. | - |
904
+ | **401** | Missing or invalid bearer token. | - |
905
+ | **404** | Resource not found. | - |
906
+
907
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
908
+
909
+
834
910
  ## createWebhook
835
911
 
836
912
  > WebhookSecretResponse createWebhook(webhookCreateRequest)
@@ -3080,6 +3156,79 @@ example().catch(console.error);
3080
3156
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
3081
3157
 
3082
3158
 
3159
+ ## listSnapshotShares
3160
+
3161
+ > NamedSnapshotShareListResponse listSnapshotShares(name)
3162
+
3163
+ List share codes of a named snapshot
3164
+
3165
+ 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`.
3166
+
3167
+ ### Example
3168
+
3169
+ ```ts
3170
+ import {
3171
+ Configuration,
3172
+ BoatApi,
3173
+ } from '@boatdev/sdk';
3174
+ import type { ListSnapshotSharesRequest } from '@boatdev/sdk';
3175
+
3176
+ async function example() {
3177
+ console.log("🚀 Testing @boatdev/sdk SDK...");
3178
+ const config = new Configuration({
3179
+ // Configure HTTP bearer authorization: BoatBearerAuth
3180
+ accessToken: "YOUR BEARER TOKEN",
3181
+ });
3182
+ const api = new BoatApi(config);
3183
+
3184
+ const body = {
3185
+ // string
3186
+ name: name_example,
3187
+ } satisfies ListSnapshotSharesRequest;
3188
+
3189
+ try {
3190
+ const data = await api.listSnapshotShares(body);
3191
+ console.log(data);
3192
+ } catch (error) {
3193
+ console.error(error);
3194
+ }
3195
+ }
3196
+
3197
+ // Run the test
3198
+ example().catch(console.error);
3199
+ ```
3200
+
3201
+ ### Parameters
3202
+
3203
+
3204
+ | Name | Type | Description | Notes |
3205
+ |------------- | ------------- | ------------- | -------------|
3206
+ | **name** | `string` | | [Defaults to `undefined`] |
3207
+
3208
+ ### Return type
3209
+
3210
+ [**NamedSnapshotShareListResponse**](NamedSnapshotShareListResponse.md)
3211
+
3212
+ ### Authorization
3213
+
3214
+ [BoatBearerAuth](../README.md#BoatBearerAuth)
3215
+
3216
+ ### HTTP request headers
3217
+
3218
+ - **Content-Type**: Not defined
3219
+ - **Accept**: `application/json`
3220
+
3221
+
3222
+ ### HTTP response details
3223
+ | Status code | Description | Response headers |
3224
+ |-------------|-------------|------------------|
3225
+ | **200** | The snapshot\'s share codes. | - |
3226
+ | **401** | Missing or invalid bearer token. | - |
3227
+ | **404** | Resource not found. | - |
3228
+
3229
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
3230
+
3231
+
3083
3232
  ## listSnapshots
3084
3233
 
3085
3234
  > SnapshotListResponse listSnapshots(limit, cursor, sort)
@@ -3834,6 +3983,82 @@ example().catch(console.error);
3834
3983
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
3835
3984
 
3836
3985
 
3986
+ ## revokeSnapshotShare
3987
+
3988
+ > NamedSnapshotShareRevokedResponse revokeSnapshotShare(name, shareId)
3989
+
3990
+ Revoke a share code
3991
+
3992
+ 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`.
3993
+
3994
+ ### Example
3995
+
3996
+ ```ts
3997
+ import {
3998
+ Configuration,
3999
+ BoatApi,
4000
+ } from '@boatdev/sdk';
4001
+ import type { RevokeSnapshotShareRequest } from '@boatdev/sdk';
4002
+
4003
+ async function example() {
4004
+ console.log("🚀 Testing @boatdev/sdk SDK...");
4005
+ const config = new Configuration({
4006
+ // Configure HTTP bearer authorization: BoatBearerAuth
4007
+ accessToken: "YOUR BEARER TOKEN",
4008
+ });
4009
+ const api = new BoatApi(config);
4010
+
4011
+ const body = {
4012
+ // string
4013
+ name: name_example,
4014
+ // string | Share id, for example `shr_...`.
4015
+ shareId: shareId_example,
4016
+ } satisfies RevokeSnapshotShareRequest;
4017
+
4018
+ try {
4019
+ const data = await api.revokeSnapshotShare(body);
4020
+ console.log(data);
4021
+ } catch (error) {
4022
+ console.error(error);
4023
+ }
4024
+ }
4025
+
4026
+ // Run the test
4027
+ example().catch(console.error);
4028
+ ```
4029
+
4030
+ ### Parameters
4031
+
4032
+
4033
+ | Name | Type | Description | Notes |
4034
+ |------------- | ------------- | ------------- | -------------|
4035
+ | **name** | `string` | | [Defaults to `undefined`] |
4036
+ | **shareId** | `string` | Share id, for example `shr_...`. | [Defaults to `undefined`] |
4037
+
4038
+ ### Return type
4039
+
4040
+ [**NamedSnapshotShareRevokedResponse**](NamedSnapshotShareRevokedResponse.md)
4041
+
4042
+ ### Authorization
4043
+
4044
+ [BoatBearerAuth](../README.md#BoatBearerAuth)
4045
+
4046
+ ### HTTP request headers
4047
+
4048
+ - **Content-Type**: Not defined
4049
+ - **Accept**: `application/json`
4050
+
4051
+
4052
+ ### HTTP response details
4053
+ | Status code | Description | Response headers |
4054
+ |-------------|-------------|------------------|
4055
+ | **200** | Revoked. | - |
4056
+ | **401** | Missing or invalid bearer token. | - |
4057
+ | **404** | Resource not found. | - |
4058
+
4059
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
4060
+
4061
+
3837
4062
  ## rotateApiKey
3838
4063
 
3839
4064
  > ApiKeySecretResponse rotateApiKey(apiKeyId)
@@ -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.1",
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
  */