@smartico/public-api 0.0.90 → 0.0.91

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 (158) hide show
  1. package/dist/Base/ClassId.d.ts +77 -77
  2. package/dist/Base/ProtocolMessage.d.ts +5 -5
  3. package/dist/Base/ProtocolRequest.d.ts +6 -6
  4. package/dist/Base/ProtocolResponse.d.ts +5 -5
  5. package/dist/CookieStore.d.ts +6 -6
  6. package/dist/Core/ActivityTypeLimited.d.ts +18 -18
  7. package/dist/Core/CoreUtils.d.ts +4 -4
  8. package/dist/Core/GetLabelInfoRequest.d.ts +3 -3
  9. package/dist/Core/GetLabelInfoResponse.d.ts +7 -7
  10. package/dist/Core/GetTranslationsRequest.d.ts +7 -7
  11. package/dist/Core/GetTranslationsResponse.d.ts +7 -7
  12. package/dist/Core/PublicLabelSettings.d.ts +29 -29
  13. package/dist/Core/PublicProperties.d.ts +11 -11
  14. package/dist/Core/ResponseIdentify.d.ts +12 -12
  15. package/dist/Core/TranslationArea.d.ts +10 -10
  16. package/dist/Core/index.d.ts +9 -9
  17. package/dist/ErrorCodes.d.ts +12 -12
  18. package/dist/GResponse.d.ts +9 -9
  19. package/dist/ILogger.d.ts +7 -7
  20. package/dist/Inbox/GetInboxMessagesRequest.d.ts +6 -6
  21. package/dist/Inbox/GetInboxMessagesResponse.d.ts +5 -5
  22. package/dist/Inbox/InboxMessage.d.ts +19 -19
  23. package/dist/Inbox/InboxMessageType.d.ts +11 -11
  24. package/dist/Inbox/MarkInboxMessageReadRequest.d.ts +5 -5
  25. package/dist/Inbox/MarkInboxMessageReadResponse.d.ts +4 -4
  26. package/dist/Inbox/MarkInboxMessageStarredRequest.d.ts +5 -5
  27. package/dist/Inbox/MarkInboxMessageStarredResponse.d.ts +4 -4
  28. package/dist/Inbox/index.d.ts +8 -8
  29. package/dist/IntUtils.d.ts +9 -9
  30. package/dist/Leaderboard/GetLeaderBoardsRequest.d.ts +7 -7
  31. package/dist/Leaderboard/GetLeaderBoardsResponse.d.ts +7 -7
  32. package/dist/Leaderboard/LeaderBoardDetails.d.ts +13 -13
  33. package/dist/Leaderboard/LeaderBoardPeriodType.d.ts +5 -5
  34. package/dist/Leaderboard/LeaderBoardPosition.d.ts +10 -10
  35. package/dist/Leaderboard/LeaderBoardPublicMeta.d.ts +5 -5
  36. package/dist/Leaderboard/index.d.ts +6 -6
  37. package/dist/Level/GetLevelMapResponse.d.ts +7 -7
  38. package/dist/Level/Level.d.ts +12 -12
  39. package/dist/Level/LevelPublicMeta.d.ts +17 -17
  40. package/dist/Level/index.d.ts +3 -3
  41. package/dist/MiniGames/SAWAcknowledgeType.d.ts +5 -5
  42. package/dist/MiniGames/SAWAskForUsername.d.ts +4 -4
  43. package/dist/MiniGames/SAWBuyInType.d.ts +14 -14
  44. package/dist/MiniGames/SAWDoAknowledgeRequest.d.ts +4 -4
  45. package/dist/MiniGames/SAWDoAknowledgeResponse.d.ts +4 -4
  46. package/dist/MiniGames/SAWDoSpinRequest.d.ts +5 -5
  47. package/dist/MiniGames/SAWDoSpinResponse.d.ts +10 -10
  48. package/dist/MiniGames/SAWGameType.d.ts +16 -16
  49. package/dist/MiniGames/SAWGetTemplatesRequest.d.ts +5 -5
  50. package/dist/MiniGames/SAWGetTemplatesResponse.d.ts +7 -7
  51. package/dist/MiniGames/SAWPrize.d.ts +11 -11
  52. package/dist/MiniGames/SAWPrizeType.d.ts +20 -20
  53. package/dist/MiniGames/SAWPrizeUI.d.ts +15 -15
  54. package/dist/MiniGames/SAWSpinErrorCode.d.ts +14 -14
  55. package/dist/MiniGames/SAWSpinsCountPush.d.ts +5 -5
  56. package/dist/MiniGames/SAWTemplate.d.ts +27 -27
  57. package/dist/MiniGames/SAWTemplateUI.d.ts +38 -38
  58. package/dist/MiniGames/SAWUtils.d.ts +5 -5
  59. package/dist/MiniGames/SAWWinSoundType.d.ts +12 -12
  60. package/dist/MiniGames/index.d.ts +19 -19
  61. package/dist/Missions/AchievementOptinRequest.d.ts +4 -4
  62. package/dist/Missions/AchievementOptinResponse.d.ts +3 -3
  63. package/dist/Missions/AchievementPublicMeta.d.ts +18 -18
  64. package/dist/Missions/AchievementStatus.d.ts +8 -8
  65. package/dist/Missions/AchievementTaskPublicMeta.d.ts +3 -3
  66. package/dist/Missions/AchievementTaskType.d.ts +4 -4
  67. package/dist/Missions/AchievementType.d.ts +4 -4
  68. package/dist/Missions/GetAchievementMapRequest.d.ts +3 -3
  69. package/dist/Missions/GetAchievementMapResponse.d.ts +5 -5
  70. package/dist/Missions/ReloadAchievementsEvent.d.ts +3 -3
  71. package/dist/Missions/ScheduledMissionType.d.ts +5 -5
  72. package/dist/Missions/UserAchievement.d.ts +26 -26
  73. package/dist/Missions/UserAchievementTask.d.ts +14 -14
  74. package/dist/Missions/index.d.ts +13 -13
  75. package/dist/NodeCache.d.ts +9 -9
  76. package/dist/OCache.d.ts +13 -13
  77. package/dist/SmarticoAPI.d.ts +81 -81
  78. package/dist/Store/BuyStoreItemErrorCode.d.ts +10 -10
  79. package/dist/Store/BuyStoreItemRequest.d.ts +4 -4
  80. package/dist/Store/BuyStoreItemResponse.d.ts +4 -4
  81. package/dist/Store/GetCategoriesStoreResponse.d.ts +5 -5
  82. package/dist/Store/GetStoreItemsResponse.d.ts +5 -5
  83. package/dist/Store/StoreCategory.d.ts +7 -7
  84. package/dist/Store/StoreCategoryPublicMeta.d.ts +4 -4
  85. package/dist/Store/StoreItem.d.ts +11 -11
  86. package/dist/Store/StoreItemPublicMeta.d.ts +12 -12
  87. package/dist/Store/StoreItemType.d.ts +4 -4
  88. package/dist/Store/index.d.ts +10 -10
  89. package/dist/Tournaments/GetTournamentInfoRequest.d.ts +4 -4
  90. package/dist/Tournaments/GetTournamentInfoResponse.d.ts +22 -22
  91. package/dist/Tournaments/GetTournamentsRequest.d.ts +3 -3
  92. package/dist/Tournaments/GetTournamentsResponse.d.ts +6 -6
  93. package/dist/Tournaments/Tournament.d.ts +49 -49
  94. package/dist/Tournaments/TournamentInstanceStatus.d.ts +10 -10
  95. package/dist/Tournaments/TournamentPlayer.d.ts +9 -9
  96. package/dist/Tournaments/TournamentPrize.d.ts +10 -10
  97. package/dist/Tournaments/TournamentPublicMeta.d.ts +25 -25
  98. package/dist/Tournaments/TournamentRegisterRequest.d.ts +4 -4
  99. package/dist/Tournaments/TournamentRegisterResponse.d.ts +5 -5
  100. package/dist/Tournaments/TournamentRegistrationError.d.ts +11 -11
  101. package/dist/Tournaments/TournamentRegistrationStatus.d.ts +22 -22
  102. package/dist/Tournaments/TournamentRegistrationType.d.ts +11 -11
  103. package/dist/Tournaments/TournamentType.d.ts +5 -5
  104. package/dist/Tournaments/TournamentUtils.d.ts +9 -9
  105. package/dist/Tournaments/index.d.ts +16 -16
  106. package/dist/WSAPI/WSAPI.d.ts +65 -65
  107. package/dist/WSAPI/WSAPITypes.d.ts +377 -377
  108. package/dist/index.d.ts +12 -12
  109. package/dist/index.js +18 -18
  110. package/dist/index.js.map +1 -1
  111. package/dist/index.modern.mjs +18 -19
  112. package/dist/index.modern.mjs.map +1 -1
  113. package/package.json +1 -1
  114. package/dist/SmarticoPublicAPI.d.ts +0 -23
  115. package/dist/Store/BuyShopItemErrorCode.d.ts +0 -10
  116. package/dist/Store/BuyShopItemRequest.d.ts +0 -4
  117. package/dist/Store/BuyShopItemResponse.d.ts +0 -4
  118. package/dist/Store/GetCategoriesShopResponse.d.ts +0 -5
  119. package/dist/Store/GetShopItemsResponse.d.ts +0 -5
  120. package/dist/Store/ShopCategory.d.ts +0 -5
  121. package/dist/Store/ShopCategoryPublicMeta.d.ts +0 -4
  122. package/dist/Store/ShopItem.d.ts +0 -9
  123. package/dist/Store/ShopItemPublicMeta.d.ts +0 -10
  124. package/dist/Store/ShopItemType.d.ts +0 -4
  125. package/dist/service/index.d.ts +0 -5
  126. package/dist/service/types/ErrorCodes.d.ts +0 -13
  127. package/dist/service/types/GRequest.d.ts +0 -16
  128. package/dist/service/types/GResponse.d.ts +0 -10
  129. package/dist/service/types/Game/GameAttemptType.d.ts +0 -6
  130. package/dist/service/types/Game/GameCanPlayType.d.ts +0 -10
  131. package/dist/service/types/Game/GameExternalStatus.d.ts +0 -6
  132. package/dist/service/types/Game/GameInfo.d.ts +0 -9
  133. package/dist/service/types/Game/GamePick.d.ts +0 -90
  134. package/dist/service/types/Game/GameUtil.d.ts +0 -7
  135. package/dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts +0 -7
  136. package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +0 -7
  137. package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +0 -5
  138. package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +0 -6
  139. package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +0 -5
  140. package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +0 -34
  141. package/dist/service/types/SmarticoProto/PublicProperties.d.ts +0 -11
  142. package/dist/service/types/SmarticoProto/ResponseIdentify.d.ts +0 -12
  143. package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +0 -5
  144. package/dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts +0 -5
  145. package/dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts +0 -5
  146. package/dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts +0 -15
  147. package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +0 -10
  148. package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts +0 -3
  149. package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts +0 -5
  150. package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +0 -11
  151. package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +0 -8
  152. package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +0 -13
  153. package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +0 -21
  154. package/dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts +0 -31
  155. package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +0 -12
  156. package/dist/service/types/SmarticoProto/TranslationArea.d.ts +0 -9
  157. package/dist/service/types/User/UserInfo.d.ts +0 -10
  158. package/dist/util/Util.d.ts +0 -51
