@smartico/public-api 0.0.336 → 0.0.339

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.
Files changed (62) hide show
  1. package/dist/{PointsHistory/PointsHistoryLog.d.ts → ActivityLog/ActivityLogEntry.d.ts} +1 -1
  2. package/dist/{PointsHistory/GetPointsHistoryRequest.d.ts → ActivityLog/GetActivityLogRequest.d.ts} +1 -1
  3. package/dist/ActivityLog/GetActivityLogResponse.d.ts +7 -0
  4. package/dist/ActivityLog/index.d.ts +5 -0
  5. package/dist/Analytics/AnalyticStoreData.d.ts +1 -1
  6. package/dist/CustomSections/AchCustomSection.d.ts +1 -1
  7. package/dist/CustomSections/UICustomSection.d.ts +1 -0
  8. package/dist/SmarticoAPI.d.ts +4 -4
  9. package/dist/Store/StoreItemPublicMeta.d.ts +3 -0
  10. package/dist/WSAPI/WSAPI.d.ts +9 -9
  11. package/dist/WSAPI/WSAPITypes.d.ts +12 -4
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +27 -22
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.modern.mjs +25 -20
  16. package/dist/index.modern.mjs.map +1 -1
  17. package/docs/enums/AchCustomSectionType.md +2 -2
  18. package/docs/interfaces/AchCategory.md +19 -0
  19. package/docs/interfaces/AchCategoryPublicMeta.md +19 -0
  20. package/docs/interfaces/AchCustomSectionType.md +21 -0
  21. package/docs/interfaces/AchievementPublicMeta.md +155 -0
  22. package/docs/interfaces/Bonus.md +107 -0
  23. package/docs/interfaces/GetTournamentInfoResponse.md +37 -0
  24. package/docs/interfaces/InboxMessage.md +51 -0
  25. package/docs/interfaces/InboxMessageBody.md +64 -0
  26. package/docs/interfaces/Level.md +67 -0
  27. package/docs/interfaces/LevelPublicMeta.md +51 -0
  28. package/docs/interfaces/SAWPrizesHistory.md +18 -0
  29. package/docs/interfaces/StoreCategory.md +19 -0
  30. package/docs/interfaces/StoreCategoryPublicMeta.md +19 -0
  31. package/docs/interfaces/StoreItem.md +59 -0
  32. package/docs/interfaces/TStoreItem.md +25 -1
  33. package/docs/interfaces/TUICustomSection.md +8 -0
  34. package/docs/interfaces/Tournament.md +187 -0
  35. package/docs/interfaces/TournamentPlayer.md +75 -0
  36. package/docs/interfaces/TournamentPrize.md +75 -0
  37. package/docs/interfaces/UICustomSection.md +123 -0
  38. package/docs/interfaces/UserAchievement.md +275 -0
  39. package/docs/interfaces/UserAchievementTask.md +67 -0
  40. package/docs/native/ADDING_METHODS.md +38 -0
  41. package/docs/native/PROTOCOL.md +2264 -0
  42. package/package.json +1 -1
  43. package/src/{PointsHistory/PointsHistoryLog.ts → ActivityLog/ActivityLogEntry.ts} +2 -1
  44. package/src/{PointsHistory/GetPointsHistoryRequest.ts → ActivityLog/GetActivityLogRequest.ts} +2 -1
  45. package/src/{PointsHistory/GetPointsHistoryResponse.ts → ActivityLog/GetActivityLogResponse.ts} +9 -8
  46. package/src/{PointsHistory → ActivityLog}/PointChangeSourceType.ts +1 -0
  47. package/src/{PointsHistory → ActivityLog}/UserBalanceType.ts +1 -0
  48. package/src/ActivityLog/index.ts +7 -0
  49. package/src/Analytics/AnalyticStoreData.ts +1 -1
  50. package/src/CustomSections/AchCustomSection.ts +1 -1
  51. package/src/CustomSections/UICustomSection.ts +7 -0
  52. package/src/SmarticoAPI.ts +10 -10
  53. package/src/Store/StoreItem.ts +3 -0
  54. package/src/Store/StoreItemPublicMeta.ts +3 -0
  55. package/src/WSAPI/WSAPI.ts +16 -16
  56. package/src/WSAPI/WSAPITypes.ts +13 -4
  57. package/src/index.ts +1 -1
  58. package/dist/PointsHistory/GetPointsHistoryResponse.d.ts +0 -7
  59. package/dist/PointsHistory/index.d.ts +0 -5
  60. package/src/PointsHistory/index.ts +0 -6
  61. /package/dist/{PointsHistory → ActivityLog}/PointChangeSourceType.d.ts +0 -0
  62. /package/dist/{PointsHistory → ActivityLog}/UserBalanceType.d.ts +0 -0
