@smartico/public-api 0.0.246 → 0.0.247

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.
@@ -4,3 +4,4 @@ export * from './LeaderBoardDetails';
4
4
  export * from './LeaderBoardPeriodType';
5
5
  export * from './LeaderBoardPosition';
6
6
  export * from './LeaderBoardPublicMeta';
7
+ export * from './LeaderBoards';
@@ -25,4 +25,5 @@ export interface SAWPrizeUI {
25
25
  allow_split_decimal?: boolean;
26
26
  hide_prize_from_history?: boolean;
27
27
  hide_prize_till_won?: boolean;
28
+ requirements_to_get_prize?: string;
28
29
  }
@@ -12,5 +12,7 @@ export declare enum SAWSpinErrorCode {
12
12
  /** User tries to play a template that is restricted by date */
13
13
  SAW_TEMPLATE_NOT_ACTIVE = 40007,
14
14
  /** Special code for the 'visitor' mode */
15
- SAW_VISITOR_STOP_SPIN_REQUEST = -40001
15
+ SAW_VISITOR_STOP_SPIN_REQUEST = -40001,
16
+ /** User is not in the segment */
17
+ SAW_NOT_IN_SEGMENT = 40009
16
18
  }
@@ -72,6 +72,8 @@ export interface TMiniGamePrize {
72
72
  allow_split_decimal?: boolean;
73
73
  /** When enabled, you can hide prize from prize history */
74
74
  hide_prize_from_history?: boolean;
75
+ /** Requirements to claim the prize (lootbox specific)*/
76
+ requirements_to_get_prize?: string;
75
77
  }
76
78
  /**
77
79
  * TMiniGamePlayResult describes the response of call to _smartico.api.playMiniGame(template_id) method
package/dist/index.js CHANGED
@@ -458,7 +458,8 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
458
458
  custom_data: IntUtils.JsonOrText((_p$saw_prize_ui_defin = p.saw_prize_ui_definition) == null ? void 0 : _p$saw_prize_ui_defin.custom_data),
459
459
  prize_modifiers: p.saw_prize_ui_definition.prize_modifiers,
460
460
  allow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,
461
- hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history
461
+ hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history,
462
+ requirements_to_get_prize: p.saw_prize_ui_definition.requirements_to_get_prize
462
463
  };
463
464
  return y;
464
465
  })
@@ -486,6 +487,8 @@ exports.SAWSpinErrorCode = void 0;
486
487
  SAWSpinErrorCode[SAWSpinErrorCode["SAW_TEMPLATE_NOT_ACTIVE"] = 40007] = "SAW_TEMPLATE_NOT_ACTIVE";
487
488
  /** Special code for the 'visitor' mode */
488
489
  SAWSpinErrorCode[SAWSpinErrorCode["SAW_VISITOR_STOP_SPIN_REQUEST"] = -40001] = "SAW_VISITOR_STOP_SPIN_REQUEST";
490
+ /** User is not in the segment */
491
+ SAWSpinErrorCode[SAWSpinErrorCode["SAW_NOT_IN_SEGMENT"] = 40009] = "SAW_NOT_IN_SEGMENT";
489
492
  })(exports.SAWSpinErrorCode || (exports.SAWSpinErrorCode = {}));
490
493
 
491
494
  var _SAWWinSoundFiles;
@@ -1553,6 +1556,52 @@ exports.LeaderBoardPeriodType = void 0;
1553
1556
  LeaderBoardPeriodType[LeaderBoardPeriodType["MONTHLY"] = 3] = "MONTHLY";
1554
1557
  })(exports.LeaderBoardPeriodType || (exports.LeaderBoardPeriodType = {}));
1555
1558
 
