@onkernel/sdk 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +15 -19
  3. package/client.d.mts +8 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +8 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +6 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +6 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/agents/agents.d.mts +10 -0
  13. package/resources/agents/agents.d.mts.map +1 -0
  14. package/resources/agents/agents.d.ts +10 -0
  15. package/resources/agents/agents.d.ts.map +1 -0
  16. package/resources/agents/agents.js +17 -0
  17. package/resources/agents/agents.js.map +1 -0
  18. package/resources/agents/agents.mjs +12 -0
  19. package/resources/agents/agents.mjs.map +1 -0
  20. package/resources/agents/auth/auth.d.mts +392 -0
  21. package/resources/agents/auth/auth.d.mts.map +1 -0
  22. package/resources/agents/auth/auth.d.ts +392 -0
  23. package/resources/agents/auth/auth.d.ts.map +1 -0
  24. package/resources/agents/auth/auth.js +97 -0
  25. package/resources/agents/auth/auth.js.map +1 -0
  26. package/resources/agents/auth/auth.mjs +92 -0
  27. package/resources/agents/auth/auth.mjs.map +1 -0
  28. package/resources/agents/auth/index.d.mts +3 -0
  29. package/resources/agents/auth/index.d.mts.map +1 -0
  30. package/resources/agents/auth/index.d.ts +3 -0
  31. package/resources/agents/auth/index.d.ts.map +1 -0
  32. package/resources/agents/auth/index.js +9 -0
  33. package/resources/agents/auth/index.js.map +1 -0
  34. package/resources/agents/auth/index.mjs +4 -0
  35. package/resources/agents/auth/index.mjs.map +1 -0
  36. package/resources/agents/auth/invocations.d.mts +130 -0
  37. package/resources/agents/auth/invocations.d.mts.map +1 -0
  38. package/resources/agents/auth/invocations.d.ts +130 -0
  39. package/resources/agents/auth/invocations.d.ts.map +1 -0
  40. package/resources/agents/auth/invocations.js +94 -0
  41. package/resources/agents/auth/invocations.js.map +1 -0
  42. package/resources/agents/auth/invocations.mjs +90 -0
  43. package/resources/agents/auth/invocations.mjs.map +1 -0
  44. package/resources/agents/auth.d.mts +2 -0
  45. package/resources/agents/auth.d.mts.map +1 -0
  46. package/resources/agents/auth.d.ts +2 -0
  47. package/resources/agents/auth.d.ts.map +1 -0
  48. package/resources/agents/auth.js +6 -0
  49. package/resources/agents/auth.js.map +1 -0
  50. package/resources/agents/auth.mjs +3 -0
  51. package/resources/agents/auth.mjs.map +1 -0
  52. package/resources/agents/index.d.mts +3 -0
  53. package/resources/agents/index.d.mts.map +1 -0
  54. package/resources/agents/index.d.ts +3 -0
  55. package/resources/agents/index.d.ts.map +1 -0
  56. package/resources/agents/index.js +9 -0
  57. package/resources/agents/index.js.map +1 -0
  58. package/resources/agents/index.mjs +4 -0
  59. package/resources/agents/index.mjs.map +1 -0
  60. package/resources/agents.d.mts +2 -0
  61. package/resources/agents.d.mts.map +1 -0
  62. package/resources/agents.d.ts +2 -0
  63. package/resources/agents.d.ts.map +1 -0
  64. package/resources/agents.js +6 -0
  65. package/resources/agents.js.map +1 -0
  66. package/resources/agents.mjs +3 -0
  67. package/resources/agents.mjs.map +1 -0
  68. package/resources/browser-pools.d.mts +81 -115
  69. package/resources/browser-pools.d.mts.map +1 -1
  70. package/resources/browser-pools.d.ts +81 -115
  71. package/resources/browser-pools.d.ts.map +1 -1
  72. package/resources/browsers/browsers.d.mts +38 -38
  73. package/resources/browsers/browsers.d.mts.map +1 -1
  74. package/resources/browsers/browsers.d.ts +38 -38
  75. package/resources/browsers/browsers.d.ts.map +1 -1
  76. package/resources/browsers/browsers.js +3 -7
  77. package/resources/browsers/browsers.js.map +1 -1
  78. package/resources/browsers/browsers.mjs +3 -7
  79. package/resources/browsers/browsers.mjs.map +1 -1
  80. package/resources/credentials.d.mts +163 -0
  81. package/resources/credentials.d.mts.map +1 -0
  82. package/resources/credentials.d.ts +163 -0
  83. package/resources/credentials.d.ts.map +1 -0
  84. package/resources/credentials.js +82 -0
  85. package/resources/credentials.js.map +1 -0
  86. package/resources/credentials.mjs +78 -0
  87. package/resources/credentials.mjs.map +1 -0
  88. package/resources/index.d.mts +3 -1
  89. package/resources/index.d.mts.map +1 -1
  90. package/resources/index.d.ts +3 -1
  91. package/resources/index.d.ts.map +1 -1
  92. package/resources/index.js +5 -1
  93. package/resources/index.js.map +1 -1
  94. package/resources/index.mjs +2 -0
  95. package/resources/index.mjs.map +1 -1
  96. package/resources/shared.d.mts +5 -5
  97. package/resources/shared.d.ts +5 -5
  98. package/src/client.ts +28 -8
  99. package/src/resources/agents/agents.ts +43 -0
  100. package/src/resources/agents/auth/auth.ts +509 -0
  101. package/src/resources/agents/auth/index.ts +25 -0
  102. package/src/resources/agents/auth/invocations.ts +174 -0
  103. package/src/resources/agents/auth.ts +3 -0
  104. package/src/resources/agents/index.ts +18 -0
  105. package/src/resources/agents.ts +3 -0
  106. package/src/resources/browser-pools.ts +90 -132
  107. package/src/resources/browsers/browsers.ts +38 -38
  108. package/src/resources/credentials.ts +205 -0
  109. package/src/resources/index.ts +11 -4
  110. package/src/resources/shared.ts +5 -5
  111. package/src/version.ts +1 -1
  112. package/version.d.mts +1 -1
  113. package/version.d.ts +1 -1
  114. package/version.js +1 -1
  115. package/version.mjs +1 -1