@@ -1013,7 +1013,10 @@ const StoreItemTransform = items => {
1013
1013
  active_till_date: r.activeTillDate,
1014
1014
  discounted_price: r.itemPublicMeta.discount_prize,
1015
1015
  discount_price_ribbon: r.itemPublicMeta.discount_prize_ribbon,
1016
- custom_ribbon_image: r.itemPublicMeta.custom_ribbon_image
1016
+ custom_ribbon_image: r.itemPublicMeta.custom_ribbon_image,
1017
+ custom_section_id: r.itemPublicMeta.custom_section_id,
1018
+ only_in_custom_section: r.itemPublicMeta.only_in_custom_section,
1019
+ custom_section_type_id: r.itemPublicMeta.custom_section_type_id
1017
1020
  };
1018
1021
  return x;
1019
1022
  });
@@ -2129,7 +2132,7 @@ var onUpdateContextKey;
2129
2132
  onUpdateContextKey["JackpotEligibleGames"] = "jackpotEligibleGames";
2130
2133
  onUpdateContextKey["CurrentLevel"] = "currentLevel";
2131
2134
  onUpdateContextKey["InboxUnreadCount"] = "inboxUnreadCount";
2132
- onUpdateContextKey["PointsHistory"] = "pointsHistory";
2135
+ onUpdateContextKey["ActivityLog"] = "activityLog";
2133
2136
  })(onUpdateContextKey || (onUpdateContextKey = {}));
2134
2137
  /** @group General API */
2135
2138
  class WSAPI {
@@ -2183,7 +2186,7 @@ class WSAPI {
2183
2186
  this.updateInboxUnreadCount(data.props.core_inbox_unread_count);
2184
2187
  }
2185
2188
  if ((data == null || (_data$props3 = data.props) == null ? void 0 : _data$props3.ach_points_balance) !== undefined || (data == null || (_data$props4 = data.props) == null ? void 0 : _data$props4.ach_gems_balance) !== undefined || (data == null || (_data$props5 = data.props) == null ? void 0 : _data$props5.ach_diamonds_balance) !== undefined) {
2186
- this.notifyPointsHistoryUpdate();
2189
+ this.notifyActivityLogUpdate();
2187
2190
  }
2188
2191
  });
2189
2192
  on(ClassId.RAF_OPTIN_RESPONSE, () => this.updateRaffles());
@@ -2908,18 +2911,18 @@ class WSAPI {
2908
2911
  this.api.reportEngagementAction(null, engagement_uid, activityType, action);
2909
2912
  }
