@smartico/public-api 0.0.131 → 0.0.133

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.
@@ -34,8 +34,6 @@ export declare enum ClassId {
34
34
  RELOAD_ACHIEVEMENTS_EVENT = 504,
35
35
  GET_LEADERS_BOARD_REQUEST = 505,
36
36
  GET_LEADERS_BOARD_RESPONSE = 506,
37
- GET_ACTIVITY_LOG_REQUEST = 507,
38
- GET_ACTIVITY_LOG_RESPONSE = 508,
39
37
  GET_SHOP_ITEMS_REQUEST = 509,
40
38
  GET_SHOP_ITEMS_RESPONSE = 510,
41
39
  BUY_SHOP_ITEM_REQUEST = 511,
@@ -5,5 +5,6 @@ declare class IntUtils {
5
5
  static replaceAll(value: string, regex: string, replacement: string | number): string;
6
6
  static escapeRegExp(v: string): string;
7
7
  static JsonOrText: (str: string) => any;
8
+ static isWithinPeriod: (timestamp: number, period: 'today' | 'thisWeek' | 'thisMonth') => boolean;
8
9
  }
9
10
  export { IntUtils };
@@ -5,5 +5,7 @@ interface JackpotPublicMeta {
5
5
  image_url: string;
6
6
  winner_template: JackpotHtmlTemplate;
7
7
  not_winner_template: JackpotHtmlTemplate;
8
+ placeholder1: string;
9
+ placeholder2: string;
8
10
  }
9
11
  export { JackpotPublicMeta };
@@ -4,7 +4,8 @@ export declare enum SAWGameType {
4
4
  ScratchCard = 2,
5
5
  MatchX = 3,
6
6
  GiftBox = 4,
7
- PrizeDrop = 5
7
+ PrizeDrop = 5,
8
+ Quiz = 6
8
9
  }
9
10
  export declare enum SAWGameTypeName {
10
11
  SpinAWheel = "wheel",
@@ -12,6 +13,7 @@ export declare enum SAWGameTypeName {
12
13
  MatchX = "matchx",
13
14
  GiftBox = "giftbox",
14
15
  PrizeDrop = "prizedrop",
16
+ Quiz = "quiz",
15
17
  Unknown = "unknown"
16
18
  }
17
19
  /** @hidden */
@@ -18,6 +18,7 @@ export interface UserAchievement {
18
18
  time_limit_ms?: number;
19
19
  progress?: number;
20
20
  complete_date?: string;
21
+ complete_date_ts?: number;
21
22
  unlock_date?: string;
22
23
  milliseconds_till_available?: number;
23
24
  completed_tasks?: number;
@@ -30,5 +31,8 @@ export interface UserAchievement {
30
31
  ach_completed_id?: number;
31
32
  requires_prize_claim?: boolean;
32
33
  prize_claimed_date_ts?: number;
34
+ completed_today?: boolean;
35
+ completed_this_week?: boolean;
36
+ completed_this_month?: boolean;
33
37
  }
34
38
  export declare const UserAchievementTransform: (items: UserAchievement[]) => TMissionOrBadge[];
@@ -150,8 +150,6 @@ declare enum ClassId {
150
150
  RELOAD_ACHIEVEMENTS_EVENT = 504,
151
151
  GET_LEADERS_BOARD_REQUEST = 505,
152
152
  GET_LEADERS_BOARD_RESPONSE = 506,
153
- GET_ACTIVITY_LOG_REQUEST = 507,
154
- GET_ACTIVITY_LOG_RESPONSE = 508,
155
153
  GET_SHOP_ITEMS_REQUEST = 509,
156
154
  GET_SHOP_ITEMS_RESPONSE = 510,
157
155
  BUY_SHOP_ITEM_REQUEST = 511,
@@ -3,6 +3,9 @@ import { StoreItem } from "./StoreItem";
3
3
  interface StoreItemPurchased extends StoreItem {
4
4
  purchase_ts: number;
5
5
  purchase_points_amount: number;
6
+ purchased_today?: boolean;
7
+ purchased_this_week?: boolean;
8
+ purchased_this_month?: boolean;
6
9
  }
7
10
  export declare const StoreItemPurchasedTransform: (items: StoreItemPurchased[]) => TStoreItem[];
8
11
  export { StoreItemPurchased };
@@ -1,7 +1,7 @@
1
1
  import { SmarticoAPI } from "../SmarticoAPI";
2
2
  import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUserProfile, UserLevelExtraCountersT } from "./WSAPITypes";
3
3
  import { LeaderBoardPeriodType } from "../Leaderboard";
4
- import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from "src/Jackpots";
4
+ import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from "../Jackpots";
5
5
  /** @group General API */
6
6
  export declare class WSAPI {
7
7
  private api;
@@ -76,6 +76,7 @@ export interface TMiniGameTemplate {
76
76
  promo_text: string;
77
77
  /** The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number */
78
78
  custom_data: any;
79
+ /** List of prizes for mini-games */
79
80
  prizes: TMiniGamePrize[];
80
81
  }
81
82
  /**
@@ -286,8 +287,11 @@ export interface TTournamentDetailed extends TTournament {
286
287
  * TStoreCategory describes the store category item. Each store item can be assigned to 1 or more categories
287
288
  */
288
289
  export interface TStoreCategory {
290
+ /**ID of the store category */
289
291
  id: number;
292
+ /**Name of the store category */
290
293
  name: string;
294
+ /**Order of the store category among other categories. Default value is 1 */
291
295
  order: number;
292
296
  }
293
297
  /**
@@ -332,13 +336,22 @@ export interface TStoreItem {
332
336
  purchase_ts?: number;
333
337
  /** The amount of points you can purchase an item */
334
338
  purchase_points_amount?: number;
339
+ /** Flag for store item indicating that it was purchased today */
340
+ purchased_today?: boolean;
341
+ /** Flag for store item indicating that it was purchased this week */
342
+ purchased_this_week?: boolean;
343
+ /** Flag for store item indicating that it was purchased this month */
344
+ purchased_this_month?: boolean;
335
345
  }
336
346
  /**
337
347
  * TAchCategory describes the badge category item. Each badge item can be assigned to 1 or more categories
338
348
  */
339
349
  export interface TAchCategory {
350
+ /**ID of the badge category */
340
351
  id: number;
352
+ /**Name of the badge category */
341
353
  name: string;
354
+ /**Order of the badge category among other categories. Default value is 1 */
342
355
  order: number;
343
356
  }
344
357
  /**
@@ -410,6 +423,12 @@ export interface TMissionOrBadge {
410
423
  requires_prize_claim?: boolean;
411
424
  /** The date/timestamp indicating when the prize was claimed by the user */
412
425
  prize_claimed_date_ts?: number;
426
+ /** Flag for mission/badge indicating that mission/badge completed today */
427
+ completed_today?: boolean;
428
+ /** Flag for mission/badge indicating that mission/badge completed this week */
429
+ completed_this_week?: boolean;
430
+ /** Flag for mission/badge indicating that mission/badge completed this month */
431
+ completed_this_month?: boolean;
413
432
  }
414
433
  export interface AchRelatedGame {
415
434
  /** The ID of the related game */
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export * from './Tournaments';
12
12
  export * from './Level';
13
13
  export * from './Quiz';
14
14
  export * from './Jackpots';
15
+ export * from './OCache';
package/dist/index.js CHANGED
@@ -38,8 +38,6 @@ exports.ClassId = void 0;
38
38
  ClassId[ClassId["RELOAD_ACHIEVEMENTS_EVENT"] = 504] = "RELOAD_ACHIEVEMENTS_EVENT";
39
39
  ClassId[ClassId["GET_LEADERS_BOARD_REQUEST"] = 505] = "GET_LEADERS_BOARD_REQUEST";
40
40
  ClassId[ClassId["GET_LEADERS_BOARD_RESPONSE"] = 506] = "GET_LEADERS_BOARD_RESPONSE";
41
- ClassId[ClassId["GET_ACTIVITY_LOG_REQUEST"] = 507] = "GET_ACTIVITY_LOG_REQUEST";
42
- ClassId[ClassId["GET_ACTIVITY_LOG_RESPONSE"] = 508] = "GET_ACTIVITY_LOG_RESPONSE";
43
41
  ClassId[ClassId["GET_SHOP_ITEMS_REQUEST"] = 509] = "GET_SHOP_ITEMS_REQUEST";
44
42
  ClassId[ClassId["GET_SHOP_ITEMS_RESPONSE"] = 510] = "GET_SHOP_ITEMS_RESPONSE";
45
43
  ClassId[ClassId["BUY_SHOP_ITEM_REQUEST"] = 511] = "BUY_SHOP_ITEM_REQUEST";
@@ -186,6 +184,26 @@ IntUtils.JsonOrText = function (str) {
186
184
  }
187
185
  return str;
188
186
  };
187
+ IntUtils.isWithinPeriod = function (timestamp, period) {
188
+ var now = new Date();
189
+ var completedDate = new Date(timestamp * 1000);
190
+ switch (period) {
191
+ case 'today':
192
+ return now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth() && now.getDate() === completedDate.getDate();
193
+ case "thisWeek":
194
+ var startOfWeek = new Date(now);
195
+ startOfWeek.setDate(now.getDate() - now.getDay());
196
+ startOfWeek.setHours(0, 0, 0, 0);
197
+ var endOfWeek = new Date(startOfWeek);
198
+ endOfWeek.setDate(startOfWeek.getDate() + 6);
199
+ endOfWeek.setHours(23, 59, 59, 999);
200
+ return completedDate >= startOfWeek && completedDate <= endOfWeek;
201
+ case "thisMonth":
202
+ return now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth();
203
+ default:
204
+ return false;
205
+ }
206
+ };
189
207
 
190
208
  /** @hidden */
191
209
  exports.SAWBuyInType = void 0;
@@ -254,6 +272,7 @@ exports.SAWGameType = void 0;
254
272
  SAWGameType[SAWGameType["MatchX"] = 3] = "MatchX";
255
273
  SAWGameType[SAWGameType["GiftBox"] = 4] = "GiftBox";
256
274
  SAWGameType[SAWGameType["PrizeDrop"] = 5] = "PrizeDrop";
275
+ SAWGameType[SAWGameType["Quiz"] = 6] = "Quiz";
257
276
  })(exports.SAWGameType || (exports.SAWGameType = {}));
