@smartico/public-api 0.0.419 → 0.0.421

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 (133) hide show
  1. package/dist/ActivityLog/ActivityLogActivities.d.ts +1 -1
  2. package/dist/ActivityLog/ActivityLogEntry.d.ts +35 -17
  3. package/dist/ActivityLog/ActivityLogMeta.d.ts +31 -0
  4. package/dist/ActivityLog/GetActivityLogRequest.d.ts +3 -1
  5. package/dist/ActivityLog/GetActivityLogResponse.d.ts +1 -2
  6. package/dist/ActivityLog/PointChangeSourceType.d.ts +1 -0
  7. package/dist/Jackpots/JackPotWinPushWinner.d.ts +34 -0
  8. package/dist/Jackpots/JackPotWinner.d.ts +3 -1
  9. package/dist/Jackpots/JackpotContributionRule.d.ts +23 -0
  10. package/dist/Jackpots/JackpotDetails.d.ts +8 -0
  11. package/dist/Jackpots/JackpotPot.d.ts +4 -2
  12. package/dist/Jackpots/JackpotPublicMeta.d.ts +6 -2
  13. package/dist/Jackpots/JackpotWinPush.d.ts +14 -2
  14. package/dist/Jackpots/index.d.ts +2 -0
  15. package/dist/SmarticoAPI.d.ts +3 -5
  16. package/dist/WSAPI/WSAPIBase.d.ts +0 -1
  17. package/dist/WSAPI/WSAPIJackpots.d.ts +2 -0
  18. package/dist/WSAPI/WSAPITypes.d.ts +17 -17
  19. package/dist/WSAPI/WSAPIUser.d.ts +24 -35
  20. package/dist/index.js +61 -131
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.modern.mjs +58 -102
  23. package/dist/index.modern.mjs.map +1 -1
  24. package/docs/Callbacks.md +1 -1
  25. package/docs/api/README.md +4 -4
  26. package/docs/api/classes/WSAPIJackpots.md +2 -0
  27. package/docs/api/classes/WSAPIUser.md +30 -59
  28. package/docs/api/documents/Callbacks.md +1 -1
  29. package/docs/api/enumerations/ActivityLogActivities.md +1 -1
  30. package/docs/api/enumerations/PointChangeSourceType.md +6 -0
  31. package/docs/api/interfaces/ActivityLogEntry.md +124 -0
  32. package/docs/api/interfaces/ActivityLogMeta.md +100 -0
  33. package/docs/api/interfaces/JackPotWinPushWinner.md +103 -0
  34. package/docs/api/interfaces/JackPotWinner.md +9 -1
  35. package/docs/api/interfaces/JackpotContributionRule.md +49 -0
  36. package/docs/api/interfaces/JackpotDetails.md +24 -0
  37. package/docs/api/interfaces/JackpotPot.md +9 -1
  38. package/docs/api/interfaces/JackpotPublicMeta.md +12 -2
  39. package/docs/api/interfaces/JackpotWinPush.md +14 -1
  40. package/docs/api/interfaces/TActivityLog.md +70 -2
  41. package/docs/api/type-aliases/TActivityLogEntry.md +7 -0
  42. package/docs/capabilities/_responses/gamePickGetActiveRound.json +37 -37
  43. package/docs/capabilities/_responses/gamePickGetActiveRounds.json +37 -131
  44. package/docs/capabilities/_responses/gamePickGetBoard.json +25 -14
  45. package/docs/capabilities/_responses/gamePickGetGameInfo.json +93 -79
  46. package/docs/capabilities/_responses/gamePickGetHistory.json +37 -131
  47. package/docs/capabilities/_responses/gamePickGetUserInfo.json +5 -5
  48. package/docs/capabilities/_responses/getActivityLog.json +106 -1
  49. package/docs/capabilities/_responses/getAvatarsCustomized.json +4 -4
  50. package/docs/capabilities/_responses/getAvatarsList.json +2 -2
  51. package/docs/capabilities/_responses/getBadges.json +27 -29
  52. package/docs/capabilities/_responses/getBonuses.json +1 -18
  53. package/docs/capabilities/_responses/getClanInfo.json +13 -13
  54. package/docs/capabilities/_responses/getClans.json +6 -6
  55. package/docs/capabilities/_responses/getCurrentLevel.json +12 -12
  56. package/docs/capabilities/_responses/getInboxMessageBody.json +2 -2
  57. package/docs/capabilities/_responses/getInboxMessages.json +6 -6
  58. package/docs/capabilities/_responses/getInboxUnreadCount.json +1 -1
  59. package/docs/capabilities/_responses/getJackpotWinners.json +14 -14
  60. package/docs/capabilities/_responses/getLeaderBoard.json +8 -8
  61. package/docs/capabilities/_responses/getMiniGames.json +92 -90
  62. package/docs/capabilities/_responses/getMiniGamesHistory.json +874 -1
  63. package/docs/capabilities/_responses/getMissions.json +2 -2
  64. package/docs/capabilities/_responses/getRaffleDrawRun.json +7 -7
  65. package/docs/capabilities/_responses/getRaffleDrawRunsHistory.json +6 -6
  66. package/docs/capabilities/_responses/getRaffles.json +14 -14
  67. package/docs/capabilities/_responses/getStorePurchasedItems.json +5 -5
  68. package/docs/capabilities/_responses/getTournamentInstanceInfo.json +100 -53
  69. package/docs/capabilities/_responses/getTournamentsList.json +12 -12
  70. package/docs/capabilities/_responses/getTranslations.json +1 -1
  71. package/docs/capabilities/_responses/getUserProfile.json +10 -10
  72. package/docs/capabilities/_responses/jackpotGet.json +33 -34
  73. package/docs/capabilities/gamePickGetActiveRound.md +22 -23
  74. package/docs/capabilities/gamePickGetActiveRounds.md +22 -23
  75. package/docs/capabilities/gamePickGetBoard.md +14 -14
  76. package/docs/capabilities/gamePickGetGameInfo.md +24 -44
  77. package/docs/capabilities/gamePickGetHistory.md +22 -23
  78. package/docs/capabilities/gamePickGetUserInfo.md +5 -5
  79. package/docs/capabilities/getActivityLog.md +69 -9
  80. package/docs/capabilities/getAvatarsCustomized.md +3 -3
  81. package/docs/capabilities/getBadges.md +13 -14
  82. package/docs/capabilities/getBonuses.md +2 -17
  83. package/docs/capabilities/getClanInfo.md +8 -8
  84. package/docs/capabilities/getClans.md +4 -4
  85. package/docs/capabilities/getCurrentLevel.md +12 -12
  86. package/docs/capabilities/getInboxMessageBody.md +2 -2
  87. package/docs/capabilities/getInboxMessages.md +3 -3
  88. package/docs/capabilities/getInboxUnreadCount.md +6 -0
  89. package/docs/capabilities/getJackpotWinners.md +9 -8
  90. package/docs/capabilities/getLeaderBoard.md +5 -5
  91. package/docs/capabilities/getMiniGames.md +35 -37
  92. package/docs/capabilities/getMiniGamesHistory.md +83 -2
  93. package/docs/capabilities/getMissions.md +1 -1
  94. package/docs/capabilities/getRaffleDrawRun.md +7 -7
  95. package/docs/capabilities/getRaffleDrawRunsHistory.md +3 -3
  96. package/docs/capabilities/getRaffles.md +8 -8
  97. package/docs/capabilities/getStorePurchasedItems.md +2 -2
  98. package/docs/capabilities/getTournamentInstanceInfo.md +45 -37
  99. package/docs/capabilities/getTournamentsList.md +6 -6
  100. package/docs/capabilities/getTranslations.md +1 -1
  101. package/docs/capabilities/getUserProfile.md +10 -10
  102. package/docs/capabilities/jackpotGet.md +56 -28
  103. package/docs/capabilities/jackpotOptIn.md +2 -0
  104. package/docs/capabilities/smarticoCallbacks.md +1 -1
  105. package/docs/native/PROTOCOL.md +141 -18
  106. package/docs/ui/jackpots/UIGuide_jackpotGet.md +1 -1
  107. package/docs/ui/user/UIGuide_getActivityLog.md +4 -2
  108. package/package.json +4 -3
  109. package/scripts/capture-responses-browser.mjs +8 -1
  110. package/src/ActivityLog/ActivityLogActivities.ts +1 -1
  111. package/src/ActivityLog/ActivityLogEntry.ts +33 -21
  112. package/src/ActivityLog/ActivityLogMeta.ts +31 -0
  113. package/src/ActivityLog/GetActivityLogRequest.ts +3 -3
  114. package/src/ActivityLog/GetActivityLogResponse.ts +23 -49
  115. package/src/ActivityLog/PointChangeSourceType.ts +1 -0
  116. package/src/Jackpots/JackPotWinPushWinner.ts +35 -0
  117. package/src/Jackpots/JackPotWinner.ts +3 -1
  118. package/src/Jackpots/JackpotContributionRule.ts +25 -0
  119. package/src/Jackpots/JackpotDetails.ts +8 -0
  120. package/src/Jackpots/JackpotPot.ts +4 -2
  121. package/src/Jackpots/JackpotPublicMeta.ts +6 -2
  122. package/src/Jackpots/JackpotWinPush.ts +14 -2
  123. package/src/Jackpots/index.ts +2 -0
  124. package/src/SmarticoAPI.ts +6 -40
  125. package/src/WSAPI/WSAPIBase.ts +0 -1
  126. package/src/WSAPI/WSAPIJackpots.ts +2 -0
  127. package/src/WSAPI/WSAPITypes.ts +18 -18
  128. package/src/WSAPI/WSAPIUser.ts +38 -55
  129. package/docs/api/interfaces/GemsDiamondsLog.md +0 -45
  130. package/docs/api/interfaces/PointsLog.md +0 -45
  131. package/docs/api/interfaces/TActivityLogEntry.md +0 -100
  132. package/docs/api/type-aliases/ActivityLogEntry.md +0 -3
  133. package/docs/capabilities/getActivityLogV2.md +0 -62
