@smartico/public-api 0.0.378 → 0.0.380
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/.nvmrc +1 -1
- package/README.md +31 -2
- package/dist/Store/BuyStoreItemErrorCode.d.ts +9 -1
- package/dist/Tournaments/TournamentRegistrationError.d.ts +3 -1
- package/dist/WSAPI/WSAPI.d.ts +13 -1235
- package/dist/WSAPI/WSAPIAvatars.d.ts +78 -0
- package/dist/WSAPI/WSAPIBase.d.ts +71 -0
- package/dist/WSAPI/WSAPIBonuses.d.ts +26 -0
- package/dist/WSAPI/WSAPIClans.d.ts +388 -0
- package/dist/WSAPI/WSAPIGamePick.d.ts +308 -0
- package/dist/WSAPI/WSAPIGeneral.d.ts +30 -0
- package/dist/WSAPI/WSAPIInbox.d.ts +126 -0
- package/dist/WSAPI/WSAPIJackpots.d.ts +109 -0
- package/dist/WSAPI/WSAPILeaderBoard.d.ts +25 -0
- package/dist/WSAPI/WSAPIMiniGames.d.ts +94 -0
- package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
- package/dist/WSAPI/WSAPIRaffles.d.ts +119 -0
- package/dist/WSAPI/WSAPIStore.d.ts +656 -0
- package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
- package/dist/WSAPI/WSAPITypes.d.ts +145 -85
- package/dist/WSAPI/WSAPIUser.d.ts +383 -0
- package/dist/index.js +3818 -1528
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +3180 -981
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +56 -2
- package/docs/api/classes/WSAPIAvatars.md +116 -0
- package/docs/api/classes/WSAPIBonuses.md +50 -0
- package/docs/api/classes/WSAPIClans.md +66 -0
- package/docs/api/classes/WSAPIGamePick.md +181 -0
- package/docs/api/classes/WSAPIGeneral.md +63 -0
- package/docs/api/classes/WSAPIInbox.md +277 -0
- package/docs/api/classes/WSAPIJackpots.md +185 -0
- package/docs/api/classes/WSAPILeaderBoard.md +39 -0
- package/docs/api/classes/WSAPIMiniGames.md +175 -0
- package/docs/api/classes/WSAPIMissions.md +611 -0
- package/docs/api/classes/WSAPIRaffles.md +195 -0
- package/docs/api/classes/WSAPIStore.md +744 -0
- package/docs/api/classes/WSAPITournaments.md +104 -0
- package/docs/api/classes/WSAPIUser.md +200 -0
- package/docs/api/enumerations/AchievementClaimPeriodTypeId.md +13 -0
- package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -0
- package/docs/api/interfaces/ClanPrizePublicMeta.md +41 -0
- package/docs/api/interfaces/ClanPrizeStructureEntry.md +7 -1
- package/docs/api/interfaces/ClanPublicMeta.md +4 -0
- package/docs/api/interfaces/SAWTemplateUI.md +10 -0
- package/docs/api/interfaces/TAchCategory.md +19 -4
- package/docs/api/interfaces/TBuyStoreItemResult.md +26 -8
- package/docs/api/interfaces/TMissionClaimRewardResult.md +14 -3
- package/docs/api/interfaces/TMissionOptInResult.md +10 -3
- package/docs/api/interfaces/TMissionOrBadge.md +6 -2
- package/docs/api/interfaces/TStoreItem.md +21 -1
- package/docs/api/interfaces/TTournamentDetailed.md +8 -0
- package/docs/api/interfaces/UserAchievement.md +1 -1
- package/docs/ui/clans/UIGuide_getClanInfo.md +153 -0
- package/docs/ui/clans/UIGuide_getClans.md +172 -0
- package/docs/ui/clans/UIGuide_joinClan.md +196 -0
- package/docs/ui/missions/UIGuide_getAchCategories.md +17 -0
- package/docs/ui/missions/UIGuide_getBadges.md +237 -0
- package/docs/ui/missions/UIGuide_getMissions.md +268 -0
- package/docs/ui/missions/UIGuide_requestMissionClaimReward.md +21 -0
- package/docs/ui/missions/UIGuide_requestMissionOptIn.md +16 -0
- package/docs/ui/store/UIGuide_buyStoreItem.md +133 -0
- package/docs/ui/store/UIGuide_getStoreCategories.md +19 -0
- package/docs/ui/store/UIGuide_getStoreItems.md +264 -0
- package/docs/ui/store/UIGuide_getStorePurchasedItems.md +122 -0
- package/docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md +140 -0
- package/docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md +265 -0
- package/docs/ui/tournaments/UIGuide_getTournamentsList.md +236 -0
- package/docs/ui/tournaments/UIGuide_registerInTournament.md +156 -0
- package/docs/ui/user/UIGuide_getLevels.md +162 -0
- package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
- package/package.json +3 -3
- package/scripts/postdoc-cleanup.js +195 -0
- package/src/Missions/MissionsUtils.ts +5 -2
- package/src/Store/BuyStoreItemErrorCode.ts +8 -0
- package/src/Store/StoreItem.ts +1 -0
- package/src/Store/StoreItemPurchased.ts +1 -0
- package/src/Store/StoreItemType.ts +1 -1
- package/src/Tournaments/TournamentRegistrationError.ts +4 -0
- package/src/WSAPI/WSAPI.ts +27 -2007
- package/src/WSAPI/WSAPIAvatars.ts +127 -0
- package/src/WSAPI/WSAPIBase.ts +93 -0
- package/src/WSAPI/WSAPIBonuses.ts +54 -0
- package/src/WSAPI/WSAPIClans.ts +417 -0
- package/src/WSAPI/WSAPIGamePick.ts +382 -0
- package/src/WSAPI/WSAPIGeneral.ts +57 -0
- package/src/WSAPI/WSAPIInbox.ts +222 -0
- package/src/WSAPI/WSAPIJackpots.ts +212 -0
- package/src/WSAPI/WSAPILeaderBoard.ts +40 -0
- package/src/WSAPI/WSAPIMiniGames.ts +181 -0
- package/src/WSAPI/WSAPIMissions.ts +572 -0
- package/src/WSAPI/WSAPIRaffles.ts +175 -0
- package/src/WSAPI/WSAPIStore.ts +732 -0
- package/src/WSAPI/WSAPITournaments.ts +541 -0
- package/src/WSAPI/WSAPITypes.ts +145 -87
- package/src/WSAPI/WSAPIUser.ts +456 -0
- package/tsconfig.json +17 -1
- package/docs/api/classes/WSAPI.md +0 -1927
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { GamesApiResponse, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamePickGameInfo, GamePickRequestParams, GamePickRoundRequestParams } from './WSAPITypes';
|
|
2
|
+
import { WSAPIAvatars } from './WSAPIAvatars';
|
|
3
|
+
/** @group GamePick */
|
|
4
|
+
export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the active rounds for the specified MatchX or Quiz game.
|
|
7
|
+
* Each round includes its events (matches/questions) along with the current user's selections and scores.
|
|
8
|
+
*
|
|
9
|
+
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
10
|
+
*
|
|
11
|
+
* **Response** `GamesApiResponse<GamePickRound[]>`:
|
|
12
|
+
* - `errCode` - 0 on success
|
|
13
|
+
* - `data` - Array of rounds, each containing:
|
|
14
|
+
* - `round_id`, `round_name` - Round identifier and display name
|
|
15
|
+
* - `open_date`, `last_bet_date` - Timestamps (ms) for round open and betting deadline
|
|
16
|
+
* - `is_active_now`, `is_resolved` - Round state flags
|
|
17
|
+
* - `round_status_id` - Round status: -1 (active), 2 (no more bets), 3 (all events resolved), 4 (round resolved)
|
|
18
|
+
* - `score_full_win`, `score_part_win`, `score_lost` - Scoring rules per prediction outcome
|
|
19
|
+
* - `user_score` - Current user's total score in this round
|
|
20
|
+
* - `user_placed_bet` - Whether the user has submitted predictions
|
|
21
|
+
* - `has_open_for_bet_events` - Whether there are events still open for betting
|
|
22
|
+
* - `events[]` - Array of events with `gp_event_id`, `market_type_id`, `event_meta` (team names, images, sport), `match_date`, `is_open_for_bets`, `odds_details`, and user selection fields
|
|
23
|
+
*
|
|
24
|
+
* **Example**:
|
|
25
|
+
* ```
|
|
26
|
+
* _smartico.api.gamePickGetActiveRounds({
|
|
27
|
+
* saw_template_id: 1083,
|
|
28
|
+
* }).then((result) => {
|
|
29
|
+
* console.log(result.data); // GamePickRound[]
|
|
30
|
+
* result.data.forEach(round => {
|
|
31
|
+
* console.log(round.round_name, round.events.length);
|
|
32
|
+
* });
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* **Visitor mode: not supported**
|
|
37
|
+
*/
|
|
38
|
+
gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a single active round for the specified MatchX or Quiz game.
|
|
41
|
+
* The round includes full event details with the current user's selections.
|
|
42
|
+
*
|
|
43
|
+
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
44
|
+
* @param props.round_id - The specific round to retrieve
|
|
45
|
+
*
|
|
46
|
+
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
47
|
+
* - `errCode` - 0 on success
|
|
48
|
+
* - `data` - Single round object with the same structure as in `gamePickGetActiveRounds`,
|
|
49
|
+
* including `events[]` with full event details, user selections, and resolution info
|
|
50
|
+
*
|
|
51
|
+
* **Example**:
|
|
52
|
+
* ```
|
|
53
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
54
|
+
* saw_template_id: 1083,
|
|
55
|
+
* round_id: 31652,
|
|
56
|
+
* }).then((result) => {
|
|
57
|
+
* console.log(result.data.round_name, result.data.events.length);
|
|
58
|
+
* console.log(result.data.user_score, result.data.user_placed_bet);
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* **Visitor mode: not supported**
|
|
63
|
+
*/
|
|
64
|
+
gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>>;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the history of all rounds (including resolved ones) for the specified MatchX or Quiz game.
|
|
67
|
+
* Each round contains full event details with results and the current user's predictions.
|
|
68
|
+
*
|
|
69
|
+
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
70
|
+
*
|
|
71
|
+
* **Response** `GamesApiResponse<GamePickRound[]>`:
|
|
72
|
+
* - `errCode` - 0 on success
|
|
73
|
+
* - `data` - Array of rounds ordered by `round_row_id` descending (newest first).
|
|
74
|
+
* Each round has the same structure as in `gamePickGetActiveRounds`, including resolved events
|
|
75
|
+
* with `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) and `resolution_score`
|
|
76
|
+
*
|
|
77
|
+
* **Example**:
|
|
78
|
+
* ```
|
|
79
|
+
* _smartico.api.gamePickGetHistory({
|
|
80
|
+
* saw_template_id: 1083,
|
|
81
|
+
* }).then((result) => {
|
|
82
|
+
* result.data.forEach(round => {
|
|
83
|
+
* console.log(round.round_name, 'Score:', round.user_score, 'Resolved:', round.is_resolved);
|
|
84
|
+
* });
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* **Visitor mode: not supported**
|
|
89
|
+
*/
|
|
90
|
+
gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the leaderboard for a specific round within a MatchX or Quiz game.
|
|
93
|
+
* Use `round_id = -1` (AllRoundsGameBoardID) to get the season/overall leaderboard across all rounds.
|
|
94
|
+
*
|
|
95
|
+
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
96
|
+
* @param props.round_id - The round to get the leaderboard for. Use -1 for overall/seasonal leaderboard
|
|
97
|
+
*
|
|
98
|
+
* **Response** `GamesApiResponse<GamePickRoundBoard>`:
|
|
99
|
+
* - `errCode` - 0 on success
|
|
100
|
+
* - `data` - Leaderboard object containing:
|
|
101
|
+
* - Round base fields (`round_id`, `round_name`, `open_date`, `last_bet_date`, etc.)
|
|
102
|
+
* - `users[]` - Ranked list of players, each with:
|
|
103
|
+
* - `ext_user_id`, `int_user_id` - User identifiers
|
|
104
|
+
* - `public_username`, `avatar_url` - Display info (usernames may be masked based on label settings)
|
|
105
|
+
* - `gp_position` - Leaderboard rank (null if not yet ranked)
|
|
106
|
+
* - `resolution_score` - Total score in this round
|
|
107
|
+
* - `full_wins_count`, `part_wins_count`, `lost_count` - Prediction outcome counts
|
|
108
|
+
* - `my_user` - Current user's entry (same fields as above), or null if user hasn't participated
|
|
109
|
+
*
|
|
110
|
+
* **Example**:
|
|
111
|
+
* ```
|
|
112
|
+
* _smartico.api.gamePickGetBoard({
|
|
113
|
+
* saw_template_id: 1083,
|
|
114
|
+
* round_id: 31652,
|
|
115
|
+
* }).then((result) => {
|
|
116
|
+
* console.log('Top players:', result.data.users);
|
|
117
|
+
* console.log('My position:', result.data.my_user?.gp_position);
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* **Visitor mode: not supported**
|
|
122
|
+
*/
|
|
123
|
+
gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>>;
|
|
124
|
+
/**
|
|
125
|
+
* Submits score predictions for a round in a MatchX game.
|
|
126
|
+
* Sends the round object with user selections for all events at once.
|
|
127
|
+
* Each event must include `team1_user_selection` and `team2_user_selection` representing predicted scores.
|
|
128
|
+
* If the user hasn't placed bets before, one game attempt (spin) will be consumed.
|
|
129
|
+
* Predictions can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
|
|
130
|
+
*
|
|
131
|
+
* @param props.saw_template_id - The ID of the MatchX game template
|
|
132
|
+
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
|
|
133
|
+
* and modified with user predictions. Each event needs: `gp_event_id`, `team1_user_selection`, `team2_user_selection`
|
|
134
|
+
*
|
|
135
|
+
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
136
|
+
* - `errCode` - 0 on success. Non-zero codes indicate errors (e.g. not enough points/attempts)
|
|
137
|
+
* - `data` - Updated round with all events reflecting the submitted selections.
|
|
138
|
+
* `user_placed_bet` will be `true`, `has_not_submitted_changes` will be `false`
|
|
139
|
+
*
|
|
140
|
+
* **Example**:
|
|
141
|
+
* ```
|
|
142
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
143
|
+
* saw_template_id: 1190,
|
|
144
|
+
* round_id: 38665,
|
|
145
|
+
* }).then((roundData) => {
|
|
146
|
+
* const round = roundData.data;
|
|
147
|
+
* round.events = round.events.map(e => ({
|
|
148
|
+
* gp_event_id: e.gp_event_id,
|
|
149
|
+
* team1_user_selection: 1,
|
|
150
|
+
* team2_user_selection: 0,
|
|
151
|
+
* }));
|
|
152
|
+
* _smartico.api.gamePickSubmitSelection({
|
|
153
|
+
* saw_template_id: 1190,
|
|
154
|
+
* round: round,
|
|
155
|
+
* }).then((result) => {
|
|
156
|
+
* console.log(result.data.user_placed_bet); // true
|
|
157
|
+
* });
|
|
158
|
+
* });
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
* **Visitor mode: not supported**
|
|
162
|
+
*/
|
|
163
|
+
gamePickSubmitSelection(props: GamePickRequestParams & {
|
|
164
|
+
round: Partial<GamePickRound>;
|
|
165
|
+
}): Promise<GamesApiResponse<GamePickRound>>;
|
|
166
|
+
/**
|
|
167
|
+
* Submits answers for a round in a Quiz game.
|
|
168
|
+
* Sends the round object with user answers for all events at once.
|
|
169
|
+
* Each event must include `user_selection` with the answer value (e.g. '1', '2', 'x', 'yes', 'no' — depending on the market type).
|
|
170
|
+
* If the user hasn't placed bets before, one game attempt (spin) will be consumed.
|
|
171
|
+
* Answers can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
|
|
172
|
+
*
|
|
173
|
+
* @param props.saw_template_id - The ID of the Quiz game template
|
|
174
|
+
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
|
|
175
|
+
* and modified with user answers. Each event needs: `gp_event_id`, `user_selection`
|
|
176
|
+
*
|
|
177
|
+
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
178
|
+
* - `errCode` - 0 on success. Non-zero codes indicate errors (e.g. not enough points/attempts)
|
|
179
|
+
* - `data` - Updated round with all events reflecting the submitted answers.
|
|
180
|
+
* `user_placed_bet` will be `true`, `has_not_submitted_changes` will be `false`
|
|
181
|
+
*
|
|
182
|
+
* **Example**:
|
|
183
|
+
* ```
|
|
184
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
185
|
+
* saw_template_id: 1183,
|
|
186
|
+
* round_id: 37974,
|
|
187
|
+
* }).then((roundData) => {
|
|
188
|
+
* const round = roundData.data;
|
|
189
|
+
* round.events = round.events.map(e => ({
|
|
190
|
+
* gp_event_id: e.gp_event_id,
|
|
191
|
+
* user_selection: 'x',
|
|
192
|
+
* }));
|
|
193
|
+
* _smartico.api.gamePickSubmitSelectionQuiz({
|
|
194
|
+
* saw_template_id: 1183,
|
|
195
|
+
* round: round,
|
|
196
|
+
* }).then((result) => {
|
|
197
|
+
* console.log(result.data.user_placed_bet); // true
|
|
198
|
+
* });
|
|
199
|
+
* });
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
202
|
+
* **Visitor mode: not supported**
|
|
203
|
+
*/
|
|
204
|
+
gamePickSubmitSelectionQuiz(props: GamePickRequestParams & {
|
|
205
|
+
round: Partial<GamePickRound>;
|
|
206
|
+
}): Promise<GamesApiResponse<GamePickRound>>;
|
|
207
|
+
/**
|
|
208
|
+
* Returns the current user's profile information within the specified MatchX or Quiz game.
|
|
209
|
+
* The user record is synced from the Smartico platform into the games DB (synced every 1 minute).
|
|
210
|
+
* If the user doesn't exist in the games DB yet, it will be created automatically on first call.
|
|
211
|
+
*
|
|
212
|
+
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
213
|
+
*
|
|
214
|
+
* **Response** `GamesApiResponse<GamePickUserInfo>`:
|
|
215
|
+
* - `errCode` - 0 on success
|
|
216
|
+
* - `data`:
|
|
217
|
+
* - `ext_user_id` - External user ID (Smartico internal numeric ID)
|
|
218
|
+
* - `int_user_id` - Internal user ID within the games system
|
|
219
|
+
* - `public_username` - Display name
|
|
220
|
+
* - `avatar_url` - User's avatar image URL
|
|
221
|
+
* - `last_wallet_sync_time` - Last time the user's balance was synced from Smartico
|
|
222
|
+
* - `ach_points_balance` - User's current points balance
|
|
223
|
+
* - `ach_gems_balance` - User's current gems balance
|
|
224
|
+
* - `ach_diamonds_balance` - User's current diamonds balance
|
|
225
|
+
* - `pubic_username_set` - Whether the user has set a custom username
|
|
226
|
+
*
|
|
227
|
+
* **Example**:
|
|
228
|
+
* ```
|
|
229
|
+
* _smartico.api.gamePickGetUserInfo({
|
|
230
|
+
* saw_template_id: 1083,
|
|
231
|
+
* }).then((result) => {
|
|
232
|
+
* console.log(result.data.public_username, result.data.ach_points_balance);
|
|
233
|
+
* });
|
|
234
|
+
* ```
|
|
235
|
+
*
|
|
236
|
+
* **Visitor mode: not supported**
|
|
237
|
+
*/
|
|
238
|
+
gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>>;
|
|
239
|
+
/**
|
|
240
|
+
* Returns the game configuration and the list of all rounds for the specified MatchX or Quiz game.
|
|
241
|
+
* Includes the SAW template definition, label settings, and round metadata (without events).
|
|
242
|
+
*
|
|
243
|
+
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
244
|
+
*
|
|
245
|
+
* **Response** `GamesApiResponse<GamePickGameInfo>`:
|
|
246
|
+
* - `errCode` - 0 on success
|
|
247
|
+
* - `data`:
|
|
248
|
+
* - `sawTemplate` - Game template configuration including:
|
|
249
|
+
* - `saw_template_id`, `saw_game_type_id` (6 = MatchX/Quiz)
|
|
250
|
+
* - `saw_template_ui_definition` - UI settings (name, ranking options, ask_for_username, etc.)
|
|
251
|
+
* - `saw_buyin_type_id` - Cost type (1=Free, 2=Points, 3=Gems, 4=Diamonds, 5=Spins)
|
|
252
|
+
* - `buyin_cost_points` - Cost per attempt
|
|
253
|
+
* - `spin_count` - Available attempts for the current user
|
|
254
|
+
* - `allRounds[]` - List of all rounds (metadata only, no events), each with:
|
|
255
|
+
* - `round_id`, `round_name`, `round_description`
|
|
256
|
+
* - `open_date`, `last_bet_date` - Timestamps (ms)
|
|
257
|
+
* - `is_active_now`, `is_resolved`, `round_status_id`
|
|
258
|
+
* - `labelInfo` - Label/brand configuration and settings
|
|
259
|
+
*
|
|
260
|
+
* **Example**:
|
|
261
|
+
* ```
|
|
262
|
+
* _smartico.api.gamePickGetGameInfo({
|
|
263
|
+
* saw_template_id: 1189,
|
|
264
|
+
* }).then((result) => {
|
|
265
|
+
* console.log(result.data.sawTemplate.saw_template_ui_definition.name);
|
|
266
|
+
* console.log('Rounds:', result.data.allRounds.length);
|
|
267
|
+
* console.log('Buy-in type:', result.data.sawTemplate.saw_buyin_type_id);
|
|
268
|
+
* });
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* **Visitor mode: not supported**
|
|
272
|
+
*/
|
|
273
|
+
gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>>;
|
|
274
|
+
/**
|
|
275
|
+
* Returns round data with events and picks for a specific user (identified by their internal user ID).
|
|
276
|
+
* Useful for viewing another user's predictions from the leaderboard.
|
|
277
|
+
* The `int_user_id` can be obtained from the `gamePickGetBoard` response (`users[].int_user_id`).
|
|
278
|
+
*
|
|
279
|
+
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
280
|
+
* @param props.round_id - The round to get info for
|
|
281
|
+
* @param props.int_user_id - Internal user ID of the player whose predictions to view (from leaderboard data)
|
|
282
|
+
*
|
|
283
|
+
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
284
|
+
* - `errCode` - 0 on success
|
|
285
|
+
* - `data` - Round object with the target user's selections.
|
|
286
|
+
* Same structure as `gamePickGetActiveRound`, but `user_selection`/`team1_user_selection`/`team2_user_selection`
|
|
287
|
+
* fields on events reflect the specified user's picks instead of the current user's.
|
|
288
|
+
* Events also include `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) showing how each prediction was scored
|
|
289
|
+
*
|
|
290
|
+
* **Example**:
|
|
291
|
+
* ```
|
|
292
|
+
* _smartico.api.gamePickGetRoundInfoForUser({
|
|
293
|
+
* saw_template_id: 1083,
|
|
294
|
+
* round_id: 31652,
|
|
295
|
+
* int_user_id: 65653810,
|
|
296
|
+
* }).then((result) => {
|
|
297
|
+
* result.data.events.forEach(e => {
|
|
298
|
+
* console.log(e.event_meta.team1_name, 'vs', e.event_meta.team2_name, '→', e.user_selection);
|
|
299
|
+
* });
|
|
300
|
+
* });
|
|
301
|
+
* ```
|
|
302
|
+
*
|
|
303
|
+
* **Visitor mode: not supported**
|
|
304
|
+
*/
|
|
305
|
+
gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & {
|
|
306
|
+
int_user_id: number;
|
|
307
|
+
}): Promise<GamesApiResponse<GamePickRound>>;
|
|
308
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TGetTranslations, TUICustomSection } from './WSAPITypes';
|
|
2
|
+
import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
|
|
3
|
+
import { WSAPIUser } from './WSAPIUser';
|
|
4
|
+
/** @group General */
|
|
5
|
+
export declare class WSAPIGeneral extends WSAPIUser {
|
|
6
|
+
getCustomSections(): Promise<TUICustomSection[]>;
|
|
7
|
+
/**
|
|
8
|
+
* Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
|
|
9
|
+
*/
|
|
10
|
+
getTranslations(lang_code: string): Promise<TGetTranslations>;
|
|
11
|
+
/**
|
|
12
|
+
* Returns all the related tournaments and missions for the provided game id for the current user
|
|
13
|
+
* The provided Game ID should correspond to the ID from the Games Catalog - https://help.smartico.ai/welcome/technical-guides/games-catalog-api
|
|
14
|
+
*
|
|
15
|
+
* **Example**:
|
|
16
|
+
* ```
|
|
17
|
+
* _smartico.api.getRelatedItemsForGame('gold-slot2').then((result) => {
|
|
18
|
+
* console.log(result);
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* **Example in the Visitor mode**:
|
|
23
|
+
* ```
|
|
24
|
+
* _smartico.vapi('EN').getRelatedItemsForGame('gold-slot2').then((result) => {
|
|
25
|
+
* console.log(result);
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ActivityTypeLimited } from '../Core';
|
|
2
|
+
import { InboxMarkMessageAction, TInboxMessage, TInboxMessageBody } from './WSAPITypes';
|
|
3
|
+
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
4
|
+
import { InboxReadStatus } from '../Inbox/InboxReadStatus';
|
|
5
|
+
import { WSAPILeaderBoard } from './WSAPILeaderBoard';
|
|
6
|
+
/** @group Inbox */
|
|
7
|
+
export declare class WSAPIInbox extends WSAPILeaderBoard {
|
|
8
|
+
/**
|
|
9
|
+
* Reports an impression event for an engagement (when engagement content is displayed to the user).
|
|
10
|
+
* Use this method to track when users view engagement content such as inbox messages, popups.
|
|
11
|
+
* When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType.
|
|
12
|
+
*
|
|
13
|
+
* **Example**:
|
|
14
|
+
* ```
|
|
15
|
+
* _smartico.api.reportImpressionEvent({
|
|
16
|
+
* engagement_uid: 'abc123-def456',
|
|
17
|
+
* activityType: 31 // Inbox
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* **Visitor mode: not supported**
|
|
22
|
+
*
|
|
23
|
+
* @param params - Event parameters
|
|
24
|
+
* @param params.engagement_uid - Unique identifier for the engagement
|
|
25
|
+
* @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
|
|
26
|
+
*/
|
|
27
|
+
reportImpressionEvent({ engagement_uid, activityType, }: {
|
|
28
|
+
engagement_uid: string;
|
|
29
|
+
activityType: ActivityTypeLimited | number;
|
|
30
|
+
}): void;
|
|
31
|
+
/**
|
|
32
|
+
* Reports a click/action event for an engagement (when user interacts with engagement content).
|
|
33
|
+
* Use this method to track when users click on or interact with engagement content such as inbox messages, popups.
|
|
34
|
+
* When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType, and pass the action/deeplink that was triggered by the user interaction as action.
|
|
35
|
+
*
|
|
36
|
+
* **Example**:
|
|
37
|
+
* ```
|
|
38
|
+
* _smartico.api.reportClickEvent({
|
|
39
|
+
* engagement_uid: 'abc123-def456',
|
|
40
|
+
* activityType: 31 // Inbox
|
|
41
|
+
* action: 'dp:gf_missions'
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* **Visitor mode: not supported**
|
|
46
|
+
*
|
|
47
|
+
* @param params - Event parameters
|
|
48
|
+
* @param params.engagement_uid - Unique identifier for the engagement
|
|
49
|
+
* @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
|
|
50
|
+
* @param params.action - Optional action/deeplink that was triggered by the user interaction
|
|
51
|
+
*/
|
|
52
|
+
reportClickEvent({ engagement_uid, activityType, action, }: {
|
|
53
|
+
engagement_uid: string;
|
|
54
|
+
activityType: ActivityTypeLimited | number;
|
|
55
|
+
action?: string;
|
|
56
|
+
}): void;
|
|
57
|
+
/** Returns inbox messages based on the provided parameters. "From" and "to" indicate the range of messages to be fetched.
|
|
58
|
+
* The maximum number of messages per request is limited to 20.
|
|
59
|
+
* An indicator "onlyFavorite" can be passed to get only messages marked as favorites.
|
|
60
|
+
* An indicator "read_status" can be passed to get only messages marked as read or unread.
|
|
61
|
+
* You can leave this params empty and by default it will return list of messages ranging from 0 to 20.
|
|
62
|
+
* This function returns a list of messages without the body of each message.
|
|
63
|
+
* To get the body of the message you need to call getInboxMessageBody function and pass the message guid contained in each message of this request.
|
|
64
|
+
* All other action like mark as read, favorite, delete, etc. can be done using this message GUID.
|
|
65
|
+
* The "onUpdate" callback will be triggered when the user receives a new message. It will provide an updated list of messages, ranging from 0 to 20, to the onUpdate callback function.
|
|
66
|
+
*
|
|
67
|
+
* **Visitor mode: not supported**
|
|
68
|
+
*
|
|
69
|
+
* @param params
|
|
70
|
+
*/
|
|
71
|
+
getInboxMessages({ from, to, onlyFavorite, categoryId, read_status, onUpdate, }?: {
|
|
72
|
+
from?: number;
|
|
73
|
+
to?: number;
|
|
74
|
+
onlyFavorite?: boolean;
|
|
75
|
+
categoryId?: InboxCategories;
|
|
76
|
+
read_status?: InboxReadStatus;
|
|
77
|
+
onUpdate?: (data: TInboxMessage[]) => void;
|
|
78
|
+
}): Promise<TInboxMessage[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Returns inbox unread count.
|
|
81
|
+
*
|
|
82
|
+
* **Visitor mode: not supported**
|
|
83
|
+
* @param params
|
|
84
|
+
*/
|
|
85
|
+
getInboxUnreadCount({ onUpdate }?: {
|
|
86
|
+
onUpdate?: (unread_count: number) => void;
|
|
87
|
+
}): Promise<number>;
|
|
88
|
+
/**
|
|
89
|
+
* Returns the message body of the specified message guid.
|
|
90
|
+
*
|
|
91
|
+
* **Visitor mode: not supported**
|
|
92
|
+
*/
|
|
93
|
+
getInboxMessageBody(messageGuid: string): Promise<TInboxMessageBody>;
|
|
94
|
+
/**
|
|
95
|
+
* Requests to mark inbox message with specified guid as read
|
|
96
|
+
*
|
|
97
|
+
* **Visitor mode: not supported**
|
|
98
|
+
*/
|
|
99
|
+
markInboxMessageAsRead(messageGuid: string): Promise<InboxMarkMessageAction>;
|
|
100
|
+
/**
|
|
101
|
+
* Requests to mark all inbox messages as read
|
|
102
|
+
*
|
|
103
|
+
* **Visitor mode: not supported**
|
|
104
|
+
*/
|
|
105
|
+
markAllInboxMessagesAsRead(): Promise<InboxMarkMessageAction>;
|
|
106
|
+
/**
|
|
107
|
+
* Requests to mark inbox message with specified guid as favorite. Pass mark true to add message to favorite and false to remove.
|
|
108
|
+
*
|
|
109
|
+
* **Visitor mode: not supported**
|
|
110
|
+
*/
|
|
111
|
+
markUnmarkInboxMessageAsFavorite(messageGuid: string, mark: boolean): Promise<InboxMarkMessageAction>;
|
|
112
|
+
/**
|
|
113
|
+
* Requests to delete inbox message
|
|
114
|
+
*
|
|
115
|
+
* **Visitor mode: not supported**
|
|
116
|
+
*/
|
|
117
|
+
deleteInboxMessage(messageGuid: string): Promise<InboxMarkMessageAction>;
|
|
118
|
+
/**
|
|
119
|
+
* Requests to delete all inbox messages
|
|
120
|
+
*
|
|
121
|
+
* **Visitor mode: not supported**
|
|
122
|
+
*/
|
|
123
|
+
deleteAllInboxMessages(): Promise<InboxMarkMessageAction>;
|
|
124
|
+
protected updateInboxUnreadCount(count: number): Promise<void>;
|
|
125
|
+
protected updateInboxMessages(): Promise<void>;
|
|
126
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { JackpotDetails, JackpotWinnerHistory, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
|
|
2
|
+
import { TGetJackpotEligibleGamesResponse } from '../Jackpots/GetJackpotEligibleGamesResponse';
|
|
3
|
+
import { WSAPIClans } from './WSAPIClans';
|
|
4
|
+
/** @group Jackpots */
|
|
5
|
+
export declare class WSAPIJackpots extends WSAPIClans {
|
|
6
|
+
/** @hidden */
|
|
7
|
+
protected jackpotGetSignature: string;
|
|
8
|
+
protected jackpotClearCache(): Promise<void>;
|
|
9
|
+
/** Returns list of Jackpots that are active in the system and matching to the filter definition.
|
|
10
|
+
* If filter is not provided, all active jackpots will be returned.
|
|
11
|
+
* Filter can be used to get jackpots related to specific game or specific jackpot template.
|
|
12
|
+
* You can call this method every second in order to get up to date information about current value of the jackpot(s) and present them to the end-users
|
|
13
|
+
*
|
|
14
|
+
* **Example**:
|
|
15
|
+
* ```
|
|
16
|
+
* _smartico.api.jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
17
|
+
* console.log(result);
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* **Example in the Visitor mode**:
|
|
22
|
+
* ```
|
|
23
|
+
* _smartico.vapi('EN').jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
24
|
+
* console.log(result);
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
jackpotGet(filter?: {
|
|
29
|
+
related_game_id?: string;
|
|
30
|
+
jp_template_id?: number;
|
|
31
|
+
}): Promise<JackpotDetails[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Opt-in currently logged in user to the jackpot with the specified jp_template_id.
|
|
34
|
+
* You may call jackpotGet method after doing optin to see that user is opted in to the jackpot.
|
|
35
|
+
*
|
|
36
|
+
* **Example**:
|
|
37
|
+
* ```
|
|
38
|
+
* _smartico.api.jackpotOptIn({ jp_template_id: 123 }).then((result) => {
|
|
39
|
+
* console.log('Opted in to the jackpot');
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* **Visitor mode: not supported**
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
jackpotOptIn(filter: {
|
|
47
|
+
jp_template_id: number;
|
|
48
|
+
}): Promise<JackpotsOptinResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Opt-out currently logged in user from the jackpot with the specified jp_template_id.
|
|
51
|
+
* You may call jackpotGet method after doing optout to see that user is not opted in to the jackpot.
|
|
52
|
+
*
|
|
53
|
+
* **Example**:
|
|
54
|
+
* ```
|
|
55
|
+
* _smartico.api.jackpotOptOut({ jp_template_id: 123 }).then((result) => {
|
|
56
|
+
* console.log('Opted out from the jackpot');
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* **Visitor mode: not supported**
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
jackpotOptOut(filter: {
|
|
64
|
+
jp_template_id: number;
|
|
65
|
+
}): Promise<JackpotsOptoutResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Returns jackpot winners for the given `jp_template_id` (paginated on the server).
|
|
68
|
+
* Default page size on the wire is 20; use `limit`, `offset`, and repeated calls to load more.
|
|
69
|
+
* The full protocol response also includes `has_more`; this method returns only the `winners` array.
|
|
70
|
+
*
|
|
71
|
+
* **Example**:
|
|
72
|
+
* ```
|
|
73
|
+
* _smartico.api.getJackpotWinners({
|
|
74
|
+
* jp_template_id: 123,
|
|
75
|
+
* }).then((result) => {
|
|
76
|
+
* console.log(result);
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* **Visitor mode: not supported**
|
|
81
|
+
*
|
|
82
|
+
* @param params - Jackpot winners parameters
|
|
83
|
+
* @param params.jp_template_id - Jackpot template id (required; throws if missing)
|
|
84
|
+
* @param params.limit - Page size (server default 20 when omitted)
|
|
85
|
+
* @param params.offset - Offset into the winner list
|
|
86
|
+
*/
|
|
87
|
+
getJackpotWinners({ limit, offset, jp_template_id, }: {
|
|
88
|
+
limit?: number;
|
|
89
|
+
offset?: number;
|
|
90
|
+
jp_template_id?: number;
|
|
91
|
+
}): Promise<JackpotWinnerHistory[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the eligible games for the jackpot with the specified jp_template_id.
|
|
94
|
+
*
|
|
95
|
+
* **Example**:
|
|
96
|
+
* ```
|
|
97
|
+
* _smartico.api.getJackpotEligibleGames({ jp_template_id: 123 }).then((result) => {
|
|
98
|
+
* console.log(result);
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* **Visitor mode: not supported**
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
getJackpotEligibleGames({ jp_template_id, onUpdate }: {
|
|
106
|
+
jp_template_id: number;
|
|
107
|
+
onUpdate?: () => void;
|
|
108
|
+
}): Promise<TGetJackpotEligibleGamesResponse>;
|
|
109
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LeaderBoardDetailsT } from './WSAPITypes';
|
|
2
|
+
import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
3
|
+
import { WSAPIGamePick } from './WSAPIGamePick';
|
|
4
|
+
/** @group LeaderBoard */
|
|
5
|
+
export declare class WSAPILeaderBoard extends WSAPIGamePick {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the leaderboard for the current type (default is Daily). If getPreviousPeriod is passed as true, a leaderboard for the previous period for the current type will be returned.
|
|
8
|
+
* For example, if the type is Weekly and getPreviousPeriod is true, a leaderboard for the previous week will be returned.
|
|
9
|
+
*
|
|
10
|
+
* **Example**:
|
|
11
|
+
* ```
|
|
12
|
+
* _smartico.api.getLeaderBoard(1).then((result) => {
|
|
13
|
+
* console.log(result);
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* **Example in the Visitor mode**:
|
|
18
|
+
* ```
|
|
19
|
+
* _smartico.vapi('EN').getLeaderBoard(1).then((result) => {
|
|
20
|
+
* console.log(result);
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
getLeaderBoard(periodType: LeaderBoardPeriodType, getPreviousPeriod?: boolean): Promise<LeaderBoardDetailsT>;
|
|
25
|
+
}
|