@smartico/public-api 0.0.141 → 0.0.143
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/README.md +14 -1
- package/dist/CustomSections/AchCustomSection.d.ts +27 -0
- package/dist/CustomSections/GetCustomSectionsRequest.d.ts +3 -0
- package/dist/CustomSections/GetCustomSectionsResponse.d.ts +7 -0
- package/dist/CustomSections/UICustomSection.d.ts +15 -0
- package/dist/CustomSections/index.d.ts +4 -0
- package/dist/Missions/AchievementPublicMeta.d.ts +1 -0
- package/dist/Missions/UserAchievement.d.ts +1 -0
- package/dist/OCache.d.ts +1 -0
- package/dist/SmarticoAPI.d.ts +17 -14
- package/dist/WSAPI/WSAPI.d.ts +270 -48
- package/dist/WSAPI/WSAPITypes.d.ts +25 -0
- package/dist/index.js +559 -214
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +382 -95
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +1 -0
- package/docs/classes/WSAPI.md +234 -27
- package/docs/enums/AchCustomLayoutTheme.md +27 -0
- package/docs/enums/AchCustomSectionType.md +43 -0
- package/docs/enums/AchMissionsTabsOptions.md +21 -0
- package/docs/enums/AchOverviewMissionsFilter.md +33 -0
- package/docs/interfaces/TUICustomSection.md +85 -0
- package/package.json +1 -1
- package/src/CustomSections/AchCustomSection.ts +30 -0
- package/src/CustomSections/GetCustomSectionsRequest.ts +5 -0
- package/src/CustomSections/GetCustomSectionsResponse.ts +7 -0
- package/src/CustomSections/UICustomSection.ts +34 -0
- package/src/CustomSections/index.ts +4 -0
- package/src/Level/GetLevelMapResponse.ts +1 -1
- package/src/Missions/AchievementPublicMeta.ts +1 -0
- package/src/Missions/UserAchievement.ts +3 -1
- package/src/OCache.ts +5 -0
- package/src/SmarticoAPI.ts +42 -34
- package/src/WSAPI/WSAPI.ts +296 -64
- package/src/WSAPI/WSAPITypes.ts +27 -0
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ and for terms of API usage
|
|
|
13
13
|
|
|
14
14
|
To use the API you need the smartico.js library installed and initialized on your site according to this guide https://help.smartico.ai/welcome/technical-guides/front-end-integration
|
|
15
15
|
|
|
16
|
-
As soon as the _smartico object is available in the global context and the user is identified, you can call API methods to get the data or act on behalf of the logged-in user.
|
|
16
|
+
As soon as the **_smartico** object is available in the global context of the browser window and the user is identified, you can call API methods to get the data or act on behalf of the logged-in user.
|
|
17
17
|
|
|
18
18
|
```javascript
|
|
19
19
|
|
|
@@ -40,6 +40,19 @@ _smartico.api.getMiniGames( { onUpdate: miniGamesUpdates} ).then( games => {
|
|
|
40
40
|
|
|
41
41
|
See the [API documentation](docs/classes/WSAPI.md) for all available methods and returning data.
|
|
42
42
|
|
|
43
|
+
## Visitor mode
|
|
44
|
+
|
|
45
|
+
You can also get gamification data for the visitors (not authorized users).
|
|
46
|
+
|
|
47
|
+
Calls to the methods look similar, with the only exception that you need to use **_smartico.vapi('EN')** method in order to get access to the Visitor API object with specific language.
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
|
|
51
|
+
_smartico.vapi('EN').getLevels().then( levels => {
|
|
52
|
+
console.log('There are ' + levels.length + ' levels available');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
```
|
|
43
56
|
|
|
44
57
|
## Backend usage (NodeJS context)
|
|
45
58
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum AchCustomSectionType {
|
|
2
|
+
HTML_PAGE = 1,
|
|
3
|
+
MISSIONS_CATEGORY = 2,
|
|
4
|
+
TOURNAMENTS_CATEGORY = 3,
|
|
5
|
+
LEVELS = 4,
|
|
6
|
+
MINI_GAMES = 5,
|
|
7
|
+
MISSION_CUSTOM_LAYOUT = 6,
|
|
8
|
+
MATCH_X = 7
|
|
9
|
+
}
|
|
10
|
+
export declare enum AchCustomLayoutTheme {
|
|
11
|
+
VALENTINES_LIGHT = "valentines-light",
|
|
12
|
+
VALENTINES_DARK = "valentines-dark",
|
|
13
|
+
EURO_2024 = "euro-2024",
|
|
14
|
+
GENERIC = "generic"
|
|
15
|
+
}
|
|
16
|
+
export declare enum AchMissionsTabsOptions {
|
|
17
|
+
ONLY_OVERVIEW = 1,
|
|
18
|
+
NO_OVERVIEW = 2,
|
|
19
|
+
ALL = 3
|
|
20
|
+
}
|
|
21
|
+
export declare enum AchOverviewMissionsFilter {
|
|
22
|
+
ANY = 1,
|
|
23
|
+
ALL_MISSIONS = 2,
|
|
24
|
+
ALL_EXCEPT_COMPLETED = 3,
|
|
25
|
+
ALL_EXCEPT_LOCKED = 4,
|
|
26
|
+
ALL_EXCEPT_COMPLETED_AND_LOCKED = 5
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TUICustomSection } from "../WSAPI/WSAPITypes";
|
|
2
|
+
import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from "./AchCustomSection";
|
|
3
|
+
export interface UICustomSection {
|
|
4
|
+
body?: string;
|
|
5
|
+
menu_img?: string;
|
|
6
|
+
menu_name?: string;
|
|
7
|
+
custom_skin_images?: string;
|
|
8
|
+
section_type_id?: AchCustomSectionType;
|
|
9
|
+
theme?: AchCustomLayoutTheme;
|
|
10
|
+
generic_custom_css?: string;
|
|
11
|
+
mission_tabs_options?: AchMissionsTabsOptions;
|
|
12
|
+
overview_missions_filter?: AchOverviewMissionsFilter;
|
|
13
|
+
overview_missions_count?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const UICustomSectionTransform: (items: UICustomSection[]) => TUICustomSection[];
|
|
@@ -34,5 +34,6 @@ export interface UserAchievement {
|
|
|
34
34
|
completed_today?: boolean;
|
|
35
35
|
completed_this_week?: boolean;
|
|
36
36
|
completed_this_month?: boolean;
|
|
37
|
+
custom_section_type_id?: number;
|
|
37
38
|
}
|
|
38
39
|
export declare const UserAchievementTransform: (items: UserAchievement[]) => TMissionOrBadge[];
|
package/dist/OCache.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export declare class OCache {
|
|
|
11
11
|
static use<T>(oKey: any, cacheContext: ECacheContext, f: () => Promise<T>, ttlSeconds?: number): Promise<T>;
|
|
12
12
|
static clear(cacheContext: ECacheContext, oKey: any): Promise<void>;
|
|
13
13
|
static clearContext(cacheContext: ECacheContext): Promise<void>;
|
|
14
|
+
static clearAll(): Promise<void>;
|
|
14
15
|
}
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -11,9 +11,10 @@ import { GetTournamentInfoResponse, GetTournamentsResponse, TournamentRegisterRe
|
|
|
11
11
|
import { LeaderBoardDetails, LeaderBoardPeriodType } from "./Leaderboard";
|
|
12
12
|
import { GetLevelMapResponse } from "./Level";
|
|
13
13
|
import { WSAPI } from "./WSAPI/WSAPI";
|
|
14
|
-
import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed, LeaderBoardDetailsT, UserLevelExtraCountersT, TSegmentCheckResult } from "./WSAPI/WSAPITypes";
|
|
14
|
+
import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed, LeaderBoardDetailsT, UserLevelExtraCountersT, TSegmentCheckResult, TUICustomSection } from "./WSAPI/WSAPITypes";
|
|
15
15
|
import { GetAchievementsUserInfoResponse } from "./Core/GetAchievementsUserInfoResponse";
|
|
16
|
-
import {
|
|
16
|
+
import { GetJackpotsPotsResponse, GetJackpotsResponse, JackpotsOptinResponse, JackpotsOptoutResponse } from "./Jackpots";
|
|
17
|
+
import { GetCustomSectionsResponse } from "./CustomSections";
|
|
17
18
|
interface Tracker {
|
|
18
19
|
label_api_key: string;
|
|
19
20
|
userPublicProps: any;
|
|
@@ -60,17 +61,17 @@ declare class SmarticoAPI {
|
|
|
60
61
|
jackpotGet(user_ext_id: string, filter?: {
|
|
61
62
|
related_game_id?: string;
|
|
62
63
|
jp_template_id?: number;
|
|
63
|
-
}): Promise<
|
|
64
|
+
}, force_language?: string): Promise<GetJackpotsResponse>;
|
|
64
65
|
potGet(user_ext_id: string, filter: {
|
|
65
66
|
jp_template_ids: number[];
|
|
66
|
-
}): Promise<
|
|
67
|
+
}): Promise<GetJackpotsPotsResponse>;
|
|
67
68
|
jackpotOptIn(user_ext_id: string, payload: {
|
|
68
69
|
jp_template_id: number;
|
|
69
70
|
}): Promise<JackpotsOptinResponse>;
|
|
70
71
|
jackpotOptOut(user_ext_id: string, payload: {
|
|
71
72
|
jp_template_id: number;
|
|
72
73
|
}): Promise<JackpotsOptoutResponse>;
|
|
73
|
-
sawGetTemplates(user_ext_id: string,
|
|
74
|
+
sawGetTemplates(user_ext_id: string, force_language?: string, is_visitor_mode?: boolean): Promise<SAWGetTemplatesResponse>;
|
|
74
75
|
sawGetTemplatesT(user_ext_id: string): Promise<TMiniGameTemplate[]>;
|
|
75
76
|
doAcknowledgeRequest(user_ext_id: string, request_id: string): Promise<SAWDoAknowledgeResponse>;
|
|
76
77
|
sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id?: number): Promise<SAWDoSpinResponse>;
|
|
@@ -79,28 +80,30 @@ declare class SmarticoAPI {
|
|
|
79
80
|
registerInTournament(user_ext_id: string, tournamentInstanceId: number): Promise<TournamentRegisterResponse>;
|
|
80
81
|
buyStoreItem(user_ext_id: string, itemId: number): Promise<BuyStoreItemResponse>;
|
|
81
82
|
inboxGetMessages(user_ext_id: string, limit?: number, offset?: number): Promise<GetInboxMessagesResponse>;
|
|
82
|
-
storeGetItems(user_ext_id: string): Promise<GetStoreItemsResponse>;
|
|
83
|
+
storeGetItems(user_ext_id: string, force_language?: string): Promise<GetStoreItemsResponse>;
|
|
83
84
|
storeGetItemsT(user_ext_id: string): Promise<TStoreItem[]>;
|
|
84
|
-
storeGetCategories(user_ext_id: string): Promise<GetCategoriesStoreResponse>;
|
|
85
|
+
storeGetCategories(user_ext_id: string, force_language?: string): Promise<GetCategoriesStoreResponse>;
|
|
85
86
|
storeGetCategoriesT(user_ext_id: string): Promise<TStoreCategory[]>;
|
|
86
87
|
storeGetPurchasedItems(user_ext_id: string, limit?: number, offset?: number): Promise<GetStoreHistoryResponse>;
|
|
87
88
|
storeGetPurchasedItemsT(user_ext_id: string, limit?: number, offset?: number): Promise<TStoreItem[]>;
|
|
88
|
-
missionsGetItems(user_ext_id: string): Promise<GetAchievementMapResponse>;
|
|
89
|
+
missionsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse>;
|
|
89
90
|
missionsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]>;
|
|
90
91
|
getUserGamificationInfo(user_ext_id: string): Promise<GetAchievementsUserInfoResponse>;
|
|
91
92
|
getUserGamificationInfoT(user_ext_id: string): Promise<UserLevelExtraCountersT>;
|
|
92
|
-
achGetCategories(user_ext_id: string): Promise<GetAchCategoriesResponse>;
|
|
93
|
+
achGetCategories(user_ext_id: string, force_language?: string): Promise<GetAchCategoriesResponse>;
|
|
93
94
|
achGetCategoriesT(user_ext_id: string): Promise<TAchCategory[]>;
|
|
94
|
-
badgetsGetItems(user_ext_id: string): Promise<GetAchievementMapResponse>;
|
|
95
|
+
badgetsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse>;
|
|
95
96
|
badgetsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]>;
|
|
96
|
-
tournamentsGetLobby(user_ext_id: string): Promise<GetTournamentsResponse>;
|
|
97
|
+
tournamentsGetLobby(user_ext_id: string, force_language?: string): Promise<GetTournamentsResponse>;
|
|
97
98
|
tournamentsGetLobbyT(user_ext_id: string): Promise<TTournament[]>;
|
|
98
|
-
tournamentsGetInfo(user_ext_id: string, tournamentInstanceId: number): Promise<GetTournamentInfoResponse>;
|
|
99
|
+
tournamentsGetInfo(user_ext_id: string, tournamentInstanceId: number, force_language?: string): Promise<GetTournamentInfoResponse>;
|
|
99
100
|
tournamentsGetInfoT(user_ext_id: string, tournamentInstanceId: number): Promise<TTournamentDetailed>;
|
|
100
|
-
leaderboardGet(user_ext_id: string, period_type_id?: LeaderBoardPeriodType, prevPeriod?: boolean): Promise<LeaderBoardDetails>;
|
|
101
|
+
leaderboardGet(user_ext_id: string, period_type_id?: LeaderBoardPeriodType, prevPeriod?: boolean, force_language?: string): Promise<LeaderBoardDetails>;
|
|
101
102
|
leaderboardsGetT(user_ext_id: string, period_type_id?: LeaderBoardPeriodType, prevPeriod?: boolean): Promise<LeaderBoardDetailsT>;
|
|
102
|
-
levelsGet(user_ext_id: string): Promise<GetLevelMapResponse>;
|
|
103
|
+
levelsGet(user_ext_id: string, force_language?: string): Promise<GetLevelMapResponse>;
|
|
103
104
|
levelsGetT(user_ext_id: string): Promise<TLevel[]>;
|
|
105
|
+
getCustomSections(user_ext_id: string): Promise<GetCustomSectionsResponse>;
|
|
106
|
+
getCustomSectionsT(user_ext_id: string): Promise<TUICustomSection[]>;
|
|
104
107
|
getTranslationsT(user_ext_id: string, lang_code: string, areas: TranslationArea[], cacheSec?: number): Promise<GetTranslationsResponse>;
|
|
105
108
|
getInboxMessages(user_ext_id: string, limit: number, offset: number, starred_only: boolean): Promise<GetInboxMessagesResponse>;
|
|
106
109
|
getInboxMessagesT(user_ext_id: string, from?: number, to?: number, favoriteOnly?: boolean): Promise<TInboxMessage[]>;
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SmarticoAPI } from "../SmarticoAPI";
|
|
2
|
-
import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUserProfile, UserLevelExtraCountersT } from "./WSAPITypes";
|
|
2
|
+
import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUICustomSection, TUserProfile, UserLevelExtraCountersT } from "./WSAPITypes";
|
|
3
3
|
import { LeaderBoardPeriodType } from "../Leaderboard";
|
|
4
4
|
import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from "../Jackpots";
|
|
5
5
|
/** @group General API */
|
|
@@ -10,37 +10,49 @@ export declare class WSAPI {
|
|
|
10
10
|
/** @private */
|
|
11
11
|
constructor(api: SmarticoAPI);
|
|
12
12
|
/** Returns information about current user
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
|
+
* **Example**:
|
|
14
15
|
* ```
|
|
15
16
|
* _smartico.api.getUserProfile().then((result) => {
|
|
16
17
|
* console.log(result);
|
|
17
18
|
* });
|
|
18
19
|
* ```
|
|
20
|
+
* **Visitor mode: not supported**
|
|
19
21
|
* */
|
|
20
22
|
getUserProfile(): TUserProfile;
|
|
21
23
|
/** Check if user belongs to specific segments
|
|
22
|
-
* Example
|
|
24
|
+
* **Example**:
|
|
23
25
|
* ```
|
|
24
26
|
* _smartico.api.checkSegmentMatch(1).then((result) => {
|
|
25
27
|
* console.log(result);
|
|
26
28
|
* });
|
|
27
29
|
* ```
|
|
30
|
+
*
|
|
31
|
+
* **Visitor mode: not supported**
|
|
28
32
|
*/
|
|
29
33
|
checkSegmentMatch(segment_id: number): Promise<boolean>;
|
|
30
34
|
/** Check if user belongs to specific list of segments
|
|
31
|
-
* Example
|
|
35
|
+
* **Example**:
|
|
32
36
|
* ```
|
|
33
37
|
* _smartico.api.checkSegmentListMatch([1, 2, 3]).then((result) => {
|
|
34
38
|
* console.log(result);
|
|
35
39
|
* });
|
|
36
40
|
* ```
|
|
41
|
+
* **Visitor mode: not supported**
|
|
37
42
|
*/
|
|
38
43
|
checkSegmentListMatch(segment_ids: number[]): Promise<TSegmentCheckResult[]>;
|
|
39
44
|
/** Returns all the levels available the current user
|
|
40
|
-
* Example
|
|
45
|
+
* **Example**:
|
|
41
46
|
* ```
|
|
42
47
|
* _smartico.api.getLevels().then((result) => {
|
|
43
|
-
*
|
|
48
|
+
* console.log(result);
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* **Example in the Visitor mode**:
|
|
53
|
+
* ```
|
|
54
|
+
* _smartico.vapi('EN').getLevels().then((result) => {
|
|
55
|
+
* console.log(result);
|
|
44
56
|
* });
|
|
45
57
|
* ```
|
|
46
58
|
*/
|
|
@@ -49,98 +61,262 @@ export declare class WSAPI {
|
|
|
49
61
|
* The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
50
62
|
* Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
51
63
|
* The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
|
|
52
|
-
*
|
|
64
|
+
*
|
|
65
|
+
* **Example**:
|
|
53
66
|
* ```
|
|
54
67
|
* _smartico.api.getMissions().then((result) => {
|
|
55
|
-
*
|
|
68
|
+
* console.log(result);
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* **Example in the Visitor mode**:
|
|
73
|
+
* ```
|
|
74
|
+
* _smartico.vapi('EN').getMissions().then((result) => {
|
|
75
|
+
* console.log(result);
|
|
56
76
|
* });
|
|
57
77
|
* ```
|
|
58
|
-
/**
|
|
59
|
-
* @param params
|
|
60
78
|
*/
|
|
61
79
|
getMissions({ onUpdate }?: {
|
|
62
80
|
onUpdate?: (data: TMissionOrBadge[]) => void;
|
|
63
81
|
}): Promise<TMissionOrBadge[]>;
|
|
64
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Returns all the badges available the current user
|
|
84
|
+
*
|
|
85
|
+
* **Visitor mode: not supported**
|
|
86
|
+
*/
|
|
65
87
|
getBadges(): Promise<TMissionOrBadge[]>;
|
|
66
88
|
/**
|
|
67
89
|
* Returns the extra counters for the current user level.
|
|
68
90
|
* These are counters that are configured for each Smartico client separatly by request.
|
|
69
91
|
* For example 1st counter could be total wagering amount, 2nd counter could be total deposit amount, etc.
|
|
70
|
-
*
|
|
92
|
+
*
|
|
93
|
+
* **Example**:
|
|
71
94
|
* ```
|
|
72
95
|
* _smartico.api.getUserLevelExtraCounters().then((result) => {
|
|
73
96
|
* console.log(result);
|
|
74
97
|
* });
|
|
75
98
|
* ```
|
|
99
|
+
*
|
|
100
|
+
* **Visitor mode: not supported**
|
|
76
101
|
*/
|
|
77
102
|
getUserLevelExtraCounters(): Promise<UserLevelExtraCountersT>;
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* Returns all the store items available the current user
|
|
106
|
+
*
|
|
107
|
+
* **Example**:
|
|
80
108
|
* ```
|
|
81
109
|
* _smartico.api.getStoreItems().then((result) => {
|
|
82
110
|
* console.log(result);
|
|
83
111
|
* });
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* **Example in the Visitor mode**:
|
|
115
|
+
* ```
|
|
116
|
+
* _smartico.vapi('EN').getStoreItems().then((result) => {
|
|
117
|
+
* console.log(result);
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
84
120
|
*/
|
|
85
121
|
getStoreItems(): Promise<TStoreItem[]>;
|
|
86
122
|
/** Buy the specific shop item by item_id. Returns the err_code in case of success or error.
|
|
87
|
-
* Example
|
|
123
|
+
* **Example**:
|
|
88
124
|
* ```
|
|
89
125
|
* _smartico.api.buyStoreItem(1).then((result) => {
|
|
90
126
|
* console.log(result);
|
|
91
127
|
* });
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* **Visitor mode: not supported**
|
|
92
131
|
*/
|
|
93
132
|
buyStoreItem(item_id: number): Promise<TBuyStoreItemResult>;
|
|
94
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
* Returns store categories
|
|
136
|
+
*
|
|
137
|
+
* **Example**:
|
|
138
|
+
* ```
|
|
139
|
+
* _smartico.api.getStoreCategories().then((result) => {
|
|
140
|
+
* console.log(result);
|
|
141
|
+
* });
|
|
142
|
+
* ```
|
|
143
|
+
*
|
|
144
|
+
* **Example in the Visitor mode**:
|
|
145
|
+
* ```
|
|
146
|
+
* _smartico.vapi('EN').getStoreCategories().then((result) => {
|
|
147
|
+
* console.log(result);
|
|
148
|
+
* });
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
95
151
|
getStoreCategories(): Promise<TStoreCategory[]>;
|
|
96
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
|
|
97
154
|
* The maximum number of items per request is limited to 20.
|
|
98
155
|
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
99
|
-
*
|
|
156
|
+
*
|
|
157
|
+
* **Example**:
|
|
100
158
|
* ```
|
|
101
159
|
* _smartico.api.getStorePurchasedItems().then((result) => {
|
|
102
160
|
* console.log(result);
|
|
103
161
|
* });
|
|
104
162
|
* ```
|
|
163
|
+
*
|
|
164
|
+
* **Visitor mode: not supported**
|
|
105
165
|
*/
|
|
106
166
|
getStorePurchasedItems({ limit, offset, onUpdate }?: {
|
|
107
167
|
limit?: number;
|
|
108
168
|
offset?: number;
|
|
109
169
|
onUpdate?: (data: TStoreItem[]) => void;
|
|
110
170
|
}): Promise<TStoreItem[]>;
|
|
111
|
-
/**
|
|
171
|
+
/**
|
|
172
|
+
* Returns missions & badges categories
|
|
173
|
+
*
|
|
174
|
+
* **Example**:
|
|
175
|
+
* ```
|
|
176
|
+
* _smartico.api.getAchCategories().then((result) => {
|
|
177
|
+
* console.log(result);
|
|
178
|
+
* });
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
181
|
+
* **Example in the Visitor mode**:
|
|
182
|
+
* ```
|
|
183
|
+
* _smartico.vapi('EN').getAchCategories().then((result) => {
|
|
184
|
+
* console.log(result);
|
|
185
|
+
* });
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* */
|
|
112
189
|
getAchCategories(): Promise<TAchCategory[]>;
|
|
113
|
-
/** Returns the list of mini-games available for user
|
|
114
|
-
* The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
115
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback. */
|
|
116
190
|
/**
|
|
191
|
+
* Returns list of custom sections
|
|
192
|
+
*
|
|
193
|
+
* **Example**:
|
|
194
|
+
* ```
|
|
195
|
+
* _smartico.api.getCustomSections().then((result) => {
|
|
196
|
+
* console.log(result);
|
|
197
|
+
* });
|
|
198
|
+
* ```
|
|
199
|
+
*
|
|
200
|
+
* **Example in the Visitor mode**:
|
|
201
|
+
* ```
|
|
202
|
+
* _smartico.vapi('EN').getCustomSections().then((result) => {
|
|
203
|
+
* console.log(result);
|
|
204
|
+
* });
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* */
|
|
208
|
+
getCustomSections(): Promise<TUICustomSection[]>;
|
|
117
209
|
/**
|
|
118
|
-
*
|
|
210
|
+
* Returns the list of mini-games available for user
|
|
211
|
+
* The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
212
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
|
|
213
|
+
*
|
|
214
|
+
* **Example**:
|
|
215
|
+
* ```
|
|
216
|
+
* _smartico.api.getMiniGames().then((result) => {
|
|
217
|
+
* console.log(result);
|
|
218
|
+
* });
|
|
219
|
+
* ```
|
|
220
|
+
*
|
|
221
|
+
* **Example in the Visitor mode**:
|
|
222
|
+
* ```
|
|
223
|
+
* _smartico.vapi('EN').getMiniGames().then((result) => {
|
|
224
|
+
* console.log(result);
|
|
225
|
+
* });
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
119
228
|
*/
|
|
120
229
|
getMiniGames({ onUpdate }?: {
|
|
121
230
|
onUpdate?: (data: TMiniGameTemplate[]) => void;
|
|
122
231
|
}): Promise<TMiniGameTemplate[]>;
|
|
123
|
-
/**
|
|
232
|
+
/**
|
|
233
|
+
* Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
|
|
234
|
+
*
|
|
235
|
+
* **Visitor mode: not supported**
|
|
236
|
+
*/
|
|
124
237
|
playMiniGame(template_id: number): Promise<TMiniGamePlayResult>;
|
|
125
|
-
/**
|
|
238
|
+
/**
|
|
239
|
+
* Requests an opt-in for the specified mission_id. Returns the err_code.
|
|
240
|
+
*
|
|
241
|
+
* **Visitor mode: not supported**
|
|
242
|
+
*/
|
|
126
243
|
requestMissionOptIn(mission_id: number): Promise<TMissionOptInResult>;
|
|
127
|
-
/**
|
|
244
|
+
/**
|
|
245
|
+
* Request for claim reward for the specified mission id. Returns the err_code.
|
|
246
|
+
*
|
|
247
|
+
* **Visitor mode: not supported**
|
|
248
|
+
*/
|
|
128
249
|
requestMissionClaimReward(mission_id: number, ach_completed_id: number): Promise<TMissionClaimRewardResult>;
|
|
129
250
|
/** Returns all the active instances of tournaments
|
|
130
251
|
* The returned list is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getTournamentsList with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
131
|
-
* The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback
|
|
132
|
-
|
|
133
|
-
*
|
|
134
|
-
|
|
252
|
+
* The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback.
|
|
253
|
+
*
|
|
254
|
+
* **Example**:
|
|
255
|
+
* ```
|
|
256
|
+
* _smartico.api.getTournamentsList().then((result) => {
|
|
257
|
+
* console.log(result);
|
|
258
|
+
* });
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* **Example in the Visitor mode**:
|
|
262
|
+
* ```
|
|
263
|
+
* _smartico.vapi('EN').getTournamentsList().then((result) => {
|
|
264
|
+
* console.log(result);
|
|
265
|
+
* });
|
|
266
|
+
* ```
|
|
267
|
+
* */
|
|
135
268
|
getTournamentsList({ onUpdate }?: {
|
|
136
269
|
onUpdate?: (data: TTournament[]) => void;
|
|
137
270
|
}): Promise<TTournament[]>;
|
|
138
|
-
/**
|
|
271
|
+
/**
|
|
272
|
+
* Returns details information of specific tournament instance, the response will include tournament info and the leaderboard of players
|
|
273
|
+
*
|
|
274
|
+
* **Example**:
|
|
275
|
+
* ```
|
|
276
|
+
* _smartico.api.getTournamentsList().then((result) => {
|
|
277
|
+
* if (result.length > 0) {
|
|
278
|
+
* _smartico.api.getTournamentInstanceInfo(result[0].instance_id).then((result) => {
|
|
279
|
+
* console.log(result);
|
|
280
|
+
* });
|
|
281
|
+
* }
|
|
282
|
+
* });
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* **Example in the Visitor mode**:
|
|
286
|
+
* ```
|
|
287
|
+
* _smartico.vapi('EN').getTournamentsList().then((result) => {
|
|
288
|
+
* if (result.length > 0) {
|
|
289
|
+
* _smartico.vapi('EN').getTournamentInstanceInfo(result[0].instance_id).then((result) => {
|
|
290
|
+
* console.log(result);
|
|
291
|
+
* });
|
|
292
|
+
* }
|
|
293
|
+
* });
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
139
296
|
getTournamentInstanceInfo(tournamentInstanceId: number): Promise<TTournamentDetailed>;
|
|
140
|
-
/**
|
|
297
|
+
/**
|
|
298
|
+
* Requests registration for the specified tournament instance. Returns the err_code.
|
|
299
|
+
*
|
|
300
|
+
* **Visitor mode: not supported**
|
|
301
|
+
*/
|
|
141
302
|
registerInTournament(tournamentInstanceId: number): Promise<TTournamentRegistrationResult>;
|
|
142
|
-
/**
|
|
143
|
-
|
|
303
|
+
/**
|
|
304
|
+
* 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.
|
|
305
|
+
* For example, if the type is Weekly and getPreviousPeriod is true, a leaderboard for the previous week will be returned.
|
|
306
|
+
*
|
|
307
|
+
* **Example**:
|
|
308
|
+
* ```
|
|
309
|
+
* _smartico.api.getLeaderBoard(1).then((result) => {
|
|
310
|
+
* console.log(result);
|
|
311
|
+
* });
|
|
312
|
+
* ```
|
|
313
|
+
*
|
|
314
|
+
* **Example in the Visitor mode**:
|
|
315
|
+
* ```
|
|
316
|
+
* _smartico.vapi('EN').getLeaderBoard(1).then((result) => {
|
|
317
|
+
* console.log(result);
|
|
318
|
+
* });
|
|
319
|
+
* ```
|
|
144
320
|
*/
|
|
145
321
|
getLeaderBoard(periodType: LeaderBoardPeriodType, getPreviousPeriod?: boolean): Promise<LeaderBoardDetailsT>;
|
|
146
322
|
/** Returns inbox messages based on the provided parameters. "From" and "to" indicate the range of messages to be fetched.
|
|
@@ -149,8 +325,10 @@ export declare class WSAPI {
|
|
|
149
325
|
* This functions return list of messages without the body of the message.
|
|
150
326
|
* 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.
|
|
151
327
|
* All other action like mark as read, favorite, delete, etc. can be done using this message GUID.
|
|
152
|
-
* 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.
|
|
153
|
-
|
|
328
|
+
* 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.
|
|
329
|
+
*
|
|
330
|
+
* **Visitor mode: not supported**
|
|
331
|
+
*
|
|
154
332
|
* @param params
|
|
155
333
|
*/
|
|
156
334
|
getInboxMessages({ from, to, onlyFavorite, onUpdate }?: {
|
|
@@ -159,19 +337,45 @@ export declare class WSAPI {
|
|
|
159
337
|
onlyFavorite?: boolean;
|
|
160
338
|
onUpdate?: (data: TInboxMessage[]) => void;
|
|
161
339
|
}): Promise<TInboxMessage[]>;
|
|
162
|
-
/**
|
|
340
|
+
/**
|
|
341
|
+
* Returns the message body of the specified message guid.
|
|
342
|
+
*
|
|
343
|
+
* **Visitor mode: not supported**
|
|
344
|
+
*/
|
|
163
345
|
getInboxMessageBody(messageGuid: string): Promise<TInboxMessageBody>;
|
|
164
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* Requests to mark inbox message with specified guid as read
|
|
348
|
+
*
|
|
349
|
+
* **Visitor mode: not supported**
|
|
350
|
+
*/
|
|
165
351
|
markInboxMessageAsRead(messageGuid: string): Promise<InboxMarkMessageAction>;
|
|
166
|
-
/**
|
|
352
|
+
/**
|
|
353
|
+
* Requests to mark all inbox messages as rea
|
|
354
|
+
*
|
|
355
|
+
* **Visitor mode: not supported**
|
|
356
|
+
*/
|
|
167
357
|
markAllInboxMessagesAsRead(): Promise<InboxMarkMessageAction>;
|
|
168
|
-
/**
|
|
358
|
+
/**
|
|
359
|
+
* Requests to mark inbox message with specified guid as favorite. Pass mark true to add message to favorite and false to remove.
|
|
360
|
+
*
|
|
361
|
+
* **Visitor mode: not supported**
|
|
362
|
+
*/
|
|
169
363
|
markUnmarkInboxMessageAsFavorite(messageGuid: string, mark: boolean): Promise<InboxMarkMessageAction>;
|
|
170
|
-
/**
|
|
364
|
+
/**
|
|
365
|
+
* Requests to delete inbox message
|
|
366
|
+
*
|
|
367
|
+
* **Visitor mode: not supported**
|
|
368
|
+
*/
|
|
171
369
|
deleteInboxMessage(messageGuid: string): Promise<InboxMarkMessageAction>;
|
|
172
|
-
/**
|
|
370
|
+
/**
|
|
371
|
+
* Requests to delete all inbox messages
|
|
372
|
+
*
|
|
373
|
+
* **Visitor mode: not supported**
|
|
374
|
+
*/
|
|
173
375
|
deleteAllInboxMessages(): Promise<InboxMarkMessageAction>;
|
|
174
|
-
/**
|
|
376
|
+
/**
|
|
377
|
+
* Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
|
|
378
|
+
*/
|
|
175
379
|
getTranslations(lang_code: string): Promise<TGetTranslations>;
|
|
176
380
|
private updateOnSpin;
|
|
177
381
|
private updateOnAddSpin;
|
|
@@ -185,37 +389,55 @@ export declare class WSAPI {
|
|
|
185
389
|
* If filter is not provided, all active jackpots will be returned.
|
|
186
390
|
* Filter can be used to get jackpots related to specific game or specific jackpot template.
|
|
187
391
|
* 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
|
|
188
|
-
*
|
|
392
|
+
*
|
|
393
|
+
* **Example**:
|
|
189
394
|
* ```
|
|
190
395
|
* _smartico.api.jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
191
396
|
* console.log(result);
|
|
192
397
|
* });
|
|
193
398
|
* ```
|
|
399
|
+
*
|
|
400
|
+
* **Example in the Visitor mode**:
|
|
401
|
+
* ```
|
|
402
|
+
* _smartico.vapi('EN').jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
403
|
+
* console.log(result);
|
|
404
|
+
* });
|
|
405
|
+
* ```
|
|
194
406
|
*/
|
|
195
407
|
jackpotGet(filter?: {
|
|
196
408
|
related_game_id?: string;
|
|
197
409
|
jp_template_id?: number;
|
|
198
410
|
}): Promise<JackpotDetails[]>;
|
|
199
|
-
/**
|
|
411
|
+
/**
|
|
412
|
+
* Opt-in currently logged in user to the jackpot with the specified jp_template_id.
|
|
200
413
|
* You may call jackpotGet method after doing optin to see that user is opted in to the jackpot.
|
|
201
|
-
*
|
|
414
|
+
*
|
|
415
|
+
* **Example**:
|
|
202
416
|
* ```
|
|
203
417
|
* _smartico.api.jackpotOptIn({ jp_template_id: 123 }).then((result) => {
|
|
204
418
|
* console.log('Opted in to the jackpot');
|
|
205
419
|
* });
|
|
206
420
|
* ```
|
|
421
|
+
*
|
|
422
|
+
* **Visitor mode: not supported**
|
|
423
|
+
*
|
|
207
424
|
*/
|
|
208
425
|
jackpotOptIn(filter: {
|
|
209
426
|
jp_template_id: number;
|
|
210
427
|
}): Promise<JackpotsOptinResponse>;
|
|
211
|
-
/**
|
|
428
|
+
/**
|
|
429
|
+
* Opt-out currently logged in user from the jackpot with the specified jp_template_id.
|
|
212
430
|
* You may call jackpotGet method after doing optout to see that user is not opted in to the jackpot.
|
|
213
|
-
*
|
|
431
|
+
*
|
|
432
|
+
* **Example**:
|
|
214
433
|
* ```
|
|
215
434
|
* _smartico.api.jackpotOptOut({ jp_template_id: 123 }).then((result) => {
|
|
216
435
|
* console.log('Opted out from the jackpot');
|
|
217
436
|
* });
|
|
218
437
|
* ```
|
|
438
|
+
*
|
|
439
|
+
* **Visitor mode: not supported**
|
|
440
|
+
*
|
|
219
441
|
*/
|
|
220
442
|
jackpotOptOut(filter: {
|
|
221
443
|
jp_template_id: number;
|