@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
package/README.md CHANGED
@@ -73,7 +73,7 @@ The SDK surface is split across one class per feature area, joined by an interna
73
73
  | **Clans** | [`WSAPIClans`](docs/api/classes/WSAPIClans.md) | `getClans`, `getClanInfo`, `joinClan` | [`getClans`](docs/ui/clans/UIGuide_getClans.md) · [`getClanInfo`](docs/ui/clans/UIGuide_getClanInfo.md) · [`joinClan`](docs/ui/clans/UIGuide_joinClan.md) |
74
74
  | **Jackpots** | [`WSAPIJackpots`](docs/api/classes/WSAPIJackpots.md) | `jackpotGet`, `jackpotOptIn`, `jackpotOptOut`, `getJackpotWinners`, `getJackpotEligibleGames` | [`jackpotGet`](docs/ui/jackpots/UIGuide_jackpotGet.md) · [`jackpotOptIn`](docs/ui/jackpots/UIGuide_jackpotOptIn.md) · [`jackpotOptOut`](docs/ui/jackpots/UIGuide_jackpotOptOut.md) · [`getJackpotWinners`](docs/ui/jackpots/UIGuide_getJackpotWinners.md) · [`getJackpotEligibleGames`](docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md) |
75
75
  | **Raffles / Draws** | [`WSAPIRaffles`](docs/api/classes/WSAPIRaffles.md) | `getRaffles`, `getRaffleDrawRun`, `getRaffleDrawRunsHistory`, `claimRafflePrize`, `requestRaffleOptin`, `getRaffleWonPrizes` | [`getRaffles`](docs/ui/raffles/UIGuide_getRaffles.md) · [`getRaffleDrawRun`](docs/ui/raffles/UIGuide_getRaffleDrawRun.md) · [`getRaffleDrawRunsHistory`](docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md) · [`claimRafflePrize`](docs/ui/raffles/UIGuide_claimRafflePrize.md) · [`requestRaffleOptin`](docs/ui/raffles/UIGuide_requestRaffleOptin.md) · [`getRaffleWonPrizes`](docs/ui/raffles/UIGuide_getRaffleWonPrizes.md) |
76
- | **MiniGames / SAW** | [`WSAPIMiniGames`](docs/api/classes/WSAPIMiniGames.md) | `getMiniGames`, `getMiniGamesHistory`, `playMiniGame`, `miniGameWinAcknowledgeRequest`, `playMiniGameBatch` | [`getMiniGames`](docs/ui/minigames/UIGuide_getMiniGames.md) · [`getMiniGamesHistory`](docs/ui/minigames/UIGuide_getMiniGamesHistory.md) · [`playMiniGame`](docs/ui/minigames/UIGuide_playMiniGame.md) · [`playMiniGameBatch`](docs/ui/minigames/UIGuide_playMiniGameBatch.md) |
76
+ | **MiniGames / SAW** | [`WSAPIMiniGames`](docs/api/classes/WSAPIMiniGames.md) | `getMiniGames`, `getMiniGamesHistory`, `playMiniGame`, `miniGameWinAcknowledgeRequest`, `playMiniGameBatch` | [`getMiniGames`](docs/ui/minigames/UIGuide_getMiniGames.md) · [`getMiniGamesHistory`](docs/ui/minigames/UIGuide_getMiniGamesHistory.md) · [`playMiniGame`](docs/ui/minigames/UIGuide_playMiniGame.md) · [`miniGameWinAcknowledgeRequest`](docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md) · [`playMiniGameBatch`](docs/ui/minigames/UIGuide_playMiniGameBatch.md) |
77
77
  | **Avatars** | [`WSAPIAvatars`](docs/api/classes/WSAPIAvatars.md) | `getAvatarsList`, `getAvatarsCustomized`, `getAvatarPrompts`, `setAvatar`, `avatarsCustomize` | [`getAvatarsList`](docs/ui/avatars/UIGuide_getAvatarsList.md) · [`getAvatarsCustomized`](docs/ui/avatars/UIGuide_getAvatarsCustomized.md) · [`getAvatarPrompts`](docs/ui/avatars/UIGuide_getAvatarPrompts.md) · [`setAvatar`](docs/ui/avatars/UIGuide_setAvatar.md) · [`avatarsCustomize`](docs/ui/avatars/UIGuide_avatarsCustomize.md) |
