@smartico/public-api 0.0.201 → 0.0.203

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.
@@ -9,7 +9,8 @@ export declare enum AchCustomSectionType {
9
9
  QUIZ = 8,
10
10
  REDIRECT_LINK = 9,
11
11
  LOOTBOX_WEEKLY = 10,
12
- LOOTBOX_CALENDAR_DAYS = 11
12
+ LOOTBOX_CALENDAR_DAYS = 11,
13
+ TREASURE_HUNT = 12
13
14
  }
14
15
  export declare enum AchCustomLayoutTheme {
15
16
  VALENTINES_LIGHT = "valentines-light",
@@ -7,7 +7,8 @@ export declare enum SAWGameType {
7
7
  PrizeDrop = 5,
8
8
  Quiz = 6,
9
9
  LootboxWeekdays = 7,
10
- LootboxCalendarDays = 8
10
+ LootboxCalendarDays = 8,
11
+ TreasureHunt = 9
11
12
  }
12
13
  export declare enum SAWGameTypeName {
13
14
  SpinAWheel = "wheel",
@@ -18,6 +19,7 @@ export declare enum SAWGameTypeName {
18
19
  Quiz = "quiz",
19
20
  LootboxWeekdays = "lootbox_weekdays",
20
21
  LootboxCalendarDays = "lootbox_calendar_days",
22
+ TreasureHunt = "treasure_hunt",
21
23
  Unknown = "unknown"
22
24
  }
23
25
  /** @hidden */
@@ -1,6 +1,6 @@
1
1
  declare class NodeCache {
2
- private static ttlChecker;
3
- private static cache;
2
+ private ttlChecker;
3
+ private cache;
4
4
  constructor();
5
5
  get(key: string): any;
6
6
  set(key: string, value: any, ttlSeconds?: number): void;
package/dist/index.js CHANGED
@@ -332,6 +332,7 @@ exports.SAWGameType = void 0;
332
332
  SAWGameType[SAWGameType["Quiz"] = 6] = "Quiz";
333
333
  SAWGameType[SAWGameType["LootboxWeekdays"] = 7] = "LootboxWeekdays";
334
334
  SAWGameType[SAWGameType["LootboxCalendarDays"] = 8] = "LootboxCalendarDays";
335
+ SAWGameType[SAWGameType["TreasureHunt"] = 9] = "TreasureHunt";
335
336
  })(exports.SAWGameType || (exports.SAWGameType = {}));
336
337
  exports.SAWGameTypeName = void 0;
337
338
  (function (SAWGameTypeName) {
@@ -343,12 +344,13 @@ exports.SAWGameTypeName = void 0;
343
344
  SAWGameTypeName["Quiz"] = "quiz";
344
345
  SAWGameTypeName["LootboxWeekdays"] = "lootbox_weekdays";
345
346
  SAWGameTypeName["LootboxCalendarDays"] = "lootbox_calendar_days";
347
+ SAWGameTypeName["TreasureHunt"] = "treasure_hunt";
346
348
  SAWGameTypeName["Unknown"] = "unknown";
347
349
  })(exports.SAWGameTypeName || (exports.SAWGameTypeName = {}));
348
350
  /** @hidden */
349
351
  var SAWGameTypeNamed = function SAWGameTypeNamed(type) {
350
352
  var _SAWGameType$SpinAWhe;
351
- 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[exports.SAWGameType.LootboxWeekdays] = exports.SAWGameTypeName.LootboxWeekdays, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxCalendarDays] = exports.SAWGameTypeName.LootboxCalendarDays, _SAWGameType$SpinAWhe)[type] || exports.SAWGameTypeName.Unknown;
353
+ 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[exports.SAWGameType.LootboxWeekdays] = exports.SAWGameTypeName.LootboxWeekdays, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxCalendarDays] = exports.SAWGameTypeName.LootboxCalendarDays, _SAWGameType$SpinAWhe[exports.SAWGameType.TreasureHunt] = exports.SAWGameTypeName.TreasureHunt, _SAWGameType$SpinAWhe)[type] || exports.SAWGameTypeName.Unknown;
352
354
  };
353
355
 
354
356
  /** @hidden */
