glitch-javascript-sdk 3.0.5 → 3.0.7
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 +30 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Subscriptions.d.ts +9 -0
- package/dist/esm/api/Titles.d.ts +15 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/package.json +1 -1
- package/src/api/Subscriptions.ts +8 -0
- package/src/api/Titles.ts +18 -0
- package/src/routes/SubscriptionsRoute.ts +2 -0
- package/src/routes/TitlesRoute.ts +6 -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/api/Titles.d.ts
CHANGED
|
@@ -670,5 +670,20 @@ declare class Titles {
|
|
|
670
670
|
limit?: number;
|
|
671
671
|
device_id?: string;
|
|
672
672
|
}): AxiosPromise<Response<T>>;
|
|
673
|
+
/**
|
|
674
|
+
* Get a curated, playable feed for the Swipe interface.
|
|
675
|
+
* This route ensures games have builds and images, and supports seeded randomization.
|
|
676
|
+
*
|
|
677
|
+
* @see https://api.glitch.fun/api/documentation#/Discovery/getSwipeFeed
|
|
678
|
+
*
|
|
679
|
+
* @param params Object of query params:
|
|
680
|
+
* - seed?: number (For consistent randomization)
|
|
681
|
+
* - genres?: string[] (Filter by genre names)
|
|
682
|
+
* - models?: string[] (premium, rental, subscription, free)
|
|
683
|
+
* - excluded_ids?: string[] (UUIDs to skip)
|
|
684
|
+
* - page?: number
|
|
685
|
+
* - per_page?: number
|
|
686
|
+
*/
|
|
687
|
+
static swipeFeed<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
673
688
|
}
|
|
674
689
|
export default Titles;
|
package/dist/esm/index.js
CHANGED
|
@@ -11981,6 +11981,11 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
11981
11981
|
communityActivity: { url: '/titles/activity/trending', method: HTTP_METHODS.GET },
|
|
11982
11982
|
socialTrending: { url: '/titles/activity/social', method: HTTP_METHODS.GET },
|
|
11983
11983
|
discoveryQueue: { url: '/titles/discovery/queue', method: HTTP_METHODS.GET },
|
|
11984
|
+
/**
|
|
11985
|
+
* Curated, playable feed for the Swipe interface.
|
|
11986
|
+
* GET /titles/discovery/swipe
|
|
11987
|
+
*/
|
|
11988
|
+
swipeFeed: { url: '/titles/discovery/swipe', method: HTTP_METHODS.GET },
|
|
11984
11989
|
};
|
|
11985
11990
|
return TitlesRoute;
|
|
11986
11991
|
}());
|
|
@@ -12863,6 +12868,23 @@ var Titles = /** @class */ (function () {
|
|
|
12863
12868
|
Titles.getDiscoveryQueue = function (params) {
|
|
12864
12869
|
return Requests.processRoute(TitlesRoute.routes.discoveryQueue, {}, {}, params);
|
|
12865
12870
|
};
|
|
12871
|
+
/**
|
|
12872
|
+
* Get a curated, playable feed for the Swipe interface.
|
|
12873
|
+
* This route ensures games have builds and images, and supports seeded randomization.
|
|
12874
|
+
*
|
|
12875
|
+
* @see https://api.glitch.fun/api/documentation#/Discovery/getSwipeFeed
|
|
12876
|
+
*
|
|
12877
|
+
* @param params Object of query params:
|
|
12878
|
+
* - seed?: number (For consistent randomization)
|
|
12879
|
+
* - genres?: string[] (Filter by genre names)
|
|
12880
|
+
* - models?: string[] (premium, rental, subscription, free)
|
|
12881
|
+
* - excluded_ids?: string[] (UUIDs to skip)
|
|
12882
|
+
* - page?: number
|
|
12883
|
+
* - per_page?: number
|
|
12884
|
+
*/
|
|
12885
|
+
Titles.swipeFeed = function (params) {
|
|
12886
|
+
return Requests.processRoute(TitlesRoute.routes.swipeFeed, {}, undefined, params);
|
|
12887
|
+
};
|
|
12866
12888
|
return Titles;
|
|
12867
12889
|
}());
|
|
12868
12890
|
|
|
@@ -13912,6 +13934,7 @@ var SubscriptionsRoute = /** @class */ (function () {
|
|
|
13912
13934
|
purchaseGift: { url: '/subscriptions/gifts/purchase', method: HTTP_METHODS.POST },
|
|
13913
13935
|
redeemGift: { url: '/subscriptions/gifts/redeem', method: HTTP_METHODS.POST },
|
|
13914
13936
|
cancelGift: { url: '/subscriptions/gifts/{gift_id}', method: HTTP_METHODS.DELETE },
|
|
13937
|
+
validateCoupon: { url: '/subscriptions/coupons/validate', method: HTTP_METHODS.POST },
|
|
13915
13938
|
};
|
|
13916
13939
|
return SubscriptionsRoute;
|
|
13917
13940
|
}());
|
|
@@ -14073,6 +14096,13 @@ var Subscriptions = /** @class */ (function () {
|
|
|
14073
14096
|
Subscriptions.cancelGift = function (gift_id) {
|
|
14074
14097
|
return Requests.processRoute(SubscriptionsRoute.routes.cancelGift, {}, { gift_id: gift_id });
|
|
14075
14098
|
};
|
|
14099
|
+
/**
|
|
14100
|
+
* Validates a coupon code and returns the calculated discount.
|
|
14101
|
+
* @param data { code: string, price: number, currency?: string }
|
|
14102
|
+
*/
|
|
14103
|
+
Subscriptions.validateCoupon = function (data) {
|
|
14104
|
+
return Requests.processRoute(SubscriptionsRoute.routes.validateCoupon, data);
|
|
14105
|
+
};
|
|
14076
14106
|
return Subscriptions;
|
|
14077
14107
|
}());
|
|
14078
14108
|
|