@smartico/public-api 0.0.409 → 0.0.411

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 (43) hide show
  1. package/README.md +1 -1
  2. package/dist/MiniGames/SAWDoAknowledgeRequest.d.ts +2 -0
  3. package/dist/MiniGames/SAWPrize.d.ts +18 -0
  4. package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
  5. package/dist/MiniGames/SAWTemplate.d.ts +24 -0
  6. package/dist/SmarticoAPI.d.ts +1 -1
  7. package/dist/SmarticoLib/index.d.ts +1 -1
  8. package/dist/WSAPI/WSAPIJackpots.d.ts +11 -2
  9. package/dist/WSAPI/WSAPIMiniGames.d.ts +92 -23
  10. package/dist/WSAPI/WSAPITypes.d.ts +45 -44
  11. package/dist/index.js +112 -31
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.modern.mjs +109 -28
  14. package/dist/index.modern.mjs.map +1 -1
  15. package/docs/api/classes/WSAPIJackpots.md +11 -2
  16. package/docs/api/classes/WSAPIMiniGames.md +92 -23
  17. package/docs/api/interfaces/SAWDoAknowledgeRequest.md +8 -0
  18. package/docs/api/interfaces/SAWPrize.md +36 -0
  19. package/docs/api/interfaces/SAWPrizeUI.md +2 -0
  20. package/docs/api/interfaces/SAWTemplate.md +48 -0
  21. package/docs/api/interfaces/TMiniGamePrize.md +51 -27
  22. package/docs/api/interfaces/TMiniGameTemplate.md +15 -16
  23. package/docs/capabilities/getJackpotEligibleGames.md +11 -2
  24. package/docs/capabilities/getMiniGames.md +63 -39
  25. package/docs/capabilities/miniGameWinAcknowledgeRequest.md +36 -7
  26. package/docs/capabilities/playMiniGame.md +27 -14
  27. package/docs/native/PROTOCOL.md +7 -0
  28. package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +8 -0
  29. package/docs/ui/minigames/UIGuide_getMiniGames.md +46 -0
  30. package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +1 -1
  31. package/docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md +90 -0
  32. package/docs/ui/minigames/UIGuide_playMiniGame.md +38 -2
  33. package/package.json +1 -1
  34. package/src/MiniGames/SAWDoAknowledgeRequest.ts +2 -0
  35. package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
  36. package/src/MiniGames/SAWPrize.ts +18 -0
  37. package/src/MiniGames/SAWPrizeUI.ts +2 -1
  38. package/src/MiniGames/SAWTemplate.ts +27 -4
  39. package/src/SmarticoAPI.ts +7 -1
  40. package/src/SmarticoLib/index.ts +1 -1
  41. package/src/WSAPI/WSAPIJackpots.ts +11 -2
  42. package/src/WSAPI/WSAPIMiniGames.ts +91 -24
  43. package/src/WSAPI/WSAPITypes.ts +47 -46
