@smartico/public-api 0.0.226 → 0.0.228
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 +4 -2
- package/dist/Raffle/GetRaffleDrawRunsHistoryRequest.d.ts +5 -0
- package/dist/Raffle/GetRaffleDrawRunsHistoryResponse.d.ts +5 -0
- package/dist/Raffle/RaffleDraw.d.ts +31 -1
- package/dist/Raffle/RafflePrize.d.ts +4 -0
- package/dist/Raffle/RafflePrizeWinner.d.ts +2 -1
- package/dist/Raffle/index.d.ts +2 -0
- package/dist/SmarticoAPI.d.ts +4 -1
- package/dist/WSAPI/WSAPI.d.ts +3 -0
- package/dist/index.js +71 -21
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +45 -19
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +3 -0
- package/docs/classes/WSAPI.md +32 -0
- package/docs/interfaces/GetRaffleDrawRunsHistoryRequest.md +49 -0
- package/docs/interfaces/GetRaffleDrawRunsHistoryResponse.md +63 -0
- package/docs/interfaces/RaffleDrawRun.md +61 -0
- package/docs/interfaces/RafflePrize.md +8 -0
- package/docs/interfaces/RafflePrizeWinner.md +6 -0
- package/package.json +1 -1
- package/src/Base/ClassId.ts +4 -3
- package/src/Raffle/GetRaffleDrawRunsHistoryRequest.ts +6 -0
- package/src/Raffle/GetRaffleDrawRunsHistoryResponse.ts +6 -0
- package/src/Raffle/RaffleDraw.ts +39 -1
- package/src/Raffle/RafflePrize.ts +6 -1
- package/src/Raffle/RafflePrizeWinner.ts +7 -6
- package/src/Raffle/index.ts +3 -1
- package/src/SmarticoAPI.ts +52 -18
- package/src/WSAPI/WSAPI.ts +10 -1
- package/dist/Quiz/MarketsAnswersType.d.ts +0 -22
- package/dist/Raffle/GetDrawResponse.d.ts +0 -5
- package/dist/SmarticoPublicAPI.d.ts +0 -23
- package/dist/Store/BuyShopItemErrorCode.d.ts +0 -10
- package/dist/Store/BuyShopItemRequest.d.ts +0 -4
- package/dist/Store/BuyShopItemResponse.d.ts +0 -4
- package/dist/Store/GetCategoriesShopResponse.d.ts +0 -5
- package/dist/Store/GetShopItemsResponse.d.ts +0 -5
- package/dist/Store/ShopCategory.d.ts +0 -5
- package/dist/Store/ShopCategoryPublicMeta.d.ts +0 -4
- package/dist/Store/ShopItem.d.ts +0 -9
- package/dist/Store/ShopItemPublicMeta.d.ts +0 -10
- package/dist/Store/ShopItemType.d.ts +0 -4
- package/dist/Store/StorItemPruchased.d.ts +0 -6
- package/dist/service/index.d.ts +0 -5
- package/dist/service/types/ErrorCodes.d.ts +0 -13
- package/dist/service/types/GRequest.d.ts +0 -16
- package/dist/service/types/GResponse.d.ts +0 -10
- package/dist/service/types/Game/GameAttemptType.d.ts +0 -6
- package/dist/service/types/Game/GameCanPlayType.d.ts +0 -10
- package/dist/service/types/Game/GameExternalStatus.d.ts +0 -6
- package/dist/service/types/Game/GameInfo.d.ts +0 -9
- package/dist/service/types/Game/GamePick.d.ts +0 -90
- package/dist/service/types/Game/GameUtil.d.ts +0 -7
- package/dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts +0 -7
- package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +0 -7
- package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +0 -5
- package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +0 -6
- package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +0 -5
- package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +0 -34
- package/dist/service/types/SmarticoProto/PublicProperties.d.ts +0 -11
- package/dist/service/types/SmarticoProto/ResponseIdentify.d.ts +0 -12
- package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +0 -5
- package/dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts +0 -5
- package/dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts +0 -5
- package/dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts +0 -15
- package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +0 -10
- package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts +0 -3
- package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts +0 -5
- package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +0 -11
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +0 -8
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +0 -13
- package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +0 -21
- package/dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts +0 -31
- package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +0 -12
- package/dist/service/types/SmarticoProto/TranslationArea.d.ts +0 -9
- package/dist/service/types/User/UserInfo.d.ts +0 -10
- package/dist/util/Util.d.ts +0 -51
package/docs/README.md
CHANGED
|
@@ -33,10 +33,13 @@
|
|
|
33
33
|
- [JackpotsOptoutResponse](interfaces/JackpotsOptoutResponse.md)
|
|
34
34
|
- [GetDrawRunRequest](interfaces/GetDrawRunRequest.md)
|
|
35
35
|
- [GetDrawRunResponse](interfaces/GetDrawRunResponse.md)
|
|
36
|
+
- [GetRaffleDrawRunsHistoryRequest](interfaces/GetRaffleDrawRunsHistoryRequest.md)
|
|
37
|
+
- [GetRaffleDrawRunsHistoryResponse](interfaces/GetRaffleDrawRunsHistoryResponse.md)
|
|
36
38
|
- [GetRafflesRequest](interfaces/GetRafflesRequest.md)
|
|
37
39
|
- [GetRafflesResponse](interfaces/GetRafflesResponse.md)
|
|
38
40
|
- [Raffle](interfaces/Raffle.md)
|
|
39
41
|
- [RaffleDraw](interfaces/RaffleDraw.md)
|
|
42
|
+
- [RaffleDrawRun](interfaces/RaffleDrawRun.md)
|
|
40
43
|
- [RafflePrize](interfaces/RafflePrize.md)
|
|
41
44
|
- [RafflePrizeWinner](interfaces/RafflePrizeWinner.md)
|
|
42
45
|
- [RaffleTicket](interfaces/RaffleTicket.md)
|
package/docs/classes/WSAPI.md
CHANGED
|
@@ -997,3 +997,35 @@ ___
|
|
|
997
997
|
#### Returns
|
|
998
998
|
|
|
999
999
|
`Promise`\<[`GetRafflesResponse`](../interfaces/GetRafflesResponse.md)\>
|
|
1000
|
+
|
|
1001
|
+
___
|
|
1002
|
+
|
|
1003
|
+
### getDrawRun
|
|
1004
|
+
|
|
1005
|
+
▸ **getDrawRun**(`payload`): `Promise`\<[`GetDrawRunResponse`](../interfaces/GetDrawRunResponse.md)\>
|
|
1006
|
+
|
|
1007
|
+
#### Parameters
|
|
1008
|
+
|
|
1009
|
+
| Name | Type |
|
|
1010
|
+
| :------ | :------ |
|
|
1011
|
+
| `payload` | [`GetDrawRunRequest`](../interfaces/GetDrawRunRequest.md) |
|
|
1012
|
+
|
|
1013
|
+
#### Returns
|
|
1014
|
+
|
|
1015
|
+
`Promise`\<[`GetDrawRunResponse`](../interfaces/GetDrawRunResponse.md)\>
|
|
1016
|
+
|
|
1017
|
+
___
|
|
1018
|
+
|
|
1019
|
+
### getRaffleDrawRunsHistory
|
|
1020
|
+
|
|
1021
|
+
▸ **getRaffleDrawRunsHistory**(`payload`): `Promise`\<[`GetRaffleDrawRunsHistoryResponse`](../interfaces/GetRaffleDrawRunsHistoryResponse.md)\>
|
|
1022
|
+
|
|
1023
|
+
#### Parameters
|
|
1024
|
+
|
|
1025
|
+
| Name | Type |
|
|
1026
|
+
| :------ | :------ |
|
|
1027
|
+
| `payload` | [`GetRaffleDrawRunsHistoryRequest`](../interfaces/GetRaffleDrawRunsHistoryRequest.md) |
|
|
1028
|
+
|
|
1029
|
+
#### Returns
|
|
1030
|
+
|
|
1031
|
+
`Promise`\<[`GetRaffleDrawRunsHistoryResponse`](../interfaces/GetRaffleDrawRunsHistoryResponse.md)\>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Interface: GetRaffleDrawRunsHistoryRequest
|
|
2
|
+
|
|
3
|
+
## Hierarchy
|
|
4
|
+
|
|
5
|
+
- `ProtocolMessage`
|
|
6
|
+
|
|
7
|
+
↳ **`GetRaffleDrawRunsHistoryRequest`**
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### cid
|
|
12
|
+
|
|
13
|
+
• **cid**: `number`
|
|
14
|
+
|
|
15
|
+
#### Inherited from
|
|
16
|
+
|
|
17
|
+
ProtocolMessage.cid
|
|
18
|
+
|
|
19
|
+
___
|
|
20
|
+
|
|
21
|
+
### ts
|
|
22
|
+
|
|
23
|
+
• `Optional` **ts**: `number`
|
|
24
|
+
|
|
25
|
+
#### Inherited from
|
|
26
|
+
|
|
27
|
+
ProtocolMessage.ts
|
|
28
|
+
|
|
29
|
+
___
|
|
30
|
+
|
|
31
|
+
### uuid
|
|
32
|
+
|
|
33
|
+
• `Optional` **uuid**: `string`
|
|
34
|
+
|
|
35
|
+
#### Inherited from
|
|
36
|
+
|
|
37
|
+
ProtocolMessage.uuid
|
|
38
|
+
|
|
39
|
+
___
|
|
40
|
+
|
|
41
|
+
### raffle\_id
|
|
42
|
+
|
|
43
|
+
• **raffle\_id**: `number`
|
|
44
|
+
|
|
45
|
+
___
|
|
46
|
+
|
|
47
|
+
### draw\_id
|
|
48
|
+
|
|
49
|
+
• **draw\_id**: `number`
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Interface: GetRaffleDrawRunsHistoryResponse
|
|
2
|
+
|
|
3
|
+
## Hierarchy
|
|
4
|
+
|
|
5
|
+
- `ProtocolResponse`
|
|
6
|
+
|
|
7
|
+
↳ **`GetRaffleDrawRunsHistoryResponse`**
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### cid
|
|
12
|
+
|
|
13
|
+
• **cid**: `number`
|
|
14
|
+
|
|
15
|
+
#### Inherited from
|
|
16
|
+
|
|
17
|
+
ProtocolResponse.cid
|
|
18
|
+
|
|
19
|
+
___
|
|
20
|
+
|
|
21
|
+
### ts
|
|
22
|
+
|
|
23
|
+
• `Optional` **ts**: `number`
|
|
24
|
+
|
|
25
|
+
#### Inherited from
|
|
26
|
+
|
|
27
|
+
ProtocolResponse.ts
|
|
28
|
+
|
|
29
|
+
___
|
|
30
|
+
|
|
31
|
+
### uuid
|
|
32
|
+
|
|
33
|
+
• `Optional` **uuid**: `string`
|
|
34
|
+
|
|
35
|
+
#### Inherited from
|
|
36
|
+
|
|
37
|
+
ProtocolResponse.uuid
|
|
38
|
+
|
|
39
|
+
___
|
|
40
|
+
|
|
41
|
+
### errCode
|
|
42
|
+
|
|
43
|
+
• `Optional` **errCode**: `number`
|
|
44
|
+
|
|
45
|
+
#### Inherited from
|
|
46
|
+
|
|
47
|
+
ProtocolResponse.errCode
|
|
48
|
+
|
|
49
|
+
___
|
|
50
|
+
|
|
51
|
+
### errMsg
|
|
52
|
+
|
|
53
|
+
• `Optional` **errMsg**: `string`
|
|
54
|
+
|
|
55
|
+
#### Inherited from
|
|
56
|
+
|
|
57
|
+
ProtocolResponse.errMsg
|
|
58
|
+
|
|
59
|
+
___
|
|
60
|
+
|
|
61
|
+
### draw\_runs
|
|
62
|
+
|
|
63
|
+
• **draw\_runs**: [`RaffleDrawRun`](RaffleDrawRun.md)[]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Interface: RaffleDrawRun
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
### draw\_id
|
|
6
|
+
|
|
7
|
+
• **draw\_id**: `number`
|
|
8
|
+
|
|
9
|
+
Id of the Draw definition, for the repetative draws (e.g. daily), this number will be the same for all draws that are repeating daily
|
|
10
|
+
(internal name: schedule_id)
|
|
11
|
+
|
|
12
|
+
___
|
|
13
|
+
|
|
14
|
+
### run\_id
|
|
15
|
+
|
|
16
|
+
• **run\_id**: `number`
|
|
17
|
+
|
|
18
|
+
Field indicates the ID of the latest instance/run of draw
|
|
19
|
+
|
|
20
|
+
___
|
|
21
|
+
|
|
22
|
+
### public\_meta
|
|
23
|
+
|
|
24
|
+
• **public\_meta**: `RaffleDrawPublicMeta`
|
|
25
|
+
|
|
26
|
+
Meta information of the Draw for the presentaiton in UI
|
|
27
|
+
|
|
28
|
+
___
|
|
29
|
+
|
|
30
|
+
### execution\_ts
|
|
31
|
+
|
|
32
|
+
• **execution\_ts**: `number`
|
|
33
|
+
|
|
34
|
+
Date/time of the draw execution
|
|
35
|
+
|
|
36
|
+
___
|
|
37
|
+
|
|
38
|
+
### ticket\_start\_date
|
|
39
|
+
|
|
40
|
+
• **ticket\_start\_date**: `number`
|
|
41
|
+
|
|
42
|
+
Date/time starting from which the tickets will participate in the upcoming draw
|
|
43
|
+
This value need to be taken into account with next_execute_ts field value, for example
|
|
44
|
+
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
|
|
45
|
+
(internally this value is calculated as next_execute_ts - ticket_start_date)
|
|
46
|
+
|
|
47
|
+
___
|
|
48
|
+
|
|
49
|
+
### is\_winner
|
|
50
|
+
|
|
51
|
+
• **is\_winner**: `boolean`
|
|
52
|
+
|
|
53
|
+
Shows if user has won a prize in a current run
|
|
54
|
+
|
|
55
|
+
___
|
|
56
|
+
|
|
57
|
+
### has\_unclaimed\_prize
|
|
58
|
+
|
|
59
|
+
• **has\_unclaimed\_prize**: `boolean`
|
|
60
|
+
|
|
61
|
+
Shows if user has unclaimed prize
|
|
@@ -132,6 +132,14 @@ the stock_items_per_draw will be decreasing by 1 each day (assuming there is eno
|
|
|
132
132
|
|
|
133
133
|
___
|
|
134
134
|
|
|
135
|
+
### is\_claimed
|
|
136
|
+
|
|
137
|
+
• **is\_claimed**: `boolean`
|
|
138
|
+
|
|
139
|
+
Shows if the prize has been claimed
|
|
140
|
+
|
|
141
|
+
___
|
|
142
|
+
|
|
135
143
|
### winners
|
|
136
144
|
|
|
137
145
|
• **winners**: [`RafflePrizeWinner`](RafflePrizeWinner.md)[]
|
package/package.json
CHANGED
package/src/Base/ClassId.ts
CHANGED
|
@@ -151,9 +151,10 @@ export enum ClassId {
|
|
|
151
151
|
|
|
152
152
|
RAF_GET_RAFFLES_REQUEST = 902,
|
|
153
153
|
RAF_GET_RAFFLES_RESPONSE = 903,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
RAF_GET_DRAW_RUN_REQUEST = 904,
|
|
155
|
+
RAF_GET_DRAW_RUN_RESPONSE = 905,
|
|
156
|
+
RAF_GET_DRAW_HISTORY_REQUEST = 906,
|
|
157
|
+
RAF_GET_DRAW_HISTORY_RESPONSE = 907,
|
|
157
158
|
/*
|
|
158
159
|
RAF_GET_TICKETS_REQUEST = 902,
|
|
159
160
|
RAF_GET_TICKETS_RESPONSE = 903,
|
package/src/Raffle/RaffleDraw.ts
CHANGED
|
@@ -113,7 +113,45 @@ interface RaffleDraw {
|
|
|
113
113
|
* List of last 5 tickets are collected by current user for this instance of draw.
|
|
114
114
|
*/
|
|
115
115
|
my_last_tickets: RaffleTicket[];
|
|
116
|
+
|
|
116
117
|
}
|
|
117
118
|
|
|
119
|
+
interface RaffleDrawRun {
|
|
120
|
+
/**
|
|
121
|
+
* Id of the Draw definition, for the repetative draws (e.g. daily), this number will be the same for all draws that are repeating daily
|
|
122
|
+
* (internal name: schedule_id)
|
|
123
|
+
*/
|
|
124
|
+
draw_id: number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Field indicates the ID of the latest instance/run of draw
|
|
128
|
+
*/
|
|
129
|
+
run_id: number;
|
|
130
|
+
|
|
131
|
+
/** Meta information of the Draw for the presentaiton in UI */
|
|
132
|
+
public_meta: RaffleDrawPublicMeta;
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
/** Date/time of the draw execution */
|
|
136
|
+
execution_ts: number;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Date/time starting from which the tickets will participate in the upcoming draw
|
|
140
|
+
* This value need to be taken into account with next_execute_ts field value, for example
|
|
141
|
+
* 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
|
|
142
|
+
* (internally this value is calculated as next_execute_ts - ticket_start_date)
|
|
143
|
+
*/
|
|
144
|
+
ticket_start_date: number;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Shows if user has won a prize in a current run
|
|
148
|
+
*/
|
|
149
|
+
is_winner: boolean;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Shows if user has unclaimed prize
|
|
153
|
+
*/
|
|
154
|
+
has_unclaimed_prize: boolean;
|
|
155
|
+
}
|
|
118
156
|
|
|
119
|
-
export { RaffleDraw }
|
|
157
|
+
export { RaffleDraw, RaffleDrawRun };
|
|
@@ -111,7 +111,12 @@ interface RafflePrize {
|
|
|
111
111
|
*/
|
|
112
112
|
stock_items_per_draw?: number;
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Shows if the prize has been claimed
|
|
116
|
+
*/
|
|
117
|
+
is_claimed: boolean;
|
|
118
|
+
|
|
119
|
+
winners: RafflePrizeWinner[];
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
export { RafflePrize }
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { RaffleTicket } from
|
|
1
|
+
import { RaffleTicket } from './RaffleTicket';
|
|
2
2
|
|
|
3
3
|
interface RafflePrizeWinner {
|
|
4
|
-
|
|
5
|
-
public_username?: string;
|
|
4
|
+
user_id: number;
|
|
5
|
+
public_username?: string;
|
|
6
6
|
avatar_id: string;
|
|
7
|
-
avatar_url?: string;
|
|
8
|
-
|
|
7
|
+
avatar_url?: string;
|
|
8
|
+
ticket: RaffleTicket;
|
|
9
|
+
won_ids: number[];
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export { RafflePrizeWinner }
|
|
12
|
+
export { RafflePrizeWinner }
|
package/src/Raffle/index.ts
CHANGED
|
@@ -6,4 +6,6 @@ export * from './Raffle';
|
|
|
6
6
|
export * from './RaffleDraw';
|
|
7
7
|
export * from './RafflePrize';
|
|
8
8
|
export * from './RafflePrizeWinner';
|
|
9
|
-
export * from './RaffleTicket';
|
|
9
|
+
export * from './RaffleTicket';
|
|
10
|
+
export * from './GetRaffleDrawRunsHistoryRequest';
|
|
11
|
+
export * from './GetRaffleDrawRunsHistoryResponse';
|
package/src/SmarticoAPI.ts
CHANGED
|
@@ -124,6 +124,7 @@ import { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse'
|
|
|
124
124
|
import { GetRafflesResponse } from './Raffle/GetRafflesResponse';
|
|
125
125
|
import { GetRafflesRequest } from './Raffle/GetRafflesRequest';
|
|
126
126
|
import { InboxCategories } from './Inbox/InboxCategories';
|
|
127
|
+
import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse } from './Raffle';
|
|
127
128
|
|
|
128
129
|
const PUBLIC_API_URL = 'https://papi{ENV_ID}.smartico.ai/services/public';
|
|
129
130
|
const C_SOCKET_PROD = 'wss://api{ENV_ID}.smartico.ai/websocket/services';
|
|
@@ -190,28 +191,38 @@ class SmarticoAPI {
|
|
|
190
191
|
return ENV_ID;
|
|
191
192
|
}
|
|
192
193
|
|
|
193
|
-
private
|
|
194
|
+
private static replaceSmrDomainsWithCloudfront<T>(value: string | {[key: string]: any}): T {
|
|
195
|
+
if (!value) {
|
|
196
|
+
return value as T;
|
|
197
|
+
}
|
|
198
|
+
|
|
194
199
|
const domains = {
|
|
195
|
-
'
|
|
200
|
+
'img.smr.vc': 'd1am61onjxtys8.cloudfront.net',
|
|
201
|
+
'img3.smr.vc': 'd3dubbodzd2q05.cloudfront.net',
|
|
196
202
|
'img4.smr.vc': 'dvm0p9vsezqr2.cloudfront.net',
|
|
197
|
-
|
|
203
|
+
'img5.smr.vc': 'd3gen1ksvxhac8.cloudfront.net',
|
|
204
|
+
'img6.smr.vc': 'db1kmyg7iufeo.cloudfront.net',
|
|
198
205
|
|
|
199
|
-
|
|
206
|
+
'static.smr.vc': 'dtt380pweilws.cloudfront.net',
|
|
207
|
+
'static3.smr.vc': 'd1qt8ake8g4imn.cloudfront.net',
|
|
208
|
+
'static4.smr.vc': 'd146b4m7rkvjkw.cloudfront.net',
|
|
209
|
+
'static5.smr.vc': 'd121pfj16xdfcq.cloudfront.net',
|
|
210
|
+
'static6.smr.vc': 'd21deilz814qgl.cloudfront.net',
|
|
211
|
+
}
|
|
200
212
|
|
|
201
|
-
const
|
|
213
|
+
const escapeRegExp = (str: string) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
202
214
|
|
|
203
|
-
|
|
204
|
-
const stringified = JSON.stringify(newObject);
|
|
215
|
+
let replacedValue = typeof value === 'string' ? value : JSON.stringify(value);
|
|
205
216
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
newObject = JSON.parse(replacedString);
|
|
209
|
-
} catch (error) {
|
|
210
|
-
console.error(error)
|
|
211
|
-
}
|
|
217
|
+
for (const [oldDomain, newDomain] of Object.entries(domains)) {
|
|
218
|
+
replacedValue = replacedValue.replace(new RegExp(escapeRegExp(oldDomain), 'g'), newDomain);
|
|
212
219
|
}
|
|
213
220
|
|
|
214
|
-
|
|
221
|
+
try {
|
|
222
|
+
return typeof value === 'string' ? replacedValue as T : JSON.parse(replacedValue)
|
|
223
|
+
} catch (err) {
|
|
224
|
+
return value as T;
|
|
225
|
+
}
|
|
215
226
|
}
|
|
216
227
|
|
|
217
228
|
public static getEnvId(label_api_key: string): number {
|
|
@@ -232,10 +243,12 @@ class SmarticoAPI {
|
|
|
232
243
|
|
|
233
244
|
public static getAvatarUrl(label_api_key: string): string {
|
|
234
245
|
const envId = SmarticoAPI.getEnvDnsSuffix(label_api_key);
|
|
246
|
+
const avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
247
|
+
|
|
235
248
|
if (envId === '4') {
|
|
236
|
-
return
|
|
249
|
+
return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
|
|
237
250
|
} else {
|
|
238
|
-
return
|
|
251
|
+
return avatarUrl;
|
|
239
252
|
}
|
|
240
253
|
}
|
|
241
254
|
|
|
@@ -255,8 +268,8 @@ class SmarticoAPI {
|
|
|
255
268
|
result = await this.messageSender(message, this.publicUrl, expectCID);
|
|
256
269
|
const timeEnd = new Date().getTime();
|
|
257
270
|
|
|
258
|
-
if (this.label_api_key
|
|
259
|
-
result =
|
|
271
|
+
if (SmarticoAPI.getEnvDnsSuffix(this.label_api_key) === 'a6e7ac26-c368-4892-9380-96e7ff82cf3e-4' && result) {
|
|
272
|
+
result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
|
|
260
273
|
}
|
|
261
274
|
|
|
262
275
|
if (this.logHTTPTiming) {
|
|
@@ -1154,6 +1167,27 @@ class SmarticoAPI {
|
|
|
1154
1167
|
|
|
1155
1168
|
return await this.send<GetRafflesResponse>(message, ClassId.RAF_GET_RAFFLES_RESPONSE);
|
|
1156
1169
|
}
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
public async getDrawRun(user_ext_id: string, payload: GetDrawRunRequest): Promise<GetDrawRunResponse> {
|
|
1173
|
+
const message = this.buildMessage<GetDrawRunRequest, GetDrawRunResponse>(
|
|
1174
|
+
user_ext_id,
|
|
1175
|
+
ClassId.RAF_GET_DRAW_RUN_REQUEST ,
|
|
1176
|
+
payload,
|
|
1177
|
+
);
|
|
1178
|
+
|
|
1179
|
+
return await this.send<GetDrawRunResponse>(message, ClassId.RAF_GET_DRAW_RUN_RESPONSE);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
public async getRaffleDrawRunsHistory(user_ext_id: string, payload: GetRaffleDrawRunsHistoryRequest): Promise<GetRaffleDrawRunsHistoryResponse> {
|
|
1183
|
+
const message = this.buildMessage<GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse>(
|
|
1184
|
+
user_ext_id,
|
|
1185
|
+
ClassId.RAF_GET_DRAW_HISTORY_REQUEST ,
|
|
1186
|
+
payload,
|
|
1187
|
+
);
|
|
1188
|
+
|
|
1189
|
+
return await this.send<GetRaffleDrawRunsHistoryResponse>(message, ClassId.RAF_GET_DRAW_HISTORY_RESPONSE);
|
|
1190
|
+
}
|
|
1157
1191
|
}
|
|
1158
1192
|
|
|
1159
1193
|
export { SmarticoAPI, MessageSender };
|
package/src/WSAPI/WSAPI.ts
CHANGED
|
@@ -53,6 +53,7 @@ import { GetAchievementMapResponse } from '../Missions';
|
|
|
53
53
|
import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
|
|
54
54
|
import { GetRafflesResponse } from '../Raffle/GetRafflesResponse';
|
|
55
55
|
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
56
|
+
import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse } from 'src/Raffle';
|
|
56
57
|
|
|
57
58
|
/** @hidden */
|
|
58
59
|
const CACHE_DATA_SEC = 30;
|
|
@@ -1050,5 +1051,13 @@ export class WSAPI {
|
|
|
1050
1051
|
|
|
1051
1052
|
public async getRaffles(): Promise<GetRafflesResponse> {
|
|
1052
1053
|
return await this.api.getRaffles(null);
|
|
1053
|
-
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
public async getDrawRun(payload: GetDrawRunRequest): Promise<GetDrawRunResponse>{
|
|
1057
|
+
return await this.api.getDrawRun(null, payload);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
public async getRaffleDrawRunsHistory(payload: GetRaffleDrawRunsHistoryRequest): Promise<GetRaffleDrawRunsHistoryResponse>{
|
|
1061
|
+
return await this.api.getRaffleDrawRunsHistory(null, payload);
|
|
1062
|
+
}
|
|
1054
1063
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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 };
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/Store/ShopItem.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/service/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
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, };
|