78
78
  | **Game Pick (sports / quiz)** | [`WSAPIGamePick`](docs/api/classes/WSAPIGamePick.md) | `gamePickGet*`, `gamePickSubmit*` (9 methods) | [`gamePickGetActiveRounds`](docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md) · [`gamePickGetActiveRound`](docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md) · [`gamePickGetHistory`](docs/ui/gamepick/UIGuide_gamePickGetHistory.md) · [`gamePickGetBoard`](docs/ui/gamepick/UIGuide_gamePickGetBoard.md) · [`gamePickSubmitSelection`](docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md) · [`gamePickSubmitSelectionQuiz`](docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md) · [`gamePickGetUserInfo`](docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md) · [`gamePickGetGameInfo`](docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md) · [`gamePickGetRoundInfoForUser`](docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md) |
79
79
  | **Leaderboard** | [`WSAPILeaderBoard`](docs/api/classes/WSAPILeaderBoard.md) | `getLeaderBoard`, `getLeaderBoards` | [`getLeaderBoard`](docs/ui/leaderboard/UIGuide_getLeaderBoard.md) |
@@ -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
  }
@@ -2,12 +2,19 @@ import { AttemptPeriodType } from './AttemptPeriodType';
2
2
  import { SAWPrizeType } from './SAWPrizeType';
3
3
  import { SAWPrizeUI } from './SAWPrizeUI';