2910
2913
  /**
2911
- * Returns the points history for a user within a specified time range.
2914
+ * Returns the activity log for a user within a specified time range.
2912
2915
  * The response includes both points changes and gems/diamonds changes.
2913
2916
  * Each log entry contains information about the change amount, balance, and source.
2914
2917
  * The returned list is cached for 30 seconds.
2915
- * You can pass the onUpdate callback as a parameter, it will be called every time the points history is updated and will provide the updated list of points history logs for the last 10 minutes.
2918
+ * You can pass the onUpdate callback as a parameter, it will be called every time the activity log is updated and will provide the updated list of activity logs for the last 10 minutes.
2916
2919
  *
2917
2920
  * **Example**:
2918
2921
  * ```
2919
2922
  * const startTime = Math.floor(Date.now() / 1000) - 86400 * 30; // 30 days ago
2920
2923
  * const endTime = Math.floor(Date.now() / 1000); // now
2921
2924
  *
2922
- * _smartico.api.getPointsHistory({
2925
+ * _smartico.api.getActivityLog({
2923
2926
  * startTimeSeconds: startTime,
2924
2927
  * endTimeSeconds: endTime,
2925
2928
  * onUpdate: (data) => console.log('Updated:', data)
@@ -2932,17 +2935,17 @@ class WSAPI {
2932
2935
  *
2933
2936
  * @param params.startTimeSeconds - Start time in seconds (epoch timestamp)
2934
2937
  * @param params.endTimeSeconds - End time in seconds (epoch timestamp)
2935
- * @param params.onUpdate - Optional callback function that will be called when the points history is updated
2938
+ * @param params.onUpdate - Optional callback function that will be called when the activity log is updated
2936
2939
  */
2937
- async getPointsHistory({
2940
+ async getActivityLog({
2938
2941
  startTimeSeconds,
2939
2942
  endTimeSeconds,
2940
2943
  onUpdate
2941
2944
  }) {
2942
2945
  if (onUpdate) {
2943
- this.onUpdateCallback.set(onUpdateContextKey.PointsHistory, onUpdate);
2946
+ this.onUpdateCallback.set(onUpdateContextKey.ActivityLog, onUpdate);
2944
2947
  }
2945
- return await OCache.use(onUpdateContextKey.PointsHistory, ECacheContext.WSAPI, () => this.api.getPointsHistoryT(null, startTimeSeconds, endTimeSeconds), CACHE_DATA_SEC);
2948
+ return await OCache.use(onUpdateContextKey.ActivityLog, ECacheContext.WSAPI, () => this.api.getActivityLogT(null, startTimeSeconds, endTimeSeconds), CACHE_DATA_SEC);
2946
2949
  }
2947
2950
  async updateOnSpin(data) {
2948
2951
  const templates = await OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, () => this.api.sawGetTemplatesT(null), CACHE_DATA_SEC);
@@ -2985,11 +2988,11 @@ class WSAPI {
2985
2988
  const payload = await this.api.getRafflesT(null);
2986
2989
  this.updateEntity(onUpdateContextKey.Raffles, payload);
2987
2990
  }
2988
- async notifyPointsHistoryUpdate() {
2991
+ async notifyActivityLogUpdate() {
2989
2992
  const startSeconds = Date.now() / 1000 - 600;
2990
2993
  const endSeconds = Date.now() / 1000;
2991
- const payload = await this.api.getPointsHistoryT(null, startSeconds, endSeconds);
2992
- this.updateEntity(onUpdateContextKey.PointsHistory, payload);
2994
+ const payload = await this.api.getActivityLogT(null, startSeconds, endSeconds);
2995
+ this.updateEntity(onUpdateContextKey.ActivityLog, payload);
2993
2996
  }
2994
2997
  async updateEntity(contextKey, payload) {
2995
2998
  OCache.set(contextKey, payload, ECacheContext.WSAPI);
@@ -3317,7 +3320,7 @@ var AchCustomSectionType;
3317
3320
  AchCustomSectionType[AchCustomSectionType["REDIRECT_LINK"] = 9] = "REDIRECT_LINK";
3318
3321
  AchCustomSectionType[AchCustomSectionType["LOOTBOX_WEEKLY"] = 10] = "LOOTBOX_WEEKLY";
3319
3322
  AchCustomSectionType[AchCustomSectionType["LOOTBOX_CALENDAR_DAYS"] = 11] = "LOOTBOX_CALENDAR_DAYS";
3320
- AchCustomSectionType[AchCustomSectionType["TREASURE_HUNT"] = 12] = "TREASURE_HUNT";
3323
+ AchCustomSectionType[AchCustomSectionType["STORE"] = 12] = "STORE";
3321
3324
  AchCustomSectionType[AchCustomSectionType["RAFFLE"] = 13] = "RAFFLE";
3322
3325
  AchCustomSectionType[AchCustomSectionType["BADGES"] = 14] = "BADGES";
3323
3326
  })(AchCustomSectionType || (AchCustomSectionType = {}));
@@ -3381,6 +3384,8 @@ const UICustomSectionTransform = response => {
3381
3384
  liquid_template: r.liquid_template
3382
3385
  } : {}, r.section_type_id === AchCustomSectionType.BADGES ? {
3383
3386
  ach_category_ids: r.ach_category_ids
3387
+ } : {}, r.section_type_id === AchCustomSectionType.STORE ? {
3388
+ shop_category_ids: r.shop_category_ids
3384
3389
  } : {});
3385
3390
  items.push(x);
3386
3391
  }
