@smartico/public-api 0.0.351 → 0.0.353
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GamePick/GPTypes.d.ts +268 -0
- package/dist/GamePick/index.d.ts +1 -0
- package/dist/Raffle/Raffle.d.ts +13 -0
- package/dist/SmarticoAPI.d.ts +20 -0
- package/dist/Tournaments/Tournament.d.ts +2 -0
- package/dist/WSAPI/WSAPI.d.ts +334 -1
- package/dist/WSAPI/WSAPITypes.d.ts +10 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1223 -452
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +731 -83
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +3 -0
- package/docs/api/classes/WSAPI.md +199 -0
- package/docs/api/enums/QuizAnswersValueType.md +121 -0
- package/docs/api/enums/RaffleTicketCapVisualization.md +25 -0
- package/docs/api/enums/SAWGPMarketType.md +157 -0
- package/docs/api/interfaces/RafflePublicMeta.md +9 -0
- package/docs/api/interfaces/TRaffle.md +8 -0
- package/docs/api/interfaces/TTournament.md +8 -0
- package/docs/api/interfaces/TTournamentDetailed.md +12 -0
- package/docs/api/interfaces/Tournament.md +8 -0
- package/package.json +4 -2
- package/src/GamePick/GPTypes.ts +277 -0
- package/src/GamePick/index.ts +1 -0
- package/src/Raffle/GetRafflesResponse.ts +1 -0
- package/src/Raffle/Raffle.ts +14 -0
- package/src/SmarticoAPI.ts +158 -13
- package/src/Tournaments/Tournament.ts +5 -2
- package/src/WSAPI/WSAPI.ts +476 -62
- package/src/WSAPI/WSAPITypes.ts +10 -2
- package/src/index.ts +3 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { SAWGPMarketType } from '../Quiz/MarketsType';
|
|
2
|
+
import { QuizAnswersValueType } from '../Quiz/MarketsAnswers';
|
|
3
|
+
export declare enum GamePickMarketType {
|
|
4
|
+
Goals = 1,
|
|
5
|
+
Winner = 2
|
|
6
|
+
}
|
|
7
|
+
export declare enum GamePickResolutionType {
|
|
8
|
+
None = 0,
|
|
9
|
+
Lost = 2,
|
|
10
|
+
PartialWin = 3,
|
|
11
|
+
FullWin = 4
|
|
12
|
+
}
|
|
13
|
+
export declare enum GPRoundStatus {
|
|
14
|
+
Other = -1,
|
|
15
|
+
NoEventsDefined = 1,
|
|
16
|
+
NoMoreBetsAllowed = 2,
|
|
17
|
+
AllEventsResolved_ButNotRound = 3,
|
|
18
|
+
RoundResolved = 4
|
|
19
|
+
}
|
|
20
|
+
export declare enum GamePickScoreType {
|
|
21
|
+
ExactScore = 1,
|
|
22
|
+
PointsDifference = 2
|
|
23
|
+
}
|
|
24
|
+
export declare enum GamePickSportType {
|
|
25
|
+
Golf = 9,
|
|
26
|
+
Cycling = 17,
|
|
27
|
+
Specials = 18,
|
|
28
|
+
TouringCarRacing = 188,
|
|
29
|
+
StockCarRacing = 191,
|
|
30
|
+
IndyRacing = 129,
|
|
31
|
+
Biathlon = 44,
|
|
32
|
+
Speedway = 131,
|
|
33
|
+
Motorsport = 11,
|
|
34
|
+
AlpineSkiing = 43,
|
|
35
|
+
SkiJumping = 48,
|
|
36
|
+
Lacrosse = 39,
|
|
37
|
+
CrossCountry = 46,
|
|
38
|
+
NordicCombined = 47,
|
|
39
|
+
Chess = 33,
|
|
40
|
+
Athletics = 36,
|
|
41
|
+
ESportOverwatch = 121,
|
|
42
|
+
MMA = 117,
|
|
43
|
+
Futsal = 29,
|
|
44
|
+
IceHockey = 4,
|
|
45
|
+
Kabaddi = 138,
|
|
46
|
+
BeachVolley = 34,
|
|
47
|
+
Formula1 = 40,
|
|
48
|
+
ESporteBasketball = 153,
|
|
49
|
+
MotorcycleRacing = 190,
|
|
50
|
+
Bowls = 32,
|
|
51
|
+
Boxing = 10,
|
|
52
|
+
Floorball = 7,
|
|
53
|
+
GaelicHurling = 136,
|
|
54
|
+
Bandy = 15,
|
|
55
|
+
Handball = 6,
|
|
56
|
+
Waterpolo = 26,
|
|
57
|
+
Rugby = 12,
|
|
58
|
+
ESporteSoccer = 137,
|
|
59
|
+
FieldHockey = 24,
|
|
60
|
+
Pesapallo = 61,
|
|
61
|
+
Snooker = 19,
|
|
62
|
+
Badminton = 31,
|
|
63
|
+
Cricket = 21,
|
|
64
|
+
BeachSoccer = 60,
|
|
65
|
+
Baseball = 3,
|
|
66
|
+
StarCraft = 112,
|
|
67
|
+
ESportCounterStrike = 109,
|
|
68
|
+
ESportArenaofValor = 158,
|
|
69
|
+
Curling = 28,
|
|
70
|
+
Squash = 37,
|
|
71
|
+
Darts = 22,
|
|
72
|
+
TableTennis = 20,
|
|
73
|
+
Basketball3x3 = 155,
|
|
74
|
+
AussieRules = 13,
|
|
75
|
+
GaelicFootball = 135,
|
|
76
|
+
CallOfDuty = 118,
|
|
77
|
+
Soccer = 1,
|
|
78
|
+
Tennis = 5,
|
|
79
|
+
ESportDota = 111,
|
|
80
|
+
Basketball = 2,
|
|
81
|
+
ESportLeagueofLegends = 110,
|
|
82
|
+
AmericanFootball = 16,
|
|
83
|
+
Volleyball = 23,
|
|
84
|
+
Netball = 35,
|
|
85
|
+
ESportRocketLeague = 128,
|
|
86
|
+
Schwingen = 56
|
|
87
|
+
}
|
|
88
|
+
export declare enum GameRoundOrderType {
|
|
89
|
+
HowAdded = 1,
|
|
90
|
+
HowAddedReversed = 2,
|
|
91
|
+
EventDateAscending = 3,
|
|
92
|
+
EventDateDescending = 4
|
|
93
|
+
}
|
|
94
|
+
export declare const AllRoundsGameBoardID = -1;
|
|
95
|
+
export interface QuizEventMeta {
|
|
96
|
+
answers?: {
|
|
97
|
+
value: string;
|
|
98
|
+
text: string;
|
|
99
|
+
_translations: {
|
|
100
|
+
[key: string]: {
|
|
101
|
+
text: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}[];
|
|
105
|
+
question_image?: string;
|
|
106
|
+
result?: QuizAnswersValueType;
|
|
107
|
+
custom_question: string;
|
|
108
|
+
}
|
|
109
|
+
export interface GamePickEventMeta extends QuizEventMeta {
|
|
110
|
+
event_name?: string;
|
|
111
|
+
team1_name: string;
|
|
112
|
+
team1_image: string;
|
|
113
|
+
team2_name: string;
|
|
114
|
+
team2_image: string;
|
|
115
|
+
team1_result?: number;
|
|
116
|
+
team2_result?: number;
|
|
117
|
+
sport_type_id?: number;
|
|
118
|
+
is_canceled?: boolean;
|
|
119
|
+
auto_resolve_enabled?: boolean;
|
|
120
|
+
auto_resolve_date?: string;
|
|
121
|
+
team1_auto_result?: number;
|
|
122
|
+
team2_auto_result?: number;
|
|
123
|
+
auto_result?: string;
|
|
124
|
+
_translations: {
|
|
125
|
+
[key: string]: {
|
|
126
|
+
team1_name: string;
|
|
127
|
+
team2_name: string;
|
|
128
|
+
event_name: string;
|
|
129
|
+
custom_question: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export interface GamePickEvent {
|
|
134
|
+
gp_event_id: number;
|
|
135
|
+
event_resolution_date: number;
|
|
136
|
+
match_date: number;
|
|
137
|
+
market_type_id: SAWGPMarketType;
|
|
138
|
+
event_meta: GamePickEventMeta;
|
|
139
|
+
user_placed_bet: boolean;
|
|
140
|
+
team1_user_selection?: number | {
|
|
141
|
+
from: number;
|
|
142
|
+
to: number;
|
|
143
|
+
};
|
|
144
|
+
team2_user_selection?: number | {
|
|
145
|
+
from: number;
|
|
146
|
+
to: number;
|
|
147
|
+
};
|
|
148
|
+
user_selection?: QuizAnswersValueType;
|
|
149
|
+
resolution_type_id: GamePickResolutionType;
|
|
150
|
+
resolution_score?: number;
|
|
151
|
+
is_open_for_bets?: boolean;
|
|
152
|
+
odds_details?: {
|
|
153
|
+
odd_value: {
|
|
154
|
+
[key: string]: number;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
question_image?: string;
|
|
158
|
+
}
|
|
159
|
+
export interface GamePickRoundBase {
|
|
160
|
+
round_id: number;
|
|
161
|
+
round_row_id: number;
|
|
162
|
+
round_name: string;
|
|
163
|
+
round_description: string;
|
|
164
|
+
final_screen_cta_button_title: string;
|
|
165
|
+
final_screen_message: string;
|
|
166
|
+
final_screen_image_desktop: string;
|
|
167
|
+
final_screen_image_mobile: string;
|
|
168
|
+
promo_image: string;
|
|
169
|
+
promo_text: string;
|
|
170
|
+
open_date: number;
|
|
171
|
+
last_bet_date: number;
|
|
172
|
+
resolution_date: number;
|
|
173
|
+
score_full_win: number;
|
|
174
|
+
score_part_win: number;
|
|
175
|
+
score_lost: number;
|
|
176
|
+
is_active_now: boolean;
|
|
177
|
+
is_resolved: boolean;
|
|
178
|
+
round_status_id: GPRoundStatus;
|
|
179
|
+
events_total: number;
|
|
180
|
+
events_resolved: number;
|
|
181
|
+
score_type_id: GamePickScoreType;
|
|
182
|
+
order_events: GameRoundOrderType;
|
|
183
|
+
board_users_count: number;
|
|
184
|
+
hide_users_predictions: boolean;
|
|
185
|
+
public_meta: {
|
|
186
|
+
round_name: string;
|
|
187
|
+
round_description: string;
|
|
188
|
+
promo_image: string;
|
|
189
|
+
promo_text: string;
|
|
190
|
+
hide_resolved_round: boolean;
|
|
191
|
+
final_screen_image_desktop: string;
|
|
192
|
+
final_screen_image_mobile: string;
|
|
193
|
+
final_screen_message: string;
|
|
194
|
+
final_screen_cta_button_title: string;
|
|
195
|
+
final_screen_cta_dp: string;
|
|
196
|
+
allow_edit_answers?: boolean;
|
|
197
|
+
_translations: {
|
|
198
|
+
[key: string]: {
|
|
199
|
+
round_name: string;
|
|
200
|
+
round_description: string;
|
|
201
|
+
promo_image: string;
|
|
202
|
+
promo_text: string;
|
|
203
|
+
final_screen_image_desktop: string;
|
|
204
|
+
final_screen_image_mobile: string;
|
|
205
|
+
final_screen_message: string;
|
|
206
|
+
final_screen_cta_button_title: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
next_round_open_date: number;
|
|
211
|
+
show_users_preference: boolean;
|
|
212
|
+
}
|
|
213
|
+
export interface GamePickRound extends GamePickRoundBase {
|
|
214
|
+
events: GamePickEvent[];
|
|
215
|
+
user_score: number;
|
|
216
|
+
user_placed_bet: boolean;
|
|
217
|
+
has_open_for_bet_events?: boolean;
|
|
218
|
+
has_not_submitted_changes?: boolean;
|
|
219
|
+
}
|
|
220
|
+
export interface GamePickRoundBoard extends GamePickRoundBase {
|
|
221
|
+
my_user: GamePickBoardUser;
|
|
222
|
+
users: GamePickBoardUser[];
|
|
223
|
+
}
|
|
224
|
+
export interface GamePickBoardUser {
|
|
225
|
+
ext_user_id: string;
|
|
226
|
+
int_user_id: number;
|
|
227
|
+
public_username: string;
|
|
228
|
+
avatar_url: string;
|
|
229
|
+
gp_position: number;
|
|
230
|
+
resolution_score: number;
|
|
231
|
+
full_wins_count: number;
|
|
232
|
+
part_wins_count: number;
|
|
233
|
+
lost_count: number;
|
|
234
|
+
}
|
|
235
|
+
export interface GamePickUserInfo {
|
|
236
|
+
ext_user_id: string;
|
|
237
|
+
int_user_id: number;
|
|
238
|
+
public_username: string;
|
|
239
|
+
avatar_url: string;
|
|
240
|
+
gp_position?: number;
|
|
241
|
+
full_wins_count?: number;
|
|
242
|
+
part_wins_count?: number;
|
|
243
|
+
resolution_score?: number;
|
|
244
|
+
last_wallet_sync_time?: Date;
|
|
245
|
+
ach_points_balance?: number;
|
|
246
|
+
ach_gems_balance?: number;
|
|
247
|
+
ach_diamonds_balance?: number;
|
|
248
|
+
pubic_username_set?: boolean;
|
|
249
|
+
}
|
|
250
|
+
export interface GamePickGameInfo {
|
|
251
|
+
sawTemplate: any;
|
|
252
|
+
allRounds: GamePickRoundBase[];
|
|
253
|
+
labelInfo: any;
|
|
254
|
+
}
|
|
255
|
+
export interface GamesApiResponse<T> {
|
|
256
|
+
errCode: number;
|
|
257
|
+
errMessage?: string;
|
|
258
|
+
data?: T;
|
|
259
|
+
}
|
|
260
|
+
export interface GamePickRequestParams {
|
|
261
|
+
saw_template_id: number;
|
|
262
|
+
ext_user_id: string;
|
|
263
|
+
smartico_ext_user_id: string;
|
|
264
|
+
lang?: string;
|
|
265
|
+
}
|
|
266
|
+
export interface GamePickRoundRequestParams extends GamePickRequestParams {
|
|
267
|
+
round_id: number;
|
|
268
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GPTypes';
|
package/dist/Raffle/Raffle.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { RaffleDraw } from "./RaffleDraw";
|
|
2
|
+
export declare enum RaffleTicketCapVisualization {
|
|
3
|
+
/** Show nothing */
|
|
4
|
+
Empty = 0,
|
|
5
|
+
/** Show ticket counter */
|
|
6
|
+
Counter = 1,
|
|
7
|
+
/** Show message when ticket cap is reached */
|
|
8
|
+
Message = 2
|
|
9
|
+
}
|
|
2
10
|
interface RafflePublicMeta {
|
|
3
11
|
/** Name of the raffle */
|
|
4
12
|
name: string;
|
|
@@ -18,6 +26,11 @@ interface RafflePublicMeta {
|
|
|
18
26
|
* Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
|
|
19
27
|
*/
|
|
20
28
|
custom_data: string;
|
|
29
|
+
/**
|
|
30
|
+
* - Value 1 (Counter): Shows a real-time "Tickets Remaining" display available during the whole Raffle activity.
|
|
31
|
+
* - Value 2 (Message): Will show a specific message that triggers only when the cap is reached and inform users that tickets will be no longer be issued.
|
|
32
|
+
*/
|
|
33
|
+
ticket_cap_visualization?: RaffleTicketCapVisualization;
|
|
21
34
|
}
|
|
22
35
|
interface Raffle {
|
|
23
36
|
/** ID of the Raffle template */
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -25,18 +25,24 @@ import { InboxCategories } from './Inbox/InboxCategories';
|
|
|
25
25
|
import { GetDrawRunResponse, GetRaffleDrawRunsHistoryResponse, RaffleClaimPrizeResponse, RaffleOptinResponse } from './Raffle';
|
|
26
26
|
import { GetJackpotWinnersResponse, JackpotWinnerHistory } from './Jackpots/GetJackpotWinnersResponse';
|
|
27
27
|
import { GetJackpotEligibleGamesResponse, TGetJackpotEligibleGamesResponse } from './Jackpots/GetJackpotEligibleGamesResponse';
|
|
28
|
+
import { GamesApiResponse, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamePickGameInfo } from './GamePick';
|
|
28
29
|
interface Tracker {
|
|
29
30
|
label_api_key: string;
|
|
30
31
|
userPublicProps: any;
|
|
32
|
+
params: {
|
|
33
|
+
brand_key?: string;
|
|
34
|
+
};
|
|
31
35
|
on: (callBackKey: ClassId, func: (data: any) => void) => void;
|
|
32
36
|
getLabelSetting: (key: PublicLabelSettings) => any;
|
|
33
37
|
triggerExternalCallBack: (callBackKey: string, payload: any) => void;
|
|
38
|
+
getExtUserId: () => string;
|
|
34
39
|
}
|
|
35
40
|
interface IOptions {
|
|
36
41
|
logger?: ILogger;
|
|
37
42
|
logCIDs?: ClassId[];
|
|
38
43
|
logHTTPTiming?: boolean;
|
|
39
44
|
tracker?: Tracker;
|
|
45
|
+
brand_api_key?: string;
|
|
40
46
|
}
|
|
41
47
|
type MessageSender = (message: any, publicApuUrl?: string, expectCID?: ClassId) => Promise<any>;
|
|
42
48
|
declare class SmarticoAPI {
|
|
@@ -47,7 +53,10 @@ declare class SmarticoAPI {
|
|
|
47
53
|
private wsUrl;
|
|
48
54
|
private inboxCdnUrl;
|
|
49
55
|
private partnerUrl;
|
|
56
|
+
private gamesApiUrl;
|
|
57
|
+
private baseRgApiParams;
|
|
50
58
|
avatarDomain: string;
|
|
59
|
+
private envId;
|
|
51
60
|
private logger;
|
|
52
61
|
private logCIDs;
|
|
53
62
|
private logHTTPTiming;
|
|
@@ -153,6 +162,17 @@ declare class SmarticoAPI {
|
|
|
153
162
|
markUnmarkInboxMessageAsFavorite(user_ext_id: string, messageGuid: string, mark: boolean): Promise<MarkInboxMessageStarredResponse>;
|
|
154
163
|
deleteInboxMessage(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageDeletedResponse>;
|
|
155
164
|
deleteAllInboxMessages(user_ext_id: string): Promise<MarkInboxMessageDeletedResponse>;
|
|
165
|
+
private buildGamesApiParams;
|
|
166
|
+
private sendGamesApi;
|
|
167
|
+
gpGetActiveRounds(saw_template_id: number): Promise<GamesApiResponse<GamePickRound[]>>;
|
|
168
|
+
gpGetActiveRound(saw_template_id: number, round_id?: number): Promise<GamesApiResponse<GamePickRound>>;
|
|
169
|
+
gpGetGamesHistory(saw_template_id: number): Promise<GamesApiResponse<GamePickRound[]>>;
|
|
170
|
+
gpGetGameBoard(saw_template_id: number, round_id: number): Promise<GamesApiResponse<GamePickRoundBoard>>;
|
|
171
|
+
gpSubmitSelection(saw_template_id: number, round: any, isQuiz: boolean): Promise<GamesApiResponse<GamePickRound>>;
|
|
172
|
+
gpGetUserInfo(saw_template_id: number): Promise<GamesApiResponse<GamePickUserInfo>>;
|
|
173
|
+
gpGetGameInfo(saw_template_id: number): Promise<GamesApiResponse<GamePickGameInfo>>;
|
|
174
|
+
gpGetTranslations(saw_template_id: number): Promise<GamesApiResponse<any>>;
|
|
175
|
+
gpGetRoundInfoForUser(saw_template_id: number, round_id: number, int_user_id: number): Promise<GamesApiResponse<GamePickRound>>;
|
|
156
176
|
getWSCalls(): WSAPI;
|
|
157
177
|
getRelatedItemsForGame(user_ext_id: string, related_game_id: string): Promise<GetRelatedAchTourResponse>;
|
|
158
178
|
getRafflesT(user_ext_id: string): Promise<TRaffle[]>;
|
|
@@ -60,5 +60,7 @@ export interface Tournament {
|
|
|
60
60
|
minScoreToWin?: number;
|
|
61
61
|
/** When enabled, users who don't meet the minimum qualifying score will be hidden from the Leaderboard. */
|
|
62
62
|
hideLeaderboardsMinScores?: boolean;
|
|
63
|
+
/** Total scores across all participants in the tournament */
|
|
64
|
+
totalScores?: number;
|
|
63
65
|
}
|
|
64
66
|
export declare const TournamentItemsTransform: (items: Tournament[]) => TTournament[];
|