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.
Files changed (137) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/index.d.mts +148 -14
  3. package/index.d.ts +148 -14
  4. package/index.d.ts.map +1 -1
  5. package/index.js +0 -3
  6. package/index.js.map +1 -1
  7. package/index.mjs +3 -6
  8. package/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/alerts.d.ts +20 -88
  11. package/resources/alerts.d.ts.map +1 -1
  12. package/resources/alerts.js.map +1 -1
  13. package/resources/alerts.mjs.map +1 -1
  14. package/resources/beta/beta.d.ts +9 -7313
  15. package/resources/beta/beta.d.ts.map +1 -1
  16. package/resources/beta/beta.js.map +1 -1
  17. package/resources/beta/beta.mjs.map +1 -1
  18. package/resources/beta/external-plan-id.d.ts +7 -7074
  19. package/resources/beta/external-plan-id.d.ts.map +1 -1
  20. package/resources/beta/external-plan-id.js.map +1 -1
  21. package/resources/beta/external-plan-id.mjs.map +1 -1
  22. package/resources/credit-notes.d.ts +9 -163
  23. package/resources/credit-notes.d.ts.map +1 -1
  24. package/resources/credit-notes.js +3 -6
  25. package/resources/credit-notes.js.map +1 -1
  26. package/resources/credit-notes.mjs +2 -4
  27. package/resources/credit-notes.mjs.map +1 -1
  28. package/resources/customers/balance-transactions.d.ts +5 -32
  29. package/resources/customers/balance-transactions.d.ts.map +1 -1
  30. package/resources/customers/balance-transactions.js.map +1 -1
  31. package/resources/customers/balance-transactions.mjs.map +1 -1
  32. package/resources/customers/costs.d.ts +3 -81
  33. package/resources/customers/costs.d.ts.map +1 -1
  34. package/resources/customers/credits/credits.d.ts +4 -4
  35. package/resources/customers/credits/credits.d.ts.map +1 -1
  36. package/resources/customers/credits/credits.js.map +1 -1
  37. package/resources/customers/credits/credits.mjs.map +1 -1
  38. package/resources/customers/credits/index.d.ts +2 -2
  39. package/resources/customers/credits/index.d.ts.map +1 -1
  40. package/resources/customers/credits/index.js.map +1 -1
  41. package/resources/customers/credits/index.mjs.map +1 -1
  42. package/resources/customers/credits/ledger.d.ts +171 -962
  43. package/resources/customers/credits/ledger.d.ts.map +1 -1
  44. package/resources/customers/credits/ledger.js.map +1 -1
  45. package/resources/customers/credits/ledger.mjs.map +1 -1
  46. package/resources/customers/credits/top-ups.d.ts +29 -121
  47. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  48. package/resources/customers/credits/top-ups.js.map +1 -1
  49. package/resources/customers/credits/top-ups.mjs.map +1 -1
  50. package/resources/customers/customers.d.ts +72 -678
  51. package/resources/customers/customers.d.ts.map +1 -1
  52. package/resources/customers/customers.js.map +1 -1
  53. package/resources/customers/customers.mjs.map +1 -1
  54. package/resources/customers/index.d.ts +1 -1
  55. package/resources/customers/index.d.ts.map +1 -1
  56. package/resources/customers/index.js.map +1 -1
  57. package/resources/customers/index.mjs.map +1 -1
  58. package/resources/index.d.ts +7 -7
  59. package/resources/index.d.ts.map +1 -1
  60. package/resources/index.js +1 -4
  61. package/resources/index.js.map +1 -1
  62. package/resources/index.mjs +3 -3
  63. package/resources/index.mjs.map +1 -1
  64. package/resources/invoice-line-items.d.ts +6 -395
  65. package/resources/invoice-line-items.d.ts.map +1 -1
  66. package/resources/invoice-line-items.js.map +1 -1
  67. package/resources/invoice-line-items.mjs.map +1 -1
  68. package/resources/invoices.d.ts +30 -1700
  69. package/resources/invoices.d.ts.map +1 -1
  70. package/resources/invoices.js +3 -6
  71. package/resources/invoices.js.map +1 -1
  72. package/resources/invoices.mjs +2 -4
  73. package/resources/invoices.mjs.map +1 -1
  74. package/resources/plans/plans.d.ts +7 -3801
  75. package/resources/plans/plans.d.ts.map +1 -1
  76. package/resources/plans/plans.js.map +1 -1
  77. package/resources/plans/plans.mjs.map +1 -1
  78. package/resources/prices/external-price-id.d.ts +3 -3
  79. package/resources/prices/external-price-id.d.ts.map +1 -1
  80. package/resources/prices/index.d.ts +1 -1
  81. package/resources/prices/index.d.ts.map +1 -1
  82. package/resources/prices/index.js +1 -2
  83. package/resources/prices/index.js.map +1 -1
  84. package/resources/prices/index.mjs +1 -1
  85. package/resources/prices/index.mjs.map +1 -1
  86. package/resources/prices/prices.d.ts +346 -9372
  87. package/resources/prices/prices.d.ts.map +1 -1
  88. package/resources/prices/prices.js +39 -20
  89. package/resources/prices/prices.js.map +1 -1
  90. package/resources/prices/prices.mjs +38 -18
  91. package/resources/prices/prices.mjs.map +1 -1
  92. package/resources/shared.d.ts +7269 -9
  93. package/resources/shared.d.ts.map +1 -1
  94. package/resources/shared.js +11 -0
  95. package/resources/shared.js.map +1 -1
  96. package/resources/shared.mjs +7 -1
  97. package/resources/shared.mjs.map +1 -1
  98. package/resources/subscription-changes.d.ts +138 -2158
  99. package/resources/subscription-changes.d.ts.map +1 -1
  100. package/resources/subscription-changes.js.map +1 -1
  101. package/resources/subscription-changes.mjs.map +1 -1
  102. package/resources/subscriptions.d.ts +2639 -27234
  103. package/resources/subscriptions.d.ts.map +1 -1
  104. package/resources/subscriptions.js +1 -1
  105. package/resources/subscriptions.js.map +1 -1
  106. package/resources/subscriptions.mjs +1 -1
  107. package/resources/subscriptions.mjs.map +1 -1
  108. package/src/index.ts +219 -42
  109. package/src/resources/alerts.ts +20 -94
  110. package/src/resources/beta/beta.ts +124 -8892
  111. package/src/resources/beta/external-plan-id.ts +118 -8593
  112. package/src/resources/credit-notes.ts +10 -217
  113. package/src/resources/customers/balance-transactions.ts +5 -36
  114. package/src/resources/customers/costs.ts +3 -101
  115. package/src/resources/customers/credits/credits.ts +18 -0
  116. package/src/resources/customers/credits/index.ts +9 -0
  117. package/src/resources/customers/credits/ledger.ts +212 -1435
  118. package/src/resources/customers/credits/top-ups.ts +33 -136
  119. package/src/resources/customers/customers.ts +162 -1454
  120. package/src/resources/customers/index.ts +8 -0
  121. package/src/resources/index.ts +42 -22
  122. package/src/resources/invoice-line-items.ts +10 -501
  123. package/src/resources/invoices.ts +60 -2394
  124. package/src/resources/plans/plans.ts +38 -4588
  125. package/src/resources/prices/external-price-id.ts +3 -3
  126. package/src/resources/prices/index.ts +2 -2
  127. package/src/resources/prices/prices.ts +500 -11810
  128. package/src/resources/shared.ts +9582 -22
  129. package/src/resources/subscription-changes.ts +171 -2670
  130. package/src/resources/subscriptions.ts +3162 -32900
  131. package/src/version.ts +1 -1
  132. package/version.d.ts +1 -1
  133. package/version.d.ts.map +1 -1
  134. package/version.js +1 -1
  135. package/version.js.map +1 -1
  136. package/version.mjs +1 -1
  137. package/version.mjs.map +1 -1
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../resource';
4
4
  import { isRequestOptions } from '../core';
