@smartico/public-api 0.0.282 → 0.0.284

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 (81) hide show
  1. package/dist/Jackpots/JackpotPublicMeta.d.ts +1 -1
  2. package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
  3. package/dist/Quiz/MarketsAnswersType.d.ts +22 -0
  4. package/dist/Raffle/GetDrawResponse.d.ts +5 -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/SmarticoPublicAPI.d.ts +23 -0
  10. package/dist/Store/BuyShopItemErrorCode.d.ts +10 -0
  11. package/dist/Store/BuyShopItemRequest.d.ts +4 -0
  12. package/dist/Store/BuyShopItemResponse.d.ts +4 -0
  13. package/dist/Store/GetCategoriesShopResponse.d.ts +5 -0
  14. package/dist/Store/GetShopItemsResponse.d.ts +5 -0
  15. package/dist/Store/ShopCategory.d.ts +5 -0
  16. package/dist/Store/ShopCategoryPublicMeta.d.ts +4 -0
  17. package/dist/Store/ShopItem.d.ts +9 -0
  18. package/dist/Store/ShopItemPublicMeta.d.ts +10 -0
  19. package/dist/Store/ShopItemType.d.ts +4 -0
  20. package/dist/Store/StorItemPruchased.d.ts +6 -0
  21. package/dist/WSAPI/WSAPITypes.d.ts +11 -0
  22. package/dist/index.js +2 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.modern.mjs +2 -0
  25. package/dist/index.modern.mjs.map +1 -1
  26. package/dist/service/index.d.ts +5 -0
  27. package/dist/service/types/ErrorCodes.d.ts +13 -0
  28. package/dist/service/types/GRequest.d.ts +16 -0
  29. package/dist/service/types/GResponse.d.ts +10 -0
  30. package/dist/service/types/Game/GameAttemptType.d.ts +6 -0
  31. package/dist/service/types/Game/GameCanPlayType.d.ts +10 -0
  32. package/dist/service/types/Game/GameExternalStatus.d.ts +6 -0
  33. package/dist/service/types/Game/GameInfo.d.ts +9 -0
  34. package/dist/service/types/Game/GamePick.d.ts +90 -0
  35. package/dist/service/types/Game/GameUtil.d.ts +7 -0
  36. package/dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts +7 -0
  37. package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +7 -0
  38. package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +5 -0
  39. package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +6 -0
  40. package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +5 -0
  41. package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +34 -0
  42. package/dist/service/types/SmarticoProto/PublicProperties.d.ts +11 -0
  43. package/dist/service/types/SmarticoProto/ResponseIdentify.d.ts +12 -0
  44. package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +5 -0
  45. package/dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts +5 -0
  46. package/dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts +5 -0
  47. package/dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts +15 -0
  48. package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +10 -0
  49. package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts +3 -0
  50. package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts +5 -0
  51. package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +11 -0
  52. package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +8 -0
  53. package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +13 -0
  54. package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +21 -0
  55. package/dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts +31 -0
  56. package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +12 -0
  57. package/dist/service/types/SmarticoProto/TranslationArea.d.ts +9 -0
  58. package/dist/service/types/User/UserInfo.d.ts +10 -0
  59. package/dist/util/Util.d.ts +51 -0
  60. package/docs/README.md +1 -0
  61. package/docs/classes/WSAPI.md +21 -0
  62. package/docs/interfaces/JackpotPublicMeta.md +1 -1
  63. package/docs/interfaces/RaffleDraw.md +13 -10
  64. package/docs/interfaces/RafflePrize.md +18 -16
  65. package/docs/interfaces/RafflePublicMeta.md +1 -1
  66. package/docs/interfaces/RaffleTicket.md +4 -0
  67. package/docs/interfaces/SAWPrizeUI.md +6 -0
  68. package/docs/interfaces/TLevel.md +6 -0
  69. package/docs/interfaces/TLevelCurrent.md +139 -0
  70. package/docs/interfaces/TMiniGameTemplate.md +18 -0
  71. package/docs/interfaces/TRaffleTicket.md +4 -0
  72. package/package.json +1 -1
  73. package/src/Jackpots/JackpotPublicMeta.ts +1 -1
  74. package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
  75. package/src/MiniGames/SAWPrizeUI.ts +1 -0
  76. package/src/Raffle/Raffle.ts +1 -1
  77. package/src/Raffle/RaffleClaimPrizeResponse.ts +1 -4
  78. package/src/Raffle/RaffleDraw.ts +17 -15
  79. package/src/Raffle/RafflePrize.ts +18 -17
  80. package/src/Raffle/RaffleTicket.ts +6 -2
  81. 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
  }
