Skip to content

Commit 4175a82

Browse files
feat(api): add browser ttls
1 parent c435fb5 commit 4175a82

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 31
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-e907afeabfeea49dedd783112ac3fd29267bc86f3d594f89ba9a2abf2bcbc9d8.yml
3-
openapi_spec_hash: 060ca6288c1a09b6d1bdf207a0011165
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-6f4aab5f0db80d6ce30ef40274eee347cce0a9465e7f1e5077f8f4a085251ddf.yml
3+
openapi_spec_hash: 8e83254243d1620b80a0dc8aa212ee0d
44
config_hash: f67e4b33b2fb30c1405ee2fff8096320

src/resources/browsers/browsers.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,26 @@ export interface BrowserCreateResponse {
129129
*/
130130
cdp_ws_url: string;
131131

132+
/**
133+
* Indicates whether the browser session is headless.
134+
*/
135+
headless: boolean;
136+
132137
/**
133138
* Unique identifier for the browser session
134139
*/
135140
session_id: string;
136141

142+
/**
143+
* Indicates whether the browser session is stealth.
144+
*/
145+
stealth: boolean;
146+
147+
/**
148+
* The number of seconds of inactivity before the browser session is terminated.
149+
*/
150+
timeout_seconds: number;
151+
137152
/**
138153
* Remote URL for live viewing the browser session. Only available for non-headless
139154
* browsers.
@@ -152,11 +167,26 @@ export interface BrowserRetrieveResponse {
152167
*/
153168
cdp_ws_url: string;
154169

170+
/**
171+
* Indicates whether the browser session is headless.
172+
*/
173+
headless: boolean;
174+
155175
/**
156176
* Unique identifier for the browser session
157177
*/
158178
session_id: string;
159179

180+
/**
181+
* Indicates whether the browser session is stealth.
182+
*/
183+
stealth: boolean;
184+
185+
/**
186+
* The number of seconds of inactivity before the browser session is terminated.
187+
*/
188+
timeout_seconds: number;
189+
160190
/**
161191
* Remote URL for live viewing the browser session. Only available for non-headless
162192
* browsers.
@@ -178,11 +208,26 @@ export namespace BrowserListResponse {
178208
*/
179209
cdp_ws_url: string;
180210

211+
/**
212+
* Indicates whether the browser session is headless.
213+
*/
214+
headless: boolean;
215+
181216
/**
182217
* Unique identifier for the browser session
183218
*/
184219
session_id: string;
185220

221+
/**
222+
* Indicates whether the browser session is stealth.
223+
*/
224+
stealth: boolean;
225+
226+
/**
227+
* The number of seconds of inactivity before the browser session is terminated.
228+
*/
229+
timeout_seconds: number;
230+
186231
/**
187232
* Remote URL for live viewing the browser session. Only available for non-headless
188233
* browsers.
@@ -218,6 +263,13 @@ export interface BrowserCreateParams {
218263
* mechanisms.
219264
*/
220265
stealth?: boolean;
266+
267+
/**
268+
* The number of seconds of inactivity before the browser session is terminated.
269+
* Only applicable to non-persistent browsers. Activity includes CDP connections
270+
* and live view connections. Defaults to 60 seconds.
271+
*/
272+
timeout_seconds?: number;
221273
}
222274

223275
export interface BrowserDeleteParams {

tests/api-resources/browsers/browsers.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('resource browsers', () => {
3030
invocation_id: 'rr33xuugxj9h0bkf1rdt2bet',
3131
persistence: { id: 'my-awesome-browser-for-user-1234' },
3232
stealth: true,
33+
timeout_seconds: 0,
3334
},
3435
{ path: '/_stainless_unknown_path' },
3536
),

0 commit comments

Comments
 (0)