@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
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { LeaderBoardDetailsT, LeaderBoardUserT, LeaderBoardsRewardsT } from
|
|
2
|
-
import { LeaderBoardDetails } from
|
|
3
|
-
import { LeaderBoardPeriodType } from
|
|
4
|
-
import { LeaderBoardPosition } from
|
|
1
|
+
import { LeaderBoardDetailsT, LeaderBoardUserT, LeaderBoardsRewardsT } from '../WSAPI/WSAPITypes'
|
|
2
|
+
import { LeaderBoardDetails } from './LeaderBoardDetails'
|
|
3
|
+
import { LeaderBoardPeriodType } from './LeaderBoardPeriodType'
|
|
4
|
+
import { LeaderBoardPosition } from './LeaderBoardPosition'
|
|
5
5
|
|
|
6
6
|
const pointsRewardTransform = (reward_points: number[]): LeaderBoardsRewardsT[] => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
if (reward_points && reward_points.length) {
|
|
8
|
+
return reward_points.map((r, i) => ({ place: i + 1, points: r }))
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
return null
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const getLeaderBoardPlayerTransformed = (user: LeaderBoardPosition, isMe?: boolean): LeaderBoardUserT => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
if (user) {
|
|
16
|
+
const x: LeaderBoardUserT = {
|
|
17
|
+
public_username: user?.public_username || user.user_alt_name,
|
|
18
|
+
avatar_url: user.avatar_url,
|
|
19
|
+
position: user.position_in_board,
|
|
20
|
+
points: user.points_accumulated,
|
|
21
|
+
is_me: user.is_me,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (isMe) {
|
|
25
|
+
delete x.is_me
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return x
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return null
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export const getLeaderBoardTransform = (board: LeaderBoardDetails): LeaderBoardDetailsT => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
35
|
+
if (board) {
|
|
36
|
+
const x: LeaderBoardDetailsT = {
|
|
37
|
+
board_id: board.board_id,
|
|
38
|
+
name: board.board_public_meta.name,
|
|
39
|
+
description: board.board_public_meta.description,
|
|
40
|
+
rules: board.board_public_meta.rules,
|
|
41
|
+
period_type_id: board.period_type_id,
|
|
42
|
+
rewards: pointsRewardTransform(board.reward_points),
|
|
43
|
+
users: board.positions.map((p) => getLeaderBoardPlayerTransformed(p)),
|
|
44
|
+
me: getLeaderBoardPlayerTransformed(board.userPosition, true),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return x
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return null
|
|
51
|
+
}
|
package/src/Leaderboard/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from './GetLeaderBoardsRequest'
|
|
2
|
+
export * from './GetLeaderBoardsResponse'
|
|
3
|
+
export * from './LeaderBoardDetails'
|
|
4
|
+
export * from './LeaderBoardPeriodType'
|
|
5
|
+
export * from './LeaderBoardPosition'
|
|
6
|
+
export * from './LeaderBoardPublicMeta'
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import { IntUtils } from
|
|
2
|
-
import { ProtocolResponse } from
|
|
3
|
-
import { TLevel } from
|
|
4
|
-
import { Level } from
|
|
1
|
+
import { IntUtils } from '../IntUtils'
|
|
2
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
3
|
+
import { TLevel } from '../WSAPI/WSAPITypes'
|
|
4
|
+
import { Level } from './Level'
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
levels: Level[];
|
|
6
|
+
export interface GetLevelMapResponse extends ProtocolResponse {
|
|
7
|
+
levels: Level[]
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
|
|
12
10
|
export const GetLevelMapResponseTransform = (levels: GetLevelMapResponse): TLevel[] => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
11
|
+
return levels?.levels.map((l) => ({
|
|
12
|
+
id: l.level_id,
|
|
13
|
+
name: l.level_public_meta.name,
|
|
14
|
+
description: l.level_public_meta.description,
|
|
15
|
+
image: l.level_public_meta.image_url,
|
|
16
|
+
required_points: l.required_points,
|
|
17
|
+
visibility_points: l.level_public_meta.visibility_points ? parseInt(l.level_public_meta.visibility_points as any) : null,
|
|
18
|
+
required_level_counter_1: l.required_level_counter_1,
|
|
19
|
+
required_level_counter_2: l.required_level_counter_2,
|
|
20
|
+
custom_data: IntUtils.JsonOrText(l.level_public_meta?.custom_data),
|
|
21
|
+
}))
|
|
22
|
+
}
|
package/src/Level/Level.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { LevelPublicMeta } from
|
|
1
|
+
import { LevelPublicMeta } from './LevelPublicMeta'
|
|
2
2
|
|
|
3
3
|
export interface Level {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
general_level_progress: number;
|
|
4
|
+
level_id: number
|
|
5
|
+
level_public_meta: LevelPublicMeta
|
|
6
|
+
required_points: number
|
|
7
|
+
is_first_level: boolean
|
|
8
|
+
/** Internal status of level. Not in use right now on the front-end */
|
|
9
|
+
level_status_id: number
|
|
10
|
+
required_level_counter_1: number
|
|
11
|
+
required_level_counter_2: number
|
|
12
|
+
general_level_progress: number
|
|
14
13
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export interface LevelPublicMeta {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
/** Description of level, HTML capabable */
|
|
3
|
+
description?: string
|
|
4
|
+
/** URL to the image of level */
|
|
5
|
+
image_url?: string
|
|
6
|
+
/** Name of level */
|
|
7
|
+
name?: string
|
|
8
|
+
/** Number of points that user should have collected in order to see this level */
|
|
9
|
+
visibility_points?: number
|
|
10
|
+
/** X & Y coordinates of level on the visual mission map, for desktop and mobile */
|
|
11
|
+
position?: {
|
|
12
|
+
mx: number
|
|
13
|
+
my: number
|
|
14
|
+
dx: number
|
|
15
|
+
dy: number
|
|
16
|
+
}
|
|
17
|
+
/**custom data as string or JSON string that can be used in UIWidget */
|
|
18
|
+
custom_data: string
|
|
19
19
|
}
|
package/src/Level/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Level'
|
|
2
|
-
export * from './LevelPublicMeta'
|
|
3
|
-
export * from './GetLevelMapResponse'
|
|
1
|
+
export * from './Level'
|
|
2
|
+
export * from './LevelPublicMeta'
|
|
3
|
+
export * from './GetLevelMapResponse'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
2
|
-
|
|
1
|
+
import { ProtocolMessage } from 'src/Base/ProtocolMessage'
|
|
3
2
|
|
|
4
3
|
export interface SAWAcknowledgeSpinPushRequest extends ProtocolMessage {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
pending_message_id: number
|
|
5
|
+
saw_template_id: number
|
|
7
6
|
}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
/** @hidden */
|
|
2
2
|
export enum SAWBuyInType {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Free = 1,
|
|
4
|
+
Points = 2,
|
|
5
|
+
Spins = 3,
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export enum SAWBuyInTypeName {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
Free = 'free',
|
|
10
|
+
Points = 'points',
|
|
11
|
+
Spins = 'spins',
|
|
12
|
+
Unknown = 'unknown',
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/** @hidden */
|
|
16
16
|
export const SAWBuyInTypeNamed = (type: SAWBuyInType): SAWBuyInTypeName => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
17
|
+
return (
|
|
18
|
+
{
|
|
19
|
+
[SAWBuyInType.Free]: SAWBuyInTypeName.Free,
|
|
20
|
+
[SAWBuyInType.Points]: SAWBuyInTypeName.Points,
|
|
21
|
+
[SAWBuyInType.Spins]: SAWBuyInTypeName.Spins,
|
|
22
|
+
}[type] || SAWBuyInTypeName.Unknown
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ProtocolRequest } from
|
|
2
|
-
|
|
1
|
+
import { ProtocolRequest } from './../Base/ProtocolRequest'
|
|
3
2
|
|
|
4
3
|
export interface SAWDoSpinRequest extends ProtocolRequest {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
saw_template_id: number;
|
|
4
|
+
request_id: string // guid
|
|
5
|
+
saw_template_id: number
|
|
8
6
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ProtocolResponse } from
|
|
2
|
-
import { SAWSpinErrorCode } from
|
|
3
|
-
|
|
1
|
+
import { ProtocolResponse } from './../Base/ProtocolResponse'
|
|
2
|
+
import { SAWSpinErrorCode } from './SAWSpinErrorCode'
|
|
4
3
|
|
|
5
4
|
export interface SAWDoSpinResponse extends ProtocolResponse {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
5
|
+
errCode: SAWSpinErrorCode
|
|
6
|
+
errMsg?: string
|
|
7
|
+
request_id: string // guid
|
|
8
|
+
saw_prize_id: number
|
|
9
|
+
jackpot_amount?: number // jackpot amount in case user won jackpot type of prize
|
|
10
|
+
first_spin_in_period: number
|
|
11
|
+
visitor_win_uuid?: string
|
|
12
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
2
|
-
|
|
1
|
+
import { ProtocolMessage } from 'src/Base/ProtocolMessage'
|
|
3
2
|
|
|
4
3
|
export interface SAWEventSawPush extends ProtocolMessage {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
pending_message_id: number
|
|
5
|
+
saw_template_id: number
|
|
7
6
|
}
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
/** @hidden */
|
|
2
2
|
|
|
3
3
|
export enum SAWGameType {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
SpinAWheel = 1,
|
|
5
|
+
ScratchCard = 2,
|
|
6
|
+
MatchX = 3,
|
|
7
|
+
GiftBox = 4,
|
|
8
|
+
PrizeDrop = 5,
|
|
9
|
+
Quiz = 6,
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export enum SAWGameTypeName {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
SpinAWheel = 'wheel',
|
|
14
|
+
ScratchCard = 'scratch',
|
|
15
|
+
MatchX = 'matchx',
|
|
16
|
+
GiftBox = 'giftbox',
|
|
17
|
+
PrizeDrop = 'prizedrop',
|
|
18
|
+
Quiz = 'quiz',
|
|
19
|
+
Unknown = 'unknown',
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/** @hidden */
|
|
23
23
|
export const SAWGameTypeNamed = (type: SAWGameType): SAWGameTypeName => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
return (
|
|
25
|
+
{
|
|
26
|
+
[SAWGameType.SpinAWheel]: SAWGameTypeName.SpinAWheel,
|
|
27
|
+
[SAWGameType.ScratchCard]: SAWGameTypeName.ScratchCard,
|
|
28
|
+
[SAWGameType.MatchX]: SAWGameTypeName.MatchX,
|
|
29
|
+
[SAWGameType.GiftBox]: SAWGameTypeName.GiftBox,
|
|
30
|
+
[SAWGameType.PrizeDrop]: SAWGameTypeName.PrizeDrop,
|
|
31
|
+
[SAWGameType.Quiz]: SAWGameTypeName.Quiz,
|
|
32
|
+
}[type] || SAWGameTypeName.Unknown
|
|
33
|
+
)
|
|
32
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProtocolRequest } from
|
|
1
|
+
import { ProtocolRequest } from './../Base/ProtocolRequest'
|
|
2
2
|
|
|
3
3
|
export interface SAWGetTemplatesRequest extends ProtocolRequest {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
force_language?: string // request templates in the defined language instead of the language of the user
|
|
5
|
+
is_visitor_mode?: boolean // request templates only for visitors or for users or all.
|
|
6
6
|
}
|
|
@@ -1,70 +1,58 @@
|
|
|
1
|
-
import { IntUtils } from
|
|
2
|
-
import { TMiniGamePrize, TMiniGameTemplate } from
|
|
3
|
-
import { ProtocolResponse } from
|
|
4
|
-
import { SAWBuyInTypeNamed } from
|
|
5
|
-
import { SAWGameTypeNamed } from
|
|
6
|
-
import { MiniGamePrizeTypeName, MiniGamePrizeTypeNamed } from
|
|
7
|
-
import { SAWTemplate } from
|
|
8
|
-
import { SAWUtils } from
|
|
9
|
-
|
|
1
|
+
import { IntUtils } from '../IntUtils'
|
|
2
|
+
import { TMiniGamePrize, TMiniGameTemplate } from '../WSAPI/WSAPITypes'
|
|
3
|
+
import { ProtocolResponse } from './../Base/ProtocolResponse'
|
|
4
|
+
import { SAWBuyInTypeNamed } from './SAWBuyInType'
|
|
5
|
+
import { SAWGameTypeNamed } from './SAWGameType'
|
|
6
|
+
import { MiniGamePrizeTypeName, MiniGamePrizeTypeNamed } from './SAWPrizeType'
|
|
7
|
+
import { SAWTemplate } from './SAWTemplate'
|
|
8
|
+
import { SAWUtils } from './SAWUtils'
|
|
10
9
|
|
|
11
10
|
export interface SAWGetTemplatesResponse extends ProtocolResponse {
|
|
12
|
-
|
|
13
|
-
templates: SAWTemplate[];
|
|
11
|
+
templates: SAWTemplate[]
|
|
14
12
|
}
|
|
15
13
|
|
|
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
|
-
acknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,
|
|
61
|
-
pool: p.pool,
|
|
62
|
-
wins_count: p.wins_count,
|
|
63
|
-
}
|
|
64
|
-
return y;
|
|
65
|
-
})
|
|
66
|
-
};
|
|
67
|
-
return x;
|
|
68
|
-
});
|
|
14
|
+
export const SAWTemplatesTransform = (items: SAWTemplate[]): TMiniGameTemplate[] => {
|
|
15
|
+
return items.map((r) => {
|
|
16
|
+
const x: TMiniGameTemplate = {
|
|
17
|
+
id: r.saw_template_id,
|
|
18
|
+
name: r.saw_template_ui_definition.name,
|
|
19
|
+
description: r.saw_template_ui_definition.description,
|
|
20
|
+
thumbnail: r.saw_skin_ui_definition?.skin_folder ? r.saw_skin_ui_definition?.skin_folder + '/ico.png' : `https://libs.smartico.ai/gf/images/saw/${r.saw_skin_key}/ico.png`,
|
|
21
|
+
over_limit_message: r.saw_template_ui_definition.over_limit_message,
|
|
22
|
+
no_attempts_message: r.saw_template_ui_definition.no_attempts_message,
|
|
23
|
+
jackpot_symbol: r.saw_template_ui_definition.jackpot_symbol,
|
|
24
|
+
saw_game_type: SAWGameTypeNamed(r.saw_game_type_id),
|
|
25
|
+
saw_buyin_type: SAWBuyInTypeNamed(r.saw_buyin_type_id),
|
|
26
|
+
buyin_cost_points: r.buyin_cost_points,
|
|
27
|
+
jackpot_add_on_attempt: r.jackpot_add_on_attempt,
|
|
28
|
+
jackpot_current: r.jackpot_current,
|
|
29
|
+
spin_count: r.spin_count,
|
|
30
|
+
promo_image: r.saw_template_ui_definition.promo_image,
|
|
31
|
+
promo_text: r.saw_template_ui_definition.promo_text,
|
|
32
|
+
custom_data: IntUtils.JsonOrText(r.saw_template_ui_definition.custom_data),
|
|
33
|
+
expose_game_stat_on_api: r.expose_game_stat_on_api,
|
|
34
|
+
|
|
35
|
+
next_available_spin_ts: r.next_available_spin_ts,
|
|
36
|
+
|
|
37
|
+
prizes: r.prizes.map((p) => {
|
|
38
|
+
const y: TMiniGamePrize = {
|
|
39
|
+
id: p.saw_prize_id,
|
|
40
|
+
name: p.saw_prize_ui_definition.name,
|
|
41
|
+
prize_type: MiniGamePrizeTypeNamed(p.prize_type_id),
|
|
42
|
+
prize_value: p.prize_value,
|
|
43
|
+
font_size: p.saw_prize_ui_definition.font_size,
|
|
44
|
+
font_size_mobile: p.saw_prize_ui_definition.font_size_mobile,
|
|
45
|
+
icon: p.saw_prize_ui_definition.icon,
|
|
46
|
+
position: p.saw_prize_ui_definition.position,
|
|
47
|
+
aknowledge_message: p.saw_prize_ui_definition.aknowledge_message,
|
|
48
|
+
acknowledge_dp: p.saw_prize_ui_definition.acknowledge_dp,
|
|
49
|
+
acknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,
|
|
50
|
+
pool: p.pool,
|
|
51
|
+
wins_count: p.wins_count,
|
|
52
|
+
}
|
|
53
|
+
return y
|
|
54
|
+
}),
|
|
55
|
+
}
|
|
56
|
+
return x
|
|
57
|
+
})
|
|
69
58
|
}
|
|
70
|
-
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { SAWPrizeType } from
|
|
2
|
-
import { SAWPrizeUI } from
|
|
3
|
-
|
|
1
|
+
import { SAWPrizeType } from './SAWPrizeType'
|
|
2
|
+
import { SAWPrizeUI } from './SAWPrizeUI'
|
|
4
3
|
|
|
5
4
|
export interface SAWPrize {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
saw_prize_id: number
|
|
6
|
+
saw_prize_ui_definition: SAWPrizeUI
|
|
7
|
+
prize_value?: number
|
|
8
|
+
prize_type_id: SAWPrizeType
|
|
9
|
+
place_from?: number
|
|
10
|
+
place_to?: number
|
|
11
|
+
sawUniqueWinId?: string
|
|
12
|
+
pool?: number
|
|
13
|
+
wins_count?: number
|
|
15
14
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
1
|
+
import { ProtocolMessage } from '../Base/ProtocolMessage'
|
|
2
2
|
|
|
3
3
|
export interface SAWPrizeDropAknowledgeRequest extends ProtocolMessage {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
request_id: string // guid
|
|
5
|
+
pending_message_id: number
|
|
6
|
+
claim_required: boolean
|
|
7
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
2
|
-
import { SAWPrize } from
|
|
3
|
-
import { SAWTemplate } from
|
|
1
|
+
import { ProtocolMessage } from '.././Base/ProtocolMessage'
|
|
2
|
+
import { SAWPrize } from './SAWPrize'
|
|
3
|
+
import { SAWTemplate } from './SAWTemplate'
|
|
4
4
|
|
|
5
5
|
export interface SAWPrizeDropWinPush extends ProtocolMessage {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
saw_template: SAWTemplate
|
|
10
|
-
|
|
6
|
+
request_id: string // guid
|
|
7
|
+
saw_template_id: number
|
|
8
|
+
saw_prize: SAWPrize
|
|
9
|
+
saw_template: SAWTemplate
|
|
10
|
+
pending_message_id: number
|
|
11
|
+
}
|