@smartico/public-api 0.0.436 → 0.0.438
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/SmarticoLib/index.d.ts +2 -1
- package/dist/WSAPI/WSAPITypes.d.ts +2 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +9 -0
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/MiniGames/SAWGetTemplatesResponse.ts +10 -0
- package/src/SmarticoLib/index.ts +1 -0
- package/src/WSAPI/WSAPITypes.ts +2 -0
|
@@ -30,6 +30,8 @@ export interface TMiniGamePrize {
|
|
|
30
30
|
* For example for prize '100 points' the prize_value will be 100, for '100 free spins' 100, for '50 Diamonds' 50.
|
|
31
31
|
*/
|
|
32
32
|
prize_value?: number;
|
|
33
|
+
/** For 'gems-and-diamonds' prizes — which currency the prize gives: 'gems', 'diamonds', or 'gems-and-diamonds' (both; `prize_value` is then their sum). Absent for other types */
|
|
34
|
+
gems_diamonds_type?: 'gems' | 'diamonds' | 'gems-and-diamonds';
|
|
33
35
|
/** Custom font size in px for rendering the prize name on the game surface (e.g. a wheel sector), desktop */
|
|
34
36
|
font_size?: number;
|
|
35
37
|
/** Custom font size in px for the prize name, mobile; falls back to `font_size` when absent */
|
package/dist/index.js
CHANGED
|
@@ -499,6 +499,14 @@ var sawPrizeValue = function sawPrizeValue(p) {
|
|
|
499
499
|
}
|
|
500
500
|
return n > 0 ? n : p.prize_value;
|
|
501
501
|
};
|
|
502
|
+
var GEMS_DIAMONDS_TYPES = ['gems', 'diamonds', 'gems-and-diamonds'];
|
|
503
|
+
/** Which currency a gems-and-diamonds prize gives (`_gems_diamonds_type`: 0 gems, 1 diamonds, 2 both). */
|
|
504
|
+
var sawGemsDiamondsType = function sawGemsDiamondsType(p) {
|
|
505
|
+
var _GEMS_DIAMONDS_TYPES$;
|
|
506
|
+
if (p.prize_type_id !== exports.SAWPrizeType.GEMS_AND_DIAMONDS) return undefined;
|
|
507
|
+
var d = p.prize_details_json;
|
|
508
|
+
return (_GEMS_DIAMONDS_TYPES$ = GEMS_DIAMONDS_TYPES[d == null ? void 0 : d._gems_diamonds_type]) != null ? _GEMS_DIAMONDS_TYPES$ : d != null && d.gems && d != null && d.diamonds ? 'gems-and-diamonds' : d != null && d.diamonds ? 'diamonds' : 'gems';
|
|
509
|
+
};
|
|
502
510
|
var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
|
|
503
511
|
return items.map(function (r) {
|
|
504
512
|
var _r$saw_skin_ui_defini;
|
|
@@ -553,6 +561,7 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
|
|
|
553
561
|
name: p.saw_prize_ui_definition.name,
|
|
554
562
|
prize_type: MiniGamePrizeTypeNamed(p.prize_type_id),
|
|
555
563
|
prize_value: sawPrizeValue(p),
|
|
564
|
+
gems_diamonds_type: sawGemsDiamondsType(p),
|
|
556
565
|
font_size: p.saw_prize_ui_definition.font_size,
|
|
557
566
|
font_size_mobile: p.saw_prize_ui_definition.font_size_mobile,
|
|
558
567
|
icon: p.saw_prize_ui_definition.icon,
|