@@ -1,377 +1,377 @@
1
- import { BuyStoreItemErrorCode } from "../Store";
2
- import { MiniGamePrizeTypeName, SAWBuyInTypeName, SAWGameTypeName, SAWSpinErrorCode } from "../MiniGames";
3
- import { TournamentRegistrationError, TournamentRegistrationStatusName, TournamentRegistrationTypeName } from "../Tournaments";
4
- type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
5
- /**
6
- * TMiniGamePrize describes the information of prize in the array of prizes in the TMiniGameTemplate
7
- */
8
- export interface TMiniGamePrize {
9
- /** ID of the prize */
10
- id: number;
11
- /** The visual name of the prize */
12
- name: string;
13
- /** The type of the prize, no-prize, points, bonus, manual, spin, jackpot */
14
- prize_type: MiniGamePrizeTypeName;
15
- /** Numeric value of the prize in case it's pints or spin type */
16
- prize_value?: number;
17
- /** Custom font size for the prize */
18
- font_size?: number;
19
- /** The URL of the icon of the prize */
20
- icon?: string;
21
- }
22
- /**
23
- * TMiniGamePlayResult describes the response of call to _smartico.api.playMiniGame(template_id) method
24
- */
25
- export interface TMiniGamePlayResult {
26
- /** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
27
- err_code: SAWSpinErrorCode;
28
- /** Optional error message */
29
- err_message: string;
30
- /** The prize_id that user won, details of the prize can be found in the mini-game definition */
31
- prize_id: number;
32
- }
33
- /**
34
- * TMiniGameTemplate describes the information of mini-games available for the user
35
- */
36
- export interface TMiniGameTemplate {
37
- /** ID of the mini-game template */
38
- id: number;
39
- /** Name of the mini-game template, translated to the user language */
40
- name: string;
41
- /** Description of the mini-game template, translated to the user language */
42
- description: string;
43
- /** URL of the icon of the mini-game template */
44
- thumbnail: string;
45
- /** The type of the game, e.g. Spin the Wheel, Gift Box, Scratch card, MatchX etc */
46
- saw_game_type: SAWGameTypeName;
47
- /** How the user is charged for each game attempt e.g. Free, Points or Spin attempts */
48
- saw_buyin_type: SAWBuyInTypeName;
49
- /** in case of charging type 'Points', what is the points amount will be deducted from user balance */
50
- buyin_cost_points: number;
51
- /** in case of charging type 'Spin attempts', shows the current number of spin attempts that user has */
52
- spin_count?: number;
53
- /** if the game is limit to the number of spins that user can do during period of time, this property shows the epoch time in UTC when the next attempt will be available */
54
- next_available_spin_ts: number;
55
- /** The message that should be shown to the user when he cannot play the game, server rejected attempt with error code SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED */
56
- over_limit_message: string;
57
- /** The message that should be shown to the user when he cannot play the game because he doesn't have spin attempts or points. */
58
- no_attempts_message: string;
59
- /** Current jackpont amount, if jackpot is enabled. */
60
- jackpot_current: number;
61
- /** 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. */
62
- jackpot_add_on_attempt: number;
63
- /** The symbol of jackpot that is giving the sense to the 'amount' E.g. the symbol could be EUR and connected to the amount it can indicate that amount is monetary, e.g. '100 EUR'. Or the symbol can be 'Free spins' and connected to the amount it can indicate that amount is number of free spins, e.g. '100 Free spins'.
64
- */
65
- jackpot_symbol: string;
66
- prizes: TMiniGamePrize[];
67
- }
68
- /**
69
- * TUser describes the information of the user
70
- * The user object is returned by _smartico.api.getUserProfile() method.
71
- * If you want to track the changes of the user profile, you can subscribe to the callback in the following way
72
- * _smartico.on('props_change', () => console.log(_smartico.api.getUserProfile()) );
73
- */
74
- export interface TUserProfile {
75
- /** The language of the user */
76
- core_user_language: string;
77
- /** The current points balance that user can use in the Store, Mini-games, Tournaments, etc.. */
78
- ach_points_balance: number;
79
- /** The amount of points that user collected in total */
80
- ach_points_ever: number;
81
- /**
82
- * The array of the public tags set on the user object.
83
- * They can be treated as server-based cookies.
84
- * You can set tags using following method _smartico.event('core_public_tags_update', { core_public_tags: ['A', 'B'] } );
85
- * And then you can check for the tags
86
- */
87
- core_public_tags: string[];
88
- /** The ID of the current level of the user */
89
- ach_level_current_id?: number;
90
- /** The indicator if user is marked as test user */
91
- core_is_test_account?: boolean;
92
- /** The URL to the user avatar */
93
- avatar_url?: string;
94
- /** The username of current user */
95
- public_username?: string;
96
- /** THe number of unread inbox messages */
97
- core_inbox_unread_count?: number;
98
- }
99
- /**
100
- * TLevel describes the information of each level defined in the system
101
- * There is no order of the levels, but it can be calculated using required_points property
102
- * The current level of user can be taken from the user object using ach_level_current_id property
103
- * The progress to the next level can be calculated using ach_points_ever and required_points properties of next level
104
- */
105
- export interface TLevel {
106
- /** The ID of the Level */
107
- id: number;
108
- /** The name of the Level, translated to the user language */
109
- name: string;
110
- /** The description of the Level, translated to the user language */
111
- description: string;
112
- /** The URL of the image of the Level */
113
- image: string;
114
- /** The amount of points required to reach the Level */
115
- required_points: number;
116
- /** Number of points that user should collect in order to see this level */
117
- visibility_points: number;
118
- /**
119
- * The counter of 1st metric used to reach the Level.
120
- * Relevant in case of using advanced leveling logic
121
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
122
- *
123
- */
124
- required_level_counter_1: number;
125
- /**
126
- * The counter of 2nd metric used to reach the Level.
127
- * Relevant in case of using advanced leveling logic
128
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
129
- *
130
- */
131
- required_level_counter_2: number;
132
- }
133
- /**
134
- * TTournament describes the general information of the tournament item
135
- */
136
- export interface TTournament {
137
- /** ID of tournament instance. Generated every time when tournament based on specific template is scheduled for run */
138
- instance_id: number;
139
- /** ID of tournament template */
140
- tournament_id: number;
141
- /** Name of the tournament, translated to the user language */
142
- name: string;
143
- /** Description of the tournament, translated to the user language */
144
- description: string;
145
- image1: string;
146
- image2: string;
147
- prize_pool_short: string;
148
- custom_price_text: string;
149
- /** The message that should be shown to the user when the user cannot register in tournament with error code TOURNAMENT_USER_DONT_MATCH_CONDITIONS */
150
- segment_dont_match_message: string;
151
- /**
152
- * The ID of the custom section where the tournament is assigned
153
- * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method (TODO-API)
154
- */
155
- custom_section_id: number;
156
- /** The custom data of the tournament defined by operator. Can be a JSON object, string or number */
157
- custom_data: any;
158
- /** The indicator if the tournament is 'Featured' */
159
- is_featured: boolean;
160
- /** The ribbon of the tournament item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon */
161
- ribbon: TRibbon;
162
- /** The time when tournament is going to start, epoch with milliseconds */
163
- start_time: number;
164
- /** The time when tournament is going to finish, epoch with milliseconds */
165
- end_time: number;
166
- /** Type of registration in the tournament */
167
- registration_type: TournamentRegistrationTypeName;
168
- /** Number of users registered in the tournament */
169
- registration_count: number;
170
- /** flag indicating if current user is registered in the tournament */
171
- is_user_registered: boolean;
172
- /** Minimum number of participant for this tournament. If tournament doesnt have enough registrations, it will not start */
173
- players_min_count: number;
174
- /** Maximum number of participant for this tournament. When reached, new users won't be able to register */
175
- players_max_count: number;
176
- /** Status of registration in the tournament for current user */
177
- registration_status: TournamentRegistrationStatusName;
178
- /** Tournament duration in millisecnnds */
179
- duration_ms: number;
180
- /** Cost of registration in the tournament in gamification points */
181
- registration_cost_points: number;
182
- /** Indicator if tournament instance is active, means in one of the statues - PUBLISHED, REGISTED, STARTED */
183
- is_active: boolean;
184
- /** Indicator if user can register in this tournament instance, e.g tournament is active, max users is not reached, user is not registered yet */
185
- is_can_register: boolean;
186
- /** Indicator if tournament instance is cancelled (status CANCELLED) */
187
- is_cancelled: boolean;
188
- /** Indicator if tournament instance is finished (status FINISHED, CANCELLED OR FINIALIZING) */
189
- is_finished: boolean;
190
- /** Indicator if tournament instance is running (status STARTED) */
191
- is_in_progress: boolean;
192
- /** Indicator if tournament instance is upcoming (status PUBLISHED or REGISTER) */
193
- is_upcoming: boolean;
194
- }
195
- /**
196
- * TTournamentDetailed describes the information of the tournament item and includes list of participants, their scores and position in the tournament leaderboard
197
- */
198
- export interface TTournamentDetailed extends TTournament {
199
- /** The list of the tournament participants */
200
- players?: {
201
- /** The username of the participant */
202
- public_username: string;
203
- /** The URL to the avatar of the participant */
204
- avatar_url: string;
205
- /** The position of the participant in the tournament */
206
- position: number;
207
- /** The scores of the participant in the tournament */
208
- scores: number;
209
- /** The indicator if the participant is current user */
210
- is_me: boolean;
211
- }[];
212
- /** The information about current user in the tournament if he is registered in the tournamnet */
213
- me?: {
214
- /** The username of the current user */
215
- public_username: string;
216
- /** The URL to the avatar of the current user */
217
- avatar_url: string;
218
- /** The position of the current user in the tournament */
219
- position: number;
220
- /** The scores of the current user in the tournament */
221
- scores: number;
222
- };
223
- prizes?: {
224
- /** The name of the prize */
225
- name: string;
226
- /** The description of the prize */
227
- description: string;
228
- /** The image of the prize */
229
- image_url: string;
230
- /** from-to range of the places to which this prize */
231
- place_from: number;
232
- place_to: number;
233
- /** type of the prize: TANGIBLE, POINTS_ADD, POINTS_DEDUCT, POINTS_RESET, MINI_GAME_ATTEMPT, BONUS */
234
- type: string;
235
- /** if the prize is points related, indicates amount of points */
236
- points?: number;
237
- }[];
238
- }
239
- /**
240
- * TStoreCategory describes the store category item. Each store item can be assigned to 1 or more categories
241
- */
242
- export interface TStoreCategory {
243
- id: number;
244
- name: string;
245
- order: number;
246
- }
247
- /**
248
- * TStoreItem describes the information of the store item defined in the system
249
- */
250
- export interface TStoreItem {
251
- /** ID of the store item */
252
- id: number;
253
- /** Name of the store item, translated to the user language */
254
- name: string;
255
- /** Description of the store item, translated to the user language */
256
- description: string;
257
- /** URL of the image of the store item */
258
- image: string;
259
- /** Type of the store item. Can be 'bonus' or 'manual'. Manual, means it's tangible item, e.g. iPhone */
260
- type: 'bonus' | 'manual';
261
- /** The price of the store item in the gamification points */
262
- price: number;
263
- /** The ribbon of the store item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon */
264
- ribbon: TRibbon;
265
- /**
266
- * The message that should be shown to the user if he is not eligible to buy it. this message can be used to explain the reason why user cannot buy the item, e.g. 'You should be VIP to buy this item' and can be used in case can_buy property is false.
267
- The message is translated to the user language.
268
- **Note**: when user is trying to buy the item, the response from server can return custom error messages that can be shown to the user as well
269
- */
270
- limit_message: string;
271
- /** The priority of the store item. Can be used to sort the items in the store */
272
- priority: number;
273
- /** The list of IDs of the related items. Can be used to show the related items in the store */
274
- related_item_ids: number[];
275
- /** The indicator if the user can buy the item
276
- * This indicator is taking into account the segment conditions for the store item, the price of item towards users balance,
277
- */
278
- can_buy: boolean;
279
- /** The list of IDs of the categories where the store item is assigned, information about categories can be retrievend with getStoreCategories method */
280
- category_ids: number[];
281
- }
282
- /**
283
- * TMissionOrBadge describes the information of mission or badge defined in the system
284
- */
285
- export interface TMissionOrBadge {
286
- /** ID of the mission or badge */
287
- id: number;
288
- /** Type of entity. Can be 'mission' or 'badge' */
289
- type: 'mission' | 'badge';
290
- /** Name of the mission or badge, translated to the user language */
291
- name: string;
292
- /** Description of the mission or badge, translated to the user language */
293
- description: string;
294
- /** Description of the mission reward if defined */
295
- reward: string;
296
- /** URL of the image of the mission or badge */
297
- image: string;
298
- /** Indicator if the mission is completed or badge is granted */
299
- is_completed: boolean;
300
- /** Indicator if the mission is locked. Means that it's visible to the user, but he cannot progress in it until it's unlocked.
301
- * Mission may optionally contain the explanation of what should be done to unlock it in the unlock_mission_description property
302
- */
303
- is_locked: boolean;
304
- /** Optional explaination of what should be done to unlock the mission */
305
- unlock_mission_description: string;
306
- /** Indicator if the mission requires opt-in. Means that user should explicitly opt-in to the mission in order to start progressing in it */
307
- is_requires_optin: boolean;
308
- /** Indicator if the user opted-in to the mission */
309
- is_opted_in: boolean;
310
- /** The amount of time in milliseconds that user has to complete the mission */
311
- time_limit_ms: number;
312
- /** The date when the mission was started, relevant for the time limited missions */
313
- dt_start: number;
314
- /** The progress of the mission in percents calculated as the aggregated relative percentage of all tasks */
315
- progress: number;
316
- /**
317
- * The action that should be performed when user clicks on the mission or badge
318
- * Can be URL or deep link, e.g. 'dp:deposit'. The most safe to execute CTA is to pass it to _smartico.do(cta_action);
319
- * The 'dp' function will handle the CTA and will execute it in the most safe way
320
- */
321
- cta_action: string;
322
- /** The text of the CTA button, e.g. 'Make a deposit' */
323
- cta_text: string;
324
- /**
325
- * The ID of the custom section where the mission or badge is assigned
326
- * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method (TODO-API)
327
- */
328
- custom_section_id: number;
329
- /** The indicator if the mission or badge is visible only in the custom section and should be hidden from the main overview of missions/badges */
330
- only_in_custom_section: boolean;
331
- /** The custom data of the mission or badge defined by operator. Can be a JSON object, string or number */
332
- custom_data: any;
333
- /** The list of tasks of the mission or badge */
334
- tasks: TMissionOrBadgeTask[];
335
- }
336
- /**
337
- * TMissionOrBadgeTask describes the information of tasks that belings to mission or badge. See also TMissionOrBadge
338
- */
339
- export interface TMissionOrBadgeTask {
340
- /** ID of the task */
341
- id: number;
342
- /** Name of the task, translated to the user language */
343
- name: string;
344
- /** Indicator if the task is completed */
345
- is_completed: boolean;
346
- /** The progress of the task in percents */
347
- progress: number;
348
- /** Reward for completing the task in points */
349
- points_reward: number;
350
- }
351
- /**
352
- * TMissionOptInResult describes the response of call to _smartico.api.requestMissionOptIn(mission_id) method
353
- */
354
- export interface TMissionOptInResult {
355
- /** Error code that represents outcome of the opt-in request. Successful opt-in in case err_code is 0 */
356
- err_code: number;
357
- /** Optional error message */
358
- err_message: string;
359
- }
360
- export interface TTournamentRegistrationResult {
361
- /** Error code that represents outcome of the tournament registration request. Successful registration in case err_code is 0 */
362
- err_code: TournamentRegistrationError;
363
- /** Optional error message */
364
- err_message: string;
365
- }
366
- export interface TBuyStoreItemResult {
367
- /** Error code representing the result of the purchase of the shop item. Successful purchase if err_code is 0 */
368
- err_code: BuyStoreItemErrorCode;
369
- /** Optional error message */
370
- err_message: string;
371
- }
372
- export interface TGetTranslations {
373
- translations: {
374
- [key: string]: string;
375
- };
376
- }
377
- export {};
1
+ import { BuyStoreItemErrorCode } from "../Store";
2
+ import { MiniGamePrizeTypeName, SAWBuyInTypeName, SAWGameTypeName, SAWSpinErrorCode } from "../MiniGames";
3
+ import { TournamentRegistrationError, TournamentRegistrationStatusName, TournamentRegistrationTypeName } from "../Tournaments";
4
+ type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
5
+ /**
6
+ * TMiniGamePrize describes the information of prize in the array of prizes in the TMiniGameTemplate
7
+ */
8
+ export interface TMiniGamePrize {
9
+ /** ID of the prize */
10
+ id: number;
11
+ /** The visual name of the prize */
12
+ name: string;
13
+ /** The type of the prize, no-prize, points, bonus, manual, spin, jackpot */
14
+ prize_type: MiniGamePrizeTypeName;
15
+ /** Numeric value of the prize in case it's pints or spin type */
16
+ prize_value?: number;
17
+ /** Custom font size for the prize */
18
+ font_size?: number;
19
+ /** The URL of the icon of the prize */
20
+ icon?: string;
21
+ }
22
+ /**
23
+ * TMiniGamePlayResult describes the response of call to _smartico.api.playMiniGame(template_id) method
24
+ */
25
+ export interface TMiniGamePlayResult {
26
+ /** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
27
+ err_code: SAWSpinErrorCode;
28
+ /** Optional error message */
29
+ err_message: string;
30
+ /** The prize_id that user won, details of the prize can be found in the mini-game definition */
31
+ prize_id: number;
32
+ }
33
+ /**
34
+ * TMiniGameTemplate describes the information of mini-games available for the user
35
+ */
36
+ export interface TMiniGameTemplate {
37
+ /** ID of the mini-game template */
38
+ id: number;
39
+ /** Name of the mini-game template, translated to the user language */
40
+ name: string;
41
+ /** Description of the mini-game template, translated to the user language */
42
+ description: string;
43
+ /** URL of the icon of the mini-game template */
44
+ thumbnail: string;
45
+ /** The type of the game, e.g. Spin the Wheel, Gift Box, Scratch card, MatchX etc */
46
+ saw_game_type: SAWGameTypeName;
47
+ /** How the user is charged for each game attempt e.g. Free, Points or Spin attempts */
48
+ saw_buyin_type: SAWBuyInTypeName;
49
+ /** in case of charging type 'Points', what is the points amount will be deducted from user balance */
50
+ buyin_cost_points: number;
51
+ /** in case of charging type 'Spin attempts', shows the current number of spin attempts that user has */
52
+ spin_count?: number;
53
+ /** if the game is limit to the number of spins that user can do during period of time, this property shows the epoch time in UTC when the next attempt will be available */
54
+ next_available_spin_ts: number;
55
+ /** The message that should be shown to the user when he cannot play the game, server rejected attempt with error code SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED */
56
+ over_limit_message: string;
57
+ /** The message that should be shown to the user when he cannot play the game because he doesn't have spin attempts or points. */
58
+ no_attempts_message: string;
59
+ /** Current jackpont amount, if jackpot is enabled. */
60
+ jackpot_current: number;
61
+ /** 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. */
62
+ jackpot_add_on_attempt: number;
63
+ /** The symbol of jackpot that is giving the sense to the 'amount' E.g. the symbol could be EUR and connected to the amount it can indicate that amount is monetary, e.g. '100 EUR'. Or the symbol can be 'Free spins' and connected to the amount it can indicate that amount is number of free spins, e.g. '100 Free spins'.
64
+ */
65
+ jackpot_symbol: string;
66
+ prizes: TMiniGamePrize[];
67
+ }
68
+ /**
69
+ * TUser describes the information of the user
70
+ * The user object is returned by _smartico.api.getUserProfile() method.
71
+ * If you want to track the changes of the user profile, you can subscribe to the callback in the following way
72
+ * _smartico.on('props_change', () => console.log(_smartico.api.getUserProfile()) );
73
+ */
74
+ export interface TUserProfile {
75
+ /** The language of the user */
76
+ core_user_language: string;
77
+ /** The current points balance that user can use in the Store, Mini-games, Tournaments, etc.. */
78
+ ach_points_balance: number;
79
+ /** The amount of points that user collected in total */
80
+ ach_points_ever: number;
81
+ /**
82
+ * The array of the public tags set on the user object.
83
+ * They can be treated as server-based cookies.
84
+ * You can set tags using following method _smartico.event('core_public_tags_update', { core_public_tags: ['A', 'B'] } );
85
+ * And then you can check for the tags
86
+ */
87
+ core_public_tags: string[];
88
+ /** The ID of the current level of the user */
89
+ ach_level_current_id?: number;
90
+ /** The indicator if user is marked as test user */
91
+ core_is_test_account?: boolean;
92
+ /** The URL to the user avatar */
93
+ avatar_url?: string;
94
+ /** The username of current user */
95
+ public_username?: string;
96
+ /** THe number of unread inbox messages */
97
+ core_inbox_unread_count?: number;
98
+ }
99
+ /**
100
+ * TLevel describes the information of each level defined in the system
101
+ * There is no order of the levels, but it can be calculated using required_points property
102
+ * The current level of user can be taken from the user object using ach_level_current_id property
103
+ * The progress to the next level can be calculated using ach_points_ever and required_points properties of next level
104
+ */
105
+ export interface TLevel {
106
+ /** The ID of the Level */
107
+ id: number;
108
+ /** The name of the Level, translated to the user language */
109
+ name: string;
110
+ /** The description of the Level, translated to the user language */
111
+ description: string;
112
+ /** The URL of the image of the Level */
113
+ image: string;
114
+ /** The amount of points required to reach the Level */
115
+ required_points: number;
116
+ /** Number of points that user should collect in order to see this level */
117
+ visibility_points: number;
118
+ /**
119
+ * The counter of 1st metric used to reach the Level.
120
+ * Relevant in case of using advanced leveling logic
121
+ * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
122
+ *
123
+ */
124
+ required_level_counter_1: number;
125
+ /**
126
+ * The counter of 2nd metric used to reach the Level.
127
+ * Relevant in case of using advanced leveling logic
128
+ * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
129
+ *
130
+ */
131
+ required_level_counter_2: number;
132
+ }
133
+ /**
134
+ * TTournament describes the general information of the tournament item
135
+ */
136
+ export interface TTournament {
137
+ /** ID of tournament instance. Generated every time when tournament based on specific template is scheduled for run */
138
+ instance_id: number;
139
+ /** ID of tournament template */
140
+ tournament_id: number;
141
+ /** Name of the tournament, translated to the user language */
142
+ name: string;
143
+ /** Description of the tournament, translated to the user language */
144
+ description: string;
145
+ image1: string;
146
+ image2: string;
147
+ prize_pool_short: string;
148
+ custom_price_text: string;
149
+ /** The message that should be shown to the user when the user cannot register in tournament with error code TOURNAMENT_USER_DONT_MATCH_CONDITIONS */
150
+ segment_dont_match_message: string;
151
+ /**
152
+ * The ID of the custom section where the tournament is assigned
153
+ * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method (TODO-API)
154
+ */
155
+ custom_section_id: number;
156
+ /** The custom data of the tournament defined by operator. Can be a JSON object, string or number */
157
+ custom_data: any;
158
+ /** The indicator if the tournament is 'Featured' */
159
+ is_featured: boolean;
160
+ /** The ribbon of the tournament item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon */
161
+ ribbon: TRibbon;
162
+ /** The time when tournament is going to start, epoch with milliseconds */
163
+ start_time: number;
164
+ /** The time when tournament is going to finish, epoch with milliseconds */
165
+ end_time: number;
166
+ /** Type of registration in the tournament */
167
+ registration_type: TournamentRegistrationTypeName;
168
+ /** Number of users registered in the tournament */
169
+ registration_count: number;
170
+ /** flag indicating if current user is registered in the tournament */
171
+ is_user_registered: boolean;
172
+ /** Minimum number of participant for this tournament. If tournament doesnt have enough registrations, it will not start */
173
+ players_min_count: number;
174
+ /** Maximum number of participant for this tournament. When reached, new users won't be able to register */
175
+ players_max_count: number;
176
+ /** Status of registration in the tournament for current user */
177
+ registration_status: TournamentRegistrationStatusName;
178
+ /** Tournament duration in millisecnnds */
179
+ duration_ms: number;
180
+ /** Cost of registration in the tournament in gamification points */
181
+ registration_cost_points: number;
182
+ /** Indicator if tournament instance is active, means in one of the statues - PUBLISHED, REGISTED, STARTED */
183
+ is_active: boolean;
184
+ /** Indicator if user can register in this tournament instance, e.g tournament is active, max users is not reached, user is not registered yet */
185
+ is_can_register: boolean;
186
+ /** Indicator if tournament instance is cancelled (status CANCELLED) */
187
+ is_cancelled: boolean;
188
+ /** Indicator if tournament instance is finished (status FINISHED, CANCELLED OR FINIALIZING) */
189
+ is_finished: boolean;
190
+ /** Indicator if tournament instance is running (status STARTED) */
191
+ is_in_progress: boolean;
192
+ /** Indicator if tournament instance is upcoming (status PUBLISHED or REGISTER) */
193
+ is_upcoming: boolean;
194
+ }
195
+ /**
196
+ * TTournamentDetailed describes the information of the tournament item and includes list of participants, their scores and position in the tournament leaderboard
197
+ */
198
+ export interface TTournamentDetailed extends TTournament {
199
+ /** The list of the tournament participants */
200
+ players?: {
201
+ /** The username of the participant */
202
+ public_username: string;
203
+ /** The URL to the avatar of the participant */
204
+ avatar_url: string;
205
+ /** The position of the participant in the tournament */
206
+ position: number;
207
+ /** The scores of the participant in the tournament */
208
+ scores: number;
209
+ /** The indicator if the participant is current user */
210
+ is_me: boolean;
211
+ }[];
212
+ /** The information about current user in the tournament if he is registered in the tournamnet */
213
+ me?: {
214
+ /** The username of the current user */
215
+ public_username: string;
216
+ /** The URL to the avatar of the current user */
217
+ avatar_url: string;
218
+ /** The position of the current user in the tournament */
219
+ position: number;
220
+ /** The scores of the current user in the tournament */
221
+ scores: number;
222
+ };
223
+ prizes?: {
224
+ /** The name of the prize */
225
+ name: string;
226
+ /** The description of the prize */
227
+ description: string;
228
+ /** The image of the prize */
229
+ image_url: string;
230
+ /** from-to range of the places to which this prize */
231
+ place_from: number;
232
+ place_to: number;
233
+ /** type of the prize: TANGIBLE, POINTS_ADD, POINTS_DEDUCT, POINTS_RESET, MINI_GAME_ATTEMPT, BONUS */
234
+ type: string;
235
+ /** if the prize is points related, indicates amount of points */
236
+ points?: number;
237
+ }[];
238
+ }
239
+ /**
240
+ * TStoreCategory describes the store category item. Each store item can be assigned to 1 or more categories
241
+ */
242
+ export interface TStoreCategory {
243
+ id: number;
244
+ name: string;
245
+ order: number;
246
+ }
247
+ /**
248
+ * TStoreItem describes the information of the store item defined in the system
249
+ */
250
+ export interface TStoreItem {
251
+ /** ID of the store item */
252
+ id: number;
253
+ /** Name of the store item, translated to the user language */
254
+ name: string;
255
+ /** Description of the store item, translated to the user language */
256
+ description: string;
257
+ /** URL of the image of the store item */
258
+ image: string;
259
+ /** Type of the store item. Can be 'bonus' or 'manual'. Manual, means it's tangible item, e.g. iPhone */
260
+ type: 'bonus' | 'manual';
261
+ /** The price of the store item in the gamification points */
262
+ price: number;
263
+ /** The ribbon of the store item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon */
264
+ ribbon: TRibbon;
265
+ /**
266
+ * The message that should be shown to the user if he is not eligible to buy it. this message can be used to explain the reason why user cannot buy the item, e.g. 'You should be VIP to buy this item' and can be used in case can_buy property is false.
267
+ The message is translated to the user language.
268
+ **Note**: when user is trying to buy the item, the response from server can return custom error messages that can be shown to the user as well
269
+ */
270
+ limit_message: string;
271
+ /** The priority of the store item. Can be used to sort the items in the store */
272
+ priority: number;
273
+ /** The list of IDs of the related items. Can be used to show the related items in the store */
274
+ related_item_ids: number[];
275
+ /** The indicator if the user can buy the item
276
+ * This indicator is taking into account the segment conditions for the store item, the price of item towards users balance,
277
+ */
278
+ can_buy: boolean;
279
+ /** The list of IDs of the categories where the store item is assigned, information about categories can be retrievend with getStoreCategories method */
280
+ category_ids: number[];
281
+ }
282
+ /**
283
+ * TMissionOrBadge describes the information of mission or badge defined in the system
284
+ */
285
+ export interface TMissionOrBadge {
286
+ /** ID of the mission or badge */
287
+ id: number;
288
+ /** Type of entity. Can be 'mission' or 'badge' */
289
+ type: 'mission' | 'badge';
290
+ /** Name of the mission or badge, translated to the user language */
291
+ name: string;
292
+ /** Description of the mission or badge, translated to the user language */
293
+ description: string;
294
+ /** Description of the mission reward if defined */
295
+ reward: string;
296
+ /** URL of the image of the mission or badge */
297
+ image: string;
298
+ /** Indicator if the mission is completed or badge is granted */
299
+ is_completed: boolean;
300
+ /** Indicator if the mission is locked. Means that it's visible to the user, but he cannot progress in it until it's unlocked.
301
+ * Mission may optionally contain the explanation of what should be done to unlock it in the unlock_mission_description property
302
+ */
303
+ is_locked: boolean;
304
+ /** Optional explaination of what should be done to unlock the mission */
305
+ unlock_mission_description: string;
306
+ /** Indicator if the mission requires opt-in. Means that user should explicitly opt-in to the mission in order to start progressing in it */
307
+ is_requires_optin: boolean;
308
+ /** Indicator if the user opted-in to the mission */
309
+ is_opted_in: boolean;
310
+ /** The amount of time in milliseconds that user has to complete the mission */
311
+ time_limit_ms: number;
312
+ /** The date when the mission was started, relevant for the time limited missions */
313
+ dt_start: number;
314
+ /** The progress of the mission in percents calculated as the aggregated relative percentage of all tasks */
315
+ progress: number;
316
+ /**
317
+ * The action that should be performed when user clicks on the mission or badge
318
+ * Can be URL or deep link, e.g. 'dp:deposit'. The most safe to execute CTA is to pass it to _smartico.do(cta_action);
319
+ * The 'dp' function will handle the CTA and will execute it in the most safe way
320
+ */
321
+ cta_action: string;
322
+ /** The text of the CTA button, e.g. 'Make a deposit' */
323
+ cta_text: string;
324
+ /**
325
+ * The ID of the custom section where the mission or badge is assigned
326
+ * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method (TODO-API)
327
+ */
328
+ custom_section_id: number;
329
+ /** The indicator if the mission or badge is visible only in the custom section and should be hidden from the main overview of missions/badges */
330
+ only_in_custom_section: boolean;
331
+ /** The custom data of the mission or badge defined by operator. Can be a JSON object, string or number */
332
+ custom_data: any;
333
+ /** The list of tasks of the mission or badge */
334
+ tasks: TMissionOrBadgeTask[];
335
+ }
336
+ /**
337
+ * TMissionOrBadgeTask describes the information of tasks that belings to mission or badge. See also TMissionOrBadge
338
+ */
339
+ export interface TMissionOrBadgeTask {
340
+ /** ID of the task */
341
+ id: number;
342
+ /** Name of the task, translated to the user language */
343
+ name: string;
344
+ /** Indicator if the task is completed */
345
+ is_completed: boolean;
346
+ /** The progress of the task in percents */
347
+ progress: number;
348
+ /** Reward for completing the task in points */
349
+ points_reward: number;
350
+ }
351
+ /**
352
+ * TMissionOptInResult describes the response of call to _smartico.api.requestMissionOptIn(mission_id) method
353
+ */
354
+ export interface TMissionOptInResult {
355
+ /** Error code that represents outcome of the opt-in request. Successful opt-in in case err_code is 0 */
356
+ err_code: number;
357
+ /** Optional error message */
358
+ err_message: string;
359
+ }
360
+ export interface TTournamentRegistrationResult {
361
+ /** Error code that represents outcome of the tournament registration request. Successful registration in case err_code is 0 */
362
+ err_code: TournamentRegistrationError;
363
+ /** Optional error message */
364
+ err_message: string;
365
+ }
366
+ export interface TBuyStoreItemResult {
367
+ /** Error code representing the result of the purchase of the shop item. Successful purchase if err_code is 0 */
368
+ err_code: BuyStoreItemErrorCode;
369
+ /** Optional error message */
370
+ err_message: string;
371
+ }
372
+ export interface TGetTranslations {
373
+ translations: {
374
+ [key: string]: string;
375
+ };
376
+ }
377
+ export {};