glitch-javascript-sdk 2.8.5 → 2.8.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.
@@ -531,5 +531,36 @@ declare class Titles {
531
531
  * Resolve a conflict.
532
532
  */
533
533
  static resolveSaveConflict<T>(title_id: string, install_id: string, save_id: string, conflict_id: string, choice: 'keep_server' | 'use_client'): AxiosPromise<Response<T>>;
534
+ /**
535
+ * Toggle a game on the current user's wishlist.
536
+ * If the game is not wishlisted, it will be added. If it is, it will be removed.
537
+ *
538
+ * @param title_id The UUID of the title.
539
+ * @param data Optional context: { fingerprint_id?: string, short_link_click_id?: string }
540
+ */
541
+ static wishlistToggle<T>(title_id: string, data?: object): AxiosPromise<Response<T>>;
542
+ /**
543
+ * Record a self-assigned excitement score (1-5) for a wishlisted game.
544
+ *
545
+ * @param title_id The UUID of the title.
546
+ * @param data { score: number } - Must be between 1 and 5.
547
+ */
548
+ static wishlistUpdateScore<T>(title_id: string, data: {
549
+ score: number;
550
+ }): AxiosPromise<Response<T>>;
551
+ /**
552
+ * Retrieve the current user's personal wishlist collection.
553
+ *
554
+ * @param params Optional pagination parameters (?page=1&per_page=25)
555
+ */
556
+ static myWishlists<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
557
+ /**
558
+ * Get Wishlist Intelligence statistics for a title.
559
+ * Includes funnel data and predictive revenue forecasting.
560
+ * Note: Requires Title Administrator permissions.
561
+ *
562
+ * @param title_id The UUID of the title.
563
+ */
564
+ static wishlistStats<T>(title_id: string): AxiosPromise<Response<T>>;
534
565
  }
535
566
  export default Titles;
@@ -24,12 +24,20 @@ declare class Config {
24
24
  * @param lock If set to true, will lock the baseUrl so it cannot be changed
25
25
  */
26
26
  static setBaseUrl(baseUrl: string, lock?: boolean): void;
27
+ /**
28
+ * Gets the base URL
29
+ */
30
+ static getBaseUrl(): string;
27
31
  /**
28
32
  * Set the JSON Web Token (JWT) that will be passed to the API
29
33
  *
30
34
  * @param authToken The JWT
31
35
  */
32
36
  static setAuthToken(authToken: string): void;
37
+ /**
38
+ * Gets the auth token
39
+ */
40
+ static getAuthToken(): string;
33
41
  /**
34
42
  * Set the community to be associated with this config through
35
43
  *
@@ -43,6 +51,9 @@ declare class Config {
43
51
  * @param domain The domain ie: example.com
44
52
  */
45
53
  static setRootDomain(domain: string): void;
54
+ /**
55
+ * Gets the root domain
56
+ */
46
57
  static getRootDomain(): string;
47
58
  /**
48
59
  * Gets base url
@@ -56,5 +67,9 @@ declare class Config {
56
67
  * Gets the community currently associated
57
68
  */
58
69
  static get getCommunity(): object;
70
+ /**
71
+ * Checks if the base URL is locked
72
+ */
73
+ static isBaseUrlLocked(): boolean;
59
74
  }
60
75
  export default Config;
package/dist/esm/index.js CHANGED
@@ -5760,6 +5760,12 @@ var Config = /** @class */ (function () {
5760
5760
  this._baseUrlLocked = true;
5761
5761
  }
5762
5762
  };
5763
+ /**
5764
+ * Gets the base URL
5765
+ */
5766
+ Config.getBaseUrl = function () {
5767
+ return Config._baseUrl;
5768
+ };
5763
5769
  /**
5764
5770
  * Set the JSON Web Token (JWT) that will be passed to the API
5765
5771
  *
@@ -5769,6 +5775,12 @@ var Config = /** @class */ (function () {
5769
5775
  Config._authToken = authToken;
5770
5776
  Requests.setAuthToken(authToken);
5771
5777
  };
5778
+ /**
5779
+ * Gets the auth token
5780
+ */
5781
+ Config.getAuthToken = function () {
5782
+ return Config._authToken;
5783
+ };
5772
5784
  /**
5773
5785
  * Set the community to be associated with this config through
5774
5786
  *
@@ -5798,6 +5810,9 @@ var Config = /** @class */ (function () {
5798
5810
  this._rootDomain = formattedDomain;
5799
5811
  Storage.setRootDomain(formattedDomain);
5800
5812
  };
5813
+ /**
5814
+ * Gets the root domain
5815
+ */
5801
5816
  Config.getRootDomain = function () {
5802
5817
  return this._rootDomain;
5803
5818
  };
@@ -5831,6 +5846,12 @@ var Config = /** @class */ (function () {
5831
5846
  enumerable: false,
5832
5847
  configurable: true
5833
5848
  });
5849
+ /**
5850
+ * Checks if the base URL is locked
5851
+ */
5852
+ Config.isBaseUrlLocked = function () {
5853
+ return this._baseUrlLocked;
5854
+ };
5834
5855
  Config._baseUrlLocked = false;
5835
5856
  return Config;
5836
5857
  }());
