orb-billing 4.33.0 → 4.47.1

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 (252) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/LICENSE +1 -1
  3. package/README.md +10 -1
  4. package/core.d.ts +4 -5
  5. package/core.d.ts.map +1 -1
  6. package/core.js +16 -11
  7. package/core.js.map +1 -1
  8. package/core.mjs +16 -11
  9. package/core.mjs.map +1 -1
  10. package/error.d.ts +30 -36
  11. package/error.d.ts.map +1 -1
  12. package/error.js +24 -43
  13. package/error.js.map +1 -1
  14. package/error.mjs +24 -43
  15. package/error.mjs.map +1 -1
  16. package/index.d.mts +43 -109
  17. package/index.d.ts +43 -109
  18. package/index.d.ts.map +1 -1
  19. package/index.js +71 -33
  20. package/index.js.map +1 -1
  21. package/index.mjs +43 -32
  22. package/index.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/resources/alerts.d.ts +58 -19
  25. package/resources/alerts.d.ts.map +1 -1
  26. package/resources/alerts.js +19 -37
  27. package/resources/alerts.js.map +1 -1
  28. package/resources/alerts.mjs +19 -14
  29. package/resources/alerts.mjs.map +1 -1
  30. package/resources/coupons/coupons.d.ts +3 -7
  31. package/resources/coupons/coupons.d.ts.map +1 -1
  32. package/resources/coupons/coupons.js +3 -5
  33. package/resources/coupons/coupons.js.map +1 -1
  34. package/resources/coupons/coupons.mjs +3 -5
  35. package/resources/coupons/coupons.mjs.map +1 -1
  36. package/resources/coupons/index.d.ts +2 -2
  37. package/resources/coupons/index.d.ts.map +1 -1
  38. package/resources/coupons/index.js.map +1 -1
  39. package/resources/coupons/index.mjs.map +1 -1
  40. package/resources/coupons/subscriptions.d.ts +1 -2
  41. package/resources/coupons/subscriptions.d.ts.map +1 -1
  42. package/resources/coupons/subscriptions.js +0 -2
  43. package/resources/coupons/subscriptions.js.map +1 -1
  44. package/resources/coupons/subscriptions.mjs +0 -2
  45. package/resources/coupons/subscriptions.mjs.map +1 -1
  46. package/resources/credit-notes.d.ts +29 -4
  47. package/resources/credit-notes.d.ts.map +1 -1
  48. package/resources/credit-notes.js +8 -27
  49. package/resources/credit-notes.js.map +1 -1
  50. package/resources/credit-notes.mjs +8 -4
  51. package/resources/credit-notes.mjs.map +1 -1
  52. package/resources/customers/balance-transactions.d.ts +1 -6
  53. package/resources/customers/balance-transactions.d.ts.map +1 -1
  54. package/resources/customers/balance-transactions.js +1 -27
  55. package/resources/customers/balance-transactions.js.map +1 -1
  56. package/resources/customers/balance-transactions.mjs +1 -4
  57. package/resources/customers/balance-transactions.mjs.map +1 -1
  58. package/resources/customers/costs.d.ts +1 -5
  59. package/resources/customers/costs.d.ts.map +1 -1
  60. package/resources/customers/costs.js +0 -2
  61. package/resources/customers/costs.js.map +1 -1
  62. package/resources/customers/costs.mjs +0 -2
  63. package/resources/customers/costs.mjs.map +1 -1
  64. package/resources/customers/credits/credits.d.ts +15 -31
  65. package/resources/customers/credits/credits.d.ts.map +1 -1
  66. package/resources/customers/credits/credits.js +10 -11
  67. package/resources/customers/credits/credits.js.map +1 -1
  68. package/resources/customers/credits/credits.mjs +10 -11
  69. package/resources/customers/credits/credits.mjs.map +1 -1
  70. package/resources/customers/credits/index.d.ts +3 -3
  71. package/resources/customers/credits/index.d.ts.map +1 -1
  72. package/resources/customers/credits/index.js.map +1 -1
  73. package/resources/customers/credits/index.mjs.map +1 -1
  74. package/resources/customers/credits/ledger.d.ts +15 -23
  75. package/resources/customers/credits/ledger.d.ts.map +1 -1
  76. package/resources/customers/credits/ledger.js +12 -36
  77. package/resources/customers/credits/ledger.js.map +1 -1
  78. package/resources/customers/credits/ledger.mjs +12 -13
  79. package/resources/customers/credits/ledger.mjs.map +1 -1
  80. package/resources/customers/credits/top-ups.d.ts +1 -11
  81. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  82. package/resources/customers/credits/top-ups.js +2 -28
  83. package/resources/customers/credits/top-ups.js.map +1 -1
  84. package/resources/customers/credits/top-ups.mjs +2 -5
  85. package/resources/customers/credits/top-ups.mjs.map +1 -1
  86. package/resources/customers/customers.d.ts +7 -25
  87. package/resources/customers/customers.d.ts.map +1 -1
  88. package/resources/customers/customers.js +10 -10
  89. package/resources/customers/customers.js.map +1 -1
  90. package/resources/customers/customers.mjs +10 -10
  91. package/resources/customers/customers.mjs.map +1 -1
  92. package/resources/customers/index.d.ts +4 -4
  93. package/resources/customers/index.d.ts.map +1 -1
  94. package/resources/customers/index.js.map +1 -1
  95. package/resources/customers/index.mjs.map +1 -1
  96. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +90 -0
  97. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -0
  98. package/resources/dimensional-price-groups/dimensional-price-groups.js +73 -0
  99. package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -0
  100. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +45 -0
  101. package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -0
  102. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +10 -0
  103. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -0
  104. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +15 -0
  105. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -0
  106. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +11 -0
  107. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -0
  108. package/resources/dimensional-price-groups/index.d.ts +3 -0
  109. package/resources/dimensional-price-groups/index.d.ts.map +1 -0
  110. package/resources/dimensional-price-groups/index.js +9 -0
  111. package/resources/dimensional-price-groups/index.js.map +1 -0
  112. package/resources/dimensional-price-groups/index.mjs +4 -0
  113. package/resources/dimensional-price-groups/index.mjs.map +1 -0
  114. package/resources/events/backfills.d.ts +5 -11
  115. package/resources/events/backfills.d.ts.map +1 -1
  116. package/resources/events/backfills.js +5 -29
  117. package/resources/events/backfills.js.map +1 -1
  118. package/resources/events/backfills.mjs +5 -6
  119. package/resources/events/backfills.mjs.map +1 -1
  120. package/resources/events/events.d.ts +7 -22
  121. package/resources/events/events.d.ts.map +1 -1
  122. package/resources/events/events.js +7 -7
  123. package/resources/events/events.js.map +1 -1
  124. package/resources/events/events.mjs +7 -7
  125. package/resources/events/events.mjs.map +1 -1
  126. package/resources/events/index.d.ts +3 -3
  127. package/resources/events/index.d.ts.map +1 -1
  128. package/resources/events/index.js.map +1 -1
  129. package/resources/events/index.mjs.map +1 -1
  130. package/resources/events/volume.d.ts +1 -3
  131. package/resources/events/volume.d.ts.map +1 -1
  132. package/resources/events/volume.js +0 -2
  133. package/resources/events/volume.js.map +1 -1
  134. package/resources/events/volume.mjs +0 -2
  135. package/resources/events/volume.mjs.map +1 -1
  136. package/resources/index.d.ts +14 -13
  137. package/resources/index.d.ts.map +1 -1
  138. package/resources/index.js +10 -7
  139. package/resources/index.js.map +1 -1
  140. package/resources/index.mjs +8 -7
  141. package/resources/index.mjs.map +1 -1
  142. package/resources/invoice-line-items.d.ts +1 -3
  143. package/resources/invoice-line-items.d.ts.map +1 -1
  144. package/resources/invoice-line-items.js +0 -2
  145. package/resources/invoice-line-items.js.map +1 -1
  146. package/resources/invoice-line-items.mjs +0 -2
  147. package/resources/invoice-line-items.mjs.map +1 -1
  148. package/resources/invoices.d.ts +78 -13
  149. package/resources/invoices.d.ts.map +1 -1
  150. package/resources/invoices.js +8 -27
  151. package/resources/invoices.js.map +1 -1
  152. package/resources/invoices.mjs +8 -4
  153. package/resources/invoices.mjs.map +1 -1
  154. package/resources/items.d.ts +1 -6
  155. package/resources/items.d.ts.map +1 -1
  156. package/resources/items.js +1 -27
  157. package/resources/items.js.map +1 -1
  158. package/resources/items.mjs +1 -4
  159. package/resources/items.mjs.map +1 -1
  160. package/resources/metrics.d.ts +1 -6
  161. package/resources/metrics.d.ts.map +1 -1
  162. package/resources/metrics.js +1 -27
  163. package/resources/metrics.js.map +1 -1
  164. package/resources/metrics.mjs +1 -4
  165. package/resources/metrics.mjs.map +1 -1
  166. package/resources/plans/external-plan-id.d.ts +1 -2
  167. package/resources/plans/external-plan-id.d.ts.map +1 -1
  168. package/resources/plans/external-plan-id.js +0 -2
  169. package/resources/plans/external-plan-id.js.map +1 -1
  170. package/resources/plans/external-plan-id.mjs +0 -2
  171. package/resources/plans/external-plan-id.mjs.map +1 -1
  172. package/resources/plans/index.d.ts +2 -2
  173. package/resources/plans/index.d.ts.map +1 -1
  174. package/resources/plans/index.js.map +1 -1
  175. package/resources/plans/index.mjs +1 -1
  176. package/resources/plans/index.mjs.map +1 -1
  177. package/resources/plans/plans.d.ts +331 -9
  178. package/resources/plans/plans.d.ts.map +1 -1
  179. package/resources/plans/plans.js +3 -5
  180. package/resources/plans/plans.js.map +1 -1
  181. package/resources/plans/plans.mjs +3 -5
  182. package/resources/plans/plans.mjs.map +1 -1
  183. package/resources/prices/external-price-id.d.ts +1 -2
  184. package/resources/prices/external-price-id.d.ts.map +1 -1
  185. package/resources/prices/external-price-id.js +0 -2
  186. package/resources/prices/external-price-id.js.map +1 -1
  187. package/resources/prices/external-price-id.mjs +0 -2
  188. package/resources/prices/external-price-id.mjs.map +1 -1
  189. package/resources/prices/index.d.ts +2 -2
  190. package/resources/prices/index.d.ts.map +1 -1
  191. package/resources/prices/index.js +3 -3
  192. package/resources/prices/index.js.map +1 -1
  193. package/resources/prices/index.mjs +1 -1
  194. package/resources/prices/index.mjs.map +1 -1
  195. package/resources/prices/prices.d.ts +339 -13
  196. package/resources/prices/prices.d.ts.map +1 -1
  197. package/resources/prices/prices.js +3 -5
  198. package/resources/prices/prices.js.map +1 -1
  199. package/resources/prices/prices.mjs +3 -5
  200. package/resources/prices/prices.mjs.map +1 -1
  201. package/resources/subscriptions.d.ts +7629 -191
  202. package/resources/subscriptions.d.ts.map +1 -1
  203. package/resources/subscriptions.js +2 -29
  204. package/resources/subscriptions.js.map +1 -1
  205. package/resources/subscriptions.mjs +2 -6
  206. package/resources/subscriptions.mjs.map +1 -1
  207. package/resources/top-level.d.ts +1 -2
  208. package/resources/top-level.d.ts.map +1 -1
  209. package/resources/top-level.js +0 -2
  210. package/resources/top-level.js.map +1 -1
  211. package/resources/top-level.mjs +0 -2
  212. package/resources/top-level.mjs.map +1 -1
  213. package/src/core.ts +23 -19
  214. package/src/error.ts +82 -125
  215. package/src/index.ts +334 -130
  216. package/src/resources/alerts.ts +117 -24
  217. package/src/resources/coupons/coupons.ts +13 -8
  218. package/src/resources/coupons/index.ts +2 -2
  219. package/src/resources/coupons/subscriptions.ts +2 -3
  220. package/src/resources/credit-notes.ts +45 -5
  221. package/src/resources/customers/balance-transactions.ts +10 -7
  222. package/src/resources/customers/costs.ts +7 -6
  223. package/src/resources/customers/credits/credits.ts +82 -32
  224. package/src/resources/customers/credits/index.ts +20 -20
  225. package/src/resources/customers/credits/ledger.ts +30 -24
  226. package/src/resources/customers/credits/top-ups.ts +16 -12
  227. package/src/resources/customers/customers.ts +68 -26
  228. package/src/resources/customers/index.ts +17 -17
  229. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +146 -0
  230. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +20 -0
  231. package/src/resources/dimensional-price-groups/index.ts +10 -0
  232. package/src/resources/events/backfills.ts +17 -12
  233. package/src/resources/events/events.ts +42 -23
  234. package/src/resources/events/index.ts +15 -15
  235. package/src/resources/events/volume.ts +2 -4
  236. package/src/resources/index.ts +113 -67
  237. package/src/resources/invoice-line-items.ts +5 -4
  238. package/src/resources/invoices.ts +108 -14
  239. package/src/resources/items.ts +10 -7
  240. package/src/resources/metrics.ts +10 -7
  241. package/src/resources/plans/external-plan-id.ts +2 -3
  242. package/src/resources/plans/index.ts +9 -2
  243. package/src/resources/plans/plans.ts +424 -9
  244. package/src/resources/prices/external-price-id.ts +2 -3
  245. package/src/resources/prices/index.ts +8 -8
  246. package/src/resources/prices/prices.ts +470 -14
  247. package/src/resources/subscriptions.ts +9231 -400
  248. package/src/resources/top-level.ts +2 -3
  249. package/src/version.ts +1 -1
  250. package/version.d.ts +1 -1
  251. package/version.js +1 -1
  252. package/version.mjs +1 -1
