@smartico/public-api 0.0.211 → 0.0.213
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/Base/AchRelatedGame.d.ts +2 -0
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/Quiz/MarketsAnswersType.d.ts +22 -0
- package/dist/SmarticoPublicAPI.d.ts +23 -0
- package/dist/Store/BuyShopItemErrorCode.d.ts +10 -0
- package/dist/Store/BuyShopItemRequest.d.ts +4 -0
- package/dist/Store/BuyShopItemResponse.d.ts +4 -0
- package/dist/Store/GetCategoriesShopResponse.d.ts +5 -0
- package/dist/Store/GetShopItemsResponse.d.ts +5 -0
- package/dist/Store/ShopCategory.d.ts +5 -0
- package/dist/Store/ShopCategoryPublicMeta.d.ts +4 -0
- package/dist/Store/ShopItem.d.ts +9 -0
- package/dist/Store/ShopItemPublicMeta.d.ts +10 -0
- package/dist/Store/ShopItemType.d.ts +4 -0
- package/dist/Store/StorItemPruchased.d.ts +6 -0
- package/dist/Tournaments/Tournament.d.ts +2 -0
- package/dist/WSAPI/WSAPITypes.d.ts +39 -2
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +4 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/service/index.d.ts +5 -0
- package/dist/service/types/ErrorCodes.d.ts +13 -0
- package/dist/service/types/GRequest.d.ts +16 -0
- package/dist/service/types/GResponse.d.ts +10 -0
- package/dist/service/types/Game/GameAttemptType.d.ts +6 -0
- package/dist/service/types/Game/GameCanPlayType.d.ts +10 -0
- package/dist/service/types/Game/GameExternalStatus.d.ts +6 -0
- package/dist/service/types/Game/GameInfo.d.ts +9 -0
- package/dist/service/types/Game/GamePick.d.ts +90 -0
- package/dist/service/types/Game/GameUtil.d.ts +7 -0
- package/dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts +7 -0
- package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +7 -0
- package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +5 -0
- package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +6 -0
- package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +5 -0
- package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +34 -0
- package/dist/service/types/SmarticoProto/PublicProperties.d.ts +11 -0
- package/dist/service/types/SmarticoProto/ResponseIdentify.d.ts +12 -0
- package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +5 -0
- package/dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts +5 -0
- package/dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts +5 -0
- package/dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts +15 -0
- package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +10 -0
- package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts +3 -0
- package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts +5 -0
- package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +11 -0
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +8 -0
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +13 -0
- package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +21 -0
- package/dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts +31 -0
- package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +12 -0
- package/dist/service/types/SmarticoProto/TranslationArea.d.ts +9 -0
- package/dist/service/types/User/UserInfo.d.ts +10 -0
- package/dist/util/Util.d.ts +51 -0
- package/docs/enums/MiniGamePrizeTypeName.md +2 -2
- package/docs/interfaces/AchRelatedGame.md +4 -0
- package/docs/interfaces/TMiniGamePrize.md +52 -11
- package/docs/interfaces/TMiniGameTemplate.md +14 -0
- package/docs/interfaces/TTournament.md +10 -0
- package/docs/interfaces/TTournamentDetailed.md +14 -0
- package/package.json +1 -1
- package/src/Base/AchRelatedGame.ts +2 -2
- package/src/MiniGames/SAWGetTemplatesResponse.ts +3 -0
- package/src/MiniGames/SAWPrizeUI.ts +3 -0
- package/src/Tournaments/Tournament.ts +2 -2
- package/src/WSAPI/WSAPITypes.ts +40 -32
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum MarketsValueType {
|
|
2
|
+
HomeTeam = "1",
|
|
3
|
+
AwayTeam = "2",
|
|
4
|
+
Draw = "x",
|
|
5
|
+
HomeTeamHomeTeam = "1/1",
|
|
6
|
+
HomeTeamDraw = "1/x",
|
|
7
|
+
HomeTeamAwayTeam = "1/2",
|
|
8
|
+
DrawHomeTeam = "x/1",
|
|
9
|
+
DrawDraw = "x/x",
|
|
10
|
+
DrawAwayTeam = "x/2",
|
|
11
|
+
AwayTeamHomeTeam = "2/1",
|
|
12
|
+
AwayTeamDraw = "2/x",
|
|
13
|
+
AwayTeamAwayTeam = "2/2",
|
|
14
|
+
Yes = "yes",
|
|
15
|
+
No = "no",
|
|
16
|
+
Odd = "odd",
|
|
17
|
+
Even = "even",
|
|
18
|
+
HomeOdd = "1/odd",
|
|
19
|
+
HomeEven = "1/even",
|
|
20
|
+
AwayOdd = "2/odd",
|
|
21
|
+
AwayEven = "2/even"
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ClassId } from "./Base/ClassId";
|
|
2
|
+
import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
|
|
3
|
+
import { SAWTemplate } from './MiniGames/SAWTemplate';
|
|
4
|
+
import { ILogger } from './ILogger';
|
|
5
|
+
interface IOptions {
|
|
6
|
+
logger?: ILogger;
|
|
7
|
+
logCIDs?: ClassId[];
|
|
8
|
+
logHTTPTiming?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare class SmarticoPublicApi {
|
|
11
|
+
private label_api_key;
|
|
12
|
+
private brand_api_key;
|
|
13
|
+
private publicUrl;
|
|
14
|
+
private logger;
|
|
15
|
+
private logCIDs;
|
|
16
|
+
private logHTTPTiming;
|
|
17
|
+
constructor(label_api_key: string, brand_api_key: string, options?: IOptions);
|
|
18
|
+
private send;
|
|
19
|
+
private buildMessage;
|
|
20
|
+
miniGamesGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
|
|
21
|
+
miniGamesFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): any[];
|
|
22
|
+
}
|
|
23
|
+
export { SmarticoPublicApi };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum BuyShopItemErrorCode {
|
|
2
|
+
FAILED_TO_BUY_SHOP_ITEM = 121,
|
|
3
|
+
SHOP_NO_BALANCE = 11000,
|
|
4
|
+
SHOP_WRONG_LABEL = 11001,
|
|
5
|
+
SHOP_FAILED_TO_BUY_BONUS = 11002,
|
|
6
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003,
|
|
7
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004,
|
|
8
|
+
SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
|
|
9
|
+
SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ShopItemPublicMeta } from "./ShopItemPublicMeta";
|
|
2
|
+
import { ShopItemType } from "./ShopItemType";
|
|
3
|
+
export interface ShopItem {
|
|
4
|
+
id: number;
|
|
5
|
+
itemTypeId: ShopItemType;
|
|
6
|
+
itemPublicMeta: ShopItemPublicMeta;
|
|
7
|
+
categoryIds?: number[];
|
|
8
|
+
canBuy?: boolean;
|
|
9
|
+
}
|
|
@@ -55,7 +55,9 @@ export interface Tournament {
|
|
|
55
55
|
tournamentPlayer?: TournamentPlayer;
|
|
56
56
|
/** List of casino games (or other types of entities) related to the tournament */
|
|
57
57
|
related_games?: AchRelatedGame[];
|
|
58
|
+
/** The minimum amount of score points that the user should get in order to be qualified for the prize */
|
|
58
59
|
minScoreToWin?: number;
|
|
60
|
+
/** When enabled, users who don’t meet the minimum qualifying score will be hidden from the Leaderboard. */
|
|
59
61
|
hideLeaderboardsMinScores?: boolean;
|
|
60
62
|
}
|
|
61
63
|
export declare const TournamentItemsTransform: (items: Tournament[]) => TTournament[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuyStoreItemErrorCode } from '../Store';
|
|
2
|
-
import { MiniGamePrizeTypeName, SAWAcknowledgeTypeName, SAWBuyInTypeName, SAWGameTypeName, SAWSpinErrorCode, SAWTemplate } from '../MiniGames';
|
|
2
|
+
import { MiniGamePrizeTypeName, SAWAcknowledgeTypeName, SAWBuyInTypeName, SAWGameTypeName, SAWSpinErrorCode, SAWTemplate, SAWTemplateUI } from '../MiniGames';
|
|
3
3
|
import { TournamentRegistrationError, TournamentRegistrationStatusName, TournamentRegistrationTypeName } from '../Tournaments';
|
|
4
4
|
import { AchievementAvailabilityStatus } from '../Missions';
|
|
5
5
|
import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
@@ -25,22 +25,41 @@ export interface TMiniGamePrize {
|
|
|
25
25
|
font_size_mobile?: number;
|
|
26
26
|
/** The URL of the icon of the prize */
|
|
27
27
|
icon?: string;
|
|
28
|
+
/** for scratch card defines position of prize in the list */
|
|
28
29
|
position: number;
|
|
30
|
+
/** List of sectors for the prize */
|
|
31
|
+
sectors: number[];
|
|
32
|
+
/** Type of acknowledge message for users */
|
|
29
33
|
acknowledge_type: SAWAcknowledgeTypeName;
|
|
34
|
+
/** Message that will be shown to user in modal pop-up */
|
|
30
35
|
aknowledge_message: string;
|
|
36
|
+
/** Deep link that will trigger some action in modal pop-up */
|
|
31
37
|
acknowledge_dp: string;
|
|
38
|
+
/** The name of the action button in modal pop-up */
|
|
32
39
|
acknowledge_action_title: string;
|
|
40
|
+
/** Deep link that will trigger some action in modal pop-up (additional) */
|
|
33
41
|
acknowledge_dp_additional?: string;
|
|
42
|
+
/** The name of the action button in modal pop-up (additional) */
|
|
34
43
|
acknowledge_action_title_additional?: string;
|
|
44
|
+
/** Message when the prize pool is empty for that specific prize */
|
|
35
45
|
out_of_stock_message?: string;
|
|
46
|
+
/** Number of items in stock */
|
|
36
47
|
pool?: number;
|
|
48
|
+
/** Initial number of items in stock */
|
|
37
49
|
pool_initial?: number;
|
|
50
|
+
/** Number of wins in game */
|
|
38
51
|
wins_count?: number;
|
|
52
|
+
/** Number of days of week, when the prize can be available */
|
|
39
53
|
weekdays?: number[];
|
|
54
|
+
/** Holds time from which prize will become available, for the prizes that are targeted to be available from specific time (UNIX timestamp) */
|
|
40
55
|
active_from_ts?: number;
|
|
56
|
+
/** Holds time till which prize will become available, for the prizes that are targeted to be available from specific time (UNIX timestamp) */
|
|
41
57
|
active_till_ts?: number;
|
|
58
|
+
/** Time zone to ensure each day aligns with your local midnight. */
|
|
42
59
|
relative_period_timezone?: number;
|
|
60
|
+
/** Flag indicating that the prize is surcharged (available all the time, despite pool numbers) */
|
|
43
61
|
is_surcharge?: boolean;
|
|
62
|
+
/** Flag indicating the state of the prize */
|
|
44
63
|
is_deleted?: boolean;
|
|
45
64
|
/** The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number */
|
|
46
65
|
custom_data?: any;
|
|
@@ -48,6 +67,8 @@ export interface TMiniGamePrize {
|
|
|
48
67
|
prize_modifiers?: PrizeModifiers[];
|
|
49
68
|
/** When enabled, you can split prize value by decimal values */
|
|
50
69
|
allow_split_decimal?: boolean;
|
|
70
|
+
/** When enabled, you can hide prize from prize history */
|
|
71
|
+
hide_prize_from_history?: boolean;
|
|
51
72
|
}
|
|
52
73
|
/**
|
|
53
74
|
* TMiniGamePlayResult describes the response of call to _smartico.api.playMiniGame(template_id) method
|
|
@@ -116,12 +137,20 @@ export interface TMiniGameTemplate {
|
|
|
116
137
|
custom_data: any;
|
|
117
138
|
/** List of prizes for mini-games */
|
|
118
139
|
prizes: TMiniGamePrize[];
|
|
140
|
+
/** When enabled, the number of items in the pool and number of won items will be exposed in the Retention API and in the UI Widgets */
|
|
119
141
|
expose_game_stat_on_api?: boolean;
|
|
142
|
+
/** Time zone to ensure each day aligns with your local midnight. */
|
|
120
143
|
relative_period_timezone?: number;
|
|
144
|
+
/** Holds time from which template will become available, for the template that are targeted to be available from specific time (UNIX timestamp) */
|
|
121
145
|
activeFromDate?: number;
|
|
146
|
+
/** Holds time till which template will become available, for the templates that are targeted to be available from specific time (UNIX timestamp) */
|
|
122
147
|
activeTillDate?: number;
|
|
148
|
+
/** The amount of steps to complete the game and gather the prize */
|
|
123
149
|
steps_to_finish_game?: number;
|
|
150
|
+
/** Hold the id of the custom section */
|
|
124
151
|
custom_section_id?: number;
|
|
152
|
+
/** The UI definition of the mini-game */
|
|
153
|
+
saw_template_ui_definition: SAWTemplateUI;
|
|
125
154
|
}
|
|
126
155
|
/**
|
|
127
156
|
* TUser describes the information of the user
|
|
@@ -202,10 +231,15 @@ export interface TTournament {
|
|
|
202
231
|
name: string;
|
|
203
232
|
/** Description of the tournament, translated to the user language */
|
|
204
233
|
description: string;
|
|
234
|
+
/** 1st image URL representing the tournament */
|
|
205
235
|
image1: string;
|
|
236
|
+
/** 2nd image URL representing the tournament */
|
|
206
237
|
image2: string;
|
|
238
|
+
/** 2nd image URL representing the tournament for mobile */
|
|
207
239
|
image2_mobile: string;
|
|
240
|
+
/** The message indicating the prize pool of the tournament */
|
|
208
241
|
prize_pool_short: string;
|
|
242
|
+
/** The message indicating the price to register in the tournament */
|
|
209
243
|
custom_price_text: string;
|
|
210
244
|
/** The message that should be shown to the user when the user cannot register in tournament with error code TOURNAMENT_USER_DONT_MATCH_CONDITIONS */
|
|
211
245
|
segment_dont_match_message: string;
|
|
@@ -281,7 +315,9 @@ export interface TTournament {
|
|
|
281
315
|
is_in_progress: boolean;
|
|
282
316
|
/** Indicator if tournament instance is upcoming (status PUBLISHED or REGISTER) */
|
|
283
317
|
is_upcoming: boolean;
|
|
318
|
+
/** The minimum amount of score points that the user should get in order to be qualified for the prize */
|
|
284
319
|
min_scores_win?: number;
|
|
320
|
+
/** When enabled, users who don’t meet the minimum qualifying score will be hidden from the Leaderboard */
|
|
285
321
|
hide_leaderboard_min_scores?: boolean;
|
|
286
322
|
}
|
|
287
323
|
/**
|
|
@@ -594,7 +630,8 @@ export interface TInboxMessageBody {
|
|
|
594
630
|
/** The action that should be performed when user clicks on the message.
|
|
595
631
|
* Can be URL or deep link, e.g. 'dp:deposit'. The most safe to execute CTA is to pass it to _smartico.dp(cta_action);
|
|
596
632
|
* The 'dp' function will handle the CTA and will execute it in the most safe way.
|
|
597
|
-
* If the message has a rich html body - the action will always be 'dp:inbox' which will open the inbox widget when triggered.
|
|
633
|
+
* If the message has a rich html body - the action will always be 'dp:inbox' which will open the inbox widget when triggered.
|
|
634
|
+
*/
|
|
598
635
|
action: string;
|
|
599
636
|
/** Rich HTML body of the message. */
|
|
600
637
|
html_body?: string;
|
package/dist/index.js
CHANGED
|
@@ -410,6 +410,7 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
|
|
|
410
410
|
next_available_spin_ts: r.next_available_spin_ts,
|
|
411
411
|
steps_to_finish_game: r.saw_template_ui_definition.steps_to_finish_game,
|
|
412
412
|
custom_section_id: r.saw_template_ui_definition.custom_section_id,
|
|
413
|
+
saw_template_ui_definition: r.saw_template_ui_definition,
|
|
413
414
|
prizes: r.prizes.map(function (p) {
|
|
414
415
|
var y = {
|
|
415
416
|
id: p.saw_prize_id,
|
|
@@ -420,6 +421,7 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
|
|
|
420
421
|
font_size_mobile: p.saw_prize_ui_definition.font_size_mobile,
|
|
421
422
|
icon: p.saw_prize_ui_definition.icon,
|
|
422
423
|
position: p.saw_prize_ui_definition.position,
|
|
424
|
+
sectors: p.saw_prize_ui_definition.sectors,
|
|
423
425
|
acknowledge_type: SAWAcknowledgeTypeNamed(p.saw_prize_ui_definition.acknowledge_type),
|
|
424
426
|
aknowledge_message: p.saw_prize_ui_definition.aknowledge_message,
|
|
425
427
|
acknowledge_dp: p.saw_prize_ui_definition.acknowledge_dp,
|
|
@@ -438,7 +440,8 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
|
|
|
438
440
|
is_deleted: p.is_deleted,
|
|
439
441
|
custom_data: IntUtils.JsonOrText(r.saw_template_ui_definition.custom_data),
|
|
440
442
|
prize_modifiers: p.saw_prize_ui_definition.prize_modifiers,
|
|
441
|
-
allow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal
|
|
443
|
+
allow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,
|
|
444
|
+
hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history
|
|
442
445
|
};
|
|
443
446
|
return y;
|
|
444
447
|
})
|