@browserbasehq/sdk 2.20.0 → 2.21.0
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.
- package/CHANGELOG.md +7 -0
- package/index.d.mts +6 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -1
- package/index.js +6 -0
- package/index.js.map +1 -1
- package/index.mjs +6 -0
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.ts +4 -4
- package/resources/agents/runs.d.ts +24 -8
- package/resources/agents/runs.d.ts.map +1 -1
- package/resources/functions/functions.d.ts +10 -0
- package/resources/functions/functions.d.ts.map +1 -0
- package/resources/functions/functions.js +49 -0
- package/resources/functions/functions.js.map +1 -0
- package/resources/functions/functions.mjs +12 -0
- package/resources/functions/functions.mjs.map +1 -0
- package/resources/functions/index.d.ts +3 -0
- package/resources/functions/index.d.ts.map +1 -0
- package/resources/functions/index.js +9 -0
- package/resources/functions/index.js.map +1 -0
- package/resources/functions/index.mjs +4 -0
- package/resources/functions/index.mjs.map +1 -0
- package/resources/functions/secrets.d.ts +74 -0
- package/resources/functions/secrets.d.ts.map +1 -0
- package/resources/functions/secrets.js +39 -0
- package/resources/functions/secrets.js.map +1 -0
- package/resources/functions/secrets.mjs +35 -0
- package/resources/functions/secrets.mjs.map +1 -0
- package/resources/functions.d.ts +2 -0
- package/resources/functions.d.ts.map +1 -0
- package/resources/functions.js +19 -0
- package/resources/functions.js.map +1 -0
- package/resources/functions.mjs +3 -0
- package/resources/functions.mjs.map +1 -0
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/search.d.ts +1 -1
- package/resources/secrets.d.ts +142 -0
- package/resources/secrets.d.ts.map +1 -0
- package/resources/secrets.js +50 -0
- package/resources/secrets.js.map +1 -0
- package/resources/secrets.mjs +46 -0
- package/resources/secrets.mjs.map +1 -0
- package/src/index.ts +26 -0
- package/src/resources/agents/agents.ts +4 -4
- package/src/resources/agents/runs.ts +25 -8
- package/src/resources/functions/functions.ts +20 -0
- package/src/resources/functions/index.ts +4 -0
- package/src/resources/functions/secrets.ts +117 -0
- package/src/resources/functions.ts +3 -0
- package/src/resources/index.ts +10 -0
- package/src/resources/search.ts +1 -1
- package/src/resources/secrets.ts +196 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
import * as SecretsAPI from '../secrets';
|
|
7
|
+
|
|
8
|
+
export class Secrets extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List secrets attached to a function. Supports filtering by secret creation time.
|
|
11
|
+
* Returns metadata only.
|
|
12
|
+
*/
|
|
13
|
+
list(
|
|
14
|
+
id: string,
|
|
15
|
+
query?: SecretListParams,
|
|
16
|
+
options?: Core.RequestOptions,
|
|
17
|
+
): Core.APIPromise<SecretListResponse>;
|
|
18
|
+
list(id: string, options?: Core.RequestOptions): Core.APIPromise<SecretListResponse>;
|
|
19
|
+
list(
|
|
20
|
+
id: string,
|
|
21
|
+
query: SecretListParams | Core.RequestOptions = {},
|
|
22
|
+
options?: Core.RequestOptions,
|
|
23
|
+
): Core.APIPromise<SecretListResponse> {
|
|
24
|
+
if (isRequestOptions(query)) {
|
|
25
|
+
return this.list(id, {}, query);
|
|
26
|
+
}
|
|
27
|
+
return this._client.get(`/v1/functions/${id}/secrets`, { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Attach a secret to a Function, taking effect on the Function's next invocation.
|
|
32
|
+
* Note: Attaching a secret that is already attached succeeds to support
|
|
33
|
+
* idempotency.
|
|
34
|
+
*/
|
|
35
|
+
attach(id: string, body: SecretAttachParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
36
|
+
return this._client.post(`/v1/functions/${id}/secrets`, {
|
|
37
|
+
body,
|
|
38
|
+
...options,
|
|
39
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Detach a secret from a Function, taking effect on the Function's next
|
|
45
|
+
* invocation. Note: Detaching a secret that is not attached succeeds to support
|
|
46
|
+
* idempotency.
|
|
47
|
+
*/
|
|
48
|
+
detach(id: string, secretId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
49
|
+
return this._client.delete(`/v1/functions/${id}/secrets/${secretId}`, {
|
|
50
|
+
...options,
|
|
51
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A page of secrets.
|
|
58
|
+
*/
|
|
59
|
+
export interface SecretListResponse {
|
|
60
|
+
/**
|
|
61
|
+
* The page of matching secrets.
|
|
62
|
+
*/
|
|
63
|
+
data: Array<SecretsAPI.Secret>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The maximum number of results returned in this page.
|
|
67
|
+
*/
|
|
68
|
+
limit: number;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Cursor for the next page. Pass it back as `cursor` on the next request to
|
|
72
|
+
* continue paging. null when there are no more results.
|
|
73
|
+
*/
|
|
74
|
+
nextCursor: string | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface SecretListParams {
|
|
78
|
+
/**
|
|
79
|
+
* Pagination cursor. Pass the nextCursor from the previous response to fetch the
|
|
80
|
+
* next page. Keep the same filters across pages. Omit to start from the first
|
|
81
|
+
* page.
|
|
82
|
+
*/
|
|
83
|
+
cursor?: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Only return secrets created on or before this timestamp (inclusive). RFC 3339,
|
|
87
|
+
* e.g. 2026-01-20T00:00:00Z.
|
|
88
|
+
*/
|
|
89
|
+
endAt?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Maximum number of results to return.
|
|
93
|
+
*/
|
|
94
|
+
limit?: number;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Only return secrets created on or after this timestamp (inclusive). RFC 3339,
|
|
98
|
+
* e.g. 2026-01-19T00:00:00Z.
|
|
99
|
+
*/
|
|
100
|
+
startAt?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface SecretAttachParams {
|
|
104
|
+
/**
|
|
105
|
+
* The id of the project secret to attach (the `id` returned by POST /v1/secrets).
|
|
106
|
+
* Idempotent: re-attaching an already-attached secret succeeds.
|
|
107
|
+
*/
|
|
108
|
+
secretId: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare namespace Secrets {
|
|
112
|
+
export {
|
|
113
|
+
type SecretListResponse as SecretListResponse,
|
|
114
|
+
type SecretListParams as SecretListParams,
|
|
115
|
+
type SecretAttachParams as SecretAttachParams,
|
|
116
|
+
};
|
|
117
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -25,8 +25,18 @@ export {
|
|
|
25
25
|
} from './contexts';
|
|
26
26
|
export { Extensions, type Extension, type ExtensionCreateParams } from './extensions';
|
|
27
27
|
export { FetchAPI, type FetchAPICreateResponse, type FetchAPICreateParams } from './fetch-api';
|
|
28
|
+
export { Functions } from './functions/functions';
|
|
28
29
|
export { Projects, type Project, type ProjectUsage, type ProjectListResponse } from './projects';
|
|
29
30
|
export { Search, type SearchWebResponse, type SearchWebParams } from './search';
|
|
31
|
+
export {
|
|
32
|
+
Secrets,
|
|
33
|
+
type Secret,
|
|
34
|
+
type SecretsKeypair,
|
|
35
|
+
type SecretListResponse,
|
|
36
|
+
type SecretCreateParams,
|
|
37
|
+
type SecretUpdateParams,
|
|
38
|
+
type SecretListParams,
|
|
39
|
+
} from './secrets';
|
|
30
40
|
export {
|
|
31
41
|
Sessions,
|
|
32
42
|
type Session,
|
package/src/resources/search.ts
CHANGED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import { isRequestOptions } from '../core';
|
|
5
|
+
import * as Core from '../core';
|
|
6
|
+
|
|
7
|
+
export class Secrets extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create Secret
|
|
10
|
+
*/
|
|
11
|
+
create(body: SecretCreateParams, options?: Core.RequestOptions): Core.APIPromise<Secret> {
|
|
12
|
+
return this._client.post('/v1/secrets', { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get Secret
|
|
17
|
+
*/
|
|
18
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Secret> {
|
|
19
|
+
return this._client.get(`/v1/secrets/${id}`, options);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Replace a secret's value. The name cannot be changed; to rename, create a new
|
|
24
|
+
* secret and delete the old one.
|
|
25
|
+
*/
|
|
26
|
+
update(id: string, body: SecretUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Secret> {
|
|
27
|
+
return this._client.patch(`/v1/secrets/${id}`, { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* List project secrets. Supports filtering by creation time.
|
|
32
|
+
*/
|
|
33
|
+
list(query?: SecretListParams, options?: Core.RequestOptions): Core.APIPromise<SecretListResponse>;
|
|
34
|
+
list(options?: Core.RequestOptions): Core.APIPromise<SecretListResponse>;
|
|
35
|
+
list(
|
|
36
|
+
query: SecretListParams | Core.RequestOptions = {},
|
|
37
|
+
options?: Core.RequestOptions,
|
|
38
|
+
): Core.APIPromise<SecretListResponse> {
|
|
39
|
+
if (isRequestOptions(query)) {
|
|
40
|
+
return this.list({}, query);
|
|
41
|
+
}
|
|
42
|
+
return this._client.get('/v1/secrets', { query, ...options });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Delete Secret
|
|
47
|
+
*/
|
|
48
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
49
|
+
return this._client.delete(`/v1/secrets/${id}`, {
|
|
50
|
+
...options,
|
|
51
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get Secrets Keypair
|
|
57
|
+
*/
|
|
58
|
+
getPublicKey(options?: Core.RequestOptions): Core.APIPromise<SecretsKeypair> {
|
|
59
|
+
return this._client.get('/v1/secrets/keypair', options);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface Secret {
|
|
64
|
+
/**
|
|
65
|
+
* Unique identifier of the secret.
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The name the secret value is stored under.
|
|
71
|
+
*/
|
|
72
|
+
secretKey: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SecretsKeypair {
|
|
76
|
+
/**
|
|
77
|
+
* Identifier of the keypair the public key was minted from. Pass this back when
|
|
78
|
+
* creating a secret so the ciphertext records which keypair sealed it, which keeps
|
|
79
|
+
* decryption correct across keypair rotation.
|
|
80
|
+
*/
|
|
81
|
+
id: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The project's HPKE public encryption key, base64-encoded. Encrypt secret values
|
|
85
|
+
* with this key before creating a secret.
|
|
86
|
+
*/
|
|
87
|
+
publicKey: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A page of secrets.
|
|
92
|
+
*/
|
|
93
|
+
export interface SecretListResponse {
|
|
94
|
+
/**
|
|
95
|
+
* The page of matching secrets.
|
|
96
|
+
*/
|
|
97
|
+
data: Array<Secret>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The maximum number of results returned in this page.
|
|
101
|
+
*/
|
|
102
|
+
limit: number;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Cursor for the next page. Pass it back as `cursor` on the next request to
|
|
106
|
+
* continue paging. null when there are no more results.
|
|
107
|
+
*/
|
|
108
|
+
nextCursor: string | null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface SecretCreateParams {
|
|
112
|
+
/**
|
|
113
|
+
* The `id` returned by GET /v1/secrets/keypair, identifying the keypair whose
|
|
114
|
+
* public key encrypted the value. Recorded with the secret so decryption stays
|
|
115
|
+
* correct across keypair rotation.
|
|
116
|
+
*/
|
|
117
|
+
keypairId: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The secret value encrypted with HPKE. In order to seal the secret value before
|
|
121
|
+
* sending, get the project's public key from GET /v1/secrets/keypair. Decode the
|
|
122
|
+
* publicKey using base64 into the raw 32-byte public key. Then, use HPKE Base mode
|
|
123
|
+
* (RFC 9180) with the following algorithm suite: DHKEM(X25519, HKDF-SHA256),
|
|
124
|
+
* HKDF-SHA256, and AES-256-GCM. Set both info and additional authenticated data
|
|
125
|
+
* (AAD) to an empty byte string. Then, create a new sender context using the
|
|
126
|
+
* public key and these settings, and encrypt the secret value as one message. Put
|
|
127
|
+
* the 32-byte encapsulated key before the ciphertext and keep the authentication
|
|
128
|
+
* tag at the end of the ciphertext. Encode the combined bytes with standard
|
|
129
|
+
* base64. Send the result as sealedSecretValue: base64(enc || ciphertext)
|
|
130
|
+
*/
|
|
131
|
+
sealedSecretValue: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The name to store the secret value under.
|
|
135
|
+
*/
|
|
136
|
+
secretKey: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface SecretUpdateParams {
|
|
140
|
+
/**
|
|
141
|
+
* The `id` returned by GET /v1/secrets/keypair, identifying the keypair whose
|
|
142
|
+
* public key encrypted the value. Recorded with the secret so decryption stays
|
|
143
|
+
* correct across keypair rotation.
|
|
144
|
+
*/
|
|
145
|
+
keypairId: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The new secret value encrypted with HPKE. In order to seal the secret value
|
|
149
|
+
* before sending, get the project's public key from GET /v1/secrets/keypair.
|
|
150
|
+
* Decode the publicKey using base64 into the raw 32-byte public key. Then, use
|
|
151
|
+
* HPKE Base mode (RFC 9180) with the following algorithm suite: DHKEM(X25519,
|
|
152
|
+
* HKDF-SHA256), HKDF-SHA256, and AES-256-GCM. Set both info and additional
|
|
153
|
+
* authenticated data (AAD) to an empty byte string. Then, create a new sender
|
|
154
|
+
* context using the public key and these settings, and encrypt the secret value as
|
|
155
|
+
* one message. Put the 32-byte encapsulated key before the ciphertext and keep the
|
|
156
|
+
* authentication tag at the end of the ciphertext. Encode the combined bytes with
|
|
157
|
+
* standard base64. Send the result as sealedSecretValue: base64(enc || ciphertext)
|
|
158
|
+
*/
|
|
159
|
+
sealedSecretValue: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface SecretListParams {
|
|
163
|
+
/**
|
|
164
|
+
* Pagination cursor. Pass the nextCursor from the previous response to fetch the
|
|
165
|
+
* next page. Omit to start from the first page.
|
|
166
|
+
*/
|
|
167
|
+
cursor?: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Only return secrets created on or before this timestamp (inclusive). RFC 3339,
|
|
171
|
+
* e.g. 2026-01-20T00:00:00Z.
|
|
172
|
+
*/
|
|
173
|
+
endAt?: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Maximum number of results to return.
|
|
177
|
+
*/
|
|
178
|
+
limit?: number;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Only return secrets created on or after this timestamp (inclusive). RFC 3339,
|
|
182
|
+
* e.g. 2026-01-19T00:00:00Z.
|
|
183
|
+
*/
|
|
184
|
+
startAt?: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export declare namespace Secrets {
|
|
188
|
+
export {
|
|
189
|
+
type Secret as Secret,
|
|
190
|
+
type SecretsKeypair as SecretsKeypair,
|
|
191
|
+
type SecretListResponse as SecretListResponse,
|
|
192
|
+
type SecretCreateParams as SecretCreateParams,
|
|
193
|
+
type SecretUpdateParams as SecretUpdateParams,
|
|
194
|
+
type SecretListParams as SecretListParams,
|
|
195
|
+
};
|
|
196
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.21.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.21.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.21.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|