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 +13 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Subscriptions.d.ts +10 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/package.json +1 -1
- package/src/api/Subscriptions.ts +12 -0
- package/src/routes/SubscriptionsRoute.ts +1 -0
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
package/src/api/Subscriptions.ts
CHANGED
|
@@ -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
|
|