@smartico/public-api 0.0.324 → 0.0.326

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.
Files changed (42) hide show
  1. package/dist/Base/ClassId.d.ts +2 -0
  2. package/dist/MiniGames/AttemptPeriodType.d.ts +6 -0
  3. package/dist/MiniGames/SAWPrize.d.ts +2 -0
  4. package/dist/MiniGames/index.d.ts +1 -0
  5. package/dist/PointsHistory/GetPointsHistoryRequest.d.ts +6 -0
  6. package/dist/PointsHistory/GetPointsHistoryResponse.d.ts +7 -0
  7. package/dist/PointsHistory/PointChangeSourceType.d.ts +19 -0
  8. package/dist/PointsHistory/PointsHistoryLog.d.ts +21 -0
  9. package/dist/PointsHistory/UserBalanceType.d.ts +5 -0
  10. package/dist/PointsHistory/index.d.ts +5 -0
  11. package/dist/SmarticoAPI.d.ts +13 -2
  12. package/dist/WSAPI/WSAPI.d.ts +83 -1
  13. package/dist/WSAPI/WSAPITypes.d.ts +28 -2
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.js +295 -74
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.modern.mjs +199 -3
  18. package/dist/index.modern.mjs.map +1 -1
  19. package/docs/README.md +4 -0
  20. package/docs/classes/WSAPI.md +107 -0
  21. package/docs/enums/AttemptPeriodType.md +25 -0
  22. package/docs/enums/PointChangeSourceType.md +103 -0
  23. package/docs/enums/UserBalanceType.md +19 -0
  24. package/docs/interfaces/SAWPrize.md +6 -0
  25. package/docs/interfaces/TMiniGamePrize.md +8 -0
  26. package/docs/interfaces/TPointsHistoryLog.md +68 -0
  27. package/package.json +1 -1
  28. package/src/Base/ClassId.ts +3 -0
  29. package/src/MiniGames/AttemptPeriodType.ts +6 -0
  30. package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
  31. package/src/MiniGames/SAWPrize.ts +2 -0
  32. package/src/MiniGames/index.ts +2 -1
  33. package/src/PointsHistory/GetPointsHistoryRequest.ts +8 -0
  34. package/src/PointsHistory/GetPointsHistoryResponse.ts +39 -0
  35. package/src/PointsHistory/PointChangeSourceType.ts +20 -0
  36. package/src/PointsHistory/PointsHistoryLog.ts +24 -0
  37. package/src/PointsHistory/UserBalanceType.ts +6 -0
  38. package/src/PointsHistory/index.ts +6 -0
  39. package/src/SmarticoAPI.ts +64 -0
  40. package/src/WSAPI/WSAPI.ts +126 -3
  41. package/src/WSAPI/WSAPITypes.ts +28 -2
  42. package/src/index.ts +2 -1
package/dist/index.js CHANGED
@@ -84,6 +84,8 @@ exports.ClassId = void 0;
84
84
  ClassId[ClassId["ACH_SHOP_ITEM_HISTORY_RESPONSE"] = 542] = "ACH_SHOP_ITEM_HISTORY_RESPONSE";
85
85
  ClassId[ClassId["GET_RELATED_ACH_N_TOURNAMENTS_REQUEST"] = 543] = "GET_RELATED_ACH_N_TOURNAMENTS_REQUEST";
86
86
  ClassId[ClassId["GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE"] = 544] = "GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE";
87
+ ClassId[ClassId["GET_POINT_HISTORY_REQUEST"] = 545] = "GET_POINT_HISTORY_REQUEST";
88
+ ClassId[ClassId["GET_POINT_HISTORY_RESPONSE"] = 546] = "GET_POINT_HISTORY_RESPONSE";
87
89
  /*
88
90
  !Important, if adding new messages that are 'acting' on behalf of the client,
89
91
  you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION
@@ -486,7 +488,8 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
486
488
  prize_modifiers: p.saw_prize_ui_definition.prize_modifiers,
487
489
  allow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,
488
490
  hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history,
489
- requirements_to_get_prize: p.saw_prize_ui_definition.requirements_to_get_prize
491
+ requirements_to_get_prize: p.saw_prize_ui_definition.requirements_to_get_prize,
492
+ max_give_period_type_id: p.max_give_period_type_id
490
493
  };
491
494
  return y;
492
495
  })
@@ -601,6 +604,14 @@ exports.SAWExposeUserSpinId = void 0;
601
604
  SAWExposeUserSpinId[SAWExposeUserSpinId["SpinId"] = 2] = "SpinId";
602
605
  })(exports.SAWExposeUserSpinId || (exports.SAWExposeUserSpinId = {}));
603
606
 
607
+ exports.AttemptPeriodType = void 0;
608
+ (function (AttemptPeriodType) {
609
+ AttemptPeriodType[AttemptPeriodType["FromLastAttempt"] = 1] = "FromLastAttempt";
610
+ AttemptPeriodType[AttemptPeriodType["CalendarDaysUTC"] = 2] = "CalendarDaysUTC";
611
+ AttemptPeriodType[AttemptPeriodType["CalendarDaysUserTimeZone"] = 3] = "CalendarDaysUserTimeZone";
612
+ AttemptPeriodType[AttemptPeriodType["Lifetime"] = 4] = "Lifetime";
613
+ })(exports.AttemptPeriodType || (exports.AttemptPeriodType = {}));
614
+
604
615
  var NodeCache = /*#__PURE__*/function () {
605
616
  function NodeCache() {
606
617
  var _this = this;
@@ -2091,6 +2102,7 @@ var onUpdateContextKey;
2091
2102
  onUpdateContextKey["JackpotEligibleGames"] = "jackpotEligibleGames";
2092
2103
  onUpdateContextKey["CurrentLevel"] = "currentLevel";
2093
2104
  onUpdateContextKey["InboxUnreadCount"] = "inboxUnreadCount";
2105
+ onUpdateContextKey["PointsHistory"] = "pointsHistory";
2094
2106
  })(onUpdateContextKey || (onUpdateContextKey = {}));
