@openmeter/client 1.0.0-beta.230 → 1.0.0-beta.231
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +347 -68
- package/dist/core.d.ts +0 -1
- package/dist/core.js +8 -1
- package/dist/funcs/addons.d.ts +49 -1
- package/dist/funcs/addons.js +50 -1
- package/dist/funcs/apps.d.ts +14 -1
- package/dist/funcs/apps.js +15 -1
- package/dist/funcs/billing.d.ts +46 -1
- package/dist/funcs/billing.js +47 -1
- package/dist/funcs/currencies.d.ts +30 -1
- package/dist/funcs/currencies.js +31 -1
- package/dist/funcs/customers.d.ts +165 -2
- package/dist/funcs/customers.js +192 -1
- package/dist/funcs/defaults.d.ts +10 -1
- package/dist/funcs/defaults.js +11 -1
- package/dist/funcs/entitlements.d.ts +5 -1
- package/dist/funcs/entitlements.js +6 -1
- package/dist/funcs/events.d.ts +14 -1
- package/dist/funcs/events.js +15 -1
- package/dist/funcs/features.d.ts +42 -1
- package/dist/funcs/features.js +43 -1
- package/dist/funcs/governance.d.ts +14 -1
- package/dist/funcs/governance.js +15 -1
- package/dist/funcs/index.d.ts +0 -1
- package/dist/funcs/index.js +1 -1
- package/dist/funcs/invoices.d.ts +44 -1
- package/dist/funcs/invoices.js +45 -1
- package/dist/funcs/llmCost.d.ts +36 -1
- package/dist/funcs/llmCost.js +37 -1
- package/dist/funcs/meters.d.ts +53 -1
- package/dist/funcs/meters.js +54 -1
- package/dist/funcs/planAddons.d.ts +35 -1
- package/dist/funcs/planAddons.js +36 -1
- package/dist/funcs/plans.d.ts +49 -1
- package/dist/funcs/plans.js +50 -1
- package/dist/funcs/subscriptions.d.ts +59 -1
- package/dist/funcs/subscriptions.js +60 -1
- package/dist/funcs/tax.d.ts +25 -1
- package/dist/funcs/tax.js +26 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.js +4 -5
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/encodings.d.ts +0 -1
- package/dist/lib/encodings.js +1 -1
- package/dist/lib/paginate.d.ts +56 -0
- package/dist/lib/paginate.js +60 -0
- package/dist/lib/request.d.ts +0 -1
- package/dist/lib/request.js +1 -1
- package/dist/lib/to-error.d.ts +0 -1
- package/dist/lib/to-error.js +1 -1
- package/dist/lib/types.d.ts +0 -1
- package/dist/lib/types.js +1 -1
- package/dist/lib/version.d.ts +1 -0
- package/dist/lib/version.js +5 -0
- package/dist/lib/wire.d.ts +3 -1
- package/dist/lib/wire.js +93 -4
- package/dist/models/errors.d.ts +13 -2
- package/dist/models/errors.js +31 -4
- package/dist/models/operations/addons.d.ts +0 -1
- package/dist/models/operations/addons.js +1 -1
- package/dist/models/operations/apps.d.ts +2 -5
- package/dist/models/operations/apps.js +1 -1
- package/dist/models/operations/billing.d.ts +0 -1
- package/dist/models/operations/billing.js +1 -1
- package/dist/models/operations/currencies.d.ts +0 -1
- package/dist/models/operations/currencies.js +1 -1
- package/dist/models/operations/customers.d.ts +9 -6
- package/dist/models/operations/customers.js +1 -1
- package/dist/models/operations/defaults.d.ts +0 -1
- package/dist/models/operations/defaults.js +1 -1
- package/dist/models/operations/entitlements.d.ts +0 -1
- package/dist/models/operations/entitlements.js +1 -1
- package/dist/models/operations/events.d.ts +0 -1
- package/dist/models/operations/events.js +1 -1
- package/dist/models/operations/features.d.ts +0 -1
- package/dist/models/operations/features.js +1 -1
- package/dist/models/operations/governance.d.ts +0 -1
- package/dist/models/operations/governance.js +1 -1
- package/dist/models/operations/invoices.d.ts +4 -7
- package/dist/models/operations/invoices.js +1 -1
- package/dist/models/operations/llmCost.d.ts +0 -1
- package/dist/models/operations/llmCost.js +1 -1
- package/dist/models/operations/meters.d.ts +0 -1
- package/dist/models/operations/meters.js +1 -1
- package/dist/models/operations/planAddons.d.ts +0 -1
- package/dist/models/operations/planAddons.js +1 -1
- package/dist/models/operations/plans.d.ts +0 -1
- package/dist/models/operations/plans.js +1 -1
- package/dist/models/operations/subscriptions.d.ts +0 -1
- package/dist/models/operations/subscriptions.js +1 -1
- package/dist/models/operations/tax.d.ts +0 -1
- package/dist/models/operations/tax.js +1 -1
- package/dist/models/schemas.d.ts +162 -1
- package/dist/models/schemas.js +37 -5
- package/dist/models/types.d.ts +464 -577
- package/dist/models/types.js +1 -1
- package/dist/sdk/addons.d.ts +60 -1
- package/dist/sdk/addons.js +63 -1
- package/dist/sdk/apps.d.ts +25 -1
- package/dist/sdk/apps.js +28 -1
- package/dist/sdk/billing.d.ts +57 -1
- package/dist/sdk/billing.js +60 -1
- package/dist/sdk/customers.d.ts +211 -2
- package/dist/sdk/customers.js +222 -2
- package/dist/sdk/defaults.d.ts +10 -1
- package/dist/sdk/defaults.js +11 -1
- package/dist/sdk/entitlements.d.ts +5 -1
- package/dist/sdk/entitlements.js +6 -1
- package/dist/sdk/events.d.ts +25 -1
- package/dist/sdk/events.js +28 -1
- package/dist/sdk/features.d.ts +53 -1
- package/dist/sdk/features.js +56 -1
- package/dist/sdk/internal.d.ts +180 -0
- package/dist/sdk/internal.js +224 -0
- package/dist/sdk/llmCost.d.ts +57 -1
- package/dist/sdk/llmCost.js +62 -1
- package/dist/sdk/meters.d.ts +64 -1
- package/dist/sdk/meters.js +67 -1
- package/dist/sdk/planAddons.d.ts +46 -1
- package/dist/sdk/planAddons.js +49 -1
- package/dist/sdk/plans.d.ts +60 -1
- package/dist/sdk/plans.js +63 -1
- package/dist/sdk/sdk.d.ts +9 -10
- package/dist/sdk/sdk.js +11 -15
- package/dist/sdk/subscriptions.d.ts +72 -3
- package/dist/sdk/subscriptions.js +77 -5
- package/dist/sdk/tax.d.ts +34 -1
- package/dist/sdk/tax.js +37 -1
- package/package.json +28 -4
- package/dist/sdk/currencies.d.ts +0 -12
- package/dist/sdk/currencies.js +0 -21
- package/dist/sdk/governance.d.ts +0 -9
- package/dist/sdk/governance.js +0 -12
- package/dist/sdk/invoices.d.ts +0 -12
- package/dist/sdk/invoices.js +0 -21
package/dist/funcs/customers.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
|
|
4
5
|
import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
|
|
5
6
|
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* Create customer
|
|
9
|
+
*
|
|
10
|
+
* POST /openmeter/customers
|
|
11
|
+
*/
|
|
6
12
|
export function createCustomer(client, req, options) {
|
|
7
13
|
return request(() => {
|
|
8
14
|
const body = toWire(req, schemas.createCustomerBody);
|
|
@@ -20,6 +26,11 @@ export function createCustomer(client, req, options) {
|
|
|
20
26
|
});
|
|
21
27
|
});
|
|
22
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Get customer
|
|
31
|
+
*
|
|
32
|
+
* GET /openmeter/customers/{customerId}
|
|
33
|
+
*/
|
|
23
34
|
export function getCustomer(client, req, options) {
|
|
24
35
|
return request(() => {
|
|
25
36
|
const path = `openmeter/customers/${(() => {
|
|
@@ -39,6 +50,11 @@ export function getCustomer(client, req, options) {
|
|
|
39
50
|
});
|
|
40
51
|
});
|
|
41
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* List customers
|
|
55
|
+
*
|
|
56
|
+
* GET /openmeter/customers
|
|
57
|
+
*/
|
|
42
58
|
export function listCustomers(client, req = {}, options) {
|
|
43
59
|
return request(() => {
|
|
44
60
|
const query = toWire({
|
|
@@ -61,6 +77,11 @@ export function listCustomers(client, req = {}, options) {
|
|
|
61
77
|
});
|
|
62
78
|
});
|
|
63
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Upsert customer
|
|
82
|
+
*
|
|
83
|
+
* PUT /openmeter/customers/{customerId}
|
|
84
|
+
*/
|
|
64
85
|
export function upsertCustomer(client, req, options) {
|
|
65
86
|
return request(() => {
|
|
66
87
|
const path = `openmeter/customers/${(() => {
|
|
@@ -84,6 +105,11 @@ export function upsertCustomer(client, req, options) {
|
|
|
84
105
|
});
|
|
85
106
|
});
|
|
86
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Delete customer
|
|
110
|
+
*
|
|
111
|
+
* DELETE /openmeter/customers/{customerId}
|
|
112
|
+
*/
|
|
87
113
|
export function deleteCustomer(client, req, options) {
|
|
88
114
|
return request(async () => {
|
|
89
115
|
const path = `openmeter/customers/${(() => {
|
|
@@ -95,6 +121,11 @@ export function deleteCustomer(client, req, options) {
|
|
|
95
121
|
await http(client).delete(path, options);
|
|
96
122
|
});
|
|
97
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Get customer billing data
|
|
126
|
+
*
|
|
127
|
+
* GET /openmeter/customers/{customerId}/billing
|
|
128
|
+
*/
|
|
98
129
|
export function getCustomerBilling(client, req, options) {
|
|
99
130
|
return request(() => {
|
|
100
131
|
const path = `openmeter/customers/${(() => {
|
|
@@ -114,6 +145,11 @@ export function getCustomerBilling(client, req, options) {
|
|
|
114
145
|
});
|
|
115
146
|
});
|
|
116
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Update customer billing data
|
|
150
|
+
*
|
|
151
|
+
* PUT /openmeter/customers/{customerId}/billing
|
|
152
|
+
*/
|
|
117
153
|
export function updateCustomerBilling(client, req, options) {
|
|
118
154
|
return request(() => {
|
|
119
155
|
const path = `openmeter/customers/${(() => {
|
|
@@ -137,6 +173,11 @@ export function updateCustomerBilling(client, req, options) {
|
|
|
137
173
|
});
|
|
138
174
|
});
|
|
139
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Update customer billing app data
|
|
178
|
+
*
|
|
179
|
+
* PUT /openmeter/customers/{customerId}/billing/app-data
|
|
180
|
+
*/
|
|
140
181
|
export function updateCustomerBillingAppData(client, req, options) {
|
|
141
182
|
return request(() => {
|
|
142
183
|
const path = `openmeter/customers/${(() => {
|
|
@@ -160,6 +201,23 @@ export function updateCustomerBillingAppData(client, req, options) {
|
|
|
160
201
|
});
|
|
161
202
|
});
|
|
162
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Create Stripe Checkout Session
|
|
206
|
+
*
|
|
207
|
+
* Create a [Stripe Checkout Session](https://docs.stripe.com/payments/checkout)
|
|
208
|
+
* for the customer.
|
|
209
|
+
*
|
|
210
|
+
* Creates a Checkout Session for collecting payment method information from
|
|
211
|
+
* customers. The session operates in "setup" mode, which collects payment details
|
|
212
|
+
* without charging the customer immediately. The collected payment method can be
|
|
213
|
+
* used for future subscription billing.
|
|
214
|
+
*
|
|
215
|
+
* For hosted checkout sessions, redirect customers to the returned URL. For
|
|
216
|
+
* embedded sessions, use the client_secret to initialize Stripe.js in your
|
|
217
|
+
* application.
|
|
218
|
+
*
|
|
219
|
+
* POST /openmeter/customers/{customerId}/billing/stripe/checkout-sessions
|
|
220
|
+
*/
|
|
163
221
|
export function createCustomerStripeCheckoutSession(client, req, options) {
|
|
164
222
|
return request(() => {
|
|
165
223
|
const path = `openmeter/customers/${(() => {
|
|
@@ -183,6 +241,18 @@ export function createCustomerStripeCheckoutSession(client, req, options) {
|
|
|
183
241
|
});
|
|
184
242
|
});
|
|
185
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Create Stripe customer portal session
|
|
246
|
+
*
|
|
247
|
+
* Create Stripe Customer Portal Session.
|
|
248
|
+
*
|
|
249
|
+
* Useful to redirect the customer to the Stripe Customer Portal to manage their
|
|
250
|
+
* payment methods, change their billing address and access their invoice history.
|
|
251
|
+
* Only returns URL if the customer billing profile is linked to a stripe app and
|
|
252
|
+
* customer.
|
|
253
|
+
*
|
|
254
|
+
* POST /openmeter/customers/{customerId}/billing/stripe/portal-sessions
|
|
255
|
+
*/
|
|
186
256
|
export function createCustomerStripePortalSession(client, req, options) {
|
|
187
257
|
return request(() => {
|
|
188
258
|
const path = `openmeter/customers/${(() => {
|
|
@@ -206,6 +276,14 @@ export function createCustomerStripePortalSession(client, req, options) {
|
|
|
206
276
|
});
|
|
207
277
|
});
|
|
208
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Create a new credit grant
|
|
281
|
+
*
|
|
282
|
+
* Create a new credit grant. A credit grant represents an allocation of prepaid
|
|
283
|
+
* credits to a customer.
|
|
284
|
+
*
|
|
285
|
+
* POST /openmeter/customers/{customerId}/credits/grants
|
|
286
|
+
*/
|
|
209
287
|
export function createCreditGrant(client, req, options) {
|
|
210
288
|
return request(() => {
|
|
211
289
|
const path = `openmeter/customers/${(() => {
|
|
@@ -229,6 +307,13 @@ export function createCreditGrant(client, req, options) {
|
|
|
229
307
|
});
|
|
230
308
|
});
|
|
231
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Get a credit grant
|
|
312
|
+
*
|
|
313
|
+
* Get a credit grant.
|
|
314
|
+
*
|
|
315
|
+
* GET /openmeter/customers/{customerId}/credits/grants/{creditGrantId}
|
|
316
|
+
*/
|
|
232
317
|
export function getCreditGrant(client, req, options) {
|
|
233
318
|
return request(() => {
|
|
234
319
|
const path = `openmeter/customers/${(() => {
|
|
@@ -253,6 +338,13 @@ export function getCreditGrant(client, req, options) {
|
|
|
253
338
|
});
|
|
254
339
|
});
|
|
255
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* List credit grants
|
|
343
|
+
*
|
|
344
|
+
* List credit grants.
|
|
345
|
+
*
|
|
346
|
+
* GET /openmeter/customers/{customerId}/credits/grants
|
|
347
|
+
*/
|
|
256
348
|
export function listCreditGrants(client, req, options) {
|
|
257
349
|
return request(() => {
|
|
258
350
|
const path = `openmeter/customers/${(() => {
|
|
@@ -280,6 +372,13 @@ export function listCreditGrants(client, req, options) {
|
|
|
280
372
|
});
|
|
281
373
|
});
|
|
282
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
* Get a customer's credit balance
|
|
377
|
+
*
|
|
378
|
+
* Get a credit balance.
|
|
379
|
+
*
|
|
380
|
+
* GET /openmeter/customers/{customerId}/credits/balance
|
|
381
|
+
*/
|
|
283
382
|
export function getCustomerCreditBalance(client, req, options) {
|
|
284
383
|
return request(() => {
|
|
285
384
|
const path = `openmeter/customers/${(() => {
|
|
@@ -307,6 +406,18 @@ export function getCustomerCreditBalance(client, req, options) {
|
|
|
307
406
|
});
|
|
308
407
|
});
|
|
309
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Create a credit adjustment
|
|
411
|
+
*
|
|
412
|
+
* A credit adjustment can be used to make manual adjustments to a customer's
|
|
413
|
+
* credit balance.
|
|
414
|
+
*
|
|
415
|
+
* Supported use-cases:
|
|
416
|
+
*
|
|
417
|
+
* - Usage correction
|
|
418
|
+
*
|
|
419
|
+
* POST /openmeter/customers/{customerId}/credits/adjustments
|
|
420
|
+
*/
|
|
310
421
|
export function createCreditAdjustment(client, req, options) {
|
|
311
422
|
return request(() => {
|
|
312
423
|
const path = `openmeter/customers/${(() => {
|
|
@@ -330,6 +441,59 @@ export function createCreditAdjustment(client, req, options) {
|
|
|
330
441
|
});
|
|
331
442
|
});
|
|
332
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* Void credit grant
|
|
446
|
+
*
|
|
447
|
+
* Void a credit grant, forfeiting the remaining unused balance.
|
|
448
|
+
*
|
|
449
|
+
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
450
|
+
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
451
|
+
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
452
|
+
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
453
|
+
* payments may still collect the original amount. Only `active` grants can be
|
|
454
|
+
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
455
|
+
* Retrying a successful void is an idempotent success.
|
|
456
|
+
*
|
|
457
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
458
|
+
*/
|
|
459
|
+
export function voidCreditGrant(client, req, options) {
|
|
460
|
+
return request(() => {
|
|
461
|
+
const path = `openmeter/customers/${(() => {
|
|
462
|
+
if (req.customerId === undefined) {
|
|
463
|
+
throw new Error('missing path parameter: customerId');
|
|
464
|
+
}
|
|
465
|
+
return encodeURIComponent(String(req.customerId));
|
|
466
|
+
})()}/credits/grants/${(() => {
|
|
467
|
+
if (req.creditGrantId === undefined) {
|
|
468
|
+
throw new Error('missing path parameter: creditGrantId');
|
|
469
|
+
}
|
|
470
|
+
return encodeURIComponent(String(req.creditGrantId));
|
|
471
|
+
})()}/void`;
|
|
472
|
+
const body = toWire(req.body, schemas.voidCreditGrantBody);
|
|
473
|
+
if (client._options.validate) {
|
|
474
|
+
assertValid(schemas.voidCreditGrantBodyWire, body);
|
|
475
|
+
}
|
|
476
|
+
return http(client)
|
|
477
|
+
.post(path, { ...options, json: body })
|
|
478
|
+
.json()
|
|
479
|
+
.then((data) => {
|
|
480
|
+
if (client._options.validate) {
|
|
481
|
+
assertValid(schemas.voidCreditGrantResponseWire, data);
|
|
482
|
+
}
|
|
483
|
+
return fromWire(data, schemas.voidCreditGrantResponse);
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Update credit grant external settlement status
|
|
489
|
+
*
|
|
490
|
+
* Update the payment settlement status of an externally funded credit grant.
|
|
491
|
+
*
|
|
492
|
+
* Use this endpoint to synchronize the payment state of an external payment with
|
|
493
|
+
* the system so that revenue recognition and credit availability work as expected.
|
|
494
|
+
*
|
|
495
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/settlement/external
|
|
496
|
+
*/
|
|
333
497
|
export function updateCreditGrantExternalSettlement(client, req, options) {
|
|
334
498
|
return request(() => {
|
|
335
499
|
const path = `openmeter/customers/${(() => {
|
|
@@ -358,6 +522,17 @@ export function updateCreditGrantExternalSettlement(client, req, options) {
|
|
|
358
522
|
});
|
|
359
523
|
});
|
|
360
524
|
}
|
|
525
|
+
/**
|
|
526
|
+
* List credit transactions
|
|
527
|
+
*
|
|
528
|
+
* List credit transactions for a customer.
|
|
529
|
+
*
|
|
530
|
+
* Returns an immutable, chronological record of credit movements: funded credits
|
|
531
|
+
* and consumed credits. Transactions are returned in reverse chronological order
|
|
532
|
+
* by default.
|
|
533
|
+
*
|
|
534
|
+
* GET /openmeter/customers/{customerId}/credits/transactions
|
|
535
|
+
*/
|
|
361
536
|
export function listCreditTransactions(client, req, options) {
|
|
362
537
|
return request(() => {
|
|
363
538
|
const path = `openmeter/customers/${(() => {
|
|
@@ -385,6 +560,16 @@ export function listCreditTransactions(client, req, options) {
|
|
|
385
560
|
});
|
|
386
561
|
});
|
|
387
562
|
}
|
|
563
|
+
/**
|
|
564
|
+
* List customer charges
|
|
565
|
+
*
|
|
566
|
+
* List customer charges.
|
|
567
|
+
*
|
|
568
|
+
* Returns the customer's charges that are represented as either flat fee or
|
|
569
|
+
* usage-based charges.
|
|
570
|
+
*
|
|
571
|
+
* GET /openmeter/customers/{customerId}/charges
|
|
572
|
+
*/
|
|
388
573
|
export function listCustomerCharges(client, req, options) {
|
|
389
574
|
return request(() => {
|
|
390
575
|
const path = `openmeter/customers/${(() => {
|
|
@@ -414,6 +599,13 @@ export function listCustomerCharges(client, req, options) {
|
|
|
414
599
|
});
|
|
415
600
|
});
|
|
416
601
|
}
|
|
602
|
+
/**
|
|
603
|
+
* Create customer charge
|
|
604
|
+
*
|
|
605
|
+
* Create customer charge.
|
|
606
|
+
*
|
|
607
|
+
* POST /openmeter/customers/{customerId}/charges
|
|
608
|
+
*/
|
|
417
609
|
export function createCustomerCharges(client, req, options) {
|
|
418
610
|
return request(() => {
|
|
419
611
|
const path = `openmeter/customers/${(() => {
|
|
@@ -437,4 +629,3 @@ export function createCustomerCharges(client, req, options) {
|
|
|
437
629
|
});
|
|
438
630
|
});
|
|
439
631
|
}
|
|
440
|
-
//# sourceMappingURL=customers.js.map
|
package/dist/funcs/defaults.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { GetOrganizationDefaultTaxCodesRequest, GetOrganizationDefaultTaxCodesResponse, UpdateOrganizationDefaultTaxCodesRequest, UpdateOrganizationDefaultTaxCodesResponse } from '../models/operations/defaults.js';
|
|
4
|
+
/**
|
|
5
|
+
* Get organization default tax codes
|
|
6
|
+
*
|
|
7
|
+
* GET /openmeter/defaults/tax-codes
|
|
8
|
+
*/
|
|
4
9
|
export declare function getOrganizationDefaultTaxCodes(client: Client, req: GetOrganizationDefaultTaxCodesRequest, options?: RequestOptions): Promise<Result<GetOrganizationDefaultTaxCodesResponse>>;
|
|
10
|
+
/**
|
|
11
|
+
* Update organization default tax codes
|
|
12
|
+
*
|
|
13
|
+
* PUT /openmeter/defaults/tax-codes
|
|
14
|
+
*/
|
|
5
15
|
export declare function updateOrganizationDefaultTaxCodes(client: Client, req: UpdateOrganizationDefaultTaxCodesRequest, options?: RequestOptions): Promise<Result<UpdateOrganizationDefaultTaxCodesResponse>>;
|
|
6
|
-
//# sourceMappingURL=defaults.d.ts.map
|
package/dist/funcs/defaults.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toWire, fromWire, assertValid } from '../lib/wire.js';
|
|
4
5
|
import * as schemas from '../models/schemas.js';
|
|
6
|
+
/**
|
|
7
|
+
* Get organization default tax codes
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/defaults/tax-codes
|
|
10
|
+
*/
|
|
5
11
|
export function getOrganizationDefaultTaxCodes(client, req, options) {
|
|
6
12
|
return request(() => http(client)
|
|
7
13
|
.get('openmeter/defaults/tax-codes', options)
|
|
@@ -13,6 +19,11 @@ export function getOrganizationDefaultTaxCodes(client, req, options) {
|
|
|
13
19
|
return fromWire(data, schemas.getOrganizationDefaultTaxCodesResponse);
|
|
14
20
|
}));
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Update organization default tax codes
|
|
24
|
+
*
|
|
25
|
+
* PUT /openmeter/defaults/tax-codes
|
|
26
|
+
*/
|
|
16
27
|
export function updateOrganizationDefaultTaxCodes(client, req, options) {
|
|
17
28
|
return request(() => {
|
|
18
29
|
const body = toWire(req, schemas.updateOrganizationDefaultTaxCodesBody);
|
|
@@ -30,4 +41,3 @@ export function updateOrganizationDefaultTaxCodes(client, req, options) {
|
|
|
30
41
|
});
|
|
31
42
|
});
|
|
32
43
|
}
|
|
33
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
|
|
4
|
+
/**
|
|
5
|
+
* List customer entitlement access
|
|
6
|
+
*
|
|
7
|
+
* GET /openmeter/customers/{customerId}/entitlement-access
|
|
8
|
+
*/
|
|
4
9
|
export declare function listCustomerEntitlementAccess(client: Client, req: ListCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<Result<ListCustomerEntitlementAccessResponse>>;
|
|
5
|
-
//# sourceMappingURL=entitlements.d.ts.map
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { fromWire, assertValid } from '../lib/wire.js';
|
|
4
5
|
import * as schemas from '../models/schemas.js';
|
|
6
|
+
/**
|
|
7
|
+
* List customer entitlement access
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/customers/{customerId}/entitlement-access
|
|
10
|
+
*/
|
|
5
11
|
export function listCustomerEntitlementAccess(client, req, options) {
|
|
6
12
|
return request(() => {
|
|
7
13
|
const path = `openmeter/customers/${(() => {
|
|
@@ -21,4 +27,3 @@ export function listCustomerEntitlementAccess(client, req, options) {
|
|
|
21
27
|
});
|
|
22
28
|
});
|
|
23
29
|
}
|
|
24
|
-
//# sourceMappingURL=entitlements.js.map
|
package/dist/funcs/events.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListMeteringEventsRequest, ListMeteringEventsResponse, IngestMeteringEventsRequest, IngestMeteringEventsResponse } from '../models/operations/events.js';
|
|
4
|
+
/**
|
|
5
|
+
* List metering events
|
|
6
|
+
*
|
|
7
|
+
* List ingested events.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/events
|
|
10
|
+
*/
|
|
4
11
|
export declare function listMeteringEvents(client: Client, req?: ListMeteringEventsRequest, options?: RequestOptions): Promise<Result<ListMeteringEventsResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Ingest metering events
|
|
14
|
+
*
|
|
15
|
+
* Ingests an event or batch of events following the CloudEvents specification.
|
|
16
|
+
*
|
|
17
|
+
* POST /openmeter/events
|
|
18
|
+
*/
|
|
5
19
|
export declare function ingestMeteringEvents(client: Client, req: IngestMeteringEventsRequest, options?: RequestOptions): Promise<Result<IngestMeteringEventsResponse>>;
|
|
6
|
-
//# sourceMappingURL=events.d.ts.map
|
package/dist/funcs/events.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
|
|
4
5
|
import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
|
|
5
6
|
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* List metering events
|
|
9
|
+
*
|
|
10
|
+
* List ingested events.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/events
|
|
13
|
+
*/
|
|
6
14
|
export function listMeteringEvents(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const query = toWire({
|
|
@@ -25,6 +33,13 @@ export function listMeteringEvents(client, req = {}, options) {
|
|
|
25
33
|
});
|
|
26
34
|
});
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Ingest metering events
|
|
38
|
+
*
|
|
39
|
+
* Ingests an event or batch of events following the CloudEvents specification.
|
|
40
|
+
*
|
|
41
|
+
* POST /openmeter/events
|
|
42
|
+
*/
|
|
28
43
|
export function ingestMeteringEvents(client, req, options) {
|
|
29
44
|
return request(async () => {
|
|
30
45
|
const body = toWire(req, schemas.ingestMeteringEventsBody);
|
|
@@ -34,4 +49,3 @@ export function ingestMeteringEvents(client, req, options) {
|
|
|
34
49
|
await http(client).post('openmeter/events', { ...options, json: body });
|
|
35
50
|
});
|
|
36
51
|
}
|
|
37
|
-
//# sourceMappingURL=events.js.map
|
package/dist/funcs/features.d.ts
CHANGED
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListFeaturesRequest, ListFeaturesResponse, CreateFeatureRequest, CreateFeatureResponse, GetFeatureRequest, GetFeatureResponse, UpdateFeatureRequest, UpdateFeatureResponse, DeleteFeatureRequest, DeleteFeatureResponse, QueryFeatureCostRequest, QueryFeatureCostResponse } from '../models/operations/features.js';
|
|
4
|
+
/**
|
|
5
|
+
* List features
|
|
6
|
+
*
|
|
7
|
+
* List all features.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/features
|
|
10
|
+
*/
|
|
4
11
|
export declare function listFeatures(client: Client, req?: ListFeaturesRequest, options?: RequestOptions): Promise<Result<ListFeaturesResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create feature
|
|
14
|
+
*
|
|
15
|
+
* Create a feature.
|
|
16
|
+
*
|
|
17
|
+
* POST /openmeter/features
|
|
18
|
+
*/
|
|
5
19
|
export declare function createFeature(client: Client, req: CreateFeatureRequest, options?: RequestOptions): Promise<Result<CreateFeatureResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get feature
|
|
22
|
+
*
|
|
23
|
+
* Get a feature by id.
|
|
24
|
+
*
|
|
25
|
+
* GET /openmeter/features/{featureId}
|
|
26
|
+
*/
|
|
6
27
|
export declare function getFeature(client: Client, req: GetFeatureRequest, options?: RequestOptions): Promise<Result<GetFeatureResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Update feature
|
|
30
|
+
*
|
|
31
|
+
* Update a feature by id. Currently only the unit_cost field can be updated.
|
|
32
|
+
*
|
|
33
|
+
* PATCH /openmeter/features/{featureId}
|
|
34
|
+
*/
|
|
7
35
|
export declare function updateFeature(client: Client, req: UpdateFeatureRequest, options?: RequestOptions): Promise<Result<UpdateFeatureResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Delete feature
|
|
38
|
+
*
|
|
39
|
+
* Delete a feature by id.
|
|
40
|
+
*
|
|
41
|
+
* DELETE /openmeter/features/{featureId}
|
|
42
|
+
*/
|
|
8
43
|
export declare function deleteFeature(client: Client, req: DeleteFeatureRequest, options?: RequestOptions): Promise<Result<DeleteFeatureResponse>>;
|
|
44
|
+
/**
|
|
45
|
+
* Query feature cost
|
|
46
|
+
*
|
|
47
|
+
* Query the cost of a feature.
|
|
48
|
+
*
|
|
49
|
+
* POST /openmeter/features/{featureId}/cost/query
|
|
50
|
+
*/
|
|
9
51
|
export declare function queryFeatureCost(client: Client, req: QueryFeatureCostRequest, options?: RequestOptions): Promise<Result<QueryFeatureCostResponse>>;
|
|
10
|
-
//# sourceMappingURL=features.d.ts.map
|
package/dist/funcs/features.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
|
|
4
5
|
import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
|
|
5
6
|
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* List features
|
|
9
|
+
*
|
|
10
|
+
* List all features.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/features
|
|
13
|
+
*/
|
|
6
14
|
export function listFeatures(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const query = toWire({
|
|
@@ -25,6 +33,13 @@ export function listFeatures(client, req = {}, options) {
|
|
|
25
33
|
});
|
|
26
34
|
});
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Create feature
|
|
38
|
+
*
|
|
39
|
+
* Create a feature.
|
|
40
|
+
*
|
|
41
|
+
* POST /openmeter/features
|
|
42
|
+
*/
|
|
28
43
|
export function createFeature(client, req, options) {
|
|
29
44
|
return request(() => {
|
|
30
45
|
const body = toWire(req, schemas.createFeatureBody);
|
|
@@ -42,6 +57,13 @@ export function createFeature(client, req, options) {
|
|
|
42
57
|
});
|
|
43
58
|
});
|
|
44
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Get feature
|
|
62
|
+
*
|
|
63
|
+
* Get a feature by id.
|
|
64
|
+
*
|
|
65
|
+
* GET /openmeter/features/{featureId}
|
|
66
|
+
*/
|
|
45
67
|
export function getFeature(client, req, options) {
|
|
46
68
|
return request(() => {
|
|
47
69
|
const path = `openmeter/features/${(() => {
|
|
@@ -61,6 +83,13 @@ export function getFeature(client, req, options) {
|
|
|
61
83
|
});
|
|
62
84
|
});
|
|
63
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Update feature
|
|
88
|
+
*
|
|
89
|
+
* Update a feature by id. Currently only the unit_cost field can be updated.
|
|
90
|
+
*
|
|
91
|
+
* PATCH /openmeter/features/{featureId}
|
|
92
|
+
*/
|
|
64
93
|
export function updateFeature(client, req, options) {
|
|
65
94
|
return request(() => {
|
|
66
95
|
const path = `openmeter/features/${(() => {
|
|
@@ -84,6 +113,13 @@ export function updateFeature(client, req, options) {
|
|
|
84
113
|
});
|
|
85
114
|
});
|
|
86
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Delete feature
|
|
118
|
+
*
|
|
119
|
+
* Delete a feature by id.
|
|
120
|
+
*
|
|
121
|
+
* DELETE /openmeter/features/{featureId}
|
|
122
|
+
*/
|
|
87
123
|
export function deleteFeature(client, req, options) {
|
|
88
124
|
return request(async () => {
|
|
89
125
|
const path = `openmeter/features/${(() => {
|
|
@@ -95,6 +131,13 @@ export function deleteFeature(client, req, options) {
|
|
|
95
131
|
await http(client).delete(path, options);
|
|
96
132
|
});
|
|
97
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Query feature cost
|
|
136
|
+
*
|
|
137
|
+
* Query the cost of a feature.
|
|
138
|
+
*
|
|
139
|
+
* POST /openmeter/features/{featureId}/cost/query
|
|
140
|
+
*/
|
|
98
141
|
export function queryFeatureCost(client, req, options) {
|
|
99
142
|
return request(() => {
|
|
100
143
|
const path = `openmeter/features/${(() => {
|
|
@@ -118,4 +161,3 @@ export function queryFeatureCost(client, req, options) {
|
|
|
118
161
|
});
|
|
119
162
|
});
|
|
120
163
|
}
|
|
121
|
-
//# sourceMappingURL=features.js.map
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from '../models/operations/governance.js';
|
|
4
|
+
/**
|
|
5
|
+
* Query governance access
|
|
6
|
+
*
|
|
7
|
+
* Query feature access for a list of customers.
|
|
8
|
+
*
|
|
9
|
+
* The endpoint resolves each provided identifier to a customer and returns the
|
|
10
|
+
* access status for the requested features, plus optional credit balance
|
|
11
|
+
* availability.
|
|
12
|
+
*
|
|
13
|
+
* _Designed to be called on a fixed refresh interval and the query response is
|
|
14
|
+
* intended to be cached._
|
|
15
|
+
*
|
|
16
|
+
* POST /openmeter/governance/query
|
|
17
|
+
*/
|
|
4
18
|
export declare function queryGovernanceAccess(client: Client, req: QueryGovernanceAccessRequest, options?: RequestOptions): Promise<Result<QueryGovernanceAccessResponse>>;
|
|
5
|
-
//# sourceMappingURL=governance.d.ts.map
|
package/dist/funcs/governance.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toURLSearchParams } from '../lib/encodings.js';
|
|
4
5
|
import { toWire, fromWire, assertValid } from '../lib/wire.js';
|
|
5
6
|
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* Query governance access
|
|
9
|
+
*
|
|
10
|
+
* Query feature access for a list of customers.
|
|
11
|
+
*
|
|
12
|
+
* The endpoint resolves each provided identifier to a customer and returns the
|
|
13
|
+
* access status for the requested features, plus optional credit balance
|
|
14
|
+
* availability.
|
|
15
|
+
*
|
|
16
|
+
* _Designed to be called on a fixed refresh interval and the query response is
|
|
17
|
+
* intended to be cached._
|
|
18
|
+
*
|
|
19
|
+
* POST /openmeter/governance/query
|
|
20
|
+
*/
|
|
6
21
|
export function queryGovernanceAccess(client, req, options) {
|
|
7
22
|
return request(() => {
|
|
8
23
|
const body = toWire(req.body, schemas.queryGovernanceAccessBody);
|
|
@@ -31,4 +46,3 @@ export function queryGovernanceAccess(client, req, options) {
|
|
|
31
46
|
});
|
|
32
47
|
});
|
|
33
48
|
}
|
|
34
|
-
//# sourceMappingURL=governance.js.map
|
package/dist/funcs/index.d.ts
CHANGED
package/dist/funcs/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
export * from './events.js';
|
|
2
3
|
export * from './meters.js';
|
|
3
4
|
export * from './customers.js';
|
|
@@ -15,4 +16,3 @@ export * from './addons.js';
|
|
|
15
16
|
export * from './planAddons.js';
|
|
16
17
|
export * from './defaults.js';
|
|
17
18
|
export * from './governance.js';
|
|
18
|
-
//# sourceMappingURL=index.js.map
|