orb-billing 5.44.0 → 5.46.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 +8 -17
- package/core.js.map +1 -1
- package/core.mjs +8 -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 +21 -0
- 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 +57 -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 +443 -10
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +24 -9
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +24 -9
- 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 +10 -21
- package/src/index.ts +151 -5
- package/src/internal/utils/query.ts +7 -0
- package/src/resources/alerts.ts +24 -0
- 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 +89 -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 +30 -1
- package/src/resources/invoice-line-items.ts +6 -0
- package/src/resources/invoices.ts +541 -10
- 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,11 +37,14 @@ import {
|
|
|
33
37
|
InvoiceFetchUpcomingParams,
|
|
34
38
|
InvoiceFetchUpcomingResponse,
|
|
35
39
|
InvoiceIssueParams,
|
|
40
|
+
InvoiceIssueSummaryParams,
|
|
41
|
+
InvoiceIssueSummaryResponse,
|
|
36
42
|
InvoiceListParams,
|
|
37
43
|
InvoiceListSummaryParams,
|
|
38
44
|
InvoiceListSummaryResponse,
|
|
39
45
|
InvoiceListSummaryResponsesPage,
|
|
40
46
|
InvoiceMarkPaidParams,
|
|
47
|
+
InvoicePayParams,
|
|
41
48
|
InvoiceUpdateParams,
|
|
42
49
|
Invoices,
|
|
43
50
|
} from './resources/invoices';
|
|
@@ -49,6 +56,15 @@ import {
|
|
|
49
56
|
Items,
|
|
50
57
|
ItemsPage,
|
|
51
58
|
} from './resources/items';
|
|
59
|
+
import {
|
|
60
|
+
LicenseTypeCreateParams,
|
|
61
|
+
LicenseTypeCreateResponse,
|
|
62
|
+
LicenseTypeListParams,
|
|
63
|
+
LicenseTypeListResponse,
|
|
64
|
+
LicenseTypeListResponsesPage,
|
|
65
|
+
LicenseTypeRetrieveResponse,
|
|
66
|
+
LicenseTypes,
|
|
67
|
+
} from './resources/license-types';
|
|
52
68
|
import {
|
|
53
69
|
BillableMetric,
|
|
54
70
|
BillableMetricsPage,
|
|
@@ -167,6 +183,19 @@ import {
|
|
|
167
183
|
EventUpdateResponse,
|
|
168
184
|
Events,
|
|
169
185
|
} from './resources/events/events';
|
|
186
|
+
import {
|
|
187
|
+
LicenseCreateParams,
|
|
188
|
+
LicenseCreateResponse,
|
|
189
|
+
LicenseDeactivateParams,
|
|
190
|
+
LicenseDeactivateResponse,
|
|
191
|
+
LicenseListParams,
|
|
192
|
+
LicenseListResponse,
|
|
193
|
+
LicenseListResponsesPage,
|
|
194
|
+
LicenseRetrieveByExternalIDParams,
|
|
195
|
+
LicenseRetrieveByExternalIDResponse,
|
|
196
|
+
LicenseRetrieveResponse,
|
|
197
|
+
Licenses,
|
|
198
|
+
} from './resources/licenses/licenses';
|
|
170
199
|
import {
|
|
171
200
|
Plan,
|
|
172
201
|
PlanCreateParams,
|
|
@@ -317,23 +346,105 @@ export class Orb extends Core.APIClient {
|
|
|
317
346
|
}
|
|
318
347
|
|
|
319
348
|
topLevel: API.TopLevel = new API.TopLevel(this);
|
|
349
|
+
/**
|
|
350
|
+
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a
|
|
351
|
+
* customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices
|
|
352
|
+
* in the [Price resource](/reference/price).
|
|
353
|
+
*/
|
|
320
354
|
beta: API.Beta = new API.Beta(this);
|
|
355
|
+
/**
|
|
356
|
+
* 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.
|
|
357
|
+
*/
|
|
321
358
|
coupons: API.Coupons = new API.Coupons(this);
|
|
359
|
+
/**
|
|
360
|
+
* The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a
|
|
361
|
+
* particular invoice.
|
|
362
|
+
*/
|
|
322
363
|
creditNotes: API.CreditNotes = new API.CreditNotes(this);
|
|
364
|
+
/**
|
|
365
|
+
* A customer is a buyer of your products, and the other party to the billing relationship.
|
|
366
|
+
*
|
|
367
|
+
* In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these
|
|
368
|
+
* match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an
|
|
369
|
+
* `external_customer_id` with your own identifier. See
|
|
370
|
+
* [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these
|
|
371
|
+
* aliases work in Orb.
|
|
372
|
+
*
|
|
373
|
+
* In addition to having an identifier in your system, a customer may exist in a payment provider solution like
|
|
374
|
+
* Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping.
|
|
375
|
+
*
|
|
376
|
+
* A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which
|
|
377
|
+
* defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for
|
|
378
|
+
* information on what this timezone parameter influences within Orb.
|
|
379
|
+
*/
|
|
323
380
|
customers: API.Customers = new API.Customers(this);
|
|
381
|
+
/**
|
|
382
|
+
* The [Event](/core-concepts#event) resource represents a usage event that has been created for a
|
|
383
|
+
* customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for
|
|
384
|
+
* a given billing period.
|
|
385
|
+
*/
|
|
324
386
|
events: API.Events = new API.Events(this);
|
|
387
|
+
/**
|
|
388
|
+
* An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for
|
|
389
|
+
* a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and
|
|
390
|
+
* can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as
|
|
391
|
+
* the result of an action, such as a cancellation.
|
|
392
|
+
*/
|
|
325
393
|
invoiceLineItems: API.InvoiceLineItems = new API.InvoiceLineItems(this);
|
|
394
|
+
/**
|
|
395
|
+
* An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for
|
|
396
|
+
* a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and
|
|
397
|
+
* can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as
|
|
398
|
+
* the result of an action, such as a cancellation.
|
|
399
|
+
*/
|
|
326
400
|
invoices: API.Invoices = new API.Invoices(this);
|
|
401
|
+
/**
|
|
402
|
+
* The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics,
|
|
403
|
+
* and prices and are used for defining external sync behavior for invoices and tax calculation purposes.
|
|
404
|
+
*/
|
|
327
405
|
items: API.Items = new API.Items(this);
|
|
406
|
+
/**
|
|
407
|
+
* The Metric resource represents a calculation of a quantity based on events.
|
|
408
|
+
* Metrics are defined by the query that transforms raw usage events into meaningful values for your customers.
|
|
409
|
+
*/
|
|
328
410
|
metrics: API.Metrics = new API.Metrics(this);
|
|
411
|
+
/**
|
|
412
|
+
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a
|
|
413
|
+
* customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices
|
|
414
|
+
* in the [Price resource](/reference/price).
|
|
415
|
+
*/
|
|
329
416
|
plans: API.Plans = new API.Plans(this);
|
|
417
|
+
/**
|
|
418
|
+
* The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in
|
|
419
|
+
* the form of an invoice line item. Prices take a quantity and determine an amount to bill.
|
|
420
|
+
*
|
|
421
|
+
* Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a
|
|
422
|
+
* given Price object. The model_type field determines the key for the configuration object that is present.
|
|
423
|
+
*
|
|
424
|
+
* For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price)
|
|
425
|
+
*/
|
|
330
426
|
prices: API.Prices = new API.Prices(this);
|
|
331
427
|
subscriptions: API.Subscriptions = new API.Subscriptions(this);
|
|
332
428
|
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
429
|
+
/**
|
|
430
|
+
* [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
|
|
431
|
+
* usage, or credit balance and trigger webhooks when a threshold is exceeded.
|
|
432
|
+
*
|
|
433
|
+
* Alerts created through the API can be scoped to either customers or subscriptions.
|
|
434
|
+
*/
|
|
333
435
|
alerts: API.Alerts = new API.Alerts(this);
|
|
334
436
|
dimensionalPriceGroups: API.DimensionalPriceGroups = new API.DimensionalPriceGroups(this);
|
|
335
437
|
subscriptionChanges: API.SubscriptionChanges = new API.SubscriptionChanges(this);
|
|
438
|
+
/**
|
|
439
|
+
* The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb.
|
|
440
|
+
*/
|
|
336
441
|
creditBlocks: API.CreditBlocks = new API.CreditBlocks(this);
|
|
442
|
+
/**
|
|
443
|
+
* The LicenseType resource represents a type of license that can be assigned to users.
|
|
444
|
+
* License types are used during billing by grouping metrics on the configured grouping key.
|
|
445
|
+
*/
|
|
446
|
+
licenseTypes: API.LicenseTypes = new API.LicenseTypes(this);
|
|
447
|
+
licenses: API.Licenses = new API.Licenses(this);
|
|
337
448
|
|
|
338
449
|
/**
|
|
339
450
|
* Check whether the base URL is set to its default.
|
|
@@ -357,8 +468,8 @@ export class Orb extends Core.APIClient {
|
|
|
357
468
|
return { Authorization: `Bearer ${this.apiKey}` };
|
|
358
469
|
}
|
|
359
470
|
|
|
360
|
-
protected override stringifyQuery(query: Record<string, unknown>): string {
|
|
361
|
-
return
|
|
471
|
+
protected override stringifyQuery(query: object | Record<string, unknown>): string {
|
|
472
|
+
return stringifyQuery(query);
|
|
362
473
|
}
|
|
363
474
|
|
|
364
475
|
static Orb = this;
|
|
@@ -420,6 +531,10 @@ Orb.DimensionalPriceGroupsPage = DimensionalPriceGroupsPage;
|
|
|
420
531
|
Orb.SubscriptionChanges = SubscriptionChanges;
|
|
421
532
|
Orb.SubscriptionChangeListResponsesPage = SubscriptionChangeListResponsesPage;
|
|
422
533
|
Orb.CreditBlocks = CreditBlocks;
|
|
534
|
+
Orb.LicenseTypes = LicenseTypes;
|
|
535
|
+
Orb.LicenseTypeListResponsesPage = LicenseTypeListResponsesPage;
|
|
536
|
+
Orb.Licenses = Licenses;
|
|
537
|
+
Orb.LicenseListResponsesPage = LicenseListResponsesPage;
|
|
423
538
|
|
|
424
539
|
export declare namespace Orb {
|
|
425
540
|
export type RequestOptions = Core.RequestOptions;
|
|
@@ -489,6 +604,7 @@ export declare namespace Orb {
|
|
|
489
604
|
export {
|
|
490
605
|
Invoices as Invoices,
|
|
491
606
|
type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse,
|
|
607
|
+
type InvoiceIssueSummaryResponse as InvoiceIssueSummaryResponse,
|
|
492
608
|
type InvoiceListSummaryResponse as InvoiceListSummaryResponse,
|
|
493
609
|
InvoiceListSummaryResponsesPage as InvoiceListSummaryResponsesPage,
|
|
494
610
|
type InvoiceCreateParams as InvoiceCreateParams,
|
|
@@ -496,8 +612,10 @@ export declare namespace Orb {
|
|
|
496
612
|
type InvoiceListParams as InvoiceListParams,
|
|
497
613
|
type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams,
|
|
498
614
|
type InvoiceIssueParams as InvoiceIssueParams,
|
|
615
|
+
type InvoiceIssueSummaryParams as InvoiceIssueSummaryParams,
|
|
499
616
|
type InvoiceListSummaryParams as InvoiceListSummaryParams,
|
|
500
617
|
type InvoiceMarkPaidParams as InvoiceMarkPaidParams,
|
|
618
|
+
type InvoicePayParams as InvoicePayParams,
|
|
501
619
|
};
|
|
502
620
|
|
|
503
621
|
export {
|
|
@@ -626,7 +744,35 @@ export declare namespace Orb {
|
|
|
626
744
|
type SubscriptionChangeApplyParams as SubscriptionChangeApplyParams,
|
|
627
745
|
};
|
|
628
746
|
|
|
629
|
-
export {
|
|
747
|
+
export {
|
|
748
|
+
CreditBlocks as CreditBlocks,
|
|
749
|
+
type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse,
|
|
750
|
+
type CreditBlockListInvoicesResponse as CreditBlockListInvoicesResponse,
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
export {
|
|
754
|
+
LicenseTypes as LicenseTypes,
|
|
755
|
+
type LicenseTypeCreateResponse as LicenseTypeCreateResponse,
|
|
756
|
+
type LicenseTypeRetrieveResponse as LicenseTypeRetrieveResponse,
|
|
757
|
+
type LicenseTypeListResponse as LicenseTypeListResponse,
|
|
758
|
+
LicenseTypeListResponsesPage as LicenseTypeListResponsesPage,
|
|
759
|
+
type LicenseTypeCreateParams as LicenseTypeCreateParams,
|
|
760
|
+
type LicenseTypeListParams as LicenseTypeListParams,
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
export {
|
|
764
|
+
Licenses as Licenses,
|
|
765
|
+
type LicenseCreateResponse as LicenseCreateResponse,
|
|
766
|
+
type LicenseRetrieveResponse as LicenseRetrieveResponse,
|
|
767
|
+
type LicenseListResponse as LicenseListResponse,
|
|
768
|
+
type LicenseDeactivateResponse as LicenseDeactivateResponse,
|
|
769
|
+
type LicenseRetrieveByExternalIDResponse as LicenseRetrieveByExternalIDResponse,
|
|
770
|
+
LicenseListResponsesPage as LicenseListResponsesPage,
|
|
771
|
+
type LicenseCreateParams as LicenseCreateParams,
|
|
772
|
+
type LicenseListParams as LicenseListParams,
|
|
773
|
+
type LicenseDeactivateParams as LicenseDeactivateParams,
|
|
774
|
+
type LicenseRetrieveByExternalIDParams as LicenseRetrieveByExternalIDParams,
|
|
775
|
+
};
|
|
630
776
|
|
|
631
777
|
export type Address = API.Address;
|
|
632
778
|
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.
|
|
@@ -233,6 +239,12 @@ export interface Alert {
|
|
|
233
239
|
*/
|
|
234
240
|
balance_alert_status?: Array<Alert.BalanceAlertStatus> | null;
|
|
235
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
|
+
|
|
236
248
|
/**
|
|
237
249
|
* Minified license type for alert serialization.
|
|
238
250
|
*/
|
|
@@ -378,10 +390,22 @@ export interface AlertCreateForSubscriptionParams {
|
|
|
378
390
|
*/
|
|
379
391
|
type: 'usage_exceeded' | 'cost_exceeded';
|
|
380
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
|
+
|
|
381
399
|
/**
|
|
382
400
|
* The metric to track usage for.
|
|
383
401
|
*/
|
|
384
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;
|
|
385
409
|
}
|
|
386
410
|
|
|
387
411
|
export interface AlertDisableParams {
|