@smartico/public-api 0.0.283 → 0.0.284
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Jackpots/JackpotPublicMeta.d.ts +1 -1
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/Quiz/MarketsAnswersType.d.ts +22 -0
- package/dist/Raffle/GetDrawResponse.d.ts +5 -0
- package/dist/Raffle/Raffle.d.ts +1 -1
- package/dist/Raffle/RaffleDraw.d.ts +16 -11
- package/dist/Raffle/RafflePrize.d.ts +15 -14
- package/dist/Raffle/RaffleTicket.d.ts +6 -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/WSAPI/WSAPITypes.d.ts +11 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +2 -0
- 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/interfaces/JackpotPublicMeta.md +1 -1
- package/docs/interfaces/RaffleDraw.md +13 -10
- package/docs/interfaces/RafflePrize.md +18 -16
- package/docs/interfaces/RafflePublicMeta.md +1 -1
- package/docs/interfaces/RaffleTicket.md +4 -0
- package/docs/interfaces/SAWPrizeUI.md +6 -0
- package/docs/interfaces/TMiniGameTemplate.md +18 -0
- package/docs/interfaces/TRaffleTicket.md +4 -0
- package/package.json +1 -1
- package/src/Jackpots/JackpotPublicMeta.ts +1 -1
- package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
- package/src/MiniGames/SAWPrizeUI.ts +1 -0
- package/src/Raffle/Raffle.ts +1 -1
- package/src/Raffle/RaffleClaimPrizeResponse.ts +1 -4
- package/src/Raffle/RaffleDraw.ts +17 -15
- package/src/Raffle/RafflePrize.ts +18 -17
- package/src/Raffle/RaffleTicket.ts +6 -2
- package/src/WSAPI/WSAPITypes.ts +11 -3
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ErrorCodes, ErrorCodesGame } from './types/ErrorCodes';
|
|
2
|
+
import { GBaseRequest } from './types/GRequest';
|
|
3
|
+
import { GResponseBase, GResponse } from './types/GResponse';
|
|
4
|
+
import { SAWSpinErrorCode } from './types/SmarticoProto/SAW/SAWDoSpinResponse';
|
|
5
|
+
export { ErrorCodes, ErrorCodesGame, SAWSpinErrorCode, GBaseRequest, GResponseBase, GResponse, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SAWSpinErrorCode } from "./SmarticoProto/SAW/SAWDoSpinResponse";
|
|
2
|
+
export declare const ErrorCodes_FatalStartingRange = 100000;
|
|
3
|
+
export declare enum ErrorCodesGame {
|
|
4
|
+
OK = 0,
|
|
5
|
+
NoBetsUpdatedOnSubmit = 3,
|
|
6
|
+
RepeatRequest_Unhandled = 4,
|
|
7
|
+
Fatal_NotValidHash,
|
|
8
|
+
Fatal_WrongCustomerID,
|
|
9
|
+
Fatal_TemplateNotFound,
|
|
10
|
+
Fatal_NoOpenRounds,
|
|
11
|
+
Fatal_Unhandled
|
|
12
|
+
}
|
|
13
|
+
export type ErrorCodes = SAWSpinErrorCode | ErrorCodesGame;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface GBaseRequest {
|
|
2
|
+
customer_id: string;
|
|
3
|
+
ext_user_id: string;
|
|
4
|
+
int_user_id: number;
|
|
5
|
+
smartico_ext_user_id: string;
|
|
6
|
+
ext_game_id: number;
|
|
7
|
+
lang: string;
|
|
8
|
+
hash: string;
|
|
9
|
+
zoom?: number;
|
|
10
|
+
label_api_key?: string;
|
|
11
|
+
brand_key?: string;
|
|
12
|
+
bridgeId?: string;
|
|
13
|
+
height?: 'auto' | string;
|
|
14
|
+
theme?: string;
|
|
15
|
+
}
|
|
16
|
+
export { GBaseRequest };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ResponseIdentifyLabelInfo } from "../SmarticoProto/PublicLabelInfo";
|
|
2
|
+
import { GamePickRoundBase } from "./GamePick";
|
|
3
|
+
import { SAWTemplate } from "../SmarticoProto/SAW/SAWTemplate";
|
|
4
|
+
interface GameInfo {
|
|
5
|
+
sawTemplate: SAWTemplate;
|
|
6
|
+
allRounds: GamePickRoundBase[];
|
|
7
|
+
labelInfo: ResponseIdentifyLabelInfo;
|
|
8
|
+
}
|
|
9
|
+
export { GameInfo };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
declare enum GamePickMarketType {
|
|
2
|
+
Goals = 1,
|
|
3
|
+
Winner = 2
|
|
4
|
+
}
|
|
5
|
+
declare enum GamePickResolutionType {
|
|
6
|
+
None = 0,
|
|
7
|
+
Lost = 2,
|
|
8
|
+
PartialWin = 3,
|
|
9
|
+
FullWin = 4
|
|
10
|
+
}
|
|
11
|
+
declare enum GPRoundStatus {
|
|
12
|
+
Other = -1,
|
|
13
|
+
NoEventsDefined = 1,
|
|
14
|
+
NoMoreBetsAllowed = 2,
|
|
15
|
+
AllEventsResolved_ButNotRound = 3,
|
|
16
|
+
RoundResolved = 4
|
|
17
|
+
}
|
|
18
|
+
interface GamePickEventMeta {
|
|
19
|
+
event_name?: string;
|
|
20
|
+
team1_name: string;
|
|
21
|
+
team1_image: string;
|
|
22
|
+
team2_name: string;
|
|
23
|
+
team2_image: string;
|
|
24
|
+
team1_result?: number;
|
|
25
|
+
team2_result?: number;
|
|
26
|
+
}
|
|
27
|
+
interface GamePickEvent {
|
|
28
|
+
gp_event_id: number;
|
|
29
|
+
event_resolution_date: number;
|
|
30
|
+
match_date: number;
|
|
31
|
+
market_type_id: GamePickMarketType;
|
|
32
|
+
event_meta: GamePickEventMeta;
|
|
33
|
+
user_placed_bet: boolean;
|
|
34
|
+
team1_user_selection: number;
|
|
35
|
+
team2_user_selection: number;
|
|
36
|
+
resolution_type_id: GamePickResolutionType;
|
|
37
|
+
resolution_score?: number;
|
|
38
|
+
is_open_for_bets?: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface GamePickRoundBase {
|
|
41
|
+
round_id: number;
|
|
42
|
+
round_row_id: number;
|
|
43
|
+
round_name: string;
|
|
44
|
+
round_description: string;
|
|
45
|
+
open_date: number;
|
|
46
|
+
last_bet_date: number;
|
|
47
|
+
resolution_date: number;
|
|
48
|
+
score_full_win: number;
|
|
49
|
+
score_part_win: number;
|
|
50
|
+
score_lost: number;
|
|
51
|
+
is_active_now: boolean;
|
|
52
|
+
is_resolved: boolean;
|
|
53
|
+
round_status_id: GPRoundStatus;
|
|
54
|
+
events_total: number;
|
|
55
|
+
events_resolved: number;
|
|
56
|
+
public_meta: {
|
|
57
|
+
round_name: string;
|
|
58
|
+
round_description: string;
|
|
59
|
+
_translations: {
|
|
60
|
+
[key: string]: {
|
|
61
|
+
round_name: string;
|
|
62
|
+
round_description: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
next_round_open_date: number;
|
|
67
|
+
}
|
|
68
|
+
interface GamePickRoundBoard extends GamePickRoundBase {
|
|
69
|
+
my_user: GamePickBoardUser;
|
|
70
|
+
users: GamePickBoardUser[];
|
|
71
|
+
}
|
|
72
|
+
interface GamePickRound extends GamePickRoundBase {
|
|
73
|
+
events: GamePickEvent[];
|
|
74
|
+
user_score: number;
|
|
75
|
+
user_placed_bet: boolean;
|
|
76
|
+
has_open_for_bet_events?: boolean;
|
|
77
|
+
has_not_submitted_changes?: boolean;
|
|
78
|
+
}
|
|
79
|
+
interface GamePickBoardUser {
|
|
80
|
+
ext_user_id: string;
|
|
81
|
+
int_user_id: number;
|
|
82
|
+
public_username: string;
|
|
83
|
+
avatar_url: string;
|
|
84
|
+
gp_position: number;
|
|
85
|
+
resolution_score: number;
|
|
86
|
+
full_wins_count: number;
|
|
87
|
+
part_wins_count: number;
|
|
88
|
+
lost_count: number;
|
|
89
|
+
}
|
|
90
|
+
export { GamePickRoundBase, GamePickRound, GamePickEvent, GamePickMarketType, GamePickResolutionType, GamePickEventMeta, GPRoundStatus, GamePickRoundBoard, GamePickBoardUser };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GameInfo } from "./GameInfo";
|
|
2
|
+
import { GamePickRound, GamePickRoundBase } from "./GamePick";
|
|
3
|
+
declare class GameUtil {
|
|
4
|
+
static getRoundName(round: GamePickRoundBase, gameInfo: GameInfo): string;
|
|
5
|
+
static getRoundDescription(round: GamePickRound, gameInfo: GameInfo): string;
|
|
6
|
+
}
|
|
7
|
+
export { GameUtil };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare enum PublicLabelSettings {
|
|
2
|
+
FCM_SENDER_ID = "FCM_SENDER_ID",
|
|
3
|
+
PUBLIC_API_URL = "PUBLIC_API_URL",
|
|
4
|
+
FCM_SW_URL = "FCM_SW_URL",
|
|
5
|
+
RECORDING_ENABLED_FOR_ALL_USERS = "RECORDING_ENABLED_FOR_ALL_USERS",
|
|
6
|
+
JS_INJECTION = "JS_INJECTION",
|
|
7
|
+
GAMIFICATION_UI_MAIN = "GAMIFICATION_UI_MAIN",
|
|
8
|
+
GAMIFICATION_UI_WIDGET = "GAMIFICATION_UI_WIDGET",
|
|
9
|
+
GAMIFICATION_UI_MINI_GAME = "GAMIFICATION_UI_MINI_GAME",
|
|
10
|
+
GAMIFICATION_UI_SETTINGS = "GAMIFICATION_UI_SETTINGS",
|
|
11
|
+
GAMIFICATION_UI_MAIN_TEST = "GAMIFICATION_UI_MAIN_TEST",
|
|
12
|
+
GAMIFICATION_UI_WIDGET_TEST = "GAMIFICATION_UI_WIDGET_TEST",
|
|
13
|
+
GAMIFICATION_UI_SETTINGS_TEST = "GAMIFICATION_UI_SETTINGS_TEST",
|
|
14
|
+
FRONT_END_ALLOWED_LANGUAGES = "FRONT_END_ALLOWED_LANGUAGES",
|
|
15
|
+
FRONT_END_ALLOW_DOMAINS = "FRONT_END_ALLOW_DOMAINS",
|
|
16
|
+
DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS = "DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS",
|
|
17
|
+
SHADOW_LABEL_PUBLIC_KEY = "SHADOW_LABEL_PUBLIC_KEY",
|
|
18
|
+
DYNAMIC_IMAGE_DOMAIN = "DYNAMIC_IMAGE_DOMAIN",
|
|
19
|
+
GAMIFICATION_UI_LEVEL_ENABLED = "GAMIFICATION_UI_LEVEL_ENABLED",
|
|
20
|
+
GAMIFICATION_UI_LEVEL_IMAGE_MOB = "GAMIFICATION_UI_LEVEL_IMAGE_MOB",
|
|
21
|
+
GAMIFICATION_UI_LEVEL_IMAGE_DESK = "GAMIFICATION_UI_LEVEL_IMAGE_DESK",
|
|
22
|
+
GAMIFICATION_LEVELS_LOGIC2 = "GAMIFICATION_LEVELS_LOGIC2",
|
|
23
|
+
AVATAR_CUSTOM_IMAGE_MAX_ID = "AVATAR_CUSTOM_IMAGE_MAX_ID",
|
|
24
|
+
AVATAR_CUSTOM_IMAGE_FOLDER = "AVATAR_CUSTOM_IMAGE_FOLDER",
|
|
25
|
+
RETENTION_GAMES_CUSTOMER_ID = "RETENTION_GAMES_CUSTOMER_ID",
|
|
26
|
+
GAMIFICATION_SHOW_POWERED_BY = "GAMIFICATION_SHOW_POWERED_BY",
|
|
27
|
+
_system_leader_board_mask_username = "_system_leader_board_mask_username"
|
|
28
|
+
}
|
|
29
|
+
export interface ResponseIdentifyLabelInfo {
|
|
30
|
+
settings: {
|
|
31
|
+
[key: string]: string;
|
|
32
|
+
};
|
|
33
|
+
label_id: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PublicProperties {
|
|
2
|
+
core_user_language?: string;
|
|
3
|
+
ach_points_balance?: number;
|
|
4
|
+
ach_points_ever?: number;
|
|
5
|
+
ach_points_board_period_type_1?: number;
|
|
6
|
+
ach_points_board_period_type_2?: number;
|
|
7
|
+
ach_level_current_id?: number;
|
|
8
|
+
ach_level_current?: string;
|
|
9
|
+
core_is_test_account?: boolean;
|
|
10
|
+
ach_gamification_in_control_group?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProtocolResponse } from "./ProtocolResponse";
|
|
2
|
+
import { PublicProperties } from "./PublicProperties";
|
|
3
|
+
interface ResponseIdentify extends ProtocolResponse {
|
|
4
|
+
user_id: number;
|
|
5
|
+
ext_user_id: string;
|
|
6
|
+
public_username: string;
|
|
7
|
+
avatar_id: string;
|
|
8
|
+
job: boolean;
|
|
9
|
+
props?: PublicProperties;
|
|
10
|
+
pubic_username_set: boolean;
|
|
11
|
+
}
|
|
12
|
+
export { ResponseIdentify };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProtocolResponse } from "../ProtocolResponse";
|
|
2
|
+
export declare enum SAWSpinErrorCode {
|
|
3
|
+
SAW_OK = 0,
|
|
4
|
+
SAW_NO_SPINS = 40001,
|
|
5
|
+
SAW_PRIZE_POOL_EMPTY = 40002,
|
|
6
|
+
SAW_NOT_ENOUGH_POINTS = 40003,
|
|
7
|
+
SAW_FAILED_MAX_SPINS_REACHED = 40004
|
|
8
|
+
}
|
|
9
|
+
export interface SAWDoSpinResponse extends ProtocolResponse {
|
|
10
|
+
errCode: SAWSpinErrorCode;
|
|
11
|
+
errMsg?: string;
|
|
12
|
+
request_id: string;
|
|
13
|
+
saw_prize_id: number;
|
|
14
|
+
first_spin_in_period: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SAWPrizeType } from "./SAWPrizeType";
|
|
2
|
+
import { SAWPrizeUI } from "./SAWPrizeUI";
|
|
3
|
+
export interface SAWPrize {
|
|
4
|
+
saw_prize_id: number;
|
|
5
|
+
saw_prize_ui_definition: SAWPrizeUI;
|
|
6
|
+
prize_value?: number;
|
|
7
|
+
prize_type_id: SAWPrizeType;
|
|
8
|
+
place_from?: number;
|
|
9
|
+
place_to?: number;
|
|
10
|
+
sawUniqueWinId?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SAWAcknowledgeType } from "./SAWAcknowledgeType";
|
|
2
|
+
import { SAWWinSoundType } from "./SAWWinSoundType";
|
|
3
|
+
export interface SAWPrizeUI {
|
|
4
|
+
position?: number;
|
|
5
|
+
name: string;
|
|
6
|
+
aknowledge_message: string;
|
|
7
|
+
sectors: number[];
|
|
8
|
+
acknowledge_type: SAWAcknowledgeType;
|
|
9
|
+
acknowledge_dp?: string;
|
|
10
|
+
font_size?: number;
|
|
11
|
+
sound_type: SAWWinSoundType;
|
|
12
|
+
icon?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SAWBuyInType } from "./SAWBuyInType";
|
|
2
|
+
import { SAWGameType } from "./SAWGameType";
|
|
3
|
+
import { SAWPrize } from "./SAWPrize";
|
|
4
|
+
import { SAWTemplateUI } from "./SAWTemplateUI";
|
|
5
|
+
export interface SAWTemplate {
|
|
6
|
+
saw_template_id: number;
|
|
7
|
+
saw_game_type_id: SAWGameType;
|
|
8
|
+
saw_template_ui_definition: SAWTemplateUI;
|
|
9
|
+
saw_buyin_type_id: SAWBuyInType;
|
|
10
|
+
buyin_cost_points?: number;
|
|
11
|
+
visibile_when_can_spin: boolean;
|
|
12
|
+
spin_count?: number;
|
|
13
|
+
prizes: SAWPrize[];
|
|
14
|
+
is_visible: boolean;
|
|
15
|
+
jackpot_add_on_attempt: number;
|
|
16
|
+
jackpot_current: number;
|
|
17
|
+
jackpot_guaranteed: number;
|
|
18
|
+
maxActiveSpinsAllowed: number;
|
|
19
|
+
maxSpinsCount: number;
|
|
20
|
+
maxSpinsPediodMs: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare enum AskForUsername {
|
|
2
|
+
NOASK = "no-ask",
|
|
3
|
+
ONSUMBIT = "on-submit"
|
|
4
|
+
}
|
|
5
|
+
export interface SAWTemplateUI {
|
|
6
|
+
skin: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
over_limit_message?: string;
|
|
10
|
+
no_attempts_message?: string;
|
|
11
|
+
thumbnail?: string;
|
|
12
|
+
sectors_count: number;
|
|
13
|
+
priority: number;
|
|
14
|
+
flow_builder_only: boolean;
|
|
15
|
+
background_image?: string;
|
|
16
|
+
background_image_mobile?: string;
|
|
17
|
+
background_sound?: string;
|
|
18
|
+
scratch_logo?: string;
|
|
19
|
+
scratch_cover?: string;
|
|
20
|
+
scratch_bg_desktop?: string;
|
|
21
|
+
scratch_bg_mobile?: string;
|
|
22
|
+
scratch_cursor?: string;
|
|
23
|
+
custom_css?: string;
|
|
24
|
+
custom_skin_folder?: string;
|
|
25
|
+
jackpot_symbol?: string;
|
|
26
|
+
promo_image?: string;
|
|
27
|
+
promo_text?: string;
|
|
28
|
+
ask_for_username?: AskForUsername;
|
|
29
|
+
show_prize_board?: boolean;
|
|
30
|
+
max_spins_period_ms?: number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { TSMap } from "typescript-map";
|
|
2
|
+
declare class Util {
|
|
3
|
+
private constructor();
|
|
4
|
+
static isNumber(value: string): boolean;
|
|
5
|
+
static parseNumber(v: string): number | null;
|
|
6
|
+
static parseBoolean(v: string | boolean): boolean | null;
|
|
7
|
+
static escapeRegExp(v: string): string;
|
|
8
|
+
static nullToEmpty(val: string): string;
|
|
9
|
+
static nullTo0(val: number): number;
|
|
10
|
+
static isNotEmpty(val: string): boolean;
|
|
11
|
+
static isNotNull(val: any): boolean;
|
|
12
|
+
static isNull(val: any): boolean;
|
|
13
|
+
static isArrayNotEmpty(val: any[]): boolean;
|
|
14
|
+
static isArrayEmpty(val: any[]): boolean;
|
|
15
|
+
static isObjectEmpty(val: any): boolean;
|
|
16
|
+
static isMapNotEmpty(val: TSMap<any, any>): boolean;
|
|
17
|
+
static isMapEmpty(val: TSMap<any, any>): boolean;
|
|
18
|
+
static objectToMap<K, V>(obj: any): TSMap<K, V> | null;
|
|
19
|
+
static keyByValue(obj: any, value: any): string | null;
|
|
20
|
+
static greaterThen0(val: number): boolean;
|
|
21
|
+
static not0(val: number): boolean;
|
|
22
|
+
static lessThen0(val: number): boolean;
|
|
23
|
+
static compareUndefined(o1: any, o2: any): number;
|
|
24
|
+
static compareArrayLength<T>(o1: T[], o2: T[]): number;
|
|
25
|
+
static compareObject(a: {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}, b: {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}): boolean;
|
|
30
|
+
static compareArrays<T>(arr1: T[], arr2: T[], comparator: (t1: T, t2: T) => number): number;
|
|
31
|
+
static compareBool(o1: boolean, o2: boolean): number;
|
|
32
|
+
static compareNumber(o1: number, o2: number): number;
|
|
33
|
+
static compareString(o1: string, o2: string): number;
|
|
34
|
+
static range(from: number, to: number): number[];
|
|
35
|
+
static has(array: any[], val: any): boolean;
|
|
36
|
+
static isEmpty(val: string): boolean;
|
|
37
|
+
static checkNotNull<T>(reference: T, msg?: string): T;
|
|
38
|
+
static randomInt(min: number, max: number): number;
|
|
39
|
+
static randomArr<T>(arr: T[]): T | undefined;
|
|
40
|
+
static remove<T>(arr: T[], item: T): boolean;
|
|
41
|
+
static replaceAll(value: string, regex: string, replacement: string | number): string;
|
|
42
|
+
static to<T, U = any>(promise: Promise<T>, errorExt?: object): Promise<[U | null, T | undefined]>;
|
|
43
|
+
static isObject(item: any): boolean;
|
|
44
|
+
static merge(target: any, ...sources: any[]): any;
|
|
45
|
+
static deepCopy(source: object): object;
|
|
46
|
+
static uuid: () => string;
|
|
47
|
+
static getStackTrace(): string | undefined;
|
|
48
|
+
static shuffleArray(array: any[]): any[];
|
|
49
|
+
static buildValidationHash(ext_user_id: string, ext_game_id: number, customer_id: string, secretKey: string): string;
|
|
50
|
+
}
|
|
51
|
+
export { Util };
|
|
@@ -64,4 +64,4 @@ ___
|
|
|
64
64
|
|
|
65
65
|
Custom data as string or JSON string that can be used in API to build custom UI
|
|
66
66
|
You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
67
|
-
Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
|
|
67
|
+
Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
|
|
@@ -48,6 +48,7 @@ ___
|
|
|
48
48
|
• **execution\_type**: [`RaffleDrawTypeExecution`](../enums/RaffleDrawTypeExecution.md)
|
|
49
49
|
|
|
50
50
|
Type of the draw execution, indicating how and when the draw is executed.
|
|
51
|
+
|
|
51
52
|
- ExecDate: Draw is executed only once at a specific date and time.
|
|
52
53
|
- Recurring: Draw is executed on a recurring basis (e.g., daily, weekly).
|
|
53
54
|
- Grand: Draw is executed once and is marked as grand, often with larger prizes or more importance.
|
|
@@ -83,9 +84,9 @@ ___
|
|
|
83
84
|
• **ticket\_start\_ts**: `number`
|
|
84
85
|
|
|
85
86
|
Date/time starting from which the tickets will participate in the upcoming draw
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
This value need to be taken into account with next_execute_ts field value, for example
|
|
88
|
+
Next draw is at 10:00, ticket_start_date is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00
|
|
89
|
+
(internally this value is calculated as next_execute_ts - ticket_start_date)
|
|
89
90
|
|
|
90
91
|
___
|
|
91
92
|
|
|
@@ -93,13 +94,13 @@ ___
|
|
|
93
94
|
|
|
94
95
|
• **allow\_multi\_prize\_per\_ticket**: `boolean`
|
|
95
96
|
|
|
96
|
-
Field is indicating if same ticket can win multiple prizes in the same draw
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
Field is indicating if same ticket can win multiple prizes in the same draw
|
|
98
|
+
For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook
|
|
99
|
+
If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),
|
|
100
|
+
if false, then one ticket can win only one prize.
|
|
101
|
+
The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)
|
|
102
|
+
If specific prize has multiple values, e.g. we have 3 iPhones,
|
|
103
|
+
then the same ticket can win only one prize of a kind, but can win multiple prizes of different kind (if allow_multi_prize_per_ticket is true)
|
|
103
104
|
|
|
104
105
|
___
|
|
105
106
|
|
|
@@ -123,3 +124,5 @@ ___
|
|
|
123
124
|
### my\_last\_tickets
|
|
124
125
|
|
|
125
126
|
• **my\_last\_tickets**: [`RaffleTicket`](RaffleTicket.md)[]
|
|
127
|
+
|
|
128
|
+
List of last 5 tickets are collected by current user for this instance of draw.
|
|
@@ -35,20 +35,22 @@ ___
|
|
|
35
35
|
|
|
36
36
|
The actual number of prizes for the current instance.
|
|
37
37
|
This value is taking into account follwing values:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
|
|
39
|
+
- min_required_total_tickets,
|
|
40
|
+
- add_one_prize_per_each_x_tickets
|
|
41
|
+
- stock_items_per_draw
|
|
42
|
+
- total_tickets_count (from Draw instance)
|
|
43
|
+
- cap_prizes_per_run
|
|
43
44
|
For example:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
|
|
46
|
+
- prizes_per_run = 1
|
|
47
|
+
- min_required_total_tickets = 1000
|
|
48
|
+
- add_one_prize_per_each_x_tickets = 1000
|
|
49
|
+
- stock_items_per_draw = 5
|
|
50
|
+
- total_tickets_count = 7000
|
|
51
|
+
- cap_prizes_per_run = 6
|
|
52
|
+
prizes_per_run_actual will be 5, because
|
|
53
|
+
7000 tickets are collected, so 7 iPhones are available, but the cap is 6 and the stock is 5.
|
|
52
54
|
|
|
53
55
|
___
|
|
54
56
|
|
|
@@ -56,8 +58,8 @@ ___
|
|
|
56
58
|
|
|
57
59
|
• **chances\_to\_win\_perc**: `number`
|
|
58
60
|
|
|
59
|
-
The chances to win the prize by current player.
|
|
60
|
-
Calculated as the ratio of the number of tickets collected by the current player to the
|
|
61
|
+
The chances to win the prize by current player.
|
|
62
|
+
Calculated as the ratio of the number of tickets collected by the current player to the
|
|
61
63
|
total number of tickets collected by all players and multiplied by number of actual prizes of this kind.
|
|
62
64
|
|
|
63
65
|
___
|
|
@@ -107,7 +109,7 @@ ___
|
|
|
107
109
|
• `Optional` **cap\_prizes\_per\_run**: `number`
|
|
108
110
|
|
|
109
111
|
The maximum number of prizes that can be given within one instance/run of draw.
|
|
110
|
-
For example the prize is iPhone and add_one_prize_per_each_x_tickets is set to 1000,
|
|
112
|
+
For example the prize is iPhone and add_one_prize_per_each_x_tickets is set to 1000,
|
|
111
113
|
cap_prizes_per_run is set to 3, and the total number of tickets collected is 7000.
|
|
112
114
|
In this case, the prizes_per_run_actual will be limited by 3
|
|
113
115
|
|
|
@@ -56,4 +56,4 @@ ___
|
|
|
56
56
|
|
|
57
57
|
Custom data as string or JSON string that can be used in API to build custom UI
|
|
58
58
|
You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
59
|
-
Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
|
|
59
|
+
Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
|