@smartico/public-api 0.0.158 → 0.0.159
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 +10 -10
- package/dist/Bonuses/Bonus.d.ts +20 -0
- package/dist/Bonuses/BonusMetaMap.d.ts +3 -0
- package/dist/Bonuses/BonusStatus.d.ts +8 -0
- package/dist/Bonuses/BonusTemplateMetaMap.d.ts +5 -0
- package/dist/Bonuses/ClaimBonusRequest.d.ts +4 -0
- package/dist/Bonuses/ClaimBonusResponse.d.ts +4 -0
- package/dist/Bonuses/GetBonusesRequest.d.ts +3 -0
- package/dist/Bonuses/GetBonusesResponse.d.ts +5 -0
- package/dist/Bonuses/index.d.ts +7 -0
- package/dist/SmarticoAPI.d.ts +5 -1
- package/dist/SmarticoLib/index.d.ts +58 -2
- package/dist/WSAPI/WSAPI.d.ts +18 -3
- package/dist/WSAPI/WSAPITypes.d.ts +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +253 -147
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +71 -2
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +2 -0
- package/docs/classes/WSAPI.md +109 -72
- package/docs/interfaces/TBonus.md +65 -0
- package/docs/interfaces/TClaimBonusResult.md +27 -0
- package/docs/interfaces/TInboxMessageBody.md +2 -2
- package/docs/interfaces/TLevel.md +2 -2
- package/docs/interfaces/TMissionOrBadgeTask.md +1 -10
- package/docs/interfaces/TTournament.md +1 -1
- package/docs/interfaces/TTournamentDetailed.md +2 -2
- package/docs/interfaces/TUserProfile.md +2 -2
- package/package.json +41 -41
- package/src/Base/AchRelatedGame.ts +10 -10
- package/src/Base/ProtocolMessage.ts +4 -4
- package/src/Base/ProtocolRequest.ts +4 -4
- package/src/Base/ProtocolResponse.ts +3 -3
- package/src/Bonuses/Bonus.ts +40 -0
- package/src/Bonuses/BonusMetaMap.ts +3 -0
- package/src/Bonuses/BonusStatus.ts +8 -0
- package/src/Bonuses/BonusTemplateMetaMap.ts +6 -0
- package/src/Bonuses/ClaimBonusRequest.ts +5 -0
- package/src/Bonuses/ClaimBonusResponse.ts +5 -0
- package/src/Bonuses/GetBonusesRequest.ts +3 -0
- package/src/Bonuses/GetBonusesResponse.ts +6 -0
- package/src/Bonuses/index.ts +7 -0
- package/src/CookieStore.ts +6 -6
- package/src/Core/CheckSegmentMatchRequest.ts +2 -2
- package/src/Core/CheckSegmentMatchResponse.ts +4 -4
- package/src/Core/CoreUtils.ts +12 -7
- package/src/Core/GetAchievementsUserInfoRequest.ts +1 -1
- package/src/Core/GetAchievementsUserInfoResponse.ts +3 -3
- package/src/Core/GetLabelInfoRequest.ts +1 -1
- package/src/Core/GetLabelInfoResponse.ts +3 -3
- package/src/Core/GetTranslationsRequest.ts +5 -5
- package/src/Core/GetTranslationsResponse.ts +3 -3
- package/src/Core/PublicProperties.ts +7 -7
- package/src/Core/ResponseIdentify.ts +10 -10
- package/src/Core/TranslationArea.ts +1 -1
- package/src/Core/index.ts +9 -9
- package/src/CustomSections/GetCustomSectionsRequest.ts +1 -1
- package/src/CustomSections/GetCustomSectionsResponse.ts +3 -3
- package/src/CustomSections/UICustomSection.ts +21 -16
- package/src/CustomSections/index.ts +4 -4
- package/src/ErrorCodes.ts +2 -2
- package/src/GResponse.ts +5 -5
- package/src/ILogger.ts +5 -5
- package/src/Inbox/GetInboxMessagesRequest.ts +4 -4
- package/src/Inbox/GetInboxMessagesResponse.ts +8 -8
- package/src/Inbox/InboxMessage.ts +20 -20
- package/src/Inbox/MarkInboxMessageDeletedRequest.ts +3 -3
- package/src/Inbox/MarkInboxMessageDeletedResponse.ts +3 -3
- package/src/Inbox/MarkInboxMessageReadRequest.ts +3 -3
- package/src/Inbox/MarkInboxMessageReadResponse.ts +3 -3
- package/src/Inbox/MarkInboxMessageStarredRequest.ts +3 -3
- package/src/Inbox/MarkInboxMessageStarredResponse.ts +3 -3
- package/src/Inbox/index.ts +10 -10
- package/src/IntUtils.ts +36 -28
- package/src/Jackpots/GetJackpotsPotsRequest.ts +2 -2
- package/src/Jackpots/GetJackpotsPotsResponse.ts +3 -3
- package/src/Jackpots/GetJackpotsRequest.ts +3 -3
- package/src/Jackpots/GetJackpotsResponse.ts +4 -4
- package/src/Jackpots/JackPotWinner.ts +6 -6
- package/src/Jackpots/JackpotContributionType.ts +1 -1
- package/src/Jackpots/JackpotDetails.ts +18 -18
- package/src/Jackpots/JackpotHtmlTemplate.ts +3 -3
- package/src/Jackpots/JackpotPot.ts +6 -6
- package/src/Jackpots/JackpotPublicMeta.ts +9 -9
- package/src/Jackpots/JackpotType.ts +1 -1
- package/src/Jackpots/JackpotWinPush.ts +5 -5
- package/src/Jackpots/JackpotsOptinRequest.ts +2 -2
- package/src/Jackpots/JackpotsOptinResponse.ts +1 -1
- package/src/Jackpots/JackpotsOptoutRequest.ts +2 -2
- package/src/Jackpots/JackpotsOptoutResponse.ts +1 -1
- package/src/Jackpots/index.ts +16 -16
- package/src/Leaderboard/GetLeaderBoardsRequest.ts +5 -5
- package/src/Leaderboard/GetLeaderBoardsResponse.ts +3 -3
- package/src/Leaderboard/LeaderBoardDetails.ts +11 -11
- package/src/Leaderboard/LeaderBoardPosition.ts +8 -8
- package/src/Leaderboard/LeaderBoardPublicMeta.ts +3 -3
- package/src/Leaderboard/LeaderBoards.ts +16 -16
- package/src/Leaderboard/index.ts +6 -6
- package/src/Level/GetLevelMapResponse.ts +7 -7
- package/src/Level/Level.ts +9 -9
- package/src/Level/LevelPublicMeta.ts +10 -10
- package/src/Level/index.ts +3 -3
- package/src/MiniGames/SAWAcknowledgeSpinPushRequest.ts +3 -3
- package/src/MiniGames/SAWBuyInType.ts +2 -2
- package/src/MiniGames/SAWDoAknowledgeRequest.ts +2 -2
- package/src/MiniGames/SAWDoAknowledgeResponse.ts +2 -2
- package/src/MiniGames/SAWDoSpinRequest.ts +3 -3
- package/src/MiniGames/SAWDoSpinResponse.ts +9 -9
- package/src/MiniGames/SAWEventSawPush.ts +3 -3
- package/src/MiniGames/SAWGameType.ts +2 -2
- package/src/MiniGames/SAWGetTemplatesRequest.ts +3 -3
- package/src/MiniGames/SAWGetTemplatesResponse.ts +18 -16
- package/src/MiniGames/SAWPrize.ts +11 -11
- package/src/MiniGames/SAWPrizeDropAknowledgeRequest.ts +4 -4
- package/src/MiniGames/SAWPrizeDropAknowledgeResponse.ts +2 -2
- package/src/MiniGames/SAWPrizeDropWinPush.ts +8 -8
- package/src/MiniGames/SAWPrizeType.ts +2 -2
- package/src/MiniGames/SAWPrizeUI.ts +16 -16
- package/src/MiniGames/SAWSpinsCountPush.ts +3 -3
- package/src/MiniGames/SAWTemplate.ts +26 -26
- package/src/MiniGames/SAWTemplateUI.ts +42 -42
- package/src/MiniGames/SAWUtils.ts +10 -10
- package/src/MiniGames/SAWWinSoundType.ts +1 -1
- package/src/MiniGames/index.ts +24 -24
- package/src/Missions/AchCategoryPublicMeta.ts +2 -2
- package/src/Missions/AchClaimPrizeRequest.ts +3 -3
- package/src/Missions/AchClaimPrizeResponse.ts +1 -1
- package/src/Missions/AchievementCategory.ts +8 -8
- package/src/Missions/AchievementOptinRequest.ts +2 -2
- package/src/Missions/AchievementOptinResponse.ts +1 -1
- package/src/Missions/AchievementPublicMeta.ts +19 -19
- package/src/Missions/AchievementTaskPublicMeta.ts +2 -2
- package/src/Missions/GetAchCategoriesRequest.ts +1 -1
- package/src/Missions/GetAchCategoriesResponse.ts +3 -3
- package/src/Missions/GetAchievementMapRequest.ts +1 -1
- package/src/Missions/GetAchievementMapResponse.ts +3 -3
- package/src/Missions/GetRelatedAchTourRequest.ts +2 -2
- package/src/Missions/GetRelatedAchTourResponse.ts +5 -5
- package/src/Missions/ReloadAchievementsEvent.ts +3 -3
- package/src/Missions/UserAchievement.ts +47 -46
- package/src/Missions/UserAchievementTask.ts +13 -13
- package/src/Missions/index.ts +19 -19
- package/src/NodeCache.ts +12 -12
- package/src/OCache.ts +22 -22
- package/src/Quiz/MarketsAnswers.ts +9 -9
- package/src/Quiz/MarketsInfo.ts +62 -23
- package/src/Quiz/MarketsPerSport.ts +11 -4
- package/src/Quiz/ScoreResultTypes.ts +22 -22
- package/src/Quiz/SportTypes.ts +1 -1
- package/src/Quiz/index.ts +6 -6
- package/src/SmarticoAPI.ts +556 -303
- package/src/SmarticoLib/index.ts +956 -840
- package/src/Store/BuyStoreItemRequest.ts +2 -2
- package/src/Store/BuyStoreItemResponse.ts +2 -2
- package/src/Store/GetCategoriesStoreResponse.ts +3 -3
- package/src/Store/GetStoreHistoryRequest.ts +3 -3
- package/src/Store/GetStoreHistoryResponse.ts +4 -4
- package/src/Store/GetStoreItemsResponse.ts +3 -3
- package/src/Store/StoreCategory.ts +8 -8
- package/src/Store/StoreCategoryPublicMeta.ts +2 -2
- package/src/Store/StoreItem.ts +13 -13
- package/src/Store/StoreItemPublicMeta.ts +10 -10
- package/src/Store/StoreItemPurchased.ts +17 -17
- package/src/Store/StoreItemType.ts +2 -2
- package/src/Store/index.ts +13 -13
- package/src/Tournaments/GetTournamentInfoRequest.ts +2 -2
- package/src/Tournaments/GetTournamentInfoResponse.ts +18 -18
- package/src/Tournaments/GetTournamentsRequest.ts +1 -1
- package/src/Tournaments/GetTournamentsResponse.ts +6 -6
- package/src/Tournaments/Tournament.ts +43 -39
- package/src/Tournaments/TournamentInstanceStatus.ts +2 -2
- package/src/Tournaments/TournamentPlayer.ts +7 -7
- package/src/Tournaments/TournamentPrize.ts +8 -8
- package/src/Tournaments/TournamentPublicMeta.ts +16 -16
- package/src/Tournaments/TournamentRegisterRequest.ts +2 -2
- package/src/Tournaments/TournamentRegisterResponse.ts +3 -3
- package/src/Tournaments/TournamentRegistrationStatus.ts +6 -4
- package/src/Tournaments/TournamentRegistrationType.ts +9 -3
- package/src/Tournaments/TournamentUtils.ts +44 -38
- package/src/Tournaments/index.ts +16 -16
- package/src/WSAPI/WSAPI.ts +244 -132
- package/src/WSAPI/WSAPITypes.ts +283 -250
- package/src/index.ts +16 -15
- package/tsconfig.json +41 -43
package/.prettierrc
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"arrowParens": "always",
|
|
3
|
+
"bracketSpacing": true,
|
|
4
|
+
"endOfLine": "lf",
|
|
5
|
+
"quoteProps": "consistent",
|
|
6
|
+
"semi": true,
|
|
7
|
+
"singleQuote": true,
|
|
8
|
+
"tabWidth": 4,
|
|
9
|
+
"printWidth": 130,
|
|
10
|
+
"useTabs": true,
|
|
11
|
+
"trailingComma": "all"
|
|
12
12
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BonusStatus } from './BonusStatus';
|
|
2
|
+
import { BonusTemplateMetaMap } from './BonusTemplateMetaMap';
|
|
3
|
+
import { BonusMetaMap } from './BonusMetaMap';
|
|
4
|
+
import { TBonus } from '../WSAPI/WSAPITypes';
|
|
5
|
+
export interface Bonus {
|
|
6
|
+
id: number;
|
|
7
|
+
redeemable?: boolean;
|
|
8
|
+
createDate?: string;
|
|
9
|
+
updateDate?: string;
|
|
10
|
+
redeemDate?: string;
|
|
11
|
+
engagementUid?: string;
|
|
12
|
+
labelBonusTemplateId?: number;
|
|
13
|
+
sourceProductRefId?: number;
|
|
14
|
+
sourceProductId?: number;
|
|
15
|
+
userId?: number;
|
|
16
|
+
bonusStatusId?: BonusStatus;
|
|
17
|
+
labelBonusTemplateMetaMap?: BonusTemplateMetaMap;
|
|
18
|
+
bonusMetaMap?: BonusMetaMap;
|
|
19
|
+
}
|
|
20
|
+
export declare const BonusItemsTransform: (items: Bonus[]) => TBonus[];
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -11,10 +11,11 @@ import { GetTournamentInfoResponse, GetTournamentsResponse, TournamentRegisterRe
|
|
|
11
11
|
import { LeaderBoardDetails, LeaderBoardPeriodType } from './Leaderboard';
|
|
12
12
|
import { GetLevelMapResponse } from './Level';
|
|
13
13
|
import { WSAPI } from './WSAPI/WSAPI';
|
|
14
|
-
import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed, LeaderBoardDetailsT, UserLevelExtraCountersT, TSegmentCheckResult, TUICustomSection } from './WSAPI/WSAPITypes';
|
|
14
|
+
import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed, LeaderBoardDetailsT, UserLevelExtraCountersT, TSegmentCheckResult, TUICustomSection, TBonus } from './WSAPI/WSAPITypes';
|
|
15
15
|
import { GetAchievementsUserInfoResponse } from './Core/GetAchievementsUserInfoResponse';
|
|
16
16
|
import { GetJackpotsPotsResponse, GetJackpotsResponse, JackpotsOptinResponse, JackpotsOptoutResponse } from './Jackpots';
|
|
17
17
|
import { GetCustomSectionsResponse } from './CustomSections';
|
|
18
|
+
import { ClaimBonusResponse, GetBonusesResponse } from './Bonuses';
|
|
18
19
|
interface Tracker {
|
|
19
20
|
label_api_key: string;
|
|
20
21
|
userPublicProps: any;
|
|
@@ -93,6 +94,9 @@ declare class SmarticoAPI {
|
|
|
93
94
|
achGetCategories(user_ext_id: string, force_language?: string): Promise<GetAchCategoriesResponse>;
|
|
94
95
|
achGetCategoriesT(user_ext_id: string): Promise<TAchCategory[]>;
|
|
95
96
|
badgetsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse>;
|
|
97
|
+
bonusesGetItems(user_ext_id: string, force_language?: string): Promise<GetBonusesResponse>;
|
|
98
|
+
bonusClaimItem(user_ext_id: string, bonus_id: number): Promise<ClaimBonusResponse>;
|
|
99
|
+
bonusesGetItemsT(user_ext_id: string): Promise<TBonus[]>;
|
|
96
100
|
badgetsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]>;
|
|
97
101
|
tournamentsGetLobby(user_ext_id: string, force_language?: string): Promise<GetTournamentsResponse>;
|
|
98
102
|
tournamentsGetLobbyT(user_ext_id: string): Promise<TTournament[]>;
|
|
@@ -1103,6 +1103,60 @@ export interface TMissionOrBadge {
|
|
|
1103
1103
|
/** The date/timestamp indicating when the prize was claimed by the user */
|
|
1104
1104
|
prize_claimed_date_ts?: number;
|
|
1105
1105
|
}
|
|
1106
|
+
export declare enum BonusStatus {
|
|
1107
|
+
/** The bonus is newly created (shouldn't be shown to the client) */
|
|
1108
|
+
New = 1,
|
|
1109
|
+
/** The bonus is issued and available for redemption but has not been redeemed yet */
|
|
1110
|
+
COUPON_ISSUED = 2,
|
|
1111
|
+
/** The bonus has been successfully redeemed */
|
|
1112
|
+
REDEEMED = 3,
|
|
1113
|
+
/** The bonus is still valid, but a previous redemption attempt failed */
|
|
1114
|
+
REDEEM_FAILED = 4,
|
|
1115
|
+
/** Failed to issue the bonus (shouldn't be shown to the client) */
|
|
1116
|
+
COUPON_ISSUE_FAILED = 5,
|
|
1117
|
+
/** The bonus was issued but has expired and can no longer be redeemed (shouldn't be shown to the client) */
|
|
1118
|
+
EXPIRED = 6
|
|
1119
|
+
}
|
|
1120
|
+
export interface BonusTemplateMetaMap {
|
|
1121
|
+
/** Description of the bonus template*/
|
|
1122
|
+
description: string;
|
|
1123
|
+
/** Acknowledge message setup in the bonus template*/
|
|
1124
|
+
acknowledge: string;
|
|
1125
|
+
/** Image URL of the bonus template*/
|
|
1126
|
+
image_url: string;
|
|
1127
|
+
}
|
|
1128
|
+
export interface BonusMetaMap {
|
|
1129
|
+
/** Label and description of the bonus sent to the player*/
|
|
1130
|
+
uiAmount?: string;
|
|
1131
|
+
}
|
|
1132
|
+
export interface TBonus {
|
|
1133
|
+
/** ID of the bonus */
|
|
1134
|
+
bonus_id: number;
|
|
1135
|
+
/** Can the bonus be redeemed (if bonus is redeemable the user needs to claim it) */
|
|
1136
|
+
is_redeemable?: boolean;
|
|
1137
|
+
/** Date of creation */
|
|
1138
|
+
create_date?: string;
|
|
1139
|
+
/** Date of last update */
|
|
1140
|
+
update_date?: string;
|
|
1141
|
+
/** Date of redemption */
|
|
1142
|
+
redeem_date?: string;
|
|
1143
|
+
/** Uniq identifier of the bonus sent to the player */
|
|
1144
|
+
engagement_uid?: string;
|
|
1145
|
+
/** ID of template used */
|
|
1146
|
+
label_bonus_template_id?: number;
|
|
1147
|
+
/** Reference ID of product */
|
|
1148
|
+
source_product_ref_id?: number;
|
|
1149
|
+
/** ID of product */
|
|
1150
|
+
source_product_id?: number;
|
|
1151
|
+
/** ID of the user who created the bonus */
|
|
1152
|
+
user_id?: number;
|
|
1153
|
+
/** ID of the bonus status */
|
|
1154
|
+
bonus_status_id?: BonusStatus;
|
|
1155
|
+
/** Additional information about the bonus(edscription, image,name, acknowledge) */
|
|
1156
|
+
label_bonus_template_meta_map?: BonusTemplateMetaMap;
|
|
1157
|
+
/** Additional information presented to the player when the bonus is redeemed */
|
|
1158
|
+
bonus_meta_map?: BonusMetaMap;
|
|
1159
|
+
}
|
|
1106
1160
|
interface AchRelatedGame$1 {
|
|
1107
1161
|
/** The ID of the related game */
|
|
1108
1162
|
ext_game_id: string;
|
|
@@ -1561,6 +1615,8 @@ declare class WSAPI {
|
|
|
1561
1615
|
}): Promise<TMissionOrBadge[]>;
|
|
1562
1616
|
/** Returns all the badges available the current user */
|
|
1563
1617
|
getBadges(): Promise<TMissionOrBadge[]>;
|
|
1618
|
+
/** Returns all the badges available the current user */
|
|
1619
|
+
getBonuses(): Promise<TBonus[]>;
|
|
1564
1620
|
/**
|
|
1565
1621
|
* Returns the extra counters for the current user level.
|
|
1566
1622
|
* These are counters that are configured for each Smartico client separatly by request.
|
|
@@ -1599,7 +1655,7 @@ declare class WSAPI {
|
|
|
1599
1655
|
/**
|
|
1600
1656
|
* @param params
|
|
1601
1657
|
*/
|
|
1602
|
-
storeGetPurchasedItems({ from, to, onUpdate }?: {
|
|
1658
|
+
storeGetPurchasedItems({ from, to, onUpdate, }?: {
|
|
1603
1659
|
from?: number;
|
|
1604
1660
|
to?: number;
|
|
1605
1661
|
onUpdate?: (data: TStoreItem[]) => void;
|
|
@@ -1649,7 +1705,7 @@ declare class WSAPI {
|
|
|
1649
1705
|
/**
|
|
1650
1706
|
* @param params
|
|
1651
1707
|
*/
|
|
1652
|
-
getInboxMessages({ from, to, onlyFavorite, onUpdate }?: {
|
|
1708
|
+
getInboxMessages({ from, to, onlyFavorite, onUpdate, }?: {
|
|
1653
1709
|
from?: number;
|
|
1654
1710
|
to?: number;
|
|
1655
1711
|
onlyFavorite?: boolean;
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SmarticoAPI } from '../SmarticoAPI';
|
|
2
|
-
import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUICustomSection, TUserProfile, UserLevelExtraCountersT } from './WSAPITypes';
|
|
2
|
+
import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUICustomSection, TUserProfile, UserLevelExtraCountersT, TBonus, TClaimBonusResult } from './WSAPITypes';
|
|
3
3
|
import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
4
4
|
import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
|
|
5
5
|
/** @group General API */
|
|
@@ -85,6 +85,21 @@ export declare class WSAPI {
|
|
|
85
85
|
* **Visitor mode: not supported**
|
|
86
86
|
*/
|
|
87
87
|
getBadges(): Promise<TMissionOrBadge[]>;
|
|
88
|
+
/**
|
|
89
|
+
* Returns all the bonuses for the current user
|
|
90
|
+
*
|
|
91
|
+
* **Visitor mode: not supported**
|
|
92
|
+
*/
|
|
93
|
+
getBonuses(): Promise<TBonus[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Claim the bonus by bonus_id. Returns the err_code in case of success or error.
|
|
96
|
+
* Note that this method can be used only on integrations where originally failed bonus can be claimed again.
|
|
97
|
+
* For example, user won a bonus in the mini-game, but Operator rejected this bonus.
|
|
98
|
+
* This bonus will be available for the user to claim again.
|
|
99
|
+
*
|
|
100
|
+
* **Visitor mode: not supported**
|
|
101
|
+
*/
|
|
102
|
+
claimBonus(bonus_id: number): Promise<TClaimBonusResult>;
|
|
88
103
|
/**
|
|
89
104
|
* Returns the extra counters for the current user level.
|
|
90
105
|
* These are counters that are configured for each Smartico client separatly by request.
|
|
@@ -163,7 +178,7 @@ export declare class WSAPI {
|
|
|
163
178
|
*
|
|
164
179
|
* **Visitor mode: not supported**
|
|
165
180
|
*/
|
|
166
|
-
getStorePurchasedItems({ limit, offset, onUpdate }?: {
|
|
181
|
+
getStorePurchasedItems({ limit, offset, onUpdate, }?: {
|
|
167
182
|
limit?: number;
|
|
168
183
|
offset?: number;
|
|
169
184
|
onUpdate?: (data: TStoreItem[]) => void;
|
|
@@ -331,7 +346,7 @@ export declare class WSAPI {
|
|
|
331
346
|
*
|
|
332
347
|
* @param params
|
|
333
348
|
*/
|
|
334
|
-
getInboxMessages({ from, to, onlyFavorite, onUpdate }?: {
|
|
349
|
+
getInboxMessages({ from, to, onlyFavorite, onUpdate, }?: {
|
|
335
350
|
from?: number;
|
|
336
351
|
to?: number;
|
|
337
352
|
onlyFavorite?: boolean;
|
|
@@ -3,6 +3,7 @@ import { MiniGamePrizeTypeName, SAWBuyInTypeName, SAWGameTypeName, SAWSpinErrorC
|
|
|
3
3
|
import { TournamentRegistrationError, TournamentRegistrationStatusName, TournamentRegistrationTypeName } from '../Tournaments';
|
|
4
4
|
import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
5
5
|
import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from '../CustomSections';
|
|
6
|
+
import { BonusStatus, BonusTemplateMetaMap, BonusMetaMap } from '../Bonuses';
|
|
6
7
|
type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
|
|
7
8
|
/**
|
|
8
9
|
* TMiniGamePrize describes the information of prize in the array of prizes in the TMiniGameTemplate
|
|
@@ -618,4 +619,33 @@ export interface TUICustomSection {
|
|
|
618
619
|
/** Quantity of missions to be shown in overview */
|
|
619
620
|
overview_missions_count?: number;
|
|
620
621
|
}
|
|
622
|
+
export interface TBonus {
|
|
623
|
+
/** ID of the bonus */
|
|
624
|
+
bonus_id: number;
|
|
625
|
+
/** Can the bonus be redeemed (if bonus is redeemable the user needs to claim it) */
|
|
626
|
+
is_redeemable?: boolean;
|
|
627
|
+
/** Date of creation */
|
|
628
|
+
create_date?: string;
|
|
629
|
+
/** Date of redemption */
|
|
630
|
+
redeem_date?: string;
|
|
631
|
+
/** ID of template used */
|
|
632
|
+
label_bonus_template_id?: number;
|
|
633
|
+
/** ID of the bonus status */
|
|
634
|
+
bonus_status_id?: BonusStatus;
|
|
635
|
+
/** Additional information about the bonus(edscription, image,name, acknowledge) */
|
|
636
|
+
label_bonus_template_meta_map?: BonusTemplateMetaMap;
|
|
637
|
+
/** Additional information presented to the player when the bonus is redeemed */
|
|
638
|
+
bonus_meta_map?: BonusMetaMap;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* TClaimBonusResult describes the response of call to _smartico.api.claimBonus(bonus_id) method
|
|
642
|
+
*/
|
|
643
|
+
export interface TClaimBonusResult {
|
|
644
|
+
/** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
|
|
645
|
+
err_code: SAWSpinErrorCode;
|
|
646
|
+
/** Optional error message */
|
|
647
|
+
err_message: string;
|
|
648
|
+
/** If the bonus was claimed successfully, then success is true */
|
|
649
|
+
success?: boolean;
|
|
650
|
+
}
|
|
621
651
|
export {};
|
package/dist/index.d.ts
CHANGED