@smartico/public-api 0.0.141 → 0.0.143
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/README.md +14 -1
- package/dist/CustomSections/AchCustomSection.d.ts +27 -0
- package/dist/CustomSections/GetCustomSectionsRequest.d.ts +3 -0
- package/dist/CustomSections/GetCustomSectionsResponse.d.ts +7 -0
- package/dist/CustomSections/UICustomSection.d.ts +15 -0
- package/dist/CustomSections/index.d.ts +4 -0
- package/dist/Missions/AchievementPublicMeta.d.ts +1 -0
- package/dist/Missions/UserAchievement.d.ts +1 -0
- package/dist/OCache.d.ts +1 -0
- package/dist/SmarticoAPI.d.ts +17 -14
- package/dist/WSAPI/WSAPI.d.ts +270 -48
- package/dist/WSAPI/WSAPITypes.d.ts +25 -0
- package/dist/index.js +559 -214
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +382 -95
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +1 -0
- package/docs/classes/WSAPI.md +234 -27
- package/docs/enums/AchCustomLayoutTheme.md +27 -0
- package/docs/enums/AchCustomSectionType.md +43 -0
- package/docs/enums/AchMissionsTabsOptions.md +21 -0
- package/docs/enums/AchOverviewMissionsFilter.md +33 -0
- package/docs/interfaces/TUICustomSection.md +85 -0
- package/package.json +1 -1
- package/src/CustomSections/AchCustomSection.ts +30 -0
- package/src/CustomSections/GetCustomSectionsRequest.ts +5 -0
- package/src/CustomSections/GetCustomSectionsResponse.ts +7 -0
- package/src/CustomSections/UICustomSection.ts +34 -0
- package/src/CustomSections/index.ts +4 -0
- package/src/Level/GetLevelMapResponse.ts +1 -1
- package/src/Missions/AchievementPublicMeta.ts +1 -0
- package/src/Missions/UserAchievement.ts +3 -1
- package/src/OCache.ts +5 -0
- package/src/SmarticoAPI.ts +42 -34
- package/src/WSAPI/WSAPI.ts +296 -64
- package/src/WSAPI/WSAPITypes.ts +27 -0
package/dist/index.js
CHANGED
|
@@ -507,6 +507,15 @@ var OCache = /*#__PURE__*/function () {
|
|
|
507
507
|
return Promise.reject(e);
|
|
508
508
|
}
|
|
509
509
|
};
|
|
510
|
+
OCache.clearAll = function clearAll() {
|
|
511
|
+
try {
|
|
512
|
+
var _this3 = this;
|
|
513
|
+
_this3.cache = {};
|
|
514
|
+
return Promise.resolve();
|
|
515
|
+
} catch (e) {
|
|
516
|
+
return Promise.reject(e);
|
|
517
|
+
}
|
|
518
|
+
};
|
|
510
519
|
return OCache;
|
|
511
520
|
}();
|
|
512
521
|
OCache.cache = {};
|
|
@@ -836,7 +845,8 @@ var UserAchievementTransform = function UserAchievementTransform(items) {
|
|
|
836
845
|
complete_date_ts: r.complete_date_ts,
|
|
837
846
|
completed_today: completedToday,
|
|
838
847
|
completed_this_week: completedThisWeek,
|
|
839
|
-
completed_this_month: completedThisMonth
|
|
848
|
+
completed_this_month: completedThisMonth,
|
|
849
|
+
custom_section_type_id: r.ach_public_meta.custom_section_type_id
|
|
840
850
|
};
|
|
841
851
|
return x;
|
|
842
852
|
});
|
|
@@ -1104,7 +1114,7 @@ var GetLevelMapResponseTransform = function GetLevelMapResponseTransform(levels)
|
|
|
1104
1114
|
description: l.level_public_meta.description,
|
|
1105
1115
|
image: l.level_public_meta.image_url,
|
|
1106
1116
|
required_points: l.required_points,
|
|
1107
|
-
visibility_points: parseInt(l.level_public_meta.visibility_points),
|
|
1117
|
+
visibility_points: l.level_public_meta.visibility_points ? parseInt(l.level_public_meta.visibility_points) : null,
|
|
1108
1118
|
required_level_counter_1: l.required_level_counter_1,
|
|
1109
1119
|
required_level_counter_2: l.required_level_counter_2,
|
|
1110
1120
|
custom_data: IntUtils.JsonOrText((_l$level_public_meta = l.level_public_meta) == null ? void 0 : _l$level_public_meta.custom_data)
|
|
@@ -1134,6 +1144,7 @@ var onUpdateContextKey;
|
|
|
1134
1144
|
onUpdateContextKey["StoreHistory"] = "storeHistory";
|
|
1135
1145
|
onUpdateContextKey["Jackpots"] = "jackpots";
|
|
1136
1146
|
onUpdateContextKey["Pots"] = "Pots";
|
|
1147
|
+
onUpdateContextKey["CustomSections"] = "customSections";
|
|
1137
1148
|
})(onUpdateContextKey || (onUpdateContextKey = {}));
|
|
1138
1149
|
/** @group General API */
|
|
1139
1150
|
var WSAPI = /*#__PURE__*/function () {
|
|
@@ -1144,50 +1155,55 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1144
1155
|
this.onUpdateCallback = new Map();
|
|
1145
1156
|
this.jackpotGetSignature = '';
|
|
1146
1157
|
this.api = api;
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
return _this.updateOnAddSpin();
|
|
1153
|
-
});
|
|
1154
|
-
on(exports.ClassId.SAW_DO_SPIN_RESPONSE, function (data) {
|
|
1155
|
-
return on(exports.ClassId.SAW_AKNOWLEDGE_RESPONSE, function () {
|
|
1156
|
-
return _this.updateOnPrizeWin(data);
|
|
1158
|
+
OCache.clearAll();
|
|
1159
|
+
if (this.api.tracker) {
|
|
1160
|
+
var on = this.api.tracker.on;
|
|
1161
|
+
on(exports.ClassId.SAW_SPINS_COUNT_PUSH, function (data) {
|
|
1162
|
+
return _this.updateOnSpin(data);
|
|
1157
1163
|
});
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1164
|
+
on(exports.ClassId.SAW_SHOW_SPIN_PUSH, function () {
|
|
1165
|
+
return _this.updateOnAddSpin();
|
|
1166
|
+
});
|
|
1167
|
+
on(exports.ClassId.SAW_DO_SPIN_RESPONSE, function (data) {
|
|
1168
|
+
return on(exports.ClassId.SAW_AKNOWLEDGE_RESPONSE, function () {
|
|
1169
|
+
return _this.updateOnPrizeWin(data);
|
|
1170
|
+
});
|
|
1171
|
+
});
|
|
1172
|
+
on(exports.ClassId.MISSION_OPTIN_RESPONSE, function () {
|
|
1173
|
+
return _this.updateMissionsOnOptIn();
|
|
1174
|
+
});
|
|
1175
|
+
on(exports.ClassId.TOURNAMENT_REGISTER_RESPONSE, function () {
|
|
1176
|
+
return _this.updateTournamentsOnRegistration();
|
|
1177
|
+
});
|
|
1178
|
+
on(exports.ClassId.CLIENT_ENGAGEMENT_EVENT_NEW, function () {
|
|
1179
|
+
return _this.updateInboxMessages();
|
|
1180
|
+
});
|
|
1181
|
+
on(exports.ClassId.LOGOUT_RESPONSE, function () {
|
|
1182
|
+
return OCache.clearContext(exports.ECacheContext.WSAPI);
|
|
1183
|
+
});
|
|
1184
|
+
on(exports.ClassId.IDENTIFY_RESPONSE, function () {
|
|
1185
|
+
return OCache.clearContext(exports.ECacheContext.WSAPI);
|
|
1186
|
+
});
|
|
1187
|
+
on(exports.ClassId.JP_WIN_PUSH, function (data) {
|
|
1188
|
+
return _this.jackpotClearCache();
|
|
1189
|
+
});
|
|
1190
|
+
on(exports.ClassId.JP_OPTOUT_RESPONSE, function (data) {
|
|
1191
|
+
return _this.jackpotClearCache();
|
|
1192
|
+
});
|
|
1193
|
+
on(exports.ClassId.JP_OPTIN_RESPONSE, function (data) {
|
|
1194
|
+
return _this.jackpotClearCache();
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1183
1197
|
}
|
|
1184
1198
|
/** Returns information about current user
|
|
1185
|
-
*
|
|
1199
|
+
*
|
|
1200
|
+
* **Example**:
|
|
1186
1201
|
* ```
|
|
1187
1202
|
* _smartico.api.getUserProfile().then((result) => {
|
|
1188
1203
|
* console.log(result);
|
|
1189
1204
|
* });
|
|
1190
1205
|
* ```
|
|
1206
|
+
* **Visitor mode: not supported**
|
|
1191
1207
|
* */
|
|
1192
1208
|
var _proto = WSAPI.prototype;
|
|
1193
1209
|
_proto.getUserProfile = function getUserProfile() {
|
|
@@ -1200,12 +1216,14 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1200
1216
|
}
|
|
1201
1217
|
}
|
|
1202
1218
|
/** Check if user belongs to specific segments
|
|
1203
|
-
* Example
|
|
1219
|
+
* **Example**:
|
|
1204
1220
|
* ```
|
|
1205
1221
|
* _smartico.api.checkSegmentMatch(1).then((result) => {
|
|
1206
1222
|
* console.log(result);
|
|
1207
1223
|
* });
|
|
1208
1224
|
* ```
|
|
1225
|
+
*
|
|
1226
|
+
* **Visitor mode: not supported**
|
|
1209
1227
|
*/;
|
|
1210
1228
|
_proto.checkSegmentMatch = function checkSegmentMatch(segment_id) {
|
|
1211
1229
|
try {
|
|
@@ -1224,12 +1242,13 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1224
1242
|
}
|
|
1225
1243
|
}
|
|
1226
1244
|
/** Check if user belongs to specific list of segments
|
|
1227
|
-
* Example
|
|
1245
|
+
* **Example**:
|
|
1228
1246
|
* ```
|
|
1229
1247
|
* _smartico.api.checkSegmentListMatch([1, 2, 3]).then((result) => {
|
|
1230
1248
|
* console.log(result);
|
|
1231
1249
|
* });
|
|
1232
1250
|
* ```
|
|
1251
|
+
* **Visitor mode: not supported**
|
|
1233
1252
|
*/
|
|
1234
1253
|
;
|
|
1235
1254
|
_proto.checkSegmentListMatch = function checkSegmentListMatch(segment_ids) {
|
|
@@ -1241,10 +1260,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1241
1260
|
}
|
|
1242
1261
|
}
|
|
1243
1262
|
/** Returns all the levels available the current user
|
|
1244
|
-
* Example
|
|
1263
|
+
* **Example**:
|
|
1245
1264
|
* ```
|
|
1246
1265
|
* _smartico.api.getLevels().then((result) => {
|
|
1247
|
-
*
|
|
1266
|
+
* console.log(result);
|
|
1267
|
+
* });
|
|
1268
|
+
* ```
|
|
1269
|
+
*
|
|
1270
|
+
* **Example in the Visitor mode**:
|
|
1271
|
+
* ```
|
|
1272
|
+
* _smartico.vapi('EN').getLevels().then((result) => {
|
|
1273
|
+
* console.log(result);
|
|
1248
1274
|
* });
|
|
1249
1275
|
* ```
|
|
1250
1276
|
*/
|
|
@@ -1263,14 +1289,20 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1263
1289
|
* The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
1264
1290
|
* Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
1265
1291
|
* The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
|
|
1266
|
-
*
|
|
1292
|
+
*
|
|
1293
|
+
* **Example**:
|
|
1267
1294
|
* ```
|
|
1268
1295
|
* _smartico.api.getMissions().then((result) => {
|
|
1269
|
-
*
|
|
1296
|
+
* console.log(result);
|
|
1297
|
+
* });
|
|
1298
|
+
* ```
|
|
1299
|
+
*
|
|
1300
|
+
* **Example in the Visitor mode**:
|
|
1301
|
+
* ```
|
|
1302
|
+
* _smartico.vapi('EN').getMissions().then((result) => {
|
|
1303
|
+
* console.log(result);
|
|
1270
1304
|
* });
|
|
1271
1305
|
* ```
|
|
1272
|
-
/**
|
|
1273
|
-
* @param params
|
|
1274
1306
|
*/
|
|
1275
1307
|
;
|
|
1276
1308
|
_proto.getMissions = function getMissions(_temp) {
|
|
@@ -1287,7 +1319,13 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1287
1319
|
} catch (e) {
|
|
1288
1320
|
return Promise.reject(e);
|
|
1289
1321
|
}
|
|
1290
|
-
}
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Returns all the badges available the current user
|
|
1325
|
+
*
|
|
1326
|
+
* **Visitor mode: not supported**
|
|
1327
|
+
*/
|
|
1328
|
+
;
|
|
1291
1329
|
_proto.getBadges = function getBadges() {
|
|
1292
1330
|
try {
|
|
1293
1331
|
var _this6 = this;
|
|
@@ -1302,12 +1340,15 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1302
1340
|
* Returns the extra counters for the current user level.
|
|
1303
1341
|
* These are counters that are configured for each Smartico client separatly by request.
|
|
1304
1342
|
* For example 1st counter could be total wagering amount, 2nd counter could be total deposit amount, etc.
|
|
1305
|
-
*
|
|
1343
|
+
*
|
|
1344
|
+
* **Example**:
|
|
1306
1345
|
* ```
|
|
1307
1346
|
* _smartico.api.getUserLevelExtraCounters().then((result) => {
|
|
1308
1347
|
* console.log(result);
|
|
1309
1348
|
* });
|
|
1310
1349
|
* ```
|
|
1350
|
+
*
|
|
1351
|
+
* **Visitor mode: not supported**
|
|
1311
1352
|
*/
|
|
1312
1353
|
;
|
|
1313
1354
|
_proto.getUserLevelExtraCounters = function getUserLevelExtraCounters() {
|
|
@@ -1320,12 +1361,23 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1320
1361
|
return Promise.reject(e);
|
|
1321
1362
|
}
|
|
1322
1363
|
}
|
|
1323
|
-
/**
|
|
1324
|
-
*
|
|
1364
|
+
/**
|
|
1365
|
+
*
|
|
1366
|
+
* Returns all the store items available the current user
|
|
1367
|
+
*
|
|
1368
|
+
* **Example**:
|
|
1325
1369
|
* ```
|
|
1326
1370
|
* _smartico.api.getStoreItems().then((result) => {
|
|
1327
1371
|
* console.log(result);
|
|
1328
1372
|
* });
|
|
1373
|
+
* ```
|
|
1374
|
+
*
|
|
1375
|
+
* **Example in the Visitor mode**:
|
|
1376
|
+
* ```
|
|
1377
|
+
* _smartico.vapi('EN').getStoreItems().then((result) => {
|
|
1378
|
+
* console.log(result);
|
|
1379
|
+
* });
|
|
1380
|
+
* ```
|
|
1329
1381
|
*/
|
|
1330
1382
|
;
|
|
1331
1383
|
_proto.getStoreItems = function getStoreItems() {
|
|
@@ -1339,11 +1391,14 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1339
1391
|
}
|
|
1340
1392
|
}
|
|
1341
1393
|
/** Buy the specific shop item by item_id. Returns the err_code in case of success or error.
|
|
1342
|
-
* Example
|
|
1394
|
+
* **Example**:
|
|
1343
1395
|
* ```
|
|
1344
1396
|
* _smartico.api.buyStoreItem(1).then((result) => {
|
|
1345
1397
|
* console.log(result);
|
|
1346
1398
|
* });
|
|
1399
|
+
* ```
|
|
1400
|
+
*
|
|
1401
|
+
* **Visitor mode: not supported**
|
|
1347
1402
|
*/
|
|
1348
1403
|
;
|
|
1349
1404
|
_proto.buyStoreItem = function buyStoreItem(item_id) {
|
|
@@ -1359,7 +1414,26 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1359
1414
|
} catch (e) {
|
|
1360
1415
|
return Promise.reject(e);
|
|
1361
1416
|
}
|
|
1362
|
-
}
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
*
|
|
1420
|
+
* Returns store categories
|
|
1421
|
+
*
|
|
1422
|
+
* **Example**:
|
|
1423
|
+
* ```
|
|
1424
|
+
* _smartico.api.getStoreCategories().then((result) => {
|
|
1425
|
+
* console.log(result);
|
|
1426
|
+
* });
|
|
1427
|
+
* ```
|
|
1428
|
+
*
|
|
1429
|
+
* **Example in the Visitor mode**:
|
|
1430
|
+
* ```
|
|
1431
|
+
* _smartico.vapi('EN').getStoreCategories().then((result) => {
|
|
1432
|
+
* console.log(result);
|
|
1433
|
+
* });
|
|
1434
|
+
* ```
|
|
1435
|
+
*/
|
|
1436
|
+
;
|
|
1363
1437
|
_proto.getStoreCategories = function getStoreCategories() {
|
|
1364
1438
|
try {
|
|
1365
1439
|
var _this10 = this;
|
|
@@ -1370,15 +1444,19 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1370
1444
|
return Promise.reject(e);
|
|
1371
1445
|
}
|
|
1372
1446
|
}
|
|
1373
|
-
/**
|
|
1447
|
+
/**
|
|
1448
|
+
* Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
|
|
1374
1449
|
* The maximum number of items per request is limited to 20.
|
|
1375
1450
|
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
1376
|
-
*
|
|
1451
|
+
*
|
|
1452
|
+
* **Example**:
|
|
1377
1453
|
* ```
|
|
1378
1454
|
* _smartico.api.getStorePurchasedItems().then((result) => {
|
|
1379
1455
|
* console.log(result);
|
|
1380
1456
|
* });
|
|
1381
1457
|
* ```
|
|
1458
|
+
*
|
|
1459
|
+
* **Visitor mode: not supported**
|
|
1382
1460
|
*/
|
|
1383
1461
|
;
|
|
1384
1462
|
_proto.getStorePurchasedItems = function getStorePurchasedItems(_temp2) {
|
|
@@ -1397,7 +1475,26 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1397
1475
|
} catch (e) {
|
|
1398
1476
|
return Promise.reject(e);
|
|
1399
1477
|
}
|
|
1400
|
-
}
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Returns missions & badges categories
|
|
1481
|
+
*
|
|
1482
|
+
* **Example**:
|
|
1483
|
+
* ```
|
|
1484
|
+
* _smartico.api.getAchCategories().then((result) => {
|
|
1485
|
+
* console.log(result);
|
|
1486
|
+
* });
|
|
1487
|
+
* ```
|
|
1488
|
+
*
|
|
1489
|
+
* **Example in the Visitor mode**:
|
|
1490
|
+
* ```
|
|
1491
|
+
* _smartico.vapi('EN').getAchCategories().then((result) => {
|
|
1492
|
+
* console.log(result);
|
|
1493
|
+
* });
|
|
1494
|
+
* ```
|
|
1495
|
+
*
|
|
1496
|
+
* */
|
|
1497
|
+
;
|
|
1401
1498
|
_proto.getAchCategories = function getAchCategories() {
|
|
1402
1499
|
try {
|
|
1403
1500
|
var _this12 = this;
|
|
@@ -1408,34 +1505,82 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1408
1505
|
return Promise.reject(e);
|
|
1409
1506
|
}
|
|
1410
1507
|
}
|
|
1411
|
-
/** Returns the list of mini-games available for user
|
|
1412
|
-
* The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
1413
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback. */
|
|
1414
1508
|
/**
|
|
1509
|
+
* Returns list of custom sections
|
|
1510
|
+
*
|
|
1511
|
+
* **Example**:
|
|
1512
|
+
* ```
|
|
1513
|
+
* _smartico.api.getCustomSections().then((result) => {
|
|
1514
|
+
* console.log(result);
|
|
1515
|
+
* });
|
|
1516
|
+
* ```
|
|
1517
|
+
*
|
|
1518
|
+
* **Example in the Visitor mode**:
|
|
1519
|
+
* ```
|
|
1520
|
+
* _smartico.vapi('EN').getCustomSections().then((result) => {
|
|
1521
|
+
* console.log(result);
|
|
1522
|
+
* });
|
|
1523
|
+
* ```
|
|
1524
|
+
*
|
|
1525
|
+
* */
|
|
1526
|
+
;
|
|
1527
|
+
_proto.getCustomSections = function getCustomSections() {
|
|
1528
|
+
try {
|
|
1529
|
+
var _this13 = this;
|
|
1530
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.CustomSections, exports.ECacheContext.WSAPI, function () {
|
|
1531
|
+
return _this13.api.getCustomSectionsT(null);
|
|
1532
|
+
}, CACHE_DATA_SEC));
|
|
1533
|
+
} catch (e) {
|
|
1534
|
+
return Promise.reject(e);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1415
1537
|
/**
|
|
1416
|
-
*
|
|
1538
|
+
* Returns the list of mini-games available for user
|
|
1539
|
+
* The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
1540
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
|
|
1541
|
+
*
|
|
1542
|
+
* **Example**:
|
|
1543
|
+
* ```
|
|
1544
|
+
* _smartico.api.getMiniGames().then((result) => {
|
|
1545
|
+
* console.log(result);
|
|
1546
|
+
* });
|
|
1547
|
+
* ```
|
|
1548
|
+
*
|
|
1549
|
+
* **Example in the Visitor mode**:
|
|
1550
|
+
* ```
|
|
1551
|
+
* _smartico.vapi('EN').getMiniGames().then((result) => {
|
|
1552
|
+
* console.log(result);
|
|
1553
|
+
* });
|
|
1554
|
+
* ```
|
|
1555
|
+
*
|
|
1417
1556
|
*/
|
|
1418
1557
|
;
|
|
1419
1558
|
_proto.getMiniGames = function getMiniGames(_temp3) {
|
|
1420
1559
|
var _ref3 = _temp3 === void 0 ? {} : _temp3,
|
|
1421
1560
|
onUpdate = _ref3.onUpdate;
|
|
1422
1561
|
try {
|
|
1423
|
-
var
|
|
1562
|
+
var _this14 = this;
|
|
1424
1563
|
if (onUpdate) {
|
|
1425
|
-
|
|
1564
|
+
_this14.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
|
|
1426
1565
|
}
|
|
1427
1566
|
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
|
|
1428
|
-
return
|
|
1567
|
+
return _this14.api.sawGetTemplatesT(null);
|
|
1429
1568
|
}, CACHE_DATA_SEC));
|
|
1430
1569
|
} catch (e) {
|
|
1431
1570
|
return Promise.reject(e);
|
|
1432
1571
|
}
|
|
1433
|
-
}
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
|
|
1575
|
+
*
|
|
1576
|
+
* **Visitor mode: not supported**
|
|
1577
|
+
*/
|
|
1578
|
+
;
|
|
1434
1579
|
_proto.playMiniGame = function playMiniGame(template_id) {
|
|
1435
1580
|
try {
|
|
1436
|
-
var
|
|
1437
|
-
return Promise.resolve(
|
|
1438
|
-
|
|
1581
|
+
var _this15 = this;
|
|
1582
|
+
return Promise.resolve(_this15.api.sawSpinRequest(null, template_id)).then(function (r) {
|
|
1583
|
+
_this15.api.doAcknowledgeRequest(null, r.request_id);
|
|
1439
1584
|
var o = {
|
|
1440
1585
|
err_code: r.errCode,
|
|
1441
1586
|
err_message: r.errMsg,
|
|
@@ -1446,11 +1591,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1446
1591
|
} catch (e) {
|
|
1447
1592
|
return Promise.reject(e);
|
|
1448
1593
|
}
|
|
1449
|
-
}
|
|
1594
|
+
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Requests an opt-in for the specified mission_id. Returns the err_code.
|
|
1597
|
+
*
|
|
1598
|
+
* **Visitor mode: not supported**
|
|
1599
|
+
*/
|
|
1600
|
+
;
|
|
1450
1601
|
_proto.requestMissionOptIn = function requestMissionOptIn(mission_id) {
|
|
1451
1602
|
try {
|
|
1452
|
-
var
|
|
1453
|
-
return Promise.resolve(
|
|
1603
|
+
var _this16 = this;
|
|
1604
|
+
return Promise.resolve(_this16.api.missionOptIn(null, mission_id)).then(function (r) {
|
|
1454
1605
|
var o = {
|
|
1455
1606
|
err_code: r.errCode,
|
|
1456
1607
|
err_message: r.errMsg
|
|
@@ -1460,11 +1611,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1460
1611
|
} catch (e) {
|
|
1461
1612
|
return Promise.reject(e);
|
|
1462
1613
|
}
|
|
1463
|
-
}
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Request for claim reward for the specified mission id. Returns the err_code.
|
|
1617
|
+
*
|
|
1618
|
+
* **Visitor mode: not supported**
|
|
1619
|
+
*/
|
|
1620
|
+
;
|
|
1464
1621
|
_proto.requestMissionClaimReward = function requestMissionClaimReward(mission_id, ach_completed_id) {
|
|
1465
1622
|
try {
|
|
1466
|
-
var
|
|
1467
|
-
return Promise.resolve(
|
|
1623
|
+
var _this17 = this;
|
|
1624
|
+
return Promise.resolve(_this17.api.missionClaimPrize(null, mission_id, ach_completed_id)).then(function (r) {
|
|
1468
1625
|
var o = {
|
|
1469
1626
|
err_code: r.errCode,
|
|
1470
1627
|
err_message: r.errMsg
|
|
@@ -1477,38 +1634,82 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1477
1634
|
}
|
|
1478
1635
|
/** Returns all the active instances of tournaments
|
|
1479
1636
|
* The returned list is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getTournamentsList with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
1480
|
-
* The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback
|
|
1481
|
-
|
|
1482
|
-
*
|
|
1483
|
-
|
|
1637
|
+
* The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback.
|
|
1638
|
+
*
|
|
1639
|
+
* **Example**:
|
|
1640
|
+
* ```
|
|
1641
|
+
* _smartico.api.getTournamentsList().then((result) => {
|
|
1642
|
+
* console.log(result);
|
|
1643
|
+
* });
|
|
1644
|
+
* ```
|
|
1645
|
+
*
|
|
1646
|
+
* **Example in the Visitor mode**:
|
|
1647
|
+
* ```
|
|
1648
|
+
* _smartico.vapi('EN').getTournamentsList().then((result) => {
|
|
1649
|
+
* console.log(result);
|
|
1650
|
+
* });
|
|
1651
|
+
* ```
|
|
1652
|
+
* */
|
|
1484
1653
|
;
|
|
1485
1654
|
_proto.getTournamentsList = function getTournamentsList(_temp4) {
|
|
1486
1655
|
var _ref4 = _temp4 === void 0 ? {} : _temp4,
|
|
1487
1656
|
onUpdate = _ref4.onUpdate;
|
|
1488
1657
|
try {
|
|
1489
|
-
var
|
|
1658
|
+
var _this18 = this;
|
|
1490
1659
|
if (onUpdate) {
|
|
1491
|
-
|
|
1660
|
+
_this18.onUpdateCallback.set(onUpdateContextKey.TournamentList, onUpdate);
|
|
1492
1661
|
}
|
|
1493
1662
|
return Promise.resolve(OCache.use(onUpdateContextKey.TournamentList, exports.ECacheContext.WSAPI, function () {
|
|
1494
|
-
return
|
|
1663
|
+
return _this18.api.tournamentsGetLobbyT(null);
|
|
1495
1664
|
}, CACHE_DATA_SEC));
|
|
1496
1665
|
} catch (e) {
|
|
1497
1666
|
return Promise.reject(e);
|
|
1498
1667
|
}
|
|
1499
|
-
}
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
* Returns details information of specific tournament instance, the response will include tournament info and the leaderboard of players
|
|
1671
|
+
*
|
|
1672
|
+
* **Example**:
|
|
1673
|
+
* ```
|
|
1674
|
+
* _smartico.api.getTournamentsList().then((result) => {
|
|
1675
|
+
* if (result.length > 0) {
|
|
1676
|
+
* _smartico.api.getTournamentInstanceInfo(result[0].instance_id).then((result) => {
|
|
1677
|
+
* console.log(result);
|
|
1678
|
+
* });
|
|
1679
|
+
* }
|
|
1680
|
+
* });
|
|
1681
|
+
* ```
|
|
1682
|
+
*
|
|
1683
|
+
* **Example in the Visitor mode**:
|
|
1684
|
+
* ```
|
|
1685
|
+
* _smartico.vapi('EN').getTournamentsList().then((result) => {
|
|
1686
|
+
* if (result.length > 0) {
|
|
1687
|
+
* _smartico.vapi('EN').getTournamentInstanceInfo(result[0].instance_id).then((result) => {
|
|
1688
|
+
* console.log(result);
|
|
1689
|
+
* });
|
|
1690
|
+
* }
|
|
1691
|
+
* });
|
|
1692
|
+
* ```
|
|
1693
|
+
*/
|
|
1694
|
+
;
|
|
1500
1695
|
_proto.getTournamentInstanceInfo = function getTournamentInstanceInfo(tournamentInstanceId) {
|
|
1501
1696
|
try {
|
|
1502
|
-
var
|
|
1503
|
-
return Promise.resolve(
|
|
1697
|
+
var _this19 = this;
|
|
1698
|
+
return Promise.resolve(_this19.api.tournamentsGetInfoT(null, tournamentInstanceId));
|
|
1504
1699
|
} catch (e) {
|
|
1505
1700
|
return Promise.reject(e);
|
|
1506
1701
|
}
|
|
1507
|
-
}
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* Requests registration for the specified tournament instance. Returns the err_code.
|
|
1705
|
+
*
|
|
1706
|
+
* **Visitor mode: not supported**
|
|
1707
|
+
*/
|
|
1708
|
+
;
|
|
1508
1709
|
_proto.registerInTournament = function registerInTournament(tournamentInstanceId) {
|
|
1509
1710
|
try {
|
|
1510
|
-
var
|
|
1511
|
-
return Promise.resolve(
|
|
1711
|
+
var _this20 = this;
|
|
1712
|
+
return Promise.resolve(_this20.api.registerInTournament(null, tournamentInstanceId)).then(function (r) {
|
|
1512
1713
|
var o = {
|
|
1513
1714
|
err_code: r.errCode,
|
|
1514
1715
|
err_message: r.errMsg
|
|
@@ -1519,15 +1720,30 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1519
1720
|
return Promise.reject(e);
|
|
1520
1721
|
}
|
|
1521
1722
|
}
|
|
1522
|
-
/**
|
|
1523
|
-
|
|
1723
|
+
/**
|
|
1724
|
+
* Returns the leaderboard for the current type (default is Daily). If getPreviousPeriod is passed as true, a leaderboard for the previous period for the current type will be returned.
|
|
1725
|
+
* For example, if the type is Weekly and getPreviousPeriod is true, a leaderboard for the previous week will be returned.
|
|
1726
|
+
*
|
|
1727
|
+
* **Example**:
|
|
1728
|
+
* ```
|
|
1729
|
+
* _smartico.api.getLeaderBoard(1).then((result) => {
|
|
1730
|
+
* console.log(result);
|
|
1731
|
+
* });
|
|
1732
|
+
* ```
|
|
1733
|
+
*
|
|
1734
|
+
* **Example in the Visitor mode**:
|
|
1735
|
+
* ```
|
|
1736
|
+
* _smartico.vapi('EN').getLeaderBoard(1).then((result) => {
|
|
1737
|
+
* console.log(result);
|
|
1738
|
+
* });
|
|
1739
|
+
* ```
|
|
1524
1740
|
*/
|
|
1525
1741
|
;
|
|
1526
1742
|
_proto.getLeaderBoard = function getLeaderBoard(periodType, getPreviousPeriod) {
|
|
1527
1743
|
try {
|
|
1528
|
-
var
|
|
1744
|
+
var _this21 = this;
|
|
1529
1745
|
return Promise.resolve(OCache.use(onUpdateContextKey.LeaderBoards, exports.ECacheContext.WSAPI, function () {
|
|
1530
|
-
return
|
|
1746
|
+
return _this21.api.leaderboardsGetT(null, periodType, getPreviousPeriod);
|
|
1531
1747
|
}, CACHE_DATA_SEC));
|
|
1532
1748
|
} catch (e) {
|
|
1533
1749
|
return Promise.reject(e);
|
|
@@ -1539,8 +1755,10 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1539
1755
|
* This functions return list of messages without the body of the message.
|
|
1540
1756
|
* To get the body of the message you need to call getInboxMessageBody function and pass the message guid contained in each message of this request.
|
|
1541
1757
|
* All other action like mark as read, favorite, delete, etc. can be done using this message GUID.
|
|
1542
|
-
* The "onUpdate" callback will be triggered when the user receives a new message. It will provide an updated list of messages, ranging from 0 to 20, to the onUpdate callback function.
|
|
1543
|
-
|
|
1758
|
+
* The "onUpdate" callback will be triggered when the user receives a new message. It will provide an updated list of messages, ranging from 0 to 20, to the onUpdate callback function.
|
|
1759
|
+
*
|
|
1760
|
+
* **Visitor mode: not supported**
|
|
1761
|
+
*
|
|
1544
1762
|
* @param params
|
|
1545
1763
|
*/
|
|
1546
1764
|
;
|
|
@@ -1551,27 +1769,39 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1551
1769
|
onlyFavorite = _ref5.onlyFavorite,
|
|
1552
1770
|
onUpdate = _ref5.onUpdate;
|
|
1553
1771
|
try {
|
|
1554
|
-
var
|
|
1772
|
+
var _this22 = this;
|
|
1555
1773
|
if (onUpdate) {
|
|
1556
|
-
|
|
1774
|
+
_this22.onUpdateCallback.set(onUpdateContextKey.InboxMessages, onUpdate);
|
|
1557
1775
|
}
|
|
1558
|
-
return Promise.resolve(
|
|
1776
|
+
return Promise.resolve(_this22.api.getInboxMessagesT(null, from, to, onlyFavorite));
|
|
1559
1777
|
} catch (e) {
|
|
1560
1778
|
return Promise.reject(e);
|
|
1561
1779
|
}
|
|
1562
|
-
}
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* Returns the message body of the specified message guid.
|
|
1783
|
+
*
|
|
1784
|
+
* **Visitor mode: not supported**
|
|
1785
|
+
*/
|
|
1786
|
+
;
|
|
1563
1787
|
_proto.getInboxMessageBody = function getInboxMessageBody(messageGuid) {
|
|
1564
1788
|
try {
|
|
1565
|
-
var
|
|
1566
|
-
return Promise.resolve(
|
|
1789
|
+
var _this23 = this;
|
|
1790
|
+
return Promise.resolve(_this23.api.getInboxMessageBodyT(messageGuid));
|
|
1567
1791
|
} catch (e) {
|
|
1568
1792
|
return Promise.reject(e);
|
|
1569
1793
|
}
|
|
1570
|
-
}
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Requests to mark inbox message with specified guid as read
|
|
1797
|
+
*
|
|
1798
|
+
* **Visitor mode: not supported**
|
|
1799
|
+
*/
|
|
1800
|
+
;
|
|
1571
1801
|
_proto.markInboxMessageAsRead = function markInboxMessageAsRead(messageGuid) {
|
|
1572
1802
|
try {
|
|
1573
|
-
var
|
|
1574
|
-
return Promise.resolve(
|
|
1803
|
+
var _this24 = this;
|
|
1804
|
+
return Promise.resolve(_this24.api.markInboxMessageRead(null, messageGuid)).then(function (r) {
|
|
1575
1805
|
return {
|
|
1576
1806
|
err_code: r.errCode,
|
|
1577
1807
|
err_message: r.errMsg
|
|
@@ -1580,11 +1810,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1580
1810
|
} catch (e) {
|
|
1581
1811
|
return Promise.reject(e);
|
|
1582
1812
|
}
|
|
1583
|
-
}
|
|
1813
|
+
}
|
|
1814
|
+
/**
|
|
1815
|
+
* Requests to mark all inbox messages as rea
|
|
1816
|
+
*
|
|
1817
|
+
* **Visitor mode: not supported**
|
|
1818
|
+
*/
|
|
1819
|
+
;
|
|
1584
1820
|
_proto.markAllInboxMessagesAsRead = function markAllInboxMessagesAsRead() {
|
|
1585
1821
|
try {
|
|
1586
|
-
var
|
|
1587
|
-
return Promise.resolve(
|
|
1822
|
+
var _this25 = this;
|
|
1823
|
+
return Promise.resolve(_this25.api.markAllInboxMessageRead(null)).then(function (r) {
|
|
1588
1824
|
return {
|
|
1589
1825
|
err_code: r.errCode,
|
|
1590
1826
|
err_message: r.errMsg
|
|
@@ -1593,11 +1829,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1593
1829
|
} catch (e) {
|
|
1594
1830
|
return Promise.reject(e);
|
|
1595
1831
|
}
|
|
1596
|
-
}
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Requests to mark inbox message with specified guid as favorite. Pass mark true to add message to favorite and false to remove.
|
|
1835
|
+
*
|
|
1836
|
+
* **Visitor mode: not supported**
|
|
1837
|
+
*/
|
|
1838
|
+
;
|
|
1597
1839
|
_proto.markUnmarkInboxMessageAsFavorite = function markUnmarkInboxMessageAsFavorite(messageGuid, mark) {
|
|
1598
1840
|
try {
|
|
1599
|
-
var
|
|
1600
|
-
return Promise.resolve(
|
|
1841
|
+
var _this26 = this;
|
|
1842
|
+
return Promise.resolve(_this26.api.markUnmarkInboxMessageAsFavorite(null, messageGuid, mark)).then(function (r) {
|
|
1601
1843
|
return {
|
|
1602
1844
|
err_code: r.errCode,
|
|
1603
1845
|
err_message: r.errMsg
|
|
@@ -1606,11 +1848,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1606
1848
|
} catch (e) {
|
|
1607
1849
|
return Promise.reject(e);
|
|
1608
1850
|
}
|
|
1609
|
-
}
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Requests to delete inbox message
|
|
1854
|
+
*
|
|
1855
|
+
* **Visitor mode: not supported**
|
|
1856
|
+
*/
|
|
1857
|
+
;
|
|
1610
1858
|
_proto.deleteInboxMessage = function deleteInboxMessage(messageGuid) {
|
|
1611
1859
|
try {
|
|
1612
|
-
var
|
|
1613
|
-
return Promise.resolve(
|
|
1860
|
+
var _this27 = this;
|
|
1861
|
+
return Promise.resolve(_this27.api.deleteInboxMessage(null, messageGuid)).then(function (r) {
|
|
1614
1862
|
return {
|
|
1615
1863
|
err_code: r.errCode,
|
|
1616
1864
|
err_message: r.errMsg
|
|
@@ -1619,11 +1867,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1619
1867
|
} catch (e) {
|
|
1620
1868
|
return Promise.reject(e);
|
|
1621
1869
|
}
|
|
1622
|
-
}
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* Requests to delete all inbox messages
|
|
1873
|
+
*
|
|
1874
|
+
* **Visitor mode: not supported**
|
|
1875
|
+
*/
|
|
1876
|
+
;
|
|
1623
1877
|
_proto.deleteAllInboxMessages = function deleteAllInboxMessages() {
|
|
1624
1878
|
try {
|
|
1625
|
-
var
|
|
1626
|
-
return Promise.resolve(
|
|
1879
|
+
var _this28 = this;
|
|
1880
|
+
return Promise.resolve(_this28.api.deleteAllInboxMessages(null)).then(function (r) {
|
|
1627
1881
|
return {
|
|
1628
1882
|
err_code: r.errCode,
|
|
1629
1883
|
err_message: r.errMsg
|
|
@@ -1632,11 +1886,15 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1632
1886
|
} catch (e) {
|
|
1633
1887
|
return Promise.reject(e);
|
|
1634
1888
|
}
|
|
1635
|
-
}
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
|
|
1892
|
+
*/
|
|
1893
|
+
;
|
|
1636
1894
|
_proto.getTranslations = function getTranslations(lang_code) {
|
|
1637
1895
|
try {
|
|
1638
|
-
var
|
|
1639
|
-
return Promise.resolve(
|
|
1896
|
+
var _this29 = this;
|
|
1897
|
+
return Promise.resolve(_this29.api.getTranslationsT(null, lang_code, [])).then(function (r) {
|
|
1640
1898
|
return {
|
|
1641
1899
|
translations: r.translations
|
|
1642
1900
|
};
|
|
@@ -1647,15 +1905,15 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1647
1905
|
};
|
|
1648
1906
|
_proto.updateOnSpin = function updateOnSpin(data) {
|
|
1649
1907
|
try {
|
|
1650
|
-
var
|
|
1908
|
+
var _this30 = this;
|
|
1651
1909
|
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
|
|
1652
|
-
return
|
|
1910
|
+
return _this30.api.sawGetTemplatesT(null);
|
|
1653
1911
|
}, CACHE_DATA_SEC)).then(function (templates) {
|
|
1654
1912
|
var index = templates.findIndex(function (t) {
|
|
1655
1913
|
return t.id === data.saw_template_id;
|
|
1656
1914
|
});
|
|
1657
1915
|
templates[index].spin_count = data.spin_count;
|
|
1658
|
-
|
|
1916
|
+
_this30.updateEntity(onUpdateContextKey.Saw, templates);
|
|
1659
1917
|
});
|
|
1660
1918
|
} catch (e) {
|
|
1661
1919
|
return Promise.reject(e);
|
|
@@ -1663,9 +1921,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1663
1921
|
};
|
|
1664
1922
|
_proto.updateOnAddSpin = function updateOnAddSpin() {
|
|
1665
1923
|
try {
|
|
1666
|
-
var
|
|
1667
|
-
return Promise.resolve(
|
|
1668
|
-
|
|
1924
|
+
var _this31 = this;
|
|
1925
|
+
return Promise.resolve(_this31.api.sawGetTemplatesT(null)).then(function (payload) {
|
|
1926
|
+
_this31.updateEntity(onUpdateContextKey.Saw, payload);
|
|
1669
1927
|
});
|
|
1670
1928
|
} catch (e) {
|
|
1671
1929
|
return Promise.reject(e);
|
|
@@ -1673,11 +1931,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1673
1931
|
};
|
|
1674
1932
|
_proto.updateOnPrizeWin = function updateOnPrizeWin(data) {
|
|
1675
1933
|
try {
|
|
1676
|
-
var
|
|
1934
|
+
var _this32 = this;
|
|
1677
1935
|
var _temp7 = function () {
|
|
1678
1936
|
if (data.errCode === exports.SAWSpinErrorCode.SAW_OK) {
|
|
1679
1937
|
return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
|
|
1680
|
-
return
|
|
1938
|
+
return _this32.api.sawGetTemplatesT(null);
|
|
1681
1939
|
}, CACHE_DATA_SEC)).then(function (templates) {
|
|
1682
1940
|
var _template$prizes$find;
|
|
1683
1941
|
var template = templates.find(function (t) {
|
|
@@ -1690,8 +1948,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1690
1948
|
})) == null ? void 0 : _template$prizes$find.prize_type;
|
|
1691
1949
|
var _temp6 = function () {
|
|
1692
1950
|
if (template.jackpot_add_on_attempt || template.spin_count === 1 || prizeType === exports.MiniGamePrizeTypeName.JACKPOT || prizeType === exports.MiniGamePrizeTypeName.SPIN) {
|
|
1693
|
-
return Promise.resolve(
|
|
1694
|
-
|
|
1951
|
+
return Promise.resolve(_this32.api.sawGetTemplatesT(null)).then(function (updatedTemplates) {
|
|
1952
|
+
_this32.updateEntity(onUpdateContextKey.Saw, updatedTemplates);
|
|
1695
1953
|
});
|
|
1696
1954
|
}
|
|
1697
1955
|
}();
|
|
@@ -1706,9 +1964,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1706
1964
|
};
|
|
1707
1965
|
_proto.updateMissionsOnOptIn = function updateMissionsOnOptIn() {
|
|
1708
1966
|
try {
|
|
1709
|
-
var
|
|
1710
|
-
return Promise.resolve(
|
|
1711
|
-
|
|
1967
|
+
var _this33 = this;
|
|
1968
|
+
return Promise.resolve(_this33.api.missionsGetItemsT(null)).then(function (payload) {
|
|
1969
|
+
_this33.updateEntity(onUpdateContextKey.Missions, payload);
|
|
1712
1970
|
});
|
|
1713
1971
|
} catch (e) {
|
|
1714
1972
|
return Promise.reject(e);
|
|
@@ -1716,9 +1974,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1716
1974
|
};
|
|
1717
1975
|
_proto.updateTournamentsOnRegistration = function updateTournamentsOnRegistration() {
|
|
1718
1976
|
try {
|
|
1719
|
-
var
|
|
1720
|
-
return Promise.resolve(
|
|
1721
|
-
|
|
1977
|
+
var _this34 = this;
|
|
1978
|
+
return Promise.resolve(_this34.api.tournamentsGetLobbyT(null)).then(function (payload) {
|
|
1979
|
+
_this34.updateEntity(onUpdateContextKey.TournamentList, payload);
|
|
1722
1980
|
});
|
|
1723
1981
|
} catch (e) {
|
|
1724
1982
|
return Promise.reject(e);
|
|
@@ -1726,9 +1984,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1726
1984
|
};
|
|
1727
1985
|
_proto.updateInboxMessages = function updateInboxMessages() {
|
|
1728
1986
|
try {
|
|
1729
|
-
var
|
|
1730
|
-
return Promise.resolve(
|
|
1731
|
-
|
|
1987
|
+
var _this35 = this;
|
|
1988
|
+
return Promise.resolve(_this35.api.getInboxMessagesT(null)).then(function (payload) {
|
|
1989
|
+
_this35.updateEntity(onUpdateContextKey.InboxMessages, payload);
|
|
1732
1990
|
});
|
|
1733
1991
|
} catch (e) {
|
|
1734
1992
|
return Promise.reject(e);
|
|
@@ -1736,9 +1994,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1736
1994
|
};
|
|
1737
1995
|
_proto.updateEntity = function updateEntity(contextKey, payload) {
|
|
1738
1996
|
try {
|
|
1739
|
-
var
|
|
1997
|
+
var _this36 = this;
|
|
1740
1998
|
OCache.set(contextKey, payload, exports.ECacheContext.WSAPI);
|
|
1741
|
-
var onUpdate =
|
|
1999
|
+
var onUpdate = _this36.onUpdateCallback.get(contextKey);
|
|
1742
2000
|
if (onUpdate) {
|
|
1743
2001
|
onUpdate(payload);
|
|
1744
2002
|
}
|
|
@@ -1760,32 +2018,40 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1760
2018
|
* If filter is not provided, all active jackpots will be returned.
|
|
1761
2019
|
* Filter can be used to get jackpots related to specific game or specific jackpot template.
|
|
1762
2020
|
* You can call this method every second in order to get up to date information about current value of the jackpot(s) and present them to the end-users
|
|
1763
|
-
*
|
|
2021
|
+
*
|
|
2022
|
+
* **Example**:
|
|
1764
2023
|
* ```
|
|
1765
2024
|
* _smartico.api.jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
1766
2025
|
* console.log(result);
|
|
1767
2026
|
* });
|
|
1768
2027
|
* ```
|
|
2028
|
+
*
|
|
2029
|
+
* **Example in the Visitor mode**:
|
|
2030
|
+
* ```
|
|
2031
|
+
* _smartico.vapi('EN').jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
2032
|
+
* console.log(result);
|
|
2033
|
+
* });
|
|
2034
|
+
* ```
|
|
1769
2035
|
*/
|
|
1770
2036
|
;
|
|
1771
2037
|
_proto.jackpotGet = function jackpotGet(filter) {
|
|
1772
2038
|
try {
|
|
1773
|
-
var
|
|
2039
|
+
var _this37 = this;
|
|
1774
2040
|
var signature = (filter == null ? void 0 : filter.jp_template_id) + ":" + (filter == null ? void 0 : filter.related_game_id);
|
|
1775
|
-
if (signature !==
|
|
1776
|
-
|
|
1777
|
-
|
|
2041
|
+
if (signature !== _this37.jackpotGetSignature) {
|
|
2042
|
+
_this37.jackpotGetSignature = signature;
|
|
2043
|
+
_this37.jackpotClearCache();
|
|
1778
2044
|
}
|
|
1779
2045
|
var jackpots = [];
|
|
1780
2046
|
var pots = [];
|
|
1781
2047
|
return Promise.resolve(OCache.use(onUpdateContextKey.Jackpots, exports.ECacheContext.WSAPI, function () {
|
|
1782
2048
|
try {
|
|
1783
|
-
return Promise.resolve(
|
|
1784
|
-
var _pots = _jackpots.map(function (jp) {
|
|
2049
|
+
return Promise.resolve(_this37.api.jackpotGet(null, filter)).then(function (_jackpots) {
|
|
2050
|
+
var _pots = _jackpots.items.map(function (jp) {
|
|
1785
2051
|
return jp.pot;
|
|
1786
2052
|
});
|
|
1787
2053
|
OCache.set(onUpdateContextKey.Pots, _pots, exports.ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);
|
|
1788
|
-
return _jackpots;
|
|
2054
|
+
return _jackpots.items;
|
|
1789
2055
|
});
|
|
1790
2056
|
} catch (e) {
|
|
1791
2057
|
return Promise.reject(e);
|
|
@@ -1809,9 +2075,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1809
2075
|
var jp_template_ids = jackpots.map(function (jp) {
|
|
1810
2076
|
return jp.jp_template_id;
|
|
1811
2077
|
});
|
|
1812
|
-
return Promise.resolve(
|
|
2078
|
+
return Promise.resolve(_this37.api.potGet(null, {
|
|
1813
2079
|
jp_template_ids: jp_template_ids
|
|
1814
|
-
}))
|
|
2080
|
+
})).then(function (_this37$api$potGet) {
|
|
2081
|
+
return _this37$api$potGet.items;
|
|
2082
|
+
});
|
|
1815
2083
|
} catch (e) {
|
|
1816
2084
|
return Promise.reject(e);
|
|
1817
2085
|
}
|
|
@@ -1826,46 +2094,56 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1826
2094
|
return Promise.reject(e);
|
|
1827
2095
|
}
|
|
1828
2096
|
}
|
|
1829
|
-
/**
|
|
2097
|
+
/**
|
|
2098
|
+
* Opt-in currently logged in user to the jackpot with the specified jp_template_id.
|
|
1830
2099
|
* You may call jackpotGet method after doing optin to see that user is opted in to the jackpot.
|
|
1831
|
-
*
|
|
2100
|
+
*
|
|
2101
|
+
* **Example**:
|
|
1832
2102
|
* ```
|
|
1833
2103
|
* _smartico.api.jackpotOptIn({ jp_template_id: 123 }).then((result) => {
|
|
1834
2104
|
* console.log('Opted in to the jackpot');
|
|
1835
2105
|
* });
|
|
1836
2106
|
* ```
|
|
2107
|
+
*
|
|
2108
|
+
* **Visitor mode: not supported**
|
|
2109
|
+
*
|
|
1837
2110
|
*/
|
|
1838
2111
|
;
|
|
1839
2112
|
_proto.jackpotOptIn = function jackpotOptIn(filter) {
|
|
1840
2113
|
try {
|
|
1841
|
-
var
|
|
2114
|
+
var _this38 = this;
|
|
1842
2115
|
if (!filter.jp_template_id) {
|
|
1843
2116
|
throw new Error('jp_template_id is required in jackpotOptIn');
|
|
1844
2117
|
}
|
|
1845
2118
|
;
|
|
1846
|
-
return Promise.resolve(
|
|
2119
|
+
return Promise.resolve(_this38.api.jackpotOptIn(null, filter));
|
|
1847
2120
|
} catch (e) {
|
|
1848
2121
|
return Promise.reject(e);
|
|
1849
2122
|
}
|
|
1850
2123
|
}
|
|
1851
|
-
/**
|
|
2124
|
+
/**
|
|
2125
|
+
* Opt-out currently logged in user from the jackpot with the specified jp_template_id.
|
|
1852
2126
|
* You may call jackpotGet method after doing optout to see that user is not opted in to the jackpot.
|
|
1853
|
-
*
|
|
2127
|
+
*
|
|
2128
|
+
* **Example**:
|
|
1854
2129
|
* ```
|
|
1855
2130
|
* _smartico.api.jackpotOptOut({ jp_template_id: 123 }).then((result) => {
|
|
1856
2131
|
* console.log('Opted out from the jackpot');
|
|
1857
2132
|
* });
|
|
1858
2133
|
* ```
|
|
2134
|
+
*
|
|
2135
|
+
* **Visitor mode: not supported**
|
|
2136
|
+
*
|
|
1859
2137
|
*/
|
|
1860
2138
|
;
|
|
1861
2139
|
_proto.jackpotOptOut = function jackpotOptOut(filter) {
|
|
1862
2140
|
try {
|
|
1863
|
-
var
|
|
2141
|
+
var _this39 = this;
|
|
1864
2142
|
if (!filter.jp_template_id) {
|
|
1865
2143
|
throw new Error('jp_template_id is required in jackpotOptOut');
|
|
1866
2144
|
}
|
|
1867
2145
|
;
|
|
1868
|
-
return Promise.resolve(
|
|
2146
|
+
return Promise.resolve(_this39.api.jackpotOptOut(null, filter));
|
|
1869
2147
|
} catch (e) {
|
|
1870
2148
|
return Promise.reject(e);
|
|
1871
2149
|
}
|
|
@@ -1919,6 +2197,58 @@ var getLeaderBoardTransform = function getLeaderBoardTransform(board) {
|
|
|
1919
2197
|
return null;
|
|
1920
2198
|
};
|
|
1921
2199
|
|
|
2200
|
+
var AchCustomSectionType;
|
|
2201
|
+
(function (AchCustomSectionType) {
|
|
2202
|
+
AchCustomSectionType[AchCustomSectionType["HTML_PAGE"] = 1] = "HTML_PAGE";
|
|
2203
|
+
AchCustomSectionType[AchCustomSectionType["MISSIONS_CATEGORY"] = 2] = "MISSIONS_CATEGORY";
|
|
2204
|
+
AchCustomSectionType[AchCustomSectionType["TOURNAMENTS_CATEGORY"] = 3] = "TOURNAMENTS_CATEGORY";
|
|
2205
|
+
AchCustomSectionType[AchCustomSectionType["LEVELS"] = 4] = "LEVELS";
|
|
2206
|
+
AchCustomSectionType[AchCustomSectionType["MINI_GAMES"] = 5] = "MINI_GAMES";
|
|
2207
|
+
AchCustomSectionType[AchCustomSectionType["MISSION_CUSTOM_LAYOUT"] = 6] = "MISSION_CUSTOM_LAYOUT";
|
|
2208
|
+
AchCustomSectionType[AchCustomSectionType["MATCH_X"] = 7] = "MATCH_X";
|
|
2209
|
+
})(AchCustomSectionType || (AchCustomSectionType = {}));
|
|
2210
|
+
var AchCustomLayoutTheme;
|
|
2211
|
+
(function (AchCustomLayoutTheme) {
|
|
2212
|
+
AchCustomLayoutTheme["VALENTINES_LIGHT"] = "valentines-light";
|
|
2213
|
+
AchCustomLayoutTheme["VALENTINES_DARK"] = "valentines-dark";
|
|
2214
|
+
AchCustomLayoutTheme["EURO_2024"] = "euro-2024";
|
|
2215
|
+
AchCustomLayoutTheme["GENERIC"] = "generic";
|
|
2216
|
+
})(AchCustomLayoutTheme || (AchCustomLayoutTheme = {}));
|
|
2217
|
+
var AchMissionsTabsOptions;
|
|
2218
|
+
(function (AchMissionsTabsOptions) {
|
|
2219
|
+
AchMissionsTabsOptions[AchMissionsTabsOptions["ONLY_OVERVIEW"] = 1] = "ONLY_OVERVIEW";
|
|
2220
|
+
AchMissionsTabsOptions[AchMissionsTabsOptions["NO_OVERVIEW"] = 2] = "NO_OVERVIEW";
|
|
2221
|
+
AchMissionsTabsOptions[AchMissionsTabsOptions["ALL"] = 3] = "ALL";
|
|
2222
|
+
})(AchMissionsTabsOptions || (AchMissionsTabsOptions = {}));
|
|
2223
|
+
var AchOverviewMissionsFilter;
|
|
2224
|
+
(function (AchOverviewMissionsFilter) {
|
|
2225
|
+
AchOverviewMissionsFilter[AchOverviewMissionsFilter["ANY"] = 1] = "ANY";
|
|
2226
|
+
AchOverviewMissionsFilter[AchOverviewMissionsFilter["ALL_MISSIONS"] = 2] = "ALL_MISSIONS";
|
|
2227
|
+
AchOverviewMissionsFilter[AchOverviewMissionsFilter["ALL_EXCEPT_COMPLETED"] = 3] = "ALL_EXCEPT_COMPLETED";
|
|
2228
|
+
AchOverviewMissionsFilter[AchOverviewMissionsFilter["ALL_EXCEPT_LOCKED"] = 4] = "ALL_EXCEPT_LOCKED";
|
|
2229
|
+
AchOverviewMissionsFilter[AchOverviewMissionsFilter["ALL_EXCEPT_COMPLETED_AND_LOCKED"] = 5] = "ALL_EXCEPT_COMPLETED_AND_LOCKED";
|
|
2230
|
+
})(AchOverviewMissionsFilter || (AchOverviewMissionsFilter = {}));
|
|
2231
|
+
|
|
2232
|
+
var UICustomSectionTransform = function UICustomSectionTransform(items) {
|
|
2233
|
+
return items.filter(function (r) {
|
|
2234
|
+
return r.section_type_id !== undefined && r.section_type_id >= 1;
|
|
2235
|
+
}).map(function (r) {
|
|
2236
|
+
var x = {
|
|
2237
|
+
body: r.body,
|
|
2238
|
+
menu_img: r.menu_img,
|
|
2239
|
+
menu_name: r.menu_name,
|
|
2240
|
+
section_type_id: r.section_type_id,
|
|
2241
|
+
custom_skin_images: r.custom_skin_images,
|
|
2242
|
+
generic_custom_css: r.generic_custom_css,
|
|
2243
|
+
mission_tabs_options: r.mission_tabs_options,
|
|
2244
|
+
overview_missions_count: r.overview_missions_count,
|
|
2245
|
+
overview_missions_filter: r.overview_missions_filter,
|
|
2246
|
+
theme: r.theme
|
|
2247
|
+
};
|
|
2248
|
+
return x;
|
|
2249
|
+
});
|
|
2250
|
+
};
|
|
2251
|
+
|
|
1922
2252
|
function _catch(body, recover) {
|
|
1923
2253
|
try {
|
|
1924
2254
|
var result = body();
|
|
@@ -1990,7 +2320,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
1990
2320
|
return AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
1991
2321
|
};
|
|
1992
2322
|
var _proto = SmarticoAPI.prototype;
|
|
1993
|
-
_proto.send = function send(message, expectCID) {
|
|
2323
|
+
_proto.send = function send(message, expectCID, force_language) {
|
|
1994
2324
|
try {
|
|
1995
2325
|
var _temp2 = function _temp2(_result) {
|
|
1996
2326
|
if (_exit) return _result;
|
|
@@ -2039,6 +2369,9 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2039
2369
|
if (_this.logCIDs.includes(message.cid)) {
|
|
2040
2370
|
_this.logger.info('REQ', message);
|
|
2041
2371
|
}
|
|
2372
|
+
if (force_language) {
|
|
2373
|
+
message.force_language = force_language;
|
|
2374
|
+
}
|
|
2042
2375
|
var result;
|
|
2043
2376
|
var _temp = _catch(function () {
|
|
2044
2377
|
var timeStart = new Date().getTime();
|
|
@@ -2199,13 +2532,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2199
2532
|
return Promise.reject(e);
|
|
2200
2533
|
}
|
|
2201
2534
|
};
|
|
2202
|
-
_proto.jackpotGet = function jackpotGet(user_ext_id, filter) {
|
|
2535
|
+
_proto.jackpotGet = function jackpotGet(user_ext_id, filter, force_language) {
|
|
2203
2536
|
try {
|
|
2204
2537
|
var _this8 = this;
|
|
2205
2538
|
var message = _this8.buildMessage(user_ext_id, exports.ClassId.JP_GET_JACKPOTS_REQUEST, filter);
|
|
2206
|
-
return Promise.resolve(_this8.send(message, exports.ClassId.JP_GET_JACKPOTS_RESPONSE))
|
|
2207
|
-
return (response == null ? void 0 : response.items) || [];
|
|
2208
|
-
});
|
|
2539
|
+
return Promise.resolve(_this8.send(message, exports.ClassId.JP_GET_JACKPOTS_RESPONSE, force_language));
|
|
2209
2540
|
} catch (e) {
|
|
2210
2541
|
return Promise.reject(e);
|
|
2211
2542
|
}
|
|
@@ -2214,9 +2545,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2214
2545
|
try {
|
|
2215
2546
|
var _this9 = this;
|
|
2216
2547
|
var message = _this9.buildMessage(user_ext_id, exports.ClassId.JP_GET_LATEST_POTS_REQUEST, filter);
|
|
2217
|
-
return Promise.resolve(_this9.send(message, exports.ClassId.JP_GET_LATEST_POTS_RESPONSE))
|
|
2218
|
-
return (response == null ? void 0 : response.items) || [];
|
|
2219
|
-
});
|
|
2548
|
+
return Promise.resolve(_this9.send(message, exports.ClassId.JP_GET_LATEST_POTS_RESPONSE));
|
|
2220
2549
|
} catch (e) {
|
|
2221
2550
|
return Promise.reject(e);
|
|
2222
2551
|
}
|
|
@@ -2239,19 +2568,16 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2239
2568
|
return Promise.reject(e);
|
|
2240
2569
|
}
|
|
2241
2570
|
};
|
|
2242
|
-
_proto.sawGetTemplates = function sawGetTemplates(user_ext_id,
|
|
2571
|
+
_proto.sawGetTemplates = function sawGetTemplates(user_ext_id, force_language, is_visitor_mode) {
|
|
2243
2572
|
if (is_visitor_mode === void 0) {
|
|
2244
2573
|
is_visitor_mode = false;
|
|
2245
2574
|
}
|
|
2246
2575
|
try {
|
|
2247
2576
|
var _this12 = this;
|
|
2248
|
-
var message = _this12.buildMessage(user_ext_id, exports.ClassId.SAW_GET_SPINS_REQUEST,
|
|
2249
|
-
force_language: lang,
|
|
2250
|
-
is_visitor_mode: is_visitor_mode
|
|
2251
|
-
} : {
|
|
2577
|
+
var message = _this12.buildMessage(user_ext_id, exports.ClassId.SAW_GET_SPINS_REQUEST, {
|
|
2252
2578
|
is_visitor_mode: is_visitor_mode
|
|
2253
2579
|
});
|
|
2254
|
-
return Promise.resolve(_this12.send(message, exports.ClassId.SAW_GET_SPINS_RESPONSE)).then(function (response) {
|
|
2580
|
+
return Promise.resolve(_this12.send(message, exports.ClassId.SAW_GET_SPINS_RESPONSE, force_language)).then(function (response) {
|
|
2255
2581
|
if (response && response.templates) {
|
|
2256
2582
|
response.templates.forEach(function (t) {
|
|
2257
2583
|
if (t.jackpot_current !== undefined && t.jackpot_current !== null) {
|
|
@@ -2399,11 +2725,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2399
2725
|
return Promise.reject(e);
|
|
2400
2726
|
}
|
|
2401
2727
|
};
|
|
2402
|
-
_proto.storeGetItems = function storeGetItems(user_ext_id) {
|
|
2728
|
+
_proto.storeGetItems = function storeGetItems(user_ext_id, force_language) {
|
|
2403
2729
|
try {
|
|
2404
2730
|
var _this21 = this;
|
|
2405
2731
|
var message = _this21.buildMessage(user_ext_id, exports.ClassId.GET_SHOP_ITEMS_REQUEST);
|
|
2406
|
-
return Promise.resolve(_this21.send(message, exports.ClassId.GET_SHOP_ITEMS_RESPONSE));
|
|
2732
|
+
return Promise.resolve(_this21.send(message, exports.ClassId.GET_SHOP_ITEMS_RESPONSE, force_language));
|
|
2407
2733
|
} catch (e) {
|
|
2408
2734
|
return Promise.reject(e);
|
|
2409
2735
|
}
|
|
@@ -2418,11 +2744,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2418
2744
|
return Promise.reject(e);
|
|
2419
2745
|
}
|
|
2420
2746
|
};
|
|
2421
|
-
_proto.storeGetCategories = function storeGetCategories(user_ext_id) {
|
|
2747
|
+
_proto.storeGetCategories = function storeGetCategories(user_ext_id, force_language) {
|
|
2422
2748
|
try {
|
|
2423
2749
|
var _this23 = this;
|
|
2424
2750
|
var message = _this23.buildMessage(user_ext_id, exports.ClassId.GET_SHOP_CATEGORIES_REQUEST);
|
|
2425
|
-
return Promise.resolve(_this23.send(message, exports.ClassId.GET_SHOP_CATEGORIES_RESPONSE));
|
|
2751
|
+
return Promise.resolve(_this23.send(message, exports.ClassId.GET_SHOP_CATEGORIES_RESPONSE, force_language));
|
|
2426
2752
|
} catch (e) {
|
|
2427
2753
|
return Promise.reject(e);
|
|
2428
2754
|
}
|
|
@@ -2465,11 +2791,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2465
2791
|
return Promise.reject(e);
|
|
2466
2792
|
}
|
|
2467
2793
|
};
|
|
2468
|
-
_proto.missionsGetItems = function missionsGetItems(user_ext_id) {
|
|
2794
|
+
_proto.missionsGetItems = function missionsGetItems(user_ext_id, force_language) {
|
|
2469
2795
|
try {
|
|
2470
2796
|
var _this27 = this;
|
|
2471
2797
|
var message = _this27.buildMessage(user_ext_id, exports.ClassId.GET_ACHIEVEMENT_MAP_REQUEST);
|
|
2472
|
-
return Promise.resolve(_this27.send(message, exports.ClassId.GET_ACHIEVEMENT_MAP_RESPONSE)).then(function (response) {
|
|
2798
|
+
return Promise.resolve(_this27.send(message, exports.ClassId.GET_ACHIEVEMENT_MAP_RESPONSE, force_language)).then(function (response) {
|
|
2473
2799
|
// we need to clone response to avoid changing original object,for cases when its called together with badgesGetItems (e.g. in Promise.all)
|
|
2474
2800
|
var responseClone = _extends({}, response);
|
|
2475
2801
|
if (responseClone.achievements) {
|
|
@@ -2515,11 +2841,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2515
2841
|
return Promise.reject(e);
|
|
2516
2842
|
}
|
|
2517
2843
|
};
|
|
2518
|
-
_proto.achGetCategories = function achGetCategories(user_ext_id) {
|
|
2844
|
+
_proto.achGetCategories = function achGetCategories(user_ext_id, force_language) {
|
|
2519
2845
|
try {
|
|
2520
2846
|
var _this31 = this;
|
|
2521
2847
|
var message = _this31.buildMessage(user_ext_id, exports.ClassId.GET_ACH_CATEGORIES_REQUEST);
|
|
2522
|
-
return Promise.resolve(_this31.send(message, exports.ClassId.GET_ACH_CATEGORIES_RESPONSE));
|
|
2848
|
+
return Promise.resolve(_this31.send(message, exports.ClassId.GET_ACH_CATEGORIES_RESPONSE, force_language));
|
|
2523
2849
|
} catch (e) {
|
|
2524
2850
|
return Promise.reject(e);
|
|
2525
2851
|
}
|
|
@@ -2534,11 +2860,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2534
2860
|
return Promise.reject(e);
|
|
2535
2861
|
}
|
|
2536
2862
|
};
|
|
2537
|
-
_proto.badgetsGetItems = function badgetsGetItems(user_ext_id) {
|
|
2863
|
+
_proto.badgetsGetItems = function badgetsGetItems(user_ext_id, force_language) {
|
|
2538
2864
|
try {
|
|
2539
2865
|
var _this33 = this;
|
|
2540
2866
|
var message = _this33.buildMessage(user_ext_id, exports.ClassId.GET_ACHIEVEMENT_MAP_REQUEST);
|
|
2541
|
-
return Promise.resolve(_this33.send(message, exports.ClassId.GET_ACHIEVEMENT_MAP_RESPONSE)).then(function (response) {
|
|
2867
|
+
return Promise.resolve(_this33.send(message, exports.ClassId.GET_ACHIEVEMENT_MAP_RESPONSE, force_language)).then(function (response) {
|
|
2542
2868
|
// we need to clone response to avoid changing original object,for cases when its called together with missionsGetItems (e.g. in Promise.all)
|
|
2543
2869
|
var responseClone = _extends({}, response);
|
|
2544
2870
|
if (responseClone.achievements) {
|
|
@@ -2562,11 +2888,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2562
2888
|
return Promise.reject(e);
|
|
2563
2889
|
}
|
|
2564
2890
|
};
|
|
2565
|
-
_proto.tournamentsGetLobby = function tournamentsGetLobby(user_ext_id) {
|
|
2891
|
+
_proto.tournamentsGetLobby = function tournamentsGetLobby(user_ext_id, force_language) {
|
|
2566
2892
|
try {
|
|
2567
2893
|
var _this35 = this;
|
|
2568
2894
|
var message = _this35.buildMessage(user_ext_id, exports.ClassId.GET_TOURNAMENT_LOBBY_REQUEST);
|
|
2569
|
-
return Promise.resolve(_this35.send(message, exports.ClassId.GET_TOURNAMENT_LOBBY_RESPONSE));
|
|
2895
|
+
return Promise.resolve(_this35.send(message, exports.ClassId.GET_TOURNAMENT_LOBBY_RESPONSE, force_language));
|
|
2570
2896
|
} catch (e) {
|
|
2571
2897
|
return Promise.reject(e);
|
|
2572
2898
|
}
|
|
@@ -2581,13 +2907,13 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2581
2907
|
return Promise.reject(e);
|
|
2582
2908
|
}
|
|
2583
2909
|
};
|
|
2584
|
-
_proto.tournamentsGetInfo = function tournamentsGetInfo(user_ext_id, tournamentInstanceId) {
|
|
2910
|
+
_proto.tournamentsGetInfo = function tournamentsGetInfo(user_ext_id, tournamentInstanceId, force_language) {
|
|
2585
2911
|
try {
|
|
2586
2912
|
var _this37 = this;
|
|
2587
2913
|
var message = _this37.buildMessage(user_ext_id, exports.ClassId.GET_TOURNAMENT_INFO_REQUEST, {
|
|
2588
2914
|
tournamentInstanceId: tournamentInstanceId
|
|
2589
2915
|
});
|
|
2590
|
-
return Promise.resolve(_this37.send(message, exports.ClassId.GET_TOURNAMENT_INFO_RESPONSE)).then(function (response) {
|
|
2916
|
+
return Promise.resolve(_this37.send(message, exports.ClassId.GET_TOURNAMENT_INFO_RESPONSE, force_language)).then(function (response) {
|
|
2591
2917
|
var _response$userPositio, _response$tournamentI;
|
|
2592
2918
|
if ((_response$userPositio = response.userPosition) != null && _response$userPositio.avatar_id) {
|
|
2593
2919
|
response.userPosition.avatar_url = CoreUtils.avatarUrl(response.userPosition.avatar_id, _this37.avatarDomain);
|
|
@@ -2614,7 +2940,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2614
2940
|
return Promise.reject(e);
|
|
2615
2941
|
}
|
|
2616
2942
|
};
|
|
2617
|
-
_proto.leaderboardGet = function leaderboardGet(user_ext_id, period_type_id, prevPeriod) {
|
|
2943
|
+
_proto.leaderboardGet = function leaderboardGet(user_ext_id, period_type_id, prevPeriod, force_language) {
|
|
2618
2944
|
if (prevPeriod === void 0) {
|
|
2619
2945
|
prevPeriod = false;
|
|
2620
2946
|
}
|
|
@@ -2625,7 +2951,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2625
2951
|
snapshot_offset: prevPeriod ? 1 : 0,
|
|
2626
2952
|
include_users: true
|
|
2627
2953
|
});
|
|
2628
|
-
return Promise.resolve(_this39.send(message, exports.ClassId.GET_LEADERS_BOARD_RESPONSE)).then(function (response) {
|
|
2954
|
+
return Promise.resolve(_this39.send(message, exports.ClassId.GET_LEADERS_BOARD_RESPONSE, force_language)).then(function (response) {
|
|
2629
2955
|
var _response$map$boardKe, _response$map$boardKe2, _response$map$boardKe3, _response$map$boardKe4;
|
|
2630
2956
|
var boardKey = Object.keys(response.map).find(function (k) {
|
|
2631
2957
|
return period_type_id === undefined || k === (period_type_id == null ? void 0 : period_type_id.toString());
|
|
@@ -2659,11 +2985,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2659
2985
|
return Promise.reject(e);
|
|
2660
2986
|
}
|
|
2661
2987
|
};
|
|
2662
|
-
_proto.levelsGet = function levelsGet(user_ext_id) {
|
|
2988
|
+
_proto.levelsGet = function levelsGet(user_ext_id, force_language) {
|
|
2663
2989
|
try {
|
|
2664
2990
|
var _this41 = this;
|
|
2665
2991
|
var message = _this41.buildMessage(user_ext_id, exports.ClassId.GET_LEVEL_MAP_REQUEST);
|
|
2666
|
-
return Promise.resolve(_this41.send(message, exports.ClassId.GET_LEVEL_MAP_RESPONSE));
|
|
2992
|
+
return Promise.resolve(_this41.send(message, exports.ClassId.GET_LEVEL_MAP_RESPONSE, force_language));
|
|
2667
2993
|
} catch (e) {
|
|
2668
2994
|
return Promise.reject(e);
|
|
2669
2995
|
}
|
|
@@ -2676,10 +3002,29 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2676
3002
|
return Promise.reject(e);
|
|
2677
3003
|
}
|
|
2678
3004
|
};
|
|
2679
|
-
_proto.
|
|
3005
|
+
_proto.getCustomSections = function getCustomSections(user_ext_id) {
|
|
2680
3006
|
try {
|
|
2681
3007
|
var _this43 = this;
|
|
2682
|
-
|
|
3008
|
+
var message = _this43.buildMessage(user_ext_id, exports.ClassId.GET_CUSTOM_SECTIONS_REQUEST);
|
|
3009
|
+
return Promise.resolve(_this43.send(message, exports.ClassId.GET_CUSTOM_SECTIONS_RESPONSE));
|
|
3010
|
+
} catch (e) {
|
|
3011
|
+
return Promise.reject(e);
|
|
3012
|
+
}
|
|
3013
|
+
};
|
|
3014
|
+
_proto.getCustomSectionsT = function getCustomSectionsT(user_ext_id) {
|
|
3015
|
+
try {
|
|
3016
|
+
var _this44 = this;
|
|
3017
|
+
return Promise.resolve(_this44.getCustomSections(user_ext_id)).then(function (_this44$getCustomSect) {
|
|
3018
|
+
return UICustomSectionTransform(Object.values(_this44$getCustomSect.customSections));
|
|
3019
|
+
});
|
|
3020
|
+
} catch (e) {
|
|
3021
|
+
return Promise.reject(e);
|
|
3022
|
+
}
|
|
3023
|
+
};
|
|
3024
|
+
_proto.getTranslationsT = function getTranslationsT(user_ext_id, lang_code, areas, cacheSec) {
|
|
3025
|
+
try {
|
|
3026
|
+
var _this45 = this;
|
|
3027
|
+
return Promise.resolve(_this45.coreGetTranslations(user_ext_id, lang_code, areas, 30));
|
|
2683
3028
|
} catch (e) {
|
|
2684
3029
|
return Promise.reject(e);
|
|
2685
3030
|
}
|
|
@@ -2692,13 +3037,13 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2692
3037
|
offset = 0;
|
|
2693
3038
|
}
|
|
2694
3039
|
try {
|
|
2695
|
-
var
|
|
2696
|
-
var message =
|
|
3040
|
+
var _this46 = this;
|
|
3041
|
+
var message = _this46.buildMessage(user_ext_id, exports.ClassId.GET_INBOX_MESSAGES_REQUEST, {
|
|
2697
3042
|
limit: limit,
|
|
2698
3043
|
offset: offset,
|
|
2699
3044
|
starred_only: starred_only
|
|
2700
3045
|
});
|
|
2701
|
-
return Promise.resolve(
|
|
3046
|
+
return Promise.resolve(_this46.send(message, exports.ClassId.GET_INBOX_MESSAGES_RESPONSE));
|
|
2702
3047
|
} catch (e) {
|
|
2703
3048
|
return Promise.reject(e);
|
|
2704
3049
|
}
|
|
@@ -2714,21 +3059,21 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2714
3059
|
favoriteOnly = false;
|
|
2715
3060
|
}
|
|
2716
3061
|
try {
|
|
2717
|
-
var
|
|
3062
|
+
var _this47 = this;
|
|
2718
3063
|
var limit = to - from > 20 ? 20 : to - from;
|
|
2719
3064
|
var offset = from;
|
|
2720
|
-
return Promise.resolve(
|
|
2721
|
-
return InboxMessagesTransform(
|
|
3065
|
+
return Promise.resolve(_this47.getInboxMessages(user_ext_id, limit, offset, favoriteOnly)).then(function (_this47$getInboxMessa) {
|
|
3066
|
+
return InboxMessagesTransform(_this47$getInboxMessa.log);
|
|
2722
3067
|
});
|
|
2723
3068
|
} catch (e) {
|
|
2724
3069
|
return Promise.reject(e);
|
|
2725
3070
|
}
|
|
2726
3071
|
};
|
|
2727
3072
|
_proto.getInboxMessageBody = function getInboxMessageBody(messageGuid) {
|
|
2728
|
-
var
|
|
3073
|
+
var _this48 = this;
|
|
2729
3074
|
var getMessageBody = function getMessageBody(messageGuid) {
|
|
2730
3075
|
try {
|
|
2731
|
-
var inboxCdnUrl =
|
|
3076
|
+
var inboxCdnUrl = _this48.tracker.getLabelSetting(exports.PublicLabelSettings.INBOX_PUBLIC_CDN);
|
|
2732
3077
|
return Promise.resolve(_catch(function () {
|
|
2733
3078
|
var url = "" + inboxCdnUrl + messageGuid + ".json";
|
|
2734
3079
|
return Promise.resolve(fetch(url, {
|
|
@@ -2744,7 +3089,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2744
3089
|
});
|
|
2745
3090
|
});
|
|
2746
3091
|
}, function (error) {
|
|
2747
|
-
|
|
3092
|
+
_this48.logger.error('Error fetching inbox message body:', error);
|
|
2748
3093
|
return null;
|
|
2749
3094
|
}));
|
|
2750
3095
|
} catch (e) {
|
|
@@ -2755,64 +3100,64 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
2755
3100
|
};
|
|
2756
3101
|
_proto.getInboxMessageBodyT = function getInboxMessageBodyT(messageGuid) {
|
|
2757
3102
|
try {
|
|
2758
|
-
var
|
|
2759
|
-
return Promise.resolve(
|
|
3103
|
+
var _this49 = this;
|
|
3104
|
+
return Promise.resolve(_this49.getInboxMessageBody(messageGuid)).then(InboxMessageBodyTransform);
|
|
2760
3105
|
} catch (e) {
|
|
2761
3106
|
return Promise.reject(e);
|
|
2762
3107
|
}
|
|
2763
3108
|
};
|
|
2764
3109
|
_proto.markInboxMessageRead = function markInboxMessageRead(user_ext_id, messageGuid) {
|
|
2765
3110
|
try {
|
|
2766
|
-
var
|
|
2767
|
-
var message =
|
|
3111
|
+
var _this50 = this;
|
|
3112
|
+
var message = _this50.buildMessage(user_ext_id, exports.ClassId.MARK_INBOX_READ_REQUEST, {
|
|
2768
3113
|
engagement_uid: messageGuid
|
|
2769
3114
|
});
|
|
2770
|
-
return Promise.resolve(
|
|
3115
|
+
return Promise.resolve(_this50.send(message, exports.ClassId.MARK_INBOX_READ_RESPONSE));
|
|
2771
3116
|
} catch (e) {
|
|
2772
3117
|
return Promise.reject(e);
|
|
2773
3118
|
}
|
|
2774
3119
|
};
|
|
2775
3120
|
_proto.markAllInboxMessageRead = function markAllInboxMessageRead(user_ext_id) {
|
|
2776
3121
|
try {
|
|
2777
|
-
var
|
|
2778
|
-
var message =
|
|
3122
|
+
var _this51 = this;
|
|
3123
|
+
var message = _this51.buildMessage(user_ext_id, exports.ClassId.MARK_INBOX_READ_REQUEST, {
|
|
2779
3124
|
all_read: true
|
|
2780
3125
|
});
|
|
2781
|
-
return Promise.resolve(
|
|
3126
|
+
return Promise.resolve(_this51.send(message, exports.ClassId.MARK_INBOX_READ_RESPONSE));
|
|
2782
3127
|
} catch (e) {
|
|
2783
3128
|
return Promise.reject(e);
|
|
2784
3129
|
}
|
|
2785
3130
|
};
|
|
2786
3131
|
_proto.markUnmarkInboxMessageAsFavorite = function markUnmarkInboxMessageAsFavorite(user_ext_id, messageGuid, mark) {
|
|
2787
3132
|
try {
|
|
2788
|
-
var
|
|
2789
|
-
var message =
|
|
3133
|
+
var _this52 = this;
|
|
3134
|
+
var message = _this52.buildMessage(user_ext_id, exports.ClassId.MARK_INBOX_STARRED_REQUEST, {
|
|
2790
3135
|
engagement_uid: messageGuid,
|
|
2791
3136
|
is_starred: mark
|
|
2792
3137
|
});
|
|
2793
|
-
return Promise.resolve(
|
|
3138
|
+
return Promise.resolve(_this52.send(message, exports.ClassId.MARK_INBOX_STARRED_RESPONSE));
|
|
2794
3139
|
} catch (e) {
|
|
2795
3140
|
return Promise.reject(e);
|
|
2796
3141
|
}
|
|
2797
3142
|
};
|
|
2798
3143
|
_proto.deleteInboxMessage = function deleteInboxMessage(user_ext_id, messageGuid) {
|
|
2799
3144
|
try {
|
|
2800
|
-
var
|
|
2801
|
-
var message =
|
|
3145
|
+
var _this53 = this;
|
|
3146
|
+
var message = _this53.buildMessage(user_ext_id, exports.ClassId.MARK_INBOX_DELETED_REQUEST, {
|
|
2802
3147
|
engagement_uid: messageGuid
|
|
2803
3148
|
});
|
|
2804
|
-
return Promise.resolve(
|
|
3149
|
+
return Promise.resolve(_this53.send(message, exports.ClassId.MARK_INBOX_DELETED_RESPONSE));
|
|
2805
3150
|
} catch (e) {
|
|
2806
3151
|
return Promise.reject(e);
|
|
2807
3152
|
}
|
|
2808
3153
|
};
|
|
2809
3154
|
_proto.deleteAllInboxMessages = function deleteAllInboxMessages(user_ext_id) {
|
|
2810
3155
|
try {
|
|
2811
|
-
var
|
|
2812
|
-
var message =
|
|
3156
|
+
var _this54 = this;
|
|
3157
|
+
var message = _this54.buildMessage(user_ext_id, exports.ClassId.MARK_INBOX_DELETED_REQUEST, {
|
|
2813
3158
|
all_deleted: true
|
|
2814
3159
|
});
|
|
2815
|
-
return Promise.resolve(
|
|
3160
|
+
return Promise.resolve(_this54.send(message, exports.ClassId.MARK_INBOX_DELETED_RESPONSE));
|
|
2816
3161
|
} catch (e) {
|
|
2817
3162
|
return Promise.reject(e);
|
|
2818
3163
|
}
|