glitch-javascript-sdk 3.2.27 → 3.2.28

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/cjs/index.js CHANGED
@@ -17392,6 +17392,42 @@ var Requests = /** @class */ (function () {
17392
17392
  }
17393
17393
  return Requests.request('GET', url);
17394
17394
  };
17395
+ Requests.download = function (url, params) {
17396
+ if (params && Object.keys(params).length > 0) {
17397
+ var queryString = Object.entries(params)
17398
+ .filter(function (_a) {
17399
+ var value = _a[1];
17400
+ return value !== undefined && value !== null && value !== '';
17401
+ })
17402
+ .map(function (_a) {
17403
+ var key = _a[0], value = _a[1];
17404
+ if (Array.isArray(value)) {
17405
+ return value.map(function (item) { return "".concat(key, "[]=").concat(encodeURIComponent(item)); }).join('&');
17406
+ }
17407
+ return "".concat(key, "=").concat(encodeURIComponent(value));
17408
+ })
17409
+ .filter(Boolean)
17410
+ .join('&');
17411
+ if (queryString) {
17412
+ url = "".concat(url, "?").concat(queryString);
17413
+ }
17414
+ }
17415
+ if (Requests.community_id) {
17416
+ var separator = url.includes('?') ? '&' : '?';
17417
+ url = "".concat(url).concat(separator, "community_id=").concat(Requests.community_id);
17418
+ }
17419
+ var headers = {};
17420
+ if (Requests.authToken) {
17421
+ headers['Authorization'] = "Bearer ".concat(Requests.authToken);
17422
+ }
17423
+ var uri = Requests.baseUrl.replace(/\/+$/, '') + '/' + url.replace(/^\/+/, '');
17424
+ return axios$1({
17425
+ method: 'GET',
17426
+ url: uri,
17427
+ headers: headers,
17428
+ responseType: 'blob',
17429
+ });
17430
+ };
17395
17431
  Requests.post = function (url, data, params) {
17396
17432
  if (params && Object.keys(params).length > 0) {
17397
17433
  var queryString = Object.entries(params)
@@ -19915,6 +19951,8 @@ var CommunitiesRoute = /** @class */ (function () {
19915
19951
  removeUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.DELETE },
19916
19952
  join: { url: '/communities/{community_id}/join', method: HTTP_METHODS.POST },
19917
19953
  findByDomain: { url: '/communities/findByDomain/{domain}', method: HTTP_METHODS.GET },
19954
+ getMarketResearchAccess: { url: '/communities/{community_id}/market-research-access', method: HTTP_METHODS.GET },
19955
+ updateMarketResearchAccess: { url: '/communities/{community_id}/market-research-access', method: HTTP_METHODS.PUT },
19918
19956
  addPaymentMethod: { url: '/communities/{community_id}/payment/methods', method: HTTP_METHODS.POST },
19919
19957
  getPaymentMethods: { url: '/communities/{community_id}/payment/methods', method: HTTP_METHODS.GET },
19920
19958
  setDefaultPaymentMethod: { url: '/communities/{community_id}/payment/methods/default', method: HTTP_METHODS.POST },
@@ -20058,6 +20096,19 @@ var Communities = /** @class */ (function () {
20058
20096
  Communities.delete = function (community_id, params) {
20059
20097
  return Requests.processRoute(CommunitiesRoute.routes.delete, {}, { community_id: community_id });
20060
20098
  };
20099
+ /**
20100
+ * Retrieve the site-admin grant state for the customer-facing game market
20101
+ * research product.
20102
+ */
20103
+ Communities.getMarketResearchAccess = function (community_id, params) {
20104
+ return Requests.processRoute(CommunitiesRoute.routes.getMarketResearchAccess, undefined, { community_id: community_id }, params);
20105
+ };
20106
+ /**
20107
+ * Enable or disable game market research access for a business account.
20108
+ */
20109
+ Communities.updateMarketResearchAccess = function (community_id, data, params) {
20110
+ return Requests.processRoute(CommunitiesRoute.routes.updateMarketResearchAccess, data, { community_id: community_id }, params);
20111
+ };
20061
20112
  /**
20062
20113
  * Updates the main image for the community using a File object.
20063
20114
  *
@@ -32045,6 +32096,45 @@ var AdminReports = /** @class */ (function () {
32045
32096
  return AdminReports;
32046
32097
  }());
32047
32098
 
32099
+ var MarketResearchRoute = /** @class */ (function () {
32100
+ function MarketResearchRoute() {
32101
+ }
32102
+ MarketResearchRoute.routes = {
32103
+ access: { url: '/market-research/access', method: HTTP_METHODS.GET },
32104
+ filterOptions: { url: '/market-research/filter-options', method: HTTP_METHODS.GET },
32105
+ listGames: { url: '/market-research/games', method: HTTP_METHODS.GET },
32106
+ viewGame: { url: '/market-research/games/{game_id}', method: HTTP_METHODS.GET },
32107
+ exportGames: { url: '/market-research/games/export', method: HTTP_METHODS.GET },
32108
+ exportGame: { url: '/market-research/games/{game_id}/export', method: HTTP_METHODS.GET },
32109
+ };
32110
+ return MarketResearchRoute;
32111
+ }());
32112
+
32113
+ var MarketResearch = /** @class */ (function () {
32114
+ function MarketResearch() {
32115
+ }
32116
+ MarketResearch.access = function (params) {
32117
+ return Requests.processRoute(MarketResearchRoute.routes.access, undefined, undefined, params);
32118
+ };
32119
+ MarketResearch.filterOptions = function (params) {
32120
+ return Requests.processRoute(MarketResearchRoute.routes.filterOptions, undefined, undefined, params);
32121
+ };
32122
+ MarketResearch.listGames = function (params) {
32123
+ return Requests.processRoute(MarketResearchRoute.routes.listGames, undefined, undefined, params);
32124
+ };
32125
+ MarketResearch.viewGame = function (game_id, params) {
32126
+ return Requests.processRoute(MarketResearchRoute.routes.viewGame, undefined, { game_id: game_id }, params);
32127
+ };
32128
+ MarketResearch.exportGames = function (params) {
32129
+ return Requests.download(MarketResearchRoute.routes.exportGames.url, params);
32130
+ };
32131
+ MarketResearch.exportGame = function (game_id, params) {
32132
+ var url = MarketResearchRoute.routes.exportGame.url.replace('{game_id}', game_id);
32133
+ return Requests.download(url, params);
32134
+ };
32135
+ return MarketResearch;
32136
+ }());
32137
+
32048
32138
  var Parser = /** @class */ (function () {
32049
32139
  function Parser() {
32050
32140
  }
@@ -32592,6 +32682,7 @@ var Glitch = /** @class */ (function () {
32592
32682
  Mcp: Mcp,
32593
32683
  PrDirectory: PrDirectory,
32594
32684
  AdminReports: AdminReports,
32685
+ MarketResearch: MarketResearch,
32595
32686
  };
32596
32687
  Glitch.util = {
32597
32688
  Requests: Requests,