@browserbasehq/sdk
Advanced tools
Comparing version
# Changelog | ||
## 2.6.0 (2025-05-16) | ||
Full Changelog: [v2.5.0...v2.6.0](https://github.com/browserbase/sdk-node/compare/v2.5.0...v2.6.0) | ||
### Features | ||
* **api:** api update ([0b43bac](https://github.com/browserbase/sdk-node/commit/0b43baccf8dbb13ed4b9bb8feed15849007cc531)) | ||
* **api:** api update ([#158](https://github.com/browserbase/sdk-node/issues/158)) ([1287216](https://github.com/browserbase/sdk-node/commit/12872160a6e7be94d82cb4189cf53dc9eecbfbba)) | ||
### Bug Fixes | ||
* **api:** improve type resolution when importing as a package ([#163](https://github.com/browserbase/sdk-node/issues/163)) ([758c8e0](https://github.com/browserbase/sdk-node/commit/758c8e048537bdc6d0070a11010ed307b5d4de03)) | ||
* **client:** send `X-Stainless-Timeout` in seconds ([#161](https://github.com/browserbase/sdk-node/issues/161)) ([8aea1ee](https://github.com/browserbase/sdk-node/commit/8aea1ee6f66052fa976087c6dbb57f98385c6eee)) | ||
* **mcp:** remove unused tools.ts ([#164](https://github.com/browserbase/sdk-node/issues/164)) ([b09bd54](https://github.com/browserbase/sdk-node/commit/b09bd54af116847e852f67bf6c7f0e32dfa92509)) | ||
### Chores | ||
* **ci:** add timeout thresholds for CI jobs ([c813b38](https://github.com/browserbase/sdk-node/commit/c813b38b3be8470e2c5b95b58c621ccd7b7ccfe5)) | ||
* **ci:** only use depot for staging repos ([475fe50](https://github.com/browserbase/sdk-node/commit/475fe5018be88d96971697bdc3e1b33ae9669310)) | ||
* **client:** minor internal fixes ([ee36919](https://github.com/browserbase/sdk-node/commit/ee369190b385d25726cac1e3bc0e23559539d8d9)) | ||
* **internal:** add aliases for Record and Array ([#162](https://github.com/browserbase/sdk-node/issues/162)) ([e658ed9](https://github.com/browserbase/sdk-node/commit/e658ed9e739c0479ffd542ffe4b616fc5884d77d)) | ||
* **internal:** codegen related update ([99b8089](https://github.com/browserbase/sdk-node/commit/99b8089de31eb102cb82a9b85b2d13fd57570f5c)) | ||
* **internal:** reduce CI branch coverage ([37d8e14](https://github.com/browserbase/sdk-node/commit/37d8e1406cc38d5e2003f40b43a7632c7f528544)) | ||
* **internal:** upload builds and expand CI branch coverage ([d30a38a](https://github.com/browserbase/sdk-node/commit/d30a38a6331169eb4ef7672ae6fbd561cd5c5b0c)) | ||
### Documentation | ||
* **readme:** fix typo ([7bc4b9b](https://github.com/browserbase/sdk-node/commit/7bc4b9ba006fef118f7883ed2fab7cc140906f97)) | ||
## 2.5.0 (2025-03-28) | ||
@@ -4,0 +36,0 @@ |
@@ -7,2 +7,13 @@ import { APIError } from "./error.js"; | ||
export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
/** | ||
* An alias to the builtin `Array` type so we can | ||
* easily alias it in import statements if there are name clashes. | ||
*/ | ||
type _Array<T> = Array<T>; | ||
/** | ||
* An alias to the builtin `Record` type so we can | ||
* easily alias it in import statements if there are name clashes. | ||
*/ | ||
type _Record<K extends keyof any, T> = Record<K, T>; | ||
export type { _Array as Array, _Record as Record }; | ||
type PromiseOrValue<T> = T | Promise<T>; | ||
@@ -99,3 +110,3 @@ type APIResponseProps = { | ||
private calculateContentLength; | ||
buildRequest<Req>(options: FinalRequestOptions<Req>, { retryCount }?: { | ||
buildRequest<Req>(inputOptions: FinalRequestOptions<Req>, { retryCount }?: { | ||
retryCount?: number; | ||
@@ -102,0 +113,0 @@ }): { |
12
core.js
@@ -200,4 +200,4 @@ "use strict"; | ||
} | ||
buildRequest(options, { retryCount = 0 } = {}) { | ||
options = { ...options }; | ||
buildRequest(inputOptions, { retryCount = 0 } = {}) { | ||
const options = { ...inputOptions }; | ||
const { method, path, query, headers: headers = {} } = options; | ||
@@ -225,5 +225,5 @@ const body = ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ? | ||
if (this.idempotencyHeader && method !== 'get') { | ||
if (!options.idempotencyKey) | ||
options.idempotencyKey = this.defaultIdempotencyKey(); | ||
headers[this.idempotencyHeader] = options.idempotencyKey; | ||
if (!inputOptions.idempotencyKey) | ||
inputOptions.idempotencyKey = this.defaultIdempotencyKey(); | ||
headers[this.idempotencyHeader] = inputOptions.idempotencyKey; | ||
} | ||
@@ -264,3 +264,3 @@ const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); | ||
options.timeout) { | ||
reqHeaders['x-stainless-timeout'] = String(options.timeout); | ||
reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000)); | ||
} | ||
@@ -267,0 +267,0 @@ this.validateHeaders(reqHeaders, headers); |
{ | ||
"name": "@browserbasehq/sdk", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "The official Node.js library for the Browserbase API", | ||
@@ -5,0 +5,0 @@ "author": "Browserbase <support@browserbase.com>", |
@@ -113,3 +113,3 @@ # Browserbase Node API Library | ||
Error codes are as followed: | ||
Error codes are as follows: | ||
@@ -116,0 +116,0 @@ | Status Code | Error Type | |
@@ -218,4 +218,4 @@ import { APIResource } from "../../resource.js"; | ||
/** | ||
* Set to true to keep the session alive even after disconnections. This is | ||
* available on the Startup plan only. | ||
* Set to true to keep the session alive even after disconnections. Available on | ||
* the Hobby Plan and above. | ||
*/ | ||
@@ -253,2 +253,12 @@ keepAlive?: boolean; | ||
blockAds?: boolean; | ||
/** | ||
* Custom selector for captcha image. See | ||
* [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving) | ||
*/ | ||
captchaImageSelector?: string; | ||
/** | ||
* Custom selector for captcha input. See | ||
* [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving) | ||
*/ | ||
captchaInputSelector?: string; | ||
context?: BrowserSettings.Context; | ||
@@ -255,0 +265,0 @@ /** |
@@ -36,2 +36,16 @@ import { VERSION } from './version'; | ||
/** | ||
* An alias to the builtin `Array` type so we can | ||
* easily alias it in import statements if there are name clashes. | ||
*/ | ||
type _Array<T> = Array<T>; | ||
/** | ||
* An alias to the builtin `Record` type so we can | ||
* easily alias it in import statements if there are name clashes. | ||
*/ | ||
type _Record<K extends keyof any, T> = Record<K, T>; | ||
export type { _Array as Array, _Record as Record }; | ||
type PromiseOrValue<T> = T | Promise<T>; | ||
@@ -286,6 +300,6 @@ | ||
buildRequest<Req>( | ||
options: FinalRequestOptions<Req>, | ||
inputOptions: FinalRequestOptions<Req>, | ||
{ retryCount = 0 }: { retryCount?: number } = {}, | ||
): { req: RequestInit; url: string; timeout: number } { | ||
options = { ...options }; | ||
const options = { ...inputOptions }; | ||
const { method, path, query, headers: headers = {} } = options; | ||
@@ -318,4 +332,4 @@ | ||
if (this.idempotencyHeader && method !== 'get') { | ||
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); | ||
headers[this.idempotencyHeader] = options.idempotencyKey; | ||
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey(); | ||
headers[this.idempotencyHeader] = inputOptions.idempotencyKey; | ||
} | ||
@@ -377,3 +391,3 @@ | ||
) { | ||
reqHeaders['x-stainless-timeout'] = String(options.timeout); | ||
reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000)); | ||
} | ||
@@ -380,0 +394,0 @@ |
@@ -310,4 +310,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
/** | ||
* Set to true to keep the session alive even after disconnections. This is | ||
* available on the Startup plan only. | ||
* Set to true to keep the session alive even after disconnections. Available on | ||
* the Hobby Plan and above. | ||
*/ | ||
@@ -354,2 +354,14 @@ keepAlive?: boolean; | ||
/** | ||
* Custom selector for captcha image. See | ||
* [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving) | ||
*/ | ||
captchaImageSelector?: string; | ||
/** | ||
* Custom selector for captcha input. See | ||
* [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving) | ||
*/ | ||
captchaInputSelector?: string; | ||
context?: BrowserSettings.Context; | ||
@@ -356,0 +368,0 @@ |
@@ -1,1 +0,1 @@ | ||
export const VERSION = '2.5.0'; // x-release-please-version | ||
export const VERSION = '2.6.0'; // x-release-please-version |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "2.5.0"; | ||
export declare const VERSION = "2.6.0"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = void 0; | ||
exports.VERSION = '2.5.0'; // x-release-please-version | ||
exports.VERSION = '2.6.0'; // x-release-please-version | ||
//# sourceMappingURL=version.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
536665
0.83%8287
0.51%