258
277
  exports.SAWGameTypeName = void 0;
259
278
  (function (SAWGameTypeName) {
@@ -262,12 +281,13 @@ exports.SAWGameTypeName = void 0;
262
281
  SAWGameTypeName["MatchX"] = "matchx";
263
282
  SAWGameTypeName["GiftBox"] = "giftbox";
264
283
  SAWGameTypeName["PrizeDrop"] = "prizedrop";
284
+ SAWGameTypeName["Quiz"] = "quiz";
265
285
  SAWGameTypeName["Unknown"] = "unknown";
266
286
  })(exports.SAWGameTypeName || (exports.SAWGameTypeName = {}));
267
287
  /** @hidden */
268
288
  var SAWGameTypeNamed = function SAWGameTypeNamed(type) {
269
289
  var _SAWGameType$SpinAWhe;
270
- return (_SAWGameType$SpinAWhe = {}, _SAWGameType$SpinAWhe[exports.SAWGameType.SpinAWheel] = exports.SAWGameTypeName.SpinAWheel, _SAWGameType$SpinAWhe[exports.SAWGameType.ScratchCard] = exports.SAWGameTypeName.ScratchCard, _SAWGameType$SpinAWhe[exports.SAWGameType.MatchX] = exports.SAWGameTypeName.MatchX, _SAWGameType$SpinAWhe[exports.SAWGameType.GiftBox] = exports.SAWGameTypeName.GiftBox, _SAWGameType$SpinAWhe[exports.SAWGameType.PrizeDrop] = exports.SAWGameTypeName.PrizeDrop, _SAWGameType$SpinAWhe)[type] || exports.SAWGameTypeName.Unknown;
290
+ return (_SAWGameType$SpinAWhe = {}, _SAWGameType$SpinAWhe[exports.SAWGameType.SpinAWheel] = exports.SAWGameTypeName.SpinAWheel, _SAWGameType$SpinAWhe[exports.SAWGameType.ScratchCard] = exports.SAWGameTypeName.ScratchCard, _SAWGameType$SpinAWhe[exports.SAWGameType.MatchX] = exports.SAWGameTypeName.MatchX, _SAWGameType$SpinAWhe[exports.SAWGameType.GiftBox] = exports.SAWGameTypeName.GiftBox, _SAWGameType$SpinAWhe[exports.SAWGameType.PrizeDrop] = exports.SAWGameTypeName.PrizeDrop, _SAWGameType$SpinAWhe[exports.SAWGameType.Quiz] = exports.SAWGameTypeName.Quiz, _SAWGameType$SpinAWhe)[type] || exports.SAWGameTypeName.Unknown;
271
291
  };