package/src/index.ts CHANGED
@@ -1,12 +1,150 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Errors from './error';
4
- import * as Uploads from './uploads';
5
3
  import { type Agent } from './_shims/index';
6
4
  import * as qs from './internal/qs';
7
5
  import * as Core from './core';
6
+ import * as Errors from './error';
8
7
  import * as Pagination from './pagination';
8
+ import { type PageParams, PageResponse } from './pagination';
9
+ import * as Uploads from './uploads';
9
10
  import * as API from './resources/index';
11
+ import {
12
+ Alert,
13
+ AlertCreateForCustomerParams,
14
+ AlertCreateForExternalCustomerParams,
15
+ AlertCreateForSubscriptionParams,
16
+ AlertDisableParams,
17
+ AlertEnableParams,
18
+ AlertListParams,
19
+ AlertUpdateParams,
20
+ Alerts,
21
+ AlertsPage,
22
+ } from './resources/alerts';
23
+ import {
24
+ CreditNote,
25
+ CreditNoteCreateParams,
26
+ CreditNoteListParams,
27
+ CreditNotes,
28
+ CreditNotesPage,
29
+ } from './resources/credit-notes';
30
+ import {
31
+ InvoiceLineItemCreateParams,
32
+ InvoiceLineItemCreateResponse,
33
+ InvoiceLineItems,
34
+ } from './resources/invoice-line-items';
35
+ import {
36
+ Invoice,
37
+ InvoiceCreateParams,
38
+ InvoiceFetchUpcomingParams,
39
+ InvoiceFetchUpcomingResponse,
40
+ InvoiceIssueParams,
41
+ InvoiceListParams,
42
+ InvoiceMarkPaidParams,
43
+ InvoiceUpdateParams,
44
+ Invoices,
45
+ InvoicesPage,
46
+ } from './resources/invoices';
47
+ import {
48
+ Item,
49
+ ItemCreateParams,
50
+ ItemListParams,
51
+ ItemUpdateParams,
52
+ Items,
53
+ ItemsPage,
54
+ } from './resources/items';
55
+ import {
56
+ BillableMetric,
57
+ BillableMetricsPage,
58
+ MetricCreateParams,
59
+ MetricListParams,
60
+ MetricUpdateParams,
61
+ Metrics,
62
+ } from './resources/metrics';
63
+ import {
64
+ Subscription,
65
+ SubscriptionCancelParams,
66
+ SubscriptionCancelResponse,
67
+ SubscriptionCreateParams,
68
+ SubscriptionCreateResponse,
69
+ SubscriptionFetchCostsParams,
70
+ SubscriptionFetchCostsResponse,
71
+ SubscriptionFetchScheduleParams,
72
+ SubscriptionFetchScheduleResponse,
73
+ SubscriptionFetchScheduleResponsesPage,
74
+ SubscriptionFetchUsageParams,
75
+ SubscriptionListParams,
76
+ SubscriptionPriceIntervalsParams,
77
+ SubscriptionPriceIntervalsResponse,
78
+ SubscriptionSchedulePlanChangeParams,
79
+ SubscriptionSchedulePlanChangeResponse,
80
+ SubscriptionTriggerPhaseParams,
81
+ SubscriptionTriggerPhaseResponse,
82
+ SubscriptionUnscheduleCancellationResponse,
83
+ SubscriptionUnscheduleFixedFeeQuantityUpdatesParams,
84
+ SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse,
85
+ SubscriptionUnschedulePendingPlanChangesResponse,
86
+ SubscriptionUpdateFixedFeeQuantityParams,
87
+ SubscriptionUpdateFixedFeeQuantityResponse,
88
+ SubscriptionUpdateParams,
89
+ SubscriptionUpdateTrialParams,
90
+ SubscriptionUpdateTrialResponse,
91
+ SubscriptionUsage,
92
+ Subscriptions,
93
+ SubscriptionsPage,
94
+ } from './resources/subscriptions';
95
+ import { TopLevel, TopLevelPingResponse } from './resources/top-level';
96
+ import {
97
+ Coupon,
98
+ CouponCreateParams,
99
+ CouponListParams,
100
+ Coupons,
101
+ CouponsPage,
102
+ } from './resources/coupons/coupons';
103
+ import {
104
+ Customer,
105
+ CustomerCreateParams,
106
+ CustomerListParams,
107
+ CustomerUpdateByExternalIDParams,
108
+ CustomerUpdateParams,
109
+ Customers,
110
+ CustomersPage,
111
+ } from './resources/customers/customers';
112
+ import {
113
+ DimensionalPriceGroup,
114
+ DimensionalPriceGroupCreateParams,
115
+ DimensionalPriceGroupListParams,
116
+ DimensionalPriceGroups,
117
+ DimensionalPriceGroupsPage,
118
+ } from './resources/dimensional-price-groups/dimensional-price-groups';
119
+ import {
120
+ EventDeprecateResponse,
121
+ EventIngestParams,
122
+ EventIngestResponse,
123
+ EventSearchParams,
124
+ EventSearchResponse,
125
+ EventUpdateParams,
126
+ EventUpdateResponse,
127
+ Events,
128
+ } from './resources/events/events';
129
+ import {
130
+ Plan,
131
+ PlanCreateParams,
132
+ PlanListParams,
133
+ PlanUpdateParams,
134
+ Plans,
135
+ PlansPage,
136
+ } from './resources/plans/plans';
137
+ import {
138
+ EvaluatePriceGroup,
139
+ Price,
140
+ PriceCreateParams,
141
+ PriceEvaluateParams,
142
+ PriceEvaluateResponse,
143
+ PriceListParams,
144
+ PriceUpdateParams,
145
+ Prices,
146
+ PricesPage,
147
+ } from './resources/prices/prices';
10
148
 