package/dist/index.js CHANGED
@@ -2234,7 +2234,6 @@ var onUpdateContextKey;
2234
2234
  onUpdateContextKey["CurrentLevel"] = "currentLevel";
2235
2235
  onUpdateContextKey["InboxUnreadCount"] = "inboxUnreadCount";
2236
2236
  onUpdateContextKey["ActivityLog"] = "activityLog";
2237
- onUpdateContextKey["ActivityLogV2"] = "activityLogV2";
2238
2237
  onUpdateContextKey["AvatarsList"] = "avatarsList";
2239
2238
  onUpdateContextKey["AvatarsCustomized"] = "avatarsCustomized";
2240
2239
  onUpdateContextKey["AvatarPrompts"] = "avatarPrompts";
@@ -3034,15 +3033,16 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3034
3033
  }
3035
3034
  }
3036
3035
  /**
3037
- * Returns the user's unified balance-change history — every points, gems, and
3038
- * diamonds transaction within the requested time window, ordered newest-first.
3039
- * Use to power an "Activity" / "History" tab showing wins, claims, purchases,
3040
- * level-up rewards, and operator adjustments.
3036
+ * Returns the user's activity history within the requested time window,
3037
+ * ordered newest-first. Today that is primarily wallet changes (points /
3038
+ * gems / diamonds); when the server starts returning richer activity rows
3039
+ * (missions, badges, levels, …), the same method surfaces them via optional
3040
+ * fields on {@link TActivityLog} — no separate call, same wire CID.
3041
3041
  *
3042
- * The returned shape is the same regardless of currency type — `type` (see
3043
- * {@link UserBalanceType}) distinguishes points / gems / diamonds and
3044
- * `source_type_id` (see {@link PointChangeSourceType}) names the originating
3045
- * event.
3042
+ * Existing wallet fields (`type`, `amount`, `balance`, `source_type_id`, …)
3043
+ * stay stable. Clients that only read those keep working; clients that want
3044
+ * the fuller feed can also read `activity_type_id`, `meta`,
3045
+ * `source_entity_*`, and `is_wallet_entry` when present.
3046
3046
  *
3047
3047
  * @remarks
3048
3048
  * **Preconditions**
@@ -3055,13 +3055,18 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3055
3055
  * `from` by 50 between calls. Both `startTimeSeconds` and `endTimeSeconds`
3056
3056
  * are epoch seconds bounding the window the server scans.
3057
3057
  *
3058
+ * **Filtering** — optional server-side filters:
3059
+ * - `types` — {@link ActivityLogActivities} / `type_id` values (e.g. Points=3, Gems=1)
3060
+ * - `src_types` — {@link PointChangeSourceType} / `source_type_id` values
3061
+ * Omit both for an unfiltered window.
3062
+ *
3058
3063
  * **Subscription model (`onUpdate`)**
3059
3064
  * The callback fires when the user's `ach_points_balance`,
3060
3065
  * `ach_gems_balance`, or `ach_diamonds_balance` changes (i.e. whenever a
3061
3066
  * wallet event lands). The pushed payload is a FIXED re-fetch of the
3062
3067
  * **last 10 minutes / first 50 entries** — it does NOT honor the original
3063
- * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to`. Consumers
3064
- * maintaining a long historical view must re-call `getActivityLog` with
3068
+ * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to` / filters.
3069
+ * Consumers maintaining a long historical view must re-call `getActivityLog` with
3065
3070
  * their own params after receiving an `onUpdate` notification.
3066
3071
  *
3067
3072
  * **Refresh**
@@ -3085,6 +3090,8 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3085
3090
  * endTimeSeconds: now,
3086
3091
  * from: 0,
3087
3092
  * to: 50,
3093
+ * types: [1], // Gems only (ActivityLogActivities.Gems)
3094
+ * src_types: [11], // Tournament wins only (PointChangeSourceType.Tournament)
3088
3095
  * onUpdate: (refreshed) => {
3089
3096
  * console.log('[smartico] wallet changed — refreshed payload is last 10 min / 50 entries:', refreshed.length, 'rows');
3090
3097
  * // If the consumer is showing a full 30-day view, re-call getActivityLog with the original params here.
@@ -3103,10 +3110,13 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3103
3110
  endTimeSeconds = _ref.endTimeSeconds,
3104
3111
  from = _ref.from,
3105
3112
  to = _ref.to,
3113
+ types = _ref.types,
3114
+ src_types = _ref.src_types,
3106
3115
  onUpdate = _ref.onUpdate;
3107
3116
  try {
3117
+ var _types$join, _src_types$join;
3108
3118
  var _this7 = this;
3109
- var cacheKey = onUpdateContextKey.ActivityLog + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to;
3119
+ var cacheKey = onUpdateContextKey.ActivityLog + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to + ":" + ((_types$join = types == null ? void 0 : types.join(',')) != null ? _types$join : '') + ":" + ((_src_types$join = src_types == null ? void 0 : src_types.join(',')) != null ? _src_types$join : '');
3110
3120
  if (typeof onUpdate === 'function') {
3111
3121
  _this7.onUpdateCallback.set(onUpdateContextKey.ActivityLog, onUpdate);
3112
3122
  // Remember the requested window so a push refresh re-fetches THIS window
@@ -3115,11 +3125,13 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3115
3125
  startTimeSeconds: startTimeSeconds,
3116
3126
  endTimeSeconds: endTimeSeconds,
3117
3127
  from: from,
3118
- to: to
3128
+ to: to,
3129
+ types: types,
3130
+ src_types: src_types
3119
3131
  };
3120
3132
  }
3121
3133
  return Promise.resolve(OCache.use(cacheKey, exports.ECacheContext.WSAPI, function () {
3122
- return _this7.api.getActivityLogT(_this7.userExtId, startTimeSeconds, endTimeSeconds, from, to);
3134
+ return _this7.api.getActivityLogT(_this7.userExtId, startTimeSeconds, endTimeSeconds, from, to, types, src_types);
3123
3135
  }, CACHE_DATA_SEC));
3124
3136
  } catch (e) {
3125
3137
  return Promise.reject(e);
@@ -3133,8 +3145,9 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3133
3145
  if (!params) {
3134
3146
  return Promise.resolve();
3135
3147
  }
3136
- return Promise.resolve(_this8.api.getActivityLogT(_this8.userExtId, params.startTimeSeconds, params.endTimeSeconds, params.from, params.to)).then(function (payload) {
3137
- var cacheKey = onUpdateContextKey.ActivityLog + ":" + params.startTimeSeconds + ":" + params.endTimeSeconds + ":" + params.from + ":" + params.to;
3148
+ return Promise.resolve(_this8.api.getActivityLogT(_this8.userExtId, params.startTimeSeconds, params.endTimeSeconds, params.from, params.to, params.types, params.src_types)).then(function (payload) {
3149
+ var _params$types$join, _params$types, _params$src_types$joi, _params$src_types;
3150
+ var cacheKey = onUpdateContextKey.ActivityLog + ":" + params.startTimeSeconds + ":" + params.endTimeSeconds + ":" + params.from + ":" + params.to + ":" + ((_params$types$join = (_params$types = params.types) == null ? void 0 : _params$types.join(',')) != null ? _params$types$join : '') + ":" + ((_params$src_types$joi = (_params$src_types = params.src_types) == null ? void 0 : _params$src_types.join(',')) != null ? _params$src_types$joi : '');
3138
3151
  OCache.set(cacheKey, payload, exports.ECacheContext.WSAPI);
3139
3152
  var onUpdate = _this8.onUpdateCallback.get(onUpdateContextKey.ActivityLog);
3140
3153
  if (typeof onUpdate === 'function') {
@@ -3144,40 +3157,6 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3144
3157
  } catch (e) {
3145
3158
  return Promise.reject(e);
3146
3159
  }
3147
- }
3148
- /**
3149
- * Returns the full activity log (v2) — wallet changes **and** non-wallet
3150
- * activities (missions, badges, levels, tournaments, avatars, …).
3151
- *
3152
- * **Backwards compatibility**: existing integrations should keep using
3153
- * {@link getActivityLog}, which returns wallet-only {@link TActivityLog}
3154
- * rows with the original field contract unchanged.
3155
- *
3156
- * **Pagination** — same `from` / `to` offset model as {@link getActivityLog}
3157
- * (server caps a single response at 50 entries).
3158
- *
3159
- * **Filtering** — pass `types` with {@link ActivityLogActivities} values to
3160
- * request a server-side subset (e.g. missions only). Omit for all activity types.
3161
- *
3162
- * @returns Array of {@link TActivityLogEntry} ordered newest-first.
3163
- */
3164
- ;
3165
- _proto.getActivityLogV2 = function getActivityLogV2(_ref2) {
3166
- var startTimeSeconds = _ref2.startTimeSeconds,
3167
- endTimeSeconds = _ref2.endTimeSeconds,
3168
- from = _ref2.from,
3169
- to = _ref2.to,
3170
- types = _ref2.types;
3171
- try {
3172
- var _types$join;
3173
- var _this9 = this;
3174
- var cacheKey = onUpdateContextKey.ActivityLogV2 + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to + ":" + ((_types$join = types == null ? void 0 : types.join(',')) != null ? _types$join : '');
3175
- return Promise.resolve(OCache.use(cacheKey, exports.ECacheContext.WSAPI, function () {
3176
- return _this9.api.getActivityLogV2T(_this9.userExtId, startTimeSeconds, endTimeSeconds, from, to, types);
3177
- }, CACHE_DATA_SEC));
3178
- } catch (e) {
3179
- return Promise.reject(e);
3180
- }
3181
3160
  };
