glitch-javascript-sdk 3.2.27 → 3.2.29

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.
@@ -49,6 +49,18 @@ declare class Communities {
49
49
  * @returns promise
50
50
  */
51
51
  static delete<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Retrieve the site-admin grant state for the customer-facing game market
54
+ * research product.
55
+ */
56
+ static getMarketResearchAccess<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
57
+ /**
58
+ * Enable or disable game market research access for a business account.
59
+ */
60
+ static updateMarketResearchAccess<T>(community_id: string, data: {
61
+ enabled: boolean;
62
+ notes?: string;
63
+ }, params?: Record<string, any>): AxiosPromise<Response<T>>;
52
64
  /**
53
65
  * Updates the main image for the community using a File object.
54
66
  *
@@ -0,0 +1,11 @@
1
+ import { AxiosPromise } from "axios";
2
+ import Response from "../util/Response";
3
+ declare class MarketResearch {
4
+ static access<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5
+ static filterOptions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
6
+ static listGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
7
+ static viewGame<T>(game_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
8
+ static exportGames(params?: Record<string, any>): AxiosPromise<Blob>;
9
+ static exportGame(game_id: string, params?: Record<string, any>): AxiosPromise<Blob>;
10
+ }
11
+ export default MarketResearch;
@@ -42,6 +42,17 @@ declare class TwitchReporting {
42
42
  * @returns promise
43
43
  */
44
44
  static getMostActiveGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
45
+ /**
46
+ * Discover the most active Twitch games with Steam/IGDB genre, category,
47
+ * theme, live snapshot, and trend metrics.
48
+ *
49
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/discoverActiveTwitchGames
50
+ *
51
+ * @param params Optional query parameters (e.g., genres, categories, match_mode, trend_days, sort_by, limit).
52
+ *
53
+ * @returns promise
54
+ */
55
+ static discoverActiveGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
45
56
  /**
46
57
  * Get top streamers by performance (average or peak CCV).
47
58
  *
@@ -49,6 +49,7 @@ import Agents from "./Agents";
49
49
  import Mcp from "./Mcp";
50
50
  import PrDirectory from "./PrDirectory";
51
51
  import AdminReports from "./AdminReports";
52
+ import MarketResearch from "./MarketResearch";
52
53
  export { Ads };
53
54
  export { AccessKeys };
54
55
  export { Auth };
@@ -100,3 +101,4 @@ export { Agents };
100
101
  export { Mcp };
101
102
  export { PrDirectory };
102
103
  export { AdminReports };
104
+ export { MarketResearch };
@@ -49,6 +49,7 @@ import { Agents } from './api';
49
49
  import { Mcp } from './api';
50
50
  import { PrDirectory } from './api';
51
51
  import { AdminReports } from './api';
52
+ import { MarketResearch } from './api';
52
53
  import Requests from "./util/Requests";
53
54
  import Parser from "./util/Parser";
54
55
  import Session from "./util/Session";
@@ -119,6 +120,7 @@ declare class Glitch {
119
120
  Mcp: typeof Mcp;
120
121
  PrDirectory: typeof PrDirectory;
121
122
  AdminReports: typeof AdminReports;
123
+ MarketResearch: typeof MarketResearch;
122
124
  };
123
125
  static util: {
124
126
  Requests: typeof Requests;
package/dist/esm/index.js CHANGED
@@ -5394,6 +5394,42 @@ var Requests = /** @class */ (function () {
5394
5394
  }
5395
5395
  return Requests.request('GET', url);
5396
5396
  };
5397
+ Requests.download = function (url, params) {
5398
+ if (params && Object.keys(params).length > 0) {
5399
+ var queryString = Object.entries(params)
5400
+ .filter(function (_a) {
5401
+ var value = _a[1];
5402
+ return value !== undefined && value !== null && value !== '';
5403
+ })
5404
+ .map(function (_a) {
5405
+ var key = _a[0], value = _a[1];
5406
+ if (Array.isArray(value)) {
5407
+ return value.map(function (item) { return "".concat(key, "[]=").concat(encodeURIComponent(item)); }).join('&');
5408
+ }
5409
+ return "".concat(key, "=").concat(encodeURIComponent(value));
5410
+ })
5411
+ .filter(Boolean)
5412
+ .join('&');
5413
+ if (queryString) {
5414
+ url = "".concat(url, "?").concat(queryString);
5415
+ }
5416
+ }
5417
+ if (Requests.community_id) {
5418
+ var separator = url.includes('?') ? '&' : '?';
5419
+ url = "".concat(url).concat(separator, "community_id=").concat(Requests.community_id);
5420
+ }
5421
+ var headers = {};
5422
+ if (Requests.authToken) {
5423
+ headers['Authorization'] = "Bearer ".concat(Requests.authToken);
5424
+ }
5425
+ var uri = Requests.baseUrl.replace(/\/+$/, '') + '/' + url.replace(/^\/+/, '');
5426
+ return axios$1({
5427
+ method: 'GET',
5428
+ url: uri,
5429
+ headers: headers,
5430
+ responseType: 'blob',
5431
+ });
5432
+ };
5397
5433
  Requests.post = function (url, data, params) {
5398
5434
  if (params && Object.keys(params).length > 0) {
5399
5435
  var queryString = Object.entries(params)
@@ -7917,6 +7953,8 @@ var CommunitiesRoute = /** @class */ (function () {
7917
7953
  removeUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.DELETE },
7918
7954
  join: { url: '/communities/{community_id}/join', method: HTTP_METHODS.POST },
7919
7955
  findByDomain: { url: '/communities/findByDomain/{domain}', method: HTTP_METHODS.GET },
7956
+ getMarketResearchAccess: { url: '/communities/{community_id}/market-research-access', method: HTTP_METHODS.GET },
7957
+ updateMarketResearchAccess: { url: '/communities/{community_id}/market-research-access', method: HTTP_METHODS.PUT },
7920
7958
  addPaymentMethod: { url: '/communities/{community_id}/payment/methods', method: HTTP_METHODS.POST },
7921
7959
  getPaymentMethods: { url: '/communities/{community_id}/payment/methods', method: HTTP_METHODS.GET },
7922
7960
  setDefaultPaymentMethod: { url: '/communities/{community_id}/payment/methods/default', method: HTTP_METHODS.POST },
@@ -8060,6 +8098,19 @@ var Communities = /** @class */ (function () {
8060
8098
  Communities.delete = function (community_id, params) {
8061
8099
  return Requests.processRoute(CommunitiesRoute.routes.delete, {}, { community_id: community_id });
8062
8100
  };
8101
+ /**
8102
+ * Retrieve the site-admin grant state for the customer-facing game market
8103
+ * research product.
8104
+ */
8105
+ Communities.getMarketResearchAccess = function (community_id, params) {
8106
+ return Requests.processRoute(CommunitiesRoute.routes.getMarketResearchAccess, undefined, { community_id: community_id }, params);
8107
+ };
8108
+ /**
8109
+ * Enable or disable game market research access for a business account.
8110
+ */
8111
+ Communities.updateMarketResearchAccess = function (community_id, data, params) {
8112
+ return Requests.processRoute(CommunitiesRoute.routes.updateMarketResearchAccess, data, { community_id: community_id }, params);
8113
+ };
8063
8114
  /**
8064
8115
  * Updates the main image for the community using a File object.
8065
8116
  *
@@ -17825,6 +17876,10 @@ var TwitchReportingRoute = /** @class */ (function () {
17825
17876
  url: '/reporting/twitch/games/most-active',
17826
17877
  method: HTTP_METHODS.GET
17827
17878
  },
17879
+ discoverActiveGames: {
17880
+ url: '/reporting/twitch/games/discovery',
17881
+ method: HTTP_METHODS.GET
17882
+ },
17828
17883
  getTopStreamers: {
17829
17884
  url: '/reporting/twitch/streamers/top',
17830
17885
  method: HTTP_METHODS.GET
@@ -17897,6 +17952,19 @@ var TwitchReporting = /** @class */ (function () {
17897
17952
  TwitchReporting.getMostActiveGames = function (params) {
17898
17953
  return Requests.processRoute(TwitchReportingRoute.routes.getMostActiveGames, undefined, undefined, params);
17899
17954
  };
17955
+ /**
17956
+ * Discover the most active Twitch games with Steam/IGDB genre, category,
17957
+ * theme, live snapshot, and trend metrics.
17958
+ *
17959
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/discoverActiveTwitchGames
17960
+ *
17961
+ * @param params Optional query parameters (e.g., genres, categories, match_mode, trend_days, sort_by, limit).
17962
+ *
17963
+ * @returns promise
17964
+ */
17965
+ TwitchReporting.discoverActiveGames = function (params) {
17966
+ return Requests.processRoute(TwitchReportingRoute.routes.discoverActiveGames, undefined, undefined, params);
17967
+ };
17900
17968
  /**
17901
17969
  * Get top streamers by performance (average or peak CCV).
17902
17970
  *
@@ -20047,6 +20115,45 @@ var AdminReports = /** @class */ (function () {
20047
20115
  return AdminReports;
20048
20116
  }());
20049
20117
 
20118
+ var MarketResearchRoute = /** @class */ (function () {
20119
+ function MarketResearchRoute() {
20120
+ }
20121
+ MarketResearchRoute.routes = {
20122
+ access: { url: '/market-research/access', method: HTTP_METHODS.GET },
20123
+ filterOptions: { url: '/market-research/filter-options', method: HTTP_METHODS.GET },
20124
+ listGames: { url: '/market-research/games', method: HTTP_METHODS.GET },
20125
+ viewGame: { url: '/market-research/games/{game_id}', method: HTTP_METHODS.GET },
20126
+ exportGames: { url: '/market-research/games/export', method: HTTP_METHODS.GET },
20127
+ exportGame: { url: '/market-research/games/{game_id}/export', method: HTTP_METHODS.GET },
20128
+ };
20129
+ return MarketResearchRoute;
20130
+ }());
20131
+
20132
+ var MarketResearch = /** @class */ (function () {
20133
+ function MarketResearch() {
20134
+ }
20135
+ MarketResearch.access = function (params) {
20136
+ return Requests.processRoute(MarketResearchRoute.routes.access, undefined, undefined, params);
20137
+ };
20138
+ MarketResearch.filterOptions = function (params) {
20139
+ return Requests.processRoute(MarketResearchRoute.routes.filterOptions, undefined, undefined, params);
20140
+ };
20141
+ MarketResearch.listGames = function (params) {
20142
+ return Requests.processRoute(MarketResearchRoute.routes.listGames, undefined, undefined, params);
20143
+ };
20144
+ MarketResearch.viewGame = function (game_id, params) {
20145
+ return Requests.processRoute(MarketResearchRoute.routes.viewGame, undefined, { game_id: game_id }, params);
20146
+ };
20147
+ MarketResearch.exportGames = function (params) {
20148
+ return Requests.download(MarketResearchRoute.routes.exportGames.url, params);
20149
+ };
20150
+ MarketResearch.exportGame = function (game_id, params) {
20151
+ var url = MarketResearchRoute.routes.exportGame.url.replace('{game_id}', game_id);
20152
+ return Requests.download(url, params);
20153
+ };
20154
+ return MarketResearch;
20155
+ }());
20156
+
20050
20157
  var Parser = /** @class */ (function () {
20051
20158
  function Parser() {
20052
20159
  }
@@ -20594,6 +20701,7 @@ var Glitch = /** @class */ (function () {
20594
20701
  Mcp: Mcp,
20595
20702
  PrDirectory: PrDirectory,
20596
20703
  AdminReports: AdminReports,
20704
+ MarketResearch: MarketResearch,
20597
20705
  };
20598
20706
  Glitch.util = {
20599
20707
  Requests: Requests,