@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.
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.139",
3
+ "version": "0.0.140",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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
- winning_position: number
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 }
@@ -5,5 +5,6 @@ export enum AchievementStatus {
5
5
  AvailableLocked = 3,
6
6
  Archived = 4,
7
7
  FeaturedManually = 5,
8
- FeaturedAI = 6
8
+ FeaturedAI = 6,
9
+ Recurring = 7
9
10
  }
@@ -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
- api_key: this.label_api_key,
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,
@@ -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
  }