Skip to content

Commit c3fe382

Browse files
feat: Align browser-pool timeout/viewport/fill-rate contract with implementation; reject save_changes on update
1 parent 7e2cef3 commit c3fe382

4 files changed

Lines changed: 19 additions & 13 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 120
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-d70be5e703da22000f3f7e76b19d5fa3e3bf8c33be2e9570bfafb5cf9d956a17.yml
3-
openapi_spec_hash: deaa8926543116d1f81d34d1e01e0c0a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-ab4e7c50c41fefd891648fa84ba0258986f192ba1bde9f42cbdf487f64c4cc27.yml
3+
openapi_spec_hash: b4bcd6557f7045ecff30b01e02d28ac5
44
config_hash: 03c7e57f268c750e2415831662e95969

src/resources/browser-pools.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ export namespace BrowserPool {
213213
extensions?: Array<Shared.BrowserExtension>;
214214

215215
/**
216-
* Percentage of the pool to fill per minute. Defaults to 10%.
216+
* Percentage of the pool to fill per minute. Defaults to 10. The cap is 25 for
217+
* most organizations but can be raised per-organization, so only the lower bound
218+
* is enforced here.
217219
*/
218220
fill_rate_per_minute?: number;
219221

@@ -263,7 +265,7 @@ export namespace BrowserPool {
263265

264266
/**
265267
* Default idle timeout in seconds for browsers acquired from this pool before they
266-
* are destroyed. Defaults to 600 seconds if not specified
268+
* are destroyed. Defaults to 600 seconds. Minimum 10, maximum 259200 (72 hours).
267269
*/
268270
timeout_seconds?: number;
269271

@@ -439,7 +441,9 @@ export interface BrowserPoolCreateParams {
439441
extensions?: Array<Shared.BrowserExtension>;
440442

441443
/**
442-
* Percentage of the pool to fill per minute. Defaults to 10%.
444+
* Percentage of the pool to fill per minute. Defaults to 10. The cap is 25 for
445+
* most organizations but can be raised per-organization, so only the lower bound
446+
* is enforced here.
443447
*/
444448
fill_rate_per_minute?: number;
445449

@@ -489,7 +493,7 @@ export interface BrowserPoolCreateParams {
489493

490494
/**
491495
* Default idle timeout in seconds for browsers acquired from this pool before they
492-
* are destroyed. Defaults to 600 seconds if not specified
496+
* are destroyed. Defaults to 600 seconds. Minimum 10, maximum 259200 (72 hours).
493497
*/
494498
timeout_seconds?: number;
495499

@@ -531,7 +535,9 @@ export interface BrowserPoolUpdateParams {
531535
extensions?: Array<Shared.BrowserExtension>;
532536

533537
/**
534-
* Percentage of the pool to fill per minute. Defaults to 10%.
538+
* Percentage of the pool to fill per minute. Defaults to 10. The cap is 25 for
539+
* most organizations but can be raised per-organization, so only the lower bound
540+
* is enforced here.
535541
*/
536542
fill_rate_per_minute?: number;
537543

@@ -588,7 +594,7 @@ export interface BrowserPoolUpdateParams {
588594

589595
/**
590596
* Default idle timeout in seconds for browsers acquired from this pool before they
591-
* are destroyed. Defaults to 600 seconds if not specified
597+
* are destroyed. Defaults to 600 seconds. Minimum 10, maximum 259200 (72 hours).
592598
*/
593599
timeout_seconds?: number;
594600

src/resources/shared.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,18 @@ export interface BrowserProfile {
7979
*/
8080
export interface BrowserViewport {
8181
/**
82-
* Browser window height in pixels.
82+
* Browser window height in pixels. Any positive integer is accepted.
8383
*/
8484
height: number;
8585

8686
/**
87-
* Browser window width in pixels.
87+
* Browser window width in pixels. Any positive integer is accepted.
8888
*/
8989
width: number;
9090

9191
/**
92-
* Display refresh rate in Hz. If omitted, automatically determined from width and
93-
* height.
92+
* Display refresh rate in Hz. Any positive integer is accepted; if omitted,
93+
* automatically determined from width and height.
9494
*/
9595
refresh_rate?: number;
9696
}

tests/api-resources/browser-pools.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('resource browserPools', () => {
3838
proxy_id: 'proxy_id',
3939
start_url: 'https://example.com',
4040
stealth: true,
41-
timeout_seconds: 60,
41+
timeout_seconds: 10,
4242
viewport: {
4343
height: 800,
4444
width: 1280,

0 commit comments

Comments
 (0)