@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.
@@ -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
- SAWSpinErrorCode[SAWSpinErrorCode["SAW_VISITOR_STOP_SPIN_REQUEST"] = -40001] = "SAW_VISITOR_STOP_SPIN_REQUEST"; // special code for visitor game mode to stop spin request
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);