@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/dist/index.js CHANGED
@@ -1498,6 +1498,14 @@ function createEvents(client, defaults) {
1498
1498
  async copy(id, options) {
1499
1499
  return unwrapProp(await client.POST("/events/v1/{id}/copy", { params: { path: { id } }, signal: options?.signal }), "event", "POST /events/v1/{id}/copy");
1500
1500
  },
1501
+ /**
1502
+ * Create a media upload
1503
+ *
1504
+ * 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.
1505
+ */
1506
+ async createMedia(media, options) {
1507
+ return unwrapProp(await client.POST("/events/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /events/v1/media");
1508
+ },
1501
1509
  tickets: {
1502
1510
  /**
1503
1511
  * Retrieve tickets
@@ -2088,8 +2096,8 @@ function createResources(client, defaults) {
2088
2096
  return unwrapProp(await client.GET("/resources/bookings/v1/{bookingId}", { params: { path: { bookingId } }, signal: options?.signal }), "booking", "GET /resources/bookings/v1/{bookingId}");
2089
2097
  },
2090
2098
  /** Create a booking */
2091
- async create(booking, options) {
2092
- return unwrapProp(await client.POST("/resources/bookings/v1", { body: { booking }, signal: options?.signal }), "booking", "POST /resources/bookings/v1");
2099
+ async create(body, options) {
2100
+ return unwrapProp(await client.POST("/resources/bookings/v1", { body, signal: options?.signal }), "booking", "POST /resources/bookings/v1");
2093
2101
  },
2094
2102
  /**
2095
2103
  * Update a booking
@@ -2624,11 +2632,43 @@ function createTransactions(client, defaults) {
2624
2632
  /**
2625
2633
  * Retrieve a money transaction
2626
2634
  *
2627
- * @param id The id of the transaction
2635
+ * @param transactionId The id of the transaction.
2628
2636
  * @param options Request options (abort signal).
2629
2637
  */
2630
- async get(id, options) {
2631
- return unwrapProp(await client.GET("/transactions/money/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "transaction", "GET /transactions/money/v1/{id}");
2638
+ async get(transactionId, options) {
2639
+ return unwrapProp(await client.GET("/transactions/money/v1/{transactionId}", { params: { path: { transactionId } }, signal: options?.signal }), "transaction", "GET /transactions/money/v1/{transactionId}");
2640
+ },
2641
+ /**
2642
+ * Create a money transaction
2643
+ *
2644
+ * Create a money transaction by charging a customer for a custom item.
2645
+ */
2646
+ async create(body, options) {
2647
+ return unwrapProp(await client.POST("/transactions/money/v1", { body, signal: options?.signal }), "transaction", "POST /transactions/money/v1");
2648
+ },
2649
+ /**
2650
+ * Update a money transaction
2651
+ *
2652
+ * Approve or cancel a pending money transaction paid externally.
2653
+ *
2654
+ * @param transactionId The id of the transaction.
2655
+ * @param transaction The `transaction` payload.
2656
+ * @param options Request options (abort signal).
2657
+ */
2658
+ async update(transactionId, transaction, options) {
2659
+ return unwrap(await client.PATCH("/transactions/money/v1/{transactionId}", { params: { path: { transactionId } }, body: { transaction }, signal: options?.signal }), "PATCH /transactions/money/v1/{transactionId}");
2660
+ },
2661
+ /**
2662
+ * Refund a money transaction
2663
+ *
2664
+ * Refund a succeeded money transaction, fully or partially, through the payment gateway it was paid with.
2665
+ *
2666
+ * @param transactionId The id of the transaction.
2667
+ * @param transaction The `transaction` payload.
2668
+ * @param options Request options (abort signal).
2669
+ */
2670
+ async refund(transactionId, transaction, options) {
2671
+ 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");
2632
2672
  }
2633
2673
  }
2634
2674
  };