@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,11 +1,11 @@
|
|
|
1
1
|
export enum BuyStoreItemErrorCode {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
2
|
+
FAILED_TO_BUY_SHOP_ITEM = 121,
|
|
3
|
+
SHOP_NO_BALANCE = 11000,
|
|
4
|
+
SHOP_WRONG_LABEL = 11001,
|
|
5
|
+
SHOP_FAILED_TO_BUY_BONUS = 11002, // remote product restriction
|
|
6
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003, // when not visible but trying to buy. Shoudnt happen
|
|
7
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004, // when visible but not matching to purchase segment
|
|
8
|
+
SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
|
|
9
|
+
SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006,
|
|
10
|
+
SHOP_FAILED_POOL_EMPTY = 11009,
|
|
11
|
+
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { ProtocolResponse } from
|
|
2
|
-
import { StoreCategory } from
|
|
3
|
-
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
|
+
import { StoreCategory } from './StoreCategory'
|
|
4
3
|
|
|
5
4
|
export interface GetCategoriesStoreResponse extends ProtocolResponse {
|
|
6
|
-
|
|
7
|
-
categories: StoreCategory[];
|
|
5
|
+
categories: StoreCategory[]
|
|
8
6
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProtocolMessage } from
|
|
1
|
+
import { ProtocolMessage } from '../Base/ProtocolMessage'
|
|
2
2
|
|
|
3
3
|
export interface GetStoreHistoryRequest extends ProtocolMessage {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
limit?: number
|
|
5
|
+
offset?: number
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ProtocolResponse } from
|
|
2
|
-
import { StoreItemPurchased } from
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
|
+
import { StoreItemPurchased } from './StoreItemPurchased'
|
|
3
3
|
|
|
4
4
|
export interface GetStoreHistoryResponse extends ProtocolResponse {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
items: StoreItemPurchased[]
|
|
6
|
+
hasMore?: boolean
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { StoreItem } from "./StoreItem";
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
|
+
import { StoreItem } from './StoreItem'
|
|
4
3
|
|
|
5
4
|
export interface GetStoreItemsResponse extends ProtocolResponse {
|
|
6
|
-
|
|
5
|
+
items: StoreItem[]
|
|
7
6
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { TStoreCategory } from
|
|
2
|
-
import { StoreCategoryPublicMeta } from
|
|
1
|
+
import { TStoreCategory } from '../WSAPI/WSAPITypes'
|
|
2
|
+
import { StoreCategoryPublicMeta } from './StoreCategoryPublicMeta'
|
|
3
3
|
|
|
4
4
|
export interface StoreCategory {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
publicMeta?: StoreCategoryPublicMeta;
|
|
5
|
+
id?: number
|
|
6
|
+
publicMeta?: StoreCategoryPublicMeta
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
export const StoreCategoryTransform = (items: StoreCategory[]): TStoreCategory[] => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
9
|
+
export const StoreCategoryTransform = (items: StoreCategory[]): TStoreCategory[] => {
|
|
10
|
+
return items.map((r) => {
|
|
11
|
+
const x: TStoreCategory = {
|
|
12
|
+
id: r.id,
|
|
13
|
+
name: r.publicMeta?.name,
|
|
14
|
+
order: r.publicMeta?.order,
|
|
15
|
+
}
|
|
16
|
+
return x
|
|
17
|
+
})
|
|
18
|
+
}
|
package/src/Store/StoreItem.ts
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import { TStoreItem } from
|
|
2
|
-
import { StoreItemPublicMeta } from
|
|
3
|
-
import { StoreItemType, StoreItemTypeNamed } from
|
|
1
|
+
import { TStoreItem } from '../WSAPI/WSAPITypes'
|
|
2
|
+
import { StoreItemPublicMeta } from './StoreItemPublicMeta'
|
|
3
|
+
import { StoreItemType, StoreItemTypeNamed } from './StoreItemType'
|
|
4
4
|
|
|
5
5
|
export interface StoreItem {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
id: number
|
|
7
|
+
itemTypeId: StoreItemType
|
|
8
|
+
itemPublicMeta: StoreItemPublicMeta
|
|
9
|
+
categoryIds?: number[]
|
|
10
|
+
canBuy?: boolean
|
|
11
|
+
shopPool: number
|
|
12
12
|
}
|
|
13
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
|
-
}
|
|
14
|
+
export const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {
|
|
15
|
+
return items
|
|
16
|
+
.filter((r) => r.id >= 1)
|
|
17
|
+
.map((r) => {
|
|
18
|
+
const x: TStoreItem = {
|
|
19
|
+
id: r.id,
|
|
20
|
+
name: r.itemPublicMeta.name,
|
|
21
|
+
price: r.itemPublicMeta.price as any as number, // AA: strange why it's string
|
|
22
|
+
image: r.itemPublicMeta.image_url,
|
|
23
|
+
description: r.itemPublicMeta.description,
|
|
24
|
+
ribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,
|
|
25
|
+
limit_message: r.itemPublicMeta.limit_message,
|
|
26
|
+
priority: r.itemPublicMeta.priority ?? 0,
|
|
27
|
+
related_item_ids: r.itemPublicMeta.related_items,
|
|
28
|
+
hint_text: r.itemPublicMeta.hint_text,
|
|
29
|
+
type: StoreItemTypeNamed(r.itemTypeId),
|
|
30
|
+
can_buy: r.canBuy,
|
|
31
|
+
category_ids: r.categoryIds ?? [],
|
|
32
|
+
pool: r.shopPool,
|
|
33
|
+
}
|
|
34
|
+
return x
|
|
35
|
+
})
|
|
36
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export interface StoreItemPublicMeta {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
price: string
|
|
3
|
+
image_url: string
|
|
4
|
+
name: string
|
|
5
|
+
description: string
|
|
6
|
+
label_tag: string
|
|
7
|
+
custom_label_tag?: string
|
|
8
|
+
limit_message: string
|
|
9
|
+
priority: number
|
|
10
|
+
related_items: number[]
|
|
11
|
+
hint_text: string
|
|
12
12
|
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { IntUtils } from
|
|
2
|
-
import { TStoreItem } from
|
|
3
|
-
import { StoreItem } from
|
|
4
|
-
import { StoreItemTypeNamed } from
|
|
1
|
+
import { IntUtils } from '../IntUtils'
|
|
2
|
+
import { TStoreItem } from '../WSAPI/WSAPITypes'
|
|
3
|
+
import { StoreItem } from './StoreItem'
|
|
4
|
+
import { StoreItemTypeNamed } from './StoreItemType'
|
|
5
5
|
|
|
6
6
|
interface StoreItemPurchased extends StoreItem {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
purchase_ts: number
|
|
8
|
+
purchase_points_amount: number
|
|
9
|
+
purchased_today?: boolean
|
|
10
|
+
purchased_this_week?: boolean
|
|
11
|
+
purchased_this_month?: boolean
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const StoreItemPurchasedTransform = (items: StoreItemPurchased[]): TStoreItem[] => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
export const StoreItemPurchasedTransform = (items: StoreItemPurchased[]): TStoreItem[] => {
|
|
15
|
+
return items
|
|
16
|
+
.filter((r) => r.id >= 1)
|
|
17
|
+
.map((r) => {
|
|
18
|
+
const purchasedToday = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'today') : false
|
|
19
|
+
const purchasedThisWeek = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisWeek') : false
|
|
20
|
+
const purchasedThisMonth = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisMonth') : false
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return x;
|
|
44
|
-
});
|
|
22
|
+
const x: TStoreItem = {
|
|
23
|
+
id: r.id,
|
|
24
|
+
name: r.itemPublicMeta.name,
|
|
25
|
+
price: r.itemPublicMeta.price as any as number, // AA: strange why it's string
|
|
26
|
+
image: r.itemPublicMeta.image_url,
|
|
27
|
+
description: r.itemPublicMeta.description,
|
|
28
|
+
ribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,
|
|
29
|
+
limit_message: r.itemPublicMeta.limit_message,
|
|
30
|
+
priority: r.itemPublicMeta.priority ?? 0,
|
|
31
|
+
related_item_ids: r.itemPublicMeta.related_items,
|
|
32
|
+
hint_text: r.itemPublicMeta.hint_text,
|
|
33
|
+
type: StoreItemTypeNamed(r.itemTypeId),
|
|
34
|
+
can_buy: r.canBuy,
|
|
35
|
+
category_ids: r.categoryIds ?? [],
|
|
36
|
+
pool: r.shopPool,
|
|
37
|
+
purchase_ts: r.purchase_ts,
|
|
38
|
+
purchase_points_amount: r.purchase_points_amount,
|
|
39
|
+
purchased_today: purchasedToday,
|
|
40
|
+
purchased_this_week: purchasedThisWeek,
|
|
41
|
+
purchased_this_month: purchasedThisMonth,
|
|
42
|
+
}
|
|
45
43
|
|
|
44
|
+
return x
|
|
45
|
+
})
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export { StoreItemPurchased }
|
|
48
|
+
export { StoreItemPurchased }
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
export enum StoreItemType {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Bonus = 1,
|
|
3
|
+
Tangible = 2,
|
|
4
|
+
MiniGameSpin = 3,
|
|
5
|
+
ChangeLevel = 4,
|
|
6
|
+
PrizeDrop = 5,
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export enum StoreItemTypeName {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
Bonus = 'bonus',
|
|
11
|
+
Tangible = 'tangible',
|
|
12
|
+
MiniGameSpin = 'minigamespin',
|
|
13
|
+
ChangeLevel = 'changelevel',
|
|
14
|
+
PrizeDrop = 'prizedrop',
|
|
15
|
+
Unknown = 'unknown',
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export const StoreItemTypeNamed = (type: StoreItemType): StoreItemTypeName => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
return (
|
|
20
|
+
{
|
|
21
|
+
[StoreItemType.Bonus]: StoreItemTypeName.Bonus,
|
|
22
|
+
[StoreItemType.Tangible]: StoreItemTypeName.Bonus,
|
|
23
|
+
[StoreItemType.MiniGameSpin]: StoreItemTypeName.MiniGameSpin,
|
|
24
|
+
[StoreItemType.ChangeLevel]: StoreItemTypeName.ChangeLevel,
|
|
25
|
+
[StoreItemType.PrizeDrop]: StoreItemTypeName.PrizeDrop,
|
|
26
|
+
}[type] || StoreItemTypeName.Unknown
|
|
27
|
+
)
|
|
26
28
|
}
|
|
27
|
-
|
package/src/Store/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from './StoreItemPurchased'
|
|
12
|
-
export * from './GetStoreHistoryRequest'
|
|
13
|
-
export * from './GetStoreHistoryResponse'
|
|
1
|
+
export * from './BuyStoreItemErrorCode'
|
|
2
|
+
export * from './BuyStoreItemRequest'
|
|
3
|
+
export * from './BuyStoreItemResponse'
|
|
4
|
+
export * from './GetCategoriesStoreResponse'
|
|
5
|
+
export * from './GetStoreItemsResponse'
|
|
6
|
+
export * from './StoreCategory'
|
|
7
|
+
export * from './StoreCategoryPublicMeta'
|
|
8
|
+
export * from './StoreItem'
|
|
9
|
+
export * from './StoreItemPublicMeta'
|
|
10
|
+
export * from './StoreItemType'
|
|
11
|
+
export * from './StoreItemPurchased'
|
|
12
|
+
export * from './GetStoreHistoryRequest'
|
|
13
|
+
export * from './GetStoreHistoryResponse'
|
|
@@ -1,54 +1,51 @@
|
|
|
1
|
-
import {Tournament, TournamentItemsTransform} from
|
|
2
|
-
import {TournamentPlayer} from
|
|
3
|
-
import { ProtocolResponse } from
|
|
4
|
-
import { TournamentPrize } from
|
|
5
|
-
import { TTournamentDetailed } from
|
|
6
|
-
import { TournamentUtils } from
|
|
1
|
+
import { Tournament, TournamentItemsTransform } from './Tournament'
|
|
2
|
+
import { TournamentPlayer } from './TournamentPlayer'
|
|
3
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
4
|
+
import { TournamentPrize } from './TournamentPrize'
|
|
5
|
+
import { TTournamentDetailed } from '../WSAPI/WSAPITypes'
|
|
6
|
+
import { TournamentUtils } from './TournamentUtils'
|
|
7
7
|
|
|
8
8
|
export interface GetTournamentInfoResponse extends ProtocolResponse {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
9
|
+
/** tournament info */
|
|
10
|
+
tournamentInfo: {
|
|
11
|
+
/** id of label, not in use */
|
|
12
|
+
labelId: number
|
|
13
|
+
tournamentLobbyInfo: Tournament
|
|
14
|
+
/** list of registered users */
|
|
15
|
+
players: TournamentPlayer[]
|
|
16
|
+
}
|
|
17
|
+
/** information about current user position */
|
|
18
|
+
userPosition: TournamentPlayer
|
|
19
|
+
/** prizes structure */
|
|
20
|
+
prizeStructure?: {
|
|
21
|
+
prizes: TournamentPrize[]
|
|
22
|
+
}
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
export const tournamentInfoItemTransform = (t: GetTournamentInfoResponse): TTournamentDetailed => {
|
|
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
|
-
|
|
26
|
+
const response: TTournamentDetailed = {
|
|
27
|
+
...TournamentItemsTransform([t.tournamentInfo.tournamentLobbyInfo])[0],
|
|
28
|
+
related_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map((g) => ({
|
|
29
|
+
ext_game_id: g.ext_game_id,
|
|
30
|
+
game_public_meta: {
|
|
31
|
+
name: g.game_public_meta.name,
|
|
32
|
+
link: g.game_public_meta.link,
|
|
33
|
+
image: g.game_public_meta.image,
|
|
34
|
+
enabled: g.game_public_meta.enabled,
|
|
35
|
+
game_categories: g.game_public_meta.game_categories,
|
|
36
|
+
game_provider: g.game_public_meta.game_provider,
|
|
37
|
+
},
|
|
38
|
+
})),
|
|
39
|
+
players: t.tournamentInfo.players.map((p) => TournamentUtils.getPlayerTransformed(p)),
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (t.prizeStructure) {
|
|
43
|
+
response.prizes = t.prizeStructure.prizes.map((p) => TournamentUtils.getPrizeTransformed(p))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (t.userPosition) {
|
|
47
|
+
response.me = TournamentUtils.getPlayerTransformed(t.userPosition, true)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return response
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { ProtocolResponse } from
|
|
2
|
-
import {Tournament} from
|
|
3
|
-
import { TournamentRegistrationStatus } from
|
|
4
|
-
import { TournamentRegistrationType } from
|
|
5
|
-
import { TournamentUtils } from
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
|
+
import { Tournament } from './Tournament'
|
|
3
|
+
import { TournamentRegistrationStatus } from './TournamentRegistrationStatus'
|
|
4
|
+
import { TournamentRegistrationType } from './TournamentRegistrationType'
|
|
5
|
+
import { TournamentUtils } from './TournamentUtils'
|
|
6
6
|
|
|
7
7
|
export interface GetTournamentsResponse extends ProtocolResponse {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
tournaments?: Tournament[];
|
|
8
|
+
/** array of the tournaments */
|
|
9
|
+
tournaments?: Tournament[]
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|