@smartico/public-api 0.0.114 → 0.0.116

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.
@@ -963,6 +963,7 @@ var onUpdateContextKey;
963
963
  onUpdateContextKey["StoreCategories"] = "storeCategories";
964
964
  onUpdateContextKey["AchCategories"] = "achCategories";
965
965
  onUpdateContextKey["LeaderBoards"] = "leaderBoards";
966
+ onUpdateContextKey["LevelExtraCounters"] = "levelExtraCounters";
966
967
  })(onUpdateContextKey || (onUpdateContextKey = {}));
967
968
  /** @group General API */
968
969
  class WSAPI {
@@ -1013,6 +1014,10 @@ class WSAPI {
1013
1014
  async getBadges() {
1014
1015
  return OCache.use(onUpdateContextKey.Badges, ECacheContext.WSAPI, () => this.api.badgetsGetItemsT(null), CACHE_DATA_SEC);
1015
1016
  }
1017
+ /** Returns the extra counters for the current user level */
1018
+ async getUserLevelExtraCounters() {
1019
+ return OCache.use(onUpdateContextKey.LevelExtraCounters, ECacheContext.WSAPI, () => this.api.getUserGamificationInfoT(null), CACHE_DATA_SEC);
1020
+ }
1016
1021
  /** Returns all the store items available the current user */
1017
1022
  async getStoreItems() {
1018
1023
  return OCache.use(onUpdateContextKey.StoreItems, ECacheContext.WSAPI, () => this.api.storeGetItemsT(null), CACHE_DATA_SEC);
@@ -1575,6 +1580,17 @@ class SmarticoAPI {
1575
1580
  async missionsGetItemsT(user_ext_id) {
1576
1581
  return UserAchievementTransform((await this.missionsGetItems(user_ext_id)).achievements);
1577
1582
  }
1583
+ async getUserGamificationInfo(user_ext_id) {
1584
+ const message = this.buildMessage(user_ext_id, ClassId.GET_ACHIEVEMENT_USER_REQUEST);
1585
+ return await this.send(message, ClassId.GET_ACHIEVEMENT_USER_RESPONSE);
1586
+ }
1587
+ async getUserGamificationInfoT(user_ext_id) {
1588
+ const response = await this.getUserGamificationInfo(user_ext_id);
1589
+ return {
1590
+ level_counter_1: response.level_counter_1,
1591
+ level_counter_2: response.level_counter_2
1592
+ };
1593
+ }
1578
1594
  async achGetCategories(user_ext_id) {
1579
1595
  const message = this.buildMessage(user_ext_id, ClassId.GET_ACH_CATEGORIES_REQUEST);
1580
1596
  return await this.send(message, ClassId.GET_ACH_CATEGORIES_RESPONSE);