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.
package/dist/index.d.ts CHANGED
@@ -1828,6 +1828,20 @@ declare class Communities {
1828
1828
  * List all Stripe invoices for the community.
1829
1829
  */
1830
1830
  static listInvoices<T>(community_id: string): AxiosPromise<Response<T>>;
1831
+ /**
1832
+ * List influencers saved to the community's private talent pool.
1833
+ *
1834
+ * @param community_id The UUID of the community.
1835
+ * @param params Optional filters like 'list_name'.
1836
+ */
1837
+ static listSavedInfluencers<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
1838
+ /**
1839
+ * Save an influencer to the community's talent pool (Shortlist).
1840
+ *
1841
+ * @param community_id The UUID of the community.
1842
+ * @param data { influencer_id: string, list_name?: string, tags?: string[] }
1843
+ */
1844
+ static saveInfluencerToPool<T>(community_id: string, data: object): AxiosPromise<Response<T>>;
1831
1845
  }
1832
1846
 
1833
1847
  declare class Users {
@@ -5010,6 +5024,16 @@ declare class Campaigns {
5010
5024
  static sendOnboarding<T>(campaign_id: string, user_id: string, data?: {
5011
5025
  template_id?: string;
5012
5026
  }): AxiosPromise<Response<T>>;
5027
+ /**
5028
+ * Bulk invite influencers from a previous campaign into the current one.
5029
+ *
5030
+ * @param campaign_id The UUID of the target campaign.
5031
+ * @param data { source_campaign_id: string, only_successful: boolean }
5032
+ */
5033
+ static crossPromote<T>(campaign_id: string, data: {
5034
+ source_campaign_id: string;
5035
+ only_successful?: boolean;
5036
+ }): AxiosPromise<Response<T>>;
5013
5037
  }
5014
5038
 
5015
5039
  declare class Subscriptions {
@@ -5279,6 +5303,33 @@ declare class Influencers {
5279
5303
  static workbook<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5280
5304
  }
5281
5305
 
5306
+ /**
5307
+ * Interface for the Release Stats response to help developers
5308
+ * understand the data structure returned by the optimizer.
5309
+ */
5310
+ interface ReleaseStatEntry {
5311
+ date: string;
5312
+ count: number;
5313
+ intensity: 'low' | 'medium' | 'high' | 'extreme';
5314
+ is_danger_zone: boolean;
5315
+ recommendation: string;
5316
+ events: Array<{
5317
+ name: string;
5318
+ type: 'nextfest' | 'sale';
5319
+ start: string;
5320
+ end: string;
5321
+ }>;
5322
+ }
5323
+ interface ReleaseStatsResponse {
5324
+ data: ReleaseStatEntry[];
5325
+ meta: {
5326
+ user_status: 'authenticated' | 'guest';
5327
+ lookahead_days: number;
5328
+ start_date: string;
5329
+ end_date: string;
5330
+ global_events: any[];
5331
+ };
5332
+ }
5282
5333
  declare class Games {
5283
5334
  /**
5284
5335
  * Get a list of Games available on he platform.
@@ -5326,6 +5377,29 @@ declare class Games {
5326
5377
  * @returns promise
5327
5378
  */
5328
5379
  static createGameScheduler<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5380
+ /**
5381
+ * Get release competition statistics and Steam danger zones.
5382
+ *
5383
+ * This tool analyzes the 'ExternalGames' database to show how many other games
5384
+ * are releasing around a specific date. It also overlays hard-coded Steam events
5385
+ * like NextFest and Seasonal Sales.
5386
+ *
5387
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getReleaseStats
5388
+ *
5389
+ * @param params Filtering options:
5390
+ * - precision: 'day' | 'month' | 'year' (Default: 'day'). Use 'month' for long-term planning.
5391
+ * - start_date: 'YYYY-MM-DD'. The date to begin the analysis from.
5392
+ *
5393
+ * @returns AxiosPromise<Response<ReleaseStatsResponse>>
5394
+ *
5395
+ * @example
5396
+ * Games.getReleaseStats({ precision: 'day', start_date: '2025-06-01' })
5397
+ * .then(res => console.log(res.data.data));
5398
+ */
5399
+ static getReleaseStats<T = ReleaseStatsResponse>(params?: {
5400
+ precision?: 'day' | 'month' | 'year';
5401
+ start_date?: string;
5402
+ }): AxiosPromise<Response<T>>;
5329
5403
  }
5330
5404
 
5331
5405
  declare class Publications {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.7.6",
3
+ "version": "2.7.8",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -998,9 +998,9 @@ class Campaigns {
998
998
  */
999
999
  public static getSpecificInfluencerInstallReport<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
1000
1000
  return Requests.processRoute(
1001
- CampaignsRoute.routes.getSpecificInfluencerInstallReport,
1002
- undefined,
1003
- { campaign_id, influencer_id },
1001
+ CampaignsRoute.routes.getSpecificInfluencerInstallReport,
1002
+ undefined,
1003
+ { campaign_id, influencer_id },
1004
1004
  params
1005
1005
  );
1006
1006
  }
@@ -1009,13 +1009,13 @@ class Campaigns {
1009
1009
  * Generate AI Landing Page for an Influencer Campaign.
1010
1010
  */
1011
1011
  public static generateInfluencerLandingPage<T>(
1012
- campaign_id: string,
1013
- user_id: string,
1012
+ campaign_id: string,
1013
+ user_id: string,
1014
1014
  data: { prompt: string, privacy_mode: string }
1015
1015
  ): AxiosPromise<Response<T>> {
1016
1016
  return Requests.processRoute(
1017
- CampaignsRoute.routes.generateInfluencerLandingPage,
1018
- data,
1017
+ CampaignsRoute.routes.generateInfluencerLandingPage,
1018
+ data,
1019
1019
  { campaign_id, user_id }
1020
1020
  );
1021
1021
  }
@@ -1024,13 +1024,13 @@ class Campaigns {
1024
1024
  * Update settings for the Influencer Landing Page.
1025
1025
  */
1026
1026
  public static updateInfluencerLandingPage<T>(
1027
- campaign_id: string,
1028
- user_id: string,
1027
+ campaign_id: string,
1028
+ user_id: string,
1029
1029
  data: { is_landing_page_active?: boolean, landing_page_slug?: string }
1030
1030
  ): AxiosPromise<Response<T>> {
1031
1031
  return Requests.processRoute(
1032
- CampaignsRoute.routes.updateInfluencerLandingPage,
1033
- data,
1032
+ CampaignsRoute.routes.updateInfluencerLandingPage,
1033
+ data,
1034
1034
  { campaign_id, user_id }
1035
1035
  );
1036
1036
  }
@@ -1064,6 +1064,15 @@ class Campaigns {
1064
1064
  return Requests.processRoute(CampaignsRoute.routes.sendOnboarding, data, { campaign_id, user_id });
1065
1065
  }
1066
1066
 
1067
+ /**
1068
+ * Bulk invite influencers from a previous campaign into the current one.
1069
+ *
1070
+ * @param campaign_id The UUID of the target campaign.
1071
+ * @param data { source_campaign_id: string, only_successful: boolean }
1072
+ */
1073
+ public static crossPromote<T>(campaign_id: string, data: { source_campaign_id: string, only_successful?: boolean }): AxiosPromise<Response<T>> {
1074
+ return Requests.processRoute(CampaignsRoute.routes.crossPromote, data, { campaign_id });
1075
+ }
1067
1076
  }
1068
1077
 
1069
1078
  export default Campaigns;
@@ -985,6 +985,26 @@ class Communities {
985
985
  return Requests.processRoute(CommunitiesRoute.routes.listInvoices, undefined, { community_id });
986
986
  }
987
987
 
988
+ /**
989
+ * List influencers saved to the community's private talent pool.
990
+ *
991
+ * @param community_id The UUID of the community.
992
+ * @param params Optional filters like 'list_name'.
993
+ */
994
+ public static listSavedInfluencers<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
995
+ return Requests.processRoute(CommunitiesRoute.routes.listSavedInfluencers, undefined, { community_id }, params);
996
+ }
997
+
998
+ /**
999
+ * Save an influencer to the community's talent pool (Shortlist).
1000
+ *
1001
+ * @param community_id The UUID of the community.
1002
+ * @param data { influencer_id: string, list_name?: string, tags?: string[] }
1003
+ */
1004
+ public static saveInfluencerToPool<T>(community_id: string, data: object): AxiosPromise<Response<T>> {
1005
+ return Requests.processRoute(CommunitiesRoute.routes.saveInfluencerToPool, data, { community_id });
1006
+ }
1007
+
988
1008
  }
989
1009
 
990
1010
  export default Communities;
package/src/api/Games.ts CHANGED
@@ -3,6 +3,35 @@ import Requests from "../util/Requests";
3
3
  import Response from "../util/Response";
4
4
  import { AxiosPromise } from "axios";
5
5
 
6
+ /**
7
+ * Interface for the Release Stats response to help developers
8
+ * understand the data structure returned by the optimizer.
9
+ */
10
+ export interface ReleaseStatEntry {
11
+ date: string;
12
+ count: number;
13
+ intensity: 'low' | 'medium' | 'high' | 'extreme';
14
+ is_danger_zone: boolean;
15
+ recommendation: string;
16
+ events: Array<{
17
+ name: string;
18
+ type: 'nextfest' | 'sale';
19
+ start: string;
20
+ end: string;
21
+ }>;
22
+ }
23
+
24
+ export interface ReleaseStatsResponse {
25
+ data: ReleaseStatEntry[];
26
+ meta: {
27
+ user_status: 'authenticated' | 'guest';
28
+ lookahead_days: number;
29
+ start_date: string;
30
+ end_date: string;
31
+ global_events: any[];
32
+ };
33
+ }
34
+
6
35
  class Games {
7
36
 
8
37
  /**
@@ -12,7 +41,7 @@ class Games {
12
41
  *
13
42
  * @returns promise
14
43
  */
15
- public static listGames<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
44
+ public static listGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
16
45
  return Requests.processRoute(GamesRoutes.routes.listGames, undefined, undefined, params);
17
46
  }
18
47
 
@@ -23,8 +52,8 @@ class Games {
23
52
  *
24
53
  * @returns promise
25
54
  */
26
- public static viewGame<T>(game_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
27
- return Requests.processRoute(GamesRoutes.routes.viewGame, undefined, {game_id : game_id}, params);
55
+ public static viewGame<T>(game_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
56
+ return Requests.processRoute(GamesRoutes.routes.viewGame, undefined, { game_id: game_id }, params);
28
57
  }
29
58
 
30
59
  /**
@@ -34,8 +63,8 @@ class Games {
34
63
  *
35
64
  * @returns promise
36
65
  */
37
- public static createCampaignData<T>(game_id : string, data?: object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
38
- return Requests.processRoute(GamesRoutes.routes.createCampaignData, data, {game_id : game_id}, params);
66
+ public static createCampaignData<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
67
+ return Requests.processRoute(GamesRoutes.routes.createCampaignData, data, { game_id: game_id }, params);
39
68
  }
40
69
 
41
70
  /**
@@ -43,8 +72,8 @@ class Games {
43
72
  *
44
73
  * @returns promise
45
74
  */
46
- public static createCampaignWithTitle<T>(game_id : string, data?: object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
47
- return Requests.processRoute(GamesRoutes.routes.createCampaignWithTitle, data, {game_id : game_id}, params);
75
+ public static createCampaignWithTitle<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
76
+ return Requests.processRoute(GamesRoutes.routes.createCampaignWithTitle, data, { game_id: game_id }, params);
48
77
  }
49
78
 
50
79
  /**
@@ -54,8 +83,8 @@ class Games {
54
83
  *
55
84
  * @returns promise
56
85
  */
57
- public static createGameTitle<T>(game_id : string, data?: object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
58
- return Requests.processRoute(GamesRoutes.routes.createGameTitle, data, {game_id : game_id}, params);
86
+ public static createGameTitle<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
87
+ return Requests.processRoute(GamesRoutes.routes.createGameTitle, data, { game_id: game_id }, params);
59
88
  }
60
89
 
61
90
  /**
@@ -65,8 +94,45 @@ class Games {
65
94
  *
66
95
  * @returns promise
67
96
  */
68
- public static createGameScheduler<T>(game_id : string, data?: object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
69
- return Requests.processRoute(GamesRoutes.routes.createGameScheduler, data, {game_id : game_id}, params);
97
+ public static createGameScheduler<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
98
+ return Requests.processRoute(GamesRoutes.routes.createGameScheduler, data, { game_id: game_id }, params);
99
+ }
100
+
101
+ /**
102
+ * Get release competition statistics and Steam danger zones.
103
+ *
104
+ * This tool analyzes the 'ExternalGames' database to show how many other games
105
+ * are releasing around a specific date. It also overlays hard-coded Steam events
106
+ * like NextFest and Seasonal Sales.
107
+ *
108
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getReleaseStats
109
+ *
110
+ * @param params Filtering options:
111
+ * - precision: 'day' | 'month' | 'year' (Default: 'day'). Use 'month' for long-term planning.
112
+ * - start_date: 'YYYY-MM-DD'. The date to begin the analysis from.
113
+ *
114
+ * @returns AxiosPromise<Response<ReleaseStatsResponse>>
115
+ *
116
+ * @example
117
+ * Games.getReleaseStats({ precision: 'day', start_date: '2025-06-01' })
118
+ * .then(res => console.log(res.data.data));
119
+ */
120
+ public static getReleaseStats<T = ReleaseStatsResponse>(params?: {
121
+ precision?: 'day' | 'month' | 'year',
122
+ start_date?: string
123
+ }): AxiosPromise<Response<T>> {
124
+
125
+ // Defensive check: ensure precision is valid if provided
126
+ if (params?.precision && !['day', 'month', 'year'].includes(params.precision)) {
127
+ console.warn(`Invalid precision '${params.precision}' passed to getReleaseStats. Defaulting to 'day'.`);
128
+ }
129
+
130
+ return Requests.processRoute(
131
+ GamesRoutes.routes.releaseStats,
132
+ undefined,
133
+ undefined,
134
+ params
135
+ );
70
136
  }
71
137
 
72
138
  }
@@ -104,6 +104,8 @@ class CampaignsRoute {
104
104
  },
105
105
  sendOnboarding: { url: '/campaigns/{campaign_id}/influencers/{user_id}/onboarding', method: HTTP_METHODS.POST },
106
106
 
107
+ crossPromote: { url: '/campaigns/{campaign_id}/cross-promote', method: HTTP_METHODS.POST },
108
+
107
109
  };
108
110
 
109
111
  }
@@ -99,9 +99,9 @@ class CommunitiesRoute {
99
99
  method: HTTP_METHODS.POST
100
100
  },
101
101
  // New Invoicing and Statement Routes
102
- listInvoices: {
103
- url: '/communities/{community_id}/payment/invoices',
104
- method: HTTP_METHODS.GET
102
+ listInvoices: {
103
+ url: '/communities/{community_id}/payment/invoices',
104
+ method: HTTP_METHODS.GET
105
105
  },
106
106
  getInvoiceDetails: {
107
107
  url: '/communities/{community_id}/payment/invoices/{invoice_id}',
@@ -112,6 +112,9 @@ class CommunitiesRoute {
112
112
  method: HTTP_METHODS.GET
113
113
  },
114
114
 
115
+ listSavedInfluencers: { url: '/communities/{community_id}/influencers', method: HTTP_METHODS.GET },
116
+ saveInfluencerToPool: { url: '/communities/{community_id}/influencers', method: HTTP_METHODS.POST }
117
+
115
118
  };
116
119
 
117
120
 
@@ -10,7 +10,7 @@ class GamesRoutes {
10
10
  createCampaignWithTitle: { url: '/games/{game_id}/generateCampaignWithTitle', method: HTTP_METHODS.POST },
11
11
  createGameTitle: { url: '/games/{game_id}/generateTitle', method: HTTP_METHODS.POST },
12
12
  createGameScheduler: { url: '/games/{game_id}/generateScheduler', method: HTTP_METHODS.POST },
13
-
13
+ releaseStats: { url: '/games/release-stats', method: HTTP_METHODS.GET },
14
14
  };
15
15
 
16
16
  }