glitch-javascript-sdk 2.8.9 → 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/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 {
@@ -4382,6 +4387,13 @@ declare class Titles {
4382
4387
  * @param title_id The UUID of the title.
4383
4388
  */
4384
4389
  static attributionFunnel<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4390
+ /**
4391
+ * Update the status of a specific deployment build.
4392
+ * @param title_id The UUID of the title.
4393
+ * @param build_id The UUID of the build.
4394
+ * @param status The new status ('ready', 'inactive', or 'failed').
4395
+ */
4396
+ static updateBuildStatus<T>(title_id: string, build_id: string, status: string): AxiosPromise<Response<T>>;
4385
4397
  }
4386
4398
 
4387
4399
  declare class Campaigns {
@@ -5242,6 +5254,14 @@ declare class Subscriptions {
5242
5254
  * @param data { purchase_type: 'premium' | 'rental', payment_method_id: string }
5243
5255
  */
5244
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>>;
5245
5265
  }
5246
5266
 
5247
5267
  declare class Messages {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.8.9",
3
+ "version": "2.9.1",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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/Titles.ts CHANGED
@@ -1082,6 +1082,16 @@ class Titles {
1082
1082
  public static attributionFunnel<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
1083
1083
  return Requests.processRoute(TitlesRoute.routes.attributionFunnel, undefined, { title_id }, params);
1084
1084
  }
1085
+
1086
+ /**
1087
+ * Update the status of a specific deployment build.
1088
+ * @param title_id The UUID of the title.
1089
+ * @param build_id The UUID of the build.
1090
+ * @param status The new status ('ready', 'inactive', or 'failed').
1091
+ */
1092
+ public static updateBuildStatus<T>(title_id: string, build_id: string, status: string): AxiosPromise<Response<T>> {
1093
+ return Requests.processRoute(TitlesRoute.routes.updateBuildStatus, { status }, { title_id, build_id });
1094
+ }
1085
1095
  }
1086
1096
 
1087
1097
  export default Titles;
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
- export default SubscriptionsRoute;
31
+ export default SubscriptionsRoute;
@@ -231,6 +231,8 @@ class TitlesRoute {
231
231
  method: HTTP_METHODS.GET
232
232
  },
233
233
 
234
+ updateBuildStatus: { url: '/titles/{title_id}/deployments/{build_id}/status', method: HTTP_METHODS.PUT },
235
+
234
236
 
235
237
  };
236
238
 
@@ -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