@smartico/public-api 0.0.124 → 0.0.125
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/SmarticoAPI.d.ts +3 -1
- package/dist/Store/GetStoreHistoryRequest.d.ts +2 -2
- package/dist/Store/GetStoreHistoryResponse.d.ts +4 -4
- package/dist/Store/StoreItemPurchased.d.ts +8 -0
- package/dist/Store/index.d.ts +3 -0
- package/dist/WSAPI/WSAPI.d.ts +83 -13
- package/dist/WSAPI/WSAPITypes.d.ts +4 -0
- package/dist/index.js +321 -165
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +132 -16
- package/dist/index.modern.mjs.map +1 -1
- package/docs/classes/WSAPI.md +76 -3
- package/docs/interfaces/TStoreItem.md +16 -0
- package/package.json +1 -1
- package/src/SmarticoAPI.ts +17 -2
- package/src/Store/GetStoreHistoryRequest.ts +2 -2
- package/src/Store/GetStoreHistoryResponse.ts +4 -4
- package/src/Store/StoreItemPurchased.ts +41 -0
- package/src/Store/index.ts +4 -1
- package/src/WSAPI/WSAPI.ts +86 -12
- package/src/WSAPI/WSAPITypes.ts +4 -0
- package/src/Store/StorItemPruchased.ts +0 -8
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { SAWDoAknowledgeResponse, SAWDoSpinResponse } from './MiniGames';
|
|
|
5
5
|
import { GetTranslationsResponse, PublicLabelSettings, ResponseIdentify, TranslationArea } from './Core';
|
|
6
6
|
import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
|
|
7
7
|
import { GetInboxMessagesResponse, InboxMessageBody, MarkInboxMessageDeletedResponse, MarkInboxMessageReadResponse, MarkInboxMessageStarredResponse } from './Inbox';
|
|
8
|
-
import { BuyStoreItemResponse, GetCategoriesStoreResponse, GetStoreItemsResponse } from './Store';
|
|
8
|
+
import { BuyStoreItemResponse, GetCategoriesStoreResponse, GetStoreHistoryResponse, GetStoreItemsResponse } from './Store';
|
|
9
9
|
import { AchClaimPrizeResponse, AchievementOptinResponse, GetAchCategoriesResponse, GetAchievementMapResponse } from './Missions';
|
|
10
10
|
import { GetTournamentInfoResponse, GetTournamentsResponse, TournamentRegisterResponse } from './Tournaments';
|
|
11
11
|
import { LeaderBoardDetails, LeaderBoardPeriodType } from "./Leaderboard";
|
|
@@ -69,6 +69,8 @@ declare class SmarticoAPI {
|
|
|
69
69
|
storeGetItemsT(user_ext_id: string): Promise<TStoreItem[]>;
|
|
70
70
|
storeGetCategories(user_ext_id: string): Promise<GetCategoriesStoreResponse>;
|
|
71
71
|
storeGetCategoriesT(user_ext_id: string): Promise<TStoreCategory[]>;
|
|
72
|
+
storeGetPurchasedItems(user_ext_id: string, limit?: number, offset?: number): Promise<GetStoreHistoryResponse>;
|
|
73
|
+
storeGetPurchasedItemsT(user_ext_id: string, from?: number, to?: number): Promise<TStoreItem[]>;
|
|
72
74
|
missionsGetItems(user_ext_id: string): Promise<GetAchievementMapResponse>;
|
|
73
75
|
missionsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]>;
|
|
74
76
|
getUserGamificationInfo(user_ext_id: string): Promise<GetAchievementsUserInfoResponse>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface GetStoreHistoryResponse extends
|
|
4
|
-
items:
|
|
1
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
2
|
+
import { StoreItemPurchased } from "./StoreItemPurchased";
|
|
3
|
+
export interface GetStoreHistoryResponse extends ProtocolResponse {
|
|
4
|
+
items: StoreItemPurchased[];
|
|
5
5
|
hasMore: boolean;
|
|
6
6
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TStoreItem } from "../WSAPI/WSAPITypes";
|
|
2
|
+
import { StoreItem } from "./StoreItem";
|
|
3
|
+
interface StoreItemPurchased extends StoreItem {
|
|
4
|
+
purchase_ts: number;
|
|
5
|
+
purchase_points_amount: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const StoreItemPurchasedTransform: (items: StoreItemPurchased[]) => TStoreItem[];
|
|
8
|
+
export { StoreItemPurchased };
|
package/dist/Store/index.d.ts
CHANGED
|
@@ -8,3 +8,6 @@ export * from "./StoreCategoryPublicMeta";
|
|
|
8
8
|
export * from "./StoreItem";
|
|
9
9
|
export * from "./StoreItemPublicMeta";
|
|
10
10
|
export * from "./StoreItemType";
|
|
11
|
+
export * from './StoreItemPurchased';
|
|
12
|
+
export * from './GetStoreHistoryRequest';
|
|
13
|
+
export * from './GetStoreHistoryResponse';
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -7,34 +7,104 @@ export declare class WSAPI {
|
|
|
7
7
|
private onUpdateCallback;
|
|
8
8
|
/** @private */
|
|
9
9
|
constructor(api: SmarticoAPI);
|
|
10
|
-
/** Returns information about current user
|
|
10
|
+
/** Returns information about current user
|
|
11
|
+
* Example usage:
|
|
12
|
+
* ```
|
|
13
|
+
* _smartico.api.getUserProfile().then((result) => {
|
|
14
|
+
* console.log(result);
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
* */
|
|
11
18
|
getUserProfile(): TUserProfile;
|
|
12
|
-
/** Check if user belongs to specific segments
|
|
19
|
+
/** Check if user belongs to specific segments
|
|
20
|
+
* Example usage:
|
|
21
|
+
* ```
|
|
22
|
+
* _smartico.api.checkSegmentMatch(1).then((result) => {
|
|
23
|
+
* console.log(result);
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
13
27
|
checkSegmentMatch(segment_id: number): Promise<boolean>;
|
|
14
|
-
/** Check if user belongs to specific list of segments
|
|
28
|
+
/** Check if user belongs to specific list of segments
|
|
29
|
+
* Example usage:
|
|
30
|
+
* ```
|
|
31
|
+
* _smartico.api.checkSegmentListMatch([1, 2, 3]).then((result) => {
|
|
32
|
+
* console.log(result);
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
15
36
|
checkSegmentListMatch(segment_ids: number[]): Promise<TSegmentCheckResult[]>;
|
|
16
|
-
/** Returns all the levels available the current user
|
|
37
|
+
/** Returns all the levels available the current user
|
|
38
|
+
* Example usage:
|
|
39
|
+
* ```
|
|
40
|
+
* _smartico.api.getLevels().then((result) => {
|
|
41
|
+
* console.log(result);
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
17
45
|
getLevels(): Promise<TLevel[]>;
|
|
18
46
|
/** Returns all the missions available the current user.
|
|
19
|
-
* The returned missions
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
47
|
+
* The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
48
|
+
* Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
49
|
+
* The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
|
|
50
|
+
* Example usage:
|
|
51
|
+
* ```
|
|
52
|
+
* _smartico.api.getMissions().then((result) => {
|
|
53
|
+
* console.log(result);
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
/**
|
|
57
|
+
* @param params
|
|
58
|
+
*/
|
|
24
59
|
getMissions({ onUpdate }?: {
|
|
25
60
|
onUpdate?: (data: TMissionOrBadge[]) => void;
|
|
26
61
|
}): Promise<TMissionOrBadge[]>;
|
|
27
62
|
/** Returns all the badges available the current user */
|
|
28
63
|
getBadges(): Promise<TMissionOrBadge[]>;
|
|
29
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Returns the extra counters for the current user level.
|
|
66
|
+
* These are counters that are configured for each Smartico client separatly by request.
|
|
67
|
+
* For example 1st counter could be total wagering amount, 2nd counter could be total deposit amount, etc.
|
|
68
|
+
* Example usage:
|
|
69
|
+
* ```
|
|
70
|
+
* _smartico.api.getUserLevelExtraCounters().then((result) => {
|
|
71
|
+
* console.log(result);
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
30
75
|
getUserLevelExtraCounters(): Promise<UserLevelExtraCountersT>;
|
|
31
|
-
/** Returns all the store items available the current user
|
|
76
|
+
/** Returns all the store items available the current user
|
|
77
|
+
* Example usage:
|
|
78
|
+
* ```
|
|
79
|
+
* _smartico.api.getStoreItems().then((result) => {
|
|
80
|
+
* console.log(result);
|
|
81
|
+
* });
|
|
82
|
+
*/
|
|
32
83
|
getStoreItems(): Promise<TStoreItem[]>;
|
|
33
|
-
/** Buy the specific shop item by item_id. Returns the err_code
|
|
84
|
+
/** Buy the specific shop item by item_id. Returns the err_code in case of success or error.
|
|
85
|
+
* Example usage:
|
|
86
|
+
* ```
|
|
87
|
+
* _smartico.api.buyStoreItem(1).then((result) => {
|
|
88
|
+
* console.log(result);
|
|
89
|
+
* });
|
|
90
|
+
*/
|
|
34
91
|
buyStoreItem(item_id: number): Promise<TBuyStoreItemResult>;
|
|
35
92
|
/** Returns store categories */
|
|
36
93
|
getStoreCategories(): Promise<TStoreCategory[]>;
|
|
37
|
-
/** Returns
|
|
94
|
+
/** Returns store purchased items based on the provided parameters. "From" and "to" indicate the range of items to be fetched.
|
|
95
|
+
* The maximum number of messages per request is limited to 20.
|
|
96
|
+
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
97
|
+
* This functions return list of purchased items.
|
|
98
|
+
* The "onUpdate" callback will be triggered when the user receives a new purchased item. It will provide an updated list of items, ranging from 0 to 20, to the onUpdate callback function. */
|
|
99
|
+
/**
|
|
100
|
+
* @param params
|
|
101
|
+
*/
|
|
102
|
+
storeGetPurchasedItems({ from, to, onUpdate }?: {
|
|
103
|
+
from?: number;
|
|
104
|
+
to?: number;
|
|
105
|
+
onUpdate?: (data: TStoreItem[]) => void;
|
|
106
|
+
}): Promise<TStoreItem[]>;
|
|
107
|
+
/** Returns missions & badges categories */
|
|
38
108
|
getAchCategories(): Promise<TAchCategory[]>;
|
|
39
109
|
/** Returns the list of mini-games available for user
|
|
40
110
|
* 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.
|
|
@@ -328,6 +328,10 @@ export interface TStoreItem {
|
|
|
328
328
|
pool?: number;
|
|
329
329
|
/** The T&C text for the store item */
|
|
330
330
|
hint_text?: string;
|
|
331
|
+
/** Purchase time to show in purchase history screen */
|
|
332
|
+
purchase_ts?: number;
|
|
333
|
+
/** The amount of points you can purchase an item */
|
|
334
|
+
purchase_points_amount?: number;
|
|
331
335
|
}
|
|
332
336
|
/**
|
|
333
337
|
* TAchCategory describes the badge category item. Each badge item can be assigned to 1 or more categories
|