glitch-javascript-sdk 3.0.5 → 3.0.6

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
@@ -27096,6 +27096,7 @@ var SubscriptionsRoute = /** @class */ (function () {
27096
27096
  purchaseGift: { url: '/subscriptions/gifts/purchase', method: HTTP_METHODS.POST },
27097
27097
  redeemGift: { url: '/subscriptions/gifts/redeem', method: HTTP_METHODS.POST },
27098
27098
  cancelGift: { url: '/subscriptions/gifts/{gift_id}', method: HTTP_METHODS.DELETE },
27099
+ validateCoupon: { url: '/subscriptions/coupons/validate', method: HTTP_METHODS.POST },
27099
27100
  };
27100
27101
  return SubscriptionsRoute;
27101
27102
  }());
@@ -27257,6 +27258,13 @@ var Subscriptions = /** @class */ (function () {
27257
27258
  Subscriptions.cancelGift = function (gift_id) {
27258
27259
  return Requests.processRoute(SubscriptionsRoute.routes.cancelGift, {}, { gift_id: gift_id });
27259
27260
  };
27261
+ /**
27262
+ * Validates a coupon code and returns the calculated discount.
27263
+ * @param data { code: string, price: number, currency?: string }
27264
+ */
27265
+ Subscriptions.validateCoupon = function (data) {
27266
+ return Requests.processRoute(SubscriptionsRoute.routes.validateCoupon, data);
27267
+ };
27260
27268
  return Subscriptions;
27261
27269
  }());
27262
27270