@boatdev/sdk 1.9.6 → 1.9.7

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 (37) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/dist/apis/BoatApi.d.ts +76 -0
  3. package/dist/apis/BoatApi.js +199 -0
  4. package/dist/esm/apis/BoatApi.d.ts +76 -0
  5. package/dist/esm/apis/BoatApi.js +199 -0
  6. package/dist/esm/models/CredentialAccount.d.ts +50 -0
  7. package/dist/esm/models/CredentialAccount.js +53 -0
  8. package/dist/esm/models/CredentialAccountsResponse.d.ts +64 -0
  9. package/dist/esm/models/CredentialAccountsResponse.js +65 -0
  10. package/dist/esm/models/CredentialProfile.d.ts +9 -0
  11. package/dist/esm/models/CredentialProfile.js +2 -0
  12. package/dist/esm/models/SetCredentialKeyRequest.d.ts +6 -0
  13. package/dist/esm/models/SetCredentialKeyRequest.js +2 -0
  14. package/dist/esm/models/index.d.ts +2 -0
  15. package/dist/esm/models/index.js +2 -0
  16. package/dist/models/CredentialAccount.d.ts +50 -0
  17. package/dist/models/CredentialAccount.js +60 -0
  18. package/dist/models/CredentialAccountsResponse.d.ts +64 -0
  19. package/dist/models/CredentialAccountsResponse.js +72 -0
  20. package/dist/models/CredentialProfile.d.ts +9 -0
  21. package/dist/models/CredentialProfile.js +2 -0
  22. package/dist/models/SetCredentialKeyRequest.d.ts +6 -0
  23. package/dist/models/SetCredentialKeyRequest.js +2 -0
  24. package/dist/models/index.d.ts +2 -0
  25. package/dist/models/index.js +2 -0
  26. package/docs/BoatApi.md +325 -0
  27. package/docs/CredentialAccount.md +39 -0
  28. package/docs/CredentialAccountsResponse.md +42 -0
  29. package/docs/CredentialProfile.md +2 -0
  30. package/docs/SetCredentialKeyRequest.md +2 -0
  31. package/package.json +1 -1
  32. package/src/apis/BoatApi.ts +307 -0
  33. package/src/models/CredentialAccount.ts +92 -0
  34. package/src/models/CredentialAccountsResponse.ts +128 -0
  35. package/src/models/CredentialProfile.ts +15 -0
  36. package/src/models/SetCredentialKeyRequest.ts +8 -0
  37. package/src/models/index.ts +2 -0
@@ -35,6 +35,7 @@ import { CreateSandboxEnvironmentRequestToJSON, } from '../models/CreateSandboxE
35
35
  import { CreateSandboxRequestToJSON, } from '../models/CreateSandboxRequest';
36
36
  import { CreateSandboxResponseFromJSON, } from '../models/CreateSandboxResponse';
37
37
  import { CreateScopedApiKeyRequestToJSON, } from '../models/CreateScopedApiKeyRequest';
38
+ import { CredentialAccountsResponseFromJSON, } from '../models/CredentialAccountsResponse';
38
39
  import { CredentialProfileDeletedResponseFromJSON, } from '../models/CredentialProfileDeletedResponse';
39
40
  import { CredentialProfileListResponseFromJSON, } from '../models/CredentialProfileListResponse';
40
41
  import { CredentialProfileResponseFromJSON, } from '../models/CredentialProfileResponse';
@@ -119,6 +120,58 @@ import { WebhookUpdateRequestToJSON, } from '../models/WebhookUpdateRequest';
119
120
  *
120
121
  */
