@openmeter/sdk 1.0.0-beta.98 → 1.0.0-beta-9958c9245841

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 (203) hide show
  1. package/Makefile +43 -0
  2. package/README.md +232 -137
  3. package/biome.json +67 -0
  4. package/dist/cjs/index.cjs +15 -21
  5. package/dist/cjs/index.d.cts +1 -15
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/cjs/src/client/addons.cjs +105 -0
  8. package/dist/cjs/src/client/addons.d.cts +152 -0
  9. package/dist/cjs/src/client/addons.js.map +1 -0
  10. package/dist/cjs/src/client/apps.cjs +247 -0
  11. package/dist/cjs/src/client/apps.d.cts +327 -0
  12. package/dist/cjs/src/client/apps.js.map +1 -0
  13. package/dist/cjs/src/client/billing.cjs +375 -0
  14. package/dist/cjs/src/client/billing.d.cts +563 -0
  15. package/dist/cjs/src/client/billing.js.map +1 -0
  16. package/dist/cjs/src/client/common.cjs +47 -0
  17. package/dist/cjs/src/client/common.d.cts +30 -0
  18. package/dist/cjs/src/client/common.js.map +1 -0
  19. package/dist/cjs/src/client/customers.cjs +469 -0
  20. package/dist/cjs/src/client/customers.d.cts +617 -0
  21. package/dist/cjs/src/client/customers.js.map +1 -0
  22. package/dist/cjs/src/client/debug.cjs +27 -0
  23. package/dist/cjs/src/client/debug.d.cts +17 -0
  24. package/dist/cjs/src/client/debug.js.map +1 -0
  25. package/dist/cjs/src/client/entitlements.cjs +372 -0
  26. package/dist/cjs/src/client/entitlements.d.cts +670 -0
  27. package/dist/cjs/src/client/entitlements.js.map +1 -0
  28. package/dist/cjs/src/client/events.cjs +113 -0
  29. package/dist/cjs/src/client/events.d.cts +48 -0
  30. package/dist/cjs/src/client/events.js.map +1 -0
  31. package/dist/cjs/src/client/features.cjs +78 -0
  32. package/dist/cjs/src/client/features.d.cts +87 -0
  33. package/dist/cjs/src/client/features.js.map +1 -0
  34. package/dist/cjs/src/client/index.cjs +122 -0
  35. package/dist/cjs/src/client/index.d.cts +54 -0
  36. package/dist/cjs/src/client/index.js.map +1 -0
  37. package/dist/cjs/src/client/info.cjs +42 -0
  38. package/dist/cjs/src/client/info.d.cts +34 -0
  39. package/dist/cjs/src/client/info.js.map +1 -0
  40. package/dist/cjs/src/client/meters.cjs +160 -0
  41. package/dist/cjs/src/client/meters.d.cts +151 -0
  42. package/dist/cjs/src/client/meters.js.map +1 -0
  43. package/dist/cjs/src/client/notifications.cjs +269 -0
  44. package/dist/cjs/src/client/notifications.d.cts +412 -0
  45. package/dist/cjs/src/client/notifications.js.map +1 -0
  46. package/dist/cjs/src/client/plans.cjs +204 -0
  47. package/dist/cjs/src/client/plans.d.cts +247 -0
  48. package/dist/cjs/src/client/plans.js.map +1 -0
  49. package/dist/cjs/src/client/portal.cjs +55 -0
  50. package/dist/cjs/src/client/portal.d.cts +48 -0
  51. package/dist/cjs/src/client/portal.js.map +1 -0
  52. package/dist/cjs/src/client/schemas.cjs +3 -0
  53. package/dist/cjs/src/client/schemas.d.cts +27081 -0
  54. package/dist/cjs/src/client/schemas.js.map +1 -0
  55. package/dist/cjs/src/client/subjects.cjs +76 -0
  56. package/dist/cjs/src/client/subjects.d.cts +79 -0
  57. package/dist/cjs/src/client/subjects.js.map +1 -0
  58. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  59. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  60. package/dist/cjs/src/client/subscription-addons.js.map +1 -0
  61. package/dist/cjs/src/client/subscriptions.cjs +132 -0
  62. package/dist/cjs/src/client/subscriptions.d.cts +175 -0
  63. package/dist/cjs/src/client/subscriptions.js.map +1 -0
  64. package/dist/cjs/src/client/utils.cjs +67 -0
  65. package/dist/cjs/src/client/utils.d.cts +12 -0
  66. package/dist/cjs/src/client/utils.js.map +1 -0
  67. package/dist/cjs/src/portal/index.cjs +89 -0
  68. package/dist/cjs/src/portal/index.d.cts +43 -0
  69. package/dist/cjs/src/portal/index.js.map +1 -0
  70. package/dist/cjs/src/react/context.cjs +35 -0
  71. package/dist/cjs/src/react/context.d.cts +9 -0
  72. package/dist/cjs/src/react/context.js.map +1 -0
  73. package/dist/cjs/src/zod/index.cjs +13102 -0
  74. package/dist/cjs/src/zod/index.d.cts +20044 -0
  75. package/dist/cjs/src/zod/index.js.map +1 -0
  76. package/dist/cjs/tsconfig.0781fa96.tsbuildinfo +1 -0
  77. package/dist/cjs/tsconfig.6c95ff08.tsbuildinfo +1 -0
  78. package/dist/index.d.ts +1 -15
  79. package/dist/index.js +1 -17
  80. package/dist/index.js.map +1 -1
  81. package/dist/src/client/addons.d.ts +152 -0
  82. package/dist/src/client/addons.js +101 -0
  83. package/dist/src/client/addons.js.map +1 -0
  84. package/dist/src/client/apps.d.ts +327 -0
  85. package/dist/src/client/apps.js +240 -0
  86. package/dist/src/client/apps.js.map +1 -0
  87. package/dist/src/client/billing.d.ts +563 -0
  88. package/dist/src/client/billing.js +368 -0
  89. package/dist/src/client/billing.js.map +1 -0
  90. package/dist/src/client/common.d.ts +30 -0
  91. package/dist/src/client/common.js +42 -0
  92. package/dist/src/client/common.js.map +1 -0
  93. package/dist/src/client/customers.d.ts +617 -0
  94. package/dist/src/client/customers.js +461 -0
  95. package/dist/src/client/customers.js.map +1 -0
  96. package/dist/src/client/debug.d.ts +17 -0
  97. package/dist/src/client/debug.js +23 -0
  98. package/dist/src/client/debug.js.map +1 -0
  99. package/dist/src/client/entitlements.d.ts +670 -0
  100. package/dist/src/client/entitlements.js +365 -0
  101. package/dist/src/client/entitlements.js.map +1 -0
  102. package/dist/src/client/events.d.ts +48 -0
  103. package/dist/src/client/events.js +108 -0
  104. package/dist/src/client/events.js.map +1 -0
  105. package/dist/src/client/features.d.ts +87 -0
  106. package/dist/src/client/features.js +74 -0
  107. package/dist/src/client/features.js.map +1 -0
  108. package/dist/src/client/index.d.ts +54 -0
  109. package/dist/src/client/index.js +82 -0
  110. package/dist/src/client/index.js.map +1 -0
  111. package/dist/src/client/info.d.ts +34 -0
  112. package/dist/src/client/info.js +38 -0
  113. package/dist/src/client/info.js.map +1 -0
  114. package/dist/src/client/meters.d.ts +151 -0
  115. package/dist/src/client/meters.js +156 -0
  116. package/dist/src/client/meters.js.map +1 -0
  117. package/dist/src/client/notifications.d.ts +412 -0
  118. package/dist/src/client/notifications.js +262 -0
  119. package/dist/src/client/notifications.js.map +1 -0
  120. package/dist/src/client/plans.d.ts +247 -0
  121. package/dist/src/client/plans.js +199 -0
  122. package/dist/src/client/plans.js.map +1 -0
  123. package/dist/src/client/portal.d.ts +48 -0
  124. package/dist/src/client/portal.js +51 -0
  125. package/dist/src/client/portal.js.map +1 -0
  126. package/dist/src/client/schemas.d.ts +27081 -0
  127. package/dist/src/client/schemas.js +2 -0
  128. package/dist/src/client/schemas.js.map +1 -0
  129. package/dist/src/client/subjects.d.ts +79 -0
  130. package/dist/src/client/subjects.js +72 -0
  131. package/dist/src/client/subjects.js.map +1 -0
  132. package/dist/src/client/subscription-addons.d.ts +123 -0
  133. package/dist/src/client/subscription-addons.js +66 -0
  134. package/dist/src/client/subscription-addons.js.map +1 -0
  135. package/dist/src/client/subscriptions.d.ts +175 -0
  136. package/dist/src/client/subscriptions.js +128 -0
  137. package/dist/src/client/subscriptions.js.map +1 -0
  138. package/dist/src/client/utils.d.ts +12 -0
  139. package/dist/src/client/utils.js +61 -0
  140. package/dist/src/client/utils.js.map +1 -0
  141. package/dist/src/portal/index.d.ts +43 -0
  142. package/dist/src/portal/index.js +52 -0
  143. package/dist/src/portal/index.js.map +1 -0
  144. package/dist/src/react/context.d.ts +9 -0
  145. package/dist/src/react/context.js +16 -0
  146. package/dist/src/react/context.js.map +1 -0
  147. package/dist/src/zod/index.d.ts +20044 -0
  148. package/dist/src/zod/index.js +13071 -0
  149. package/dist/src/zod/index.js.map +1 -0
  150. package/dist/tsconfig.tsbuildinfo +1 -1
  151. package/orval.config.ts +38 -0
  152. package/package.json +62 -32
  153. package/patches/openapi-typescript.patch +6194 -0
  154. package/dist/cjs/clients/client.cjs +0 -117
  155. package/dist/cjs/clients/client.d.cts +0 -40
  156. package/dist/cjs/clients/client.js.map +0 -1
  157. package/dist/cjs/clients/event.cjs +0 -71
  158. package/dist/cjs/clients/event.d.cts +0 -79
  159. package/dist/cjs/clients/event.js.map +0 -1
  160. package/dist/cjs/clients/meter.cjs +0 -69
  161. package/dist/cjs/clients/meter.d.cts +0 -75
  162. package/dist/cjs/clients/meter.js.map +0 -1
  163. package/dist/cjs/clients/portal.cjs +0 -41
  164. package/dist/cjs/clients/portal.d.cts +0 -22
  165. package/dist/cjs/clients/portal.js.map +0 -1
  166. package/dist/cjs/clients/subject.cjs +0 -60
  167. package/dist/cjs/clients/subject.d.cts +0 -27
  168. package/dist/cjs/clients/subject.js.map +0 -1
  169. package/dist/cjs/schemas/openapi.cjs +0 -7
  170. package/dist/cjs/schemas/openapi.d.cts +0 -2078
  171. package/dist/cjs/schemas/openapi.js.map +0 -1
  172. package/dist/cjs/test/agent.cjs +0 -266
  173. package/dist/cjs/test/agent.d.cts +0 -2
  174. package/dist/cjs/test/agent.js.map +0 -1
  175. package/dist/cjs/test/mocks.cjs +0 -44
  176. package/dist/cjs/test/mocks.d.cts +0 -14
  177. package/dist/cjs/test/mocks.js.map +0 -1
  178. package/dist/cjs/tsconfig.4e4a4d92.tsbuildinfo +0 -1
  179. package/dist/cjs/tsconfig.d9d2f106.tsbuildinfo +0 -1
  180. package/dist/clients/client.d.ts +0 -40
  181. package/dist/clients/client.js +0 -112
  182. package/dist/clients/client.js.map +0 -1
  183. package/dist/clients/event.d.ts +0 -79
  184. package/dist/clients/event.js +0 -64
  185. package/dist/clients/event.js.map +0 -1
  186. package/dist/clients/meter.d.ts +0 -75
  187. package/dist/clients/meter.js +0 -65
  188. package/dist/clients/meter.js.map +0 -1
  189. package/dist/clients/portal.d.ts +0 -22
  190. package/dist/clients/portal.js +0 -37
  191. package/dist/clients/portal.js.map +0 -1
  192. package/dist/clients/subject.d.ts +0 -27
  193. package/dist/clients/subject.js +0 -56
  194. package/dist/clients/subject.js.map +0 -1
  195. package/dist/schemas/openapi.d.ts +0 -2078
  196. package/dist/schemas/openapi.js +0 -6
  197. package/dist/schemas/openapi.js.map +0 -1
  198. package/dist/test/agent.d.ts +0 -2
  199. package/dist/test/agent.js +0 -263
  200. package/dist/test/agent.js.map +0 -1
  201. package/dist/test/mocks.d.ts +0 -14
  202. package/dist/test/mocks.js +0 -41
  203. package/dist/test/mocks.js.map +0 -1