@@ -0,0 +1,18 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Agents } from './agents';
4
+ export {
5
+ Auth,
6
+ type AgentAuthDiscoverResponse,
7
+ type AgentAuthInvocationResponse,
8
+ type AgentAuthSubmitResponse,
9
+ type AuthAgent,
10
+ type AuthAgentCreateRequest,
11
+ type AuthAgentInvocationCreateRequest,
12
+ type AuthAgentInvocationCreateResponse,
13
+ type DiscoveredField,
14
+ type ReauthResponse,
15
+ type AuthCreateParams,
16
+ type AuthListParams,
17
+ type AuthAgentsOffsetPagination,
18
+ } from './auth/index';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './agents/index';
@@ -162,7 +162,7 @@ export interface BrowserPool {
162
162
  /**
163
163
  * Configuration used to create all browsers in this pool
164
164
  */
165
- browser_pool_config: BrowserPoolRequest;
165
+ browser_pool_config: BrowserPool.BrowserPoolConfig;
166
166
 
167
167
  /**
168
168
  * Timestamp when the browser pool was created
@@ -175,118 +175,79 @@ export interface BrowserPool {
175
175
  name?: string;
176
176
  }
177
177
 
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
-
249
- /**
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 (commonly 1024x768@60). Only specific viewport
270
- * configurations are supported. The server will reject unsupported combinations.
271
- * Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
272
- * 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
273
- * be 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 {
178
+ export namespace BrowserPool {
285
179
  /**
286
- * Whether to discard all idle browsers and rebuild the pool immediately. Defaults
287
- * to true.
180
+ * Configuration used to create all browsers in this pool
288
181
  */
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
+ }
290
251
  }
291
252
 
292
253
  export type BrowserPoolListResponse = Array<BrowserPool>;