3182
3161
  return WSAPIUser;
3183
3162
  }(WSAPIBase);
@@ -6218,6 +6197,8 @@ var WSAPIJackpots = /*#__PURE__*/function (_WSAPIClans) {
6218
6197
  * - The jackpot must currently be active and the user must be in its
6219
6198
  * eligibility segment. Ineligible jackpots are filtered out of
6220
6199
  * {@link jackpotGet} entirely, so a card the user sees is opt-in-able.
6200
+ * - Skip the opt-in CTA when the template reports `is_auto_opt_in: true` —
6201
+ * eligible users are enrolled automatically and there is nothing to join.
6221
6202
  *
6222
6203
  * **Error handling**
6223
6204
  * The server returns a non-zero `errCode` with a human-readable `errMsg`
@@ -10340,7 +10321,7 @@ exports.BonusStatus = void 0;
10340
10321
  BonusStatus[BonusStatus["EXPIRED"] = 6] = "EXPIRED";
10341
10322
  })(exports.BonusStatus || (exports.BonusStatus = {}));
10342
10323
 
10343
- /** Activity-log entry type as returned on the v2 wire (`type_id`). */
10324
+ /** Activity-log entry type as returned on the wire (`type_id`). */
10344
10325
  exports.ActivityLogActivities = void 0;
