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.
@@ -113,5 +113,15 @@ declare class Subscriptions {
113
113
  * @returns promise
114
114
  */
115
115
  static redeemGift<T>(redemption_code: string): AxiosPromise<Response<T>>;
116
+ /**
117
+ * Cancel an unredeemed gift and trigger a refund.
118
+ * Only the user who purchased the gift (the giver) can perform this action.
119
+ *
120
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelGift
121
+ *
122
+ * @param gift_id The UUID of the gift to cancel.
123
+ * @returns promise
124
+ */
125
+ static cancelGift<T>(gift_id: string): AxiosPromise<Response<T>>;
116
126
  }
117
127
  export default Subscriptions;
package/dist/esm/index.js CHANGED
@@ -13893,6 +13893,7 @@ var SubscriptionsRoute = /** @class */ (function () {
13893
13893
  refundLicense: { url: '/subscriptions/licenses/{license_id}/refund', method: HTTP_METHODS.POST },
13894
13894
  purchaseGift: { url: '/subscriptions/gifts/purchase', method: HTTP_METHODS.POST },
13895
13895
  redeemGift: { url: '/subscriptions/gifts/redeem', method: HTTP_METHODS.POST },
13896
+ cancelGift: { url: '/subscriptions/gifts/{gift_id}', method: HTTP_METHODS.DELETE },
13896
13897
  };
13897
13898
  return SubscriptionsRoute;
13898
13899
  }());
@@ -14042,6 +14043,18 @@ var Subscriptions = /** @class */ (function () {
14042
14043
  Subscriptions.redeemGift = function (redemption_code) {
14043
14044
  return Requests.processRoute(SubscriptionsRoute.routes.redeemGift, { redemption_code: redemption_code });
14044
14045
  };
14046
+ /**
14047
+ * Cancel an unredeemed gift and trigger a refund.
14048
+ * Only the user who purchased the gift (the giver) can perform this action.
14049
+ *
14050
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelGift
14051
+ *
14052
+ * @param gift_id The UUID of the gift to cancel.
14053
+ * @returns promise
14054
+ */
14055
+ Subscriptions.cancelGift = function (gift_id) {
14056
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelGift, {}, { gift_id: gift_id });
14057
+ };
14045
14058
  return Subscriptions;
14046
14059
  }());
14047
14060