@onkernel/sdk 0.88.0 → 0.91.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.
- package/CHANGELOG.md +26 -0
- package/client.d.mts +9 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -3
- package/client.d.ts.map +1 -1
- package/client.js +9 -1
- package/client.js.map +1 -1
- package/client.mjs +9 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/auth/connections.d.mts +42 -0
- package/resources/auth/connections.d.mts.map +1 -1
- package/resources/auth/connections.d.ts +42 -0
- package/resources/auth/connections.d.ts.map +1 -1
- package/resources/browser-pools.d.mts +44 -0
- package/resources/browser-pools.d.mts.map +1 -1
- package/resources/browser-pools.d.ts +44 -0
- package/resources/browser-pools.d.ts.map +1 -1
- package/resources/browsers/browsers.d.mts +109 -1
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +109 -1
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +1 -1
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +1 -1
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs.map +1 -1
- package/resources/browsers/telemetry.d.mts +1 -1
- package/resources/browsers/telemetry.d.ts +1 -1
- package/resources/browsers/telemetry.js +1 -1
- package/resources/browsers/telemetry.mjs +1 -1
- package/resources/credential-providers.d.mts +8 -4
- package/resources/credential-providers.d.mts.map +1 -1
- package/resources/credential-providers.d.ts +8 -4
- package/resources/credential-providers.d.ts.map +1 -1
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invocations.d.mts +13 -0
- package/resources/invocations.d.mts.map +1 -1
- package/resources/invocations.d.ts +13 -0
- package/resources/invocations.d.ts.map +1 -1
- package/resources/organization/limits.d.mts +18 -3
- package/resources/organization/limits.d.mts.map +1 -1
- package/resources/organization/limits.d.ts +18 -3
- package/resources/organization/limits.d.ts.map +1 -1
- package/resources/organization/limits.js +1 -3
- package/resources/organization/limits.js.map +1 -1
- package/resources/organization/limits.mjs +1 -3
- package/resources/organization/limits.mjs.map +1 -1
- package/resources/projects/limits.d.mts +4 -4
- package/resources/projects/limits.d.mts.map +1 -1
- package/resources/projects/limits.d.ts +4 -4
- package/resources/projects/limits.d.ts.map +1 -1
- package/resources/projects/limits.js +6 -6
- package/resources/projects/limits.js.map +1 -1
- package/resources/projects/limits.mjs +6 -6
- package/resources/projects/limits.mjs.map +1 -1
- package/resources/projects/projects.d.mts +12 -10
- package/resources/projects/projects.d.mts.map +1 -1
- package/resources/projects/projects.d.ts +12 -10
- package/resources/projects/projects.d.ts.map +1 -1
- package/resources/projects/projects.js +11 -9
- package/resources/projects/projects.js.map +1 -1
- package/resources/projects/projects.mjs +11 -9
- package/resources/projects/projects.mjs.map +1 -1
- package/resources/telemetry/destinations.d.mts +138 -0
- package/resources/telemetry/destinations.d.mts.map +1 -0
- package/resources/telemetry/destinations.d.ts +138 -0
- package/resources/telemetry/destinations.d.ts.map +1 -0
- package/resources/telemetry/destinations.js +63 -0
- package/resources/telemetry/destinations.js.map +1 -0
- package/resources/telemetry/destinations.mjs +59 -0
- package/resources/telemetry/destinations.mjs.map +1 -0
- package/resources/telemetry/index.d.mts +3 -0
- package/resources/telemetry/index.d.mts.map +1 -0
- package/resources/telemetry/index.d.ts +3 -0
- package/resources/telemetry/index.d.ts.map +1 -0
- package/resources/telemetry/index.js +9 -0
- package/resources/telemetry/index.js.map +1 -0
- package/resources/telemetry/index.mjs +4 -0
- package/resources/telemetry/index.mjs.map +1 -0
- package/resources/telemetry/telemetry.d.mts +10 -0
- package/resources/telemetry/telemetry.d.mts.map +1 -0
- package/resources/telemetry/telemetry.d.ts +10 -0
- package/resources/telemetry/telemetry.d.ts.map +1 -0
- package/resources/telemetry/telemetry.js +17 -0
- package/resources/telemetry/telemetry.js.map +1 -0
- package/resources/telemetry/telemetry.mjs +12 -0
- package/resources/telemetry/telemetry.mjs.map +1 -0
- package/resources/telemetry.d.mts +2 -0
- package/resources/telemetry.d.mts.map +1 -0
- package/resources/telemetry.d.ts +2 -0
- package/resources/telemetry.d.ts.map +1 -0
- package/resources/telemetry.js +6 -0
- package/resources/telemetry.js.map +1 -0
- package/resources/telemetry.mjs +3 -0
- package/resources/telemetry.mjs.map +1 -0
- package/src/client.ts +20 -0
- package/src/resources/auth/connections.ts +72 -0
- package/src/resources/browser-pools.ts +53 -0
- package/src/resources/browsers/browsers.ts +130 -0
- package/src/resources/browsers/index.ts +3 -0
- package/src/resources/browsers/telemetry.ts +1 -1
- package/src/resources/credential-providers.ts +8 -4
- package/src/resources/index.ts +4 -0
- package/src/resources/invocations.ts +16 -0
- package/src/resources/organization/limits.ts +21 -3
- package/src/resources/projects/limits.ts +6 -6
- package/src/resources/projects/projects.ts +15 -13
- package/src/resources/telemetry/destinations.ts +188 -0
- package/src/resources/telemetry/index.ts +11 -0
- package/src/resources/telemetry/telemetry.ts +29 -0
- package/src/resources/telemetry.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/client.ts
CHANGED
|
@@ -153,6 +153,9 @@ import {
|
|
|
153
153
|
BrowserListResponse,
|
|
154
154
|
BrowserListResponsesOffsetPagination,
|
|
155
155
|
BrowserLoadExtensionsParams,
|
|
156
|
+
BrowserMemory,
|
|
157
|
+
BrowserMemoryRequest,
|
|
158
|
+
BrowserNetworkConfig,
|
|
156
159
|
BrowserPoolRef,
|
|
157
160
|
BrowserProxy,
|
|
158
161
|
BrowserProxyConfig,
|
|
@@ -177,6 +180,7 @@ import {
|
|
|
177
180
|
ProjectsOffsetPagination,
|
|
178
181
|
UpdateProjectRequest,
|
|
179
182
|
} from './resources/projects/projects';
|
|
183
|
+
import { Telemetry } from './resources/telemetry/telemetry';
|
|
180
184
|
import { type Fetch } from './internal/builtin-types';
|
|
181
185
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
182
186
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
@@ -204,6 +208,8 @@ export interface ClientOptions {
|
|
|
204
208
|
|
|
205
209
|
projectID?: string | null | undefined;
|
|
206
210
|
|
|
211
|
+
project?: string | null | undefined;
|
|
212
|
+
|
|
207
213
|
/**
|
|
208
214
|
* Specifies the environment to use for the API.
|
|
209
215
|
*
|
|
@@ -288,6 +294,7 @@ export interface ClientOptions {
|
|
|
288
294
|
export class Kernel {
|
|
289
295
|
apiKey: string;
|
|
290
296
|
projectID: string | null;
|
|
297
|
+
project: string | null;
|
|
291
298
|
|
|
292
299
|
baseURL: string;
|
|
293
300
|
maxRetries: number;
|
|
@@ -308,6 +315,7 @@ export class Kernel {
|
|
|
308
315
|
*
|
|
309
316
|
* @param {string | undefined} [opts.apiKey=process.env['KERNEL_API_KEY'] ?? undefined]
|
|
310
317
|
* @param {string | null | undefined} [opts.projectID]
|
|
318
|
+
* @param {string | null | undefined} [opts.project]
|
|
311
319
|
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
|
312
320
|
* @param {string} [opts.baseURL=process.env['KERNEL_BASE_URL'] ?? https://api.onkernel.com/] - Override the default base URL for the API.
|
|
313
321
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
@@ -321,6 +329,7 @@ export class Kernel {
|
|
|
321
329
|
baseURL = readEnv('KERNEL_BASE_URL'),
|
|
322
330
|
apiKey = readEnv('KERNEL_API_KEY'),
|
|
323
331
|
projectID = null,
|
|
332
|
+
project = null,
|
|
324
333
|
...opts
|
|
325
334
|
}: ClientOptions = {}) {
|
|
326
335
|
// Check for Bun runtime in a way that avoids type errors if Bun is not defined
|
|
@@ -344,6 +353,7 @@ export class Kernel {
|
|
|
344
353
|
const options: ClientOptions = {
|
|
345
354
|
apiKey,
|
|
346
355
|
projectID,
|
|
356
|
+
project,
|
|
347
357
|
...opts,
|
|
348
358
|
baseURL,
|
|
349
359
|
environment: opts.environment ?? 'production',
|
|
@@ -392,6 +402,7 @@ export class Kernel {
|
|
|
392
402
|
|
|
393
403
|
this.apiKey = apiKey;
|
|
394
404
|
this.projectID = projectID;
|
|
405
|
+
this.project = project;
|
|
395
406
|
}
|
|
396
407
|
|
|
397
408
|
/**
|
|
@@ -410,6 +421,7 @@ export class Kernel {
|
|
|
410
421
|
fetchOptions: this.fetchOptions,
|
|
411
422
|
apiKey: this.apiKey,
|
|
412
423
|
projectID: this.projectID,
|
|
424
|
+
project: this.project,
|
|
413
425
|
...options,
|
|
414
426
|
});
|
|
415
427
|
client.browserRouteCache = this.browserRouteCache;
|
|
@@ -887,6 +899,7 @@ export class Kernel {
|
|
|
887
899
|
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
|
|
888
900
|
...getPlatformHeaders(),
|
|
889
901
|
'X-Kernel-Project-Id': this.projectID,
|
|
902
|
+
'X-Kernel-Project': this.project,
|
|
890
903
|
},
|
|
891
904
|
await this.authHeaders(options),
|
|
892
905
|
this._options.defaultHeaders,
|
|
@@ -1008,6 +1021,7 @@ export class Kernel {
|
|
|
1008
1021
|
*/
|
|
1009
1022
|
profiles: API.Profiles = new API.Profiles(this);
|
|
1010
1023
|
auth: API.Auth = new API.Auth(this);
|
|
1024
|
+
telemetry: API.Telemetry = new API.Telemetry(this);
|
|
1011
1025
|
/**
|
|
1012
1026
|
* Create and manage proxy configurations for routing browser traffic.
|
|
1013
1027
|
*/
|
|
@@ -1052,6 +1066,7 @@ Kernel.Invocations = Invocations;
|
|
|
1052
1066
|
Kernel.Browsers = Browsers;
|
|
1053
1067
|
Kernel.Profiles = Profiles;
|
|
1054
1068
|
Kernel.Auth = Auth;
|
|
1069
|
+
Kernel.Telemetry = Telemetry;
|
|
1055
1070
|
Kernel.Proxies = Proxies;
|
|
1056
1071
|
Kernel.Extensions = Extensions;
|
|
1057
1072
|
Kernel.BrowserPools = BrowserPools;
|
|
@@ -1115,6 +1130,9 @@ export declare namespace Kernel {
|
|
|
1115
1130
|
|
|
1116
1131
|
export {
|
|
1117
1132
|
Browsers as Browsers,
|
|
1133
|
+
type BrowserMemory as BrowserMemory,
|
|
1134
|
+
type BrowserMemoryRequest as BrowserMemoryRequest,
|
|
1135
|
+
type BrowserNetworkConfig as BrowserNetworkConfig,
|
|
1118
1136
|
type BrowserPoolRef as BrowserPoolRef,
|
|
1119
1137
|
type BrowserProxy as BrowserProxy,
|
|
1120
1138
|
type BrowserProxyConfig as BrowserProxyConfig,
|
|
@@ -1146,6 +1164,8 @@ export declare namespace Kernel {
|
|
|
1146
1164
|
|
|
1147
1165
|
export { Auth as Auth };
|
|
1148
1166
|
|
|
1167
|
+
export { Telemetry as Telemetry };
|
|
1168
|
+
|
|
1149
1169
|
export {
|
|
1150
1170
|
Proxies as Proxies,
|
|
1151
1171
|
type ProxyCreateResponse as ProxyCreateResponse,
|
|
@@ -648,11 +648,42 @@ export namespace ManagedAuth {
|
|
|
648
648
|
| 'account'
|
|
649
649
|
| 'other';
|
|
650
650
|
|
|
651
|
+
/**
|
|
652
|
+
* Context captured for a choice.
|
|
653
|
+
*/
|
|
654
|
+
context?: string | null;
|
|
655
|
+
|
|
651
656
|
/**
|
|
652
657
|
* Additional context for the choice.
|
|
653
658
|
*/
|
|
654
659
|
description?: string | null;
|
|
655
660
|
|
|
661
|
+
/**
|
|
662
|
+
* Display text captured for a choice.
|
|
663
|
+
*/
|
|
664
|
+
display_text?: string | null;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Masked phone number or email address shown for an MFA choice.
|
|
668
|
+
*/
|
|
669
|
+
masked_destination?: string | null;
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Semantic MFA method. Choice id remains the stable identity of the exact option
|
|
673
|
+
* selected.
|
|
674
|
+
*/
|
|
675
|
+
mfa_type?:
|
|
676
|
+
| 'sms'
|
|
677
|
+
| 'call'
|
|
678
|
+
| 'email'
|
|
679
|
+
| 'totp'
|
|
680
|
+
| 'push'
|
|
681
|
+
| 'password'
|
|
682
|
+
| 'passkey'
|
|
683
|
+
| 'switch'
|
|
684
|
+
| 'other'
|
|
685
|
+
| null;
|
|
686
|
+
|
|
656
687
|
/**
|
|
657
688
|
* Selector for the visible choice, when available.
|
|
658
689
|
*/
|
|
@@ -754,6 +785,11 @@ export namespace ManagedAuth {
|
|
|
754
785
|
*/
|
|
755
786
|
type: 'identifier' | 'password' | 'code' | 'totp_code' | 'totp_secret' | 'text';
|
|
756
787
|
|
|
788
|
+
/**
|
|
789
|
+
* Context shown near the field, including a masked code destination.
|
|
790
|
+
*/
|
|
791
|
+
hint?: string;
|
|
792
|
+
|
|
757
793
|
/**
|
|
758
794
|
* Human-readable label shown to the user.
|
|
759
795
|
*/
|
|
@@ -1697,11 +1733,42 @@ export namespace ConnectionFollowResponse {
|
|
|
1697
1733
|
| 'account'
|
|
1698
1734
|
| 'other';
|
|
1699
1735
|
|
|
1736
|
+
/**
|
|
1737
|
+
* Context captured for a choice.
|
|
1738
|
+
*/
|
|
1739
|
+
context?: string | null;
|
|
1740
|
+
|
|
1700
1741
|
/**
|
|
1701
1742
|
* Additional context for the choice.
|
|
1702
1743
|
*/
|
|
1703
1744
|
description?: string | null;
|
|
1704
1745
|
|
|
1746
|
+
/**
|
|
1747
|
+
* Display text captured for a choice.
|
|
1748
|
+
*/
|
|
1749
|
+
display_text?: string | null;
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Masked phone number or email address shown for an MFA choice.
|
|
1753
|
+
*/
|
|
1754
|
+
masked_destination?: string | null;
|
|
1755
|
+
|
|
1756
|
+
/**
|
|
1757
|
+
* Semantic MFA method. Choice id remains the stable identity of the exact option
|
|
1758
|
+
* selected.
|
|
1759
|
+
*/
|
|
1760
|
+
mfa_type?:
|
|
1761
|
+
| 'sms'
|
|
1762
|
+
| 'call'
|
|
1763
|
+
| 'email'
|
|
1764
|
+
| 'totp'
|
|
1765
|
+
| 'push'
|
|
1766
|
+
| 'password'
|
|
1767
|
+
| 'passkey'
|
|
1768
|
+
| 'switch'
|
|
1769
|
+
| 'other'
|
|
1770
|
+
| null;
|
|
1771
|
+
|
|
1705
1772
|
/**
|
|
1706
1773
|
* Selector for the visible choice, when available.
|
|
1707
1774
|
*/
|
|
@@ -1774,6 +1841,11 @@ export namespace ConnectionFollowResponse {
|
|
|
1774
1841
|
*/
|
|
1775
1842
|
type: 'identifier' | 'password' | 'code' | 'totp_code' | 'totp_secret' | 'text';
|
|
1776
1843
|
|
|
1844
|
+
/**
|
|
1845
|
+
* Context shown near the field, including a masked code destination.
|
|
1846
|
+
*/
|
|
1847
|
+
hint?: string;
|
|
1848
|
+
|
|
1777
1849
|
/**
|
|
1778
1850
|
* Human-readable label shown to the user.
|
|
1779
1851
|
*/
|
|
@@ -196,6 +196,11 @@ export interface BrowserPool {
|
|
|
196
196
|
*/
|
|
197
197
|
extension_ids: Array<string>;
|
|
198
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Geographic region of the browser pool. Fixed once the pool is created.
|
|
201
|
+
*/
|
|
202
|
+
region: 'us-east' | 'eu-west';
|
|
203
|
+
|
|
199
204
|
/**
|
|
200
205
|
* Browser pool name, if set
|
|
201
206
|
*/
|
|
@@ -258,6 +263,12 @@ export namespace BrowserPool {
|
|
|
258
263
|
*/
|
|
259
264
|
name?: string;
|
|
260
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Network configuration applied to browsers in this pool, if any. Omitted when the
|
|
268
|
+
* pool has no network configuration.
|
|
269
|
+
*/
|
|
270
|
+
network?: BrowsersAPI.BrowserNetworkConfig;
|
|
271
|
+
|
|
261
272
|
/**
|
|
262
273
|
* Profile configuration for browsers in a pool. Provide either id or name.
|
|
263
274
|
* Profiles must be created beforehand. Unlike single browser sessions, pools load
|
|
@@ -363,6 +374,16 @@ export interface BrowserPoolAcquireResponse {
|
|
|
363
374
|
*/
|
|
364
375
|
headless: boolean;
|
|
365
376
|
|
|
377
|
+
/**
|
|
378
|
+
* Memory allocated to the browser session.
|
|
379
|
+
*/
|
|
380
|
+
memory: BrowsersAPI.BrowserMemory;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Geographic region of the browser session. Fixed once the session is created.
|
|
384
|
+
*/
|
|
385
|
+
region: 'us-east' | 'eu-west';
|
|
386
|
+
|
|
366
387
|
/**
|
|
367
388
|
* Unique identifier for the browser session
|
|
368
389
|
*/
|
|
@@ -422,6 +443,12 @@ export interface BrowserPoolAcquireResponse {
|
|
|
422
443
|
*/
|
|
423
444
|
name?: string;
|
|
424
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Network configuration the session was created with, if any. Omitted when the
|
|
448
|
+
* session has no network configuration.
|
|
449
|
+
*/
|
|
450
|
+
network?: BrowsersAPI.BrowserNetworkConfig;
|
|
451
|
+
|
|
425
452
|
/**
|
|
426
453
|
* Browser pool this session was acquired from, if any.
|
|
427
454
|
*/
|
|
@@ -536,6 +563,11 @@ export interface BrowserPoolCreateParams {
|
|
|
536
563
|
*/
|
|
537
564
|
name?: string;
|
|
538
565
|
|
|
566
|
+
/**
|
|
567
|
+
* Network configuration applied to browsers in this pool.
|
|
568
|
+
*/
|
|
569
|
+
network?: BrowsersAPI.BrowserNetworkConfig;
|
|
570
|
+
|
|
539
571
|
/**
|
|
540
572
|
* Profile configuration for browsers in a pool. Provide either id or name.
|
|
541
573
|
* Profiles must be created beforehand. Unlike single browser sessions, pools load
|
|
@@ -558,6 +590,13 @@ export interface BrowserPoolCreateParams {
|
|
|
558
590
|
*/
|
|
559
591
|
refresh_on_profile_update?: boolean;
|
|
560
592
|
|
|
593
|
+
/**
|
|
594
|
+
* Geographic region for the browser pool. It is fixed once the pool is created.
|
|
595
|
+
* Region selection requires a Start-Up or Enterprise plan, defaults to us-east
|
|
596
|
+
* when omitted on create.
|
|
597
|
+
*/
|
|
598
|
+
region?: 'us-east' | 'eu-west';
|
|
599
|
+
|
|
561
600
|
/**
|
|
562
601
|
* Optional URL to navigate to when a new browser is warmed into the pool.
|
|
563
602
|
* Best-effort: failures to navigate do not fail pool fill. Only applied to
|
|
@@ -770,6 +809,15 @@ export interface BrowserPoolUpdateParams {
|
|
|
770
809
|
*/
|
|
771
810
|
name?: string;
|
|
772
811
|
|
|
812
|
+
/**
|
|
813
|
+
* If provided, replaces the pool's network configuration. Omit to leave the
|
|
814
|
+
* existing configuration unchanged; an empty object ({}) removes it, while
|
|
815
|
+
* network: {private_hosts: []} sets an explicit empty list. Only applied to
|
|
816
|
+
* browsers created in the pool after the update; browsers already in the pool keep
|
|
817
|
+
* their configuration until discarded (see discard_all_idle).
|
|
818
|
+
*/
|
|
819
|
+
network?: BrowsersAPI.BrowserNetworkConfig;
|
|
820
|
+
|
|
773
821
|
/**
|
|
774
822
|
* Profile configuration for browsers in a pool. Provide either id or name.
|
|
775
823
|
* Profiles must be created beforehand. Unlike single browser sessions, pools load
|
|
@@ -976,6 +1024,11 @@ export interface BrowserPoolListParams extends OffsetPaginationParams {
|
|
|
976
1024
|
* value.
|
|
977
1025
|
*/
|
|
978
1026
|
query?: string;
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
* Filter pools by geographic region. Omit to list pools in all regions.
|
|
1030
|
+
*/
|
|
1031
|
+
region?: 'us-east' | 'eu-west';
|
|
979
1032
|
}
|
|
980
1033
|
|
|
981
1034
|
export interface BrowserPoolDeleteParams {
|
|
@@ -281,6 +281,47 @@ export type BrowserListResponsesOffsetPagination = OffsetPagination<BrowserListR
|
|
|
281
281
|
|
|
282
282
|
export type ProfilesOffsetPagination = OffsetPagination<Profile>;
|
|
283
283
|
|
|
284
|
+
/**
|
|
285
|
+
* Memory allocated to the browser session.
|
|
286
|
+
*/
|
|
287
|
+
export type BrowserMemory = '1GiB' | '2GiB' | '6GiB' | '8GiB' | '16GiB';
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Memory requested for a headful, non-GPU browser session.
|
|
291
|
+
*/
|
|
292
|
+
export type BrowserMemoryRequest = '8GiB' | '16GiB';
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Network configuration for a browser session or browser pool.
|
|
296
|
+
*/
|
|
297
|
+
export interface BrowserNetworkConfig {
|
|
298
|
+
/**
|
|
299
|
+
* Destinations the browser reaches directly through the session's own network
|
|
300
|
+
* instead of through Kernel-managed egress — for private hosts reachable over a
|
|
301
|
+
* VPN or tunnel the session has joined (e.g. a Tailscale tailnet). By default,
|
|
302
|
+
* private IP ranges already route directly: RFC1918 (10.0.0.0/8, 172.16.0.0/12,
|
|
303
|
+
* 192.168.0.0/16), CGNAT/Tailscale (100.64.0.0/10), and IPv6 ULA (fc00::/7). An
|
|
304
|
+
* explicitly supplied list replaces those defaults with exactly the entries given,
|
|
305
|
+
* and an empty list ([]) disables them so all traffic uses Kernel-managed egress;
|
|
306
|
+
* omit private_hosts to keep the defaults. Entries are hostname patterns
|
|
307
|
+
* ("_.example.ts.net", "preview.internal") or IP/CIDR literals ("100.64.0.0/10",
|
|
308
|
+
* "10.1.30.63"). IP and CIDR entries only match URLs written with a literal IP
|
|
309
|
+
* address; they never match hostnames that resolve into the range, so private DNS
|
|
310
|
+
* names need a hostname entry even when they resolve inside the default ranges.
|
|
311
|
+
* CIDRs must be in canonical masked form (host bits zero), and only the private
|
|
312
|
+
* ranges listed above are accepted; public, loopback, link-local, and unspecified
|
|
313
|
+
* ranges are rejected. Exact IPv6 addresses must be bracketed ("[fd00::1]"); IPv6
|
|
314
|
+
* CIDR ranges are unbracketed ("fd00::/8"). Wildcards are limited to one leading
|
|
315
|
+
* "_." over a suffix with at least two labels that is not a public suffix (so
|
|
316
|
+
* "_.co.uk" or "_.ts.net" are rejected, while "\*.example.ts.net" is accepted).
|
|
317
|
+
* Hostname and IP entries may carry a port; CIDR ranges may not. Hostname entries
|
|
318
|
+
* are not resolved during validation, so callers must ensure they identify private
|
|
319
|
+
* destinations. Not related to a proxy's bypass_hosts, which selects between
|
|
320
|
+
* upstream-proxy and Kernel-managed direct egress and cannot reach into a VPN.
|
|
321
|
+
*/
|
|
322
|
+
private_hosts?: Array<string>;
|
|
323
|
+
}
|
|
324
|
+
|
|
284
325
|
/**
|
|
285
326
|
* Browser pool this session was acquired from, if any.
|
|
286
327
|
*/
|
|
@@ -423,6 +464,16 @@ export interface BrowserCreateResponse {
|
|
|
423
464
|
*/
|
|
424
465
|
headless: boolean;
|
|
425
466
|
|
|
467
|
+
/**
|
|
468
|
+
* Memory allocated to the browser session.
|
|
469
|
+
*/
|
|
470
|
+
memory: BrowserMemory;
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Geographic region of the browser session. Fixed once the session is created.
|
|
474
|
+
*/
|
|
475
|
+
region: 'us-east' | 'eu-west';
|
|
476
|
+
|
|
426
477
|
/**
|
|
427
478
|
* Unique identifier for the browser session
|
|
428
479
|
*/
|
|
@@ -482,6 +533,12 @@ export interface BrowserCreateResponse {
|
|
|
482
533
|
*/
|
|
483
534
|
name?: string;
|
|
484
535
|
|
|
536
|
+
/**
|
|
537
|
+
* Network configuration the session was created with, if any. Omitted when the
|
|
538
|
+
* session has no network configuration.
|
|
539
|
+
*/
|
|
540
|
+
network?: BrowserNetworkConfig;
|
|
541
|
+
|
|
485
542
|
/**
|
|
486
543
|
* Browser pool this session was acquired from, if any.
|
|
487
544
|
*/
|
|
@@ -567,6 +624,16 @@ export interface BrowserRetrieveResponse {
|
|
|
567
624
|
*/
|
|
568
625
|
headless: boolean;
|
|
569
626
|
|
|
627
|
+
/**
|
|
628
|
+
* Memory allocated to the browser session.
|
|
629
|
+
*/
|
|
630
|
+
memory: BrowserMemory;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Geographic region of the browser session. Fixed once the session is created.
|
|
634
|
+
*/
|
|
635
|
+
region: 'us-east' | 'eu-west';
|
|
636
|
+
|
|
570
637
|
/**
|
|
571
638
|
* Unique identifier for the browser session
|
|
572
639
|
*/
|
|
@@ -626,6 +693,12 @@ export interface BrowserRetrieveResponse {
|
|
|
626
693
|
*/
|
|
627
694
|
name?: string;
|
|
628
695
|
|
|
696
|
+
/**
|
|
697
|
+
* Network configuration the session was created with, if any. Omitted when the
|
|
698
|
+
* session has no network configuration.
|
|
699
|
+
*/
|
|
700
|
+
network?: BrowserNetworkConfig;
|
|
701
|
+
|
|
629
702
|
/**
|
|
630
703
|
* Browser pool this session was acquired from, if any.
|
|
631
704
|
*/
|
|
@@ -711,6 +784,16 @@ export interface BrowserUpdateResponse {
|
|
|
711
784
|
*/
|
|
712
785
|
headless: boolean;
|
|
713
786
|
|
|
787
|
+
/**
|
|
788
|
+
* Memory allocated to the browser session.
|
|
789
|
+
*/
|
|
790
|
+
memory: BrowserMemory;
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Geographic region of the browser session. Fixed once the session is created.
|
|
794
|
+
*/
|
|
795
|
+
region: 'us-east' | 'eu-west';
|
|
796
|
+
|
|
714
797
|
/**
|
|
715
798
|
* Unique identifier for the browser session
|
|
716
799
|
*/
|
|
@@ -770,6 +853,12 @@ export interface BrowserUpdateResponse {
|
|
|
770
853
|
*/
|
|
771
854
|
name?: string;
|
|
772
855
|
|
|
856
|
+
/**
|
|
857
|
+
* Network configuration the session was created with, if any. Omitted when the
|
|
858
|
+
* session has no network configuration.
|
|
859
|
+
*/
|
|
860
|
+
network?: BrowserNetworkConfig;
|
|
861
|
+
|
|
773
862
|
/**
|
|
774
863
|
* Browser pool this session was acquired from, if any.
|
|
775
864
|
*/
|
|
@@ -855,6 +944,16 @@ export interface BrowserListResponse {
|
|
|
855
944
|
*/
|
|
856
945
|
headless: boolean;
|
|
857
946
|
|
|
947
|
+
/**
|
|
948
|
+
* Memory allocated to the browser session.
|
|
949
|
+
*/
|
|
950
|
+
memory: BrowserMemory;
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Geographic region of the browser session. Fixed once the session is created.
|
|
954
|
+
*/
|
|
955
|
+
region: 'us-east' | 'eu-west';
|
|
956
|
+
|
|
858
957
|
/**
|
|
859
958
|
* Unique identifier for the browser session
|
|
860
959
|
*/
|
|
@@ -914,6 +1013,12 @@ export interface BrowserListResponse {
|
|
|
914
1013
|
*/
|
|
915
1014
|
name?: string;
|
|
916
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* Network configuration the session was created with, if any. Omitted when the
|
|
1018
|
+
* session has no network configuration.
|
|
1019
|
+
*/
|
|
1020
|
+
network?: BrowserNetworkConfig;
|
|
1021
|
+
|
|
917
1022
|
/**
|
|
918
1023
|
* Browser pool this session was acquired from, if any.
|
|
919
1024
|
*/
|
|
@@ -1045,6 +1150,11 @@ export interface BrowserCreateParams {
|
|
|
1045
1150
|
*/
|
|
1046
1151
|
kiosk_mode?: boolean;
|
|
1047
1152
|
|
|
1153
|
+
/**
|
|
1154
|
+
* Memory for a headful, non-GPU browser session. Defaults to 8GiB.
|
|
1155
|
+
*/
|
|
1156
|
+
memory?: BrowserMemoryRequest;
|
|
1157
|
+
|
|
1048
1158
|
/**
|
|
1049
1159
|
* Optional human-readable name for the browser session, used to find it later in
|
|
1050
1160
|
* the dashboard. Must be unique among active sessions within the project. Can be
|
|
@@ -1052,6 +1162,11 @@ export interface BrowserCreateParams {
|
|
|
1052
1162
|
*/
|
|
1053
1163
|
name?: string;
|
|
1054
1164
|
|
|
1165
|
+
/**
|
|
1166
|
+
* Network configuration for the browser session. Cannot be changed after creation.
|
|
1167
|
+
*/
|
|
1168
|
+
network?: BrowserNetworkConfig;
|
|
1169
|
+
|
|
1055
1170
|
/**
|
|
1056
1171
|
* Profile selection for the browser session. Provide either id or name. If
|
|
1057
1172
|
* specified, the matching profile will be loaded into the browser session.
|
|
@@ -1076,6 +1191,13 @@ export interface BrowserCreateParams {
|
|
|
1076
1191
|
*/
|
|
1077
1192
|
proxy_id?: string;
|
|
1078
1193
|
|
|
1194
|
+
/**
|
|
1195
|
+
* Geographic region for the browser session. It is fixed once the session is
|
|
1196
|
+
* created. Region selection requires a Start-Up or Enterprise plan, defaults to
|
|
1197
|
+
* us-east when omitted on create.
|
|
1198
|
+
*/
|
|
1199
|
+
region?: 'us-east' | 'eu-west';
|
|
1200
|
+
|
|
1079
1201
|
/**
|
|
1080
1202
|
* Optional URL to open when the browser session is created. Navigation is
|
|
1081
1203
|
* best-effort, so navigation failures do not prevent the session from being
|
|
@@ -1410,6 +1532,11 @@ export interface BrowserListParams extends OffsetPaginationParams {
|
|
|
1410
1532
|
*/
|
|
1411
1533
|
query?: string;
|
|
1412
1534
|
|
|
1535
|
+
/**
|
|
1536
|
+
* Filter sessions by geographic region. Omit to list sessions in all regions.
|
|
1537
|
+
*/
|
|
1538
|
+
region?: 'us-east' | 'eu-west';
|
|
1539
|
+
|
|
1413
1540
|
/**
|
|
1414
1541
|
* Filter sessions by status. "active" returns only active sessions (default),
|
|
1415
1542
|
* "deleted" returns only soft-deleted sessions, "all" returns both.
|
|
@@ -1488,6 +1615,9 @@ Browsers.Playwright = Playwright;
|
|
|
1488
1615
|
|
|
1489
1616
|
export declare namespace Browsers {
|
|
1490
1617
|
export {
|
|
1618
|
+
type BrowserMemory as BrowserMemory,
|
|
1619
|
+
type BrowserMemoryRequest as BrowserMemoryRequest,
|
|
1620
|
+
type BrowserNetworkConfig as BrowserNetworkConfig,
|
|
1491
1621
|
type BrowserPoolRef as BrowserPoolRef,
|
|
1492
1622
|
type BrowserProxy as BrowserProxy,
|
|
1493
1623
|
type BrowserProxyConfig as BrowserProxyConfig,
|
|
@@ -10,7 +10,7 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
10
10
|
import { path } from '../../internal/utils/path';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Stream live telemetry events from a browser session.
|
|
13
|
+
* Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
|
|
14
14
|
*/
|
|
15
15
|
export class Telemetry extends APIResource {
|
|
16
16
|
/**
|
|
@@ -136,7 +136,8 @@ export interface CreateCredentialProviderRequest {
|
|
|
136
136
|
token: string;
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
|
-
* Human-readable name for this provider instance (unique per org)
|
|
139
|
+
* Human-readable name for this provider instance (unique per org). Surrounding
|
|
140
|
+
* whitespace is trimmed and the trimmed value must be non-empty.
|
|
140
141
|
*/
|
|
141
142
|
name: string;
|
|
142
143
|
|
|
@@ -281,7 +282,8 @@ export interface UpdateCredentialProviderRequest {
|
|
|
281
282
|
enabled?: boolean;
|
|
282
283
|
|
|
283
284
|
/**
|
|
284
|
-
* Human-readable name for this provider instance
|
|
285
|
+
* Human-readable name for this provider instance. Surrounding whitespace is
|
|
286
|
+
* trimmed and the trimmed value must be non-empty.
|
|
285
287
|
*/
|
|
286
288
|
name?: string;
|
|
287
289
|
|
|
@@ -302,7 +304,8 @@ export interface CredentialProviderCreateParams {
|
|
|
302
304
|
token: string;
|
|
303
305
|
|
|
304
306
|
/**
|
|
305
|
-
* Human-readable name for this provider instance (unique per org)
|
|
307
|
+
* Human-readable name for this provider instance (unique per org). Surrounding
|
|
308
|
+
* whitespace is trimmed and the trimmed value must be non-empty.
|
|
306
309
|
*/
|
|
307
310
|
name: string;
|
|
308
311
|
|
|
@@ -334,7 +337,8 @@ export interface CredentialProviderUpdateParams {
|
|
|
334
337
|
enabled?: boolean;
|
|
335
338
|
|
|
336
339
|
/**
|
|
337
|
-
* Human-readable name for this provider instance
|
|
340
|
+
* Human-readable name for this provider instance. Surrounding whitespace is
|
|
341
|
+
* trimmed and the trimmed value must be non-empty.
|
|
338
342
|
*/
|
|
339
343
|
name?: string;
|
|
340
344
|
|
package/src/resources/index.ts
CHANGED
|
@@ -40,6 +40,9 @@ export {
|
|
|
40
40
|
} from './browser-pools';
|
|
41
41
|
export {
|
|
42
42
|
Browsers,
|
|
43
|
+
type BrowserMemory,
|
|
44
|
+
type BrowserMemoryRequest,
|
|
45
|
+
type BrowserNetworkConfig,
|
|
43
46
|
type BrowserPoolRef,
|
|
44
47
|
type BrowserProxy,
|
|
45
48
|
type BrowserProxyConfig,
|
|
@@ -153,3 +156,4 @@ export {
|
|
|
153
156
|
type ProxyCheckParams,
|
|
154
157
|
type ProxyListResponsesOffsetPagination,
|
|
155
158
|
} from './proxies';
|
|
159
|
+
export { Telemetry } from './telemetry/telemetry';
|
|
@@ -434,6 +434,16 @@ export namespace InvocationListBrowsersResponse {
|
|
|
434
434
|
*/
|
|
435
435
|
headless: boolean;
|
|
436
436
|
|
|
437
|
+
/**
|
|
438
|
+
* Memory allocated to the browser session.
|
|
439
|
+
*/
|
|
440
|
+
memory: BrowsersAPI.BrowserMemory;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Geographic region of the browser session. Fixed once the session is created.
|
|
444
|
+
*/
|
|
445
|
+
region: 'us-east' | 'eu-west';
|
|
446
|
+
|
|
437
447
|
/**
|
|
438
448
|
* Unique identifier for the browser session
|
|
439
449
|
*/
|
|
@@ -493,6 +503,12 @@ export namespace InvocationListBrowsersResponse {
|
|
|
493
503
|
*/
|
|
494
504
|
name?: string;
|
|
495
505
|
|
|
506
|
+
/**
|
|
507
|
+
* Network configuration the session was created with, if any. Omitted when the
|
|
508
|
+
* session has no network configuration.
|
|
509
|
+
*/
|
|
510
|
+
network?: BrowsersAPI.BrowserNetworkConfig;
|
|
511
|
+
|
|
496
512
|
/**
|
|
497
513
|
* Browser pool this session was acquired from, if any.
|
|
498
514
|
*/
|
|
@@ -9,9 +9,7 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
9
9
|
*/
|
|
10
10
|
export class Limits extends APIResource {
|
|
11
11
|
/**
|
|
12
|
-
* Get the organization's
|
|
13
|
-
* across on-demand sessions and browser pool reservations — and the default
|
|
14
|
-
* per-project concurrency cap applied to projects without an explicit override.
|
|
12
|
+
* Get the organization's effective limits and managed auth usage.
|
|
15
13
|
*/
|
|
16
14
|
retrieve(options?: RequestOptions): APIPromise<OrgLimits> {
|
|
17
15
|
return this._client.get('/org/limits', options);
|
|
@@ -28,6 +26,26 @@ export class Limits extends APIResource {
|
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
export interface OrgLimits {
|
|
29
|
+
/**
|
|
30
|
+
* The organization's current non-deleted managed auth connections, counted
|
|
31
|
+
* org-wide across every project. Compare against max_auth_connections to show
|
|
32
|
+
* remaining capacity before a create is rejected with 403 insufficient_plan.
|
|
33
|
+
*/
|
|
34
|
+
auth_connections_used: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Maximum managed auth connections the organization's plan allows. Null means
|
|
38
|
+
* unlimited. Counted org-wide, so it cannot be multiplied across projects.
|
|
39
|
+
*/
|
|
40
|
+
max_auth_connections: number | null;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Smallest health_check_interval the organization's plan accepts on a managed auth
|
|
44
|
+
* connection. Requests below this are rejected with 400. Existing connections
|
|
45
|
+
* stored below the floor are grandfathered until edited.
|
|
46
|
+
*/
|
|
47
|
+
min_health_check_interval_seconds: number;
|
|
48
|
+
|
|
31
49
|
/**
|
|
32
50
|
* Default maximum concurrent browsers applied to every project that has no
|
|
33
51
|
* explicit per-project override. Null means no org-level default, so such projects
|