Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.40.0"
".": "4.41.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-77e2e50c9fb438b08736da759f722f9d062ed3fad3183fb951eb1eee93fa93f5.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-908960f165205e2874dd29322cc974df5ab10c7634ab9a342ab22047013de1b4.yml
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 4.41.0 (2024-12-12)

Full Changelog: [v4.40.0...v4.41.0](https://github.com/orbcorp/orb-node/compare/v4.40.0...v4.41.0)

### Features

* **api:** api update ([#419](https://github.com/orbcorp/orb-node/issues/419)) ([1f3a57f](https://github.com/orbcorp/orb-node/commit/1f3a57f6a7c8de054c495ede973e9746fe1554bf))


### Chores

* **internal:** bump cross-spawn to v7.0.6 ([#416](https://github.com/orbcorp/orb-node/issues/416)) ([3424ec9](https://github.com/orbcorp/orb-node/commit/3424ec91cd4912493bc01d2924f51ebc002f64b9))
* **internal:** remove unnecessary getRequestClient function ([#414](https://github.com/orbcorp/orb-node/issues/414)) ([a0ddd82](https://github.com/orbcorp/orb-node/commit/a0ddd828b55422d13b12abcb7e401c24aee90311))
* **internal:** update isAbsoluteURL ([#418](https://github.com/orbcorp/orb-node/issues/418)) ([6249150](https://github.com/orbcorp/orb-node/commit/6249150672207a4691bb5a627daf3f635c52aa7e))
* **types:** nicer error class types + jsdocs ([#417](https://github.com/orbcorp/orb-node/issues/417)) ([e564fdf](https://github.com/orbcorp/orb-node/commit/e564fdf4283c5cecfacaf050771bf2be826710cb))

## 4.40.0 (2024-12-03)

Full Changelog: [v4.39.0...v4.40.0](https://github.com/orbcorp/orb-node/compare/v4.39.0...v4.40.0)
Expand Down
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,5 +332,5 @@ Methods:
- <code title="post /alerts/customer_id/{customer_id}">client.alerts.<a href="./src/resources/alerts.ts">createForCustomer</a>(customerId, { ...params }) -> Alert</code>
- <code title="post /alerts/external_customer_id/{external_customer_id}">client.alerts.<a href="./src/resources/alerts.ts">createForExternalCustomer</a>(externalCustomerId, { ...params }) -> Alert</code>
- <code title="post /alerts/subscription_id/{subscription_id}">client.alerts.<a href="./src/resources/alerts.ts">createForSubscription</a>(subscriptionId, { ...params }) -> Alert</code>
- <code title="post /alerts/{alert_configuration_id}/disable">client.alerts.<a href="./src/resources/alerts.ts">disable</a>(alertConfigurationId) -> Alert</code>
- <code title="post /alerts/{alert_configuration_id}/enable">client.alerts.<a href="./src/resources/alerts.ts">enable</a>(alertConfigurationId) -> Alert</code>
- <code title="post /alerts/{alert_configuration_id}/disable">client.alerts.<a href="./src/resources/alerts.ts">disable</a>(alertConfigurationId, { ...params }) -> Alert</code>
- <code title="post /alerts/{alert_configuration_id}/enable">client.alerts.<a href="./src/resources/alerts.ts">enable</a>(alertConfigurationId, { ...params }) -> Alert</code>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orb-billing",
"version": "4.40.0",
"version": "4.41.0",
"description": "The official TypeScript library for the Orb API",
"author": "Orb <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
18 changes: 6 additions & 12 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,19 +523,13 @@ export abstract class APIClient {
const timeout = setTimeout(() => controller.abort(), ms);

return (
this.getRequestClient()
// use undefined this binding; fetch errors if bound to something else in browser/cloudflare
.fetch.call(undefined, url, { signal: controller.signal as any, ...options })
.finally(() => {
clearTimeout(timeout);
})
// use undefined this binding; fetch errors if bound to something else in browser/cloudflare
this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
clearTimeout(timeout);
})
);
}

protected getRequestClient(): RequestClient {
return { fetch: this.fetch };
}

private shouldRetry(response: Response): boolean {
// Note this is not a standard header.
const shouldRetryHeader = response.headers.get('x-should-retry');
Expand Down Expand Up @@ -976,8 +970,8 @@ export const safeJSON = (text: string) => {
}
};

// https://stackoverflow.com/a/19709846
const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i');
// https://url.spec.whatwg.org/#url-scheme-string
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
const isAbsoluteURL = (url: string): boolean => {
return startsWithSchemeRegexp.test(url);
};
Expand Down
Loading
Loading