@boatdev/sdk 1.9.4 → 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.
@@ -53,6 +53,8 @@ docs/ErrorEnvelopeError.md
53
53
  docs/ErrorEvent.md
54
54
  docs/EventsResponse.md
55
55
  docs/FileReadResponse.md
56
+ docs/FileUrlRequest.md
57
+ docs/FileUrlResponse.md
56
58
  docs/FileWriteRequest.md
57
59
  docs/FileWriteResponse.md
58
60
  docs/ForkRequest.md
@@ -215,6 +217,8 @@ src/models/ErrorEnvelopeError.ts
215
217
  src/models/ErrorEvent.ts
216
218
  src/models/EventsResponse.ts
217
219
  src/models/FileReadResponse.ts
220
+ src/models/FileUrlRequest.ts
221
+ src/models/FileUrlResponse.ts
218
222
  src/models/FileWriteRequest.ts
219
223
  src/models/FileWriteResponse.ts
220
224
  src/models/ForkRequest.ts
@@ -39,6 +39,8 @@ import { type DesktopResponse } from '../models/DesktopResponse';
39
39
  import { type EnvironmentItemChangeResponse } from '../models/EnvironmentItemChangeResponse';
40
40
  import { type EventsResponse } from '../models/EventsResponse';
41
41
  import { type FileReadResponse } from '../models/FileReadResponse';
42
+ import { type FileUrlRequest } from '../models/FileUrlRequest';
43
+ import { type FileUrlResponse } from '../models/FileUrlResponse';
42
44
  import { type FileWriteRequest } from '../models/FileWriteRequest';
43
45
  import { type FileWriteResponse } from '../models/FileWriteResponse';
44
46
  import { type ForkRequest } from '../models/ForkRequest';
@@ -150,6 +152,10 @@ export interface CreateRequest {
150
152
  xBoatOrg?: string;
151
153
  createSandboxRequest?: CreateSandboxRequest;
152
154
  }
155
+ export interface CreateDownloadUrlRequest {
156
+ sandboxId: string;
157
+ fileUrlRequest: FileUrlRequest;
158
+ }
153
159
  export interface CreateEnvironmentRequest {
154
160
  createSandboxEnvironmentRequest: CreateSandboxEnvironmentRequest;
155
161
  }
