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.32.0"
".": "4.33.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: 95
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-ba6405a18533c3a25d39dd75a279ef46ce41d33d478441376ecd3ebd54f9088c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-97c8d75c5095cb134ab45f92a057797013d174324268fcf1ba750c5ebcd9b3e4.yml
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 4.33.0 (2024-11-06)

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

### Features

* **api:** api update ([#379](https://github.com/orbcorp/orb-node/issues/379)) ([43a40be](https://github.com/orbcorp/orb-node/commit/43a40be638be51f8bcc62e7bad4a822f3af5b7c0))
* **api:** api update ([#381](https://github.com/orbcorp/orb-node/issues/381)) ([789f363](https://github.com/orbcorp/orb-node/commit/789f36319272f2488cc848789e815cb071c10f27))

## 4.32.0 (2024-10-22)

Full Changelog: [v4.31.0...v4.32.0](https://github.com/orbcorp/orb-node/compare/v4.31.0...v4.32.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Note that requests which time out will be [retried twice by default](#retries).
## Auto-pagination

List methods in the Orb API are paginated.
You can use `for await … of` syntax to iterate through items across all pages:
You can use the `for await … of` syntax to iterate through items across all pages:

```ts
async function fetchAllCoupons(params) {
Expand All @@ -154,7 +154,7 @@ async function fetchAllCoupons(params) {
}
```

Alternatively, you can make request a single page at a time:
Alternatively, you can request a single page at a time:

```ts
let page = await client.coupons.list();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orb-billing",
"version": "4.32.0",
"version": "4.33.0",
"description": "The official TypeScript library for the Orb API",
"author": "Orb <team@withorb.com>",
"types": "dist/index.d.ts",
Expand All @@ -10,7 +10,7 @@
"license": "Apache-2.0",
"packageManager": "yarn@1.22.22",
"files": [
"*"
"**/*"
],
"private": false,
"scripts": {
Expand Down
22 changes: 2 additions & 20 deletions src/resources/customers/customers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,9 @@ export class Customers extends APIResource {
*/
update(
customerId: string,
body?: CustomerUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<Customer>;
update(customerId: string, options?: Core.RequestOptions): Core.APIPromise<Customer>;
update(
customerId: string,
body: CustomerUpdateParams | Core.RequestOptions = {},
body: CustomerUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<Customer> {
if (isRequestOptions(body)) {
return this.update(customerId, {}, body);
}
return this._client.put(`/customers/${customerId}`, { body, ...options });
}

Expand Down Expand Up @@ -131,18 +122,9 @@ export class Customers extends APIResource {
*/
updateByExternalId(
id: string,
body?: CustomerUpdateByExternalIDParams,
options?: Core.RequestOptions,
): Core.APIPromise<Customer>;
updateByExternalId(id: string, options?: Core.RequestOptions): Core.APIPromise<Customer>;
updateByExternalId(
id: string,
body: CustomerUpdateByExternalIDParams | Core.RequestOptions = {},
body: CustomerUpdateByExternalIDParams,
options?: Core.RequestOptions,
): Core.APIPromise<Customer> {
if (isRequestOptions(body)) {
return this.updateByExternalId(id, {}, body);
}
return this._client.put(`/customers/external_customer_id/${id}`, { body, ...options });
}
}
Expand Down
27 changes: 9 additions & 18 deletions src/resources/events/volume.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import * as VolumeAPI from './volume';

Expand All @@ -21,15 +20,7 @@ export class Volume extends APIResource {
* timestamp is passed in for either start or end time, the response includes the
* hours the timestamp falls in.
*/
list(query?: VolumeListParams, options?: Core.RequestOptions): Core.APIPromise<EventVolumes>;
list(options?: Core.RequestOptions): Core.APIPromise<EventVolumes>;
list(
query: VolumeListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<EventVolumes> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
list(query: VolumeListParams, options?: Core.RequestOptions): Core.APIPromise<EventVolumes> {
return this._client.get('/events/volume', { query, ...options });
}
}
Expand All @@ -56,6 +47,14 @@ export namespace EventVolumes {
}

export interface VolumeListParams {
/**
* The start of the timeframe, inclusive, in which to return event volume. All
* datetime values are converted to UTC time. If the specified time isn't
* hour-aligned, the response includes the event volume count for the hour the time
* falls in.
*/
timeframe_start: string;

/**
* Cursor for pagination. This can be populated by the `next_cursor` value returned
* from the initial request.
Expand All @@ -74,14 +73,6 @@ export interface VolumeListParams {
* volumecount for the hour the time falls in.
*/
timeframe_end?: string;

/**
* The start of the timeframe, inclusive, in which to return event volume. All
* datetime values are converted to UTC time. If the specified time isn't
* hour-aligned, the response includes the event volume count for the hour the time
* falls in.
*/
timeframe_start?: string;
}

export namespace Volume {
Expand Down
23 changes: 3 additions & 20 deletions src/resources/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,9 @@ export class Invoices extends APIResource {
*/
update(
invoiceId: string,
body?: InvoiceUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<Invoice>;
update(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
update(
invoiceId: string,
body: InvoiceUpdateParams | Core.RequestOptions = {},
body: InvoiceUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<Invoice> {
if (isRequestOptions(body)) {
return this.update(invoiceId, {}, body);
}
return this._client.put(`/invoices/${invoiceId}`, { body, ...options });
}

Expand Down Expand Up @@ -81,17 +72,9 @@ export class Invoices extends APIResource {
* subscription.
*/
fetchUpcoming(
query?: InvoiceFetchUpcomingParams,
options?: Core.RequestOptions,
): Core.APIPromise<InvoiceFetchUpcomingResponse>;
fetchUpcoming(options?: Core.RequestOptions): Core.APIPromise<InvoiceFetchUpcomingResponse>;
fetchUpcoming(
query: InvoiceFetchUpcomingParams | Core.RequestOptions = {},
query: InvoiceFetchUpcomingParams,
options?: Core.RequestOptions,
): Core.APIPromise<InvoiceFetchUpcomingResponse> {
if (isRequestOptions(query)) {
return this.fetchUpcoming({}, query);
}
return this._client.get('/invoices/upcoming', { query, ...options });
}

Expand Down Expand Up @@ -2647,7 +2630,7 @@ export interface InvoiceListParams extends PageParams {
}

export interface InvoiceFetchUpcomingParams {
subscription_id?: string;
subscription_id: string;
}

export interface InvoiceIssueParams {
Expand Down
11 changes: 1 addition & 10 deletions src/resources/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,7 @@ export class Items extends APIResource {
/**
* This endpoint can be used to update properties on the Item.
*/
update(itemId: string, body?: ItemUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Item>;
update(itemId: string, options?: Core.RequestOptions): Core.APIPromise<Item>;
update(
itemId: string,
body: ItemUpdateParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<Item> {
if (isRequestOptions(body)) {
return this.update(itemId, {}, body);
}
update(itemId: string, body: ItemUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Item> {
return this._client.put(`/items/${itemId}`, { body, ...options });
}

Expand Down
11 changes: 1 addition & 10 deletions src/resources/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,9 @@ export class Metrics extends APIResource {
*/
update(
metricId: string,
body?: MetricUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<BillableMetric>;
update(metricId: string, options?: Core.RequestOptions): Core.APIPromise<BillableMetric>;
update(
metricId: string,
body: MetricUpdateParams | Core.RequestOptions = {},
body: MetricUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<BillableMetric> {
if (isRequestOptions(body)) {
return this.update(metricId, {}, body);
}
return this._client.put(`/metrics/${metricId}`, { body, ...options });
}

Expand Down
12 changes: 1 addition & 11 deletions src/resources/plans/external-plan-id.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import * as ExternalPlanIDAPI from './external-plan-id';
import * as PlansAPI from './plans';
Expand All @@ -15,18 +14,9 @@ export class ExternalPlanID extends APIResource {
*/
update(
otherExternalPlanId: string,
body?: ExternalPlanIDUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<PlansAPI.Plan>;
update(otherExternalPlanId: string, options?: Core.RequestOptions): Core.APIPromise<PlansAPI.Plan>;
update(
otherExternalPlanId: string,
body: ExternalPlanIDUpdateParams | Core.RequestOptions = {},
body: ExternalPlanIDUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<PlansAPI.Plan> {
if (isRequestOptions(body)) {
return this.update(otherExternalPlanId, {}, body);
}
return this._client.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
}

Expand Down
11 changes: 1 addition & 10 deletions src/resources/plans/plans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@ export class Plans extends APIResource {
*
* Other fields on a customer are currently immutable.
*/
update(planId: string, body?: PlanUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Plan>;
update(planId: string, options?: Core.RequestOptions): Core.APIPromise<Plan>;
update(
planId: string,
body: PlanUpdateParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<Plan> {
if (isRequestOptions(body)) {
return this.update(planId, {}, body);
}
update(planId: string, body: PlanUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Plan> {
return this._client.put(`/plans/${planId}`, { body, ...options });
}

Expand Down
12 changes: 1 addition & 11 deletions src/resources/prices/external-price-id.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import * as ExternalPriceIDAPI from './external-price-id';
import * as PricesAPI from './prices';
Expand All @@ -14,18 +13,9 @@ export class ExternalPriceID extends APIResource {
*/
update(
externalPriceId: string,
body?: ExternalPriceIDUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<PricesAPI.Price>;
update(externalPriceId: string, options?: Core.RequestOptions): Core.APIPromise<PricesAPI.Price>;
update(
externalPriceId: string,
body: ExternalPriceIDUpdateParams | Core.RequestOptions = {},
body: ExternalPriceIDUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<PricesAPI.Price> {
if (isRequestOptions(body)) {
return this.update(externalPriceId, {}, body);
}
return this._client.put(`/prices/external_price_id/${externalPriceId}`, { body, ...options });
}

Expand Down
11 changes: 1 addition & 10 deletions src/resources/prices/prices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,7 @@ export class Prices extends APIResource {
* pass null for the metadata value, it will clear any existing metadata for that
* price.
*/
update(priceId: string, body?: PriceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Price>;
update(priceId: string, options?: Core.RequestOptions): Core.APIPromise<Price>;
update(
priceId: string,
body: PriceUpdateParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<Price> {
if (isRequestOptions(body)) {
return this.update(priceId, {}, body);
}
update(priceId: string, body: PriceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Price> {
return this._client.put(`/prices/${priceId}`, { body, ...options });
}

Expand Down
Loading