@openmeter/sdk 1.0.0-beta.21 → 1.0.0-beta.210

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 (138) hide show
  1. package/README.md +38 -150
  2. package/dist/cjs/index.cjs +18 -0
  3. package/dist/cjs/index.d.cts +1 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/src/client/apps.cjs +174 -0
  6. package/dist/cjs/src/client/apps.d.cts +285 -0
  7. package/dist/cjs/src/client/apps.js.map +1 -0
  8. package/dist/cjs/src/client/billing.cjs +309 -0
  9. package/dist/cjs/src/client/billing.d.cts +502 -0
  10. package/dist/cjs/src/client/billing.js.map +1 -0
  11. package/dist/cjs/src/client/common.cjs +47 -0
  12. package/dist/cjs/src/client/common.d.cts +30 -0
  13. package/dist/cjs/src/client/common.js.map +1 -0
  14. package/dist/cjs/src/client/customers.cjs +199 -0
  15. package/dist/cjs/src/client/customers.d.cts +176 -0
  16. package/dist/cjs/src/client/customers.js.map +1 -0
  17. package/dist/cjs/src/client/entitlements.cjs +244 -0
  18. package/dist/cjs/src/client/entitlements.d.cts +472 -0
  19. package/dist/cjs/src/client/entitlements.js.map +1 -0
  20. package/dist/cjs/src/client/events.cjs +66 -0
  21. package/dist/cjs/src/client/events.d.cts +31 -0
  22. package/dist/cjs/src/client/events.js.map +1 -0
  23. package/dist/cjs/src/client/features.cjs +78 -0
  24. package/dist/cjs/src/client/features.d.cts +78 -0
  25. package/dist/cjs/src/client/features.js.map +1 -0
  26. package/dist/cjs/src/client/index.cjs +108 -0
  27. package/dist/cjs/src/client/index.d.cts +45 -0
  28. package/dist/cjs/src/client/index.js.map +1 -0
  29. package/dist/cjs/src/client/meters.cjs +96 -0
  30. package/dist/cjs/src/client/meters.d.cts +99 -0
  31. package/dist/cjs/src/client/meters.js.map +1 -0
  32. package/dist/cjs/src/client/notifications.cjs +249 -0
  33. package/dist/cjs/src/client/notifications.d.cts +219 -0
  34. package/dist/cjs/src/client/notifications.js.map +1 -0
  35. package/dist/cjs/src/client/plans.cjs +127 -0
  36. package/dist/cjs/src/client/plans.d.cts +142 -0
  37. package/dist/cjs/src/client/plans.js.map +1 -0
  38. package/dist/cjs/src/client/portal.cjs +55 -0
  39. package/dist/cjs/src/client/portal.d.cts +48 -0
  40. package/dist/cjs/src/client/portal.js.map +1 -0
  41. package/dist/cjs/src/client/schemas.cjs +3 -0
  42. package/dist/cjs/src/client/schemas.d.cts +22268 -0
  43. package/dist/cjs/src/client/schemas.js.map +1 -0
  44. package/dist/cjs/src/client/subjects.cjs +76 -0
  45. package/dist/cjs/src/client/subjects.d.cts +70 -0
  46. package/dist/cjs/src/client/subjects.js.map +1 -0
  47. package/dist/cjs/src/client/subscriptions.cjs +116 -0
  48. package/dist/cjs/src/client/subscriptions.d.cts +147 -0
  49. package/dist/cjs/src/client/subscriptions.js.map +1 -0
  50. package/dist/cjs/src/client/utils.cjs +69 -0
  51. package/dist/cjs/src/client/utils.d.cts +12 -0
  52. package/dist/cjs/src/client/utils.js.map +1 -0
  53. package/dist/cjs/src/portal/index.cjs +60 -0
  54. package/dist/cjs/src/portal/index.d.cts +43 -0
  55. package/dist/cjs/src/portal/index.js.map +1 -0
  56. package/dist/cjs/src/react/context.cjs +35 -0
  57. package/dist/cjs/src/react/context.d.cts +9 -0
  58. package/dist/cjs/src/react/context.js.map +1 -0
  59. package/dist/cjs/tsconfig.1232d5e5.tsbuildinfo +1 -0
  60. package/dist/cjs/tsconfig.90ca0b5f.tsbuildinfo +1 -0
  61. package/dist/index.d.ts +1 -14
  62. package/dist/index.js +2 -15
  63. package/dist/index.js.map +1 -0
  64. package/dist/src/client/apps.d.ts +285 -0
  65. package/dist/src/client/apps.js +168 -0
  66. package/dist/src/client/apps.js.map +1 -0
  67. package/dist/src/client/billing.d.ts +502 -0
  68. package/dist/src/client/billing.js +302 -0
  69. package/dist/src/client/billing.js.map +1 -0
  70. package/dist/src/client/common.d.ts +30 -0
  71. package/dist/src/client/common.js +42 -0
  72. package/dist/src/client/common.js.map +1 -0
  73. package/dist/src/client/customers.d.ts +176 -0
  74. package/dist/src/client/customers.js +193 -0
  75. package/dist/src/client/customers.js.map +1 -0
  76. package/dist/src/client/entitlements.d.ts +472 -0
  77. package/dist/src/client/entitlements.js +239 -0
  78. package/dist/src/client/entitlements.js.map +1 -0
  79. package/dist/src/client/events.d.ts +31 -0
  80. package/dist/src/client/events.js +58 -0
  81. package/dist/src/client/events.js.map +1 -0
  82. package/dist/src/client/features.d.ts +78 -0
  83. package/dist/src/client/features.js +74 -0
  84. package/dist/src/client/features.js.map +1 -0
  85. package/dist/src/client/index.d.ts +45 -0
  86. package/dist/src/client/index.js +68 -0
  87. package/dist/src/client/index.js.map +1 -0
  88. package/dist/src/client/meters.d.ts +99 -0
  89. package/dist/src/client/meters.js +92 -0
  90. package/dist/src/client/meters.js.map +1 -0
  91. package/dist/src/client/notifications.d.ts +219 -0
  92. package/dist/src/client/notifications.js +242 -0
  93. package/dist/src/client/notifications.js.map +1 -0
  94. package/dist/src/client/plans.d.ts +142 -0
  95. package/dist/src/client/plans.js +123 -0
  96. package/dist/src/client/plans.js.map +1 -0
  97. package/dist/src/client/portal.d.ts +48 -0
  98. package/dist/src/client/portal.js +51 -0
  99. package/dist/src/client/portal.js.map +1 -0
  100. package/dist/src/client/schemas.d.ts +22268 -0
  101. package/dist/src/client/schemas.js +2 -0
  102. package/dist/src/client/schemas.js.map +1 -0
  103. package/dist/src/client/subjects.d.ts +70 -0
  104. package/dist/src/client/subjects.js +72 -0
  105. package/dist/src/client/subjects.js.map +1 -0
  106. package/dist/src/client/subscriptions.d.ts +147 -0
  107. package/dist/src/client/subscriptions.js +112 -0
  108. package/dist/src/client/subscriptions.js.map +1 -0
  109. package/dist/src/client/utils.d.ts +12 -0
  110. package/dist/src/client/utils.js +63 -0
  111. package/dist/src/client/utils.js.map +1 -0
  112. package/dist/src/portal/index.d.ts +43 -0
  113. package/dist/src/portal/index.js +53 -0
  114. package/dist/src/portal/index.js.map +1 -0
  115. package/dist/src/react/context.d.ts +9 -0
  116. package/dist/src/react/context.js +16 -0
  117. package/dist/src/react/context.js.map +1 -0
  118. package/dist/tsconfig.tsbuildinfo +1 -1
  119. package/package.json +75 -35
  120. package/patches/openapi-typescript.patch +73 -0
  121. package/dist/clients/client.d.ts +0 -40
  122. package/dist/clients/client.js +0 -104
  123. package/dist/clients/event.d.ts +0 -79
  124. package/dist/clients/event.js +0 -53
  125. package/dist/clients/meter.d.ts +0 -96
  126. package/dist/clients/meter.js +0 -64
  127. package/dist/clients/portal.d.ts +0 -23
  128. package/dist/clients/portal.js +0 -37
  129. package/dist/next.d.ts +0 -15
  130. package/dist/next.js +0 -46
  131. package/dist/schemas/openapi.d.ts +0 -460
  132. package/dist/schemas/openapi.js +0 -5
  133. package/dist/test/agent.d.ts +0 -2
  134. package/dist/test/agent.js +0 -178
  135. package/dist/test/mocks.d.ts +0 -12
  136. package/dist/test/mocks.js +0 -32
  137. package/index.ts +0 -22
  138. package/next.ts +0 -76
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apps.js","sourceRoot":"","sources":["../../../../src/client/apps.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAU9C;;;GAGG;AACH,MAAa,IAAI;IAIK;IAHb,WAAW,CAAgB;IAC3B,MAAM,CAAW;IAExB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;QAC9D,IAAI,CAAC,WAAW,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAA;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAA;IACrC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CACf,KAAqD,EACrD,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE;YACjD,MAAM,EAAE,EAAE,KAAK,EAAE;YACjB,GAAG,OAAO;SACX,CAAC,C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C,oDAAoD,EACpD;YACE,IAAI;YACJ,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE;YAC1B,GAAG,OAAO;SACX,CACF,CAAA;QAED,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AAvGD,wCAuGC;AAED;;GAEG;AACH,MAAa,SAAS;IACA;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CAChC,IAAwC,EACxC,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE;YACtE,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AApBD,8BAoBC"}
@@ -0,0 +1,309 @@
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
+ exports.BillingProfiles = BillingProfiles;
91
+ /**
92
+ * Billing Invoices
93
+ */
94
+ class BillingInvoices {
95
+ client;
96
+ constructor(client) {
97
+ this.client = client;
98
+ }
99
+ /**
100
+ * List invoices
101
+ * @param query - The query parameters
102
+ * @param signal - An optional abort signal
103
+ * @returns The invoices
104
+ */
105
+ async list(query, options) {
106
+ const resp = await this.client.GET('/api/v1/billing/invoices', {
107
+ params: {
108
+ query,
109
+ },
110
+ ...options,
111
+ });
112
+ return (0, utils_js_1.transformResponse)(resp);
113
+ }
114
+ /**
115
+ * Get an invoice by ID
116
+ * @param id - The ID of the invoice to get
117
+ * @param signal - An optional abort signal
118
+ * @returns The invoice
119
+ */
120
+ async get(id, options) {
121
+ const resp = await this.client.GET('/api/v1/billing/invoices/{invoiceId}', {
122
+ params: {
123
+ path: { invoiceId: id },
124
+ },
125
+ ...options,
126
+ });
127
+ return (0, utils_js_1.transformResponse)(resp);
128
+ }
129
+ /**
130
+ * Update an invoice
131
+ * @description Only invoices in draft or earlier status can be updated.
132
+ * @param id - The ID of the invoice to update
133
+ * @param invoice - The invoice to update
134
+ * @param signal - An optional abort signal
135
+ * @returns The updated invoice
136
+ */
137
+ async update(id, invoice, options) {
138
+ const resp = await this.client.PUT('/api/v1/billing/invoices/{invoiceId}', {
139
+ body: invoice,
140
+ params: { path: { invoiceId: id } },
141
+ ...options,
142
+ });
143
+ return (0, utils_js_1.transformResponse)(resp);
144
+ }
145
+ /**
146
+ * Advance the invoice to the next status
147
+ * @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.
148
+ * @param id - The ID of the invoice to advance
149
+ * @param signal - An optional abort signal
150
+ * @returns The advanced invoice
151
+ */
152
+ async advance(id, options) {
153
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/advance', {
154
+ params: { path: { invoiceId: id } },
155
+ ...options,
156
+ });
157
+ return (0, utils_js_1.transformResponse)(resp);
158
+ }
159
+ /**
160
+ * Approve an invoice
161
+ * @description This call instantly sends the invoice to the customer using the configured billing profile app.
162
+ * @param id - The ID of the invoice to approve
163
+ * @param signal - An optional abort signal
164
+ * @returns The approved invoice
165
+ */
166
+ async approve(id, options) {
167
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/approve', {
168
+ params: { path: { invoiceId: id } },
169
+ ...options,
170
+ });
171
+ return (0, utils_js_1.transformResponse)(resp);
172
+ }
173
+ /**
174
+ * Retry advancing the invoice after a failed attempt.
175
+ * @param id - The ID of the invoice to retry
176
+ * @param signal - An optional abort signal
177
+ * @returns The retried invoice
178
+ */
179
+ async retry(id, options) {
180
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/retry', {
181
+ params: { path: { invoiceId: id } },
182
+ ...options,
183
+ });
184
+ return (0, utils_js_1.transformResponse)(resp);
185
+ }
186
+ /**
187
+ * Void an invoice
188
+ * @description Void an invoice
189
+ *
190
+ * Only invoices that have been alread issued can be voided.
191
+ * @param id - The ID of the invoice to void
192
+ * @param signal - An optional abort signal
193
+ * @returns The voided invoice
194
+ */
195
+ async void(id, body, options) {
196
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/void', {
197
+ body,
198
+ params: { path: { invoiceId: id } },
199
+ ...options,
200
+ });
201
+ return (0, utils_js_1.transformResponse)(resp);
202
+ }
203
+ /**
204
+ * Recalculate an invoice's tax amounts
205
+ * @param id - The ID of the invoice to recalculate
206
+ * @param signal - An optional abort signal
207
+ * @returns The recalculated invoice
208
+ */
209
+ async recalculateTax(id, options) {
210
+ const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/taxes/recalculate', {
211
+ params: { path: { invoiceId: id } },
212
+ ...options,
213
+ });
214
+ return (0, utils_js_1.transformResponse)(resp);
215
+ }
216
+ /**
217
+ * Simulate an invoice for a customer
218
+ * @param id - The ID of the customer to simulate the invoice for
219
+ * @param signal - An optional abort signal
220
+ * @returns The simulated invoice
221
+ */
222
+ async simulate(id, body, options) {
223
+ const resp = await this.client.POST('/api/v1/billing/customers/{customerId}/invoices/simulate', {
224
+ body,
225
+ params: { path: { customerId: id } },
226
+ ...options,
227
+ });
228
+ return (0, utils_js_1.transformResponse)(resp);
229
+ }
230
+ /**
231
+ * Create pending invoice line items
232
+ * @param body - The pending invoice line items to create
233
+ * @param signal - An optional abort signal
234
+ * @returns The created pending invoice line items
235
+ */
236
+ async createLineItems(body, options) {
237
+ const resp = await this.client.POST('/api/v1/billing/invoices/lines', {
238
+ body,
239
+ ...options,
240
+ });
241
+ return (0, utils_js_1.transformResponse)(resp);
242
+ }
243
+ }
244
+ exports.BillingInvoices = BillingInvoices;
245
+ /**
246
+ * Billing Customer Invoices and Overrides
247
+ */
248
+ class BillingCustomers {
249
+ client;
250
+ constructor(client) {
251
+ this.client = client;
252
+ }
253
+ /**
254
+ * Create or update a customer override
255
+ * @param id - The ID of the customer to create the override for
256
+ * @param body - The customer override to create
257
+ * @param signal - An optional abort signal
258
+ * @returns The created customer override
259
+ */
260
+ async createOverride(id, body, options) {
261
+ const resp = await this.client.PUT('/api/v1/billing/customers/{customerId}', {
262
+ body,
263
+ params: { path: { customerId: id } },
264
+ ...options,
265
+ });
266
+ return (0, utils_js_1.transformResponse)(resp);
267
+ }
268
+ /**
269
+ * Get a customer override
270
+ * @param id - The ID of the customer to get the override for
271
+ * @param signal - An optional abort signal
272
+ * @returns The customer override
273
+ */
274
+ async getOverride(id, options) {
275
+ const resp = await this.client.GET('/api/v1/billing/customers/{customerId}', {
276
+ params: { path: { customerId: id } },
277
+ ...options,
278
+ });
279
+ return (0, utils_js_1.transformResponse)(resp);
280
+ }
281
+ /**
282
+ * List customer overrides
283
+ * @param query - The query parameters
284
+ * @param signal - An optional abort signal
285
+ * @returns The customer overrides
286
+ */
287
+ async listOverrides(query, options) {
288
+ const resp = await this.client.GET('/api/v1/billing/customers', {
289
+ params: { query },
290
+ ...options,
291
+ });
292
+ return (0, utils_js_1.transformResponse)(resp);
293
+ }
294
+ /**
295
+ * Delete a customer override
296
+ * @param id - The ID of the customer to delete the override for
297
+ * @param signal - An optional abort signal
298
+ * @returns The deleted customer override
299
+ */
300
+ async deleteOverride(id, options) {
301
+ const resp = await this.client.DELETE('/api/v1/billing/customers/{customerId}', {
302
+ params: { path: { customerId: id } },
303
+ ...options,
304
+ });
305
+ return (0, utils_js_1.transformResponse)(resp);
306
+ }
307
+ }
308
+ exports.BillingCustomers = BillingCustomers;
309
+ //# sourceMappingURL=billing.js.map