@boatdev/sdk 1.9.3 → 1.9.5

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 (46) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/dist/apis/BoatApi.d.ts +42 -4
  3. package/dist/apis/BoatApi.js +102 -4
  4. package/dist/esm/apis/BoatApi.d.ts +42 -4
  5. package/dist/esm/apis/BoatApi.js +102 -4
  6. package/dist/esm/models/DeletionOperation.d.ts +1 -1
  7. package/dist/esm/models/FileUrlRequest.d.ts +38 -0
  8. package/dist/esm/models/FileUrlRequest.js +45 -0
  9. package/dist/esm/models/FileUrlResponse.d.ts +78 -0
  10. package/dist/esm/models/FileUrlResponse.js +77 -0
  11. package/dist/esm/models/HostPortRequest.d.ts +6 -0
  12. package/dist/esm/models/HostPortRequest.js +2 -0
  13. package/dist/esm/models/HostPortResponse.d.ts +6 -0
  14. package/dist/esm/models/HostPortResponse.js +2 -0
  15. package/dist/esm/models/SnapshotSummary.d.ts +14 -0
  16. package/dist/esm/models/SnapshotSummary.js +9 -0
  17. package/dist/esm/models/index.d.ts +2 -0
  18. package/dist/esm/models/index.js +2 -0
  19. package/dist/models/DeletionOperation.d.ts +1 -1
  20. package/dist/models/FileUrlRequest.d.ts +38 -0
  21. package/dist/models/FileUrlRequest.js +52 -0
  22. package/dist/models/FileUrlResponse.d.ts +78 -0
  23. package/dist/models/FileUrlResponse.js +85 -0
  24. package/dist/models/HostPortRequest.d.ts +6 -0
  25. package/dist/models/HostPortRequest.js +2 -0
  26. package/dist/models/HostPortResponse.d.ts +6 -0
  27. package/dist/models/HostPortResponse.js +2 -0
  28. package/dist/models/SnapshotSummary.d.ts +14 -0
  29. package/dist/models/SnapshotSummary.js +10 -1
  30. package/dist/models/index.d.ts +2 -0
  31. package/dist/models/index.js +2 -0
  32. package/docs/BoatApi.md +160 -2
  33. package/docs/FileUrlRequest.md +34 -0
  34. package/docs/FileUrlResponse.md +42 -0
  35. package/docs/HostPortRequest.md +2 -0
  36. package/docs/HostPortResponse.md +2 -0
  37. package/docs/SnapshotSummary.md +2 -0
  38. package/package.json +1 -1
  39. package/src/apis/BoatApi.ts +156 -4
  40. package/src/models/DeletionOperation.ts +1 -1
  41. package/src/models/FileUrlRequest.ts +74 -0
  42. package/src/models/FileUrlResponse.ts +131 -0
  43. package/src/models/HostPortRequest.ts +8 -0
  44. package/src/models/HostPortResponse.ts +8 -0
  45. package/src/models/SnapshotSummary.ts +17 -0
  46. package/src/models/index.ts +2 -0
@@ -13,7 +13,7 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.SnapshotSummaryKindEnum = exports.SnapshotSummaryStatusEnum = void 0;
16
+ exports.SnapshotSummaryOriginEnum = exports.SnapshotSummaryKindEnum = exports.SnapshotSummaryStatusEnum = void 0;
17
17
  exports.instanceOfSnapshotSummary = instanceOfSnapshotSummary;
18
18
  exports.SnapshotSummaryFromJSON = SnapshotSummaryFromJSON;
19
19
  exports.SnapshotSummaryFromJSONTyped = SnapshotSummaryFromJSONTyped;
@@ -32,6 +32,13 @@ exports.SnapshotSummaryKindEnum = {
32
32
  Base: 'base',
33
33
  Incremental: 'incremental'
34
34
  };
35
+ /**
36
+ * @export
37
+ */
38
+ exports.SnapshotSummaryOriginEnum = {
39
+ Captured: 'captured',
40
+ Template: 'template'
41
+ };
35
42
  /**
36
43
  * Check if a given object implements the SnapshotSummary interface.
37
44
  */
