@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.
- package/dist/Core/ActivityTypeLimited.d.ts +3 -0
- package/dist/MiniGames/SAWPrize.d.ts +3 -0
- package/dist/MiniGames/SAWTemplate.d.ts +1 -0
- package/dist/Tournaments/TournamentPrize.d.ts +2 -0
- package/dist/Tournaments/TournamentUtils.d.ts +2 -0
- package/dist/WSAPI/WSAPITypes.d.ts +6 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +12 -3
- package/dist/index.modern.mjs.map +1 -1
- package/docs/interfaces/TMiniGameTemplate.md +4 -1
- package/package.json +1 -1
- package/src/Core/ActivityTypeLimited.ts +3 -0
- package/src/MiniGames/SAWPrize.ts +1 -0
- package/src/MiniGames/SAWTemplate.ts +1 -0
- package/src/SmarticoAPI.ts +4 -1
- package/src/Tournaments/TournamentPrize.ts +2 -0
- package/src/Tournaments/TournamentUtils.ts +3 -0
- package/src/WSAPI/WSAPITypes.ts +6 -1
|
@@ -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,
|
|
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
package/src/SmarticoAPI.ts
CHANGED
|
@@ -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;
|
|
@@ -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
|
|
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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 */
|