@openmeter/client 1.0.0-beta-f209c2c47d2c → 1.0.0-beta-8da3e943bb2c
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/README.md +11 -4
- package/dist/funcs/customers.d.ts +13 -1
- package/dist/funcs/customers.js +43 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/customers.d.ts +6 -1
- package/dist/models/schemas.d.ts +938 -38
- package/dist/models/schemas.js +421 -54
- package/dist/models/types.d.ts +384 -36
- package/dist/sdk/entitlements.d.ts +1 -9
- package/dist/sdk/entitlements.js +1 -11
- package/dist/sdk/internal.d.ts +34 -1
- package/dist/sdk/internal.js +46 -1
- package/package.json +1 -1
package/dist/sdk/internal.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
|
-
import { voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
4
|
+
import { createCustomerEntitlement, voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
5
|
+
import { getCustomerEntitlementAccess } from '../funcs/entitlements.js';
|
|
5
6
|
import { unscheduleSubscription, restoreSubscription, migrateSubscription, createSubscriptionAddon, updateSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
6
7
|
import { uninstallApp, updateApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
7
8
|
import { listInvoices, getInvoice, updateInvoice, deleteInvoice, advanceInvoice, approveInvoice, retryInvoice, snapshotQuantitiesInvoice, } from '../funcs/invoices.js';
|
|
@@ -23,6 +24,10 @@ export class Internal {
|
|
|
23
24
|
get customers() {
|
|
24
25
|
return (this._customers ??= new InternalCustomers(this._client));
|
|
25
26
|
}
|
|
27
|
+
_entitlements;
|
|
28
|
+
get entitlements() {
|
|
29
|
+
return (this._entitlements ??= new InternalEntitlements(this._client));
|
|
30
|
+
}
|
|
26
31
|
_subscriptions;
|
|
27
32
|
get subscriptions() {
|
|
28
33
|
return (this._subscriptions ??= new InternalSubscriptions(this._client));
|
|
@@ -57,6 +62,10 @@ export class InternalCustomers {
|
|
|
57
62
|
constructor(_client) {
|
|
58
63
|
this._client = _client;
|
|
59
64
|
}
|
|
65
|
+
_entitlements;
|
|
66
|
+
get entitlements() {
|
|
67
|
+
return (this._entitlements ??= new InternalCustomersEntitlements(this._client));
|
|
68
|
+
}
|
|
60
69
|
_credits;
|
|
61
70
|
get credits() {
|
|
62
71
|
return (this._credits ??= new InternalCustomersCredits(this._client));
|
|
@@ -66,6 +75,26 @@ export class InternalCustomers {
|
|
|
66
75
|
return (this._charges ??= new InternalCustomersCharges(this._client));
|
|
67
76
|
}
|
|
68
77
|
}
|
|
78
|
+
export class InternalCustomersEntitlements {
|
|
79
|
+
_client;
|
|
80
|
+
constructor(_client) {
|
|
81
|
+
this._client = _client;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Create customer entitlement
|
|
85
|
+
*
|
|
86
|
+
* Create an entitlement for the customer.
|
|
87
|
+
*
|
|
88
|
+
* A customer can have only one active entitlement per feature. The feature must be
|
|
89
|
+
* compatible with the entitlement type. Entitlements cannot be modified after
|
|
90
|
+
* creation, only deleted.
|
|
91
|
+
*
|
|
92
|
+
* POST /openmeter/customers/{customerId}/entitlements
|
|
93
|
+
*/
|
|
94
|
+
async create(request, options) {
|
|
95
|
+
return unwrap(await createCustomerEntitlement(this._client, request, options));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
69
98
|
export class InternalCustomersCredits {
|
|
70
99
|
_client;
|
|
71
100
|
constructor(_client) {
|
|
@@ -144,6 +173,22 @@ export class InternalCustomersCharges {
|
|
|
144
173
|
return unwrap(await createCustomerCharges(this._client, request, options));
|
|
145
174
|
}
|
|
146
175
|
}
|
|
176
|
+
export class InternalEntitlements {
|
|
177
|
+
_client;
|
|
178
|
+
constructor(_client) {
|
|
179
|
+
this._client = _client;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get customer entitlement access
|
|
183
|
+
*
|
|
184
|
+
* Get the customer's access to a single feature.
|
|
185
|
+
*
|
|
186
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
187
|
+
*/
|
|
188
|
+
async getCustomerAccess(request, options) {
|
|
189
|
+
return unwrap(await getCustomerEntitlementAccess(this._client, request, options));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
147
192
|
export class InternalSubscriptions {
|
|
148
193
|
_client;
|
|
149
194
|
constructor(_client) {
|