@smartico/public-api 0.0.410 → 0.0.412

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 (51) hide show
  1. package/README.md +1 -1
  2. package/dist/Jackpots/JackpotPublicMeta.d.ts +1 -1
  3. package/dist/Level/LevelPublicMeta.d.ts +1 -1
  4. package/dist/MiniGames/SAWPrize.d.ts +9 -0
  5. package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
  6. package/dist/MiniGames/SAWTemplate.d.ts +25 -0
  7. package/dist/Raffle/Raffle.d.ts +1 -1
  8. package/dist/SmarticoLib/index.d.ts +3 -3
  9. package/dist/WSAPI/WSAPIMiniGames.d.ts +7 -1
  10. package/dist/WSAPI/WSAPIMissions.d.ts +40 -12
  11. package/dist/WSAPI/WSAPITypes.d.ts +40 -37
  12. package/dist/index.js +49 -13
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.modern.mjs +49 -13
  15. package/dist/index.modern.mjs.map +1 -1
  16. package/docs/api/classes/WSAPIMiniGames.md +7 -1
  17. package/docs/api/classes/WSAPIMissions.md +40 -12
  18. package/docs/api/interfaces/JackpotPublicMeta.md +1 -1
  19. package/docs/api/interfaces/LevelPublicMeta.md +1 -1
  20. package/docs/api/interfaces/RafflePublicMeta.md +1 -1
  21. package/docs/api/interfaces/SAWPrize.md +18 -0
  22. package/docs/api/interfaces/SAWPrizeUI.md +2 -0
  23. package/docs/api/interfaces/SAWTemplate.md +46 -0
  24. package/docs/api/interfaces/TMiniGamePrize.md +28 -20
  25. package/docs/api/interfaces/TMiniGameTemplate.md +12 -13
  26. package/docs/api/interfaces/TMissionOrBadge.md +6 -4
  27. package/docs/api/interfaces/TRaffle.md +1 -1
  28. package/docs/capabilities/getBadges.md +4 -4
  29. package/docs/capabilities/getMiniGames.md +30 -29
  30. package/docs/capabilities/getMissions.md +44 -16
  31. package/docs/capabilities/getRaffles.md +1 -1
  32. package/docs/capabilities/jackpotGet.md +1 -1
  33. package/docs/capabilities/miniGameWinAcknowledgeRequest.md +7 -1
  34. package/docs/native/PROTOCOL.md +4 -0
  35. package/docs/ui/minigames/UIGuide_getMiniGames.md +22 -0
  36. package/docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md +90 -0
  37. package/docs/ui/minigames/UIGuide_playMiniGame.md +12 -3
  38. package/docs/ui/missions/UIGuide_getMissions.md +44 -24
  39. package/package.json +1 -1
  40. package/src/Jackpots/JackpotPublicMeta.ts +1 -1
  41. package/src/Level/LevelPublicMeta.ts +1 -1
  42. package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
  43. package/src/MiniGames/SAWPrize.ts +9 -0
  44. package/src/MiniGames/SAWPrizeUI.ts +2 -1
  45. package/src/MiniGames/SAWTemplate.ts +28 -4
  46. package/src/Raffle/Raffle.ts +1 -1
  47. package/src/SmarticoAPI.ts +5 -0
  48. package/src/SmarticoLib/index.ts +3 -3
  49. package/src/WSAPI/WSAPIMiniGames.ts +7 -1
  50. package/src/WSAPI/WSAPIMissions.ts +40 -12
  51. package/src/WSAPI/WSAPITypes.ts +42 -39
@@ -17,7 +17,7 @@ interface JackpotPublicMeta {
17
17
  /**
18
18
  * Custom data as string or JSON string that can be used in API to build custom UI
19
19
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
20
- * Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
20
+ * Read more here - <https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes>
21
21
  */
22
22
  custom_data: string;
23
23
  }
@@ -17,7 +17,7 @@ export interface LevelPublicMeta {
17
17
  /**
18
18
  * Custom data as string or JSON string that can be used in API to build custom UI
19
19
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
20
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
20
+ * Read more here - https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes
21
21
  */
22
22
  custom_data?: string;
23
23
  }
@@ -73,6 +73,7 @@ export const SAWTemplatesTransform = (items: SAWTemplate[]): TMiniGameTemplate[]
73
73
  sectors: p.saw_prize_ui_definition.sectors,
