glitch-javascript-sdk 2.7.6 → 2.7.8

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.
@@ -759,5 +759,15 @@ declare class Campaigns {
759
759
  static sendOnboarding<T>(campaign_id: string, user_id: string, data?: {
760
760
  template_id?: string;
761
761
  }): AxiosPromise<Response<T>>;
762
+ /**
763
+ * Bulk invite influencers from a previous campaign into the current one.
764
+ *
765
+ * @param campaign_id The UUID of the target campaign.
766
+ * @param data { source_campaign_id: string, only_successful: boolean }
767
+ */
768
+ static crossPromote<T>(campaign_id: string, data: {
769
+ source_campaign_id: string;
770
+ only_successful?: boolean;
771
+ }): AxiosPromise<Response<T>>;
762
772
  }
763
773
  export default Campaigns;
@@ -664,5 +664,19 @@ declare class Communities {
664
664
  * List all Stripe invoices for the community.
665
665
  */
666
666
  static listInvoices<T>(community_id: string): AxiosPromise<Response<T>>;
667
+ /**
668
+ * List influencers saved to the community's private talent pool.
669
+ *
670
+ * @param community_id The UUID of the community.
671
+ * @param params Optional filters like 'list_name'.
672
+ */
673
+ static listSavedInfluencers<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
674
+ /**
675
+ * Save an influencer to the community's talent pool (Shortlist).
676
+ *
677
+ * @param community_id The UUID of the community.
678
+ * @param data { influencer_id: string, list_name?: string, tags?: string[] }
679
+ */
680
+ static saveInfluencerToPool<T>(community_id: string, data: object): AxiosPromise<Response<T>>;
667
681
  }
668
682
  export default Communities;
@@ -1,5 +1,32 @@
1
1
  import Response from "../util/Response";
2
2
  import { AxiosPromise } from "axios";
3
+ /**
4
+ * Interface for the Release Stats response to help developers
5
+ * understand the data structure returned by the optimizer.
6
+ */
7
+ export interface ReleaseStatEntry {
8
+ date: string;
9
+ count: number;
10
+ intensity: 'low' | 'medium' | 'high' | 'extreme';
11
+ is_danger_zone: boolean;
12
+ recommendation: string;
13
+ events: Array<{
14
+ name: string;
15
+ type: 'nextfest' | 'sale';
16
+ start: string;
17
+ end: string;
18
+ }>;
19
+ }
20
+ export interface ReleaseStatsResponse {
21
+ data: ReleaseStatEntry[];
22
+ meta: {
23
+ user_status: 'authenticated' | 'guest';
24
+ lookahead_days: number;
25
+ start_date: string;
26
+ end_date: string;
27
+ global_events: any[];
28
+ };
29
+ }
3
30
  declare class Games {
4
31
  /**
5
32
  * Get a list of Games available on he platform.
@@ -47,5 +74,28 @@ declare class Games {
47
74
  * @returns promise
48
75
  */
49
76
  static createGameScheduler<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
77
+ /**
78
+ * Get release competition statistics and Steam danger zones.
79
+ *
80
+ * This tool analyzes the 'ExternalGames' database to show how many other games
81
+ * are releasing around a specific date. It also overlays hard-coded Steam events
82
+ * like NextFest and Seasonal Sales.
83
+ *
84
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getReleaseStats
85
+ *
86
+ * @param params Filtering options:
87
+ * - precision: 'day' | 'month' | 'year' (Default: 'day'). Use 'month' for long-term planning.
88
+ * - start_date: 'YYYY-MM-DD'. The date to begin the analysis from.
89
+ *
90
+ * @returns AxiosPromise<Response<ReleaseStatsResponse>>
91
+ *
92
+ * @example
93
+ * Games.getReleaseStats({ precision: 'day', start_date: '2025-06-01' })
94
+ * .then(res => console.log(res.data.data));
95
+ */
96
+ static getReleaseStats<T = ReleaseStatsResponse>(params?: {
97
+ precision?: 'day' | 'month' | 'year';
98
+ start_date?: string;
99
+ }): AxiosPromise<Response<T>>;
50
100
  }
51
101
  export default Games;
package/dist/esm/index.js CHANGED
@@ -7885,6 +7885,8 @@ var CommunitiesRoute = /** @class */ (function () {
7885
7885
  url: '/communities/{community_id}/payment/statement',
7886
7886
  method: HTTP_METHODS.GET
7887
7887
  },
7888
+ listSavedInfluencers: { url: '/communities/{community_id}/influencers', method: HTTP_METHODS.GET },
7889
+ saveInfluencerToPool: { url: '/communities/{community_id}/influencers', method: HTTP_METHODS.POST }
7888
7890
  };
7889
7891
  return CommunitiesRoute;
7890
7892
  }());
