@smartico/public-api 0.0.359 → 0.0.360
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/dist/MiniGames/SAWTemplateUI.d.ts +304 -7
- package/dist/Store/StoreItem.d.ts +2 -0
- package/dist/WSAPI/WSAPITypes.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +15 -1
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/interfaces/SAWTemplateUI.md +273 -30
- package/docs/api/interfaces/StoreItem.md +6 -0
- package/docs/api/interfaces/TStoreItem.md +8 -0
- package/package.json +1 -1
- package/src/Jackpots/GetJackpotsResponse.ts +0 -1
- package/src/MiniGames/SAWTemplateUI.ts +440 -64
- package/src/Store/StoreItem.ts +15 -0
- package/src/WSAPI/WSAPITypes.ts +2 -0
- package/src/index.ts +2 -1
|
@@ -3,58 +3,355 @@ import { SAWExposeUserSpinId } from './SAWExposeUserSpinId';
|
|
|
3
3
|
import { SAWGameDifficultyType } from './SAWGameDifficulty';
|
|
4
4
|
import { SAWGameLayout } from './SAWGameLayout';
|
|
5
5
|
import { SAWWheelLayout } from './SAWWheelLayout';
|
|
6
|
+
/**
|
|
7
|
+
* UI configuration for a SAW (Spin-And-Win) mini-game template.
|
|
8
|
+
*
|
|
9
|
+
* This interface is returned as the `saw_template_ui_definition` property of
|
|
10
|
+
* {@link SAWTemplate} and {@link TMiniGameTemplate}. It covers all visual,
|
|
11
|
+
* behavioural and game-type-specific settings that the operator can configure
|
|
12
|
+
* in the Back-Office for every mini-game variant (Spin the Wheel, Scratch Card,
|
|
13
|
+
* Gift Box, MatchX / Quiz, Treasure Hunt, Lootbox, Voyager, Prize Drop, etc.).
|
|
14
|
+
*/
|
|
6
15
|
export interface SAWTemplateUI {
|
|
16
|
+
/**
|
|
17
|
+
* CSS skin key that selects the overall visual theme of the game.
|
|
18
|
+
* Resolved at runtime to the matching skin folder / CSS bundle.
|
|
19
|
+
*/
|
|
7
20
|
skin: string;
|
|
21
|
+
/**
|
|
22
|
+
* Display name of the mini-game template shown to players and in the
|
|
23
|
+
* Back-Office listing. Supports translations via
|
|
24
|
+
* `saw_template_ui_definition._translations.<lang>.name`.
|
|
25
|
+
*/
|
|
8
26
|
name: string;
|
|
27
|
+
/**
|
|
28
|
+
* HTML-capable description / rules text shown to the player before or
|
|
29
|
+
* during the game. Supports translations via
|
|
30
|
+
* `saw_template_ui_definition._translations.<lang>.description`.
|
|
31
|
+
*/
|
|
9
32
|
description?: string;
|
|
33
|
+
/**
|
|
34
|
+
* URL of the thumbnail image (typically 256 × 256 px) shown in
|
|
35
|
+
* mini-game selection lists and galleries.
|
|
36
|
+
*/
|
|
37
|
+
thumbnail?: string;
|
|
38
|
+
/**
|
|
39
|
+
* HTML-capable message shown to a player who has reached the maximum
|
|
40
|
+
* number of allowed attempts for the current period.
|
|
41
|
+
* Rendered when the server rejects a spin with
|
|
42
|
+
* `SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED`.
|
|
43
|
+
* Supports translations via
|
|
44
|
+
* `saw_template_ui_definition._translations.<lang>.over_limit_message`.
|
|
45
|
+
*
|
|
46
|
+
* Only relevant when `max_spins_count` is configured on the template.
|
|
47
|
+
*/
|
|
10
48
|
over_limit_message?: string;
|
|
11
|
-
|
|
49
|
+
/**
|
|
50
|
+
* HTML-capable message shown when the player has no spin attempts or
|
|
51
|
+
* insufficient points / gems / diamonds to play.
|
|
52
|
+
* Supports translations via
|
|
53
|
+
* `saw_template_ui_definition._translations.<lang>.no_attempts_message`.
|
|
54
|
+
*
|
|
55
|
+
* Only relevant for buy-in types `Spins`, `Points`, `Gems`, or `Diamonds`.
|
|
56
|
+
*/
|
|
12
57
|
no_attempts_message?: string;
|
|
13
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Number of prize sectors on the wheel or gift-box grid.
|
|
60
|
+
* For Spin-the-Wheel games the Back-Office enforces a range of 3 – 10.
|
|
61
|
+
*/
|
|
14
62
|
sectors_count: number;
|
|
63
|
+
/**
|
|
64
|
+
* Relative display order of the mini-game within a list.
|
|
65
|
+
* Lower values appear first. Configurable in the Back-Office
|
|
66
|
+
* "Priority" field (Advanced section).
|
|
67
|
+
*/
|
|
15
68
|
priority: number;
|
|
69
|
+
/**
|
|
70
|
+
* When `true` the mini-game is **excluded from the widget's automatic
|
|
71
|
+
* game listing** and is only accessible when it is explicitly triggered
|
|
72
|
+
* via a Campaign Flow Builder action or accessed by deep links or triggered over the api.
|
|
73
|
+
*
|
|
74
|
+
* Back-Office label:
|
|
75
|
+
* _"Available only from campaign (won't be visible in the widget)"_
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
16
78
|
flow_builder_only: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* URL of the full-bleed background image shown on desktop devices.
|
|
81
|
+
* Not used for Plinko and Coin Flip game types.
|
|
82
|
+
*/
|
|
17
83
|
background_image?: string;
|
|
84
|
+
/**
|
|
85
|
+
* URL of the full-bleed background image shown on mobile devices.
|
|
86
|
+
* Falls back to {@link background_image} when absent.
|
|
87
|
+
* Not used for Plinko and Coin Flip game types.
|
|
88
|
+
*/
|
|
18
89
|
background_image_mobile?: string;
|
|
90
|
+
/**
|
|
91
|
+
* URL of the audio file (MP3 / WAV) played as background music
|
|
92
|
+
* during gameplay. Silenced when {@link disable_background_music}
|
|
93
|
+
* is `true` or the player has muted audio.
|
|
94
|
+
*/
|
|
19
95
|
background_sound?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Volume level of the background music, expressed as a percentage
|
|
98
|
+
* in the range `0` – `100`.
|
|
99
|
+
*/
|
|
100
|
+
background_music_volume?: number;
|
|
101
|
+
/**
|
|
102
|
+
* When `true`, background music is muted even if a
|
|
103
|
+
* {@link background_sound} URL is provided.
|
|
104
|
+
* Defaults to `true` in the Skin Editor preview scaffolding.
|
|
105
|
+
*/
|
|
106
|
+
disable_background_music?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Duration in milliseconds of the spin animation before the result
|
|
109
|
+
* is revealed (e.g. `3000` = 3 seconds).
|
|
110
|
+
* Applies to Spin-the-Wheel and similar animated game types.
|
|
111
|
+
*/
|
|
20
112
|
spin_animation_duration?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Rotation offset in degrees applied to the visual pointer / arrow
|
|
115
|
+
* on the wheel to compensate for skin-specific alignment differences.
|
|
116
|
+
*/
|
|
21
117
|
wheel_pointer_rotation?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Screen positioning of the wheel relative to the game panel.
|
|
120
|
+
*
|
|
121
|
+
* | Value | Meaning |
|
|
122
|
+
* | --- | --- |
|
|
123
|
+
* | `SAWWheelLayout.Centered = 1` | Wheel centred in the panel |
|
|
124
|
+
* | `SAWWheelLayout.LeftAligned = 2` | Wheel pinned to the left |
|
|
125
|
+
* | `SAWWheelLayout.RightAligned = 3` | Wheel pinned to the right |
|
|
126
|
+
* | `SAWWheelLayout.BottomAligned = 4` | Wheel pinned to the bottom |
|
|
127
|
+
*
|
|
128
|
+
* Applies to Spin-the-Wheel games only.
|
|
129
|
+
* Back-Office label: _"Wheel layout"_.
|
|
130
|
+
*/
|
|
131
|
+
wheel_layout?: SAWWheelLayout;
|
|
132
|
+
/**
|
|
133
|
+
* URL of the logo image overlaid on the scratch-card surface
|
|
134
|
+
* before the player scratches.
|
|
135
|
+
*/
|
|
22
136
|
scratch_logo?: string;
|
|
137
|
+
/**
|
|
138
|
+
* URL of the cover / foil image that the player scratches away
|
|
139
|
+
* to reveal the prize beneath.
|
|
140
|
+
*/
|
|
23
141
|
scratch_cover?: string;
|
|
142
|
+
/**
|
|
143
|
+
* URL of the background image shown behind the scratch card on
|
|
144
|
+
* desktop devices.
|
|
145
|
+
* Back-Office label: _"Scratch main desktop background"_.
|
|
146
|
+
*/
|
|
24
147
|
scratch_bg_desktop?: string;
|
|
148
|
+
/**
|
|
149
|
+
* URL of the background image shown behind the scratch card on
|
|
150
|
+
* mobile devices.
|
|
151
|
+
* Back-Office label: _"Scratch main mobile background"_.
|
|
152
|
+
*/
|
|
25
153
|
scratch_bg_mobile?: string;
|
|
154
|
+
/**
|
|
155
|
+
* URL of a custom cursor image used when the pointer hovers over
|
|
156
|
+
* the scratchable area.
|
|
157
|
+
* Back-Office label: _"Scratch mouse cursor"_.
|
|
158
|
+
*/
|
|
26
159
|
scratch_cursor?: string;
|
|
160
|
+
/**
|
|
161
|
+
* When `true`, prize / reward names are hidden inside the scratch-card
|
|
162
|
+
* UI so the player does not know what they won until they have fully
|
|
163
|
+
* scratched the card.
|
|
164
|
+
*
|
|
165
|
+
* Only rendered for `SAWGameType.ScratchCard`.
|
|
166
|
+
* Back-Office label: _"Hide prize names"_.
|
|
167
|
+
*/
|
|
168
|
+
hide_prize_names?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Raw CSS injected into the game iframe, allowing fine-grained
|
|
171
|
+
* overrides beyond what the selected skin provides.
|
|
172
|
+
*/
|
|
27
173
|
custom_css?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Path to an alternative folder from which skin assets (images,
|
|
176
|
+
* CSS, JS) are loaded instead of the default skin bundle.
|
|
177
|
+
*/
|
|
28
178
|
custom_skin_folder?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Label / symbol appended to the jackpot amount to give it semantic
|
|
181
|
+
* meaning (e.g. `"EUR"`, `"Free spins"`).
|
|
182
|
+
* Displayed alongside {@link SAWTemplate.jackpot_current}.
|
|
183
|
+
* Back-Office label: _"Jackpot symbol"_.
|
|
184
|
+
*/
|
|
29
185
|
jackpot_symbol?: string;
|
|
186
|
+
/**
|
|
187
|
+
* URL of a promotional banner image (recommended 500 × 240 px)
|
|
188
|
+
* displayed inside the game UI to advertise an offer or campaign.
|
|
189
|
+
* Supports per-language variants via
|
|
190
|
+
* `saw_template_ui_definition.promo_image_<lang>`.
|
|
191
|
+
*/
|
|
30
192
|
promo_image?: string;
|
|
193
|
+
/**
|
|
194
|
+
* HTML-capable promotional text displayed alongside
|
|
195
|
+
* {@link promo_image}. Supports translations via
|
|
196
|
+
* `saw_template_ui_definition._translations.<lang>.promo_text`.
|
|
197
|
+
*/
|
|
31
198
|
promo_text?: string;
|
|
199
|
+
/**
|
|
200
|
+
* URL of the banner image shown at the top of the MatchX / Quiz
|
|
201
|
+
* tournament leaderboard on desktop.
|
|
202
|
+
* Back-Office label: _"Banner"_.
|
|
203
|
+
*/
|
|
32
204
|
matchx_banner?: string;
|
|
205
|
+
/**
|
|
206
|
+
* URL of the mobile-optimised banner image for the MatchX / Quiz
|
|
207
|
+
* tournament leaderboard.
|
|
208
|
+
*/
|
|
33
209
|
matchx_banner_mobile?: string;
|
|
210
|
+
/**
|
|
211
|
+
* When `true`, tournament rankings are reset on a seasonal cadence
|
|
212
|
+
* rather than being continuous.
|
|
213
|
+
*/
|
|
34
214
|
matchx_seasonal_ranking?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* When `true`, the MatchX / Quiz tournament has concluded.
|
|
217
|
+
* New entries are blocked and the final leaderboard is shown.
|
|
218
|
+
*/
|
|
35
219
|
matchx_is_completed?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Maximum number of players visible on the general leaderboard
|
|
222
|
+
* inside the MatchX / Quiz game.
|
|
223
|
+
*/
|
|
36
224
|
matchx_general_board_users_count?: number;
|
|
225
|
+
/**
|
|
226
|
+
* When `true`, the ranking / leaderboard panel is hidden from
|
|
227
|
+
* players inside the MatchX / Quiz game.
|
|
228
|
+
* Back-Office label: _"Hide ranking"_.
|
|
229
|
+
*/
|
|
37
230
|
matchx_hide_ranking?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* URL of an image used to illustrate the prize pool (e.g. a trophy
|
|
233
|
+
* or coins graphic).
|
|
234
|
+
*/
|
|
38
235
|
prize_pool_image?: string;
|
|
39
|
-
|
|
236
|
+
/**
|
|
237
|
+
* When `true`, a panel listing the available prizes is displayed
|
|
238
|
+
* inside the game.
|
|
239
|
+
*
|
|
240
|
+
* Back-Office label: _"Show the list of the prizes"_.
|
|
241
|
+
* Defaults to `true` in the MatchX / Quiz game form.
|
|
242
|
+
*/
|
|
40
243
|
show_prize_board?: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* The rolling time-window in milliseconds within which
|
|
246
|
+
* `SAWTemplate.maxSpinsCount` attempts are allowed
|
|
247
|
+
* (e.g. `86400000` = 24 hours).
|
|
248
|
+
*
|
|
249
|
+
* Stored on the template root as `max_spins_period_ms`; mirrored here
|
|
250
|
+
* for convenience in UI preview payloads.
|
|
251
|
+
*/
|
|
41
252
|
max_spins_period_ms?: number;
|
|
253
|
+
/**
|
|
254
|
+
* When `true`, a countdown timer showing when the next spin becomes
|
|
255
|
+
* available is displayed to the player.
|
|
256
|
+
*
|
|
257
|
+
* Only active when `max_spins_count === 1` **and** `max_spins_period_ms`
|
|
258
|
+
* is set; automatically forced to `false`.
|
|
259
|
+
*
|
|
260
|
+
* Back-Office label: _"Show time to the next available spin"_.
|
|
261
|
+
*/
|
|
42
262
|
show_countdown_for_next_availability?: boolean;
|
|
43
|
-
|
|
263
|
+
/**
|
|
264
|
+
* Controls when (or whether) the player is asked to provide a
|
|
265
|
+
* display name before or after playing.
|
|
266
|
+
*
|
|
267
|
+
* | Value | Meaning |
|
|
268
|
+
* | --- | --- |
|
|
269
|
+
* | `SAWAskForUsername.NOASK = 'no-ask'` | Never ask |
|
|
270
|
+
* | `SAWAskForUsername.ONSUMBIT = 'on-submit'` | Ask when submitting |
|
|
271
|
+
*
|
|
272
|
+
* Back-Office label: _"Ask for username"_.
|
|
273
|
+
*/
|
|
274
|
+
ask_for_username?: SAWAskForUsername;
|
|
275
|
+
/**
|
|
276
|
+
* ID of the custom section (category / tab) this mini-game belongs to,
|
|
277
|
+
* allowing operators to group games in bespoke widget sections.
|
|
278
|
+
* Back-Office label: _"Custom section"_.
|
|
279
|
+
*/
|
|
44
280
|
custom_section_id?: number;
|
|
281
|
+
/**
|
|
282
|
+
* When `true`, the template is shown **only** inside its assigned
|
|
283
|
+
* custom section and is suppressed from all standard game listings.
|
|
284
|
+
*/
|
|
45
285
|
only_in_custom_section?: boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Determines which identifier is forwarded in webhooks and the
|
|
288
|
+
* Retention API when a spin result is produced.
|
|
289
|
+
*
|
|
290
|
+
* | Value | Meaning |
|
|
291
|
+
* | --- | --- |
|
|
292
|
+
* | `SAWExposeUserSpinId.UserId = 1` | Expose the operator's external user ID |
|
|
293
|
+
* | `SAWExposeUserSpinId.SpinId = 2` | Expose the internal spin transaction ID |
|
|
294
|
+
*
|
|
295
|
+
* Back-Office label:
|
|
296
|
+
* _"Expose 'External user ID' or 'Spin transaction ID'"_.
|
|
297
|
+
*/
|
|
46
298
|
expose_user_spin_id?: SAWExposeUserSpinId;
|
|
299
|
+
/**
|
|
300
|
+
* Arbitrary operator-defined payload attached to the template.
|
|
301
|
+
* Can be a JSON object, plain string, or number. Passed through to
|
|
302
|
+
* the front-end as-is and accessible via the public API.
|
|
303
|
+
* Back-Office label: _"Custom data field"_.
|
|
304
|
+
*/
|
|
47
305
|
custom_data: any;
|
|
306
|
+
/**
|
|
307
|
+
* First free-form placeholder string used by Prize Drop game skins
|
|
308
|
+
* to inject operator-defined copy into the game UI.
|
|
309
|
+
*/
|
|
48
310
|
placeholder1?: string;
|
|
311
|
+
/**
|
|
312
|
+
* Second free-form placeholder string used by Prize Drop game skins
|
|
313
|
+
* to inject operator-defined copy into the game UI.
|
|
314
|
+
*/
|
|
49
315
|
placeholder2?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Template definition for the Prize Drop game overlay.
|
|
318
|
+
* `id` is the unique template identifier; `content` is the raw HTML
|
|
319
|
+
* rendered inside the drop panel.
|
|
320
|
+
*/
|
|
50
321
|
prize_drop_template?: {
|
|
322
|
+
/** Unique identifier for this prize-drop HTML template. */
|
|
51
323
|
id: string;
|
|
324
|
+
/** HTML content rendered inside the prize-drop panel. */
|
|
52
325
|
content: string;
|
|
53
326
|
};
|
|
327
|
+
/**
|
|
328
|
+
* Visual arrangement of items in Lootbox (Weekly / Calendar Days)
|
|
329
|
+
* game types.
|
|
330
|
+
*
|
|
331
|
+
* | Value | Meaning |
|
|
332
|
+
* | --- | --- |
|
|
333
|
+
* | `SAWGameLayout.Horizontal = 1` | Items laid out in a horizontal row |
|
|
334
|
+
* | `SAWGameLayout.VerticalMap = 2` | Items arranged as a vertical map path |
|
|
335
|
+
*
|
|
336
|
+
* Back-Office label: _"Visual layout"_.
|
|
337
|
+
*/
|
|
54
338
|
game_layout?: SAWGameLayout;
|
|
339
|
+
/**
|
|
340
|
+
* Total number of path steps / cells a player must progress through
|
|
341
|
+
* to complete a Treasure Hunt game and receive the final prize.
|
|
342
|
+
* Higher values result in longer gameplay sessions.
|
|
343
|
+
* Back-Office label: _"Steps to finish game"_.
|
|
344
|
+
*/
|
|
55
345
|
steps_to_finish_game?: number;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
346
|
+
/**
|
|
347
|
+
* Difficulty level of the Voyager (space-exploration) mini-game,
|
|
348
|
+
* controlling obstacle frequency and game speed.
|
|
349
|
+
*
|
|
350
|
+
* | Value | Meaning |
|
|
351
|
+
* | --- | --- |
|
|
352
|
+
* | `SAWGameDifficultyType.EASY = 1` | Easy |
|
|
353
|
+
* | `SAWGameDifficultyType.MEDIUM = 2` | Medium |
|
|
354
|
+
* | `SAWGameDifficultyType.HARD = 3` | Hard |
|
|
355
|
+
*/
|
|
59
356
|
game_difficulty?: SAWGameDifficultyType;
|
|
60
357
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AchRelatedGame } from '../Base/AchRelatedGame';
|
|
1
2
|
import { TStoreItem } from '../WSAPI/WSAPITypes';
|
|
2
3
|
import { StoreItemPublicMeta } from './StoreItemPublicMeta';
|
|
3
4
|
import { StoreItemType } from './StoreItemType';
|
|
@@ -9,5 +10,6 @@ export interface StoreItem {
|
|
|
9
10
|
canBuy?: boolean;
|
|
10
11
|
shopPool: number;
|
|
11
12
|
activeTillDate?: number;
|
|
13
|
+
related_games?: AchRelatedGame[];
|
|
12
14
|
}
|
|
13
15
|
export declare const StoreItemTransform: (items: StoreItem[]) => TStoreItem[];
|
|
@@ -488,6 +488,8 @@ export interface TStoreItem {
|
|
|
488
488
|
priority: number;
|
|
489
489
|
/** The list of IDs of the related items. Can be used to show the related items in the store */
|
|
490
490
|
related_item_ids: number[];
|
|
491
|
+
/** List of casino games (or other types of entities) related to the store item */
|
|
492
|
+
related_games?: AchRelatedGame[];
|
|
491
493
|
/** The indicator if the user can buy the item
|
|
492
494
|
* This indicator is taking into account the segment conditions for the store item, the price of item towards users balance,
|
|
493
495
|
*/
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1056,7 +1056,23 @@ var StoreItemTransform = function StoreItemTransform(items) {
|
|
|
1056
1056
|
custom_section_type_id: r.itemPublicMeta.custom_section_type_id
|
|
1057
1057
|
}, r.itemPublicMeta.cant_buy_message ? {
|
|
1058
1058
|
cant_buy_message: r.itemPublicMeta.cant_buy_message
|
|
1059
|
-
} : {}
|
|
1059
|
+
} : {}, {
|
|
1060
|
+
related_games: (r.related_games || []).map(function (g, i) {
|
|
1061
|
+
return {
|
|
1062
|
+
ext_game_id: g.ext_game_id,
|
|
1063
|
+
game_public_meta: {
|
|
1064
|
+
name: g.game_public_meta.name,
|
|
1065
|
+
link: g.game_public_meta.link,
|
|
1066
|
+
image: g.game_public_meta.image,
|
|
1067
|
+
enabled: g.game_public_meta.enabled,
|
|
1068
|
+
game_categories: g.game_public_meta.game_categories,
|
|
1069
|
+
game_provider: g.game_public_meta.game_provider,
|
|
1070
|
+
mobile_spec_link: g.game_public_meta.mobile_spec_link,
|
|
1071
|
+
priority: i + 1
|
|
1072
|
+
}
|
|
1073
|
+
};
|
|
1074
|
+
})
|
|
1075
|
+
});
|
|
1060
1076
|
return x;
|
|
1061
1077
|
});
|
|
1062
1078
|
};
|