74
74
  acknowledge_type: SAWAcknowledgeTypeNamed(p.saw_prize_ui_definition.acknowledge_type),
75
75
  aknowledge_message: p.saw_prize_ui_definition.aknowledge_message,
76
+ aknowledge_message_lose: p.saw_prize_ui_definition.aknowledge_message_lose,
76
77
  acknowledge_dp: p.saw_prize_ui_definition.acknowledge_dp,
77
78
  acknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,
78
79
  acknowledge_dp_additional: p.saw_prize_ui_definition.acknowledge_dp_additional,
@@ -3,12 +3,19 @@ import { SAWPrizeType } from './SAWPrizeType';
3
3
  import { SAWPrizeUI } from './SAWPrizeUI';
4
4
 
5
5
  export interface SAWPrize {
6
+ /** ID of the prize */
6
7
  saw_prize_id: number;
8
+ /** Visual definition of the prize (name, icon, win-modal buttons, per-game rendering hints) */
7
9
  saw_prize_ui_definition: SAWPrizeUI;
10
+ /** Numeric value for 'points' / 'spin' prize types (e.g. 100 for "100 points"); not relevant for other types */
8
11
  prize_value?: number;
12
+ /** The type of the prize — see {@link SAWPrizeType} */
9
13
  prize_type_id: SAWPrizeType;
14
+ /** Competition games (MatchX / Quiz): first finishing place this prize applies to */
10
15
  place_from?: number;
16
+ /** Competition games (MatchX / Quiz): last finishing place this prize applies to; equals `place_from` for a single-place prize */
11
17
  place_to?: number;
18
+ /** Client-side only — unique id of a win instance generated by the default Smartico UI to dedupe render effects; never sent by the server */
12
19
  sawUniqueWinId?: string;
13
20
  /** Remaining stock. Present only when the template's `expose_game_stat_on_api` is enabled; always present for MatchX / Quiz games */
14
21
  pool?: number;
@@ -28,6 +35,8 @@ export interface SAWPrize {
28
35
  is_surcharge?: boolean;
29
36
  /** Always `false` in API responses — deleted prizes are excluded server-side */
30
37
  is_deleted?: boolean;
38
+ /** Type-specific prize details — e.g. `gems` / `_gems_diamonds_type` for gems-and-diamonds prizes, `tickets_count` for raffle-ticket prizes */
31
39
  prize_details_json?: {[key: string]: any};
40
+ /** Period basis for the prize availability restriction — see {@link AttemptPeriodType} */
32
41
  max_give_period_type_id?: AttemptPeriodType;
33
42
  }
@@ -8,7 +8,8 @@ export interface SAWPrizeUI {
8
8
  name_original?: string; // keeps original name, how it came from the servers. This is needed for the Jackpot value replacemenet
9
9
  hide_prize_popup: boolean; // if true, prize popup on Prize Drop will not be shown
10
10
  aknowledge_message?: string;
11
- aknowledge_message_lose?: string; // voyager specific
11
+ /** Message shown instead of `aknowledge_message` when the spin is finalised as lost (`lose: true` acknowledge — games with a client-decided outcome, e.g. Voyager) */
12
+ aknowledge_message_lose?: string;
12
13
  sectors?: number[];
13
14
  acknowledge_type?: SAWAcknowledgeType;
14
15
  acknowledge_dp?: string;
@@ -4,31 +4,49 @@ import { SAWPrize } from './SAWPrize';
4
4
  import { SAWTemplateUI } from './SAWTemplateUI';
5
5
 
6
6
  export interface SAWTemplate {
7
+ /** ID of the mini-game template */
7
8
  saw_template_id: number;
9
+ /** The type of the game — see {@link SAWGameType} */
8
10
  saw_game_type_id: SAWGameType;
11
+ /** Full UI definition of the mini-game (name, description, skin, colors, per-game visual settings) */
9
12
  saw_template_ui_definition: SAWTemplateUI;
10
13
 
14
+ /** How the user is charged per attempt — see {@link SAWBuyInType} */
11
15
  saw_buyin_type_id: SAWBuyInType;
16
+ /** Cost per attempt in the buy-in currency (points, gems or diamonds per `saw_buyin_type_id`) */
12
17
  buyin_cost_points?: number;
18
+ /** Operator hint: show the game only while the user can actually play it (has attempts / sufficient balance) */
13
19
  visibile_when_can_spin: boolean;
14
20
 
15
- spin_count?: number; // inital count, after that server will push SAWSpinsCountPush
21
+ /** Number of spin attempts the user currently has (initial value; later changes arrive as spin-count pushes) */
22
+ spin_count?: number;
16
23
 
24
+ /** Prizes configured for this game — see {@link SAWPrize} */
17
25
  prizes: SAWPrize[];
18
26
 
27
+ /** Operator visibility flag for the template */
19
28
  is_visible: boolean;
20
29
 
30
+ /** Time from which the template becomes available (epoch ms); absent when not restricted */
21
31
  activeFromDate?: number;
32
+ /** Time until which the template stays available (epoch ms); absent when not restricted */
22
33
  activeTillDate?: number;
23
34
 
35
+ /** Amount added to the jackpot on every play (abstract contribution — nothing is deducted from the player) */
24
36
  jackpot_add_on_attempt: number;
37
+ /** Current jackpot accumulator value */
25
38
  jackpot_current: number;
39
+ /** Seed value of the jackpot — the accumulator starts at (and resets to) this amount after a jackpot win */
26
40
  jackpot_guaranteed: number;
27
41
 
42
+ /** Maximum number of unspent spin attempts a user can accumulate */
28
43
  maxActiveSpinsAllowed: number;
44
+ /** Maximum number of attempts a user can make during `maxSpinsPediodMs` */
29
45
  maxSpinsCount: number;
46
+ /** Length of the attempt-limit period in ms (note the field-name spelling) */
30
47
  maxSpinsPediodMs: number;
31
48
 
49
+ /** Epoch-ms time when the next attempt becomes available; populated only when the operator enabled the "show time to the next available spin" setting and max attempts per period is 1 */
32
50
  next_available_spin_ts?: number;
33
51
 
34
52
  /** Soonest-expiring spin's expiration time for this user (epoch ms); `null`/absent when no expirable spins. */
@@ -36,7 +54,9 @@ export interface SAWTemplate {
36
54
  /** Latest-expiring spin's expiration time for this user (epoch ms); `null`/absent when no expirable spins. */
37
55
  latest_expiration_dt?: number | null;
38
56
 
57
+ /** Key of the visual skin the operator selected for the game */
39
58
  saw_skin_key: string;
59
+ /** Skin assets of the game: `skin_folder` is the base URL for the skin's images, `skin_css` custom CSS overrides, plus optional popup/animation tweaks */
40
60
  saw_skin_ui_definition: {
41
61
  skin_folder: string;
42
62
  skin_css: string;
@@ -47,9 +67,13 @@ export interface SAWTemplate {
47
67
  /** Operator template setting. When enabled, the per-prize stock statistics (`pool`, `wins_count`, `weekdays`, `active_from_ts` / `active_till_ts`) are populated on `prizes`; when disabled (default) the server strips them from the response (`pool` is kept for MatchX / Quiz games). */
48
68
  expose_game_stat_on_api?: boolean;
49
69
 
50
- // AA: releavnt only in the context of the SAWPrizeDropWinPush
70
+ /** Prize Drop only: when true, the pushed prize requires an explicit claim by the user before it is credited */
51
71
  requires_prize_claim?: boolean;
52
-
72
+ /** Prize Drop only: when true, the pushed prize requires a manual claim by the user before it is credited. The difference between this and `requires_prize_claim` is that requires_manual_claim gives the user the ability to cancel the claim. */
73
+ requires_manual_claim?: boolean;
74
+
75
+ /** Timezone offset in minutes used to evaluate the template's period-based rules (UTC minus local, as in JS `Date.getTimezoneOffset()`) */
53
76
  relative_period_timezone?: number;
54
- show_prize_history?:boolean;
77
+ /** Operator setting: show a prize-history entry point (icon / button) on this game's view */
78
+ show_prize_history?: boolean;
55
79
  }
@@ -25,7 +25,7 @@ interface RafflePublicMeta {
25
25
  /**
26
26
  * Custom data as string or JSON string that can be used in API to build custom UI
27
27
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
28
- * Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
28
+ * Read more here - <https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes>
29
29
  */
30
30
  custom_data: string;
31
31
 
@@ -668,6 +668,11 @@ class SmarticoAPI {
668
668
  '{{jackpot}}',
669
669
  jackpotValue,
670
670
  );
671
+ p.saw_prize_ui_definition.aknowledge_message_lose = IntUtils.replaceAll(
672
+ p.saw_prize_ui_definition.aknowledge_message_lose,
673
+ '{{jackpot}}',
674
+ jackpotValue,
675
+ );
671
676
  });
672
677
  }
673
678
  });
@@ -873,21 +873,21 @@ export interface TLevel {
873
873
  /**
874
874
  * The counter of 1st metric used to reach the Level.
875
875
  * Relevant in case of using advanced leveling logic
876
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
876
+ * https://help.smartico.ai/welcome/products/release-notes/september-2022#new-logic-for-leveling-users
877
877
  *
878
878
  */
879
879
  required_level_counter_1: number;
880
880
  /**
881
881
  * The counter of 2nd metric used to reach the Level.
882
882
  * Relevant in case of using advanced leveling logic
883
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
883
+ * https://help.smartico.ai/welcome/products/release-notes/september-2022#new-logic-for-leveling-users
884
884
  *
885
885
  */
886
886
  required_level_counter_2: number;
887
887
  /**
888
888
  * Custom data as string or JSON string that can be used in API to build custom UI
889
889
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
890
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
890
+ * Read more here - https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes
891
891
  */
892
892
  custom_data: string;
893
893
  }
@@ -502,7 +502,11 @@ export class WSAPIMiniGames extends WSAPIRaffles {
502
502
  * true` with no prize attached. Use this for game mechanics where the
503
503
  * player can decline or forfeit the drawn prize — e.g. a
504
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. It only
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
506
510
  * works on a spin that is not yet finalised, so it requires playing
507
511
  * with `acknowledge: false` and calling promptly — once the automatic
508
512
  * acknowledge or the server-side fallback (below) has finalised the
@@ -532,6 +536,8 @@ export class WSAPIMiniGames extends WSAPIRaffles {
532
536
  * - Either way the spin's `is_claimed` flips to `true` on the next
533
537
  * {@link getMiniGamesHistory} fetch.
534
538
  *
539
+ * **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).
540
+ *
535
541
  * **Visitor mode**: not supported.
536
542
  *
537
543
  * @param request_id Correlation id of the spin to finalise: the
@@ -66,18 +66,46 @@ export class WSAPIMissions extends WSAPIGeneral {
66
66
  * `only_in_custom_section: true` are intended for their custom-section
67
67
  * view only and should be hidden from the main mission list.
68
68
  *
69
- * **Reading state from the returned mission**
70
- * Drive availability chips ("missed", "coming soon", "needs opt-in",
71
- * "in progress", "expired") from `availability_status` (enum
72
- * {@link AchievementAvailabilityStatus}) — it's the canonical derived
73
- * state and reflects all server-side timing/visibility rules in one
74
- * field. For time-limited and recurring missions, `dt_start` doubles
75
- * as the opt-in timestamp (for opt-in missions) or unlock timestamp
76
- * (for previously-locked missions); the expiration of a time-limited
77
- * mission is `dt_start + time_limit_ms`. `next_recurrence_date_ts`
78
- * is populated for `RECURRING` / `RECURRING_QUANTITY` missions but
79
- * is no longer meaningful once the mission's `active_till_ts` has
80
- * passed.
69
+ * **Status bucketing (which tab / section a mission belongs to)**
70
+ * There is no pre-computed bucket field — assign each mission to exactly
71
+ * ONE section reading the raw state fields directly (NOT `availability_status`;
72
+ * see "Timers" below). Priority order, FIRST match wins:
73
+ * 1. **Missed / Expired** — not completed and the window has closed:
74
+ * `!is_completed && ((time_limit_ms && dt_start && dt_start + time_limit_ms < Date.now())`
75
+ * `|| (active_till_ts && active_till_ts < Date.now()))`. Do NOT gate this on
76
+ * opt-in — an opt-in mission whose window closed before the user ever
77
+ * opted in is still Missed. Sort by `position` ASC.
78
+ * 2. **Completed** — `is_completed === true`, OR (recurring-upon-completion
79
+ * missions) at least one cycle done / the cap reached — see the recurring
80
+ * caveats below. Sort by `complete_date_ts` DESC.
81
+ * 3. **Locked** — `is_locked === true`, OR not yet started
82
+ * (`active_from_ts > Date.now()`). Sort by `position` ASC.
83
+ * 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and
84
+ * `progress > 0`). Sort by `position` ASC.
85
+ * 5. **Available** — everything else (opt-in required but not yet joined, or
86
+ * an unrestricted mission not yet started). Sort by `position` ASC.
87
+ *
88
+ * **Recurring-upon-completion caveats** (the common mis-bucketing trap):
89
+ * - `is_completed` NEVER flips true for a recurring-upon-completion mission
90
+ * (only for one-shot missions) — detect a completed cycle from
91
+ * `completion_count > 0`, not `is_completed`.
92
+ * - A non-null `completion_count` is what identifies a recurring-upon-completion
93
+ * mission. `max_completion_count === null` means an INFINITE cap (still
94
+ * recurring — never read null as "not recurring"), so only test
95
+ * `completion_count >= max_completion_count` when `max_completion_count` is set.
96
+ *
97
+ * **Timers & timestamps** (display only — NOT bucketing)
98
+ * `availability_status` (enum {@link AchievementAvailabilityStatus}) is the
99
+ * timer/window signal: use it to pick WHICH countdown to show and whether the
100
+ * window has elapsed — NOT to choose the section. It does not read
101
+ * `completion_count`, and between cycles the server may keep reporting the
102
+ * just-elapsed cycle's `Missed*` value even after `dt_start` / `active_till_ts`
103
+ * are cleared for the next attempt, so bucketing by it sends recurring missions
104
+ * to the wrong tab. For time-limited / opt-in missions `dt_start` is the opt-in
105
+ * timestamp (or unlock timestamp for previously-locked missions), and a
106
+ * time-limited mission expires at `dt_start + time_limit_ms`.
107
+ * `next_recurrence_date_ts` is populated for `RECURRING` / `RECURRING_QUANTITY`
108
+ * missions but is no longer meaningful once `active_till_ts` has passed.
81
109
  *
82
110
  * **Refresh after a mutation**
83
111
  * After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`
@@ -23,39 +23,41 @@ 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;
@@ -77,17 +79,17 @@ export interface TMiniGamePrize {
77
79
  is_surcharge?: boolean;
78
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,28 +206,28 @@ 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
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
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;
@@ -852,7 +853,9 @@ export interface TMissionOrBadge {
852
853
  reward: string;
853
854
  /** URL of the image of the mission or badge, 256x256px */
854
855
  image: string;
855
- /** Indicator if the mission is completed or badge is granted */
856
+ /** Indicator if the mission is completed or badge is granted. Stays `false` for
857
+ * Recurring-upon-completion missions even after cycles complete — use `completion_count`
858
+ * to detect completed cycles (see `getMissions` bucketing). */
856
859
  is_completed: boolean;
857
860
  /** Indicator if the mission is locked. Means that it's visible to the user, but he cannot progress in it until it's unlocked.
858
861
  * Mission may optionally contain the explanation of what should be done to unlock it in the unlock_mission_description property
@@ -944,10 +947,10 @@ export interface TMissionOrBadge {
944
947
  /** ID of specific Custom Section type */
945
948
  custom_section_type_id?: number;
946
949
 
947
- /** Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite. */
950
+ /** Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite (still recurring — not "no cap disables recurring"). */
948
951
  max_completion_count?: number;
949
952
 
950
- /** Current completion count for Recurring upon completion missions */
953
+ /** Current completion count for Recurring-upon-completion missions. Non-null ONLY for that mission type, so its presence identifies one; `> 0` means at least one cycle completed. */
951
954
  completion_count?: number;
952
955
 
953
956
  /** The date/timestamp for recurring missions, which indicating the time remaining until the next recurrence of the mission.
@@ -955,7 +958,7 @@ export interface TMissionOrBadge {
955
958
  */
956
959
  next_recurrence_date_ts?: number;
957
960
 
958
- /** Availability status of the mission depends on the defined time limits */
961
+ /** Timer/window state derived from the mission's time limits (which countdown to show / whether the window elapsed). NOT a tab-bucketing signal — it ignores `completion_count`, so bucket sections from the raw fields instead (see `getMissions`). */
959
962
  availability_status?: AchievementAvailabilityStatus;
960
963
 
961
964
  /** Title for the claim reward button */
@@ -1417,7 +1420,7 @@ export interface TRaffle {
1417
1420
  /**
1418
1421
  * Custom data as string or JSON string that can be used in API to build custom UI
1419
1422
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
1420
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
1423
+ * Read more here - https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes
1421
1424
  */
1422
1425
  custom_data: string;
1423
1426
  /** Date of start */