272
292
 
273
293
  /** @hidden */
@@ -413,12 +433,12 @@ var NodeCache = /*#__PURE__*/function () {
413
433
  NodeCache.ttlChecker = void 0;
414
434
  NodeCache.cache = {};
415
435
 
416
- var ECacheContext;
436
+ exports.ECacheContext = void 0;
417
437
  (function (ECacheContext) {
418
438
  ECacheContext[ECacheContext["Translations"] = 0] = "Translations";
419
439
  ECacheContext[ECacheContext["LabelInfo"] = 1] = "LabelInfo";
420
440
  ECacheContext[ECacheContext["WSAPI"] = 2] = "WSAPI";
421
- })(ECacheContext || (ECacheContext = {}));
441
+ })(exports.ECacheContext || (exports.ECacheContext = {}));
422
442
  var OCache = /*#__PURE__*/function () {
423
443
  function OCache() {}
424
444
  OCache.init = function init(cacheContext) {
@@ -678,6 +698,9 @@ var StoreItemPurchasedTransform = function StoreItemPurchasedTransform(items) {
678
698
  return r.id >= 1;
679
699
  }).map(function (r) {
680
700
  var _StoreItemType$Bonus$, _r$categoryIds;
701
+ var purchasedToday = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'today') : false;
702
+ var purchasedThisWeek = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisWeek') : false;
703
+ var purchasedThisMonth = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisMonth') : false;
681
704
  var x = {
682
705
  id: r.id,
683
706
  name: r.itemPublicMeta.name,
@@ -694,7 +717,10 @@ var StoreItemPurchasedTransform = function StoreItemPurchasedTransform(items) {
694
717
  category_ids: (_r$categoryIds = r.categoryIds) != null ? _r$categoryIds : [],
695
718
  pool: r.shopPool,
696
719
  purchase_ts: r.purchase_ts,
697
- purchase_points_amount: r.purchase_points_amount
720
+ purchase_points_amount: r.purchase_points_amount,
721
+ purchased_today: purchasedToday,
722
+ purchased_this_week: purchasedThisWeek,
723
+ purchased_this_month: purchasedThisMonth
698
724
  };
699
725
  return x;
700
726
  });
@@ -727,6 +753,9 @@ var UserAchievementTransform = function UserAchievementTransform(items) {
727
753
  return r.ach_id >= 1;
728
754
  }).map(function (r) {
729
755
  var _r$ach_categories;
756
+ var completedToday = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'today') : false;
757
+ var completedThisWeek = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'thisWeek') : false;
758
+ var completedThisMonth = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'thisMonth') : false;
730
759
  var x = {
731
760
  id: r.ach_id,
732
761
  name: r.ach_public_meta.name,
@@ -778,7 +807,10 @@ var UserAchievementTransform = function UserAchievementTransform(items) {
778
807
  category_ids: (_r$ach_categories = r.ach_categories) != null ? _r$ach_categories : [],
779
808
  ach_completed_id: r.ach_completed_id,
780
809
  requires_prize_claim: r.requires_prize_claim,
781
- prize_claimed_date_ts: r.prize_claimed_date_ts
810
+ prize_claimed_date_ts: r.prize_claimed_date_ts,
811
+ completed_today: completedToday,
812
+ completed_this_week: completedThisWeek,
813
+ completed_this_month: completedThisMonth
782
814
  };
783
815
  return x;
784
816
  });
