@izak0s/spacebring-api 9.0.0 → 9.1.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 -->190 operations across 21 resource groups<!-- /coverage -->** — the full Spacebring API surface
18
+ - **<!-- coverage -->194 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
@@ -1525,6 +1525,14 @@ function createEvents(client, defaults) {
1525
1525
  async copy(id, options) {
1526
1526
  return unwrapProp(await client.POST("/events/v1/{id}/copy", { params: { path: { id } }, signal: options?.signal }), "event", "POST /events/v1/{id}/copy");
1527
1527
  },
1528
+ /**
1529
+ * Create a media upload
1530
+ *
1531
+ * Create a media upload for an event 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 an event within an hour; an image that is not attached by then is discarded.
1532
+ */
1533
+ async createMedia(media, options) {
1534
+ return unwrapProp(await client.POST("/events/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /events/v1/media");
1535
+ },
1528
1536
  tickets: {
1529
1537
  /**
1530
1538
  * Retrieve tickets
@@ -2115,8 +2123,8 @@ function createResources(client, defaults) {
2115
2123
  return unwrapProp(await client.GET("/resources/bookings/v1/{bookingId}", { params: { path: { bookingId } }, signal: options?.signal }), "booking", "GET /resources/bookings/v1/{bookingId}");
2116
2124
  },
2117
2125
  /** Create a booking */
2118
- async create(booking, options) {
2119
- return unwrapProp(await client.POST("/resources/bookings/v1", { body: { booking }, signal: options?.signal }), "booking", "POST /resources/bookings/v1");
2126
+ async create(body, options) {
2127
+ return unwrapProp(await client.POST("/resources/bookings/v1", { body, signal: options?.signal }), "booking", "POST /resources/bookings/v1");
2120
2128
  },
2121
2129
  /**
2122
2130
  * Update a booking
@@ -2651,11 +2659,43 @@ function createTransactions(client, defaults) {
2651
2659
  /**
2652
2660
  * Retrieve a money transaction
2653
2661
  *
2654
- * @param id The id of the transaction
2662
+ * @param transactionId The id of the transaction.
2655
2663
  * @param options Request options (abort signal).
2656
2664
  */
2657
- async get(id, options) {
2658
- return unwrapProp(await client.GET("/transactions/money/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "transaction", "GET /transactions/money/v1/{id}");
2665
+ async get(transactionId, options) {
2666
+ return unwrapProp(await client.GET("/transactions/money/v1/{transactionId}", { params: { path: { transactionId } }, signal: options?.signal }), "transaction", "GET /transactions/money/v1/{transactionId}");
2667
+ },
2668
+ /**
2669
+ * Create a money transaction
2670
+ *
2671
+ * Create a money transaction by charging a customer for a custom item.
2672
+ */
2673
+ async create(body, options) {
2674
+ return unwrapProp(await client.POST("/transactions/money/v1", { body, signal: options?.signal }), "transaction", "POST /transactions/money/v1");
2675
+ },
2676
+ /**
2677
+ * Update a money transaction
2678
+ *
2679
+ * Approve or cancel a pending money transaction paid externally.
2680
+ *
2681
+ * @param transactionId The id of the transaction.
2682
+ * @param transaction The `transaction` payload.
2683
+ * @param options Request options (abort signal).
2684
+ */
2685
+ async update(transactionId, transaction, options) {
2686
+ return unwrap(await client.PATCH("/transactions/money/v1/{transactionId}", { params: { path: { transactionId } }, body: { transaction }, signal: options?.signal }), "PATCH /transactions/money/v1/{transactionId}");
2687
+ },
2688
+ /**
2689
+ * Refund a money transaction
2690
+ *
2691
+ * Refund a succeeded money transaction, fully or partially, through the payment gateway it was paid with.
2692
+ *
2693
+ * @param transactionId The id of the transaction.
2694
+ * @param transaction The `transaction` payload.
2695
+ * @param options Request options (abort signal).
2696
+ */
2697
+ async refund(transactionId, transaction, options) {
2698
+ return unwrapProp(await client.POST("/transactions/money/v1/{transactionId}/refund", { params: { path: { transactionId } }, body: transaction === void 0 ? void 0 : { transaction }, signal: options?.signal }), "refund", "POST /transactions/money/v1/{transactionId}/refund");
2659
2699
  }
2660
2700
  }
2661
2701
  };