@smartico/public-api 0.0.130 → 0.0.132
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.
- package/dist/MiniGames/SAWTemplate.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +25 -24
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/MiniGames/SAWTemplate.ts +4 -0
- package/src/index.ts +3 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -413,12 +413,12 @@ var NodeCache = /*#__PURE__*/function () {
|
|
|
413
413
|
NodeCache.ttlChecker = void 0;
|
|
414
414
|
NodeCache.cache = {};
|
|
415
415
|
|
|
416
|
-
|
|
416
|
+
exports.ECacheContext = void 0;
|
|
417
417
|
(function (ECacheContext) {
|
|
418
418
|
ECacheContext[ECacheContext["Translations"] = 0] = "Translations";
|
|
419
419
|
ECacheContext[ECacheContext["LabelInfo"] = 1] = "LabelInfo";
|
|
420
420
|
ECacheContext[ECacheContext["WSAPI"] = 2] = "WSAPI";
|
|
421
|
-
})(ECacheContext || (ECacheContext = {}));
|
|
421
|
+
})(exports.ECacheContext || (exports.ECacheContext = {}));
|
|
422
422
|
var OCache = /*#__PURE__*/function () {
|
|
423
423
|
function OCache() {}
|
|
424
424
|
OCache.init = function init(cacheContext) {
|
|
@@ -1107,10 +1107,10 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1107
1107
|
return _this.updateInboxMessages();
|
|
1108
1108
|
});
|
|
1109
1109
|
on(exports.ClassId.LOGOUT_RESPONSE, function () {
|
|
1110
|
-
return OCache.clearContext(ECacheContext.WSAPI);
|
|
1110
|
+
return OCache.clearContext(exports.ECacheContext.WSAPI);
|
|
1111
1111
|
});
|
|
1112
1112
|
on(exports.ClassId.IDENTIFY_RESPONSE, function () {
|
|
1113
|
-
return OCache.clearContext(ECacheContext.WSAPI);
|
|
1113
|
+
return OCache.clearContext(exports.ECacheContext.WSAPI);
|
|
1114
1114
|
});
|
|
1115
1115
|
on(exports.ClassId.JP_WIN_PUSH, function (data) {
|
|
1116
1116
|
return _this.jackpotClearCache();
|
|
@@ -1187,7 +1187,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1187
1187
|
_proto.getLevels = function getLevels() {
|
|
1188
1188
|
try {
|
|
1189
1189
|
var _this4 = this;
|
|
1190
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.Levels, ECacheContext.WSAPI, function () {
|
|
1190
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.Levels, exports.ECacheContext.WSAPI, function () {
|
|
1191
1191
|
return _this4.api.levelsGetT(null);
|
|
1192
1192
|
}, CACHE_DATA_SEC));
|
|
1193
1193
|
} catch (e) {
|
|
@@ -1216,7 +1216,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1216
1216
|
if (onUpdate) {
|
|
1217
1217
|
_this5.onUpdateCallback.set(onUpdateContextKey.Missions, onUpdate);
|
|
1218
1218
|
}
|
|
1219
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.Missions, ECacheContext.WSAPI, function () {
|
|
1219
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.Missions, exports.ECacheContext.WSAPI, function () {
|
|
1220
1220
|
return _this5.api.missionsGetItemsT(null);
|
|
1221
1221
|
}, CACHE_DATA_SEC));
|
|
1222
1222
|
} catch (e) {
|
|
@@ -1226,7 +1226,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1226
1226
|
_proto.getBadges = function getBadges() {
|
|
1227
1227
|
try {
|
|
1228
1228
|
var _this6 = this;
|
|
1229
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.Badges, ECacheContext.WSAPI, function () {
|
|
1229
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.Badges, exports.ECacheContext.WSAPI, function () {
|
|
1230
1230
|
return _this6.api.badgetsGetItemsT(null);
|
|
1231
1231
|
}, CACHE_DATA_SEC));
|
|
1232
1232
|
} catch (e) {
|
|
@@ -1248,7 +1248,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1248
1248
|
_proto.getUserLevelExtraCounters = function getUserLevelExtraCounters() {
|
|
1249
1249
|
try {
|
|
1250
1250
|
var _this7 = this;
|
|
1251
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.LevelExtraCounters, ECacheContext.WSAPI, function () {
|
|
1251
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.LevelExtraCounters, exports.ECacheContext.WSAPI, function () {
|
|
1252
1252
|
return _this7.api.getUserGamificationInfoT(null);
|
|
1253
1253
|
}, CACHE_DATA_SEC));
|
|
1254
1254
|
} catch (e) {
|
|
@@ -1266,7 +1266,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1266
1266
|
_proto.getStoreItems = function getStoreItems() {
|
|
1267
1267
|
try {
|
|
1268
1268
|
var _this8 = this;
|
|
1269
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.StoreItems, ECacheContext.WSAPI, function () {
|
|
1269
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.StoreItems, exports.ECacheContext.WSAPI, function () {
|
|
1270
1270
|
return _this8.api.storeGetItemsT(null);
|
|
1271
1271
|
}, CACHE_DATA_SEC));
|
|
1272
1272
|
} catch (e) {
|
|
@@ -1298,7 +1298,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1298
1298
|
_proto.getStoreCategories = function getStoreCategories() {
|
|
1299
1299
|
try {
|
|
1300
1300
|
var _this10 = this;
|
|
1301
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.StoreCategories, ECacheContext.WSAPI, function () {
|
|
1301
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.StoreCategories, exports.ECacheContext.WSAPI, function () {
|
|
1302
1302
|
return _this10.api.storeGetCategoriesT(null);
|
|
1303
1303
|
}, CACHE_DATA_SEC));
|
|
1304
1304
|
} catch (e) {
|
|
@@ -1332,7 +1332,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1332
1332
|
_proto.getAchCategories = function getAchCategories() {
|
|
1333
1333
|
try {
|
|
1334
1334
|
var _this12 = this;
|
|
1335
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.AchCategories, ECacheContext.WSAPI, function () {
|
|
1335
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.AchCategories, exports.ECacheContext.WSAPI, function () {
|
|
1336
1336
|
return _this12.api.achGetCategoriesT(null);
|
|
1337
1337
|
}, CACHE_DATA_SEC));
|
|
1338
1338
|
} catch (e) {
|
|
@@ -1355,7 +1355,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1355
1355
|
if (onUpdate) {
|
|
1356
1356
|
_this13.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
|
|
1357
1357
|
}
|
|
1358
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, function () {
|
|
1358
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
|
|
1359
1359
|
return _this13.api.sawGetTemplatesT(null);
|
|
1360
1360
|
}, CACHE_DATA_SEC));
|
|
1361
1361
|
} catch (e) {
|
|
@@ -1421,7 +1421,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1421
1421
|
if (onUpdate) {
|
|
1422
1422
|
_this17.onUpdateCallback.set(onUpdateContextKey.TournamentList, onUpdate);
|
|
1423
1423
|
}
|
|
1424
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.TournamentList, ECacheContext.WSAPI, function () {
|
|
1424
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.TournamentList, exports.ECacheContext.WSAPI, function () {
|
|
1425
1425
|
return _this17.api.tournamentsGetLobbyT(null);
|
|
1426
1426
|
}, CACHE_DATA_SEC));
|
|
1427
1427
|
} catch (e) {
|
|
@@ -1457,7 +1457,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1457
1457
|
_proto.getLeaderBoard = function getLeaderBoard(periodType, getPreviousPeriod) {
|
|
1458
1458
|
try {
|
|
1459
1459
|
var _this20 = this;
|
|
1460
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.LeaderBoards, ECacheContext.WSAPI, function () {
|
|
1460
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.LeaderBoards, exports.ECacheContext.WSAPI, function () {
|
|
1461
1461
|
return _this20.api.leaderboardsGetT(null, periodType, getPreviousPeriod);
|
|
1462
1462
|
}, CACHE_DATA_SEC));
|
|
1463
1463
|
} catch (e) {
|
|
@@ -1579,7 +1579,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1579
1579
|
_proto.updateOnSpin = function updateOnSpin(data) {
|
|
1580
1580
|
try {
|
|
1581
1581
|
var _this29 = this;
|
|
1582
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, function () {
|
|
1582
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
|
|
1583
1583
|
return _this29.api.sawGetTemplatesT(null);
|
|
1584
1584
|
}, CACHE_DATA_SEC)).then(function (templates) {
|
|
1585
1585
|
var index = templates.findIndex(function (t) {
|
|
@@ -1607,7 +1607,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1607
1607
|
var _this31 = this;
|
|
1608
1608
|
var _temp7 = function () {
|
|
1609
1609
|
if (data.errCode === exports.SAWSpinErrorCode.SAW_OK) {
|
|
1610
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, function () {
|
|
1610
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
|
|
1611
1611
|
return _this31.api.sawGetTemplatesT(null);
|
|
1612
1612
|
}, CACHE_DATA_SEC)).then(function (templates) {
|
|
1613
1613
|
var _template$prizes$find;
|
|
@@ -1668,7 +1668,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1668
1668
|
_proto.updateEntity = function updateEntity(contextKey, payload) {
|
|
1669
1669
|
try {
|
|
1670
1670
|
var _this35 = this;
|
|
1671
|
-
OCache.set(contextKey, payload, ECacheContext.WSAPI);
|
|
1671
|
+
OCache.set(contextKey, payload, exports.ECacheContext.WSAPI);
|
|
1672
1672
|
var onUpdate = _this35.onUpdateCallback.get(contextKey);
|
|
1673
1673
|
if (onUpdate) {
|
|
1674
1674
|
onUpdate(payload);
|
|
@@ -1680,8 +1680,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1680
1680
|
};
|
|
1681
1681
|
_proto.jackpotClearCache = function jackpotClearCache() {
|
|
1682
1682
|
try {
|
|
1683
|
-
OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Jackpots);
|
|
1684
|
-
OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);
|
|
1683
|
+
OCache.clear(exports.ECacheContext.WSAPI, onUpdateContextKey.Jackpots);
|
|
1684
|
+
OCache.clear(exports.ECacheContext.WSAPI, onUpdateContextKey.Pots);
|
|
1685
1685
|
return Promise.resolve();
|
|
1686
1686
|
} catch (e) {
|
|
1687
1687
|
return Promise.reject(e);
|
|
@@ -1697,13 +1697,13 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
var jackpots = [];
|
|
1699
1699
|
var pots = [];
|
|
1700
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.Jackpots, ECacheContext.WSAPI, function () {
|
|
1700
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.Jackpots, exports.ECacheContext.WSAPI, function () {
|
|
1701
1701
|
try {
|
|
1702
1702
|
return Promise.resolve(_this36.api.jackpotGet(null, filter)).then(function (_jackpots) {
|
|
1703
1703
|
var _pots = _jackpots.map(function (jp) {
|
|
1704
1704
|
return jp.pot;
|
|
1705
1705
|
});
|
|
1706
|
-
OCache.set(onUpdateContextKey.Pots, _pots, ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);
|
|
1706
|
+
OCache.set(onUpdateContextKey.Pots, _pots, exports.ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);
|
|
1707
1707
|
return _jackpots;
|
|
1708
1708
|
});
|
|
1709
1709
|
} catch (e) {
|
|
@@ -1723,7 +1723,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1723
1723
|
jackpots = _OCache$use;
|
|
1724
1724
|
var _temp8 = function () {
|
|
1725
1725
|
if (jackpots.length > 0) {
|
|
1726
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.Pots, ECacheContext.WSAPI, function () {
|
|
1726
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.Pots, exports.ECacheContext.WSAPI, function () {
|
|
1727
1727
|
try {
|
|
1728
1728
|
var jp_template_ids = jackpots.map(function (jp) {
|
|
1729
1729
|
return jp.jp_template_id;
|
|
@@ -2011,7 +2011,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2011
2011
|
if (lang_code === undefined || lang_code === null || lang_code.trim && lang_code.trim() === '') {
|
|
2012
2012
|
lang_code = DEFAULT_LANG_EN;
|
|
2013
2013
|
}
|
|
2014
|
-
return Promise.resolve(OCache.use(lang_code + "-" + _this3.label_api_key + "-" + _this3.brand_api_key, ECacheContext.Translations, function () {
|
|
2014
|
+
return Promise.resolve(OCache.use(lang_code + "-" + _this3.label_api_key + "-" + _this3.brand_api_key, exports.ECacheContext.Translations, function () {
|
|
2015
2015
|
try {
|
|
2016
2016
|
var tsBaseRQ = _this3.buildMessage(user_ext_id, exports.ClassId.GET_TRANSLATIONS_REQUEST, {
|
|
2017
2017
|
lang_code: DEFAULT_LANG_EN,
|
|
@@ -2052,7 +2052,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
try {
|
|
2054
2054
|
var _this4 = this;
|
|
2055
|
-
return Promise.resolve(OCache.use(_this4.label_api_key + " - " + _this4.brand_api_key, ECacheContext.LabelInfo, function () {
|
|
2055
|
+
return Promise.resolve(OCache.use(_this4.label_api_key + " - " + _this4.brand_api_key, exports.ECacheContext.LabelInfo, function () {
|
|
2056
2056
|
try {
|
|
2057
2057
|
var message = _this4.buildMessage(user_ext_id, exports.ClassId.INIT);
|
|
2058
2058
|
return Promise.resolve(_this4.send(message, exports.ClassId.INIT_RESPONSE));
|
|
@@ -3104,6 +3104,7 @@ exports.GetLevelMapResponseTransform = GetLevelMapResponseTransform;
|
|
|
3104
3104
|
exports.InboxMessageBodyTransform = InboxMessageBodyTransform;
|
|
3105
3105
|
exports.InboxMessagesTransform = InboxMessagesTransform;
|
|
3106
3106
|
exports.MiniGamePrizeTypeNamed = MiniGamePrizeTypeNamed;
|
|
3107
|
+
exports.OCache = OCache;
|
|
3107
3108
|
exports.QuizMarketPerSport = QuizMarketPerSport;
|
|
3108
3109
|
exports.SAWBuyInTypeNamed = SAWBuyInTypeNamed;
|
|
3109
3110
|
exports.SAWGameTypeNamed = SAWGameTypeNamed;
|