@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/src/IntUtils.ts
CHANGED
|
@@ -1,88 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
class IntUtils {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
now.getFullYear() === completedDate.getFullYear() &&
|
|
78
|
-
now.getMonth() === completedDate.getMonth()
|
|
79
|
-
);
|
|
80
|
-
default:
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
2
|
+
public static uuid(): string {
|
|
3
|
+
let a: any
|
|
4
|
+
let b: any
|
|
5
|
+
for (b = a = ''; a++ < 36; b += (a * 51) & 52 ? (a ^ 15 ? 8 ^ (Math.random() * (a ^ 20 ? 16 : 4)) : 4).toString(16) : '-') {}
|
|
6
|
+
return b
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
public static isNotNull(val: any): boolean {
|
|
10
|
+
return typeof val !== 'undefined' && val !== null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public static isNotEmpty(val: string): boolean {
|
|
14
|
+
return typeof val !== 'undefined' && val !== null && val.length > 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public static replaceAll(value: string, regex: string, replacement: string | number): string {
|
|
18
|
+
if (IntUtils.isNotNull(value)) {
|
|
19
|
+
return value.replace(new RegExp(IntUtils.escapeRegExp(regex), 'g'), replacement?.toString())
|
|
20
|
+
}
|
|
21
|
+
return value
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public static escapeRegExp(v: string): string {
|
|
25
|
+
if (IntUtils.isNotEmpty(v)) {
|
|
26
|
+
return v.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
27
|
+
}
|
|
28
|
+
return v
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public static JsonOrText = (str: string): any => {
|
|
32
|
+
if (str && str.includes && (str.includes('{') || str.includes('['))) {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(str)
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return str
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return str
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// public static wsTimeToEpoch = (time: string): number => {
|
|
43
|
+
// if (time) {
|
|
44
|
+
// return moment.utc(time, "DD/MM/YYYY HH:mm:ss").valueOf()
|
|
45
|
+
// } else {
|
|
46
|
+
// return null
|
|
47
|
+
// }
|
|
48
|
+
// }
|
|
49
|
+
|
|
50
|
+
public static isWithinPeriod = (timestamp: number, period: 'today' | 'thisWeek' | 'thisMonth'): boolean => {
|
|
51
|
+
const now = new Date()
|
|
52
|
+
const completedDate = new Date(timestamp)
|
|
53
|
+
|
|
54
|
+
switch (period) {
|
|
55
|
+
case 'today':
|
|
56
|
+
return now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth() && now.getDate() === completedDate.getDate()
|
|
57
|
+
case 'thisWeek':
|
|
58
|
+
const startOfWeek = new Date(now)
|
|
59
|
+
startOfWeek.setDate(now.getDate() - now.getDay())
|
|
60
|
+
startOfWeek.setHours(0, 0, 0, 0)
|
|
61
|
+
|
|
62
|
+
const endOfWeek = new Date(startOfWeek)
|
|
63
|
+
endOfWeek.setDate(startOfWeek.getDate() + 6)
|
|
64
|
+
endOfWeek.setHours(23, 59, 59, 999)
|
|
65
|
+
|
|
66
|
+
return completedDate >= startOfWeek && completedDate <= endOfWeek
|
|
67
|
+
case 'thisMonth':
|
|
68
|
+
return now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth()
|
|
69
|
+
default:
|
|
70
|
+
return false
|
|
71
|
+
}
|
|
72
|
+
}
|
|
84
73
|
}
|
|
85
74
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
export { IntUtils }
|
|
75
|
+
export { IntUtils }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
1
|
+
import { ProtocolMessage } from '../Base/ProtocolMessage'
|
|
2
2
|
|
|
3
|
-
export interface
|
|
4
|
-
|
|
3
|
+
export interface GetJackpotsPotsRequest extends ProtocolMessage {
|
|
4
|
+
jp_template_ids: number[]
|
|
5
5
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ProtocolResponse } from
|
|
2
|
-
import { JackpotPot } from
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
|
+
import { JackpotPot } from './JackpotPot'
|
|
3
3
|
|
|
4
4
|
export interface GetJackpotsPotsResponse extends ProtocolResponse {
|
|
5
|
-
|
|
6
|
-
items: JackpotPot[];
|
|
5
|
+
items: JackpotPot[]
|
|
7
6
|
}
|
|
8
|
-
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
1
|
+
import { ProtocolMessage } from '../Base/ProtocolMessage'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
related_game_id?: string;
|
|
7
|
-
jp_template_id?: number;
|
|
3
|
+
export interface GetJackpotsRequest extends ProtocolMessage {
|
|
4
|
+
related_game_id?: string
|
|
5
|
+
jp_template_id?: number
|
|
8
6
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { AchRelatedGame } from
|
|
2
|
-
import { ProtocolResponse } from
|
|
3
|
-
import { JackpotDetails } from
|
|
1
|
+
import { AchRelatedGame } from '../Base/AchRelatedGame'
|
|
2
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
3
|
+
import { JackpotDetails } from './JackpotDetails'
|
|
4
4
|
|
|
5
|
-
export interface
|
|
6
|
-
|
|
7
|
-
items: JackpotDetails[];
|
|
5
|
+
export interface GetJackpotsResponse extends ProtocolResponse {
|
|
6
|
+
items: JackpotDetails[]
|
|
8
7
|
}
|
|
9
|
-
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
1
|
interface JackPotWinner {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
/** Flag indicating that this winner is the currently logged in user */
|
|
3
|
+
is_me: boolean
|
|
4
|
+
/** Name of the winner, note that for all users except is_me, the name is masked by default, but masking can be disabled by request to Smartico AM team */
|
|
5
|
+
public_username: string // masked for all except "is_me"
|
|
6
|
+
/** Won amount in the Jackpot currency */
|
|
7
|
+
winning_amount_jp_currency: number
|
|
8
|
+
/** Won amount in the user Wallet currency */
|
|
9
|
+
winning_amount_wallet_currency: number
|
|
10
|
+
/** Position of the winner. Relevant for jackpots where there could be multiple winners */
|
|
11
|
+
winning_position: number
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
export { JackPotWinner }
|
|
14
|
+
export { JackPotWinner }
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { AchRelatedGame } from
|
|
2
|
-
import { JackpotContributionType } from
|
|
3
|
-
import { JackpotPot } from
|
|
4
|
-
import { JackpotPublicMeta } from
|
|
5
|
-
import { JackpotType } from
|
|
1
|
+
import { AchRelatedGame } from '../Base/AchRelatedGame'
|
|
2
|
+
import { JackpotContributionType } from './JackpotContributionType'
|
|
3
|
+
import { JackpotPot } from './JackpotPot'
|
|
4
|
+
import { JackpotPublicMeta } from './JackpotPublicMeta'
|
|
5
|
+
import { JackpotType } from './JackpotType'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* JackpotDetails the information about Jackpot template
|
|
9
9
|
* It also includes JackpotPot object that holds the current value of the jackpot
|
|
10
10
|
* Flag is_opted_in indicates if the current user is opted in to the jackpot
|
|
11
|
-
*/
|
|
11
|
+
*/
|
|
12
12
|
interface JackpotDetails {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
13
|
+
/** ID of the jackpot template */
|
|
14
|
+
jp_template_id: number
|
|
15
|
+
/** type of jackpot logic */
|
|
16
|
+
jp_type_id: JackpotType
|
|
17
|
+
/** UI information of jackpot, like name, description, etc. */
|
|
18
|
+
jp_public_meta: JackpotPublicMeta
|
|
19
|
+
/** base currency of the jackpot */
|
|
20
|
+
jp_currency: string
|
|
21
|
+
/** wallet currency of currently logged in user */
|
|
22
|
+
user_currency: string
|
|
23
|
+
/** list of related games that are eligible for the jackpot */
|
|
24
|
+
related_games?: AchRelatedGame[]
|
|
25
|
+
/** type of the user contribution to the jackpot */
|
|
26
|
+
contribution_type: JackpotContributionType
|
|
27
|
+
/** value of the user contribution. Fixed amount or percentage of bet depending on the contribution type */
|
|
28
|
+
contribution_value: number
|
|
29
|
+
/** information of current value of the jackpot */
|
|
30
|
+
pot: JackpotPot
|
|
31
|
+
/** indication if the current user is opted in to the jackpot */
|
|
32
|
+
is_opted_in: boolean
|
|
33
|
+
/** indicates whether all games are eligible for the jackpot */
|
|
34
|
+
ach_related_game_allow_all: boolean
|
|
35
|
+
/** The number of users who have opted in to participate in the jackpot */
|
|
36
|
+
registration_count: number
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export { JackpotDetails }
|
|
39
|
+
export { JackpotDetails }
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
1
|
interface JackpotPot {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
/** ID of the jackpot template */
|
|
3
|
+
jp_template_id: number
|
|
4
|
+
/** ID of the jackpot pot */
|
|
5
|
+
jp_pot_id: number
|
|
6
|
+
/** currency of the jackpot pot in the Jackput base currency */
|
|
7
|
+
current_pot_amount: number
|
|
8
|
+
/** currency of the jackpot pot in the user wallet currency */
|
|
9
|
+
current_pot_amount_user_currency: number
|
|
10
|
+
/** the date/time when this pot exploded */
|
|
11
|
+
explode_date_ts: number
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
export { JackpotPot }
|
|
14
|
+
export { JackpotPot }
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { JackpotHtmlTemplate } from './JackpotHtmlTemplate'
|
|
1
|
+
import { JackpotHtmlTemplate } from './JackpotHtmlTemplate'
|
|
2
2
|
interface JackpotPublicMeta {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
/** name of the jackpot */
|
|
4
|
+
name: string
|
|
5
|
+
/** description/rules of the jackpot */
|
|
6
|
+
description: string
|
|
7
|
+
/** image url of the jackpot */
|
|
8
|
+
image_url: string
|
|
9
|
+
/** HTML template for the winner of the jackpt */
|
|
10
|
+
winner_template: JackpotHtmlTemplate
|
|
11
|
+
/** HTML template for the not winner of the jackpot */
|
|
12
|
+
not_winner_template: JackpotHtmlTemplate
|
|
13
|
+
/** custom value of placeholder1 defined by operator and can be used in the HTML templates */
|
|
14
|
+
placeholder1: string
|
|
15
|
+
/** custom value of placeholder2 defined by operator and can be used in the HTML templates */
|
|
16
|
+
placeholder2: string
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export { JackpotPublicMeta }
|
|
19
|
+
export { JackpotPublicMeta }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
2
|
-
import { JackPotWinner } from
|
|
3
|
-
import { JackpotDetails } from
|
|
1
|
+
import { ProtocolMessage } from '../Base/ProtocolMessage'
|
|
2
|
+
import { JackPotWinner } from './JackPotWinner'
|
|
3
|
+
import { JackpotDetails } from './JackpotDetails'
|
|
4
4
|
|
|
5
5
|
export interface JackpotWinPush extends ProtocolMessage {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
jackpot: JackpotDetails
|
|
7
|
+
winners: JackPotWinner[]
|
|
8
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ProtocolResponse } from
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
2
|
|
|
3
|
-
export interface JackpotsOptoutResponse extends ProtocolResponse {
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
export interface JackpotsOptoutResponse extends ProtocolResponse {}
|
package/src/Jackpots/index.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export * from './GetJackpotsPotsRequest'
|
|
2
|
-
export * from './GetJackpotsPotsResponse'
|
|
3
|
-
export * from './GetJackpotsRequest'
|
|
4
|
-
export * from './GetJackpotsResponse'
|
|
5
|
-
export * from './JackPotWinner'
|
|
6
|
-
export * from './JackpotContributionType'
|
|
7
|
-
export * from './JackpotDetails'
|
|
8
|
-
export * from './JackpotPot'
|
|
9
|
-
export * from './JackpotPublicMeta'
|
|
10
|
-
export * from './JackpotType'
|
|
11
|
-
export * from './JackpotWinPush'
|
|
12
|
-
export * from './JackpotsOptinRequest'
|
|
13
|
-
export * from './JackpotsOptinResponse'
|
|
14
|
-
export * from './JackpotsOptoutRequest'
|
|
15
|
-
export * from './JackpotsOptoutResponse'
|
|
16
|
-
export * from './JackpotHtmlTemplate'
|
|
1
|
+
export * from './GetJackpotsPotsRequest'
|
|
2
|
+
export * from './GetJackpotsPotsResponse'
|
|
3
|
+
export * from './GetJackpotsRequest'
|
|
4
|
+
export * from './GetJackpotsResponse'
|
|
5
|
+
export * from './JackPotWinner'
|
|
6
|
+
export * from './JackpotContributionType'
|
|
7
|
+
export * from './JackpotDetails'
|
|
8
|
+
export * from './JackpotPot'
|
|
9
|
+
export * from './JackpotPublicMeta'
|
|
10
|
+
export * from './JackpotType'
|
|
11
|
+
export * from './JackpotWinPush'
|
|
12
|
+
export * from './JackpotsOptinRequest'
|
|
13
|
+
export * from './JackpotsOptinResponse'
|
|
14
|
+
export * from './JackpotsOptoutRequest'
|
|
15
|
+
export * from './JackpotsOptoutResponse'
|
|
16
|
+
export * from './JackpotHtmlTemplate'
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
2
|
-
import { LeaderBoardPeriodType } from
|
|
1
|
+
import { ProtocolMessage } from '../Base/ProtocolMessage'
|
|
2
|
+
import { LeaderBoardPeriodType } from './LeaderBoardPeriodType'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
include_users?: boolean;
|
|
4
|
+
export interface GetLeaderBoardsRequest extends ProtocolMessage {
|
|
5
|
+
// if not set will return all boards
|
|
6
|
+
period_type_id?: LeaderBoardPeriodType
|
|
7
|
+
// can be >=1, if set will return snapshot for the previous period (1), or period before previous (2) etc
|
|
8
|
+
snapshot_offset?: number
|
|
9
|
+
include_users?: boolean
|
|
11
10
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ProtocolResponse } from
|
|
2
|
-
import { LeaderBoardDetails } from
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
|
+
import { LeaderBoardDetails } from './LeaderBoardDetails'
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
map: { [key: string]: LeaderBoardDetails };
|
|
4
|
+
export interface GetLeaderBoardsResponse extends ProtocolResponse {
|
|
5
|
+
map: { [key: string]: LeaderBoardDetails }
|
|
7
6
|
}
|
|
8
|
-
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { LeaderBoardPeriodType } from
|
|
2
|
-
import { LeaderBoardPosition } from
|
|
3
|
-
import { LeaderBoardPublicMeta } from
|
|
1
|
+
import { LeaderBoardPeriodType } from './LeaderBoardPeriodType'
|
|
2
|
+
import { LeaderBoardPosition } from './LeaderBoardPosition'
|
|
3
|
+
import { LeaderBoardPublicMeta } from './LeaderBoardPublicMeta'
|
|
4
4
|
|
|
5
5
|
export interface LeaderBoardDetails {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
userPosition: LeaderBoardPosition;
|
|
6
|
+
board_id: number
|
|
7
|
+
period_type_id: LeaderBoardPeriodType
|
|
8
|
+
create_date?: number // 0 for the current
|
|
9
|
+
versiod_id: number // 0 for the current
|
|
10
|
+
reward_points: number[]
|
|
11
|
+
board_public_meta: LeaderBoardPublicMeta
|
|
12
|
+
positions: LeaderBoardPosition[]
|
|
13
|
+
userPosition: LeaderBoardPosition
|
|
15
14
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export interface LeaderBoardPosition {
|
|
2
|
+
public_username?: string
|
|
3
|
+
user_alt_name: string // TODO Need remove it in future
|
|
4
|
+
position_in_board: number
|
|
5
|
+
points_accumulated: number
|
|
6
|
+
is_me: boolean
|
|
7
|
+
level_id: number
|
|
8
|
+
avatar_id: string
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
position_in_board: number;
|
|
6
|
-
points_accumulated: number;
|
|
7
|
-
is_me: boolean;
|
|
8
|
-
level_id: number;
|
|
9
|
-
avatar_id: string;
|
|
10
|
-
|
|
11
|
-
avatar_url?: string;
|
|
12
|
-
}
|
|
10
|
+
avatar_url?: string
|
|
11
|
+
}
|