1559
+ var pointsRewardTransform = function pointsRewardTransform(reward_points) {
1560
+ if (reward_points && reward_points.length) {
1561
+ return reward_points.map(function (r, i) {
1562
+ return {
1563
+ place: i + 1,
1564
+ points: r
1565
+ };
1566
+ });
1567
+ }
1568
+ return null;
1569
+ };
1570
+ var getLeaderBoardPlayerTransformed = function getLeaderBoardPlayerTransformed(user, isMe) {
1571
+ if (user) {
1572
+ var x = {
1573
+ public_username: (user == null ? void 0 : user.public_username) || user.user_alt_name,
1574
+ avatar_url: user.avatar_url,
1575
+ position: user.position_in_board,
1576
+ points: user.points_accumulated,
1577
+ is_me: user.is_me
1578
+ };
1579
+ if (isMe) {
1580
+ delete x.is_me;
1581
+ }
1582
+ return x;
1583
+ }
1584
+ return null;
1585
+ };
1586
+ var getLeaderBoardTransform = function getLeaderBoardTransform(board) {
1587
+ if (board) {
1588
+ var x = {
1589
+ board_id: board.board_id,
1590
+ name: board.board_public_meta.name,
1591
+ description: board.board_public_meta.description,
1592
+ rules: board.board_public_meta.rules,
1593
+ period_type_id: board.period_type_id,
1594
+ rewards: pointsRewardTransform(board.reward_points),
1595
+ users: board.positions.map(function (p) {
1596
+ return getLeaderBoardPlayerTransformed(p);
1597
+ }),
1598
+ me: getLeaderBoardPlayerTransformed(board.userPosition, true)
1599
+ };
1600
+ return x;
1601
+ }
1602
+ return null;
1603
+ };
1604
+
1556
1605
  var GetLevelMapResponseTransform = function GetLevelMapResponseTransform(levels) {
1557
1606
  return levels == null ? void 0 : levels.levels.map(function (l) {
1558
1607
  var _l$level_public_meta;
@@ -2812,52 +2861,6 @@ var WSAPI = /*#__PURE__*/function () {
2812
2861
  return WSAPI;
2813
2862
  }();
2814
2863
 
2815
- var pointsRewardTransform = function pointsRewardTransform(reward_points) {
2816
- if (reward_points && reward_points.length) {
2817
- return reward_points.map(function (r, i) {
2818
- return {
2819
- place: i + 1,
2820
- points: r
2821
- };
2822
- });
2823
- }
2824
- return null;
2825
- };
2826
- var getLeaderBoardPlayerTransformed = function getLeaderBoardPlayerTransformed(user, isMe) {
2827
- if (user) {
2828
- var x = {
2829
- public_username: (user == null ? void 0 : user.public_username) || user.user_alt_name,
2830
- avatar_url: user.avatar_url,
2831
- position: user.position_in_board,
2832
- points: user.points_accumulated,
2833
- is_me: user.is_me
2834
- };
2835
- if (isMe) {
2836
- delete x.is_me;
2837
- }
2838
- return x;
2839
- }
2840
- return null;
2841
- };
2842
- var getLeaderBoardTransform = function getLeaderBoardTransform(board) {
2843
- if (board) {
2844
- var x = {
2845
- board_id: board.board_id,
2846
- name: board.board_public_meta.name,
2847
- description: board.board_public_meta.description,
2848
- rules: board.board_public_meta.rules,
2849
- period_type_id: board.period_type_id,
2850
- rewards: pointsRewardTransform(board.reward_points),
2851
- users: board.positions.map(function (p) {
2852
- return getLeaderBoardPlayerTransformed(p);
2853
- }),
2854
- me: getLeaderBoardPlayerTransformed(board.userPosition, true)
2855
- };
2856
- return x;
2857
- }
2858
- return null;
2859
- };
2860
-
2861
2864
  var AchCustomSectionType;
2862
2865
  (function (AchCustomSectionType) {
2863
2866
  AchCustomSectionType[AchCustomSectionType["HTML_PAGE"] = 1] = "HTML_PAGE";
@@ -4499,6 +4502,7 @@ exports.TournamentRegistrationStatusNamed = TournamentRegistrationStatusNamed;
4499
4502
  exports.TournamentRegistrationTypeGetName = TournamentRegistrationTypeGetName;
4500
4503
  exports.TournamentUtils = TournamentUtils;
4501
4504
  exports.UserAchievementTransform = UserAchievementTransform;
4505
+ exports.getLeaderBoardTransform = getLeaderBoardTransform;
4502
4506
  exports.marketsInfo = marketsInfo;
4503
4507
  exports.quizAnswerAwayTeamReplacementText = quizAnswerAwayTeamReplacementText;
4504
4508
  exports.quizAnswerHomeTeamReplacementText = quizAnswerHomeTeamReplacementText;