@smartico/public-api 0.0.379 → 0.0.380

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 (99) hide show
  1. package/.nvmrc +1 -1
  2. package/README.md +31 -2
  3. package/dist/Store/BuyStoreItemErrorCode.d.ts +9 -1
  4. package/dist/Tournaments/TournamentRegistrationError.d.ts +3 -1
  5. package/dist/WSAPI/WSAPI.d.ts +13 -1235
  6. package/dist/WSAPI/WSAPIAvatars.d.ts +78 -0
  7. package/dist/WSAPI/WSAPIBase.d.ts +71 -0
  8. package/dist/WSAPI/WSAPIBonuses.d.ts +26 -0
  9. package/dist/WSAPI/WSAPIClans.d.ts +388 -0
  10. package/dist/WSAPI/WSAPIGamePick.d.ts +308 -0
  11. package/dist/WSAPI/WSAPIGeneral.d.ts +30 -0
  12. package/dist/WSAPI/WSAPIInbox.d.ts +126 -0
  13. package/dist/WSAPI/WSAPIJackpots.d.ts +109 -0
  14. package/dist/WSAPI/WSAPILeaderBoard.d.ts +25 -0
  15. package/dist/WSAPI/WSAPIMiniGames.d.ts +94 -0
  16. package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
  17. package/dist/WSAPI/WSAPIRaffles.d.ts +119 -0
  18. package/dist/WSAPI/WSAPIStore.d.ts +656 -0
  19. package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
  20. package/dist/WSAPI/WSAPITypes.d.ts +145 -85
  21. package/dist/WSAPI/WSAPIUser.d.ts +383 -0
  22. package/dist/index.js +3818 -1528
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.modern.mjs +3180 -981
  25. package/dist/index.modern.mjs.map +1 -1
  26. package/docs/api/README.md +56 -2
  27. package/docs/api/classes/WSAPIAvatars.md +116 -0
  28. package/docs/api/classes/WSAPIBonuses.md +50 -0
  29. package/docs/api/classes/WSAPIClans.md +66 -0
  30. package/docs/api/classes/WSAPIGamePick.md +181 -0
  31. package/docs/api/classes/WSAPIGeneral.md +63 -0
  32. package/docs/api/classes/WSAPIInbox.md +277 -0
  33. package/docs/api/classes/WSAPIJackpots.md +185 -0
  34. package/docs/api/classes/WSAPILeaderBoard.md +39 -0
  35. package/docs/api/classes/WSAPIMiniGames.md +175 -0
  36. package/docs/api/classes/WSAPIMissions.md +611 -0
  37. package/docs/api/classes/WSAPIRaffles.md +195 -0
  38. package/docs/api/classes/WSAPIStore.md +744 -0
  39. package/docs/api/classes/WSAPITournaments.md +104 -0
  40. package/docs/api/classes/WSAPIUser.md +200 -0
  41. package/docs/api/enumerations/AchievementClaimPeriodTypeId.md +13 -0
  42. package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -0
  43. package/docs/api/interfaces/ClanPrizePublicMeta.md +41 -0
  44. package/docs/api/interfaces/ClanPrizeStructureEntry.md +7 -1
  45. package/docs/api/interfaces/ClanPublicMeta.md +4 -0
  46. package/docs/api/interfaces/SAWTemplateUI.md +10 -0
  47. package/docs/api/interfaces/TAchCategory.md +19 -4
  48. package/docs/api/interfaces/TBuyStoreItemResult.md +26 -8
  49. package/docs/api/interfaces/TMissionClaimRewardResult.md +14 -3
  50. package/docs/api/interfaces/TMissionOptInResult.md +10 -3
  51. package/docs/api/interfaces/TMissionOrBadge.md +6 -2
  52. package/docs/api/interfaces/TStoreItem.md +21 -1
  53. package/docs/api/interfaces/TTournamentDetailed.md +8 -0
  54. package/docs/api/interfaces/UserAchievement.md +1 -1
  55. package/docs/ui/clans/UIGuide_getClanInfo.md +153 -0
  56. package/docs/ui/clans/UIGuide_getClans.md +172 -0
  57. package/docs/ui/clans/UIGuide_joinClan.md +196 -0
  58. package/docs/ui/missions/UIGuide_getAchCategories.md +17 -0
  59. package/docs/ui/missions/UIGuide_getBadges.md +237 -0
  60. package/docs/ui/missions/UIGuide_getMissions.md +268 -0
  61. package/docs/ui/missions/UIGuide_requestMissionClaimReward.md +21 -0
  62. package/docs/ui/missions/UIGuide_requestMissionOptIn.md +16 -0
  63. package/docs/ui/store/UIGuide_buyStoreItem.md +133 -0
  64. package/docs/ui/store/UIGuide_getStoreCategories.md +19 -0
  65. package/docs/ui/store/UIGuide_getStoreItems.md +264 -0
  66. package/docs/ui/store/UIGuide_getStorePurchasedItems.md +122 -0
  67. package/docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md +140 -0
  68. package/docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md +265 -0
  69. package/docs/ui/tournaments/UIGuide_getTournamentsList.md +236 -0
  70. package/docs/ui/tournaments/UIGuide_registerInTournament.md +156 -0
  71. package/docs/ui/user/UIGuide_getLevels.md +162 -0
  72. package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
  73. package/package.json +3 -3
  74. package/scripts/postdoc-cleanup.js +195 -0
  75. package/src/Missions/MissionsUtils.ts +5 -2
  76. package/src/Store/BuyStoreItemErrorCode.ts +8 -0
  77. package/src/Store/StoreItem.ts +1 -0
  78. package/src/Store/StoreItemPurchased.ts +1 -0
  79. package/src/Store/StoreItemType.ts +1 -1
  80. package/src/Tournaments/TournamentRegistrationError.ts +4 -0
  81. package/src/WSAPI/WSAPI.ts +27 -2007
  82. package/src/WSAPI/WSAPIAvatars.ts +127 -0
  83. package/src/WSAPI/WSAPIBase.ts +93 -0
  84. package/src/WSAPI/WSAPIBonuses.ts +54 -0
  85. package/src/WSAPI/WSAPIClans.ts +417 -0
  86. package/src/WSAPI/WSAPIGamePick.ts +382 -0
  87. package/src/WSAPI/WSAPIGeneral.ts +57 -0
  88. package/src/WSAPI/WSAPIInbox.ts +222 -0
  89. package/src/WSAPI/WSAPIJackpots.ts +212 -0
  90. package/src/WSAPI/WSAPILeaderBoard.ts +40 -0
  91. package/src/WSAPI/WSAPIMiniGames.ts +181 -0
  92. package/src/WSAPI/WSAPIMissions.ts +572 -0
  93. package/src/WSAPI/WSAPIRaffles.ts +175 -0
  94. package/src/WSAPI/WSAPIStore.ts +732 -0
  95. package/src/WSAPI/WSAPITournaments.ts +541 -0
  96. package/src/WSAPI/WSAPITypes.ts +145 -87
  97. package/src/WSAPI/WSAPIUser.ts +456 -0
  98. package/tsconfig.json +17 -1
  99. package/docs/api/classes/WSAPI.md +0 -1927
