@smartico/public-api 0.0.296 → 0.0.298

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.
@@ -23,3 +23,11 @@ ___
23
23
  • **image\_url**: `string`
24
24
 
25
25
  URL of the image that represents the prize
26
+
27
+ ___
28
+
29
+ ### hide\_chance\_to\_win
30
+
31
+ • **hide\_chance\_to\_win**: `boolean`
32
+
33
+ Indicates whether the chance to win should be hidden in the UI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.296",
3
+ "version": "0.0.298",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,6 +8,10 @@ interface RafflePrizePublicMeta {
8
8
  description: string;
9
9
  /** URL of the image that represents the prize */
10
10
  image_url: string;
11
+ /**
12
+ * Indicates whether the chance to win should be hidden in the UI.
13
+ */
14
+ hide_chance_to_win: boolean;
11
15
  }
12
16
 
13
17
  /**
@@ -138,6 +138,7 @@ interface Tracker {
138
138
  userPublicProps: any;
139
139
  on: (callBackKey: ClassId, func: (data: any) => void) => void;
140
140
  getLabelSetting: (key: PublicLabelSettings) => any;
141
+ triggerExternalCallBack: (callBackKey: string, payload: any) => void;
141
142
  }
142
143
  interface IOptions {
143
144
  logger?: ILogger;
@@ -102,6 +102,8 @@ export class WSAPI {
102
102
  OCache.clearAll();
103
103
  if (this.api.tracker) {
104
104
  const on = this.api.tracker.on;
105
+ const triggerExternalCallback = this.api.tracker.triggerExternalCallBack;
106
+
105
107
  on(ClassId.SAW_SPINS_COUNT_PUSH, (data: SAWSpinsCountPush) => this.updateOnSpin(data));
106
108
  on(ClassId.SAW_SHOW_SPIN_PUSH, () => this.reloadMiniGameTemplate());
107
109
  on(ClassId.SAW_AKNOWLEDGE_RESPONSE, () => {
@@ -135,6 +137,15 @@ export class WSAPI {
135
137
  this.updateRaffles();
136
138
  OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Raffles);
137
139
  });
140
+ on(ClassId.GET_INBOX_MESSAGES_RESPONSE, (res) => {
141
+ const unreadCountInProfile = this.api.tracker?.userPublicProps?.core_inbox_unread_count;
142
+
143
+ if (res.unread_count && triggerExternalCallback && unreadCountInProfile !== res.unread_count) {
144
+ triggerExternalCallback('props_change', {
145
+ core_inbox_unread_count: res.unread_count,
146
+ });
147
+ }
148
+ })
138
149
  }
139
150
  }
140
151