@@ -396,7 +396,7 @@ export class WSAPIJackpots extends WSAPIClans {
396
396
  *
397
397
  * @remarks
398
398
  * **Preconditions**
399
- * - User must be authenticated. Visitor mode not supported.
399
+ * - No authentication required — works in both identified and visitor mode.
400
400
  * - `jp_template_id` is mandatory.
401
401
  *
402
402
  * **`onUpdate` caveat**
@@ -414,7 +414,12 @@ export class WSAPIJackpots extends WSAPIClans {
414
414
  * Non-zero `errCode` on control-group users or generic server errors.
415
415
  * Branch on `errCode === 0` and surface `errMsg` on failure.
416
416
  *
417
- * **Visitor mode**: not supported.
417
+ * **Visitor mode**: supported via
418
+ * `_smartico.vapi(lang).getJackpotEligibleGames(...)`. The eligible-games
419
+ * list is template-level (which games contribute to the pot) and carries no
420
+ * per-user fields, so a visitor session receives the same list an identified
421
+ * user would. The `lang` passed to `_smartico.vapi(lang)` drives the
422
+ * translation of game names.
418
423
  *
419
424
  * **UI guidance**: see [UI Guide — `getJackpotEligibleGames`](../../docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md).
420
425
  *
@@ -432,6 +437,10 @@ export class WSAPIJackpots extends WSAPIClans {
432
437
  *
433
438
  * const r = await window._smartico.api.getJackpotEligibleGames({ jp_template_id: 42 });
434
439
  * console.log('[smartico] render', r.eligible_games.length, 'eligible game tiles');
440
+ *
441
+ * // Visitor mode — same shape, language driven by the vapi(lang) argument
442
+ * const visitor = await window._smartico.vapi('EN').getJackpotEligibleGames({ jp_template_id: 42 });
443
+ * console.log('[smartico] visitor eligible games:', visitor.eligible_games.length);
435
444
  * ```
436
445
  */
437
446
  public async getJackpotEligibleGames({ jp_template_id, onUpdate } : {
@@ -64,6 +64,27 @@ export class WSAPIMiniGames extends WSAPIRaffles {
64
64
  * games server (not this SDK); the SAW spin is fired
65
65
  * server-internally to deduct the buy-in.
66
66
  *
67
+ * **Per-prize statistics (`expose_game_stat_on_api`)**
68
+ * Each template's `prizes` array always carries the definition
69
+ * fields — name, icon, `prize_type`, `prize_value`, acknowledge
70
+ * configuration. The stock-statistics fields are gated by an
71
+ * operator template setting, surfaced as
72
+ * `expose_game_stat_on_api`:
73
+ * - Populated when enabled: `pool` (remaining stock),
74
+ * `wins_count` (total wins across all players), `weekdays`
75
+ * (ISO 1–7 days the prize can be won), `active_from_ts` /
76
+ * `active_till_ts` (prize availability window).
77
+ * - Omitted when disabled (the default) — this keeps the live
78
+ * prize economy (stock levels, win rates, schedules) hidden
79
+ * from players.
80
+ * - Exception: `pool` is always populated for `MatchX` / `Quiz`
81
+ * templates, whose game flow needs the remaining stock.
82
+ * - `pool_initial` is populated regardless of the setting.
83
+ * When enabled, the values are also kept current — the server
84
+ * refreshes the prize rows on each fetch and drops its template
85
+ * caches after every play, so `pool` / `wins_count` are safe to
86
+ * drive an "X prizes left" scarcity UI.
87
+ *
67
88
  * **Cache TTL**: the SDK caches the response for 30 seconds. Cache
68
89
  * is fully cleared on login / logout.
69
90
  *
@@ -290,14 +311,19 @@ export class WSAPIMiniGames extends WSAPIRaffles {
290
311
  * it later by calling {@link miniGameWinAcknowledgeRequest} with the
291
312
  * `request_id` returned on this result.
292
313
  *
293
- * What `acknowledge: false` does and does NOT defer:
294
- * - For STANDARD prizes the value is credited at spin time
295
- * regardless, so opting out does NOT delay the balance change —
296
- * it only defers the "delivered" bookkeeping and the `is_claimed`
297
- * flag flipping in {@link getMiniGamesHistory}.
298
- * - For operator-configured "explicit claim" prizes the credit IS
299
- * deferred until the spin is acknowledged, so those require an
300
- * explicit acknowledge to finalise.
314
+ * What `acknowledge: false` defers:
315
+ * - For STANDARD prizes the value is credited when the spin is
316
+ * finalised — by your later acknowledge or, failing that, by the
317
+ * server-side fallback below — so opting out delays the balance
318
+ * change by at most that fallback window. The `is_claimed` flag in
319
+ * {@link getMiniGamesHistory} flips on the same finalisation.
320
+ * - For operator-configured "explicit claim" prizes the credit is
321
+ * deferred until your explicit acknowledge — the fallback does not
322
+ * cover them.
323
+ *
324
+ * While the spin is un-finalised it can also be finalised as LOST —
325
+ * prize discarded back to the pool — via
326
+ * {@link miniGameWinAcknowledgeRequest} with `{ lose: true }`.
301
327
  *
302
328
  * A server-side fallback auto-acknowledges ordinary un-acknowledged
303
329
  * spins after a short delay (about 1–3 minutes), so an ordinary
@@ -328,8 +354,10 @@ export class WSAPIMiniGames extends WSAPIRaffles {
328
354
  * time the call resolves. Balance updates flow via the
329
355
  * user-properties channel (observe via {@link getUserProfile}).
330
356
  * - Prize value credited per the prize's type (see "Prize handling"
331
- * above). Standard prizes are credited at spin time; "explicit
332
- * claim" prizes are credited when the spin is acknowledged.
357
+ * above) when the spin is finalised — with the default
358
+ * auto-acknowledge that happens before the call resolves;
359
+ * "explicit claim" prizes are credited only by an explicit
360
+ * acknowledge.
333
361
  * - The play is recorded server-side for analytics / reporting.
334
362
  *
335
363
  * **UI guidance**: see [UI Guide — `playMiniGame`](../../docs/ui/minigames/UIGuide_playMiniGame.md).
@@ -394,18 +422,24 @@ export class WSAPIMiniGames extends WSAPIRaffles {
394
422
  *
395
423
  * @example
396
424
  * Manual finalisation (`acknowledge: false`) — e.g. an explicit
397
- * "Claim" CTA, or finalising on your own schedule:
425
+ * "Claim" CTA, a decline/forfeit flow, or finalising on your own
426
+ * schedule:
398
427
  * ```ts
399
428
  * const r = await window._smartico.api.playMiniGame(game.id, { acknowledge: false });
400
429
  * if (r.err_code === 0) {
401
- * // Spin resolved but not yet acknowledged. For standard prizes the
402
- * // balance already changed server-side; "explicit claim" prizes
403
- * // are credited only by the acknowledge below.
430
+ * // Spin resolved but not yet finalised — the prize is not credited
431
+ * // yet. Your acknowledge below credits it (for standard prizes the
432
+ * // server-side fallback would eventually do the same).
404
433
  * console.log('[smartico] prize won — show the result / Claim CTA, then finalise');
405
434
  *
406
435
  * // On the user's Claim click, finalise with the request_id from the result.
407
436
  * await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
408
437
  * console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
438
+ *
439
+ * // Or, if the game flow ends in the player declining / losing the
440
+ * // drawn prize, finalise the spin as lost instead — the prize is
441
+ * // not credited and returns to the prize pool:
442
+ * // await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });
409
443
  * }
410
444
  * ```
411
445
  */
@@ -433,9 +467,10 @@ export class WSAPIMiniGames extends WSAPIRaffles {
433
467
 
434
468
  /**
435
469
  * Manually acknowledges a mini-game spin — marks the win delivered
436
- * server-side. Most consumers do NOT need this: {@link playMiniGame}
437
- * acknowledges by default (`acknowledge: true`) and
438
- * {@link playMiniGameBatch} acknowledges automatically. Call this
470
+ * server-side, or (with `lose: true`) finalises it as lost and
471
+ * returns the prize to the pool. Most consumers do NOT need this:
472
+ * {@link playMiniGame} acknowledges by default (`acknowledge: true`)
473
+ * and {@link playMiniGameBatch} acknowledges automatically. Call this
439
474
  * directly only when you took ownership of the acknowledge step or
440
475
  * need to recover a lost one.
441
476
  *
@@ -458,6 +493,27 @@ export class WSAPIMiniGames extends WSAPIRaffles {
458
493
  * `client_request_id` on a {@link getMiniGamesHistory} row are the
459
494
  * same correlation id — this method accepts either.
460
495
  *
496
+ * **Finalising as lost (`lose: true`)**
497
+ * Pass `{ lose: true }` to finalise the spin as LOST instead of won:
498
+ * the prize is NOT credited and is returned to the game's prize pool
499
+ * (available again for other players), and the spin fires the
500
+ * mini-game "lose" engagement event instead of the win one. On the
501
+ * next {@link getMiniGamesHistory} fetch the row shows `is_claimed:
502
+ * true` with no prize attached. Use this for game mechanics where the
503
+ * player can decline or forfeit the drawn prize — e.g. a
504
+ * gamble/discard step, or a client-driven game where the user's final
505
+ * action decides whether the pre-drawn prize is actually won (the
506
+ * default Smartico UI does this for the Voyager game: failing the
507
+ * star-collection run finalises the spin as lost). When configured,
508
+ * the prize's `aknowledge_message_lose` is the operator's result copy
509
+ * for this case — show it instead of `aknowledge_message`. It only
510
+ * works on a spin that is not yet finalised, so it requires playing
511
+ * with `acknowledge: false` and calling promptly — once the automatic
512
+ * acknowledge or the server-side fallback (below) has finalised the
513
+ * spin, `lose: true` is a no-op and the prize stays credited.
514
+ * ("Explicit claim" prizes are exempt from the fallback, so for them
515
+ * there is no time pressure.)
516
+ *
461
517
  * **Idempotency**: safe. Acknowledging a spin that is already
462
518
  * finalised — by you, by the automatic acknowledge, or by the
463
519
  * fallback — is a no-op with no double credit. Acknowledging a
@@ -472,13 +528,16 @@ export class WSAPIMiniGames extends WSAPIRaffles {
472
528
  * call here.
473
529
  *
474
530
  * **Side effects** (first successful call for an un-acknowledged spin)
475
- * - For "explicit claim" prizes, the prize value is credited on this
476
- * call. For standard prizes the value was already credited at spin
477
- * time (see {@link playMiniGame} "Prize handling"); this call only
478
- * marks the win delivered.
479
- * - The spin's `is_claimed` flips to `true` on the next
531
+ * - Default (win): the prize value is credited on this call — this is
532
+ * the finalisation step that credits standard and "explicit claim"
533
+ * prizes alike (see {@link playMiniGame} "Prize handling").
534
+ * - With `lose: true`: no credit; the prize returns to the prize pool
535
+ * and the "lose" engagement event fires.
536
+ * - Either way the spin's `is_claimed` flips to `true` on the next
480
537
  * {@link getMiniGamesHistory} fetch.
481
538
  *
539
+ * **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).
540
+ *
482
541
  * **Visitor mode**: not supported.
483
542
  *
484
543
  * @param request_id Correlation id of the spin to finalise: the
@@ -486,6 +545,10 @@ export class WSAPIMiniGames extends WSAPIRaffles {
486
545
  * (played with `acknowledge: false`), or the
487
546
  * `client_request_id` of a
488
547
  * {@link getMiniGamesHistory} row.
548
+ * @param options.lose Optional. When `true`, finalises the spin as
549
+ * lost — the prize is not credited and returns
550
+ * to the prize pool (see "Finalising as lost").
551
+ * Omit (or pass `false`) to deliver the win.
489
552
  *
490
553
  * @example
491
554
  * ```ts
@@ -496,6 +559,10 @@ export class WSAPIMiniGames extends WSAPIRaffles {
496
559
  * await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
497
560
  * }
498
561
  *
562
+ * // Decline / forfeit — finalise the same spin as lost instead:
563
+ * // the prize is not credited and goes back to the prize pool.
564
+ * await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });
565
+ *
499
566
  * // Recovery — re-acknowledge any spins a batch acknowledge missed.
500
567
  * const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });
