@smartico/public-api 0.0.140 → 0.0.142
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/OCache.d.ts +1 -0
- package/dist/Quiz/MarketsInfo.d.ts +8 -0
- package/dist/Quiz/MarketsType.d.ts +3 -1
- package/dist/SmarticoAPI.d.ts +13 -13
- package/dist/WSAPI/WSAPI.d.ts +249 -48
- package/dist/index.js +381 -129
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +314 -106
- package/dist/index.modern.mjs.map +1 -1
- package/docs/classes/WSAPI.md +205 -27
- package/package.json +1 -1
- package/src/Level/GetLevelMapResponse.ts +1 -1
- package/src/OCache.ts +5 -0
- package/src/Quiz/MarketsInfo.ts +17 -16
- package/src/Quiz/MarketsType.ts +4 -1
- package/src/SmarticoAPI.ts +30 -32
- package/src/WSAPI/WSAPI.ts +270 -63
package/dist/index.modern.mjs
CHANGED
|
@@ -459,6 +459,9 @@ class OCache {
|
|
|
459
459
|
this.cache[cacheContext].flushAll();
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
+
static async clearAll() {
|
|
463
|
+
this.cache = {};
|
|
464
|
+
}
|
|
462
465
|
}
|
|
463
466
|
OCache.cache = {};
|
|
464
467
|
const deepClone = o => {
|
|
@@ -1082,7 +1085,7 @@ const GetLevelMapResponseTransform = levels => {
|
|
|
1082
1085
|
description: l.level_public_meta.description,
|
|
1083
1086
|
image: l.level_public_meta.image_url,
|
|
1084
1087
|
required_points: l.required_points,
|
|
1085
|
-
visibility_points: parseInt(l.level_public_meta.visibility_points),
|
|
1088
|
+
visibility_points: l.level_public_meta.visibility_points ? parseInt(l.level_public_meta.visibility_points) : null,
|
|
1086
1089
|
required_level_counter_1: l.required_level_counter_1,
|
|
1087
1090
|
required_level_counter_2: l.required_level_counter_2,
|
|
1088
1091
|
custom_data: IntUtils.JsonOrText((_l$level_public_meta = l.level_public_meta) == null ? void 0 : _l$level_public_meta.custom_data)
|
|
@@ -1121,26 +1124,31 @@ class WSAPI {
|
|
|
1121
1124
|
this.onUpdateCallback = new Map();
|
|
1122
1125
|
this.jackpotGetSignature = '';
|
|
1123
1126
|
this.api = api;
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1127
|
+
OCache.clearAll();
|
|
1128
|
+
if (this.api.tracker) {
|
|
1129
|
+
const on = this.api.tracker.on;
|
|
1130
|
+
on(ClassId.SAW_SPINS_COUNT_PUSH, data => this.updateOnSpin(data));
|
|
1131
|
+
on(ClassId.SAW_SHOW_SPIN_PUSH, () => this.updateOnAddSpin());
|
|
1132
|
+
on(ClassId.SAW_DO_SPIN_RESPONSE, data => on(ClassId.SAW_AKNOWLEDGE_RESPONSE, () => this.updateOnPrizeWin(data)));
|
|
1133
|
+
on(ClassId.MISSION_OPTIN_RESPONSE, () => this.updateMissionsOnOptIn());
|
|
1134
|
+
on(ClassId.TOURNAMENT_REGISTER_RESPONSE, () => this.updateTournamentsOnRegistration());
|
|
1135
|
+
on(ClassId.CLIENT_ENGAGEMENT_EVENT_NEW, () => this.updateInboxMessages());
|
|
1136
|
+
on(ClassId.LOGOUT_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));
|
|
1137
|
+
on(ClassId.IDENTIFY_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));
|
|
1138
|
+
on(ClassId.JP_WIN_PUSH, data => this.jackpotClearCache());
|
|
1139
|
+
on(ClassId.JP_OPTOUT_RESPONSE, data => this.jackpotClearCache());
|
|
1140
|
+
on(ClassId.JP_OPTIN_RESPONSE, data => this.jackpotClearCache());
|
|
1141
|
+
}
|
|
1136
1142
|
}
|
|
1137
1143
|
/** Returns information about current user
|
|
1138
|
-
*
|
|
1144
|
+
*
|
|
1145
|
+
* **Example**:
|
|
1139
1146
|
* ```
|
|
1140
1147
|
* _smartico.api.getUserProfile().then((result) => {
|
|
1141
1148
|
* console.log(result);
|
|
1142
1149
|
* });
|
|
1143
1150
|
* ```
|
|
1151
|
+
* **Visitor mode: not supported**
|
|
1144
1152
|
* */
|
|
1145
1153
|
getUserProfile() {
|
|
1146
1154
|
if (this.api.tracker) {
|
|
@@ -1152,12 +1160,14 @@ class WSAPI {
|
|
|
1152
1160
|
}
|
|
1153
1161
|
}
|
|
1154
1162
|
/** Check if user belongs to specific segments
|
|
1155
|
-
* Example
|
|
1163
|
+
* **Example**:
|
|
1156
1164
|
* ```
|
|
1157
1165
|
* _smartico.api.checkSegmentMatch(1).then((result) => {
|
|
1158
1166
|
* console.log(result);
|
|
1159
1167
|
* });
|
|
1160
1168
|
* ```
|
|
1169
|
+
*
|
|
1170
|
+
* **Visitor mode: not supported**
|
|
1161
1171
|
*/
|
|
1162
1172
|
async checkSegmentMatch(segment_id) {
|
|
1163
1173
|
const r = await this.api.coreCheckSegments(null, [segment_id]);
|
|
@@ -1168,21 +1178,29 @@ class WSAPI {
|
|
|
1168
1178
|
}
|
|
1169
1179
|
}
|
|
1170
1180
|
/** Check if user belongs to specific list of segments
|
|
1171
|
-
* Example
|
|
1181
|
+
* **Example**:
|
|
1172
1182
|
* ```
|
|
1173
1183
|
* _smartico.api.checkSegmentListMatch([1, 2, 3]).then((result) => {
|
|
1174
1184
|
* console.log(result);
|
|
1175
1185
|
* });
|
|
1176
1186
|
* ```
|
|
1187
|
+
* **Visitor mode: not supported**
|
|
1177
1188
|
*/
|
|
1178
1189
|
async checkSegmentListMatch(segment_ids) {
|
|
1179
1190
|
return await this.api.coreCheckSegments(null, Array.isArray(segment_ids) ? segment_ids : [segment_ids]);
|
|
1180
1191
|
}
|
|
1181
1192
|
/** Returns all the levels available the current user
|
|
1182
|
-
* Example
|
|
1193
|
+
* **Example**:
|
|
1183
1194
|
* ```
|
|
1184
1195
|
* _smartico.api.getLevels().then((result) => {
|
|
1185
|
-
*
|
|
1196
|
+
* console.log(result);
|
|
1197
|
+
* });
|
|
1198
|
+
* ```
|
|
1199
|
+
*
|
|
1200
|
+
* **Example in the Visitor mode**:
|
|
1201
|
+
* ```
|
|
1202
|
+
* _smartico.vapi('EN').getLevels().then((result) => {
|
|
1203
|
+
* console.log(result);
|
|
1186
1204
|
* });
|
|
1187
1205
|
* ```
|
|
1188
1206
|
*/
|
|
@@ -1193,14 +1211,20 @@ class WSAPI {
|
|
|
1193
1211
|
* The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
1194
1212
|
* Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
1195
1213
|
* The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
|
|
1196
|
-
*
|
|
1214
|
+
*
|
|
1215
|
+
* **Example**:
|
|
1197
1216
|
* ```
|
|
1198
1217
|
* _smartico.api.getMissions().then((result) => {
|
|
1199
|
-
*
|
|
1218
|
+
* console.log(result);
|
|
1219
|
+
* });
|
|
1220
|
+
* ```
|
|
1221
|
+
*
|
|
1222
|
+
* **Example in the Visitor mode**:
|
|
1223
|
+
* ```
|
|
1224
|
+
* _smartico.vapi('EN').getMissions().then((result) => {
|
|
1225
|
+
* console.log(result);
|
|
1200
1226
|
* });
|
|
1201
1227
|
* ```
|
|
1202
|
-
/**
|
|
1203
|
-
* @param params
|
|
1204
1228
|
*/
|
|
1205
1229
|
async getMissions({
|
|
1206
1230
|
onUpdate
|
|
@@ -1210,7 +1234,11 @@ class WSAPI {
|
|
|
1210
1234
|
}
|
|
1211
1235
|
return OCache.use(onUpdateContextKey.Missions, ECacheContext.WSAPI, () => this.api.missionsGetItemsT(null), CACHE_DATA_SEC);
|
|
1212
1236
|
}
|
|
1213
|
-
/**
|
|
1237
|
+
/**
|
|
1238
|
+
* Returns all the badges available the current user
|
|
1239
|
+
*
|
|
1240
|
+
* **Visitor mode: not supported**
|
|
1241
|
+
*/
|
|
1214
1242
|
async getBadges() {
|
|
1215
1243
|
return OCache.use(onUpdateContextKey.Badges, ECacheContext.WSAPI, () => this.api.badgetsGetItemsT(null), CACHE_DATA_SEC);
|
|
1216
1244
|
}
|
|
@@ -1218,32 +1246,48 @@ class WSAPI {
|
|
|
1218
1246
|
* Returns the extra counters for the current user level.
|
|
1219
1247
|
* These are counters that are configured for each Smartico client separatly by request.
|
|
1220
1248
|
* For example 1st counter could be total wagering amount, 2nd counter could be total deposit amount, etc.
|
|
1221
|
-
*
|
|
1249
|
+
*
|
|
1250
|
+
* **Example**:
|
|
1222
1251
|
* ```
|
|
1223
1252
|
* _smartico.api.getUserLevelExtraCounters().then((result) => {
|
|
1224
1253
|
* console.log(result);
|
|
1225
1254
|
* });
|
|
1226
1255
|
* ```
|
|
1256
|
+
*
|
|
1257
|
+
* **Visitor mode: not supported**
|
|
1227
1258
|
*/
|
|
1228
1259
|
async getUserLevelExtraCounters() {
|
|
1229
1260
|
return OCache.use(onUpdateContextKey.LevelExtraCounters, ECacheContext.WSAPI, () => this.api.getUserGamificationInfoT(null), CACHE_DATA_SEC);
|
|
1230
1261
|
}
|
|
1231
|
-
/**
|
|
1232
|
-
*
|
|
1262
|
+
/**
|
|
1263
|
+
*
|
|
1264
|
+
* Returns all the store items available the current user
|
|
1265
|
+
*
|
|
1266
|
+
* **Example**:
|
|
1233
1267
|
* ```
|
|
1234
1268
|
* _smartico.api.getStoreItems().then((result) => {
|
|
1235
1269
|
* console.log(result);
|
|
1236
1270
|
* });
|
|
1271
|
+
* ```
|
|
1272
|
+
*
|
|
1273
|
+
* **Example in the Visitor mode**:
|
|
1274
|
+
* ```
|
|
1275
|
+
* _smartico.vapi('EN').getStoreItems().then((result) => {
|
|
1276
|
+
* console.log(result);
|
|
1277
|
+
* });
|
|
1237
1278
|
*/
|
|
1238
1279
|
async getStoreItems() {
|
|
1239
1280
|
return OCache.use(onUpdateContextKey.StoreItems, ECacheContext.WSAPI, () => this.api.storeGetItemsT(null), CACHE_DATA_SEC);
|
|
1240
1281
|
}
|
|
1241
1282
|
/** Buy the specific shop item by item_id. Returns the err_code in case of success or error.
|
|
1242
|
-
* Example
|
|
1283
|
+
* **Example**:
|
|
1243
1284
|
* ```
|
|
1244
1285
|
* _smartico.api.buyStoreItem(1).then((result) => {
|
|
1245
1286
|
* console.log(result);
|
|
1246
1287
|
* });
|
|
1288
|
+
* ```
|
|
1289
|
+
*
|
|
1290
|
+
* **Visitor mode: not supported**
|
|
1247
1291
|
*/
|
|
1248
1292
|
async buyStoreItem(item_id) {
|
|
1249
1293
|
const r = await this.api.buyStoreItem(null, item_id);
|
|
@@ -1253,19 +1297,39 @@ class WSAPI {
|
|
|
1253
1297
|
};
|
|
1254
1298
|
return o;
|
|
1255
1299
|
}
|
|
1256
|
-
/**
|
|
1300
|
+
/**
|
|
1301
|
+
*
|
|
1302
|
+
* Returns store categories
|
|
1303
|
+
*
|
|
1304
|
+
* **Example**:
|
|
1305
|
+
* ```
|
|
1306
|
+
* _smartico.api.getStoreCategories().then((result) => {
|
|
1307
|
+
* console.log(result);
|
|
1308
|
+
* });
|
|
1309
|
+
* ```
|
|
1310
|
+
*
|
|
1311
|
+
* **Example in the Visitor mode**:
|
|
1312
|
+
* ```
|
|
1313
|
+
* _smartico.vapi('EN').getStoreCategories().then((result) => {
|
|
1314
|
+
* console.log(result);
|
|
1315
|
+
* });
|
|
1316
|
+
*/
|
|
1257
1317
|
async getStoreCategories() {
|
|
1258
1318
|
return OCache.use(onUpdateContextKey.StoreCategories, ECacheContext.WSAPI, () => this.api.storeGetCategoriesT(null), CACHE_DATA_SEC);
|
|
1259
1319
|
}
|
|
1260
|
-
/**
|
|
1320
|
+
/**
|
|
1321
|
+
* Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
|
|
1261
1322
|
* The maximum number of items per request is limited to 20.
|
|
1262
1323
|
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
1263
|
-
*
|
|
1324
|
+
*
|
|
1325
|
+
* **Example**:
|
|
1264
1326
|
* ```
|
|
1265
1327
|
* _smartico.api.getStorePurchasedItems().then((result) => {
|
|
1266
1328
|
* console.log(result);
|
|
1267
1329
|
* });
|
|
1268
1330
|
* ```
|
|
1331
|
+
*
|
|
1332
|
+
* **Visitor mode: not supported**
|
|
1269
1333
|
*/
|
|
1270
1334
|
async getStorePurchasedItems({
|
|
1271
1335
|
limit,
|
|
@@ -1277,16 +1341,46 @@ class WSAPI {
|
|
|
1277
1341
|
}
|
|
1278
1342
|
return OCache.use(onUpdateContextKey.StoreHistory, ECacheContext.WSAPI, () => this.api.storeGetPurchasedItemsT(null, limit, offset), CACHE_DATA_SEC);
|
|
1279
1343
|
}
|
|
1280
|
-
/**
|
|
1344
|
+
/**
|
|
1345
|
+
* Returns missions & badges categories
|
|
1346
|
+
*
|
|
1347
|
+
* **Example**:
|
|
1348
|
+
* ```
|
|
1349
|
+
* _smartico.api.getAchCategories().then((result) => {
|
|
1350
|
+
* console.log(result);
|
|
1351
|
+
* });
|
|
1352
|
+
* ```
|
|
1353
|
+
*
|
|
1354
|
+
* **Example in the Visitor mode**:
|
|
1355
|
+
* ```
|
|
1356
|
+
* _smartico.vapi('EN').getAchCategories().then((result) => {
|
|
1357
|
+
* console.log(result);
|
|
1358
|
+
* });
|
|
1359
|
+
* ```
|
|
1360
|
+
*
|
|
1361
|
+
* */
|
|
1281
1362
|
async getAchCategories() {
|
|
1282
1363
|
return OCache.use(onUpdateContextKey.AchCategories, ECacheContext.WSAPI, () => this.api.achGetCategoriesT(null), CACHE_DATA_SEC);
|
|
1283
1364
|
}
|
|
1284
|
-
/** Returns the list of mini-games available for user
|
|
1285
|
-
* 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.
|
|
1286
|
-
* 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. */
|
|
1287
|
-
/**
|
|
1288
1365
|
/**
|
|
1289
|
-
*
|
|
1366
|
+
* Returns the list of mini-games available for user
|
|
1367
|
+
* 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.
|
|
1368
|
+
* 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.
|
|
1369
|
+
*
|
|
1370
|
+
* **Example**:
|
|
1371
|
+
* ```
|
|
1372
|
+
* _smartico.api.getMiniGames().then((result) => {
|
|
1373
|
+
* console.log(result);
|
|
1374
|
+
* });
|
|
1375
|
+
* ```
|
|
1376
|
+
*
|
|
1377
|
+
* **Example in the Visitor mode**:
|
|
1378
|
+
* ```
|
|
1379
|
+
* _smartico.vapi('EN').getMiniGames().then((result) => {
|
|
1380
|
+
* console.log(result);
|
|
1381
|
+
* });
|
|
1382
|
+
* ```
|
|
1383
|
+
*
|
|
1290
1384
|
*/
|
|
1291
1385
|
async getMiniGames({
|
|
1292
1386
|
onUpdate
|
|
@@ -1296,7 +1390,11 @@ class WSAPI {
|
|
|
1296
1390
|
}
|
|
1297
1391
|
return OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, () => this.api.sawGetTemplatesT(null), CACHE_DATA_SEC);
|
|
1298
1392
|
}
|
|
1299
|
-
/**
|
|
1393
|
+
/**
|
|
1394
|
+
* Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
|
|
1395
|
+
*
|
|
1396
|
+
* **Visitor mode: not supported**
|
|
1397
|
+
*/
|
|
1300
1398
|
async playMiniGame(template_id) {
|
|
1301
1399
|
const r = await this.api.sawSpinRequest(null, template_id);
|
|
1302
1400
|
this.api.doAcknowledgeRequest(null, r.request_id);
|
|
@@ -1307,7 +1405,11 @@ class WSAPI {
|
|
|
1307
1405
|
};
|
|
1308
1406
|
return o;
|
|
1309
1407
|
}
|
|
1310
|
-
/**
|
|
1408
|
+
/**
|
|
1409
|
+
* Requests an opt-in for the specified mission_id. Returns the err_code.
|
|
1410
|
+
*
|
|
1411
|
+
* **Visitor mode: not supported**
|
|
1412
|
+
*/
|
|
1311
1413
|
async requestMissionOptIn(mission_id) {
|
|
1312
1414
|
const r = await this.api.missionOptIn(null, mission_id);
|
|
1313
1415
|
const o = {
|
|
@@ -1316,7 +1418,11 @@ class WSAPI {
|
|
|
1316
1418
|
};
|
|
1317
1419
|
return o;
|
|
1318
1420
|
}
|
|
1319
|
-
/**
|
|
1421
|
+
/**
|
|
1422
|
+
* Request for claim reward for the specified mission id. Returns the err_code.
|
|
1423
|
+
*
|
|
1424
|
+
* **Visitor mode: not supported**
|
|
1425
|
+
*/
|
|
1320
1426
|
async requestMissionClaimReward(mission_id, ach_completed_id) {
|
|
1321
1427
|
const r = await this.api.missionClaimPrize(null, mission_id, ach_completed_id);
|
|
1322
1428
|
const o = {
|
|
@@ -1327,10 +1433,22 @@ class WSAPI {
|
|
|
1327
1433
|
}
|
|
1328
1434
|
/** Returns all the active instances of tournaments
|
|
1329
1435
|
* 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.
|
|
1330
|
-
* The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback
|
|
1331
|
-
|
|
1332
|
-
*
|
|
1333
|
-
|
|
1436
|
+
* The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback.
|
|
1437
|
+
*
|
|
1438
|
+
* **Example**:
|
|
1439
|
+
* ```
|
|
1440
|
+
* _smartico.api.getTournamentsList().then((result) => {
|
|
1441
|
+
* console.log(result);
|
|
1442
|
+
* });
|
|
1443
|
+
* ```
|
|
1444
|
+
*
|
|
1445
|
+
* **Example in the Visitor mode**:
|
|
1446
|
+
* ```
|
|
1447
|
+
* _smartico.vapi('EN').getTournamentsList().then((result) => {
|
|
1448
|
+
* console.log(result);
|
|
1449
|
+
* });
|
|
1450
|
+
* ```
|
|
1451
|
+
* */
|
|
1334
1452
|
async getTournamentsList({
|
|
1335
1453
|
onUpdate
|
|
1336
1454
|
} = {}) {
|
|
@@ -1339,11 +1457,39 @@ class WSAPI {
|
|
|
1339
1457
|
}
|
|
1340
1458
|
return OCache.use(onUpdateContextKey.TournamentList, ECacheContext.WSAPI, () => this.api.tournamentsGetLobbyT(null), CACHE_DATA_SEC);
|
|
1341
1459
|
}
|
|
1342
|
-
/**
|
|
1460
|
+
/**
|
|
1461
|
+
* Returns details information of specific tournament instance, the response will include tournament info and the leaderboard of players
|
|
1462
|
+
*
|
|
1463
|
+
* **Example**:
|
|
1464
|
+
* ```
|
|
1465
|
+
* _smartico.api.getTournamentsList().then((result) => {
|
|
1466
|
+
* if (result.length > 0) {
|
|
1467
|
+
* _smartico.api.getTournamentInstanceInfo(result[0].instance_id).then((result) => {
|
|
1468
|
+
* console.log(result);
|
|
1469
|
+
* });
|
|
1470
|
+
* }
|
|
1471
|
+
* });
|
|
1472
|
+
* ```
|
|
1473
|
+
*
|
|
1474
|
+
* **Example in the Visitor mode**:
|
|
1475
|
+
* ```
|
|
1476
|
+
* _smartico.vapi('EN').getTournamentsList().then((result) => {
|
|
1477
|
+
* if (result.length > 0) {
|
|
1478
|
+
* _smartico.vapi('EN').getTournamentInstanceInfo(result[0].instance_id).then((result) => {
|
|
1479
|
+
* console.log(result);
|
|
1480
|
+
* });
|
|
1481
|
+
* }
|
|
1482
|
+
* });
|
|
1483
|
+
* ```
|
|
1484
|
+
*/
|
|
1343
1485
|
async getTournamentInstanceInfo(tournamentInstanceId) {
|
|
1344
1486
|
return this.api.tournamentsGetInfoT(null, tournamentInstanceId);
|
|
1345
1487
|
}
|
|
1346
|
-
/**
|
|
1488
|
+
/**
|
|
1489
|
+
* Requests registration for the specified tournament instance. Returns the err_code.
|
|
1490
|
+
*
|
|
1491
|
+
* **Visitor mode: not supported**
|
|
1492
|
+
*/
|
|
1347
1493
|
async registerInTournament(tournamentInstanceId) {
|
|
1348
1494
|
const r = await this.api.registerInTournament(null, tournamentInstanceId);
|
|
1349
1495
|
const o = {
|
|
@@ -1352,8 +1498,23 @@ class WSAPI {
|
|
|
1352
1498
|
};
|
|
1353
1499
|
return o;
|
|
1354
1500
|
}
|
|
1355
|
-
/**
|
|
1356
|
-
|
|
1501
|
+
/**
|
|
1502
|
+
* 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.
|
|
1503
|
+
* For example, if the type is Weekly and getPreviousPeriod is true, a leaderboard for the previous week will be returned.
|
|
1504
|
+
*
|
|
1505
|
+
* **Example**:
|
|
1506
|
+
* ```
|
|
1507
|
+
* _smartico.api.getLeaderBoard(1).then((result) => {
|
|
1508
|
+
* console.log(result);
|
|
1509
|
+
* });
|
|
1510
|
+
* ```
|
|
1511
|
+
*
|
|
1512
|
+
* **Example in the Visitor mode**:
|
|
1513
|
+
* ```
|
|
1514
|
+
* _smartico.vapi('EN').getLeaderBoard(1).then((result) => {
|
|
1515
|
+
* console.log(result);
|
|
1516
|
+
* });
|
|
1517
|
+
* ```
|
|
1357
1518
|
*/
|
|
1358
1519
|
async getLeaderBoard(periodType, getPreviousPeriod) {
|
|
1359
1520
|
return OCache.use(onUpdateContextKey.LeaderBoards, ECacheContext.WSAPI, () => this.api.leaderboardsGetT(null, periodType, getPreviousPeriod), CACHE_DATA_SEC);
|
|
@@ -1364,8 +1525,10 @@ class WSAPI {
|
|
|
1364
1525
|
* This functions return list of messages without the body of the message.
|
|
1365
1526
|
* 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.
|
|
1366
1527
|
* All other action like mark as read, favorite, delete, etc. can be done using this message GUID.
|
|
1367
|
-
* 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.
|
|
1368
|
-
|
|
1528
|
+
* 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.
|
|
1529
|
+
*
|
|
1530
|
+
* **Visitor mode: not supported**
|
|
1531
|
+
*
|
|
1369
1532
|
* @param params
|
|
1370
1533
|
*/
|
|
1371
1534
|
async getInboxMessages({
|
|
@@ -1379,11 +1542,19 @@ class WSAPI {
|
|
|
1379
1542
|
}
|
|
1380
1543
|
return await this.api.getInboxMessagesT(null, from, to, onlyFavorite);
|
|
1381
1544
|
}
|
|
1382
|
-
/**
|
|
1545
|
+
/**
|
|
1546
|
+
* Returns the message body of the specified message guid.
|
|
1547
|
+
*
|
|
1548
|
+
* **Visitor mode: not supported**
|
|
1549
|
+
*/
|
|
1383
1550
|
async getInboxMessageBody(messageGuid) {
|
|
1384
1551
|
return await this.api.getInboxMessageBodyT(messageGuid);
|
|
1385
1552
|
}
|
|
1386
|
-
/**
|
|
1553
|
+
/**
|
|
1554
|
+
* Requests to mark inbox message with specified guid as read
|
|
1555
|
+
*
|
|
1556
|
+
* **Visitor mode: not supported**
|
|
1557
|
+
*/
|
|
1387
1558
|
async markInboxMessageAsRead(messageGuid) {
|
|
1388
1559
|
const r = await this.api.markInboxMessageRead(null, messageGuid);
|
|
1389
1560
|
return {
|
|
@@ -1391,7 +1562,11 @@ class WSAPI {
|
|
|
1391
1562
|
err_message: r.errMsg
|
|
1392
1563
|
};
|
|
1393
1564
|
}
|
|
1394
|
-
/**
|
|
1565
|
+
/**
|
|
1566
|
+
* Requests to mark all inbox messages as rea
|
|
1567
|
+
*
|
|
1568
|
+
* **Visitor mode: not supported**
|
|
1569
|
+
*/
|
|
1395
1570
|
async markAllInboxMessagesAsRead() {
|
|
1396
1571
|
const r = await this.api.markAllInboxMessageRead(null);
|
|
1397
1572
|
return {
|
|
@@ -1399,7 +1574,11 @@ class WSAPI {
|
|
|
1399
1574
|
err_message: r.errMsg
|
|
1400
1575
|
};
|
|
1401
1576
|
}
|
|
1402
|
-
/**
|
|
1577
|
+
/**
|
|
1578
|
+
* Requests to mark inbox message with specified guid as favorite. Pass mark true to add message to favorite and false to remove.
|
|
1579
|
+
*
|
|
1580
|
+
* **Visitor mode: not supported**
|
|
1581
|
+
*/
|
|
1403
1582
|
async markUnmarkInboxMessageAsFavorite(messageGuid, mark) {
|
|
1404
1583
|
const r = await this.api.markUnmarkInboxMessageAsFavorite(null, messageGuid, mark);
|
|
1405
1584
|
return {
|
|
@@ -1407,7 +1586,11 @@ class WSAPI {
|
|
|
1407
1586
|
err_message: r.errMsg
|
|
1408
1587
|
};
|
|
1409
1588
|
}
|
|
1410
|
-
/**
|
|
1589
|
+
/**
|
|
1590
|
+
* Requests to delete inbox message
|
|
1591
|
+
*
|
|
1592
|
+
* **Visitor mode: not supported**
|
|
1593
|
+
*/
|
|
1411
1594
|
async deleteInboxMessage(messageGuid) {
|
|
1412
1595
|
const r = await this.api.deleteInboxMessage(null, messageGuid);
|
|
1413
1596
|
return {
|
|
@@ -1415,7 +1598,11 @@ class WSAPI {
|
|
|
1415
1598
|
err_message: r.errMsg
|
|
1416
1599
|
};
|
|
1417
1600
|
}
|
|
1418
|
-
/**
|
|
1601
|
+
/**
|
|
1602
|
+
* Requests to delete all inbox messages
|
|
1603
|
+
*
|
|
1604
|
+
* **Visitor mode: not supported**
|
|
1605
|
+
*/
|
|
1419
1606
|
async deleteAllInboxMessages() {
|
|
1420
1607
|
const r = await this.api.deleteAllInboxMessages(null);
|
|
1421
1608
|
return {
|
|
@@ -1423,7 +1610,9 @@ class WSAPI {
|
|
|
1423
1610
|
err_message: r.errMsg
|
|
1424
1611
|
};
|
|
1425
1612
|
}
|
|
1426
|
-
/**
|
|
1613
|
+
/**
|
|
1614
|
+
* Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
|
|
1615
|
+
*/
|
|
1427
1616
|
async getTranslations(lang_code) {
|
|
1428
1617
|
const r = await this.api.getTranslationsT(null, lang_code, []);
|
|
1429
1618
|
return {
|
|
@@ -1479,12 +1668,20 @@ class WSAPI {
|
|
|
1479
1668
|
* If filter is not provided, all active jackpots will be returned.
|
|
1480
1669
|
* Filter can be used to get jackpots related to specific game or specific jackpot template.
|
|
1481
1670
|
* 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
|
|
1482
|
-
*
|
|
1671
|
+
*
|
|
1672
|
+
* **Example**:
|
|
1483
1673
|
* ```
|
|
1484
1674
|
* _smartico.api.jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
1485
1675
|
* console.log(result);
|
|
1486
1676
|
* });
|
|
1487
1677
|
* ```
|
|
1678
|
+
*
|
|
1679
|
+
* **Example in the Visitor mode**:
|
|
1680
|
+
* ```
|
|
1681
|
+
* _smartico.vapi('EN').jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
1682
|
+
* console.log(result);
|
|
1683
|
+
* });
|
|
1684
|
+
* ```
|
|
1488
1685
|
*/
|
|
1489
1686
|
async jackpotGet(filter) {
|
|
1490
1687
|
var _this = this;
|
|
@@ -1497,16 +1694,16 @@ class WSAPI {
|
|
|
1497
1694
|
let pots = [];
|
|
1498
1695
|
jackpots = await OCache.use(onUpdateContextKey.Jackpots, ECacheContext.WSAPI, async function () {
|
|
1499
1696
|
const _jackpots = await _this.api.jackpotGet(null, filter);
|
|
1500
|
-
const _pots = _jackpots.map(jp => jp.pot);
|
|
1697
|
+
const _pots = _jackpots.items.map(jp => jp.pot);
|
|
1501
1698
|
OCache.set(onUpdateContextKey.Pots, _pots, ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);
|
|
1502
|
-
return _jackpots;
|
|
1699
|
+
return _jackpots.items;
|
|
1503
1700
|
}, JACKPOT_TEMPLATE_CACHE_SEC);
|
|
1504
1701
|
if (jackpots.length > 0) {
|
|
1505
1702
|
pots = await OCache.use(onUpdateContextKey.Pots, ECacheContext.WSAPI, async function () {
|
|
1506
1703
|
const jp_template_ids = jackpots.map(jp => jp.jp_template_id);
|
|
1507
|
-
return _this.api.potGet(null, {
|
|
1704
|
+
return (await _this.api.potGet(null, {
|
|
1508
1705
|
jp_template_ids
|
|
1509
|
-
});
|
|
1706
|
+
})).items;
|
|
1510
1707
|
}, JACKPOT_POT_CACHE_SEC);
|
|
1511
1708
|
}
|
|
1512
1709
|
return jackpots.map(jp => {
|
|
@@ -1516,14 +1713,19 @@ class WSAPI {
|
|
|
1516
1713
|
return _jp;
|
|
1517
1714
|
});
|
|
1518
1715
|
}
|
|
1519
|
-
/**
|
|
1716
|
+
/**
|
|
1717
|
+
* Opt-in currently logged in user to the jackpot with the specified jp_template_id.
|
|
1520
1718
|
* You may call jackpotGet method after doing optin to see that user is opted in to the jackpot.
|
|
1521
|
-
*
|
|
1719
|
+
*
|
|
1720
|
+
* **Example**:
|
|
1522
1721
|
* ```
|
|
1523
1722
|
* _smartico.api.jackpotOptIn({ jp_template_id: 123 }).then((result) => {
|
|
1524
1723
|
* console.log('Opted in to the jackpot');
|
|
1525
1724
|
* });
|
|
1526
1725
|
* ```
|
|
1726
|
+
*
|
|
1727
|
+
* **Visitor mode: not supported**
|
|
1728
|
+
*
|
|
1527
1729
|
*/
|
|
1528
1730
|
async jackpotOptIn(filter) {
|
|
1529
1731
|
if (!filter.jp_template_id) {
|
|
@@ -1532,14 +1734,19 @@ class WSAPI {
|
|
|
1532
1734
|
const result = await this.api.jackpotOptIn(null, filter);
|
|
1533
1735
|
return result;
|
|
1534
1736
|
}
|
|
1535
|
-
/**
|
|
1737
|
+
/**
|
|
1738
|
+
* Opt-out currently logged in user from the jackpot with the specified jp_template_id.
|
|
1536
1739
|
* You may call jackpotGet method after doing optout to see that user is not opted in to the jackpot.
|
|
1537
|
-
*
|
|
1740
|
+
*
|
|
1741
|
+
* **Example**:
|
|
1538
1742
|
* ```
|
|
1539
1743
|
* _smartico.api.jackpotOptOut({ jp_template_id: 123 }).then((result) => {
|
|
1540
1744
|
* console.log('Opted out from the jackpot');
|
|
1541
1745
|
* });
|
|
1542
1746
|
* ```
|
|
1747
|
+
*
|
|
1748
|
+
* **Visitor mode: not supported**
|
|
1749
|
+
*
|
|
1543
1750
|
*/
|
|
1544
1751
|
async jackpotOptOut(filter) {
|
|
1545
1752
|
if (!filter.jp_template_id) {
|
|
@@ -1648,10 +1855,13 @@ class SmarticoAPI {
|
|
|
1648
1855
|
static getAvatarUrl(label_api_key) {
|
|
1649
1856
|
return AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
1650
1857
|
}
|
|
1651
|
-
async send(message, expectCID) {
|
|
1858
|
+
async send(message, expectCID, force_language) {
|
|
1652
1859
|
if (this.logCIDs.includes(message.cid)) {
|
|
1653
1860
|
this.logger.info('REQ', message);
|
|
1654
1861
|
}
|
|
1862
|
+
if (force_language) {
|
|
1863
|
+
message.force_language = force_language;
|
|
1864
|
+
}
|
|
1655
1865
|
let result;
|
|
1656
1866
|
try {
|
|
1657
1867
|
const timeStart = new Date().getTime();
|
|
@@ -1791,15 +2001,13 @@ class SmarticoAPI {
|
|
|
1791
2001
|
const results = await this.send(message, ClassId.CHECK_SEGMENT_MATCH_RESPONSE);
|
|
1792
2002
|
return results.segments || [];
|
|
1793
2003
|
}
|
|
1794
|
-
async jackpotGet(user_ext_id, filter) {
|
|
2004
|
+
async jackpotGet(user_ext_id, filter, force_language) {
|
|
1795
2005
|
const message = this.buildMessage(user_ext_id, ClassId.JP_GET_JACKPOTS_REQUEST, filter);
|
|
1796
|
-
|
|
1797
|
-
return (response == null ? void 0 : response.items) || [];
|
|
2006
|
+
return await this.send(message, ClassId.JP_GET_JACKPOTS_RESPONSE, force_language);
|
|
1798
2007
|
}
|
|
1799
2008
|
async potGet(user_ext_id, filter) {
|
|
1800
2009
|
const message = this.buildMessage(user_ext_id, ClassId.JP_GET_LATEST_POTS_REQUEST, filter);
|
|
1801
|
-
|
|
1802
|
-
return (response == null ? void 0 : response.items) || [];
|
|
2010
|
+
return await this.send(message, ClassId.JP_GET_LATEST_POTS_RESPONSE);
|
|
1803
2011
|
}
|
|
1804
2012
|
async jackpotOptIn(user_ext_id, payload) {
|
|
1805
2013
|
const message = this.buildMessage(user_ext_id, ClassId.JP_OPTIN_REQUEST, payload);
|
|
@@ -1809,14 +2017,11 @@ class SmarticoAPI {
|
|
|
1809
2017
|
const message = this.buildMessage(user_ext_id, ClassId.JP_OPTOUT_REQUEST, payload);
|
|
1810
2018
|
return await this.send(message, ClassId.JP_OPTOUT_RESPONSE);
|
|
1811
2019
|
}
|
|
1812
|
-
async sawGetTemplates(user_ext_id,
|
|
1813
|
-
const message = this.buildMessage(user_ext_id, ClassId.SAW_GET_SPINS_REQUEST,
|
|
1814
|
-
force_language: lang,
|
|
1815
|
-
is_visitor_mode
|
|
1816
|
-
} : {
|
|
2020
|
+
async sawGetTemplates(user_ext_id, force_language, is_visitor_mode = false) {
|
|
2021
|
+
const message = this.buildMessage(user_ext_id, ClassId.SAW_GET_SPINS_REQUEST, {
|
|
1817
2022
|
is_visitor_mode
|
|
1818
2023
|
});
|
|
1819
|
-
const response = await this.send(message, ClassId.SAW_GET_SPINS_RESPONSE);
|
|
2024
|
+
const response = await this.send(message, ClassId.SAW_GET_SPINS_RESPONSE, force_language);
|
|
1820
2025
|
if (response && response.templates) {
|
|
1821
2026
|
response.templates.forEach(t => {
|
|
1822
2027
|
if (t.jackpot_current !== undefined && t.jackpot_current !== null) {
|
|
@@ -1919,16 +2124,16 @@ class SmarticoAPI {
|
|
|
1919
2124
|
});
|
|
1920
2125
|
return await this.send(message, ClassId.GET_INBOX_MESSAGES_RESPONSE);
|
|
1921
2126
|
}
|
|
1922
|
-
async storeGetItems(user_ext_id) {
|
|
2127
|
+
async storeGetItems(user_ext_id, force_language) {
|
|
1923
2128
|
const message = this.buildMessage(user_ext_id, ClassId.GET_SHOP_ITEMS_REQUEST);
|
|
1924
|
-
return await this.send(message, ClassId.GET_SHOP_ITEMS_RESPONSE);
|
|
2129
|
+
return await this.send(message, ClassId.GET_SHOP_ITEMS_RESPONSE, force_language);
|
|
1925
2130
|
}
|
|
1926
2131
|
async storeGetItemsT(user_ext_id) {
|
|
1927
2132
|
return StoreItemTransform((await this.storeGetItems(user_ext_id)).items);
|
|
1928
2133
|
}
|
|
1929
|
-
async storeGetCategories(user_ext_id) {
|
|
2134
|
+
async storeGetCategories(user_ext_id, force_language) {
|
|
1930
2135
|
const message = this.buildMessage(user_ext_id, ClassId.GET_SHOP_CATEGORIES_REQUEST);
|
|
1931
|
-
return await this.send(message, ClassId.GET_SHOP_CATEGORIES_RESPONSE);
|
|
2136
|
+
return await this.send(message, ClassId.GET_SHOP_CATEGORIES_RESPONSE, force_language);
|
|
1932
2137
|
}
|
|
1933
2138
|
async storeGetCategoriesT(user_ext_id) {
|
|
1934
2139
|
return StoreCategoryTransform((await this.storeGetCategories(user_ext_id)).categories);
|
|
@@ -1943,9 +2148,9 @@ class SmarticoAPI {
|
|
|
1943
2148
|
async storeGetPurchasedItemsT(user_ext_id, limit, offset) {
|
|
1944
2149
|
return StoreItemPurchasedTransform((await this.storeGetPurchasedItems(user_ext_id, limit, offset)).items);
|
|
1945
2150
|
}
|
|
1946
|
-
async missionsGetItems(user_ext_id) {
|
|
2151
|
+
async missionsGetItems(user_ext_id, force_language) {
|
|
1947
2152
|
const message = this.buildMessage(user_ext_id, ClassId.GET_ACHIEVEMENT_MAP_REQUEST);
|
|
1948
|
-
const response = await this.send(message, ClassId.GET_ACHIEVEMENT_MAP_RESPONSE);
|
|
2153
|
+
const response = await this.send(message, ClassId.GET_ACHIEVEMENT_MAP_RESPONSE, force_language);
|
|
1949
2154
|
// we need to clone response to avoid changing original object,for cases when its called together with badgesGetItems (e.g. in Promise.all)
|
|
1950
2155
|
const responseClone = _extends({}, response);
|
|
1951
2156
|
if (responseClone.achievements) {
|
|
@@ -1967,16 +2172,16 @@ class SmarticoAPI {
|
|
|
1967
2172
|
level_counter_2: response.level_counter_2
|
|
1968
2173
|
};
|
|
1969
2174
|
}
|
|
1970
|
-
async achGetCategories(user_ext_id) {
|
|
2175
|
+
async achGetCategories(user_ext_id, force_language) {
|
|
1971
2176
|
const message = this.buildMessage(user_ext_id, ClassId.GET_ACH_CATEGORIES_REQUEST);
|
|
1972
|
-
return await this.send(message, ClassId.GET_ACH_CATEGORIES_RESPONSE);
|
|
2177
|
+
return await this.send(message, ClassId.GET_ACH_CATEGORIES_RESPONSE, force_language);
|
|
1973
2178
|
}
|
|
1974
2179
|
async achGetCategoriesT(user_ext_id) {
|
|
1975
2180
|
return AchCategoryTransform((await this.achGetCategories(user_ext_id)).categories);
|
|
1976
2181
|
}
|
|
1977
|
-
async badgetsGetItems(user_ext_id) {
|
|
2182
|
+
async badgetsGetItems(user_ext_id, force_language) {
|
|
1978
2183
|
const message = this.buildMessage(user_ext_id, ClassId.GET_ACHIEVEMENT_MAP_REQUEST);
|
|
1979
|
-
const response = await this.send(message, ClassId.GET_ACHIEVEMENT_MAP_RESPONSE);
|
|
2184
|
+
const response = await this.send(message, ClassId.GET_ACHIEVEMENT_MAP_RESPONSE, force_language);
|
|
1980
2185
|
// we need to clone response to avoid changing original object,for cases when its called together with missionsGetItems (e.g. in Promise.all)
|
|
1981
2186
|
const responseClone = _extends({}, response);
|
|
1982
2187
|
if (responseClone.achievements) {
|
|
@@ -1987,19 +2192,19 @@ class SmarticoAPI {
|
|
|
1987
2192
|
async badgetsGetItemsT(user_ext_id) {
|
|
1988
2193
|
return UserAchievementTransform((await this.badgetsGetItems(user_ext_id)).achievements);
|
|
1989
2194
|
}
|
|
1990
|
-
async tournamentsGetLobby(user_ext_id) {
|
|
2195
|
+
async tournamentsGetLobby(user_ext_id, force_language) {
|
|
1991
2196
|
const message = this.buildMessage(user_ext_id, ClassId.GET_TOURNAMENT_LOBBY_REQUEST);
|
|
1992
|
-
return await this.send(message, ClassId.GET_TOURNAMENT_LOBBY_RESPONSE);
|
|
2197
|
+
return await this.send(message, ClassId.GET_TOURNAMENT_LOBBY_RESPONSE, force_language);
|
|
1993
2198
|
}
|
|
1994
2199
|
async tournamentsGetLobbyT(user_ext_id) {
|
|
1995
2200
|
return TournamentItemsTransform((await this.tournamentsGetLobby(user_ext_id)).tournaments);
|
|
1996
2201
|
}
|
|
1997
|
-
async tournamentsGetInfo(user_ext_id, tournamentInstanceId) {
|
|
2202
|
+
async tournamentsGetInfo(user_ext_id, tournamentInstanceId, force_language) {
|
|
1998
2203
|
var _response$userPositio, _response$tournamentI;
|
|
1999
2204
|
const message = this.buildMessage(user_ext_id, ClassId.GET_TOURNAMENT_INFO_REQUEST, {
|
|
2000
2205
|
tournamentInstanceId
|
|
2001
2206
|
});
|
|
2002
|
-
const response = await this.send(message, ClassId.GET_TOURNAMENT_INFO_RESPONSE);
|
|
2207
|
+
const response = await this.send(message, ClassId.GET_TOURNAMENT_INFO_RESPONSE, force_language);
|
|
2003
2208
|
if ((_response$userPositio = response.userPosition) != null && _response$userPositio.avatar_id) {
|
|
2004
2209
|
response.userPosition.avatar_url = CoreUtils.avatarUrl(response.userPosition.avatar_id, this.avatarDomain);
|
|
2005
2210
|
}
|
|
@@ -2017,14 +2222,14 @@ class SmarticoAPI {
|
|
|
2017
2222
|
const response = await this.tournamentsGetInfo(user_ext_id, tournamentInstanceId);
|
|
2018
2223
|
return tournamentInfoItemTransform(response);
|
|
2019
2224
|
}
|
|
2020
|
-
async leaderboardGet(user_ext_id, period_type_id, prevPeriod = false) {
|
|
2225
|
+
async leaderboardGet(user_ext_id, period_type_id, prevPeriod = false, force_language) {
|
|
2021
2226
|
var _response$map$boardKe, _response$map$boardKe2, _response$map$boardKe3, _response$map$boardKe4;
|
|
2022
2227
|
const message = this.buildMessage(user_ext_id, ClassId.GET_LEADERS_BOARD_REQUEST, {
|
|
2023
2228
|
period_type_id,
|
|
2024
2229
|
snapshot_offset: prevPeriod ? 1 : 0,
|
|
2025
2230
|
include_users: true
|
|
2026
2231
|
});
|
|
2027
|
-
const response = await this.send(message, ClassId.GET_LEADERS_BOARD_RESPONSE);
|
|
2232
|
+
const response = await this.send(message, ClassId.GET_LEADERS_BOARD_RESPONSE, force_language);
|
|
2028
2233
|
const boardKey = Object.keys(response.map).find(k => period_type_id === undefined || k === (period_type_id == null ? void 0 : period_type_id.toString()));
|
|
2029
2234
|
if (boardKey === undefined) {
|
|
2030
2235
|
return undefined;
|
|
@@ -2042,9 +2247,9 @@ class SmarticoAPI {
|
|
|
2042
2247
|
async leaderboardsGetT(user_ext_id, period_type_id = LeaderBoardPeriodType.DAILY, prevPeriod = false) {
|
|
2043
2248
|
return getLeaderBoardTransform(await this.leaderboardGet(user_ext_id, period_type_id, prevPeriod));
|
|
2044
2249
|
}
|
|
2045
|
-
async levelsGet(user_ext_id) {
|
|
2250
|
+
async levelsGet(user_ext_id, force_language) {
|
|
2046
2251
|
const message = this.buildMessage(user_ext_id, ClassId.GET_LEVEL_MAP_REQUEST);
|
|
2047
|
-
return await this.send(message, ClassId.GET_LEVEL_MAP_RESPONSE);
|
|
2252
|
+
return await this.send(message, ClassId.GET_LEVEL_MAP_RESPONSE, force_language);
|
|
2048
2253
|
}
|
|
2049
2254
|
async levelsGetT(user_ext_id) {
|
|
2050
2255
|
return GetLevelMapResponseTransform(await this.levelsGet(user_ext_id));
|
|
@@ -2174,6 +2379,8 @@ var QuizMarketType;
|
|
|
2174
2379
|
QuizMarketType[QuizMarketType["PlayerOneWinsOneSet"] = 23] = "PlayerOneWinsOneSet";
|
|
2175
2380
|
QuizMarketType[QuizMarketType["PlayerTwoWinsOneSet"] = 24] = "PlayerTwoWinsOneSet";
|
|
2176
2381
|
QuizMarketType[QuizMarketType["LastGoal"] = 25] = "LastGoal";
|
|
2382
|
+
QuizMarketType[QuizMarketType["CustomSport"] = 26] = "CustomSport";
|
|
2383
|
+
QuizMarketType[QuizMarketType["CustomNonSport"] = 27] = "CustomNonSport";
|
|
2177
2384
|
})(QuizMarketType || (QuizMarketType = {}));
|
|
2178
2385
|
|
|
2179
2386
|
var MarketsValueType;
|
|
@@ -2202,11 +2409,12 @@ var MarketsValueType;
|
|
|
2202
2409
|
|
|
2203
2410
|
const quizAnswerHomeTeamReplacementText = '{quiz_home_team}';
|
|
2204
2411
|
const quizAnswerAwayTeamReplacementText = '{quiz_away_team}';
|
|
2205
|
-
const
|
|
2412
|
+
const quizDrawReplacementText = '{quiz_draw}';
|
|
2206
2413
|
const quizYesReplacementText = '{yes}';
|
|
2207
2414
|
const quizNoReplacementText = '{no}';
|
|
2208
2415
|
const quizOddReplacementText = '{odd}';
|
|
2209
2416
|
const quizEvenReplacementText = '{even}';
|
|
2417
|
+
const quizOrReplacementText = '{or}';
|
|
2210
2418
|
const yesNoAnswers = [{
|
|
2211
2419
|
text: quizYesReplacementText,
|
|
2212
2420
|
value: MarketsValueType.Yes
|
|
@@ -2222,7 +2430,7 @@ const homeAwayAnswers = [{
|
|
|
2222
2430
|
value: MarketsValueType.AwayTeam
|
|
2223
2431
|
}];
|
|
2224
2432
|
const homeAwayDrawAnswers = [...homeAwayAnswers, {
|
|
2225
|
-
text:
|
|
2433
|
+
text: quizDrawReplacementText,
|
|
2226
2434
|
value: MarketsValueType.Draw
|
|
2227
2435
|
}];
|
|
2228
2436
|
const marketsInfo = [{
|
|
@@ -2252,25 +2460,25 @@ const marketsInfo = [{
|
|
|
2252
2460
|
text: `${quizAnswerHomeTeamReplacementText} / ${quizAnswerHomeTeamReplacementText}`,
|
|
2253
2461
|
value: MarketsValueType.HomeTeamHomeTeam
|
|
2254
2462
|
}, {
|
|
2255
|
-
text: `${quizAnswerHomeTeamReplacementText} / ${
|
|
2463
|
+
text: `${quizAnswerHomeTeamReplacementText} / ${quizDrawReplacementText}`,
|
|
2256
2464
|
value: MarketsValueType.HomeTeamDraw
|
|
2257
2465
|
}, {
|
|
2258
2466
|
text: `${quizAnswerHomeTeamReplacementText} / ${quizAnswerAwayTeamReplacementText}`,
|
|
2259
2467
|
value: MarketsValueType.HomeTeamAwayTeam
|
|
2260
2468
|
}, {
|
|
2261
|
-
text: `${
|
|
2469
|
+
text: `${quizDrawReplacementText} / ${quizAnswerHomeTeamReplacementText}`,
|
|
2262
2470
|
value: MarketsValueType.DrawHomeTeam
|
|
2263
2471
|
}, {
|
|
2264
|
-
text: `${
|
|
2472
|
+
text: `${quizDrawReplacementText} / ${quizDrawReplacementText}`,
|
|
2265
2473
|
value: MarketsValueType.DrawDraw
|
|
2266
2474
|
}, {
|
|
2267
|
-
text: `${
|
|
2475
|
+
text: `${quizDrawReplacementText} / ${quizAnswerAwayTeamReplacementText}`,
|
|
2268
2476
|
value: MarketsValueType.DrawAwayTeam
|
|
2269
2477
|
}, {
|
|
2270
2478
|
text: `${quizAnswerAwayTeamReplacementText} / ${quizAnswerHomeTeamReplacementText}`,
|
|
2271
2479
|
value: MarketsValueType.AwayTeamHomeTeam
|
|
2272
2480
|
}, {
|
|
2273
|
-
text: `${quizAnswerAwayTeamReplacementText} / ${
|
|
2481
|
+
text: `${quizAnswerAwayTeamReplacementText} / ${quizDrawReplacementText}`,
|
|
2274
2482
|
value: MarketsValueType.AwayTeamDraw
|
|
2275
2483
|
}, {
|
|
2276
2484
|
text: `${quizAnswerAwayTeamReplacementText} / ${quizAnswerAwayTeamReplacementText}`,
|
|
@@ -2300,13 +2508,13 @@ const marketsInfo = [{
|
|
|
2300
2508
|
trKey: 'quizQuestion_doubleChance'
|
|
2301
2509
|
},
|
|
2302
2510
|
answers: [{
|
|
2303
|
-
text: `${
|
|
2511
|
+
text: `${quizDrawReplacementText} ${quizOrReplacementText} ${quizAnswerHomeTeamReplacementText}`,
|
|
2304
2512
|
value: MarketsValueType.HomeTeamDraw
|
|
2305
2513
|
}, {
|
|
2306
|
-
text: `${quizAnswerHomeTeamReplacementText}
|
|
2514
|
+
text: `${quizAnswerHomeTeamReplacementText} ${quizOrReplacementText} ${quizAnswerAwayTeamReplacementText}`,
|
|
2307
2515
|
value: MarketsValueType.HomeTeamAwayTeam
|
|
2308
2516
|
}, {
|
|
2309
|
-
text: `${
|
|
2517
|
+
text: `${quizDrawReplacementText} ${quizOrReplacementText} ${quizAnswerAwayTeamReplacementText}`,
|
|
2310
2518
|
value: MarketsValueType.AwayTeamDraw
|
|
2311
2519
|
}]
|
|
2312
2520
|
}, {
|
|
@@ -2490,5 +2698,5 @@ var JackpotType;
|
|
|
2490
2698
|
JackpotType[JackpotType["Main"] = 1] = "Main";
|
|
2491
2699
|
})(JackpotType || (JackpotType = {}));
|
|
2492
2700
|
|
|
2493
|
-
export { AchCategoryTransform, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GetLevelMapResponseTransform, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, JackpotContributionType, JackpotType, LeaderBoardPeriodType, MarketsValueType, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, OCache, PublicLabelSettings, QuizMarketPerSport, QuizMarketType, QuizSportType, SAWAcknowledgeType, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWinSoundFiles, SAWWinSoundType, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UserAchievementTransform, marketsInfo, quizSupportedSports, tournamentInfoItemTransform };
|
|
2701
|
+
export { AchCategoryTransform, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GetLevelMapResponseTransform, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, JackpotContributionType, JackpotType, LeaderBoardPeriodType, MarketsValueType, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, OCache, PublicLabelSettings, QuizMarketPerSport, QuizMarketType, QuizSportType, SAWAcknowledgeType, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWinSoundFiles, SAWWinSoundType, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UserAchievementTransform, marketsInfo, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizDrawReplacementText, quizEvenReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, tournamentInfoItemTransform };
|
|
2494
2702
|
//# sourceMappingURL=index.modern.mjs.map
|