@smartico/public-api 0.0.283 → 0.0.285

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.
Files changed (36) hide show
  1. package/dist/Jackpots/JackpotPublicMeta.d.ts +1 -1
  2. package/dist/MiniGames/SAWGameDifficulty.d.ts +12 -0
  3. package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
  4. package/dist/MiniGames/SAWTemplateUI.d.ts +2 -0
  5. package/dist/Raffle/Raffle.d.ts +1 -1
  6. package/dist/Raffle/RaffleDraw.d.ts +16 -11
  7. package/dist/Raffle/RafflePrize.d.ts +15 -14
  8. package/dist/Raffle/RaffleTicket.d.ts +6 -0
  9. package/dist/WSAPI/WSAPI.d.ts +37 -8
  10. package/dist/WSAPI/WSAPITypes.d.ts +11 -0
  11. package/dist/index.js +39 -8
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.modern.mjs +39 -8
  14. package/dist/index.modern.mjs.map +1 -1
  15. package/docs/classes/WSAPI.md +36 -8
  16. package/docs/interfaces/JackpotPublicMeta.md +1 -1
  17. package/docs/interfaces/RaffleDraw.md +13 -10
  18. package/docs/interfaces/RafflePrize.md +18 -16
  19. package/docs/interfaces/RafflePublicMeta.md +1 -1
  20. package/docs/interfaces/RaffleTicket.md +4 -0
  21. package/docs/interfaces/SAWPrizeUI.md +6 -0
  22. package/docs/interfaces/TMiniGameTemplate.md +18 -0
  23. package/docs/interfaces/TRaffleTicket.md +4 -0
  24. package/package.json +1 -1
  25. package/src/Jackpots/JackpotPublicMeta.ts +1 -1
  26. package/src/MiniGames/SAWGameDifficulty.ts +22 -0
  27. package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
  28. package/src/MiniGames/SAWPrizeUI.ts +1 -0
  29. package/src/MiniGames/SAWTemplateUI.ts +2 -0
  30. package/src/Raffle/Raffle.ts +1 -1
  31. package/src/Raffle/RaffleClaimPrizeResponse.ts +1 -4
  32. package/src/Raffle/RaffleDraw.ts +17 -15
  33. package/src/Raffle/RafflePrize.ts +18 -17
  34. package/src/Raffle/RaffleTicket.ts +6 -2
  35. package/src/WSAPI/WSAPI.ts +38 -8
  36. package/src/WSAPI/WSAPITypes.ts +11 -3
@@ -17,7 +17,7 @@ interface JackpotPublicMeta {
17
17
  /**
18
18
  * Custom data as string or JSON string that can be used in API to build custom UI
19
19
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
20
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
20
+ * Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
21
21
  */
22
22
  custom_data: string;
23
23
  }
