glitch-javascript-sdk 3.0.2 → 3.0.3

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.d.ts CHANGED
@@ -5478,6 +5478,16 @@ declare class Subscriptions {
5478
5478
  * @returns promise
5479
5479
  */
5480
5480
  static redeemGift<T>(redemption_code: string): AxiosPromise<Response<T>>;
5481
+ /**
5482
+ * Cancel an unredeemed gift and trigger a refund.
5483
+ * Only the user who purchased the gift (the giver) can perform this action.
5484
+ *
5485
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelGift
5486
+ *
5487
+ * @param gift_id The UUID of the gift to cancel.
5488
+ * @returns promise
5489
+ */
5490
+ static cancelGift<T>(gift_id: string): AxiosPromise<Response<T>>;
5481
5491
  }
5482
5492
 
5483
5493
  declare class Messages {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -162,6 +162,18 @@ class Subscriptions {
162
162
  return Requests.processRoute(SubscriptionsRoute.routes.redeemGift, { redemption_code });
163
163
  }
164
164
 
165
+ /**
166
+ * Cancel an unredeemed gift and trigger a refund.
167
+ * Only the user who purchased the gift (the giver) can perform this action.
168
+ *
169
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelGift
170
+ *
171
+ * @param gift_id The UUID of the gift to cancel.
172
+ * @returns promise
173
+ */
174
+ public static cancelGift<T>(gift_id: string): AxiosPromise<Response<T>> {
175
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelGift, {}, { gift_id });
176
+ }
165
177
 
166
178
  }
167
179
 
@@ -26,6 +26,7 @@ class SubscriptionsRoute {
26
26
 
27
27
  purchaseGift: { url: '/subscriptions/gifts/purchase', method: HTTP_METHODS.POST },
28
28
  redeemGift: { url: '/subscriptions/gifts/redeem', method: HTTP_METHODS.POST },
29
+ cancelGift: { url: '/subscriptions/gifts/{gift_id}', method: HTTP_METHODS.DELETE },
29
30
 
30
31
  };
31
32