glitch-javascript-sdk 3.2.26 → 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 +103 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/AdminReports.d.ts +6 -0
- package/dist/esm/api/Communities.d.ts +12 -0
- package/dist/esm/api/MarketResearch.d.ts +11 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +103 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/MarketResearchRoute.d.ts +7 -0
- package/dist/esm/util/Requests.d.ts +1 -0
- package/dist/index.d.ts +29 -0
- package/package.json +1 -1
- package/src/api/AdminReports.ts +9 -0
- package/src/api/Communities.ts +16 -1
- package/src/api/MarketResearch.ts +33 -0
- package/src/api/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/routes/AdminReportsRoute.ts +4 -0
- package/src/routes/CommunitiesRoute.ts +3 -1
- package/src/routes/MarketResearchRoute.ts +15 -0
- package/src/util/Requests.ts +38 -0
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
|
*
|
|
@@ -32016,6 +32067,10 @@ var AdminReportsRoute = /** @class */ (function () {
|
|
|
32016
32067
|
url: '/admin/reports/users-revenue',
|
|
32017
32068
|
method: HTTP_METHODS.GET
|
|
32018
32069
|
},
|
|
32070
|
+
steam: {
|
|
32071
|
+
url: '/admin/reports/steam',
|
|
32072
|
+
method: HTTP_METHODS.GET
|
|
32073
|
+
},
|
|
32019
32074
|
};
|
|
32020
32075
|
return AdminReportsRoute;
|
|
32021
32076
|
}());
|
|
@@ -32030,9 +32085,56 @@ var AdminReports = /** @class */ (function () {
|
|
|
32030
32085
|
AdminReports.usersRevenue = function (params) {
|
|
32031
32086
|
return Requests.processRoute(AdminReportsRoute.routes.usersRevenue, undefined, undefined, params);
|
|
32032
32087
|
};
|
|
32088
|
+
/**
|
|
32089
|
+
* Returns site-admin Steam market reports, including social profile coverage,
|
|
32090
|
+
* platform usage, follower benchmarks, review/player relationships, and
|
|
32091
|
+
* optional target-app game reports.
|
|
32092
|
+
*/
|
|
32093
|
+
AdminReports.steam = function (params) {
|
|
32094
|
+
return Requests.processRoute(AdminReportsRoute.routes.steam, undefined, undefined, params);
|
|
32095
|
+
};
|
|
32033
32096
|
return AdminReports;
|
|
32034
32097
|
}());
|
|
32035
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
|
+
|
|
32036
32138
|
var Parser = /** @class */ (function () {
|
|
32037
32139
|
function Parser() {
|
|
32038
32140
|
}
|
|
@@ -32580,6 +32682,7 @@ var Glitch = /** @class */ (function () {
|
|
|
32580
32682
|
Mcp: Mcp,
|
|
32581
32683
|
PrDirectory: PrDirectory,
|
|
32582
32684
|
AdminReports: AdminReports,
|
|
32685
|
+
MarketResearch: MarketResearch,
|
|
32583
32686
|
};
|
|
32584
32687
|
Glitch.util = {
|
|
32585
32688
|
Requests: Requests,
|