@smartico/public-api 0.0.346 → 0.0.348
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/README.md +114 -1
- package/dist/Base/ClassId.d.ts +4 -0
- package/dist/SmarticoAPI.d.ts +4 -1
- package/dist/WSAPI/WSAPI.d.ts +6 -3
- package/dist/index.js +48 -24
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +19 -5
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/classes/WSAPI.md +6 -3
- package/package.json +1 -1
- package/src/Base/ClassId.ts +5 -0
- package/src/SmarticoAPI.ts +16 -2
- package/src/WSAPI/WSAPI.ts +6 -8
package/dist/index.modern.mjs
CHANGED
|
@@ -144,6 +144,10 @@ var ClassId;
|
|
|
144
144
|
RAF_GET_TICKETS_RESPONSE = 903,
|
|
145
145
|
RAF_CLAIM_PRIZE_REQUEST = 906,
|
|
146
146
|
*/
|
|
147
|
+
ClassId[ClassId["BNR_GET_BANNER_PLACEMENTS_REQUEST"] = 950] = "BNR_GET_BANNER_PLACEMENTS_REQUEST";
|
|
148
|
+
ClassId[ClassId["BNR_GET_BANNER_PLACEMENTS_RESPONSE"] = 951] = "BNR_GET_BANNER_PLACEMENTS_RESPONSE";
|
|
149
|
+
ClassId[ClassId["BNR_GET_BANNER_CONTENT_REQUEST"] = 952] = "BNR_GET_BANNER_CONTENT_REQUEST";
|
|
150
|
+
ClassId[ClassId["BNR_GET_BANNER_CONTENT_RESPONSE"] = 953] = "BNR_GET_BANNER_CONTENT_RESPONSE";
|
|
147
151
|
/*
|
|
148
152
|
!Important, if adding new messages that are 'acting' on behalf of the client,
|
|
149
153
|
you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION
|
|
@@ -2312,7 +2316,7 @@ class WSAPI {
|
|
|
2312
2316
|
async getCurrentLevel() {
|
|
2313
2317
|
return OCache.use(onUpdateContextKey.CurrentLevel, ECacheContext.WSAPI, () => this.api.getLevelCurrent(null), CACHE_DATA_SEC);
|
|
2314
2318
|
}
|
|
2315
|
-
/** Returns all the missions
|
|
2319
|
+
/** Returns all the missions configured for the current user (server-side scoped, not filtered by Widget visibility).
|
|
2316
2320
|
* The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
2317
2321
|
* Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
2318
2322
|
* The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
|
|
@@ -2537,7 +2541,7 @@ class WSAPI {
|
|
|
2537
2541
|
return OCache.use(onUpdateContextKey.CustomSections, ECacheContext.WSAPI, () => this.api.customSectionsGetT(null), CACHE_DATA_SEC);
|
|
2538
2542
|
}
|
|
2539
2543
|
/**
|
|
2540
|
-
* Returns the list of mini-games
|
|
2544
|
+
* Returns the list of mini-games configured for the current user (not filtered by spin availability or Widget visibility).
|
|
2541
2545
|
* 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.
|
|
2542
2546
|
* 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.
|
|
2543
2547
|
*
|
|
@@ -3237,7 +3241,8 @@ class WSAPI {
|
|
|
3237
3241
|
return OCache.use(onUpdateContextKey.Raffles, ECacheContext.WSAPI, () => this.api.getRafflesT(null), CACHE_DATA_SEC);
|
|
3238
3242
|
}
|
|
3239
3243
|
/**
|
|
3240
|
-
* Returns draw run for provided raffle_id and run_id
|
|
3244
|
+
* Returns draw run for provided raffle_id and run_id.
|
|
3245
|
+
* You can pass winners_from and winners_to parameters to get a specific range of winners. Default is 0-20.
|
|
3241
3246
|
*
|
|
3242
3247
|
*
|
|
3243
3248
|
* **Example**:
|
|
@@ -3259,11 +3264,10 @@ class WSAPI {
|
|
|
3259
3264
|
*
|
|
3260
3265
|
*/
|
|
3261
3266
|
async getRaffleDrawRun(props) {
|
|
3262
|
-
const res = await this.api.getRaffleDrawRun(null, props);
|
|
3263
3267
|
if (!props.raffle_id || !props.run_id) {
|
|
3264
3268
|
throw new Error('both raffle_id and run_id are required');
|
|
3265
3269
|
}
|
|
3266
|
-
return
|
|
3270
|
+
return await this.api.getRaffleDrawRunT(null, props.raffle_id, props.run_id, props.winners_from, props.winners_to);
|
|
3267
3271
|
}
|
|
3268
3272
|
/**
|
|
3269
3273
|
* Returns history of draw runs for the provided raffle_id and draw_id, if the draw_id is not provided will return history of all the draws for the provided raffle_id
|
|
@@ -4290,6 +4294,16 @@ class SmarticoAPI {
|
|
|
4290
4294
|
const message = this.buildMessage(user_ext_id, ClassId.RAF_GET_DRAW_RUN_REQUEST, payload);
|
|
4291
4295
|
return await this.send(message, ClassId.RAF_GET_DRAW_RUN_RESPONSE);
|
|
4292
4296
|
}
|
|
4297
|
+
async getRaffleDrawRunT(user_ext_id, raffle_id, run_id, winners_from = 0, winners_to = 20) {
|
|
4298
|
+
const winners_limit = winners_to - winners_from > 50 ? 50 : winners_to - winners_from;
|
|
4299
|
+
const winners_offset = winners_from;
|
|
4300
|
+
return drawRunTransform(await this.getRaffleDrawRun(user_ext_id, {
|
|
4301
|
+
raffle_id,
|
|
4302
|
+
run_id,
|
|
4303
|
+
winners_limit,
|
|
4304
|
+
winners_offset
|
|
4305
|
+
}));
|
|
4306
|
+
}
|
|
4293
4307
|
async getRaffleDrawRunsHistory(user_ext_id, props) {
|
|
4294
4308
|
const message = this.buildMessage(user_ext_id, ClassId.RAF_GET_DRAW_HISTORY_REQUEST, props);
|
|
4295
4309
|
return await this.send(message, ClassId.RAF_GET_DRAW_HISTORY_RESPONSE);
|