@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/index.modern.mjs
CHANGED
|
@@ -4009,12 +4009,15 @@ class SmarticoAPI {
|
|
|
4009
4009
|
this.tracker = options.tracker;
|
|
4010
4010
|
this.publicUrl = SmarticoAPI.getPublicUrl(label_api_key);
|
|
4011
4011
|
this.wsUrl = SmarticoAPI.getPublicWsUrl(label_api_key);
|
|
4012
|
-
this.
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4012
|
+
if (this.tracker) {
|
|
4013
|
+
// available only for real users
|
|
4014
|
+
this.baseRgApiParams = {
|
|
4015
|
+
env_id: String(SmarticoAPI.getEnvId(label_api_key)),
|
|
4016
|
+
label_api_key: label_api_key,
|
|
4017
|
+
brand_key: options.brand_api_key || this.tracker.params.brand_key,
|
|
4018
|
+
hash: IntUtils.uuid()
|
|
4019
|
+
};
|
|
4020
|
+
}
|
|
4018
4021
|
this.avatarDomain = SmarticoAPI.getAvatarUrl(label_api_key || ((_options$tracker = options.tracker) == null ? void 0 : _options$tracker.label_api_key));
|
|
4019
4022
|
this.label_api_key = SmarticoAPI.getCleanLabelApiKey(label_api_key);
|
|
4020
4023
|
}
|
|
@@ -4715,6 +4718,9 @@ class SmarticoAPI {
|
|
|
4715
4718
|
params,
|
|
4716
4719
|
usePost = false
|
|
4717
4720
|
}) {
|
|
4721
|
+
if (!this.tracker) {
|
|
4722
|
+
throw new Error(`MatchX and Quiz APIs are not available in the visitor mode`);
|
|
4723
|
+
}
|
|
4718
4724
|
const baseParams = this.buildGamesApiParams();
|
|
4719
4725
|
const queryString = Object.entries(baseParams).map(([k, v]) => `${k}=${encodeURIComponent(v)}`).join('&');
|
|
4720
4726
|
let url = `${GAMES_API_URL}/${method}?${queryString}`;
|