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 +8 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Subscriptions.d.ts +9 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/package.json +1 -1
- package/src/api/Subscriptions.ts +8 -0
- package/src/routes/SubscriptionsRoute.ts +2 -0
|
@@ -123,5 +123,14 @@ declare class Subscriptions {
|
|
|
123
123
|
* @returns promise
|
|
124
124
|
*/
|
|
125
125
|
static cancelGift<T>(gift_id: string): AxiosPromise<Response<T>>;
|
|
126
|
+
/**
|
|
127
|
+
* Validates a coupon code and returns the calculated discount.
|
|
128
|
+
* @param data { code: string, price: number, currency?: string }
|
|
129
|
+
*/
|
|
130
|
+
static validateCoupon<T>(data: {
|
|
131
|
+
code: string;
|
|
132
|
+
price: number;
|
|
133
|
+
currency?: string;
|
|
134
|
+
}): AxiosPromise<Response<T>>;
|
|
126
135
|
}
|
|
127
136
|
export default Subscriptions;
|
package/dist/esm/index.js
CHANGED
|
@@ -13912,6 +13912,7 @@ var SubscriptionsRoute = /** @class */ (function () {
|
|
|
13912
13912
|
purchaseGift: { url: '/subscriptions/gifts/purchase', method: HTTP_METHODS.POST },
|
|
13913
13913
|
redeemGift: { url: '/subscriptions/gifts/redeem', method: HTTP_METHODS.POST },
|
|
13914
13914
|
cancelGift: { url: '/subscriptions/gifts/{gift_id}', method: HTTP_METHODS.DELETE },
|
|
13915
|
+
validateCoupon: { url: '/subscriptions/coupons/validate', method: HTTP_METHODS.POST },
|
|
13915
13916
|
};
|
|
13916
13917
|
return SubscriptionsRoute;
|
|
13917
13918
|
}());
|
|
@@ -14073,6 +14074,13 @@ var Subscriptions = /** @class */ (function () {
|
|
|
14073
14074
|
Subscriptions.cancelGift = function (gift_id) {
|
|
14074
14075
|
return Requests.processRoute(SubscriptionsRoute.routes.cancelGift, {}, { gift_id: gift_id });
|
|
14075
14076
|
};
|
|
14077
|
+
/**
|
|
14078
|
+
* Validates a coupon code and returns the calculated discount.
|
|
14079
|
+
* @param data { code: string, price: number, currency?: string }
|
|
14080
|
+
*/
|
|
14081
|
+
Subscriptions.validateCoupon = function (data) {
|
|
14082
|
+
return Requests.processRoute(SubscriptionsRoute.routes.validateCoupon, data);
|
|
14083
|
+
};
|
|
14076
14084
|
return Subscriptions;
|
|
14077
14085
|
}());
|
|
14078
14086
|
|