@smartico/public-api 0.0.278 → 0.0.280
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/dist/MiniGames/SAWBuyInType.d.ts +0 -1
- package/dist/MiniGames/SAWGameType.d.ts +0 -1
- package/dist/MiniGames/SAWPrizeType.d.ts +0 -1
- package/dist/Missions/index.d.ts +1 -0
- package/dist/Tournaments/Tournament.d.ts +3 -2
- package/dist/Tournaments/TournamentRegistrationStatus.d.ts +0 -1
- package/dist/Tournaments/TournamentRegistrationType.d.ts +0 -1
- package/dist/WSAPI/WSAPI.d.ts +4 -0
- package/dist/WSAPI/WSAPITypes.d.ts +26 -1
- package/dist/index.js +109 -98
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +61 -58
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +103 -0
- package/docs/classes/SAWUtils.md +27 -0
- package/docs/classes/WSAPI.md +5 -2
- package/docs/enums/AchCustomLayoutTheme.md +25 -0
- package/docs/enums/AchMissionsTabsOptions.md +19 -0
- package/docs/enums/AchOverviewMissionsFilter.md +31 -0
- package/docs/enums/BonusStatus-1.md +49 -0
- package/docs/enums/BonusStatus.md +37 -0
- package/docs/enums/SAWAcknowledgeType.md +25 -0
- package/docs/enums/SAWBuyInType.md +31 -0
- package/docs/enums/SAWGameType.md +61 -0
- package/docs/enums/SAWPrizeType.md +61 -0
- package/docs/enums/SAWWheelLayout.md +25 -0
- package/docs/enums/SAWWinSoundType.md +31 -0
- package/docs/enums/TournamentRegistrationStatus.md +43 -0
- package/docs/enums/TournamentRegistrationType.md +43 -0
- package/docs/interfaces/BonusMetaMap.md +9 -0
- package/docs/interfaces/BonusTemplateMetaMap.md +25 -0
- package/docs/interfaces/SAWAcknowledgeSpinPushRequest.md +79 -0
- package/docs/interfaces/SAWDoAknowledgeRequest.md +43 -0
- package/docs/interfaces/SAWDoAknowledgeResponse.md +43 -0
- package/docs/interfaces/SAWDoSpinRequest.md +79 -0
- package/docs/interfaces/SAWDoSpinResponse.md +87 -0
- package/docs/interfaces/SAWEventSawPush.md +55 -0
- package/docs/interfaces/SAWGetTemplatesRequest.md +79 -0
- package/docs/interfaces/SAWGetTemplatesResponse.md +63 -0
- package/docs/interfaces/SAWPrize.md +107 -0
- package/docs/interfaces/SAWPrizeDropAknowledgeRequest.md +55 -0
- package/docs/interfaces/SAWPrizeDropAknowledgeResponse.md +43 -0
- package/docs/interfaces/SAWPrizeDropWinPush.md +67 -0
- package/docs/interfaces/SAWPrizeUI.md +157 -0
- package/docs/interfaces/SAWPrizesHistory.md +49 -0
- package/docs/interfaces/SAWSpinsCountPush.md +49 -0
- package/docs/interfaces/SAWTemplate.md +154 -0
- package/docs/interfaces/SAWTemplateUI.md +1 -1
- package/docs/interfaces/SAWWinningHistoryRequest.md +61 -0
- package/docs/interfaces/SAWWinningHistoryResponse.md +69 -0
- package/docs/interfaces/TBonus.md +3 -3
- package/docs/interfaces/TSawHistory.md +1 -1
- package/docs/interfaces/TUICustomSection.md +3 -3
- package/package.json +1 -1
- package/src/MiniGames/SAWBuyInType.ts +0 -1
- package/src/MiniGames/SAWGameType.ts +0 -2
- package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -1
- package/src/MiniGames/SAWPrizeType.ts +0 -1
- package/src/Missions/index.ts +1 -0
- package/src/Tournaments/Tournament.ts +4 -2
- package/src/Tournaments/TournamentRegistrationStatus.ts +0 -1
- package/src/Tournaments/TournamentRegistrationType.ts +0 -1
- package/src/WSAPI/WSAPI.ts +10 -16
- package/src/WSAPI/WSAPITypes.ts +30 -6
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import { ProtocolResponse } from './../Base/ProtocolResponse';
|
|
|
4
4
|
import { SAWAcknowledgeTypeNamed } from './SAWAcknowledgeType';
|
|
5
5
|
import { SAWBuyInType, SAWBuyInTypeNamed } from './SAWBuyInType';
|
|
6
6
|
import { SAWGameTypeNamed } from './SAWGameType';
|
|
7
|
-
import {
|
|
7
|
+
import { MiniGamePrizeTypeNamed } from './SAWPrizeType';
|
|
8
8
|
import { SAWTemplate } from './SAWTemplate';
|
|
9
9
|
|
|
10
10
|
export interface SAWGetTemplatesResponse extends ProtocolResponse {
|
package/src/Missions/index.ts
CHANGED
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
import { TournamentType } from './TournamentType';
|
|
9
9
|
import { TournamentPublicMeta } from './TournamentPublicMeta';
|
|
10
10
|
import { TTournament } from '../WSAPI/WSAPITypes';
|
|
11
|
-
import { TournamentPlayer
|
|
11
|
+
import { TournamentPlayer } from './TournamentPlayer';
|
|
12
|
+
import { TournamentPrize } from './TournamentPrize';
|
|
13
|
+
import { TournamentUtils } from './TournamentUtils';
|
|
12
14
|
import { IntUtils } from '../IntUtils';
|
|
13
15
|
import { AchRelatedGame } from '../Base/AchRelatedGame';
|
|
14
16
|
|
|
@@ -64,7 +66,7 @@ export interface Tournament {
|
|
|
64
66
|
related_games?: AchRelatedGame[];
|
|
65
67
|
/** The minimum amount of score points that the user should get in order to be qualified for the prize */
|
|
66
68
|
minScoreToWin?: number;
|
|
67
|
-
/** When enabled, users who don
|
|
69
|
+
/** When enabled, users who don't meet the minimum qualifying score will be hidden from the Leaderboard. */
|
|
68
70
|
hideLeaderboardsMinScores?: boolean;
|
|
69
71
|
}
|
|
70
72
|
|
package/src/WSAPI/WSAPI.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { ClassId } from '../Base/ClassId';
|
|
2
2
|
import { CoreUtils } from '../Core';
|
|
3
3
|
import {
|
|
4
|
-
MiniGamePrizeTypeName,
|
|
5
|
-
SAWDoSpinResponse,
|
|
6
|
-
SAWGetTemplatesResponse,
|
|
7
|
-
SAWSpinErrorCode,
|
|
8
4
|
SAWSpinsCountPush,
|
|
9
|
-
SAWWinningHistoryRequest,
|
|
10
|
-
SAWWinningHistoryResponse,
|
|
11
5
|
} from '../MiniGames';
|
|
12
6
|
import { ECacheContext, OCache } from '../OCache';
|
|
13
7
|
import { SmarticoAPI } from '../SmarticoAPI';
|
|
@@ -53,24 +47,15 @@ import {
|
|
|
53
47
|
JackpotsOptoutRequest,
|
|
54
48
|
JackpotsOptoutResponse,
|
|
55
49
|
} from '../Jackpots';
|
|
56
|
-
import { GetTournamentsResponse } from '../Tournaments';
|
|
57
|
-
import { GetAchievementMapResponse } from '../Missions';
|
|
58
50
|
import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
|
|
59
|
-
import { drawTransform, GetRafflesResponse, prizeTransform, ticketsTransform } from '../Raffle/GetRafflesResponse';
|
|
60
51
|
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
61
52
|
import {
|
|
62
53
|
drawRunHistoryTransform,
|
|
63
54
|
drawRunTransform,
|
|
64
|
-
GetDrawRunRequest,
|
|
65
|
-
GetDrawRunResponse,
|
|
66
|
-
GetRaffleDrawRunsHistoryRequest,
|
|
67
|
-
GetRaffleDrawRunsHistoryResponse,
|
|
68
|
-
RaffleClaimPrizeRequest,
|
|
69
|
-
RaffleClaimPrizeResponse,
|
|
70
55
|
raffleClaimPrizeResponseTransform,
|
|
71
56
|
} from '../Raffle';
|
|
72
57
|
import { IntUtils } from '../IntUtils';
|
|
73
|
-
import {
|
|
58
|
+
import { TGetJackpotEligibleGamesResponse } from '../Jackpots/GetJackpotEligibleGamesResponse';
|
|
74
59
|
|
|
75
60
|
/** @hidden */
|
|
76
61
|
const CACHE_DATA_SEC = 30;
|
|
@@ -129,6 +114,7 @@ export class WSAPI {
|
|
|
129
114
|
on(ClassId.ACHIEVEMENT_CLAIM_PRIZE_RESPONSE, () => this.updateMissions());
|
|
130
115
|
on(ClassId.RELOAD_ACHIEVEMENTS_EVENT, () => this.updateMissions());
|
|
131
116
|
on(ClassId.TOURNAMENT_REGISTER_RESPONSE, () => this.updateTournaments());
|
|
117
|
+
on(ClassId.BUY_SHOP_ITEM_RESPONSE, () => this.updateStorePurchasedItems());
|
|
132
118
|
on(ClassId.CLIENT_ENGAGEMENT_EVENT_NEW, () => this.updateInboxMessages());
|
|
133
119
|
on(ClassId.LOGOUT_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));
|
|
134
120
|
on(ClassId.IDENTIFY_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));
|
|
@@ -405,6 +391,9 @@ export class WSAPI {
|
|
|
405
391
|
* Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
|
|
406
392
|
* The maximum number of items per request is limited to 20.
|
|
407
393
|
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
394
|
+
* The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
395
|
+
* Note that each time you call getStorePurchasedItems with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
396
|
+
* The onUpdate callback will be called on purchase of the store item and the last 20 items will be passed to it.
|
|
408
397
|
*
|
|
409
398
|
* **Example**:
|
|
410
399
|
* ```
|
|
@@ -924,6 +913,11 @@ export class WSAPI {
|
|
|
924
913
|
this.updateEntity(onUpdateContextKey.TournamentList, payload);
|
|
925
914
|
}
|
|
926
915
|
|
|
916
|
+
private async updateStorePurchasedItems() {
|
|
917
|
+
const payload = await this.api.storeGetPurchasedItemsT(null, 20, 0);
|
|
918
|
+
this.updateEntity(onUpdateContextKey.StoreHistory, payload);
|
|
919
|
+
}
|
|
920
|
+
|
|
927
921
|
private async updateInboxMessages() {
|
|
928
922
|
const payload = await this.api.getInboxMessagesT(null);
|
|
929
923
|
this.updateEntity(onUpdateContextKey.InboxMessages, payload);
|
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { BuyStoreItemErrorCode } from '../Store';
|
|
2
|
-
import { MiniGamePrizeTypeName, SAWAcknowledgeTypeName, SAWAskForUsername,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { MiniGamePrizeTypeName, SAWAcknowledgeTypeName, SAWAskForUsername, SAWBuyInTypeName, SAWGameLayout, SAWGameTypeName, SAWSpinErrorCode, SAWTemplate, SAWTemplateUI } from '../MiniGames';
|
|
3
|
+
import { TournamentRegistrationError, TournamentRegistrationStatusName, TournamentRegistrationTypeName } from '../Tournaments';
|
|
4
|
+
import { AchievementAvailabilityStatus } from '../Missions';
|
|
5
5
|
import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
6
6
|
import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from '../CustomSections';
|
|
7
|
-
import { BonusStatus , BonusTemplateMetaMap, BonusMetaMap} from '../Bonuses';
|
|
8
7
|
import { PrizeModifiers } from '../MiniGames/PrizeModifiers';
|
|
9
8
|
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
10
9
|
import { RaffleDrawInstanceState, RaffleDrawTypeExecution } from '../Raffle';
|
|
11
|
-
import { JackPotWinner } from '../Jackpots/JackPotWinner';
|
|
12
|
-
import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
|
|
13
10
|
|
|
14
11
|
|
|
15
12
|
type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
|
|
@@ -859,6 +856,33 @@ export interface TBonus {
|
|
|
859
856
|
bonus_meta_map?: BonusMetaMap;
|
|
860
857
|
}
|
|
861
858
|
|
|
859
|
+
export enum BonusStatus {
|
|
860
|
+
/** The bonus is newly created (shouldn't be shown to the client) */
|
|
861
|
+
New = 1,
|
|
862
|
+
/** The bonus is issued and available for redemption but has not been redeemed yet */
|
|
863
|
+
COUPON_ISSUED = 2,
|
|
864
|
+
/** The bonus has been successfully redeemed */
|
|
865
|
+
REDEEMED = 3,
|
|
866
|
+
/** The bonus is still valid, but a previous redemption attempt failed */
|
|
867
|
+
REDEEM_FAILED = 4,
|
|
868
|
+
/** Failed to issue the bonus (shouldn't be shown to the client) */
|
|
869
|
+
COUPON_ISSUE_FAILED = 5,
|
|
870
|
+
/** The bonus was issued but has expired and can no longer be redeemed (shouldn't be shown to the client) */
|
|
871
|
+
EXPIRED = 6,
|
|
872
|
+
}
|
|
873
|
+
export interface BonusTemplateMetaMap {
|
|
874
|
+
/** Description of the bonus template*/
|
|
875
|
+
description: string;
|
|
876
|
+
/** Acknowledge message setup in the bonus template*/
|
|
877
|
+
acknowledge: string;
|
|
878
|
+
/** Image URL of the bonus template*/
|
|
879
|
+
image_url: string;
|
|
880
|
+
}
|
|
881
|
+
export interface BonusMetaMap {
|
|
882
|
+
/** Label and description of the bonus sent to the player*/
|
|
883
|
+
uiAmount?: string;
|
|
884
|
+
}
|
|
885
|
+
|
|
862
886
|
/**
|
|
863
887
|
* TClaimBonusResult describes the response of call to _smartico.api.claimBonus(bonus_id) method
|
|
864
888
|
*/
|