Skip to content

Commit cfc4539

Browse files
feat: Make the browser pool OpenAPI contract truthful
1 parent dd94a68 commit cfc4539

2 files changed

Lines changed: 42 additions & 42 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: 127
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-b20fcf2fc1cdb91b51ffd354adcd12d63b950ea98b69e13bee6a78a58498c2cd.yml
3-
openapi_spec_hash: bc8b527a963dd2c2d74b6f9e6ca56652
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-d7ab1ecb886cb7f86e7ce0926207db423a6650e8e12e7283a71f8682fbb472ae.yml
3+
openapi_spec_hash: 9323b0ba38d2d50b8506be4d7401c04d
44
config_hash: 77ee715aa17061166f9a02b264a21b8d

src/resources/browser-pools.ts

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export namespace BrowserPool {
216216
*/
217217
export interface BrowserPoolConfig {
218218
/**
219-
* Number of browsers to maintain in the pool. The maximum size is determined by
219+
* Number of browsers maintained in the pool. The maximum size is determined by
220220
* your organization's pooled sessions limit (the sum of all pool sizes cannot
221221
* exceed your limit).
222222
*/
@@ -226,7 +226,8 @@ export namespace BrowserPool {
226226
* Custom Chrome enterprise policy overrides applied to all browsers in this pool.
227227
* Keys are Chrome enterprise policy names; values must match their expected types.
228228
* Blocked: kernel-managed policies (extensions, proxy, CDP/automation). See
229-
* https://chromeenterprise.google/policies/
229+
* https://chromeenterprise.google/policies/ The serialized JSON payload is capped
230+
* at 5 MiB.
230231
*/
231232
chrome_policy?: { [key: string]: unknown };
232233

@@ -236,14 +237,13 @@ export namespace BrowserPool {
236237
extensions?: Array<Shared.BrowserExtension>;
237238

238239
/**
239-
* Percentage of the pool to fill per minute. Defaults to 10. The cap is 25 for
240-
* most organizations but can be raised per-organization, so only the lower bound
241-
* is enforced here.
240+
* Percentage of the pool to fill per minute. The cap is 25 for most organizations
241+
* but can be raised per-organization, so only the lower bound is enforced here.
242242
*/
243243
fill_rate_per_minute?: number;
244244

245245
/**
246-
* If true, launches the browser using a headless image. Defaults to false.
246+
* If true, launches the browser using a headless image.
247247
*/
248248
headless?: boolean;
249249

@@ -268,8 +268,8 @@ export namespace BrowserPool {
268268
profile?: BrowserPoolConfig.Profile;
269269

270270
/**
271-
* Optional proxy to associate to the browser session. Must reference a proxy in
272-
* the same project as the browser session.
271+
* Optional proxy associated to the browser session. References a proxy in the same
272+
* project as the browser session.
273273
*/
274274
proxy_id?: string;
275275

@@ -297,7 +297,7 @@ export namespace BrowserPool {
297297

298298
/**
299299
* Default idle timeout in seconds for browsers acquired from this pool before they
300-
* are destroyed. Defaults to 600 seconds. Minimum 10, maximum 259200 (72 hours).
300+
* are destroyed. Minimum 10, maximum 259200 (72 hours).
301301
*/
302302
timeout_seconds?: number;
303303

@@ -485,7 +485,8 @@ export interface BrowserPoolCreateParams {
485485
* Custom Chrome enterprise policy overrides applied to all browsers in this pool.
486486
* Keys are Chrome enterprise policy names; values must match their expected types.
487487
* Blocked: kernel-managed policies (extensions, proxy, CDP/automation). See
488-
* https://chromeenterprise.google/policies/
488+
* https://chromeenterprise.google/policies/ The serialized JSON payload is capped
489+
* at 5 MiB.
489490
*/
490491
chrome_policy?: { [key: string]: unknown };
491492

@@ -508,7 +509,7 @@ export interface BrowserPoolCreateParams {
508509

509510
/**
510511
* If true, launches the browser in kiosk mode to hide address bar and tabs in live
511-
* view.
512+
* view. Defaults to false.
512513
*/
513514
kiosk_mode?: boolean;
514515

@@ -550,7 +551,7 @@ export interface BrowserPoolCreateParams {
550551

551552
/**
552553
* If true, launches the browser in stealth mode to reduce detection by anti-bot
553-
* mechanisms.
554+
* mechanisms. Defaults to false.
554555
*/
555556
stealth?: boolean;
556557

@@ -601,10 +602,12 @@ export namespace BrowserPoolCreateParams {
601602

602603
export interface BrowserPoolUpdateParams {
603604
/**
604-
* Custom Chrome enterprise policy overrides applied to all browsers in this pool.
605-
* Keys are Chrome enterprise policy names; values must match their expected types.
605+
* If provided, replaces the custom Chrome enterprise policy overrides applied to
606+
* all browsers in this pool. Empty object clears any previously-set policy. Keys
607+
* are Chrome enterprise policy names; values must match their expected types.
606608
* Blocked: kernel-managed policies (extensions, proxy, CDP/automation). See
607-
* https://chromeenterprise.google/policies/
609+
* https://chromeenterprise.google/policies/ The serialized JSON payload is capped
610+
* at 5 MiB.
608611
*/
609612
chrome_policy?: { [key: string]: unknown };
610613

@@ -619,30 +622,31 @@ export interface BrowserPoolUpdateParams {
619622
discard_all_idle?: boolean;
620623

621624
/**
622-
* List of browser extensions to load into the session. Provide each by id or name.
625+
* If provided, replaces the extension list. Empty array clears all
626+
* previously-selected extensions. Omit this field to leave extensions unchanged.
623627
*/
624628
extensions?: Array<Shared.BrowserExtension>;
625629

626630
/**
627-
* Percentage of the pool to fill per minute. Defaults to 10. The cap is 25 for
628-
* most organizations but can be raised per-organization, so only the lower bound
629-
* is enforced here.
631+
* If provided, replaces the percentage of the pool to fill per minute. The cap is
632+
* 25 for most organizations but can be raised per-organization, so only the lower
633+
* bound is enforced here.
630634
*/
631635
fill_rate_per_minute?: number;
632636

633637
/**
634-
* If true, launches the browser using a headless image. Defaults to false.
638+
* If provided, replaces whether browsers launch using a headless image.
635639
*/
636640
headless?: boolean;
637641

638642
/**
639-
* If true, launches the browser in kiosk mode to hide address bar and tabs in live
640-
* view.
643+
* If provided, replaces whether browsers launch in kiosk mode.
641644
*/
642645
kiosk_mode?: boolean;
643646

644647
/**
645-
* Optional name for the browser pool. Must be unique within the project.
648+
* If provided, replaces the pool name. Empty string is a no-op; the pool name
649+
* cannot be cleared or reset to empty once assigned.
646650
*/
647651
name?: string;
648652

@@ -656,43 +660,39 @@ export interface BrowserPoolUpdateParams {
656660
profile?: BrowserPoolUpdateParams.Profile;
657661

658662
/**
659-
* Optional proxy to associate to the browser session. Must reference a proxy in
660-
* the same project as the browser session.
663+
* Empty string clears the previously-selected proxy. Omit this field to leave the
664+
* proxy unchanged.
661665
*/
662666
proxy_id?: string;
663667

664668
/**
665-
* When true, flush idle browsers when the profile the pool uses is updated, so
666-
* pool browsers pick up the latest profile data. Requires a profile to be set on
667-
* the pool.
669+
* If provided, replaces whether idle browsers are flushed when the profile the
670+
* pool uses is updated. Requires a profile to be set on the pool.
668671
*/
669672
refresh_on_profile_update?: boolean;
670673

671674
/**
672-
* Number of browsers to maintain in the pool. The maximum size is determined by
673-
* your organization's pooled sessions limit (the sum of all pool sizes cannot
674-
* exceed your limit).
675+
* If provided, replaces the number of browsers to maintain in the pool. The
676+
* maximum size is determined by your organization's pooled sessions limit (the sum
677+
* of all pool sizes cannot exceed your limit).
675678
*/
676679
size?: number;
677680

678681
/**
679-
* Optional URL to navigate to when a new browser is warmed into the pool.
680-
* Best-effort: failures to navigate do not fail pool fill. Only applied to
681-
* newly-warmed browsers; browsers reused via release/acquire keep whatever URL the
682-
* previous lease left them on. Accepts any URL Chromium can resolve, including
683-
* chrome:// pages.
682+
* If provided, replaces the URL to navigate to when a new browser is warmed into
683+
* the pool. Empty string clears the previously-set URL. Omit this field to leave
684+
* it unchanged.
684685
*/
685686
start_url?: string;
686687

687688
/**
688-
* If true, launches the browser in stealth mode to reduce detection by anti-bot
689-
* mechanisms.
689+
* If provided, replaces whether browsers launch in stealth mode.
690690
*/
691691
stealth?: boolean;
692692

693693
/**
694-
* Default idle timeout in seconds for browsers acquired from this pool before they
695-
* are destroyed. Defaults to 600 seconds. Minimum 10, maximum 259200 (72 hours).
694+
* If provided, replaces the default idle timeout in seconds for browsers acquired
695+
* from this pool before they are destroyed. Minimum 10, maximum 259200 (72 hours).
696696
*/
697697
timeout_seconds?: number;
698698

0 commit comments

Comments
 (0)