@smartico/public-api 0.0.339 → 0.0.341

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.
@@ -3,4 +3,6 @@ export interface GetActivityLogRequest extends ProtocolMessage {
3
3
  userId: number;
4
4
  startTimeSeconds: number;
5
5
  endTimeSeconds: number;
6
+ limit: number;
7
+ offset: number;
6
8
  }
@@ -41,5 +41,7 @@ export declare enum LiquidEntityData {
41
41
  Bonus = 7,
42
42
  Leaderboard = 8,
43
43
  Badges = 9,
44
- Tournament = 10
44
+ Tournament = 10,
45
+ Raffles = 11,
46
+ SingleRaffle = 12
45
47
  }
@@ -14,6 +14,7 @@ export interface UICustomSection {
14
14
  overview_missions_count?: number;
15
15
  liquid_entity_data?: LiquidEntityData[];
16
16
  ach_tournament_id?: number;
17
+ raffle_id?: number;
17
18
  show_raw_data?: boolean;
18
19
  liquid_template?: number;
19
20
  ach_category_ids?: number[];
@@ -173,7 +173,7 @@ declare class SmarticoAPI {
173
173
  draw_id: number;
174
174
  raffle_run_id: number;
175
175
  }): Promise<RaffleOptinResponse>;
176
- getActivityLog(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number): Promise<GetActivityLogResponse>;
177
- getActivityLogT(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number): Promise<TActivityLog[]>;
176
+ getActivityLog(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, limit: number, offset: number): Promise<GetActivityLogResponse>;
177
+ getActivityLogT(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, from?: number, to?: number): Promise<TActivityLog[]>;
178
178
  }
179
179
  export { SmarticoAPI, MessageSender };
