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 +91 -0
- package/dist/cjs/index.js.map +1 -1
- 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 +91 -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 +23 -0
- package/package.json +1 -1
- 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/CommunitiesRoute.ts +3 -1
- package/src/routes/MarketResearchRoute.ts +15 -0
- package/src/util/Requests.ts +38 -0
|
@@ -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;
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -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 };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -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
|
*
|
|
@@ -20047,6 +20098,45 @@ var AdminReports = /** @class */ (function () {
|
|
|
20047
20098
|
return AdminReports;
|
|
20048
20099
|
}());
|
|
20049
20100
|
|
|
20101
|
+
var MarketResearchRoute = /** @class */ (function () {
|
|
20102
|
+
function MarketResearchRoute() {
|
|
20103
|
+
}
|
|
20104
|
+
MarketResearchRoute.routes = {
|
|
20105
|
+
access: { url: '/market-research/access', method: HTTP_METHODS.GET },
|
|
20106
|
+
filterOptions: { url: '/market-research/filter-options', method: HTTP_METHODS.GET },
|
|
20107
|
+
listGames: { url: '/market-research/games', method: HTTP_METHODS.GET },
|
|
20108
|
+
viewGame: { url: '/market-research/games/{game_id}', method: HTTP_METHODS.GET },
|
|
20109
|
+
exportGames: { url: '/market-research/games/export', method: HTTP_METHODS.GET },
|
|
20110
|
+
exportGame: { url: '/market-research/games/{game_id}/export', method: HTTP_METHODS.GET },
|
|
20111
|
+
};
|
|
20112
|
+
return MarketResearchRoute;
|
|
20113
|
+
}());
|
|
20114
|
+
|
|
20115
|
+
var MarketResearch = /** @class */ (function () {
|
|
20116
|
+
function MarketResearch() {
|
|
20117
|
+
}
|
|
20118
|
+
MarketResearch.access = function (params) {
|
|
20119
|
+
return Requests.processRoute(MarketResearchRoute.routes.access, undefined, undefined, params);
|
|
20120
|
+
};
|
|
20121
|
+
MarketResearch.filterOptions = function (params) {
|
|
20122
|
+
return Requests.processRoute(MarketResearchRoute.routes.filterOptions, undefined, undefined, params);
|
|
20123
|
+
};
|
|
20124
|
+
MarketResearch.listGames = function (params) {
|
|
20125
|
+
return Requests.processRoute(MarketResearchRoute.routes.listGames, undefined, undefined, params);
|
|
20126
|
+
};
|
|
20127
|
+
MarketResearch.viewGame = function (game_id, params) {
|
|
20128
|
+
return Requests.processRoute(MarketResearchRoute.routes.viewGame, undefined, { game_id: game_id }, params);
|
|
20129
|
+
};
|
|
20130
|
+
MarketResearch.exportGames = function (params) {
|
|
20131
|
+
return Requests.download(MarketResearchRoute.routes.exportGames.url, params);
|
|
20132
|
+
};
|
|
20133
|
+
MarketResearch.exportGame = function (game_id, params) {
|
|
20134
|
+
var url = MarketResearchRoute.routes.exportGame.url.replace('{game_id}', game_id);
|
|
20135
|
+
return Requests.download(url, params);
|
|
20136
|
+
};
|
|
20137
|
+
return MarketResearch;
|
|
20138
|
+
}());
|
|
20139
|
+
|
|
20050
20140
|
var Parser = /** @class */ (function () {
|
|
20051
20141
|
function Parser() {
|
|
20052
20142
|
}
|
|
@@ -20594,6 +20684,7 @@ var Glitch = /** @class */ (function () {
|
|
|
20594
20684
|
Mcp: Mcp,
|
|
20595
20685
|
PrDirectory: PrDirectory,
|
|
20596
20686
|
AdminReports: AdminReports,
|
|
20687
|
+
MarketResearch: MarketResearch,
|
|
20597
20688
|
};
|
|
20598
20689
|
Glitch.util = {
|
|
20599
20690
|
Requests: Requests,
|