@@ -339,7 +300,8 @@ export interface BrowserPoolAcquireResponse {
339
300
  kiosk_mode?: boolean;
340
301
 
341
302
  /**
342
- * Optional persistence configuration for the browser session.
303
+ * @deprecated DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles
304
+ * instead.
343
305
  */
344
306
  persistence?: BrowsersAPI.BrowserPersistence;
345
307
 
@@ -355,11 +317,11 @@ export interface BrowserPoolAcquireResponse {
355
317
 
356
318
  /**
357
319
  * Initial browser window size in pixels with optional refresh rate. If omitted,
358
- * image defaults apply (commonly 1024x768@60). Only specific viewport
359
- * configurations are supported. The server will reject unsupported combinations.
360
- * Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
361
- * 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
362
- * be automatically determined from the width and height if they match a supported
320
+ * image defaults apply (1920x1080@25). Only specific viewport configurations are
321
+ * supported. The server will reject unsupported combinations. Supported
322
+ * resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
323
+ * 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
324
+ * automatically determined from the width and height if they match a supported
363
325
  * configuration exactly. Note: Higher resolutions may affect the responsiveness of
364
326
  * live view browser
365
327
  */
@@ -425,11 +387,11 @@ export interface BrowserPoolCreateParams {
425
387
 
426
388
  /**
427
389
  * Initial browser window size in pixels with optional refresh rate. If omitted,
428
- * image defaults apply (commonly 1024x768@60). Only specific viewport
429
- * configurations are supported. The server will reject unsupported combinations.
430
- * Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
431
- * 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
432
- * be automatically determined from the width and height if they match a supported
390
+ * image defaults apply (1920x1080@25). Only specific viewport configurations are
391
+ * supported. The server will reject unsupported combinations. Supported
392
+ * resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
393
+ * 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
394
+ * automatically determined from the width and height if they match a supported
433
395
  * configuration exactly. Note: Higher resolutions may affect the responsiveness of
434
396
  * live view browser
435
397
  */
@@ -444,7 +406,7 @@ export interface BrowserPoolUpdateParams {
444
406
 
445
407
  /**
446
408
  * Whether to discard all idle browsers and rebuild the pool immediately. Defaults
447
- * to true.
409
+ * to false.
448
410
  */
449
411
  discard_all_idle?: boolean;
450
412
 
@@ -501,11 +463,11 @@ export interface BrowserPoolUpdateParams {
501
463
 
502
464
  /**
503
465
  * Initial browser window size in pixels with optional refresh rate. If omitted,
504
- * image defaults apply (commonly 1024x768@60). Only specific viewport
505
- * configurations are supported. The server will reject unsupported combinations.
506
- * Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
507
- * 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
508
- * be automatically determined from the width and height if they match a supported
466
+ * image defaults apply (1920x1080@25). Only specific viewport configurations are
467
+ * supported. The server will reject unsupported combinations. Supported
468
+ * resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
469
+ * 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
470
+ * automatically determined from the width and height if they match a supported
509
471
  * configuration exactly. Note: Higher resolutions may affect the responsiveness of
510
472
  * live view browser
511
473
  */
@@ -545,10 +507,6 @@ export interface BrowserPoolReleaseParams {
545
507
  export declare namespace BrowserPools {
546
508
  export {
547
509
  type BrowserPool as BrowserPool,
548
- type BrowserPoolAcquireRequest as BrowserPoolAcquireRequest,
549
- type BrowserPoolReleaseRequest as BrowserPoolReleaseRequest,
550
- type BrowserPoolRequest as BrowserPoolRequest,
551
- type BrowserPoolUpdateRequest as BrowserPoolUpdateRequest,
552
510
  type BrowserPoolListResponse as BrowserPoolListResponse,
553
511
  type BrowserPoolAcquireResponse as BrowserPoolAcquireResponse,
554
512
  type BrowserPoolCreateParams as BrowserPoolCreateParams,
@@ -127,14 +127,10 @@ export class Browsers extends APIResource {
127
127
  }
128
128
 
129
129
  /**
130
- * Delete a persistent browser session by its persistent_id.
130
+ * DEPRECATED: Use DELETE /browsers/{id} instead. Delete a persistent browser
131
+ * session by its persistent_id.
131
132
  *
132
- * @example
133
- * ```ts
134
- * await client.browsers.delete({
135
- * persistent_id: 'persistent_id',
136
- * });
137
- * ```
133
+ * @deprecated
138
134
  */
139
135
  delete(params: BrowserDeleteParams, options?: RequestOptions): APIPromise<void> {
140
136
  const { persistent_id } = params;
@@ -192,11 +188,12 @@ export class Browsers extends APIResource {
192
188
  export type BrowserListResponsesOffsetPagination = OffsetPagination<BrowserListResponse>;
193
189
 
194
190
  /**
195
- * Optional persistence configuration for the browser session.
191
+ * @deprecated DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles
192
+ * instead.
196
193
  */
197
194
  export interface BrowserPersistence {
198
195
  /**
199
- * Unique identifier for the persistent browser session.
196
+ * DEPRECATED: Unique identifier for the persistent browser session.
200
197
  */
201
198
  id: string;
202
199
  }
@@ -279,7 +276,8 @@ export interface BrowserCreateResponse {
279
276
  kiosk_mode?: boolean;
280
277
 
281
278
  /**
282
- * Optional persistence configuration for the browser session.
279
+ * @deprecated DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles
280
+ * instead.
283
281
  */
284
282
  persistence?: BrowserPersistence;
285
283
 
@@ -295,11 +293,11 @@ export interface BrowserCreateResponse {
295
293
 
296
294
  /**
297
295
  * Initial browser window size in pixels with optional refresh rate. If omitted,
298
- * image defaults apply (commonly 1024x768@60). Only specific viewport
299
- * configurations are supported. The server will reject unsupported combinations.
300
- * Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
301
- * 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
302
- * be automatically determined from the width and height if they match a supported
296
+ * image defaults apply (1920x1080@25). Only specific viewport configurations are
297
+ * supported. The server will reject unsupported combinations. Supported
298
+ * resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
299
+ * 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
300
+ * automatically determined from the width and height if they match a supported
303
301
  * configuration exactly. Note: Higher resolutions may affect the responsiveness of
304
302
  * live view browser
305
303
  */
@@ -354,7 +352,8 @@ export interface BrowserRetrieveResponse {
354
352
  kiosk_mode?: boolean;
355
353
 
356
354
  /**
357
- * Optional persistence configuration for the browser session.
355
+ * @deprecated DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles
356
+ * instead.
358
357
  */
359
358
  persistence?: BrowserPersistence;
360
359
 
@@ -370,11 +369,11 @@ export interface BrowserRetrieveResponse {
370
369
 
371
370
  /**
372
371
  * Initial browser window size in pixels with optional refresh rate. If omitted,
373
- * image defaults apply (commonly 1024x768@60). Only specific viewport
374
- * configurations are supported. The server will reject unsupported combinations.
375
- * Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
376
- * 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
377
- * be automatically determined from the width and height if they match a supported
372
+ * image defaults apply (1920x1080@25). Only specific viewport configurations are
373
+ * supported. The server will reject unsupported combinations. Supported
374
+ * resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
375
+ * 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
376
+ * automatically determined from the width and height if they match a supported
378
377
  * configuration exactly. Note: Higher resolutions may affect the responsiveness of
379
378
  * live view browser
380
379
  */
@@ -429,7 +428,8 @@ export interface BrowserListResponse {
429
428
  kiosk_mode?: boolean;
430
429
 
431
430
  /**
432
- * Optional persistence configuration for the browser session.
431
+ * @deprecated DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles
432
+ * instead.
433
433
  */
434
434
  persistence?: BrowserPersistence;
435
435
 
@@ -445,11 +445,11 @@ export interface BrowserListResponse {
445
445
 
446
446
  /**
447
447
  * Initial browser window size in pixels with optional refresh rate. If omitted,
448
- * image defaults apply (commonly 1024x768@60). Only specific viewport
449
- * configurations are supported. The server will reject unsupported combinations.
450
- * Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
451
- * 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
452
- * be automatically determined from the width and height if they match a supported
448
+ * image defaults apply (1920x1080@25). Only specific viewport configurations are
449
+ * supported. The server will reject unsupported combinations. Supported
450
+ * resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
451
+ * 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
452
+ * automatically determined from the width and height if they match a supported
453
453
  * configuration exactly. Note: Higher resolutions may affect the responsiveness of
454
454
  * live view browser
455
455
  */
@@ -480,7 +480,8 @@ export interface BrowserCreateParams {
480
480
  kiosk_mode?: boolean;
481
481
 
482
482
  /**
483
- * Optional persistence configuration for the browser session.
483
+ * @deprecated DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles
484
+ * instead.
484
485
  */
485
486
  persistence?: BrowserPersistence;
486
487
 
@@ -505,21 +506,20 @@ export interface BrowserCreateParams {
505
506
 
506
507
  /**
507
508
  * The number of seconds of inactivity before the browser session is terminated.
508
- * Only applicable to non-persistent browsers. Activity includes CDP connections
509
- * and live view connections. Defaults to 60 seconds. Minimum allowed is 10
510
- * seconds. Maximum allowed is 259200 (72 hours). We check for inactivity every 5
511
- * seconds, so the actual timeout behavior you will see is +/- 5 seconds around the
512
- * specified value.
509
+ * Activity includes CDP connections and live view connections. Defaults to 60
510
+ * seconds. Minimum allowed is 10 seconds. Maximum allowed is 259200 (72 hours). We
511
+ * check for inactivity every 5 seconds, so the actual timeout behavior you will
512
+ * see is +/- 5 seconds around the specified value.
513
513
  */
514
514
  timeout_seconds?: number;
515
515
 
516
516
  /**
517
517
  * Initial browser window size in pixels with optional refresh rate. If omitted,
518
- * image defaults apply (commonly 1024x768@60). Only specific viewport
519
- * configurations are supported. The server will reject unsupported combinations.
520
- * Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
521
- * 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
522
- * be automatically determined from the width and height if they match a supported
518
+ * image defaults apply (1920x1080@25). Only specific viewport configurations are
519
+ * supported. The server will reject unsupported combinations. Supported
520
+ * resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
521
+ * 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
522
+ * automatically determined from the width and height if they match a supported
523
523
  * configuration exactly. Note: Higher resolutions may affect the responsiveness of
524
524
  * live view browser
525
525
  */
@@ -0,0 +1,205 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../core/pagination';
6
+ import { buildHeaders } from '../internal/headers';
7
+ import { RequestOptions } from '../internal/request-options';
8
+ import { path } from '../internal/utils/path';
9
+
10
+ export class Credentials extends APIResource {
11
+ /**
12
+ * Create a new credential for storing login information. Values are encrypted at
13
+ * rest.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const credential = await client.credentials.create({
18
+ * domain: 'netflix.com',
19
+ * name: 'my-netflix-login',
20
+ * values: {
21
+ * username: 'user@example.com',
22
+ * password: 'mysecretpassword',
23
+ * },
24
+ * });
25
+ * ```
26
+ */
27
+ create(body: CredentialCreateParams, options?: RequestOptions): APIPromise<Credential> {
28
+ return this._client.post('/credentials', { body, ...options });
29
+ }
30
+
31
+ /**
32
+ * Retrieve a credential by its ID. Credential values are not returned.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const credential = await client.credentials.retrieve('id');
37
+ * ```
38
+ */
39
+ retrieve(id: string, options?: RequestOptions): APIPromise<Credential> {
40
+ return this._client.get(path`/credentials/${id}`, options);
41
+ }
42
+
43
+ /**
44
+ * Update a credential's name or values. Values are encrypted at rest.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const credential = await client.credentials.update('id');
49
+ * ```
50
+ */
51
+ update(id: string, body: CredentialUpdateParams, options?: RequestOptions): APIPromise<Credential> {
52
+ return this._client.patch(path`/credentials/${id}`, { body, ...options });
53
+ }
54
+
55
+ /**
56
+ * List credentials owned by the caller's organization. Credential values are not
57
+ * returned.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * // Automatically fetches more pages as needed.
62
+ * for await (const credential of client.credentials.list()) {
63
+ * // ...
64
+ * }
65
+ * ```
66
+ */
67
+ list(
68
+ query: CredentialListParams | null | undefined = {},
69
+ options?: RequestOptions,
70
+ ): PagePromise<CredentialsOffsetPagination, Credential> {
71
+ return this._client.getAPIList('/credentials', OffsetPagination<Credential>, { query, ...options });
72
+ }
73
+
74
+ /**
75
+ * Delete a credential by its ID.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * await client.credentials.delete('id');
80
+ * ```
81
+ */
82
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
83
+ return this._client.delete(path`/credentials/${id}`, {
84
+ ...options,
85
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
86
+ });
87
+ }
88
+ }
89
+
90
+ export type CredentialsOffsetPagination = OffsetPagination<Credential>;
91
+
92
+ /**
93
+ * Request to create a new credential
94
+ */
95
+ export interface CreateCredentialRequest {
96
+ /**
97
+ * Target domain this credential is for
98
+ */
99
+ domain: string;
100
+
101
+ /**
102
+ * Unique name for the credential within the organization
103
+ */
104
+ name: string;
105
+
106
+ /**
107
+ * Field name to value mapping (e.g., username, password)
108
+ */
109
+ values: { [key: string]: string };
110
+ }
111
+
112
+ /**
113
+ * A stored credential for automatic re-authentication
114
+ */
115
+ export interface Credential {
116
+ /**
117
+ * Unique identifier for the credential
118
+ */
119
+ id: string;
120
+
121
+ /**
122
+ * When the credential was created
123
+ */
124
+ created_at: string;
125
+
126
+ /**
127
+ * Target domain this credential is for
128
+ */
129
+ domain: string;
130
+
131
+ /**
132
+ * Unique name for the credential within the organization
133
+ */
134
+ name: string;
135
+
136
+ /**
137
+ * When the credential was last updated
138
+ */
139
+ updated_at: string;
140
+ }
141
+
142
+ /**
143
+ * Request to update an existing credential
144
+ */
145
+ export interface UpdateCredentialRequest {
146
+ /**
147
+ * New name for the credential
148
+ */
149
+ name?: string;
150
+
151
+ /**
152
+ * Field name to value mapping (e.g., username, password). Replaces all existing
153
+ * values.
154
+ */
155
+ values?: { [key: string]: string };
156
+ }
157
+
158
+ export interface CredentialCreateParams {
159
+ /**
160
+ * Target domain this credential is for
161
+ */
162
+ domain: string;
163
+
164
+ /**
165
+ * Unique name for the credential within the organization
166
+ */
167
+ name: string;
168
+
169
+ /**
170
+ * Field name to value mapping (e.g., username, password)
171
+ */
172
+ values: { [key: string]: string };
173
+ }
174
+
175
+ export interface CredentialUpdateParams {
176
+ /**
177
+ * New name for the credential
178
+ */
179
+ name?: string;
180
+
181
+ /**
182
+ * Field name to value mapping (e.g., username, password). Replaces all existing
183
+ * values.
184
+ */
185
+ values?: { [key: string]: string };
186
+ }
187
+
188
+ export interface CredentialListParams extends OffsetPaginationParams {
189
+ /**
190
+ * Filter by domain
191
+ */
192
+ domain?: string;
193
+ }
194
+
195
+ export declare namespace Credentials {
196
+ export {
197
+ type CreateCredentialRequest as CreateCredentialRequest,
198
+ type Credential as Credential,
199
+ type UpdateCredentialRequest as UpdateCredentialRequest,
200
+ type CredentialsOffsetPagination as CredentialsOffsetPagination,
201
+ type CredentialCreateParams as CredentialCreateParams,
202
+ type CredentialUpdateParams as CredentialUpdateParams,
203
+ type CredentialListParams as CredentialListParams,
204
+ };
205
+ }