5
5
  import * as Core from '../core';
6
+ import * as Shared from './shared';
6
7
  import { Page, type PageParams } from '../pagination';
7
8
 
8
9
  export class Alerts extends APIResource {
@@ -187,7 +188,7 @@ export interface Alert {
187
188
  /**
188
189
  * The customer the alert applies to.
189
190
  */
190
- customer: Alert.Customer | null;
191
+ customer: Shared.CustomerMinified | null;
191
192
 
192
193
  /**
193
194
  * Whether the alert is enabled or disabled.
@@ -207,13 +208,13 @@ export interface Alert {
207
208
  /**
208
209
  * The subscription the alert applies to.
209
210
  */
210
- subscription: Alert.Subscription | null;
211
+ subscription: Shared.SubscriptionMinified | null;
211
212
 
212
213
  /**
213
214
  * The thresholds that define the conditions under which the alert will be
214
215
  * triggered.
215
216
  */
216
- thresholds: Array<Alert.Threshold> | null;
217
+ thresholds: Array<Threshold> | null;
217
218
 
218
219
  /**
219
220
  * The type of alert. This must be a valid alert type.
@@ -233,15 +234,6 @@ export interface Alert {
233
234
  }
234
235
 
235
236
  export namespace Alert {
236
- /**
237
- * The customer the alert applies to.
238
- */
239
- export interface Customer {
240
- id: string;
241
-
242
- external_customer_id: string | null;
243
- }
244
-
245
237
  /**
246
238
  * The metric the alert applies to.
247
239
  */
@@ -267,26 +259,6 @@ export namespace Alert {
267
259
  plan_version: string;
268
260
  }
269
261
 
270
- /**
271
- * The subscription the alert applies to.
272
- */
273
- export interface Subscription {
274
- id: string;
275
- }
276
-
277
- /**
278
- * Thresholds are used to define the conditions under which an alert will be
279
- * triggered.
280
- */
281
- export interface Threshold {
282
- /**
283
- * The value at which an alert will fire. For credit balance alerts, the alert will
284
- * fire at or below this value. For usage and cost alerts, the alert will fire at
285
- * or above this value.
286
- */
287
- value: number;
288
- }
289
-
290
262
  /**
291
263
  * Alert status is used to determine if an alert is currently in-alert or not.
292
264
  */
@@ -303,26 +275,24 @@ export namespace Alert {
303
275
  }
304
276
  }
305
277
 
306
- export interface AlertUpdateParams {
278
+ /**
279
+ * Thresholds are used to define the conditions under which an alert will be
280
+ * triggered.
281
+ */
282
+ export interface Threshold {
307
283
  /**
308
- * The thresholds that define the values at which the alert will be triggered.
284
+ * The value at which an alert will fire. For credit balance alerts, the alert will
285
+ * fire at or below this value. For usage and cost alerts, the alert will fire at
286
+ * or above this value.
309
287
  */
310
- thresholds: Array<AlertUpdateParams.Threshold>;
288
+ value: number;
311
289
  }
312
290
 
313
- export namespace AlertUpdateParams {
291
+ export interface AlertUpdateParams {
314
292
  /**
315
- * Thresholds are used to define the conditions under which an alert will be
316
- * triggered.
293
+ * The thresholds that define the values at which the alert will be triggered.
317
294
  */
318
- export interface Threshold {
319
- /**
320
- * The value at which an alert will fire. For credit balance alerts, the alert will
321
- * fire at or below this value. For usage and cost alerts, the alert will fire at
322
- * or above this value.
323
- */
324
- value: number;
325
- }
295
+ thresholds: Array<Threshold>;
326
296
  }
327
297
 
328
298
  export interface AlertListParams extends PageParams {
@@ -364,22 +334,7 @@ export interface AlertCreateForCustomerParams {
364
334
  /**
365
335
  * The thresholds that define the values at which the alert will be triggered.
366
336
  */
367
- thresholds?: Array<AlertCreateForCustomerParams.Threshold> | null;
368
- }
369
-
370
- export namespace AlertCreateForCustomerParams {
371
- /**
372
- * Thresholds are used to define the conditions under which an alert will be
373
- * triggered.
374
- */
375
- export interface Threshold {
376
- /**
377
- * The value at which an alert will fire. For credit balance alerts, the alert will
378
- * fire at or below this value. For usage and cost alerts, the alert will fire at
379
- * or above this value.
380
- */
381
- value: number;
382
- }
337
+ thresholds?: Array<Threshold> | null;
383
338
  }
384
339
 
385
340
  export interface AlertCreateForExternalCustomerParams {
@@ -396,29 +351,14 @@ export interface AlertCreateForExternalCustomerParams {
396
351
  /**
397
352
  * The thresholds that define the values at which the alert will be triggered.
398
353
  */
399
- thresholds?: Array<AlertCreateForExternalCustomerParams.Threshold> | null;
400
- }
401
-
402
- export namespace AlertCreateForExternalCustomerParams {
403
- /**
404
- * Thresholds are used to define the conditions under which an alert will be
405
- * triggered.
406
- */
407
- export interface Threshold {
408
- /**
409
- * The value at which an alert will fire. For credit balance alerts, the alert will
410
- * fire at or below this value. For usage and cost alerts, the alert will fire at
411
- * or above this value.
412
- */
413
- value: number;
414
- }
354
+ thresholds?: Array<Threshold> | null;
415
355
  }
416
356
 
417
357
  export interface AlertCreateForSubscriptionParams {
418
358
  /**
419
359
  * The thresholds that define the values at which the alert will be triggered.
420
360
  */
421
- thresholds: Array<AlertCreateForSubscriptionParams.Threshold>;
361
+ thresholds: Array<Threshold>;
422
362
 
423
363
  /**
424
364
  * The type of alert to create. This must be a valid alert type.
@@ -431,21 +371,6 @@ export interface AlertCreateForSubscriptionParams {
431
371
  metric_id?: string | null;
432
372
  }
433
373
 
434
- export namespace AlertCreateForSubscriptionParams {
435
- /**
436
- * Thresholds are used to define the conditions under which an alert will be
437
- * triggered.
438
- */
439
- export interface Threshold {
440
- /**
441
- * The value at which an alert will fire. For credit balance alerts, the alert will
442
- * fire at or below this value. For usage and cost alerts, the alert will fire at
443
- * or above this value.
444
- */
445
- value: number;
446
- }
447
- }
448
-
449
374
  export interface AlertDisableParams {
450
375
  /**
451
376
  * Used to update the status of a plan alert scoped to this subscription_id
@@ -465,6 +390,7 @@ Alerts.AlertsPage = AlertsPage;
465
390
  export declare namespace Alerts {
466
391
  export {
467
392
  type Alert as Alert,
393
+ type Threshold as Threshold,
468
394
  AlertsPage as AlertsPage,
469
395
  type AlertUpdateParams as AlertUpdateParams,
470
396
  type AlertListParams as AlertListParams,