@@ -8711,6 +8713,24 @@ var Communities = /** @class */ (function () {
8711
8713
  Communities.listInvoices = function (community_id) {
8712
8714
  return Requests.processRoute(CommunitiesRoute.routes.listInvoices, undefined, { community_id: community_id });
8713
8715
  };
8716
+ /**
8717
+ * List influencers saved to the community's private talent pool.
8718
+ *
8719
+ * @param community_id The UUID of the community.
8720
+ * @param params Optional filters like 'list_name'.
8721
+ */
8722
+ Communities.listSavedInfluencers = function (community_id, params) {
8723
+ return Requests.processRoute(CommunitiesRoute.routes.listSavedInfluencers, undefined, { community_id: community_id }, params);
8724
+ };
8725
+ /**
8726
+ * Save an influencer to the community's talent pool (Shortlist).
8727
+ *
8728
+ * @param community_id The UUID of the community.
8729
+ * @param data { influencer_id: string, list_name?: string, tags?: string[] }
8730
+ */
8731
+ Communities.saveInfluencerToPool = function (community_id, data) {
8732
+ return Requests.processRoute(CommunitiesRoute.routes.saveInfluencerToPool, data, { community_id: community_id });
8733
+ };
8714
8734
  return Communities;
8715
8735
  }());
8716
8736
 
@@ -12398,6 +12418,7 @@ var CampaignsRoute = /** @class */ (function () {
12398
12418
  method: HTTP_METHODS.POST
12399
12419
  },
12400
12420
  sendOnboarding: { url: '/campaigns/{campaign_id}/influencers/{user_id}/onboarding', method: HTTP_METHODS.POST },
12421
+ crossPromote: { url: '/campaigns/{campaign_id}/cross-promote', method: HTTP_METHODS.POST },
12401
12422
  };
12402
12423
  return CampaignsRoute;
12403
12424
  }());
@@ -13305,6 +13326,15 @@ var Campaigns = /** @class */ (function () {
13305
13326
  Campaigns.sendOnboarding = function (campaign_id, user_id, data) {
13306
13327
  return Requests.processRoute(CampaignsRoute.routes.sendOnboarding, data, { campaign_id: campaign_id, user_id: user_id });
13307
13328
  };
13329
+ /**
13330
+ * Bulk invite influencers from a previous campaign into the current one.
13331
+ *
13332
+ * @param campaign_id The UUID of the target campaign.
13333
+ * @param data { source_campaign_id: string, only_successful: boolean }
13334
+ */
13335
+ Campaigns.crossPromote = function (campaign_id, data) {
13336
+ return Requests.processRoute(CampaignsRoute.routes.crossPromote, data, { campaign_id: campaign_id });
13337
+ };
13308
13338
  return Campaigns;
13309
13339
  }());
13310
13340
 
@@ -13725,6 +13755,7 @@ var GamesRoutes = /** @class */ (function () {
13725
13755
  createCampaignWithTitle: { url: '/games/{game_id}/generateCampaignWithTitle', method: HTTP_METHODS.POST },
13726
13756
  createGameTitle: { url: '/games/{game_id}/generateTitle', method: HTTP_METHODS.POST },
13727
13757
  createGameScheduler: { url: '/games/{game_id}/generateScheduler', method: HTTP_METHODS.POST },
13758
+ releaseStats: { url: '/games/release-stats', method: HTTP_METHODS.GET },
13728
13759
  };
13729
13760
  return GamesRoutes;
13730
13761
  }());
@@ -13790,6 +13821,32 @@ var Games = /** @class */ (function () {
13790
13821
  Games.createGameScheduler = function (game_id, data, params) {
13791
13822
  return Requests.processRoute(GamesRoutes.routes.createGameScheduler, data, { game_id: game_id }, params);
13792
13823
  };
13824
+ /**
13825
+ * Get release competition statistics and Steam danger zones.
13826
+ *
13827
+ * This tool analyzes the 'ExternalGames' database to show how many other games
13828
+ * are releasing around a specific date. It also overlays hard-coded Steam events
13829
+ * like NextFest and Seasonal Sales.
13830
+ *
13831
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getReleaseStats
13832
+ *
13833
+ * @param params Filtering options:
13834
+ * - precision: 'day' | 'month' | 'year' (Default: 'day'). Use 'month' for long-term planning.
13835
+ * - start_date: 'YYYY-MM-DD'. The date to begin the analysis from.
13836
+ *
13837
+ * @returns AxiosPromise<Response<ReleaseStatsResponse>>
13838
+ *
13839
+ * @example
13840
+ * Games.getReleaseStats({ precision: 'day', start_date: '2025-06-01' })
13841
+ * .then(res => console.log(res.data.data));
13842
+ */
13843
+ Games.getReleaseStats = function (params) {
13844
+ // Defensive check: ensure precision is valid if provided
13845
+ if ((params === null || params === void 0 ? void 0 : params.precision) && !['day', 'month', 'year'].includes(params.precision)) {
13846
+ console.warn("Invalid precision '".concat(params.precision, "' passed to getReleaseStats. Defaulting to 'day'."));
13847
+ }
13848
+ return Requests.processRoute(GamesRoutes.routes.releaseStats, undefined, undefined, params);
13849
+ };
13793
13850
  return Games;
13794
13851
  }());
13795
13852