@smartico/public-api 0.0.353 → 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.
@@ -15,5 +15,6 @@ export declare enum PointChangeSourceType {
15
15
  WinMiniGame = 17,
16
16
  API = 18,
17
17
  DynamicFormula = 19,
18
- Raffle = 21
18
+ Raffle = 21,
19
+ Avatars = 22
19
20
  }
@@ -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
@@ -4469,6 +4469,7 @@ exports.PointChangeSourceType = void 0;
4469
4469
  PointChangeSourceType[PointChangeSourceType["API"] = 18] = "API";
4470
4470
  PointChangeSourceType[PointChangeSourceType["DynamicFormula"] = 19] = "DynamicFormula";
4471
4471
  PointChangeSourceType[PointChangeSourceType["Raffle"] = 21] = "Raffle";
4472
+ PointChangeSourceType[PointChangeSourceType["Avatars"] = 22] = "Avatars";
4472
4473
  })(exports.PointChangeSourceType || (exports.PointChangeSourceType = {}));
4473
4474
 
4474
4475
  /**
@@ -4558,12 +4559,15 @@ var SmarticoAPI = /*#__PURE__*/function () {
4558
4559
  this.tracker = options.tracker;
4559
4560
  this.publicUrl = SmarticoAPI.getPublicUrl(label_api_key);
4560
4561
  this.wsUrl = SmarticoAPI.getPublicWsUrl(label_api_key);
4561
- this.baseRgApiParams = {
4562
- env_id: String(SmarticoAPI.getEnvId(label_api_key)),
4563
- label_api_key: label_api_key,
4564
- brand_key: options.brand_api_key || this.tracker.params.brand_key,
4565
- hash: IntUtils.uuid()
4566
- };
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
+ }
4567
4571
  this.avatarDomain = SmarticoAPI.getAvatarUrl(label_api_key || ((_options$tracker = options.tracker) == null ? void 0 : _options$tracker.label_api_key));
4568
4572
  this.label_api_key = SmarticoAPI.getCleanLabelApiKey(label_api_key);
4569
4573
  }
@@ -5731,6 +5735,9 @@ var SmarticoAPI = /*#__PURE__*/function () {
5731
5735
  usePost = _ref3$usePost === void 0 ? false : _ref3$usePost;
5732
5736
  try {
5733
5737
  var _this66 = this;
5738
+ if (!_this66.tracker) {
5739
+ throw new Error("MatchX and Quiz APIs are not available in the visitor mode");
5740
+ }
5734
5741
  var baseParams = _this66.buildGamesApiParams();
5735
5742
  var queryString = Object.entries(baseParams).map(function (_ref4) {
5736
5743
  var k = _ref4[0],