Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

orb-billing

Package Overview
Dependencies
Maintainers
2
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orb-billing - npm Package Compare versions

Comparing version 4.21.0 to 4.23.0

17

CHANGELOG.md
# Changelog
## 4.23.0 (2024-09-25)
Full Changelog: [v4.22.0...v4.23.0](https://github.com/orbcorp/orb-node/compare/v4.22.0...v4.23.0)
### Features
* **api:** extract discounts to models ([#342](https://github.com/orbcorp/orb-node/issues/342)) ([78f38d5](https://github.com/orbcorp/orb-node/commit/78f38d5c289a3a09e943799b3324e50dfe99de8e))
## 4.22.0 (2024-09-24)
Full Changelog: [v4.21.0...v4.22.0](https://github.com/orbcorp/orb-node/compare/v4.21.0...v4.22.0)
### Features
* **api:** OpenAPI spec update via Stainless API ([#340](https://github.com/orbcorp/orb-node/issues/340)) ([26681d3](https://github.com/orbcorp/orb-node/commit/26681d3be966505df5c0cec4bda3205ed9d51229))
* **client:** send retry count header ([#338](https://github.com/orbcorp/orb-node/issues/338)) ([7b916b9](https://github.com/orbcorp/orb-node/commit/7b916b9277115bbc2ed76d79bdfd6c400331652e))
## 4.21.0 (2024-09-20)

@@ -4,0 +21,0 @@

4

core.d.ts

@@ -100,3 +100,5 @@

private calculateContentLength;
buildRequest<Req>(options: FinalRequestOptions<Req>): {
buildRequest<Req>(options: FinalRequestOptions<Req>, { retryCount }?: {
retryCount?: number;
}): {
req: RequestInit;

@@ -103,0 +105,0 @@ url: string;

@@ -193,3 +193,3 @@ "use strict";

}
buildRequest(options) {
buildRequest(options, { retryCount = 0 } = {}) {
const { method, path, query, headers: headers = {} } = options;

@@ -221,3 +221,3 @@ const body = ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ?

}
const reqHeaders = this.buildHeaders({ options, headers, contentLength });
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
const req = {

@@ -234,3 +234,3 @@ method,

}
buildHeaders({ options, headers, contentLength, }) {
buildHeaders({ options, headers, contentLength, retryCount, }) {
const reqHeaders = {};

@@ -247,2 +247,3 @@ if (contentLength) {

}
reqHeaders['x-stainless-retry-count'] = String(retryCount);
this.validateHeaders(reqHeaders, headers);

@@ -276,7 +277,8 @@ return reqHeaders;

const options = await optionsInput;
const maxRetries = options.maxRetries ?? this.maxRetries;
if (retriesRemaining == null) {
retriesRemaining = options.maxRetries ?? this.maxRetries;
retriesRemaining = maxRetries;
}
await this.prepareOptions(options);
const { req, url, timeout } = this.buildRequest(options);
const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });
await this.prepareRequest(req, { url, options });

@@ -283,0 +285,0 @@ debug('request', url, options, req.headers);

@@ -235,7 +235,11 @@ import * as Errors from "./error.js";

export import AlertCreateForSubscriptionParams = API.AlertCreateForSubscriptionParams;
export import AmountDiscount = API.AmountDiscount;
export import BillingCycleRelativeDate = API.BillingCycleRelativeDate;
export import Discount = API.Discount;
export import InvoiceLevelDiscount = API.InvoiceLevelDiscount;
export import PaginationMetadata = API.PaginationMetadata;
export import PercentageDiscount = API.PercentageDiscount;
export import TrialDiscount = API.TrialDiscount;
}
export default Orb;
//# sourceMappingURL=index.d.ts.map
{
"name": "orb-billing",
"version": "4.21.0",
"version": "4.23.0",
"description": "The official TypeScript library for the Orb API",

@@ -5,0 +5,0 @@ "author": "Orb <team@withorb.com>",

import { APIResource } from "../../resource.js";
import * as Core from "../../core.js";
import * as CouponsAPI from "./coupons.js";
import * as Shared from "../shared.js";
import * as SubscriptionsAPI from "./subscriptions.js";

@@ -89,3 +90,3 @@ import { Page, type PageParams } from "../../pagination.js";

archived_at: string | null;
discount: Coupon.PercentageDiscount | Coupon.AmountDiscount;
discount: Shared.PercentageDiscount | Shared.AmountDiscount;
/**

@@ -110,31 +111,2 @@ * This allows for a coupon's discount to apply for a limited time (determined in

}
export declare namespace Coupon {
interface PercentageDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'percentage';
/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount: number;
reason?: string | null;
}
interface AmountDiscount {
/**
* Only available if discount_type is `amount`.
*/
amount_discount: string;
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'amount';
reason?: string | null;
}
}
export interface CouponCreateParams {

@@ -141,0 +113,0 @@ discount: CouponCreateParams.NewCouponPercentageDiscount | CouponCreateParams.NewCouponAmountDiscount;

@@ -118,19 +118,2 @@ import { APIResource } from "../../resource.js";

*
* ## Grouping by custom attributes
*
* In order to view costs grouped by a specific _attribute_ that each event is
* tagged with (i.e. `cluster`), you can additionally specify a `group_by` key. The
* `group_by` key denotes the event property on which to group.
*
* When returning grouped costs, a separate `price_group` object in the
* `per_price_costs` array is returned for each value of the `group_by` key present
* in your events. The `subtotal` value of the `per_price_costs` object is the sum
* of each `price_group`'s total.
*
* Orb expects events will contain values in the `properties` dictionary that
* correspond to the `group_by` key specified. By default, Orb will return a `null`
* group (i.e. events that match the metric but do not have the key set).
* Currently, it is only possible to view costs grouped by a single attribute at a
* time.
*
* ### Matrix prices

@@ -257,19 +240,2 @@ *

*
* ## Grouping by custom attributes
*
* In order to view costs grouped by a specific _attribute_ that each event is
* tagged with (i.e. `cluster`), you can additionally specify a `group_by` key. The
* `group_by` key denotes the event property on which to group.
*
* When returning grouped costs, a separate `price_group` object in the
* `per_price_costs` array is returned for each value of the `group_by` key present
* in your events. The `subtotal` value of the `per_price_costs` object is the sum
* of each `price_group`'s total.
*
* Orb expects events will contain values in the `properties` dictionary that
* correspond to the `group_by` key specified. By default, Orb will return a `null`
* group (i.e. events that match the metric but do not have the key set).
* Currently, it is only possible to view costs grouped by a single attribute at a
* time.
*
* ### Matrix prices

@@ -276,0 +242,0 @@ *

@@ -0,35 +1,17 @@

export interface AmountDiscount {
/**
* Only available if discount_type is `amount`.
*/
amount_discount: string;
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'amount';
reason?: string | null;
}
export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term';
export type Discount = Discount.PercentageDiscount | Discount.TrialDiscount | Discount.UsageDiscount | Discount.AmountDiscount;
export type Discount = PercentageDiscount | TrialDiscount | Discount.UsageDiscount | AmountDiscount;
export declare namespace Discount {
interface PercentageDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'percentage';
/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount: number;
reason?: string | null;
}
interface TrialDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'trial';
reason?: string | null;
/**
* Only available if discount_type is `trial`
*/
trial_amount_discount?: string | null;
/**
* Only available if discount_type is `trial`
*/
trial_percentage_discount?: number | null;
}
interface UsageDiscount {

@@ -49,16 +31,4 @@ /**

}
interface AmountDiscount {
/**
* Only available if discount_type is `amount`.
*/
amount_discount: string;
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'amount';
reason?: string | null;
}
}
export type InvoiceLevelDiscount = PercentageDiscount | AmountDiscount | TrialDiscount;
export interface PaginationMetadata {

@@ -68,2 +38,33 @@ has_more: boolean;

}
export interface PercentageDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'percentage';
/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount: number;
reason?: string | null;
}
export interface TrialDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'trial';
reason?: string | null;
/**
* Only available if discount_type is `trial`
*/
trial_amount_discount?: string | null;
/**
* Only available if discount_type is `trial`
*/
trial_percentage_discount?: number | null;
}
//# sourceMappingURL=shared.d.ts.map

@@ -277,3 +277,6 @@ import { VERSION } from './version';

buildRequest<Req>(options: FinalRequestOptions<Req>): { req: RequestInit; url: string; timeout: number } {
buildRequest<Req>(
options: FinalRequestOptions<Req>,
{ retryCount = 0 }: { retryCount?: number } = {},
): { req: RequestInit; url: string; timeout: number } {
const { method, path, query, headers: headers = {} } = options;

@@ -310,3 +313,3 @@

const reqHeaders = this.buildHeaders({ options, headers, contentLength });
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });

@@ -330,2 +333,3 @@ const req: RequestInit = {

contentLength,
retryCount,
}: {

@@ -335,2 +339,3 @@ options: FinalRequestOptions;

contentLength: string | null | undefined;
retryCount: number;
}): Record<string, string> {

@@ -351,2 +356,4 @@ const reqHeaders: Record<string, string> = {};

reqHeaders['x-stainless-retry-count'] = String(retryCount);
this.validateHeaders(reqHeaders, headers);

@@ -403,4 +410,5 @@

const options = await optionsInput;
const maxRetries = options.maxRetries ?? this.maxRetries;
if (retriesRemaining == null) {
retriesRemaining = options.maxRetries ?? this.maxRetries;
retriesRemaining = maxRetries;
}

@@ -410,3 +418,3 @@

const { req, url, timeout } = this.buildRequest(options);
const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });

@@ -413,0 +421,0 @@ await this.prepareRequest(req, { url, options });

@@ -345,7 +345,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export import AmountDiscount = API.AmountDiscount;
export import BillingCycleRelativeDate = API.BillingCycleRelativeDate;
export import Discount = API.Discount;
export import InvoiceLevelDiscount = API.InvoiceLevelDiscount;
export import PaginationMetadata = API.PaginationMetadata;
export import PercentageDiscount = API.PercentageDiscount;
export import TrialDiscount = API.TrialDiscount;
}
export default Orb;

@@ -7,2 +7,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as CouponsAPI from './coupons';
import * as Shared from '../shared';
import * as SubscriptionsAPI from './subscriptions';

@@ -116,3 +117,3 @@ import { Page, type PageParams } from '../../pagination';

discount: Coupon.PercentageDiscount | Coupon.AmountDiscount;
discount: Shared.PercentageDiscount | Shared.AmountDiscount;

@@ -142,39 +143,2 @@ /**

export namespace Coupon {
export interface PercentageDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'percentage';
/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount: number;
reason?: string | null;
}
export interface AmountDiscount {
/**
* Only available if discount_type is `amount`.
*/
amount_discount: string;
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'amount';
reason?: string | null;
}
}
export interface CouponCreateParams {

@@ -181,0 +145,0 @@ discount: CouponCreateParams.NewCouponPercentageDiscount | CouponCreateParams.NewCouponAmountDiscount;

@@ -122,19 +122,2 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

*
* ## Grouping by custom attributes
*
* In order to view costs grouped by a specific _attribute_ that each event is
* tagged with (i.e. `cluster`), you can additionally specify a `group_by` key. The
* `group_by` key denotes the event property on which to group.
*
* When returning grouped costs, a separate `price_group` object in the
* `per_price_costs` array is returned for each value of the `group_by` key present
* in your events. The `subtotal` value of the `per_price_costs` object is the sum
* of each `price_group`'s total.
*
* Orb expects events will contain values in the `properties` dictionary that
* correspond to the `group_by` key specified. By default, Orb will return a `null`
* group (i.e. events that match the metric but do not have the key set).
* Currently, it is only possible to view costs grouped by a single attribute at a
* time.
*
* ### Matrix prices

@@ -276,19 +259,2 @@ *

*
* ## Grouping by custom attributes
*
* In order to view costs grouped by a specific _attribute_ that each event is
* tagged with (i.e. `cluster`), you can additionally specify a `group_by` key. The
* `group_by` key denotes the event property on which to group.
*
* When returning grouped costs, a separate `price_group` object in the
* `per_price_costs` array is returned for each value of the `group_by` key present
* in your events. The `subtotal` value of the `per_price_costs` object is the sum
* of each `price_group`'s total.
*
* Orb expects events will contain values in the `properties` dictionary that
* correspond to the `group_by` key specified. By default, Orb will return a `null`
* group (i.e. events that match the metric but do not have the key set).
* Currently, it is only possible to view costs grouped by a single attribute at a
* time.
*
* ### Matrix prices

@@ -295,0 +261,0 @@ *

// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term';
export interface AmountDiscount {
/**
* Only available if discount_type is `amount`.
*/
amount_discount: string;
export type Discount =
| Discount.PercentageDiscount
| Discount.TrialDiscount
| Discount.UsageDiscount
| Discount.AmountDiscount;
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
export namespace Discount {
export interface PercentageDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'amount';
discount_type: 'percentage';
reason?: string | null;
}
/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount: number;
export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term';
reason?: string | null;
}
export type Discount = PercentageDiscount | TrialDiscount | Discount.UsageDiscount | AmountDiscount;
export interface TrialDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'trial';
reason?: string | null;
/**
* Only available if discount_type is `trial`
*/
trial_amount_discount?: string | null;
/**
* Only available if discount_type is `trial`
*/
trial_percentage_discount?: number | null;
}
export namespace Discount {
export interface UsageDiscount {

@@ -69,25 +42,50 @@ /**

}
}
export interface AmountDiscount {
/**
* Only available if discount_type is `amount`.
*/
amount_discount: string;
export type InvoiceLevelDiscount = PercentageDiscount | AmountDiscount | TrialDiscount;
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
export interface PaginationMetadata {
has_more: boolean;
discount_type: 'amount';
next_cursor: string | null;
}
reason?: string | null;
}
export interface PercentageDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
discount_type: 'percentage';
/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount: number;
reason?: string | null;
}
export interface PaginationMetadata {
has_more: boolean;
export interface TrialDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;
next_cursor: string | null;
discount_type: 'trial';
reason?: string | null;
/**
* Only available if discount_type is `trial`
*/
trial_amount_discount?: string | null;
/**
* Only available if discount_type is `trial`
*/
trial_percentage_discount?: number | null;
}

@@ -1,1 +0,1 @@

export const VERSION = '4.21.0'; // x-release-please-version
export const VERSION = '4.23.0'; // x-release-please-version

@@ -1,2 +0,2 @@

export declare const VERSION = "4.21.0";
export declare const VERSION = "4.23.0";
//# sourceMappingURL=version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '4.21.0'; // x-release-please-version
exports.VERSION = '4.23.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

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 too big to display

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 too big to display

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 too big to display

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 too big to display

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 too big to display

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 too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc