Skip to content

Commit b2391f8

Browse files
feat(api): api update (#142)
1 parent 0e240d7 commit b2391f8

File tree

6 files changed

+81
-3
lines changed

6 files changed

+81
-3
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-396a2b9092f645c5a9e46a1f3be8c2e45ca9ae079e1d39761eb0a73f56e24b15.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-a42637317cf43a3f4dacf3b88ac09b86e41d4dc44c51140aa92cef99b5d0c02a.yml

api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ Types:
4545
- <code><a href="./src/resources/sessions/sessions.ts">Session</a></code>
4646
- <code><a href="./src/resources/sessions/sessions.ts">SessionLiveURLs</a></code>
4747
- <code><a href="./src/resources/sessions/sessions.ts">SessionCreateResponse</a></code>
48+
- <code><a href="./src/resources/sessions/sessions.ts">SessionRetrieveResponse</a></code>
4849
- <code><a href="./src/resources/sessions/sessions.ts">SessionListResponse</a></code>
4950

5051
Methods:
5152

5253
- <code title="post /v1/sessions">client.sessions.<a href="./src/resources/sessions/sessions.ts">create</a>({ ...params }) -> SessionCreateResponse</code>
53-
- <code title="get /v1/sessions/{id}">client.sessions.<a href="./src/resources/sessions/sessions.ts">retrieve</a>(id) -> Session</code>
54+
- <code title="get /v1/sessions/{id}">client.sessions.<a href="./src/resources/sessions/sessions.ts">retrieve</a>(id) -> SessionRetrieveResponse</code>
5455
- <code title="post /v1/sessions/{id}">client.sessions.<a href="./src/resources/sessions/sessions.ts">update</a>(id, { ...params }) -> Session</code>
5556
- <code title="get /v1/sessions">client.sessions.<a href="./src/resources/sessions/sessions.ts">list</a>({ ...params }) -> SessionListResponse</code>
5657
- <code title="get /v1/sessions/{id}/debug">client.sessions.<a href="./src/resources/sessions/sessions.ts">debug</a>(id) -> SessionLiveURLs</code>

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
SessionListParams,
2222
SessionListResponse,
2323
SessionLiveURLs,
24+
SessionRetrieveResponse,
2425
SessionUpdateParams,
2526
Sessions,
2627
} from './resources/sessions/sessions';
@@ -212,6 +213,7 @@ export declare namespace Browserbase {
212213
type Session as Session,
213214
type SessionLiveURLs as SessionLiveURLs,
214215
type SessionCreateResponse as SessionCreateResponse,
216+
type SessionRetrieveResponse as SessionRetrieveResponse,
215217
type SessionListResponse as SessionListResponse,
216218
type SessionCreateParams as SessionCreateParams,
217219
type SessionUpdateParams as SessionUpdateParams,

src/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export {
1414
type Session,
1515
type SessionLiveURLs,
1616
type SessionCreateResponse,
17+
type SessionRetrieveResponse,
1718
type SessionListResponse,
1819
type SessionCreateParams,
1920
type SessionUpdateParams,

src/resources/sessions/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export {
88
type Session,
99
type SessionLiveURLs,
1010
type SessionCreateResponse,
11+
type SessionRetrieveResponse,
1112
type SessionListResponse,
1213
type SessionCreateParams,
1314
type SessionUpdateParams,

src/resources/sessions/sessions.ts

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Sessions extends APIResource {
2828
/**
2929
* Session
3030
*/
31-
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Session> {
31+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<SessionRetrieveResponse> {
3232
return this._client.get(`/v1/sessions/${id}`, options);
3333
}
3434

@@ -217,6 +217,78 @@ export interface SessionCreateResponse {
217217
userMetadata?: Record<string, unknown>;
218218
}
219219

220+
export interface SessionRetrieveResponse {
221+
id: string;
222+
223+
createdAt: string;
224+
225+
expiresAt: string;
226+
227+
/**
228+
* Indicates if the Session was created to be kept alive upon disconnections
229+
*/
230+
keepAlive: boolean;
231+
232+
/**
233+
* The Project ID linked to the Session.
234+
*/
235+
projectId: string;
236+
237+
/**
238+
* Bytes used via the [Proxy](/features/stealth-mode#proxies-and-residential-ips)
239+
*/
240+
proxyBytes: number;
241+
242+
/**
243+
* The region where the Session is running.
244+
*/
245+
region: 'us-west-2' | 'us-east-1' | 'eu-central-1' | 'ap-southeast-1';
246+
247+
startedAt: string;
248+
249+
status: 'RUNNING' | 'ERROR' | 'TIMED_OUT' | 'COMPLETED';
250+
251+
updatedAt: string;
252+
253+
/**
254+
* CPU used by the Session
255+
*/
256+
avgCpuUsage?: number;
257+
258+
/**
259+
* WebSocket URL to connect to the Session.
260+
*/
261+
connectUrl?: string;
262+
263+
/**
264+
* Optional. The Context linked to the Session.
265+
*/
266+
contextId?: string;
267+
268+
endedAt?: string;
269+
270+
/**
271+
* Memory used by the Session
272+
*/
273+
memoryUsage?: number;
274+
275+
/**
276+
* HTTP URL to connect to the Session.
277+
*/
278+
seleniumRemoteUrl?: string;
279+
280+
/**
281+
* Signing key to use when connecting to the Session via HTTP.
282+
*/
283+
signingKey?: string;
284+
285+
/**
286+
* Arbitrary user metadata to attach to the session. To learn more about user
287+
* metadata, see [User Metadata](/features/sessions#user-metadata).
288+
*/
289+
userMetadata?: Record<string, unknown>;
290+
}
291+
220292
export type SessionListResponse = Array<Session>;
221293

222294
export interface SessionCreateParams {
@@ -473,6 +545,7 @@ export declare namespace Sessions {
473545
type Session as Session,
474546
type SessionLiveURLs as SessionLiveURLs,
475547
type SessionCreateResponse as SessionCreateResponse,
548+
type SessionRetrieveResponse as SessionRetrieveResponse,
476549
type SessionListResponse as SessionListResponse,
477550
type SessionCreateParams as SessionCreateParams,
478551
type SessionUpdateParams as SessionUpdateParams,

0 commit comments

Comments
 (0)