Skip to content

Commit e4b773f

Browse files
feat: Fix browser pool sdk types
1 parent 8b9c392 commit e4b773f

File tree

5 files changed

+73
-132
lines changed

5 files changed

+73
-132
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 89
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-13214b99e392aab631aa1ca99b6a51a58df81e34156d21b8d639bea779566123.yml
33
openapi_spec_hash: a88d175fc3980de3097ac1411d8dcbff
4-
config_hash: 7225e7b7e4695c81d7be26c7108b5494
4+
config_hash: 179f33af31ece83563163d5b3d751d13

api.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ Methods:
229229
Types:
230230

231231
- <code><a href="./src/resources/browser-pools.ts">BrowserPool</a></code>
232-
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolAcquireRequest</a></code>
233-
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolReleaseRequest</a></code>
234-
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolRequest</a></code>
235-
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolUpdateRequest</a></code>
236232
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolListResponse</a></code>
237233
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolAcquireResponse</a></code>
238234

src/client.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ import { AppListParams, AppListResponse, AppListResponsesOffsetPagination, Apps
2222
import {
2323
BrowserPool,
2424
BrowserPoolAcquireParams,
25-
BrowserPoolAcquireRequest,
2625
BrowserPoolAcquireResponse,
2726
BrowserPoolCreateParams,
2827
BrowserPoolDeleteParams,
2928
BrowserPoolListResponse,
3029
BrowserPoolReleaseParams,
31-
BrowserPoolReleaseRequest,
32-
BrowserPoolRequest,
3330
BrowserPoolUpdateParams,
34-
BrowserPoolUpdateRequest,
3531
BrowserPools,
3632
} from './resources/browser-pools';
3733
import {
@@ -968,10 +964,6 @@ export declare namespace Kernel {
968964
export {
969965
BrowserPools as BrowserPools,
970966
type BrowserPool as BrowserPool,
971-
type BrowserPoolAcquireRequest as BrowserPoolAcquireRequest,
972-
type BrowserPoolReleaseRequest as BrowserPoolReleaseRequest,
973-
type BrowserPoolRequest as BrowserPoolRequest,
974-
type BrowserPoolUpdateRequest as BrowserPoolUpdateRequest,
975967
type BrowserPoolListResponse as BrowserPoolListResponse,
976968
type BrowserPoolAcquireResponse as BrowserPoolAcquireResponse,
977969
type BrowserPoolCreateParams as BrowserPoolCreateParams,

src/resources/browser-pools.ts

Lines changed: 72 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export interface BrowserPool {
162162
/**
163163
* Configuration used to create all browsers in this pool
164164
*/
165-
browser_pool_config: BrowserPoolRequest;
165+
browser_pool_config: BrowserPool.BrowserPoolConfig;
166166

167167
/**
168168
* Timestamp when the browser pool was created
@@ -175,118 +175,79 @@ export interface BrowserPool {
175175
name?: string;
176176
}
177177

178-
/**
179-
* Request body for acquiring a browser from the pool.
180-
*/
181-
export interface BrowserPoolAcquireRequest {
182-
/**
183-
* Maximum number of seconds to wait for a browser to be available. Defaults to the
184-
* calculated time it would take to fill the pool at the currently configured fill
185-
* rate.
186-
*/
187-
acquire_timeout_seconds?: number;
188-
}
189-
190-
/**
191-
* Request body for releasing a browser back to the pool.
192-
*/
193-
export interface BrowserPoolReleaseRequest {
194-
/**
195-
* Browser session ID to release back to the pool
196-
*/
197-
session_id: string;
198-
199-
/**
200-
* Whether to reuse the browser instance or destroy it and create a new one.
201-
* Defaults to true.
202-
*/
203-
reuse?: boolean;
204-
}
205-
206-
/**
207-
* Parameters for creating a browser pool. All browsers in the pool will be created
208-
* with the same configuration.
209-
*/
210-
export interface BrowserPoolRequest {
211-
/**
212-
* Number of browsers to create in the pool
213-
*/
214-
size: number;
215-
216-
/**
217-
* List of browser extensions to load into the session. Provide each by id or name.
218-
*/
219-
extensions?: Array<Shared.BrowserExtension>;
220-
221-
/**
222-
* Percentage of the pool to fill per minute. Defaults to 10%.
223-
*/
224-
fill_rate_per_minute?: number;
225-
226-
/**
227-
* If true, launches the browser using a headless image. Defaults to false.
228-
*/
229-
headless?: boolean;
230-
231-
/**
232-
* If true, launches the browser in kiosk mode to hide address bar and tabs in live
233-
* view.
234-
*/
235-
kiosk_mode?: boolean;
236-
237-
/**
238-
* Optional name for the browser pool. Must be unique within the organization.
239-
*/
240-
name?: string;
241-
242-
/**
243-
* Profile selection for the browser session. Provide either id or name. If
244-
* specified, the matching profile will be loaded into the browser session.
245-
* Profiles must be created beforehand.
246-
*/
247-
profile?: Shared.BrowserProfile;
248-
178+
export namespace BrowserPool {
249179
/**
250-
* Optional proxy to associate to the browser session. Must reference a proxy
251-
* belonging to the caller's org.
252-
*/
253-
proxy_id?: string;
254-
255-
/**
256-
* If true, launches the browser in stealth mode to reduce detection by anti-bot
257-
* mechanisms.
258-
*/
259-
stealth?: boolean;
260-
261-
/**
262-
* Default idle timeout in seconds for browsers acquired from this pool before they
263-
* are destroyed. Defaults to 600 seconds if not specified
264-
*/
265-
timeout_seconds?: number;
266-
267-
/**
268-
* Initial browser window size in pixels with optional refresh rate. If omitted,
269-
* image defaults apply (1920x1080@25). Only specific viewport configurations are
270-
* supported. The server will reject unsupported combinations. Supported
271-
* resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
272-
* 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
273-
* automatically determined from the width and height if they match a supported
274-
* configuration exactly. Note: Higher resolutions may affect the responsiveness of
275-
* live view browser
276-
*/
277-
viewport?: Shared.BrowserViewport;
278-
}
279-
280-
/**
281-
* Parameters for updating a browser pool. All browsers in the pool will be created
282-
* with the same configuration.
283-
*/
284-
export interface BrowserPoolUpdateRequest extends BrowserPoolRequest {
285-
/**
286-
* Whether to discard all idle browsers and rebuild the pool immediately. Defaults
287-
* to false.
180+
* Configuration used to create all browsers in this pool
288181
*/
289-
discard_all_idle?: boolean;
182+
export interface BrowserPoolConfig {
183+
/**
184+
* Number of browsers to create in the pool
185+
*/
186+
size: number;
187+
188+
/**
189+
* List of browser extensions to load into the session. Provide each by id or name.
190+
*/
191+
extensions?: Array<Shared.BrowserExtension>;
192+
193+
/**
194+
* Percentage of the pool to fill per minute. Defaults to 10%.
195+
*/
196+
fill_rate_per_minute?: number;
197+
198+
/**
199+
* If true, launches the browser using a headless image. Defaults to false.
200+
*/
201+
headless?: boolean;
202+
203+
/**
204+
* If true, launches the browser in kiosk mode to hide address bar and tabs in live
205+
* view.
206+
*/
207+
kiosk_mode?: boolean;
208+
209+
/**
210+
* Optional name for the browser pool. Must be unique within the organization.
211+
*/
212+
name?: string;
213+
214+
/**
215+
* Profile selection for the browser session. Provide either id or name. If
216+
* specified, the matching profile will be loaded into the browser session.
217+
* Profiles must be created beforehand.
218+
*/
219+
profile?: Shared.BrowserProfile;
220+
221+
/**
222+
* Optional proxy to associate to the browser session. Must reference a proxy
223+
* belonging to the caller's org.
224+
*/
225+
proxy_id?: string;
226+
227+
/**
228+
* If true, launches the browser in stealth mode to reduce detection by anti-bot
229+
* mechanisms.
230+
*/
231+
stealth?: boolean;
232+
233+
/**
234+
* Default idle timeout in seconds for browsers acquired from this pool before they
235+
* are destroyed. Defaults to 600 seconds if not specified
236+
*/
237+
timeout_seconds?: number;
238+
239+
/**
240+
* Initial browser window size in pixels with optional refresh rate. If omitted,
241+
* image defaults apply (1920x1080@25). Only specific viewport configurations are
242+
* supported. The server will reject unsupported combinations. Supported
243+
* resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
244+
* 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
245+
* automatically determined from the width and height if they match a supported
246+
* configuration exactly. Note: Higher resolutions may affect the responsiveness of
247+
* live view browser
248+
*/
249+
viewport?: Shared.BrowserViewport;
250+
}
290251
}
291252

292253
export type BrowserPoolListResponse = Array<BrowserPool>;
@@ -546,10 +507,6 @@ export interface BrowserPoolReleaseParams {
546507
export declare namespace BrowserPools {
547508
export {
548509
type BrowserPool as BrowserPool,
549-
type BrowserPoolAcquireRequest as BrowserPoolAcquireRequest,
550-
type BrowserPoolReleaseRequest as BrowserPoolReleaseRequest,
551-
type BrowserPoolRequest as BrowserPoolRequest,
552-
type BrowserPoolUpdateRequest as BrowserPoolUpdateRequest,
553510
type BrowserPoolListResponse as BrowserPoolListResponse,
554511
type BrowserPoolAcquireResponse as BrowserPoolAcquireResponse,
555512
type BrowserPoolCreateParams as BrowserPoolCreateParams,

src/resources/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ export {
1111
export {
1212
BrowserPools,
1313
type BrowserPool,
14-
type BrowserPoolAcquireRequest,
15-
type BrowserPoolReleaseRequest,
16-
type BrowserPoolRequest,
17-
type BrowserPoolUpdateRequest,
1814
type BrowserPoolListResponse,
1915
type BrowserPoolAcquireResponse,
2016
type BrowserPoolCreateParams,

0 commit comments

Comments
 (0)