11
149
  export interface ClientOptions {
12
150
  /**
@@ -146,6 +284,7 @@ export class Orb extends Core.APIClient {
146
284
  subscriptions: API.Subscriptions = new API.Subscriptions(this);
147
285
  webhooks: API.Webhooks = new API.Webhooks(this);
148
286
  alerts: API.Alerts = new API.Alerts(this);
287
+ dimensionalPriceGroups: API.DimensionalPriceGroups = new API.DimensionalPriceGroups(this);
149
288
 
150
289
  protected override defaultQuery(): Core.DefaultQuery | undefined {
151
290
  return this._options.defaultQuery;
@@ -199,7 +338,198 @@ export class Orb extends Core.APIClient {
199
338
  static fileFromPath = Uploads.fileFromPath;
200
339
  }
201
340
 
202
- export const {
341
+ Orb.TopLevel = TopLevel;
342
+ Orb.Coupons = Coupons;
343
+ Orb.CouponsPage = CouponsPage;
344
+ Orb.CreditNotes = CreditNotes;
345
+ Orb.CreditNotesPage = CreditNotesPage;
346
+ Orb.Customers = Customers;
347
+ Orb.CustomersPage = CustomersPage;
348
+ Orb.Events = Events;
349
+ Orb.InvoiceLineItems = InvoiceLineItems;
350
+ Orb.Invoices = Invoices;
351
+ Orb.InvoicesPage = InvoicesPage;
352
+ Orb.Items = Items;
353
+ Orb.ItemsPage = ItemsPage;
354
+ Orb.Metrics = Metrics;
355
+ Orb.BillableMetricsPage = BillableMetricsPage;
356
+ Orb.Plans = Plans;
357
+ Orb.PlansPage = PlansPage;
358
+ Orb.Prices = Prices;
359
+ Orb.PricesPage = PricesPage;
360
+ Orb.SubscriptionsPage = SubscriptionsPage;
361
+ Orb.SubscriptionFetchScheduleResponsesPage = SubscriptionFetchScheduleResponsesPage;
362
+ Orb.Alerts = Alerts;
363
+ Orb.AlertsPage = AlertsPage;
364
+ Orb.DimensionalPriceGroupsPage = DimensionalPriceGroupsPage;
365
+ export declare namespace Orb {
366
+ export type RequestOptions = Core.RequestOptions;
367
+
368
+ export import Page = Pagination.Page;
369
+ export { type PageParams as PageParams, type PageResponse as PageResponse };
370
+
371
+ export { TopLevel as TopLevel, type TopLevelPingResponse as TopLevelPingResponse };
372
+
373
+ export {
374
+ Coupons as Coupons,
375
+ type Coupon as Coupon,
376
+ CouponsPage as CouponsPage,
377
+ type CouponCreateParams as CouponCreateParams,
378
+ type CouponListParams as CouponListParams,
379
+ };
380
+
381
+ export {
382
+ CreditNotes as CreditNotes,
383
+ type CreditNote as CreditNote,
384
+ CreditNotesPage as CreditNotesPage,
385
+ type CreditNoteCreateParams as CreditNoteCreateParams,
386
+ type CreditNoteListParams as CreditNoteListParams,
387
+ };
388
+
389
+ export {
390
+ Customers as Customers,
391
+ type Customer as Customer,
392
+ CustomersPage as CustomersPage,
393
+ type CustomerCreateParams as CustomerCreateParams,
394
+ type CustomerUpdateParams as CustomerUpdateParams,
395
+ type CustomerListParams as CustomerListParams,
396
+ type CustomerUpdateByExternalIDParams as CustomerUpdateByExternalIDParams,
397
+ };
398
+
399
+ export {
400
+ Events as Events,
401
+ type EventUpdateResponse as EventUpdateResponse,
402
+ type EventDeprecateResponse as EventDeprecateResponse,
403
+ type EventIngestResponse as EventIngestResponse,
404
+ type EventSearchResponse as EventSearchResponse,
405
+ type EventUpdateParams as EventUpdateParams,
406
+ type EventIngestParams as EventIngestParams,
407
+ type EventSearchParams as EventSearchParams,
408
+ };
409
+
410
+ export {
411
+ InvoiceLineItems as InvoiceLineItems,
412
+ type InvoiceLineItemCreateResponse as InvoiceLineItemCreateResponse,
413
+ type InvoiceLineItemCreateParams as InvoiceLineItemCreateParams,
414
+ };
415
+
416
+ export {
417
+ Invoices as Invoices,
418
+ type Invoice as Invoice,
419
+ type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse,
420
+ InvoicesPage as InvoicesPage,
421
+ type InvoiceCreateParams as InvoiceCreateParams,
422
+ type InvoiceUpdateParams as InvoiceUpdateParams,
423
+ type InvoiceListParams as InvoiceListParams,
424
+ type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams,
425
+ type InvoiceIssueParams as InvoiceIssueParams,
426
+ type InvoiceMarkPaidParams as InvoiceMarkPaidParams,
427
+ };
428
+
429
+ export {
430
+ Items as Items,
431
+ type Item as Item,
432
+ ItemsPage as ItemsPage,
433
+ type ItemCreateParams as ItemCreateParams,
434
+ type ItemUpdateParams as ItemUpdateParams,
435
+ type ItemListParams as ItemListParams,
436
+ };
437
+
438
+ export {
439
+ Metrics as Metrics,
440
+ type BillableMetric as BillableMetric,
441
+ BillableMetricsPage as BillableMetricsPage,
442
+ type MetricCreateParams as MetricCreateParams,
443
+ type MetricUpdateParams as MetricUpdateParams,
444
+ type MetricListParams as MetricListParams,
445
+ };
446
+
447
+ export {
448
+ Plans as Plans,
449
+ type Plan as Plan,
450
+ PlansPage as PlansPage,
451
+ type PlanCreateParams as PlanCreateParams,
452
+ type PlanUpdateParams as PlanUpdateParams,
453
+ type PlanListParams as PlanListParams,
454
+ };
455
+
456
+ export {
457
+ Prices as Prices,
458
+ type EvaluatePriceGroup as EvaluatePriceGroup,
459
+ type Price as Price,
460
+ type PriceEvaluateResponse as PriceEvaluateResponse,
461
+ PricesPage as PricesPage,
462
+ type PriceCreateParams as PriceCreateParams,
463
+ type PriceUpdateParams as PriceUpdateParams,
464
+ type PriceListParams as PriceListParams,
465
+ type PriceEvaluateParams as PriceEvaluateParams,
466
+ };
467
+
468
+ export {
469
+ type Subscriptions as Subscriptions,
470
+ type Subscription as Subscription,
471
+ type SubscriptionUsage as SubscriptionUsage,
472
+ type SubscriptionCreateResponse as SubscriptionCreateResponse,
473
+ type SubscriptionCancelResponse as SubscriptionCancelResponse,
474
+ type SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse,
475
+ type SubscriptionFetchScheduleResponse as SubscriptionFetchScheduleResponse,
476
+ type SubscriptionPriceIntervalsResponse as SubscriptionPriceIntervalsResponse,
477
+ type SubscriptionSchedulePlanChangeResponse as SubscriptionSchedulePlanChangeResponse,
478
+ type SubscriptionTriggerPhaseResponse as SubscriptionTriggerPhaseResponse,
479
+ type SubscriptionUnscheduleCancellationResponse as SubscriptionUnscheduleCancellationResponse,
480
+ type SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse as SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse,
481
+ type SubscriptionUnschedulePendingPlanChangesResponse as SubscriptionUnschedulePendingPlanChangesResponse,
482
+ type SubscriptionUpdateFixedFeeQuantityResponse as SubscriptionUpdateFixedFeeQuantityResponse,
483
+ type SubscriptionUpdateTrialResponse as SubscriptionUpdateTrialResponse,
484
+ SubscriptionsPage as SubscriptionsPage,
485
+ SubscriptionFetchScheduleResponsesPage as SubscriptionFetchScheduleResponsesPage,
486
+ type SubscriptionCreateParams as SubscriptionCreateParams,
487
+ type SubscriptionUpdateParams as SubscriptionUpdateParams,
488
+ type SubscriptionListParams as SubscriptionListParams,
489
+ type SubscriptionCancelParams as SubscriptionCancelParams,
490
+ type SubscriptionFetchCostsParams as SubscriptionFetchCostsParams,
491
+ type SubscriptionFetchScheduleParams as SubscriptionFetchScheduleParams,
492
+ type SubscriptionFetchUsageParams as SubscriptionFetchUsageParams,
493
+ type SubscriptionPriceIntervalsParams as SubscriptionPriceIntervalsParams,
494
+ type SubscriptionSchedulePlanChangeParams as SubscriptionSchedulePlanChangeParams,
495
+ type SubscriptionTriggerPhaseParams as SubscriptionTriggerPhaseParams,
496
+ type SubscriptionUnscheduleFixedFeeQuantityUpdatesParams as SubscriptionUnscheduleFixedFeeQuantityUpdatesParams,
497
+ type SubscriptionUpdateFixedFeeQuantityParams as SubscriptionUpdateFixedFeeQuantityParams,
498
+ type SubscriptionUpdateTrialParams as SubscriptionUpdateTrialParams,
499
+ };
500
+
501
+ export {
502
+ Alerts as Alerts,
503
+ type Alert as Alert,
504
+ AlertsPage as AlertsPage,
505
+ type AlertUpdateParams as AlertUpdateParams,
506
+ type AlertListParams as AlertListParams,
507
+ type AlertCreateForCustomerParams as AlertCreateForCustomerParams,
508
+ type AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams,
509
+ type AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams,
510
+ type AlertDisableParams as AlertDisableParams,
511
+ type AlertEnableParams as AlertEnableParams,
512
+ };
513
+
514
+ export {
515
+ type DimensionalPriceGroups as DimensionalPriceGroups,
516
+ type DimensionalPriceGroup as DimensionalPriceGroup,
517
+ DimensionalPriceGroupsPage as DimensionalPriceGroupsPage,
518
+ type DimensionalPriceGroupCreateParams as DimensionalPriceGroupCreateParams,
519
+ type DimensionalPriceGroupListParams as DimensionalPriceGroupListParams,
520
+ };
521
+
522
+ export type AmountDiscount = API.AmountDiscount;
523
+ export type BillingCycleRelativeDate = API.BillingCycleRelativeDate;
524
+ export type Discount = API.Discount;
525
+ export type InvoiceLevelDiscount = API.InvoiceLevelDiscount;
526
+ export type PaginationMetadata = API.PaginationMetadata;
527
+ export type PercentageDiscount = API.PercentageDiscount;
528
+ export type TrialDiscount = API.TrialDiscount;
529
+ }
530
+
531
+ export { toFile, fileFromPath } from './uploads';
532
+ export {
203
533
  OrbError,
204
534
  APIError,
205
535
  APIConnectionError,
@@ -225,132 +555,6 @@ export const {
225
555
  OrbInternalServerError,
226
556
  UnprocessableEntityError,
227
557
  DuplicateResourceCreation,
228
- } = Errors;
229
-
230
- export import toFile = Uploads.toFile;
231
- export import fileFromPath = Uploads.fileFromPath;
232
-
233
- export namespace Orb {
234
- export import RequestOptions = Core.RequestOptions;
235
-
236
- export import Page = Pagination.Page;
237
- export import PageParams = Pagination.PageParams;
238
- export import PageResponse = Pagination.PageResponse;
239
-
240
- export import TopLevel = API.TopLevel;
241
- export import TopLevelPingResponse = API.TopLevelPingResponse;
242
-
243
- export import Coupons = API.Coupons;
244
- export import Coupon = API.Coupon;
245
- export import CouponsPage = API.CouponsPage;
246
- export import CouponCreateParams = API.CouponCreateParams;
247
- export import CouponListParams = API.CouponListParams;
248
-
249
- export import CreditNotes = API.CreditNotes;
250
- export import CreditNote = API.CreditNote;
251
- export import CreditNotesPage = API.CreditNotesPage;
252
- export import CreditNoteListParams = API.CreditNoteListParams;
253
-
254
- export import Customers = API.Customers;
255
- export import Customer = API.Customer;
256
- export import CustomersPage = API.CustomersPage;
257
- export import CustomerCreateParams = API.CustomerCreateParams;
258
- export import CustomerUpdateParams = API.CustomerUpdateParams;
259
- export import CustomerListParams = API.CustomerListParams;
260
- export import CustomerUpdateByExternalIDParams = API.CustomerUpdateByExternalIDParams;
261
-
262
- export import Events = API.Events;
263
- export import EventUpdateResponse = API.EventUpdateResponse;
264
- export import EventDeprecateResponse = API.EventDeprecateResponse;
265
- export import EventIngestResponse = API.EventIngestResponse;
266
- export import EventSearchResponse = API.EventSearchResponse;
267
- export import EventUpdateParams = API.EventUpdateParams;
268
- export import EventIngestParams = API.EventIngestParams;
269
- export import EventSearchParams = API.EventSearchParams;
270
-
271
- export import InvoiceLineItems = API.InvoiceLineItems;
272
- export import InvoiceLineItemCreateResponse = API.InvoiceLineItemCreateResponse;
273
- export import InvoiceLineItemCreateParams = API.InvoiceLineItemCreateParams;
274
-
275
- export import Invoices = API.Invoices;
276
- export import Invoice = API.Invoice;
277
- export import InvoiceFetchUpcomingResponse = API.InvoiceFetchUpcomingResponse;
278
- export import InvoicesPage = API.InvoicesPage;
279
- export import InvoiceCreateParams = API.InvoiceCreateParams;
280
- export import InvoiceUpdateParams = API.InvoiceUpdateParams;
281
- export import InvoiceListParams = API.InvoiceListParams;
282
- export import InvoiceFetchUpcomingParams = API.InvoiceFetchUpcomingParams;
283
- export import InvoiceIssueParams = API.InvoiceIssueParams;
284
- export import InvoiceMarkPaidParams = API.InvoiceMarkPaidParams;
285
-
286
- export import Items = API.Items;
287
- export import Item = API.Item;
288
- export import ItemsPage = API.ItemsPage;
289
- export import ItemCreateParams = API.ItemCreateParams;
290
- export import ItemUpdateParams = API.ItemUpdateParams;
291
- export import ItemListParams = API.ItemListParams;
292
-
293
- export import Metrics = API.Metrics;
294
- export import BillableMetric = API.BillableMetric;
295
- export import BillableMetricsPage = API.BillableMetricsPage;
296
- export import MetricCreateParams = API.MetricCreateParams;
297
- export import MetricUpdateParams = API.MetricUpdateParams;
298
- export import MetricListParams = API.MetricListParams;
299
-
300
- export import Plans = API.Plans;
301
- export import Plan = API.Plan;
302
- export import PlansPage = API.PlansPage;
303
- export import PlanCreateParams = API.PlanCreateParams;
304
- export import PlanUpdateParams = API.PlanUpdateParams;
305
- export import PlanListParams = API.PlanListParams;
306
-
307
- export import Prices = API.Prices;
308
- export import EvaluatePriceGroup = API.EvaluatePriceGroup;
309
- export import Price = API.Price;
310
- export import PriceEvaluateResponse = API.PriceEvaluateResponse;
311
- export import PricesPage = API.PricesPage;
312
- export import PriceCreateParams = API.PriceCreateParams;
313
- export import PriceUpdateParams = API.PriceUpdateParams;
314
- export import PriceListParams = API.PriceListParams;
315
- export import PriceEvaluateParams = API.PriceEvaluateParams;
316
-
317
- export import Subscriptions = API.Subscriptions;
318
- export import Subscription = API.Subscription;
319
- export import SubscriptionUsage = API.SubscriptionUsage;
320
- export import SubscriptionFetchCostsResponse = API.SubscriptionFetchCostsResponse;
321
- export import SubscriptionFetchScheduleResponse = API.SubscriptionFetchScheduleResponse;
322
- export import SubscriptionsPage = API.SubscriptionsPage;
323
- export import SubscriptionFetchScheduleResponsesPage = API.SubscriptionFetchScheduleResponsesPage;
324
- export import SubscriptionCreateParams = API.SubscriptionCreateParams;
325
- export import SubscriptionUpdateParams = API.SubscriptionUpdateParams;
326
- export import SubscriptionListParams = API.SubscriptionListParams;
327
- export import SubscriptionCancelParams = API.SubscriptionCancelParams;
328
- export import SubscriptionFetchCostsParams = API.SubscriptionFetchCostsParams;
329
- export import SubscriptionFetchScheduleParams = API.SubscriptionFetchScheduleParams;
330
- export import SubscriptionFetchUsageParams = API.SubscriptionFetchUsageParams;
331
- export import SubscriptionPriceIntervalsParams = API.SubscriptionPriceIntervalsParams;
332
- export import SubscriptionSchedulePlanChangeParams = API.SubscriptionSchedulePlanChangeParams;
333
- export import SubscriptionTriggerPhaseParams = API.SubscriptionTriggerPhaseParams;
334
- export import SubscriptionUnscheduleFixedFeeQuantityUpdatesParams = API.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams;
335
- export import SubscriptionUpdateFixedFeeQuantityParams = API.SubscriptionUpdateFixedFeeQuantityParams;
336
- export import SubscriptionUpdateTrialParams = API.SubscriptionUpdateTrialParams;
337
-
338
- export import Alerts = API.Alerts;
339
- export import Alert = API.Alert;
340
- export import AlertsPage = API.AlertsPage;
341
- export import AlertUpdateParams = API.AlertUpdateParams;
342
- export import AlertListParams = API.AlertListParams;
343
- export import AlertCreateForCustomerParams = API.AlertCreateForCustomerParams;
344
- export import AlertCreateForExternalCustomerParams = API.AlertCreateForExternalCustomerParams;
345
- export import AlertCreateForSubscriptionParams = API.AlertCreateForSubscriptionParams;
346
-
347
- export import AmountDiscount = API.AmountDiscount;
348
- export import BillingCycleRelativeDate = API.BillingCycleRelativeDate;
349
- export import Discount = API.Discount;
350
- export import InvoiceLevelDiscount = API.InvoiceLevelDiscount;
351
- export import PaginationMetadata = API.PaginationMetadata;
352
- export import PercentageDiscount = API.PercentageDiscount;
353
- export import TrialDiscount = API.TrialDiscount;
354
- }
558
+ } from './error';
355
559
 
356
560
  export default Orb;
@@ -3,7 +3,6 @@
3
3
  import { APIResource } from '../resource';
4
4
  import { isRequestOptions } from '../core';
5
5
  import * as Core from '../core';
6
- import * as AlertsAPI from './alerts';
7
6
  import { Page, type PageParams } from '../pagination';
8
7
 
9
8
  export class Alerts extends APIResource {
@@ -110,17 +109,55 @@ export class Alerts extends APIResource {
110
109
  }
111
110
 
112
111
  /**
113
- * This endpoint can be used to disable an alert.
112
+ * This endpoint allows you to disable an alert. To disable a plan-level alert for
113
+ * a specific subscription, you must include the `subscription_id`. The
114
+ * `subscription_id` is not required for customer or subscription level alerts.
114
115
  */
115
- disable(alertConfigurationId: string, options?: Core.RequestOptions): Core.APIPromise<Alert> {
116
- return this._client.post(`/alerts/${alertConfigurationId}/disable`, options);
116
+ disable(
117
+ alertConfigurationId: string,
118
+ params?: AlertDisableParams,
119
+ options?: Core.RequestOptions,
120
+ ): Core.APIPromise<Alert>;
121
+ disable(alertConfigurationId: string, options?: Core.RequestOptions): Core.APIPromise<Alert>;
122
+ disable(
123
+ alertConfigurationId: string,
124
+ params: AlertDisableParams | Core.RequestOptions = {},
125
+ options?: Core.RequestOptions,
126
+ ): Core.APIPromise<Alert> {
127
+ if (isRequestOptions(params)) {
128
+ return this.disable(alertConfigurationId, {}, params);
129
+ }
130
+ const { subscription_id } = params;
131
+ return this._client.post(`/alerts/${alertConfigurationId}/disable`, {
132
+ query: { subscription_id },
133
+ ...options,
134
+ });
117
135
  }
118
136
 
119
137
  /**
120
- * This endpoint can be used to enable an alert.
138
+ * This endpoint allows you to enable an alert. To enable a plan-level alert for a
139
+ * specific subscription, you must include the `subscription_id`. The
140
+ * `subscription_id` is not required for customer or subscription level alerts.
121
141
  */
122
- enable(alertConfigurationId: string, options?: Core.RequestOptions): Core.APIPromise<Alert> {
123
- return this._client.post(`/alerts/${alertConfigurationId}/enable`, options);
142
+ enable(
143
+ alertConfigurationId: string,
144
+ params?: AlertEnableParams,
145
+ options?: Core.RequestOptions,
146
+ ): Core.APIPromise<Alert>;
147
+ enable(alertConfigurationId: string, options?: Core.RequestOptions): Core.APIPromise<Alert>;
148
+ enable(
149
+ alertConfigurationId: string,
150
+ params: AlertEnableParams | Core.RequestOptions = {},
151
+ options?: Core.RequestOptions,
152
+ ): Core.APIPromise<Alert> {
153
+ if (isRequestOptions(params)) {
154
+ return this.enable(alertConfigurationId, {}, params);
155
+ }
156
+ const { subscription_id } = params;
157
+ return this._client.post(`/alerts/${alertConfigurationId}/enable`, {
158
+ query: { subscription_id },
159
+ ...options,
160
+ });
124
161
  }
125
162
  }
126
163
 
@@ -133,11 +170,6 @@ export class AlertsPage extends Page<Alert> {}
133
170
  *
134
171
  * Alerts created through the API can be scoped to either customers or
135
172
  * subscriptions.
136
- *
137
- * | Scope | Monitors | Vaild Alert Types |
138
- * | ------------ | ------------------------------ | ----------------------------------------------------------------------------------- |
139
- * | Customer | A customer's credit balance | `credit_balance_depleted`, `credit_balance_recovered`, and `credit_balance_dropped` |
140
- * | Subscription | A subscription's usage or cost | `usage_exceeded` and `cost_exceeded` |
141
173
  */
142
174
  export interface Alert {
143
175
  /**
@@ -158,7 +190,7 @@ export interface Alert {
158
190
  /**
159
191
  * The customer the alert applies to.
160
192
  */
161
- customer: Record<string, string | null> | null;
193
+ customer: Alert.Customer | null;
162
194
 
163
195
  /**
164
196
  * Whether the alert is enabled or disabled.
@@ -168,17 +200,17 @@ export interface Alert {
168
200
  /**
169
201
  * The metric the alert applies to.
170
202
  */
171
- metric: Record<string, string | null> | null;
203
+ metric: Alert.Metric | null;
172
204
 
173
205
  /**
174
206
  * The plan the alert applies to.
175
207
  */
176
- plan: Record<string, string | null> | null;
208
+ plan: Alert.Plan | null;
177
209
 
178
210
  /**
179
211
  * The subscription the alert applies to.
180
212
  */
181
- subscription: Record<string, string | null> | null;
213
+ subscription: Alert.Subscription | null;
182
214
 
183
215
  /**
184
216
  * The thresholds that define the conditions under which the alert will be
@@ -198,6 +230,47 @@ export interface Alert {
198
230
  }
199
231
 
200
232
  export namespace Alert {
233
+ /**
234
+ * The customer the alert applies to.
235
+ */
236
+ export interface Customer {
237
+ id: string;
238
+
239
+ external_customer_id: string | null;
240
+ }
241
+
242
+ /**
243
+ * The metric the alert applies to.
244
+ */
245
+ export interface Metric {
246
+ id: string;
247
+ }
248
+
249
+ /**
250
+ * The plan the alert applies to.
251
+ */
252
+ export interface Plan {
253
+ id: string | null;
254
+
255
+ /**
256
+ * An optional user-defined ID for this plan resource, used throughout the system
257
+ * as an alias for this Plan. Use this field to identify a plan by an existing
258
+ * identifier in your system.
259
+ */
260
+ external_plan_id: string | null;
261
+
262
+ name: string | null;
263
+
264
+ plan_version: string;
265
+ }
266
+
267
+ /**
268
+ * The subscription the alert applies to.
269
+ */
270
+ export interface Subscription {
271
+ id: string;
272
+ }
273
+
201
274
  /**
202
275
  * Thresholds are used to define the conditions under which an alert will be
203
276
  * triggered.
@@ -370,12 +443,32 @@ export namespace AlertCreateForSubscriptionParams {
370
443
  }
371
444
  }
372
445
 
373
- export namespace Alerts {
374
- export import Alert = AlertsAPI.Alert;
375
- export import AlertsPage = AlertsAPI.AlertsPage;
376
- export import AlertUpdateParams = AlertsAPI.AlertUpdateParams;
377
- export import AlertListParams = AlertsAPI.AlertListParams;
378
- export import AlertCreateForCustomerParams = AlertsAPI.AlertCreateForCustomerParams;
379
- export import AlertCreateForExternalCustomerParams = AlertsAPI.AlertCreateForExternalCustomerParams;
380
- export import AlertCreateForSubscriptionParams = AlertsAPI.AlertCreateForSubscriptionParams;
446
+ export interface AlertDisableParams {
447
+ /**
448
+ * Used to update the status of a plan alert scoped to this subscription_id
449
+ */
450
+ subscription_id?: string | null;
451
+ }
452
+
453
+ export interface AlertEnableParams {
454
+ /**
455
+ * Used to update the status of a plan alert scoped to this subscription_id
456
+ */
457
+ subscription_id?: string | null;
458
+ }
459
+
460
+ Alerts.AlertsPage = AlertsPage;
461
+
462
+ export declare namespace Alerts {
463
+ export {
464
+ type Alert as Alert,
465
+ AlertsPage as AlertsPage,
466
+ type AlertUpdateParams as AlertUpdateParams,
467
+ type AlertListParams as AlertListParams,
468
+ type AlertCreateForCustomerParams as AlertCreateForCustomerParams,
469
+ type AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams,
470
+ type AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams,
471
+ type AlertDisableParams as AlertDisableParams,
472
+ type AlertEnableParams as AlertEnableParams,
473
+ };
381
474
  }