glitch-javascript-sdk 2.9.0 → 2.9.2

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.
@@ -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;
@@ -579,5 +579,13 @@ declare class Titles {
579
579
  * @param status The new status ('ready', 'inactive', or 'failed').
580
580
  */
581
581
  static updateBuildStatus<T>(title_id: string, build_id: string, status: string): AxiosPromise<Response<T>>;
582
+ /**
583
+ * Proxies a request through the backend to the matchmaker.
584
+ * This avoids HTTPS -> HTTP mixed content blocks.
585
+ *
586
+ * @param title_id The UUID of the game title.
587
+ * @returns AxiosPromise containing { signallingServer: string }
588
+ */
589
+ static getMatchmakerServer<T>(title_id: string): AxiosPromise<Response<T>>;
582
590
  }
583
591
  export default Titles;
@@ -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
 
@@ -11769,6 +11777,11 @@ var TitlesRoute = /** @class */ (function () {
11769
11777
  method: HTTP_METHODS.GET
11770
11778
  },
11771
11779
  updateBuildStatus: { url: '/titles/{title_id}/deployments/{build_id}/status', method: HTTP_METHODS.PUT },
11780
+ // Inside the routes object in TitlesRoute.ts
11781
+ getMatchmakerServer: {
11782
+ url: '/titles/{title_id}/matchmaker/server',
11783
+ method: HTTP_METHODS.GET
11784
+ },
11772
11785
  };
11773
11786
  return TitlesRoute;
11774
11787
  }());
@@ -12526,6 +12539,16 @@ var Titles = /** @class */ (function () {
12526
12539
  Titles.updateBuildStatus = function (title_id, build_id, status) {
12527
12540
  return Requests.processRoute(TitlesRoute.routes.updateBuildStatus, { status: status }, { title_id: title_id, build_id: build_id });
12528
12541
  };
12542
+ /**
12543
+ * Proxies a request through the backend to the matchmaker.
12544
+ * This avoids HTTPS -> HTTP mixed content blocks.
12545
+ *
12546
+ * @param title_id The UUID of the game title.
12547
+ * @returns AxiosPromise containing { signallingServer: string }
12548
+ */
12549
+ Titles.getMatchmakerServer = function (title_id) {
12550
+ return Requests.processRoute(TitlesRoute.routes.getMatchmakerServer, {}, { title_id: title_id });
12551
+ };
12529
12552
  return Titles;
12530
12553
  }());
12531
12554
 
@@ -13570,6 +13593,8 @@ var SubscriptionsRoute = /** @class */ (function () {
13570
13593
  method: HTTP_METHODS.POST
13571
13594
  },
13572
13595
  purchaseLicense: { url: '/titles/{title_id}/purchase', method: HTTP_METHODS.POST },
13596
+ listMyLicenses: { url: '/subscriptions/my-licenses', method: HTTP_METHODS.GET },
13597
+ refundLicense: { url: '/subscriptions/licenses/{license_id}/refund', method: HTTP_METHODS.POST },
13573
13598
  };
13574
13599
  return SubscriptionsRoute;
13575
13600
  }());
@@ -13685,6 +13710,18 @@ var Subscriptions = /** @class */ (function () {
13685
13710
  Subscriptions.purchaseLicense = function (title_id, data) {
13686
13711
  return Requests.processRoute(SubscriptionsRoute.routes.purchaseLicense, data, { title_id: title_id });
13687
13712
  };
13713
+ /**
13714
+ * List all game licenses (Premium/Rental) owned by the current user.
13715
+ */
13716
+ Subscriptions.listMyLicenses = function (params) {
13717
+ return Requests.processRoute(SubscriptionsRoute.routes.listMyLicenses, undefined, undefined, params);
13718
+ };
13719
+ /**
13720
+ * Request a refund for a premium purchase.
13721
+ */
13722
+ Subscriptions.refundLicense = function (license_id) {
13723
+ return Requests.processRoute(SubscriptionsRoute.routes.refundLicense, {}, { license_id: license_id });
13724
+ };
13688
13725
  return Subscriptions;
13689
13726
  }());
13690
13727