121
122
  export class BoatApi extends runtime.BaseAPI {
123
+ /**
124
+ * Creates request options for addCredentialAccount without sending the request
125
+ */
126
+ async addCredentialAccountRequestOpts(input) {
127
+ const requestParameters = runtime.unflattenBody(input, 'setCredentialKeyRequest', ['profile', 'credential'], []);
128
+ if (requestParameters['profile'] == null) {
129
+ throw new runtime.RequiredError('profile', 'Required parameter "profile" was null or undefined when calling addCredentialAccount().');
130
+ }
131
+ if (requestParameters['credential'] == null) {
132
+ throw new runtime.RequiredError('credential', 'Required parameter "credential" was null or undefined when calling addCredentialAccount().');
133
+ }
134
+ if (requestParameters['setCredentialKeyRequest'] == null) {
135
+ throw new runtime.RequiredError('setCredentialKeyRequest', 'Required parameter "setCredentialKeyRequest" was null or undefined when calling addCredentialAccount().');
136
+ }
137
+ const queryParameters = {};
138
+ const headerParameters = {};
139
+ headerParameters['Content-Type'] = 'application/json';
140
+ if (this.configuration && this.configuration.accessToken) {
141
+ const token = this.configuration.accessToken;
142
+ const tokenString = await token("BoatBearerAuth", []);
143
+ if (tokenString) {
144
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
145
+ }
146
+ }
147
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}`;
148
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
149
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
150
+ return {
151
+ path: urlPath,
152
+ method: 'POST',
153
+ headers: headerParameters,
154
+ query: queryParameters,
155
+ body: SetCredentialKeyRequestToJSON(requestParameters['setCredentialKeyRequest']),
156
+ };
157
+ }
158
+ /**
159
+ * Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns `400 not_an_api_key`; add another sign-in with \"Add another account\" on the dashboard. Needs an API key with `account.admin`.
160
+ * Add another API key to a credential
161
+ */
162
+ async addCredentialAccountRaw(requestParameters, initOverrides) {
163
+ const requestOptions = await this.addCredentialAccountRequestOpts(requestParameters);
164
+ const response = await this.request(requestOptions, initOverrides);
165
+ return new runtime.JSONApiResponse(response, (jsonValue) => CredentialAccountsResponseFromJSON(jsonValue));
166
+ }
167
+ /**
168
+ * Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns `400 not_an_api_key`; add another sign-in with \"Add another account\" on the dashboard. Needs an API key with `account.admin`.
169
+ * Add another API key to a credential
170
+ */
171
+ async addCredentialAccount(requestParameters, initOverrides) {
172
+ const response = await this.addCredentialAccountRaw(requestParameters, initOverrides);
173
+ return await response.value();
174
+ }
122
175
  /**
123
176
  * Creates request options for addEnvironmentRepo without sending the request
124
177
  */
@@ -974,6 +1027,56 @@ export class BoatApi extends runtime.BaseAPI {
974
1027
  const response = await this.createWebhookRaw(requestParameters, initOverrides);
975
1028
  return await response.value();
976
1029
  }
1030
+ /**
1031
+ * Creates request options for deleteCredentialAccount without sending the request
1032
+ */
1033
+ async deleteCredentialAccountRequestOpts(requestParameters) {
1034
+ if (requestParameters['profile'] == null) {
1035
+ throw new runtime.RequiredError('profile', 'Required parameter "profile" was null or undefined when calling deleteCredentialAccount().');
1036
+ }
1037
+ if (requestParameters['credential'] == null) {
1038
+ throw new runtime.RequiredError('credential', 'Required parameter "credential" was null or undefined when calling deleteCredentialAccount().');
1039
+ }
1040
+ if (requestParameters['account'] == null) {
1041
+ throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling deleteCredentialAccount().');
1042
+ }
1043
+ const queryParameters = {};
1044
+ const headerParameters = {};
1045
+ if (this.configuration && this.configuration.accessToken) {
1046
+ const token = this.configuration.accessToken;
1047
+ const tokenString = await token("BoatBearerAuth", []);
1048
+ if (tokenString) {
1049
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1050
+ }
1051
+ }
1052
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}/{account}`;
1053
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
1054
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
1055
+ urlPath = urlPath.replace('{account}', encodeURIComponent(String(requestParameters['account'])));
1056
+ return {
1057
+ path: urlPath,
1058
+ method: 'DELETE',
1059
+ headers: headerParameters,
1060
+ query: queryParameters,
1061
+ };
1062
+ }
1063
+ /**
1064
+ * Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with `account.admin`.
1065
+ * Forget an account of a credential
1066
+ */
1067
+ async deleteCredentialAccountRaw(requestParameters, initOverrides) {
1068
+ const requestOptions = await this.deleteCredentialAccountRequestOpts(requestParameters);
1069
+ const response = await this.request(requestOptions, initOverrides);
1070
+ return new runtime.JSONApiResponse(response, (jsonValue) => CredentialAccountsResponseFromJSON(jsonValue));
1071
+ }
1072
+ /**
1073
+ * Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with `account.admin`.
1074
+ * Forget an account of a credential
1075
+ */
1076
+ async deleteCredentialAccount(requestParameters, initOverrides) {
1077
+ const response = await this.deleteCredentialAccountRaw(requestParameters, initOverrides);
1078
+ return await response.value();
1079
+ }
977
1080
  /**
978
1081
  * Creates request options for deleteCredentialProfile without sending the request
979
1082
  */
@@ -2547,6 +2650,52 @@ export class BoatApi extends runtime.BaseAPI {
2547
2650
  const response = await this.limitsRaw(requestParameters, initOverrides);
2548
2651
  return await response.value();
2549
2652
  }
2653
+ /**
2654
+ * Creates request options for listCredentialAccounts without sending the request
2655
+ */
2656
+ async listCredentialAccountsRequestOpts(requestParameters) {
2657
+ if (requestParameters['profile'] == null) {
2658
+ throw new runtime.RequiredError('profile', 'Required parameter "profile" was null or undefined when calling listCredentialAccounts().');
2659
+ }
2660
+ if (requestParameters['credential'] == null) {
2661
+ throw new runtime.RequiredError('credential', 'Required parameter "credential" was null or undefined when calling listCredentialAccounts().');
2662
+ }
2663
+ const queryParameters = {};
2664
+ const headerParameters = {};
2665
+ if (this.configuration && this.configuration.accessToken) {
2666
+ const token = this.configuration.accessToken;
2667
+ const tokenString = await token("BoatBearerAuth", []);
2668
+ if (tokenString) {
2669
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
2670
+ }
2671
+ }
2672
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}`;
2673
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
2674
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
2675
+ return {
2676
+ path: urlPath,
2677
+ method: 'GET',
2678
+ headers: headerParameters,
2679
+ query: queryParameters,
2680
+ };
2681
+ }
2682
+ /**
2683
+ * Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with `account.admin`.
2684
+ * List the accounts of a credential
2685
+ */
2686
+ async listCredentialAccountsRaw(requestParameters, initOverrides) {
2687
+ const requestOptions = await this.listCredentialAccountsRequestOpts(requestParameters);
2688
+ const response = await this.request(requestOptions, initOverrides);
2689
+ return new runtime.JSONApiResponse(response, (jsonValue) => CredentialAccountsResponseFromJSON(jsonValue));
2690
+ }
2691
+ /**
2692
+ * Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with `account.admin`.
2693
+ * List the accounts of a credential
2694
+ */
2695
+ async listCredentialAccounts(requestParameters, initOverrides) {
2696
+ const response = await this.listCredentialAccountsRaw(requestParameters, initOverrides);
2697
+ return await response.value();
2698
+ }
2550
2699
  /**
2551
2700
  * Creates request options for listCredentialProfiles without sending the request
2552
2701
  */
@@ -4137,6 +4286,56 @@ export class BoatApi extends runtime.BaseAPI {
4137
4286
  const response = await this.stopCommandRaw(requestParameters, initOverrides);
4138
4287
  return await response.value();
4139
4288
  }
4289
+ /**
4290
+ * Creates request options for switchCredentialAccount without sending the request
4291
+ */
4292
+ async switchCredentialAccountRequestOpts(requestParameters) {
4293
+ if (requestParameters['profile'] == null) {
4294
+ throw new runtime.RequiredError('profile', 'Required parameter "profile" was null or undefined when calling switchCredentialAccount().');
4295
+ }
4296
+ if (requestParameters['credential'] == null) {
4297
+ throw new runtime.RequiredError('credential', 'Required parameter "credential" was null or undefined when calling switchCredentialAccount().');
4298
+ }
4299
+ if (requestParameters['account'] == null) {
4300
+ throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling switchCredentialAccount().');
4301
+ }
4302
+ const queryParameters = {};
4303
+ const headerParameters = {};
4304
+ if (this.configuration && this.configuration.accessToken) {
4305
+ const token = this.configuration.accessToken;
4306
+ const tokenString = await token("BoatBearerAuth", []);
4307
+ if (tokenString) {
4308
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4309
+ }
4310
+ }
4311
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}/{account}/active`;
4312
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
4313
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
4314
+ urlPath = urlPath.replace('{account}', encodeURIComponent(String(requestParameters['account'])));
4315
+ return {
4316
+ path: urlPath,
4317
+ method: 'PUT',
4318
+ headers: headerParameters,
4319
+ query: queryParameters,
4320
+ };
4321
+ }
4322
+ /**
4323
+ * Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. Needs an API key with `account.admin`.
4324
+ * Switch a credential to another account
4325
+ */
4326
+ async switchCredentialAccountRaw(requestParameters, initOverrides) {
4327
+ const requestOptions = await this.switchCredentialAccountRequestOpts(requestParameters);
4328
+ const response = await this.request(requestOptions, initOverrides);
4329
+ return new runtime.JSONApiResponse(response, (jsonValue) => CredentialAccountsResponseFromJSON(jsonValue));
4330
+ }
4331
+ /**
4332
+ * Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. Needs an API key with `account.admin`.
4333
+ * Switch a credential to another account
4334
+ */
4335
+ async switchCredentialAccount(requestParameters, initOverrides) {
4336
+ const response = await this.switchCredentialAccountRaw(requestParameters, initOverrides);
4337
+ return await response.value();
4338
+ }
4140
4339
  /**
4141
4340
  * Creates request options for update without sending the request
4142
4341
  */
