@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
@@ -13,6 +13,7 @@ Name | Type
13
13
  `owner` | [CredentialProfileOwner](CredentialProfileOwner.md)
14
14
  `canManage` | boolean
15
15
  `connected` | [Array<CredentialId>](CredentialId.md)
16
+ `accounts` | { [key: string]: Array<CredentialAccount>; }
16
17
  `customApis` | Array<string>
17
18
  `createdAt` | Date
18
19
  `updatedAt` | Date
@@ -30,6 +31,7 @@ const example = {
30
31
  "owner": null,
31
32
  "canManage": null,
32
33
  "connected": null,
34
+ "accounts": null,
33
35
  "customApis": null,
34
36
  "createdAt": null,
35
37
  "updatedAt": null,
@@ -7,6 +7,7 @@
7
7
  Name | Type
8
8
  ------------ | -------------
9
9
  `value` | string
10
+ `keepCurrent` | boolean
10
11
 
11
12
  ## Example
12
13
 
@@ -16,6 +17,7 @@ import type { SetCredentialKeyRequest } from '@boatdev/sdk'
16
17
  // TODO: Update the object below with actual values
17
18
  const example = {
18
19
  "value": null,
20
+ "keepCurrent": null,
19
21
  } satisfies SetCredentialKeyRequest
20
22
 
21
23
  console.log(example)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boatdev/sdk",
3
- "version": "1.9.6",
3
+ "version": "1.9.7",
4
4
  "description": "OpenAPI client for @boatdev/sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "license": "MIT",
@@ -138,6 +138,11 @@ import {
138
138
  CreateScopedApiKeyRequestFromJSON,
139
139
  CreateScopedApiKeyRequestToJSON,
140
140
  } from '../models/CreateScopedApiKeyRequest';
141
+ import {
142
+ type CredentialAccountsResponse,
143
+ CredentialAccountsResponseFromJSON,
144
+ CredentialAccountsResponseToJSON,
145
+ } from '../models/CredentialAccountsResponse';
141
146
  import {
142
147
  type CredentialId,
143
148
  CredentialIdFromJSON,
@@ -554,6 +559,12 @@ import {
554
559
  WebhookUpdateRequestToJSON,
555
560
  } from '../models/WebhookUpdateRequest';
556
561
 
562
+ export interface AddCredentialAccountRequest {
563
+ profile: string;
564
+ credential: CredentialId;
565
+ setCredentialKeyRequest: SetCredentialKeyRequest;
566
+ }
567
+
557
568
  export interface AddEnvironmentRepoOperationRequest {
558
569
  environmentId: string;
559
570
  addEnvironmentRepoRequest: AddEnvironmentRepoRequest;
@@ -648,6 +659,12 @@ export interface CreateWebhookRequest {
648
659
  webhookCreateRequest: WebhookCreateRequest;
649
660
  }
650
661
 
662
+ export interface DeleteCredentialAccountRequest {
663
+ profile: string;
664
+ credential: CredentialId;
665
+ account: string;
666
+ }
667
+
651
668
  export interface DeleteCredentialProfileRequest {
652
669
  profile: string;
653
670
  }
@@ -810,6 +827,11 @@ export interface LimitsRequest {
810
827
  teamId?: string;
811
828
  }
812
829
 
830
+ export interface ListCredentialAccountsRequest {
831
+ profile: string;
832
+ credential: CredentialId;
833
+ }
834
+
813
835
  export interface ListSandboxSnapshotsRequest {
814
836
  sandboxId: string;
815
837
  limit?: number;
@@ -962,6 +984,12 @@ export interface StopCommandRequest {
962
984
  processId: number;
963
985
  }
964
986
 
987
+ export interface SwitchCredentialAccountRequest {
988
+ profile: string;
989
+ credential: CredentialId;
990
+ account: string;
991
+ }
992
+
965
993
  export interface UpdateRequest {
966
994
  sandboxId: string;
967
995
  updateSandboxRequest: UpdateSandboxRequest;
@@ -1019,6 +1047,80 @@ export interface WriteFileRequest {
1019
1047
  */
1020
1048
  export class BoatApi extends runtime.BaseAPI {
1021
1049
 
1050
+ /**
1051
+ * Creates request options for addCredentialAccount without sending the request
1052
+ */
1053
+ async addCredentialAccountRequestOpts(input: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>): Promise<runtime.RequestOpts> {
1054
+ const requestParameters = runtime.unflattenBody<AddCredentialAccountRequest>(input, 'setCredentialKeyRequest', ['profile', 'credential'], []);
1055
+ if (requestParameters['profile'] == null) {
1056
+ throw new runtime.RequiredError(
1057
+ 'profile',
1058
+ 'Required parameter "profile" was null or undefined when calling addCredentialAccount().'
1059
+ );
1060
+ }
1061
+
1062
+ if (requestParameters['credential'] == null) {
1063
+ throw new runtime.RequiredError(
1064
+ 'credential',
1065
+ 'Required parameter "credential" was null or undefined when calling addCredentialAccount().'
1066
+ );
1067
+ }
1068
+
1069
+ if (requestParameters['setCredentialKeyRequest'] == null) {
1070
+ throw new runtime.RequiredError(
1071
+ 'setCredentialKeyRequest',
1072
+ 'Required parameter "setCredentialKeyRequest" was null or undefined when calling addCredentialAccount().'
1073
+ );
1074
+ }
1075
+
1076
+ const queryParameters: any = {};
1077
+
1078
+ const headerParameters: runtime.HTTPHeaders = {};
1079
+
1080
+ headerParameters['Content-Type'] = 'application/json';
1081
+
1082
+ if (this.configuration && this.configuration.accessToken) {
1083
+ const token = this.configuration.accessToken;
1084
+ const tokenString = await token("BoatBearerAuth", []);
1085
+
1086
+ if (tokenString) {
1087
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1088
+ }
1089
+ }
1090
+
1091
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}`;
1092
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
1093
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
1094
+
1095
+ return {
1096
+ path: urlPath,
1097
+ method: 'POST',
1098
+ headers: headerParameters,
1099
+ query: queryParameters,
1100
+ body: SetCredentialKeyRequestToJSON(requestParameters['setCredentialKeyRequest']),
1101
+ };
1102
+ }
1103
+
1104
+ /**
1105
+ * 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`.
1106
+ * Add another API key to a credential
1107
+ */
1108
+ async addCredentialAccountRaw(requestParameters: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>> {
1109
+ const requestOptions = await this.addCredentialAccountRequestOpts(requestParameters);
1110
+ const response = await this.request(requestOptions, initOverrides);
1111
+
1112
+ return new runtime.JSONApiResponse(response, (jsonValue) => CredentialAccountsResponseFromJSON(jsonValue));
1113
+ }
1114
+
1115
+ /**
1116
+ * 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`.
1117
+ * Add another API key to a credential
1118
+ */
1119
+ async addCredentialAccount(requestParameters: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse> {
1120
+ const response = await this.addCredentialAccountRaw(requestParameters, initOverrides);
1121
+ return await response.value();
1122
+ }
1123
+
1022
1124
  /**
1023
1125
  * Creates request options for addEnvironmentRepo without sending the request
1024
1126
  */
@@ -2160,6 +2262,77 @@ export class BoatApi extends runtime.BaseAPI {
2160
2262
  return await response.value();
2161
2263
  }
2162
2264
 
2265
+ /**
2266
+ * Creates request options for deleteCredentialAccount without sending the request
2267
+ */
2268
+ async deleteCredentialAccountRequestOpts(requestParameters: DeleteCredentialAccountRequest): Promise<runtime.RequestOpts> {
2269
+ if (requestParameters['profile'] == null) {
2270
+ throw new runtime.RequiredError(
2271
+ 'profile',
2272
+ 'Required parameter "profile" was null or undefined when calling deleteCredentialAccount().'
2273
+ );
2274
+ }
2275
+
2276
+ if (requestParameters['credential'] == null) {
2277
+ throw new runtime.RequiredError(
2278
+ 'credential',
2279
+ 'Required parameter "credential" was null or undefined when calling deleteCredentialAccount().'
2280
+ );
2281
+ }
2282
+
2283
+ if (requestParameters['account'] == null) {
2284
+ throw new runtime.RequiredError(
2285
+ 'account',
2286
+ 'Required parameter "account" was null or undefined when calling deleteCredentialAccount().'
2287
+ );
2288
+ }
2289
+
2290
+ const queryParameters: any = {};
2291
+
2292
+ const headerParameters: runtime.HTTPHeaders = {};
2293
+
2294
+ if (this.configuration && this.configuration.accessToken) {
2295
+ const token = this.configuration.accessToken;
2296
+ const tokenString = await token("BoatBearerAuth", []);
2297
+
2298
+ if (tokenString) {
2299
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
2300
+ }
2301
+ }
2302
+
2303
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}/{account}`;
2304
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
2305
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
2306
+ urlPath = urlPath.replace('{account}', encodeURIComponent(String(requestParameters['account'])));
2307
+
2308
+ return {
2309
+ path: urlPath,
2310
+ method: 'DELETE',
2311
+ headers: headerParameters,
2312
+ query: queryParameters,
2313
+ };
2314
+ }
2315
+
2316
+ /**
2317
+ * 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`.
2318
+ * Forget an account of a credential
2319
+ */
2320
+ async deleteCredentialAccountRaw(requestParameters: DeleteCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>> {
2321
+ const requestOptions = await this.deleteCredentialAccountRequestOpts(requestParameters);
2322
+ const response = await this.request(requestOptions, initOverrides);
2323
+
2324
+ return new runtime.JSONApiResponse(response, (jsonValue) => CredentialAccountsResponseFromJSON(jsonValue));
2325
+ }
2326
+
2327
+ /**
2328
+ * 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`.
2329
+ * Forget an account of a credential
2330
+ */
2331
+ async deleteCredentialAccount(requestParameters: DeleteCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse> {
2332
+ const response = await this.deleteCredentialAccountRaw(requestParameters, initOverrides);
2333
+ return await response.value();
2334
+ }
2335
+
2163
2336
  /**
2164
2337
  * Creates request options for deleteCredentialProfile without sending the request
2165
2338
  */
@@ -4236,6 +4409,69 @@ export class BoatApi extends runtime.BaseAPI {
4236
4409
  return await response.value();
4237
4410
  }
4238
4411
 
4412
+ /**
4413
+ * Creates request options for listCredentialAccounts without sending the request
4414
+ */
4415
+ async listCredentialAccountsRequestOpts(requestParameters: ListCredentialAccountsRequest): Promise<runtime.RequestOpts> {
4416
+ if (requestParameters['profile'] == null) {
4417
+ throw new runtime.RequiredError(
4418
+ 'profile',
4419
+ 'Required parameter "profile" was null or undefined when calling listCredentialAccounts().'
4420
+ );
4421
+ }
4422
+
4423
+ if (requestParameters['credential'] == null) {
4424
+ throw new runtime.RequiredError(
4425
+ 'credential',
4426
+ 'Required parameter "credential" was null or undefined when calling listCredentialAccounts().'
4427
+ );
4428
+ }
4429
+
4430
+ const queryParameters: any = {};
4431
+
4432
+ const headerParameters: runtime.HTTPHeaders = {};
4433
+
4434
+ if (this.configuration && this.configuration.accessToken) {
4435
+ const token = this.configuration.accessToken;
4436
+ const tokenString = await token("BoatBearerAuth", []);
4437
+
4438
+ if (tokenString) {
4439
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4440
+ }
4441
+ }
4442
+
4443
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}`;
4444
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
4445
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
4446
+
4447
+ return {
4448
+ path: urlPath,
4449
+ method: 'GET',
4450
+ headers: headerParameters,
4451
+ query: queryParameters,
4452
+ };
4453
+ }
4454
+
4455
+ /**
4456
+ * 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`.
4457
+ * List the accounts of a credential
4458
+ */
4459
+ async listCredentialAccountsRaw(requestParameters: ListCredentialAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>> {
4460
+ const requestOptions = await this.listCredentialAccountsRequestOpts(requestParameters);
4461
+ const response = await this.request(requestOptions, initOverrides);
4462
+
4463
+ return new runtime.JSONApiResponse(response, (jsonValue) => CredentialAccountsResponseFromJSON(jsonValue));
4464
+ }
4465
+
4466
+ /**
4467
+ * 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`.
4468
+ * List the accounts of a credential
4469
+ */
4470
+ async listCredentialAccounts(requestParameters: ListCredentialAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse> {
4471
+ const response = await this.listCredentialAccountsRaw(requestParameters, initOverrides);
4472
+ return await response.value();
4473
+ }
4474
+
4239
4475
  /**
4240
4476
  * Creates request options for listCredentialProfiles without sending the request
4241
4477
  */
@@ -6342,6 +6578,77 @@ export class BoatApi extends runtime.BaseAPI {
6342
6578
  return await response.value();
6343
6579
  }
6344
6580
 
6581
+ /**
6582
+ * Creates request options for switchCredentialAccount without sending the request
6583
+ */
6584
+ async switchCredentialAccountRequestOpts(requestParameters: SwitchCredentialAccountRequest): Promise<runtime.RequestOpts> {
6585
+ if (requestParameters['profile'] == null) {
6586
+ throw new runtime.RequiredError(
6587
+ 'profile',
6588
+ 'Required parameter "profile" was null or undefined when calling switchCredentialAccount().'
6589
+ );
6590
+ }
6591
+
6592
+ if (requestParameters['credential'] == null) {
6593
+ throw new runtime.RequiredError(
6594
+ 'credential',
6595
+ 'Required parameter "credential" was null or undefined when calling switchCredentialAccount().'
6596
+ );
6597
+ }
6598
+
6599
+ if (requestParameters['account'] == null) {
6600
+ throw new runtime.RequiredError(
6601
+ 'account',
6602
+ 'Required parameter "account" was null or undefined when calling switchCredentialAccount().'
6603
+ );
6604
+ }
6605
+
6606
+ const queryParameters: any = {};
6607
+
6608
+ const headerParameters: runtime.HTTPHeaders = {};
6609
+
6610
+ if (this.configuration && this.configuration.accessToken) {
6611
+ const token = this.configuration.accessToken;
6612
+ const tokenString = await token("BoatBearerAuth", []);
6613
+
6614
+ if (tokenString) {
6615
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
6616
+ }
6617
+ }
6618
+
6619
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}/{account}/active`;
6620
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
6621
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
6622
+ urlPath = urlPath.replace('{account}', encodeURIComponent(String(requestParameters['account'])));
6623
+
6624
+ return {
6625
+ path: urlPath,
6626
+ method: 'PUT',
6627
+ headers: headerParameters,
6628
+ query: queryParameters,
6629
+ };
6630
+ }
6631
+
6632
+ /**
6633
+ * 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`.
6634
+ * Switch a credential to another account
6635
+ */
6636
+ async switchCredentialAccountRaw(requestParameters: SwitchCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>> {
6637
+ const requestOptions = await this.switchCredentialAccountRequestOpts(requestParameters);
6638
+ const response = await this.request(requestOptions, initOverrides);
6639
+
6640
+ return new runtime.JSONApiResponse(response, (jsonValue) => CredentialAccountsResponseFromJSON(jsonValue));
6641
+ }
6642
+
6643
+ /**
6644
+ * 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`.
6645
+ * Switch a credential to another account
6646
+ */
6647
+ async switchCredentialAccount(requestParameters: SwitchCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse> {
6648
+ const response = await this.switchCredentialAccountRaw(requestParameters, initOverrides);
6649
+ return await response.value();
6650
+ }
6651
+
6345
6652
  /**
6346
6653
  * Creates request options for update without sending the request
6347
6654
  */
@@ -0,0 +1,92 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Boat Public API v1
5
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * One account of a credential. Never a secret.
18
+ * @export
19
+ * @interface CredentialAccount
20
+ */
21
+ export interface CredentialAccount {
22
+ /**
23
+ * The account's id. It stays the same across switches.
24
+ * @type {string}
25
+ * @memberof CredentialAccount
26
+ */
27
+ id: string;
28
+ /**
29
+ * The account's email for a sign-in, or the key's last characters (…1234).
30
+ * @type {string}
31
+ * @memberof CredentialAccount
32
+ */
33
+ label: string;
34
+ /**
35
+ * True for the account every sandbox on the profile uses.
36
+ * @type {boolean}
37
+ * @memberof CredentialAccount
38
+ */
39
+ active: boolean;
40
+ /**
41
+ * When the account was set aside (accounts not in use).
42
+ * @type {Date}
43
+ * @memberof CredentialAccount
44
+ */
45
+ addedAt?: Date;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the CredentialAccount interface.
50
+ */
51
+ export function instanceOfCredentialAccount(value: object): value is CredentialAccount {
52
+ if (!('id' in value) || value['id'] === undefined) return false;
53
+ if (!('label' in value) || value['label'] === undefined) return false;
54
+ if (!('active' in value) || value['active'] === undefined) return false;
55
+ return true;
56
+ }
57
+
58
+ export function CredentialAccountFromJSON(json: any): CredentialAccount {
59
+ return CredentialAccountFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function CredentialAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): CredentialAccount {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'id': json['id'],
69
+ 'label': json['label'],
70
+ 'active': json['active'],
71
+ 'addedAt': json['addedAt'] == null ? undefined : (new Date(json['addedAt'])),
72
+ };
73
+ }
74
+
75
+ export function CredentialAccountToJSON(json: any): CredentialAccount {
76
+ return CredentialAccountToJSONTyped(json, false);
77
+ }
78
+
79
+ export function CredentialAccountToJSONTyped(value?: CredentialAccount | null, ignoreDiscriminator: boolean = false): any {
80
+ if (value == null) {
81
+ return value;
82
+ }
83
+
84
+ return {
85
+
86
+ 'id': value['id'],
87
+ 'label': value['label'],
88
+ 'active': value['active'],
89
+ 'addedAt': value['addedAt'] == null ? value['addedAt'] : value['addedAt'].toISOString(),
90
+ };
91
+ }
92
+
@@ -0,0 +1,128 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Boat Public API v1
5
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { CredentialId } from './CredentialId';
17
+ import {
18
+ CredentialIdFromJSON,
19
+ CredentialIdFromJSONTyped,
20
+ CredentialIdToJSON,
21
+ CredentialIdToJSONTyped,
22
+ } from './CredentialId';
23
+ import type { CredentialAccount } from './CredentialAccount';
24
+ import {
25
+ CredentialAccountFromJSON,
26
+ CredentialAccountFromJSONTyped,
27
+ CredentialAccountToJSON,
28
+ CredentialAccountToJSONTyped,
29
+ } from './CredentialAccount';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface CredentialAccountsResponse
35
+ */
36
+ export interface CredentialAccountsResponse {
37
+ /**
38
+ *
39
+ * @type {boolean}
40
+ * @memberof CredentialAccountsResponse
41
+ */
42
+ ok: boolean;
43
+ /**
44
+ * Stable success envelope discriminator added by v1.
45
+ * @type {string}
46
+ * @memberof CredentialAccountsResponse
47
+ */
48
+ type: string;
49
+ /**
50
+ *
51
+ * @type {boolean}
52
+ * @memberof CredentialAccountsResponse
53
+ */
54
+ success: boolean;
55
+ /**
56
+ *
57
+ * @type {string}
58
+ * @memberof CredentialAccountsResponse
59
+ */
60
+ profileId: string;
61
+ /**
62
+ *
63
+ * @type {CredentialId}
64
+ * @memberof CredentialAccountsResponse
65
+ */
66
+ credential: CredentialId;
67
+ /**
68
+ * In the order the accounts were added, so their numbers stay the same across switches. The one in use is marked `active`.
69
+ * @type {Array<CredentialAccount>}
70
+ * @memberof CredentialAccountsResponse
71
+ */
72
+ accounts: Array<CredentialAccount>;
73
+ }
74
+
75
+
76
+
77
+ /**
78
+ * Check if a given object implements the CredentialAccountsResponse interface.
79
+ */
80
+ export function instanceOfCredentialAccountsResponse(value: object): value is CredentialAccountsResponse {
81
+ if (!('ok' in value) || value['ok'] === undefined) return false;
82
+ if (!('type' in value) || value['type'] === undefined) return false;
83
+ if (!('success' in value) || value['success'] === undefined) return false;
84
+ if (!('profileId' in value) || value['profileId'] === undefined) return false;
85
+ if (!('credential' in value) || value['credential'] === undefined) return false;
86
+ if (!('accounts' in value) || value['accounts'] === undefined) return false;
87
+ return true;
88
+ }
89
+
90
+ export function CredentialAccountsResponseFromJSON(json: any): CredentialAccountsResponse {
91
+ return CredentialAccountsResponseFromJSONTyped(json, false);
92
+ }
93
+
94
+ export function CredentialAccountsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CredentialAccountsResponse {
95
+ if (json == null) {
96
+ return json;
97
+ }
98
+ return {
99
+
100
+ 'ok': json['ok'],
101
+ 'type': json['type'],
102
+ 'success': json['success'],
103
+ 'profileId': json['profileId'],
104
+ 'credential': CredentialIdFromJSON(json['credential']),
105
+ 'accounts': ((json['accounts'] as Array<any>).map(CredentialAccountFromJSON)),
106
+ };
107
+ }
108
+
109
+ export function CredentialAccountsResponseToJSON(json: any): CredentialAccountsResponse {
110
+ return CredentialAccountsResponseToJSONTyped(json, false);
111
+ }
112
+
113
+ export function CredentialAccountsResponseToJSONTyped(value?: CredentialAccountsResponse | null, ignoreDiscriminator: boolean = false): any {
114
+ if (value == null) {
115
+ return value;
116
+ }
117
+
118
+ return {
119
+
120
+ 'ok': value['ok'],
121
+ 'type': value['type'],
122
+ 'success': value['success'],
123
+ 'profileId': value['profileId'],
124
+ 'credential': CredentialIdToJSON(value['credential']),
125
+ 'accounts': ((value['accounts'] as Array<any>).map(CredentialAccountToJSON)),
126
+ };
127
+ }
128
+
@@ -27,6 +27,13 @@ import {
27
27
  CredentialProfileOwnerToJSON,
28
28
  CredentialProfileOwnerToJSONTyped,
29
29
  } from './CredentialProfileOwner';
30
+ import type { CredentialAccount } from './CredentialAccount';
31
+ import {
32
+ CredentialAccountFromJSON,
33
+ CredentialAccountFromJSONTyped,
34
+ CredentialAccountToJSON,
35
+ CredentialAccountToJSONTyped,
36
+ } from './CredentialAccount';
30
37
 
31
38
  /**
32
39
  * A named set of AI credentials. Secret values are never returned.
@@ -70,6 +77,12 @@ export interface CredentialProfile {
70
77
  * @memberof CredentialProfile
71
78
  */
72
79
  connected: Array<CredentialId>;
80
+ /**
81
+ * Credentials with several accounts, keyed by credential id. Each lists every account (labels only), the one in use marked `active`.
82
+ * @type {{ [key: string]: Array<CredentialAccount>; }}
83
+ * @memberof CredentialProfile
84
+ */
85
+ accounts?: { [key: string]: Array<CredentialAccount>; };
73
86
  /**
74
87
  * The names of the profile's custom APIs. Values are never returned.
75
88
  * @type {Array<string>}
@@ -122,6 +135,7 @@ export function CredentialProfileFromJSONTyped(json: any, ignoreDiscriminator: b
122
135
  'owner': CredentialProfileOwnerFromJSON(json['owner']),
123
136
  'canManage': json['canManage'],
124
137
  'connected': ((json['connected'] as Array<any>).map(CredentialIdFromJSON)),
138
+ 'accounts': json['accounts'] == null ? undefined : json['accounts'],
125
139
  'customApis': json['customApis'],
126
140
  'createdAt': (new Date(json['createdAt'])),
127
141
  'updatedAt': (new Date(json['updatedAt'])),
@@ -145,6 +159,7 @@ export function CredentialProfileToJSONTyped(value?: CredentialProfile | null, i
145
159
  'owner': CredentialProfileOwnerToJSON(value['owner']),
146
160
  'canManage': value['canManage'],
147
161
  'connected': ((value['connected'] as Array<any>).map(CredentialIdToJSON)),
162
+ 'accounts': value['accounts'],
148
163
  'customApis': value['customApis'],
149
164
  'createdAt': value['createdAt'].toISOString(),
150
165
  'updatedAt': value['updatedAt'].toISOString(),