Skip to content

Commit 41f382e

Browse files
fix(api): browser pool profile omits save_changes (BrowserPoolProfile)
1 parent 0f08d5a commit 41f382e

3 files changed

Lines changed: 100 additions & 21 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: 124
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-4fb45d71a99648425c84bdc8e5780920105cede4ee2d4eac67276d0609ac1e94.yml
3-
openapi_spec_hash: 1f04cb5b36e92db81dfa264c2a59c32a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-4c243ff089133bd49322d98a6943647589972f71ecadc993fe9e5029972b3995.yml
3+
openapi_spec_hash: a2cb637a19a070d07a1a4343c75444ee
44
config_hash: fb167e754ebb3a14649463725891c9d0

src/resources/browser-pools.ts

Lines changed: 97 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ import { path } from '../internal/utils/path';
1515
*/
1616
export class BrowserPools extends APIResource {
1717
/**
18-
* Create a new browser pool with the specified configuration and size.
18+
* Create a new browser pool with the specified configuration and size. Pooled
19+
* browsers load their profile read-only: any save_changes on the profile is
20+
* ignored (not rejected), so pooled browsers never persist changes back to the
21+
* profile.
1922
*
2023
* @example
2124
* ```ts
@@ -43,7 +46,9 @@ export class BrowserPools extends APIResource {
4346
}
4447

4548
/**
46-
* Updates the configuration used to create browsers in the pool.
49+
* Updates the configuration used to create browsers in the pool. As with creation,
50+
* save_changes on the pool profile is ignored (not rejected); pooled browsers
51+
* never persist changes back to the profile.
4752
*
4853
* @example
4954
* ```ts
@@ -236,11 +241,14 @@ export namespace BrowserPool {
236241
name?: string;
237242

238243
/**
239-
* Profile selection for the browser session. Provide either id or name. If
240-
* specified, the matching profile will be loaded into the browser session.
241-
* Profiles must be created beforehand.
244+
* Profile selection for browsers in a pool. Provide either id or name. The
245+
* matching profile is loaded into every browser in the pool. Profiles must be
246+
* created beforehand. Unlike single browser sessions, pools load the profile
247+
* read-only and never persist changes back to it, so save_changes is omitted here.
248+
* Any save_changes value sent on a pool profile is silently ignored rather than
249+
* rejected, so callers reusing a single-session profile object will not error.
242250
*/
243-
profile?: Shared.BrowserProfile;
251+
profile?: BrowserPoolConfig.Profile;
244252

245253
/**
246254
* Optional proxy to associate to the browser session. Must reference a proxy in
@@ -285,6 +293,29 @@ export namespace BrowserPool {
285293
*/
286294
viewport?: Shared.BrowserViewport;
287295
}
296+
297+
export namespace BrowserPoolConfig {
298+
/**
299+
* Profile selection for browsers in a pool. Provide either id or name. The
300+
* matching profile is loaded into every browser in the pool. Profiles must be
301+
* created beforehand. Unlike single browser sessions, pools load the profile
302+
* read-only and never persist changes back to it, so save_changes is omitted here.
303+
* Any save_changes value sent on a pool profile is silently ignored rather than
304+
* rejected, so callers reusing a single-session profile object will not error.
305+
*/
306+
export interface Profile {
307+
/**
308+
* Profile ID to load for browsers in this pool
309+
*/
310+
id?: string;
311+
312+
/**
313+
* Profile name to load for browsers in this pool (instead of id). Must be 1-255
314+
* characters, using letters, numbers, dots, underscores, or hyphens.
315+
*/
316+
name?: string;
317+
}
318+
}
288319
}
289320

