@smartico/public-api 0.0.276 → 0.0.278

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.
@@ -88,7 +88,10 @@ ___
88
88
 
89
89
  • **next\_available\_spin\_ts**: `number`
90
90
 
91
- if the game is limit to the number of spins that user can do during period of time, this property shows the epoch time in UTC when the next attempt will be available
91
+ if the game is limit to the number of spins that user can do during period of time,
92
+ this property shows the epoch time in UTC when the next attempt will be available.
93
+ Note that you need to enable 'Show time to the next available spin' setting on mini-game template in the backoffice
94
+ Important: this field will not be populated if “Max number of attempts a user can do” is set to value different from 1
92
95
 
93
96
  ___
94
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.276",
3
+ "version": "0.0.278",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -6,6 +6,9 @@ export enum ActivityTypeLimited {
6
6
  MiniGameAttempt = 16,
7
7
  DeductPoints = 21,
8
8
  ResetPoints = 22,
9
+ AddGemsAndDiamonds = 25,
10
+ DeductGemsAndDiamonds = 26,
11
+ ResetGemsAndDiamonds = 27,
9
12
  Popup = 30,
10
13
  Inbox = 31,
11
14
  Slack = 70,
@@ -18,4 +18,5 @@ export interface SAWPrize {
18
18
  relative_period_timezone?: number;
19
19
  is_surcharge?: boolean;
20
20
  is_deleted?: boolean;
21
+ prize_details_json?: {[key: string]: any};
21
22
  }
@@ -36,6 +36,7 @@ export interface SAWTemplate {
36
36
  skin_folder: string;
37
37
  skin_css: string;
38
38
  use_new_popups?: boolean;
39
+ lottie_animation_speed?: number;
39
40
  };
40
41
 
41
42
  expose_game_stat_on_api?: boolean;
@@ -621,6 +621,9 @@ class SmarticoAPI {
621
621
  [SAWSpinErrorCode.SAW_NOT_ENOUGH_POINTS]: 'NOT ENOUGH POINTS',
622
622
  [SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED]: 'MAX SPIN ATTEMPTS REACHED',
623
623
  [SAWSpinErrorCode.SAW_TEMPLATE_NOT_ACTIVE]: "MINIGAME IS NOT IN ACTIVE PERIOD",
624
+ [SAWSpinErrorCode.SAW_NOT_IN_SEGMENT]: "USER IS NOT IN SEGMENT",
625
+ [SAWSpinErrorCode.SAW_NO_BALANCE_GEMS]: "NOT ENOUGH GEMS",
626
+ [SAWSpinErrorCode.SAW_NO_BALANCE_DIAMONDS]: "NOT ENOUGH DIAMONDS",
624
627
  }[spinAttemptResponse.errCode] || 'OTHER';
625
628
 
626
629
  await this.coreReportCustomEvent(user_ext_id, 'minigame_attempt', {
@@ -986,7 +989,7 @@ class SmarticoAPI {
986
989
 
987
990
  const response = await this.send<GetLeaderBoardsResponse>(message, ClassId.GET_LEADERS_BOARD_RESPONSE, force_language);
988
991
 
989
- const boardKey = Object.keys(response.map).find((k) => period_type_id === undefined || k === period_type_id?.toString());
992
+ const boardKey = Object.keys(response.map || {}).find((k) => period_type_id === undefined || k === period_type_id?.toString());
990
993
 
991
994
  if (boardKey === undefined) {
992
995
  return undefined;
@@ -8,4 +8,6 @@ export interface TournamentPrize {
8
8
  place_to: number;
9
9
  type: ActivityTypeLimited;
10
10
  points: number;
11
+ gems: number;
12
+ diamonds: number;
11
13
  }
@@ -14,6 +14,9 @@ const tournamentPrizeTypeToPrizeName = (type: ActivityTypeLimited) => {
14
14
  [ActivityTypeLimited.ResetPoints]: 'POINTS_RESET',
15
15
  [ActivityTypeLimited.MiniGameAttempt]: 'MINI_GAME_ATTEMPT',
16
16
  [ActivityTypeLimited.Bonus]: 'BONUS',
17
+ [ActivityTypeLimited.AddGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_ADD',
18
+ [ActivityTypeLimited.DeductGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_DEDUCT',
19
+ [ActivityTypeLimited.ResetGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_RESET',
17
20
  }[type];
18
21
  };
19
22
 
@@ -137,7 +137,12 @@ export interface TMiniGameTemplate {
137
137
  /** in case of charging type 'Spin attempts', shows the current number of spin attempts that user has */
138
138
  spin_count?: number;
139
139
 
140
- /** if the game is limit to the number of spins that user can do during period of time, this property shows the epoch time in UTC when the next attempt will be available */
140
+ /**
141
+ * if the game is limit to the number of spins that user can do during period of time,
142
+ * this property shows the epoch time in UTC when the next attempt will be available.
143
+ * Note that you need to enable 'Show time to the next available spin' setting on mini-game template in the backoffice
144
+ * Important: this field will not be populated if “Max number of attempts a user can do” is set to value different from 1
145
+ * */
141
146
  next_available_spin_ts: number;
142
147
 
143
148
  /** The message that should be shown to the user when he cannot play the game, server rejected attempt with error code SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED */