@izak0s/spacebring-api 9.9.0 → 10.0.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 -->196 operations across 21 resource groups<!-- /coverage -->** — the full Spacebring API surface
18
+ - **<!-- coverage -->197 operations across 21 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
package/dist/index.cjs CHANGED
@@ -678,6 +678,14 @@ function createBenefits(client, defaults) {
678
678
  async delete(benefitId, options) {
679
679
  return unwrap(await client.DELETE("/benefits/v1/{benefitId}", { params: { path: { benefitId } }, signal: options?.signal }), "DELETE /benefits/v1/{benefitId}");
680
680
  },
681
+ /**
682
+ * Create a media upload
683
+ *
684
+ * Create a media upload for a benefit cover image. The response carries a presigned URL: send the raw file bytes with a PUT request within a minute, using exactly the headers returned. Once the file is stored, pass the returned key as `media[0].key` when creating or updating a benefit within an hour; an image that is not attached by then is discarded.
685
+ */
686
+ async createMedia(media, options) {
687
+ return unwrapProp(await client.POST("/benefits/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /benefits/v1/media");
688
+ },
681
689
  applications: {
682
690
  /**
683
691
  * Retrieve applications