@izak0s/spacebring-api 3.6.0 → 5.0.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
@@ -2460,6 +2460,17 @@ function createTransactions(client, defaults) {
2460
2460
  "transactions"
2461
2461
  );
2462
2462
  },
2463
+ /**
2464
+ * Retrieve a credit transaction
2465
+ *
2466
+ * Retrieve a credits transaction.
2467
+ *
2468
+ * @param id The id of the transaction
2469
+ * @param options Request options (abort signal).
2470
+ */
2471
+ async get(id, options) {
2472
+ return unwrapProp(await client.GET("/transactions/credits/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "transaction", "GET /transactions/credits/v1/{id}");
2473
+ },
2463
2474
  /**
2464
2475
  * Create a credit transaction
2465
2476
  *
@@ -2467,6 +2478,27 @@ function createTransactions(client, defaults) {
2467
2478
  */
2468
2479
  async create(transaction, options) {
2469
2480
  return unwrapProp(await client.POST("/transactions/credits/v1", { body: { transaction }, signal: options?.signal }), "transaction", "POST /transactions/credits/v1");
2481
+ },
2482
+ scheduled: {
2483
+ /**
2484
+ * Retrieve scheduled credits transactions
2485
+ *
2486
+ * Retrieve scheduled credits transactions of a subscription or a customer.
2487
+ */
2488
+ async list(query, options) {
2489
+ return unwrap(await client.GET("/transactions/credits/scheduled/v1", { params: { query }, signal: options?.signal }), "GET /transactions/credits/scheduled/v1");
2490
+ },
2491
+ /**
2492
+ * Retrieve scheduled credits transactions — iterates every item across all pages.
2493
+ *
2494
+ * Retrieve scheduled credits transactions of a subscription or a customer.
2495
+ */
2496
+ iterate(query, options) {
2497
+ return paginate(
2498
+ async (nextPageToken) => unwrap(await client.GET("/transactions/credits/scheduled/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /transactions/credits/scheduled/v1"),
2499
+ "scheduledTransactions"
2500
+ );
2501
+ }
2470
2502
  }
2471
2503
  },
2472
2504
  dayPasses: {