@@ -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;
@@ -0,0 +1,22 @@
1
+ export declare enum MarketsValueType {
2
+ HomeTeam = "1",
3
+ AwayTeam = "2",
4
+ Draw = "x",
5
+ HomeTeamHomeTeam = "1/1",
6
+ HomeTeamDraw = "1/x",
7
+ HomeTeamAwayTeam = "1/2",
8
+ DrawHomeTeam = "x/1",
9
+ DrawDraw = "x/x",
10
+ DrawAwayTeam = "x/2",
11
+ AwayTeamHomeTeam = "2/1",
12
+ AwayTeamDraw = "2/x",
13
+ AwayTeamAwayTeam = "2/2",
14
+ Yes = "yes",
15
+ No = "no",
16
+ Odd = "odd",
17
+ Even = "even",
18
+ HomeOdd = "1/odd",
19
+ HomeEven = "1/even",
20
+ AwayOdd = "2/odd",
21
+ AwayEven = "2/even"
22
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from '../Base/ProtocolResponse';
2
+ import { RaffleDraw } from './RaffleDraw';
3
+ export interface GetDrawResponse extends ProtocolResponse {
4
+ draw: RaffleDraw;
5
+ }
@@ -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 };
@@ -0,0 +1,23 @@
1
+ import { ClassId } from "./Base/ClassId";
2
+ import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
3
+ import { SAWTemplate } from './MiniGames/SAWTemplate';
4
+ import { ILogger } from './ILogger';
5
+ interface IOptions {
6
+ logger?: ILogger;
7
+ logCIDs?: ClassId[];
8
+ logHTTPTiming?: boolean;
9
+ }
10
+ declare class SmarticoPublicApi {
11
+ private label_api_key;
12
+ private brand_api_key;
13
+ private publicUrl;
14
+ private logger;
15
+ private logCIDs;
16
+ private logHTTPTiming;
17
+ constructor(label_api_key: string, brand_api_key: string, options?: IOptions);
18
+ private send;
19
+ private buildMessage;
20
+ miniGamesGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
21
+ miniGamesFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): any[];
22
+ }
23
+ export { SmarticoPublicApi };
@@ -0,0 +1,10 @@
1
+ export declare enum BuyShopItemErrorCode {
2
+ FAILED_TO_BUY_SHOP_ITEM = 121,
3
+ SHOP_NO_BALANCE = 11000,
4
+ SHOP_WRONG_LABEL = 11001,
5
+ SHOP_FAILED_TO_BUY_BONUS = 11002,
6
+ SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003,
7
+ SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004,
8
+ SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
9
+ SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006
10
+ }
@@ -0,0 +1,4 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+ export interface BuyShopItemRequest extends ProtocolMessage {
3
+ itemId: number;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ export interface BuyShopItemResponse extends ProtocolResponse {
3
+ success?: boolean;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { ShopCategory } from "./ShopCategory";
3
+ export interface GetCategoriesShopResponse extends ProtocolResponse {
4
+ categories: ShopCategory[];
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { ShopItem } from "./ShopItem";
3
+ export interface GetShopItemsResponse extends ProtocolResponse {
4
+ items: ShopItem[];
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ShopCategoryPublicMeta } from "./ShopCategoryPublicMeta";
2
+ export interface ShopCategory {
3
+ id?: number;
4
+ publicMeta?: ShopCategoryPublicMeta;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface ShopCategoryPublicMeta {
2
+ name?: string;
3
+ order?: number;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { ShopItemPublicMeta } from "./ShopItemPublicMeta";
2
+ import { ShopItemType } from "./ShopItemType";
3
+ export interface ShopItem {
4
+ id: number;
5
+ itemTypeId: ShopItemType;
6
+ itemPublicMeta: ShopItemPublicMeta;
7
+ categoryIds?: number[];
8
+ canBuy?: boolean;
9
+ }
@@ -0,0 +1,10 @@
1
+ export interface ShopItemPublicMeta {
2
+ price: string;
3
+ image_url: string;
4
+ name: string;
5
+ description: string;
6
+ label_tag: string;
7
+ limit_message: string;
8
+ priority: number;
9
+ related_items: number[];
10
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum ShopItemType {
2
+ Bonus = 1,
3
+ Manual = 2
4
+ }
@@ -0,0 +1,6 @@
1
+ import { StoreItem } from "./StoreItem";
2
+ interface StorItemPruchased extends StoreItem {
3
+ purchase_ts: number;
4
+ purchase_points_amount: number;
5
+ }
6
+ export { StorItemPruchased };
@@ -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 = {