@openmeter/client 1.0.0-beta-be2666bd959f → 1.0.0-beta-50d7ae9443a8

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 CHANGED
@@ -194,11 +194,12 @@ The full call path, HTTP route, and a short description are listed below.
194
194
 
195
195
  ### Invoices
196
196
 
197
- | Method | HTTP | Description |
198
- | ------------------------ | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
199
- | `client.invoices.list` | `GET /openmeter/billing/invoices` | List billing invoices. Returns a page of invoices. Gathering invoices are never included. Use `filter` to narrow by status, customer, dates, or service period start. Use `sort` to control ordering. |
200
- | `client.invoices.get` | `GET /openmeter/billing/invoices/{invoiceId}` | Get a billing invoice by ID. Returns the full invoice resource including line items, status details, totals, and workflow configuration snapshot. |
201
- | `client.invoices.update` | `PUT /openmeter/billing/invoices/{invoiceId}` | Update a billing invoice. Only the mutable fields of the invoice can be edited: description, labels, supplier, customer, workflow settings, and top-level lines. Top-level lines are matched by `id`; lines without an `id` are created, and existing lines omitted from `lines` are deleted. Detailed (child) lines are always computed and cannot be edited directly. Only invoices in draft status can be updated. |
197
+ | Method | HTTP | Description |
198
+ | ------------------------ | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
199
+ | `client.invoices.list` | `GET /openmeter/billing/invoices` | List billing invoices. Returns a page of invoices. Gathering invoices are never included. Use `filter` to narrow by status, customer, dates, or service period start. Use `sort` to control ordering. |
200
+ | `client.invoices.get` | `GET /openmeter/billing/invoices/{invoiceId}` | Get a billing invoice by ID. Returns the full invoice resource including line items, status details, totals, and workflow configuration snapshot. |
201
+ | `client.invoices.update` | `PUT /openmeter/billing/invoices/{invoiceId}` | Update a billing invoice. Only the mutable fields of the invoice can be edited: description, labels, supplier, customer, workflow settings, and top-level lines. Top-level lines are matched by `id`; lines without an `id` are created, and existing lines omitted from `lines` are deleted. Detailed (child) lines are always computed and cannot be edited directly. Only invoices in draft status can be updated. |
202
+ | `client.invoices.delete` | `DELETE /openmeter/billing/invoices/{invoiceId}` | Delete a billing invoice. Only standard invoices in draft status can be deleted. Deleting an invoice will also delete all associated line items and workflow configuration. |
202
203
 
203
204
  ### Tax
204
205
 
@@ -1,7 +1,8 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse } from '../models/operations/invoices.js';
3
+ import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse } from '../models/operations/invoices.js';
4
4
  export declare function listInvoices(client: Client, req?: ListInvoicesRequest, options?: RequestOptions): Promise<Result<ListInvoicesResponse>>;
5
5
  export declare function getInvoice(client: Client, req: GetInvoiceRequest, options?: RequestOptions): Promise<Result<GetInvoiceResponse>>;
6
6
  export declare function updateInvoice(client: Client, req: UpdateInvoiceRequest, options?: RequestOptions): Promise<Result<UpdateInvoiceResponse>>;
7
+ export declare function deleteInvoice(client: Client, req: DeleteInvoiceRequest, options?: RequestOptions): Promise<Result<DeleteInvoiceResponse>>;
7
8
  //# sourceMappingURL=invoices.d.ts.map
@@ -67,4 +67,15 @@ export function updateInvoice(client, req, options) {
67
67
  });
68
68
  });
69
69
  }
70
+ export function deleteInvoice(client, req, options) {
71
+ return request(async () => {
72
+ const path = `openmeter/billing/invoices/${(() => {
73
+ if (req.invoiceId === undefined) {
74
+ throw new Error('missing path parameter: invoiceId');
75
+ }
76
+ return encodeURIComponent(String(req.invoiceId));
77
+ })()}`;
78
+ await http(client).delete(path, options);
79
+ });
80
+ }
70
81
  //# sourceMappingURL=invoices.js.map
@@ -40,4 +40,8 @@ export type UpdateInvoiceRequest = {
40
40
  body: UpdateInvoiceStandardRequestInput;
41
41
  };
42
42
  export type UpdateInvoiceResponse = z.output<typeof schemas.updateInvoiceResponse>;