2095
2107
  /** @group General API */
2096
2108
  var WSAPI = /*#__PURE__*/function () {
@@ -2169,10 +2181,13 @@ var WSAPI = /*#__PURE__*/function () {
2169
2181
  }
2170
2182
  });
2171
2183
  on(exports.ClassId.CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT, function (data) {
2172
- var _data$props, _data$props2;
2184
+ var _data$props, _data$props2, _data$props3, _data$props4, _data$props5;
2173
2185
  if ((data == null || (_data$props = data.props) == null ? void 0 : _data$props.core_inbox_unread_count) !== undefined && (data == null || (_data$props2 = data.props) == null ? void 0 : _data$props2.core_inbox_unread_count) !== null) {
2174
2186
  _this.updateInboxUnreadCount(data.props.core_inbox_unread_count);
2175
2187
  }
2188
+ if ((data == null || (_data$props3 = data.props) == null ? void 0 : _data$props3.ach_points_balance) !== undefined || (data == null || (_data$props4 = data.props) == null ? void 0 : _data$props4.ach_gems_balance) !== undefined || (data == null || (_data$props5 = data.props) == null ? void 0 : _data$props5.ach_diamonds_balance) !== undefined) {
2189
+ _this.notifyPointsHistoryUpdate();
2190
+ }
2176
2191
  });
2177
2192
  }
2178
2193
  }
@@ -3102,18 +3117,112 @@ var WSAPI = /*#__PURE__*/function () {
3102
3117
  } catch (e) {
3103
3118
  return Promise.reject(e);
3104
3119
  }
3120
+ }
3121
+ /**
3122
+ * Reports an impression event for an engagement (when engagement content is displayed to the user).
3123
+ * Use this method to track when users view engagement content such as inbox messages, popups.
3124
+ * When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType.
3125
+ *
3126
+ * **Example**:
3127
+ * ```
3128
+ * _smartico.api.reportImpressionEvent({
3129
+ * engagement_uid: 'abc123-def456',
3130
+ * activityType: 31 // Inbox
3131
+ * });
3132
+ * ```
3133
+ *
3134
+ * **Visitor mode: not supported**
3135
+ *
3136
+ * @param params.engagement_uid - Unique identifier for the engagement
3137
+ * @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
3138
+ */
3139
+ ;
3140
+ _proto.reportImpressionEvent = function reportImpressionEvent(_ref12) {
3141
+ var engagement_uid = _ref12.engagement_uid,
3142
+ activityType = _ref12.activityType;
3143
+ this.api.reportEngagementImpression(null, engagement_uid, activityType);
3144
+ }
3145
+ /**
3146
+ * Reports a click/action event for an engagement (when user interacts with engagement content).
3147
+ * Use this method to track when users click on or interact with engagement content such as inbox messages, popups.
3148
+ * When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType, and pass the action/deeplink that was triggered by the user interaction as action.
3149
+ *
3150
+ *
3151
+ * **Example**:
3152
+ * ```
3153
+ * _smartico.api.reportClickEvent({
3154
+ * engagement_uid: 'abc123-def456',
3155
+ * activityType: 31 // Inbox,
3156
+ * action: 'dp:gf_missions'
3157
+ * });
3158
+ * ```
3159
+ *
3160
+ * **Visitor mode: not supported**
3161
+ *
3162
+ * @param params.engagement_uid - Unique identifier for the engagement
3163
+ * @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
3164
+ * @param params.action - Optional action/deeplink that was triggered by the user interaction
3165
+ */;
3166
+ _proto.reportClickEvent = function reportClickEvent(_ref13) {
3167
+ var engagement_uid = _ref13.engagement_uid,
3168
+ activityType = _ref13.activityType,
3169
+ action = _ref13.action;
3170
+ this.api.reportEngagementAction(null, engagement_uid, activityType, action);
3171
+ }
3172
+ /**
3173
+ * Returns the points history for a user within a specified time range.
3174
+ * The response includes both points changes and gems/diamonds changes.
3175
+ * Each log entry contains information about the change amount, balance, and source.
3176
+ * The returned list is cached for 30 seconds.
3177
+ * You can pass the onUpdate callback as a parameter, it will be called every time the points history is updated and will provide the updated list of points history logs for the last 10 minutes.
3178
+ *
3179
+ * **Example**:
3180
+ * ```
3181
+ * const startTime = Math.floor(Date.now() / 1000) - 86400 * 30; // 30 days ago
3182
+ * const endTime = Math.floor(Date.now() / 1000); // now
3183
+ *
3184
+ * _smartico.api.getPointsHistory({
3185
+ * startTimeSeconds: startTime,
3186
+ * endTimeSeconds: endTime,
3187
+ * onUpdate: (data) => console.log('Updated:', data)
3188
+ * }).then((result) => {
3189
+ * console.log(result);
3190
+ * });
3191
+ * ```
3192
+ *
3193
+ * **Visitor mode: not supported**
3194
+ *
3195
+ * @param params.startTimeSeconds - Start time in seconds (epoch timestamp)
3196
+ * @param params.endTimeSeconds - End time in seconds (epoch timestamp)
3197
+ * @param params.onUpdate - Optional callback function that will be called when the points history is updated
3198
+ */;
3199
+ _proto.getPointsHistory = function getPointsHistory(_ref14) {
3200
+ var startTimeSeconds = _ref14.startTimeSeconds,
3201
+ endTimeSeconds = _ref14.endTimeSeconds,
3202
+ onUpdate = _ref14.onUpdate;
3203
+ try {
3204
+ var _this37 = this;
3205
+ if (onUpdate) {
3206
+ _this37.onUpdateCallback.set(onUpdateContextKey.PointsHistory, onUpdate);
3207
+ }
3208
+ return Promise.resolve(OCache.use(onUpdateContextKey.PointsHistory, exports.ECacheContext.WSAPI, function () {
3209
+ return _this37.api.getPointsHistoryT(null, startTimeSeconds, endTimeSeconds);
3210
+ }, CACHE_DATA_SEC));
3211
+ } catch (e) {
3212
+ return Promise.reject(e);
3213
+ }
3105
3214
  };
