@smartico/public-api 0.0.410 → 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.
- package/README.md +1 -1
- package/dist/MiniGames/SAWPrize.d.ts +9 -0
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/MiniGames/SAWTemplate.d.ts +23 -0
- package/dist/WSAPI/WSAPIMiniGames.d.ts +7 -1
- package/dist/WSAPI/WSAPITypes.d.ts +33 -32
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +9 -1
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/classes/WSAPIMiniGames.md +7 -1
- package/docs/api/interfaces/SAWPrize.md +18 -0
- package/docs/api/interfaces/SAWPrizeUI.md +2 -0
- package/docs/api/interfaces/SAWTemplate.md +46 -0
- package/docs/api/interfaces/TMiniGamePrize.md +28 -20
- package/docs/api/interfaces/TMiniGameTemplate.md +12 -13
- package/docs/capabilities/getMiniGames.md +30 -29
- package/docs/capabilities/miniGameWinAcknowledgeRequest.md +7 -1
- package/docs/native/PROTOCOL.md +4 -0
- package/docs/ui/minigames/UIGuide_getMiniGames.md +22 -0
- package/docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md +90 -0
- package/docs/ui/minigames/UIGuide_playMiniGame.md +12 -3
- package/package.json +1 -1
- package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
- package/src/MiniGames/SAWPrize.ts +9 -0
- package/src/MiniGames/SAWPrizeUI.ts +2 -1
- package/src/MiniGames/SAWTemplate.ts +26 -4
- package/src/SmarticoAPI.ts +5 -0
- package/src/WSAPI/WSAPIMiniGames.ts +7 -1
- package/src/WSAPI/WSAPITypes.ts +35 -34
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) |
|
|
@@ -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,10 @@ 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
|
+
/** Timezone offset in minutes used to evaluate the template's period-based rules (UTC minus local, as in JS `Date.getTimezoneOffset()`) */
|
|
38
60
|
relative_period_timezone?: number;
|
|
61
|
+
/** Operator setting: show a prize-history entry point (icon / button) on this game's view */
|
|
39
62
|
show_prize_history?: boolean;
|
|
40
63
|
}
|
|
@@ -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
|
|
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
|
|
@@ -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
|
-
/**
|
|
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
|
|
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 (
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
39
|
+
/** For Spin-a-Wheel games — wheel sector indices this prize occupies. Absent for non-wheel games */
|
|
40
40
|
sectors: number[];
|
|
41
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
49
|
+
/** Label of the main action button in the win modal */
|
|
48
50
|
acknowledge_action_title: string;
|
|
49
|
-
/** Deep link
|
|
51
|
+
/** Deep link of the additional action button in the win modal */
|
|
50
52
|
acknowledge_dp_additional?: string;
|
|
51
|
-
/**
|
|
53
|
+
/** Label of the additional action button in the win modal */
|
|
52
54
|
acknowledge_action_title_additional?: string;
|
|
53
|
-
/** Deep link
|
|
55
|
+
/** Deep link of the secondary button in the win modal */
|
|
54
56
|
second_btn?: string;
|
|
55
|
-
/**
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
200
|
+
/** Time from which the template becomes available (epoch ms); absent when not restricted */
|
|
200
201
|
activeFromDate?: number;
|
|
201
|
-
/**
|
|
202
|
+
/** Time until which the template stays available (epoch ms); absent when not restricted */
|
|
202
203
|
activeTillDate?: number;
|
|
203
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
210
|
+
/** Grid layout of the game. Populated only for Lootbox game types (LootboxWeekdays / LootboxCalendarDays) */
|
|
210
211
|
game_layout?: SAWGameLayoutName;
|
|
211
|
-
/**
|
|
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;
|
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,
|
|
@@ -7669,7 +7670,11 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
|
|
|
7669
7670
|
* true` with no prize attached. Use this for game mechanics where the
|
|
7670
7671
|
* player can decline or forfeit the drawn prize — e.g. a
|
|
7671
7672
|
* gamble/discard step, or a client-driven game where the user's final
|
|
7672
|
-
* action decides whether the pre-drawn prize is actually won
|
|
7673
|
+
* action decides whether the pre-drawn prize is actually won (the
|
|
7674
|
+
* default Smartico UI does this for the Voyager game: failing the
|
|
7675
|
+
* star-collection run finalises the spin as lost). When configured,
|
|
7676
|
+
* the prize's `aknowledge_message_lose` is the operator's result copy
|
|
7677
|
+
* for this case — show it instead of `aknowledge_message`. It only
|
|
7673
7678
|
* works on a spin that is not yet finalised, so it requires playing
|
|
7674
7679
|
* with `acknowledge: false` and calling promptly — once the automatic
|
|
7675
7680
|
* acknowledge or the server-side fallback (below) has finalised the
|
|
@@ -7699,6 +7704,8 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
|
|
|
7699
7704
|
* - Either way the spin's `is_claimed` flips to `true` on the next
|
|
7700
7705
|
* {@link getMiniGamesHistory} fetch.
|
|
7701
7706
|
*
|
|
7707
|
+
* **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).
|
|
7708
|
+
*
|
|
7702
7709
|
* **Visitor mode**: not supported.
|
|
7703
7710
|
*
|
|
7704
7711
|
* @param request_id Correlation id of the spin to finalise: the
|
|
@@ -10885,6 +10892,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
10885
10892
|
t.prizes.forEach(function (p) {
|
|
10886
10893
|
p.saw_prize_ui_definition.name = IntUtils.replaceAll(p.saw_prize_ui_definition.name, '{{jackpot}}', jackpotValue);
|
|
10887
10894
|
p.saw_prize_ui_definition.aknowledge_message = IntUtils.replaceAll(p.saw_prize_ui_definition.aknowledge_message, '{{jackpot}}', jackpotValue);
|
|
10895
|
+
p.saw_prize_ui_definition.aknowledge_message_lose = IntUtils.replaceAll(p.saw_prize_ui_definition.aknowledge_message_lose, '{{jackpot}}', jackpotValue);
|
|
10888
10896
|
});
|
|
10889
10897
|
}
|
|
10890
10898
|
});
|