10345
10326
  (function (ActivityLogActivities) {
10346
10327
  ActivityLogActivities[ActivityLogActivities["Gems"] = 1] = "Gems";
@@ -10373,59 +10354,38 @@ exports.UserBalanceType = void 0;
10373
10354
  })(exports.UserBalanceType || (exports.UserBalanceType = {}));
10374
10355
 
10375
10356
  var ActivityLogTransform = function ActivityLogTransform(items) {
10376
- if (!items) {
10377
- return [];
10378
- }
10379
- return items.map(function (item) {
10380
- var _item$create_date$sec, _item$create_date, _item$type;
10381
- var itemTransformed = {
10382
- create_date: (_item$create_date$sec = (_item$create_date = item.create_date) == null ? void 0 : _item$create_date.seconds) != null ? _item$create_date$sec : item.create_date,
10383
- user_ext_id: item.user_ext_id,
10384
- crm_brand_id: item.crm_brand_id,
10385
- source_type_id: item.source_type_id
10386
- };
10387
- item.type = (_item$type = item.type) != null ? _item$type : exports.UserBalanceType.Points;
10388
- if (item.type === exports.UserBalanceType.Diamonds || item.type === exports.UserBalanceType.Gems) {
10389
- itemTransformed.type = item.type;
10390
- itemTransformed.amount = item.amount;
10391
- itemTransformed.balance = item.balance;
10392
- }
10393
- if (item.type === exports.UserBalanceType.Points) {
10394
- itemTransformed.type = exports.UserBalanceType.Points;
10395
- itemTransformed.amount = item.points_collected;
10396
- itemTransformed.balance = item.user_points_balance;
10397
- itemTransformed.total_ever = item.user_points_ever;
10398
- }
10399
- return itemTransformed;
10400
- });
10401
- };
10402
- var ActivityLogV2Transform = function ActivityLogV2Transform(items) {
10403
10357
  if (!items) {
10404
10358
  return [];
10405
10359
  }
10406
10360
  return items.map(function (r) {
10407
- var _r$create_date$second, _r$create_date, _r$points_collected, _r$user_points_balanc;
10408
- var isGems = r.type_id === exports.ActivityLogActivities.Gems || r.type === exports.UserBalanceType.Gems;
10409
- var isDiamonds = r.type_id === exports.ActivityLogActivities.Diamonds || r.type === exports.UserBalanceType.Diamonds;
10410
- var x = {
10361
+ var _r$type_id, _r$ctx_meta, _r$create_date$second, _r$create_date, _r$amount, _r$user_points_balanc, _r$ctx_, _r$source_entity_name, _r$source_ref_id;
10362
+ // The wire sends the activity kind as `type` (an ActivityLogActivities value).
10363
+ // `type_id` is accepted as an alias so an older/newer server spelling still maps.
10364
+ var activityTypeId = (_r$type_id = r.type_id) != null ? _r$type_id : r.type;
10365
+ var isGems = activityTypeId === exports.ActivityLogActivities.Gems;
10366
+ var isDiamonds = activityTypeId === exports.ActivityLogActivities.Diamonds;
10367
+ var meta = (_r$ctx_meta = r.ctx_meta) != null ? _r$ctx_meta : r.context_value_meta;
10368
+ return {
10411
10369
  create_date: (_r$create_date$second = (_r$create_date = r.create_date) == null ? void 0 : _r$create_date.seconds) != null ? _r$create_date$second : r.create_date,
10412
10370
  user_ext_id: r.user_ext_id,
10413
- crm_brand_id: r.crm_brand_id,
10371
+ // Sent as a string on the wire.
10372
+ crm_brand_id: Number(r.crm_brand_id),
10414
10373
  type: isGems ? exports.UserBalanceType.Gems : isDiamonds ? exports.UserBalanceType.Diamonds : exports.UserBalanceType.Points,
10415
- amount: (_r$points_collected = r.points_collected) != null ? _r$points_collected : r.amount,
10374
+ // `amount` carries the real delta; `points_collected` is a `-1` placeholder on points rows.
10375
+ amount: (_r$amount = r.amount) != null ? _r$amount : r.points_collected,
10416
10376
  balance: (_r$user_points_balanc = r.user_points_balance) != null ? _r$user_points_balanc : r.balance,
10417
10377
  total_ever: r.user_points_ever,
10418
10378
  source_type_id: r.source_type_id,
10419
- activity_type_id: r.type_id,
10420
- context_value_1: r.context_value_1,
10421
- meta: r.context_value_meta,
10422
- source_entity_name: r.source_entity_name,
10379
+ activity_type_id: activityTypeId,
10380
+ context_value_1: (_r$ctx_ = r.ctx_1) != null ? _r$ctx_ : r.context_value_1,
10381
+ meta: meta,
10382
+ // Entity name travels inside the context meta, not as a top-level field.
10383
+ source_entity_name: (_r$source_entity_name = r.source_entity_name) != null ? _r$source_entity_name : meta == null ? void 0 : meta.name,
10423
10384
  source_entity_id: r.source_entity_id,
10424
- source_reference_id: r.source_reference_id,
10385
+ source_reference_id: (_r$source_ref_id = r.source_ref_id) != null ? _r$source_ref_id : r.source_reference_id,
10425
10386
  source_root_id: r.source_root_id,
10426
- is_wallet_entry: r.type_id == null || r.type_id === exports.ActivityLogActivities.Gems || r.type_id === exports.ActivityLogActivities.Diamonds || r.type_id === exports.ActivityLogActivities.Points
10387
+ is_wallet_entry: activityTypeId == null || activityTypeId === exports.ActivityLogActivities.Gems || activityTypeId === exports.ActivityLogActivities.Diamonds || activityTypeId === exports.ActivityLogActivities.Points
10427
10388
  };
10428
- return x;
10429
10389
  });
10430
10390
  };
10431
10391
 
@@ -10447,6 +10407,7 @@ exports.PointChangeSourceType = void 0;
10447
10407
  PointChangeSourceType[PointChangeSourceType["WinMiniGame"] = 17] = "WinMiniGame";
10448
10408
  PointChangeSourceType[PointChangeSourceType["API"] = 18] = "API";
10449
10409
  PointChangeSourceType[PointChangeSourceType["DynamicFormula"] = 19] = "DynamicFormula";
10410
+ PointChangeSourceType[PointChangeSourceType["Jackpot"] = 20] = "Jackpot";
10450
10411
  PointChangeSourceType[PointChangeSourceType["Raffle"] = 21] = "Raffle";
10451
10412
  PointChangeSourceType[PointChangeSourceType["Avatars"] = 22] = "Avatars";
10452
10413
  PointChangeSourceType[PointChangeSourceType["Clan"] = 23] = "Clan";
@@ -12330,55 +12291,25 @@ var SmarticoAPI = /*#__PURE__*/function () {
12330
12291
  return Promise.reject(e);
12331
12292
  }
12332
12293
  };
