orb-billing 5.43.0 → 5.45.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 +52 -0
- package/core.d.ts +1 -1
- package/core.d.ts.map +1 -1
- package/core.js +13 -17
- package/core.js.map +1 -1
- package/core.mjs +13 -17
- package/core.mjs.map +1 -1
- package/index.d.mts +91 -5
- package/index.d.ts +91 -5
- package/index.d.ts.map +1 -1
- package/index.js +90 -2
- package/index.js.map +1 -1
- package/index.mjs +91 -3
- package/index.mjs.map +1 -1
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +33 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/alerts.d.ts +32 -1
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js +6 -0
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs +6 -0
- package/resources/alerts.mjs.map +1 -1
- package/resources/beta/beta.d.ts +8293 -140
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +5 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +5 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/external-plan-id.d.ts +8293 -140
- package/resources/beta/external-plan-id.d.ts.map +1 -1
- package/resources/beta/external-plan-id.js +5 -0
- package/resources/beta/external-plan-id.js.map +1 -1
- package/resources/beta/external-plan-id.mjs +5 -0
- package/resources/beta/external-plan-id.mjs.map +1 -1
- package/resources/coupons/coupons.d.ts +3 -0
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js +3 -0
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +3 -0
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.ts +3 -0
- package/resources/coupons/subscriptions.d.ts.map +1 -1
- package/resources/coupons/subscriptions.js +3 -0
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs +3 -0
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/credit-blocks.d.ts +85 -1
- package/resources/credit-blocks.d.ts.map +1 -1
- package/resources/credit-blocks.js +22 -0
- package/resources/credit-blocks.js.map +1 -1
- package/resources/credit-blocks.mjs +22 -0
- package/resources/credit-blocks.mjs.map +1 -1
- package/resources/credit-notes.d.ts +4 -0
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +4 -0
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +4 -0
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.d.ts +16 -0
- package/resources/customers/balance-transactions.d.ts.map +1 -1
- package/resources/customers/balance-transactions.js +16 -0
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs +16 -0
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.d.ts +16 -0
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js +16 -0
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs +16 -0
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.d.ts +39 -0
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js +3 -0
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs +3 -0
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +31 -4
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js +19 -2
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +19 -2
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.d.ts +3 -0
- package/resources/customers/credits/top-ups.d.ts.map +1 -1
- package/resources/customers/credits/top-ups.js +3 -0
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs +3 -0
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/customers.d.ts +33 -12
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +20 -3
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +20 -3
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
- package/resources/events/backfills.d.ts +5 -0
- package/resources/events/backfills.d.ts.map +1 -1
- package/resources/events/backfills.js +5 -0
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +5 -0
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.d.ts +5 -0
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +5 -0
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +5 -0
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/volume.d.ts +5 -0
- package/resources/events/volume.d.ts.map +1 -1
- package/resources/events/volume.js +5 -0
- package/resources/events/volume.js.map +1 -1
- package/resources/events/volume.mjs +5 -0
- package/resources/events/volume.mjs.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.d.ts +6 -0
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoice-line-items.js +6 -0
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +6 -0
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +432 -7
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +18 -5
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +18 -5
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.ts +6 -2
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +4 -0
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +4 -0
- package/resources/items.mjs.map +1 -1
- package/resources/license-types.d.ts +113 -0
- package/resources/license-types.d.ts.map +1 -0
- package/resources/license-types.js +44 -0
- package/resources/license-types.js.map +1 -0
- package/resources/license-types.mjs +39 -0
- package/resources/license-types.mjs.map +1 -0
- package/resources/licenses/external-licenses.d.ts +114 -0
- package/resources/licenses/external-licenses.d.ts.map +1 -0
- package/resources/licenses/external-licenses.js +18 -0
- package/resources/licenses/external-licenses.js.map +1 -0
- package/resources/licenses/external-licenses.mjs +14 -0
- package/resources/licenses/external-licenses.mjs.map +1 -0
- package/resources/licenses/index.d.ts +4 -0
- package/resources/licenses/index.d.ts.map +1 -0
- package/resources/licenses/index.js +12 -0
- package/resources/licenses/index.js.map +1 -0
- package/resources/licenses/index.mjs +5 -0
- package/resources/licenses/index.mjs.map +1 -0
- package/resources/licenses/licenses.d.ts +133 -0
- package/resources/licenses/licenses.d.ts.map +1 -0
- package/resources/licenses/licenses.js +86 -0
- package/resources/licenses/licenses.js.map +1 -0
- package/resources/licenses/licenses.mjs +58 -0
- package/resources/licenses/licenses.mjs.map +1 -0
- package/resources/licenses/usage.d.ts +211 -0
- package/resources/licenses/usage.d.ts.map +1 -0
- package/resources/licenses/usage.js +25 -0
- package/resources/licenses/usage.js.map +1 -0
- package/resources/licenses/usage.mjs +21 -0
- package/resources/licenses/usage.mjs.map +1 -0
- package/resources/licenses.d.ts +2 -0
- package/resources/licenses.d.ts.map +1 -0
- package/resources/licenses.js +19 -0
- package/resources/licenses.js.map +1 -0
- package/resources/licenses.mjs +3 -0
- package/resources/licenses.mjs.map +1 -0
- package/resources/metrics.d.ts +7 -0
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +4 -0
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +4 -0
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +5 -0
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +5 -0
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +5 -0
- package/resources/plans/external-plan-id.mjs.map +1 -1
- package/resources/plans/migrations.d.ts +5 -0
- package/resources/plans/migrations.d.ts.map +1 -1
- package/resources/plans/migrations.js +5 -0
- package/resources/plans/migrations.js.map +1 -1
- package/resources/plans/migrations.mjs +5 -0
- package/resources/plans/migrations.mjs.map +1 -1
- package/resources/plans/plans.d.ts +4200 -121
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +5 -0
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +5 -0
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +9 -0
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/external-price-id.js +9 -0
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +9 -0
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/prices.d.ts +198 -0
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +9 -0
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +9 -0
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +1040 -6
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/subscriptions.d.ts +262 -0
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/core.ts +16 -21
- package/src/index.ts +149 -5
- package/src/internal/utils/query.ts +7 -0
- package/src/resources/alerts.ts +38 -1
- package/src/resources/beta/beta.ts +9945 -194
- package/src/resources/beta/external-plan-id.ts +9945 -194
- package/src/resources/coupons/coupons.ts +3 -0
- package/src/resources/coupons/subscriptions.ts +3 -0
- package/src/resources/credit-blocks.ts +110 -1
- package/src/resources/credit-notes.ts +4 -0
- package/src/resources/customers/balance-transactions.ts +16 -0
- package/src/resources/customers/costs.ts +16 -0
- package/src/resources/customers/credits/credits.ts +45 -0
- package/src/resources/customers/credits/ledger.ts +33 -4
- package/src/resources/customers/credits/top-ups.ts +3 -0
- package/src/resources/customers/customers.ts +61 -12
- package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +1 -1
- package/src/resources/events/backfills.ts +5 -0
- package/src/resources/events/events.ts +5 -0
- package/src/resources/events/volume.ts +5 -0
- package/src/resources/index.ts +29 -1
- package/src/resources/invoice-line-items.ts +6 -0
- package/src/resources/invoices.ts +523 -6
- package/src/resources/items.ts +8 -2
- package/src/resources/license-types.ts +163 -0
- package/src/resources/licenses/external-licenses.ts +147 -0
- package/src/resources/licenses/index.ts +27 -0
- package/src/resources/licenses/licenses.ts +248 -0
- package/src/resources/licenses/usage.ts +280 -0
- package/src/resources/licenses.ts +3 -0
- package/src/resources/metrics.ts +6 -0
- package/src/resources/plans/external-plan-id.ts +5 -0
- package/src/resources/plans/migrations.ts +5 -0
- package/src/resources/plans/plans.ts +5004 -126
- package/src/resources/prices/external-price-id.ts +9 -0
- package/src/resources/prices/prices.ts +237 -0
- package/src/resources/shared.ts +1213 -0
- package/src/resources/subscriptions.ts +311 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { type Agent } from './_shims/index';
|
|
4
|
-
import
|
|
4
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
5
5
|
import * as Core from './core';
|
|
6
6
|
import * as Errors from './error';
|
|
7
7
|
import * as Pagination from './pagination';
|
|
@@ -21,7 +21,11 @@ import {
|
|
|
21
21
|
AlertsPage,
|
|
22
22
|
Threshold,
|
|
23
23
|
} from './resources/alerts';
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
CreditBlockListInvoicesResponse,
|
|
26
|
+
CreditBlockRetrieveResponse,
|
|
27
|
+
CreditBlocks,
|
|
28
|
+
} from './resources/credit-blocks';
|
|
25
29
|
import { CreditNoteCreateParams, CreditNoteListParams, CreditNotes } from './resources/credit-notes';
|
|
26
30
|
import {
|
|
27
31
|
InvoiceLineItemCreateParams,
|
|
@@ -33,6 +37,8 @@ import {
|
|
|
33
37
|
InvoiceFetchUpcomingParams,
|
|
34
38
|
InvoiceFetchUpcomingResponse,
|
|
35
39
|
InvoiceIssueParams,
|
|
40
|
+
InvoiceIssueSummaryParams,
|
|
41
|
+
InvoiceIssueSummaryResponse,
|
|
36
42
|
InvoiceListParams,
|
|
37
43
|
InvoiceListSummaryParams,
|
|
38
44
|
InvoiceListSummaryResponse,
|
|
@@ -49,6 +55,15 @@ import {
|
|
|
49
55
|
Items,
|
|
50
56
|
ItemsPage,
|
|
51
57
|
} from './resources/items';
|
|
58
|
+
import {
|
|
59
|
+
LicenseTypeCreateParams,
|
|
60
|
+
LicenseTypeCreateResponse,
|
|
61
|
+
LicenseTypeListParams,
|
|
62
|
+
LicenseTypeListResponse,
|
|
63
|
+
LicenseTypeListResponsesPage,
|
|
64
|
+
LicenseTypeRetrieveResponse,
|
|
65
|
+
LicenseTypes,
|
|
66
|
+
} from './resources/license-types';
|
|
52
67
|
import {
|
|
53
68
|
BillableMetric,
|
|
54
69
|
BillableMetricsPage,
|
|
@@ -167,6 +182,19 @@ import {
|
|
|
167
182
|
EventUpdateResponse,
|
|
168
183
|
Events,
|
|
169
184
|
} from './resources/events/events';
|
|
185
|
+
import {
|
|
186
|
+
LicenseCreateParams,
|
|
187
|
+
LicenseCreateResponse,
|
|
188
|
+
LicenseDeactivateParams,
|
|
189
|
+
LicenseDeactivateResponse,
|
|
190
|
+
LicenseListParams,
|
|
191
|
+
LicenseListResponse,
|
|
192
|
+
LicenseListResponsesPage,
|
|
193
|
+
LicenseRetrieveByExternalIDParams,
|
|
194
|
+
LicenseRetrieveByExternalIDResponse,
|
|
195
|
+
LicenseRetrieveResponse,
|
|
196
|
+
Licenses,
|
|
197
|
+
} from './resources/licenses/licenses';
|
|
170
198
|
import {
|
|
171
199
|
Plan,
|
|
172
200
|
PlanCreateParams,
|
|
@@ -317,23 +345,105 @@ export class Orb extends Core.APIClient {
|
|
|
317
345
|
}
|
|
318
346
|
|
|
319
347
|
topLevel: API.TopLevel = new API.TopLevel(this);
|
|
348
|
+
/**
|
|
349
|
+
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a
|
|
350
|
+
* customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices
|
|
351
|
+
* in the [Price resource](/reference/price).
|
|
352
|
+
*/
|
|
320
353
|
beta: API.Beta = new API.Beta(this);
|
|
354
|
+
/**
|
|
355
|
+
* A coupon represents a reusable discount configuration that can be applied either as a fixed or percentage amount to an invoice or subscription. Coupons are activated using a redemption code, which applies the discount to a subscription or invoice. The duration of a coupon determines how long it remains available for use by end users.
|
|
356
|
+
*/
|
|
321
357
|
coupons: API.Coupons = new API.Coupons(this);
|
|
358
|
+
/**
|
|
359
|
+
* The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a
|
|
360
|
+
* particular invoice.
|
|
361
|
+
*/
|
|
322
362
|
creditNotes: API.CreditNotes = new API.CreditNotes(this);
|
|
363
|
+
/**
|
|
364
|
+
* A customer is a buyer of your products, and the other party to the billing relationship.
|
|
365
|
+
*
|
|
366
|
+
* In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these
|
|
367
|
+
* match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an
|
|
368
|
+
* `external_customer_id` with your own identifier. See
|
|
369
|
+
* [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these
|
|
370
|
+
* aliases work in Orb.
|
|
371
|
+
*
|
|
372
|
+
* In addition to having an identifier in your system, a customer may exist in a payment provider solution like
|
|
373
|
+
* Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping.
|
|
374
|
+
*
|
|
375
|
+
* A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which
|
|
376
|
+
* defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for
|
|
377
|
+
* information on what this timezone parameter influences within Orb.
|
|
378
|
+
*/
|
|
323
379
|
customers: API.Customers = new API.Customers(this);
|
|
380
|
+
/**
|
|
381
|
+
* The [Event](/core-concepts#event) resource represents a usage event that has been created for a
|
|
382
|
+
* customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for
|
|
383
|
+
* a given billing period.
|
|
384
|
+
*/
|
|
324
385
|
events: API.Events = new API.Events(this);
|
|
386
|
+
/**
|
|
387
|
+
* An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for
|
|
388
|
+
* a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and
|
|
389
|
+
* can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as
|
|
390
|
+
* the result of an action, such as a cancellation.
|
|
391
|
+
*/
|
|
325
392
|
invoiceLineItems: API.InvoiceLineItems = new API.InvoiceLineItems(this);
|
|
393
|
+
/**
|
|
394
|
+
* An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for
|
|
395
|
+
* a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and
|
|
396
|
+
* can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as
|
|
397
|
+
* the result of an action, such as a cancellation.
|
|
398
|
+
*/
|
|
326
399
|
invoices: API.Invoices = new API.Invoices(this);
|
|
400
|
+
/**
|
|
401
|
+
* The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics,
|
|
402
|
+
* and prices and are used for defining external sync behavior for invoices and tax calculation purposes.
|
|
403
|
+
*/
|
|
327
404
|
items: API.Items = new API.Items(this);
|
|
405
|
+
/**
|
|
406
|
+
* The Metric resource represents a calculation of a quantity based on events.
|
|
407
|
+
* Metrics are defined by the query that transforms raw usage events into meaningful values for your customers.
|
|
408
|
+
*/
|
|
328
409
|
metrics: API.Metrics = new API.Metrics(this);
|
|
410
|
+
/**
|
|
411
|
+
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a
|
|
412
|
+
* customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices
|
|
413
|
+
* in the [Price resource](/reference/price).
|
|
414
|
+
*/
|
|
329
415
|
plans: API.Plans = new API.Plans(this);
|
|
416
|
+
/**
|
|
417
|
+
* The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in
|
|
418
|
+
* the form of an invoice line item. Prices take a quantity and determine an amount to bill.
|
|
419
|
+
*
|
|
420
|
+
* Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a
|
|
421
|
+
* given Price object. The model_type field determines the key for the configuration object that is present.
|
|
422
|
+
*
|
|
423
|
+
* For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price)
|
|
424
|
+
*/
|
|
330
425
|
prices: API.Prices = new API.Prices(this);
|
|
331
426
|
subscriptions: API.Subscriptions = new API.Subscriptions(this);
|
|
332
427
|
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
428
|
+
/**
|
|
429
|
+
* [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
|
|
430
|
+
* usage, or credit balance and trigger webhooks when a threshold is exceeded.
|
|
431
|
+
*
|
|
432
|
+
* Alerts created through the API can be scoped to either customers or subscriptions.
|
|
433
|
+
*/
|
|
333
434
|
alerts: API.Alerts = new API.Alerts(this);
|
|
334
435
|
dimensionalPriceGroups: API.DimensionalPriceGroups = new API.DimensionalPriceGroups(this);
|
|
335
436
|
subscriptionChanges: API.SubscriptionChanges = new API.SubscriptionChanges(this);
|
|
437
|
+
/**
|
|
438
|
+
* The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb.
|
|
439
|
+
*/
|
|
336
440
|
creditBlocks: API.CreditBlocks = new API.CreditBlocks(this);
|
|
441
|
+
/**
|
|
442
|
+
* The LicenseType resource represents a type of license that can be assigned to users.
|
|
443
|
+
* License types are used during billing by grouping metrics on the configured grouping key.
|
|
444
|
+
*/
|
|
445
|
+
licenseTypes: API.LicenseTypes = new API.LicenseTypes(this);
|
|
446
|
+
licenses: API.Licenses = new API.Licenses(this);
|
|
337
447
|
|
|
338
448
|
/**
|
|
339
449
|
* Check whether the base URL is set to its default.
|
|
@@ -357,8 +467,8 @@ export class Orb extends Core.APIClient {
|
|
|
357
467
|
return { Authorization: `Bearer ${this.apiKey}` };
|
|
358
468
|
}
|
|
359
469
|
|
|
360
|
-
protected override stringifyQuery(query: Record<string, unknown>): string {
|
|
361
|
-
return
|
|
470
|
+
protected override stringifyQuery(query: object | Record<string, unknown>): string {
|
|
471
|
+
return stringifyQuery(query);
|
|
362
472
|
}
|
|
363
473
|
|
|
364
474
|
static Orb = this;
|
|
@@ -420,6 +530,10 @@ Orb.DimensionalPriceGroupsPage = DimensionalPriceGroupsPage;
|
|
|
420
530
|
Orb.SubscriptionChanges = SubscriptionChanges;
|
|
421
531
|
Orb.SubscriptionChangeListResponsesPage = SubscriptionChangeListResponsesPage;
|
|
422
532
|
Orb.CreditBlocks = CreditBlocks;
|
|
533
|
+
Orb.LicenseTypes = LicenseTypes;
|
|
534
|
+
Orb.LicenseTypeListResponsesPage = LicenseTypeListResponsesPage;
|
|
535
|
+
Orb.Licenses = Licenses;
|
|
536
|
+
Orb.LicenseListResponsesPage = LicenseListResponsesPage;
|
|
423
537
|
|
|
424
538
|
export declare namespace Orb {
|
|
425
539
|
export type RequestOptions = Core.RequestOptions;
|
|
@@ -489,6 +603,7 @@ export declare namespace Orb {
|
|
|
489
603
|
export {
|
|
490
604
|
Invoices as Invoices,
|
|
491
605
|
type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse,
|
|
606
|
+
type InvoiceIssueSummaryResponse as InvoiceIssueSummaryResponse,
|
|
492
607
|
type InvoiceListSummaryResponse as InvoiceListSummaryResponse,
|
|
493
608
|
InvoiceListSummaryResponsesPage as InvoiceListSummaryResponsesPage,
|
|
494
609
|
type InvoiceCreateParams as InvoiceCreateParams,
|
|
@@ -496,6 +611,7 @@ export declare namespace Orb {
|
|
|
496
611
|
type InvoiceListParams as InvoiceListParams,
|
|
497
612
|
type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams,
|
|
498
613
|
type InvoiceIssueParams as InvoiceIssueParams,
|
|
614
|
+
type InvoiceIssueSummaryParams as InvoiceIssueSummaryParams,
|
|
499
615
|
type InvoiceListSummaryParams as InvoiceListSummaryParams,
|
|
500
616
|
type InvoiceMarkPaidParams as InvoiceMarkPaidParams,
|
|
501
617
|
};
|
|
@@ -626,7 +742,35 @@ export declare namespace Orb {
|
|
|
626
742
|
type SubscriptionChangeApplyParams as SubscriptionChangeApplyParams,
|
|
627
743
|
};
|
|
628
744
|
|
|
629
|
-
export {
|
|
745
|
+
export {
|
|
746
|
+
CreditBlocks as CreditBlocks,
|
|
747
|
+
type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse,
|
|
748
|
+
type CreditBlockListInvoicesResponse as CreditBlockListInvoicesResponse,
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
export {
|
|
752
|
+
LicenseTypes as LicenseTypes,
|
|
753
|
+
type LicenseTypeCreateResponse as LicenseTypeCreateResponse,
|
|
754
|
+
type LicenseTypeRetrieveResponse as LicenseTypeRetrieveResponse,
|
|
755
|
+
type LicenseTypeListResponse as LicenseTypeListResponse,
|
|
756
|
+
LicenseTypeListResponsesPage as LicenseTypeListResponsesPage,
|
|
757
|
+
type LicenseTypeCreateParams as LicenseTypeCreateParams,
|
|
758
|
+
type LicenseTypeListParams as LicenseTypeListParams,
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
export {
|
|
762
|
+
Licenses as Licenses,
|
|
763
|
+
type LicenseCreateResponse as LicenseCreateResponse,
|
|
764
|
+
type LicenseRetrieveResponse as LicenseRetrieveResponse,
|
|
765
|
+
type LicenseListResponse as LicenseListResponse,
|
|
766
|
+
type LicenseDeactivateResponse as LicenseDeactivateResponse,
|
|
767
|
+
type LicenseRetrieveByExternalIDResponse as LicenseRetrieveByExternalIDResponse,
|
|
768
|
+
LicenseListResponsesPage as LicenseListResponsesPage,
|
|
769
|
+
type LicenseCreateParams as LicenseCreateParams,
|
|
770
|
+
type LicenseListParams as LicenseListParams,
|
|
771
|
+
type LicenseDeactivateParams as LicenseDeactivateParams,
|
|
772
|
+
type LicenseRetrieveByExternalIDParams as LicenseRetrieveByExternalIDParams,
|
|
773
|
+
};
|
|
630
774
|
|
|
631
775
|
export type Address = API.Address;
|
|
632
776
|
export type AdjustmentInterval = API.AdjustmentInterval;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as qs from '../qs/stringify';
|
|
4
|
+
|
|
5
|
+
export function stringifyQuery(query: object | Record<string, unknown>) {
|
|
6
|
+
return qs.stringify(query, { arrayFormat: 'brackets' });
|
|
7
|
+
}
|
package/src/resources/alerts.ts
CHANGED
|
@@ -6,6 +6,12 @@ import * as Core from '../core';
|
|
|
6
6
|
import * as Shared from './shared';
|
|
7
7
|
import { Page, type PageParams } from '../pagination';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
|
|
11
|
+
* usage, or credit balance and trigger webhooks when a threshold is exceeded.
|
|
12
|
+
*
|
|
13
|
+
* Alerts created through the API can be scoped to either customers or subscriptions.
|
|
14
|
+
*/
|
|
9
15
|
export class Alerts extends APIResource {
|
|
10
16
|
/**
|
|
11
17
|
* This endpoint retrieves an alert by its ID.
|
|
@@ -224,13 +230,25 @@ export interface Alert {
|
|
|
224
230
|
| 'credit_balance_dropped'
|
|
225
231
|
| 'credit_balance_recovered'
|
|
226
232
|
| 'usage_exceeded'
|
|
227
|
-
| 'cost_exceeded'
|
|
233
|
+
| 'cost_exceeded'
|
|
234
|
+
| 'license_balance_threshold_reached';
|
|
228
235
|
|
|
229
236
|
/**
|
|
230
237
|
* The current status of the alert. This field is only present for credit balance
|
|
231
238
|
* alerts.
|
|
232
239
|
*/
|
|
233
240
|
balance_alert_status?: Array<Alert.BalanceAlertStatus> | null;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* The property keys to group cost alerts by. Only present for cost alerts with
|
|
244
|
+
* grouping enabled.
|
|
245
|
+
*/
|
|
246
|
+
grouping_keys?: Array<string> | null;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Minified license type for alert serialization.
|
|
250
|
+
*/
|
|
251
|
+
license_type?: Alert.LicenseType | null;
|
|
234
252
|
}
|
|
235
253
|
|
|
236
254
|
export namespace Alert {
|
|
@@ -273,6 +291,13 @@ export namespace Alert {
|
|
|
273
291
|
*/
|
|
274
292
|
threshold_value: number;
|
|
275
293
|
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Minified license type for alert serialization.
|
|
297
|
+
*/
|
|
298
|
+
export interface LicenseType {
|
|
299
|
+
id: string;
|
|
300
|
+
}
|
|
276
301
|
}
|
|
277
302
|
|
|
278
303
|
/**
|
|
@@ -365,10 +390,22 @@ export interface AlertCreateForSubscriptionParams {
|
|
|
365
390
|
*/
|
|
366
391
|
type: 'usage_exceeded' | 'cost_exceeded';
|
|
367
392
|
|
|
393
|
+
/**
|
|
394
|
+
* The property keys to group cost alerts by. Only applicable for cost_exceeded
|
|
395
|
+
* alerts.
|
|
396
|
+
*/
|
|
397
|
+
grouping_keys?: Array<string> | null;
|
|
398
|
+
|
|
368
399
|
/**
|
|
369
400
|
* The metric to track usage for.
|
|
370
401
|
*/
|
|
371
402
|
metric_id?: string | null;
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* The pricing unit to use for grouped cost alerts. Required when grouping_keys is
|
|
406
|
+
* set.
|
|
407
|
+
*/
|
|
408
|
+
pricing_unit_id?: string | null;
|
|
372
409
|
}
|
|
373
410
|
|
|
374
411
|
export interface AlertDisableParams {
|