@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/dist/index.js CHANGED
@@ -1555,10 +1555,12 @@ function createEvents(client, defaults) {
1555
1555
  /**
1556
1556
  * Check in a ticket
1557
1557
  *
1558
- * Check in an event ticket. Fails if the ticket is already checked in.
1558
+ * Check in an event ticket. Fails if the ticket is already checked in. Deprecated: this endpoint will be removed in a future release.
1559
1559
  *
1560
1560
  * @param id The id of the event ticket.
1561
1561
  * @param options Request options (abort signal).
1562
+ *
1563
+ * @deprecated Marked as deprecated in the OpenAPI spec.
1562
1564
  */
1563
1565
  async checkIn(id, options) {
1564
1566
  return unwrapProp(await client.POST("/events/tickets/v1/{id}/checkin", { params: { path: { id } }, signal: options?.signal }), "ticket", "POST /events/tickets/v1/{id}/checkin");
@@ -2022,7 +2024,18 @@ function createResources(client, defaults) {
2022
2024
  * 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.
2023
2025
  */
2024
2026
  async list(query, options) {
2025
- return unwrapProp(await client.GET("/resources/v1/assignments", { params: { query }, signal: options?.signal }), "assignments", "GET /resources/v1/assignments");
2027
+ return unwrap(await client.GET("/resources/v1/assignments", { params: { query }, signal: options?.signal }), "GET /resources/v1/assignments");
2028
+ },
2029
+ /**
2030
+ * Retrieve resource assignments — iterates every item across all pages.
2031
+ *
2032
+ * 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.
2033
+ */
2034
+ iterate(query, options) {
2035
+ return paginate(
2036
+ async (nextPageToken) => unwrap(await client.GET("/resources/v1/assignments", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /resources/v1/assignments"),
2037
+ "assignments"
2038
+ );
2026
2039
  },
2027
2040
  /**
2028
2041
  * Create a resource assignment
@@ -2075,8 +2088,8 @@ function createResources(client, defaults) {
2075
2088
  return unwrapProp(await client.GET("/resources/bookings/v1/{bookingId}", { params: { path: { bookingId } }, signal: options?.signal }), "booking", "GET /resources/bookings/v1/{bookingId}");
2076
2089
  },
2077
2090
  /** Create a booking */
2078
- async create(booking, options) {
2079
- return unwrapProp(await client.POST("/resources/bookings/v1", { body: { booking }, signal: options?.signal }), "booking", "POST /resources/bookings/v1");
2091
+ async create(body, options) {
2092
+ return unwrapProp(await client.POST("/resources/bookings/v1", { body, signal: options?.signal }), "booking", "POST /resources/bookings/v1");
2080
2093
  },
2081
2094
  /**
2082
2095
  * Update a booking
@@ -2611,11 +2624,43 @@ function createTransactions(client, defaults) {
2611
2624
  /**
2612
2625
  * Retrieve a money transaction
2613
2626
  *
2614
- * @param id The id of the transaction
2627
+ * @param transactionId The id of the transaction.
2615
2628
  * @param options Request options (abort signal).
2616
2629
  */
2617
- async get(id, options) {
2618
- return unwrapProp(await client.GET("/transactions/money/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "transaction", "GET /transactions/money/v1/{id}");
2630
+ async get(transactionId, options) {
2631
+ return unwrapProp(await client.GET("/transactions/money/v1/{transactionId}", { params: { path: { transactionId } }, signal: options?.signal }), "transaction", "GET /transactions/money/v1/{transactionId}");
2632
+ },
2633
+ /**
2634
+ * Create a money transaction
2635
+ *
2636
+ * Create a money transaction by charging a customer for a custom item.
2637
+ */
2638
+ async create(body, options) {
2639
+ return unwrapProp(await client.POST("/transactions/money/v1", { body, signal: options?.signal }), "transaction", "POST /transactions/money/v1");
2640
+ },
2641
+ /**
2642
+ * Update a money transaction
2643
+ *
2644
+ * Approve or cancel a pending money transaction paid externally.
2645
+ *
2646
+ * @param transactionId The id of the transaction.
2647
+ * @param transaction The `transaction` payload.
2648
+ * @param options Request options (abort signal).
2649
+ */
2650
+ async update(transactionId, transaction, options) {
2651
+ return unwrap(await client.PATCH("/transactions/money/v1/{transactionId}", { params: { path: { transactionId } }, body: { transaction }, signal: options?.signal }), "PATCH /transactions/money/v1/{transactionId}");
2652
+ },
2653
+ /**
2654
+ * Refund a money transaction
2655
+ *
2656
+ * Refund a succeeded money transaction, fully or partially, through the payment gateway it was paid with.
2657
+ *
2658
+ * @param transactionId The id of the transaction.
2659
+ * @param transaction The `transaction` payload.
2660
+ * @param options Request options (abort signal).
2661
+ */
2662
+ async refund(transactionId, transaction, options) {
2663
+ 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");
2619
2664
  }
2620
2665
  }
2621
2666
  };