glitch-javascript-sdk 2.9.0 → 2.9.1
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 +22 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Subscriptions.d.ts +8 -0
- package/dist/esm/api/Users.d.ts +5 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +13 -0
- package/package.json +1 -1
- package/src/api/Subscriptions.ts +14 -0
- package/src/api/Users.ts +7 -0
- package/src/routes/SubscriptionsRoute.ts +8 -6
- package/src/routes/UserRoutes.ts +2 -0
|
@@ -87,5 +87,13 @@ declare class Subscriptions {
|
|
|
87
87
|
* @param data { purchase_type: 'premium' | 'rental', payment_method_id: string }
|
|
88
88
|
*/
|
|
89
89
|
static purchaseLicense<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
90
|
+
/**
|
|
91
|
+
* List all game licenses (Premium/Rental) owned by the current user.
|
|
92
|
+
*/
|
|
93
|
+
static listMyLicenses<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
94
|
+
/**
|
|
95
|
+
* Request a refund for a premium purchase.
|
|
96
|
+
*/
|
|
97
|
+
static refundLicense<T>(license_id: string): AxiosPromise<Response<T>>;
|
|
90
98
|
}
|
|
91
99
|
export default Subscriptions;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -391,5 +391,10 @@ declare class Users {
|
|
|
391
391
|
* @returns Promise resolving to the list of rules
|
|
392
392
|
*/
|
|
393
393
|
static getSubredditRules<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
394
|
+
/**
|
|
395
|
+
* Get a list of games the current user has played.
|
|
396
|
+
* Includes playtime and last played timestamps.
|
|
397
|
+
*/
|
|
398
|
+
static playedGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
394
399
|
}
|
|
395
400
|
export default Users;
|
package/dist/esm/index.js
CHANGED
|
@@ -8801,6 +8801,7 @@ var UserRoutes = /** @class */ (function () {
|
|
|
8801
8801
|
resendVerificationEmail: { url: '/users/resendVerificationEmail', method: HTTP_METHODS.POST },
|
|
8802
8802
|
clearInstagramAuth: { url: '/users/clearInstagramAuth', method: HTTP_METHODS.DELETE },
|
|
8803
8803
|
getSubredditRules: { url: "/users/reddit/redditrules/{subreddit}", method: HTTP_METHODS.GET },
|
|
8804
|
+
playedGames: { url: '/users/me/played-games', method: HTTP_METHODS.GET },
|
|
8804
8805
|
};
|
|
8805
8806
|
return UserRoutes;
|
|
8806
8807
|
}());
|
|
@@ -9284,6 +9285,13 @@ var Users = /** @class */ (function () {
|
|
|
9284
9285
|
Users.getSubredditRules = function (subreddit, params) {
|
|
9285
9286
|
return Requests.processRoute(UserRoutes.routes.getSubredditRules, undefined, { subreddit: subreddit }, params);
|
|
9286
9287
|
};
|
|
9288
|
+
/**
|
|
9289
|
+
* Get a list of games the current user has played.
|
|
9290
|
+
* Includes playtime and last played timestamps.
|
|
9291
|
+
*/
|
|
9292
|
+
Users.playedGames = function (params) {
|
|
9293
|
+
return Requests.processRoute(UserRoutes.routes.playedGames, undefined, undefined, params);
|
|
9294
|
+
};
|
|
9287
9295
|
return Users;
|
|
9288
9296
|
}());
|
|
9289
9297
|
|
|
@@ -13570,6 +13578,8 @@ var SubscriptionsRoute = /** @class */ (function () {
|
|
|
13570
13578
|
method: HTTP_METHODS.POST
|
|
13571
13579
|
},
|
|
13572
13580
|
purchaseLicense: { url: '/titles/{title_id}/purchase', method: HTTP_METHODS.POST },
|
|
13581
|
+
listMyLicenses: { url: '/subscriptions/my-licenses', method: HTTP_METHODS.GET },
|
|
13582
|
+
refundLicense: { url: '/subscriptions/licenses/{license_id}/refund', method: HTTP_METHODS.POST },
|
|
13573
13583
|
};
|
|
13574
13584
|
return SubscriptionsRoute;
|
|
13575
13585
|
}());
|
|
@@ -13685,6 +13695,18 @@ var Subscriptions = /** @class */ (function () {
|
|
|
13685
13695
|
Subscriptions.purchaseLicense = function (title_id, data) {
|
|
13686
13696
|
return Requests.processRoute(SubscriptionsRoute.routes.purchaseLicense, data, { title_id: title_id });
|
|
13687
13697
|
};
|
|
13698
|
+
/**
|
|
13699
|
+
* List all game licenses (Premium/Rental) owned by the current user.
|
|
13700
|
+
*/
|
|
13701
|
+
Subscriptions.listMyLicenses = function (params) {
|
|
13702
|
+
return Requests.processRoute(SubscriptionsRoute.routes.listMyLicenses, undefined, undefined, params);
|
|
13703
|
+
};
|
|
13704
|
+
/**
|
|
13705
|
+
* Request a refund for a premium purchase.
|
|
13706
|
+
*/
|
|
13707
|
+
Subscriptions.refundLicense = function (license_id) {
|
|
13708
|
+
return Requests.processRoute(SubscriptionsRoute.routes.refundLicense, {}, { license_id: license_id });
|
|
13709
|
+
};
|
|
13688
13710
|
return Subscriptions;
|
|
13689
13711
|
}());
|
|
13690
13712
|
|