@@ -159,6 +165,10 @@ export interface CreateScopedApiKeyOperationRequest {
159
165
  export interface CreateSnapshotShareRequest {
160
166
  name: string;
161
167
  }
168
+ export interface CreateUploadUrlRequest {
169
+ sandboxId: string;
170
+ fileUrlRequest: FileUrlRequest;
171
+ }
162
172
  export interface CreateWebhookRequest {
163
173
  webhookCreateRequest: WebhookCreateRequest;
164
174
  }
@@ -556,6 +566,20 @@ export declare class BoatApi extends runtime.BaseAPI {
556
566
  * Create sandbox
557
567
  */
558
568
  create(requestParameters?: CreateRequest | runtime.FlatBody<CreateRequest, 'createSandboxRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateSandboxResponse>;
569
+ /**
570
+ * Creates request options for createDownloadUrl without sending the request
571
+ */
572
+ createDownloadUrlRequestOpts(input: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>): Promise<runtime.RequestOpts>;
573
+ /**
574
+ * 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.
575
+ * Get a download URL for a sandbox file
576
+ */
577
+ createDownloadUrlRaw(requestParameters: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileUrlResponse>>;
578
+ /**
579
+ * 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.
580
+ * Get a download URL for a sandbox file
581
+ */
582
+ createDownloadUrl(requestParameters: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileUrlResponse>;
559
583
  /**
560
584
  * Creates request options for createEnvironment without sending the request
561
585
  */
@@ -598,6 +622,20 @@ export declare class BoatApi extends runtime.BaseAPI {
598
622
  * Share a named snapshot
599
623
  */
600
624
  createSnapshotShare(requestParameters: CreateSnapshotShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NamedSnapshotShareCreatedResponse>;
625
+ /**
626
+ * Creates request options for createUploadUrl without sending the request
627
+ */
628
+ createUploadUrlRequestOpts(input: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>): Promise<runtime.RequestOpts>;
629
+ /**
630
+ * 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.
631
+ * Get an upload URL for a sandbox file
632
+ */
633
+ createUploadUrlRaw(requestParameters: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileUrlResponse>>;
634
+ /**
635
+ * 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.
636
+ * Get an upload URL for a sandbox file
637
+ */
638
+ createUploadUrl(requestParameters: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileUrlResponse>;
601
639
  /**
602
640
  * Creates request options for createWebhook without sending the request
603
641
  */
@@ -1159,12 +1197,12 @@ export declare class BoatApi extends runtime.BaseAPI {
1159
1197
  */
1160
1198
  readFileRequestOpts(requestParameters: ReadFileRequest): Promise<runtime.RequestOpts>;
1161
1199
  /**
1162
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
1200
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
1163
1201
  * Read a file from a sandbox
1164
1202
  */
1165
1203
  readFileRaw(requestParameters: ReadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileReadResponse>>;
1166
1204
  /**
1167
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
1205
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
1168
1206
  * Read a file from a sandbox
1169
1207
  */
1170
1208
  readFile(requestParameters: ReadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileReadResponse>;
@@ -1545,12 +1583,12 @@ export declare class BoatApi extends runtime.BaseAPI {
1545
1583
  */
1546
1584
  writeFileRequestOpts(input: WriteFileRequest | runtime.FlatBody<WriteFileRequest, 'fileWriteRequest'>): Promise<runtime.RequestOpts>;
1547
1585
  /**
1548
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
1586
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
1549
1587
  * Write a file in a sandbox
1550
1588
  */
1551
1589
  writeFileRaw(requestParameters: WriteFileRequest | runtime.FlatBody<WriteFileRequest, 'fileWriteRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileWriteResponse>>;
1552
1590
  /**
1553
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
1591
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
1554
1592
  * Write a file in a sandbox
1555
1593
  */
1556
1594
  writeFile(requestParameters: WriteFileRequest | runtime.FlatBody<WriteFileRequest, 'fileWriteRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileWriteResponse>;
@@ -77,6 +77,8 @@ const DesktopResponse_1 = require("../models/DesktopResponse");
77
77
  const EnvironmentItemChangeResponse_1 = require("../models/EnvironmentItemChangeResponse");
78
78
  const EventsResponse_1 = require("../models/EventsResponse");
79
79
  const FileReadResponse_1 = require("../models/FileReadResponse");
80
+ const FileUrlRequest_1 = require("../models/FileUrlRequest");
81
+ const FileUrlResponse_1 = require("../models/FileUrlResponse");
80
82
  const FileWriteRequest_1 = require("../models/FileWriteRequest");
81
83
  const FileWriteResponse_1 = require("../models/FileWriteResponse");
82
84
  const ForkRequest_1 = require("../models/ForkRequest");
@@ -675,6 +677,54 @@ class BoatApi extends runtime.BaseAPI {
675
677
  const response = await this.createRaw(requestParameters, initOverrides);
676
678
  return await response.value();
677
679
  }
680
+ /**
681
+ * Creates request options for createDownloadUrl without sending the request
682
+ */
683
+ async createDownloadUrlRequestOpts(input) {
684
+ const requestParameters = runtime.unflattenBody(input, 'fileUrlRequest', ['sandboxId'], []);
685
+ if (requestParameters['sandboxId'] == null) {
686
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling createDownloadUrl().');
687
+ }
688
+ if (requestParameters['fileUrlRequest'] == null) {
689
+ throw new runtime.RequiredError('fileUrlRequest', 'Required parameter "fileUrlRequest" was null or undefined when calling createDownloadUrl().');
690
+ }
691
+ const queryParameters = {};
692
+ const headerParameters = {};
693
+ headerParameters['Content-Type'] = 'application/json';
694
+ if (this.configuration && this.configuration.accessToken) {
695
+ const token = this.configuration.accessToken;
696
+ const tokenString = await token("BoatBearerAuth", []);
697
+ if (tokenString) {
698
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
699
+ }
700
+ }
701
+ let urlPath = `/sandboxes/{sandboxId}/files/download-url`;
702
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
703
+ return {
704
+ path: urlPath,
705
+ method: 'POST',
706
+ headers: headerParameters,
707
+ query: queryParameters,
708
+ body: (0, FileUrlRequest_1.FileUrlRequestToJSON)(requestParameters['fileUrlRequest']),
709
+ };
710
+ }
711
+ /**
712
+ * 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.
713
+ * Get a download URL for a sandbox file
714
+ */
715
+ async createDownloadUrlRaw(requestParameters, initOverrides) {
716
+ const requestOptions = await this.createDownloadUrlRequestOpts(requestParameters);
717
+ const response = await this.request(requestOptions, initOverrides);
718
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, FileUrlResponse_1.FileUrlResponseFromJSON)(jsonValue));
719
+ }
720
+ /**
721
+ * 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.
722
+ * Get a download URL for a sandbox file
723
+ */
724
+ async createDownloadUrl(requestParameters, initOverrides) {
725
+ const response = await this.createDownloadUrlRaw(requestParameters, initOverrides);
726
+ return await response.value();
727
+ }
678
728
  /**
679
729
  * Creates request options for createEnvironment without sending the request
680
730
  */
@@ -805,6 +855,54 @@ class BoatApi extends runtime.BaseAPI {
805
855
  const response = await this.createSnapshotShareRaw(requestParameters, initOverrides);
806
856
  return await response.value();
807
857
  }
858
+ /**
859
+ * Creates request options for createUploadUrl without sending the request
860
+ */
861
+ async createUploadUrlRequestOpts(input) {
862
+ const requestParameters = runtime.unflattenBody(input, 'fileUrlRequest', ['sandboxId'], []);
863
+ if (requestParameters['sandboxId'] == null) {
864
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling createUploadUrl().');
865
+ }
866
+ if (requestParameters['fileUrlRequest'] == null) {
867
+ throw new runtime.RequiredError('fileUrlRequest', 'Required parameter "fileUrlRequest" was null or undefined when calling createUploadUrl().');
868
+ }
869
+ const queryParameters = {};
870
+ const headerParameters = {};
871
+ headerParameters['Content-Type'] = 'application/json';
872
+ if (this.configuration && this.configuration.accessToken) {
873
+ const token = this.configuration.accessToken;
874
+ const tokenString = await token("BoatBearerAuth", []);
875
+ if (tokenString) {
876
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
877
+ }
878
+ }
879
+ let urlPath = `/sandboxes/{sandboxId}/files/upload-url`;
880
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
881
+ return {
882
+ path: urlPath,
883
+ method: 'POST',
884
+ headers: headerParameters,
885
+ query: queryParameters,
886
+ body: (0, FileUrlRequest_1.FileUrlRequestToJSON)(requestParameters['fileUrlRequest']),
887
+ };
888
+ }
889
+ /**
890
+ * 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.
891
+ * Get an upload URL for a sandbox file
892
+ */
893
+ async createUploadUrlRaw(requestParameters, initOverrides) {
894
+ const requestOptions = await this.createUploadUrlRequestOpts(requestParameters);
895
+ const response = await this.request(requestOptions, initOverrides);
896
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, FileUrlResponse_1.FileUrlResponseFromJSON)(jsonValue));
897
+ }
898
+ /**
899
+ * 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.
900
+ * Get an upload URL for a sandbox file
901
+ */
902
+ async createUploadUrl(requestParameters, initOverrides) {
903
+ const response = await this.createUploadUrlRaw(requestParameters, initOverrides);
904
+ return await response.value();
905
+ }
808
906
  /**
809
907
  * Creates request options for createWebhook without sending the request
810
908
  */
@@ -2597,7 +2695,7 @@ class BoatApi extends runtime.BaseAPI {
2597
2695
  };
2598
2696
  }
2599
2697
  /**
2600
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
2698
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
2601
2699
  * Read a file from a sandbox
2602
2700
  */
2603
2701
  async readFileRaw(requestParameters, initOverrides) {
@@ -2606,7 +2704,7 @@ class BoatApi extends runtime.BaseAPI {
2606
2704
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, FileReadResponse_1.FileReadResponseFromJSON)(jsonValue));
2607
2705
  }
2608
2706
  /**
2609
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
2707
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
2610
2708
  * Read a file from a sandbox
2611
2709
  */
2612
2710
  async readFile(requestParameters, initOverrides) {
@@ -3881,7 +3979,7 @@ class BoatApi extends runtime.BaseAPI {
3881
3979
  };
3882
3980
  }
3883
3981
  /**
3884
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
3982
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
3885
3983
  * Write a file in a sandbox
3886
3984
  */
3887
3985
  async writeFileRaw(requestParameters, initOverrides) {
@@ -3890,7 +3988,7 @@ class BoatApi extends runtime.BaseAPI {
3890
3988
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, FileWriteResponse_1.FileWriteResponseFromJSON)(jsonValue));
3891
3989
  }
3892
3990
  /**
3893
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
3991
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
3894
3992
  * Write a file in a sandbox
3895
3993
  */
3896
3994
  async writeFile(requestParameters, initOverrides) {
@@ -39,6 +39,8 @@ import { type DesktopResponse } from '../models/DesktopResponse';
39
39
  import { type EnvironmentItemChangeResponse } from '../models/EnvironmentItemChangeResponse';
40
40
  import { type EventsResponse } from '../models/EventsResponse';
41
41
  import { type FileReadResponse } from '../models/FileReadResponse';
42
+ import { type FileUrlRequest } from '../models/FileUrlRequest';
43
+ import { type FileUrlResponse } from '../models/FileUrlResponse';
42
44
  import { type FileWriteRequest } from '../models/FileWriteRequest';
43
45
  import { type FileWriteResponse } from '../models/FileWriteResponse';
44
46
  import { type ForkRequest } from '../models/ForkRequest';
@@ -150,6 +152,10 @@ export interface CreateRequest {
150
152
  xBoatOrg?: string;
151
153
  createSandboxRequest?: CreateSandboxRequest;
152
154
  }
155
+ export interface CreateDownloadUrlRequest {
156
+ sandboxId: string;
157
+ fileUrlRequest: FileUrlRequest;
158
+ }
153
159
  export interface CreateEnvironmentRequest {
154
160
  createSandboxEnvironmentRequest: CreateSandboxEnvironmentRequest;
155
161
  }
@@ -159,6 +165,10 @@ export interface CreateScopedApiKeyOperationRequest {
159
165
  export interface CreateSnapshotShareRequest {
160
166
  name: string;
161
167
  }
168
+ export interface CreateUploadUrlRequest {
169
+ sandboxId: string;
170
+ fileUrlRequest: FileUrlRequest;
171
+ }
162
172
  export interface CreateWebhookRequest {
163
173
  webhookCreateRequest: WebhookCreateRequest;
164
174
  }
@@ -556,6 +566,20 @@ export declare class BoatApi extends runtime.BaseAPI {
556
566
  * Create sandbox
557
567
  */
558
568
  create(requestParameters?: CreateRequest | runtime.FlatBody<CreateRequest, 'createSandboxRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateSandboxResponse>;
569
+ /**
570
+ * Creates request options for createDownloadUrl without sending the request
571
+ */
572
+ createDownloadUrlRequestOpts(input: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>): Promise<runtime.RequestOpts>;
573
+ /**
574
+ * 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.
575
+ * Get a download URL for a sandbox file
576
+ */
577
+ createDownloadUrlRaw(requestParameters: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileUrlResponse>>;
578
+ /**
579
+ * 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.
580
+ * Get a download URL for a sandbox file
581
+ */
582
+ createDownloadUrl(requestParameters: CreateDownloadUrlRequest | runtime.FlatBody<CreateDownloadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileUrlResponse>;
559
583
  /**
560
584
  * Creates request options for createEnvironment without sending the request
561
585
  */
@@ -598,6 +622,20 @@ export declare class BoatApi extends runtime.BaseAPI {
598
622
  * Share a named snapshot
599
623
  */
600
624
  createSnapshotShare(requestParameters: CreateSnapshotShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NamedSnapshotShareCreatedResponse>;
625
+ /**
626
+ * Creates request options for createUploadUrl without sending the request
627
+ */
628
+ createUploadUrlRequestOpts(input: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>): Promise<runtime.RequestOpts>;
629
+ /**
630
+ * 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.
631
+ * Get an upload URL for a sandbox file
632
+ */
633
+ createUploadUrlRaw(requestParameters: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileUrlResponse>>;
634
+ /**
635
+ * 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.
636
+ * Get an upload URL for a sandbox file
637
+ */
638
+ createUploadUrl(requestParameters: CreateUploadUrlRequest | runtime.FlatBody<CreateUploadUrlRequest, 'fileUrlRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileUrlResponse>;
601
639
  /**
602
640
  * Creates request options for createWebhook without sending the request
603
641
  */
@@ -1159,12 +1197,12 @@ export declare class BoatApi extends runtime.BaseAPI {
1159
1197
  */
1160
1198
  readFileRequestOpts(requestParameters: ReadFileRequest): Promise<runtime.RequestOpts>;
1161
1199
  /**
1162
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
1200
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
1163
1201
  * Read a file from a sandbox
1164
1202
  */
1165
1203
  readFileRaw(requestParameters: ReadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileReadResponse>>;
1166
1204
  /**
1167
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
1205
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
1168
1206
  * Read a file from a sandbox
1169
1207
  */
1170
1208
  readFile(requestParameters: ReadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileReadResponse>;
@@ -1545,12 +1583,12 @@ export declare class BoatApi extends runtime.BaseAPI {
1545
1583
  */
1546
1584
  writeFileRequestOpts(input: WriteFileRequest | runtime.FlatBody<WriteFileRequest, 'fileWriteRequest'>): Promise<runtime.RequestOpts>;
1547
1585
  /**
1548
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
1586
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
1549
1587
  * Write a file in a sandbox
1550
1588
  */
1551
1589
  writeFileRaw(requestParameters: WriteFileRequest | runtime.FlatBody<WriteFileRequest, 'fileWriteRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileWriteResponse>>;
1552
1590
  /**
1553
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
1591
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
1554
1592
  * Write a file in a sandbox
1555
1593
  */
1556
1594
  writeFile(requestParameters: WriteFileRequest | runtime.FlatBody<WriteFileRequest, 'fileWriteRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileWriteResponse>;
@@ -41,6 +41,8 @@ import { DesktopResponseFromJSON, } from '../models/DesktopResponse';
41
41
  import { EnvironmentItemChangeResponseFromJSON, } from '../models/EnvironmentItemChangeResponse';
42
42
  import { EventsResponseFromJSON, } from '../models/EventsResponse';
43
43
  import { FileReadResponseFromJSON, } from '../models/FileReadResponse';
44
+ import { FileUrlRequestToJSON, } from '../models/FileUrlRequest';
45
+ import { FileUrlResponseFromJSON, } from '../models/FileUrlResponse';
44
46
  import { FileWriteRequestToJSON, } from '../models/FileWriteRequest';
45
47
  import { FileWriteResponseFromJSON, } from '../models/FileWriteResponse';
46
48
  import { ForkRequestToJSON, } from '../models/ForkRequest';
@@ -639,6 +641,54 @@ export class BoatApi extends runtime.BaseAPI {
639
641
  const response = await this.createRaw(requestParameters, initOverrides);
640
642
  return await response.value();
641
643
  }
644
+ /**
645
+ * Creates request options for createDownloadUrl without sending the request
646
+ */
647
+ async createDownloadUrlRequestOpts(input) {
648
+ const requestParameters = runtime.unflattenBody(input, 'fileUrlRequest', ['sandboxId'], []);
649
+ if (requestParameters['sandboxId'] == null) {
650
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling createDownloadUrl().');
651
+ }
652
+ if (requestParameters['fileUrlRequest'] == null) {
653
+ throw new runtime.RequiredError('fileUrlRequest', 'Required parameter "fileUrlRequest" was null or undefined when calling createDownloadUrl().');
654
+ }
655
+ const queryParameters = {};
656
+ const headerParameters = {};
657
+ headerParameters['Content-Type'] = 'application/json';
658
+ if (this.configuration && this.configuration.accessToken) {
659
+ const token = this.configuration.accessToken;
660
+ const tokenString = await token("BoatBearerAuth", []);
661
+ if (tokenString) {
662
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
663
+ }
664
+ }
665
+ let urlPath = `/sandboxes/{sandboxId}/files/download-url`;
666
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
667
+ return {
668
+ path: urlPath,
669
+ method: 'POST',
670
+ headers: headerParameters,
671
+ query: queryParameters,
672
+ body: FileUrlRequestToJSON(requestParameters['fileUrlRequest']),
673
+ };
674
+ }
675
+ /**
676
+ * 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.
677
+ * Get a download URL for a sandbox file
678
+ */
679
+ async createDownloadUrlRaw(requestParameters, initOverrides) {
680
+ const requestOptions = await this.createDownloadUrlRequestOpts(requestParameters);
681
+ const response = await this.request(requestOptions, initOverrides);
682
+ return new runtime.JSONApiResponse(response, (jsonValue) => FileUrlResponseFromJSON(jsonValue));
683
+ }
684
+ /**
685
+ * 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.
686
+ * Get a download URL for a sandbox file
687
+ */
688
+ async createDownloadUrl(requestParameters, initOverrides) {
689
+ const response = await this.createDownloadUrlRaw(requestParameters, initOverrides);
690
+ return await response.value();
691
+ }
642
692
  /**
643
693
  * Creates request options for createEnvironment without sending the request
644
694
  */
@@ -769,6 +819,54 @@ export class BoatApi extends runtime.BaseAPI {
769
819
  const response = await this.createSnapshotShareRaw(requestParameters, initOverrides);
770
820
  return await response.value();
771
821
  }
822
+ /**
823
+ * Creates request options for createUploadUrl without sending the request
824
+ */
825
+ async createUploadUrlRequestOpts(input) {
826
+ const requestParameters = runtime.unflattenBody(input, 'fileUrlRequest', ['sandboxId'], []);
827
+ if (requestParameters['sandboxId'] == null) {
828
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling createUploadUrl().');
829
+ }
830
+ if (requestParameters['fileUrlRequest'] == null) {
831
+ throw new runtime.RequiredError('fileUrlRequest', 'Required parameter "fileUrlRequest" was null or undefined when calling createUploadUrl().');
832
+ }
833
+ const queryParameters = {};
834
+ const headerParameters = {};
835
+ headerParameters['Content-Type'] = 'application/json';
836
+ if (this.configuration && this.configuration.accessToken) {
837
+ const token = this.configuration.accessToken;
838
+ const tokenString = await token("BoatBearerAuth", []);
839
+ if (tokenString) {
840
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
841
+ }
842
+ }
843
+ let urlPath = `/sandboxes/{sandboxId}/files/upload-url`;
844
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
845
+ return {
846
+ path: urlPath,
847
+ method: 'POST',
848
+ headers: headerParameters,
849
+ query: queryParameters,
850
+ body: FileUrlRequestToJSON(requestParameters['fileUrlRequest']),
851
+ };
852
+ }
853
+ /**
854
+ * 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.
855
+ * Get an upload URL for a sandbox file
856
+ */
857
+ async createUploadUrlRaw(requestParameters, initOverrides) {
858
+ const requestOptions = await this.createUploadUrlRequestOpts(requestParameters);
859
+ const response = await this.request(requestOptions, initOverrides);
860
+ return new runtime.JSONApiResponse(response, (jsonValue) => FileUrlResponseFromJSON(jsonValue));
861
+ }
862
+ /**
863
+ * 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.
864
+ * Get an upload URL for a sandbox file
865
+ */
866
+ async createUploadUrl(requestParameters, initOverrides) {
867
+ const response = await this.createUploadUrlRaw(requestParameters, initOverrides);
868
+ return await response.value();
869
+ }
772
870
  /**
773
871
  * Creates request options for createWebhook without sending the request
774
872
  */
@@ -2561,7 +2659,7 @@ export class BoatApi extends runtime.BaseAPI {
2561
2659
  };
2562
2660
  }
2563
2661
  /**
2564
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
2662
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
2565
2663
  * Read a file from a sandbox
2566
2664
  */
2567
2665
  async readFileRaw(requestParameters, initOverrides) {
@@ -2570,7 +2668,7 @@ export class BoatApi extends runtime.BaseAPI {
2570
2668
  return new runtime.JSONApiResponse(response, (jsonValue) => FileReadResponseFromJSON(jsonValue));
2571
2669
  }
2572
2670
  /**
2573
- * Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
2671
+ * Files up to 5 MiB. For a larger file, use `POST /sandboxes/{sandboxId}/files/download-url`.
2574
2672
  * Read a file from a sandbox
2575
2673
  */
2576
2674
  async readFile(requestParameters, initOverrides) {
@@ -3845,7 +3943,7 @@ export class BoatApi extends runtime.BaseAPI {
3845
3943
  };
3846
3944
  }
3847
3945
  /**
3848
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
3946
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
3849
3947
  * Write a file in a sandbox
3850
3948
  */
3851
3949
  async writeFileRaw(requestParameters, initOverrides) {
@@ -3854,7 +3952,7 @@ export class BoatApi extends runtime.BaseAPI {
3854
3952
  return new runtime.JSONApiResponse(response, (jsonValue) => FileWriteResponseFromJSON(jsonValue));
3855
3953
  }
3856
3954
  /**
3857
- * Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
3955
+ * Files up to 5 MiB after decoding. For a larger file, use `POST /sandboxes/{sandboxId}/files/upload-url`.
3858
3956
  * Write a file in a sandbox
3859
3957
  */
3860
3958
  async writeFile(requestParameters, initOverrides) {
@@ -46,7 +46,7 @@ export interface DeletionOperation {
46
46
  */
47
47
  status: DeletionOperationStatusEnum;
48
48
  /**
49
- * What the background purge is doing. The target is already gone from every list, restore and fork once the operation exists. `waiting_for_uploads`: stored data is erased once the last upload URL issued for it expires (`expectedBy`). `kept_for_newer_snapshots`: a newer snapshot you kept is built on this one; its data goes when they go. `waiting_for_restore`: a sandbox is still restoring from it. `retrying`: a transient fault, retried automatically.
49
+ * What the background purge is doing. The target is already gone from every list, restore and fork once the operation exists. `waiting_for_uploads`: stored data is erased once the last upload URL issued for it expires (`expectedBy`). `kept_for_newer_snapshots`: a newer snapshot, 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.
50
50
  * @type {DeletionOperationStageEnum}
51
51
  * @memberof DeletionOperation
52
52
  */
@@ -0,0 +1,38 @@
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
+ /**
13
+ *
14
+ * @export
15
+ * @interface FileUrlRequest
16
+ */
17
+ export interface FileUrlRequest {
18
+ /**
19
+ * Absolute path, or path relative to the sandbox work directory (/home/user). It must resolve under /home/user or /tmp.
20
+ * @type {string}
21
+ * @memberof FileUrlRequest
22
+ */
23
+ path: string;
24
+ /**
25
+ * How long the URL stays valid.
26
+ * @type {number}
27
+ * @memberof FileUrlRequest
28
+ */
29
+ ttlSeconds?: number;
30
+ }
31
+ /**
32
+ * Check if a given object implements the FileUrlRequest interface.
33
+ */
34
+ export declare function instanceOfFileUrlRequest(value: object): value is FileUrlRequest;
35
+ export declare function FileUrlRequestFromJSON(json: any): FileUrlRequest;
36
+ export declare function FileUrlRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileUrlRequest;
37
+ export declare function FileUrlRequestToJSON(json: any): FileUrlRequest;
38
+ export declare function FileUrlRequestToJSONTyped(value?: FileUrlRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,45 @@
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
+ * Check if a given object implements the FileUrlRequest interface.
16
+ */
17
+ export function instanceOfFileUrlRequest(value) {
18
+ if (!('path' in value) || value['path'] === undefined)
19
+ return false;
20
+ return true;
21
+ }
22
+ export function FileUrlRequestFromJSON(json) {
23
+ return FileUrlRequestFromJSONTyped(json, false);
24
+ }
25
+ export function FileUrlRequestFromJSONTyped(json, ignoreDiscriminator) {
26
+ if (json == null) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'path': json['path'],
31
+ 'ttlSeconds': json['ttlSeconds'] == null ? undefined : json['ttlSeconds'],
32
+ };
33
+ }
34
+ export function FileUrlRequestToJSON(json) {
35
+ return FileUrlRequestToJSONTyped(json, false);
36
+ }
37
+ export function FileUrlRequestToJSONTyped(value, ignoreDiscriminator = false) {
38
+ if (value == null) {
39
+ return value;
40
+ }
41
+ return {
42
+ 'path': value['path'],
43
+ 'ttlSeconds': value['ttlSeconds'],
44
+ };
45
+ }