@@ -0,0 +1,383 @@
1
+ import { TActivityLog, TLevel, TLevelCurrent, TSegmentCheckResult, TUserProfile, UserLevelExtraCountersT } from './WSAPITypes';
2
+ import { WSAPIBase } from './WSAPIBase';
3
+ /** @group User */
4
+ export declare class WSAPIUser extends WSAPIBase {
5
+ /**
6
+ * Returns the current user's public profile — the source of truth for
7
+ * balances (points / gems / diamonds), the current level ID, the
8
+ * display username + avatar, language, public tags, and the inbox
9
+ * unread count. **This method is synchronous** (returns `TUserProfile`,
10
+ * not a Promise): the SDK keeps a local snapshot of the user's public
11
+ * properties that is initialised at identify time and kept live by a
12
+ * server-driven update channel — every call returns the latest cached
13
+ * values without a network round-trip.
14
+ *
15
+ * Subscribe to changes by registering a callback on `_smartico.on('props_change', ...)`
16
+ * — the callback fires with the full snapshot at identify and with
17
+ * partial-key updates on every subsequent server push (typically
18
+ * under 1 second after the underlying state change).
19
+ *
20
+ * @remarks
21
+ * **Preconditions**
22
+ * The tracker must be initialised — calling this before the identify
23
+ * round-trip completes throws (`"Tracker is not initialized, cannot
24
+ * getUserProfile"`). Safe ways to wait for readiness:
25
+ * - register `_smartico.on('identify', (errCode, props) => ...)` —
26
+ * fires once after a successful identify with the full props
27
+ * - register `_smartico.on('props_change', () => ...)` — fires first
28
+ * at identify with the full snapshot, then on every push update
29
+ *
30
+ * **What's kept live (push-updated)**
31
+ * Balance fields (`ach_points_balance`, `ach_gems_balance`,
32
+ * `ach_diamonds_balance`, `ach_points_ever`), `ach_level_current_id`,
33
+ * `core_public_tags`, `core_inbox_unread_count`, `core_user_language`,
34
+ * `avatar_url`, `public_username`, and the AI-driven recommended-amount
35
+ * fields all flow over the SDK's user-properties update channel as
36
+ * partial updates — the snapshot is patched in place when any of them
37
+ * change server-side. Re-call `getUserProfile()` (or watch
38
+ * `props_change`) to observe new values.
39
+ *
40
+ * **Reading state from the returned profile**
41
+ * Balances (`ach_points_balance`, `ach_gems_balance`,
42
+ * `ach_diamonds_balance`) are the canonical source for affordability
43
+ * checks across the SDK — compare against `entry_fee_amount` (clans),
44
+ * `registration_cost_points` / `_gems` / `_diamonds` (tournaments), and
45
+ * `price` / `discounted_price` + `purchase_type` (store items).
46
+ * `ach_points_ever` is monotonic — store purchases deduct from
47
+ * `ach_points_balance` but NEVER from `ach_points_ever`, so it remains
48
+ * useful for level-progress math (`required_points` on the next
49
+ * {@link getLevels} entry minus `ach_points_ever`). `ach_level_current_id`
50
+ * is the FK into the level ladder — resolve metadata via
51
+ * {@link getCurrentLevel} (richer, includes progress %) or
52
+ * {@link getLevels} (full ladder lookup table).
53
+ *
54
+ * **Inbox unread count** — `core_inbox_unread_count` on this profile
55
+ * is push-updated in real time (under 1 second). For an inbox badge,
56
+ * prefer this field over {@link getInboxUnreadCount} (which is cached
57
+ * for 30 s) — same value, fresher signal.
58
+ *
59
+ * **Language**: `core_user_language` reflects the server's stored
60
+ * language. If the consumer just called `_smartico.changeLanguage(...)`,
61
+ * the field may briefly lag the local intent until the server push
62
+ * arrives. Use `_smartico.getPublicProps()` for the
63
+ * client-fallback-applied version if instant accuracy matters.
64
+ *
65
+ * **Idempotency / Side effects**: trivially safe — no network call,
66
+ * no state mutation.
67
+ *
68
+ * **UI guidance**: see [UI Guide — `getUserProfile`](../../docs/ui/user/UIGuide_getUserProfile.md).
69
+ *
70
+ * **Visitor mode**: not supported — throws. Visitor sessions do not
71
+ * have a public-profile snapshot.
72
+ *
73
+ * @returns The current cached `TUserProfile` snapshot. A shallow copy —
74
+ * mutating it does not affect the SDK's internal state.
75
+ * @throws `Error("Tracker is not initialized, cannot getUserProfile")`
76
+ * if called before identify completes or from a visitor session.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * // Wait for identify before calling.
81
+ * window._smartico.on('identify', (errCode) => {
82
+ * if (errCode !== 0) return;
83
+ * const profile = window._smartico.api.getUserProfile();
84
+ * console.log('[smartico] initial profile loaded — render the user widget:', profile);
85
+ * });
86
+ *
87
+ * // Stay in sync with live updates.
88
+ * window._smartico.on('props_change', (changed) => {
89
+ * // `changed` is the partial keys for this push (full snapshot at identify).
90
+ * const profile = window._smartico.api.getUserProfile();
91
+ * console.log('[smartico] profile updated — re-render any widgets bound to:', Object.keys(changed),
92
+ * '— balances now:', profile.ach_points_balance, profile.ach_gems_balance, profile.ach_diamonds_balance);
93
+ *
94
+ * // React to specific fields.
95
+ * if ('ach_level_current_id' in changed) {
96
+ * console.log('[smartico] level changed — call getCurrentLevel() for richer detail, animate the level badge');
97
+ * }
98
+ * if ('core_inbox_unread_count' in changed) {
99
+ * console.log('[smartico] inbox unread count changed — update the badge to:', profile.core_inbox_unread_count);
100
+ * }
101
+ * });
102
+ *
103
+ * // Affordability gating example — used inside a clan / tournament / store CTA handler.
104
+ * const profile = window._smartico.api.getUserProfile();
105
+ * const item = await window._smartico.api.getStoreItems().then(items => items[0]);
106
+ * const price = item.discounted_price ?? item.price;
107
+ * const balance = {
108
+ * points: profile.ach_points_balance,
109
+ * gems: profile.ach_gems_balance,
110
+ * diamonds: profile.ach_diamonds_balance,
111
+ * }[item.purchase_type];
112
+ * if (balance < price) {
113
+ * console.log('[smartico] insufficient', item.purchase_type, '— disable Buy and show deficit', price - balance);
114
+ * }
115
+ * ```
116
+ */
117
+ getUserProfile(): TUserProfile;
118
+ /** Check if user belongs to specific segments
119
+ * **Example**:
120
+ * ```
121
+ * _smartico.api.checkSegmentMatch(1).then((result) => {
122
+ * console.log(result);
123
+ * });
124
+ * ```
125
+ *
126
+ * **Visitor mode: not supported**
127
+ */
128
+ checkSegmentMatch(segment_id: number): Promise<boolean>;
129
+ /** Check if user belongs to specific list of segments
130
+ * **Example**:
131
+ * ```
132
+ * _smartico.api.checkSegmentListMatch([1, 2, 3]).then((result) => {
133
+ * console.log(result);
134
+ * });
135
+ * ```
136
+ * **Visitor mode: not supported**
137
+ */
138
+ checkSegmentListMatch(segment_ids: number[]): Promise<TSegmentCheckResult[]>;
139
+ /**
140
+ * Returns the full level ladder configured for the current label —
141
+ * one `TLevel` per active level, server-sorted by `required_points`
142
+ * ASC (lowest first; `ordinal_position` is a 1-based index into the
143
+ * returned array). Use this to render a level map / progression
144
+ * screen, or as a lookup table to resolve `ach_level_current_id` from
145
+ * {@link getUserProfile} into a richer level object.
146
+ *
147
+ * @remarks
148
+ * **Server-side filtering**
149
+ * The server returns ALL active levels for the label. There is NO
150
+ * per-user filtering on visibility, level-status, or anything else —
151
+ * the response is identical across users of the same label. Apply
152
+ * `visibility_points` filtering client-side if you want to hide
153
+ * not-yet-reached levels (compare against
154
+ * `getUserProfile().ach_points_ever` and exclude levels where
155
+ * `visibility_points > ach_points_ever`).
156
+ *
157
+ * **Sort order**
158
+ * The returned array is already sorted by `required_points` ASC, and
159
+ * `ordinal_position` is a 1-based index into that same sort order —
160
+ * client-side re-sorting is not required for the default rendering.
161
+ * If your label uses sliding-window leveling logic
162
+ * (see {@link getUserLevelExtraCounters}) and you want to sort by
163
+ * a multi-criteria key (`required_points`, then
164
+ * `required_level_counter_1`, then `required_level_counter_2`), do
165
+ * that client-side.
166
+ *
167
+ * **Cache TTL**: the SDK caches the response for 30 seconds. Cache
168
+ * is fully cleared on login / logout. Operator-driven level edits
169
+ * surface on the next cache miss.
170
+ *
171
+ * **Idempotency / Side effects**: safe. Read-only metadata. Calls
172
+ * within the cache window de-duplicate to the same cached array.
173
+ *
174
+ * **UI guidance**: see [UI Guide — `getLevels`](../../docs/ui/user/UIGuide_getLevels.md).
175
+ *
176
+ * **Visitor mode**: supported. Use `_smartico.vapi(lang).getLevels()`
177
+ * to fetch the ladder for anonymous viewers; the level configuration
178
+ * is label-scoped static data so the response is meaningful even
179
+ * without an authenticated user. Per-user fields (the implicit
180
+ * "current level" via {@link getCurrentLevel}, or the user's progress)
181
+ * are not available in visitor mode.
182
+ *
183
+ * @returns Promise resolving to the ordered `TLevel[]` ladder. Empty
184
+ * if no levels are configured for the label.
185
+ *
186
+ * @example
187
+ * ```ts
188
+ * const [levels, profile] = await Promise.all([
189
+ * window._smartico.api.getLevels(),
190
+ * Promise.resolve(window._smartico.api.getUserProfile()),
191
+ * ]);
192
+ *
193
+ * // Resolve the user's current level by ID.
194
+ * const current = levels.find(l => l.id === profile.ach_level_current_id);
195
+ * console.log('[smartico] render header badge — current level:', current?.name,
196
+ * '(position', current?.ordinal_position, 'of', levels.length, ')');
197
+ *
198
+ * // Filter to levels the user has unlocked enough to see.
199
+ * const visible = levels.filter(l =>
200
+ * l.visibility_points == null || l.visibility_points <= profile.ach_points_ever
201
+ * );
202
+ * console.log('[smartico] render the level map with', visible.length, 'visible tiles');
203
+ *
204
+ * // Visitor-mode equivalent: returns the same ladder; no per-user state.
205
+ * // const visitorLevels = await window._smartico.vapi('EN').getLevels();
206
+ * ```
207
+ */
208
+ getLevels(): Promise<TLevel[]>;
209
+ /**
210
+ * Returns the user's current level — every `TLevel` field plus a
211
+ * computed `progress` percentage toward the next level. Use this to
212
+ * power a level badge with a progress bar.
213
+ *
214
+ * @remarks
215
+ * **How `progress` is computed**
216
+ * The SDK derives `progress` as the *delta-from-current-level-floor*:
217
+ * `(ach_points_ever − current.required_points) / (next.required_points
218
+ * − current.required_points) × 100`, clamped to `[0, 100]`. At the
219
+ * highest level (no next level), `progress` is `100`. Reading the
220
+ * source values directly from {@link getUserProfile}'s
221
+ * `ach_points_ever` and {@link getLevels} would also work, but
222
+ * `progress` saves the math.
223
+ *
224
+ * **Cache TTL**: the SDK caches the response for 30 seconds. There is
225
+ * no push event that refreshes this cache; a server-side level change
226
+ * (visible immediately on {@link getUserProfile}'s `ach_level_current_id`
227
+ * via the user-properties update channel) becomes visible on this
228
+ * method only after the cache TTL expires, or after
229
+ * `_smartico.api.clearCaches()` is called.
230
+ *
231
+ * **Leveling logic**
232
+ * The semantics of how a user advances depends on the label's
233
+ * leveling logic (configured per brand): points-only (the default),
234
+ * sliding-window with extra counters (uses
235
+ * {@link getUserLevelExtraCounters}), or fully-manual operator
236
+ * assignment. The `progress` percentage on this method assumes the
237
+ * points-only model — it's not meaningful for manual-only labels
238
+ * where level changes are operator-driven rather than points-driven.
239
+ *
240
+ * **Idempotency**: safe. Read-only. Repeated calls within the cache
241
+ * window return a deep-cloned cached value without a network
242
+ * round-trip.
243
+ *
244
+ * **Side effects**: none — pure read.
245
+ *
246
+ * **Visitor mode**: not supported.
247
+ *
248
+ * @returns Promise resolving to `TLevelCurrent` — the current level
249
+ * plus `progress: number` (0–100).
250
+ *
251
+ * @example
252
+ * ```ts
253
+ * const level = await window._smartico.api.getCurrentLevel();
254
+ * console.log('[smartico] render level badge — name:', level.name,
255
+ * 'progress:', Math.round(level.progress), '%');
256
+ *
257
+ * // Detect level-up via getUserProfile's push channel.
258
+ * window._smartico.on('props_change', async (changed) => {
259
+ * if ('ach_level_current_id' in changed) {
260
+ * await window._smartico.api.clearCaches(); // bust the 30 s cache
261
+ * const fresh = await window._smartico.api.getCurrentLevel();
262
+ * console.log('[smartico] user levelled up — animate badge to new level:', fresh.name);
263
+ * }
264
+ * });
265
+ * ```
266
+ */
267
+ getCurrentLevel(): Promise<TLevelCurrent>;
268
+ /**
269
+ * Returns the user's current values for the two label-defined "extra
270
+ * counters" used by sliding-window leveling logic. Operators
271
+ * configure what each counter means per label (e.g. `level_counter_1`
272
+ * = total deposits in the last 30 days, `level_counter_2` = total
273
+ * wagering in the last 30 days). Compare against
274
+ * `required_level_counter_1` / `_2` on the next level from
275
+ * {@link getLevels} to know how close the user is to advancing.
276
+ *
277
+ * @remarks
278
+ * **When this matters**
279
+ * Only labels configured for sliding-window leveling populate the
280
+ * counter fields. On the default points-only leveling model, both
281
+ * `level_counter_1` and `level_counter_2` are `undefined`. Detect
282
+ * a points-only label by either counter being `undefined`.
283
+ *
284
+ * **Counter semantics — operator-defined**
285
+ * The SDK exposes raw numeric values; the meaning of each counter
286
+ * (deposit amount, wager amount, lifetime spend, etc.) is fully
287
+ * operator-defined per label. Resolve labels for display via
288
+ * {@link getTranslations} — the operator's display strings are
289
+ * stored under the translation keys `levelsCounter1Name` and
290
+ * `levelsCounter2Name`.
291
+ *
292
+ * **Refresh cadence**
293
+ * Sliding-window counters are recomputed by a server-side job that
294
+ * runs roughly every 60 seconds against the operator's BigQuery
295
+ * dataset; level transitions driven by counter changes have a
296
+ * latency of up to several minutes after the underlying activity
297
+ * (e.g. a deposit). The SDK caches the response for 30 seconds; no
298
+ * push event refreshes this cache. After a level change visible on
299
+ * {@link getUserProfile}'s `ach_level_current_id`, call
300
+ * `_smartico.api.clearCaches()` to force a fresh fetch.
301
+ *
302
+ * **Idempotency**: safe. Read-only. Repeated calls within the cache
303
+ * window return a deep-cloned cached value without a network
304
+ * round-trip.
305
+ *
306
+ * **Side effects**: none — pure read.
307
+ *
308
+ * **Visitor mode**: not supported.
309
+ *
310
+ * @returns Promise resolving to `UserLevelExtraCountersT`. Both
311
+ * fields are `undefined` on labels not using sliding-window
312
+ * leveling.
313
+ *
314
+ * @example
315
+ * ```ts
316
+ * const [counters, levels, profile] = await Promise.all([
317
+ * window._smartico.api.getUserLevelExtraCounters(),
318
+ * window._smartico.api.getLevels(),
319
+ * Promise.resolve(window._smartico.api.getUserProfile()),
320
+ * ]);
321
+ *
322
+ * // Quick detection: undefined means this label doesn't use sliding-window leveling.
323
+ * if (counters.level_counter_1 === undefined) {
324
+ * console.log('[smartico] points-only label — skip counter UI; show points progress only');
325
+ * return;
326
+ * }
327
+ *
328
+ * // Find the next level and render a 3-bar progress block.
329
+ * const currentIdx = levels.findIndex(l => l.id === profile.ach_level_current_id);
330
+ * const next = levels[currentIdx + 1];
331
+ * if (next) {
332
+ * console.log('[smartico] render points bar:', profile.ach_points_ever, '/', next.required_points);
333
+ * if (next.required_level_counter_1) {
334
+ * console.log('[smartico] render counter 1 bar:', counters.level_counter_1, '/', next.required_level_counter_1);
335
+ * }
336
+ * if (next.required_level_counter_2) {
337
+ * console.log('[smartico] render counter 2 bar:', counters.level_counter_2, '/', next.required_level_counter_2);
338
+ * }
339
+ * }
340
+ * ```
341
+ */
342
+ getUserLevelExtraCounters(): Promise<UserLevelExtraCountersT>;
343
+ /**
344
+ * Returns the activity log for a user within a specified time range.
345
+ * The response includes both points changes and gems/diamonds changes.
346
+ * Each log entry contains information about the change amount, balance, and source.
347
+ * The returned list is cached for 30 seconds.
348
+ * You can pass the onUpdate callback as a parameter, it will be called every time the activity log is updated and will provide the updated list of activity logs for the last 10 minutes.
349
+ *
350
+ * **Example**:
351
+ * ```
352
+ * const startTime = Math.floor(Date.now() / 1000) - 86400 * 30; // 30 days ago
353
+ * const endTime = Math.floor(Date.now() / 1000); // now
354
+ *
355
+ * _smartico.api.getActivityLog({
356
+ * startTimeSeconds: startTime,
357
+ * endTimeSeconds: endTime,
358
+ * from: 0,
359
+ * to: 50,
360
+ * onUpdate: (data) => console.log('Updated:', data)
361
+ * }).then((result) => {
362
+ * console.log(result);
363
+ * });
364
+ * ```
365
+ *
366
+ * **Visitor mode: not supported**
367
+ *
368
+ * @param params - Activity log parameters
369
+ * @param params.startTimeSeconds - Start time in seconds (epoch timestamp)
370
+ * @param params.endTimeSeconds - End time in seconds (epoch timestamp)
371
+ * @param params.from - Start index of records to return
372
+ * @param params.to - End index of records to return
373
+ * @param params.onUpdate - Optional callback function that will be called when the activity log is updated
374
+ */
375
+ getActivityLog({ startTimeSeconds, endTimeSeconds, from, to, onUpdate, }: {
376
+ startTimeSeconds: number;
377
+ endTimeSeconds: number;
378
+ from: number;
379
+ to: number;
380
+ onUpdate?: (data: TActivityLog[]) => void;
381
+ }): Promise<TActivityLog[]>;
382
+ protected notifyActivityLogUpdate(): Promise<void>;
383
+ }