@@ -1107,10 +1139,10 @@ var WSAPI = /*#__PURE__*/function () {
1107
1139
  return _this.updateInboxMessages();
1108
1140
  });
1109
1141
  on(exports.ClassId.LOGOUT_RESPONSE, function () {
1110
- return OCache.clearContext(ECacheContext.WSAPI);
1142
+ return OCache.clearContext(exports.ECacheContext.WSAPI);
1111
1143
  });
1112
1144
  on(exports.ClassId.IDENTIFY_RESPONSE, function () {
1113
- return OCache.clearContext(ECacheContext.WSAPI);
1145
+ return OCache.clearContext(exports.ECacheContext.WSAPI);
1114
1146
  });
1115
1147
  on(exports.ClassId.JP_WIN_PUSH, function (data) {
1116
1148
  return _this.jackpotClearCache();
@@ -1187,7 +1219,7 @@ var WSAPI = /*#__PURE__*/function () {
1187
1219
  _proto.getLevels = function getLevels() {
1188
1220
  try {
1189
1221
  var _this4 = this;
1190
- return Promise.resolve(OCache.use(onUpdateContextKey.Levels, ECacheContext.WSAPI, function () {
1222
+ return Promise.resolve(OCache.use(onUpdateContextKey.Levels, exports.ECacheContext.WSAPI, function () {
1191
1223
  return _this4.api.levelsGetT(null);
1192
1224
  }, CACHE_DATA_SEC));
1193
1225
  } catch (e) {
@@ -1216,7 +1248,7 @@ var WSAPI = /*#__PURE__*/function () {
1216
1248
  if (onUpdate) {
1217
1249
  _this5.onUpdateCallback.set(onUpdateContextKey.Missions, onUpdate);
1218
1250
  }
1219
- return Promise.resolve(OCache.use(onUpdateContextKey.Missions, ECacheContext.WSAPI, function () {
1251
+ return Promise.resolve(OCache.use(onUpdateContextKey.Missions, exports.ECacheContext.WSAPI, function () {
1220
1252
  return _this5.api.missionsGetItemsT(null);
1221
1253
  }, CACHE_DATA_SEC));
1222
1254
  } catch (e) {
@@ -1226,7 +1258,7 @@ var WSAPI = /*#__PURE__*/function () {
1226
1258
  _proto.getBadges = function getBadges() {
1227
1259
  try {
1228
1260
  var _this6 = this;
1229
- return Promise.resolve(OCache.use(onUpdateContextKey.Badges, ECacheContext.WSAPI, function () {
1261
+ return Promise.resolve(OCache.use(onUpdateContextKey.Badges, exports.ECacheContext.WSAPI, function () {
1230
1262
  return _this6.api.badgetsGetItemsT(null);
1231
1263
  }, CACHE_DATA_SEC));
1232
1264
  } catch (e) {
@@ -1248,7 +1280,7 @@ var WSAPI = /*#__PURE__*/function () {
1248
1280
  _proto.getUserLevelExtraCounters = function getUserLevelExtraCounters() {
1249
1281
  try {
1250
1282
  var _this7 = this;
1251
- return Promise.resolve(OCache.use(onUpdateContextKey.LevelExtraCounters, ECacheContext.WSAPI, function () {
1283
+ return Promise.resolve(OCache.use(onUpdateContextKey.LevelExtraCounters, exports.ECacheContext.WSAPI, function () {
1252
1284
  return _this7.api.getUserGamificationInfoT(null);
1253
1285
  }, CACHE_DATA_SEC));
1254
1286
  } catch (e) {
@@ -1266,7 +1298,7 @@ var WSAPI = /*#__PURE__*/function () {
1266
1298
  _proto.getStoreItems = function getStoreItems() {
1267
1299
  try {
1268
1300
  var _this8 = this;
1269
- return Promise.resolve(OCache.use(onUpdateContextKey.StoreItems, ECacheContext.WSAPI, function () {
1301
+ return Promise.resolve(OCache.use(onUpdateContextKey.StoreItems, exports.ECacheContext.WSAPI, function () {
1270
1302
  return _this8.api.storeGetItemsT(null);
1271
1303
  }, CACHE_DATA_SEC));
1272
1304
  } catch (e) {
@@ -1298,7 +1330,7 @@ var WSAPI = /*#__PURE__*/function () {
1298
1330
  _proto.getStoreCategories = function getStoreCategories() {
1299
1331
  try {
1300
1332
  var _this10 = this;
1301
- return Promise.resolve(OCache.use(onUpdateContextKey.StoreCategories, ECacheContext.WSAPI, function () {
1333
+ return Promise.resolve(OCache.use(onUpdateContextKey.StoreCategories, exports.ECacheContext.WSAPI, function () {
1302
1334
  return _this10.api.storeGetCategoriesT(null);
1303
1335
  }, CACHE_DATA_SEC));
1304
1336
  } catch (e) {
@@ -1332,7 +1364,7 @@ var WSAPI = /*#__PURE__*/function () {
1332
1364
  _proto.getAchCategories = function getAchCategories() {
1333
1365
  try {
1334
1366
  var _this12 = this;
1335
- return Promise.resolve(OCache.use(onUpdateContextKey.AchCategories, ECacheContext.WSAPI, function () {
1367
+ return Promise.resolve(OCache.use(onUpdateContextKey.AchCategories, exports.ECacheContext.WSAPI, function () {
1336
1368
  return _this12.api.achGetCategoriesT(null);
1337
1369
  }, CACHE_DATA_SEC));
1338
1370
  } catch (e) {
@@ -1355,7 +1387,7 @@ var WSAPI = /*#__PURE__*/function () {
1355
1387
  if (onUpdate) {
1356
1388
  _this13.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
1357
1389
  }
1358
- return Promise.resolve(OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, function () {
1390
+ return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
1359
1391
  return _this13.api.sawGetTemplatesT(null);
1360
1392
  }, CACHE_DATA_SEC));
1361
1393
  } catch (e) {
@@ -1421,7 +1453,7 @@ var WSAPI = /*#__PURE__*/function () {
1421
1453
  if (onUpdate) {
1422
1454
  _this17.onUpdateCallback.set(onUpdateContextKey.TournamentList, onUpdate);
1423
1455
  }
1424
- return Promise.resolve(OCache.use(onUpdateContextKey.TournamentList, ECacheContext.WSAPI, function () {
1456
+ return Promise.resolve(OCache.use(onUpdateContextKey.TournamentList, exports.ECacheContext.WSAPI, function () {
1425
1457
  return _this17.api.tournamentsGetLobbyT(null);
1426
1458
  }, CACHE_DATA_SEC));
1427
1459
  } catch (e) {
@@ -1457,7 +1489,7 @@ var WSAPI = /*#__PURE__*/function () {
1457
1489
  _proto.getLeaderBoard = function getLeaderBoard(periodType, getPreviousPeriod) {
1458
1490
  try {
1459
1491
  var _this20 = this;
1460
- return Promise.resolve(OCache.use(onUpdateContextKey.LeaderBoards, ECacheContext.WSAPI, function () {
1492
+ return Promise.resolve(OCache.use(onUpdateContextKey.LeaderBoards, exports.ECacheContext.WSAPI, function () {
1461
1493
  return _this20.api.leaderboardsGetT(null, periodType, getPreviousPeriod);
1462
1494
  }, CACHE_DATA_SEC));
1463
1495
  } catch (e) {
@@ -1579,7 +1611,7 @@ var WSAPI = /*#__PURE__*/function () {
1579
1611
  _proto.updateOnSpin = function updateOnSpin(data) {
1580
1612
  try {
1581
1613
  var _this29 = this;
1582
- return Promise.resolve(OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, function () {
1614
+ return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
1583
1615
  return _this29.api.sawGetTemplatesT(null);
1584
1616
  }, CACHE_DATA_SEC)).then(function (templates) {
1585
1617
  var index = templates.findIndex(function (t) {
@@ -1607,7 +1639,7 @@ var WSAPI = /*#__PURE__*/function () {
1607
1639
  var _this31 = this;
1608
1640
  var _temp7 = function () {
1609
1641
  if (data.errCode === exports.SAWSpinErrorCode.SAW_OK) {
1610
- return Promise.resolve(OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, function () {
1642
+ return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
1611
1643
  return _this31.api.sawGetTemplatesT(null);
1612
1644
  }, CACHE_DATA_SEC)).then(function (templates) {
1613
1645
  var _template$prizes$find;
@@ -1668,7 +1700,7 @@ var WSAPI = /*#__PURE__*/function () {
1668
1700
  _proto.updateEntity = function updateEntity(contextKey, payload) {
1669
1701
  try {
1670
1702
  var _this35 = this;
1671
- OCache.set(contextKey, payload, ECacheContext.WSAPI);
1703
+ OCache.set(contextKey, payload, exports.ECacheContext.WSAPI);
1672
1704
  var onUpdate = _this35.onUpdateCallback.get(contextKey);
1673
1705
  if (onUpdate) {
1674
1706
  onUpdate(payload);
@@ -1680,8 +1712,8 @@ var WSAPI = /*#__PURE__*/function () {
1680
1712
  };
1681
1713
  _proto.jackpotClearCache = function jackpotClearCache() {
1682
1714
  try {
1683
- OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Jackpots);
1684
- OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);
1715
+ OCache.clear(exports.ECacheContext.WSAPI, onUpdateContextKey.Jackpots);
1716
+ OCache.clear(exports.ECacheContext.WSAPI, onUpdateContextKey.Pots);
1685
1717
  return Promise.resolve();
1686
1718
  } catch (e) {
1687
1719
  return Promise.reject(e);
@@ -1697,13 +1729,13 @@ var WSAPI = /*#__PURE__*/function () {
1697
1729
  }
1698
1730
  var jackpots = [];
1699
1731
  var pots = [];
1700
- return Promise.resolve(OCache.use(onUpdateContextKey.Jackpots, ECacheContext.WSAPI, function () {
1732
+ return Promise.resolve(OCache.use(onUpdateContextKey.Jackpots, exports.ECacheContext.WSAPI, function () {
1701
1733
  try {
1702
1734
  return Promise.resolve(_this36.api.jackpotGet(null, filter)).then(function (_jackpots) {
1703
1735
  var _pots = _jackpots.map(function (jp) {
1704
1736
  return jp.pot;
1705
1737
  });
1706
- OCache.set(onUpdateContextKey.Pots, _pots, ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);
1738
+ OCache.set(onUpdateContextKey.Pots, _pots, exports.ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);
1707
1739
  return _jackpots;
1708
1740
  });
1709
1741
  } catch (e) {
@@ -1723,7 +1755,7 @@ var WSAPI = /*#__PURE__*/function () {
1723
1755
  jackpots = _OCache$use;
1724
1756
  var _temp8 = function () {
1725
1757
  if (jackpots.length > 0) {
1726
- return Promise.resolve(OCache.use(onUpdateContextKey.Pots, ECacheContext.WSAPI, function () {
1758
+ return Promise.resolve(OCache.use(onUpdateContextKey.Pots, exports.ECacheContext.WSAPI, function () {
1727
1759
  try {
1728
1760
  var jp_template_ids = jackpots.map(function (jp) {
1729
1761
  return jp.jp_template_id;
@@ -2011,7 +2043,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
2011
2043
  if (lang_code === undefined || lang_code === null || lang_code.trim && lang_code.trim() === '') {
2012
2044
  lang_code = DEFAULT_LANG_EN;
2013
2045
  }
2014
- return Promise.resolve(OCache.use(lang_code + "-" + _this3.label_api_key + "-" + _this3.brand_api_key, ECacheContext.Translations, function () {
2046
+ return Promise.resolve(OCache.use(lang_code + "-" + _this3.label_api_key + "-" + _this3.brand_api_key, exports.ECacheContext.Translations, function () {
2015
2047
  try {
2016
2048
  var tsBaseRQ = _this3.buildMessage(user_ext_id, exports.ClassId.GET_TRANSLATIONS_REQUEST, {
2017
2049
  lang_code: DEFAULT_LANG_EN,
@@ -2052,7 +2084,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
2052
2084
  }
2053
2085
  try {
2054
2086
  var _this4 = this;
2055
- return Promise.resolve(OCache.use(_this4.label_api_key + " - " + _this4.brand_api_key, ECacheContext.LabelInfo, function () {
2087
+ return Promise.resolve(OCache.use(_this4.label_api_key + " - " + _this4.brand_api_key, exports.ECacheContext.LabelInfo, function () {
2056
2088
  try {
2057
2089
  var message = _this4.buildMessage(user_ext_id, exports.ClassId.INIT);
2058
2090
  return Promise.resolve(_this4.send(message, exports.ClassId.INIT_RESPONSE));
@@ -3104,6 +3136,7 @@ exports.GetLevelMapResponseTransform = GetLevelMapResponseTransform;
3104
3136
  exports.InboxMessageBodyTransform = InboxMessageBodyTransform;
3105
3137
  exports.InboxMessagesTransform = InboxMessagesTransform;
3106
3138
  exports.MiniGamePrizeTypeNamed = MiniGamePrizeTypeNamed;
3139
+ exports.OCache = OCache;
3107
3140
  exports.QuizMarketPerSport = QuizMarketPerSport;
3108
3141
  exports.SAWBuyInTypeNamed = SAWBuyInTypeNamed;
3109
3142
  exports.SAWGameTypeNamed = SAWGameTypeNamed;