@izak0s/spacebring-api 10.3.0 → 10.5.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 -->207 operations across 22 resource groups<!-- /coverage -->** — the full Spacebring API surface
18
+ - **<!-- coverage -->209 operations across 22 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
@@ -1911,6 +1911,14 @@ function createGuides(client, defaults) {
1911
1911
  async delete(guideId, options) {
1912
1912
  return unwrap(await client.DELETE("/guides/v1/{guideId}", { params: { path: { guideId } }, signal: options?.signal }), "DELETE /guides/v1/{guideId}");
1913
1913
  },
1914
+ /**
1915
+ * Create an attachment upload
1916
+ *
1917
+ * Create an upload for a file to attach to a guide, of any type up to 50 MB. 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 in `attachments[].key` when creating or updating a guide within an hour; a file that is not attached by then is discarded. The file is served as a download under the declared name.
1918
+ */
1919
+ async createAttachment(attachment, options) {
1920
+ return unwrapProp(await client.POST("/guides/v1/attachments", { body: { attachment }, signal: options?.signal }), "attachment", "POST /guides/v1/attachments");
1921
+ },
1914
1922
  /**
1915
1923
  * Create a media upload
1916
1924
  *
@@ -2556,6 +2564,14 @@ function createSupport(client, defaults) {
2556
2564
  async create(ticket, options) {
2557
2565
  return unwrap(await client.POST("/support/tickets/v1", { body: { ticket }, signal: options?.signal }), "POST /support/tickets/v1");
2558
2566
  },
2567
+ /**
2568
+ * Create a ticket media upload
2569
+ *
2570
+ * Create a media upload for a ticket comment attachment, a file of any type up to 50 MB. 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 `activity.attachments[0].key` when creating a ticket comment within 25 minutes; a file that is not attached by then is discarded.
2571
+ */
2572
+ async createMedia(media, options) {
2573
+ return unwrapProp(await client.POST("/support/tickets/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /support/tickets/v1/media");
2574
+ },
2559
2575
  /**
2560
2576
  * Update a ticket's assignee
2561
2577
  *
@@ -2596,7 +2612,7 @@ function createSupport(client, defaults) {
2596
2612
  /**
2597
2613
  * Create a ticket comment
2598
2614
  *
2599
- * Create a support ticket comment.
2615
+ * Create a support ticket comment. To attach a file, create a media upload first, send the file, then pass its key as `activity.attachments[0].key`; a 409 response means the file has not been received yet, so retry shortly.
2600
2616
  */
2601
2617
  async create(activity, options) {
2602
2618
  return unwrapProp(await client.POST("/support/tickets/v1/comment", { body: { activity }, signal: options?.signal }), "activity", "POST /support/tickets/v1/comment");