@izak0s/spacebring-api 1.9.0 → 1.11.0

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
@@ -15,7 +15,7 @@ A fully-typed TypeScript client for the [Spacebring](https://www.spacebring.com)
15
15
 
16
16
  ## Features
17
17
 
18
- - **<!-- coverage -->162 operations across 20 resource groups<!-- /coverage -->** — the full Spacebring API surface
18
+ - **<!-- coverage -->163 operations across 20 resource groups<!-- /coverage -->** — the full Spacebring API surface
19
19
  - **Auto-generated** from the official OpenAPI spec — types and facade regenerate anytime the spec changes
20
20
  - **Nested, discoverable API** — `sb.billing.invoices.pay(id)`, `sb.visitors.visits.checkIn(body)`
21
21
  - **Auto-pagination** — every paginated list endpoint has an `iterate()` async generator that walks `nextPageToken` for you
@@ -80,7 +80,7 @@ const { invoice, payment } = await sb.billing.invoices.pay(invoiceId, {
80
80
  });
81
81
  ```
82
82
 
83
- Entity types are exported by name — `import type { Booking, Invoice, Membership } from "@izak0s/spacebring-api"` — matching what the methods return (`get`/`create`/`update` resolve to the entity, `iterate()` yields it). Query parameters get named interfaces too (`GetBookingsQuery`, `GetInvoicesQuery`), with per-field docs from the spec and enum filters as literal unions. Lower-level helpers too: `SpacebringConfig`, `SpacebringResources`, and the raw spec types `paths` / `components` / `operations`.
83
+ Entity types are exported by name — `import type { Booking, Invoice, Membership } from "@izak0s/spacebring-api"` — matching what the methods return (`get`/`create`/`update` resolve to the entity, `iterate()` yields it). Query parameters get named interfaces too (`GetBookingsQuery`, `GetInvoicesQuery`), with per-field docs from the spec and enum filters as literal unions, and request bodies get named types (`CreateBookingBody`, `UpdateInvoiceBody`). Lower-level helpers too: `SpacebringConfig`, `SpacebringResources`, and the raw spec types `paths` / `components` / `operations`.
84
84
 
85
85
  ### Data formats
86
86
 
package/dist/index.cjs CHANGED
@@ -898,6 +898,25 @@ function createBilling(client, defaults) {
898
898
  return unwrap(await client.PATCH("/billing/invoices/v1/{invoiceId}/void", { params: { path: { invoiceId } }, signal: options?.signal }), "PATCH /billing/invoices/v1/{invoiceId}/void");
899
899
  },
900
900
  items: {
901
+ /**
902
+ * List invoice items
903
+ *
904
+ * List invoice items filtered customer, location, type, status, or date range. Status and issue date filters match items connected to an invoice.
905
+ */
906
+ async list(query, options) {
907
+ return unwrap(await client.GET("/billing/invoices/v1/items", { params: { query }, signal: options?.signal }), "GET /billing/invoices/v1/items");
908
+ },
909
+ /**
910
+ * List invoice items — iterates every item across all pages.
911
+ *
912
+ * List invoice items filtered customer, location, type, status, or date range. Status and issue date filters match items connected to an invoice.
913
+ */
914
+ iterate(query, options) {
915
+ return paginate(
916
+ async (nextPageToken) => unwrap(await client.GET("/billing/invoices/v1/items", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /billing/invoices/v1/items"),
917
+ "invoiceItems"
918
+ );
919
+ },
901
920
  /**
902
921
  * Retrieve an invoice item
903
922
  *