43
+ export type DeleteInvoiceRequest = {
44
+ invoiceId: string;
45
+ };
46
+ export type DeleteInvoiceResponse = void;
43
47
  //# sourceMappingURL=invoices.d.ts.map
@@ -14515,6 +14515,9 @@ export declare const updateInvoiceResponse: z.ZodDiscriminatedUnion<[z.ZodObject
14515
14515
  }, z.core.$strip>>;
14516
14516
  }, z.core.$strip>], "type">>>;
14517
14517
  }, z.core.$strip>], "type">;
14518
+ export declare const deleteInvoicePathParams: z.ZodObject<{
14519
+ invoiceId: z.ZodString;
14520
+ }, z.core.$strip>;
14518
14521
  export declare const createTaxCodeBody: z.ZodObject<{
14519
14522
  name: z.ZodString;
14520
14523
  description: z.ZodOptional<z.ZodString>;
@@ -32296,6 +32299,9 @@ export declare const updateInvoiceResponseWire: z.ZodDiscriminatedUnion<[z.ZodOb
32296
32299
  }, z.core.$strict>>;
32297
32300
  }, z.core.$strict>], "type">>>;
32298
32301
  }, z.core.$strict>], "type">;
32302
+ export declare const deleteInvoicePathParamsWire: z.ZodObject<{
32303
+ invoiceId: z.ZodString;
32304
+ }, z.core.$strip>;
32299
32305
  export declare const createTaxCodeBodyWire: z.ZodObject<{
32300
32306
  name: z.ZodString;
32301
32307
  description: z.ZodOptional<z.ZodString>;
@@ -4562,6 +4562,9 @@ export const updateInvoicePathParams = z.object({
4562
4562
  });
4563
4563
  export const updateInvoiceBody = updateInvoiceRequest;
4564
4564
  export const updateInvoiceResponse = invoice;
4565
+ export const deleteInvoicePathParams = z.object({
4566
+ invoiceId: ulid,
4567
+ });
4565
4568
  export const createTaxCodeBody = createTaxCodeRequest;
4566
4569
  export const createTaxCodeResponse = taxCode;
4567
4570
  export const getTaxCodePathParams = z.object({
@@ -9439,6 +9442,9 @@ export const updateInvoicePathParamsWire = z.object({
9439
9442
  });
9440
9443
  export const updateInvoiceBodyWire = updateInvoiceRequestWire;
9441
9444
  export const updateInvoiceResponseWire = invoiceWire;
9445
+ export const deleteInvoicePathParamsWire = z.object({
9446
+ invoiceId: ulidWire,
9447
+ });
9442
9448
  export const createTaxCodeBodyWire = createTaxCodeRequestWire;
9443
9449
  export const createTaxCodeResponseWire = taxCodeWire;
9444
9450
  export const getTaxCodePathParamsWire = z.object({
@@ -1,11 +1,12 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse } from '../models/operations/invoices.js';
3
+ import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse } from '../models/operations/invoices.js';
4
4
  export declare class Invoices {
5
5
  private readonly _client;
6
6
  constructor(_client: Client);
7
7
  list(request?: ListInvoicesRequest, options?: RequestOptions): Promise<ListInvoicesResponse>;
8
8
  get(request: GetInvoiceRequest, options?: RequestOptions): Promise<GetInvoiceResponse>;
9
9
  update(request: UpdateInvoiceRequest, options?: RequestOptions): Promise<UpdateInvoiceResponse>;
10
+ delete(request: DeleteInvoiceRequest, options?: RequestOptions): Promise<DeleteInvoiceResponse>;
10
11
  }
11
12
  //# sourceMappingURL=invoices.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { unwrap } from '../lib/types.js';
2
- import { listInvoices, getInvoice, updateInvoice } from '../funcs/invoices.js';
2
+ import { listInvoices, getInvoice, updateInvoice, deleteInvoice, } from '../funcs/invoices.js';
3
3
  export class Invoices {
4
4
  _client;
5
5
  constructor(_client) {
@@ -14,5 +14,8 @@ export class Invoices {
14
14
  async update(request, options) {
15
15
  return unwrap(await updateInvoice(this._client, request, options));
16
16
  }
17
+ async delete(request, options) {
18
+ return unwrap(await deleteInvoice(this._client, request, options));
19
+ }
17
20
  }
18
21
  //# sourceMappingURL=invoices.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta-be2666bd959f",
3
+ "version": "1.0.0-beta-50d7ae9443a8",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://openmeter.io",
6
6
  "repository": {