@smartico/public-api 0.0.347 → 0.0.349

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.
@@ -115,6 +115,10 @@ export declare enum ClassId {
115
115
  RAF_CLAIM_PRIZE_RESPONSE = 909,
116
116
  RAF_OPTIN_REQUEST = 916,
117
117
  RAF_OPTIN_RESPONSE = 917,
118
+ BNR_GET_BANNER_PLACEMENTS_REQUEST = 950,
119
+ BNR_GET_BANNER_PLACEMENTS_RESPONSE = 951,
120
+ BNR_GET_BANNER_CONTENT_REQUEST = 952,
121
+ BNR_GET_BANNER_CONTENT_RESPONSE = 953,
118
122
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
119
123
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
120
124
  CLIENT_DEBUG_REQUEST = 77777,
@@ -47,6 +47,7 @@ declare enum PublicLabelSettings {
47
47
  GAMIFICATION_WIDGET_BG_OPACITY = "GAMIFICATION_WIDGET_BG_OPACITY",
48
48
  GAMIFICATION_POPUP_BG_OPACITY = "GAMIFICATION_POPUP_BG_OPACITY",
49
49
  GAMIFICATION_POPUP_BG_BLUR = "GAMIFICATION_POPUP_BG_BLUR",
50
+ FRONT_DISABLE_POPUP_INBOX_ON_URLS = "FRONT_DISABLE_POPUP_INBOX_ON_URLS",
50
51
  GAMIFICATION_LEVELS_LOGIC2 = "GAMIFICATION_LEVELS_LOGIC2",
51
52
  GAMIFICATION_LEVELS_LOGIC3 = "GAMIFICATION_LEVELS_LOGIC3",
52
53
  AVATAR_CUSTOM_IMAGE_MAX_ID = "AVATAR_CUSTOM_IMAGE_MAX_ID",
@@ -77,7 +77,7 @@ export declare class WSAPI {
77
77
  * **Visitor mode: not supported**
78
78
  */
79
79
  getCurrentLevel(): Promise<TLevelCurrent>;
80
- /** Returns all the missions available the current user.
80
+ /** Returns all the missions configured for the current user (server-side scoped, not filtered by Widget visibility).
81
81
  * The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
82
82
  * Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
83
83
  * The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
@@ -257,7 +257,7 @@ export declare class WSAPI {
257
257
  * */
258
258
  getCustomSections(): Promise<TUICustomSection[]>;
259
259
  /**
260
- * Returns the list of mini-games available for user
260
+ * Returns the list of mini-games configured for the current user (not filtered by spin availability or Widget visibility).
261
261
  * The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
262
262
  * The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
263
263
  *
@@ -260,13 +260,13 @@ export interface TLevel {
260
260
  * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
261
261
  */
262
262
  custom_data: string;
263
+ /** The ordinal position of the level */
264
+ ordinal_position: number;
263
265
  }
264
266
  /**
265
267
  * TLevelCurrent describes the information of each level defined in the system along with ordinal position and progress of the current level
266
268
  */
267
269
  export interface TLevelCurrent extends TLevel {
268
- /** The ordinal position of the level */
269
- ordinal_position: number;
270
270
  /** The progress of the user towards next level in the percents to complete */
271
271
  progress: number;
272
272
  }
package/dist/index.js CHANGED
@@ -144,6 +144,10 @@ exports.ClassId = void 0;
144
144
  RAF_GET_TICKETS_RESPONSE = 903,
145
145
  RAF_CLAIM_PRIZE_REQUEST = 906,
146
146
  */
147
+ ClassId[ClassId["BNR_GET_BANNER_PLACEMENTS_REQUEST"] = 950] = "BNR_GET_BANNER_PLACEMENTS_REQUEST";
148
+ ClassId[ClassId["BNR_GET_BANNER_PLACEMENTS_RESPONSE"] = 951] = "BNR_GET_BANNER_PLACEMENTS_RESPONSE";
149
+ ClassId[ClassId["BNR_GET_BANNER_CONTENT_REQUEST"] = 952] = "BNR_GET_BANNER_CONTENT_REQUEST";
150
+ ClassId[ClassId["BNR_GET_BANNER_CONTENT_RESPONSE"] = 953] = "BNR_GET_BANNER_CONTENT_RESPONSE";
147
151
  /*
148
152
  !Important, if adding new messages that are 'acting' on behalf of the client,
149
153
  you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION
@@ -1921,7 +1925,8 @@ var getLeaderBoardTransform = function getLeaderBoardTransform(board) {
1921
1925
  };
1922
1926
 
1923
1927
  var GetLevelMapResponseTransform = function GetLevelMapResponseTransform(levels) {
1924
- return levels == null ? void 0 : levels.levels.map(function (l) {
1928
+ if (!(levels != null && levels.levels)) return [];
1929
+ var mapped = levels.levels.map(function (l) {
1925
1930
  var _l$level_public_meta;
1926
1931
  return {
1927
1932
  id: l.level_id,
@@ -1932,9 +1937,21 @@ var GetLevelMapResponseTransform = function GetLevelMapResponseTransform(levels)
1932
1937
  visibility_points: l.level_public_meta.visibility_points ? parseInt(l.level_public_meta.visibility_points) : null,
1933
1938
  required_level_counter_1: l.required_level_counter_1,
1934
1939
  required_level_counter_2: l.required_level_counter_2,
1935
- custom_data: IntUtils.JsonOrText((_l$level_public_meta = l.level_public_meta) == null ? void 0 : _l$level_public_meta.custom_data)
1940
+ custom_data: IntUtils.JsonOrText((_l$level_public_meta = l.level_public_meta) == null ? void 0 : _l$level_public_meta.custom_data),
1941
+ ordinal_position: 0
1936
1942
  };
1937
1943
  });
1944
+ var ordinalById = new Map();
1945
+ [].concat(mapped).sort(function (a, b) {
1946
+ return a.required_points - b.required_points;
1947
+ }).forEach(function (l, index) {
1948
+ return ordinalById.set(l.id, index + 1);
1949
+ });
1950
+ return mapped.map(function (l) {
1951
+ return _extends({}, l, {
1952
+ ordinal_position: ordinalById.get(l.id)
1953
+ });
1954
+ });
1938
1955
  };
1939
1956
 
1940
1957
  /** @hidden */
@@ -2368,7 +2385,7 @@ var WSAPI = /*#__PURE__*/function () {
2368
2385
  return Promise.reject(e);
2369
2386
  }
2370
2387
  }
2371
- /** Returns all the missions available the current user.
2388
+ /** Returns all the missions configured for the current user (server-side scoped, not filtered by Widget visibility).
2372
2389
  * The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
2373
2390
  * Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
2374
2391
  * The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
@@ -2679,7 +2696,7 @@ var WSAPI = /*#__PURE__*/function () {
2679
2696
  }
2680
2697
  }
2681
2698
  /**
2682
- * Returns the list of mini-games available for user
2699
+ * Returns the list of mini-games configured for the current user (not filtered by spin availability or Widget visibility).
2683
2700
  * The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
2684
2701
  * The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
2685
2702
  *
@@ -5037,7 +5054,6 @@ var SmarticoAPI = /*#__PURE__*/function () {
5037
5054
  var userPointsEver = (_userInfo$points_ever2 = userInfo.points_ever) != null ? _userInfo$points_ever2 : 0;
5038
5055
  var progress = nextLevel ? (userPointsEver - currentLevel.required_points) / (nextLevel.required_points - currentLevel.required_points) * 100 : 100;
5039
5056
  return _extends({}, currentLevel, {
5040
- ordinal_position: currentLevelIndex + 1,
5041
5057
  progress: Math.min(Math.max(progress, 0), 100)
5042
5058
  });
5043
5059
  });