4
4
  export interface SAWPrize {
5
+ /** ID of the prize */
5
6
  saw_prize_id: number;
7
+ /** Visual definition of the prize (name, icon, win-modal buttons, per-game rendering hints) */
6
8
  saw_prize_ui_definition: SAWPrizeUI;
9
+ /** Numeric value for 'points' / 'spin' prize types (e.g. 100 for "100 points"); not relevant for other types */
7
10
  prize_value?: number;
11
+ /** The type of the prize — see {@link SAWPrizeType} */
8
12
  prize_type_id: SAWPrizeType;
13
+ /** Competition games (MatchX / Quiz): first finishing place this prize applies to */
9
14
  place_from?: number;
15
+ /** Competition games (MatchX / Quiz): last finishing place this prize applies to; equals `place_from` for a single-place prize */
10
16
  place_to?: number;
17
+ /** Client-side only — unique id of a win instance generated by the default Smartico UI to dedupe render effects; never sent by the server */
11
18
  sawUniqueWinId?: string;
12
19
  /** Remaining stock. Present only when the template's `expose_game_stat_on_api` is enabled; always present for MatchX / Quiz games */
13
20
  pool?: number;
@@ -27,8 +34,10 @@ export interface SAWPrize {
27
34
  is_surcharge?: boolean;
28
35
  /** Always `false` in API responses — deleted prizes are excluded server-side */
29
36
  is_deleted?: boolean;
37
+ /** Type-specific prize details — e.g. `gems` / `_gems_diamonds_type` for gems-and-diamonds prizes, `tickets_count` for raffle-ticket prizes */
30
38
  prize_details_json?: {
31
39
  [key: string]: any;
32
40
  };
41
+ /** Period basis for the prize availability restriction — see {@link AttemptPeriodType} */
33
42
  max_give_period_type_id?: AttemptPeriodType;
34
43
  }
@@ -7,6 +7,7 @@ export interface SAWPrizeUI {
7
7
  name_original?: string;
8
8
  hide_prize_popup: boolean;
9
9
  aknowledge_message?: string;
10
+ /** 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) */
10
11
  aknowledge_message_lose?: string;
11
12
  sectors?: number[];
12
13
  acknowledge_type?: SAWAcknowledgeType;
@@ -3,29 +3,49 @@ import { SAWGameType } from './SAWGameType';
3
3
  import { SAWPrize } from './SAWPrize';
4
4
  import { SAWTemplateUI } from './SAWTemplateUI';
5
5
  export interface SAWTemplate {
6
+ /** ID of the mini-game template */
6
7
  saw_template_id: number;
8
+ /** The type of the game — see {@link SAWGameType} */
7
9
  saw_game_type_id: SAWGameType;
10
+ /** Full UI definition of the mini-game (name, description, skin, colors, per-game visual settings) */
8
11
  saw_template_ui_definition: SAWTemplateUI;
12
+ /** How the user is charged per attempt — see {@link SAWBuyInType} */
9
13
  saw_buyin_type_id: SAWBuyInType;
14
+ /** Cost per attempt in the buy-in currency (points, gems or diamonds per `saw_buyin_type_id`) */
10
15
  buyin_cost_points?: number;
16
+ /** Operator hint: show the game only while the user can actually play it (has attempts / sufficient balance) */
11
17
  visibile_when_can_spin: boolean;
18
+ /** Number of spin attempts the user currently has (initial value; later changes arrive as spin-count pushes) */
12
19
  spin_count?: number;
20
+ /** Prizes configured for this game — see {@link SAWPrize} */
13
21
  prizes: SAWPrize[];
22
+ /** Operator visibility flag for the template */
14
23
  is_visible: boolean;
24
+ /** Time from which the template becomes available (epoch ms); absent when not restricted */
15
25
  activeFromDate?: number;
26
+ /** Time until which the template stays available (epoch ms); absent when not restricted */
16
27
  activeTillDate?: number;
28
+ /** Amount added to the jackpot on every play (abstract contribution — nothing is deducted from the player) */
17
29
  jackpot_add_on_attempt: number;
30
+ /** Current jackpot accumulator value */
18
31
  jackpot_current: number;
32
+ /** Seed value of the jackpot — the accumulator starts at (and resets to) this amount after a jackpot win */
19
33
  jackpot_guaranteed: number;
34
+ /** Maximum number of unspent spin attempts a user can accumulate */
20
35
  maxActiveSpinsAllowed: number;
36
+ /** Maximum number of attempts a user can make during `maxSpinsPediodMs` */
21
37
  maxSpinsCount: number;
38
+ /** Length of the attempt-limit period in ms (note the field-name spelling) */
22
39
  maxSpinsPediodMs: number;
40
+ /** 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 */
23
41
  next_available_spin_ts?: number;
24
42
  /** Soonest-expiring spin's expiration time for this user (epoch ms); `null`/absent when no expirable spins. */
25
43
  earliest_expiration_dt?: number | null;
26
44
  /** Latest-expiring spin's expiration time for this user (epoch ms); `null`/absent when no expirable spins. */
27
45
  latest_expiration_dt?: number | null;
46
+ /** Key of the visual skin the operator selected for the game */
28
47
  saw_skin_key: string;
48
+ /** 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 */
29
49
  saw_skin_ui_definition: {
30
50
  skin_folder: string;
31
51
  skin_css: string;
@@ -34,7 +54,12 @@ export interface SAWTemplate {
34
54
  };
35
55
  /** 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). */
36
56
  expose_game_stat_on_api?: boolean;
57
+ /** Prize Drop only: when true, the pushed prize requires an explicit claim by the user before it is credited */
37
58
  requires_prize_claim?: boolean;
59
+ /** 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. */
60
+ requires_manual_claim?: boolean;
61
+ /** Timezone offset in minutes used to evaluate the template's period-based rules (UTC minus local, as in JS `Date.getTimezoneOffset()`) */
38
62
  relative_period_timezone?: number;
63
+ /** Operator setting: show a prize-history entry point (icon / button) on this game's view */
39
64
  show_prize_history?: boolean;
40
65
  }
@@ -23,7 +23,7 @@ interface RafflePublicMeta {
23
23
  /**
24
24
  * Custom data as string or JSON string that can be used in API to build custom UI
25
25
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
26
- * Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
26
+ * Read more here - <https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes>
27
27
  */
28
28
  custom_data: string;
29
29
  /**
@@ -854,21 +854,21 @@ export interface TLevel {
854
854
  /**
855
855
  * The counter of 1st metric used to reach the Level.
856
856
  * Relevant in case of using advanced leveling logic
857
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
857
+ * https://help.smartico.ai/welcome/products/release-notes/september-2022#new-logic-for-leveling-users
858
858
  *
859
859
  */
860
860
  required_level_counter_1: number;
861
861
  /**
862
862
  * The counter of 2nd metric used to reach the Level.
863
863
  * Relevant in case of using advanced leveling logic
864
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
864
+ * https://help.smartico.ai/welcome/products/release-notes/september-2022#new-logic-for-leveling-users
865
865
  *
866
866
  */
867
867
  required_level_counter_2: number;
868
868
  /**
869
869
  * Custom data as string or JSON string that can be used in API to build custom UI
870
870
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
871
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
871
+ * Read more here - https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes
872
872
  */
873
873
  custom_data: string;
874
874
  }
@@ -453,7 +453,11 @@ export declare class WSAPIMiniGames extends WSAPIRaffles {
453
453
  * true` with no prize attached. Use this for game mechanics where the
454
454
  * player can decline or forfeit the drawn prize — e.g. a
455
455
  * gamble/discard step, or a client-driven game where the user's final
456
- * action decides whether the pre-drawn prize is actually won. It only
456
+ * action decides whether the pre-drawn prize is actually won (the
457
+ * default Smartico UI does this for the Voyager game: failing the
458
+ * star-collection run finalises the spin as lost). When configured,
459
+ * the prize's `aknowledge_message_lose` is the operator's result copy
460
+ * for this case — show it instead of `aknowledge_message`. It only
457
461
  * works on a spin that is not yet finalised, so it requires playing
458
462
  * with `acknowledge: false` and calling promptly — once the automatic
459
463
  * acknowledge or the server-side fallback (below) has finalised the
@@ -483,6 +487,8 @@ export declare class WSAPIMiniGames extends WSAPIRaffles {
483
487
  * - Either way the spin's `is_claimed` flips to `true` on the next
484
488
  * {@link getMiniGamesHistory} fetch.
485
489
  *
490
+ * **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).
491
+ *
486
492
  * **Visitor mode**: not supported.
487
493
  *
488
494
  * @param request_id Correlation id of the spin to finalise: the
@@ -55,18 +55,46 @@ export declare class WSAPIMissions extends WSAPIGeneral {
55
55
  * `only_in_custom_section: true` are intended for their custom-section
56
56
  * view only and should be hidden from the main mission list.
57
57
  *
58
- * **Reading state from the returned mission**
59
- * Drive availability chips ("missed", "coming soon", "needs opt-in",
60
- * "in progress", "expired") from `availability_status` (enum
61
- * {@link AchievementAvailabilityStatus}) — it's the canonical derived
62
- * state and reflects all server-side timing/visibility rules in one
63
- * field. For time-limited and recurring missions, `dt_start` doubles
64
- * as the opt-in timestamp (for opt-in missions) or unlock timestamp
65
- * (for previously-locked missions); the expiration of a time-limited
66
- * mission is `dt_start + time_limit_ms`. `next_recurrence_date_ts`
67
- * is populated for `RECURRING` / `RECURRING_QUANTITY` missions but
68
- * is no longer meaningful once the mission's `active_till_ts` has
69
- * passed.
58
+ * **Status bucketing (which tab / section a mission belongs to)**
59
+ * There is no pre-computed bucket field — assign each mission to exactly
60
+ * ONE section reading the raw state fields directly (NOT `availability_status`;
61
+ * see "Timers" below). Priority order, FIRST match wins:
62
+ * 1. **Missed / Expired** — not completed and the window has closed:
63
+ * `!is_completed && ((time_limit_ms && dt_start && dt_start + time_limit_ms < Date.now())`
64
+ * `|| (active_till_ts && active_till_ts < Date.now()))`. Do NOT gate this on
65
+ * opt-in — an opt-in mission whose window closed before the user ever
66
+ * opted in is still Missed. Sort by `position` ASC.
67
+ * 2. **Completed** — `is_completed === true`, OR (recurring-upon-completion
68
+ * missions) at least one cycle done / the cap reached — see the recurring
69
+ * caveats below. Sort by `complete_date_ts` DESC.
70
+ * 3. **Locked** — `is_locked === true`, OR not yet started
71
+ * (`active_from_ts > Date.now()`). Sort by `position` ASC.
72
+ * 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and
73
+ * `progress > 0`). Sort by `position` ASC.
74
+ * 5. **Available** — everything else (opt-in required but not yet joined, or
75
+ * an unrestricted mission not yet started). Sort by `position` ASC.
76
+ *
77
+ * **Recurring-upon-completion caveats** (the common mis-bucketing trap):
78
+ * - `is_completed` NEVER flips true for a recurring-upon-completion mission
79
+ * (only for one-shot missions) — detect a completed cycle from
80
+ * `completion_count > 0`, not `is_completed`.
81
+ * - A non-null `completion_count` is what identifies a recurring-upon-completion
82
+ * mission. `max_completion_count === null` means an INFINITE cap (still
83
+ * recurring — never read null as "not recurring"), so only test
84
+ * `completion_count >= max_completion_count` when `max_completion_count` is set.
85
+ *
86
+ * **Timers & timestamps** (display only — NOT bucketing)
87
+ * `availability_status` (enum {@link AchievementAvailabilityStatus}) is the
88
+ * timer/window signal: use it to pick WHICH countdown to show and whether the
89
+ * window has elapsed — NOT to choose the section. It does not read
90
+ * `completion_count`, and between cycles the server may keep reporting the
91
+ * just-elapsed cycle's `Missed*` value even after `dt_start` / `active_till_ts`
92
+ * are cleared for the next attempt, so bucketing by it sends recurring missions
93
+ * to the wrong tab. For time-limited / opt-in missions `dt_start` is the opt-in
94
+ * timestamp (or unlock timestamp for previously-locked missions), and a
95
+ * time-limited mission expires at `dt_start + time_limit_ms`.
96
+ * `next_recurrence_date_ts` is populated for `RECURRING` / `RECURRING_QUANTITY`
97
+ * missions but is no longer meaningful once `active_till_ts` has passed.
70
98
  *
71
99
  * **Refresh after a mutation**
72
100
  * After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`
@@ -20,39 +20,41 @@ type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
20
20
  export interface TMiniGamePrize {
21
21
  /** ID of the prize */
22
22
  id: number;
23
- /** The visual name of the prize */
23
+ /** Display name of the prize, pre-translated; any jackpot placeholder in it arrives resolved to the live jackpot value */
24
24
  name: string;
25
- /** The type of the prize, no-prize, points, bonus, manual, spin, jackpot */
25
+ /** The type of the prize — see {@link MiniGamePrizeTypeName} ('no-prize', 'points', 'gems-and-diamonds', 'spin', 'bonus', 'jackpot', 'raffle-ticket', 'mission', 'change-level', 'manual') */
26
26
  prize_type: MiniGamePrizeTypeName;
27
27
  /** Numeric value of the prize in case it's 'points' or 'spin' type. For other types of prizes this value is not relevant.
28
28
  * For example for prize '100 points' the prize_value will be 100. For '100 free spins' the prize_value will be 100.
29
29
  */
30
30
  prize_value?: number;
31
- /** Custom font size for the prize (desktop) */
31
+ /** Custom font size in px for rendering the prize name on the game surface (e.g. a wheel sector), desktop */
32
32
  font_size?: number;
33
- /** Custom font size for the prize (mobile) */
33
+ /** Custom font size in px for the prize name, mobile; falls back to `font_size` when absent */
34
34
  font_size_mobile?: number;
35
35
  /** The URL of the icon of the prize, aspect ratio 1:1 */
36
36
  icon?: string;
37
- /** for scratch card defines position of prize in the list */
37
+ /** For Scratch Card games — relative order of the prize in the scratch grid (lower first). May be absent for other game types */
38
38
  position: number;
39
- /** List of sectors for the prize */
39
+ /** For Spin-a-Wheel games — wheel sector indices this prize occupies. Absent for non-wheel games */
40
40
  sectors: number[];
41
- /** Type of acknowledge message for users */
41
+ /** Which win modal the prize uses — see {@link SAWAcknowledgeTypeName} (Silent / QuickMessage / FullMessage / ExplicitAcknowledge) */
42
42
  acknowledge_type: SAWAcknowledgeTypeName;
43
43
  /** Message that will be shown to user in modal pop-up */
44
44
  aknowledge_message: string;
45
- /** Deep link that will trigger some action in modal pop-up */
45
+ /** 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 */
46
+ aknowledge_message_lose?: string;
47
+ /** Deep link executed when the user taps the main action button in the win modal (run it via `_smartico.dp()`) */
46
48
  acknowledge_dp: string;
47
- /** The name of the action button in modal pop-up */
49
+ /** Label of the main action button in the win modal */
48
50
  acknowledge_action_title: string;
49
- /** Deep link that will trigger some action in modal pop-up (additional) */
51
+ /** Deep link of the additional action button in the win modal */
50
52
  acknowledge_dp_additional?: string;
51
- /** The name of the action button in modal pop-up (additional) */
53
+ /** Label of the additional action button in the win modal */
52
54
  acknowledge_action_title_additional?: string;
53
- /** Deep link that will trigger some action in modal pop-up (second button) */
55
+ /** Deep link of the secondary button in the win modal */
54
56
  second_btn?: string;
55
- /** The name of the action button in modal pop-up (second button) */
57
+ /** Label of the secondary button in the win modal */
56
58
  second_btn_action_title?: string;
57
59
  /** Message when the prize pool is empty for that specific prize */
58
60
  out_of_stock_message?: string;
@@ -74,17 +76,17 @@ export interface TMiniGamePrize {
74
76
  is_surcharge?: boolean;
75
77
  /** Always `false` in API responses — deleted prizes are excluded server-side */
76
78
  is_deleted?: boolean;
77
- /** The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number */
79
+ /** The custom data of the prize defined by the operator. Can be a JSON object, string or number */
78
80
  custom_data?: any;
79
- /** 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. */
81
+ /** 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` */
80
82
  prize_modifiers?: PrizeModifiers[];
81
- /** When enabled, you can split prize value by decimal values */
83
+ /** 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 */
82
84
  allow_split_decimal?: boolean;
83
- /** When enabled, you can hide prize from prize history */
85
+ /** Operator hint to hide this prize when rendering prize-history UIs. Informational only — API responses are not filtered by it */
84
86
  hide_prize_from_history?: boolean;
85
- /** Requirements to claim the prize (lootbox specific)*/
87
+ /** 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 */
86
88
  requirements_to_get_prize?: string;
87
- /** The period type for the prize to be given: Time from last attempt, Calendar days UTC, Calendar days user time zone, Lifetime */
89
+ /** 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` */
88
90
  max_give_period_type_id?: AttemptPeriodType;
89
91
  }
90
92
  /**
@@ -158,10 +160,9 @@ export interface TMiniGameTemplate {
158
160
  /** in case of charging type 'Spin attempts', shows the current number of spin attempts that user has */
159
161
  spin_count?: number;
160
162
  /**
161
- * if the game is limit to the number of spins that user can do during period of time,
162
- * this property shows the epoch time in UTC when the next attempt will be available.
163
- * Note that you need to enable 'Show time to the next available spin' setting on mini-game template in the backoffice
164
- * Important: this field will not be populated if “Max number of attempts a user can do” is set to value different from 1
163
+ * If the game limits the number of attempts per period of time, the epoch-ms time (UTC) when the next attempt becomes available.
164
+ * Populated only when the operator enabled the "show time to the next available spin" template setting, and only when the
165
+ * template's maximum attempts per period is 1.
165
166
  * */
166
167
  next_available_spin_ts: number;
167
168
  /** Soonest-expiring spin's expiration time for the current user, as an epoch-ms timestamp.
@@ -177,7 +178,7 @@ export interface TMiniGameTemplate {
177
178
  over_limit_message: string;
178
179
  /** The message that should be shown to the user when he cannot play the game because he doesn't have spin attempts or points. */
179
180
  no_attempts_message: string;
180
- /** Current jackpont amount, if jackpot is enabled. */
181
+ /** Current jackpot amount, if jackpot is enabled. */
181
182
  jackpot_current: number;
182
183
  /** 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. */
183
184
  jackpot_add_on_attempt: number;
@@ -190,25 +191,25 @@ export interface TMiniGameTemplate {
190
191
  promo_text: string;
191
192
  /** The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number */
192
193
  custom_data: any;
193
- /** List of prizes for mini-games */
194
+ /** Prizes configured for this game — see {@link TMiniGamePrize} */
194
195
  prizes: TMiniGamePrize[];
195
196
  /** 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" */
196
197
  expose_game_stat_on_api?: boolean;
197
- /** Time zone to ensure each day aligns with your local midnight. */
198
+ /** 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) */
198
199
  relative_period_timezone?: number;
199
- /** Holds time from which template will become available, for the template that are targeted to be available from specific time (UNIX timestamp) */
200
+ /** Time from which the template becomes available (epoch ms); absent when not restricted */
200
201
  activeFromDate?: number;
201
- /** Holds time till which template will become available, for the templates that are targeted to be available from specific time (UNIX timestamp) */
202
+ /** Time until which the template stays available (epoch ms); absent when not restricted */
202
203
  activeTillDate?: number;
203
- /** The amount of steps to complete the game and gather the prize */
204
+ /** Number of steps to complete the game and collect the prize (step games — Voyager / Treasure Hunt) */
204
205
  steps_to_finish_game?: number;
205
206
  /** ID of the operator-defined custom section (widget menu grouping) the mini-game is assigned to */
206
207
  custom_section_id?: number;
207
- /** The UI definition of the mini-game */
208
+ /** 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 */
208
209
  saw_template_ui_definition: SAWTemplateUI;
209
- /** The layout of the game */
210
+ /** Grid layout of the game. Populated only for Lootbox game types (LootboxWeekdays / LootboxCalendarDays) */
210
211
  game_layout?: SAWGameLayoutName;
211
- /** When enabled the prize history icon is visible on a certain template */
212
+ /** Operator setting: show a prize-history entry point (icon / button) on this game's view */
212
213
  show_prize_history?: boolean;
213
214
  /** The maximum number of attempts that user can do during period of time */
214
215
  max_number_of_attempts?: number;
@@ -825,7 +826,9 @@ export interface TMissionOrBadge {
825
826
  reward: string;
826
827
  /** URL of the image of the mission or badge, 256x256px */
827
828
  image: string;
828
- /** Indicator if the mission is completed or badge is granted */
829
+ /** Indicator if the mission is completed or badge is granted. Stays `false` for
830
+ * Recurring-upon-completion missions even after cycles complete — use `completion_count`
831
+ * to detect completed cycles (see `getMissions` bucketing). */
829
832
  is_completed: boolean;
830
833
  /** Indicator if the mission is locked. Means that it's visible to the user, but he cannot progress in it until it's unlocked.
831
834
  * Mission may optionally contain the explanation of what should be done to unlock it in the unlock_mission_description property
@@ -897,15 +900,15 @@ export interface TMissionOrBadge {
897
900
  completed_this_month?: boolean;
898
901
  /** ID of specific Custom Section type */
899
902
  custom_section_type_id?: number;
900
- /** Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite. */
903
+ /** 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"). */
901
904
  max_completion_count?: number;
902
- /** Current completion count for Recurring upon completion missions */
905
+ /** 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. */
903
906
  completion_count?: number;
904
907
  /** The date/timestamp for recurring missions, which indicating the time remaining until the next recurrence of the mission.
905
908
  * Note that if a mission has an "Active till" date defined, this field is not relevant after that date.
906
909
  */
907
910
  next_recurrence_date_ts?: number;
908
- /** Availability status of the mission depends on the defined time limits */
911
+ /** 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`). */
909
912
  availability_status?: AchievementAvailabilityStatus;
910
913
  /** Title for the claim reward button */
911
914
  claim_button_title?: string;
@@ -1342,7 +1345,7 @@ export interface TRaffle {
1342
1345
  /**
1343
1346
  * Custom data as string or JSON string that can be used in API to build custom UI
1344
1347
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
1345
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
1348
+ * Read more here - https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes
1346
1349
  */
1347
1350
  custom_data: string;
1348
1351
  /** Date of start */
package/dist/index.js CHANGED
@@ -538,6 +538,7 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
538
538
  sectors: p.saw_prize_ui_definition.sectors,
539
539
  acknowledge_type: SAWAcknowledgeTypeNamed(p.saw_prize_ui_definition.acknowledge_type),
540
540
  aknowledge_message: p.saw_prize_ui_definition.aknowledge_message,
541
+ aknowledge_message_lose: p.saw_prize_ui_definition.aknowledge_message_lose,
541
542
  acknowledge_dp: p.saw_prize_ui_definition.acknowledge_dp,
542
543
  acknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,
543
544
  acknowledge_dp_additional: p.saw_prize_ui_definition.acknowledge_dp_additional,
@@ -3408,18 +3409,46 @@ var WSAPIMissions = /*#__PURE__*/function (_WSAPIGeneral) {
3408
3409
  * `only_in_custom_section: true` are intended for their custom-section
3409
3410
  * view only and should be hidden from the main mission list.
3410
3411
  *
3411
- * **Reading state from the returned mission**
3412
- * Drive availability chips ("missed", "coming soon", "needs opt-in",
3413
- * "in progress", "expired") from `availability_status` (enum
3414
- * {@link AchievementAvailabilityStatus}) — it's the canonical derived
3415
- * state and reflects all server-side timing/visibility rules in one
3416
- * field. For time-limited and recurring missions, `dt_start` doubles
3417
- * as the opt-in timestamp (for opt-in missions) or unlock timestamp
3418
- * (for previously-locked missions); the expiration of a time-limited
3419
- * mission is `dt_start + time_limit_ms`. `next_recurrence_date_ts`
3420
- * is populated for `RECURRING` / `RECURRING_QUANTITY` missions but
3421
- * is no longer meaningful once the mission's `active_till_ts` has
3422
- * passed.
3412
+ * **Status bucketing (which tab / section a mission belongs to)**
3413
+ * There is no pre-computed bucket field — assign each mission to exactly
3414
+ * ONE section reading the raw state fields directly (NOT `availability_status`;
3415
+ * see "Timers" below). Priority order, FIRST match wins:
3416
+ * 1. **Missed / Expired** — not completed and the window has closed:
3417
+ * `!is_completed && ((time_limit_ms && dt_start && dt_start + time_limit_ms < Date.now())`
3418
+ * `|| (active_till_ts && active_till_ts < Date.now()))`. Do NOT gate this on
3419
+ * opt-in — an opt-in mission whose window closed before the user ever
3420
+ * opted in is still Missed. Sort by `position` ASC.
3421
+ * 2. **Completed** — `is_completed === true`, OR (recurring-upon-completion
3422
+ * missions) at least one cycle done / the cap reached — see the recurring
3423
+ * caveats below. Sort by `complete_date_ts` DESC.
3424
+ * 3. **Locked** — `is_locked === true`, OR not yet started
3425
+ * (`active_from_ts > Date.now()`). Sort by `position` ASC.
3426
+ * 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and
3427
+ * `progress > 0`). Sort by `position` ASC.
3428
+ * 5. **Available** — everything else (opt-in required but not yet joined, or
3429
+ * an unrestricted mission not yet started). Sort by `position` ASC.
3430
+ *
3431
+ * **Recurring-upon-completion caveats** (the common mis-bucketing trap):
3432
+ * - `is_completed` NEVER flips true for a recurring-upon-completion mission
3433
+ * (only for one-shot missions) — detect a completed cycle from
3434
+ * `completion_count > 0`, not `is_completed`.
3435
+ * - A non-null `completion_count` is what identifies a recurring-upon-completion
3436
+ * mission. `max_completion_count === null` means an INFINITE cap (still
3437
+ * recurring — never read null as "not recurring"), so only test
3438
+ * `completion_count >= max_completion_count` when `max_completion_count` is set.
3439
+ *
3440
+ * **Timers & timestamps** (display only — NOT bucketing)
3441
+ * `availability_status` (enum {@link AchievementAvailabilityStatus}) is the
3442
+ * timer/window signal: use it to pick WHICH countdown to show and whether the
3443
+ * window has elapsed — NOT to choose the section. It does not read
3444
+ * `completion_count`, and between cycles the server may keep reporting the
3445
+ * just-elapsed cycle's `Missed*` value even after `dt_start` / `active_till_ts`
3446
+ * are cleared for the next attempt, so bucketing by it sends recurring missions
3447
+ * to the wrong tab. For time-limited / opt-in missions `dt_start` is the opt-in
3448
+ * timestamp (or unlock timestamp for previously-locked missions), and a
3449
+ * time-limited mission expires at `dt_start + time_limit_ms`.
3450
+ * `next_recurrence_date_ts` is populated for `RECURRING` / `RECURRING_QUANTITY`
3451
+ * missions but is no longer meaningful once `active_till_ts` has passed.
3423
3452
  *
3424
3453
  * **Refresh after a mutation**
3425
3454
  * After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`
@@ -7669,7 +7698,11 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
7669
7698
  * true` with no prize attached. Use this for game mechanics where the
7670
7699
  * player can decline or forfeit the drawn prize — e.g. a
7671
7700
  * gamble/discard step, or a client-driven game where the user's final
7672
- * action decides whether the pre-drawn prize is actually won. It only
7701
+ * action decides whether the pre-drawn prize is actually won (the
7702
+ * default Smartico UI does this for the Voyager game: failing the
7703
+ * star-collection run finalises the spin as lost). When configured,
7704
+ * the prize's `aknowledge_message_lose` is the operator's result copy
7705
+ * for this case — show it instead of `aknowledge_message`. It only
7673
7706
  * works on a spin that is not yet finalised, so it requires playing
7674
7707
  * with `acknowledge: false` and calling promptly — once the automatic
7675
7708
  * acknowledge or the server-side fallback (below) has finalised the
@@ -7699,6 +7732,8 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
7699
7732
  * - Either way the spin's `is_claimed` flips to `true` on the next
7700
7733
  * {@link getMiniGamesHistory} fetch.
7701
7734
  *
7735
+ * **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).
7736
+ *
7702
7737
  * **Visitor mode**: not supported.
7703
7738
  *
7704
7739
  * @param request_id Correlation id of the spin to finalise: the
@@ -10885,6 +10920,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
10885
10920
  t.prizes.forEach(function (p) {
10886
10921
  p.saw_prize_ui_definition.name = IntUtils.replaceAll(p.saw_prize_ui_definition.name, '{{jackpot}}', jackpotValue);
10887
10922
  p.saw_prize_ui_definition.aknowledge_message = IntUtils.replaceAll(p.saw_prize_ui_definition.aknowledge_message, '{{jackpot}}', jackpotValue);
10923
+ p.saw_prize_ui_definition.aknowledge_message_lose = IntUtils.replaceAll(p.saw_prize_ui_definition.aknowledge_message_lose, '{{jackpot}}', jackpotValue);
10888
10924
  });
10889
10925
  }
10890
10926
  });