@openmeter/client 1.0.0-beta.237 → 1.0.0-beta.238

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.
@@ -6,8 +6,11 @@
6
6
  * "mesh", "kic", or "\_".
7
7
  */
8
8
  export type Labels = Record<string, string>;
9
- /** Determines which page of the collection to retrieve. */
10
- export interface CursorPaginationQueryPage {
9
+ /**
10
+ * Determines which page of the metering event list to retrieve. A page holds at
11
+ * most 100 events.
12
+ */
13
+ export interface ListEventsPage {
11
14
  /** The number of items to include per page. */
12
15
  size?: number;
13
16
  /** Request the next page of data, starting with the item after this parameter. */
@@ -169,6 +172,15 @@ export interface VersionFilter {
169
172
  /** Match this version and earlier versions. */
170
173
  lte?: number;
171
174
  }
175
+ /** Determines which page of the collection to retrieve. */
176
+ export interface CursorPaginationQueryPage {
177
+ /** The number of items to include per page. */
178
+ size?: number;
179
+ /** Request the next page of data, starting with the item after this parameter. */
180
+ after?: string;
181
+ /** Request the previous page of data, starting with the item before this parameter. */
182
+ before?: string;
183
+ }
172
184
  /** Free price. */
173
185
  export interface PriceFree {
174
186
  /** The type of the price. */
@@ -406,6 +418,18 @@ export interface ProductCatalogValidationError {
406
418
  /** The path to the field. */
407
419
  field: string;
408
420
  }
421
+ /**
422
+ * Determines which page of the entitlement access query to retrieve. A page holds
423
+ * at most 100 customers.
424
+ */
425
+ export interface EntitlementAccessQueryPage {
426
+ /** The number of items to include per page. */
427
+ size?: number;
428
+ /** Request the next page of data, starting with the item after this parameter. */
429
+ after?: string;
430
+ /** Request the previous page of data, starting with the item before this parameter. */
431
+ before?: string;
432
+ }
409
433
  /** List of customer identifiers to evaluate access for. */
410
434
  export interface EntitlementAccessQueryRequestCustomers {
411
435
  /**
@@ -1176,9 +1200,13 @@ export interface QueryFilterNumeric {
1176
1200
  /** Combines the provided filters with a logical OR. */
1177
1201
  or?: QueryFilterNumeric[];
1178
1202
  }
1179
- /** Cursor page query. */
1180
- export interface CursorPaginationQuery {
1181
- page?: CursorPaginationQueryPage;
1203
+ /**
1204
+ * Cursor pagination for the metering event list, with a smaller page size limit
1205
+ * than the common one.
1206
+ */
1207
+ export interface ListEventsPagination {
1208
+ /** Determines which page of the collection to retrieve. */
1209
+ page?: ListEventsPage;
1182
1210
  }
1183
1211
  /** Filter options for listing meters. */
1184
1212
  export interface ListMetersParamsFilter {
@@ -2303,6 +2331,10 @@ export interface VoidCreditGrantRequest {
2303
2331
  */
2304
2332
  paymentAdjustment: 'none';
2305
2333
  }
2334
+ /** Cursor page query. */
2335
+ export interface CursorPaginationQuery {
2336
+ page?: CursorPaginationQueryPage;
2337
+ }
2306
2338
  /** The pro-rating configuration of a subscription. */
2307
2339
  export interface SubscriptionProRatingConfig {
2308
2340
  /** Whether pro-rating is enabled. */
@@ -2584,6 +2616,14 @@ export interface ListCurrenciesParamsFilter {
2584
2616
  type?: 'fiat' | 'custom';
2585
2617
  code?: StringFieldFilter;
2586
2618
  }
2619
+ /**
2620
+ * Cursor pagination for the entitlement access query, with a smaller page size
2621
+ * limit than the common one.
2622
+ */
2623
+ export interface EntitlementAccessQueryPagination {
2624
+ /** Determines which page of the collection to retrieve. */
2625
+ page?: EntitlementAccessQueryPage;
2626
+ }
2587
2627
  /** Query to evaluate feature access for a list of customers. */
2588
2628
  export interface EntitlementAccessQueryRequest {
2589
2629
  /**
@@ -4114,6 +4154,11 @@ export interface ListChargesParamsFilter {
4114
4154
  servicePeriodTo?: DateTimeFieldFilter;
4115
4155
  /** Filter charges by the ID of their customer. */
4116
4156
  customerId?: UlidFieldFilter;
4157
+ /**
4158
+ * Filter charges by the ID of their subscription. Only charges linked to a
4159
+ * subscription can match, including when using `neq`.
4160
+ */
4161
+ subscriptionId?: UlidFieldFilter;
4117
4162
  }
4118
4163
  /** Filter options for listing notification channels. */
4119
4164
  export interface ListNotificationChannelsParamsFilter {
@@ -4898,6 +4943,21 @@ export interface SubscriptionBase {
4898
4943
  * - Custom date (customer-specified day)
4899
4944
  */
4900
4945
  billingAnchor: Date;
4946
+ /**
4947
+ * When billing starts for the subscription. Nothing is billed for service before
4948
+ * this time, while access, entitlements and metering start with the subscription.
4949
+ * Use it when the time before was already billed elsewhere, for example when
4950
+ * importing a subscription from another billing system.
4951
+ *
4952
+ * It cannot be before the start of the subscription and cannot be changed later.
4953
+ * On subscriptions billed through invoice lines it must be the start of a billing
4954
+ * period. If not provided, billing starts with the subscription.
4955
+ *
4956
+ * When billing starts inside a billing period, we recommend enabling price
4957
+ * pro-rating (`prorate_prices`) on the plan. Without it that billing period's flat
4958
+ * fees are billed in full.
4959
+ */
4960
+ billingStartsAt?: Date;
4901
4961
  /** The status of the subscription. */
4902
4962
  status: 'active' | 'inactive' | 'canceled' | 'scheduled';
4903
4963
  /**
@@ -8616,6 +8676,21 @@ export interface Subscription {
8616
8676
  * - Custom date (customer-specified day)
8617
8677
  */
8618
8678
  billingAnchor: Date;
8679
+ /**
8680
+ * When billing starts for the subscription. Nothing is billed for service before
8681
+ * this time, while access, entitlements and metering start with the subscription.
8682
+ * Use it when the time before was already billed elsewhere, for example when
8683
+ * importing a subscription from another billing system.
8684
+ *
8685
+ * It cannot be before the start of the subscription and cannot be changed later.
8686
+ * On subscriptions billed through invoice lines it must be the start of a billing
8687
+ * period. If not provided, billing starts with the subscription.
8688
+ *
8689
+ * When billing starts inside a billing period, we recommend enabling price
8690
+ * pro-rating (`prorate_prices`) on the plan. Without it that billing period's flat
8691
+ * fees are billed in full.
8692
+ */
8693
+ billingStartsAt?: Date;
8619
8694
  /** The status of the subscription. */
8620
8695
  status: 'active' | 'inactive' | 'canceled' | 'scheduled';
8621
8696
  /**
@@ -8641,6 +8716,21 @@ export interface Subscription {
8641
8716
  }
8642
8717
  export interface SubscriptionCreate {
8643
8718
  labels?: Labels;
8719
+ /**
8720
+ * When billing starts for the subscription. Nothing is billed for service before
8721
+ * this time, while access, entitlements and metering start with the subscription.
8722
+ * Use it when the time before was already billed elsewhere, for example when
8723
+ * importing a subscription from another billing system.
8724
+ *
8725
+ * It cannot be before the start of the subscription and cannot be changed later.
8726
+ * On subscriptions billed through invoice lines it must be the start of a billing
8727
+ * period. If not provided, billing starts with the subscription.
8728
+ *
8729
+ * When billing starts inside a billing period, we recommend enabling price
8730
+ * pro-rating (`prorate_prices`) on the plan. Without it that billing period's flat
8731
+ * fees are billed in full.
8732
+ */
8733
+ billingStartsAt?: Date;
8644
8734
  /**
8645
8735
  * Settlement mode for billing.
8646
8736
  *
@@ -10533,6 +10623,21 @@ export interface SubscriptionBaseInput {
10533
10623
  * - Custom date (customer-specified day)
10534
10624
  */
10535
10625
  billingAnchor: Date;
10626
+ /**
10627
+ * When billing starts for the subscription. Nothing is billed for service before
10628
+ * this time, while access, entitlements and metering start with the subscription.
10629
+ * Use it when the time before was already billed elsewhere, for example when
10630
+ * importing a subscription from another billing system.
10631
+ *
10632
+ * It cannot be before the start of the subscription and cannot be changed later.
10633
+ * On subscriptions billed through invoice lines it must be the start of a billing
10634
+ * period. If not provided, billing starts with the subscription.
10635
+ *
10636
+ * When billing starts inside a billing period, we recommend enabling price
10637
+ * pro-rating (`prorate_prices`) on the plan. Without it that billing period's flat
10638
+ * fees are billed in full.
10639
+ */
10640
+ billingStartsAt?: Date;
10536
10641
  /** The status of the subscription. */
10537
10642
  status: 'active' | 'inactive' | 'canceled' | 'scheduled';
10538
10643
  /**
@@ -12217,6 +12322,21 @@ export interface SubscriptionInput {
12217
12322
  * - Custom date (customer-specified day)
12218
12323
  */
12219
12324
  billingAnchor: Date;
12325
+ /**
12326
+ * When billing starts for the subscription. Nothing is billed for service before
12327
+ * this time, while access, entitlements and metering start with the subscription.
12328
+ * Use it when the time before was already billed elsewhere, for example when
12329
+ * importing a subscription from another billing system.
12330
+ *
12331
+ * It cannot be before the start of the subscription and cannot be changed later.
12332
+ * On subscriptions billed through invoice lines it must be the start of a billing
12333
+ * period. If not provided, billing starts with the subscription.
12334
+ *
12335
+ * When billing starts inside a billing period, we recommend enabling price
12336
+ * pro-rating (`prorate_prices`) on the plan. Without it that billing period's flat
12337
+ * fees are billed in full.
12338
+ */
12339
+ billingStartsAt?: Date;
12220
12340
  /** The status of the subscription. */
12221
12341
  status: 'active' | 'inactive' | 'canceled' | 'scheduled';
12222
12342
  /**
@@ -12242,6 +12362,21 @@ export interface SubscriptionInput {
12242
12362
  }
12243
12363
  export interface SubscriptionCreateInput {
12244
12364
  labels?: Labels;
12365
+ /**
12366
+ * When billing starts for the subscription. Nothing is billed for service before
12367
+ * this time, while access, entitlements and metering start with the subscription.
12368
+ * Use it when the time before was already billed elsewhere, for example when
12369
+ * importing a subscription from another billing system.
12370
+ *
12371
+ * It cannot be before the start of the subscription and cannot be changed later.
12372
+ * On subscriptions billed through invoice lines it must be the start of a billing
12373
+ * period. If not provided, billing starts with the subscription.
12374
+ *
12375
+ * When billing starts inside a billing period, we recommend enabling price
12376
+ * pro-rating (`prorate_prices`) on the plan. Without it that billing period's flat
12377
+ * fees are billed in full.
12378
+ */
12379
+ billingStartsAt?: Date;
12245
12380
  /**
12246
12381
  * Settlement mode for billing.
12247
12382
  *
@@ -1,10 +1,20 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { ListChargesRequest, ListChargesResponse } from '../models/operations/charges.js';
3
+ import type { GetChargeRequest, GetChargeResponse, ListChargesRequest, ListChargesResponse } from '../models/operations/charges.js';
4
4
  import type { Charge } from '../models/types.js';
5
5
  export declare class Charges {
6
6
  private readonly _client;
7
7
  constructor(_client: Client);
8
+ /**
9
+ * Get charge
10
+ *
11
+ * Get a flat fee or usage-based charge by ID.
12
+ *
13
+ * Deleted charges are returned with their status and realization history.
14
+ *
15
+ * GET /openmeter/charges/{chargeId}
16
+ */
17
+ get(request: GetChargeRequest, options?: RequestOptions): Promise<GetChargeResponse>;
8
18
  /**
9
19
  * List charges
10
20
  *
@@ -1,12 +1,24 @@
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 { listCharges } from '../funcs/charges.js';
4
+ import { getCharge, listCharges } from '../funcs/charges.js';
5
5
  export class Charges {
6
6
  _client;
7
7
  constructor(_client) {
8
8
  this._client = _client;
9
9
  }
10
+ /**
11
+ * Get charge
12
+ *
13
+ * Get a flat fee or usage-based charge by ID.
14
+ *
15
+ * Deleted charges are returned with their status and realization history.
16
+ *
17
+ * GET /openmeter/charges/{chargeId}
18
+ */
19
+ async get(request, options) {
20
+ return unwrap(await getCharge(this._client, request, options));
21
+ }
10
22
  /**
11
23
  * List charges
12
24
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta.237",
3
+ "version": "1.0.0-beta.238",
4
4
  "description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
5
5
  "keywords": [
6
6
  "openmeter",