@izak0s/spacebring-api 9.0.0 → 9.0.1

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 -->193 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
@@ -2115,8 +2115,8 @@ function createResources(client, defaults) {
2115
2115
  return unwrapProp(await client.GET("/resources/bookings/v1/{bookingId}", { params: { path: { bookingId } }, signal: options?.signal }), "booking", "GET /resources/bookings/v1/{bookingId}");
2116
2116
  },
2117
2117
  /** 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");
2118
+ async create(body, options) {
2119
+ return unwrapProp(await client.POST("/resources/bookings/v1", { body, signal: options?.signal }), "booking", "POST /resources/bookings/v1");
2120
2120
  },
2121
2121
  /**
2122
2122
  * Update a booking
@@ -2651,11 +2651,43 @@ function createTransactions(client, defaults) {
2651
2651
  /**
2652
2652
  * Retrieve a money transaction
2653
2653
  *
2654
- * @param id The id of the transaction
2654
+ * @param transactionId The id of the transaction.
2655
2655
  * @param options Request options (abort signal).
2656
2656
  */
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}");
2657
+ async get(transactionId, options) {
2658
+ return unwrapProp(await client.GET("/transactions/money/v1/{transactionId}", { params: { path: { transactionId } }, signal: options?.signal }), "transaction", "GET /transactions/money/v1/{transactionId}");
2659
+ },
2660
+ /**
2661
+ * Create a money transaction
2662
+ *
2663
+ * Create a money transaction by charging a customer for a custom item.
2664
+ */
2665
+ async create(body, options) {
2666
+ return unwrapProp(await client.POST("/transactions/money/v1", { body, signal: options?.signal }), "transaction", "POST /transactions/money/v1");
2667
+ },
2668
+ /**
2669
+ * Update a money transaction
2670
+ *
2671
+ * Approve or cancel a pending money transaction paid externally.
2672
+ *
2673
+ * @param transactionId The id of the transaction.
2674
+ * @param transaction The `transaction` payload.
2675
+ * @param options Request options (abort signal).
2676
+ */
2677
+ async update(transactionId, transaction, options) {
2678
+ return unwrap(await client.PATCH("/transactions/money/v1/{transactionId}", { params: { path: { transactionId } }, body: { transaction }, signal: options?.signal }), "PATCH /transactions/money/v1/{transactionId}");
2679
+ },
2680
+ /**
2681
+ * Refund a money transaction
2682
+ *
2683
+ * Refund a succeeded money transaction, fully or partially, through the payment gateway it was paid with.
2684
+ *
2685
+ * @param transactionId The id of the transaction.
2686
+ * @param transaction The `transaction` payload.
2687
+ * @param options Request options (abort signal).
2688
+ */
2689
+ async refund(transactionId, transaction, options) {
2690
+ 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
2691
  }
2660
2692
  }
2661
2693
  };