@@ -72,6 +79,7 @@ function SnapshotSummaryFromJSONTyped(json, ignoreDiscriminator) {
72
79
  'fileCount': json['fileCount'],
73
80
  'contentSizeBytes': json['contentSizeBytes'] == null ? undefined : json['contentSizeBytes'],
74
81
  'contentFileCount': json['contentFileCount'] == null ? undefined : json['contentFileCount'],
82
+ 'origin': json['origin'] == null ? undefined : json['origin'],
75
83
  };
76
84
  }
77
85
  function SnapshotSummaryToJSON(json) {
@@ -94,5 +102,6 @@ function SnapshotSummaryToJSONTyped(value, ignoreDiscriminator = false) {
94
102
  'fileCount': value['fileCount'],
95
103
  'contentSizeBytes': value['contentSizeBytes'],
96
104
  'contentFileCount': value['contentFileCount'],
105
+ 'origin': value['origin'],
97
106
  };
98
107
  }
@@ -48,6 +48,8 @@ export * from './ErrorEnvelopeError';
48
48
  export * from './ErrorEvent';
49
49
  export * from './EventsResponse';
50
50
  export * from './FileReadResponse';
51
+ export * from './FileUrlRequest';
52
+ export * from './FileUrlResponse';
51
53
  export * from './FileWriteRequest';
52
54
  export * from './FileWriteResponse';
53
55
  export * from './ForkRequest';
@@ -66,6 +66,8 @@ __exportStar(require("./ErrorEnvelopeError"), exports);
66
66
  __exportStar(require("./ErrorEvent"), exports);
67
67
  __exportStar(require("./EventsResponse"), exports);
68
68
  __exportStar(require("./FileReadResponse"), exports);
69
+ __exportStar(require("./FileUrlRequest"), exports);
70
+ __exportStar(require("./FileUrlResponse"), exports);
69
71
  __exportStar(require("./FileWriteRequest"), exports);
70
72
  __exportStar(require("./FileWriteResponse"), exports);
71
73
  __exportStar(require("./ForkRequest"), exports);