12333
- _proto.getActivityLog = function getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset) {
12294
+ _proto.getActivityLog = function getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types) {
12334
12295
  try {
12335
12296
  var _this102 = this;
12336
- var message = _this102.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, {
12337
- startTimeSeconds: Math.floor(startTimeSeconds),
12338
- endTimeSeconds: Math.floor(endTimeSeconds),
12339
- limit: limit,
12340
- offset: offset
12341
- });
12342
- return Promise.resolve(_this102.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
12343
- } catch (e) {
12344
- return Promise.reject(e);
12345
- }
12346
- };
12347
- _proto.getActivityLogV2 = function getActivityLogV2(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types) {
12348
- try {
12349
- var _this103 = this;
12350
- var message = _this103.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, _extends({
12297
+ var message = _this102.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, _extends({
12351
12298
  startTimeSeconds: Math.floor(startTimeSeconds),
12352
12299
  endTimeSeconds: Math.floor(endTimeSeconds),
12353
12300
  limit: limit,
12354
12301
  offset: offset
12355
12302
  }, types ? {
12356
12303
  types: types
12304
+ } : {}, src_types ? {
12305
+ src_types: src_types
12357
12306
  } : {}));
12358
- return Promise.resolve(_this103.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
12359
- } catch (e) {
12360
- return Promise.reject(e);
12361
- }
12362
- };
12363
- _proto.getActivityLogT = function getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds, from, to) {
12364
- if (from === void 0) {
12365
- from = 0;
12366
- }
12367
- if (to === void 0) {
12368
- to = 50;
12369
- }
12370
- try {
12371
- var _this104 = this;
12372
- var limit = to - from > 50 ? 50 : to - from;
12373
- var offset = from;
12374
- return Promise.resolve(_this104.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset)).then(function (_this104$getActivityL) {
12375
- return ActivityLogTransform(_this104$getActivityL.logHistory);
12376
- });
12307
+ return Promise.resolve(_this102.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
12377
12308
  } catch (e) {
12378
12309
  return Promise.reject(e);
12379
12310
  }
12380
12311
  };
12381
- _proto.getActivityLogV2T = function getActivityLogV2T(user_ext_id, startTimeSeconds, endTimeSeconds, from, to, types) {
12312
+ _proto.getActivityLogT = function getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds, from, to, types, src_types) {
12382
12313
  if (from === void 0) {
12383
12314
  from = 0;
12384
12315
  }
@@ -12386,11 +12317,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
12386
12317
  to = 50;
12387
12318
  }
12388
12319
  try {
12389
- var _this105 = this;
12320
+ var _this103 = this;
12390
12321
  var limit = to - from > 50 ? 50 : to - from;
12391
12322
  var offset = from;
12392
- return Promise.resolve(_this105.getActivityLogV2(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types)).then(function (_this105$getActivityL) {
12393
- return ActivityLogV2Transform(_this105$getActivityL.logHistory);
12323
+ return Promise.resolve(_this103.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types)).then(function (_this103$getActivityL) {
12324
+ return ActivityLogTransform(_this103$getActivityL.logHistory);
12394
12325
  });
12395
12326
  } catch (e) {
12396
12327
  return Promise.reject(e);
@@ -13042,7 +12973,6 @@ exports.JoinClanErrorCode = void 0;
13042
12973
 
13043
12974
  exports.AchCategoryTransform = AchCategoryTransform;
13044
12975
  exports.ActivityLogTransform = ActivityLogTransform;
13045
- exports.ActivityLogV2Transform = ActivityLogV2Transform;
13046
12976
  exports.AllRoundsGameBoardID = AllRoundsGameBoardID;
13047
12977
  exports.BonusItemsTransform = BonusItemsTransform;
13048
12978
  exports.CookieStore = CookieStore;