501
568
  * for (const row of history.filter(h => !h.is_claimed)) {
@@ -504,8 +571,8 @@ export class WSAPIMiniGames extends WSAPIRaffles {
504
571
  * }
505
572
  * ```
506
573
  */
507
- public async miniGameWinAcknowledgeRequest(request_id: string) {
508
- return this.api.doAcknowledgeRequest(this.userExtId, request_id);
574
+ public async miniGameWinAcknowledgeRequest(request_id: string, { lose }: { lose?: boolean } = {}) {
575
+ return this.api.doAcknowledgeRequest(this.userExtId, request_id, lose);
509
576
  }
510
577
 
511
578
  /**
@@ -23,71 +23,73 @@ type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
23
23
  export interface TMiniGamePrize {
24
24
  /** ID of the prize */
25
25
  id: number;
26
- /** The visual name of the prize */
26
+ /** Display name of the prize, pre-translated; any jackpot placeholder in it arrives resolved to the live jackpot value */
27
27
  name: string;
28
- /** The type of the prize, no-prize, points, bonus, manual, spin, jackpot */
28
+ /** The type of the prize — see {@link MiniGamePrizeTypeName} ('no-prize', 'points', 'gems-and-diamonds', 'spin', 'bonus', 'jackpot', 'raffle-ticket', 'mission', 'change-level', 'manual') */
29
29
  prize_type: MiniGamePrizeTypeName;
30
- /** Numeric value of the prize in case it's 'points' or 'spin' type. For other types of prizes this value is not relevant.
30
+ /** Numeric value of the prize in case it's 'points' or 'spin' type. For other types of prizes this value is not relevant.
31
31
  * For example for prize '100 points' the prize_value will be 100. For '100 free spins' the prize_value will be 100.
32
32
  */
33
33
  prize_value?: number;
34
- /** Custom font size for the prize (desktop) */
34
+ /** Custom font size in px for rendering the prize name on the game surface (e.g. a wheel sector), desktop */
35
35
  font_size?: number;
36
- /** Custom font size for the prize (mobile) */
36
+ /** Custom font size in px for the prize name, mobile; falls back to `font_size` when absent */
37
37
  font_size_mobile?: number;
38
38
  /** The URL of the icon of the prize, aspect ratio 1:1 */
39
39
  icon?: string;
40
- /** for scratch card defines position of prize in the list */
40
+ /** For Scratch Card games — relative order of the prize in the scratch grid (lower first). May be absent for other game types */
41
41
  position: number;
42
- /** List of sectors for the prize */
42
+ /** For Spin-a-Wheel games — wheel sector indices this prize occupies. Absent for non-wheel games */
43
43
  sectors: number[];
44
- /** Type of acknowledge message for users */
44
+ /** Which win modal the prize uses — see {@link SAWAcknowledgeTypeName} (Silent / QuickMessage / FullMessage / ExplicitAcknowledge) */
45
45
  acknowledge_type: SAWAcknowledgeTypeName;
46
46
  /** Message that will be shown to user in modal pop-up */
47
47
  aknowledge_message: string;
48
- /** Deep link that will trigger some action in modal pop-up */
48
+ /** Message shown instead of `aknowledge_message` when the spin is finalised as lost (`lose: true` acknowledge flows — games with a client-decided outcome, e.g. Voyager). Absent unless configured */
49
+ aknowledge_message_lose?: string;
50
+ /** Deep link executed when the user taps the main action button in the win modal (run it via `_smartico.dp()`) */
49
51
  acknowledge_dp: string;
50
- /** The name of the action button in modal pop-up */
52
+ /** Label of the main action button in the win modal */
51
53
  acknowledge_action_title: string;
52
- /** Deep link that will trigger some action in modal pop-up (additional) */
54
+ /** Deep link of the additional action button in the win modal */
53
55
  acknowledge_dp_additional?: string;
54
- /** The name of the action button in modal pop-up (additional) */
56
+ /** Label of the additional action button in the win modal */
55
57
  acknowledge_action_title_additional?: string;
56
- /** Deep link that will trigger some action in modal pop-up (second button) */
58
+ /** Deep link of the secondary button in the win modal */
57
59
  second_btn?: string,
58
- /** The name of the action button in modal pop-up (second button) */
60
+ /** Label of the secondary button in the win modal */
59
61
  second_btn_action_title?: string;
60
62
  /** Message when the prize pool is empty for that specific prize */
61
63
  out_of_stock_message?: string;
62
- /** Number of items in stock */
64
+ /** Remaining stock of the prize — decrements on each win, refunded if the spin is finalised as lost. Populated only when the template's `expose_game_stat_on_api` is enabled; always populated for MatchX / Quiz games */
63
65
  pool?: number;
64
- /** Initial number of items in stock */
66
+ /** Initial (configured) stock of the prize. Populated regardless of `expose_game_stat_on_api` */
65
67
  pool_initial?: number;
66
- /** Number of wins in game */
68
+ /** Number of times the prize has been won, across all players. Populated only when the template's `expose_game_stat_on_api` is enabled */
67
69
  wins_count?: number;
68
- /** Number of days of week, when the prize can be available */
70
+ /** ISO weekday numbers (1 = Monday … 7 = Sunday) on which the prize can be won; absent = any day. Populated only when the template's `expose_game_stat_on_api` is enabled */
69
71
  weekdays?: number[];
70
- /** Holds time from which prize will become available, for the prizes that are targeted to be available from specific time (UNIX timestamp) */
72
+ /** Time from which the prize can be won (epoch ms), evaluated against `relative_period_timezone`. Populated only when the template's `expose_game_stat_on_api` is enabled */
71
73
  active_from_ts?: number;
72
- /** Holds time till which prize will become available, for the prizes that are targeted to be available from specific time (UNIX timestamp) */
74
+ /** Time until which the prize can be won (epoch ms), evaluated against `relative_period_timezone`. Populated only when the template's `expose_game_stat_on_api` is enabled */
73
75
  active_till_ts?: number;
74
- /** Time zone to ensure each day aligns with your local midnight. */
76
+ /** Timezone offset in minutes used to evaluate `weekdays` and the active window (UTC minus local, as in JS `Date.getTimezoneOffset()` — e.g. `-180` for UTC+3) */
75
77
  relative_period_timezone?: number;
76
- /** Flag indicating that the prize is surcharged (available all the time, despite pool numbers) */
78
+ /** When true, the prize stays winnable even when its `pool` reaches 0 (effectively unlimited stock) */
77
79
  is_surcharge?: boolean;
78
- /** Flag indicating the state of the prize */
80
+ /** Always `false` in API responses — deleted prizes are excluded server-side */
79
81
  is_deleted?: boolean;
80
- /** The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number */
82
+ /** The custom data of the prize defined by the operator. Can be a JSON object, string or number */
81
83
  custom_data?: any;
82
- /** Prize modifiers that will multiply by 2x, 5x or 10x the current total. This will not affect the final Prize Amount that will be awarded. */
84
+ /** Step-modifier tiles for step games (Treasure Hunt / Voyager) — see {@link PrizeModifiers} (2x / 5x / 10x, /2 / /5 / /10, 0, reset) applied to the running total revealed during the game. Presentation only — the awarded amount is still `prize_value` */
83
85
  prize_modifiers?: PrizeModifiers[];
84
- /** When enabled, you can split prize value by decimal values */
86
+ /** Step games (Treasure Hunt / Voyager): when true, the per-step revealed amounts of the prize value may be fractional; when false the split uses whole numbers */
85
87
  allow_split_decimal?: boolean;
86
- /** When enabled, you can hide prize from prize history */
88
+ /** Operator hint to hide this prize when rendering prize-history UIs. Informational only — API responses are not filtered by it */
87
89
  hide_prize_from_history?: boolean;
88
- /** Requirements to claim the prize (lootbox specific)*/
90
+ /** Operator text describing what the user must do to be eligible for this prize (lootbox games); shown when the prize is not yet available to the user */
89
91
  requirements_to_get_prize?: string;
90
- /** The period type for the prize to be given: Time from last attempt, Calendar days UTC, Calendar days user time zone, Lifetime */
92
+ /** Period basis for the prize availability restriction — see {@link AttemptPeriodType}. `CalendarDaysUserTimeZone` evaluates `weekdays` / the active window in the user's timezone; the other types use `relative_period_timezone` */
91
93
  max_give_period_type_id?: AttemptPeriodType;
92
94
  }
93
95
 
@@ -167,11 +169,10 @@ export interface TMiniGameTemplate {
167
169
  /** in case of charging type 'Spin attempts', shows the current number of spin attempts that user has */
168
170
  spin_count?: number;
169
171
 
170
- /**
171
- * if the game is limit to the number of spins that user can do during period of time,
172
- * this property shows the epoch time in UTC when the next attempt will be available.
173
- * Note that you need to enable 'Show time to the next available spin' setting on mini-game template in the backoffice
174
- * Important: this field will not be populated if “Max number of attempts a user can do” is set to value different from 1
172
+ /**
173
+ * If the game limits the number of attempts per period of time, the epoch-ms time (UTC) when the next attempt becomes available.
174
+ * Populated only when the operator enabled the "show time to the next available spin" template setting, and only when the
175
+ * template's maximum attempts per period is 1.
175
176
  * */
176
177
  next_available_spin_ts: number;
177
178
 
@@ -190,7 +191,7 @@ export interface TMiniGameTemplate {
190
191
  /** The message that should be shown to the user when he cannot play the game because he doesn't have spin attempts or points. */
191
192
  no_attempts_message: string;
192
193
 
193
- /** Current jackpont amount, if jackpot is enabled. */
194
+ /** Current jackpot amount, if jackpot is enabled. */
194
195
  jackpot_current: number;
195
196
  /** The amount that will be added to the jackpot every time when somebody plays the game. Note that the contribution amount is abstract, means that no money or points are deducted from the user balance. */
196
197
  jackpot_add_on_attempt: number;
@@ -205,34 +206,34 @@ export interface TMiniGameTemplate {
205
206
  /** The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number */
206
207
  custom_data: any;
207
208
 
208
- /** List of prizes for mini-games */
209
+ /** Prizes configured for this game — see {@link TMiniGamePrize} */
209
210
  prizes: TMiniGamePrize[];
210
211
 
211
- /** When enabled, the number of items in the pool and number of won items will be exposed in the Retention API and in the UI Widgets */
212
+ /** Operator template setting. When enabled, the per-prize stock statistics (`pool`, `wins_count`, `weekdays`, `active_from_ts` / `active_till_ts`) are populated on `prizes` and kept current after every play; when disabled (default) those fields are omitted. See `getMiniGames` "Per-prize statistics" */
212
213
  expose_game_stat_on_api?: boolean;
213
214
 
214
- /** Time zone to ensure each day aligns with your local midnight. */
215
+ /** Timezone offset in minutes used to evaluate the template's period-based rules (UTC minus local, as in JS `Date.getTimezoneOffset()` — e.g. `-180` for UTC+3) */
215
216
  relative_period_timezone?: number;
216
- /** Holds time from which template will become available, for the template that are targeted to be available from specific time (UNIX timestamp) */
217
+ /** Time from which the template becomes available (epoch ms); absent when not restricted */
217
218
  activeFromDate?: number;
218
- /** Holds time till which template will become available, for the templates that are targeted to be available from specific time (UNIX timestamp) */
219
+ /** Time until which the template stays available (epoch ms); absent when not restricted */
219
220
  activeTillDate?: number;
220
- /** The amount of steps to complete the game and gather the prize */
221
+ /** Number of steps to complete the game and collect the prize (step games — Voyager / Treasure Hunt) */
221
222
  steps_to_finish_game?: number;
222
- /** Hold the id of the custom section */
223
+ /** ID of the operator-defined custom section (widget menu grouping) the mini-game is assigned to */
223
224
  custom_section_id?: number;
224
225
 
225
- /** The UI definition of the mini-game */
226
+ /** Full raw UI definition of the mini-game (skin, colors, per-game visual settings) — see {@link SAWTemplateUI}. The commonly needed values are already lifted onto this template object */
226
227
  saw_template_ui_definition: SAWTemplateUI;
227
- /** The layout of the game */
228
+ /** Grid layout of the game. Populated only for Lootbox game types (LootboxWeekdays / LootboxCalendarDays) */
228
229
  game_layout?: SAWGameLayoutName;
229
- /** When enabled the prize history icon is visible on a certain template */
230
+ /** Operator setting: show a prize-history entry point (icon / button) on this game's view */
230
231
  show_prize_history?: boolean;
231
232
  /** The maximum number of attempts that user can do during period of time */
232
233
  max_number_of_attempts?: number;
233
234
  /** The period of time in milliseconds during which the user can do the maximum number of attempts */
234
235
  max_spins_period_ms?: number;
235
- /** The ID of the user spin id to expose on the game */
236
+ /** Which identifier to show next to a win result for transparency/audit — 'userId' (the player's external user id) or 'spinId' (the spin's transaction id). Absent when the operator disabled it */
236
237
  expose_user_spin_id?: SAWExposeUserSpinIdName;
237
238
  }
238
239