package/docs/BoatApi.md CHANGED
@@ -15,9 +15,11 @@ All URIs are relative to *https://boat.dev/api/v1*
15
15
  | [**commandStatus**](BoatApi.md#commandstatus) | **GET** /sandboxes/{sandboxId}/commands/{processId} | Get detached command status and logs |
16
16
  | [**conversations**](BoatApi.md#conversations) | **GET** /sandboxes/{sandboxId}/conversations | List boat conversations |
17
17
  | [**create**](BoatApi.md#create) | **POST** /sandboxes | Create sandbox |
18
+ | [**createDownloadUrl**](BoatApi.md#createdownloadurl) | **POST** /sandboxes/{sandboxId}/files/download-url | Get a download URL for a sandbox file |
18
19
  | [**createEnvironment**](BoatApi.md#createenvironment) | **POST** /environments | Create a sandbox environment |
19
20
  | [**createScopedApiKey**](BoatApi.md#createscopedapikeyoperation) | **POST** /api-keys/scoped | Create a scoped API key |
20
21
  | [**createSnapshotShare**](BoatApi.md#createsnapshotshare) | **POST** /named-snapshots/{name}/shares | Share a named snapshot |
22
+ | [**createUploadUrl**](BoatApi.md#createuploadurl) | **POST** /sandboxes/{sandboxId}/files/upload-url | Get an upload URL for a sandbox file |
21
23
  | [**createWebhook**](BoatApi.md#createwebhook) | **POST** /webhooks | Create webhook |
22
24
  | [**deleteEnvironment**](BoatApi.md#deleteenvironment) | **DELETE** /environments/{environmentId} | Delete a sandbox environment |
23
25
  | [**deleteEnvironmentRepo**](BoatApi.md#deleteenvironmentrepo) | **DELETE** /environments/{environmentId}/repos/{repositoryId} | Remove a repository from an environment |
@@ -962,6 +964,84 @@ example().catch(console.error);
962
964
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
963
965
 
964
966
 
967
+ ## createDownloadUrl
968
+
969
+ > FileUrlResponse createDownloadUrl(sandboxId, fileUrlRequest)
970
+
971
+ Get a download URL for a sandbox file
972
+
973
+ Returns a short-lived URL that the sandbox serves itself. GET it to download the file as raw bytes, with no size limit and no Authorization header. The URL is bound to this path and expires after `ttlSeconds` (default 15 minutes, at most 1 hour). Needs `file.read`. Treat the URL as a secret until it expires.
974
+
975
+ ### Example
976
+
977
+ ```ts
978
+ import {
979
+ Configuration,
980
+ BoatApi,
981
+ } from '@boatdev/sdk';
982
+ import type { CreateDownloadUrlRequest } from '@boatdev/sdk';
983
+
984
+ async function example() {
985
+ console.log("🚀 Testing @boatdev/sdk SDK...");
986
+ const config = new Configuration({
987
+ // Configure HTTP bearer authorization: BoatBearerAuth
988
+ accessToken: "YOUR BEARER TOKEN",
989
+ });
990
+ const api = new BoatApi(config);
991
+
992
+ const body = {
993
+ // string | Public Sandbox id returned by create/list/get sandbox calls.
994
+ sandboxId: sandboxId_example,
995
+ // FileUrlRequest
996
+ fileUrlRequest: ...,
997
+ } satisfies CreateDownloadUrlRequest;
998
+
999
+ try {
1000
+ const data = await api.createDownloadUrl(body);
1001
+ console.log(data);
1002
+ } catch (error) {
1003
+ console.error(error);
1004
+ }
1005
+ }
1006
+
1007
+ // Run the test
1008
+ example().catch(console.error);
1009
+ ```
1010
+
1011
+ ### Parameters
1012
+
1013
+
1014
+ | Name | Type | Description | Notes |
1015
+ |------------- | ------------- | ------------- | -------------|
1016
+ | **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
1017
+ | **fileUrlRequest** | [FileUrlRequest](FileUrlRequest.md) | | |
1018
+
1019
+ ### Return type
1020
+
1021
+ [**FileUrlResponse**](FileUrlResponse.md)
1022
+
1023
+ ### Authorization
1024
+
1025
+ [BoatBearerAuth](../README.md#BoatBearerAuth)
1026
+
1027
+ ### HTTP request headers
1028
+
1029
+ - **Content-Type**: `application/json`
1030
+ - **Accept**: `application/json`
1031
+
1032
+
1033
+ ### HTTP response details
1034
+ | Status code | Description | Response headers |
1035
+ |-------------|-------------|------------------|
1036
+ | **200** | Signed download URL. | - |
1037
+ | **400** | Invalid request body or parameters. | - |
1038
+ | **401** | Missing or invalid bearer token. | - |
1039
+ | **404** | Resource not found. | - |
1040
+ | **409** | Request conflicts with current account or sandbox state. | - |
1041
+
1042
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1043
+
1044
+
965
1045
  ## createEnvironment
966
1046
 
967
1047
  > SandboxEnvironmentListResponse createEnvironment(createSandboxEnvironmentRequest)
@@ -1184,6 +1264,84 @@ example().catch(console.error);
1184
1264
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1185
1265
 
1186
1266
 
1267
+ ## createUploadUrl
1268
+
1269
+ > FileUrlResponse createUploadUrl(sandboxId, fileUrlRequest)
1270
+
1271
+ Get an upload URL for a sandbox file
1272
+
1273
+ Returns a short-lived URL that the sandbox serves itself. PUT the file as the raw request body to write it, with no size limit and no Authorization header. Missing directories are created; an existing file is replaced only once the upload completes. The URL is bound to this path and expires after `ttlSeconds` (default 15 minutes, at most 1 hour). Needs `file.write`. Treat the URL as a secret until it expires.
1274
+
1275
+ ### Example
1276
+
1277
+ ```ts
1278
+ import {
1279
+ Configuration,
1280
+ BoatApi,
1281
+ } from '@boatdev/sdk';
1282
+ import type { CreateUploadUrlRequest } from '@boatdev/sdk';
1283
+
1284
+ async function example() {
1285
+ console.log("🚀 Testing @boatdev/sdk SDK...");
1286
+ const config = new Configuration({
1287
+ // Configure HTTP bearer authorization: BoatBearerAuth
1288
+ accessToken: "YOUR BEARER TOKEN",
1289
+ });
1290
+ const api = new BoatApi(config);
1291
+
1292
+ const body = {
1293
+ // string | Public Sandbox id returned by create/list/get sandbox calls.
1294
+ sandboxId: sandboxId_example,
1295
+ // FileUrlRequest
1296
+ fileUrlRequest: ...,
1297
+ } satisfies CreateUploadUrlRequest;
1298
+
1299
+ try {
1300
+ const data = await api.createUploadUrl(body);
1301
+ console.log(data);
1302
+ } catch (error) {
1303
+ console.error(error);
1304
+ }
1305
+ }
1306
+
1307
+ // Run the test
1308
+ example().catch(console.error);
1309
+ ```
1310
+
1311
+ ### Parameters
1312
+
1313
+
1314
+ | Name | Type | Description | Notes |
1315
+ |------------- | ------------- | ------------- | -------------|
1316
+ | **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
1317
+ | **fileUrlRequest** | [FileUrlRequest](FileUrlRequest.md) | | |
1318
+
1319
+ ### Return type
1320
+
1321
+ [**FileUrlResponse**](FileUrlResponse.md)
1322
+
1323
+ ### Authorization
1324
+
1325
+ [BoatBearerAuth](../README.md#BoatBearerAuth)
1326
+
1327
+ ### HTTP request headers
1328
+
1329
+ - **Content-Type**: `application/json`
1330
+ - **Accept**: `application/json`
1331
+
1332
+
1333
+ ### HTTP response details
1334
+ | Status code | Description | Response headers |
1335
+ |-------------|-------------|------------------|
1336
+ | **200** | Signed upload URL. | - |
1337
+ | **400** | Invalid request body or parameters. | - |
1338
+ | **401** | Missing or invalid bearer token. | - |
1339
+ | **404** | Resource not found. | - |
1340
+ | **409** | Request conflicts with current account or sandbox state. | - |
1341
+
1342
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1343
+
1344
+
1187
1345
  ## createWebhook
1188
1346
 
1189
1347
  > WebhookSecretResponse createWebhook(webhookCreateRequest)
@@ -4150,7 +4308,7 @@ example().catch(console.error);
4150
4308
 
4151
4309
  Read a file from a sandbox
4152
4310
 
4153
- Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
4311
+ Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
4154
4312
 
4155
4313
  ### Example
4156
4314
 
@@ -6293,7 +6451,7 @@ example().catch(console.error);
6293
6451
 
6294
6452
  Write a file in a sandbox
6295
6453
 
6296
- Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
6454
+ Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
6297
6455
 
6298
6456
  ### Example
6299
6457
 
@@ -0,0 +1,34 @@
1
+
2
+ # FileUrlRequest
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `path` | string
10
+ `ttlSeconds` | number
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { FileUrlRequest } from '@boatdev/sdk'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "path": null,
20
+ "ttlSeconds": null,
21
+ } satisfies FileUrlRequest
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as FileUrlRequest
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[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,42 @@
1
+
2
+ # FileUrlResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `ok` | boolean
10
+ `type` | string
11
+ `url` | string
12
+ `method` | string
13
+ `path` | string
14
+ `expiresAt` | Date
15
+
16
+ ## Example
17
+
18
+ ```typescript
19
+ import type { FileUrlResponse } from '@boatdev/sdk'
20
+
21
+ // TODO: Update the object below with actual values
22
+ const example = {
23
+ "ok": null,
24
+ "type": null,
25
+ "url": null,
26
+ "method": null,
27
+ "path": null,
28
+ "expiresAt": null,
29
+ } satisfies FileUrlResponse
30
+
31
+ console.log(example)
32
+
33
+ // Convert the instance to a JSON string
34
+ const exampleJSON: string = JSON.stringify(example)
35
+ console.log(exampleJSON)
36
+
37
+ // Parse the JSON string back to an object
38
+ const exampleParsed = JSON.parse(exampleJSON) as FileUrlResponse
39
+ console.log(exampleParsed)
40
+ ```
41
+
42
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -8,6 +8,7 @@ Name | Type
8
8
  ------------ | -------------
9
9
  `port` | number
10
10
  `_public` | boolean
11
+ `localhost` | boolean
11
12
  `title` | string
12
13
 
13
14
  ## Example
@@ -19,6 +20,7 @@ import type { HostPortRequest } from '@boatdev/sdk'
19
20
  const example = {
20
21
  "port": null,
21
22
  "_public": null,
23
+ "localhost": null,
22
24
  "title": null,
23
25
  } satisfies HostPortRequest
24
26
 
@@ -13,6 +13,7 @@ Name | Type
13
13
  `url` | string
14
14
  `isProtected` | boolean
15
15
  `access` | string
16
+ `localhost` | boolean
16
17
 
17
18
  ## Example
18
19
 
@@ -28,6 +29,7 @@ const example = {
28
29
  "url": null,
29
30
  "isProtected": null,
30
31
  "access": null,
32
+ "localhost": null,
31
33
  } satisfies HostPortResponse
32
34
 
33
35
  console.log(example)
@@ -18,6 +18,7 @@ Name | Type
18
18
  `fileCount` | number
19
19
  `contentSizeBytes` | number
20
20
  `contentFileCount` | number
21
+ `origin` | string
21
22
 
22
23
  ## Example
23
24
 
@@ -38,6 +39,7 @@ const example = {
38
39
  "fileCount": null,
39
40
  "contentSizeBytes": null,
40
41
  "contentFileCount": null,
42
+ "origin": null,
41
43
  } satisfies SnapshotSummary
42
44
 
43
45
  console.log(example)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boatdev/sdk",
3
- "version": "1.9.3",
3
+ "version": "1.9.5",
4
4
  "description": "OpenAPI client for @boatdev/sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "license": "MIT",
@@ -173,6 +173,16 @@ import {
173
173
  FileReadResponseFromJSON,
174
174
  FileReadResponseToJSON,
175
175
  } from '../models/FileReadResponse';
176
+ import {
177
+ type FileUrlRequest,
178
+ FileUrlRequestFromJSON,
179
+ FileUrlRequestToJSON,
180
+ } from '../models/FileUrlRequest';
181
+ import {
182
+ type FileUrlResponse,
183
+ FileUrlResponseFromJSON,
184
+ FileUrlResponseToJSON,
185
+ } from '../models/FileUrlResponse';
176
186
  import {
177
187
  type FileWriteRequest,
178
188
  FileWriteRequestFromJSON,
@@ -536,6 +546,11 @@ export interface CreateRequest {
536
546
  createSandboxRequest?: CreateSandboxRequest;
537
547
  }
538
548
 
549
+ export interface CreateDownloadUrlRequest {
550
+ sandboxId: string;
551
+ fileUrlRequest: FileUrlRequest;
552
+ }
553
+
539
554
  export interface CreateEnvironmentRequest {
540
555
  createSandboxEnvironmentRequest: CreateSandboxEnvironmentRequest;
541
556
  }
@@ -548,6 +563,11 @@ export interface CreateSnapshotShareRequest {
548
563
  name: string;
549
564
  }
550
565
 
566
+ export interface CreateUploadUrlRequest {
567
+ sandboxId: string;
568
+ fileUrlRequest: FileUrlRequest;
569
+ }
570
+
551
571
  export interface CreateWebhookRequest {
552
572
  webhookCreateRequest: WebhookCreateRequest;
553
573
  }
@@ -1566,6 +1586,72 @@ export class BoatApi extends runtime.BaseAPI {
1566
1586
  return await response.value();
1567
1587
  }
1568
1588
 
1589
+ /**
1590
+ * Creates request options for createDownloadUrl without sending the request
1591
+ */
1592
+ async createDownloadUrlRequestOpts(input: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>): Promise<runtime.RequestOpts> {
1593
+ const requestParameters = runtime.unflattenBody<CreateDownloadUrlRequest>(input, 'fileUrlRequest', ['sandboxId'], []);
1594
+ if (requestParameters['sandboxId'] == null) {
1595
+ throw new runtime.RequiredError(
1596
+ 'sandboxId',
1597
+ 'Required parameter "sandboxId" was null or undefined when calling createDownloadUrl().'
1598
+ );
1599
+ }
1600
+
1601
+ if (requestParameters['fileUrlRequest'] == null) {
1602
+ throw new runtime.RequiredError(
1603
+ 'fileUrlRequest',
1604
+ 'Required parameter "fileUrlRequest" was null or undefined when calling createDownloadUrl().'
1605
+ );
1606
+ }
1607
+
1608
+ const queryParameters: any = {};
1609
+
1610
+ const headerParameters: runtime.HTTPHeaders = {};
1611
+
1612
+ headerParameters['Content-Type'] = 'application/json';
1613
+
1614
+ if (this.configuration && this.configuration.accessToken) {
1615
+ const token = this.configuration.accessToken;
1616
+ const tokenString = await token("BoatBearerAuth", []);
1617
+
1618
+ if (tokenString) {
1619
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1620
+ }
1621
+ }
1622
+
1623
+ let urlPath = `/sandboxes/{sandboxId}/files/download-url`;
1624
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
1625
+
1626
+ return {
1627
+ path: urlPath,
1628
+ method: 'POST',
1629
+ headers: headerParameters,
1630
+ query: queryParameters,
1631
+ body: FileUrlRequestToJSON(requestParameters['fileUrlRequest']),
1632
+ };
1633
+ }
1634
+
1635
+ /**
1636
+ * Returns a short-lived URL that the sandbox serves itself. GET it to download the file as raw bytes, with no size limit and no Authorization header. The URL is bound to this path and expires after `ttlSeconds` (default 15 minutes, at most 1 hour). Needs `file.read`. Treat the URL as a secret until it expires.
1637
+ * Get a download URL for a sandbox file
1638
+ */
1639
+ async createDownloadUrlRaw(requestParameters: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileUrlResponse>> {
1640
+ const requestOptions = await this.createDownloadUrlRequestOpts(requestParameters);
1641
+ const response = await this.request(requestOptions, initOverrides);
1642
+
1643
+ return new runtime.JSONApiResponse(response, (jsonValue) => FileUrlResponseFromJSON(jsonValue));
1644
+ }
1645
+
1646
+ /**
1647
+ * Returns a short-lived URL that the sandbox serves itself. GET it to download the file as raw bytes, with no size limit and no Authorization header. The URL is bound to this path and expires after `ttlSeconds` (default 15 minutes, at most 1 hour). Needs `file.read`. Treat the URL as a secret until it expires.
1648
+ * Get a download URL for a sandbox file
1649
+ */
1650
+ async createDownloadUrl(requestParameters: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileUrlResponse> {
1651
+ const response = await this.createDownloadUrlRaw(requestParameters, initOverrides);
1652
+ return await response.value();
1653
+ }
1654
+
1569
1655
  /**
1570
1656
  * Creates request options for createEnvironment without sending the request
1571
1657
  */
@@ -1737,6 +1823,72 @@ export class BoatApi extends runtime.BaseAPI {
1737
1823
  return await response.value();
1738
1824
  }
1739
1825
 
1826
+ /**
1827
+ * Creates request options for createUploadUrl without sending the request
1828
+ */
1829
+ async createUploadUrlRequestOpts(input: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>): Promise<runtime.RequestOpts> {
1830
+ const requestParameters = runtime.unflattenBody<CreateUploadUrlRequest>(input, 'fileUrlRequest', ['sandboxId'], []);
1831
+ if (requestParameters['sandboxId'] == null) {
1832
+ throw new runtime.RequiredError(
1833
+ 'sandboxId',
1834
+ 'Required parameter "sandboxId" was null or undefined when calling createUploadUrl().'
1835
+ );
1836
+ }
1837
+
1838
+ if (requestParameters['fileUrlRequest'] == null) {
1839
+ throw new runtime.RequiredError(
1840
+ 'fileUrlRequest',
1841
+ 'Required parameter "fileUrlRequest" was null or undefined when calling createUploadUrl().'
1842
+ );
1843
+ }
1844
+
1845
+ const queryParameters: any = {};
1846
+
1847
+ const headerParameters: runtime.HTTPHeaders = {};
1848
+
1849
+ headerParameters['Content-Type'] = 'application/json';
1850
+
1851
+ if (this.configuration && this.configuration.accessToken) {
1852
+ const token = this.configuration.accessToken;
1853
+ const tokenString = await token("BoatBearerAuth", []);
1854
+
1855
+ if (tokenString) {
1856
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1857
+ }
1858
+ }
1859
+
1860
+ let urlPath = `/sandboxes/{sandboxId}/files/upload-url`;
1861
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
1862
+
1863
+ return {
1864
+ path: urlPath,
1865
+ method: 'POST',
1866
+ headers: headerParameters,
1867
+ query: queryParameters,
1868
+ body: FileUrlRequestToJSON(requestParameters['fileUrlRequest']),
1869
+ };
1870
+ }
1871
+
1872
+ /**
1873
+ * Returns a short-lived URL that the sandbox serves itself. PUT the file as the raw request body to write it, with no size limit and no Authorization header. Missing directories are created; an existing file is replaced only once the upload completes. The URL is bound to this path and expires after `ttlSeconds` (default 15 minutes, at most 1 hour). Needs `file.write`. Treat the URL as a secret until it expires.
1874
+ * Get an upload URL for a sandbox file
1875
+ */
1876
+ async createUploadUrlRaw(requestParameters: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileUrlResponse>> {
1877
+ const requestOptions = await this.createUploadUrlRequestOpts(requestParameters);
1878
+ const response = await this.request(requestOptions, initOverrides);
1879
+
1880
+ return new runtime.JSONApiResponse(response, (jsonValue) => FileUrlResponseFromJSON(jsonValue));
1881
+ }
1882
+
1883
+ /**
1884
+ * Returns a short-lived URL that the sandbox serves itself. PUT the file as the raw request body to write it, with no size limit and no Authorization header. Missing directories are created; an existing file is replaced only once the upload completes. The URL is bound to this path and expires after `ttlSeconds` (default 15 minutes, at most 1 hour). Needs `file.write`. Treat the URL as a secret until it expires.
1885
+ * Get an upload URL for a sandbox file
1886
+ */
1887
+ async createUploadUrl(requestParameters: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileUrlResponse> {
1888
+ const response = await this.createUploadUrlRaw(requestParameters, initOverrides);
1889
+ return await response.value();
1890
+ }
1891
+
1740
1892
  /**
1741
1893
  * Creates request options for createWebhook without sending the request
1742
1894
  */
@@ -4097,7 +4249,7 @@ export class BoatApi extends runtime.BaseAPI {
4097
4249
  }
4098
4250
 
4099
4251
  /**
4100
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
4252
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
4101
4253
  * Read a file from a sandbox
4102
4254
  */
4103
4255
  async readFileRaw(requestParameters: ReadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileReadResponse>> {
@@ -4108,7 +4260,7 @@ export class BoatApi extends runtime.BaseAPI {
4108
4260
  }
4109
4261
 
4110
4262
  /**
4111
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
4263
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
4112
4264
  * Read a file from a sandbox
4113
4265
  */
4114
4266
  async readFile(requestParameters: ReadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileReadResponse> {
@@ -5809,7 +5961,7 @@ export class BoatApi extends runtime.BaseAPI {
5809
5961
  }
5810
5962
 
5811
5963
  /**
5812
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
5964
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
5813
5965
  * Write a file in a sandbox
5814
5966
  */
5815
5967
  async writeFileRaw(requestParameters: WriteFileRequest | runtime.FlatBody<WriteFileRequest, 'fileWriteRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileWriteResponse>> {
@@ -5820,7 +5972,7 @@ export class BoatApi extends runtime.BaseAPI {
5820
5972
  }
5821
5973
 
5822
5974
  /**
5823
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
5975
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
5824
5976
  * Write a file in a sandbox
5825
5977
  */
5826
5978
  async writeFile(requestParameters: WriteFileRequest | runtime.FlatBody<WriteFileRequest, 'fileWriteRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileWriteResponse> {
@@ -50,7 +50,7 @@ export interface DeletionOperation {
50
50
  */
51
51
  status: DeletionOperationStatusEnum;
52
52
  /**
53
- * 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.
53
+ * 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, or a sandbox forked or deployed from it, still builds on this data; it goes when they go. `waiting_for_restore`: a sandbox is still restoring from it. `retrying`: a transient fault, retried automatically.
54
54
  * @type {DeletionOperationStageEnum}
55
55
  * @memberof DeletionOperation
56
56
  */