@smartico/public-api 0.0.57 → 0.0.59
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/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/MiniGames/SAWSpinErrorCode.d.ts +6 -0
- package/dist/SmarticoAPI.d.ts +1 -1
- package/dist/WSAPI/WSAPI.d.ts +3 -1
- package/dist/WSAPI/WSAPITypes.d.ts +22 -11
- package/dist/index.js +29 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +20 -1
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +2 -0
- package/docs/classes/WSAPI.md +20 -2
- package/docs/enums/SAWSpinErrorCode.md +49 -0
- package/docs/interfaces/TLevel.md +1 -1
- package/docs/interfaces/TMiniGamePlayResult.md +27 -0
- package/docs/interfaces/TMiniGamePrize.md +1 -1
- package/docs/interfaces/TMiniGameTemplate.md +1 -1
- package/docs/interfaces/TMissionOrBadge.md +1 -1
- package/docs/interfaces/TMissionOrBadgeTask.md +1 -1
- package/docs/interfaces/TStoreCategory.md +1 -1
- package/docs/interfaces/TStoreItem.md +1 -1
- package/docs/interfaces/TTournament.md +1 -1
- package/docs/interfaces/TTournamentDetailed.md +1 -1
- package/docs/interfaces/TUserProfile.md +1 -1
- package/package.json +1 -1
- package/src/MiniGames/SAWPrizeUI.ts +1 -0
- package/src/MiniGames/SAWSpinErrorCode.ts +10 -2
- package/src/SmarticoAPI.ts +1 -1
- package/src/WSAPI/WSAPI.ts +16 -2
- package/src/WSAPI/WSAPITypes.ts +23 -11
- package/tsconfig.json +1 -0
package/dist/index.modern.mjs
CHANGED
|
@@ -284,14 +284,23 @@ const SAWTemplatesTransform = items => {
|
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
286
|
|
|
287
|
+
/*
|
|
288
|
+
* Possible error codes for the mini-games attempts
|
|
289
|
+
*/
|
|
287
290
|
var SAWSpinErrorCode;
|
|
288
291
|
(function (SAWSpinErrorCode) {
|
|
292
|
+
/** No error */
|
|
289
293
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_OK"] = 0] = "SAW_OK";
|
|
294
|
+
/** User doesn't have 'spin attempts' to play. In case buy in type for the game is 'spins' based */
|
|
290
295
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_NO_SPINS"] = 40001] = "SAW_NO_SPINS";
|
|
296
|
+
/** The are no prizes left to play the game */
|
|
291
297
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_PRIZE_POOL_EMPTY"] = 40002] = "SAW_PRIZE_POOL_EMPTY";
|
|
298
|
+
/** User doesn't have enough points to play. In case buy in type for the game is 'points' based */
|
|
292
299
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_NOT_ENOUGH_POINTS"] = 40003] = "SAW_NOT_ENOUGH_POINTS";
|
|
300
|
+
/** User reached max number of game attempts defined in the BackOffice */
|
|
293
301
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_FAILED_MAX_SPINS_REACHED"] = 40004] = "SAW_FAILED_MAX_SPINS_REACHED";
|
|
294
|
-
|
|
302
|
+
/** Special code for the 'visitor' mode */
|
|
303
|
+
SAWSpinErrorCode[SAWSpinErrorCode["SAW_VISITOR_STOP_SPIN_REQUEST"] = -40001] = "SAW_VISITOR_STOP_SPIN_REQUEST";
|
|
295
304
|
})(SAWSpinErrorCode || (SAWSpinErrorCode = {}));
|
|
296
305
|
|
|
297
306
|
var SAWWinSoundType;
|
|
@@ -803,6 +812,16 @@ class WSAPI {
|
|
|
803
812
|
async getMiniGames() {
|
|
804
813
|
return this.api.sawGetTemplatesT(null);
|
|
805
814
|
}
|
|
815
|
+
/** Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code */
|
|
816
|
+
async playMiniGame(template_id) {
|
|
817
|
+
const r = await this.api.sawSpinRequest(null, template_id);
|
|
818
|
+
const o = {
|
|
819
|
+
err_code: r.errCode,
|
|
820
|
+
err_message: r.errMsg,
|
|
821
|
+
prize_id: r.saw_prize_id
|
|
822
|
+
};
|
|
823
|
+
return o;
|
|
824
|
+
}
|
|
806
825
|
/** Returns all the active instances of tournaments */
|
|
807
826
|
async getTournamentsList() {
|
|
808
827
|
return this.api.tournamentsGetLobbyT(null);
|