@openmeter/client 1.0.0-beta.232 → 1.0.0-beta.234

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +112 -43
  2. package/dist/funcs/apps.js +7 -2
  3. package/dist/funcs/billing.js +7 -2
  4. package/dist/funcs/charges.d.ts +14 -0
  5. package/dist/funcs/charges.js +42 -0
  6. package/dist/funcs/customers.d.ts +112 -1
  7. package/dist/funcs/customers.js +430 -0
  8. package/dist/funcs/{governance.d.ts → entitlementAccess.d.ts} +4 -4
  9. package/dist/funcs/{governance.js → entitlementAccess.js} +10 -10
  10. package/dist/funcs/entitlements.d.ts +46 -1
  11. package/dist/funcs/entitlements.js +213 -1
  12. package/dist/funcs/grants.d.ts +24 -0
  13. package/dist/funcs/grants.js +78 -0
  14. package/dist/funcs/index.d.ts +4 -1
  15. package/dist/funcs/index.js +4 -1
  16. package/dist/funcs/notifications.d.ts +43 -0
  17. package/dist/funcs/notifications.js +163 -0
  18. package/dist/funcs/planAddons.js +7 -2
  19. package/dist/funcs/subscriptions.d.ts +60 -1
  20. package/dist/funcs/subscriptions.js +204 -0
  21. package/dist/index.d.ts +6 -2
  22. package/dist/index.js +1 -0
  23. package/dist/lib/version.d.ts +1 -1
  24. package/dist/lib/version.js +1 -1
  25. package/dist/lib/wire.js +62 -6
  26. package/dist/models/operations/apps.d.ts +17 -1
  27. package/dist/models/operations/billing.d.ts +19 -1
  28. package/dist/models/operations/charges.d.ts +54 -0
  29. package/dist/models/operations/customers.d.ts +127 -5
  30. package/dist/models/operations/entitlementAccess.d.ts +9 -0
  31. package/dist/models/operations/entitlementAccess.js +2 -0
  32. package/dist/models/operations/entitlements.d.ts +73 -1
  33. package/dist/models/operations/grants.d.ts +43 -0
  34. package/dist/models/operations/grants.js +2 -0
  35. package/dist/models/operations/notifications.d.ts +46 -0
  36. package/dist/models/operations/notifications.js +2 -0
  37. package/dist/models/operations/planAddons.d.ts +14 -1
  38. package/dist/models/operations/subscriptions.d.ts +27 -3
  39. package/dist/models/schemas.d.ts +51330 -23237
  40. package/dist/models/schemas.js +4837 -1735
  41. package/dist/models/types.d.ts +4758 -1592
  42. package/dist/sdk/apps.d.ts +2 -44
  43. package/dist/sdk/apps.js +1 -53
  44. package/dist/sdk/customers.d.ts +2 -56
  45. package/dist/sdk/customers.js +1 -67
  46. package/dist/sdk/internal.d.ts +491 -28
  47. package/dist/sdk/internal.js +607 -30
  48. package/dist/sdk/invoices.d.ts +112 -0
  49. package/dist/sdk/invoices.js +115 -0
  50. package/dist/sdk/notifications.d.ts +58 -0
  51. package/dist/sdk/notifications.js +72 -0
  52. package/dist/sdk/planAddons.d.ts +1 -20
  53. package/dist/sdk/planAddons.js +1 -24
  54. package/dist/sdk/sdk.d.ts +3 -0
  55. package/dist/sdk/sdk.js +5 -0
  56. package/dist/sdk/subscriptions.d.ts +12 -1
  57. package/dist/sdk/subscriptions.js +14 -1
  58. package/package.json +1 -1
  59. package/dist/models/operations/governance.d.ts +0 -9
  60. /package/dist/models/operations/{governance.js → charges.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse, UninstallAppRequest, UninstallAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
4
- import type { App, AppCatalogItem } from '../models/types.js';
3
+ import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse } from '../models/operations/apps.js';
4
+ import type { App } from '../models/types.js';
5
5
  export declare class Apps {
6
6
  private readonly _client;
7
7
  constructor(_client: Client);
@@ -31,46 +31,4 @@ export declare class Apps {
31
31
  * GET /openmeter/apps/{appId}
32
32
  */
33
33
  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
34
  }
package/dist/sdk/apps.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 { paginatePages } from '../lib/paginate.js';
4
- import { listApps, getApp, uninstallApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
4
+ import { listApps, getApp } from '../funcs/apps.js';
5
5
  export class Apps {
6
6
  _client;
7
7
  constructor(_client) {
@@ -39,56 +39,4 @@ export class Apps {
39
39
  async get(request, options) {
40
40
  return unwrap(await getApp(this._client, request, options));
41
41
  }
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
42
  }
@@ -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, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
4
- import type { Charge, CreditGrant, CreditTransaction, Customer } from '../models/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, 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
- }
@@ -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, voidCreditGrant, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
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
- }