@smartico/public-api 0.0.237 → 0.0.239
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 +2 -0
- package/dist/CustomSections/UICustomSection.d.ts +2 -1
- package/dist/Raffle/RaffleClaimPrizeRequest.d.ts +4 -0
- package/dist/Raffle/RaffleClaimPrizeResponse.d.ts +3 -0
- package/dist/Raffle/index.d.ts +2 -0
- package/dist/WSAPI/WSAPITypes.d.ts +2 -0
- package/dist/index.js +29 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +29 -18
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +2 -0
- package/docs/interfaces/RaffleClaimPrizeRequest.md +43 -0
- package/docs/interfaces/RaffleClaimPrizeResponse.md +57 -0
- package/package.json +1 -1
- package/src/Base/ClassId.ts +2 -0
- package/src/CustomSections/UICustomSection.ts +16 -6
- package/src/Raffle/GetRaffleDrawRunsHistoryRequest.ts +1 -1
- package/src/Raffle/RaffleClaimPrizeRequest.ts +5 -0
- package/src/Raffle/RaffleClaimPrizeResponse.ts +3 -0
- package/src/Raffle/index.ts +2 -0
- package/src/SmarticoAPI.ts +5 -4
- package/src/WSAPI/WSAPITypes.ts +2 -0
package/docs/README.md
CHANGED
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
- [GetRafflesRequest](interfaces/GetRafflesRequest.md)
|
|
39
39
|
- [GetRafflesResponse](interfaces/GetRafflesResponse.md)
|
|
40
40
|
- [Raffle](interfaces/Raffle.md)
|
|
41
|
+
- [RaffleClaimPrizeRequest](interfaces/RaffleClaimPrizeRequest.md)
|
|
42
|
+
- [RaffleClaimPrizeResponse](interfaces/RaffleClaimPrizeResponse.md)
|
|
41
43
|
- [RaffleDraw](interfaces/RaffleDraw.md)
|
|
42
44
|
- [RaffleDrawRun](interfaces/RaffleDrawRun.md)
|
|
43
45
|
- [RafflePrize](interfaces/RafflePrize.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Interface: RaffleClaimPrizeRequest
|
|
2
|
+
|
|
3
|
+
## Hierarchy
|
|
4
|
+
|
|
5
|
+
- `ProtocolMessage`
|
|
6
|
+
|
|
7
|
+
↳ **`RaffleClaimPrizeRequest`**
|
|
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
|
+
### won\_id
|
|
42
|
+
|
|
43
|
+
• **won\_id**: `number`
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Interface: RaffleClaimPrizeResponse
|
|
2
|
+
|
|
3
|
+
## Hierarchy
|
|
4
|
+
|
|
5
|
+
- `ProtocolResponse`
|
|
6
|
+
|
|
7
|
+
↳ **`RaffleClaimPrizeResponse`**
|
|
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
|
package/package.json
CHANGED
package/src/Base/ClassId.ts
CHANGED
|
@@ -155,6 +155,8 @@ export enum ClassId {
|
|
|
155
155
|
RAF_GET_DRAW_RUN_RESPONSE = 905,
|
|
156
156
|
RAF_GET_DRAW_HISTORY_REQUEST = 906,
|
|
157
157
|
RAF_GET_DRAW_HISTORY_RESPONSE = 907,
|
|
158
|
+
RAF_CLAIM_PRIZE_REQUEST = 908,
|
|
159
|
+
RAF_CLAIM_PRIZE_RESPONSE = 909,
|
|
158
160
|
/*
|
|
159
161
|
RAF_GET_TICKETS_REQUEST = 902,
|
|
160
162
|
RAF_GET_TICKETS_RESPONSE = 903,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
AchMissionsTabsOptions,
|
|
6
6
|
AchOverviewMissionsFilter,
|
|
7
7
|
} from './AchCustomSection';
|
|
8
|
+
import { GetCustomSectionsResponse } from './GetCustomSectionsResponse';
|
|
8
9
|
|
|
9
10
|
export interface UICustomSection {
|
|
10
11
|
body?: string;
|
|
@@ -19,11 +20,16 @@ export interface UICustomSection {
|
|
|
19
20
|
overview_missions_count?: number;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
export const UICustomSectionTransform = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export const UICustomSectionTransform = (response: GetCustomSectionsResponse): TUICustomSection[] => {
|
|
24
|
+
|
|
25
|
+
const items: TUICustomSection[] = [];
|
|
26
|
+
|
|
27
|
+
Object.keys(response.customSections).forEach((key: string) => {
|
|
28
|
+
const r = response.customSections[key];
|
|
29
|
+
const id = parseInt(key);
|
|
30
|
+
if (r.section_type_id !== undefined && r.section_type_id >= 1) {
|
|
26
31
|
const x: TUICustomSection = {
|
|
32
|
+
id: id,
|
|
27
33
|
body: r.body,
|
|
28
34
|
menu_img: r.menu_img,
|
|
29
35
|
menu_name: r.menu_name,
|
|
@@ -35,6 +41,10 @@ export const UICustomSectionTransform = (items: UICustomSection[]): TUICustomSec
|
|
|
35
41
|
overview_missions_filter: r.overview_missions_filter,
|
|
36
42
|
theme: r.theme,
|
|
37
43
|
};
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
|
|
45
|
+
items.push(x);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return items;
|
|
40
50
|
};
|
|
@@ -2,7 +2,7 @@ import { ProtocolMessage } from "../Base/ProtocolMessage";
|
|
|
2
2
|
|
|
3
3
|
export interface GetRaffleDrawRunsHistoryRequest extends ProtocolMessage {
|
|
4
4
|
raffle_id: number;
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
/**
|
|
7
7
|
* If draw_id is not passed all draw runs that belong to raffle with passed raffle_id will be returned.
|
|
8
8
|
*/
|
package/src/Raffle/index.ts
CHANGED
|
@@ -10,3 +10,5 @@ export * from './RafflePrizeWinner';
|
|
|
10
10
|
export * from './RaffleTicket';
|
|
11
11
|
export * from './GetRaffleDrawRunsHistoryRequest';
|
|
12
12
|
export * from './GetRaffleDrawRunsHistoryResponse';
|
|
13
|
+
export * from './RaffleClaimPrizeRequest';
|
|
14
|
+
export * from './RaffleClaimPrizeResponse';
|
package/src/SmarticoAPI.ts
CHANGED
|
@@ -244,8 +244,8 @@ class SmarticoAPI {
|
|
|
244
244
|
public static getAvatarUrl(label_api_key: string): string {
|
|
245
245
|
const envId = SmarticoAPI.getEnvDnsSuffix(label_api_key);
|
|
246
246
|
const avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
247
|
-
|
|
248
|
-
if (envId
|
|
247
|
+
const envs = ['4', '5', '6', '7'];
|
|
248
|
+
if (envs.includes(envId)) {
|
|
249
249
|
return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
|
|
250
250
|
} else {
|
|
251
251
|
return avatarUrl;
|
|
@@ -267,8 +267,9 @@ class SmarticoAPI {
|
|
|
267
267
|
const timeStart = new Date().getTime();
|
|
268
268
|
result = await this.messageSender(message, this.publicUrl, expectCID);
|
|
269
269
|
const timeEnd = new Date().getTime();
|
|
270
|
+
const envs = ['4', '5', '6', '7'];
|
|
270
271
|
|
|
271
|
-
if (SmarticoAPI.getEnvDnsSuffix(this.label_api_key)
|
|
272
|
+
if (envs.includes(SmarticoAPI.getEnvDnsSuffix(this.label_api_key)) && result) {
|
|
272
273
|
result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
|
|
273
274
|
}
|
|
274
275
|
|
|
@@ -1001,7 +1002,7 @@ class SmarticoAPI {
|
|
|
1001
1002
|
}
|
|
1002
1003
|
|
|
1003
1004
|
public async getCustomSectionsT(user_ext_id: string): Promise<TUICustomSection[]> {
|
|
1004
|
-
return UICustomSectionTransform(
|
|
1005
|
+
return UICustomSectionTransform(await this.getCustomSections(user_ext_id));
|
|
1005
1006
|
}
|
|
1006
1007
|
|
|
1007
1008
|
public async getTranslationsT(
|
package/src/WSAPI/WSAPITypes.ts
CHANGED