@smartico/public-api 0.0.409 → 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/SAWDoAknowledgeRequest.d.ts +2 -0
- package/dist/MiniGames/SAWPrize.d.ts +18 -0
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/MiniGames/SAWTemplate.d.ts +24 -0
- package/dist/SmarticoAPI.d.ts +1 -1
- package/dist/SmarticoLib/index.d.ts +1 -1
- package/dist/WSAPI/WSAPIJackpots.d.ts +11 -2
- package/dist/WSAPI/WSAPIMiniGames.d.ts +92 -23
- package/dist/WSAPI/WSAPITypes.d.ts +45 -44
- package/dist/index.js +112 -31
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +109 -28
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/classes/WSAPIJackpots.md +11 -2
- package/docs/api/classes/WSAPIMiniGames.md +92 -23
- package/docs/api/interfaces/SAWDoAknowledgeRequest.md +8 -0
- package/docs/api/interfaces/SAWPrize.md +36 -0
- package/docs/api/interfaces/SAWPrizeUI.md +2 -0
- package/docs/api/interfaces/SAWTemplate.md +48 -0
- package/docs/api/interfaces/TMiniGamePrize.md +51 -27
- package/docs/api/interfaces/TMiniGameTemplate.md +15 -16
- package/docs/capabilities/getJackpotEligibleGames.md +11 -2
- package/docs/capabilities/getMiniGames.md +63 -39
- package/docs/capabilities/miniGameWinAcknowledgeRequest.md +36 -7
- package/docs/capabilities/playMiniGame.md +27 -14
- package/docs/native/PROTOCOL.md +7 -0
- package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +8 -0
- package/docs/ui/minigames/UIGuide_getMiniGames.md +46 -0
- package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +1 -1
- package/docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md +90 -0
- package/docs/ui/minigames/UIGuide_playMiniGame.md +38 -2
- package/package.json +1 -1
- package/src/MiniGames/SAWDoAknowledgeRequest.ts +2 -0
- package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
- package/src/MiniGames/SAWPrize.ts +18 -0
- package/src/MiniGames/SAWPrizeUI.ts +2 -1
- package/src/MiniGames/SAWTemplate.ts +27 -4
- package/src/SmarticoAPI.ts +7 -1
- package/src/SmarticoLib/index.ts +1 -1
- package/src/WSAPI/WSAPIJackpots.ts +11 -2
- package/src/WSAPI/WSAPIMiniGames.ts +91 -24
- package/src/WSAPI/WSAPITypes.ts +47 -46
|
@@ -396,7 +396,7 @@ export class WSAPIJackpots extends WSAPIClans {
|
|
|
396
396
|
*
|
|
397
397
|
* @remarks
|
|
398
398
|
* **Preconditions**
|
|
399
|
-
* -
|
|
399
|
+
* - No authentication required — works in both identified and visitor mode.
|
|
400
400
|
* - `jp_template_id` is mandatory.
|
|
401
401
|
*
|
|
402
402
|
* **`onUpdate` caveat**
|
|
@@ -414,7 +414,12 @@ export class WSAPIJackpots extends WSAPIClans {
|
|
|
414
414
|
* Non-zero `errCode` on control-group users or generic server errors.
|
|
415
415
|
* Branch on `errCode === 0` and surface `errMsg` on failure.
|
|
416
416
|
*
|
|
417
|
-
* **Visitor mode**:
|
|
417
|
+
* **Visitor mode**: supported via
|
|
418
|
+
* `_smartico.vapi(lang).getJackpotEligibleGames(...)`. The eligible-games
|
|
419
|
+
* list is template-level (which games contribute to the pot) and carries no
|
|
420
|
+
* per-user fields, so a visitor session receives the same list an identified
|
|
421
|
+
* user would. The `lang` passed to `_smartico.vapi(lang)` drives the
|
|
422
|
+
* translation of game names.
|
|
418
423
|
*
|
|
419
424
|
* **UI guidance**: see [UI Guide — `getJackpotEligibleGames`](../../docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md).
|
|
420
425
|
*
|
|
@@ -432,6 +437,10 @@ export class WSAPIJackpots extends WSAPIClans {
|
|
|
432
437
|
*
|
|
433
438
|
* const r = await window._smartico.api.getJackpotEligibleGames({ jp_template_id: 42 });
|
|
434
439
|
* console.log('[smartico] render', r.eligible_games.length, 'eligible game tiles');
|
|
440
|
+
*
|
|
441
|
+
* // Visitor mode — same shape, language driven by the vapi(lang) argument
|
|
442
|
+
* const visitor = await window._smartico.vapi('EN').getJackpotEligibleGames({ jp_template_id: 42 });
|
|
443
|
+
* console.log('[smartico] visitor eligible games:', visitor.eligible_games.length);
|
|
435
444
|
* ```
|
|
436
445
|
*/
|
|
437
446
|
public async getJackpotEligibleGames({ jp_template_id, onUpdate } : {
|
|
@@ -64,6 +64,27 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
64
64
|
* games server (not this SDK); the SAW spin is fired
|
|
65
65
|
* server-internally to deduct the buy-in.
|
|
66
66
|
*
|
|
67
|
+
* **Per-prize statistics (`expose_game_stat_on_api`)**
|
|
68
|
+
* Each template's `prizes` array always carries the definition
|
|
69
|
+
* fields — name, icon, `prize_type`, `prize_value`, acknowledge
|
|
70
|
+
* configuration. The stock-statistics fields are gated by an
|
|
71
|
+
* operator template setting, surfaced as
|
|
72
|
+
* `expose_game_stat_on_api`:
|
|
73
|
+
* - Populated when enabled: `pool` (remaining stock),
|
|
74
|
+
* `wins_count` (total wins across all players), `weekdays`
|
|
75
|
+
* (ISO 1–7 days the prize can be won), `active_from_ts` /
|
|
76
|
+
* `active_till_ts` (prize availability window).
|
|
77
|
+
* - Omitted when disabled (the default) — this keeps the live
|
|
78
|
+
* prize economy (stock levels, win rates, schedules) hidden
|
|
79
|
+
* from players.
|
|
80
|
+
* - Exception: `pool` is always populated for `MatchX` / `Quiz`
|
|
81
|
+
* templates, whose game flow needs the remaining stock.
|
|
82
|
+
* - `pool_initial` is populated regardless of the setting.
|
|
83
|
+
* When enabled, the values are also kept current — the server
|
|
84
|
+
* refreshes the prize rows on each fetch and drops its template
|
|
85
|
+
* caches after every play, so `pool` / `wins_count` are safe to
|
|
86
|
+
* drive an "X prizes left" scarcity UI.
|
|
87
|
+
*
|
|
67
88
|
* **Cache TTL**: the SDK caches the response for 30 seconds. Cache
|
|
68
89
|
* is fully cleared on login / logout.
|
|
69
90
|
*
|
|
@@ -290,14 +311,19 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
290
311
|
* it later by calling {@link miniGameWinAcknowledgeRequest} with the
|
|
291
312
|
* `request_id` returned on this result.
|
|
292
313
|
*
|
|
293
|
-
* What `acknowledge: false`
|
|
294
|
-
* - For STANDARD prizes the value is credited
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
* explicit acknowledge
|
|
314
|
+
* What `acknowledge: false` defers:
|
|
315
|
+
* - For STANDARD prizes the value is credited when the spin is
|
|
316
|
+
* finalised — by your later acknowledge or, failing that, by the
|
|
317
|
+
* server-side fallback below — so opting out delays the balance
|
|
318
|
+
* change by at most that fallback window. The `is_claimed` flag in
|
|
319
|
+
* {@link getMiniGamesHistory} flips on the same finalisation.
|
|
320
|
+
* - For operator-configured "explicit claim" prizes the credit is
|
|
321
|
+
* deferred until your explicit acknowledge — the fallback does not
|
|
322
|
+
* cover them.
|
|
323
|
+
*
|
|
324
|
+
* While the spin is un-finalised it can also be finalised as LOST —
|
|
325
|
+
* prize discarded back to the pool — via
|
|
326
|
+
* {@link miniGameWinAcknowledgeRequest} with `{ lose: true }`.
|
|
301
327
|
*
|
|
302
328
|
* A server-side fallback auto-acknowledges ordinary un-acknowledged
|
|
303
329
|
* spins after a short delay (about 1–3 minutes), so an ordinary
|
|
@@ -328,8 +354,10 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
328
354
|
* time the call resolves. Balance updates flow via the
|
|
329
355
|
* user-properties channel (observe via {@link getUserProfile}).
|
|
330
356
|
* - Prize value credited per the prize's type (see "Prize handling"
|
|
331
|
-
* above)
|
|
332
|
-
*
|
|
357
|
+
* above) when the spin is finalised — with the default
|
|
358
|
+
* auto-acknowledge that happens before the call resolves;
|
|
359
|
+
* "explicit claim" prizes are credited only by an explicit
|
|
360
|
+
* acknowledge.
|
|
333
361
|
* - The play is recorded server-side for analytics / reporting.
|
|
334
362
|
*
|
|
335
363
|
* **UI guidance**: see [UI Guide — `playMiniGame`](../../docs/ui/minigames/UIGuide_playMiniGame.md).
|
|
@@ -394,18 +422,24 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
394
422
|
*
|
|
395
423
|
* @example
|
|
396
424
|
* Manual finalisation (`acknowledge: false`) — e.g. an explicit
|
|
397
|
-
* "Claim" CTA, or finalising on your own
|
|
425
|
+
* "Claim" CTA, a decline/forfeit flow, or finalising on your own
|
|
426
|
+
* schedule:
|
|
398
427
|
* ```ts
|
|
399
428
|
* const r = await window._smartico.api.playMiniGame(game.id, { acknowledge: false });
|
|
400
429
|
* if (r.err_code === 0) {
|
|
401
|
-
* // Spin resolved but not yet
|
|
402
|
-
* //
|
|
403
|
-
* //
|
|
430
|
+
* // Spin resolved but not yet finalised — the prize is not credited
|
|
431
|
+
* // yet. Your acknowledge below credits it (for standard prizes the
|
|
432
|
+
* // server-side fallback would eventually do the same).
|
|
404
433
|
* console.log('[smartico] prize won — show the result / Claim CTA, then finalise');
|
|
405
434
|
*
|
|
406
435
|
* // On the user's Claim click, finalise with the request_id from the result.
|
|
407
436
|
* await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
|
|
408
437
|
* console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
|
|
438
|
+
*
|
|
439
|
+
* // Or, if the game flow ends in the player declining / losing the
|
|
440
|
+
* // drawn prize, finalise the spin as lost instead — the prize is
|
|
441
|
+
* // not credited and returns to the prize pool:
|
|
442
|
+
* // await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });
|
|
409
443
|
* }
|
|
410
444
|
* ```
|
|
411
445
|
*/
|
|
@@ -433,9 +467,10 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
433
467
|
|
|
434
468
|
/**
|
|
435
469
|
* Manually acknowledges a mini-game spin — marks the win delivered
|
|
436
|
-
* server-side
|
|
437
|
-
*
|
|
438
|
-
* {@link
|
|
470
|
+
* server-side, or (with `lose: true`) finalises it as lost and
|
|
471
|
+
* returns the prize to the pool. Most consumers do NOT need this:
|
|
472
|
+
* {@link playMiniGame} acknowledges by default (`acknowledge: true`)
|
|
473
|
+
* and {@link playMiniGameBatch} acknowledges automatically. Call this
|
|
439
474
|
* directly only when you took ownership of the acknowledge step or
|
|
440
475
|
* need to recover a lost one.
|
|
441
476
|
*
|
|
@@ -458,6 +493,27 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
458
493
|
* `client_request_id` on a {@link getMiniGamesHistory} row are the
|
|
459
494
|
* same correlation id — this method accepts either.
|
|
460
495
|
*
|
|
496
|
+
* **Finalising as lost (`lose: true`)**
|
|
497
|
+
* Pass `{ lose: true }` to finalise the spin as LOST instead of won:
|
|
498
|
+
* the prize is NOT credited and is returned to the game's prize pool
|
|
499
|
+
* (available again for other players), and the spin fires the
|
|
500
|
+
* mini-game "lose" engagement event instead of the win one. On the
|
|
501
|
+
* next {@link getMiniGamesHistory} fetch the row shows `is_claimed:
|
|
502
|
+
* true` with no prize attached. Use this for game mechanics where the
|
|
503
|
+
* player can decline or forfeit the drawn prize — e.g. a
|
|
504
|
+
* gamble/discard step, or a client-driven game where the user's final
|
|
505
|
+
* action decides whether the pre-drawn prize is actually won (the
|
|
506
|
+
* default Smartico UI does this for the Voyager game: failing the
|
|
507
|
+
* star-collection run finalises the spin as lost). When configured,
|
|
508
|
+
* the prize's `aknowledge_message_lose` is the operator's result copy
|
|
509
|
+
* for this case — show it instead of `aknowledge_message`. It only
|
|
510
|
+
* works on a spin that is not yet finalised, so it requires playing
|
|
511
|
+
* with `acknowledge: false` and calling promptly — once the automatic
|
|
512
|
+
* acknowledge or the server-side fallback (below) has finalised the
|
|
513
|
+
* spin, `lose: true` is a no-op and the prize stays credited.
|
|
514
|
+
* ("Explicit claim" prizes are exempt from the fallback, so for them
|
|
515
|
+
* there is no time pressure.)
|
|
516
|
+
*
|
|
461
517
|
* **Idempotency**: safe. Acknowledging a spin that is already
|
|
462
518
|
* finalised — by you, by the automatic acknowledge, or by the
|
|
463
519
|
* fallback — is a no-op with no double credit. Acknowledging a
|
|
@@ -472,13 +528,16 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
472
528
|
* call here.
|
|
473
529
|
*
|
|
474
530
|
* **Side effects** (first successful call for an un-acknowledged spin)
|
|
475
|
-
* -
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
531
|
+
* - Default (win): the prize value is credited on this call — this is
|
|
532
|
+
* the finalisation step that credits standard and "explicit claim"
|
|
533
|
+
* prizes alike (see {@link playMiniGame} "Prize handling").
|
|
534
|
+
* - With `lose: true`: no credit; the prize returns to the prize pool
|
|
535
|
+
* and the "lose" engagement event fires.
|
|
536
|
+
* - Either way the spin's `is_claimed` flips to `true` on the next
|
|
480
537
|
* {@link getMiniGamesHistory} fetch.
|
|
481
538
|
*
|
|
539
|
+
* **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).
|
|
540
|
+
*
|
|
482
541
|
* **Visitor mode**: not supported.
|
|
483
542
|
*
|
|
484
543
|
* @param request_id Correlation id of the spin to finalise: the
|
|
@@ -486,6 +545,10 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
486
545
|
* (played with `acknowledge: false`), or the
|
|
487
546
|
* `client_request_id` of a
|
|
488
547
|
* {@link getMiniGamesHistory} row.
|
|
548
|
+
* @param options.lose Optional. When `true`, finalises the spin as
|
|
549
|
+
* lost — the prize is not credited and returns
|
|
550
|
+
* to the prize pool (see "Finalising as lost").
|
|
551
|
+
* Omit (or pass `false`) to deliver the win.
|
|
489
552
|
*
|
|
490
553
|
* @example
|
|
491
554
|
* ```ts
|
|
@@ -496,6 +559,10 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
496
559
|
* await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
|
|
497
560
|
* }
|
|
498
561
|
*
|
|
562
|
+
* // Decline / forfeit — finalise the same spin as lost instead:
|
|
563
|
+
* // the prize is not credited and goes back to the prize pool.
|
|
564
|
+
* await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });
|
|
565
|
+
*
|
|
499
566
|
* // Recovery — re-acknowledge any spins a batch acknowledge missed.
|
|
500
567
|
* const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });
|
|
501
568
|
* for (const row of history.filter(h => !h.is_claimed)) {
|
|
@@ -504,8 +571,8 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
504
571
|
* }
|
|
505
572
|
* ```
|
|
506
573
|
*/
|
|
507
|
-
public async miniGameWinAcknowledgeRequest(request_id: string) {
|
|
508
|
-
return this.api.doAcknowledgeRequest(this.userExtId, request_id);
|
|
574
|
+
public async miniGameWinAcknowledgeRequest(request_id: string, { lose }: { lose?: boolean } = {}) {
|
|
575
|
+
return this.api.doAcknowledgeRequest(this.userExtId, request_id, lose);
|
|
509
576
|
}
|
|
510
577
|
|
|
511
578
|
/**
|
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -23,71 +23,73 @@ 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;
|
|
62
|
-
/**
|
|
64
|
+
/** Remaining stock of the prize — decrements on each win, refunded if the spin is finalised as lost. Populated only when the template's `expose_game_stat_on_api` is enabled; always populated for MatchX / Quiz games */
|
|
63
65
|
pool?: number;
|
|
64
|
-
/** Initial
|
|
66
|
+
/** Initial (configured) stock of the prize. Populated regardless of `expose_game_stat_on_api` */
|
|
65
67
|
pool_initial?: number;
|
|
66
|
-
/** Number of
|
|
68
|
+
/** Number of times the prize has been won, across all players. Populated only when the template's `expose_game_stat_on_api` is enabled */
|
|
67
69
|
wins_count?: number;
|
|
68
|
-
/**
|
|
70
|
+
/** ISO weekday numbers (1 = Monday … 7 = Sunday) on which the prize can be won; absent = any day. Populated only when the template's `expose_game_stat_on_api` is enabled */
|
|
69
71
|
weekdays?: number[];
|
|
70
|
-
/**
|
|
72
|
+
/** Time from which the prize can be won (epoch ms), evaluated against `relative_period_timezone`. Populated only when the template's `expose_game_stat_on_api` is enabled */
|
|
71
73
|
active_from_ts?: number;
|
|
72
|
-
/**
|
|
74
|
+
/** Time until which the prize can be won (epoch ms), evaluated against `relative_period_timezone`. Populated only when the template's `expose_game_stat_on_api` is enabled */
|
|
73
75
|
active_till_ts?: number;
|
|
74
|
-
/**
|
|
76
|
+
/** Timezone offset in minutes used to evaluate `weekdays` and the active window (UTC minus local, as in JS `Date.getTimezoneOffset()` — e.g. `-180` for UTC+3) */
|
|
75
77
|
relative_period_timezone?: number;
|
|
76
|
-
/**
|
|
78
|
+
/** When true, the prize stays winnable even when its `pool` reaches 0 (effectively unlimited stock) */
|
|
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,34 +206,34 @@ 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
|
-
/** When enabled, the
|
|
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;
|
|
233
234
|
/** The period of time in milliseconds during which the user can do the maximum number of attempts */
|
|
234
235
|
max_spins_period_ms?: number;
|
|
235
|
-
/**
|
|
236
|
+
/** Which identifier to show next to a win result for transparency/audit — 'userId' (the player's external user id) or 'spinId' (the spin's transaction id). Absent when the operator disabled it */
|
|
236
237
|
expose_user_spin_id?: SAWExposeUserSpinIdName;
|
|
237
238
|
}
|
|
238
239
|
|