@@ -560,6 +560,8 @@ export declare class WSAPI {
560
560
  * _smartico.api.getActivityLog({
561
561
  * startTimeSeconds: startTime,
562
562
  * endTimeSeconds: endTime,
563
+ * from: 0,
564
+ * to: 50,
563
565
  * onUpdate: (data) => console.log('Updated:', data)
564
566
  * }).then((result) => {
565
567
  * console.log(result);
@@ -570,11 +572,15 @@ export declare class WSAPI {
570
572
  *
571
573
  * @param params.startTimeSeconds - Start time in seconds (epoch timestamp)
572
574
  * @param params.endTimeSeconds - End time in seconds (epoch timestamp)
575
+ * @param params.from - Start index of records to return
576
+ * @param params.to - End index of records to return
573
577
  * @param params.onUpdate - Optional callback function that will be called when the activity log is updated
574
578
  */
575
- getActivityLog({ startTimeSeconds, endTimeSeconds, onUpdate, }: {
579
+ getActivityLog({ startTimeSeconds, endTimeSeconds, from, to, onUpdate, }: {
576
580
  startTimeSeconds: number;
577
581
  endTimeSeconds: number;
582
+ from: number;
583
+ to: number;
578
584
  onUpdate?: (data: TActivityLog[]) => void;
579
585
  }): Promise<TActivityLog[]>;
580
586
  private updateOnSpin;
@@ -846,6 +846,8 @@ export interface TUICustomSection {
846
846
  ach_category_ids?: number[];
847
847
  /** List of IDs of the categories where the store item is assigned, information about categories can be retrieved with getShopCategories method */
848
848
  shop_category_ids?: number[];
849
+ /** ID of the raffle to be used for Liquid templates */
850
+ raffle_id?: number;
849
851
  }
850
852
  export interface TBonus {
851
853
  /** ID of the bonus */
package/dist/index.js CHANGED
@@ -3214,6 +3214,8 @@ var WSAPI = /*#__PURE__*/function () {
3214
3214
  * _smartico.api.getActivityLog({
3215
3215
  * startTimeSeconds: startTime,
3216
3216
  * endTimeSeconds: endTime,
3217
+ * from: 0,
3218
+ * to: 50,
3217
3219
  * onUpdate: (data) => console.log('Updated:', data)
3218
3220
  * }).then((result) => {
3219
3221
  * console.log(result);
@@ -3224,11 +3226,15 @@ var WSAPI = /*#__PURE__*/function () {
3224
3226
  *
3225
3227
  * @param params.startTimeSeconds - Start time in seconds (epoch timestamp)
3226
3228
  * @param params.endTimeSeconds - End time in seconds (epoch timestamp)
3229
+ * @param params.from - Start index of records to return
3230
+ * @param params.to - End index of records to return
3227
3231
  * @param params.onUpdate - Optional callback function that will be called when the activity log is updated
3228
3232
  */;
3229
3233
  _proto.getActivityLog = function getActivityLog(_ref14) {
3230
3234
  var startTimeSeconds = _ref14.startTimeSeconds,
3231
3235
  endTimeSeconds = _ref14.endTimeSeconds,
3236
+ from = _ref14.from,
3237
+ to = _ref14.to,
3232
3238
  onUpdate = _ref14.onUpdate;
3233
3239
  try {
3234
3240
  var _this37 = this;
@@ -3236,7 +3242,7 @@ var WSAPI = /*#__PURE__*/function () {
3236
3242
  _this37.onUpdateCallback.set(onUpdateContextKey.ActivityLog, onUpdate);
3237
3243
  }
3238
3244
  return Promise.resolve(OCache.use(onUpdateContextKey.ActivityLog, exports.ECacheContext.WSAPI, function () {
3239
- return _this37.api.getActivityLogT(null, startTimeSeconds, endTimeSeconds);
3245
+ return _this37.api.getActivityLogT(null, startTimeSeconds, endTimeSeconds, from, to);
3240
3246
  }, CACHE_DATA_SEC));
3241
3247
  } catch (e) {
3242
3248
  return Promise.reject(e);
@@ -3352,7 +3358,7 @@ var WSAPI = /*#__PURE__*/function () {
3352
3358
  var _this48 = this;
3353
3359
  var startSeconds = Date.now() / 1000 - 600;
3354
3360
  var endSeconds = Date.now() / 1000;
3355
- return Promise.resolve(_this48.api.getActivityLogT(null, startSeconds, endSeconds)).then(function (payload) {
3361
+ return Promise.resolve(_this48.api.getActivityLogT(null, startSeconds, endSeconds, 0, 50)).then(function (payload) {
3356
3362
  _this48.updateEntity(onUpdateContextKey.ActivityLog, payload);
3357
3363
  });
3358
3364
  } catch (e) {
@@ -3828,6 +3834,8 @@ exports.LiquidEntityData = void 0;
3828
3834
  LiquidEntityData[LiquidEntityData["Leaderboard"] = 8] = "Leaderboard";
3829
3835
  LiquidEntityData[LiquidEntityData["Badges"] = 9] = "Badges";
3830
3836
  LiquidEntityData[LiquidEntityData["Tournament"] = 10] = "Tournament";
3837
+ LiquidEntityData[LiquidEntityData["Raffles"] = 11] = "Raffles";
3838
+ LiquidEntityData[LiquidEntityData["SingleRaffle"] = 12] = "SingleRaffle";
3831
3839
  })(exports.LiquidEntityData || (exports.LiquidEntityData = {}));
3832
3840
 
3833
3841
  var UICustomSectionTransform = function UICustomSectionTransform(response) {
@@ -3851,6 +3859,7 @@ var UICustomSectionTransform = function UICustomSectionTransform(response) {
3851
3859
  }, r.section_type_id === exports.AchCustomSectionType.LEVELS ? {
3852
3860
  liquid_entity_data: r.liquid_entity_data,
3853
3861
  ach_tournament_id: r.ach_tournament_id,
3862
+ raffle_id: r.raffle_id,
3854
3863
  show_raw_data: r.show_raw_data,
3855
3864
  liquid_template: r.liquid_template
3856
3865
  } : {}, r.section_type_id === exports.AchCustomSectionType.BADGES ? {
@@ -5251,22 +5260,32 @@ var SmarticoAPI = /*#__PURE__*/function () {
5251
5260
  return Promise.reject(e);
5252
5261
  }
5253
5262
  };
5254
- _proto.getActivityLog = function getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds) {
5263
+ _proto.getActivityLog = function getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset) {
5255
5264
  try {
5256
5265
  var _this75 = this;
5257
5266
  var message = _this75.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, {
5258
5267
  startTimeSeconds: Math.floor(startTimeSeconds),
5259
- endTimeSeconds: Math.floor(endTimeSeconds)
5268
+ endTimeSeconds: Math.floor(endTimeSeconds),
5269
+ limit: limit,
5270
+ offset: offset
5260
5271
  });
5261
5272
  return Promise.resolve(_this75.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
5262
5273
  } catch (e) {
5263
5274
  return Promise.reject(e);
5264
5275
  }
5265
5276
  };
5266
- _proto.getActivityLogT = function getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds) {
5277
+ _proto.getActivityLogT = function getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds, from, to) {
5278
+ if (from === void 0) {
5279
+ from = 0;
5280
+ }
5281
+ if (to === void 0) {
5282
+ to = 50;
5283
+ }
5267
5284
  try {
5268
5285
  var _this76 = this;
5269
- return Promise.resolve(_this76.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds)).then(function (_this76$getActivityLo) {
5286
+ var limit = to - from > 50 ? 50 : to - from;
5287
+ var offset = from;
5288
+ return Promise.resolve(_this76.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset)).then(function (_this76$getActivityLo) {
5270
5289
  return ActivityLogTransform(_this76$getActivityLo.logHistory);
5271
5290
  });
5272
5291
  } catch (e) {