@@ -496,14 +498,17 @@ exports.SAWGameLayout = void 0;
496
498
 
497
499
  var NodeCache = /*#__PURE__*/function () {
498
500
  function NodeCache() {
499
- if (NodeCache.ttlChecker === undefined) {
500
- NodeCache.ttlChecker = setInterval(function () {
501
+ var _this = this;
502
+ this.ttlChecker = void 0;
503
+ this.cache = {};
504
+ if (this.ttlChecker === undefined) {
505
+ this.ttlChecker = setInterval(function () {
501
506
  var now = new Date().getTime();
502
- for (var key in NodeCache.cache) {
503
- if (NodeCache.cache.hasOwnProperty(key)) {
504
- var o = NodeCache.cache[key];
507
+ for (var key in _this.cache) {
508
+ if (_this.cache.hasOwnProperty(key)) {
509
+ var o = _this.cache[key];
505
510
  if (o.ttl < now) {
506
- delete NodeCache.cache[key];
511
+ delete _this.cache[key];
507
512
  }
508
513
  }
509
514
  }
@@ -512,7 +517,7 @@ var NodeCache = /*#__PURE__*/function () {
512
517
  }
513
518
  var _proto = NodeCache.prototype;
514
519
  _proto.get = function get(key) {
515
- var o = NodeCache.cache[key];
520
+ var o = this.cache[key];
516
521
  if (o !== undefined && o.ttl > new Date().getTime()) {
517
522
  return o.value;
518
523
  }
@@ -521,23 +526,25 @@ var NodeCache = /*#__PURE__*/function () {
521
526
  if (ttlSeconds === void 0) {
522
527
  ttlSeconds = 60;
523
528
  }
524
- NodeCache.cache[key] = {
529
+ this.cache[key] = {
525
530
  value: value,
526
531
  ttl: new Date().getTime() + ttlSeconds * 1000
527
532
  };
528
533
  };
529
534
  _proto.remove = function remove(key) {
530
- if (NodeCache.cache.hasOwnProperty(key)) {
531
- delete NodeCache.cache[key];
535
+ if (this.cache.hasOwnProperty(key)) {
536
+ delete this.cache[key];
532
537
  }
533
538
  };
534
539
  _proto.flushAll = function flushAll() {
535
- NodeCache.cache = {};
540
+ this.cache = {};
541
+ if (this.ttlChecker) {
542
+ clearInterval(this.ttlChecker);
543
+ this.ttlChecker = undefined;
544
+ }
536
545
  };
537
546
  return NodeCache;
538
547
  }();
539
- NodeCache.ttlChecker = void 0;
540
- NodeCache.cache = {};
541
548
 
542
549
  exports.ECacheContext = void 0;
543
550
  (function (ECacheContext) {
@@ -616,6 +623,11 @@ var OCache = /*#__PURE__*/function () {
616
623
  OCache.clearAll = function clearAll() {
617
624
  try {
618
625
  var _this3 = this;
626
+ for (var cacheContext in _this3.cache) {
627
+ if (_this3.cache.hasOwnProperty(cacheContext)) {
628
+ _this3.cache[cacheContext].flushAll();
629
+ }
630
+ }
619
631
  _this3.cache = {};
620
632
  return Promise.resolve();
621
633
  } catch (e) {
@@ -2497,6 +2509,7 @@ var AchCustomSectionType;
2497
2509
  AchCustomSectionType[AchCustomSectionType["REDIRECT_LINK"] = 9] = "REDIRECT_LINK";
2498
2510
  AchCustomSectionType[AchCustomSectionType["LOOTBOX_WEEKLY"] = 10] = "LOOTBOX_WEEKLY";
2499
2511
  AchCustomSectionType[AchCustomSectionType["LOOTBOX_CALENDAR_DAYS"] = 11] = "LOOTBOX_CALENDAR_DAYS";
2512
+ AchCustomSectionType[AchCustomSectionType["TREASURE_HUNT"] = 12] = "TREASURE_HUNT";
2500
2513
  })(AchCustomSectionType || (AchCustomSectionType = {}));
2501
2514
  var AchCustomLayoutTheme;
2502
2515
  (function (AchCustomLayoutTheme) {