@@ -3421,7 +3426,7 @@ var UserBalanceType;
3421
3426
  UserBalanceType[UserBalanceType["Diamonds"] = 2] = "Diamonds";
3422
3427
  })(UserBalanceType || (UserBalanceType = {}));
3423
3428
 
3424
- const PointsHistoryTransform = items => {
3429
+ const ActivityLogTransform = items => {
3425
3430
  if (!items) {
3426
3431
  return [];
3427
3432
  }
@@ -4256,15 +4261,15 @@ class SmarticoAPI {
4256
4261
  const message = this.buildMessage(user_ext_id, ClassId.RAF_OPTIN_REQUEST, props);
4257
4262
  return await this.send(message, ClassId.RAF_OPTIN_RESPONSE);
4258
4263
  }
4259
- async getPointsHistory(user_ext_id, startTimeSeconds, endTimeSeconds) {
4264
+ async getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds) {
4260
4265
  const message = this.buildMessage(user_ext_id, ClassId.GET_POINT_HISTORY_REQUEST, {
4261
4266
  startTimeSeconds: Math.floor(startTimeSeconds),
4262
4267
  endTimeSeconds: Math.floor(endTimeSeconds)
4263
4268
  });
4264
4269
  return await this.send(message, ClassId.GET_POINT_HISTORY_RESPONSE);
4265
4270
  }
4266
- async getPointsHistoryT(user_ext_id, startTimeSeconds, endTimeSeconds) {
4267
- return PointsHistoryTransform((await this.getPointsHistory(user_ext_id, startTimeSeconds, endTimeSeconds)).logHistory);
4271
+ async getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds) {
4272
+ return ActivityLogTransform((await this.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds)).logHistory);
4268
4273
  }
4269
4274
  }
4270
4275
 
@@ -4309,7 +4314,7 @@ var AnalyticsScreenNameId;
4309
4314
  AnalyticsScreenNameId[AnalyticsScreenNameId["LootboxCalendarDays"] = 21] = "LootboxCalendarDays";
4310
4315
  AnalyticsScreenNameId[AnalyticsScreenNameId["TreasureHunt"] = 22] = "TreasureHunt";
4311
4316
  AnalyticsScreenNameId[AnalyticsScreenNameId["LiquidSection"] = 23] = "LiquidSection";
4312
- AnalyticsScreenNameId[AnalyticsScreenNameId["PointsHistory"] = 24] = "PointsHistory";
4317
+ AnalyticsScreenNameId[AnalyticsScreenNameId["ActivityLog"] = 24] = "ActivityLog";
4313
4318
  AnalyticsScreenNameId[AnalyticsScreenNameId["ModalMission"] = 31] = "ModalMission";
4314
4319
  AnalyticsScreenNameId[AnalyticsScreenNameId["ModalLevel"] = 32] = "ModalLevel";
4315
4320
  AnalyticsScreenNameId[AnalyticsScreenNameId["ModalBadge"] = 33] = "ModalBadge";
