@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/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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
|
|
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 (
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
42
|
+
/** For Spin-a-Wheel games — wheel sector indices this prize occupies. Absent for non-wheel games */
|
|
43
43
|
sectors: number[];
|
|
44
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
52
|
+
/** Label of the main action button in the win modal */
|
|
51
53
|
acknowledge_action_title: string;
|
|
52
|
-
/** Deep link
|
|
54
|
+
/** Deep link of the additional action button in the win modal */
|
|
53
55
|
acknowledge_dp_additional?: string;
|
|
54
|
-
/**
|
|
56
|
+
/** Label of the additional action button in the win modal */
|
|
55
57
|
acknowledge_action_title_additional?: string;
|
|
56
|
-
/** Deep link
|
|
58
|
+
/** Deep link of the secondary button in the win modal */
|
|
57
59
|
second_btn?: string,
|
|
58
|
-
/**
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
217
|
+
/** Time from which the template becomes available (epoch ms); absent when not restricted */
|
|
217
218
|
activeFromDate?: number;
|
|
218
|
-
/**
|
|
219
|
+
/** Time until which the template stays available (epoch ms); absent when not restricted */
|
|
219
220
|
activeTillDate?: number;
|
|
220
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
228
|
+
/** Grid layout of the game. Populated only for Lootbox game types (LootboxWeekdays / LootboxCalendarDays) */
|
|
228
229
|
game_layout?: SAWGameLayoutName;
|
|
229
|
-
/**
|
|
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;
|