@smartico/public-api 0.0.346 → 0.0.347

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.
@@ -3237,7 +3237,8 @@ class WSAPI {
3237
3237
  return OCache.use(onUpdateContextKey.Raffles, ECacheContext.WSAPI, () => this.api.getRafflesT(null), CACHE_DATA_SEC);
3238
3238
  }
3239
3239
  /**
3240
- * Returns draw run for provided raffle_id and run_id
3240
+ * Returns draw run for provided raffle_id and run_id.
3241
+ * You can pass winners_from and winners_to parameters to get a specific range of winners. Default is 0-20.
3241
3242
  *
3242
3243
  *
3243
3244
  * **Example**:
@@ -3259,11 +3260,10 @@ class WSAPI {
3259
3260
  *
3260
3261
  */
3261
3262
  async getRaffleDrawRun(props) {
3262
- const res = await this.api.getRaffleDrawRun(null, props);
3263
3263
  if (!props.raffle_id || !props.run_id) {
3264
3264
  throw new Error('both raffle_id and run_id are required');
3265
3265
  }
3266
- return drawRunTransform(res);
3266
+ return await this.api.getRaffleDrawRunT(null, props.raffle_id, props.run_id, props.winners_from, props.winners_to);
3267
3267
  }
3268
3268
  /**
3269
3269
  * 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 +4290,16 @@ class SmarticoAPI {
4290
4290
  const message = this.buildMessage(user_ext_id, ClassId.RAF_GET_DRAW_RUN_REQUEST, payload);
4291
4291
  return await this.send(message, ClassId.RAF_GET_DRAW_RUN_RESPONSE);
4292
4292
  }
4293
+ async getRaffleDrawRunT(user_ext_id, raffle_id, run_id, winners_from = 0, winners_to = 20) {
4294
+ const winners_limit = winners_to - winners_from > 50 ? 50 : winners_to - winners_from;
4295
+ const winners_offset = winners_from;
4296
+ return drawRunTransform(await this.getRaffleDrawRun(user_ext_id, {
4297
+ raffle_id,
4298
+ run_id,
4299
+ winners_limit,
4300
+ winners_offset
4301
+ }));
4302
+ }
4293
4303
  async getRaffleDrawRunsHistory(user_ext_id, props) {
4294
4304
  const message = this.buildMessage(user_ext_id, ClassId.RAF_GET_DRAW_HISTORY_REQUEST, props);
4295
4305
  return await this.send(message, ClassId.RAF_GET_DRAW_HISTORY_RESPONSE);