@smartico/public-api 0.0.354 → 0.0.355
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/SmarticoAPI.d.ts +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +12 -6
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/SmarticoAPI.ts +14 -6
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ import { GamesApiResponse, GamePickRound, GamePickRoundBoard, GamePickUserInfo,
|
|
|
29
29
|
interface Tracker {
|
|
30
30
|
label_api_key: string;
|
|
31
31
|
userPublicProps: any;
|
|
32
|
-
params
|
|
32
|
+
params?: {
|
|
33
33
|
brand_key?: string;
|
|
34
34
|
};
|
|
35
35
|
on: (callBackKey: ClassId, func: (data: any) => void) => void;
|
package/dist/index.js
CHANGED
|
@@ -4559,12 +4559,15 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
4559
4559
|
this.tracker = options.tracker;
|
|
4560
4560
|
this.publicUrl = SmarticoAPI.getPublicUrl(label_api_key);
|
|
4561
4561
|
this.wsUrl = SmarticoAPI.getPublicWsUrl(label_api_key);
|
|
4562
|
-
this.
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4562
|
+
if (this.tracker) {
|
|
4563
|
+
// available only for real users
|
|
4564
|
+
this.baseRgApiParams = {
|
|
4565
|
+
env_id: String(SmarticoAPI.getEnvId(label_api_key)),
|
|
4566
|
+
label_api_key: label_api_key,
|
|
4567
|
+
brand_key: options.brand_api_key || this.tracker.params.brand_key,
|
|
4568
|
+
hash: IntUtils.uuid()
|
|
4569
|
+
};
|
|
4570
|
+
}
|
|
4568
4571
|
this.avatarDomain = SmarticoAPI.getAvatarUrl(label_api_key || ((_options$tracker = options.tracker) == null ? void 0 : _options$tracker.label_api_key));
|
|
4569
4572
|
this.label_api_key = SmarticoAPI.getCleanLabelApiKey(label_api_key);
|
|
4570
4573
|
}
|
|
@@ -5732,6 +5735,9 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
5732
5735
|
usePost = _ref3$usePost === void 0 ? false : _ref3$usePost;
|
|
5733
5736
|
try {
|
|
5734
5737
|
var _this66 = this;
|
|
5738
|
+
if (!_this66.tracker) {
|
|
5739
|
+
throw new Error("MatchX and Quiz APIs are not available in the visitor mode");
|
|
5740
|
+
}
|
|
5735
5741
|
var baseParams = _this66.buildGamesApiParams();
|
|
5736
5742
|
var queryString = Object.entries(baseParams).map(function (_ref4) {
|
|
5737
5743
|
var k = _ref4[0],
|