@@ -0,0 +1,375 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingCustomers = exports.BillingInvoices = exports.BillingProfiles = exports.Billing = void 0;
4
+ const utils_js_1 = require("./utils.cjs");
5
+ /**
6
+ * Billing
7
+ */
8
+ class Billing {
9
+ client;
10
+ profiles;
11
+ invoices;
12
+ customers;
13
+ constructor(client) {
14
+ this.client = client;
15
+ this.profiles = new BillingProfiles(this.client);
16
+ this.invoices = new BillingInvoices(this.client);
17
+ this.customers = new BillingCustomers(this.client);
18
+ }
19
+ }
20
+ exports.Billing = Billing;
21
+ /**
22
+ * Billing Profiles
23
+ */
24
+ class BillingProfiles {
25
+ client;
26
+ constructor(client) {
27
+ this.client = client;
28
+ }
29
+ /**
30
+ * Create a billing profile
31
+ * @param billingProfile - The billing profile to create
32
+ * @param signal - An optional abort signal
33
+ * @returns The created billing profile
34
+ */
35
+ async create(billingProfile, options) {
36
+ const resp = await this.client.POST('/api/v1/billing/profiles', {
37
+ body: billingProfile,
38
+ ...options,
39
+ });
40
+ return (0, utils_js_1.transformResponse)(resp);
41
+ }
42
+ /**
43
+ * Get a billing profile by ID
44
+ * @param id - The ID of the billing profile to get
45
+ * @param signal - An optional abort signal
46
+ * @returns The billing profile
47
+ */
48
+ async get(id, options) {
49
+ const resp = await this.client.GET('/api/v1/billing/profiles/{id}', {
50
+ params: {
51
+ path: { id },
52
+ },
53
+ ...options,
54
+ });
55
+ return (0, utils_js_1.transformResponse)(resp);
56
+ }
57
+ /**
58
+ * List billing profiles
59
+ * @param query - The query parameters
60
+ * @param signal - An optional abort signal
61
+ * @returns The billing profiles
62
+ */
63
+ async list(query, options) {
64
+ const resp = await this.client.GET('/api/v1/billing/profiles', {
65
+ params: {
66
+ query,
67
+ },
68
+ ...options,
69
+ });
70
+ return (0, utils_js_1.transformResponse)(resp);
71
+ }
72
+ /**
73
+ * Update a billing profile
74
+ * @param id - The ID of the billing profile to update
75
+ * @param billingProfile - The billing profile to update
76
+ * @param signal - An optional abort signal
77
+ * @returns The updated billing profile
78
+ */
79
+ async update(id, billingProfile, options) {
80
+ const resp = await this.client.PUT('/api/v1/billing/profiles/{id}', {
81
+ body: billingProfile,
82
+ params: {
83
+ path: { id },
84
+ },
85
+ ...options,
86
+ });
87
+ return (0, utils_js_1.transformResponse)(resp);
88
+ }
89
+ /**
90
+ * Delete a billing profile
91
+ * @param id - The ID of the billing profile to delete
92
+ * @param options - The request options
93
+ * @returns The deleted billing profile
94
+ */
95
+ async delete(id, options) {
96
+ const resp = await this.client.DELETE('/api/v1/billing/profiles/{id}', {
97
+ params: {
98
+ path: { id },
99
+ },
100
+ ...options,
101
+ });
102
+ return (0, utils_js_1.transformResponse)(resp);
103
+ }
104
+ }
105
+ exports.BillingProfiles = BillingProfiles;
106
+ /**
107
+ * Billing Invoices
108
+ */
109
+ class BillingInvoices {
110
+ client;
111
+ constructor(client) {
112
+ this.client = client;
113
+ }
114
+ /**
115
+ * List invoices
116
+ * @param query - The query parameters
117
+ * @param signal - An optional abort signal
118
+ * @returns The invoices
119
+ */
120
+ async list(query, options) {
121
+ const resp = await this.client.GET('/api/v1/billing/invoices', {
122
+ params: {
123
+ query,
124
+ },
125
+ ...options,
126
+ });
127
+ return (0, utils_js_1.transformResponse)(resp);
128
+ }
129
+ /**
130
+ * Get an invoice by ID
131
+ * @param id - The ID of the invoice to get
132
+ * @param signal - An optional abort signal
133
+ * @returns The invoice
134
+ */
135
+ async get(id, options) {
136
+ const resp = await this.client.GET('/api/v1/billing/invoices/{invoiceId}', {
137
+ params: {
138
+ path: { invoiceId: id },
139
+ },
140
+ ...options,
141
+ });
142
+ return (0, utils_js_1.transformResponse)(resp);
143
+ }
144
+ /**
145
+ * Update an invoice
146
+ * @description Only invoices in draft or earlier status can be updated.
147
+ * @param id - The ID of the invoice to update
148
+ * @param invoice - The invoice to update
149
+ * @param signal - An optional abort signal
150
+ * @returns The updated invoice
151
+ */
152
+ async update(id, invoice, options) {
153
+ const resp = await this.client.PUT('/api/v1/billing/invoices/{invoiceId}', {
154
+ body: invoice,
155
+ params: { path: { invoiceId: id } },
156
+ ...options,
157
+ });
158
+ return (0, utils_js_1.transformResponse)(resp);
159
+ }
160
+ /**
161
+ * Delete an invoice
162
+ * @description Only invoices that are in the draft (or earlier) status can be deleted.
163
+ * @param id - The ID of the invoice to delete
164
+ * @param options - The request options
165
+ * @returns The deleted invoice
166
+ */
167
+ async delete(id, options) {
168
+ const resp = await this.client.DELETE('/api/v1/billing/invoices/{invoiceId}', {
169
+ params: { path: { invoiceId: id } },
170
+ ...options,
171
+ });
172
+ return (0, utils_js_1.transformResponse)(resp);
173
+ }
174
+ /**
175
+ * Advance the invoice to the next status
176
+ * @description The call doesn't "approve the invoice", it only advances the invoice to the next status if the transition would be automatic. The action can be called when the invoice's statusDetails' actions field contain the "advance" action.
177
+ * @param id - The ID of the invoice to advance
178
+ * @param signal - An optional abort signal
179
+ * @returns The advanced invoice
180
+ */
181
+ async advance(id, options) {
182
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/advance', {
183
+ params: { path: { invoiceId: id } },
184
+ ...options,
185
+ });
186
+ return (0, utils_js_1.transformResponse)(resp);
187
+ }
188
+ /**
189
+ * Approve an invoice
190
+ * @description This call instantly sends the invoice to the customer using the configured billing profile app.
191
+ * @param id - The ID of the invoice to approve
192
+ * @param signal - An optional abort signal
193
+ * @returns The approved invoice
194
+ */
195
+ async approve(id, options) {
196
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/approve', {
197
+ params: { path: { invoiceId: id } },
198
+ ...options,
199
+ });
200
+ return (0, utils_js_1.transformResponse)(resp);
201
+ }
202
+ /**
203
+ * Retry advancing the invoice after a failed attempt.
204
+ * @param id - The ID of the invoice to retry
205
+ * @param signal - An optional abort signal
206
+ * @returns The retried invoice
207
+ */
208
+ async retry(id, options) {
209
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/retry', {
210
+ params: { path: { invoiceId: id } },
211
+ ...options,
212
+ });
213
+ return (0, utils_js_1.transformResponse)(resp);
214
+ }
215
+ /**
216
+ * Void an invoice
217
+ * @description Void an invoice
218
+ *
219
+ * Only invoices that have been alread issued can be voided.
220
+ * @param id - The ID of the invoice to void
221
+ * @param signal - An optional abort signal
222
+ * @returns The voided invoice
223
+ */
224
+ async void(id, body, options) {
225
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/void', {
226
+ body,
227
+ params: { path: { invoiceId: id } },
228
+ ...options,
229
+ });
230
+ return (0, utils_js_1.transformResponse)(resp);
231
+ }
232
+ /**
233
+ * Recalculate an invoice's tax amounts
234
+ * @param id - The ID of the invoice to recalculate
235
+ * @param signal - An optional abort signal
236
+ * @returns The recalculated invoice
237
+ */
238
+ async recalculateTax(id, options) {
239
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/taxes/recalculate', {
240
+ params: { path: { invoiceId: id } },
241
+ ...options,
242
+ });
243
+ return (0, utils_js_1.transformResponse)(resp);
244
+ }
245
+ /**
246
+ * Snapshot invoice line item quantities
247
+ * @description Snapshot the quantities of the invoice line items. This is useful for invoices that have usage-based line items.
248
+ * @param id - The ID of the invoice to snapshot
249
+ * @param signal - An optional abort signal
250
+ * @returns The invoice with snapshotted quantities
251
+ */
252
+ async snapshotQuantities(id, options) {
253
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/snapshot-quantities', {
254
+ params: { path: { invoiceId: id } },
255
+ ...options,
256
+ });
257
+ return (0, utils_js_1.transformResponse)(resp);
258
+ }
259
+ /**
260
+ * Simulate an invoice for a customer
261
+ * @param id - The ID of the customer to simulate the invoice for
262
+ * @param signal - An optional abort signal
263
+ * @returns The simulated invoice
264
+ */
265
+ async simulate(id, body, options) {
266
+ const resp = await this.client.POST('/api/v1/billing/customers/{customerId}/invoices/simulate', {
267
+ body,
268
+ params: { path: { customerId: id } },
269
+ ...options,
270
+ });
271
+ return (0, utils_js_1.transformResponse)(resp);
272
+ }
273
+ /**
274
+ * Create pending line items
275
+ * @description Create new pending line items (charges).
276
+ * This call is used to create a new pending line item for the customer if required a new
277
+ * gathering invoice will be created.
278
+ *
279
+ * A new invoice will be created if:
280
+ * - there is no invoice in gathering state
281
+ * - the currency of the line item doesn't match the currency of any invoices in gathering state
282
+ * @param customerId - The ID of the customer to create the line items for
283
+ * @param body - The line items to create
284
+ * @param signal - An optional abort signal
285
+ * @returns The created line items
286
+ */
287
+ async createLineItems(customerId, body, options) {
288
+ const resp = await this.client.POST('/api/v1/billing/customers/{customerId}/invoices/pending-lines', {
289
+ body,
290
+ params: { path: { customerId } },
291
+ ...options,
292
+ });
293
+ return (0, utils_js_1.transformResponse)(resp);
294
+ }
295
+ /**
296
+ * Invoice a customer based on the pending line items
297
+ * @description Create a new invoice from the pending line items. This should only be called if for some reason we need to invoice a customer outside of the normal billing cycle.
298
+ * @param body - The invoice data
299
+ * @param options - The request options
300
+ * @returns The created invoices
301
+ */
302
+ async invoicePendingLines(body, options) {
303
+ const resp = await this.client.POST('/api/v1/billing/invoices/invoice', {
304
+ body,
305
+ ...options,
306
+ });
307
+ return (0, utils_js_1.transformResponse)(resp);
308
+ }
309
+ }
310
+ exports.BillingInvoices = BillingInvoices;
311
+ /**
312
+ * Billing Customer Invoices and Overrides
313
+ */
314
+ class BillingCustomers {
315
+ client;
316
+ constructor(client) {
317
+ this.client = client;
318
+ }
319
+ /**
320
+ * Create or update a customer override
321
+ * @param id - The ID of the customer to create the override for
322
+ * @param body - The customer override to create
323
+ * @param signal - An optional abort signal
324
+ * @returns The created customer override
325
+ */
326
+ async createOverride(id, body, options) {
327
+ const resp = await this.client.PUT('/api/v1/billing/customers/{customerId}', {
328
+ body,
329
+ params: { path: { customerId: id } },
330
+ ...options,
331
+ });
332
+ return (0, utils_js_1.transformResponse)(resp);
333
+ }
334
+ /**
335
+ * Get a customer override
336
+ * @param id - The ID of the customer to get the override for
337
+ * @param signal - An optional abort signal
338
+ * @returns The customer override
339
+ */
340
+ async getOverride(id, options) {
341
+ const resp = await this.client.GET('/api/v1/billing/customers/{customerId}', {
342
+ params: { path: { customerId: id } },
343
+ ...options,
344
+ });
345
+ return (0, utils_js_1.transformResponse)(resp);
346
+ }
347
+ /**
348
+ * List customer overrides
349
+ * @param query - The query parameters
350
+ * @param signal - An optional abort signal
351
+ * @returns The customer overrides
352
+ */
353
+ async listOverrides(query, options) {
354
+ const resp = await this.client.GET('/api/v1/billing/customers', {
355
+ params: { query },
356
+ ...options,
357
+ });
358
+ return (0, utils_js_1.transformResponse)(resp);
359
+ }
360
+ /**
361
+ * Delete a customer override
362
+ * @param id - The ID of the customer to delete the override for
363
+ * @param signal - An optional abort signal
364
+ * @returns The deleted customer override
365
+ */
366
+ async deleteOverride(id, options) {
367
+ const resp = await this.client.DELETE('/api/v1/billing/customers/{customerId}', {
368
+ params: { path: { customerId: id } },
369
+ ...options,
370
+ });
371
+ return (0, utils_js_1.transformResponse)(resp);
372
+ }
373
+ }
374
+ exports.BillingCustomers = BillingCustomers;
375
+ //# sourceMappingURL=billing.js.map