@@ -0,0 +1,50 @@
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
+ * One account of a credential. Never a secret.
14
+ * @export
15
+ * @interface CredentialAccount
16
+ */
17
+ export interface CredentialAccount {
18
+ /**
19
+ * The account's id. It stays the same across switches.
20
+ * @type {string}
21
+ * @memberof CredentialAccount
22
+ */
23
+ id: string;
24
+ /**
25
+ * The account's email for a sign-in, or the key's last characters (…1234).
26
+ * @type {string}
27
+ * @memberof CredentialAccount
28
+ */
29
+ label: string;
30
+ /**
31
+ * True for the account every sandbox on the profile uses.
32
+ * @type {boolean}
33
+ * @memberof CredentialAccount
34
+ */
35
+ active: boolean;
36
+ /**
37
+ * When the account was set aside (accounts not in use).
38
+ * @type {Date}
39
+ * @memberof CredentialAccount
40
+ */
41
+ addedAt?: Date;
42
+ }
43
+ /**
44
+ * Check if a given object implements the CredentialAccount interface.
45
+ */
46
+ export declare function instanceOfCredentialAccount(value: object): value is CredentialAccount;
47
+ export declare function CredentialAccountFromJSON(json: any): CredentialAccount;
48
+ export declare function CredentialAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): CredentialAccount;
49
+ export declare function CredentialAccountToJSON(json: any): CredentialAccount;
50
+ export declare function CredentialAccountToJSONTyped(value?: CredentialAccount | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,53 @@
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 CredentialAccount interface.
16
+ */
17
+ export function instanceOfCredentialAccount(value) {
18
+ if (!('id' in value) || value['id'] === undefined)
19
+ return false;
20
+ if (!('label' in value) || value['label'] === undefined)
21
+ return false;
22
+ if (!('active' in value) || value['active'] === undefined)
23
+ return false;
24
+ return true;
25
+ }
26
+ export function CredentialAccountFromJSON(json) {
27
+ return CredentialAccountFromJSONTyped(json, false);
28
+ }
29
+ export function CredentialAccountFromJSONTyped(json, ignoreDiscriminator) {
30
+ if (json == null) {
31
+ return json;
32
+ }
33
+ return {
34
+ 'id': json['id'],
35
+ 'label': json['label'],
36
+ 'active': json['active'],
37
+ 'addedAt': json['addedAt'] == null ? undefined : (new Date(json['addedAt'])),
38
+ };
39
+ }
40
+ export function CredentialAccountToJSON(json) {
41
+ return CredentialAccountToJSONTyped(json, false);
42
+ }
43
+ export function CredentialAccountToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ 'id': value['id'],
49
+ 'label': value['label'],
50
+ 'active': value['active'],
51
+ 'addedAt': value['addedAt'] == null ? value['addedAt'] : value['addedAt'].toISOString(),
52
+ };
53
+ }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Boat Public API v1
3
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { CredentialId } from './CredentialId';
13
+ import type { CredentialAccount } from './CredentialAccount';
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface CredentialAccountsResponse
18
+ */
19
+ export interface CredentialAccountsResponse {
20
+ /**
21
+ *
22
+ * @type {boolean}
23
+ * @memberof CredentialAccountsResponse
24
+ */
25
+ ok: boolean;
26
+ /**
27
+ * Stable success envelope discriminator added by v1.
28
+ * @type {string}
29
+ * @memberof CredentialAccountsResponse
30
+ */
31
+ type: string;
32
+ /**
33
+ *
34
+ * @type {boolean}
35
+ * @memberof CredentialAccountsResponse
36
+ */
37
+ success: boolean;
38
+ /**
39
+ *
40
+ * @type {string}
41
+ * @memberof CredentialAccountsResponse
42
+ */
43
+ profileId: string;
44
+ /**
45
+ *
46
+ * @type {CredentialId}
47
+ * @memberof CredentialAccountsResponse
48
+ */
49
+ credential: CredentialId;
50
+ /**
51
+ * In the order the accounts were added, so their numbers stay the same across switches. The one in use is marked `active`.
52
+ * @type {Array<CredentialAccount>}
53
+ * @memberof CredentialAccountsResponse
54
+ */
55
+ accounts: Array<CredentialAccount>;
56
+ }
57
+ /**
58
+ * Check if a given object implements the CredentialAccountsResponse interface.
59
+ */
60
+ export declare function instanceOfCredentialAccountsResponse(value: object): value is CredentialAccountsResponse;
61
+ export declare function CredentialAccountsResponseFromJSON(json: any): CredentialAccountsResponse;
62
+ export declare function CredentialAccountsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CredentialAccountsResponse;
63
+ export declare function CredentialAccountsResponseToJSON(json: any): CredentialAccountsResponse;
64
+ export declare function CredentialAccountsResponseToJSONTyped(value?: CredentialAccountsResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,65 @@
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
+ import { CredentialIdFromJSON, CredentialIdToJSON, } from './CredentialId';
15
+ import { CredentialAccountFromJSON, CredentialAccountToJSON, } from './CredentialAccount';
16
+ /**
17
+ * Check if a given object implements the CredentialAccountsResponse interface.
18
+ */
19
+ export function instanceOfCredentialAccountsResponse(value) {
20
+ if (!('ok' in value) || value['ok'] === undefined)
21
+ return false;
22
+ if (!('type' in value) || value['type'] === undefined)
23
+ return false;
24
+ if (!('success' in value) || value['success'] === undefined)
25
+ return false;
26
+ if (!('profileId' in value) || value['profileId'] === undefined)
27
+ return false;
28
+ if (!('credential' in value) || value['credential'] === undefined)
29
+ return false;
30
+ if (!('accounts' in value) || value['accounts'] === undefined)
31
+ return false;
32
+ return true;
33
+ }
34
+ export function CredentialAccountsResponseFromJSON(json) {
35
+ return CredentialAccountsResponseFromJSONTyped(json, false);
36
+ }
37
+ export function CredentialAccountsResponseFromJSONTyped(json, ignoreDiscriminator) {
38
+ if (json == null) {
39
+ return json;
40
+ }
41
+ return {
42
+ 'ok': json['ok'],
43
+ 'type': json['type'],
44
+ 'success': json['success'],
45
+ 'profileId': json['profileId'],
46
+ 'credential': CredentialIdFromJSON(json['credential']),
47
+ 'accounts': (json['accounts'].map(CredentialAccountFromJSON)),
48
+ };
49
+ }
50
+ export function CredentialAccountsResponseToJSON(json) {
51
+ return CredentialAccountsResponseToJSONTyped(json, false);
52
+ }
53
+ export function CredentialAccountsResponseToJSONTyped(value, ignoreDiscriminator = false) {
54
+ if (value == null) {
55
+ return value;
56
+ }
57
+ return {
58
+ 'ok': value['ok'],
59
+ 'type': value['type'],
60
+ 'success': value['success'],
61
+ 'profileId': value['profileId'],
62
+ 'credential': CredentialIdToJSON(value['credential']),
63
+ 'accounts': (value['accounts'].map(CredentialAccountToJSON)),
64
+ };
65
+ }
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import type { CredentialId } from './CredentialId';
13
13
  import type { CredentialProfileOwner } from './CredentialProfileOwner';
14
+ import type { CredentialAccount } from './CredentialAccount';
14
15
  /**
15
16
  * A named set of AI credentials. Secret values are never returned.
16
17
  * @export
@@ -53,6 +54,14 @@ export interface CredentialProfile {
53
54
  * @memberof CredentialProfile
54
55
  */
55
56
  connected: Array<CredentialId>;
57
+ /**
58
+ * Credentials with several accounts, keyed by credential id. Each lists every account (labels only), the one in use marked `active`.
59
+ * @type {{ [key: string]: Array<CredentialAccount>; }}
60
+ * @memberof CredentialProfile
61
+ */
62
+ accounts?: {
63
+ [key: string]: Array<CredentialAccount>;
64
+ };
56
65
  /**
57
66
  * The names of the profile's custom APIs. Values are never returned.
58
67
  * @type {Array<string>}
@@ -51,6 +51,7 @@ export function CredentialProfileFromJSONTyped(json, ignoreDiscriminator) {
51
51
  'owner': CredentialProfileOwnerFromJSON(json['owner']),
52
52
  'canManage': json['canManage'],
53
53
  'connected': (json['connected'].map(CredentialIdFromJSON)),
54
+ 'accounts': json['accounts'] == null ? undefined : json['accounts'],
54
55
  'customApis': json['customApis'],
55
56
  'createdAt': (new Date(json['createdAt'])),
56
57
  'updatedAt': (new Date(json['updatedAt'])),
@@ -70,6 +71,7 @@ export function CredentialProfileToJSONTyped(value, ignoreDiscriminator = false)
70
71
  'owner': CredentialProfileOwnerToJSON(value['owner']),
71
72
  'canManage': value['canManage'],
72
73
  'connected': (value['connected'].map(CredentialIdToJSON)),
74
+ 'accounts': value['accounts'],
73
75
  'customApis': value['customApis'],
74
76
  'createdAt': value['createdAt'].toISOString(),
75
77
  'updatedAt': value['updatedAt'].toISOString(),
@@ -21,6 +21,12 @@ export interface SetCredentialKeyRequest {
21
21
  * @memberof SetCredentialKeyRequest
22
22
  */
23
23
  value: string;
24
+ /**
25
+ * Keep the key this one replaces as another account of the credential, ready to switch back to.
26
+ * @type {boolean}
27
+ * @memberof SetCredentialKeyRequest
28
+ */
29
+ keepCurrent?: boolean;
24
30
  }