290321
export interface BrowserPoolAcquireResponse {
@@ -464,11 +495,14 @@ export interface BrowserPoolCreateParams {
464495
name?: string;
465496

466497
/**
467-
* Profile selection for the browser session. Provide either id or name. If
468-
* specified, the matching profile will be loaded into the browser session.
469-
* Profiles must be created beforehand.
498+
* Profile selection for browsers in a pool. Provide either id or name. The
499+
* matching profile is loaded into every browser in the pool. Profiles must be
500+
* created beforehand. Unlike single browser sessions, pools load the profile
501+
* read-only and never persist changes back to it, so save_changes is omitted here.
502+
* Any save_changes value sent on a pool profile is silently ignored rather than
503+
* rejected, so callers reusing a single-session profile object will not error.
470504
*/
471-
profile?: Shared.BrowserProfile;
505+
profile?: BrowserPoolCreateParams.Profile;
472506

473507
/**
474508
* Optional proxy to associate to the browser session. Must reference a proxy in
@@ -514,6 +548,29 @@ export interface BrowserPoolCreateParams {
514548
viewport?: Shared.BrowserViewport;
515549
}
516550

551+
export namespace BrowserPoolCreateParams {
552+
/**
553+
* Profile selection for browsers in a pool. Provide either id or name. The
554+
* matching profile is loaded into every browser in the pool. Profiles must be
555+
* created beforehand. Unlike single browser sessions, pools load the profile
556+
* read-only and never persist changes back to it, so save_changes is omitted here.
557+
* Any save_changes value sent on a pool profile is silently ignored rather than
558+
* rejected, so callers reusing a single-session profile object will not error.
559+
*/
560+
export interface Profile {
561+
/**
562+
* Profile ID to load for browsers in this pool
563+
*/
564+
id?: string;
565+
566+
/**
567+
* Profile name to load for browsers in this pool (instead of id). Must be 1-255
568+
* characters, using letters, numbers, dots, underscores, or hyphens.
569+
*/
570+
name?: string;
571+
}
572+
}
573+
517574
export interface BrowserPoolUpdateParams {
518575
/**
519576
* Custom Chrome enterprise policy overrides applied to all browsers in this pool.
@@ -558,11 +615,14 @@ export interface BrowserPoolUpdateParams {
558615
name?: string;
559616

560617
/**
561-
* Profile selection for the browser session. Provide either id or name. If
562-
* specified, the matching profile will be loaded into the browser session.
563-
* Profiles must be created beforehand.
618+
* Profile selection for browsers in a pool. Provide either id or name. The
619+
* matching profile is loaded into every browser in the pool. Profiles must be
620+
* created beforehand. Unlike single browser sessions, pools load the profile
621+
* read-only and never persist changes back to it, so save_changes is omitted here.
622+
* Any save_changes value sent on a pool profile is silently ignored rather than
623+
* rejected, so callers reusing a single-session profile object will not error.
564624
*/
565-
profile?: Shared.BrowserProfile;
625+
profile?: BrowserPoolUpdateParams.Profile;
566626

567627
/**
568628
* Optional proxy to associate to the browser session. Must reference a proxy in
@@ -615,6 +675,29 @@ export interface BrowserPoolUpdateParams {
615675
viewport?: Shared.BrowserViewport;
616676
}
617677

678+
export namespace BrowserPoolUpdateParams {
679+
/**
680+
* Profile selection for browsers in a pool. Provide either id or name. The
681+
* matching profile is loaded into every browser in the pool. Profiles must be
682+
* created beforehand. Unlike single browser sessions, pools load the profile
683+
* read-only and never persist changes back to it, so save_changes is omitted here.
684+
* Any save_changes value sent on a pool profile is silently ignored rather than
685+
* rejected, so callers reusing a single-session profile object will not error.
686+
*/
687+
export interface Profile {
688+
/**
689+
* Profile ID to load for browsers in this pool
690+
*/
691+
id?: string;
692+
693+
/**
694+
* Profile name to load for browsers in this pool (instead of id). Must be 1-255
695+
* characters, using letters, numbers, dots, underscores, or hyphens.
696+
*/
697+
name?: string;
698+
}
699+
}
700+
618701
export interface BrowserPoolListParams extends OffsetPaginationParams {
619702
/**
620703
* Search browser pools by name or ID.

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ describe('resource browserPools', () => {
3030
headless: false,
3131
kiosk_mode: true,
3232
name: 'my-pool',
33-
profile: {
34-
id: 'id',
35-
name: 'name',
36-
save_changes: true,
37-
},
33+
profile: { id: 'id', name: 'name' },
3834
proxy_id: 'proxy_id',
3935
start_url: 'https://example.com',
4036
stealth: true,

0 commit comments

Comments
 (0)