@@ -0,0 +1,12 @@
1
+ export declare enum SAWGameDifficultyType {
2
+ EASY = 1,
3
+ MEDIUM = 2,
4
+ HARD = 3
5
+ }
6
+ export declare enum SAWGameDifficultyTypeName {
7
+ EASY = "easy",
8
+ MEDIUM = "medium",
9
+ HARD = "hard"
10
+ }
11
+ /** @hidden */
12
+ export declare const SawGameDifficultyTypeNamed: (type: SAWGameDifficultyType) => SAWGameDifficultyTypeName;
@@ -7,6 +7,7 @@ export interface SAWPrizeUI {
7
7
  name_original?: string;
8
8
  hide_prize_popup: boolean;
9
9
  aknowledge_message?: string;
10
+ aknowledge_message_lose?: string;
10
11
  sectors?: number[];
11
12
  acknowledge_type?: SAWAcknowledgeType;
12
13
  acknowledge_dp?: string;
@@ -1,4 +1,5 @@
1
1
  import { SAWAskForUsername } from './SAWAskForUsername';
2
+ import { SAWGameDifficultyType } from './SAWGameDifficulty';
2
3
  import { SAWGameLayout } from './SAWGameLayout';
3
4
  import { SAWWheelLayout } from './SAWWheelLayout';
4
5
  export interface SAWTemplateUI {
@@ -52,4 +53,5 @@ export interface SAWTemplateUI {
52
53
  steps_to_finish_game?: number;
53
54
  wheel_layout?: SAWWheelLayout;
54
55
  background_music_volume?: number;
56
+ game_difficulty: SAWGameDifficultyType;
55
57
  }
@@ -15,7 +15,7 @@ interface RafflePublicMeta {
15
15
  /**
16
16
  * Custom data as string or JSON string that can be used in API to build custom UI
17
17
  * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
18
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
18
+ * Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
19
19
  */
20
20
  custom_data: string;
21
21
  }
@@ -41,6 +41,7 @@ interface RaffleDraw {
41
41
  run_id: number;
42
42
  /**
43
43
  * Type of the draw execution, indicating how and when the draw is executed.
44
+ *
44
45
  * - ExecDate: Draw is executed only once at a specific date and time.
45
46
  * - Recurring: Draw is executed on a recurring basis (e.g., daily, weekly).
46
47
  * - Grand: Draw is executed once and is marked as grand, often with larger prizes or more importance.
@@ -53,19 +54,20 @@ interface RaffleDraw {
53
54
  /** Unique ID of the previusly executed draw (if there is such) */
54
55
  previous_run_id?: number;
55
56
  /**
56
- * Date/time starting from which the tickets will participate in the upcoming draw
57
- * This value need to be taken into account with next_execute_ts field value, for example
58
- * Next draw is at 10:00, ticket_start_date is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00
59
- * (internally this value is calculated as next_execute_ts - ticket_start_date)
57
+ * Date/time starting from which the tickets will participate in the upcoming draw
58
+ * This value need to be taken into account with next_execute_ts field value, for example
59
+ * Next draw is at 10:00, ticket_start_date is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00
60
+ * (internally this value is calculated as next_execute_ts - ticket_start_date)
60
61
  */
61
62
  ticket_start_ts: number;
62
- /** Field is indicating if same ticket can win multiple prizes in the same draw
63
- * For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook
64
- * If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),
65
- * if false, then one ticket can win only one prize.
66
- * The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)
67
- * If specific prize has multiple values, e.g. we have 3 iPhones,
68
- * then the same ticket can win only one prize of a kind, but can win multiple prizes of different kind (if allow_multi_prize_per_ticket is true)
63
+ /**
64
+ * Field is indicating if same ticket can win multiple prizes in the same draw
65
+ * For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook
66
+ * If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),
67
+ * if false, then one ticket can win only one prize.
68
+ * The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)
69
+ * If specific prize has multiple values, e.g. we have 3 iPhones,
70
+ * then the same ticket can win only one prize of a kind, but can win multiple prizes of different kind (if allow_multi_prize_per_ticket is true)
69
71
  */
70
72
  allow_multi_prize_per_ticket: boolean;
71
73
  /**
@@ -77,6 +79,9 @@ interface RaffleDraw {
77
79
  * The number of tickets collected by current user for this instance of draw.
78
80
  */
79
81
  my_tickets_count: number;
82
+ /**
83
+ * List of last 5 tickets are collected by current user for this instance of draw.
84
+ */
80
85
  my_last_tickets: RaffleTicket[];
81
86
  }
82
87
  export { RaffleDraw };
@@ -27,24 +27,25 @@ interface RafflePrize {
27
27
  /**
28
28
  * The actual number of prizes for the current instance.
29
29
  * This value is taking into account follwing values:
30
- * - min_required_total_tickets,
31
- * - add_one_prize_per_each_x_tickets
32
- * - stock_items_per_draw
33
- * - total_tickets_count (from Draw instance)
34
- * - cap_prizes_per_run
30
+ *
31
+ * - min_required_total_tickets,
32
+ * - add_one_prize_per_each_x_tickets
33
+ * - stock_items_per_draw
34
+ * - total_tickets_count (from Draw instance)
35
+ * - cap_prizes_per_run
35
36
  * For example:
36
- * - prizes_per_run = 1
37
- * - min_required_total_tickets = 1000
38
- * - add_one_prize_per_each_x_tickets = 1000
39
- * - stock_items_per_draw = 5
40
- * - total_tickets_count = 7000
41
- * - cap_prizes_per_run = 6
42
- * prizes_per_run_actual will be 5, because
43
- * 7000 tickets are collected, so 7 iPhones are available, but the cap is 6 and the stock is 5.
37
+ *
38
+ * - prizes_per_run = 1
39
+ * - min_required_total_tickets = 1000
40
+ * - add_one_prize_per_each_x_tickets = 1000
41
+ * - stock_items_per_draw = 5
42
+ * - total_tickets_count = 7000
43
+ * - cap_prizes_per_run = 6
44
+ * prizes_per_run_actual will be 5, because
45
+ * 7000 tickets are collected, so 7 iPhones are available, but the cap is 6 and the stock is 5.
44
46
  */
45
47
  prizes_per_run_actual: number;
46
48
  /**
47
- *
48
49
  * The chances to win the prize by current player.
49
50
  * Calculated as the ratio of the number of tickets collected by the current player to the
50
51
  * total number of tickets collected by all players and multiplied by number of actual prizes of this kind.
@@ -1,5 +1,11 @@
1
1
  interface RaffleTicket {
2
+ /**
3
+ * Int presentation of the ticket
4
+ */
2
5
  id: number;
6
+ /**
7
+ * String presentation of the ticket
8
+ */
3
9
  s: string;
4
10
  }
5
11
  export { RaffleTicket };
@@ -605,13 +605,20 @@ export declare class WSAPI {
605
605
  * The onUpdate callback will be called on claiming prize. Updated Raffles will be passed to onUpdate callback.
606
606
  *
607
607
  * **Example**:
608
+ *
608
609
  * ```
609
610
  * _smartico.api.getRaffles().then((result) => {
610
611
  * console.log(result);
611
612
  * });
612
613
  * ```
613
614
  *
614
- * **Visitor mode: not supported**
615
+ * **Example in the Visitor mode**:
616
+ *
617
+ * ```
618
+ * _smartico.vapi('EN').getRaffles().then((result) => {
619
+ * console.log(result);
620
+ * });
621
+ * ```
615
622
  *
616
623
  */
617
624
  getRaffles({ onUpdate }?: {
@@ -622,13 +629,21 @@ export declare class WSAPI {
622
629
  *
623
630
  *
624
631
  * **Example**:
625
- * ```
626
- * _smartico.api.getRaffleDrawRun({raffle_id:156, run_id: 145}).then((result) => {
632
+ *
633
+ * ```javascript
634
+ * _smartico.api.getRaffleDrawRun({raffle_id: 156, run_id: 145}).then((result) => {
627
635
  * console.log(result);
628
636
  * });
629
637
  * ```
630
638
  *
631
- * **Visitor mode: not supported**
639
+ * **Example in the Visitor mode**:
640
+ *
641
+ *
642
+ * ```javascript
643
+ * _smartico.vapi('EN').getRaffleDrawRun({ raffle_id: 156, run_id: 145 }).then((result) => {
644
+ * console.log(result);
645
+ * });
646
+ * ```
632
647
  *
633
648
  */
634
649
  getRaffleDrawRun(props: {
@@ -640,13 +655,20 @@ export declare class WSAPI {
640
655
  *
641
656
  *
642
657
  * **Example**:
643
- * ```
658
+ *
659
+ * ```javascript
644
660
  * _smartico.api.getRaffleDrawRunHistory({raffle_id:156, draw_id: 432}).then((result) => {
645
661
  * console.log(result);
646
662
  * });
647
663
  * ```
648
664
  *
649
- * **Visitor mode: not supported**
665
+ * **Example in the Visitor mode**:
666
+ *
667
+ * ```javascript
668
+ * _smartico.vapi('EN').getRaffleDrawRunHistory({ raffle_id: 156, draw_id: 432 }).then((result) => {
669
+ * console.log(result);
670
+ * });
671
+ * ```
650
672
  *
651
673
  */
652
674
  getRaffleDrawRunsHistory(props: {
@@ -658,13 +680,20 @@ export declare class WSAPI {
658
680
  *
659
681
  *
660
682
  * **Example**:
661
- * ```
683
+ *
684
+ * ```javascript
662
685
  * _smartico.api.claimRafflePrize({won_id:251}).then((result) => {
663
686
  * console.log(result);
664
687
  * });
665
688
  * ```
666
689
  *
667
- * **Visitor mode: not supported**
690
+ * **Example in the Visitor mode**:
691
+ *
692
+ * ```javascript
693
+ * _smartico.vapi('EN').claimRafflePrize({ won_id: 251 }).then((result) => {
694
+ * console.log(result);
695
+ * });
696
+ * ```
668
697
  *
669
698
  */
670
699
  claimRafflePrize(props: {
@@ -165,7 +165,12 @@ export interface TMiniGameTemplate {
165
165
  custom_section_id?: number;
166
166
  /** The UI definition of the mini-game */
167
167
  saw_template_ui_definition: SAWTemplateUI;
168
+ /** When enabled the prize history icon is visible on a certain template */
168
169
  show_prize_history?: boolean;
170
+ /** The maximum number of attempts that user can do during period of time */
171
+ max_number_of_attempts?: number;
172
+ /** The period of time in milliseconds during which the user can do the maximum number of attempts */
173
+ max_spins_period_ms?: number;
169
174
  }
170
175
  /**
171
176
  * TUser describes the information of the user
@@ -881,7 +886,13 @@ export interface TRaffle {
881
886
  draws: TRaffleDraw[];
882
887
  }
883
888
  export interface TRaffleTicket {
889
+ /**
890
+ * Int presentation of the ticket
891
+ */
884
892
  ticekt_id: number;
893
+ /**
894
+ * String presentation of the ticket
895
+ */
885
896
  ticket_id_string: string;
886
897
  }
887
898
  export interface TRafflePrize {
package/dist/index.js CHANGED
@@ -450,6 +450,8 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
450
450
  custom_section_id: r.saw_template_ui_definition.custom_section_id,
451
451
  saw_template_ui_definition: r.saw_template_ui_definition,
452
452
  show_prize_history: r.show_prize_history,
453
+ max_number_of_attempts: r.maxSpinsCount,
454
+ max_spins_period_ms: r.maxSpinsPediodMs,
453
455
  prizes: r.prizes.map(function (p) {
454
456
  var _p$saw_prize_ui_defin;
455
457
  var y = {
@@ -3173,13 +3175,20 @@ var WSAPI = /*#__PURE__*/function () {
3173
3175
  * The onUpdate callback will be called on claiming prize. Updated Raffles will be passed to onUpdate callback.
3174
3176
  *
3175
3177
  * **Example**:
3178
+ *
3176
3179
  * ```
3177
3180
  * _smartico.api.getRaffles().then((result) => {
3178
3181
  * console.log(result);
3179
3182
  * });
3180
3183
  * ```
3181
3184
  *
3182
- * **Visitor mode: not supported**
3185
+ * **Example in the Visitor mode**:
3186
+ *
3187
+ * ```
3188
+ * _smartico.vapi('EN').getRaffles().then((result) => {
3189
+ * console.log(result);
3190
+ * });
3191
+ * ```
3183
3192
  *
3184
3193
  */
3185
3194
  ;
@@ -3203,13 +3212,21 @@ var WSAPI = /*#__PURE__*/function () {
3203
3212
  *
3204
3213
  *
3205
3214
  * **Example**:
3206
- * ```
3207
- * _smartico.api.getRaffleDrawRun({raffle_id:156, run_id: 145}).then((result) => {
3215
+ *
3216
+ * ```javascript
3217
+ * _smartico.api.getRaffleDrawRun({raffle_id: 156, run_id: 145}).then((result) => {
3208
3218
  * console.log(result);
3209
3219
  * });
3210
3220
  * ```
3211
3221
  *
3212
- * **Visitor mode: not supported**
3222
+ * **Example in the Visitor mode**:
3223
+ *
3224
+ *
3225
+ * ```javascript
3226
+ * _smartico.vapi('EN').getRaffleDrawRun({ raffle_id: 156, run_id: 145 }).then((result) => {
3227
+ * console.log(result);
3228
+ * });
3229
+ * ```
3213
3230
  *
3214
3231
  */
3215
3232
  ;
@@ -3231,13 +3248,20 @@ var WSAPI = /*#__PURE__*/function () {
3231
3248
  *
3232
3249
  *
3233
3250
  * **Example**:
3234
- * ```
3251
+ *
3252
+ * ```javascript
3235
3253
  * _smartico.api.getRaffleDrawRunHistory({raffle_id:156, draw_id: 432}).then((result) => {
3236
3254
  * console.log(result);
3237
3255
  * });
3238
3256
  * ```
3239
3257
  *
3240
- * **Visitor mode: not supported**
3258
+ * **Example in the Visitor mode**:
3259
+ *
3260
+ * ```javascript
3261
+ * _smartico.vapi('EN').getRaffleDrawRunHistory({ raffle_id: 156, draw_id: 432 }).then((result) => {
3262
+ * console.log(result);
3263
+ * });
3264
+ * ```
3241
3265
  *
3242
3266
  */
3243
3267
  ;
@@ -3259,13 +3283,20 @@ var WSAPI = /*#__PURE__*/function () {
3259
3283
  *
3260
3284
  *
3261
3285
  * **Example**:
3262
- * ```
3286
+ *
3287
+ * ```javascript
3263
3288
  * _smartico.api.claimRafflePrize({won_id:251}).then((result) => {
3264
3289
  * console.log(result);
3265
3290
  * });
3266
3291
  * ```
3267
3292
  *
3268
- * **Visitor mode: not supported**
3293
+ * **Example in the Visitor mode**:
3294
+ *
3295
+ * ```javascript
3296
+ * _smartico.vapi('EN').claimRafflePrize({ won_id: 251 }).then((result) => {
3297
+ * console.log(result);
3298
+ * });
3299
+ * ```
3269
3300
  *
3270
3301
  */
3271
3302
  ;