3106
3215
  _proto.updateOnSpin = function updateOnSpin(data) {
3107
3216
  try {
3108
- var _this37 = this;
3217
+ var _this38 = this;
3109
3218
  return Promise.resolve(OCache.use(onUpdateContextKey.Saw, exports.ECacheContext.WSAPI, function () {
3110
- return _this37.api.sawGetTemplatesT(null);
3219
+ return _this38.api.sawGetTemplatesT(null);
3111
3220
  }, CACHE_DATA_SEC)).then(function (templates) {
3112
3221
  var index = templates.findIndex(function (t) {
3113
3222
  return t.id === data.saw_template_id;
3114
3223
  });
3115
3224
  templates[index].spin_count = data.spin_count;
3116
- _this37.updateEntity(onUpdateContextKey.Saw, templates);
3225
+ _this38.updateEntity(onUpdateContextKey.Saw, templates);
3117
3226
  });
3118
3227
  } catch (e) {
3119
3228
  return Promise.reject(e);
@@ -3121,9 +3230,9 @@ var WSAPI = /*#__PURE__*/function () {
3121
3230
  };
3122
3231
  _proto.reloadMiniGameTemplate = function reloadMiniGameTemplate() {
3123
3232
  try {
3124
- var _this38 = this;
3125
- return Promise.resolve(_this38.api.sawGetTemplatesT(null)).then(function (updatedTemplates) {
3126
- _this38.updateEntity(onUpdateContextKey.Saw, updatedTemplates);
3233
+ var _this39 = this;
3234
+ return Promise.resolve(_this39.api.sawGetTemplatesT(null)).then(function (updatedTemplates) {
3235
+ _this39.updateEntity(onUpdateContextKey.Saw, updatedTemplates);
3127
3236
  });
3128
3237
  } catch (e) {
3129
3238
  return Promise.reject(e);
@@ -3131,9 +3240,9 @@ var WSAPI = /*#__PURE__*/function () {
3131
3240
  };
3132
3241
  _proto.updateMissions = function updateMissions() {
3133
3242
  try {
3134
- var _this39 = this;
3135
- return Promise.resolve(_this39.api.missionsGetItemsT(null)).then(function (payload) {
3136
- _this39.updateEntity(onUpdateContextKey.Missions, payload);
3243
+ var _this40 = this;
3244
+ return Promise.resolve(_this40.api.missionsGetItemsT(null)).then(function (payload) {
3245
+ _this40.updateEntity(onUpdateContextKey.Missions, payload);
3137
3246
  });
3138
3247
  } catch (e) {
3139
3248
  return Promise.reject(e);
@@ -3141,9 +3250,9 @@ var WSAPI = /*#__PURE__*/function () {
3141
3250
  };
3142
3251
  _proto.updateBonuses = function updateBonuses() {
3143
3252
  try {
3144
- var _this40 = this;
3145
- return Promise.resolve(_this40.api.bonusesGetItemsT(null)).then(function (payload) {
3146
- _this40.updateEntity(onUpdateContextKey.Bonuses, payload);
3253
+ var _this41 = this;
3254
+ return Promise.resolve(_this41.api.bonusesGetItemsT(null)).then(function (payload) {
3255
+ _this41.updateEntity(onUpdateContextKey.Bonuses, payload);
3147
3256
  });
3148
3257
  } catch (e) {
3149
3258
  return Promise.reject(e);
@@ -3151,9 +3260,9 @@ var WSAPI = /*#__PURE__*/function () {
3151
3260
  };
3152
3261
  _proto.updateTournaments = function updateTournaments() {
3153
3262
  try {
3154
- var _this41 = this;
3155
- return Promise.resolve(_this41.api.tournamentsGetLobbyT(null)).then(function (payload) {
3156
- _this41.updateEntity(onUpdateContextKey.TournamentList, payload);
3263
+ var _this42 = this;
3264
+ return Promise.resolve(_this42.api.tournamentsGetLobbyT(null)).then(function (payload) {
3265
+ _this42.updateEntity(onUpdateContextKey.TournamentList, payload);
3157
3266
  });
3158
3267
  } catch (e) {
3159
3268
  return Promise.reject(e);
@@ -3161,9 +3270,9 @@ var WSAPI = /*#__PURE__*/function () {
3161
3270
  };
3162
3271
  _proto.updateStorePurchasedItems = function updateStorePurchasedItems() {
3163
3272
  try {
3164
- var _this42 = this;
3165
- return Promise.resolve(_this42.api.storeGetPurchasedItemsT(null, 20, 0)).then(function (payload) {
3166
- _this42.updateEntity(onUpdateContextKey.StoreHistory, payload);
3273
+ var _this43 = this;
3274
+ return Promise.resolve(_this43.api.storeGetPurchasedItemsT(null, 20, 0)).then(function (payload) {
3275
+ _this43.updateEntity(onUpdateContextKey.StoreHistory, payload);
3167
3276
  });
3168
3277
  } catch (e) {
3169
3278
  return Promise.reject(e);
@@ -3171,9 +3280,9 @@ var WSAPI = /*#__PURE__*/function () {
3171
3280
  };
3172
3281
  _proto.updateStoreItems = function updateStoreItems() {
3173
3282
  try {
3174
- var _this43 = this;
3175
- return Promise.resolve(_this43.api.storeGetItemsT(null)).then(function (payload) {
3176
- _this43.updateEntity(onUpdateContextKey.StoreItems, payload);
3283
+ var _this44 = this;
3284
+ return Promise.resolve(_this44.api.storeGetItemsT(null)).then(function (payload) {
3285
+ _this44.updateEntity(onUpdateContextKey.StoreItems, payload);
3177
3286
  });
3178
3287
  } catch (e) {
3179
3288
  return Promise.reject(e);
@@ -3181,8 +3290,8 @@ var WSAPI = /*#__PURE__*/function () {
3181
3290
  };
3182
3291
  _proto.updateInboxUnreadCount = function updateInboxUnreadCount(count) {
3183
3292
  try {
3184
- var _this44 = this;
3185
- _this44.updateEntity(onUpdateContextKey.InboxUnreadCount, count);
3293
+ var _this45 = this;
3294
+ _this45.updateEntity(onUpdateContextKey.InboxUnreadCount, count);
3186
3295
  return Promise.resolve();
3187
3296
  } catch (e) {
3188
3297
  return Promise.reject(e);
@@ -3190,9 +3299,9 @@ var WSAPI = /*#__PURE__*/function () {
3190
3299
  };
3191
3300
  _proto.updateInboxMessages = function updateInboxMessages() {
3192
3301
  try {
3193
- var _this45 = this;
3194
- return Promise.resolve(_this45.api.getInboxMessagesT(null)).then(function (payload) {
3195
- _this45.updateEntity(onUpdateContextKey.InboxMessages, payload);
3302
+ var _this46 = this;
3303
+ return Promise.resolve(_this46.api.getInboxMessagesT(null)).then(function (payload) {
3304
+ _this46.updateEntity(onUpdateContextKey.InboxMessages, payload);
3196
3305
  });
3197
3306
  } catch (e) {
3198
3307
  return Promise.reject(e);
@@ -3200,9 +3309,21 @@ var WSAPI = /*#__PURE__*/function () {
3200
3309
  };
3201
3310
  _proto.updateRaffles = function updateRaffles() {
3202
3311
  try {
3203
- var _this46 = this;
3204
- return Promise.resolve(_this46.api.getRafflesT(null)).then(function (payload) {
3205
- _this46.updateEntity(onUpdateContextKey.Raffles, payload);
3312
+ var _this47 = this;
3313
+ return Promise.resolve(_this47.api.getRafflesT(null)).then(function (payload) {
3314
+ _this47.updateEntity(onUpdateContextKey.Raffles, payload);
3315
+ });
3316
+ } catch (e) {
3317
+ return Promise.reject(e);
3318
+ }
3319
+ };
3320
+ _proto.notifyPointsHistoryUpdate = function notifyPointsHistoryUpdate() {
3321
+ try {
3322
+ var _this48 = this;
3323
+ var startSeconds = Date.now() / 1000 - 600;
3324
+ var endSeconds = Date.now() / 1000;
3325
+ return Promise.resolve(_this48.api.getPointsHistoryT(null, startSeconds, endSeconds)).then(function (payload) {
3326
+ _this48.updateEntity(onUpdateContextKey.PointsHistory, payload);
3206
3327
  });
3207
3328
  } catch (e) {
3208
3329
  return Promise.reject(e);
@@ -3210,9 +3331,9 @@ var WSAPI = /*#__PURE__*/function () {
3210
3331
  };
3211
3332
  _proto.updateEntity = function updateEntity(contextKey, payload) {
3212
3333
  try {
3213
- var _this47 = this;
3334
+ var _this49 = this;
3214
3335
  OCache.set(contextKey, payload, exports.ECacheContext.WSAPI);
3215
- var onUpdate = _this47.onUpdateCallback.get(contextKey);
3336
+ var onUpdate = _this49.onUpdateCallback.get(contextKey);
3216
3337
  if (onUpdate) {
3217
3338
  onUpdate(payload);
3218
3339
  }
@@ -3253,17 +3374,17 @@ var WSAPI = /*#__PURE__*/function () {
3253
3374
  ;
3254
3375
  _proto.jackpotGet = function jackpotGet(filter) {
3255
3376
  try {
3256
- var _this48 = this;
3377
+ var _this50 = this;
3257
3378
  var signature = (filter == null ? void 0 : filter.jp_template_id) + ":" + (filter == null ? void 0 : filter.related_game_id);
3258
- if (signature !== _this48.jackpotGetSignature) {
3259
- _this48.jackpotGetSignature = signature;
3260
- _this48.jackpotClearCache();
3379
+ if (signature !== _this50.jackpotGetSignature) {
3380
+ _this50.jackpotGetSignature = signature;
3381
+ _this50.jackpotClearCache();
3261
3382
  }
3262
3383
  var jackpots = [];
3263
3384
  var pots = [];
3264
3385
  return Promise.resolve(OCache.use(onUpdateContextKey.Jackpots, exports.ECacheContext.WSAPI, function () {
3265
3386
  try {
3266
- return Promise.resolve(_this48.api.jackpotGet(null, filter)).then(function (_jackpots) {
3387
+ return Promise.resolve(_this50.api.jackpotGet(null, filter)).then(function (_jackpots) {
3267
3388
  var _pots = _jackpots.items.map(function (jp) {
3268
3389
  return jp.pot;
3269
3390
  });
@@ -3276,7 +3397,7 @@ var WSAPI = /*#__PURE__*/function () {
3276
3397
  } catch (e) {
3277
3398
  return Promise.reject(e);
3278
3399
  }
3279
- }, JACKPOT_TEMPLATE_CACHE_SEC)).then(function (_OCache$use) {
3400
+ }, JACKPOT_TEMPLATE_CACHE_SEC)).then(function (_OCache$use2) {
3280
3401
  function _temp12() {
3281
3402
  return jackpots.map(function (jp) {
3282
3403
  var _jp = _extends({}, jp, {
@@ -3287,7 +3408,7 @@ var WSAPI = /*#__PURE__*/function () {
3287
3408
  return _jp;
3288
3409
  });
3289
3410
  }
3290
- jackpots = _OCache$use;
3411
+ jackpots = _OCache$use2;
3291
3412
  var _temp11 = function () {
3292
3413
  if (jackpots.length > 0) {
3293
3414
  return Promise.resolve(OCache.use(onUpdateContextKey.Pots, exports.ECacheContext.WSAPI, function () {
@@ -3295,16 +3416,16 @@ var WSAPI = /*#__PURE__*/function () {
3295
3416
  var jp_template_ids = jackpots.map(function (jp) {
3296
3417
  return jp.jp_template_id;
3297
3418
  });
3298
- return Promise.resolve(_this48.api.potGet(null, {
3419
+ return Promise.resolve(_this50.api.potGet(null, {
3299
3420
  jp_template_ids: jp_template_ids
3300
- })).then(function (_this48$api$potGet) {
3301
- return _this48$api$potGet.items;
3421
+ })).then(function (_this50$api$potGet) {
3422
+ return _this50$api$potGet.items;
3302
3423
  });
3303
3424
  } catch (e) {
3304
3425
  return Promise.reject(e);
3305
3426
  }
3306
- }, JACKPOT_POT_CACHE_SEC)).then(function (_OCache$use2) {
3307
- pots = _OCache$use2;
3427
+ }, JACKPOT_POT_CACHE_SEC)).then(function (_OCache$use3) {
3428
+ pots = _OCache$use3;
3308
3429
  });
3309
3430
  }
3310
3431
  }();
@@ -3331,11 +3452,11 @@ var WSAPI = /*#__PURE__*/function () {
3331
3452
  ;
3332
3453
  _proto.jackpotOptIn = function jackpotOptIn(filter) {
3333
3454
  try {
3334
- var _this49 = this;
3455
+ var _this51 = this;
3335
3456
  if (!filter.jp_template_id) {
3336
3457
  throw new Error('jp_template_id is required in jackpotOptIn');
3337
3458
  }
3338
- return Promise.resolve(_this49.api.jackpotOptIn(null, filter));
3459
+ return Promise.resolve(_this51.api.jackpotOptIn(null, filter));
3339
3460
  } catch (e) {
3340
3461
  return Promise.reject(e);
3341
3462
  }
@@ -3357,11 +3478,11 @@ var WSAPI = /*#__PURE__*/function () {
3357
3478
  ;
3358
3479
  _proto.jackpotOptOut = function jackpotOptOut(filter) {
3359
3480
  try {
3360
- var _this50 = this;
3481
+ var _this52 = this;
3361
3482
  if (!filter.jp_template_id) {
3362
3483
  throw new Error('jp_template_id is required in jackpotOptOut');
3363
3484
  }
3364
- return Promise.resolve(_this50.api.jackpotOptOut(null, filter));
3485
+ return Promise.resolve(_this52.api.jackpotOptOut(null, filter));
3365
3486
  } catch (e) {
3366
3487
  return Promise.reject(e);
3367
3488
  }
@@ -3382,14 +3503,14 @@ var WSAPI = /*#__PURE__*/function () {
3382
3503
  *
3383
3504
  */
3384
3505
  ;
3385
- _proto.getJackpotWinners = function getJackpotWinners(_ref12) {
3386
- var limit = _ref12.limit,
3387
- offset = _ref12.offset,
3388
- jp_template_id = _ref12.jp_template_id;
3506
+ _proto.getJackpotWinners = function getJackpotWinners(_ref15) {
3507
+ var limit = _ref15.limit,
3508
+ offset = _ref15.offset,
3509
+ jp_template_id = _ref15.jp_template_id;
3389
3510
  try {
3390
- var _this51 = this;
3511
+ var _this53 = this;
3391
3512
  return Promise.resolve(OCache.use(onUpdateContextKey.JackpotWinners + jp_template_id, exports.ECacheContext.WSAPI, function () {
3392
- return _this51.api.getJackpotWinnersT(null, limit, offset, jp_template_id);
3513
+ return _this53.api.getJackpotWinnersT(null, limit, offset, jp_template_id);
3393
3514
  }, JACKPOT_WINNERS_CACHE_SEC));
3394
3515
  } catch (e) {
3395
3516
  return Promise.reject(e);
@@ -3409,16 +3530,16 @@ var WSAPI = /*#__PURE__*/function () {
3409
3530
  *
3410
3531
  */
3411
3532
  ;
3412
- _proto.getJackpotEligibleGames = function getJackpotEligibleGames(_ref13) {
3413
- var jp_template_id = _ref13.jp_template_id,
3414
- onUpdate = _ref13.onUpdate;
3533
+ _proto.getJackpotEligibleGames = function getJackpotEligibleGames(_ref16) {
3534
+ var jp_template_id = _ref16.jp_template_id,
3535
+ onUpdate = _ref16.onUpdate;
3415
3536
  try {
3416
- var _this52 = this;
3537
+ var _this54 = this;
3417
3538
  if (onUpdate) {
3418
- _this52.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);
3539
+ _this54.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);
3419
3540
  }
3420
3541
  return Promise.resolve(OCache.use(onUpdateContextKey.JackpotEligibleGames + jp_template_id, exports.ECacheContext.WSAPI, function () {
3421
- return _this52.api.getJackpotEligibleGamesT(null, {
3542
+ return _this54.api.getJackpotEligibleGamesT(null, {
3422
3543
  jp_template_id: jp_template_id
3423
3544
  });
3424
3545
  }, JACKPOT_ELIGIBLE_GAMES_CACHE_SEC));
@@ -3447,8 +3568,8 @@ var WSAPI = /*#__PURE__*/function () {
3447
3568
  ;
3448
3569
  _proto.getRelatedItemsForGame = function getRelatedItemsForGame(related_game_id) {
3449
3570
  try {
3450
- var _this53 = this;
3451
- return Promise.resolve(_this53.api.getRelatedItemsForGame(null, related_game_id));
3571
+ var _this55 = this;
3572
+ return Promise.resolve(_this55.api.getRelatedItemsForGame(null, related_game_id));
3452
3573
  } catch (e) {
3453
3574
  return Promise.reject(e);
3454
3575
  }
@@ -3477,15 +3598,15 @@ var WSAPI = /*#__PURE__*/function () {
3477
3598
  */
3478
3599
  ;
3479
3600
  _proto.getRaffles = function getRaffles(_temp13) {
3480
- var _ref14 = _temp13 === void 0 ? {} : _temp13,
3481
- onUpdate = _ref14.onUpdate;
3601
+ var _ref17 = _temp13 === void 0 ? {} : _temp13,
3602
+ onUpdate = _ref17.onUpdate;
3482
3603
  try {
3483
- var _this54 = this;
3604
+ var _this56 = this;
3484
3605
  if (onUpdate) {
3485
- _this54.onUpdateCallback.set(onUpdateContextKey.Raffles, onUpdate);
3606
+ _this56.onUpdateCallback.set(onUpdateContextKey.Raffles, onUpdate);
3486
3607
  }
3487
3608
  return Promise.resolve(OCache.use(onUpdateContextKey.Raffles, exports.ECacheContext.WSAPI, function () {
3488
- return _this54.api.getRafflesT(null);
3609
+ return _this56.api.getRafflesT(null);
3489
3610
  }, CACHE_DATA_SEC));
3490
3611
  } catch (e) {
3491
3612
  return Promise.reject(e);
@@ -3516,8 +3637,8 @@ var WSAPI = /*#__PURE__*/function () {
3516
3637
  ;
3517
3638
  _proto.getRaffleDrawRun = function getRaffleDrawRun(props) {
3518
3639
  try {
3519
- var _this55 = this;
3520
- return Promise.resolve(_this55.api.getRaffleDrawRun(null, props)).then(function (res) {
3640
+ var _this57 = this;
3641
+ return Promise.resolve(_this57.api.getRaffleDrawRun(null, props)).then(function (res) {
3521
3642
  if (!props.raffle_id || !props.run_id) {
3522
3643
  throw new Error('both raffle_id and run_id are required');
3523
3644
  }
@@ -3551,8 +3672,8 @@ var WSAPI = /*#__PURE__*/function () {
3551
3672
  ;
3552
3673
  _proto.getRaffleDrawRunsHistory = function getRaffleDrawRunsHistory(props) {
3553
3674
  try {
3554
- var _this56 = this;
3555
- return Promise.resolve(_this56.api.getRaffleDrawRunsHistory(null, props)).then(function (res) {
3675
+ var _this58 = this;
3676
+ return Promise.resolve(_this58.api.getRaffleDrawRunsHistory(null, props)).then(function (res) {
3556
3677
  if (!props.raffle_id) {
3557
3678
  throw new Error('raffle_id is required');
3558
3679
  }
@@ -3586,11 +3707,11 @@ var WSAPI = /*#__PURE__*/function () {
3586
3707
  ;
3587
3708
  _proto.claimRafflePrize = function claimRafflePrize(props) {
3588
3709
  try {
3589
- var _this57 = this;
3710
+ var _this59 = this;
3590
3711
  if (!props.won_id) {
3591
3712
  throw new Error('won_id is required');
3592
3713
  }
3593
- return Promise.resolve(_this57.api.claimRafflePrize(null, {
3714
+ return Promise.resolve(_this59.api.claimRafflePrize(null, {
3594
3715
  won_id: props.won_id
3595
3716
  })).then(raffleClaimPrizeResponseTransform);
3596
3717
  } catch (e) {
@@ -3708,6 +3829,60 @@ exports.BonusStatus = void 0;
3708
3829
  BonusStatus[BonusStatus["EXPIRED"] = 6] = "EXPIRED";
3709
3830
  })(exports.BonusStatus || (exports.BonusStatus = {}));
3710
3831
 
3832
+ exports.UserBalanceType = void 0;
3833
+ (function (UserBalanceType) {
3834
+ UserBalanceType[UserBalanceType["Points"] = 0] = "Points";
3835
+ UserBalanceType[UserBalanceType["Gems"] = 1] = "Gems";
3836
+ UserBalanceType[UserBalanceType["Diamonds"] = 2] = "Diamonds";
3837
+ })(exports.UserBalanceType || (exports.UserBalanceType = {}));
3838
+
3839
+ var PointsHistoryTransform = function PointsHistoryTransform(items) {
3840
+ if (!items) {
3841
+ return [];
3842
+ }
3843
+ return items.map(function (item) {
3844
+ var itemTransformed = {
3845
+ create_date: item.create_date,
3846
+ user_ext_id: item.user_ext_id,
3847
+ crm_brand_id: item.crm_brand_id,
3848
+ source_type_id: item.source_type_id
3849
+ };
3850
+ if (item.type === exports.UserBalanceType.Diamonds || item.type === exports.UserBalanceType.Gems) {
3851
+ itemTransformed.type = item.type;
3852
+ itemTransformed.amount = item.amount;
3853
+ itemTransformed.balance = item.balance;
3854
+ }
3855
+ if (item.type === exports.UserBalanceType.Points) {
3856
+ itemTransformed.type = exports.UserBalanceType.Points;
3857
+ itemTransformed.amount = item.points_collected;
3858
+ itemTransformed.balance = item.user_points_balance;
3859
+ itemTransformed.total_ever = item.user_points_ever;
3860
+ }
3861
+ return itemTransformed;
3862
+ });
3863
+ };
3864
+
3865
+ exports.PointChangeSourceType = void 0;
3866
+ (function (PointChangeSourceType) {
3867
+ PointChangeSourceType[PointChangeSourceType["Journey"] = 1] = "Journey";
3868
+ PointChangeSourceType[PointChangeSourceType["AchievementTaskCompletion"] = 2] = "AchievementTaskCompletion";
3869
+ PointChangeSourceType[PointChangeSourceType["AchievementCompletion"] = 3] = "AchievementCompletion";
3870
+ PointChangeSourceType[PointChangeSourceType["LevelsStructureChange"] = 4] = "LevelsStructureChange";
3871
+ PointChangeSourceType[PointChangeSourceType["StorePurchase"] = 5] = "StorePurchase";
3872
+ PointChangeSourceType[PointChangeSourceType["ManualAdjustment"] = 6] = "ManualAdjustment";
3873
+ PointChangeSourceType[PointChangeSourceType["Leaderboard"] = 7] = "Leaderboard";
3874
+ PointChangeSourceType[PointChangeSourceType["Tournament"] = 11] = "Tournament";
3875
+ PointChangeSourceType[PointChangeSourceType["AutomationRule"] = 12] = "AutomationRule";
3876
+ PointChangeSourceType[PointChangeSourceType["TournamentRegistration"] = 13] = "TournamentRegistration";
3877
+ PointChangeSourceType[PointChangeSourceType["TournamentRegistrationCancellation"] = 14] = "TournamentRegistrationCancellation";
3878
+ PointChangeSourceType[PointChangeSourceType["RefundPoints"] = 15] = "RefundPoints";
3879
+ PointChangeSourceType[PointChangeSourceType["PlayMiniGame"] = 16] = "PlayMiniGame";
3880
+ PointChangeSourceType[PointChangeSourceType["WinMiniGame"] = 17] = "WinMiniGame";
3881
+ PointChangeSourceType[PointChangeSourceType["API"] = 18] = "API";
3882
+ PointChangeSourceType[PointChangeSourceType["DynamicFormula"] = 19] = "DynamicFormula";
3883
+ PointChangeSourceType[PointChangeSourceType["Raffle"] = 21] = "Raffle";
3884
+ })(exports.PointChangeSourceType || (exports.PointChangeSourceType = {}));
3885
+
3711
3886
  /**
3712
3887
  * @ignore
3713
3888
  */
@@ -4069,6 +4244,29 @@ var SmarticoAPI = /*#__PURE__*/function () {
4069
4244
  } catch (e) {
4070
4245
  return Promise.reject(e);
4071
4246
  }
4247
+ }
4248
+ /**
4249
+ * Reports an engagement impression event (when engagement content is displayed to the user).
4250
+ */
4251
+ ;
4252
+ _proto.reportEngagementImpression = function reportEngagementImpression(user_ext_id, engagement_uid, activityType) {
4253
+ var message = this.buildMessage(user_ext_id, exports.ClassId.CLIENT_ENGAGEMENT_IMPRESSION_REQUEST, {
4254
+ engagement_uid: engagement_uid,
4255
+ activityType: activityType
4256
+ });
4257
+ this.send(message)["catch"](function () {});
4258
+ }
4259
+ /**
4260
+ * Reports an engagement action event (when user clicks/interacts with engagement content).
4261
+ */;
4262
+ _proto.reportEngagementAction = function reportEngagementAction(user_ext_id, engagement_uid, activityType, action) {
4263
+ var message = this.buildMessage(user_ext_id, exports.ClassId.CLIENT_ENGAGEMENT_ACTION_REQUEST, _extends({
4264
+ engagement_uid: engagement_uid,
4265
+ activityType: activityType
4266
+ }, action && {
4267
+ action: action
4268
+ }));
4269
+ this.send(message)["catch"](function () {});
4072
4270
  };
4073
4271
  _proto.jackpotGet = function jackpotGet(user_ext_id, filter, force_language) {
4074
4272
  try {
@@ -4980,6 +5178,28 @@ var SmarticoAPI = /*#__PURE__*/function () {
4980
5178
  return Promise.reject(e);
4981
5179
  }
4982
5180
  };
5181
+ _proto.getPointsHistory = function getPointsHistory(user_ext_id, startTimeSeconds, endTimeSeconds) {
5182
+ try {
5183
+ var _this74 = this;
5184
+ var message = _this74.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, {
5185
+ startTimeSeconds: startTimeSeconds,
5186
+ endTimeSeconds: endTimeSeconds
5187
+ });
5188
+ return Promise.resolve(_this74.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
5189
+ } catch (e) {
5190
+ return Promise.reject(e);
5191
+ }
5192
+ };
5193
+ _proto.getPointsHistoryT = function getPointsHistoryT(user_ext_id, startTimeSeconds, endTimeSeconds) {
5194
+ try {
5195
+ var _this75 = this;
5196
+ return Promise.resolve(_this75.getPointsHistory(user_ext_id, startTimeSeconds, endTimeSeconds)).then(function (_this75$getPointsHist) {
5197
+ return PointsHistoryTransform(_this75$getPointsHist.logHistory);
5198
+ });
5199
+ } catch (e) {
5200
+ return Promise.reject(e);
5201
+ }
5202
+ };
4983
5203
  return SmarticoAPI;
4984
5204
  }();
4985
5205
 
@@ -5452,6 +5672,7 @@ exports.InboxMessagesTransform = InboxMessagesTransform;
5452
5672
  exports.MiniGamePrizeTypeNamed = MiniGamePrizeTypeNamed;
5453
5673
  exports.MissionUtils = MissionUtils;
5454
5674
  exports.OCache = OCache;
5675
+ exports.PointsHistoryTransform = PointsHistoryTransform;
5455
5676
  exports.PrizeModifiersKeysNames = PrizeModifiersKeysNames;
5456
5677
  exports.QuizMarketPerSport = QuizMarketPerSport;
5457
5678
  exports.SAWAcknowledgeTypeNamed = SAWAcknowledgeTypeNamed;