@openmeter/client 1.0.0-beta-bb2cf2b95d67 → 1.0.0-beta-4e7660203681

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.
@@ -2402,6 +2402,15 @@ export const listEventsParamsFilter = z
2402
2402
  stored_at: dateTimeFieldFilter.optional(),
2403
2403
  })
2404
2404
  .describe('Filter options for listing ingested events.');
2405
+ export const listInvoicesParamsFilter = z
2406
+ .object({
2407
+ status: stringFieldFilterExact.optional(),
2408
+ customer_id: ulidFieldFilter.optional(),
2409
+ issued_at: dateTimeFieldFilter.optional(),
2410
+ service_period_start: dateTimeFieldFilter.optional(),
2411
+ created_at: dateTimeFieldFilter.optional(),
2412
+ })
2413
+ .describe('Filter options for listing invoices.');
2405
2414
  export const resourceFilters = z
2406
2415
  .object({
2407
2416
  name: stringFieldFilter.optional(),
@@ -3917,6 +3926,12 @@ export const invoiceStandard = z
3917
3926
  export const invoice = z
3918
3927
  .discriminatedUnion('type', [invoiceStandard])
3919
3928
  .describe('An invoice issued to a customer. The `type` field determines the concrete variant: - `standard`: a standard invoice for charges owed.');
3929
+ export const invoicePagePaginatedResponse = z
3930
+ .object({
3931
+ data: z.array(invoice),
3932
+ meta: paginatedMeta,
3933
+ })
3934
+ .describe('Page paginated response.');
3920
3935
  export const listMeteringEventsQueryParams = z.object({
3921
3936
  page: cursorPaginationQueryPage.optional(),
3922
3937
  filter: listEventsParamsFilter.optional(),
@@ -4244,6 +4259,25 @@ export const updateBillingProfileResponse = profile;
4244
4259
  export const deleteBillingProfilePathParams = z.object({
4245
4260
  id: ulid,
4246
4261
  });
4262
+ export const listInvoicesQueryParams = z.object({
4263
+ page: z
4264
+ .object({
4265
+ size: z.coerce
4266
+ .number()
4267
+ .int()
4268
+ .optional()
4269
+ .describe('The number of items to include per page.'),
4270
+ number: z.coerce.number().int().optional().describe('The page number.'),
4271
+ })
4272
+ .optional()
4273
+ .describe('Determines which page of the collection to retrieve.'),
4274
+ sort: sortQuery.optional(),
4275
+ filter: listInvoicesParamsFilter.optional(),
4276
+ });
4277
+ export const listInvoicesResponse = z.object({
4278
+ data: z.array(invoice),
4279
+ meta: paginatedMeta,
4280
+ });
4247
4281
  export const getInvoicePathParams = z.object({
4248
4282
  invoiceId: ulid,
4249
4283
  });
@@ -2655,6 +2655,45 @@ export interface ListEventsParamsFilter {
2655
2655
  gte?: string;
2656
2656
  };
2657
2657
  }
2658
+ /** Filter options for listing invoices. */
2659
+ export interface ListInvoicesParamsFilter {
2660
+ /** Filter by invoice status. */
2661
+ status?: string | {
2662
+ eq?: string;
2663
+ oeq?: string[];
2664
+ neq?: string;
2665
+ };
2666
+ /** Filter by customer ID. */
2667
+ customer_id?: string | {
2668
+ eq?: string;
2669
+ oeq?: string[];
2670
+ neq?: string;
2671
+ };
2672
+ /** Filter by the time the invoice was issued. */
2673
+ issued_at?: string | {
2674
+ eq?: string;
2675
+ lt?: string;
2676
+ lte?: string;
2677
+ gt?: string;
2678
+ gte?: string;
2679
+ };
2680
+ /** Filter by service period start. */
2681
+ service_period_start?: string | {
2682
+ eq?: string;
2683
+ lt?: string;
2684
+ lte?: string;
2685
+ gt?: string;
2686
+ gte?: string;
2687
+ };
2688
+ /** Filter by invoice creation time. */
2689
+ created_at?: string | {
2690
+ eq?: string;
2691
+ lt?: string;
2692
+ lte?: string;
2693
+ gt?: string;
2694
+ gte?: string;
2695
+ };
2696
+ }
2658
2697
  /** Resource filters. */
2659
2698
  export interface ResourceFilters {
2660
2699
  name?: string | {
@@ -4846,6 +4885,11 @@ export interface InvoiceStandard {
4846
4885
  */
4847
4886
  lines?: InvoiceStandardLine[];
4848
4887
  }
4888
+ /** Page paginated response. */
4889
+ export interface InvoicePagePaginatedResponse {
4890
+ data: InvoiceStandard[];
4891
+ meta: PaginatedMeta;
4892
+ }
4849
4893
  export interface SortQueryInput {
4850
4894
  /** The attribute to sort by. */
4851
4895
  by: string;
@@ -6070,4 +6114,8 @@ export interface InvoiceStandardInput {
6070
6114
  */
6071
6115
  lines?: InvoiceStandardLineInput[];
6072
6116
  }
6117
+ export interface InvoicePagePaginatedResponseInput {
6118
+ data: InvoiceStandardInput[];
6119
+ meta: PaginatedMeta;
6120
+ }
6073
6121
  //# sourceMappingURL=types.d.ts.map
@@ -1,9 +1,10 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { GetInvoiceRequest, GetInvoiceResponse } from '../models/operations/invoices.js';
3
+ import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse } from '../models/operations/invoices.js';
4
4
  export declare class Invoices {
5
5
  private readonly _client;
6
6
  constructor(_client: Client);
7
+ list(request?: ListInvoicesRequest, options?: RequestOptions): Promise<ListInvoicesResponse>;
7
8
  get(request: GetInvoiceRequest, options?: RequestOptions): Promise<GetInvoiceResponse>;
8
9
  }
9
10
  //# sourceMappingURL=invoices.d.ts.map
@@ -1,10 +1,13 @@
1
1
  import { unwrap } from '../lib/types.js';
2
- import { getInvoice } from '../funcs/invoices.js';
2
+ import { listInvoices, getInvoice } from '../funcs/invoices.js';
3
3
  export class Invoices {
4
4
  _client;
5
5
  constructor(_client) {
6
6
  this._client = _client;
7
7
  }
8
+ async list(request, options) {
9
+ return unwrap(await listInvoices(this._client, request, options));
10
+ }
8
11
  async get(request, options) {
9
12
  return unwrap(await getInvoice(this._client, request, options));
10
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta-bb2cf2b95d67",
3
+ "version": "1.0.0-beta-4e7660203681",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://openmeter.io",
6
6
  "repository": {