@@ -11723,6 +11744,22 @@ var TitlesRoute = /** @class */ (function () {
11723
11744
  listSaves: { url: '/titles/{title_id}/installs/{install_id}/saves', method: HTTP_METHODS.GET },
11724
11745
  storeSave: { url: '/titles/{title_id}/installs/{install_id}/saves', method: HTTP_METHODS.POST },
11725
11746
  resolveSaveConflict: { url: '/titles/{title_id}/installs/{install_id}/saves/{save_id}/resolve', method: HTTP_METHODS.POST },
11747
+ wishlistToggle: {
11748
+ url: '/titles/{title_id}/wishlist',
11749
+ method: HTTP_METHODS.POST
11750
+ },
11751
+ wishlistUpdateScore: {
11752
+ url: '/titles/{title_id}/wishlist/score',
11753
+ method: HTTP_METHODS.POST
11754
+ },
11755
+ wishlistStats: {
11756
+ url: '/titles/{title_id}/wishlist/stats',
11757
+ method: HTTP_METHODS.GET
11758
+ },
11759
+ myWishlists: {
11760
+ url: '/users/me/wishlists',
11761
+ method: HTTP_METHODS.GET
11762
+ },
11726
11763
  };
11727
11764
  return TitlesRoute;
11728
11765
  }());
@@ -12420,6 +12457,43 @@ var Titles = /** @class */ (function () {
12420
12457
  Titles.resolveSaveConflict = function (title_id, install_id, save_id, conflict_id, choice) {
12421
12458
  return Requests.processRoute(TitlesRoute.routes.resolveSaveConflict, { conflict_id: conflict_id, choice: choice }, { title_id: title_id, install_id: install_id, save_id: save_id });
12422
12459
  };
12460
+ /**
12461
+ * Toggle a game on the current user's wishlist.
12462
+ * If the game is not wishlisted, it will be added. If it is, it will be removed.
12463
+ *
12464
+ * @param title_id The UUID of the title.
12465
+ * @param data Optional context: { fingerprint_id?: string, short_link_click_id?: string }
12466
+ */
12467
+ Titles.wishlistToggle = function (title_id, data) {
12468
+ return Requests.processRoute(TitlesRoute.routes.wishlistToggle, data, { title_id: title_id });
12469
+ };
12470
+ /**
12471
+ * Record a self-assigned excitement score (1-5) for a wishlisted game.
12472
+ *
12473
+ * @param title_id The UUID of the title.
12474
+ * @param data { score: number } - Must be between 1 and 5.
12475
+ */
12476
+ Titles.wishlistUpdateScore = function (title_id, data) {
12477
+ return Requests.processRoute(TitlesRoute.routes.wishlistUpdateScore, data, { title_id: title_id });
12478
+ };
12479
+ /**
12480
+ * Retrieve the current user's personal wishlist collection.
12481
+ *
12482
+ * @param params Optional pagination parameters (?page=1&per_page=25)
12483
+ */
12484
+ Titles.myWishlists = function (params) {
12485
+ return Requests.processRoute(TitlesRoute.routes.myWishlists, undefined, undefined, params);
12486
+ };
12487
+ /**
12488
+ * Get Wishlist Intelligence statistics for a title.
12489
+ * Includes funnel data and predictive revenue forecasting.
12490
+ * Note: Requires Title Administrator permissions.
12491
+ *
12492
+ * @param title_id The UUID of the title.
12493
+ */
12494
+ Titles.wishlistStats = function (title_id) {
12495
+ return Requests.processRoute(TitlesRoute.routes.wishlistStats, undefined, { title_id: title_id });
12496
+ };
12423
12497
  return Titles;
12424
12498
  }());
12425
12499