@smartico/public-api 0.0.333 → 0.0.335

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.
@@ -26,6 +26,7 @@ export declare enum AnalyticsScreenNameId {
26
26
  LootboxCalendarDays = 21,
27
27
  TreasureHunt = 22,
28
28
  LiquidSection = 23,
29
+ PointsHistory = 24,
29
30
  ModalMission = 31,
30
31
  ModalLevel = 32,
31
32
  ModalBadge = 33,
@@ -14,5 +14,5 @@ export declare class MissionUtils {
14
14
  task: UserAchievementTask;
15
15
  currencySymbol?: string;
16
16
  }) => UserAchievementTask;
17
- static determineBadgeState: (badge: UserAchievement) => BadgesTimeLimitStates;
17
+ static determineBadgeState: (badge: UserAchievement) => BadgesTimeLimitStates | null;
18
18
  }
@@ -2,4 +2,6 @@ import { ProtocolMessage } from '../Base/ProtocolMessage';
2
2
  export interface GetDrawRunRequest extends ProtocolMessage {
3
3
  raffle_id: number;
4
4
  run_id: number;
5
+ winners_limit?: number;
6
+ winners_offset?: number;
5
7
  }
@@ -91,5 +91,17 @@ interface RaffleDraw {
91
91
  * If true, the user needs to opt-in to the raffle before they can participate.
92
92
  */
93
93
  requires_optin: boolean;
94
+ /**
95
+ * The number of winners to return
96
+ */
97
+ winners_limit?: number;
98
+ /**
99
+ * The offset of the winners to return
100
+ */
101
+ winners_offset?: number;
102
+ /**
103
+ * The total number of winners
104
+ */
105
+ winners_total?: number;
94
106
  }
95
107
  export { RaffleDraw };
