@openmeter/client 1.0.0-beta-4d26c6d3c7fe → 1.0.0-beta-e7a04be10ed8
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 +316 -55
- 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 +148 -1
- package/dist/funcs/customers.js +149 -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/index.d.ts +0 -3
- package/dist/funcs/index.js +1 -3
- 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 -8
- 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 +3 -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/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 +4453 -6950
- package/dist/models/schemas.js +1 -73
- package/dist/models/types.d.ts +381 -566
- 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 +194 -1
- package/dist/sdk/customers.js +203 -1
- 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 +89 -0
- package/dist/sdk/internal.js +113 -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/funcs/governance.d.ts +0 -5
- package/dist/funcs/governance.js +0 -34
- package/dist/funcs/invoices.d.ts +0 -8
- package/dist/funcs/invoices.js +0 -81
- package/dist/models/operations/governance.d.ts +0 -10
- package/dist/models/operations/governance.js +0 -2
- package/dist/models/operations/invoices.d.ts +0 -48
- package/dist/models/operations/invoices.js +0 -2
- 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,16 @@ export function createCreditAdjustment(client, req, options) {
|
|
|
330
441
|
});
|
|
331
442
|
});
|
|
332
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* Update credit grant external settlement status
|
|
446
|
+
*
|
|
447
|
+
* Update the payment settlement status of an externally funded credit grant.
|
|
448
|
+
*
|
|
449
|
+
* Use this endpoint to synchronize the payment state of an external payment with
|
|
450
|
+
* the system so that revenue recognition and credit availability work as expected.
|
|
451
|
+
*
|
|
452
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/settlement/external
|
|
453
|
+
*/
|
|
333
454
|
export function updateCreditGrantExternalSettlement(client, req, options) {
|
|
334
455
|
return request(() => {
|
|
335
456
|
const path = `openmeter/customers/${(() => {
|
|
@@ -358,6 +479,17 @@ export function updateCreditGrantExternalSettlement(client, req, options) {
|
|
|
358
479
|
});
|
|
359
480
|
});
|
|
360
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* List credit transactions
|
|
484
|
+
*
|
|
485
|
+
* List credit transactions for a customer.
|
|
486
|
+
*
|
|
487
|
+
* Returns an immutable, chronological record of credit movements: funded credits
|
|
488
|
+
* and consumed credits. Transactions are returned in reverse chronological order
|
|
489
|
+
* by default.
|
|
490
|
+
*
|
|
491
|
+
* GET /openmeter/customers/{customerId}/credits/transactions
|
|
492
|
+
*/
|
|
361
493
|
export function listCreditTransactions(client, req, options) {
|
|
362
494
|
return request(() => {
|
|
363
495
|
const path = `openmeter/customers/${(() => {
|
|
@@ -385,6 +517,16 @@ export function listCreditTransactions(client, req, options) {
|
|
|
385
517
|
});
|
|
386
518
|
});
|
|
387
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* List customer charges
|
|
522
|
+
*
|
|
523
|
+
* List customer charges.
|
|
524
|
+
*
|
|
525
|
+
* Returns the customer's charges that are represented as either flat fee or
|
|
526
|
+
* usage-based charges.
|
|
527
|
+
*
|
|
528
|
+
* GET /openmeter/customers/{customerId}/charges
|
|
529
|
+
*/
|
|
388
530
|
export function listCustomerCharges(client, req, options) {
|
|
389
531
|
return request(() => {
|
|
390
532
|
const path = `openmeter/customers/${(() => {
|
|
@@ -414,6 +556,13 @@ export function listCustomerCharges(client, req, options) {
|
|
|
414
556
|
});
|
|
415
557
|
});
|
|
416
558
|
}
|
|
559
|
+
/**
|
|
560
|
+
* Create customer charge
|
|
561
|
+
*
|
|
562
|
+
* Create customer charge.
|
|
563
|
+
*
|
|
564
|
+
* POST /openmeter/customers/{customerId}/charges
|
|
565
|
+
*/
|
|
417
566
|
export function createCustomerCharges(client, req, options) {
|
|
418
567
|
return request(() => {
|
|
419
568
|
const path = `openmeter/customers/${(() => {
|
|
@@ -437,4 +586,3 @@ export function createCustomerCharges(client, req, options) {
|
|
|
437
586
|
});
|
|
438
587
|
});
|
|
439
588
|
}
|
|
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
|
package/dist/funcs/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './entitlements.js';
|
|
|
5
5
|
export * from './subscriptions.js';
|
|
6
6
|
export * from './apps.js';
|
|
7
7
|
export * from './billing.js';
|
|
8
|
-
export * from './invoices.js';
|
|
9
8
|
export * from './tax.js';
|
|
10
9
|
export * from './currencies.js';
|
|
11
10
|
export * from './features.js';
|
|
@@ -14,5 +13,3 @@ export * from './plans.js';
|
|
|
14
13
|
export * from './addons.js';
|
|
15
14
|
export * from './planAddons.js';
|
|
16
15
|
export * from './defaults.js';
|
|
17
|
-
export * from './governance.js';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
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';
|
|
@@ -5,7 +6,6 @@ export * from './entitlements.js';
|
|
|
5
6
|
export * from './subscriptions.js';
|
|
6
7
|
export * from './apps.js';
|
|
7
8
|
export * from './billing.js';
|
|
8
|
-
export * from './invoices.js';
|
|
9
9
|
export * from './tax.js';
|
|
10
10
|
export * from './currencies.js';
|
|
11
11
|
export * from './features.js';
|
|
@@ -14,5 +14,3 @@ export * from './plans.js';
|
|
|
14
14
|
export * from './addons.js';
|
|
15
15
|
export * from './planAddons.js';
|
|
16
16
|
export * from './defaults.js';
|
|
17
|
-
export * from './governance.js';
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/funcs/llmCost.d.ts
CHANGED
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListLlmCostPricesRequest, ListLlmCostPricesResponse, GetLlmCostPriceRequest, GetLlmCostPriceResponse, ListLlmCostOverridesRequest, ListLlmCostOverridesResponse, CreateLlmCostOverrideRequest, CreateLlmCostOverrideResponse, DeleteLlmCostOverrideRequest, DeleteLlmCostOverrideResponse } from '../models/operations/llmCost.js';
|
|
4
|
+
/**
|
|
5
|
+
* List LLM cost prices
|
|
6
|
+
*
|
|
7
|
+
* List global LLM cost prices. Returns prices with overrides applied if any.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/llm-cost/prices
|
|
10
|
+
*/
|
|
4
11
|
export declare function listLlmCostPrices(client: Client, req?: ListLlmCostPricesRequest, options?: RequestOptions): Promise<Result<ListLlmCostPricesResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Get LLM cost price
|
|
14
|
+
*
|
|
15
|
+
* Get a specific LLM cost price by ID. Returns the price with overrides applied if
|
|
16
|
+
* any.
|
|
17
|
+
*
|
|
18
|
+
* GET /openmeter/llm-cost/prices/{priceId}
|
|
19
|
+
*/
|
|
5
20
|
export declare function getLlmCostPrice(client: Client, req: GetLlmCostPriceRequest, options?: RequestOptions): Promise<Result<GetLlmCostPriceResponse>>;
|
|
21
|
+
/**
|
|
22
|
+
* List LLM cost overrides
|
|
23
|
+
*
|
|
24
|
+
* List per-namespace price overrides.
|
|
25
|
+
*
|
|
26
|
+
* GET /openmeter/llm-cost/overrides
|
|
27
|
+
*/
|
|
6
28
|
export declare function listLlmCostOverrides(client: Client, req?: ListLlmCostOverridesRequest, options?: RequestOptions): Promise<Result<ListLlmCostOverridesResponse>>;
|
|
29
|
+
/**
|
|
30
|
+
* Create LLM cost override
|
|
31
|
+
*
|
|
32
|
+
* Create a per-namespace price override.
|
|
33
|
+
*
|
|
34
|
+
* POST /openmeter/llm-cost/overrides
|
|
35
|
+
*/
|
|
7
36
|
export declare function createLlmCostOverride(client: Client, req: CreateLlmCostOverrideRequest, options?: RequestOptions): Promise<Result<CreateLlmCostOverrideResponse>>;
|
|
37
|
+
/**
|
|
38
|
+
* Delete LLM cost override
|
|
39
|
+
*
|
|
40
|
+
* Delete a per-namespace price override.
|
|
41
|
+
*
|
|
42
|
+
* DELETE /openmeter/llm-cost/overrides/{priceId}
|
|
43
|
+
*/
|
|
8
44
|
export declare function deleteLlmCostOverride(client: Client, req: DeleteLlmCostOverrideRequest, options?: RequestOptions): Promise<Result<DeleteLlmCostOverrideResponse>>;
|
|
9
|
-
//# sourceMappingURL=llmCost.d.ts.map
|