Skip to content

Commit b948ca0

Browse files
release: 2.3.0 (#131)
Automated Release PR --- ## 2.3.0 (2025-02-05) Full Changelog: [v2.2.0...v2.3.0](v2.2.0...v2.3.0) ### Features * **client:** send `X-Stainless-Timeout` header ([#133](#133)) ([1b03cd8](1b03cd8)) ### Chores * **internal:** version bump ([#129](#129)) ([579f065](579f065)) --- This pull request is managed by Stainless's [GitHub App](https://github.com/apps/stainless-app). The [semver version number](https://semver.org/#semantic-versioning-specification-semver) is based on included [commit messages](https://www.conventionalcommits.org/en/v1.0.0/). Alternatively, you can manually set the version number in the title of this pull request. For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request. 🔗 Stainless [website](https://www.stainlessapi.com) 📚 Read the [docs](https://app.stainlessapi.com/docs) 🙋 [Reach out](mailto:support@stainlessapi.com) for help or questions --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 36f6a12 commit b948ca0

File tree

6 files changed

+32
-11
lines changed

6 files changed

+32
-11
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.2.0"
2+
".": "2.3.0"
33
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 2.3.0 (2025-02-05)
4+
5+
Full Changelog: [v2.2.0...v2.3.0](https://github.com/browserbase/sdk-node/compare/v2.2.0...v2.3.0)
6+
7+
### Features
8+
9+
* **client:** send `X-Stainless-Timeout` header ([#133](https://github.com/browserbase/sdk-node/issues/133)) ([1b03cd8](https://github.com/browserbase/sdk-node/commit/1b03cd8b5e8a3830915686c429d7188f8c5e1f2f))
10+
11+
12+
### Chores
13+
14+
* **internal:** version bump ([#129](https://github.com/browserbase/sdk-node/issues/129)) ([579f065](https://github.com/browserbase/sdk-node/commit/579f065310a7d06b13b9c6a82adf78718fcd3751))
15+
316
## 2.2.0 (2025-01-28)
417

518
Full Changelog: [v2.1.3...v2.2.0](https://github.com/browserbase/sdk-node/compare/v2.1.3...v2.2.0)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@browserbasehq/sdk",
3-
"version": "2.2.0",
3+
"version": "2.3.0",
44
"description": "The official Node.js library for the Browserbase API",
55
"author": "Browserbase <support@browserbase.com>",
66
"types": "dist/index.d.ts",

src/core.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ export abstract class APIClient {
280280
options: FinalRequestOptions<Req>,
281281
{ retryCount = 0 }: { retryCount?: number } = {},
282282
): { req: RequestInit; url: string; timeout: number } {
283+
options = { ...options };
283284
const { method, path, query, headers: headers = {} } = options;
284285

285286
const body =
@@ -292,9 +293,9 @@ export abstract class APIClient {
292293

293294
const url = this.buildURL(path!, query);
294295
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
295-
const timeout = options.timeout ?? this.timeout;
296+
options.timeout = options.timeout ?? this.timeout;
296297
const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
297-
const minAgentTimeout = timeout + 1000;
298+
const minAgentTimeout = options.timeout + 1000;
298299
if (
299300
typeof (httpAgent as any)?.options?.timeout === 'number' &&
300301
minAgentTimeout > ((httpAgent as any).options.timeout ?? 0)
@@ -323,7 +324,7 @@ export abstract class APIClient {
323324
signal: options.signal ?? null,
324325
};
325326

326-
return { req, url, timeout };
327+
return { req, url, timeout: options.timeout };
327328
}
328329

329330
private buildHeaders({
@@ -351,15 +352,22 @@ export abstract class APIClient {
351352
delete reqHeaders['content-type'];
352353
}
353354

354-
// Don't set the retry count header if it was already set or removed through default headers or by the
355-
// caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to
356-
// account for the removal case.
355+
// Don't set theses headers if they were already set or removed through default headers or by the caller.
356+
// We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account
357+
// for the removal case.
357358
if (
358359
getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
359360
getHeader(headers, 'x-stainless-retry-count') === undefined
360361
) {
361362
reqHeaders['x-stainless-retry-count'] = String(retryCount);
362363
}
364+
if (
365+
getHeader(defaultHeaders, 'x-stainless-timeout') === undefined &&
366+
getHeader(headers, 'x-stainless-timeout') === undefined &&
367+
options.timeout
368+
) {
369+
reqHeaders['x-stainless-timeout'] = String(options.timeout);
370+
}
363371

364372
this.validateHeaders(reqHeaders, headers);
365373

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '2.2.0'; // x-release-please-version
1+
export const VERSION = '2.3.0'; // x-release-please-version

0 commit comments

Comments
 (0)