orb-billing
Advanced tools
Comparing version 4.54.0 to 4.55.0
18
core.js
@@ -194,2 +194,3 @@ "use strict"; | ||
buildRequest(options, { retryCount = 0 } = {}) { | ||
options = { ...options }; | ||
const { method, path, query, headers: headers = {} } = options; | ||
@@ -205,5 +206,5 @@ const body = ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ? | ||
validatePositiveInteger('timeout', options.timeout); | ||
const timeout = options.timeout ?? this.timeout; | ||
options.timeout = options.timeout ?? this.timeout; | ||
const httpAgent = options.httpAgent ?? this.httpAgent ?? (0, index_1.getDefaultAgent)(url); | ||
const minAgentTimeout = timeout + 1000; | ||
const minAgentTimeout = options.timeout + 1000; | ||
if (typeof httpAgent?.options?.timeout === 'number' && | ||
@@ -232,3 +233,3 @@ minAgentTimeout > (httpAgent.options.timeout ?? 0)) { | ||
}; | ||
return { req, url, timeout }; | ||
return { req, url, timeout: options.timeout }; | ||
} | ||
@@ -247,5 +248,5 @@ buildHeaders({ options, headers, contentLength, retryCount, }) { | ||
} | ||
// Don't set the retry count header if it was already set or removed through default headers or by the | ||
// caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to | ||
// account for the removal case. | ||
// Don't set theses headers if they were already set or removed through default headers or by the caller. | ||
// We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account | ||
// for the removal case. | ||
if ((0, exports.getHeader)(defaultHeaders, 'x-stainless-retry-count') === undefined && | ||
@@ -255,2 +256,7 @@ (0, exports.getHeader)(headers, 'x-stainless-retry-count') === undefined) { | ||
} | ||
if ((0, exports.getHeader)(defaultHeaders, 'x-stainless-timeout') === undefined && | ||
(0, exports.getHeader)(headers, 'x-stainless-timeout') === undefined && | ||
options.timeout) { | ||
reqHeaders['x-stainless-timeout'] = String(options.timeout); | ||
} | ||
this.validateHeaders(reqHeaders, headers); | ||
@@ -257,0 +263,0 @@ return reqHeaders; |
{ | ||
"name": "orb-billing", | ||
"version": "4.54.0", | ||
"version": "4.55.0", | ||
"description": "The official TypeScript library for the Orb API", | ||
@@ -5,0 +5,0 @@ "author": "Orb <team@withorb.com>", |
@@ -102,2 +102,8 @@ import { APIResource } from "../../resource.js"; | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -141,2 +147,8 @@ */ | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -180,2 +192,8 @@ */ | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -219,2 +237,8 @@ */ | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -258,2 +282,8 @@ */ | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -260,0 +290,0 @@ */ |
@@ -18,3 +18,3 @@ import { APIResource } from "../resource.js"; | ||
/** | ||
* The line amount after any adjustments, before overage conversion, credits and | ||
* The line amount after any adjustments and before overage conversion, credits and | ||
* partial invoicing. | ||
@@ -24,11 +24,12 @@ */ | ||
/** | ||
* All adjustments applied to the line item. | ||
* All adjustments (ie. maximums, minimums, discounts) applied to the line item. | ||
*/ | ||
adjustments: Array<InvoiceLineItemCreateResponse.AmountDiscountAdjustment | InvoiceLineItemCreateResponse.PercentageDiscountAdjustment | InvoiceLineItemCreateResponse.UsageDiscountAdjustment | InvoiceLineItemCreateResponse.MinimumAdjustment | InvoiceLineItemCreateResponse.MaximumAdjustment>; | ||
adjustments: Array<InvoiceLineItemCreateResponse.MonetaryUsageDiscountAdjustment | InvoiceLineItemCreateResponse.MonetaryAmountDiscountAdjustment | InvoiceLineItemCreateResponse.MonetaryPercentageDiscountAdjustment | InvoiceLineItemCreateResponse.MonetaryMinimumAdjustment | InvoiceLineItemCreateResponse.MonetaryMaximumAdjustment>; | ||
/** | ||
* The final amount after any discounts or minimums. | ||
* The final amount for a line item after all adjustments and pre paid credits have | ||
* been applied. | ||
*/ | ||
amount: string; | ||
/** | ||
* The number of credits used | ||
* The number of prepaid credits applied. | ||
*/ | ||
@@ -84,2 +85,5 @@ credits_applied: string; | ||
price: PricesAPI.Price | null; | ||
/** | ||
* Either the fixed fee quantity or the usage during the service period. | ||
*/ | ||
quantity: number; | ||
@@ -96,3 +100,3 @@ /** | ||
/** | ||
* The line amount before any line item-specific discounts or minimums. | ||
* The line amount before before any adjustments. | ||
*/ | ||
@@ -107,10 +111,9 @@ subtotal: string; | ||
export declare namespace InvoiceLineItemCreateResponse { | ||
interface AmountDiscountAdjustment { | ||
interface MonetaryUsageDiscountAdjustment { | ||
id: string; | ||
adjustment_type: 'amount_discount'; | ||
adjustment_type: 'usage_discount'; | ||
/** | ||
* The amount by which to discount the prices this adjustment applies to in a given | ||
* billing period. | ||
* The value applied by an adjustment. | ||
*/ | ||
amount_discount: string; | ||
amount: string; | ||
/** | ||
@@ -126,14 +129,24 @@ * The price IDs that this adjustment applies to. | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
* The reason for the adjustment. | ||
*/ | ||
plan_phase_order: number | null; | ||
reason: string | null; | ||
/** | ||
* The reason for the adjustment. | ||
* The number of usage units by which to discount the price this adjustment applies | ||
* to in a given billing period. | ||
*/ | ||
reason: string | null; | ||
usage_discount: number; | ||
} | ||
interface PercentageDiscountAdjustment { | ||
interface MonetaryAmountDiscountAdjustment { | ||
id: string; | ||
adjustment_type: 'percentage_discount'; | ||
adjustment_type: 'amount_discount'; | ||
/** | ||
* The value applied by an adjustment. | ||
*/ | ||
amount: string; | ||
/** | ||
* The amount by which to discount the prices this adjustment applies to in a given | ||
* billing period. | ||
*/ | ||
amount_discount: string; | ||
/** | ||
* The price IDs that this adjustment applies to. | ||
@@ -148,11 +161,2 @@ */ | ||
/** | ||
* The percentage (as a value between 0 and 1) by which to discount the price | ||
* intervals this adjustment applies to in a given billing period. | ||
*/ | ||
percentage_discount: number; | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
*/ | ||
plan_phase_order: number | null; | ||
/** | ||
* The reason for the adjustment. | ||
@@ -162,6 +166,10 @@ */ | ||
} | ||
interface UsageDiscountAdjustment { | ||
interface MonetaryPercentageDiscountAdjustment { | ||
id: string; | ||
adjustment_type: 'usage_discount'; | ||
adjustment_type: 'percentage_discount'; | ||
/** | ||
* The value applied by an adjustment. | ||
*/ | ||
amount: string; | ||
/** | ||
* The price IDs that this adjustment applies to. | ||
@@ -176,5 +184,6 @@ */ | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
* The percentage (as a value between 0 and 1) by which to discount the price | ||
* intervals this adjustment applies to in a given billing period. | ||
*/ | ||
plan_phase_order: number | null; | ||
percentage_discount: number; | ||
/** | ||
@@ -184,12 +193,11 @@ * The reason for the adjustment. | ||
reason: string | null; | ||
/** | ||
* The number of usage units by which to discount the price this adjustment applies | ||
* to in a given billing period. | ||
*/ | ||
usage_discount: number; | ||
} | ||
interface MinimumAdjustment { | ||
interface MonetaryMinimumAdjustment { | ||
id: string; | ||
adjustment_type: 'minimum'; | ||
/** | ||
* The value applied by an adjustment. | ||
*/ | ||
amount: string; | ||
/** | ||
* The price IDs that this adjustment applies to. | ||
@@ -213,6 +221,2 @@ */ | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
*/ | ||
plan_phase_order: number | null; | ||
/** | ||
* The reason for the adjustment. | ||
@@ -222,6 +226,10 @@ */ | ||
} | ||
interface MaximumAdjustment { | ||
interface MonetaryMaximumAdjustment { | ||
id: string; | ||
adjustment_type: 'maximum'; | ||
/** | ||
* The value applied by an adjustment. | ||
*/ | ||
amount: string; | ||
/** | ||
* The price IDs that this adjustment applies to. | ||
@@ -241,6 +249,2 @@ */ | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
*/ | ||
plan_phase_order: number | null; | ||
/** | ||
* The reason for the adjustment. | ||
@@ -247,0 +251,0 @@ */ |
@@ -283,2 +283,3 @@ import { VERSION } from './version'; | ||
): { req: RequestInit; url: string; timeout: number } { | ||
options = { ...options }; | ||
const { method, path, query, headers: headers = {} } = options; | ||
@@ -296,5 +297,5 @@ | ||
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); | ||
const timeout = options.timeout ?? this.timeout; | ||
options.timeout = options.timeout ?? this.timeout; | ||
const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); | ||
const minAgentTimeout = timeout + 1000; | ||
const minAgentTimeout = options.timeout + 1000; | ||
if ( | ||
@@ -328,3 +329,3 @@ typeof (httpAgent as any)?.options?.timeout === 'number' && | ||
return { req, url, timeout }; | ||
return { req, url, timeout: options.timeout }; | ||
} | ||
@@ -357,5 +358,5 @@ | ||
// Don't set the retry count header if it was already set or removed through default headers or by the | ||
// caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to | ||
// account for the removal case. | ||
// Don't set theses headers if they were already set or removed through default headers or by the caller. | ||
// We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account | ||
// for the removal case. | ||
if ( | ||
@@ -367,2 +368,9 @@ getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && | ||
} | ||
if ( | ||
getHeader(defaultHeaders, 'x-stainless-timeout') === undefined && | ||
getHeader(headers, 'x-stainless-timeout') === undefined && | ||
options.timeout | ||
) { | ||
reqHeaders['x-stainless-timeout'] = String(options.timeout); | ||
} | ||
@@ -369,0 +377,0 @@ this.validateHeaders(reqHeaders, headers); |
@@ -136,2 +136,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -185,2 +192,9 @@ */ | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -234,2 +248,9 @@ */ | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -283,2 +304,9 @@ */ | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -332,2 +360,9 @@ */ | ||
/** | ||
* If `true`, existing events in the backfill's timeframe will be replaced with the | ||
* newly ingested events associated with the backfill. If `false`, newly ingested | ||
* events will be added to the existing events. | ||
*/ | ||
replace_existing_events: boolean; | ||
/** | ||
* The time at which this backfill was reverted. | ||
@@ -334,0 +369,0 @@ */ |
@@ -28,3 +28,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
/** | ||
* The line amount after any adjustments, before overage conversion, credits and | ||
* The line amount after any adjustments and before overage conversion, credits and | ||
* partial invoicing. | ||
@@ -35,14 +35,15 @@ */ | ||
/** | ||
* All adjustments applied to the line item. | ||
* All adjustments (ie. maximums, minimums, discounts) applied to the line item. | ||
*/ | ||
adjustments: Array< | ||
| InvoiceLineItemCreateResponse.AmountDiscountAdjustment | ||
| InvoiceLineItemCreateResponse.PercentageDiscountAdjustment | ||
| InvoiceLineItemCreateResponse.UsageDiscountAdjustment | ||
| InvoiceLineItemCreateResponse.MinimumAdjustment | ||
| InvoiceLineItemCreateResponse.MaximumAdjustment | ||
| InvoiceLineItemCreateResponse.MonetaryUsageDiscountAdjustment | ||
| InvoiceLineItemCreateResponse.MonetaryAmountDiscountAdjustment | ||
| InvoiceLineItemCreateResponse.MonetaryPercentageDiscountAdjustment | ||
| InvoiceLineItemCreateResponse.MonetaryMinimumAdjustment | ||
| InvoiceLineItemCreateResponse.MonetaryMaximumAdjustment | ||
>; | ||
/** | ||
* The final amount after any discounts or minimums. | ||
* The final amount for a line item after all adjustments and pre paid credits have | ||
* been applied. | ||
*/ | ||
@@ -52,3 +53,3 @@ amount: string; | ||
/** | ||
* The number of credits used | ||
* The number of prepaid credits applied. | ||
*/ | ||
@@ -115,2 +116,5 @@ credits_applied: string; | ||
/** | ||
* Either the fixed fee quantity or the usage during the service period. | ||
*/ | ||
quantity: number; | ||
@@ -134,3 +138,3 @@ | ||
/** | ||
* The line amount before any line item-specific discounts or minimums. | ||
* The line amount before before any adjustments. | ||
*/ | ||
@@ -147,12 +151,11 @@ subtotal: string; | ||
export namespace InvoiceLineItemCreateResponse { | ||
export interface AmountDiscountAdjustment { | ||
export interface MonetaryUsageDiscountAdjustment { | ||
id: string; | ||
adjustment_type: 'amount_discount'; | ||
adjustment_type: 'usage_discount'; | ||
/** | ||
* The amount by which to discount the prices this adjustment applies to in a given | ||
* billing period. | ||
* The value applied by an adjustment. | ||
*/ | ||
amount_discount: string; | ||
amount: string; | ||
@@ -171,38 +174,39 @@ /** | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
* The reason for the adjustment. | ||
*/ | ||
plan_phase_order: number | null; | ||
reason: string | null; | ||
/** | ||
* The reason for the adjustment. | ||
* The number of usage units by which to discount the price this adjustment applies | ||
* to in a given billing period. | ||
*/ | ||
reason: string | null; | ||
usage_discount: number; | ||
} | ||
export interface PercentageDiscountAdjustment { | ||
export interface MonetaryAmountDiscountAdjustment { | ||
id: string; | ||
adjustment_type: 'percentage_discount'; | ||
adjustment_type: 'amount_discount'; | ||
/** | ||
* The price IDs that this adjustment applies to. | ||
* The value applied by an adjustment. | ||
*/ | ||
applies_to_price_ids: Array<string>; | ||
amount: string; | ||
/** | ||
* True for adjustments that apply to an entire invocice, false for adjustments | ||
* that apply to only one price. | ||
* The amount by which to discount the prices this adjustment applies to in a given | ||
* billing period. | ||
*/ | ||
is_invoice_level: boolean; | ||
amount_discount: string; | ||
/** | ||
* The percentage (as a value between 0 and 1) by which to discount the price | ||
* intervals this adjustment applies to in a given billing period. | ||
* The price IDs that this adjustment applies to. | ||
*/ | ||
percentage_discount: number; | ||
applies_to_price_ids: Array<string>; | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
* True for adjustments that apply to an entire invocice, false for adjustments | ||
* that apply to only one price. | ||
*/ | ||
plan_phase_order: number | null; | ||
is_invoice_level: boolean; | ||
@@ -215,8 +219,13 @@ /** | ||
export interface UsageDiscountAdjustment { | ||
export interface MonetaryPercentageDiscountAdjustment { | ||
id: string; | ||
adjustment_type: 'usage_discount'; | ||
adjustment_type: 'percentage_discount'; | ||
/** | ||
* The value applied by an adjustment. | ||
*/ | ||
amount: string; | ||
/** | ||
* The price IDs that this adjustment applies to. | ||
@@ -233,5 +242,6 @@ */ | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
* The percentage (as a value between 0 and 1) by which to discount the price | ||
* intervals this adjustment applies to in a given billing period. | ||
*/ | ||
plan_phase_order: number | null; | ||
percentage_discount: number; | ||
@@ -242,11 +252,5 @@ /** | ||
reason: string | null; | ||
/** | ||
* The number of usage units by which to discount the price this adjustment applies | ||
* to in a given billing period. | ||
*/ | ||
usage_discount: number; | ||
} | ||
export interface MinimumAdjustment { | ||
export interface MonetaryMinimumAdjustment { | ||
id: string; | ||
@@ -257,2 +261,7 @@ | ||
/** | ||
* The value applied by an adjustment. | ||
*/ | ||
amount: string; | ||
/** | ||
* The price IDs that this adjustment applies to. | ||
@@ -280,7 +289,2 @@ */ | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
*/ | ||
plan_phase_order: number | null; | ||
/** | ||
* The reason for the adjustment. | ||
@@ -291,3 +295,3 @@ */ | ||
export interface MaximumAdjustment { | ||
export interface MonetaryMaximumAdjustment { | ||
id: string; | ||
@@ -298,2 +302,7 @@ | ||
/** | ||
* The value applied by an adjustment. | ||
*/ | ||
amount: string; | ||
/** | ||
* The price IDs that this adjustment applies to. | ||
@@ -316,7 +325,2 @@ */ | ||
/** | ||
* The plan phase in which this adjustment is active. | ||
*/ | ||
plan_phase_order: number | null; | ||
/** | ||
* The reason for the adjustment. | ||
@@ -323,0 +327,0 @@ */ |
@@ -1,1 +0,1 @@ | ||
export const VERSION = '4.54.0'; // x-release-please-version | ||
export const VERSION = '4.55.0'; // x-release-please-version |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "4.54.0"; | ||
export declare const VERSION = "4.55.0"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = void 0; | ||
exports.VERSION = '4.54.0'; // x-release-please-version | ||
exports.VERSION = '4.55.0'; // x-release-please-version | ||
//# sourceMappingURL=version.js.map |
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 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 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 not supported yet
4477201
86911