@smartico/public-api 0.0.154 → 0.0.155
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/.prettierrc +12 -0
- package/dist/Base/ProtocolRequest.d.ts +1 -1
- package/dist/Base/ProtocolResponse.d.ts +1 -1
- package/dist/Core/CheckSegmentMatchRequest.d.ts +1 -1
- package/dist/Core/CheckSegmentMatchResponse.d.ts +1 -1
- package/dist/Core/GetAchievementsUserInfoRequest.d.ts +1 -1
- package/dist/Core/GetAchievementsUserInfoResponse.d.ts +1 -1
- package/dist/Core/GetLabelInfoRequest.d.ts +1 -1
- package/dist/Core/GetLabelInfoResponse.d.ts +1 -1
- package/dist/Core/GetTranslationsRequest.d.ts +2 -2
- package/dist/Core/GetTranslationsResponse.d.ts +1 -1
- package/dist/Core/ResponseIdentify.d.ts +2 -2
- package/dist/CustomSections/GetCustomSectionsRequest.d.ts +1 -1
- package/dist/CustomSections/GetCustomSectionsResponse.d.ts +2 -2
- package/dist/CustomSections/UICustomSection.d.ts +2 -2
- package/dist/GResponse.d.ts +1 -1
- package/dist/Inbox/GetInboxMessagesRequest.d.ts +1 -1
- package/dist/Inbox/GetInboxMessagesResponse.d.ts +3 -3
- package/dist/Inbox/InboxMessage.d.ts +2 -2
- package/dist/Inbox/MarkInboxMessageDeletedRequest.d.ts +1 -1
- package/dist/Inbox/MarkInboxMessageDeletedResponse.d.ts +1 -1
- package/dist/Inbox/MarkInboxMessageReadRequest.d.ts +1 -1
- package/dist/Inbox/MarkInboxMessageReadResponse.d.ts +1 -1
- package/dist/Inbox/MarkInboxMessageStarredRequest.d.ts +1 -1
- package/dist/Inbox/MarkInboxMessageStarredResponse.d.ts +1 -1
- package/dist/Inbox/index.d.ts +8 -8
- package/dist/Jackpots/GetJackpotsPotsRequest.d.ts +1 -1
- package/dist/Jackpots/GetJackpotsPotsResponse.d.ts +2 -2
- package/dist/Jackpots/GetJackpotsRequest.d.ts +1 -1
- package/dist/Jackpots/GetJackpotsResponse.d.ts +2 -2
- package/dist/Jackpots/JackpotDetails.d.ts +6 -6
- package/dist/Jackpots/JackpotWinPush.d.ts +3 -3
- package/dist/Jackpots/JackpotsOptinRequest.d.ts +1 -1
- package/dist/Jackpots/JackpotsOptinResponse.d.ts +1 -1
- package/dist/Jackpots/JackpotsOptoutRequest.d.ts +1 -1
- package/dist/Jackpots/JackpotsOptoutResponse.d.ts +1 -1
- package/dist/Leaderboard/GetLeaderBoardsRequest.d.ts +2 -2
- package/dist/Leaderboard/GetLeaderBoardsResponse.d.ts +2 -2
- package/dist/Leaderboard/LeaderBoardDetails.d.ts +3 -3
- package/dist/Leaderboard/LeaderBoards.d.ts +2 -2
- package/dist/Leaderboard/index.d.ts +6 -6
- package/dist/Level/GetLevelMapResponse.d.ts +3 -3
- package/dist/Level/Level.d.ts +1 -1
- package/dist/MiniGames/SAWAcknowledgeSpinPushRequest.d.ts +1 -1
- package/dist/MiniGames/SAWDoAknowledgeRequest.d.ts +1 -1
- package/dist/MiniGames/SAWDoAknowledgeResponse.d.ts +1 -1
- package/dist/MiniGames/SAWDoSpinRequest.d.ts +1 -1
- package/dist/MiniGames/SAWDoSpinResponse.d.ts +2 -2
- package/dist/MiniGames/SAWEventSawPush.d.ts +1 -1
- package/dist/MiniGames/SAWGetTemplatesRequest.d.ts +1 -1
- package/dist/MiniGames/SAWGetTemplatesResponse.d.ts +3 -3
- package/dist/MiniGames/SAWPrize.d.ts +2 -2
- package/dist/MiniGames/SAWPrizeDropAknowledgeRequest.d.ts +3 -1
- package/dist/MiniGames/SAWPrizeDropAknowledgeResponse.d.ts +1 -1
- package/dist/MiniGames/SAWPrizeDropWinPush.d.ts +4 -3
- package/dist/MiniGames/SAWPrizeUI.d.ts +2 -2
- package/dist/MiniGames/SAWSpinsCountPush.d.ts +1 -1
- package/dist/MiniGames/SAWTemplate.d.ts +4 -4
- package/dist/MiniGames/SAWTemplateUI.d.ts +1 -1
- package/dist/MiniGames/SAWUtils.d.ts +1 -1
- package/dist/MiniGames/index.d.ts +24 -22
- package/dist/Missions/AchClaimPrizeRequest.d.ts +1 -1
- package/dist/Missions/AchClaimPrizeResponse.d.ts +1 -1
- package/dist/Missions/AchievementCategory.d.ts +2 -2
- package/dist/Missions/AchievementOptinRequest.d.ts +1 -1
- package/dist/Missions/AchievementOptinResponse.d.ts +1 -1
- package/dist/Missions/GetAchCategoriesRequest.d.ts +1 -1
- package/dist/Missions/GetAchCategoriesResponse.d.ts +2 -2
- package/dist/Missions/GetAchievementMapRequest.d.ts +1 -1
- package/dist/Missions/GetAchievementMapResponse.d.ts +2 -2
- package/dist/Missions/GetRelatedAchTourRequest.d.ts +1 -1
- package/dist/Missions/GetRelatedAchTourResponse.d.ts +3 -3
- package/dist/Missions/ReloadAchievementsEvent.d.ts +2 -2
- package/dist/Missions/UserAchievement.d.ts +7 -7
- package/dist/Missions/UserAchievementTask.d.ts +2 -2
- package/dist/Missions/index.d.ts +13 -13
- package/dist/Quiz/MarketsInfo.d.ts +2 -2
- package/dist/Quiz/MarketsPerSport.d.ts +1 -1
- package/dist/SmarticoAPI.d.ts +8 -8
- package/dist/SmarticoLib/index.d.ts +39 -39
- package/dist/Store/BuyStoreItemRequest.d.ts +1 -1
- package/dist/Store/BuyStoreItemResponse.d.ts +1 -1
- package/dist/Store/GetCategoriesStoreResponse.d.ts +2 -2
- package/dist/Store/GetStoreHistoryRequest.d.ts +1 -1
- package/dist/Store/GetStoreHistoryResponse.d.ts +2 -2
- package/dist/Store/GetStoreItemsResponse.d.ts +2 -2
- package/dist/Store/StoreCategory.d.ts +2 -2
- package/dist/Store/StoreItem.d.ts +3 -3
- package/dist/Store/StoreItemPurchased.d.ts +2 -2
- package/dist/Store/index.d.ts +10 -10
- package/dist/Tournaments/GetTournamentInfoRequest.d.ts +1 -1
- package/dist/Tournaments/GetTournamentInfoResponse.d.ts +5 -5
- package/dist/Tournaments/GetTournamentsRequest.d.ts +1 -1
- package/dist/Tournaments/GetTournamentsResponse.d.ts +2 -2
- package/dist/Tournaments/Tournament.d.ts +8 -8
- package/dist/Tournaments/TournamentPrize.d.ts +1 -1
- package/dist/Tournaments/TournamentRegisterRequest.d.ts +1 -1
- package/dist/Tournaments/TournamentRegisterResponse.d.ts +2 -2
- package/dist/Tournaments/TournamentUtils.d.ts +3 -3
- package/dist/Tournaments/index.d.ts +16 -16
- package/dist/WSAPI/WSAPI.d.ts +65 -65
- package/dist/WSAPI/WSAPITypes.d.ts +18 -18
- package/dist/index.js +76 -78
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +103 -103
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Base/AchRelatedGame.ts +13 -13
- package/src/Base/ClassId.ts +118 -121
- package/src/Base/ProtocolMessage.ts +6 -7
- package/src/Base/ProtocolRequest.ts +4 -5
- package/src/Base/ProtocolResponse.ts +3 -5
- package/src/CookieStore.ts +10 -11
- package/src/Core/ActivityTypeLimited.ts +17 -18
- package/src/Core/CheckSegmentMatchRequest.ts +2 -3
- package/src/Core/CheckSegmentMatchResponse.ts +6 -6
- package/src/Core/CoreUtils.ts +37 -39
- package/src/Core/GetAchievementsUserInfoRequest.ts +2 -4
- package/src/Core/GetAchievementsUserInfoResponse.ts +4 -4
- package/src/Core/GetLabelInfoRequest.ts +2 -4
- package/src/Core/GetLabelInfoResponse.ts +4 -4
- package/src/Core/GetTranslationsRequest.ts +5 -7
- package/src/Core/GetTranslationsResponse.ts +3 -5
- package/src/Core/PublicLabelSettings.ts +29 -30
- package/src/Core/PublicProperties.ts +7 -7
- package/src/Core/ResponseIdentify.ts +12 -12
- package/src/Core/TranslationArea.ts +8 -9
- package/src/Core/index.ts +1 -1
- package/src/CustomSections/AchCustomSection.ts +20 -20
- package/src/CustomSections/GetCustomSectionsRequest.ts +2 -4
- package/src/CustomSections/GetCustomSectionsResponse.ts +4 -5
- package/src/CustomSections/UICustomSection.ts +30 -29
- package/src/CustomSections/index.ts +4 -4
- package/src/ErrorCodes.ts +11 -12
- package/src/GResponse.ts +5 -5
- package/src/ILogger.ts +6 -10
- package/src/Inbox/GetInboxMessagesRequest.ts +4 -5
- package/src/Inbox/GetInboxMessagesResponse.ts +15 -17
- package/src/Inbox/InboxMessage.ts +31 -33
- package/src/Inbox/InboxMessageType.ts +9 -9
- package/src/Inbox/MarkInboxMessageDeletedRequest.ts +3 -3
- package/src/Inbox/MarkInboxMessageDeletedResponse.ts +3 -3
- package/src/Inbox/MarkInboxMessageReadRequest.ts +4 -5
- package/src/Inbox/MarkInboxMessageReadResponse.ts +4 -5
- package/src/Inbox/MarkInboxMessageStarredRequest.ts +4 -5
- package/src/Inbox/MarkInboxMessageStarredResponse.ts +4 -5
- package/src/Inbox/index.ts +10 -10
- package/src/IntUtils.ts +72 -85
- package/src/Jackpots/GetJackpotsPotsRequest.ts +3 -3
- package/src/Jackpots/GetJackpotsPotsResponse.ts +3 -5
- package/src/Jackpots/GetJackpotsRequest.ts +4 -6
- package/src/Jackpots/GetJackpotsResponse.ts +5 -7
- package/src/Jackpots/JackPotWinner.ts +11 -12
- package/src/Jackpots/JackpotContributionType.ts +3 -4
- package/src/Jackpots/JackpotDetails.ts +31 -31
- package/src/Jackpots/JackpotHtmlTemplate.ts +3 -3
- package/src/Jackpots/JackpotPot.ts +11 -12
- package/src/Jackpots/JackpotPublicMeta.ts +16 -16
- package/src/Jackpots/JackpotType.ts +2 -5
- package/src/Jackpots/JackpotWinPush.ts +6 -6
- package/src/Jackpots/JackpotsOptinRequest.ts +3 -5
- package/src/Jackpots/JackpotsOptinResponse.ts +2 -4
- package/src/Jackpots/JackpotsOptoutRequest.ts +3 -5
- package/src/Jackpots/JackpotsOptoutResponse.ts +2 -4
- package/src/Jackpots/index.ts +16 -16
- package/src/Leaderboard/GetLeaderBoardsRequest.ts +8 -9
- package/src/Leaderboard/GetLeaderBoardsResponse.ts +4 -6
- package/src/Leaderboard/LeaderBoardDetails.ts +11 -12
- package/src/Leaderboard/LeaderBoardPeriodType.ts +3 -3
- package/src/Leaderboard/LeaderBoardPosition.ts +9 -10
- package/src/Leaderboard/LeaderBoardPublicMeta.ts +3 -4
- package/src/Leaderboard/LeaderBoards.ts +42 -42
- package/src/Leaderboard/index.ts +6 -6
- package/src/Level/GetLevelMapResponse.ts +18 -21
- package/src/Level/Level.ts +10 -11
- package/src/Level/LevelPublicMeta.ts +17 -17
- package/src/Level/index.ts +3 -3
- package/src/MiniGames/SAWAcknowledgeSpinPushRequest.ts +3 -4
- package/src/MiniGames/SAWAcknowledgeType.ts +3 -4
- package/src/MiniGames/SAWAskForUsername.ts +3 -4
- package/src/MiniGames/SAWBuyInType.ts +15 -13
- package/src/MiniGames/SAWDoAknowledgeRequest.ts +3 -3
- package/src/MiniGames/SAWDoAknowledgeResponse.ts +3 -3
- package/src/MiniGames/SAWDoSpinRequest.ts +3 -5
- package/src/MiniGames/SAWDoSpinResponse.ts +10 -11
- package/src/MiniGames/SAWEventSawPush.ts +3 -4
- package/src/MiniGames/SAWGameType.ts +23 -21
- package/src/MiniGames/SAWGetTemplatesRequest.ts +3 -3
- package/src/MiniGames/SAWGetTemplatesResponse.ts +53 -65
- package/src/MiniGames/SAWPrize.ts +11 -12
- package/src/MiniGames/SAWPrizeDropAknowledgeRequest.ts +5 -3
- package/src/MiniGames/SAWPrizeDropAknowledgeResponse.ts +3 -3
- package/src/MiniGames/SAWPrizeDropWinPush.ts +9 -8
- package/src/MiniGames/SAWPrizeType.ts +23 -22
- package/src/MiniGames/SAWPrizeUI.ts +17 -17
- package/src/MiniGames/SAWSpinErrorCode.ts +15 -16
- package/src/MiniGames/SAWSpinsCountPush.ts +4 -4
- package/src/MiniGames/SAWTemplate.ts +29 -29
- package/src/MiniGames/SAWTemplateUI.ts +45 -47
- package/src/MiniGames/SAWUtils.ts +23 -26
- package/src/MiniGames/SAWWinSoundType.ts +10 -11
- package/src/MiniGames/index.ts +24 -22
- package/src/Missions/AchCategoryPublicMeta.ts +2 -3
- package/src/Missions/AchClaimPrizeRequest.ts +4 -5
- package/src/Missions/AchClaimPrizeResponse.ts +3 -4
- package/src/Missions/AchievementCategory.ts +14 -15
- package/src/Missions/AchievementOptinRequest.ts +3 -5
- package/src/Missions/AchievementOptinResponse.ts +2 -4
- package/src/Missions/AchievementPublicMeta.ts +19 -20
- package/src/Missions/AchievementStatus.ts +7 -8
- package/src/Missions/AchievementTaskPublicMeta.ts +2 -3
- package/src/Missions/AchievementTaskType.ts +2 -2
- package/src/Missions/AchievementType.ts +2 -3
- package/src/Missions/GetAchCategoriesRequest.ts +2 -4
- package/src/Missions/GetAchCategoriesResponse.ts +4 -5
- package/src/Missions/GetAchievementMapRequest.ts +2 -4
- package/src/Missions/GetAchievementMapResponse.ts +3 -5
- package/src/Missions/GetRelatedAchTourRequest.ts +3 -4
- package/src/Missions/GetRelatedAchTourResponse.ts +5 -7
- package/src/Missions/ReloadAchievementsEvent.ts +5 -5
- package/src/Missions/ScheduledMissionType.ts +4 -5
- package/src/Missions/UserAchievement.ts +104 -108
- package/src/Missions/UserAchievementTask.ts +13 -15
- package/src/Missions/index.ts +19 -19
- package/src/NodeCache.ts +44 -49
- package/src/OCache.ts +51 -57
- package/src/Quiz/MarketsAnswers.ts +34 -34
- package/src/Quiz/MarketsInfo.ts +184 -177
- package/src/Quiz/MarketsPerSport.ts +30 -37
- package/src/Quiz/MarketsType.ts +28 -28
- package/src/Quiz/ScoreResultTypes.ts +18 -18
- package/src/Quiz/SportTypes.ts +4 -4
- package/src/Quiz/index.ts +6 -6
- package/src/SmarticoAPI.ts +769 -730
- package/src/SmarticoLib/index.ts +1053 -1069
- package/src/Store/BuyStoreItemErrorCode.ts +10 -10
- package/src/Store/BuyStoreItemRequest.ts +2 -2
- package/src/Store/BuyStoreItemResponse.ts +2 -3
- package/src/Store/GetCategoriesStoreResponse.ts +3 -8
- package/src/Store/GetStoreHistoryRequest.ts +3 -3
- package/src/Store/GetStoreHistoryResponse.ts +4 -4
- package/src/Store/GetStoreItemsResponse.ts +3 -4
- package/src/Store/StoreCategory.ts +14 -15
- package/src/Store/StoreCategoryPublicMeta.ts +2 -3
- package/src/Store/StoreItem.ts +32 -33
- package/src/Store/StoreItemPublicMeta.ts +10 -10
- package/src/Store/StoreItemPurchased.ts +40 -40
- package/src/Store/StoreItemType.ts +20 -19
- package/src/Store/index.ts +13 -13
- package/src/Tournaments/GetTournamentInfoRequest.ts +2 -3
- package/src/Tournaments/GetTournamentInfoResponse.ts +45 -48
- package/src/Tournaments/GetTournamentsRequest.ts +2 -4
- package/src/Tournaments/GetTournamentsResponse.ts +7 -14
- package/src/Tournaments/Tournament.ts +109 -115
- package/src/Tournaments/TournamentInstanceStatus.ts +17 -18
- package/src/Tournaments/TournamentPlayer.ts +7 -8
- package/src/Tournaments/TournamentPrize.ts +9 -10
- package/src/Tournaments/TournamentPublicMeta.ts +26 -26
- package/src/Tournaments/TournamentRegisterRequest.ts +2 -3
- package/src/Tournaments/TournamentRegisterResponse.ts +3 -7
- package/src/Tournaments/TournamentRegistrationError.ts +9 -9
- package/src/Tournaments/TournamentRegistrationStatus.ts +25 -27
- package/src/Tournaments/TournamentRegistrationType.ts +15 -16
- package/src/Tournaments/TournamentType.ts +3 -4
- package/src/Tournaments/TournamentUtils.ts +90 -89
- package/src/Tournaments/index.ts +16 -16
- package/src/WSAPI/WSAPI.ts +781 -763
- package/src/WSAPI/WSAPITypes.ts +574 -586
- package/src/index.ts +15 -15
package/dist/index.modern.mjs
CHANGED
|
@@ -150,24 +150,24 @@ class IntUtils {
|
|
|
150
150
|
static uuid() {
|
|
151
151
|
let a;
|
|
152
152
|
let b;
|
|
153
|
-
for (b = a =
|
|
153
|
+
for (b = a = ''; a++ < 36; b += a * 51 & 52 ? (a ^ 15 ? 8 ^ Math.random() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') {}
|
|
154
154
|
return b;
|
|
155
155
|
}
|
|
156
156
|
static isNotNull(val) {
|
|
157
|
-
return typeof val !==
|
|
157
|
+
return typeof val !== 'undefined' && val !== null;
|
|
158
158
|
}
|
|
159
159
|
static isNotEmpty(val) {
|
|
160
|
-
return typeof val !==
|
|
160
|
+
return typeof val !== 'undefined' && val !== null && val.length > 0;
|
|
161
161
|
}
|
|
162
162
|
static replaceAll(value, regex, replacement) {
|
|
163
163
|
if (IntUtils.isNotNull(value)) {
|
|
164
|
-
return value.replace(new RegExp(IntUtils.escapeRegExp(regex),
|
|
164
|
+
return value.replace(new RegExp(IntUtils.escapeRegExp(regex), 'g'), replacement == null ? void 0 : replacement.toString());
|
|
165
165
|
}
|
|
166
166
|
return value;
|
|
167
167
|
}
|
|
168
168
|
static escapeRegExp(v) {
|
|
169
169
|
if (IntUtils.isNotEmpty(v)) {
|
|
170
|
-
return v.replace(/[.*+?^${}()|[\]\\]/g,
|
|
170
|
+
return v.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
171
171
|
}
|
|
172
172
|
return v;
|
|
173
173
|
}
|
|
@@ -195,7 +195,7 @@ IntUtils.isWithinPeriod = (timestamp, period) => {
|
|
|
195
195
|
switch (period) {
|
|
196
196
|
case 'today':
|
|
197
197
|
return now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth() && now.getDate() === completedDate.getDate();
|
|
198
|
-
case
|
|
198
|
+
case 'thisWeek':
|
|
199
199
|
const startOfWeek = new Date(now);
|
|
200
200
|
startOfWeek.setDate(now.getDate() - now.getDay());
|
|
201
201
|
startOfWeek.setHours(0, 0, 0, 0);
|
|
@@ -203,7 +203,7 @@ IntUtils.isWithinPeriod = (timestamp, period) => {
|
|
|
203
203
|
endOfWeek.setDate(startOfWeek.getDate() + 6);
|
|
204
204
|
endOfWeek.setHours(23, 59, 59, 999);
|
|
205
205
|
return completedDate >= startOfWeek && completedDate <= endOfWeek;
|
|
206
|
-
case
|
|
206
|
+
case 'thisMonth':
|
|
207
207
|
return now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth();
|
|
208
208
|
default:
|
|
209
209
|
return false;
|
|
@@ -253,7 +253,7 @@ SAWUtils.canPlay = (t, pointsBalance) => {
|
|
|
253
253
|
}
|
|
254
254
|
default:
|
|
255
255
|
{
|
|
256
|
-
console.error(
|
|
256
|
+
console.error('MiniGamesUtils.canPlay: Unknwon SAW buyin type ' + t.saw_buyin_type_id);
|
|
257
257
|
return false;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
@@ -382,8 +382,8 @@ const SAWTemplatesTransform = items => {
|
|
|
382
382
|
};
|
|
383
383
|
|
|
384
384
|
/*
|
|
385
|
-
* Possible error codes for the mini-games attempts
|
|
386
|
-
*/
|
|
385
|
+
* Possible error codes for the mini-games attempts
|
|
386
|
+
*/
|
|
387
387
|
var SAWSpinErrorCode;
|
|
388
388
|
(function (SAWSpinErrorCode) {
|
|
389
389
|
/** No error */
|
|
@@ -410,9 +410,9 @@ var SAWWinSoundType;
|
|
|
410
410
|
})(SAWWinSoundType || (SAWWinSoundType = {}));
|
|
411
411
|
const SAWWinSoundFiles = {
|
|
412
412
|
[SAWWinSoundType.NoSound]: null,
|
|
413
|
-
[SAWWinSoundType.Disappointing]:
|
|
414
|
-
[SAWWinSoundType.Positive]:
|
|
415
|
-
[SAWWinSoundType.HighlyPositive]:
|
|
413
|
+
[SAWWinSoundType.Disappointing]: 'saw-disappointed.m4a',
|
|
414
|
+
[SAWWinSoundType.Positive]: 'saw-positive.m4a',
|
|
415
|
+
[SAWWinSoundType.HighlyPositive]: 'saw-highly-positive.m4a'
|
|
416
416
|
};
|
|
417
417
|
|
|
418
418
|
class NodeCache {
|
|
@@ -536,26 +536,26 @@ class CoreUtils {
|
|
|
536
536
|
static currencySymbol(currency) {
|
|
537
537
|
return {
|
|
538
538
|
[currency == null ? void 0 : currency.toUpperCase()]: currency == null ? void 0 : currency.toUpperCase(),
|
|
539
|
-
USD:
|
|
540
|
-
EUR:
|
|
541
|
-
JPY:
|
|
542
|
-
GBP:
|
|
543
|
-
AUD:
|
|
544
|
-
CAD:
|
|
545
|
-
CHF:
|
|
546
|
-
CNY:
|
|
547
|
-
SEK:
|
|
548
|
-
NZD:
|
|
549
|
-
MXN:
|
|
550
|
-
SGD:
|
|
551
|
-
HKD:
|
|
552
|
-
NOK:
|
|
553
|
-
KRW:
|
|
554
|
-
TRY:
|
|
555
|
-
INR:
|
|
556
|
-
RUB:
|
|
557
|
-
BRL:
|
|
558
|
-
ZAR:
|
|
539
|
+
USD: '$',
|
|
540
|
+
EUR: '\u20AC',
|
|
541
|
+
JPY: '\u00A5',
|
|
542
|
+
GBP: '\u00A3',
|
|
543
|
+
AUD: 'A$',
|
|
544
|
+
CAD: 'C$',
|
|
545
|
+
CHF: 'CHF',
|
|
546
|
+
CNY: '\u00A5',
|
|
547
|
+
SEK: 'kr',
|
|
548
|
+
NZD: 'NZ$',
|
|
549
|
+
MXN: 'MX$',
|
|
550
|
+
SGD: 'S$',
|
|
551
|
+
HKD: 'HK$',
|
|
552
|
+
NOK: 'kr',
|
|
553
|
+
KRW: '\u20A9',
|
|
554
|
+
TRY: '\u20BA',
|
|
555
|
+
INR: '\u20B9',
|
|
556
|
+
RUB: '\u20BD',
|
|
557
|
+
BRL: 'R$',
|
|
558
|
+
ZAR: 'R' // South African Rand
|
|
559
559
|
}[currency == null ? void 0 : currency.toUpperCase()];
|
|
560
560
|
}
|
|
561
561
|
}
|
|
@@ -985,13 +985,13 @@ var TournamentInstanceStatus;
|
|
|
985
985
|
})(TournamentInstanceStatus || (TournamentInstanceStatus = {}));
|
|
986
986
|
const TournamentInstanceStatusName = s => {
|
|
987
987
|
return {
|
|
988
|
-
[TournamentInstanceStatus.PUBLISHED]:
|
|
989
|
-
[TournamentInstanceStatus.REGISTER]:
|
|
990
|
-
[TournamentInstanceStatus.STARTED]:
|
|
991
|
-
[TournamentInstanceStatus.FINISHED]:
|
|
992
|
-
[TournamentInstanceStatus.CANCELLED]:
|
|
993
|
-
[TournamentInstanceStatus.FAILED]:
|
|
994
|
-
[TournamentInstanceStatus.FINALIZING]:
|
|
988
|
+
[TournamentInstanceStatus.PUBLISHED]: 'PUBLISHED',
|
|
989
|
+
[TournamentInstanceStatus.REGISTER]: 'REGISTER',
|
|
990
|
+
[TournamentInstanceStatus.STARTED]: 'STARTED',
|
|
991
|
+
[TournamentInstanceStatus.FINISHED]: 'FINISHED',
|
|
992
|
+
[TournamentInstanceStatus.CANCELLED]: 'CANCELLED',
|
|
993
|
+
[TournamentInstanceStatus.FAILED]: 'FAILED',
|
|
994
|
+
[TournamentInstanceStatus.FINALIZING]: 'FINALIZING'
|
|
995
995
|
}[s];
|
|
996
996
|
};
|
|
997
997
|
|
|
@@ -1001,7 +1001,7 @@ const tournamentPrizeTypeToPrizeName = type => {
|
|
|
1001
1001
|
[ActivityTypeLimited.Points]: 'POINTS_ADD',
|
|
1002
1002
|
[ActivityTypeLimited.DeductPoints]: 'POINTS_DEDUCT',
|
|
1003
1003
|
[ActivityTypeLimited.ResetPoints]: 'POINTS_RESET',
|
|
1004
|
-
[ActivityTypeLimited.MiniGameAttempt]:
|
|
1004
|
+
[ActivityTypeLimited.MiniGameAttempt]: 'MINI_GAME_ATTEMPT',
|
|
1005
1005
|
[ActivityTypeLimited.Bonus]: 'BONUS'
|
|
1006
1006
|
}[type];
|
|
1007
1007
|
};
|
|
@@ -1214,7 +1214,7 @@ class WSAPI {
|
|
|
1214
1214
|
* ```
|
|
1215
1215
|
*
|
|
1216
1216
|
* **Visitor mode: not supported**
|
|
1217
|
-
|
|
1217
|
+
*/
|
|
1218
1218
|
async checkSegmentMatch(segment_id) {
|
|
1219
1219
|
const r = await this.api.coreCheckSegments(null, [segment_id]);
|
|
1220
1220
|
if (r && r.find(s => s.segment_id === segment_id && s.is_matching)) {
|
|
@@ -1231,7 +1231,7 @@ class WSAPI {
|
|
|
1231
1231
|
* });
|
|
1232
1232
|
* ```
|
|
1233
1233
|
* **Visitor mode: not supported**
|
|
1234
|
-
|
|
1234
|
+
*/
|
|
1235
1235
|
async checkSegmentListMatch(segment_ids) {
|
|
1236
1236
|
return await this.api.coreCheckSegments(null, Array.isArray(segment_ids) ? segment_ids : [segment_ids]);
|
|
1237
1237
|
}
|
|
@@ -1249,7 +1249,7 @@ class WSAPI {
|
|
|
1249
1249
|
* console.log(result);
|
|
1250
1250
|
* });
|
|
1251
1251
|
* ```
|
|
1252
|
-
|
|
1252
|
+
*/
|
|
1253
1253
|
async getLevels() {
|
|
1254
1254
|
return OCache.use(onUpdateContextKey.Levels, ECacheContext.WSAPI, () => this.api.levelsGetT(null), CACHE_DATA_SEC);
|
|
1255
1255
|
}
|
|
@@ -1284,7 +1284,7 @@ class WSAPI {
|
|
|
1284
1284
|
* Returns all the badges available the current user
|
|
1285
1285
|
*
|
|
1286
1286
|
* **Visitor mode: not supported**
|
|
1287
|
-
|
|
1287
|
+
*/
|
|
1288
1288
|
async getBadges() {
|
|
1289
1289
|
return OCache.use(onUpdateContextKey.Badges, ECacheContext.WSAPI, () => this.api.badgetsGetItemsT(null), CACHE_DATA_SEC);
|
|
1290
1290
|
}
|
|
@@ -1301,7 +1301,7 @@ class WSAPI {
|
|
|
1301
1301
|
* ```
|
|
1302
1302
|
*
|
|
1303
1303
|
* **Visitor mode: not supported**
|
|
1304
|
-
|
|
1304
|
+
*/
|
|
1305
1305
|
async getUserLevelExtraCounters() {
|
|
1306
1306
|
return OCache.use(onUpdateContextKey.LevelExtraCounters, ECacheContext.WSAPI, () => this.api.getUserGamificationInfoT(null), CACHE_DATA_SEC);
|
|
1307
1307
|
}
|
|
@@ -1322,7 +1322,7 @@ class WSAPI {
|
|
|
1322
1322
|
* console.log(result);
|
|
1323
1323
|
* });
|
|
1324
1324
|
* ```
|
|
1325
|
-
|
|
1325
|
+
*/
|
|
1326
1326
|
async getStoreItems() {
|
|
1327
1327
|
return OCache.use(onUpdateContextKey.StoreItems, ECacheContext.WSAPI, () => this.api.storeGetItemsT(null), CACHE_DATA_SEC);
|
|
1328
1328
|
}
|
|
@@ -1335,7 +1335,7 @@ class WSAPI {
|
|
|
1335
1335
|
* ```
|
|
1336
1336
|
*
|
|
1337
1337
|
* **Visitor mode: not supported**
|
|
1338
|
-
|
|
1338
|
+
*/
|
|
1339
1339
|
async buyStoreItem(item_id) {
|
|
1340
1340
|
const r = await this.api.buyStoreItem(null, item_id);
|
|
1341
1341
|
const o = {
|
|
@@ -1366,19 +1366,19 @@ class WSAPI {
|
|
|
1366
1366
|
return OCache.use(onUpdateContextKey.StoreCategories, ECacheContext.WSAPI, () => this.api.storeGetCategoriesT(null), CACHE_DATA_SEC);
|
|
1367
1367
|
}
|
|
1368
1368
|
/**
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1369
|
+
* Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
|
|
1370
|
+
* The maximum number of items per request is limited to 20.
|
|
1371
|
+
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
1372
|
+
*
|
|
1373
|
+
* **Example**:
|
|
1374
|
+
* ```
|
|
1375
|
+
* _smartico.api.getStorePurchasedItems().then((result) => {
|
|
1376
|
+
* console.log(result);
|
|
1377
|
+
* });
|
|
1378
|
+
* ```
|
|
1379
|
+
*
|
|
1380
|
+
* **Visitor mode: not supported**
|
|
1381
|
+
*/
|
|
1382
1382
|
async getStorePurchasedItems({
|
|
1383
1383
|
limit,
|
|
1384
1384
|
offset,
|
|
@@ -1411,23 +1411,23 @@ class WSAPI {
|
|
|
1411
1411
|
return OCache.use(onUpdateContextKey.AchCategories, ECacheContext.WSAPI, () => this.api.achGetCategoriesT(null), CACHE_DATA_SEC);
|
|
1412
1412
|
}
|
|
1413
1413
|
/**
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1414
|
+
* Returns list of custom sections
|
|
1415
|
+
*
|
|
1416
|
+
* **Example**:
|
|
1417
|
+
* ```
|
|
1418
|
+
* _smartico.api.getCustomSections().then((result) => {
|
|
1419
|
+
* console.log(result);
|
|
1420
|
+
* });
|
|
1421
|
+
* ```
|
|
1422
|
+
*
|
|
1423
|
+
* **Example in the Visitor mode**:
|
|
1424
|
+
* ```
|
|
1425
|
+
* _smartico.vapi('EN').getCustomSections().then((result) => {
|
|
1426
|
+
* console.log(result);
|
|
1427
|
+
* });
|
|
1428
|
+
* ```
|
|
1429
|
+
*
|
|
1430
|
+
* */
|
|
1431
1431
|
async getCustomSections() {
|
|
1432
1432
|
return OCache.use(onUpdateContextKey.CustomSections, ECacheContext.WSAPI, () => this.api.getCustomSectionsT(null), CACHE_DATA_SEC);
|
|
1433
1433
|
}
|
|
@@ -1463,7 +1463,7 @@ class WSAPI {
|
|
|
1463
1463
|
* Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
|
|
1464
1464
|
*
|
|
1465
1465
|
* **Visitor mode: not supported**
|
|
1466
|
-
|
|
1466
|
+
*/
|
|
1467
1467
|
async playMiniGame(template_id) {
|
|
1468
1468
|
const r = await this.api.sawSpinRequest(null, template_id);
|
|
1469
1469
|
this.api.doAcknowledgeRequest(null, r.request_id);
|
|
@@ -1478,7 +1478,7 @@ class WSAPI {
|
|
|
1478
1478
|
* Requests an opt-in for the specified mission_id. Returns the err_code.
|
|
1479
1479
|
*
|
|
1480
1480
|
* **Visitor mode: not supported**
|
|
1481
|
-
|
|
1481
|
+
*/
|
|
1482
1482
|
async requestMissionOptIn(mission_id) {
|
|
1483
1483
|
const r = await this.api.missionOptIn(null, mission_id);
|
|
1484
1484
|
const o = {
|
|
@@ -1491,7 +1491,7 @@ class WSAPI {
|
|
|
1491
1491
|
* Request for claim reward for the specified mission id. Returns the err_code.
|
|
1492
1492
|
*
|
|
1493
1493
|
* **Visitor mode: not supported**
|
|
1494
|
-
|
|
1494
|
+
*/
|
|
1495
1495
|
async requestMissionClaimReward(mission_id, ach_completed_id) {
|
|
1496
1496
|
const r = await this.api.missionClaimPrize(null, mission_id, ach_completed_id);
|
|
1497
1497
|
const o = {
|
|
@@ -1529,7 +1529,7 @@ class WSAPI {
|
|
|
1529
1529
|
/**
|
|
1530
1530
|
* Returns details information of specific tournament instance, the response will include tournament info and the leaderboard of players
|
|
1531
1531
|
*
|
|
1532
|
-
|
|
1532
|
+
* **Example**:
|
|
1533
1533
|
* ```
|
|
1534
1534
|
* _smartico.api.getTournamentsList().then((result) => {
|
|
1535
1535
|
* if (result.length > 0) {
|
|
@@ -1558,7 +1558,7 @@ class WSAPI {
|
|
|
1558
1558
|
* Requests registration for the specified tournament instance. Returns the err_code.
|
|
1559
1559
|
*
|
|
1560
1560
|
* **Visitor mode: not supported**
|
|
1561
|
-
|
|
1561
|
+
*/
|
|
1562
1562
|
async registerInTournament(tournamentInstanceId) {
|
|
1563
1563
|
const r = await this.api.registerInTournament(null, tournamentInstanceId);
|
|
1564
1564
|
const o = {
|
|
@@ -1589,17 +1589,17 @@ class WSAPI {
|
|
|
1589
1589
|
return OCache.use(onUpdateContextKey.LeaderBoards, ECacheContext.WSAPI, () => this.api.leaderboardsGetT(null, periodType, getPreviousPeriod), CACHE_DATA_SEC);
|
|
1590
1590
|
}
|
|
1591
1591
|
/** Returns inbox messages based on the provided parameters. "From" and "to" indicate the range of messages to be fetched.
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1592
|
+
* The maximum number of messages per request is limited to 20. An indicator "onlyFavorite" can be passed to get only messages marked as favorites.
|
|
1593
|
+
* You can leave this params empty and by default it will return list of messages ranging from 0 to 20.
|
|
1594
|
+
* This functions return list of messages without the body of the message.
|
|
1595
|
+
* 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.
|
|
1596
|
+
* All other action like mark as read, favorite, delete, etc. can be done using this message GUID.
|
|
1597
|
+
* 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.
|
|
1598
|
+
*
|
|
1599
|
+
* **Visitor mode: not supported**
|
|
1600
|
+
*
|
|
1601
|
+
* @param params
|
|
1602
|
+
*/
|
|
1603
1603
|
async getInboxMessages({
|
|
1604
1604
|
from,
|
|
1605
1605
|
to,
|
|
@@ -1613,9 +1613,9 @@ class WSAPI {
|
|
|
1613
1613
|
}
|
|
1614
1614
|
/**
|
|
1615
1615
|
* Returns the message body of the specified message guid.
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1616
|
+
*
|
|
1617
|
+
* **Visitor mode: not supported**
|
|
1618
|
+
*/
|
|
1619
1619
|
async getInboxMessageBody(messageGuid) {
|
|
1620
1620
|
return await this.api.getInboxMessageBodyT(messageGuid);
|
|
1621
1621
|
}
|
|
@@ -1635,7 +1635,7 @@ class WSAPI {
|
|
|
1635
1635
|
* Requests to mark all inbox messages as rea
|
|
1636
1636
|
*
|
|
1637
1637
|
* **Visitor mode: not supported**
|
|
1638
|
-
|
|
1638
|
+
*/
|
|
1639
1639
|
async markAllInboxMessagesAsRead() {
|
|
1640
1640
|
const r = await this.api.markAllInboxMessageRead(null);
|
|
1641
1641
|
return {
|
|
@@ -1681,7 +1681,7 @@ class WSAPI {
|
|
|
1681
1681
|
}
|
|
1682
1682
|
/**
|
|
1683
1683
|
* Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
|
|
1684
|
-
|
|
1684
|
+
*/
|
|
1685
1685
|
async getTranslations(lang_code) {
|
|
1686
1686
|
const r = await this.api.getTranslationsT(null, lang_code, []);
|
|
1687
1687
|
return {
|
|
@@ -1751,7 +1751,7 @@ class WSAPI {
|
|
|
1751
1751
|
* console.log(result);
|
|
1752
1752
|
* });
|
|
1753
1753
|
* ```
|
|
1754
|
-
|
|
1754
|
+
*/
|
|
1755
1755
|
async jackpotGet(filter) {
|
|
1756
1756
|
var _this = this;
|
|
1757
1757
|
const signature = `${filter == null ? void 0 : filter.jp_template_id}:${filter == null ? void 0 : filter.related_game_id}`;
|
|
@@ -1795,7 +1795,7 @@ class WSAPI {
|
|
|
1795
1795
|
*
|
|
1796
1796
|
* **Visitor mode: not supported**
|
|
1797
1797
|
*
|
|
1798
|
-
|
|
1798
|
+
*/
|
|
1799
1799
|
async jackpotOptIn(filter) {
|
|
1800
1800
|
if (!filter.jp_template_id) {
|
|
1801
1801
|
throw new Error('jp_template_id is required in jackpotOptIn');
|
|
@@ -1816,7 +1816,7 @@ class WSAPI {
|
|
|
1816
1816
|
*
|
|
1817
1817
|
* **Visitor mode: not supported**
|
|
1818
1818
|
*
|
|
1819
|
-
|
|
1819
|
+
*/
|
|
1820
1820
|
async jackpotOptOut(filter) {
|
|
1821
1821
|
if (!filter.jp_template_id) {
|
|
1822
1822
|
throw new Error('jp_template_id is required in jackpotOptOut');
|
|
@@ -1921,7 +1921,7 @@ const UICustomSectionTransform = items => {
|
|
|
1921
1921
|
const PUBLIC_API_URL = 'https://papi{ENV_ID}.smartico.ai/services/public';
|
|
1922
1922
|
const C_SOCKET_PROD = 'wss://api{ENV_ID}.smartico.ai/websocket/services';
|
|
1923
1923
|
const AVATAR_DOMAIN = 'https://img{ENV_ID}.smr.vc';
|
|
1924
|
-
const DEFAULT_LANG_EN =
|
|
1924
|
+
const DEFAULT_LANG_EN = 'EN';
|
|
1925
1925
|
class SmarticoAPI {
|
|
1926
1926
|
constructor(label_api_key, brand_api_key, messageSender, options = {}) {
|
|
1927
1927
|
var _options$tracker;
|