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
package/dist/index.d.ts
CHANGED
|
@@ -2250,6 +2250,11 @@ declare class Users {
|
|
|
2250
2250
|
* @returns Promise resolving to the list of rules
|
|
2251
2251
|
*/
|
|
2252
2252
|
static getSubredditRules<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2253
|
+
/**
|
|
2254
|
+
* Get a list of games the current user has played.
|
|
2255
|
+
* Includes playtime and last played timestamps.
|
|
2256
|
+
*/
|
|
2257
|
+
static playedGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2253
2258
|
}
|
|
2254
2259
|
|
|
2255
2260
|
declare class Events {
|
|
@@ -5249,6 +5254,14 @@ declare class Subscriptions {
|
|
|
5249
5254
|
* @param data { purchase_type: 'premium' | 'rental', payment_method_id: string }
|
|
5250
5255
|
*/
|
|
5251
5256
|
static purchaseLicense<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
5257
|
+
/**
|
|
5258
|
+
* List all game licenses (Premium/Rental) owned by the current user.
|
|
5259
|
+
*/
|
|
5260
|
+
static listMyLicenses<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5261
|
+
/**
|
|
5262
|
+
* Request a refund for a premium purchase.
|
|
5263
|
+
*/
|
|
5264
|
+
static refundLicense<T>(license_id: string): AxiosPromise<Response<T>>;
|
|
5252
5265
|
}
|
|
5253
5266
|
|
|
5254
5267
|
declare class Messages {
|
package/package.json
CHANGED
package/src/api/Subscriptions.ts
CHANGED
|
@@ -124,6 +124,20 @@ class Subscriptions {
|
|
|
124
124
|
return Requests.processRoute(SubscriptionsRoute.routes.purchaseLicense, data, { title_id });
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/**
|
|
128
|
+
* List all game licenses (Premium/Rental) owned by the current user.
|
|
129
|
+
*/
|
|
130
|
+
public static listMyLicenses<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
131
|
+
return Requests.processRoute(SubscriptionsRoute.routes.listMyLicenses, undefined, undefined, params);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Request a refund for a premium purchase.
|
|
136
|
+
*/
|
|
137
|
+
public static refundLicense<T>(license_id: string): AxiosPromise<Response<T>> {
|
|
138
|
+
return Requests.processRoute(SubscriptionsRoute.routes.refundLicense, {}, { license_id });
|
|
139
|
+
}
|
|
140
|
+
|
|
127
141
|
|
|
128
142
|
}
|
|
129
143
|
|
package/src/api/Users.ts
CHANGED
|
@@ -564,6 +564,13 @@ class Users {
|
|
|
564
564
|
}
|
|
565
565
|
|
|
566
566
|
|
|
567
|
+
/**
|
|
568
|
+
* Get a list of games the current user has played.
|
|
569
|
+
* Includes playtime and last played timestamps.
|
|
570
|
+
*/
|
|
571
|
+
public static playedGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
572
|
+
return Requests.processRoute(UserRoutes.routes.playedGames, undefined, undefined, params);
|
|
573
|
+
}
|
|
567
574
|
|
|
568
575
|
|
|
569
576
|
}
|
|
@@ -2,7 +2,7 @@ import Route from "./interface";
|
|
|
2
2
|
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
3
|
|
|
4
4
|
class SubscriptionsRoute {
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
public static routes: { [key: string]: Route } = {
|
|
7
7
|
createCreatorSubscription: { url: '/subscriptions/creators/subscribe', method: HTTP_METHODS.POST },
|
|
8
8
|
getCreatorSubscription: { url: '/subscriptions/creators/{stripe_subscription_id}', method: HTTP_METHODS.GET },
|
|
@@ -15,15 +15,17 @@ class SubscriptionsRoute {
|
|
|
15
15
|
listCommunityInfluencerSubscriptions: { url: '/subscriptions/communities/influencers/{community_id}', method: HTTP_METHODS.GET },
|
|
16
16
|
changeCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/change/{community_id}', method: HTTP_METHODS.POST },
|
|
17
17
|
|
|
18
|
-
createCustomCommunitySubscription: {
|
|
19
|
-
url: '/subscriptions/communities/custom/{community_id}',
|
|
20
|
-
method: HTTP_METHODS.POST
|
|
18
|
+
createCustomCommunitySubscription: {
|
|
19
|
+
url: '/subscriptions/communities/custom/{community_id}',
|
|
20
|
+
method: HTTP_METHODS.POST
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
purchaseLicense: { url: '/titles/{title_id}/purchase', method: HTTP_METHODS.POST },
|
|
24
|
+
listMyLicenses: { url: '/subscriptions/my-licenses', method: HTTP_METHODS.GET },
|
|
25
|
+
refundLicense: { url: '/subscriptions/licenses/{license_id}/refund', method: HTTP_METHODS.POST },
|
|
24
26
|
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
}
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
export default SubscriptionsRoute;
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -50,6 +50,8 @@ class UserRoutes {
|
|
|
50
50
|
clearInstagramAuth: { url: '/users/clearInstagramAuth', method: HTTP_METHODS.DELETE },
|
|
51
51
|
getSubredditRules: { url: "/users/reddit/redditrules/{subreddit}", method: HTTP_METHODS.GET },
|
|
52
52
|
|
|
53
|
+
playedGames: { url: '/users/me/played-games', method: HTTP_METHODS.GET },
|
|
54
|
+
|
|
53
55
|
|
|
54
56
|
};
|
|
55
57
|
|