@@ -117,6 +117,8 @@ export interface TMiniGameTemplate {
117
117
  description: string;
118
118
  /** URL of the icon of the mini-game template */
119
119
  thumbnail: string;
120
+ /** Indicates if the mini-game is visible when the user have attempts/points/gems/diamonds to play */
121
+ visibile_when_can_spin?: boolean;
120
122
  /** The type of the game, e.g. Spin the Wheel, Gift Box, Scratch card, MatchX etc */
121
123
  saw_game_type: SAWGameTypeName;
122
124
  /** How the user is charged for each game attempt e.g. Free, Points or Spin attempts */
@@ -1144,6 +1146,18 @@ export interface TRaffleDraw {
1144
1146
  * If true, the user needs to opt-in to the raffle before they can participate.
1145
1147
  */
1146
1148
  requires_optin: boolean;
1149
+ /**
1150
+ * The number of winners to return
1151
+ */
1152
+ winners_limit?: number;
1153
+ /**
1154
+ * The offset of the winners to return
1155
+ */
1156
+ winners_offset?: number;
1157
+ /**
1158
+ * The total number of winners
1159
+ */
1160
+ winners_total?: number;
1147
1161
  }
1148
1162
  export interface TRaffleDrawRun {
1149
1163
  /**
package/dist/index.js CHANGED
@@ -431,6 +431,7 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
431
431
  name: r.saw_template_ui_definition.name,
432
432
  description: r.saw_template_ui_definition.description,
433
433
  thumbnail: r.saw_template_ui_definition.thumbnail ? r.saw_template_ui_definition.thumbnail : (_r$saw_skin_ui_defini = r.saw_skin_ui_definition) != null && _r$saw_skin_ui_defini.skin_folder ? r.saw_skin_ui_definition.skin_folder + "/ico.png" : "https://d312ucx3huj7iy.cloudfront.net/gf/images/saw/" + r.saw_skin_key + "/ico.png",
434
+ visibile_when_can_spin: r.visibile_when_can_spin,
434
435
  over_limit_message: r.saw_template_ui_definition.over_limit_message,
435
436
  no_attempts_message: r.saw_template_ui_definition.no_attempts_message,
436
437
  jackpot_symbol: r.saw_template_ui_definition.jackpot_symbol,
@@ -1401,7 +1402,13 @@ MissionUtils.determineBadgeState = function (badge) {
1401
1402
  var now = Date.now();
1402
1403
  var active_from_ts = badge.active_from_ts,
1403
1404
  active_till_ts = badge.active_till_ts,
1404
- progress = badge.progress;
1405
+ progress = badge.progress,
1406
+ isCompleted = badge.isCompleted,
1407
+ complete_date_ts = badge.complete_date_ts;
1408
+ // If badge is completed before active till date, return null
1409
+ if (isCompleted && (!active_till_ts || complete_date_ts < active_till_ts)) {
1410
+ return null;
1411
+ }
1405
1412
  // 1. BEFORE START
1406
1413
  if (active_from_ts > now) {
1407
1414
  return exports.BadgesTimeLimitStates.BeforeStartDate;
@@ -1972,7 +1979,10 @@ var drawTransform = function drawTransform(items) {
1972
1979
  my_tickets_count: item.my_tickets_count,
1973
1980
  my_last_tickets: ticketsTransform(item.my_last_tickets),
1974
1981
  user_opted_in: Boolean(item.user_opted_in),
1975
- requires_optin: Boolean(item.requires_optin)
1982
+ requires_optin: Boolean(item.requires_optin),
1983
+ winners_limit: item.winners_limit,
1984
+ winners_offset: item.winners_offset,
1985
+ winners_total: item.winners_total
1976
1986
  };
1977
1987
  });
1978
1988
  };
@@ -2022,7 +2032,10 @@ var drawRunTransform = function drawRunTransform(res) {
2022
2032
  my_tickets_count: res.draw.my_tickets_count,
2023
2033
  my_last_tickets: ticketsTransform(res.draw.my_last_tickets),
2024
2034
  user_opted_in: Boolean(res.draw.user_opted_in),
2025
- requires_optin: Boolean(res.draw.requires_optin)
2035
+ requires_optin: Boolean(res.draw.requires_optin),
2036
+ winners_limit: res.draw.winners_limit,
2037
+ winners_offset: res.draw.winners_offset,
2038
+ winners_total: res.draw.winners_total
2026
2039
  };
2027
2040
  };
2028
2041
 
@@ -5235,8 +5248,8 @@ var SmarticoAPI = /*#__PURE__*/function () {
5235
5248
  try {
5236
5249
  var _this75 = this;
5237
5250
  var message = _this75.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, {
5238
- startTimeSeconds: startTimeSeconds,
5239
- endTimeSeconds: endTimeSeconds
5251
+ startTimeSeconds: Math.floor(startTimeSeconds),
5252
+ endTimeSeconds: Math.floor(endTimeSeconds)
5240
5253
  });
5241
5254
  return Promise.resolve(_this75.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
5242
5255
  } catch (e) {
@@ -5301,6 +5314,7 @@ exports.AnalyticsScreenNameId = void 0;
5301
5314
  AnalyticsScreenNameId[AnalyticsScreenNameId["LootboxCalendarDays"] = 21] = "LootboxCalendarDays";
5302
5315
  AnalyticsScreenNameId[AnalyticsScreenNameId["TreasureHunt"] = 22] = "TreasureHunt";
5303
5316
  AnalyticsScreenNameId[AnalyticsScreenNameId["LiquidSection"] = 23] = "LiquidSection";
5317
+ AnalyticsScreenNameId[AnalyticsScreenNameId["PointsHistory"] = 24] = "PointsHistory";
5304
5318
  AnalyticsScreenNameId[AnalyticsScreenNameId["ModalMission"] = 31] = "ModalMission";
5305
5319
  AnalyticsScreenNameId[AnalyticsScreenNameId["ModalLevel"] = 32] = "ModalLevel";
5306
5320
  AnalyticsScreenNameId[AnalyticsScreenNameId["ModalBadge"] = 33] = "ModalBadge";