@smartico/public-api 0.0.139 → 0.0.140
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/Jackpots/JackPotWinner.d.ts +5 -0
- package/dist/Missions/AchievementStatus.d.ts +2 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +5 -2
- package/dist/index.modern.mjs.map +1 -1
- package/docs/interfaces/JackPotWinner.md +10 -0
- package/package.json +1 -1
- package/src/Jackpots/JackPotWinner.ts +6 -1
- package/src/Missions/AchievementStatus.ts +2 -1
- package/src/SmarticoAPI.ts +3 -1
- package/src/WSAPI/WSAPI.ts +3 -5
|
@@ -6,26 +6,36 @@
|
|
|
6
6
|
|
|
7
7
|
• **is\_me**: `boolean`
|
|
8
8
|
|
|
9
|
+
Flag indicating that this winner is the currently logged in user
|
|
10
|
+
|
|
9
11
|
___
|
|
10
12
|
|
|
11
13
|
### public\_username
|
|
12
14
|
|
|
13
15
|
• **public\_username**: `string`
|
|
14
16
|
|
|
17
|
+
Name of the winner, note that for all users except is_me, the name is masked by default, but masking can be disabled by request to Smartico AM team
|
|
18
|
+
|
|
15
19
|
___
|
|
16
20
|
|
|
17
21
|
### winning\_amount\_jp\_currency
|
|
18
22
|
|
|
19
23
|
• **winning\_amount\_jp\_currency**: `number`
|
|
20
24
|
|
|
25
|
+
Won amount in the Jackpot currency
|
|
26
|
+
|
|
21
27
|
___
|
|
22
28
|
|
|
23
29
|
### winning\_amount\_wallet\_currency
|
|
24
30
|
|
|
25
31
|
• **winning\_amount\_wallet\_currency**: `number`
|
|
26
32
|
|
|
33
|
+
Won amount in the user Wallet currency
|
|
34
|
+
|
|
27
35
|
___
|
|
28
36
|
|
|
29
37
|
### winning\_position
|
|
30
38
|
|
|
31
39
|
• **winning\_position**: `number`
|
|
40
|
+
|
|
41
|
+
Position of the winner. Relevant for jackpots where there could be multiple winners
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
interface JackPotWinner {
|
|
3
|
+
/** Flag indicating that this winner is the currently logged in user */
|
|
3
4
|
is_me: boolean;
|
|
5
|
+
/** Name of the winner, note that for all users except is_me, the name is masked by default, but masking can be disabled by request to Smartico AM team */
|
|
4
6
|
public_username: string; // masked for all except "is_me"
|
|
7
|
+
/** Won amount in the Jackpot currency */
|
|
5
8
|
winning_amount_jp_currency: number;
|
|
9
|
+
/** Won amount in the user Wallet currency */
|
|
6
10
|
winning_amount_wallet_currency: number;
|
|
7
|
-
|
|
11
|
+
/** Position of the winner. Relevant for jackpots where there could be multiple winners */
|
|
12
|
+
winning_position: number;
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
export { JackPotWinner }
|
package/src/SmarticoAPI.ts
CHANGED
|
@@ -173,7 +173,9 @@ class SmarticoAPI {
|
|
|
173
173
|
private buildMessage<TRequest,TResponse>(user_ext_id: string, cid: ClassId, payload: Partial<TRequest> = {}): TResponse {
|
|
174
174
|
|
|
175
175
|
const message: ProtocolRequest = {
|
|
176
|
-
|
|
176
|
+
// AA: in fact we need api and brand keys and ext_user_id only in the context of HTTP
|
|
177
|
+
// its not needed in WebSocket and can be deleted
|
|
178
|
+
api_key: this.label_api_key,
|
|
177
179
|
brand_key: this.brand_api_key,
|
|
178
180
|
ext_user_id: user_ext_id,
|
|
179
181
|
cid,
|
package/src/WSAPI/WSAPI.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ECacheContext, OCache } from "../OCache";
|
|
|
5
5
|
import { SmarticoAPI } from "../SmarticoAPI";
|
|
6
6
|
import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUserProfile, UserLevelExtraCountersT } from "./WSAPITypes";
|
|
7
7
|
import { LeaderBoardPeriodType } from "../Leaderboard";
|
|
8
|
-
import { JackpotDetails, JackpotPot, JackpotWinPush, JackpotsOptinResponse, JackpotsOptoutResponse } from "../Jackpots";
|
|
8
|
+
import { JackpotDetails, JackpotPot, JackpotWinPush, JackpotsOptinResponse, JackpotsOptoutRequest, JackpotsOptoutResponse } from "../Jackpots";
|
|
9
9
|
|
|
10
10
|
/** @hidden */
|
|
11
11
|
const CACHE_DATA_SEC = 30;
|
|
@@ -51,6 +51,8 @@ export class WSAPI {
|
|
|
51
51
|
on(ClassId.LOGOUT_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));
|
|
52
52
|
on(ClassId.IDENTIFY_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));
|
|
53
53
|
on(ClassId.JP_WIN_PUSH, (data: JackpotWinPush) => this.jackpotClearCache());
|
|
54
|
+
on(ClassId.JP_OPTOUT_RESPONSE, (data: JackpotsOptoutRequest) => this.jackpotClearCache());
|
|
55
|
+
on(ClassId.JP_OPTIN_RESPONSE, (data: JackpotsOptinResponse) => this.jackpotClearCache());
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
/** Returns information about current user
|
|
@@ -513,8 +515,6 @@ export class WSAPI {
|
|
|
513
515
|
|
|
514
516
|
const result = await this.api.jackpotOptIn(null, filter);
|
|
515
517
|
|
|
516
|
-
this.jackpotClearCache();
|
|
517
|
-
|
|
518
518
|
return result;
|
|
519
519
|
}
|
|
520
520
|
|
|
@@ -535,8 +535,6 @@ export class WSAPI {
|
|
|
535
535
|
|
|
536
536
|
const result = await this.api.jackpotOptOut(null, filter);
|
|
537
537
|
|
|
538
|
-
this.jackpotClearCache();
|
|
539
|
-
|
|
540
538
|
return result;
|
|
541
539
|
}
|
|
542
540
|
}
|