@openmeter/client 1.0.0-beta.232 → 1.0.0-beta.233
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 +76 -45
- package/dist/funcs/apps.js +7 -2
- package/dist/funcs/billing.js +7 -2
- package/dist/funcs/charges.d.ts +14 -0
- package/dist/funcs/charges.js +42 -0
- package/dist/funcs/{governance.d.ts → entitlementAccess.d.ts} +4 -4
- package/dist/funcs/{governance.js → entitlementAccess.js} +10 -10
- package/dist/funcs/entitlements.d.ts +9 -1
- package/dist/funcs/entitlements.js +50 -1
- package/dist/funcs/index.d.ts +2 -1
- package/dist/funcs/index.js +2 -1
- package/dist/funcs/planAddons.js +7 -2
- package/dist/funcs/subscriptions.d.ts +60 -1
- package/dist/funcs/subscriptions.js +204 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/lib/wire.js +62 -6
- package/dist/models/operations/apps.d.ts +17 -1
- package/dist/models/operations/billing.d.ts +19 -1
- package/dist/models/operations/charges.d.ts +54 -0
- package/dist/models/operations/customers.d.ts +19 -5
- package/dist/models/operations/entitlementAccess.d.ts +9 -0
- package/dist/models/operations/entitlementAccess.js +2 -0
- package/dist/models/operations/entitlements.d.ts +18 -1
- package/dist/models/operations/planAddons.d.ts +14 -1
- package/dist/models/operations/subscriptions.d.ts +27 -3
- package/dist/models/schemas.d.ts +46830 -22570
- package/dist/models/schemas.js +3175 -1508
- package/dist/models/types.d.ts +4115 -1896
- package/dist/sdk/apps.d.ts +1 -62
- package/dist/sdk/apps.js +1 -76
- package/dist/sdk/customers.d.ts +2 -56
- package/dist/sdk/customers.js +1 -67
- package/dist/sdk/entitlements.d.ts +9 -1
- package/dist/sdk/entitlements.js +11 -1
- package/dist/sdk/internal.d.ts +183 -22
- package/dist/sdk/internal.js +231 -26
- package/dist/sdk/invoices.d.ts +112 -0
- package/dist/sdk/invoices.js +115 -0
- package/dist/sdk/planAddons.d.ts +1 -20
- package/dist/sdk/planAddons.js +1 -24
- package/dist/sdk/sdk.d.ts +3 -0
- package/dist/sdk/sdk.js +5 -0
- package/dist/sdk/subscriptions.d.ts +20 -1
- package/dist/sdk/subscriptions.js +24 -1
- package/package.json +1 -1
- package/dist/models/operations/governance.d.ts +0 -9
- /package/dist/models/operations/{governance.js → charges.js} +0 -0
package/dist/sdk/apps.d.ts
CHANGED
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type { App, AppCatalogItem } from '../models/types.js';
|
|
3
|
+
import type { GetAppRequest, GetAppResponse } from '../models/operations/apps.js';
|
|
5
4
|
export declare class Apps {
|
|
6
5
|
private readonly _client;
|
|
7
6
|
constructor(_client: Client);
|
|
8
|
-
/**
|
|
9
|
-
* List apps
|
|
10
|
-
*
|
|
11
|
-
* List installed apps.
|
|
12
|
-
*
|
|
13
|
-
* GET /openmeter/apps
|
|
14
|
-
*/
|
|
15
|
-
list(request?: ListAppsRequest, options?: RequestOptions): Promise<ListAppsResponse>;
|
|
16
|
-
/**
|
|
17
|
-
* List apps
|
|
18
|
-
*
|
|
19
|
-
* List installed apps.
|
|
20
|
-
*
|
|
21
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
22
|
-
*
|
|
23
|
-
* GET /openmeter/apps
|
|
24
|
-
*/
|
|
25
|
-
listAll(request?: ListAppsRequest, options?: RequestOptions): AsyncIterable<App>;
|
|
26
7
|
/**
|
|
27
8
|
* Get app
|
|
28
9
|
*
|
|
@@ -31,46 +12,4 @@ export declare class Apps {
|
|
|
31
12
|
* GET /openmeter/apps/{appId}
|
|
32
13
|
*/
|
|
33
14
|
get(request: GetAppRequest, options?: RequestOptions): Promise<GetAppResponse>;
|
|
34
|
-
/**
|
|
35
|
-
* Uninstall app
|
|
36
|
-
*
|
|
37
|
-
* Uninstall an app by ID.
|
|
38
|
-
*
|
|
39
|
-
* DELETE /openmeter/apps/{appId}
|
|
40
|
-
*/
|
|
41
|
-
uninstall(request: UninstallAppRequest, options?: RequestOptions): Promise<UninstallAppResponse>;
|
|
42
|
-
/**
|
|
43
|
-
* List app catalog
|
|
44
|
-
*
|
|
45
|
-
* List available apps.
|
|
46
|
-
*
|
|
47
|
-
* GET /openmeter/app-catalog
|
|
48
|
-
*/
|
|
49
|
-
listCatalog(request?: ListAppCatalogRequest, options?: RequestOptions): Promise<ListAppCatalogResponse>;
|
|
50
|
-
/**
|
|
51
|
-
* List app catalog
|
|
52
|
-
*
|
|
53
|
-
* List available apps.
|
|
54
|
-
*
|
|
55
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
56
|
-
*
|
|
57
|
-
* GET /openmeter/app-catalog
|
|
58
|
-
*/
|
|
59
|
-
listCatalogAll(request?: ListAppCatalogRequest, options?: RequestOptions): AsyncIterable<AppCatalogItem>;
|
|
60
|
-
/**
|
|
61
|
-
* Get app catalog item by type
|
|
62
|
-
*
|
|
63
|
-
* Get an app catalog item by type.
|
|
64
|
-
*
|
|
65
|
-
* GET /openmeter/app-catalog/{appType}
|
|
66
|
-
*/
|
|
67
|
-
getCatalogItem(request: GetAppCatalogItemRequest, options?: RequestOptions): Promise<GetAppCatalogItemResponse>;
|
|
68
|
-
/**
|
|
69
|
-
* Install app from the catalog
|
|
70
|
-
*
|
|
71
|
-
* Install an app from the catalog.
|
|
72
|
-
*
|
|
73
|
-
* POST /openmeter/app-catalog/install
|
|
74
|
-
*/
|
|
75
|
-
install(request: InstallAppRequest, options?: RequestOptions): Promise<InstallAppResponse>;
|
|
76
15
|
}
|
package/dist/sdk/apps.js
CHANGED
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
|
-
import {
|
|
4
|
-
import { listApps, getApp, uninstallApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
3
|
+
import { getApp } from '../funcs/apps.js';
|
|
5
4
|
export class Apps {
|
|
6
5
|
_client;
|
|
7
6
|
constructor(_client) {
|
|
8
7
|
this._client = _client;
|
|
9
8
|
}
|
|
10
|
-
/**
|
|
11
|
-
* List apps
|
|
12
|
-
*
|
|
13
|
-
* List installed apps.
|
|
14
|
-
*
|
|
15
|
-
* GET /openmeter/apps
|
|
16
|
-
*/
|
|
17
|
-
async list(request, options) {
|
|
18
|
-
return unwrap(await listApps(this._client, request, options));
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* List apps
|
|
22
|
-
*
|
|
23
|
-
* List installed apps.
|
|
24
|
-
*
|
|
25
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
26
|
-
*
|
|
27
|
-
* GET /openmeter/apps
|
|
28
|
-
*/
|
|
29
|
-
listAll(request, options) {
|
|
30
|
-
return paginatePages((req, opts) => listApps(this._client, req, opts), request ?? {}, options);
|
|
31
|
-
}
|
|
32
9
|
/**
|
|
33
10
|
* Get app
|
|
34
11
|
*
|
|
@@ -39,56 +16,4 @@ export class Apps {
|
|
|
39
16
|
async get(request, options) {
|
|
40
17
|
return unwrap(await getApp(this._client, request, options));
|
|
41
18
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Uninstall app
|
|
44
|
-
*
|
|
45
|
-
* Uninstall an app by ID.
|
|
46
|
-
*
|
|
47
|
-
* DELETE /openmeter/apps/{appId}
|
|
48
|
-
*/
|
|
49
|
-
async uninstall(request, options) {
|
|
50
|
-
return unwrap(await uninstallApp(this._client, request, options));
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* List app catalog
|
|
54
|
-
*
|
|
55
|
-
* List available apps.
|
|
56
|
-
*
|
|
57
|
-
* GET /openmeter/app-catalog
|
|
58
|
-
*/
|
|
59
|
-
async listCatalog(request, options) {
|
|
60
|
-
return unwrap(await listAppCatalog(this._client, request, options));
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* List app catalog
|
|
64
|
-
*
|
|
65
|
-
* List available apps.
|
|
66
|
-
*
|
|
67
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
68
|
-
*
|
|
69
|
-
* GET /openmeter/app-catalog
|
|
70
|
-
*/
|
|
71
|
-
listCatalogAll(request, options) {
|
|
72
|
-
return paginatePages((req, opts) => listAppCatalog(this._client, req, opts), request ?? {}, options);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Get app catalog item by type
|
|
76
|
-
*
|
|
77
|
-
* Get an app catalog item by type.
|
|
78
|
-
*
|
|
79
|
-
* GET /openmeter/app-catalog/{appType}
|
|
80
|
-
*/
|
|
81
|
-
async getCatalogItem(request, options) {
|
|
82
|
-
return unwrap(await getAppCatalogItem(this._client, request, options));
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Install app from the catalog
|
|
86
|
-
*
|
|
87
|
-
* Install an app from the catalog.
|
|
88
|
-
*
|
|
89
|
-
* POST /openmeter/app-catalog/install
|
|
90
|
-
*/
|
|
91
|
-
async install(request, options) {
|
|
92
|
-
return unwrap(await installApp(this._client, request, options));
|
|
93
|
-
}
|
|
94
19
|
}
|
package/dist/sdk/customers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse,
|
|
4
|
-
import type {
|
|
3
|
+
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse } from '../models/operations/customers.js';
|
|
4
|
+
import type { CreditGrant, CreditTransaction, Customer } from '../models/types.js';
|
|
5
5
|
export declare class Customers {
|
|
6
6
|
private readonly _client;
|
|
7
7
|
constructor(_client: Client);
|
|
@@ -47,8 +47,6 @@ export declare class Customers {
|
|
|
47
47
|
get billing(): CustomersBilling;
|
|
48
48
|
private _credits?;
|
|
49
49
|
get credits(): CustomersCredits;
|
|
50
|
-
private _charges?;
|
|
51
|
-
get charges(): CustomersCharges;
|
|
52
50
|
}
|
|
53
51
|
export declare class CustomersBilling {
|
|
54
52
|
private readonly _client;
|
|
@@ -153,22 +151,6 @@ export declare class CustomersCreditsGrants {
|
|
|
153
151
|
* GET /openmeter/customers/{customerId}/credits/grants
|
|
154
152
|
*/
|
|
155
153
|
listAll(request: ListCreditGrantsRequest, options?: RequestOptions): AsyncIterable<CreditGrant>;
|
|
156
|
-
/**
|
|
157
|
-
* Void credit grant
|
|
158
|
-
*
|
|
159
|
-
* Void a credit grant, forfeiting the remaining unused balance.
|
|
160
|
-
*
|
|
161
|
-
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
162
|
-
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
163
|
-
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
164
|
-
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
165
|
-
* payments may still collect the original amount. Only `active` grants can be
|
|
166
|
-
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
167
|
-
* Retrying a successful void is an idempotent success.
|
|
168
|
-
*
|
|
169
|
-
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
170
|
-
*/
|
|
171
|
-
void(request: VoidCreditGrantRequest, options?: RequestOptions): Promise<VoidCreditGrantResponse>;
|
|
172
154
|
/**
|
|
173
155
|
* Update credit grant external settlement status
|
|
174
156
|
*
|
|
@@ -240,39 +222,3 @@ export declare class CustomersCreditsTransactions {
|
|
|
240
222
|
*/
|
|
241
223
|
listAll(request: ListCreditTransactionsRequest, options?: RequestOptions): AsyncIterable<CreditTransaction>;
|
|
242
224
|
}
|
|
243
|
-
export declare class CustomersCharges {
|
|
244
|
-
private readonly _client;
|
|
245
|
-
constructor(_client: Client);
|
|
246
|
-
/**
|
|
247
|
-
* List customer charges
|
|
248
|
-
*
|
|
249
|
-
* List customer charges.
|
|
250
|
-
*
|
|
251
|
-
* Returns the customer's charges that are represented as either flat fee or
|
|
252
|
-
* usage-based charges.
|
|
253
|
-
*
|
|
254
|
-
* GET /openmeter/customers/{customerId}/charges
|
|
255
|
-
*/
|
|
256
|
-
list(request: ListCustomerChargesRequest, options?: RequestOptions): Promise<ListCustomerChargesResponse>;
|
|
257
|
-
/**
|
|
258
|
-
* List customer charges
|
|
259
|
-
*
|
|
260
|
-
* List customer charges.
|
|
261
|
-
*
|
|
262
|
-
* Returns the customer's charges that are represented as either flat fee or
|
|
263
|
-
* usage-based charges.
|
|
264
|
-
*
|
|
265
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
266
|
-
*
|
|
267
|
-
* GET /openmeter/customers/{customerId}/charges
|
|
268
|
-
*/
|
|
269
|
-
listAll(request: ListCustomerChargesRequest, options?: RequestOptions): AsyncIterable<Charge>;
|
|
270
|
-
/**
|
|
271
|
-
* Create customer charge
|
|
272
|
-
*
|
|
273
|
-
* Create customer charge.
|
|
274
|
-
*
|
|
275
|
-
* POST /openmeter/customers/{customerId}/charges
|
|
276
|
-
*/
|
|
277
|
-
create(request: CreateCustomerChargesRequest, options?: RequestOptions): Promise<CreateCustomerChargesResponse>;
|
|
278
|
-
}
|
package/dist/sdk/customers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginateCursor, paginatePages } from '../lib/paginate.js';
|
|
4
|
-
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment,
|
|
4
|
+
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, updateCreditGrantExternalSettlement, listCreditTransactions, } from '../funcs/customers.js';
|
|
5
5
|
export class Customers {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
@@ -65,10 +65,6 @@ export class Customers {
|
|
|
65
65
|
get credits() {
|
|
66
66
|
return (this._credits ??= new CustomersCredits(this._client));
|
|
67
67
|
}
|
|
68
|
-
_charges;
|
|
69
|
-
get charges() {
|
|
70
|
-
return (this._charges ??= new CustomersCharges(this._client));
|
|
71
|
-
}
|
|
72
68
|
}
|
|
73
69
|
export class CustomersBilling {
|
|
74
70
|
_client;
|
|
@@ -205,24 +201,6 @@ export class CustomersCreditsGrants {
|
|
|
205
201
|
listAll(request, options) {
|
|
206
202
|
return paginatePages((req, opts) => listCreditGrants(this._client, req, opts), request, options);
|
|
207
203
|
}
|
|
208
|
-
/**
|
|
209
|
-
* Void credit grant
|
|
210
|
-
*
|
|
211
|
-
* Void a credit grant, forfeiting the remaining unused balance.
|
|
212
|
-
*
|
|
213
|
-
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
214
|
-
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
215
|
-
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
216
|
-
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
217
|
-
* payments may still collect the original amount. Only `active` grants can be
|
|
218
|
-
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
219
|
-
* Retrying a successful void is an idempotent success.
|
|
220
|
-
*
|
|
221
|
-
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
222
|
-
*/
|
|
223
|
-
async void(request, options) {
|
|
224
|
-
return unwrap(await voidCreditGrant(this._client, request, options));
|
|
225
|
-
}
|
|
226
204
|
/**
|
|
227
205
|
* Update credit grant external settlement status
|
|
228
206
|
*
|
|
@@ -310,47 +288,3 @@ export class CustomersCreditsTransactions {
|
|
|
310
288
|
return paginateCursor((req, opts) => listCreditTransactions(this._client, req, opts), request, options);
|
|
311
289
|
}
|
|
312
290
|
}
|
|
313
|
-
export class CustomersCharges {
|
|
314
|
-
_client;
|
|
315
|
-
constructor(_client) {
|
|
316
|
-
this._client = _client;
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* List customer charges
|
|
320
|
-
*
|
|
321
|
-
* List customer charges.
|
|
322
|
-
*
|
|
323
|
-
* Returns the customer's charges that are represented as either flat fee or
|
|
324
|
-
* usage-based charges.
|
|
325
|
-
*
|
|
326
|
-
* GET /openmeter/customers/{customerId}/charges
|
|
327
|
-
*/
|
|
328
|
-
async list(request, options) {
|
|
329
|
-
return unwrap(await listCustomerCharges(this._client, request, options));
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* List customer charges
|
|
333
|
-
*
|
|
334
|
-
* List customer charges.
|
|
335
|
-
*
|
|
336
|
-
* Returns the customer's charges that are represented as either flat fee or
|
|
337
|
-
* usage-based charges.
|
|
338
|
-
*
|
|
339
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
340
|
-
*
|
|
341
|
-
* GET /openmeter/customers/{customerId}/charges
|
|
342
|
-
*/
|
|
343
|
-
listAll(request, options) {
|
|
344
|
-
return paginatePages((req, opts) => listCustomerCharges(this._client, req, opts), request, options);
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Create customer charge
|
|
348
|
-
*
|
|
349
|
-
* Create customer charge.
|
|
350
|
-
*
|
|
351
|
-
* POST /openmeter/customers/{customerId}/charges
|
|
352
|
-
*/
|
|
353
|
-
async create(request, options) {
|
|
354
|
-
return unwrap(await createCustomerCharges(this._client, request, options));
|
|
355
|
-
}
|
|
356
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
|
|
3
|
+
import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse, GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
|
|
4
4
|
export declare class Entitlements {
|
|
5
5
|
private readonly _client;
|
|
6
6
|
constructor(_client: Client);
|
|
@@ -10,4 +10,12 @@ export declare class Entitlements {
|
|
|
10
10
|
* GET /openmeter/customers/{customerId}/entitlement-access
|
|
11
11
|
*/
|
|
12
12
|
listCustomerAccess(request: ListCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<ListCustomerEntitlementAccessResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get customer entitlement access
|
|
15
|
+
*
|
|
16
|
+
* Get the customer's access to a single feature.
|
|
17
|
+
*
|
|
18
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
19
|
+
*/
|
|
20
|
+
getCustomerAccess(request: GetCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<GetCustomerEntitlementAccessResponse>;
|
|
13
21
|
}
|
package/dist/sdk/entitlements.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
|
-
import { listCustomerEntitlementAccess } from '../funcs/entitlements.js';
|
|
3
|
+
import { listCustomerEntitlementAccess, getCustomerEntitlementAccess, } from '../funcs/entitlements.js';
|
|
4
4
|
export class Entitlements {
|
|
5
5
|
_client;
|
|
6
6
|
constructor(_client) {
|
|
@@ -14,4 +14,14 @@ export class Entitlements {
|
|
|
14
14
|
async listCustomerAccess(request, options) {
|
|
15
15
|
return unwrap(await listCustomerEntitlementAccess(this._client, request, options));
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Get customer entitlement access
|
|
19
|
+
*
|
|
20
|
+
* Get the customer's access to a single feature.
|
|
21
|
+
*
|
|
22
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
23
|
+
*/
|
|
24
|
+
async getCustomerAccess(request, options) {
|
|
25
|
+
return unwrap(await getCustomerEntitlementAccess(this._client, request, options));
|
|
26
|
+
}
|
|
17
27
|
}
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
|
+
import type { UnscheduleSubscriptionRequest, UnscheduleSubscriptionResponse, RestoreSubscriptionRequest, RestoreSubscriptionResponse, MigrateSubscriptionRequest, MigrateSubscriptionResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
5
|
+
import type { ListAppsRequest, ListAppsResponse, UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
|
|
5
6
|
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
|
|
7
|
+
import type { ListChargesRequest, ListChargesResponse } from '../models/operations/charges.js';
|
|
6
8
|
import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, GetCustomCurrencyRequest, GetCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
+
import type { ListPlanAddonsRequest, ListPlanAddonsResponse } from '../models/operations/planAddons.js';
|
|
10
|
+
import type { QueryEntitlementAccessRequest, QueryEntitlementAccessResponse } from '../models/operations/entitlementAccess.js';
|
|
11
|
+
import type { App, AppCatalogItem, Charge, CostBasis, Currency, Invoice, PlanAddon } from '../models/types.js';
|
|
9
12
|
/**
|
|
10
13
|
* Operations marked internal in the API definition. They are not part of
|
|
11
14
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -14,28 +17,144 @@ import type { App, AppCatalogItem, CostBasis, Currency, Invoice } from '../model
|
|
|
14
17
|
export declare class Internal {
|
|
15
18
|
private readonly _client;
|
|
16
19
|
constructor(_client: Client);
|
|
20
|
+
private _customers?;
|
|
21
|
+
get customers(): InternalCustomers;
|
|
17
22
|
private _subscriptions?;
|
|
18
23
|
get subscriptions(): InternalSubscriptions;
|
|
19
24
|
private _apps?;
|
|
20
25
|
get apps(): InternalApps;
|
|
21
26
|
private _invoices?;
|
|
22
27
|
get invoices(): InternalInvoices;
|
|
28
|
+
private _charges?;
|
|
29
|
+
get charges(): InternalCharges;
|
|
23
30
|
private _currencies?;
|
|
24
31
|
get currencies(): InternalCurrencies;
|
|
25
|
-
private
|
|
26
|
-
get
|
|
32
|
+
private _planAddons?;
|
|
33
|
+
get planAddons(): InternalPlanAddons;
|
|
34
|
+
private _entitlementAccess?;
|
|
35
|
+
get entitlementAccess(): InternalEntitlementAccess;
|
|
36
|
+
}
|
|
37
|
+
export declare class InternalCustomers {
|
|
38
|
+
private readonly _client;
|
|
39
|
+
constructor(_client: Client);
|
|
40
|
+
private _credits?;
|
|
41
|
+
get credits(): InternalCustomersCredits;
|
|
42
|
+
private _charges?;
|
|
43
|
+
get charges(): InternalCustomersCharges;
|
|
44
|
+
}
|
|
45
|
+
export declare class InternalCustomersCredits {
|
|
46
|
+
private readonly _client;
|
|
47
|
+
constructor(_client: Client);
|
|
48
|
+
private _grants?;
|
|
49
|
+
get grants(): InternalCustomersCreditsGrants;
|
|
50
|
+
}
|
|
51
|
+
export declare class InternalCustomersCreditsGrants {
|
|
52
|
+
private readonly _client;
|
|
53
|
+
constructor(_client: Client);
|
|
54
|
+
/**
|
|
55
|
+
* Void credit grant
|
|
56
|
+
*
|
|
57
|
+
* Void a credit grant, forfeiting the remaining unused balance.
|
|
58
|
+
*
|
|
59
|
+
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
60
|
+
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
61
|
+
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
62
|
+
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
63
|
+
* payments may still collect the original amount. Only `active` grants can be
|
|
64
|
+
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
65
|
+
* Retrying a successful void is an idempotent success.
|
|
66
|
+
*
|
|
67
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
68
|
+
*/
|
|
69
|
+
void(request: VoidCreditGrantRequest, options?: RequestOptions): Promise<VoidCreditGrantResponse>;
|
|
70
|
+
}
|
|
71
|
+
export declare class InternalCustomersCharges {
|
|
72
|
+
private readonly _client;
|
|
73
|
+
constructor(_client: Client);
|
|
74
|
+
/**
|
|
75
|
+
* List customer charges
|
|
76
|
+
*
|
|
77
|
+
* List customer charges.
|
|
78
|
+
*
|
|
79
|
+
* Returns the customer's charges that are represented as either flat fee or
|
|
80
|
+
* usage-based charges.
|
|
81
|
+
*
|
|
82
|
+
* GET /openmeter/customers/{customerId}/charges
|
|
83
|
+
*/
|
|
84
|
+
list(request: ListCustomerChargesRequest, options?: RequestOptions): Promise<ListCustomerChargesResponse>;
|
|
85
|
+
/**
|
|
86
|
+
* List customer charges
|
|
87
|
+
*
|
|
88
|
+
* List customer charges.
|
|
89
|
+
*
|
|
90
|
+
* Returns the customer's charges that are represented as either flat fee or
|
|
91
|
+
* usage-based charges.
|
|
92
|
+
*
|
|
93
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
94
|
+
*
|
|
95
|
+
* GET /openmeter/customers/{customerId}/charges
|
|
96
|
+
*/
|
|
97
|
+
listAll(request: ListCustomerChargesRequest, options?: RequestOptions): AsyncIterable<Charge>;
|
|
98
|
+
/**
|
|
99
|
+
* Create customer charge
|
|
100
|
+
*
|
|
101
|
+
* Create customer charge.
|
|
102
|
+
*
|
|
103
|
+
* POST /openmeter/customers/{customerId}/charges
|
|
104
|
+
*/
|
|
105
|
+
create(request: CreateCustomerChargesRequest, options?: RequestOptions): Promise<CreateCustomerChargesResponse>;
|
|
27
106
|
}
|
|
28
107
|
export declare class InternalSubscriptions {
|
|
29
108
|
private readonly _client;
|
|
30
109
|
constructor(_client: Client);
|
|
31
110
|
/**
|
|
32
|
-
*
|
|
111
|
+
* Unschedule subscription
|
|
33
112
|
*
|
|
34
|
-
*
|
|
113
|
+
* Deletes a scheduled subscription that has not yet become active, removing it and
|
|
114
|
+
* resolving any scheduling conflict it was holding. This is distinct from
|
|
115
|
+
* canceling: cancel ends a running subscription, whereas unscheduling removes a
|
|
116
|
+
* not-yet-active one. Only scheduled subscriptions can be unscheduled;
|
|
117
|
+
* unscheduling an active or already-started subscription is rejected.
|
|
35
118
|
*
|
|
36
|
-
* POST /openmeter/subscriptions/{subscriptionId}/
|
|
119
|
+
* POST /openmeter/subscriptions/{subscriptionId}/unschedule
|
|
37
120
|
*/
|
|
38
|
-
|
|
121
|
+
unschedule(request: UnscheduleSubscriptionRequest, options?: RequestOptions): Promise<UnscheduleSubscriptionResponse>;
|
|
122
|
+
/**
|
|
123
|
+
* Restore subscription
|
|
124
|
+
*
|
|
125
|
+
* Restores the subscription by deleting any later-scheduled successor
|
|
126
|
+
* subscriptions and continuing this one indefinitely. This is the inverse of a
|
|
127
|
+
* future-dated change, which schedules a successor. Restore is not available when
|
|
128
|
+
* multi-subscription is enabled.
|
|
129
|
+
*
|
|
130
|
+
* POST /openmeter/subscriptions/{subscriptionId}/restore
|
|
131
|
+
*/
|
|
132
|
+
restore(request: RestoreSubscriptionRequest, options?: RequestOptions): Promise<RestoreSubscriptionResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* Migrate subscription
|
|
135
|
+
*
|
|
136
|
+
* Migrates to a later version of the current plan. With starting_phase omitted and
|
|
137
|
+
* billing_anchor omitted or unchanged, migration amends the subscription in place:
|
|
138
|
+
* unchanged items retain their service periods and both response entries have the
|
|
139
|
+
* same ID. Existing addons must remain compatible with the target plan.
|
|
140
|
+
* Incompatible phase timelines or billing settings return an error. Providing
|
|
141
|
+
* starting_phase or a different billing_anchor explicitly requests replacement,
|
|
142
|
+
* which resets the phase timeline, may produce billing adjustments, and does not
|
|
143
|
+
* transfer addons. Custom subscriptions cannot be migrated.
|
|
144
|
+
*
|
|
145
|
+
* POST /openmeter/subscriptions/{subscriptionId}/migrate
|
|
146
|
+
*/
|
|
147
|
+
migrate(request: MigrateSubscriptionRequest, options?: RequestOptions): Promise<MigrateSubscriptionResponse>;
|
|
148
|
+
/**
|
|
149
|
+
* Update subscription addon
|
|
150
|
+
*
|
|
151
|
+
* Update a subscription add-on. Only the quantity is mutable; the timing controls
|
|
152
|
+
* when the new quantity takes effect. A new entry is appended to the add-on's
|
|
153
|
+
* timeline.
|
|
154
|
+
*
|
|
155
|
+
* PATCH /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}
|
|
156
|
+
*/
|
|
157
|
+
updateAddon(request: UpdateSubscriptionAddonRequest, options?: RequestOptions): Promise<UpdateSubscriptionAddonResponse>;
|
|
39
158
|
}
|
|
40
159
|
export declare class InternalApps {
|
|
41
160
|
private readonly _client;
|
|
@@ -58,14 +177,6 @@ export declare class InternalApps {
|
|
|
58
177
|
* GET /openmeter/apps
|
|
59
178
|
*/
|
|
60
179
|
listAll(request?: ListAppsRequest, options?: RequestOptions): AsyncIterable<App>;
|
|
61
|
-
/**
|
|
62
|
-
* Get app
|
|
63
|
-
*
|
|
64
|
-
* Get an installed app.
|
|
65
|
-
*
|
|
66
|
-
* GET /openmeter/apps/{appId}
|
|
67
|
-
*/
|
|
68
|
-
get(request: GetAppRequest, options?: RequestOptions): Promise<GetAppResponse>;
|
|
69
180
|
/**
|
|
70
181
|
* Uninstall app
|
|
71
182
|
*
|
|
@@ -240,6 +351,34 @@ export declare class InternalInvoices {
|
|
|
240
351
|
*/
|
|
241
352
|
snapshotQuantities(request: SnapshotQuantitiesInvoiceRequest, options?: RequestOptions): Promise<SnapshotQuantitiesInvoiceResponse>;
|
|
242
353
|
}
|
|
354
|
+
export declare class InternalCharges {
|
|
355
|
+
private readonly _client;
|
|
356
|
+
constructor(_client: Client);
|
|
357
|
+
/**
|
|
358
|
+
* List charges
|
|
359
|
+
*
|
|
360
|
+
* List charges.
|
|
361
|
+
*
|
|
362
|
+
* Returns the charges of every customer that are represented as either flat fee or
|
|
363
|
+
* usage-based charges.
|
|
364
|
+
*
|
|
365
|
+
* GET /openmeter/charges
|
|
366
|
+
*/
|
|
367
|
+
list(request?: ListChargesRequest, options?: RequestOptions): Promise<ListChargesResponse>;
|
|
368
|
+
/**
|
|
369
|
+
* List charges
|
|
370
|
+
*
|
|
371
|
+
* List charges.
|
|
372
|
+
*
|
|
373
|
+
* Returns the charges of every customer that are represented as either flat fee or
|
|
374
|
+
* usage-based charges.
|
|
375
|
+
*
|
|
376
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
377
|
+
*
|
|
378
|
+
* GET /openmeter/charges
|
|
379
|
+
*/
|
|
380
|
+
listAll(request?: ListChargesRequest, options?: RequestOptions): AsyncIterable<Charge>;
|
|
381
|
+
}
|
|
243
382
|
export declare class InternalCurrencies {
|
|
244
383
|
private readonly _client;
|
|
245
384
|
constructor(_client: Client);
|
|
@@ -307,11 +446,33 @@ export declare class InternalCurrencies {
|
|
|
307
446
|
*/
|
|
308
447
|
createCostBasis(request: CreateCostBasisRequest, options?: RequestOptions): Promise<CreateCostBasisResponse>;
|
|
309
448
|
}
|
|
310
|
-
export declare class
|
|
449
|
+
export declare class InternalPlanAddons {
|
|
450
|
+
private readonly _client;
|
|
451
|
+
constructor(_client: Client);
|
|
452
|
+
/**
|
|
453
|
+
* List add-ons for plan
|
|
454
|
+
*
|
|
455
|
+
* List add-ons associated with a plan.
|
|
456
|
+
*
|
|
457
|
+
* GET /openmeter/plans/{planId}/addons
|
|
458
|
+
*/
|
|
459
|
+
list(request: ListPlanAddonsRequest, options?: RequestOptions): Promise<ListPlanAddonsResponse>;
|
|
460
|
+
/**
|
|
461
|
+
* List add-ons for plan
|
|
462
|
+
*
|
|
463
|
+
* List add-ons associated with a plan.
|
|
464
|
+
*
|
|
465
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
466
|
+
*
|
|
467
|
+
* GET /openmeter/plans/{planId}/addons
|
|
468
|
+
*/
|
|
469
|
+
listAll(request: ListPlanAddonsRequest, options?: RequestOptions): AsyncIterable<PlanAddon>;
|
|
470
|
+
}
|
|
471
|
+
export declare class InternalEntitlementAccess {
|
|
311
472
|
private readonly _client;
|
|
312
473
|
constructor(_client: Client);
|
|
313
474
|
/**
|
|
314
|
-
* Query
|
|
475
|
+
* Query entitlement access
|
|
315
476
|
*
|
|
316
477
|
* Query feature access for a list of customers.
|
|
317
478
|
*
|
|
@@ -322,7 +483,7 @@ export declare class InternalGovernance {
|
|
|
322
483
|
* _Designed to be called on a fixed refresh interval and the query response is
|
|
323
484
|
* intended to be cached._
|
|
324
485
|
*
|
|
325
|
-
* POST /openmeter/
|
|
486
|
+
* POST /openmeter/entitlement-access/query
|
|
326
487
|
*/
|
|
327
|
-
|
|
488
|
+
query(request: QueryEntitlementAccessRequest, options?: RequestOptions): Promise<QueryEntitlementAccessResponse>;
|
|
328
489
|
}
|