@@ -4732,5 +4737,5 @@ var JackpotType;
4732
4737
  JackpotType[JackpotType["Personal"] = 2] = "Personal";
4733
4738
  })(JackpotType || (JackpotType = {}));
4734
4739
 
4735
- export { AchCategoryTransform, AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter, AchievementAvailabilityStatus, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, AnalyticsInboxSubScreenNameId, AnalyticsInterfaceType, AnalyticsScreenNameId, AnalyticsTournamentsLobbySubScreenNameId, AttemptPeriodType, BadgesTimeLimitStates, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GetJackpotEligibleGamesResponseTransform, GetJackpotWinnersResponseTransform, GetLevelMapResponseTransform, InboxCategories, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, InboxReadStatus, JackPotTemparature, JackpotContributionType, JackpotType, LeaderBoardPeriodType, LiquidEntityData, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, MissionCategory, MissionUtils, OCache, OpenLinksType, PointChangeSourceType, PointsHistoryTransform, PrizeModifiers, PrizeModifiersKeysNames, PublicLabelSettings, QuizAnswersValueType, QuizMarketPerSport, QuizSportType, RaffleDrawInstanceState, RaffleDrawTypeExecution, SAWAcknowledgeType, SAWAcknowledgeTypeName, SAWAcknowledgeTypeNamed, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWExposeUserSpinId, SAWGPMarketType, SAWGameDifficultyType, SAWGameDifficultyTypeName, SAWGameLayout, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWHistoryTransform, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWheelLayout, SAWWinSoundFiles, SAWWinSoundType, SawGameDifficultyTypeNamed, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchaseType, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UICustomSectionTransform, UserAchievementTransform, UserBalanceType, drawRunHistoryTransform, drawRunTransform, drawTransform, enrichUserAchievementsWithBadgeState, getLeaderBoardTransform, marketsInfo, prizeTransform, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, raffleClaimPrizeResponseTransform, raffleTransform, ticketsTransform, tournamentInfoItemTransform, winnersTransform };
4740
+ export { AchCategoryTransform, AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter, AchievementAvailabilityStatus, AchievementStatus, AchievementTaskType, AchievementType, ActivityLogTransform, ActivityTypeLimited, AnalyticsInboxSubScreenNameId, AnalyticsInterfaceType, AnalyticsScreenNameId, AnalyticsTournamentsLobbySubScreenNameId, AttemptPeriodType, BadgesTimeLimitStates, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GetJackpotEligibleGamesResponseTransform, GetJackpotWinnersResponseTransform, GetLevelMapResponseTransform, InboxCategories, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, InboxReadStatus, JackPotTemparature, JackpotContributionType, JackpotType, LeaderBoardPeriodType, LiquidEntityData, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, MissionCategory, MissionUtils, OCache, OpenLinksType, PointChangeSourceType, PrizeModifiers, PrizeModifiersKeysNames, PublicLabelSettings, QuizAnswersValueType, QuizMarketPerSport, QuizSportType, RaffleDrawInstanceState, RaffleDrawTypeExecution, SAWAcknowledgeType, SAWAcknowledgeTypeName, SAWAcknowledgeTypeNamed, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWExposeUserSpinId, SAWGPMarketType, SAWGameDifficultyType, SAWGameDifficultyTypeName, SAWGameLayout, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWHistoryTransform, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWheelLayout, SAWWinSoundFiles, SAWWinSoundType, SawGameDifficultyTypeNamed, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchaseType, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UICustomSectionTransform, UserAchievementTransform, UserBalanceType, drawRunHistoryTransform, drawRunTransform, drawTransform, enrichUserAchievementsWithBadgeState, getLeaderBoardTransform, marketsInfo, prizeTransform, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, raffleClaimPrizeResponseTransform, raffleTransform, ticketsTransform, tournamentInfoItemTransform, winnersTransform };
4736
4741
  //# sourceMappingURL=index.modern.mjs.map