@smartico/public-api 0.0.278 → 0.0.280
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MiniGames/SAWBuyInType.d.ts +0 -1
- package/dist/MiniGames/SAWGameType.d.ts +0 -1
- package/dist/MiniGames/SAWPrizeType.d.ts +0 -1
- package/dist/Missions/index.d.ts +1 -0
- package/dist/Tournaments/Tournament.d.ts +3 -2
- package/dist/Tournaments/TournamentRegistrationStatus.d.ts +0 -1
- package/dist/Tournaments/TournamentRegistrationType.d.ts +0 -1
- package/dist/WSAPI/WSAPI.d.ts +4 -0
- package/dist/WSAPI/WSAPITypes.d.ts +26 -1
- package/dist/index.js +109 -98
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +61 -58
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +103 -0
- package/docs/classes/SAWUtils.md +27 -0
- package/docs/classes/WSAPI.md +5 -2
- package/docs/enums/AchCustomLayoutTheme.md +25 -0
- package/docs/enums/AchMissionsTabsOptions.md +19 -0
- package/docs/enums/AchOverviewMissionsFilter.md +31 -0
- package/docs/enums/BonusStatus-1.md +49 -0
- package/docs/enums/BonusStatus.md +37 -0
- package/docs/enums/SAWAcknowledgeType.md +25 -0
- package/docs/enums/SAWBuyInType.md +31 -0
- package/docs/enums/SAWGameType.md +61 -0
- package/docs/enums/SAWPrizeType.md +61 -0
- package/docs/enums/SAWWheelLayout.md +25 -0
- package/docs/enums/SAWWinSoundType.md +31 -0
- package/docs/enums/TournamentRegistrationStatus.md +43 -0
- package/docs/enums/TournamentRegistrationType.md +43 -0
- package/docs/interfaces/BonusMetaMap.md +9 -0
- package/docs/interfaces/BonusTemplateMetaMap.md +25 -0
- package/docs/interfaces/SAWAcknowledgeSpinPushRequest.md +79 -0
- package/docs/interfaces/SAWDoAknowledgeRequest.md +43 -0
- package/docs/interfaces/SAWDoAknowledgeResponse.md +43 -0
- package/docs/interfaces/SAWDoSpinRequest.md +79 -0
- package/docs/interfaces/SAWDoSpinResponse.md +87 -0
- package/docs/interfaces/SAWEventSawPush.md +55 -0
- package/docs/interfaces/SAWGetTemplatesRequest.md +79 -0
- package/docs/interfaces/SAWGetTemplatesResponse.md +63 -0
- package/docs/interfaces/SAWPrize.md +107 -0
- package/docs/interfaces/SAWPrizeDropAknowledgeRequest.md +55 -0
- package/docs/interfaces/SAWPrizeDropAknowledgeResponse.md +43 -0
- package/docs/interfaces/SAWPrizeDropWinPush.md +67 -0
- package/docs/interfaces/SAWPrizeUI.md +157 -0
- package/docs/interfaces/SAWPrizesHistory.md +49 -0
- package/docs/interfaces/SAWSpinsCountPush.md +49 -0
- package/docs/interfaces/SAWTemplate.md +154 -0
- package/docs/interfaces/SAWTemplateUI.md +1 -1
- package/docs/interfaces/SAWWinningHistoryRequest.md +61 -0
- package/docs/interfaces/SAWWinningHistoryResponse.md +69 -0
- package/docs/interfaces/TBonus.md +3 -3
- package/docs/interfaces/TSawHistory.md +1 -1
- package/docs/interfaces/TUICustomSection.md +3 -3
- package/package.json +1 -1
- package/src/MiniGames/SAWBuyInType.ts +0 -1
- package/src/MiniGames/SAWGameType.ts +0 -2
- package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -1
- package/src/MiniGames/SAWPrizeType.ts +0 -1
- package/src/Missions/index.ts +1 -0
- package/src/Tournaments/Tournament.ts +4 -2
- package/src/Tournaments/TournamentRegistrationStatus.ts +0 -1
- package/src/Tournaments/TournamentRegistrationType.ts +0 -1
- package/src/WSAPI/WSAPI.ts +10 -16
- package/src/WSAPI/WSAPITypes.ts +30 -6
package/dist/Missions/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { TournamentRegistrationStatus } from './TournamentRegistrationStatus';
|
|
|
4
4
|
import { TournamentType } from './TournamentType';
|
|
5
5
|
import { TournamentPublicMeta } from './TournamentPublicMeta';
|
|
6
6
|
import { TTournament } from '../WSAPI/WSAPITypes';
|
|
7
|
-
import { TournamentPlayer
|
|
7
|
+
import { TournamentPlayer } from './TournamentPlayer';
|
|
8
|
+
import { TournamentPrize } from './TournamentPrize';
|
|
8
9
|
import { AchRelatedGame } from '../Base/AchRelatedGame';
|
|
9
10
|
export interface Tournament {
|
|
10
11
|
/** ID of tournament template */
|
|
@@ -57,7 +58,7 @@ export interface Tournament {
|
|
|
57
58
|
related_games?: AchRelatedGame[];
|
|
58
59
|
/** The minimum amount of score points that the user should get in order to be qualified for the prize */
|
|
59
60
|
minScoreToWin?: number;
|
|
60
|
-
/** When enabled, users who don
|
|
61
|
+
/** When enabled, users who don't meet the minimum qualifying score will be hidden from the Leaderboard. */
|
|
61
62
|
hideLeaderboardsMinScores?: boolean;
|
|
62
63
|
}
|
|
63
64
|
export declare const TournamentItemsTransform: (items: Tournament[]) => TTournament[];
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -178,6 +178,9 @@ export declare class WSAPI {
|
|
|
178
178
|
* Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
|
|
179
179
|
* The maximum number of items per request is limited to 20.
|
|
180
180
|
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
181
|
+
* The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
182
|
+
* Note that each time you call getStorePurchasedItems with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
183
|
+
* The onUpdate callback will be called on purchase of the store item and the last 20 items will be passed to it.
|
|
181
184
|
*
|
|
182
185
|
* **Example**:
|
|
183
186
|
* ```
|
|
@@ -465,6 +468,7 @@ export declare class WSAPI {
|
|
|
465
468
|
private updateMissions;
|
|
466
469
|
private updateBonuses;
|
|
467
470
|
private updateTournaments;
|
|
471
|
+
private updateStorePurchasedItems;
|
|
468
472
|
private updateInboxMessages;
|
|
469
473
|
private updateRaffles;
|
|
470
474
|
private updateEntity;
|
|
@@ -4,7 +4,6 @@ import { TournamentRegistrationError, TournamentRegistrationStatusName, Tourname
|
|
|
4
4
|
import { AchievementAvailabilityStatus } from '../Missions';
|
|
5
5
|
import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
6
6
|
import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from '../CustomSections';
|
|
7
|
-
import { BonusStatus, BonusTemplateMetaMap, BonusMetaMap } from '../Bonuses';
|
|
8
7
|
import { PrizeModifiers } from '../MiniGames/PrizeModifiers';
|
|
9
8
|
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
10
9
|
import { RaffleDrawInstanceState, RaffleDrawTypeExecution } from '../Raffle';
|
|
@@ -781,6 +780,32 @@ export interface TBonus {
|
|
|
781
780
|
/** Additional information presented to the player when the bonus is redeemed */
|
|
782
781
|
bonus_meta_map?: BonusMetaMap;
|
|
783
782
|
}
|
|
783
|
+
export declare enum BonusStatus {
|
|
784
|
+
/** The bonus is newly created (shouldn't be shown to the client) */
|
|
785
|
+
New = 1,
|
|
786
|
+
/** The bonus is issued and available for redemption but has not been redeemed yet */
|
|
787
|
+
COUPON_ISSUED = 2,
|
|
788
|
+
/** The bonus has been successfully redeemed */
|
|
789
|
+
REDEEMED = 3,
|
|
790
|
+
/** The bonus is still valid, but a previous redemption attempt failed */
|
|
791
|
+
REDEEM_FAILED = 4,
|
|
792
|
+
/** Failed to issue the bonus (shouldn't be shown to the client) */
|
|
793
|
+
COUPON_ISSUE_FAILED = 5,
|
|
794
|
+
/** The bonus was issued but has expired and can no longer be redeemed (shouldn't be shown to the client) */
|
|
795
|
+
EXPIRED = 6
|
|
796
|
+
}
|
|
797
|
+
export interface BonusTemplateMetaMap {
|
|
798
|
+
/** Description of the bonus template*/
|
|
799
|
+
description: string;
|
|
800
|
+
/** Acknowledge message setup in the bonus template*/
|
|
801
|
+
acknowledge: string;
|
|
802
|
+
/** Image URL of the bonus template*/
|
|
803
|
+
image_url: string;
|
|
804
|
+
}
|
|
805
|
+
export interface BonusMetaMap {
|
|
806
|
+
/** Label and description of the bonus sent to the player*/
|
|
807
|
+
uiAmount?: string;
|
|
808
|
+
}
|
|
784
809
|
/**
|
|
785
810
|
* TClaimBonusResult describes the response of call to _smartico.api.claimBonus(bonus_id) method
|
|
786
811
|
*/
|
package/dist/index.js
CHANGED
|
@@ -266,7 +266,6 @@ IntUtils.isWithinPeriod = function (timestamp, period) {
|
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
269
|
-
/** @hidden */
|
|
270
269
|
exports.SAWBuyInType = void 0;
|
|
271
270
|
(function (SAWBuyInType) {
|
|
272
271
|
SAWBuyInType[SAWBuyInType["Free"] = 1] = "Free";
|
|
@@ -350,7 +349,6 @@ exports.SAWAskForUsername = void 0;
|
|
|
350
349
|
SAWAskForUsername["ONSUMBIT"] = "on-submit";
|
|
351
350
|
})(exports.SAWAskForUsername || (exports.SAWAskForUsername = {}));
|
|
352
351
|
|
|
353
|
-
/** @hidden */
|
|
354
352
|
exports.SAWGameType = void 0;
|
|
355
353
|
(function (SAWGameType) {
|
|
356
354
|
SAWGameType[SAWGameType["SpinAWheel"] = 1] = "SpinAWheel";
|
|
@@ -384,7 +382,6 @@ var SAWGameTypeNamed = function SAWGameTypeNamed(type) {
|
|
|
384
382
|
return (_SAWGameType$SpinAWhe = {}, _SAWGameType$SpinAWhe[exports.SAWGameType.SpinAWheel] = exports.SAWGameTypeName.SpinAWheel, _SAWGameType$SpinAWhe[exports.SAWGameType.ScratchCard] = exports.SAWGameTypeName.ScratchCard, _SAWGameType$SpinAWhe[exports.SAWGameType.MatchX] = exports.SAWGameTypeName.MatchX, _SAWGameType$SpinAWhe[exports.SAWGameType.GiftBox] = exports.SAWGameTypeName.GiftBox, _SAWGameType$SpinAWhe[exports.SAWGameType.PrizeDrop] = exports.SAWGameTypeName.PrizeDrop, _SAWGameType$SpinAWhe[exports.SAWGameType.Quiz] = exports.SAWGameTypeName.Quiz, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxWeekdays] = exports.SAWGameTypeName.LootboxWeekdays, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxCalendarDays] = exports.SAWGameTypeName.LootboxCalendarDays, _SAWGameType$SpinAWhe[exports.SAWGameType.TreasureHunt] = exports.SAWGameTypeName.TreasureHunt, _SAWGameType$SpinAWhe[exports.SAWGameType.Voyager] = exports.SAWGameTypeName.Voyager, _SAWGameType$SpinAWhe)[type] || exports.SAWGameTypeName.Unknown;
|
|
385
383
|
};
|
|
386
384
|
|
|
387
|
-
/** @hidden */
|
|
388
385
|
exports.SAWPrizeType = void 0;
|
|
389
386
|
(function (SAWPrizeType) {
|
|
390
387
|
SAWPrizeType[SAWPrizeType["NO_PRIZE"] = 1] = "NO_PRIZE";
|
|
@@ -1360,7 +1357,6 @@ var AchCategoryTransform = function AchCategoryTransform(items) {
|
|
|
1360
1357
|
});
|
|
1361
1358
|
};
|
|
1362
1359
|
|
|
1363
|
-
/** @hidden */
|
|
1364
1360
|
exports.TournamentRegistrationType = void 0;
|
|
1365
1361
|
(function (TournamentRegistrationType) {
|
|
1366
1362
|
TournamentRegistrationType[TournamentRegistrationType["AUTO"] = 1] = "AUTO";
|
|
@@ -1378,7 +1374,6 @@ var TournamentRegistrationTypeGetName = function TournamentRegistrationTypeGetNa
|
|
|
1378
1374
|
return (_TournamentRegistrati = {}, _TournamentRegistrati[exports.TournamentRegistrationType.AUTO] = 'AUTO', _TournamentRegistrati[exports.TournamentRegistrationType.BUY_IN_POINTS] = 'BUY_IN_POINTS', _TournamentRegistrati[exports.TournamentRegistrationType.MANUAL_APPROVAL] = 'MANUAL_APPROVAL', _TournamentRegistrati[exports.TournamentRegistrationType.OPT_IN] = 'OPT_IN', _TournamentRegistrati[exports.TournamentRegistrationType.REQUIRES_QUALIFICATION] = 'REQUIRES_QUALIFICATION', _TournamentRegistrati[exports.TournamentRegistrationType.BUY_IN_GEMS] = 'BUY_IN_GEMS', _TournamentRegistrati[exports.TournamentRegistrationType.BUY_IN_DIAMONDS] = 'BUY_IN_DIAMONDS', _TournamentRegistrati)[type] || 'UNKNOWN';
|
|
1379
1375
|
};
|
|
1380
1376
|
|
|
1381
|
-
/** @hidden */
|
|
1382
1377
|
exports.TournamentRegistrationStatus = void 0;
|
|
1383
1378
|
(function (TournamentRegistrationStatus) {
|
|
1384
1379
|
TournamentRegistrationStatus[TournamentRegistrationStatus["NOT_REGISTERED"] = 0] = "NOT_REGISTERED";
|
|
@@ -1406,63 +1401,6 @@ var TournamentRegistrationStatusNamed = function TournamentRegistrationStatusNam
|
|
|
1406
1401
|
return (_TournamentRegistrati = {}, _TournamentRegistrati[exports.TournamentRegistrationStatus.CANCELLED] = exports.TournamentRegistrationStatusName.CANCELLED, _TournamentRegistrati[exports.TournamentRegistrationStatus.FINISHED] = exports.TournamentRegistrationStatusName.FINISHED, _TournamentRegistrati[exports.TournamentRegistrationStatus.NOT_REGISTERED] = exports.TournamentRegistrationStatusName.NOT_REGISTERED, _TournamentRegistrati[exports.TournamentRegistrationStatus.PENDING] = exports.TournamentRegistrationStatusName.PENDING, _TournamentRegistrati[exports.TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION] = exports.TournamentRegistrationStatusName.QUALIFIED_PENDING_REGISTRATION, _TournamentRegistrati[exports.TournamentRegistrationStatus.REGISTERED] = exports.TournamentRegistrationStatusName.REGISTERED, _TournamentRegistrati[exports.TournamentRegistrationStatus.REGISTERED_PENDING_QUALIFICATION] = exports.TournamentRegistrationStatusName.REGISTERED_PENDING_QUALIFICATION, _TournamentRegistrati)[type] || exports.TournamentRegistrationStatusName.UNKNOWN;
|
|
1407
1402
|
};
|
|
1408
1403
|
|
|
1409
|
-
var TournamentItemsTransform = function TournamentItemsTransform(items) {
|
|
1410
|
-
return items.filter(function (r) {
|
|
1411
|
-
return r.tournamentId >= 1;
|
|
1412
|
-
}).map(function (r) {
|
|
1413
|
-
var x = _extends({
|
|
1414
|
-
instance_id: r.tournamentInstanceId,
|
|
1415
|
-
tournament_id: r.tournamentId,
|
|
1416
|
-
name: r.publicMeta.name,
|
|
1417
|
-
description: r.publicMeta.description,
|
|
1418
|
-
segment_dont_match_message: r.publicMeta.segment_dont_match_message,
|
|
1419
|
-
image1: r.publicMeta.image_url,
|
|
1420
|
-
image2: r.publicMeta.image_url2,
|
|
1421
|
-
image2_mobile: r.publicMeta.image_url2_mobile,
|
|
1422
|
-
prize_pool_short: r.publicMeta.prize_pool_short,
|
|
1423
|
-
custom_price_text: r.publicMeta.custom_price_text,
|
|
1424
|
-
custom_section_id: r.publicMeta.custom_section_id,
|
|
1425
|
-
custom_data: IntUtils.JsonOrText(r.publicMeta.custom_data),
|
|
1426
|
-
is_featured: r.publicMeta.featured,
|
|
1427
|
-
ribbon: r.publicMeta.label_tag === 'custom' ? r.publicMeta.custom_label_tag : r.publicMeta.label_tag,
|
|
1428
|
-
priority: r.publicMeta.position,
|
|
1429
|
-
start_time: r.startTimeTs,
|
|
1430
|
-
end_time: r.endTimeTs,
|
|
1431
|
-
registration_count: r.registrationCount,
|
|
1432
|
-
is_user_registered: r.isUserRegistered,
|
|
1433
|
-
players_min_count: r.playersMinCount,
|
|
1434
|
-
players_max_count: r.playersMaxCount,
|
|
1435
|
-
registration_status: TournamentRegistrationStatusNamed(r.tournamentRegistrationStatus),
|
|
1436
|
-
registration_type: TournamentRegistrationTypeGetName(r.registrationType)
|
|
1437
|
-
}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_POINTS ? {
|
|
1438
|
-
registration_cost_points: r.buyInAmount
|
|
1439
|
-
} : {}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_GEMS ? {
|
|
1440
|
-
registration_cost_gems: r.buyInAmount
|
|
1441
|
-
} : {}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_DIAMONDS ? {
|
|
1442
|
-
registration_cost_diamonds: r.buyInAmount
|
|
1443
|
-
} : {}, {
|
|
1444
|
-
duration_ms: r.durationMs,
|
|
1445
|
-
is_active: TournamentUtils.isActive(r),
|
|
1446
|
-
is_can_register: TournamentUtils.isCanRegister(r),
|
|
1447
|
-
is_cancelled: TournamentUtils.isCancelled(r),
|
|
1448
|
-
is_finished: TournamentUtils.isFinished(r),
|
|
1449
|
-
is_in_progress: TournamentUtils.isInProgress(r),
|
|
1450
|
-
is_upcoming: TournamentUtils.isUpcoming(r),
|
|
1451
|
-
min_scores_win: r.minScoreToWin,
|
|
1452
|
-
hide_leaderboard_min_scores: r.hideLeaderboardsMinScores
|
|
1453
|
-
});
|
|
1454
|
-
if (r.prizeStructure) {
|
|
1455
|
-
x.prizes = r.prizeStructure.prizes.map(function (p) {
|
|
1456
|
-
return TournamentUtils.getPrizeTransformed(p);
|
|
1457
|
-
});
|
|
1458
|
-
}
|
|
1459
|
-
if (r.tournamentPlayer) {
|
|
1460
|
-
x.me = TournamentUtils.getPlayerTransformed(r.tournamentPlayer, true);
|
|
1461
|
-
}
|
|
1462
|
-
return x;
|
|
1463
|
-
});
|
|
1464
|
-
};
|
|
1465
|
-
|
|
1466
1404
|
exports.TournamentInstanceStatus = void 0;
|
|
1467
1405
|
(function (TournamentInstanceStatus) {
|
|
1468
1406
|
TournamentInstanceStatus[TournamentInstanceStatus["PUBLISHED"] = 1] = "PUBLISHED";
|
|
@@ -1547,6 +1485,63 @@ TournamentUtils.getPrizeTransformed = function (prize) {
|
|
|
1547
1485
|
return null;
|
|
1548
1486
|
};
|
|
1549
1487
|
|
|
1488
|
+
var TournamentItemsTransform = function TournamentItemsTransform(items) {
|
|
1489
|
+
return items.filter(function (r) {
|
|
1490
|
+
return r.tournamentId >= 1;
|
|
1491
|
+
}).map(function (r) {
|
|
1492
|
+
var x = _extends({
|
|
1493
|
+
instance_id: r.tournamentInstanceId,
|
|
1494
|
+
tournament_id: r.tournamentId,
|
|
1495
|
+
name: r.publicMeta.name,
|
|
1496
|
+
description: r.publicMeta.description,
|
|
1497
|
+
segment_dont_match_message: r.publicMeta.segment_dont_match_message,
|
|
1498
|
+
image1: r.publicMeta.image_url,
|
|
1499
|
+
image2: r.publicMeta.image_url2,
|
|
1500
|
+
image2_mobile: r.publicMeta.image_url2_mobile,
|
|
1501
|
+
prize_pool_short: r.publicMeta.prize_pool_short,
|
|
1502
|
+
custom_price_text: r.publicMeta.custom_price_text,
|
|
1503
|
+
custom_section_id: r.publicMeta.custom_section_id,
|
|
1504
|
+
custom_data: IntUtils.JsonOrText(r.publicMeta.custom_data),
|
|
1505
|
+
is_featured: r.publicMeta.featured,
|
|
1506
|
+
ribbon: r.publicMeta.label_tag === 'custom' ? r.publicMeta.custom_label_tag : r.publicMeta.label_tag,
|
|
1507
|
+
priority: r.publicMeta.position,
|
|
1508
|
+
start_time: r.startTimeTs,
|
|
1509
|
+
end_time: r.endTimeTs,
|
|
1510
|
+
registration_count: r.registrationCount,
|
|
1511
|
+
is_user_registered: r.isUserRegistered,
|
|
1512
|
+
players_min_count: r.playersMinCount,
|
|
1513
|
+
players_max_count: r.playersMaxCount,
|
|
1514
|
+
registration_status: TournamentRegistrationStatusNamed(r.tournamentRegistrationStatus),
|
|
1515
|
+
registration_type: TournamentRegistrationTypeGetName(r.registrationType)
|
|
1516
|
+
}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_POINTS ? {
|
|
1517
|
+
registration_cost_points: r.buyInAmount
|
|
1518
|
+
} : {}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_GEMS ? {
|
|
1519
|
+
registration_cost_gems: r.buyInAmount
|
|
1520
|
+
} : {}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_DIAMONDS ? {
|
|
1521
|
+
registration_cost_diamonds: r.buyInAmount
|
|
1522
|
+
} : {}, {
|
|
1523
|
+
duration_ms: r.durationMs,
|
|
1524
|
+
is_active: TournamentUtils.isActive(r),
|
|
1525
|
+
is_can_register: TournamentUtils.isCanRegister(r),
|
|
1526
|
+
is_cancelled: TournamentUtils.isCancelled(r),
|
|
1527
|
+
is_finished: TournamentUtils.isFinished(r),
|
|
1528
|
+
is_in_progress: TournamentUtils.isInProgress(r),
|
|
1529
|
+
is_upcoming: TournamentUtils.isUpcoming(r),
|
|
1530
|
+
min_scores_win: r.minScoreToWin,
|
|
1531
|
+
hide_leaderboard_min_scores: r.hideLeaderboardsMinScores
|
|
1532
|
+
});
|
|
1533
|
+
if (r.prizeStructure) {
|
|
1534
|
+
x.prizes = r.prizeStructure.prizes.map(function (p) {
|
|
1535
|
+
return TournamentUtils.getPrizeTransformed(p);
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
if (r.tournamentPlayer) {
|
|
1539
|
+
x.me = TournamentUtils.getPlayerTransformed(r.tournamentPlayer, true);
|
|
1540
|
+
}
|
|
1541
|
+
return x;
|
|
1542
|
+
});
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1550
1545
|
var tournamentInfoItemTransform = function tournamentInfoItemTransform(t) {
|
|
1551
1546
|
var response = _extends({}, TournamentItemsTransform([t.tournamentInfo.tournamentLobbyInfo])[0], {
|
|
1552
1547
|
related_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map(function (g) {
|
|
@@ -1913,6 +1908,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1913
1908
|
on(exports.ClassId.TOURNAMENT_REGISTER_RESPONSE, function () {
|
|
1914
1909
|
return _this.updateTournaments();
|
|
1915
1910
|
});
|
|
1911
|
+
on(exports.ClassId.BUY_SHOP_ITEM_RESPONSE, function () {
|
|
1912
|
+
return _this.updateStorePurchasedItems();
|
|
1913
|
+
});
|
|
1916
1914
|
on(exports.ClassId.CLIENT_ENGAGEMENT_EVENT_NEW, function () {
|
|
1917
1915
|
return _this.updateInboxMessages();
|
|
1918
1916
|
});
|
|
@@ -2251,6 +2249,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2251
2249
|
* Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
|
|
2252
2250
|
* The maximum number of items per request is limited to 20.
|
|
2253
2251
|
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
2252
|
+
* The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
2253
|
+
* Note that each time you call getStorePurchasedItems with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
2254
|
+
* The onUpdate callback will be called on purchase of the store item and the last 20 items will be passed to it.
|
|
2254
2255
|
*
|
|
2255
2256
|
* **Example**:
|
|
2256
2257
|
* ```
|
|
@@ -2866,31 +2867,41 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2866
2867
|
return Promise.reject(e);
|
|
2867
2868
|
}
|
|
2868
2869
|
};
|
|
2869
|
-
_proto.
|
|
2870
|
+
_proto.updateStorePurchasedItems = function updateStorePurchasedItems() {
|
|
2870
2871
|
try {
|
|
2871
2872
|
var _this40 = this;
|
|
2872
|
-
return Promise.resolve(_this40.api.
|
|
2873
|
-
_this40.updateEntity(onUpdateContextKey.
|
|
2873
|
+
return Promise.resolve(_this40.api.storeGetPurchasedItemsT(null, 20, 0)).then(function (payload) {
|
|
2874
|
+
_this40.updateEntity(onUpdateContextKey.StoreHistory, payload);
|
|
2874
2875
|
});
|
|
2875
2876
|
} catch (e) {
|
|
2876
2877
|
return Promise.reject(e);
|
|
2877
2878
|
}
|
|
2878
2879
|
};
|
|
2879
|
-
_proto.
|
|
2880
|
+
_proto.updateInboxMessages = function updateInboxMessages() {
|
|
2880
2881
|
try {
|
|
2881
2882
|
var _this41 = this;
|
|
2882
|
-
return Promise.resolve(_this41.api.
|
|
2883
|
-
_this41.updateEntity(onUpdateContextKey.
|
|
2883
|
+
return Promise.resolve(_this41.api.getInboxMessagesT(null)).then(function (payload) {
|
|
2884
|
+
_this41.updateEntity(onUpdateContextKey.InboxMessages, payload);
|
|
2884
2885
|
});
|
|
2885
2886
|
} catch (e) {
|
|
2886
2887
|
return Promise.reject(e);
|
|
2887
2888
|
}
|
|
2888
2889
|
};
|
|
2889
|
-
_proto.
|
|
2890
|
+
_proto.updateRaffles = function updateRaffles() {
|
|
2890
2891
|
try {
|
|
2891
2892
|
var _this42 = this;
|
|
2893
|
+
return Promise.resolve(_this42.api.getRafflesT(null)).then(function (payload) {
|
|
2894
|
+
_this42.updateEntity(onUpdateContextKey.Raffles, payload);
|
|
2895
|
+
});
|
|
2896
|
+
} catch (e) {
|
|
2897
|
+
return Promise.reject(e);
|
|
2898
|
+
}
|
|
2899
|
+
};
|
|
2900
|
+
_proto.updateEntity = function updateEntity(contextKey, payload) {
|
|
2901
|
+
try {
|
|
2902
|
+
var _this43 = this;
|
|
2892
2903
|
OCache.set(contextKey, payload, exports.ECacheContext.WSAPI);
|
|
2893
|
-
var onUpdate =
|
|
2904
|
+
var onUpdate = _this43.onUpdateCallback.get(contextKey);
|
|
2894
2905
|
if (onUpdate) {
|
|
2895
2906
|
onUpdate(payload);
|
|
2896
2907
|
}
|
|
@@ -2931,17 +2942,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2931
2942
|
;
|
|
2932
2943
|
_proto.jackpotGet = function jackpotGet(filter) {
|
|
2933
2944
|
try {
|
|
2934
|
-
var
|
|
2945
|
+
var _this44 = this;
|
|
2935
2946
|
var signature = (filter == null ? void 0 : filter.jp_template_id) + ":" + (filter == null ? void 0 : filter.related_game_id);
|
|
2936
|
-
if (signature !==
|
|
2937
|
-
|
|
2938
|
-
|
|
2947
|
+
if (signature !== _this44.jackpotGetSignature) {
|
|
2948
|
+
_this44.jackpotGetSignature = signature;
|
|
2949
|
+
_this44.jackpotClearCache();
|
|
2939
2950
|
}
|
|
2940
2951
|
var jackpots = [];
|
|
2941
2952
|
var pots = [];
|
|
2942
2953
|
return Promise.resolve(OCache.use(onUpdateContextKey.Jackpots, exports.ECacheContext.WSAPI, function () {
|
|
2943
2954
|
try {
|
|
2944
|
-
return Promise.resolve(
|
|
2955
|
+
return Promise.resolve(_this44.api.jackpotGet(null, filter)).then(function (_jackpots) {
|
|
2945
2956
|
var _pots = _jackpots.items.map(function (jp) {
|
|
2946
2957
|
return jp.pot;
|
|
2947
2958
|
});
|
|
@@ -2973,10 +2984,10 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2973
2984
|
var jp_template_ids = jackpots.map(function (jp) {
|
|
2974
2985
|
return jp.jp_template_id;
|
|
2975
2986
|
});
|
|
2976
|
-
return Promise.resolve(
|
|
2987
|
+
return Promise.resolve(_this44.api.potGet(null, {
|
|
2977
2988
|
jp_template_ids: jp_template_ids
|
|
2978
|
-
})).then(function (
|
|
2979
|
-
return
|
|
2989
|
+
})).then(function (_this44$api$potGet) {
|
|
2990
|
+
return _this44$api$potGet.items;
|
|
2980
2991
|
});
|
|
2981
2992
|
} catch (e) {
|
|
2982
2993
|
return Promise.reject(e);
|
|
@@ -3009,11 +3020,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3009
3020
|
;
|
|
3010
3021
|
_proto.jackpotOptIn = function jackpotOptIn(filter) {
|
|
3011
3022
|
try {
|
|
3012
|
-
var
|
|
3023
|
+
var _this45 = this;
|
|
3013
3024
|
if (!filter.jp_template_id) {
|
|
3014
3025
|
throw new Error('jp_template_id is required in jackpotOptIn');
|
|
3015
3026
|
}
|
|
3016
|
-
return Promise.resolve(
|
|
3027
|
+
return Promise.resolve(_this45.api.jackpotOptIn(null, filter));
|
|
3017
3028
|
} catch (e) {
|
|
3018
3029
|
return Promise.reject(e);
|
|
3019
3030
|
}
|
|
@@ -3035,11 +3046,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3035
3046
|
;
|
|
3036
3047
|
_proto.jackpotOptOut = function jackpotOptOut(filter) {
|
|
3037
3048
|
try {
|
|
3038
|
-
var
|
|
3049
|
+
var _this46 = this;
|
|
3039
3050
|
if (!filter.jp_template_id) {
|
|
3040
3051
|
throw new Error('jp_template_id is required in jackpotOptOut');
|
|
3041
3052
|
}
|
|
3042
|
-
return Promise.resolve(
|
|
3053
|
+
return Promise.resolve(_this46.api.jackpotOptOut(null, filter));
|
|
3043
3054
|
} catch (e) {
|
|
3044
3055
|
return Promise.reject(e);
|
|
3045
3056
|
}
|
|
@@ -3065,9 +3076,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3065
3076
|
offset = _ref10.offset,
|
|
3066
3077
|
jp_template_id = _ref10.jp_template_id;
|
|
3067
3078
|
try {
|
|
3068
|
-
var
|
|
3079
|
+
var _this47 = this;
|
|
3069
3080
|
return Promise.resolve(OCache.use(onUpdateContextKey.JackpotWinners + jp_template_id, exports.ECacheContext.WSAPI, function () {
|
|
3070
|
-
return
|
|
3081
|
+
return _this47.api.getJackpotWinnersT(null, limit, offset, jp_template_id);
|
|
3071
3082
|
}, JACKPOT_WINNERS_CACHE_SEC));
|
|
3072
3083
|
} catch (e) {
|
|
3073
3084
|
return Promise.reject(e);
|
|
@@ -3091,12 +3102,12 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3091
3102
|
var jp_template_id = _ref11.jp_template_id,
|
|
3092
3103
|
onUpdate = _ref11.onUpdate;
|
|
3093
3104
|
try {
|
|
3094
|
-
var
|
|
3105
|
+
var _this48 = this;
|
|
3095
3106
|
if (onUpdate) {
|
|
3096
|
-
|
|
3107
|
+
_this48.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);
|
|
3097
3108
|
}
|
|
3098
3109
|
return Promise.resolve(OCache.use(onUpdateContextKey.JackpotEligibleGames + jp_template_id, exports.ECacheContext.WSAPI, function () {
|
|
3099
|
-
return
|
|
3110
|
+
return _this48.api.getJackpotEligibleGamesT(null, {
|
|
3100
3111
|
jp_template_id: jp_template_id
|
|
3101
3112
|
});
|
|
3102
3113
|
}, JACKPOT_ELIGIBLE_GAMES_CACHE_SEC));
|
|
@@ -3125,8 +3136,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3125
3136
|
;
|
|
3126
3137
|
_proto.getRelatedItemsForGame = function getRelatedItemsForGame(related_game_id) {
|
|
3127
3138
|
try {
|
|
3128
|
-
var
|
|
3129
|
-
return Promise.resolve(
|
|
3139
|
+
var _this49 = this;
|
|
3140
|
+
return Promise.resolve(_this49.api.getRelatedItemsForGame(null, related_game_id));
|
|
3130
3141
|
} catch (e) {
|
|
3131
3142
|
return Promise.reject(e);
|
|
3132
3143
|
}
|
|
@@ -3151,12 +3162,12 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3151
3162
|
var _ref12 = _temp11 === void 0 ? {} : _temp11,
|
|
3152
3163
|
onUpdate = _ref12.onUpdate;
|
|
3153
3164
|
try {
|
|
3154
|
-
var
|
|
3165
|
+
var _this50 = this;
|
|
3155
3166
|
if (onUpdate) {
|
|
3156
|
-
|
|
3167
|
+
_this50.onUpdateCallback.set(onUpdateContextKey.Raffles, onUpdate);
|
|
3157
3168
|
}
|
|
3158
3169
|
return Promise.resolve(OCache.use(onUpdateContextKey.Raffles, exports.ECacheContext.WSAPI, function () {
|
|
3159
|
-
return
|
|
3170
|
+
return _this50.api.getRafflesT(null);
|
|
3160
3171
|
}, CACHE_DATA_SEC));
|
|
3161
3172
|
} catch (e) {
|
|
3162
3173
|
return Promise.reject(e);
|
|
@@ -3179,8 +3190,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3179
3190
|
;
|
|
3180
3191
|
_proto.getRaffleDrawRun = function getRaffleDrawRun(props) {
|
|
3181
3192
|
try {
|
|
3182
|
-
var
|
|
3183
|
-
return Promise.resolve(
|
|
3193
|
+
var _this51 = this;
|
|
3194
|
+
return Promise.resolve(_this51.api.getRaffleDrawRun(null, props)).then(function (res) {
|
|
3184
3195
|
if (!props.raffle_id || !props.run_id) {
|
|
3185
3196
|
throw new Error('both raffle_id and run_id are required');
|
|
3186
3197
|
}
|
|
@@ -3207,8 +3218,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3207
3218
|
;
|
|
3208
3219
|
_proto.getRaffleDrawRunsHistory = function getRaffleDrawRunsHistory(props) {
|
|
3209
3220
|
try {
|
|
3210
|
-
var
|
|
3211
|
-
return Promise.resolve(
|
|
3221
|
+
var _this52 = this;
|
|
3222
|
+
return Promise.resolve(_this52.api.getRaffleDrawRunsHistory(null, props)).then(function (res) {
|
|
3212
3223
|
if (!props.raffle_id) {
|
|
3213
3224
|
throw new Error('raffle_id is required');
|
|
3214
3225
|
}
|
|
@@ -3235,11 +3246,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3235
3246
|
;
|
|
3236
3247
|
_proto.claimRafflePrize = function claimRafflePrize(props) {
|
|
3237
3248
|
try {
|
|
3238
|
-
var
|
|
3249
|
+
var _this53 = this;
|
|
3239
3250
|
if (!props.won_id) {
|
|
3240
3251
|
throw new Error('won_id is required');
|
|
3241
3252
|
}
|
|
3242
|
-
return Promise.resolve(
|
|
3253
|
+
return Promise.resolve(_this53.api.claimRafflePrize(null, {
|
|
3243
3254
|
won_id: props.won_id
|
|
3244
3255
|
})).then(raffleClaimPrizeResponseTransform);
|
|
3245
3256
|
} catch (e) {
|