@smartico/public-api 0.0.172 → 0.0.173
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 +10 -2
- package/dist/index.js +33 -16
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +17 -2
- package/dist/index.modern.mjs.map +1 -1
- package/docs/classes/WSAPI.md +10 -2
- package/package.json +1 -1
- package/src/WSAPI/WSAPI.ts +19 -4
package/dist/index.modern.mjs
CHANGED
|
@@ -1194,6 +1194,7 @@ class WSAPI {
|
|
|
1194
1194
|
on(ClassId.JP_WIN_PUSH, data => this.jackpotClearCache());
|
|
1195
1195
|
on(ClassId.JP_OPTOUT_RESPONSE, data => this.jackpotClearCache());
|
|
1196
1196
|
on(ClassId.CLAIM_BONUS_RESPONSE, () => this.updateBonuses());
|
|
1197
|
+
on(ClassId.SAW_DO_SPIN_BATCH_RESPONSE, () => this.updateOnAddSpin());
|
|
1197
1198
|
}
|
|
1198
1199
|
}
|
|
1199
1200
|
/** Returns information about current user
|
|
@@ -1504,6 +1505,8 @@ class WSAPI {
|
|
|
1504
1505
|
}
|
|
1505
1506
|
/**
|
|
1506
1507
|
* Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
|
|
1508
|
+
* After playMiniGame is called, you can call getMiniGames to get the list of mini-games.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 playMiniGame with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
1509
|
+
* 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.
|
|
1507
1510
|
*
|
|
1508
1511
|
* **Example**:
|
|
1509
1512
|
* ```
|
|
@@ -1514,7 +1517,12 @@ class WSAPI {
|
|
|
1514
1517
|
*
|
|
1515
1518
|
* **Visitor mode: not supported**
|
|
1516
1519
|
*/
|
|
1517
|
-
async playMiniGame(template_id
|
|
1520
|
+
async playMiniGame(template_id, {
|
|
1521
|
+
onUpdate
|
|
1522
|
+
} = {}) {
|
|
1523
|
+
if (onUpdate) {
|
|
1524
|
+
this.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
|
|
1525
|
+
}
|
|
1518
1526
|
const r = await this.api.sawSpinRequest(null, template_id);
|
|
1519
1527
|
this.api.doAcknowledgeRequest(null, r.request_id);
|
|
1520
1528
|
const o = {
|
|
@@ -1526,6 +1534,8 @@ class WSAPI {
|
|
|
1526
1534
|
}
|
|
1527
1535
|
/**
|
|
1528
1536
|
* Plays the specified by template_id mini-game on behalf of user spin_count times and returns array of the prizes
|
|
1537
|
+
* After playMiniGameBatch is called, you can call getMiniGames to get the list of mini-games. 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 playMiniGameBatch with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
1538
|
+
* 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.
|
|
1529
1539
|
*
|
|
1530
1540
|
* **Example**:
|
|
1531
1541
|
* ```
|
|
@@ -1535,7 +1545,12 @@ class WSAPI {
|
|
|
1535
1545
|
* ```
|
|
1536
1546
|
* **Visitor mode: not supported**
|
|
1537
1547
|
*/
|
|
1538
|
-
async playMiniGameBatch(template_id, spin_count
|
|
1548
|
+
async playMiniGameBatch(template_id, spin_count, {
|
|
1549
|
+
onUpdate
|
|
1550
|
+
} = {}) {
|
|
1551
|
+
if (onUpdate) {
|
|
1552
|
+
this.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
|
|
1553
|
+
}
|
|
1539
1554
|
const response = await this.api.sawSpinBatchRequest(null, template_id, spin_count);
|
|
1540
1555
|
const request_ids = response.results.map(result => result.request_id);
|
|
1541
1556
|
this.api.doAcknowledgeBatchRequest(null, request_ids);
|