@smartico/public-api 0.0.72 → 0.0.73
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/WSAPI/WSAPI.d.ts +12 -1
- package/dist/index.js +39 -13
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +17 -1
- package/dist/index.modern.mjs.map +1 -1
- package/docs/classes/WSAPI.md +11 -20
- package/package.json +1 -1
- package/src/WSAPI/WSAPI.ts +19 -2
package/dist/index.modern.mjs
CHANGED
|
@@ -797,6 +797,8 @@ class WSAPI {
|
|
|
797
797
|
this.api = api;
|
|
798
798
|
const on = this.api.tracker.on;
|
|
799
799
|
on(ClassId.SAW_SPINS_COUNT_PUSH, data => this.updateOnSpin(data));
|
|
800
|
+
on(ClassId.SAW_SPINS_COUNT_PUSH, data => this.updateOnSpin(data));
|
|
801
|
+
on(ClassId.SAW_SHOW_SPIN_PUSH, () => this.updateOnAddSpin());
|
|
800
802
|
on(ClassId.SAW_DO_SPIN_RESPONSE, data => on(ClassId.SAW_AKNOWLEDGE_RESPONSE, () => this.updateOnPrizeWin(data)));
|
|
801
803
|
on(ClassId.MISSION_OPTIN_RESPONSE, () => this.updateMissionsOnOptIn());
|
|
802
804
|
on(ClassId.TOURNAMENT_REGISTER_RESPONSE, () => this.updateTournamentsOnRegistration());
|
|
@@ -818,6 +820,9 @@ class WSAPI {
|
|
|
818
820
|
/** Returns all the missions available the current user.
|
|
819
821
|
* The returned missions is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
820
822
|
* The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it. */
|
|
823
|
+
/**
|
|
824
|
+
* @param params
|
|
825
|
+
*/
|
|
821
826
|
async getMissions({
|
|
822
827
|
onUpdate
|
|
823
828
|
} = {}) {
|
|
@@ -840,7 +845,11 @@ class WSAPI {
|
|
|
840
845
|
}
|
|
841
846
|
/** Returns the list of mini-games available for user
|
|
842
847
|
* The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
843
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one. Updated templates will be passed to onUpdate callback. */
|
|
848
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback. */
|
|
849
|
+
/**
|
|
850
|
+
/**
|
|
851
|
+
* @param params
|
|
852
|
+
*/
|
|
844
853
|
async getMiniGames({
|
|
845
854
|
onUpdate
|
|
846
855
|
} = {}) {
|
|
@@ -863,6 +872,9 @@ class WSAPI {
|
|
|
863
872
|
/** Returns all the active instances of tournaments
|
|
864
873
|
* The returned list is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getTournamentsList with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
865
874
|
* The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback.*/
|
|
875
|
+
/**
|
|
876
|
+
* @param params
|
|
877
|
+
*/
|
|
866
878
|
async getTournamentsList({
|
|
867
879
|
onUpdate
|
|
868
880
|
} = {}) {
|
|
@@ -881,6 +893,10 @@ class WSAPI {
|
|
|
881
893
|
templates[index].spin_count = data.spin_count;
|
|
882
894
|
this.updateEntity(onUpdateContextKey.Saw, templates);
|
|
883
895
|
}
|
|
896
|
+
async updateOnAddSpin() {
|
|
897
|
+
const payload = await this.api.sawGetTemplatesT(null);
|
|
898
|
+
this.updateEntity(onUpdateContextKey.Saw, payload);
|
|
899
|
+
}
|
|
884
900
|
async updateOnPrizeWin(data) {
|
|
885
901
|
if (data.errCode === SAWSpinErrorCode.SAW_OK) {
|
|
886
902
|
var _template$prizes$find;
|