@smartico/public-api 0.0.121 → 0.0.123
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/ClassId.d.ts +15 -0
- package/dist/Core/CheckSegmentMatchRequest.d.ts +4 -0
- package/dist/Core/CheckSegmentMatchResponse.d.ts +7 -0
- package/dist/Jackpots/GetJackpotsPotsRequest.d.ts +4 -0
- package/dist/Jackpots/GetJackpotsPotsResponse.d.ts +5 -0
- package/dist/Jackpots/GetJackpotsRequest.d.ts +4 -0
- package/dist/Jackpots/GetJackpotsResponse.d.ts +5 -0
- package/dist/Jackpots/JackpotContributionType.d.ts +5 -0
- package/dist/Jackpots/JackpotDetails.d.ts +17 -0
- package/dist/Jackpots/JackpotPot.d.ts +7 -0
- package/dist/Jackpots/JackpotPublicMeta.d.ts +6 -0
- package/dist/Jackpots/JackpotType.d.ts +4 -0
- package/dist/Jackpots/JackpotsOptinRequest.d.ts +4 -0
- package/dist/Jackpots/JackpotsOptinResponse.d.ts +3 -0
- package/dist/Jackpots/JackpotsOptoutRequest.d.ts +4 -0
- package/dist/Jackpots/JackpotsOptoutResponse.d.ts +3 -0
- package/dist/MiniGames/SAWGameType.d.ts +3 -1
- package/dist/MiniGames/SAWPrizeDropAknowledgeRequest.d.ts +4 -0
- package/dist/MiniGames/SAWPrizeDropAknowledgeResponse.d.ts +4 -0
- package/dist/MiniGames/SAWPrizeDropWinPush.d.ts +9 -0
- package/dist/Missions/AchClaimPrizeResponse.d.ts +2 -2
- package/dist/Missions/index.d.ts +2 -0
- package/dist/Quiz/MarketsAnswersType.d.ts +22 -0
- package/dist/Quiz/MarketsInfo.d.ts +2 -1
- package/dist/Quiz/index.d.ts +1 -0
- package/dist/SmarticoAPI.d.ts +4 -2
- package/dist/Store/GetStoreHistoryRequest.d.ts +5 -0
- package/dist/Store/GetStoreHistoryResponse.d.ts +6 -0
- package/dist/Store/StorItemPruchased.d.ts +6 -0
- package/dist/WSAPI/WSAPI.d.ts +7 -1
- package/dist/WSAPI/WSAPITypes.d.ts +19 -0
- package/dist/index.js +562 -198
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +352 -13
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +2 -0
- package/docs/classes/WSAPI.md +55 -0
- package/docs/enums/SAWGameTypeName.md +6 -0
- package/docs/interfaces/TMiniGamePrize.md +9 -1
- package/docs/interfaces/TMiniGameTemplate.md +1 -1
- package/docs/interfaces/TMissionClaimRewardResult.md +19 -0
- package/docs/interfaces/TMissionOrBadge.md +32 -0
- package/docs/interfaces/TSegmentCheckResult.md +13 -0
- package/package.json +1 -1
- package/src/Base/ClassId.ts +24 -0
- package/src/Core/CheckSegmentMatchRequest.ts +6 -0
- package/src/Core/CheckSegmentMatchResponse.ts +8 -0
- package/src/Jackpots/GetJackpotsPotsRequest.ts +5 -0
- package/src/Jackpots/GetJackpotsPotsResponse.ts +8 -0
- package/src/Jackpots/GetJackpotsRequest.ts +7 -0
- package/src/Jackpots/GetJackpotsResponse.ts +9 -0
- package/src/Jackpots/JackpotContributionType.ts +7 -0
- package/src/Jackpots/JackpotDetails.ts +20 -0
- package/src/Jackpots/JackpotPot.ts +10 -0
- package/src/Jackpots/JackpotPublicMeta.ts +8 -0
- package/src/Jackpots/JackpotType.ts +8 -0
- package/src/Jackpots/JackpotsOptinRequest.ts +7 -0
- package/src/Jackpots/JackpotsOptinResponse.ts +5 -0
- package/src/Jackpots/JackpotsOptoutRequest.ts +7 -0
- package/src/Jackpots/JackpotsOptoutResponse.ts +5 -0
- package/src/Jackpots/jackpotsWSApi.zip +0 -0
- package/src/MiniGames/SAWGameType.ts +5 -2
- package/src/MiniGames/SAWPrizeDropAknowledgeRequest.ts +5 -0
- package/src/MiniGames/SAWPrizeDropAknowledgeResponse.ts +5 -0
- package/src/MiniGames/SAWPrizeDropWinPush.ts +10 -0
- package/src/Missions/AchClaimPrizeResponse.ts +2 -3
- package/src/Missions/UserAchievement.ts +3 -0
- package/src/Missions/index.ts +3 -1
- package/src/Quiz/MarketsAnswersType.ts +22 -0
- package/src/Quiz/MarketsInfo.ts +185 -8
- package/src/Quiz/index.ts +2 -1
- package/src/SmarticoAPI.ts +32 -2
- package/src/Store/GetStoreHistoryRequest.ts +6 -0
- package/src/Store/GetStoreHistoryResponse.ts +7 -0
- package/src/Store/StorItemPruchased.ts +8 -0
- package/src/WSAPI/WSAPI.ts +30 -1
- package/src/WSAPI/WSAPITypes.ts +24 -0
package/docs/README.md
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
- [AchRelatedGame](interfaces/AchRelatedGame.md)
|
|
27
27
|
- [TMissionOrBadgeTask](interfaces/TMissionOrBadgeTask.md)
|
|
28
28
|
- [TMissionOptInResult](interfaces/TMissionOptInResult.md)
|
|
29
|
+
- [TMissionClaimRewardResult](interfaces/TMissionClaimRewardResult.md)
|
|
29
30
|
- [TTournamentRegistrationResult](interfaces/TTournamentRegistrationResult.md)
|
|
30
31
|
- [TBuyStoreItemResult](interfaces/TBuyStoreItemResult.md)
|
|
31
32
|
- [TGetTranslations](interfaces/TGetTranslations.md)
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
- [LeaderBoardsRewardsT](interfaces/LeaderBoardsRewardsT.md)
|
|
37
38
|
- [LeaderBoardUserT](interfaces/LeaderBoardUserT.md)
|
|
38
39
|
- [UserLevelExtraCountersT](interfaces/UserLevelExtraCountersT.md)
|
|
40
|
+
- [TSegmentCheckResult](interfaces/TSegmentCheckResult.md)
|
|
39
41
|
|
|
40
42
|
## General API
|
|
41
43
|
|
package/docs/classes/WSAPI.md
CHANGED
|
@@ -14,6 +14,42 @@ Returns information about current user
|
|
|
14
14
|
|
|
15
15
|
___
|
|
16
16
|
|
|
17
|
+
### checkSegmentMatch
|
|
18
|
+
|
|
19
|
+
▸ **checkSegmentMatch**(`segment_id`): `Promise`<`boolean`\>
|
|
20
|
+
|
|
21
|
+
Check if user belongs to specific segments
|
|
22
|
+
|
|
23
|
+
#### Parameters
|
|
24
|
+
|
|
25
|
+
| Name | Type |
|
|
26
|
+
| :------ | :------ |
|
|
27
|
+
| `segment_id` | `number` |
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`Promise`<`boolean`\>
|
|
32
|
+
|
|
33
|
+
___
|
|
34
|
+
|
|
35
|
+
### checkSegmentListMatch
|
|
36
|
+
|
|
37
|
+
▸ **checkSegmentListMatch**(`segment_ids`): `Promise`<[`TSegmentCheckResult`](../interfaces/TSegmentCheckResult.md)[]\>
|
|
38
|
+
|
|
39
|
+
Check if user belongs to specific list of segments
|
|
40
|
+
|
|
41
|
+
#### Parameters
|
|
42
|
+
|
|
43
|
+
| Name | Type |
|
|
44
|
+
| :------ | :------ |
|
|
45
|
+
| `segment_ids` | `number`[] |
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`Promise`<[`TSegmentCheckResult`](../interfaces/TSegmentCheckResult.md)[]\>
|
|
50
|
+
|
|
51
|
+
___
|
|
52
|
+
|
|
17
53
|
### getLevels
|
|
18
54
|
|
|
19
55
|
▸ **getLevels**(): `Promise`<[`TLevel`](../interfaces/TLevel.md)[]\>
|
|
@@ -177,6 +213,25 @@ Requests an opt-in for the specified mission_id. Returns the err_code.
|
|
|
177
213
|
|
|
178
214
|
___
|
|
179
215
|
|
|
216
|
+
### requestMissionClaimReward
|
|
217
|
+
|
|
218
|
+
▸ **requestMissionClaimReward**(`mission_id`, `ach_completed_id`): `Promise`<[`TMissionClaimRewardResult`](../interfaces/TMissionClaimRewardResult.md)\>
|
|
219
|
+
|
|
220
|
+
Request for claim reward for the specified mission id. Returns the err_code.
|
|
221
|
+
|
|
222
|
+
#### Parameters
|
|
223
|
+
|
|
224
|
+
| Name | Type |
|
|
225
|
+
| :------ | :------ |
|
|
226
|
+
| `mission_id` | `number` |
|
|
227
|
+
| `ach_completed_id` | `number` |
|
|
228
|
+
|
|
229
|
+
#### Returns
|
|
230
|
+
|
|
231
|
+
`Promise`<[`TMissionClaimRewardResult`](../interfaces/TMissionClaimRewardResult.md)\>
|
|
232
|
+
|
|
233
|
+
___
|
|
234
|
+
|
|
180
235
|
### getTournamentsList
|
|
181
236
|
|
|
182
237
|
▸ **getTournamentsList**(`params?`): `Promise`<[`TTournament`](../interfaces/TTournament.md)[]\>
|
|
@@ -40,7 +40,15 @@ ___
|
|
|
40
40
|
|
|
41
41
|
• `Optional` **font\_size**: `number`
|
|
42
42
|
|
|
43
|
-
Custom font size for the prize
|
|
43
|
+
Custom font size for the prize (desktop)
|
|
44
|
+
|
|
45
|
+
___
|
|
46
|
+
|
|
47
|
+
### font\_size\_mobile
|
|
48
|
+
|
|
49
|
+
• `Optional` **font\_size\_mobile**: `number`
|
|
50
|
+
|
|
51
|
+
Custom font size for the prize (mobile)
|
|
44
52
|
|
|
45
53
|
___
|
|
46
54
|
|
|
@@ -136,7 +136,7 @@ ___
|
|
|
136
136
|
|
|
137
137
|
• **custom\_data**: `any`
|
|
138
138
|
|
|
139
|
-
The custom data of the mini-game defined by operator. Can be a JSON object, string or number
|
|
139
|
+
The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number
|
|
140
140
|
|
|
141
141
|
___
|
|
142
142
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: TMissionClaimRewardResult
|
|
2
|
+
|
|
3
|
+
TMissionClaimRewardResult describes the response of call to _smartico.api.requestMissionClaimReward(mission_id, ach_completed_id) method
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### err\_code
|
|
8
|
+
|
|
9
|
+
• **err\_code**: `number`
|
|
10
|
+
|
|
11
|
+
Error code that represents outcome of the claim request. Successful claim reward in case err_code is 0
|
|
12
|
+
|
|
13
|
+
___
|
|
14
|
+
|
|
15
|
+
### err\_message
|
|
16
|
+
|
|
17
|
+
• **err\_message**: `string`
|
|
18
|
+
|
|
19
|
+
Optional error message
|
|
@@ -197,3 +197,35 @@ ___
|
|
|
197
197
|
• `Optional` **position**: `number`
|
|
198
198
|
|
|
199
199
|
Priority (or position) of the mission in the UI. Low value indicates higher position in the UI
|
|
200
|
+
|
|
201
|
+
___
|
|
202
|
+
|
|
203
|
+
### ribbon
|
|
204
|
+
|
|
205
|
+
• `Optional` **ribbon**: `string`
|
|
206
|
+
|
|
207
|
+
The ribbon of the mission/badge item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon
|
|
208
|
+
|
|
209
|
+
___
|
|
210
|
+
|
|
211
|
+
### ach\_completed\_id
|
|
212
|
+
|
|
213
|
+
• `Optional` **ach\_completed\_id**: `number`
|
|
214
|
+
|
|
215
|
+
ID of the completion fact from ach_completed or ach_completed_recurring tables
|
|
216
|
+
|
|
217
|
+
___
|
|
218
|
+
|
|
219
|
+
### requires\_prize\_claim
|
|
220
|
+
|
|
221
|
+
• `Optional` **requires\_prize\_claim**: `boolean`
|
|
222
|
+
|
|
223
|
+
Flag from achievement if the mission prize will be given only after user claims it
|
|
224
|
+
|
|
225
|
+
___
|
|
226
|
+
|
|
227
|
+
### prize\_claimed\_date\_ts
|
|
228
|
+
|
|
229
|
+
• `Optional` **prize\_claimed\_date\_ts**: `number`
|
|
230
|
+
|
|
231
|
+
The date/timestamp indicating when the prize was claimed by the user
|
package/package.json
CHANGED
package/src/Base/ClassId.ts
CHANGED
|
@@ -33,6 +33,9 @@ export enum ClassId {
|
|
|
33
33
|
CLIENT_SET_CUSTOM_USERNAME_REQUEST = 159,
|
|
34
34
|
CLIENT_SET_CUSTOM_USERNAME_RESPONSE = 160,
|
|
35
35
|
|
|
36
|
+
CHECK_SEGMENT_MATCH_REQUEST = 161,
|
|
37
|
+
CHECK_SEGMENT_MATCH_RESPONSE = 162,
|
|
38
|
+
|
|
36
39
|
// 500-1000 - Achievements
|
|
37
40
|
GET_LEVEL_MAP_REQUEST = 500,
|
|
38
41
|
GET_LEVEL_MAP_RESPONSE = 501,
|
|
@@ -78,6 +81,9 @@ export enum ClassId {
|
|
|
78
81
|
ACHIEVEMENT_CLAIM_PRIZE_REQUEST = 539,
|
|
79
82
|
ACHIEVEMENT_CLAIM_PRIZE_RESPONSE = 540,
|
|
80
83
|
|
|
84
|
+
ACH_SHOP_ITEM_HISTORY_REQUEST = 541,
|
|
85
|
+
ACH_SHOP_ITEM_HISTORY_RESPONSE = 542,
|
|
86
|
+
|
|
81
87
|
GET_BONUSES_REQUEST = 600,
|
|
82
88
|
GET_BONUSES_RESPONSE = 601,
|
|
83
89
|
CLAIM_BONUS_REQUEST = 602,
|
|
@@ -91,6 +97,24 @@ export enum ClassId {
|
|
|
91
97
|
SAW_AKNOWLEDGE_RESPONSE = 705,
|
|
92
98
|
SAW_SPINS_COUNT_PUSH = 706,
|
|
93
99
|
SAW_SHOW_SPIN_PUSH = 707,
|
|
100
|
+
SAW_PRIZE_DROP_WIN_PUSH = 708,
|
|
101
|
+
SAW_PRIZE_DROP_WIN_AKNOWLEDGE_REQUEST = 709,
|
|
102
|
+
SAW_PRIZE_DROP_WIN_AKNOWLEDGE_RESPONSE = 710,
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
JP_GET_JACKPOTS_REQUEST = 800,
|
|
106
|
+
JP_GET_JACKPOTS_RESPONSE = 801,
|
|
107
|
+
|
|
108
|
+
JP_GET_LATEST_POTS_REQUEST = 802,
|
|
109
|
+
JP_GET_LATEST_POTS_RESPONSE = 803,
|
|
110
|
+
|
|
111
|
+
JP_OPTIN_REQUEST = 804,
|
|
112
|
+
JP_OPTIN_RESPONSE = 805,
|
|
113
|
+
|
|
114
|
+
JP_OPTOUT_REQUEST = 806,
|
|
115
|
+
JP_OPTOUT_RESPONSE = 807,
|
|
116
|
+
|
|
117
|
+
// JP_WIN_PUSH = 808,
|
|
94
118
|
|
|
95
119
|
REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
|
|
96
120
|
REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AchRelatedGame } from "../Base/AchRelatedGame";
|
|
2
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
3
|
+
import { JackpotDetails } from "./JackpotDetails";
|
|
4
|
+
|
|
5
|
+
export interface GetJackpotsResponse extends ProtocolResponse {
|
|
6
|
+
|
|
7
|
+
jackpots: JackpotDetails[];
|
|
8
|
+
}
|
|
9
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AchRelatedGame } from "../Base/AchRelatedGame";
|
|
2
|
+
import { JackpotContributionType } from "./JackpotContributionType";
|
|
3
|
+
import { JackpotPot } from "./JackpotPot";
|
|
4
|
+
import { JackpotPublicMeta } from "./JackpotPublicMeta";
|
|
5
|
+
import { JackpotType } from "./JackpotType";
|
|
6
|
+
|
|
7
|
+
interface JackpotDetails {
|
|
8
|
+
jp_template_id: number;
|
|
9
|
+
jp_type_id: JackpotType;
|
|
10
|
+
jp_public_meta: JackpotPublicMeta;
|
|
11
|
+
jp_currency: string;
|
|
12
|
+
related_games?: AchRelatedGame[];
|
|
13
|
+
contribution_type: JackpotContributionType;
|
|
14
|
+
contribution_value: number;
|
|
15
|
+
pot: JackpotPot;
|
|
16
|
+
is_opted_in: boolean;
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { JackpotDetails }
|
|
Binary file
|
|
@@ -4,7 +4,8 @@ export enum SAWGameType {
|
|
|
4
4
|
SpinAWheel = 1,
|
|
5
5
|
ScratchCard = 2,
|
|
6
6
|
MatchX = 3,
|
|
7
|
-
GiftBox = 4
|
|
7
|
+
GiftBox = 4,
|
|
8
|
+
PrizeDrop = 5
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export enum SAWGameTypeName {
|
|
@@ -12,6 +13,7 @@ export enum SAWGameTypeName {
|
|
|
12
13
|
ScratchCard = "scratch",
|
|
13
14
|
MatchX = "matchx",
|
|
14
15
|
GiftBox = "giftbox",
|
|
16
|
+
PrizeDrop = "prizedrop",
|
|
15
17
|
Unknown = "unknown"
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -21,6 +23,7 @@ export const SAWGameTypeNamed = (type: SAWGameType): SAWGameTypeName => {
|
|
|
21
23
|
[SAWGameType.SpinAWheel]: SAWGameTypeName.SpinAWheel,
|
|
22
24
|
[SAWGameType.ScratchCard]: SAWGameTypeName.ScratchCard,
|
|
23
25
|
[SAWGameType.MatchX]: SAWGameTypeName.MatchX,
|
|
24
|
-
[SAWGameType.GiftBox]: SAWGameTypeName.GiftBox
|
|
26
|
+
[SAWGameType.GiftBox]: SAWGameTypeName.GiftBox,
|
|
27
|
+
[SAWGameType.PrizeDrop]: SAWGameTypeName.PrizeDrop
|
|
25
28
|
}[type] || SAWGameTypeName.Unknown;
|
|
26
29
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProtocolMessage } from ".././Base/ProtocolMessage";
|
|
2
|
+
import { SAWPrize } from "./SAWPrize";
|
|
3
|
+
import { SAWTemplate } from "./SAWTemplate";
|
|
4
|
+
|
|
5
|
+
export interface SAWPrizeDropWinPush extends ProtocolMessage {
|
|
6
|
+
request_id: string; // guid
|
|
7
|
+
saw_template_id: number;
|
|
8
|
+
saw_prize: SAWPrize;
|
|
9
|
+
saw_template: SAWTemplate;
|
|
10
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface AchClaimPrizeRequest extends ProtocolMessage {
|
|
1
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
2
|
+
export interface AchClaimPrizeResponse extends ProtocolResponse {
|
|
4
3
|
|
|
5
4
|
// no details here, just check for errCode and reload list of missions
|
|
6
5
|
}
|
|
@@ -86,6 +86,9 @@ export const UserAchievementTransform = (items: UserAchievement[]): TMissionOrBa
|
|
|
86
86
|
},
|
|
87
87
|
})),
|
|
88
88
|
category_ids: r.ach_categories ?? [],
|
|
89
|
+
ach_completed_id: r.ach_completed_id,
|
|
90
|
+
requires_prize_claim: r.requires_prize_claim,
|
|
91
|
+
prize_claimed_date_ts: r.prize_claimed_date_ts,
|
|
89
92
|
}
|
|
90
93
|
return x;
|
|
91
94
|
});
|
package/src/Missions/index.ts
CHANGED
|
@@ -14,4 +14,6 @@ export * from "./ScheduledMissionType";
|
|
|
14
14
|
export * from './AchCategoryPublicMeta';
|
|
15
15
|
export * from './AchievementCategory';
|
|
16
16
|
export * from './GetAchCategoriesResponse';
|
|
17
|
-
export * from './GetAchCategoriesRequest';
|
|
17
|
+
export * from './GetAchCategoriesRequest';
|
|
18
|
+
export * from './AchClaimPrizeRequest';
|
|
19
|
+
export * from './AchClaimPrizeResponse'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export 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
|
+
}
|