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/cjs/index.js CHANGED
@@ -27077,6 +27077,7 @@ var SubscriptionsRoute = /** @class */ (function () {
27077
27077
  refundLicense: { url: '/subscriptions/licenses/{license_id}/refund', method: HTTP_METHODS.POST },
27078
27078
  purchaseGift: { url: '/subscriptions/gifts/purchase', method: HTTP_METHODS.POST },
27079
27079
  redeemGift: { url: '/subscriptions/gifts/redeem', method: HTTP_METHODS.POST },
27080
+ cancelGift: { url: '/subscriptions/gifts/{gift_id}', method: HTTP_METHODS.DELETE },
27080
27081
  };
27081
27082
  return SubscriptionsRoute;
27082
27083
  }());
@@ -27226,6 +27227,18 @@ var Subscriptions = /** @class */ (function () {
27226
27227
  Subscriptions.redeemGift = function (redemption_code) {
27227
27228
  return Requests.processRoute(SubscriptionsRoute.routes.redeemGift, { redemption_code: redemption_code });
27228
27229
  };
27230
+ /**
27231
+ * Cancel an unredeemed gift and trigger a refund.
27232
+ * Only the user who purchased the gift (the giver) can perform this action.
27233
+ *
27234
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelGift
27235
+ *
27236
+ * @param gift_id The UUID of the gift to cancel.
27237
+ * @returns promise
27238
+ */
27239
+ Subscriptions.cancelGift = function (gift_id) {
27240
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelGift, {}, { gift_id: gift_id });
27241
+ };
27229
27242
  return Subscriptions;
27230
27243
  }());
27231
27244