orb-billing 4.74.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/index.d.mts +148 -14
- package/index.d.ts +148 -14
- package/index.d.ts.map +1 -1
- package/index.js +0 -3
- package/index.js.map +1 -1
- package/index.mjs +3 -6
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/alerts.d.ts +20 -88
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs.map +1 -1
- package/resources/beta/beta.d.ts +9 -7313
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/external-plan-id.d.ts +7 -7074
- package/resources/beta/external-plan-id.d.ts.map +1 -1
- package/resources/beta/external-plan-id.js.map +1 -1
- package/resources/beta/external-plan-id.mjs.map +1 -1
- package/resources/credit-notes.d.ts +9 -163
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +3 -6
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +2 -4
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.d.ts +5 -32
- package/resources/customers/balance-transactions.d.ts.map +1 -1
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.d.ts +3 -81
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/credits/credits.d.ts +4 -4
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/index.d.ts +2 -2
- package/resources/customers/credits/index.d.ts.map +1 -1
- package/resources/customers/credits/index.js.map +1 -1
- package/resources/customers/credits/index.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +171 -962
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.d.ts +29 -121
- package/resources/customers/credits/top-ups.d.ts.map +1 -1
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/customers.d.ts +72 -678
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.d.ts +1 -1
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs.map +1 -1
- package/resources/index.d.ts +7 -7
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -3
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.d.ts +6 -395
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +30 -1700
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +3 -6
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +2 -4
- package/resources/invoices.mjs.map +1 -1
- package/resources/plans/plans.d.ts +7 -3801
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +3 -3
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/index.d.ts +1 -1
- package/resources/prices/index.d.ts.map +1 -1
- package/resources/prices/index.js +1 -2
- package/resources/prices/index.js.map +1 -1
- package/resources/prices/index.mjs +1 -1
- package/resources/prices/index.mjs.map +1 -1
- package/resources/prices/prices.d.ts +346 -9372
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +39 -20
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +38 -18
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +7269 -9
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js +11 -0
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs +7 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/subscription-changes.d.ts +138 -2158
- package/resources/subscription-changes.d.ts.map +1 -1
- package/resources/subscription-changes.js.map +1 -1
- package/resources/subscription-changes.mjs.map +1 -1
- package/resources/subscriptions.d.ts +2639 -27234
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/index.ts +219 -42
- package/src/resources/alerts.ts +20 -94
- package/src/resources/beta/beta.ts +124 -8892
- package/src/resources/beta/external-plan-id.ts +118 -8593
- package/src/resources/credit-notes.ts +10 -217
- package/src/resources/customers/balance-transactions.ts +5 -36
- package/src/resources/customers/costs.ts +3 -101
- package/src/resources/customers/credits/credits.ts +18 -0
- package/src/resources/customers/credits/index.ts +9 -0
- package/src/resources/customers/credits/ledger.ts +212 -1435
- package/src/resources/customers/credits/top-ups.ts +33 -136
- package/src/resources/customers/customers.ts +162 -1454
- package/src/resources/customers/index.ts +8 -0
- package/src/resources/index.ts +42 -22
- package/src/resources/invoice-line-items.ts +10 -501
- package/src/resources/invoices.ts +60 -2394
- package/src/resources/plans/plans.ts +38 -4588
- package/src/resources/prices/external-price-id.ts +3 -3
- package/src/resources/prices/index.ts +2 -2
- package/src/resources/prices/prices.ts +500 -11810
- package/src/resources/shared.ts +9582 -22
- package/src/resources/subscription-changes.ts +171 -2670
- package/src/resources/subscriptions.ts +3162 -32900
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../resource.mjs";
|
|
3
3
|
import { isRequestOptions } from "../../core.mjs";
|
|
4
|
+
import { PricesPage } from "../shared.mjs";
|
|
4
5
|
import * as ExternalPriceIDAPI from "./external-price-id.mjs";
|
|
5
6
|
import { ExternalPriceID } from "./external-price-id.mjs";
|
|
6
|
-
import { Page } from "../../pagination.mjs";
|
|
7
7
|
export class Prices extends APIResource {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
@@ -70,23 +70,14 @@ export class Prices extends APIResource {
|
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* This endpoint is used to evaluate the output of price(s) for a given customer
|
|
73
|
-
* and time range over
|
|
74
|
-
*
|
|
73
|
+
* and time range over ingested events. It enables filtering and grouping the
|
|
74
|
+
* output using
|
|
75
75
|
* [computed properties](/extensibility/advanced-metrics#computed-properties),
|
|
76
76
|
* supporting the following workflows:
|
|
77
77
|
*
|
|
78
78
|
* 1. Showing detailed usage and costs to the end customer.
|
|
79
79
|
* 2. Auditing subtotals on invoice line items.
|
|
80
80
|
*
|
|
81
|
-
* Prices may either reference existing prices in your Orb account or be defined
|
|
82
|
-
* inline in the request body. Up to 100 prices can be evaluated in a single
|
|
83
|
-
* request.
|
|
84
|
-
*
|
|
85
|
-
* Price evaluation by default uses ingested events, but you can also provide a
|
|
86
|
-
* list of preview events to use instead. Up to 500 preview events can be provided
|
|
87
|
-
* in a single request. When using ingested events, the start of the time range
|
|
88
|
-
* must be no more than 100 days ago.
|
|
89
|
-
*
|
|
90
81
|
* For these workflows, the expressiveness of computed properties in both the
|
|
91
82
|
* filters and grouping is critical. For example, if you'd like to show your
|
|
92
83
|
* customer their usage grouped by hour and another property, you can do so with
|
|
@@ -96,13 +87,44 @@ export class Prices extends APIResource {
|
|
|
96
87
|
* with the following `filter`:
|
|
97
88
|
* `my_property = 'foo' AND my_other_property = 'bar'`.
|
|
98
89
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
90
|
+
* Prices may either reference existing prices in your Orb account or be defined
|
|
91
|
+
* inline in the request body. Up to 100 prices can be evaluated in a single
|
|
92
|
+
* request.
|
|
93
|
+
*
|
|
94
|
+
* Prices are evaluated on ingested events and the start of the time range must be
|
|
95
|
+
* no more than 100 days ago. To evaluate based off a set of provided events, the
|
|
96
|
+
* [evaluate preview events](/api-reference/price/evaluate-preview-events) endpoint
|
|
97
|
+
* can be used instead.
|
|
98
|
+
*
|
|
99
|
+
* Note that this is a POST endpoint rather than a GET endpoint because it employs
|
|
100
|
+
* a JSON body rather than query parameters.
|
|
102
101
|
*/
|
|
103
102
|
evaluateMultiple(body, options) {
|
|
104
103
|
return this._client.post('/prices/evaluate', { body, ...options });
|
|
105
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* This endpoint evaluates prices on preview events instead of actual usage, making
|
|
107
|
+
* it ideal for building price calculators and cost estimation tools. You can
|
|
108
|
+
* filter and group results using
|
|
109
|
+
* [computed properties](/extensibility/advanced-metrics#computed-properties) to
|
|
110
|
+
* analyze pricing across different dimensions.
|
|
111
|
+
*
|
|
112
|
+
* Prices may either reference existing prices in your Orb account or be defined
|
|
113
|
+
* inline in the request body. The endpoint has the following limitations:
|
|
114
|
+
*
|
|
115
|
+
* 1. Up to 100 prices can be evaluated in a single request.
|
|
116
|
+
* 2. Up to 500 preview events can be provided in a single request.
|
|
117
|
+
*
|
|
118
|
+
* A top-level customer_id is required to evaluate the preview events.
|
|
119
|
+
* Additionally, all events without a customer_id will have the top-level
|
|
120
|
+
* customer_id added.
|
|
121
|
+
*
|
|
122
|
+
* Note that this is a POST endpoint rather than a GET endpoint because it employs
|
|
123
|
+
* a JSON body rather than query parameters.
|
|
124
|
+
*/
|
|
125
|
+
evaluatePreviewEvents(body, options) {
|
|
126
|
+
return this._client.post('/prices/evaluate_preview_events', { body, ...options });
|
|
127
|
+
}
|
|
106
128
|
/**
|
|
107
129
|
* This endpoint returns a price given an identifier.
|
|
108
130
|
*/
|
|
@@ -110,8 +132,6 @@ export class Prices extends APIResource {
|
|
|
110
132
|
return this._client.get(`/prices/${priceId}`, options);
|
|
111
133
|
}
|
|
112
134
|
}
|
|
113
|
-
export class PricesPage extends Page {
|
|
114
|
-
}
|
|
115
|
-
Prices.PricesPage = PricesPage;
|
|
116
135
|
Prices.ExternalPriceID = ExternalPriceID;
|
|
136
|
+
export { PricesPage };
|
|
117
137
|
//# sourceMappingURL=prices.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prices.mjs","sourceRoot":"","sources":["../../src/resources/prices/prices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,KAAK,kBAAkB;OACvB,EAAE,eAAe,EAA+B;
|
|
1
|
+
{"version":3,"file":"prices.mjs","sourceRoot":"","sources":["../../src/resources/prices/prices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,UAAU,EAAE;OACd,KAAK,kBAAkB;OACvB,EAAE,eAAe,EAA+B;AAGvD,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,oBAAe,GAAuC,IAAI,kBAAkB,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAyJ7G,CAAC;IAvJC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAuB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,OAAe,EACf,IAAuB,EACvB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAA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