@izak0s/spacebring-api 8.1.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
@@ -1582,10 +1582,12 @@ function createEvents(client, defaults) {
1582
1582
  /**
1583
1583
  * Check in a ticket
1584
1584
  *
1585
- * Check in an event ticket. Fails if the ticket is already checked in.
1585
+ * Check in an event ticket. Fails if the ticket is already checked in. Deprecated: this endpoint will be removed in a future release.
1586
1586
  *
1587
1587
  * @param id The id of the event ticket.
1588
1588
  * @param options Request options (abort signal).
1589
+ *
1590
+ * @deprecated Marked as deprecated in the OpenAPI spec.
1589
1591
  */
1590
1592
  async checkIn(id, options) {
1591
1593
  return unwrapProp(await client.POST("/events/tickets/v1/{id}/checkin", { params: { path: { id } }, signal: options?.signal }), "ticket", "POST /events/tickets/v1/{id}/checkin");
@@ -2049,7 +2051,18 @@ function createResources(client, defaults) {
2049
2051
  * Retrieve resource assignments in the location. An assignment links a resource, or a number of seats in it, to a company or a member for the duration of a subscription.
2050
2052
  */
2051
2053
  async list(query, options) {
2052
- return unwrapProp(await client.GET("/resources/v1/assignments", { params: { query }, signal: options?.signal }), "assignments", "GET /resources/v1/assignments");
2054
+ return unwrap(await client.GET("/resources/v1/assignments", { params: { query }, signal: options?.signal }), "GET /resources/v1/assignments");
2055
+ },
2056
+ /**
2057
+ * Retrieve resource assignments — iterates every item across all pages.
2058
+ *
2059
+ * Retrieve resource assignments in the location. An assignment links a resource, or a number of seats in it, to a company or a member for the duration of a subscription.
2060
+ */
2061
+ iterate(query, options) {
2062
+ return paginate(
2063
+ async (nextPageToken) => unwrap(await client.GET("/resources/v1/assignments", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /resources/v1/assignments"),
2064
+ "assignments"
2065
+ );
2053
2066
  },
2054
2067
  /**
2055
2068
  * Create a resource assignment
@@ -2102,8 +2115,8 @@ function createResources(client, defaults) {
2102
2115
  return unwrapProp(await client.GET("/resources/bookings/v1/{bookingId}", { params: { path: { bookingId } }, signal: options?.signal }), "booking", "GET /resources/bookings/v1/{bookingId}");
2103
2116
  },
2104
2117
  /** Create a booking */
2105
- async create(booking, options) {
2106
- 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");
2107
2120
  },
2108
2121
  /**
2109
2122
  * Update a booking
@@ -2638,11 +2651,43 @@ function createTransactions(client, defaults) {
2638
2651
  /**
2639
2652
  * Retrieve a money transaction
2640
2653
  *
2641
- * @param id The id of the transaction
2654
+ * @param transactionId The id of the transaction.
2642
2655
  * @param options Request options (abort signal).
2643
2656
  */
2644
- async get(id, options) {
2645
- 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");
2646
2691
  }
2647
2692
  }
2648
2693
  };