25
31
  /**
26
32
  * Check if a given object implements the SetCredentialKeyRequest interface.
@@ -28,6 +28,7 @@ export function SetCredentialKeyRequestFromJSONTyped(json, ignoreDiscriminator)
28
28
  }
29
29
  return {
30
30
  'value': json['value'],
31
+ 'keepCurrent': json['keepCurrent'] == null ? undefined : json['keepCurrent'],
31
32
  };
32
33
  }
33
34
  export function SetCredentialKeyRequestToJSON(json) {
@@ -39,5 +40,6 @@ export function SetCredentialKeyRequestToJSONTyped(value, ignoreDiscriminator =
39
40
  }
40
41
  return {
41
42
  'value': value['value'],
43
+ 'keepCurrent': value['keepCurrent'],
42
44
  };
43
45
  }
@@ -41,6 +41,8 @@ export * from './CreateSandboxRequest';
41
41
  export * from './CreateSandboxResponse';
42
42
  export * from './CreateScopedApiKey503Response';
43
43
  export * from './CreateScopedApiKeyRequest';
44
+ export * from './CredentialAccount';
45
+ export * from './CredentialAccountsResponse';
44
46
  export * from './CredentialId';
45
47
  export * from './CredentialProfile';
46
48
  export * from './CredentialProfileDeletedResponse';
@@ -43,6 +43,8 @@ export * from './CreateSandboxRequest';
43
43
  export * from './CreateSandboxResponse';
44
44
  export * from './CreateScopedApiKey503Response';
45
45
  export * from './CreateScopedApiKeyRequest';
46
+ export * from './CredentialAccount';
47
+ export * from './CredentialAccountsResponse';
46
48
  export * from './CredentialId';
47
49
  export * from './CredentialProfile';
48
50
  export * from './CredentialProfileDeletedResponse';
@@ -0,0 +1,50 @@
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
+ * One account of a credential. Never a secret.
14
+ * @export
15
+ * @interface CredentialAccount
16
+ */
17
+ export interface CredentialAccount {
18
+ /**
19
+ * The account's id. It stays the same across switches.
20
+ * @type {string}
21
+ * @memberof CredentialAccount
22
+ */
23
+ id: string;
24
+ /**
25
+ * The account's email for a sign-in, or the key's last characters (…1234).
26
+ * @type {string}
27
+ * @memberof CredentialAccount
28
+ */
29
+ label: string;
30
+ /**
31
+ * True for the account every sandbox on the profile uses.
32
+ * @type {boolean}
33
+ * @memberof CredentialAccount
34
+ */
35
+ active: boolean;
36
+ /**
37
+ * When the account was set aside (accounts not in use).
38
+ * @type {Date}
39
+ * @memberof CredentialAccount
40
+ */
41
+ addedAt?: Date;
42
+ }
43
+ /**
44
+ * Check if a given object implements the CredentialAccount interface.
45
+ */
46
+ export declare function instanceOfCredentialAccount(value: object): value is CredentialAccount;
47
+ export declare function CredentialAccountFromJSON(json: any): CredentialAccount;
48
+ export declare function CredentialAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): CredentialAccount;
49
+ export declare function CredentialAccountToJSON(json: any): CredentialAccount;
50
+ export declare function CredentialAccountToJSONTyped(value?: CredentialAccount | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Boat Public API v1
6
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfCredentialAccount = instanceOfCredentialAccount;
17
+ exports.CredentialAccountFromJSON = CredentialAccountFromJSON;
18
+ exports.CredentialAccountFromJSONTyped = CredentialAccountFromJSONTyped;
19
+ exports.CredentialAccountToJSON = CredentialAccountToJSON;
20
+ exports.CredentialAccountToJSONTyped = CredentialAccountToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the CredentialAccount interface.
23
+ */
24
+ function instanceOfCredentialAccount(value) {
25
+ if (!('id' in value) || value['id'] === undefined)
26
+ return false;
27
+ if (!('label' in value) || value['label'] === undefined)
28
+ return false;
29
+ if (!('active' in value) || value['active'] === undefined)
30
+ return false;
31
+ return true;
32
+ }
33
+ function CredentialAccountFromJSON(json) {
34
+ return CredentialAccountFromJSONTyped(json, false);
35
+ }
36
+ function CredentialAccountFromJSONTyped(json, ignoreDiscriminator) {
37
+ if (json == null) {
38
+ return json;
39
+ }
40
+ return {
41
+ 'id': json['id'],
42
+ 'label': json['label'],
43
+ 'active': json['active'],
44
+ 'addedAt': json['addedAt'] == null ? undefined : (new Date(json['addedAt'])),
45
+ };
46
+ }
47
+ function CredentialAccountToJSON(json) {
48
+ return CredentialAccountToJSONTyped(json, false);
49
+ }
50
+ function CredentialAccountToJSONTyped(value, ignoreDiscriminator = false) {
51
+ if (value == null) {
52
+ return value;
53
+ }
54
+ return {
55
+ 'id': value['id'],
56
+ 'label': value['label'],
57
+ 'active': value['active'],
58
+ 'addedAt': value['addedAt'] == null ? value['addedAt'] : value['addedAt'].toISOString(),
59
+ };
60
+ }