@openmeter/client 1.0.0-beta-72c0e4789aae → 1.0.0-beta-e609679efd27

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.
@@ -1,17 +1,6 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, OverrideCustomerEntitlementRequest, OverrideCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCustomerEntitlementGrantRequest, CreateCustomerEntitlementGrantResponse, ListCustomerEntitlementGrantsRequest, ListCustomerEntitlementGrantsResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
4
- import type { GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse, GetCustomerEntitlementValueByFeatureKeyRequest, GetCustomerEntitlementValueByFeatureKeyResponse, ListEntitlementsRequest, ListEntitlementsResponse, GetEntitlementRequest, GetEntitlementResponse, GetCustomerEntitlementValueRequest, GetCustomerEntitlementValueResponse } from '../models/operations/entitlements.js';
5
- import type { ListGrantsRequest, ListGrantsResponse, VoidGrantRequest, VoidGrantResponse } from '../models/operations/grants.js';
6
- import type { UnscheduleSubscriptionRequest, UnscheduleSubscriptionResponse, RestoreSubscriptionRequest, RestoreSubscriptionResponse, MigrateSubscriptionRequest, MigrateSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
7
- import type { UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
8
- import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
9
- import type { ListChargesRequest, ListChargesResponse } from '../models/operations/charges.js';
10
- import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, GetCustomCurrencyRequest, GetCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
11
- import type { ListPlanAddonsRequest, ListPlanAddonsResponse } from '../models/operations/planAddons.js';
12
- import type { QueryEntitlementAccessRequest, QueryEntitlementAccessResponse } from '../models/operations/entitlementAccess.js';
13
- import type { ListNotificationChannelsRequest, ListNotificationChannelsResponse, CreateNotificationChannelRequest, CreateNotificationChannelResponse, GetNotificationChannelRequest, GetNotificationChannelResponse, UpdateNotificationChannelRequest, UpdateNotificationChannelResponse, DeleteNotificationChannelRequest, DeleteNotificationChannelResponse } from '../models/operations/notifications.js';
14
- import type { AppCatalogItem, Charge, CostBasis, Currency, Entitlement, EntitlementGrant, Invoice, NotificationChannel, PlanAddon } from '../models/types.js';
3
+ import type { CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
15
4
  /**
16
5
  * Operations marked internal in the API definition. They are not part of
17
6
  * the customer surface: they may require additional permissions, and they
@@ -20,389 +9,12 @@ import type { AppCatalogItem, Charge, CostBasis, Currency, Entitlement, Entitlem
20
9
  export declare class Internal {
21
10
  private readonly _client;
22
11
  constructor(_client: Client);
23
- private _customers?;
24
- get customers(): InternalCustomers;
25
- private _entitlements?;
26
- get entitlements(): InternalEntitlements;
27
- private _grants?;
28
- get grants(): InternalGrants;
29
12
  private _subscriptions?;
30
13
  get subscriptions(): InternalSubscriptions;
31
- private _apps?;
32
- get apps(): InternalApps;
33
- private _invoices?;
34
- get invoices(): InternalInvoices;
35
- private _charges?;
36
- get charges(): InternalCharges;
37
- private _currencies?;
38
- get currencies(): InternalCurrencies;
39
- private _planAddons?;
40
- get planAddons(): InternalPlanAddons;
41
- private _entitlementAccess?;
42
- get entitlementAccess(): InternalEntitlementAccess;
43
- private _notifications?;
44
- get notifications(): InternalNotifications;
45
- }
46
- export declare class InternalCustomers {
47
- private readonly _client;
48
- constructor(_client: Client);
49
- private _entitlements?;
50
- get entitlements(): InternalCustomersEntitlements;
51
- private _credits?;
52
- get credits(): InternalCustomersCredits;
53
- private _charges?;
54
- get charges(): InternalCustomersCharges;
55
- }
56
- export declare class InternalCustomersEntitlements {
57
- private readonly _client;
58
- constructor(_client: Client);
59
- /**
60
- * Create customer entitlement
61
- *
62
- * Create an entitlement for the customer.
63
- *
64
- * A customer can have only one active entitlement per feature. The feature must be
65
- * compatible with the entitlement type. Entitlements cannot be modified after
66
- * creation, only deleted.
67
- *
68
- * POST /openmeter/customers/{customerId}/entitlements
69
- */
70
- create(request: CreateCustomerEntitlementRequest, options?: RequestOptions): Promise<CreateCustomerEntitlementResponse>;
71
- /**
72
- * Override customer entitlement
73
- *
74
- * Override an entitlement of the customer with a new one.
75
- *
76
- * The referenced entitlement ends and the new one starts at the same instant, so
77
- * access continues without a gap. Both must belong to the same feature. Use this
78
- * for upgrades and downgrades.
79
- *
80
- * Fails if the referenced entitlement does not exist, is deleted, or is no longer
81
- * active.
82
- *
83
- * PUT /openmeter/customers/{customerId}/entitlements/{entitlementId}/override
84
- */
85
- override(request: OverrideCustomerEntitlementRequest, options?: RequestOptions): Promise<OverrideCustomerEntitlementResponse>;
86
- /**
87
- * Get customer entitlement history
88
- *
89
- * Get the balance and usage history of a metered entitlement. The queried range
90
- * may span multiple usage periods.
91
- *
92
- * `windowed_history` groups usage into windows of the requested size and reports
93
- * the balance at the start of each window. `burndown_history` lists the periods in
94
- * which grants were consumed in a fixed order, together with the usage taken from
95
- * each grant.
96
- *
97
- * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history
98
- */
99
- getHistory(request: GetCustomerEntitlementHistoryRequest, options?: RequestOptions): Promise<GetCustomerEntitlementHistoryResponse>;
100
- /**
101
- * Get customer entitlement
102
- *
103
- * Get an entitlement of the customer by ID. For checking entitlement access, use
104
- * the entitlement access endpoints instead.
105
- *
106
- * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}
107
- */
108
- get(request: GetCustomerEntitlementRequest, options?: RequestOptions): Promise<GetCustomerEntitlementResponse>;
109
- /**
110
- * List customer entitlements
111
- *
112
- * List the entitlements of the customer that are active at the time of the
113
- * request. For checking entitlement access, use the entitlement access endpoints
114
- * instead.
115
- *
116
- * GET /openmeter/customers/{customerId}/entitlements
117
- */
118
- list(request: ListCustomerEntitlementsRequest, options?: RequestOptions): Promise<ListCustomerEntitlementsResponse>;
119
- /**
120
- * List customer entitlements
121
- *
122
- * List the entitlements of the customer that are active at the time of the
123
- * request. For checking entitlement access, use the entitlement access endpoints
124
- * instead.
125
- *
126
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
127
- *
128
- * GET /openmeter/customers/{customerId}/entitlements
129
- */
130
- listAll(request: ListCustomerEntitlementsRequest, options?: RequestOptions): AsyncIterable<Entitlement>;
131
- /**
132
- * Reset customer entitlement usage
133
- *
134
- * Reset the usage of a metered entitlement. The reset starts a new usage period:
135
- * usage is zeroed and grants roll over according to their rollover settings.
136
- *
137
- * Usage is reset automatically at the end of each usage period. Use this operation
138
- * to reset it earlier, for example to align the entitlement with the customer's
139
- * billing period. The usage period anchor can be moved at the same time.
140
- *
141
- * POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/reset
142
- */
143
- resetUsage(request: ResetCustomerEntitlementUsageRequest, options?: RequestOptions): Promise<ResetCustomerEntitlementUsageResponse>;
144
- /**
145
- * Delete customer entitlement
146
- *
147
- * Deletes the entitlement and revokes access to its feature. A customer can hold
148
- * only one active entitlement per feature, so migrating a feature requires
149
- * deleting the previous entitlement first.
150
- *
151
- * Deletion sets the `deleted_at` timestamp instead of removing history. Access and
152
- * status queries for earlier points in time still treat the entitlement as active,
153
- * so access changes are never retroactive.
154
- *
155
- * DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}
156
- */
157
- delete(request: DeleteCustomerEntitlementRequest, options?: RequestOptions): Promise<DeleteCustomerEntitlementResponse>;
158
- private _grants?;
159
- get grants(): InternalCustomersEntitlementsGrants;
160
- }
161
- export declare class InternalCustomersEntitlementsGrants {
162
- private readonly _client;
163
- constructor(_client: Client);
164
- /**
165
- * Create customer entitlement grant
166
- *
167
- * Issue a grant for a metered entitlement of the customer. Boolean and static
168
- * entitlements cannot have grants, so the request is rejected for them.
169
- *
170
- * Grants are immutable. The amount is added to the balance from `effective_at`,
171
- * which cannot be earlier than the start of the current usage period.
172
- *
173
- * POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
174
- */
175
- create(request: CreateCustomerEntitlementGrantRequest, options?: RequestOptions): Promise<CreateCustomerEntitlementGrantResponse>;
176
- /**
177
- * List customer entitlement grants
178
- *
179
- * List the grants issued for an entitlement of the customer. Grants only exist for
180
- * metered entitlements, so the list is empty for boolean and static entitlements.
181
- *
182
- * Deleted grants are excluded unless `include_deleted` is set. Voided and expired
183
- * grants are always included, as they are part of the balance history.
184
- *
185
- * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
186
- */
187
- list(request: ListCustomerEntitlementGrantsRequest, options?: RequestOptions): Promise<ListCustomerEntitlementGrantsResponse>;
188
- /**
189
- * List customer entitlement grants
190
- *
191
- * List the grants issued for an entitlement of the customer. Grants only exist for
192
- * metered entitlements, so the list is empty for boolean and static entitlements.
193
- *
194
- * Deleted grants are excluded unless `include_deleted` is set. Voided and expired
195
- * grants are always included, as they are part of the balance history.
196
- *
197
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
198
- *
199
- * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
200
- */
201
- listAll(request: ListCustomerEntitlementGrantsRequest, options?: RequestOptions): AsyncIterable<EntitlementGrant>;
202
- }
203
- export declare class InternalCustomersCredits {
204
- private readonly _client;
205
- constructor(_client: Client);
206
- private _grants?;
207
- get grants(): InternalCustomersCreditsGrants;
208
- }
209
- export declare class InternalCustomersCreditsGrants {
210
- private readonly _client;
211
- constructor(_client: Client);
212
- /**
213
- * Void credit grant
214
- *
215
- * Void a credit grant, forfeiting the remaining unused balance.
216
- *
217
- * Voiding is a forward-looking, irreversible operation. Credits already consumed
218
- * by usage remain unaffected — only the remaining balance is forfeited. The grant
219
- * reads as `voided` status afterwards. Payment state is not adjusted when
220
- * `payment_adjustment` is `none`, so invoice-backed or externally collected
221
- * payments may still collect the original amount. Only `active` grants can be
222
- * voided; voiding a pending, expired, or fully consumed grant returns a conflict.
223
- * Retrying a successful void is an idempotent success.
224
- *
225
- * POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
226
- */
227
- void(request: VoidCreditGrantRequest, options?: RequestOptions): Promise<VoidCreditGrantResponse>;
228
- }
229
- export declare class InternalCustomersCharges {
230
- private readonly _client;
231
- constructor(_client: Client);
232
- /**
233
- * List customer charges
234
- *
235
- * List customer charges.
236
- *
237
- * Returns the customer's charges that are represented as either flat fee or
238
- * usage-based charges.
239
- *
240
- * GET /openmeter/customers/{customerId}/charges
241
- */
242
- list(request: ListCustomerChargesRequest, options?: RequestOptions): Promise<ListCustomerChargesResponse>;
243
- /**
244
- * List customer charges
245
- *
246
- * List customer charges.
247
- *
248
- * Returns the customer's charges that are represented as either flat fee or
249
- * usage-based charges.
250
- *
251
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
252
- *
253
- * GET /openmeter/customers/{customerId}/charges
254
- */
255
- listAll(request: ListCustomerChargesRequest, options?: RequestOptions): AsyncIterable<Charge>;
256
- /**
257
- * Create customer charge
258
- *
259
- * Create customer charge.
260
- *
261
- * POST /openmeter/customers/{customerId}/charges
262
- */
263
- create(request: CreateCustomerChargesRequest, options?: RequestOptions): Promise<CreateCustomerChargesResponse>;
264
- }
265
- export declare class InternalEntitlements {
266
- private readonly _client;
267
- constructor(_client: Client);
268
- /**
269
- * Get customer entitlement access
270
- *
271
- * Get the customer's access to a single feature.
272
- *
273
- * GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
274
- */
275
- getCustomerAccess(request: GetCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<GetCustomerEntitlementAccessResponse>;
276
- /**
277
- * Get customer entitlement value by feature key
278
- *
279
- * Get the customer's entitlement value for a feature at a point in time. Without
280
- * an active entitlement, the result denies access and omits the type.
281
- *
282
- * GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}/value
283
- */
284
- getCustomerValueByFeatureKey(request: GetCustomerEntitlementValueByFeatureKeyRequest, options?: RequestOptions): Promise<GetCustomerEntitlementValueByFeatureKeyResponse>;
285
- /**
286
- * List entitlements
287
- *
288
- * List the active entitlements of all customers. Intended for administrative use.
289
- * To list the entitlements of a single customer, use the customer entitlements
290
- * endpoints; to check entitlement access, use the entitlement access endpoints.
291
- *
292
- * GET /openmeter/entitlements
293
- */
294
- list(request?: ListEntitlementsRequest, options?: RequestOptions): Promise<ListEntitlementsResponse>;
295
- /**
296
- * List entitlements
297
- *
298
- * List the active entitlements of all customers. Intended for administrative use.
299
- * To list the entitlements of a single customer, use the customer entitlements
300
- * endpoints; to check entitlement access, use the entitlement access endpoints.
301
- *
302
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
303
- *
304
- * GET /openmeter/entitlements
305
- */
306
- listAll(request?: ListEntitlementsRequest, options?: RequestOptions): AsyncIterable<Entitlement>;
307
- /**
308
- * Get entitlement
309
- *
310
- * Get an entitlement by ID. To check entitlement access, use the entitlement
311
- * access endpoints instead.
312
- *
313
- * GET /openmeter/entitlements/{entitlementId}
314
- */
315
- get(request: GetEntitlementRequest, options?: RequestOptions): Promise<GetEntitlementResponse>;
316
- /**
317
- * Get customer entitlement value
318
- *
319
- * Get the customer's access through a single entitlement, optionally evaluated at
320
- * a point in time.
321
- *
322
- * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/value
323
- */
324
- getCustomerValue(request: GetCustomerEntitlementValueRequest, options?: RequestOptions): Promise<GetCustomerEntitlementValueResponse>;
325
- }
326
- export declare class InternalGrants {
327
- private readonly _client;
328
- constructor(_client: Client);
329
- /**
330
- * List grants
331
- *
332
- * List the grants of all customers and entitlements. To list the grants of a
333
- * single entitlement, use the customer entitlement grants endpoint.
334
- *
335
- * Deleted grants are excluded unless `include_deleted` is set. Voided and expired
336
- * grants are always included, as they are part of the balance history.
337
- *
338
- * GET /openmeter/grants
339
- */
340
- list(request?: ListGrantsRequest, options?: RequestOptions): Promise<ListGrantsResponse>;
341
- /**
342
- * List grants
343
- *
344
- * List the grants of all customers and entitlements. To list the grants of a
345
- * single entitlement, use the customer entitlement grants endpoint.
346
- *
347
- * Deleted grants are excluded unless `include_deleted` is set. Voided and expired
348
- * grants are always included, as they are part of the balance history.
349
- *
350
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
351
- *
352
- * GET /openmeter/grants
353
- */
354
- listAll(request?: ListGrantsRequest, options?: RequestOptions): AsyncIterable<EntitlementGrant>;
355
- /**
356
- * Void grant
357
- *
358
- * Void a grant so it no longer adds to the balance. Usage already deducted from
359
- * the grant is kept.
360
- *
361
- * DELETE /openmeter/grants/{grantId}
362
- */
363
- void(request: VoidGrantRequest, options?: RequestOptions): Promise<VoidGrantResponse>;
364
14
  }
365
15
  export declare class InternalSubscriptions {
366
16
  private readonly _client;
367
17
  constructor(_client: Client);
368
- /**
369
- * Unschedule subscription
370
- *
371
- * Deletes a scheduled subscription that has not yet become active, removing it and
372
- * resolving any scheduling conflict it was holding. This is distinct from
373
- * canceling: cancel ends a running subscription, whereas unscheduling removes a
374
- * not-yet-active one. Only scheduled subscriptions can be unscheduled;
375
- * unscheduling an active or already-started subscription is rejected.
376
- *
377
- * POST /openmeter/subscriptions/{subscriptionId}/unschedule
378
- */
379
- unschedule(request: UnscheduleSubscriptionRequest, options?: RequestOptions): Promise<UnscheduleSubscriptionResponse>;
380
- /**
381
- * Restore subscription
382
- *
383
- * Restores the subscription by deleting any later-scheduled successor
384
- * subscriptions and continuing this one indefinitely. This is the inverse of a
385
- * future-dated change, which schedules a successor. Restore is not available when
386
- * multi-subscription is enabled.
387
- *
388
- * POST /openmeter/subscriptions/{subscriptionId}/restore
389
- */
390
- restore(request: RestoreSubscriptionRequest, options?: RequestOptions): Promise<RestoreSubscriptionResponse>;
391
- /**
392
- * Migrate subscription
393
- *
394
- * Migrates to a later version of the current plan. With starting_phase omitted and
395
- * billing_anchor omitted or unchanged, migration amends the subscription in place:
396
- * unchanged items retain their service periods and both response entries have the
397
- * same ID. Existing addons must remain compatible with the target plan.
398
- * Incompatible phase timelines or billing settings return an error. Providing
399
- * starting_phase or a different billing_anchor explicitly requests replacement,
400
- * which resets the phase timeline, may produce billing adjustments, and does not
401
- * transfer addons. Custom subscriptions cannot be migrated.
402
- *
403
- * POST /openmeter/subscriptions/{subscriptionId}/migrate
404
- */
405
- migrate(request: MigrateSubscriptionRequest, options?: RequestOptions): Promise<MigrateSubscriptionResponse>;
406
18
  /**
407
19
  * Create a new subscription add-on
408
20
  *
@@ -422,370 +34,3 @@ export declare class InternalSubscriptions {
422
34
  */
423
35
  updateAddon(request: UpdateSubscriptionAddonRequest, options?: RequestOptions): Promise<UpdateSubscriptionAddonResponse>;
424
36
  }
425
- export declare class InternalApps {
426
- private readonly _client;
427
- constructor(_client: Client);
428
- /**
429
- * Uninstall app
430
- *
431
- * Uninstall an app by ID.
432
- *
433
- * DELETE /openmeter/apps/{appId}
434
- */
435
- uninstall(request: UninstallAppRequest, options?: RequestOptions): Promise<UninstallAppResponse>;
436
- /**
437
- * Update app
438
- *
439
- * Update an installed app.
440
- *
441
- * PUT /openmeter/apps/{appId}
442
- */
443
- update(request: UpdateAppRequest, options?: RequestOptions): Promise<UpdateAppResponse>;
444
- /**
445
- * List app catalog
446
- *
447
- * List available apps.
448
- *
449
- * GET /openmeter/app-catalog
450
- */
451
- listCatalog(request?: ListAppCatalogRequest, options?: RequestOptions): Promise<ListAppCatalogResponse>;
452
- /**
453
- * List app catalog
454
- *
455
- * List available apps.
456
- *
457
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
458
- *
459
- * GET /openmeter/app-catalog
460
- */
461
- listCatalogAll(request?: ListAppCatalogRequest, options?: RequestOptions): AsyncIterable<AppCatalogItem>;
462
- /**
463
- * Get app catalog item by type
464
- *
465
- * Get an app catalog item by type.
466
- *
467
- * GET /openmeter/app-catalog/{appType}
468
- */
469
- getCatalogItem(request: GetAppCatalogItemRequest, options?: RequestOptions): Promise<GetAppCatalogItemResponse>;
470
- /**
471
- * Install app from the catalog
472
- *
473
- * Install an app from the catalog.
474
- *
475
- * POST /openmeter/app-catalog/install
476
- */
477
- install(request: InstallAppRequest, options?: RequestOptions): Promise<InstallAppResponse>;
478
- }
479
- export declare class InternalInvoices {
480
- private readonly _client;
481
- constructor(_client: Client);
482
- /**
483
- * List billing invoices
484
- *
485
- * List billing invoices.
486
- *
487
- * Returns a page of invoices. Gathering invoices are never included. Use `filter`
488
- * to narrow by status, customer, dates, or service period start. Use `sort` to
489
- * control ordering.
490
- *
491
- * GET /openmeter/billing/invoices
492
- */
493
- list(request?: ListInvoicesRequest, options?: RequestOptions): Promise<ListInvoicesResponse>;
494
- /**
495
- * List billing invoices
496
- *
497
- * List billing invoices.
498
- *
499
- * Returns a page of invoices. Gathering invoices are never included. Use `filter`
500
- * to narrow by status, customer, dates, or service period start. Use `sort` to
501
- * control ordering.
502
- *
503
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
504
- *
505
- * GET /openmeter/billing/invoices
506
- */
507
- listAll(request?: ListInvoicesRequest, options?: RequestOptions): AsyncIterable<Invoice>;
508
- /**
509
- * Get a billing invoice
510
- *
511
- * Get a billing invoice by ID.
512
- *
513
- * Returns the full invoice resource including line items, status details, totals,
514
- * and workflow configuration snapshot.
515
- *
516
- * GET /openmeter/billing/invoices/{invoiceId}
517
- */
518
- get(request: GetInvoiceRequest, options?: RequestOptions): Promise<GetInvoiceResponse>;
519
- /**
520
- * Update a billing invoice
521
- *
522
- * Update a billing invoice.
523
- *
524
- * Only the mutable fields of the invoice can be edited: description, labels,
525
- * supplier, customer, workflow settings, and top-level lines. Top-level lines are
526
- * matched by `id`; lines without an `id` are created, and existing lines omitted
527
- * from `lines` are deleted. Detailed (child) lines are always computed and cannot
528
- * be edited directly. Only invoices in draft status can be updated.
529
- *
530
- * PUT /openmeter/billing/invoices/{invoiceId}
531
- */
532
- update(request: UpdateInvoiceRequest, options?: RequestOptions): Promise<UpdateInvoiceResponse>;
533
- /**
534
- * Delete a billing invoice
535
- *
536
- * Delete a billing invoice.
537
- *
538
- * Only standard invoices in draft status can be deleted. Deleting an invoice will
539
- * also delete all associated line items and workflow configuration.
540
- *
541
- * DELETE /openmeter/billing/invoices/{invoiceId}
542
- */
543
- delete(request: DeleteInvoiceRequest, options?: RequestOptions): Promise<DeleteInvoiceResponse>;
544
- /**
545
- * Advance billing invoice's next status
546
- *
547
- * Advance a billing invoice.
548
- *
549
- * Advances the invoice to the next workflow state. The next state is determined by
550
- * the invoice's current status and workflow configuration. Only invoices in draft
551
- * or issued status can be advanced.
552
- *
553
- * POST /openmeter/billing/invoices/{invoiceId}/advance
554
- */
555
- advance(request: AdvanceInvoiceRequest, options?: RequestOptions): Promise<AdvanceInvoiceResponse>;
556
- /**
557
- * Send the invoice to the customer
558
- *
559
- * Approve a billing invoice.
560
- *
561
- * This call instantly sends the invoice to the customer using the configured
562
- * billing profile app.
563
- *
564
- * This call is valid in two invoice statuses:
565
- *
566
- * - draft: the invoice will be sent to the customer, the invoice state becomes
567
- * issued
568
- * - manual_approval_needed: the invoice will be sent to the customer, the invoice
569
- * state becomes issued
570
- *
571
- * POST /openmeter/billing/invoices/{invoiceId}/approve
572
- */
573
- approve(request: ApproveInvoiceRequest, options?: RequestOptions): Promise<ApproveInvoiceResponse>;
574
- /**
575
- * Retry advancing the invoice after a failed attempt
576
- *
577
- * Retry sending a billing invoice.
578
- *
579
- * Retry advancing the invoice after a failed attempt.
580
- *
581
- * The action can be called when the invoice's statusDetails' actions field contain
582
- * the "retry" action.
583
- *
584
- * POST /openmeter/billing/invoices/{invoiceId}/retry
585
- */
586
- retry(request: RetryInvoiceRequest, options?: RequestOptions): Promise<RetryInvoiceResponse>;
587
- /**
588
- * Snapshot quantities for usage based line items
589
- *
590
- * Snapshot quantities for usage-based line items.
591
- *
592
- * This call will snapshot the quantities for all usage based line items in the
593
- * invoice.
594
- *
595
- * This call is only valid in draft.waiting_for_collection status, where the
596
- * collection period can be skipped using this action.
597
- *
598
- * POST /openmeter/billing/invoices/{invoiceId}/snapshot-quantities
599
- */
600
- snapshotQuantities(request: SnapshotQuantitiesInvoiceRequest, options?: RequestOptions): Promise<SnapshotQuantitiesInvoiceResponse>;
601
- }
602
- export declare class InternalCharges {
603
- private readonly _client;
604
- constructor(_client: Client);
605
- /**
606
- * List charges
607
- *
608
- * List charges.
609
- *
610
- * Returns the charges of every customer that are represented as either flat fee or
611
- * usage-based charges.
612
- *
613
- * GET /openmeter/charges
614
- */
615
- list(request?: ListChargesRequest, options?: RequestOptions): Promise<ListChargesResponse>;
616
- /**
617
- * List charges
618
- *
619
- * List charges.
620
- *
621
- * Returns the charges of every customer that are represented as either flat fee or
622
- * usage-based charges.
623
- *
624
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
625
- *
626
- * GET /openmeter/charges
627
- */
628
- listAll(request?: ListChargesRequest, options?: RequestOptions): AsyncIterable<Charge>;
629
- }
630
- export declare class InternalCurrencies {
631
- private readonly _client;
632
- constructor(_client: Client);
633
- /**
634
- * List currencies
635
- *
636
- * List currencies supported by the billing system.
637
- *
638
- * GET /openmeter/currencies
639
- */
640
- list(request?: ListCurrenciesRequest, options?: RequestOptions): Promise<ListCurrenciesResponse>;
641
- /**
642
- * List currencies
643
- *
644
- * List currencies supported by the billing system.
645
- *
646
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
647
- *
648
- * GET /openmeter/currencies
649
- */
650
- listAll(request?: ListCurrenciesRequest, options?: RequestOptions): AsyncIterable<Currency>;
651
- /**
652
- * Create custom currency
653
- *
654
- * Create a custom currency. This operation allows defining your own custom
655
- * currency for billing purposes.
656
- *
657
- * POST /openmeter/currencies/custom
658
- */
659
- createCustomCurrency(request: CreateCustomCurrencyRequest, options?: RequestOptions): Promise<CreateCustomCurrencyResponse>;
660
- /**
661
- * Get custom currency
662
- *
663
- * Get a custom currency.
664
- *
665
- * GET /openmeter/currencies/custom/{currencyId}
666
- */
667
- getCustomCurrency(request: GetCustomCurrencyRequest, options?: RequestOptions): Promise<GetCustomCurrencyResponse>;
668
- /**
669
- * List cost bases
670
- *
671
- * List cost bases for a currency. For custom currencies, there can be multiple
672
- * cost bases with different `effective_from` dates.
673
- *
674
- * GET /openmeter/currencies/custom/{currencyId}/cost-bases
675
- */
676
- listCostBases(request: ListCostBasesRequest, options?: RequestOptions): Promise<ListCostBasesResponse>;
677
- /**
678
- * List cost bases
679
- *
680
- * List cost bases for a currency. For custom currencies, there can be multiple
681
- * cost bases with different `effective_from` dates.
682
- *
683
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
684
- *
685
- * GET /openmeter/currencies/custom/{currencyId}/cost-bases
686
- */
687
- listCostBasesAll(request: ListCostBasesRequest, options?: RequestOptions): AsyncIterable<CostBasis>;
688
- /**
689
- * Create cost basis
690
- *
691
- * Create a cost basis for a currency.
692
- *
693
- * POST /openmeter/currencies/custom/{currencyId}/cost-bases
694
- */
695
- createCostBasis(request: CreateCostBasisRequest, options?: RequestOptions): Promise<CreateCostBasisResponse>;
696
- }
697
- export declare class InternalPlanAddons {
698
- private readonly _client;
699
- constructor(_client: Client);
700
- /**
701
- * List add-ons for plan
702
- *
703
- * List add-ons associated with a plan.
704
- *
705
- * GET /openmeter/plans/{planId}/addons
706
- */
707
- list(request: ListPlanAddonsRequest, options?: RequestOptions): Promise<ListPlanAddonsResponse>;
708
- /**
709
- * List add-ons for plan
710
- *
711
- * List add-ons associated with a plan.
712
- *
713
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
714
- *
715
- * GET /openmeter/plans/{planId}/addons
716
- */
717
- listAll(request: ListPlanAddonsRequest, options?: RequestOptions): AsyncIterable<PlanAddon>;
718
- }
719
- export declare class InternalEntitlementAccess {
720
- private readonly _client;
721
- constructor(_client: Client);
722
- /**
723
- * Query entitlement access
724
- *
725
- * Query feature access for a list of customers.
726
- *
727
- * The endpoint resolves each provided identifier to a customer and returns the
728
- * access status for the requested features, plus optional credit balance
729
- * availability.
730
- *
731
- * _Designed to be called on a fixed refresh interval and the query response is
732
- * intended to be cached._
733
- *
734
- * POST /openmeter/entitlement-access/query
735
- */
736
- query(request: QueryEntitlementAccessRequest, options?: RequestOptions): Promise<QueryEntitlementAccessResponse>;
737
- }
738
- export declare class InternalNotifications {
739
- private readonly _client;
740
- constructor(_client: Client);
741
- /**
742
- * List notification channels
743
- *
744
- * List all notification channels.
745
- *
746
- * GET /openmeter/notification/channels
747
- */
748
- listChannels(request?: ListNotificationChannelsRequest, options?: RequestOptions): Promise<ListNotificationChannelsResponse>;
749
- /**
750
- * List notification channels
751
- *
752
- * List all notification channels.
753
- *
754
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
755
- *
756
- * GET /openmeter/notification/channels
757
- */
758
- listChannelsAll(request?: ListNotificationChannelsRequest, options?: RequestOptions): AsyncIterable<NotificationChannel>;
759
- /**
760
- * Create notification channel
761
- *
762
- * Create a notification channel.
763
- *
764
- * POST /openmeter/notification/channels
765
- */
766
- createChannel(request: CreateNotificationChannelRequest, options?: RequestOptions): Promise<CreateNotificationChannelResponse>;
767
- /**
768
- * Get notification channel
769
- *
770
- * Get a notification channel by id.
771
- *
772
- * GET /openmeter/notification/channels/{notificationChannelId}
773
- */
774
- getChannel(request: GetNotificationChannelRequest, options?: RequestOptions): Promise<GetNotificationChannelResponse>;
775
- /**
776
- * Update notification channel
777
- *
778
- * Update a notification channel by id.
779
- *
780
- * PUT /openmeter/notification/channels/{notificationChannelId}
781
- */
782
- updateChannel(request: UpdateNotificationChannelRequest, options?: RequestOptions): Promise<UpdateNotificationChannelResponse>;
783
- /**
784
- * Delete notification channel
785
- *
786
- * Delete a notification channel by id.
787
- *
788
- * DELETE /openmeter/notification/channels/{notificationChannelId}
789
- */
790
- deleteChannel(request: DeleteNotificationChannelRequest, options?: RequestOptions): Promise<DeleteNotificationChannelResponse>;
791
- }